home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume27 / ytalk-3.0 / patch02 / patch_02
Text File  |  1993-11-20  |  12KB  |  512 lines

  1. *** 3.0.1/README    Tue Aug 24 16:42:58 1993
  2. --- README    Sat Nov 20 23:11:16 1993
  3. ***************
  4. *** 45,50 ****
  5. --- 45,60 ----
  6.   
  7.       ytalk@austin.eds.com
  8.   
  9. + ---- PATCH LEVEL 02
  10. +   1. Remove #elif directive, patch by Pete Wenzel.
  11. +   2. Recognize if party is refusing messages, thanks to J. Adam Hawkes.
  12. +   3. Linux support, thanks to Thilo Wunderlich.
  13. +   4. Port to AIX 3.1+.
  14. +   5. Add -s option to start in a shell, thanks to Mark Musone.
  15. +   6. Fix various error messages.
  16. +   7. Fix possible obscure bug in socket.c.
  17.   ---- PATCH LEVEL 01
  18.   
  19.     1. Forcibly reset the scrolling region after a shell exits.
  20. *** 3.0.1/ytalk.1    Tue Aug 24 16:42:58 1993
  21. --- ytalk.1    Sat Nov 20 23:53:25 1993
  22. ***************
  23. *** 8,20 ****
  24.   \fB\\$1\fR
  25.   .PP
  26.   ..
  27. ! .TH YTalk 1 "24 Jun 1993"
  28.   .SH NAME
  29.   ytalk - A multi-user chat program. 
  30.   .SH SYNOPSIS
  31. ! .B ytalk [-x] username...
  32.   .SH DESCRIPTION
  33. ! .I YTalk V3.0 Patch Level 1
  34.   .PP
  35.   YTalk is in essence a multi-user chat program.  It works almost exactly like
  36.   the UNIX talk program and even communicates with the same talk daemon(s), but
  37. --- 8,20 ----
  38.   \fB\\$1\fR
  39.   .PP
  40.   ..
  41. ! .TH YTalk 1 "20 Nov 1993"
  42.   .SH NAME
  43.   ytalk - A multi-user chat program. 
  44.   .SH SYNOPSIS
  45. ! .B ytalk [-x] [-s] username...
  46.   .SH DESCRIPTION
  47. ! .I YTalk V3.0 Patch Level 2
  48.   .PP
  49.   YTalk is in essence a multi-user chat program.  It works almost exactly like
  50.   the UNIX talk program and even communicates with the same talk daemon(s), but
  51. ***************
  52. *** 42,47 ****
  53. --- 42,49 ----
  54.   .PP
  55.   The -x option disables the X11 interface (described below).
  56.   .PP
  57. + The -s option starts your YTalk window in a shell.
  58. + .PP
  59.   For each user on the command line, YTalk will attempt to connect to the talk
  60.   daemon on the specified user's host and determine if that user has left an
  61.   invitation for you to call.  If not, YTalk leaves an invitation for him
  62. ***************
  63. *** 307,318 ****
  64.   .SH FUTURE WORK
  65.   Work is being done on the following ideas:
  66.   .sp
  67. -     1) private conversations which do not get interrupted 
  68.   .br
  69. !         or transmitted to all YTalk connections,
  70.   .br
  71. !     2) a dedicated YTalk daemon.
  72.   
  73.   .SH FILES
  74.   
  75.   /usr/local/etc/ytalkrc
  76. --- 309,321 ----
  77.   .SH FUTURE WORK
  78.   Work is being done on the following ideas:
  79.   .sp
  80.   .br
  81. !     1) a dedicated YTalk daemon.
  82.   .br
  83. !     2) MBCS/NLS support.
  84. ! .br
  85.   
  86.   .SH FILES
  87.   
  88.   /usr/local/etc/ytalkrc
  89. ***************
  90. *** 342,353 ****
  91.   .PP
  92.   Thanks to Magnus Hammerin for Solaris 2.* support.
  93.   .PP
  94.   Thanks to Jonas Yngvesson for aside messages in X.
  95.   .PP
  96.   Thanks to Andreas Stolcke for fixing the X resource database calls.
  97.   .PP
  98.   Thanks to John Vanderpool, Shih-Chen Huang, Andrew Myers, Duncan Sinclair,
  99. ! Evan McLean, and Larry Schwimmer for comments and ideas.
  100.   .PP
  101.   The README file shipped with ytalk gives detailed attributions.
  102.   
  103. --- 345,361 ----
  104.   .PP
  105.   Thanks to Magnus Hammerin for Solaris 2.* support.
  106.   .PP
  107. + Thanks to Thilo Wunderlich for Linux support.
  108. + .PP
  109.   Thanks to Jonas Yngvesson for aside messages in X.
  110.   .PP
  111.   Thanks to Andreas Stolcke for fixing the X resource database calls.
  112.   .PP
  113. + Thanks to Pete Wenzel for fixing the #elif directive.
  114. + .PP
  115.   Thanks to John Vanderpool, Shih-Chen Huang, Andrew Myers, Duncan Sinclair,
  116. ! Evan McLean, Larry Schwimmer, J. Adam Hawkes, and Mark Musone for comments
  117. ! and ideas.
  118.   .PP
  119.   The README file shipped with ytalk gives detailed attributions.
  120.   
  121. *** 3.0.1/header.h    Tue Aug 24 16:42:58 1993
  122. --- header.h    Fri Aug 27 13:49:21 1993
  123. ***************
  124. *** 17,23 ****
  125.   /* Mail comments or questions to ytalk@austin.eds.com */
  126.   
  127.   #include <sys/types.h>
  128. ! #include <sys/param.h>
  129.   #include <sys/socket.h>
  130.   #include <netinet/in.h>
  131.   #include <errno.h>
  132. --- 17,27 ----
  133.   /* Mail comments or questions to ytalk@austin.eds.com */
  134.   
  135.   #include <sys/types.h>
  136. ! #ifdef LINUX
  137. ! # include <linux/param.h>
  138. ! #else
  139. ! # include <sys/param.h>
  140. ! #endif
  141.   #include <sys/socket.h>
  142.   #include <netinet/in.h>
  143.   #include <errno.h>
  144. ***************
  145. *** 30,36 ****
  146.   
  147.   #define VMAJOR    3    /* major version number */
  148.   #define VMINOR    0    /* minor version number */
  149. ! #define VPATCH    1    /* patch level */
  150.   
  151.   /* ---- YTalk protocols ---- */
  152.   
  153. --- 34,40 ----
  154.   
  155.   #define VMAJOR    3    /* major version number */
  156.   #define VMINOR    0    /* minor version number */
  157. ! #define VPATCH    2    /* patch level */
  158.   
  159.   /* ---- YTalk protocols ---- */
  160.   
  161. *** 3.0.1/main.c    Tue Aug 24 16:42:58 1993
  162. --- main.c    Tue Nov  2 11:37:07 1993
  163. ***************
  164. *** 134,140 ****
  165.     int argc;
  166.     char **argv;
  167.   {
  168. !     int xflg = 0;
  169.       char *prog;
  170.   
  171.       /* check for a 64-bit mis-compile */
  172. --- 134,140 ----
  173.     int argc;
  174.     char **argv;
  175.   {
  176. !     int xflg = 0, sflg = 0;
  177.       char *prog;
  178.   
  179.       /* check for a 64-bit mis-compile */
  180. ***************
  181. *** 178,183 ****
  182. --- 178,188 ----
  183.           xflg++;    /* disable X from the command line */
  184.           argv++, argc--;
  185.       }
  186. +     else if(strcmp(*argv, "-s") == 0)
  187. +     {
  188. +         sflg++;    /* immediately start a shell */
  189. +         argv++, argc--;
  190. +     }
  191.       else
  192.           argc = 0;    /* force a Usage error */
  193.       }
  194. ***************
  195. *** 213,219 ****
  196.       init_socket();
  197.       for(; argc > 0; argc--, argv++)
  198.       invite(*argv, 1);
  199. !     msg_term(me, "Waiting for connection...");
  200.       main_loop();
  201.       bail(YTE_SUCCESS);
  202.   
  203. --- 218,227 ----
  204.       init_socket();
  205.       for(; argc > 0; argc--, argv++)
  206.       invite(*argv, 1);
  207. !     if(sflg)
  208. !     execute(NULL);
  209. !     else
  210. !     msg_term(me, "Waiting for connection...");
  211.       main_loop();
  212.       bail(YTE_SUCCESS);
  213.   
  214. *** 3.0.1/comm.c    Tue Aug 24 16:42:58 1993
  215. --- comm.c    Thu Nov 18 18:13:20 1993
  216. ***************
  217. *** 157,163 ****
  218.       if((host_addr = get_host_addr(host)) == (ylong)-1)
  219.       {
  220.       errno = 0;
  221. !     sprintf(errstr, "unknown host: '%s'\n", host);
  222.       show_error(errstr);
  223.       show_error("port from ytalk V2.? failed");
  224.       return;
  225. --- 157,163 ----
  226.       if((host_addr = get_host_addr(host)) == (ylong)-1)
  227.       {
  228.       errno = 0;
  229. !     sprintf(errstr, "unknown host: '%s'", host);
  230.       show_error(errstr);
  231.       show_error("port from ytalk V2.? failed");
  232.       return;
  233. ***************
  234. *** 748,756 ****
  235.       return -1;
  236.   
  237.       errno = 0;
  238. !     if(send_dgram(user, ANNOUNCE) != 0)
  239. !     return -1;
  240. !     return 0;
  241.   }
  242.   
  243.   /* ---- global functions ---- */
  244. --- 748,758 ----
  245.       return -1;
  246.   
  247.       errno = 0;
  248. !     if((rc = send_dgram(user, ANNOUNCE)) == 0)
  249. !     return 0;
  250. !     if(rc == 4)    /* mesg n (refusing messages) */
  251. !     return 1;
  252. !     return -1;
  253.   }
  254.   
  255.   /* ---- global functions ---- */
  256. ***************
  257. *** 833,842 ****
  258.       }
  259.       (void)send_dgram(user, LEAVE_INVITE);
  260.       user->last_invite = (ylong)time(NULL);
  261. !     if(send_announce && announce(user) < 0)
  262.       {
  263.       (void)send_dgram(user, DELETE_INVITE);
  264. !     sprintf(errstr, "%s not logged in", user->full_name);
  265.       show_error(errstr);
  266.       free_user(user);
  267.       return;
  268. --- 835,847 ----
  269.       }
  270.       (void)send_dgram(user, LEAVE_INVITE);
  271.       user->last_invite = (ylong)time(NULL);
  272. !     if(send_announce && (rc = announce(user)) != 0)
  273.       {
  274.       (void)send_dgram(user, DELETE_INVITE);
  275. !     if(rc > 0)
  276. !         sprintf(errstr, "%s refusing messages", user->full_name);
  277. !     else
  278. !         sprintf(errstr, "%s not logged in", user->full_name);
  279.       show_error(errstr);
  280.       free_user(user);
  281.       return;
  282. ***************
  283. *** 853,859 ****
  284.       ylong t;
  285.       static char estr[80];
  286.       static ylong last_auto = 0;
  287. !     int answer;
  288.   
  289.       t = (ylong)time(NULL);
  290.   
  291. --- 858,864 ----
  292.       ylong t;
  293.       static char estr[80];
  294.       static ylong last_auto = 0;
  295. !     int answer, rc;
  296.   
  297.       t = (ylong)time(NULL);
  298.   
  299. ***************
  300. *** 884,893 ****
  301.           if(answer == 'n')
  302.               continue;
  303.           }
  304. !         if(announce(u) < 0)
  305.           {
  306.           (void)send_dgram(u, DELETE_INVITE);
  307. !         sprintf(errstr, "%s not logged in", u->full_name);
  308.           show_error(errstr);
  309.           free_user(u);
  310.           }
  311. --- 889,901 ----
  312.           if(answer == 'n')
  313.               continue;
  314.           }
  315. !         if((rc = announce(u)) != 0)
  316.           {
  317.           (void)send_dgram(u, DELETE_INVITE);
  318. !         if(rc > 0)
  319. !             sprintf(errstr, "%s refusing messages", u->full_name);
  320. !         else
  321. !             sprintf(errstr, "%s not logged in", u->full_name);
  322.           show_error(errstr);
  323.           free_user(u);
  324.           }
  325. *** 3.0.1/fd.c    Tue Aug 24 16:42:58 1993
  326. --- fd.c    Thu Aug 26 09:19:05 1993
  327. ***************
  328. *** 130,137 ****
  329.   
  330.   #if defined(SIGCHLD)
  331.       signal(SIGCHLD, SIG_IGN);
  332. ! #elif defined(SIGCLD)
  333.       signal(SIGCLD, SIG_IGN);
  334.   #endif
  335.   
  336.       /* For housecleaning to occur every CLEAN_INTERVAL seconds, we make
  337. --- 130,139 ----
  338.   
  339.   #if defined(SIGCHLD)
  340.       signal(SIGCHLD, SIG_IGN);
  341. ! #else
  342. ! # if defined(SIGCLD)
  343.       signal(SIGCLD, SIG_IGN);
  344. + # endif
  345.   #endif
  346.   
  347.       /* For housecleaning to occur every CLEAN_INTERVAL seconds, we make
  348. *** 3.0.1/exec.c    Tue Aug 24 16:42:59 1993
  349. --- exec.c    Fri Sep 17 18:21:58 1993
  350. ***************
  351. *** 55,60 ****
  352. --- 55,76 ----
  353.     char *name;
  354.   {
  355.       register int pty, tty;
  356. +     char *pty_dev = "/dev/ptc", *tt;
  357. +     extern char *ttyname();
  358. +     /* first look for a SYSV-type pseudo device */
  359. +     if((pty = open(pty_dev, O_RDWR)) >= 0)
  360. +     {
  361. +     if((tt = ttyname(pty)) != NULL)
  362. +     {
  363. +         strcpy(name, tt);
  364. +         return pty;
  365. +     }
  366. +     close(pty);
  367. +     }
  368. +     /* scan Berkeley-style */
  369.   
  370.       strcpy(name, "/dev/ptyp0");
  371.       while(access(name, 0) == 0)
  372. *** 3.0.1/socket.c    Tue Aug 24 16:42:59 1993
  373. --- socket.c    Sat Nov 20 23:09:26 1993
  374. ***************
  375. *** 653,659 ****
  376. --- 653,663 ----
  377.       nmsg.addr = user->sock;
  378.       nmsg.addr.sin_family = htons(AF_INET);
  379.       if(sendit(addr, d) != 0)
  380. +     {
  381. +     if(type == AUTO_LOOK_UP || type == AUTO_DELETE)
  382. +         strncpy(nmsg.l_name, me->user_name, NAME_SIZE);
  383.       return -2;
  384. +     }
  385.   
  386.       switch(type)
  387.       {
  388. ***************
  389. *** 830,840 ****
  390.       ylong addr;
  391.       ylong inet_addr();
  392.   
  393.       if((host = (struct hostent *) gethostbyname(hostname)) != NULL)
  394.       {
  395.       if(host->h_length != sizeof(addr))
  396.       {
  397. !         sprintf(errstr, "Bad IN addr: %s\n", hostname);
  398.           show_error(errstr);
  399.           return (ylong)-1;
  400.       }
  401. --- 834,845 ----
  402.       ylong addr;
  403.       ylong inet_addr();
  404.   
  405. +     errno = 0;
  406.       if((host = (struct hostent *) gethostbyname(hostname)) != NULL)
  407.       {
  408.       if(host->h_length != sizeof(addr))
  409.       {
  410. !         sprintf(errstr, "Bad IN addr: %s", hostname);
  411.           show_error(errstr);
  412.           return (ylong)-1;
  413.       }
  414. ***************
  415. *** 878,896 ****
  416.   
  417.       if((from_addr = get_host_addr(from_id)) == (ylong)-1)
  418.       {
  419. !     sprintf(errstr, "Unknown host: '%s'\n", from_id);
  420.       show_error(errstr);
  421.       return;
  422.       }
  423.       if((to_addr = get_host_addr(to_id)) == (ylong)-1)
  424.       {
  425. !     sprintf(errstr, "Unknown host: '%s'\n", to_id);
  426.       show_error(errstr);
  427.       return;
  428.       }
  429.       if((on_addr = get_host_addr(on_id)) == (ylong)-1)
  430.       {
  431. !     sprintf(errstr, "Unknown host: '%s'\n", on_id);
  432.       show_error(errstr);
  433.       return;
  434.       }
  435. --- 883,901 ----
  436.   
  437.       if((from_addr = get_host_addr(from_id)) == (ylong)-1)
  438.       {
  439. !     sprintf(errstr, "Unknown host: '%s'", from_id);
  440.       show_error(errstr);
  441.       return;
  442.       }
  443.       if((to_addr = get_host_addr(to_id)) == (ylong)-1)
  444.       {
  445. !     sprintf(errstr, "Unknown host: '%s'", to_id);
  446.       show_error(errstr);
  447.       return;
  448.       }
  449.       if((on_addr = get_host_addr(on_id)) == (ylong)-1)
  450.       {
  451. !     sprintf(errstr, "Unknown host: '%s'", on_id);
  452.       show_error(errstr);
  453.       return;
  454.       }
  455. *** 3.0.1/user.c    Tue Aug 24 16:42:59 1993
  456. --- user.c    Thu Nov 18 18:13:48 1993
  457. ***************
  458. *** 195,201 ****
  459.       }
  460.       else if((addr = get_host_addr(hostname)) == (ylong)-1)
  461.       {
  462. !     sprintf(errstr, "new_user: bad host: '%s'\n", hostname);
  463.       show_error(errstr);
  464.       return NULL;
  465.       }
  466. --- 195,201 ----
  467.       }
  468.       else if((addr = get_host_addr(hostname)) == (ylong)-1)
  469.       {
  470. !     sprintf(errstr, "new_user: bad host: '%s'", hostname);
  471.       show_error(errstr);
  472.       return NULL;
  473.       }
  474. *** 3.0.1/term.c    Tue Aug 24 16:42:59 1993
  475. --- term.c    Fri Sep 17 17:37:03 1993
  476. ***************
  477. *** 17,24 ****
  478.   /* Mail comments or questions to ytalk@austin.eds.com */
  479.   
  480.   #include "header.h"
  481.   #ifdef USE_SGTTY
  482. - # include <sys/ioctl.h>
  483.   # ifdef hpux
  484.   #  include <sys/bsdtty.h>
  485.   #  include <sgtty.h>
  486. --- 17,24 ----
  487.   /* Mail comments or questions to ytalk@austin.eds.com */
  488.   
  489.   #include "header.h"
  490. + #include <sys/ioctl.h>
  491.   #ifdef USE_SGTTY
  492.   # ifdef hpux
  493.   #  include <sys/bsdtty.h>
  494.   #  include <sgtty.h>
  495. *** 3.0.1/cwin.c    Tue Aug 24 16:42:59 1993
  496. --- cwin.c    Fri Sep 17 17:32:38 1993
  497. ***************
  498. *** 433,436 ****
  499. --- 433,438 ----
  500.   set_cooked_curses()
  501.   {
  502.       noraw();
  503. +     crmode();
  504. +     noecho();
  505.   }
  506.