home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume27 / ytalk-3.0 / patch01 / patch_01 < prev   
Text File  |  1993-08-24  |  62KB  |  2,559 lines

  1. *** 3.0.0/README    Mon Aug 23 14:05:01 1993
  2. --- README    Tue Aug 24 16:37:57 1993
  3. ***************
  4. *** 22,27 ****
  5. --- 22,31 ----
  6.   
  7.   The resulting executable program will be named "ytalk".
  8.   
  9. + If you ever go back and change some configuration parameters at the
  10. + top of Imakefile or Makefile, you should run 'make clean' before running
  11. + 'xmkmf' and/or 'make' again.  This will ensure that everything recompiles.
  12.   A manpage will automatically be built.  It will be named "ytalk.cat".
  13.   You can read the manual page by running:
  14.   
  15. ***************
  16. *** 40,42 ****
  17. --- 44,69 ----
  18.   at this email address:
  19.   
  20.       ytalk@austin.eds.com
  21. + ---- PATCH LEVEL 01
  22. +   1. Forcibly reset the scrolling region after a shell exits.
  23. +   2. Handle a local X resize while in a shell.
  24. +   3. Repair the password entry lookup stuff.
  25. +   4. Character-wrap to next line if word-wrap is disabled.
  26. +   5. Solaris 2.* support, patch by Magnus Hammerin.
  27. +   6. Aside messages in X, patch by Jonas Yngvesson.
  28. +   7. Fix X support, patch by Carl Edman.
  29. +   8. Option -x to disable X from the command line, thanks to John Vanderpool.
  30. +   9. Ctrl-L or ctrl-R to redraw screen, thanks to Shih-Chen Huang.
  31. +  10. Fix bizarre WINCH bug in exec.c.
  32. +  11. Handle 64-bit machines, thanks to Andrew Myers.
  33. +  12. Implement raw/cooked curses -- fixes 8-bit/parity problems with some
  34. +      terminals and allows ytalk to be suspended.  Thanks to Duncan Sinclair.
  35. +  13. System ytalkrc file, thanks to Evan McLean.
  36. +  14. Place user's full name in title bar, thanks to Evan McLean.
  37. +  15. Better imake support, thanks to Carl Edman.
  38. +  16. Installation features for make.
  39. +  17. Fix X resource database calls, patch by Andreas Stolcke.
  40. +  18. Fix cross-platform problems, thanks to Larry Schwimmer.
  41. *** 3.0.0/ytalk.1    Mon Aug 23 14:05:02 1993
  42. --- ytalk.1    Tue Aug 24 12:11:08 1993
  43. ***************
  44. *** 12,20 ****
  45.   .SH NAME
  46.   ytalk - A multi-user chat program. 
  47.   .SH SYNOPSIS
  48. ! .B ytalk username...
  49.   .SH DESCRIPTION
  50. ! .I YTalk V3.0
  51.   .PP
  52.   YTalk is in essence a multi-user chat program.  It works almost exactly like
  53.   the UNIX talk program and even communicates with the same talk daemon(s), but
  54. --- 12,20 ----
  55.   .SH NAME
  56.   ytalk - A multi-user chat program. 
  57.   .SH SYNOPSIS
  58. ! .B ytalk [-x] username...
  59.   .SH DESCRIPTION
  60. ! .I YTalk V3.0 Patch Level 1
  61.   .PP
  62.   YTalk is in essence a multi-user chat program.  It works almost exactly like
  63.   the UNIX talk program and even communicates with the same talk daemon(s), but
  64. ***************
  65. *** 40,45 ****
  66. --- 40,47 ----
  67.   .sp
  68.       ytalk george fred@hissun.edu marc@grumpy.cc
  69.   .PP
  70. + The -x option disables the X11 interface (described below).
  71. + .PP
  72.   For each user on the command line, YTalk will attempt to connect to the talk
  73.   daemon on the specified user's host and determine if that user has left an
  74.   invitation for you to call.  If not, YTalk leaves an invitation for him
  75. ***************
  76. *** 95,111 ****
  77.   moment has these options:
  78.   .sp
  79.           a: add a user
  80. ! .sp
  81.           d: delete a user
  82. ! .sp
  83.           o: options
  84. ! .sp
  85.           s: shell
  86. ! .sp
  87.           u: user list
  88. ! .sp
  89.           w: output user to file
  90. ! .sp
  91.           q: quit
  92.   .PP
  93.   By choosing option "a", you are given the opportunity to type the name of any
  94. --- 97,113 ----
  95.   moment has these options:
  96.   .sp
  97.           a: add a user
  98. ! .br
  99.           d: delete a user
  100. ! .br
  101.           o: options
  102. ! .br
  103.           s: shell
  104. ! .br
  105.           u: user list
  106. ! .br
  107.           w: output user to file
  108. ! .br
  109.           q: quit
  110.   .PP
  111.   By choosing option "a", you are given the opportunity to type the name of any
  112. ***************
  113. *** 148,161 ****
  114.   to edit the YTalk options.  The current options are:
  115.   .sp
  116.       s: turn scrolling [off/on]
  117. ! .sp
  118.       w: turn word-wrap [off/on]
  119. ! .sp
  120.       i: turn auto-import [off/on]
  121. ! .sp
  122.       v: turn auto-invite [off/on]
  123. ! .sp
  124.       r: turn auto-rering [off/on]
  125.   .PP
  126.   If
  127.   .I scrolling
  128. --- 150,165 ----
  129.   to edit the YTalk options.  The current options are:
  130.   .sp
  131.       s: turn scrolling [off/on]
  132. ! .br
  133.       w: turn word-wrap [off/on]
  134. ! .br
  135.       i: turn auto-import [off/on]
  136. ! .br
  137.       v: turn auto-invite [off/on]
  138. ! .br
  139.       r: turn auto-rering [off/on]
  140. + .br
  141. +     a: turn asides [off/on]
  142.   .PP
  143.   If
  144.   .I scrolling
  145. ***************
  146. *** 186,191 ****
  147. --- 190,201 ----
  148.   respond to your invitation within 30 seconds.  You will not be asked for
  149.   verification.
  150.   .PP
  151. + If
  152. + .I asides
  153. + is turned on (it may not be available), then keyboard input received while
  154. + the input focus is in a specific users' window will only be sent to that
  155. + user.  See the X11 interface description below.
  156. + .PP
  157.   Any of these options can be set to your preference in your .ytalkrc file,
  158.   as described below.
  159.   .SH YTALK STARTUP FILE
  160. ***************
  161. *** 207,212 ****
  162. --- 217,223 ----
  163.   .I auto-import ,
  164.   .I auto-invite ,
  165.   .I auto-rering ,
  166. + .I asides ,
  167.   or
  168.   .I X .
  169.   Setting these options works just like described above.  Turning
  170. ***************
  171. *** 269,278 ****
  172.   If the DISPLAY environment variable is defined when YTalk starts up, then
  173.   YTalk will attempt to communicate with that X server.  A window will be
  174.   created for you and each user you are connected to.  The X11 Interface can
  175. ! be disabled by putting this line into your .ytalkrc file:
  176.   .sp
  177.       turn X off
  178.   .PP
  179.   YTalk consults the X11 Resource Database for these user-definable
  180.   configuration options:
  181.   .sp
  182. --- 280,298 ----
  183.   If the DISPLAY environment variable is defined when YTalk starts up, then
  184.   YTalk will attempt to communicate with that X server.  A window will be
  185.   created for you and each user you are connected to.  The X11 Interface can
  186. ! be disabled either by specifying -x on the command line or by putting this
  187. ! line into your .ytalkrc file:
  188.   .sp
  189.       turn X off
  190.   .PP
  191. + A window is created for each individual user in the conversation.  If the
  192. + input focus is in the main window (ie: the one with "ytalk" in the title
  193. + bar) then anything typed will be sent to all connected users.  If the input
  194. + focus is in one of the users' windows, then anything typed will be sent
  195. + as an aside to only that user.  If the "aside" option is turned off (see
  196. + above) then ytalk will beep and not accept anything typed when the input
  197. + focus is not in the main window.
  198. + .PP
  199.   YTalk consults the X11 Resource Database for these user-definable
  200.   configuration options:
  201.   .sp
  202. ***************
  203. *** 291,301 ****
  204.   .br
  205.           or transmitted to all YTalk connections,
  206.   .br
  207. !     2) a way to send an aside to just one or a few of the 
  208.   .br
  209. !         connected users,
  210.   .br
  211. !     3) a dedicated YTalk daemon.
  212.   
  213.   .SH AUTHOR
  214.   
  215. --- 311,329 ----
  216.   .br
  217.           or transmitted to all YTalk connections,
  218.   .br
  219. !     2) a dedicated YTalk daemon.
  220. ! .SH FILES
  221. ! /usr/local/etc/ytalkrc
  222.   .br
  223. !     System-wide defaults file.
  224. ! .PP
  225. ! $HOME/.ytalkrc
  226.   .br
  227. !     User's local configuration file.  This file overrides
  228. ! .br
  229. !     options set in the system ytalkrc file.
  230.   
  231.   .SH AUTHOR
  232.   
  233. ***************
  234. *** 304,313 ****
  235.   yenne@austin.eds.com
  236.   
  237.   .SH CONTRIBUTORS
  238. ! Special thanks to Carl Edman, Tobias Hahn, and Geoff W. for beta
  239. ! testing and suggestions.
  240.   .PP
  241.   Thanks to Sitaram Ramaswamy for the original YTalk manpage.
  242.   
  243.   .SH BUGS
  244.   
  245. --- 332,355 ----
  246.   yenne@austin.eds.com
  247.   
  248.   .SH CONTRIBUTORS
  249. ! Special thanks to Carl Edman for numerous code patches, beta testing,
  250. ! and comments.  I think this guy spends as much time on ytalk as I do.
  251.   .PP
  252. + Special thanks to Tobias Hahn and Geoff W. for beta testing and
  253. + suggestions.
  254. + .PP
  255.   Thanks to Sitaram Ramaswamy for the original YTalk manpage.
  256. + .PP
  257. + Thanks to Magnus Hammerin for Solaris 2.* support.
  258. + .PP
  259. + Thanks to Jonas Yngvesson for aside messages in X.
  260. + .PP
  261. + Thanks to Andreas Stolcke for fixing the X resource database calls.
  262. + .PP
  263. + Thanks to John Vanderpool, Shih-Chen Huang, Andrew Myers, Duncan Sinclair,
  264. + Evan McLean, and Larry Schwimmer for comments and ideas.
  265. + .PP
  266. + The README file shipped with ytalk gives detailed attributions.
  267.   
  268.   .SH BUGS
  269.   
  270. *** 3.0.0/term.doc    Mon Aug 23 14:05:02 1993
  271. --- term.doc    Sun Aug 22 21:34:48 1993
  272. ***************
  273. *** 19,27 ****
  274.   by calling this function in comm.c:
  275.   
  276.       void
  277. !     my_input(buf, len)        [in comm.c]
  278.         ychar *buf;
  279.         int len;
  280.   
  281.   Note that it is much more optimal to call this function once with a
  282.   batch of input characters rather than calling this function once for
  283. --- 19,37 ----
  284.   by calling this function in comm.c:
  285.   
  286.       void
  287. !     my_input(user, buf, len)    [in comm.c]
  288. !       yuser *user;
  289.         ychar *buf;
  290.         int len;
  291. + The "user" parameter should be set to the user pointer whose window
  292. + the given input was taken from (ie: I had my mouse cursor in the
  293. + window assigned to user X and typed some info).  The my_input routine
  294. + will send the given info to the given user as an aside, ie: no other
  295. + users get sent this info.  If a terminal interface cannot distinguish
  296. + input from various windows, or if you do not wish to bother with this,
  297. + then just send "me" as the user.  Any input given the "me" user will
  298. + get sent to all connected users.
  299.   
  300.   Note that it is much more optimal to call this function once with a
  301.   batch of input characters rather than calling this function once for
  302. *** 3.0.0/header.h    Mon Aug 23 14:05:02 1993
  303. --- header.h    Tue Aug 24 10:39:40 1993
  304. ***************
  305. *** 30,35 ****
  306. --- 30,36 ----
  307.   
  308.   #define VMAJOR    3    /* major version number */
  309.   #define VMINOR    0    /* minor version number */
  310. + #define VPATCH    1    /* patch level */
  311.   
  312.   /* ---- YTalk protocols ---- */
  313.   
  314. ***************
  315. *** 49,54 ****
  316. --- 50,61 ----
  317.   typedef yaddr    yterm;        /* terminal cookie */
  318.   typedef u_char    ychar;        /* we use unsigned chars */
  319.   
  320. + #ifdef Y64BIT
  321. + typedef u_int    ylong;        /* unsigned 32-bit */
  322. + #else
  323. + typedef u_long    ylong;        /* unsigned 32-bit */
  324. + #endif
  325.   typedef struct {
  326.       u_char w_rows, w_cols;    /* window size FOR PROTOCOL YTP_OLD */
  327.       char protocol;        /* ytalk protocol -- see above */
  328. ***************
  329. *** 56,62 ****
  330.       short vmajor, vminor;    /* version numbers */
  331.       u_short rows, cols;        /* his window size over there */
  332.       u_short my_rows, my_cols;    /* my window size over there */
  333. !     u_long pid;            /* my process id */
  334.       char pad[44];        /* zeroed out */
  335.   } y_parm;
  336.   
  337. --- 63,69 ----
  338.       short vmajor, vminor;    /* version numbers */
  339.       u_short rows, cols;        /* his window size over there */
  340.       u_short my_rows, my_cols;    /* my window size over there */
  341. !     ylong pid;            /* my process id */
  342.       char pad[44];        /* zeroed out */
  343.   } y_parm;
  344.   
  345. ***************
  346. *** 67,73 ****
  347.       struct _yuser *unext;    /* next user in full user list */
  348.       int fd;            /* file descriptor */
  349.       int output_fd;        /* non-zero if output is going to a file */
  350. !     u_long flags;        /* active FL_* flags below */
  351.       ychar edit[4];        /* edit characters */
  352.       u_short t_rows, t_cols;    /* his rows and cols on window over here */
  353.       u_short rows, cols;        /* his active region rows and cols over here */
  354. --- 74,80 ----
  355.       struct _yuser *unext;    /* next user in full user list */
  356.       int fd;            /* file descriptor */
  357.       int output_fd;        /* non-zero if output is going to a file */
  358. !     ylong flags;        /* active FL_* flags below */
  359.       ychar edit[4];        /* edit characters */
  360.       u_short t_rows, t_cols;    /* his rows and cols on window over here */
  361.       u_short rows, cols;        /* his active region rows and cols over here */
  362. ***************
  363. *** 85,95 ****
  364.       char *user_name;        /* user name */
  365.       char *host_name;        /* host name */
  366.       char *tty_name;        /* tty name */
  367. !     u_long host_addr;        /* host inet address */
  368.       int daemon;            /* daemon type to use */
  369. !     u_long l_id, r_id;        /* local and remote talkd invite list index */
  370. !     u_long d_id;        /* talk daemon process id -- see socket.c */
  371. !     long last_invite;        /* timestamp of last invitation sent */
  372.       struct sockaddr_in sock;    /* communication socket */
  373.       struct sockaddr_in orig_sock; /* original socket -- another sick hack */
  374.       u_int av[MAXARG];        /* ESC sequence arguments */
  375. --- 92,102 ----
  376.       char *user_name;        /* user name */
  377.       char *host_name;        /* host name */
  378.       char *tty_name;        /* tty name */
  379. !     ylong host_addr;        /* host inet address */
  380.       int daemon;            /* daemon type to use */
  381. !     ylong l_id, r_id;        /* local and remote talkd invite list index */
  382. !     ylong d_id;            /* talk daemon process id -- see socket.c */
  383. !     ylong last_invite;        /* timestamp of last invitation sent */
  384.       struct sockaddr_in sock;    /* communication socket */
  385.       struct sockaddr_in orig_sock; /* original socket -- another sick hack */
  386.       u_int av[MAXARG];        /* ESC sequence arguments */
  387. ***************
  388. *** 119,124 ****
  389. --- 126,132 ----
  390.   #define FL_INVITE    0x00000010L    /* auto-invite enabled */
  391.   #define FL_RING        0x00000020L    /* auto-rering enabled */
  392.   #define FL_XWIN        0x00000040L    /* X Windows enabled (startup opt) */
  393. + #define FL_ASIDE    0x00000080L    /* multiple window input/asides */
  394.   #define FL_LOCKED    0x40000000L    /* flags locked by other end */
  395.   
  396.   /* ---- defines and short-cuts ---- */
  397. ***************
  398. *** 151,158 ****
  399.   typedef struct {
  400.       ychar code;            /* V3_EXPORT, V3_IMPORT, or V3_ACCEPT */
  401.       char filler[3];
  402. !     u_long host_addr;        /* host address */
  403. !     u_long pid;            /* process id */
  404.       char name[V3_NAMELEN];    /* user name */
  405.       char host[V3_HOSTLEN];    /* host name */
  406.   } v3_pack;
  407. --- 159,166 ----
  408.   typedef struct {
  409.       ychar code;            /* V3_EXPORT, V3_IMPORT, or V3_ACCEPT */
  410.       char filler[3];
  411. !     ylong host_addr;        /* host address */
  412. !     ylong pid;            /* process id */
  413.       char name[V3_NAMELEN];    /* user name */
  414.       char host[V3_HOSTLEN];    /* host name */
  415.   } v3_pack;
  416. ***************
  417. *** 165,171 ****
  418.   typedef struct {
  419.       ychar code;            /* V3_LOCKF or V3_UNLOCKF */
  420.       char filler[3];
  421. !     u_long flags;        /* flags */
  422.   } v3_flags;
  423.   
  424.   #define V3_FLAGSLEN    sizeof(v3_flags)
  425. --- 173,179 ----
  426.   typedef struct {
  427.       ychar code;            /* V3_LOCKF or V3_UNLOCKF */
  428.       char filler[3];
  429. !     ylong flags;        /* flags */
  430.   } v3_flags;
  431.   
  432.   #define V3_FLAGSLEN    sizeof(v3_flags)
  433. ***************
  434. *** 220,226 ****
  435.   extern yuser *fd_to_user[MAX_FILES];    /* convert file descriptors to users */
  436.   extern yuser *key_to_user[128];    /* convert menu ident chars to users */
  437.   extern char errstr[MAXERR];    /* temporary string for errors */
  438. ! extern u_long def_flags;    /* default FL_* flags */
  439.   extern int user_winch;        /* user window/status changed flag */
  440.   
  441.   extern ychar *io_ptr;        /* user input pointer */
  442. --- 228,234 ----
  443.   extern yuser *fd_to_user[MAX_FILES];    /* convert file descriptors to users */
  444.   extern yuser *key_to_user[128];    /* convert menu ident chars to users */
  445.   extern char errstr[MAXERR];    /* temporary string for errors */
  446. ! extern ylong def_flags;        /* default FL_* flags */
  447.   extern int user_winch;        /* user window/status changed flag */
  448.   
  449.   extern ychar *io_ptr;        /* user input pointer */
  450. ***************
  451. *** 228,233 ****
  452. --- 236,249 ----
  453.   
  454.   extern int running_process;    /* flag: is process running? */
  455.   
  456. + /* ---- some machine compatibility definitions ---- */
  457. + #if defined(SYSV)
  458. + # define Y_USE_SIGHOLD 1
  459. + #endif
  460. + extern int errno;
  461.   /* ---- global functions ---- */
  462.   
  463.   extern void    bail        ( /* int */ );            /* main.c */
  464. ***************
  465. *** 267,272 ****
  466. --- 283,292 ----
  467.   extern void    msg_term    ( /* yuser, str */ );        /* term.c */
  468.   extern void    spew_term    ( /* yuser, fd, rows, cols */ ); /* term.c */
  469.   extern int    center        ( /* width, n */ );        /* term.c */
  470. + extern void    redraw_all_terms();                /* term.c */
  471. + extern void    set_raw_term    ();                /* term.c */
  472. + extern void    set_cooked_term    ();                /* term.c */
  473. + extern int    term_does_asides();                /* term.c */
  474.   
  475.   extern void    init_user    ();                /* user.c */
  476.   extern yuser   *new_user    ( /* name, host, tty */ );    /* user.c */
  477. ***************
  478. *** 298,304 ****
  479.   extern void    kill_auto    ();                /* socket.c */
  480.   extern int    newsock        ( /* yuser */ );        /* socket.c */
  481.   extern int    connect_to    ( /* yuser */ );        /* socket.c */
  482. ! extern u_long    get_host_addr    ( /* hostname */ );        /* socket.c */
  483.   extern char    *host_name    ( /* addr */ );            /* socket.c */
  484.   extern void    readdress_host    ( /* from, to, on */ );        /* socket.c */
  485.   
  486. --- 318,324 ----
  487.   extern void    kill_auto    ();                /* socket.c */
  488.   extern int    newsock        ( /* yuser */ );        /* socket.c */
  489.   extern int    connect_to    ( /* yuser */ );        /* socket.c */
  490. ! extern ylong    get_host_addr    ( /* hostname */ );        /* socket.c */
  491.   extern char    *host_name    ( /* addr */ );            /* socket.c */
  492.   extern void    readdress_host    ( /* from, to, on */ );        /* socket.c */
  493.   
  494. *** 3.0.0/socket.h    Mon Aug 23 14:05:03 1993
  495. --- socket.h    Sun Aug 22 21:05:40 1993
  496. ***************
  497. *** 18,33 ****
  498.   
  499.   typedef struct _hostinfo {
  500.       struct _hostinfo *next;    /* next in linked list */
  501. !     u_long host_addr;        /* host address */
  502.       int dtype;            /* active daemon types bitmask */
  503.   } hostinfo;
  504.   
  505.   typedef struct _readdr {
  506.       struct _readdr *next;    /* next in linked list */
  507. !     u_long addr;        /* this net address [group?], */
  508. !     u_long mask;        /* with this mask, */
  509. !     u_long id_addr;        /* thinks I'm at this net address, */
  510. !     u_long id_mask;        /* with this mask. */
  511.   } readdr;
  512.   
  513.   extern struct _talkd talkd[MAXDAEMON+1];
  514. --- 18,33 ----
  515.   
  516.   typedef struct _hostinfo {
  517.       struct _hostinfo *next;    /* next in linked list */
  518. !     ylong host_addr;        /* host address */
  519.       int dtype;            /* active daemon types bitmask */
  520.   } hostinfo;
  521.   
  522.   typedef struct _readdr {
  523.       struct _readdr *next;    /* next in linked list */
  524. !     ylong addr;        /* this net address [group?], */
  525. !     ylong mask;        /* with this mask, */
  526. !     ylong id_addr;        /* thinks I'm at this net address, */
  527. !     ylong id_mask;        /* with this mask. */
  528.   } readdr;
  529.   
  530.   extern struct _talkd talkd[MAXDAEMON+1];
  531. ***************
  532. *** 45,52 ****
  533.       char    l_name[NAME_SIZE];
  534.       char    r_name[NAME_SIZE];
  535.       char    filler;
  536. !     u_long    id_num;
  537. !     u_long    pid;
  538.       char    r_tty[TTY_SIZE];
  539.       struct    sockaddr_in addr;
  540.       struct    sockaddr_in ctl_addr;
  541. --- 45,52 ----
  542.       char    l_name[NAME_SIZE];
  543.       char    r_name[NAME_SIZE];
  544.       char    filler;
  545. !     ylong    id_num;
  546. !     ylong    pid;
  547.       char    r_tty[TTY_SIZE];
  548.       struct    sockaddr_in addr;
  549.       struct    sockaddr_in ctl_addr;
  550. ***************
  551. *** 58,64 ****
  552.       char    type;
  553.       char    answer;
  554.       u_short    filler;
  555. !     u_long    id_num;
  556.       struct    sockaddr_in addr;
  557.   } CTL_RESPONSE;
  558.   
  559. --- 58,64 ----
  560.       char    type;
  561.       char    answer;
  562.       u_short    filler;
  563. !     ylong    id_num;
  564.       struct    sockaddr_in addr;
  565.   } CTL_RESPONSE;
  566.   
  567. ***************
  568. *** 68,77 ****
  569.       u_char    vers;
  570.       char    type;
  571.       u_short    filler;
  572. !     u_long    id_num;
  573.       struct    sockaddr_in addr;
  574.       struct    sockaddr_in ctl_addr;
  575. !     u_long    pid;
  576.       char    l_name[NAME_SIZE];
  577.       char    l_name_filler[3];
  578.       char    r_name[NAME_SIZE];
  579. --- 68,77 ----
  580.       u_char    vers;
  581.       char    type;
  582.       u_short    filler;
  583. !     ylong    id_num;
  584.       struct    sockaddr_in addr;
  585.       struct    sockaddr_in ctl_addr;
  586. !     ylong    pid;
  587.       char    l_name[NAME_SIZE];
  588.       char    l_name_filler[3];
  589.       char    r_name[NAME_SIZE];
  590. ***************
  591. *** 86,92 ****
  592.       char    type;
  593.       char    answer;
  594.       char    filler;
  595. !     u_long    id_num;
  596.       struct    sockaddr_in addr;
  597.   } CTL_RESPONSE42;
  598.   
  599. --- 86,92 ----
  600.       char    type;
  601.       char    answer;
  602.       char    filler;
  603. !     ylong    id_num;
  604.       struct    sockaddr_in addr;
  605.   } CTL_RESPONSE42;
  606.   
  607. *** 3.0.0/cwin.h    Mon Aug 23 14:05:03 1993
  608. --- cwin.h    Tue Aug 24 11:16:40 1993
  609. ***************
  610. *** 1,4 ****
  611. ! /* curses.h -- curses interface (curses.c) */
  612.   
  613.   /*               NOTICE
  614.    *
  615. --- 1,4 ----
  616. ! /* cwin.h -- curses interface (cwin.c) */
  617.   
  618.   /*               NOTICE
  619.    *
  620. ***************
  621. *** 26,31 ****
  622. --- 26,34 ----
  623.   extern void    clreos_curses    ( /* yuser */ );
  624.   extern void    scroll_curses    ( /* yuser */ );
  625.   extern void    flush_curses    ( /* yuser */ );
  626. + extern void    redisplay_curses();
  627. + extern void    set_raw_curses();
  628. + extern void    set_cooked_curses();
  629.   
  630.   #ifndef getyx
  631.   # define getyx(w,y,x)    y = w->_cury, x = w->_curx
  632. *** 3.0.0/main.c    Mon Aug 23 14:05:03 1993
  633. --- main.c    Tue Aug 24 16:07:47 1993
  634. ***************
  635. *** 134,146 ****
  636.     int argc;
  637.     char **argv;
  638.   {
  639. !     if(argc <= 1)
  640.       {
  641. !     fprintf(stderr, "Usage: %s user[@hostname][#tty] [user...]\n", *argv);
  642.       (void)exit(YTE_INIT);
  643.       }
  644.       argv++, argc--;
  645.   
  646.       /* set up signals */
  647.   
  648.       signal(SIGINT, got_sig);
  649. --- 134,195 ----
  650.     int argc;
  651.     char **argv;
  652.   {
  653. !     int xflg = 0;
  654. !     char *prog;
  655. !     /* check for a 64-bit mis-compile */
  656. !     if(sizeof(ylong) != 4)
  657.       {
  658. !     if(sizeof(ylong) > 4)
  659. !     {
  660. !         fprintf(stderr,
  661. !         "You should have compiled ytalk with the -DY64BIT option.\n");
  662. !     }
  663. !     else
  664. !     {
  665. ! #ifdef Y64BIT
  666. !         fprintf(stderr,
  667. !         "You should NOT have compiled ytalk with the -DY64BIT option.\n");
  668. ! #else
  669. !         fprintf(stderr,
  670. !         "Your machine doesn't support 32-bit longs.  Please mail\n");
  671. !         fprintf(stderr,
  672. !         "ytalk@austin.eds.com your machine type and OS version.\n");
  673. !         (void)exit(YTE_INIT);
  674. ! #endif
  675. !     }
  676. !     fprintf(stderr,
  677. !         "See the README file on how to update the appropriate\n");
  678. !     fprintf(stderr,
  679. !         "makefile, then type 'make clean', 'make'.\n");
  680.       (void)exit(YTE_INIT);
  681.       }
  682. +     /* search for options */
  683. +     prog = *argv;
  684.       argv++, argc--;
  685. +     while(argc > 0 && **argv == '-')
  686. +     {
  687. +     if(strcmp(*argv, "-x") == 0
  688. +     || strcmp(*argv, "-nw") == 0)
  689. +     {
  690. +         xflg++;    /* disable X from the command line */
  691. +         argv++, argc--;
  692. +     }
  693. +     else
  694. +         argc = 0;    /* force a Usage error */
  695. +     }
  696.   
  697. +     /* check for users */
  698. +     if(argc <= 0)
  699. +     {
  700. +     fprintf(stderr, "Usage: %s [-x] user[@hostname][#tty]...\n", prog);
  701. +     (void)exit(YTE_INIT);
  702. +     }
  703.       /* set up signals */
  704.   
  705.       signal(SIGINT, got_sig);
  706. ***************
  707. *** 158,163 ****
  708. --- 207,214 ----
  709.       init_fd();
  710.       init_user();
  711.       read_ytalkrc();
  712. +     if(xflg)
  713. +     def_flags &= ~FL_XWIN;
  714.       init_term();
  715.       init_socket();
  716.       for(; argc > 0; argc--, argv++)
  717. *** 3.0.0/comm.c    Mon Aug 23 14:05:03 1993
  718. --- comm.c    Mon Aug 23 13:30:30 1993
  719. ***************
  720. *** 142,148 ****
  721.     v2_pack *pack;
  722.   {
  723.       register yuser *u;
  724. !     u_long host_addr;
  725.       static char name[V2_NAMELEN + 1];
  726.       static char host[V2_HOSTLEN + 1];
  727.       static char estr[V2_NAMELEN + V2_HOSTLEN + 20];
  728. --- 142,148 ----
  729.     v2_pack *pack;
  730.   {
  731.       register yuser *u;
  732. !     ylong host_addr;
  733.       static char name[V2_NAMELEN + 1];
  734.       static char host[V2_HOSTLEN + 1];
  735.       static char estr[V2_NAMELEN + V2_HOSTLEN + 20];
  736. ***************
  737. *** 154,160 ****
  738.       strncpy(host, pack->host, V2_HOSTLEN);
  739.       name[V2_NAMELEN] = '\0';
  740.       host[V2_HOSTLEN] = '\0';
  741. !     if((host_addr = get_host_addr(host)) == (u_long)-1)
  742.       {
  743.       errno = 0;
  744.       sprintf(errstr, "unknown host: '%s'\n", host);
  745. --- 154,160 ----
  746.       strncpy(host, pack->host, V2_HOSTLEN);
  747.       name[V2_NAMELEN] = '\0';
  748.       host[V2_HOSTLEN] = '\0';
  749. !     if((host_addr = get_host_addr(host)) == (ylong)-1)
  750.       {
  751.       errno = 0;
  752.       sprintf(errstr, "unknown host: '%s'\n", host);
  753. ***************
  754. *** 168,174 ****
  755.           /* Don't import a user with the same name of an existing
  756.            * user at this end.  yukk.
  757.            */
  758. !         if(find_user(name, host_addr, (u_long)-1) != NULL)
  759.           break;
  760.           if(!(def_flags & FL_IMPORT))
  761.           {
  762. --- 168,174 ----
  763.           /* Don't import a user with the same name of an existing
  764.            * user at this end.  yukk.
  765.            */
  766. !         if(find_user(name, host_addr, (ylong)-1) != NULL)
  767.           break;
  768.           if(!(def_flags & FL_IMPORT))
  769.           {
  770. ***************
  771. *** 193,199 ****
  772.            * send_accept() will think his version number is zero
  773.            * and won't send anything.
  774.            */
  775. !         if((u = find_user(name, host_addr, (u_long)-1)) == NULL)
  776.           break;
  777.           send_accept(u, user);
  778.           break;
  779. --- 193,199 ----
  780.            * send_accept() will think his version number is zero
  781.            * and won't send anything.
  782.            */
  783. !         if((u = find_user(name, host_addr, (ylong)-1)) == NULL)
  784.           break;
  785.           send_accept(u, user);
  786.           break;
  787. ***************
  788. *** 212,218 ****
  789.     v3_pack *pack;
  790.   {
  791.       register yuser *u;
  792. !     u_long host_addr, pid;
  793.       static char name[V3_NAMELEN + 1];
  794.       static char host[V3_HOSTLEN + 1];
  795.       static char estr[V3_NAMELEN + V3_HOSTLEN + 20];
  796. --- 212,218 ----
  797.     v3_pack *pack;
  798.   {
  799.       register yuser *u;
  800. !     ylong host_addr, pid;
  801.       static char name[V3_NAMELEN + 1];
  802.       static char host[V3_HOSTLEN + 1];
  803.       static char estr[V3_NAMELEN + V3_HOSTLEN + 20];
  804. ***************
  805. *** 221,227 ****
  806.       strncpy(host, pack->host, V3_HOSTLEN);
  807.       name[V3_NAMELEN] = '\0';
  808.       host[V3_HOSTLEN] = '\0';
  809. !     if((host_addr = get_host_addr(host)) == (u_long)-1)
  810.       host_addr = ntohl(pack->host_addr);
  811.       pid = ntohl(pack->pid);
  812.   
  813. --- 221,227 ----
  814.       strncpy(host, pack->host, V3_HOSTLEN);
  815.       name[V3_NAMELEN] = '\0';
  816.       host[V3_HOSTLEN] = '\0';
  817. !     if((host_addr = get_host_addr(host)) == (ylong)-1)
  818.       host_addr = ntohl(pack->host_addr);
  819.       pid = ntohl(pack->pid);
  820.   
  821. ***************
  822. *** 524,532 ****
  823.           parm.my_rows = ntohs(parm.my_rows);
  824.           parm.my_cols = ntohs(parm.my_cols);
  825.           parm.pid = ntohl(parm.pid);
  826. !         if(user->remote.vmajor <= 2)
  827. !         spew_term(me, fd, parm.rows, parm.cols);
  828. !         /* else we spew_term later */
  829.           break;
  830.       default:
  831.           free_user(user);
  832. --- 524,530 ----
  833.           parm.my_rows = ntohs(parm.my_rows);
  834.           parm.my_cols = ntohs(parm.my_cols);
  835.           parm.pid = ntohl(parm.pid);
  836. !         /* we spew_term later */
  837.           break;
  838.       default:
  839.           free_user(user);
  840. ***************
  841. *** 603,609 ****
  842.       show_error("connect_user: bad read");
  843.       return;
  844.       }
  845. !     if(open_term(user, user->user_name) < 0)
  846.       {
  847.       free_user(user);
  848.       show_error("connect_user: open_term() failed");
  849. --- 601,607 ----
  850.       show_error("connect_user: bad read");
  851.       return;
  852.       }
  853. !     if(open_term(user, user->full_name) < 0)
  854.       {
  855.       free_user(user);
  856.       show_error("connect_user: open_term() failed");
  857. ***************
  858. *** 699,710 ****
  859.       for(i = 1; i < bound && user->scr[user->y][x-i] != ' '; i++)
  860.       temp[i] = user->scr[user->y][x-i];
  861.       if(i >= bound)
  862. !     return;
  863.       move_term(user, user->y, x - i);
  864.       clreol_term(user);
  865.       newline_term(user);
  866.       for(i--; i >= 1; i--)
  867.       addch_term(user, temp[i]);
  868.   }
  869.   
  870.   /* Ring a user.  If he has an auto-invitation port established then talk
  871. --- 697,709 ----
  872.       for(i = 1; i < bound && user->scr[user->y][x-i] != ' '; i++)
  873.       temp[i] = user->scr[user->y][x-i];
  874.       if(i >= bound)
  875. !     return -1;
  876.       move_term(user, user->y, x - i);
  877.       clreol_term(user);
  878.       newline_term(user);
  879.       for(i--; i >= 1; i--)
  880.       addch_term(user, temp[i]);
  881. +     return 0;
  882.   }
  883.   
  884.   /* Ring a user.  If he has an auto-invitation port established then talk
  885. ***************
  886. *** 812,818 ****
  887.           free_user(user);
  888.           return;
  889.       }
  890. !     user->last_invite = time(NULL);
  891.       add_fd(user->fd, connect_user);
  892.       (void)write(user->fd, me->edit, 3);    /* send the edit keys */
  893.       return;
  894. --- 811,817 ----
  895.           free_user(user);
  896.           return;
  897.       }
  898. !     user->last_invite = (ylong)time(NULL);
  899.       add_fd(user->fd, connect_user);
  900.       (void)write(user->fd, me->edit, 3);    /* send the edit keys */
  901.       return;
  902. ***************
  903. *** 833,839 ****
  904.       return;
  905.       }
  906.       (void)send_dgram(user, LEAVE_INVITE);
  907. !     user->last_invite = time(NULL);
  908.       if(send_announce && announce(user) < 0)
  909.       {
  910.       (void)send_dgram(user, DELETE_INVITE);
  911. --- 832,838 ----
  912.       return;
  913.       }
  914.       (void)send_dgram(user, LEAVE_INVITE);
  915. !     user->last_invite = (ylong)time(NULL);
  916.       if(send_announce && announce(user) < 0)
  917.       {
  918.       (void)send_dgram(user, DELETE_INVITE);
  919. ***************
  920. *** 851,862 ****
  921.   house_clean()
  922.   {
  923.       register yuser *u, *next;
  924. !     long t;
  925.       static char estr[80];
  926. !     static u_long last_auto = 0;
  927.       int answer;
  928.   
  929. !     t = time(NULL);
  930.   
  931.       if(t - last_auto >= 30)
  932.       {
  933. --- 850,861 ----
  934.   house_clean()
  935.   {
  936.       register yuser *u, *next;
  937. !     ylong t;
  938.       static char estr[80];
  939. !     static ylong last_auto = 0;
  940.       int answer;
  941.   
  942. !     t = (ylong)time(NULL);
  943.   
  944.       if(t - last_auto >= 30)
  945.       {
  946. ***************
  947. *** 874,880 ****
  948.       if(t - u->last_invite >= 30)
  949.       {
  950.           (void)send_dgram(u, LEAVE_INVITE);
  951. !         u->last_invite = t = time(NULL);
  952.           if(!(def_flags & FL_RING))
  953.           {
  954.           if(input_flag)
  955. --- 873,879 ----
  956.       if(t - u->last_invite >= 30)
  957.       {
  958.           (void)send_dgram(u, LEAVE_INVITE);
  959. !         u->last_invite = t = (ylong)time(NULL);
  960.           if(!(def_flags & FL_RING))
  961.           {
  962.           if(input_flag)
  963. ***************
  964. *** 881,887 ****
  965.               continue;
  966.           sprintf(estr, "Rering %s?", u->full_name);
  967.           answer = yes_no(estr);
  968. !         t = time(NULL);
  969.           if(answer == 'n')
  970.               continue;
  971.           }
  972. --- 880,886 ----
  973.               continue;
  974.           sprintf(estr, "Rering %s?", u->full_name);
  975.           answer = yes_no(estr);
  976. !         t = (ylong)time(NULL);
  977.           if(answer == 'n')
  978.               continue;
  979.           }
  980. ***************
  981. *** 948,955 ****
  982.           send_oob(u->fd, &v3w, V3_WINCHLEN);
  983.   }
  984.   
  985.   void
  986. ! send_users(buf, len)
  987.     ychar *buf;
  988.     register int len;
  989.   {
  990. --- 947,958 ----
  991.           send_oob(u->fd, &v3w, V3_WINCHLEN);
  992.   }
  993.   
  994. + /* Send some output to a given user.  Sends the output to all connected
  995. +  * users if the given user is either "me" or NULL.
  996. +  */
  997.   void
  998. ! send_users(user, buf, len)
  999. !   yuser *user;
  1000.     ychar *buf;
  1001.     register int len;
  1002.   {
  1003. ***************
  1004. *** 971,981 ****
  1005.       if(*b == V3_OOB)
  1006.           *(o++) = V3_OOB;
  1007.       }
  1008. !     for(u = connect_list; u; u = u->next)
  1009. !     if(u->remote.vmajor > 2)
  1010. !         (void)write(u->fd, o_buf, o - o_buf);
  1011. !     else
  1012. !         (void)write(u->fd, buf, b - buf);
  1013.   }
  1014.   
  1015.   /* Display user input.  Emulate ANSI.
  1016. --- 974,996 ----
  1017.       if(*b == V3_OOB)
  1018.           *(o++) = V3_OOB;
  1019.       }
  1020. !     if(user && user != me)
  1021. !     {
  1022. !     if(user->fd > 0)    /* just to be sure... */
  1023. !     {
  1024. !         if(user->remote.vmajor > 2)
  1025. !         (void)write(user->fd, o_buf, o - o_buf);
  1026. !         else
  1027. !         (void)write(user->fd, buf, b - buf);
  1028. !     }
  1029. !     }
  1030. !     else
  1031. !     for(u = connect_list; u; u = u->next)
  1032. !         if(u->remote.vmajor > 2)
  1033. !         (void)write(u->fd, o_buf, o - o_buf);
  1034. !         else
  1035. !         (void)write(u->fd, buf, b - buf);
  1036.   }
  1037.   
  1038.   /* Display user input.  Emulate ANSI.
  1039. ***************
  1040. *** 1136,1149 ****
  1041.       {
  1042.       if(*buf >= ' ' && *buf <= '~')
  1043.       {
  1044. !         if((user->flags & FL_WRAP) && user->x + 1 >= user->cols)
  1045.           {
  1046. !         if(*buf == ' ')
  1047. !             newline_term(user);
  1048.           else
  1049.           {
  1050. -             word_wrap(user);
  1051.               addch_term(user, *buf);
  1052.           }
  1053.           }
  1054.           else
  1055. --- 1151,1174 ----
  1056.       {
  1057.       if(*buf >= ' ' && *buf <= '~')
  1058.       {
  1059. !         if(user->x + 1 >= user->cols)
  1060.           {
  1061. !         if(user->flags & FL_WRAP)
  1062. !         {
  1063. !             if(*buf == ' ')
  1064. !             newline_term(user);
  1065. !             else if(word_wrap(user) >= 0)
  1066. !             addch_term(user, *buf);
  1067. !             else
  1068. !             {
  1069. !             addch_term(user, *buf);
  1070. !             newline_term(user);
  1071. !             }
  1072. !         }
  1073.           else
  1074.           {
  1075.               addch_term(user, *buf);
  1076. +             newline_term(user);
  1077.           }
  1078.           }
  1079.           else
  1080. ***************
  1081. *** 1199,1205 ****
  1082.   /* Process keyboard input.
  1083.    */
  1084.   void
  1085. ! my_input(buf, len)
  1086.     register ychar *buf;
  1087.     int len;
  1088.   {
  1089. --- 1224,1231 ----
  1090.   /* Process keyboard input.
  1091.    */
  1092.   void
  1093. ! my_input(user, buf, len)
  1094. !   yuser *user;
  1095.     register ychar *buf;
  1096.     int len;
  1097.   {
  1098. ***************
  1099. *** 1246,1268 ****
  1100.       {
  1101.           /* do normal input */
  1102.   
  1103. !         c = buf;
  1104. !         for(; len > 0; buf++, len--)
  1105.           {
  1106. !         if(*buf == me->old_rub)
  1107. !             *buf = me->RUB;
  1108. !         else if(*buf == '\r')
  1109. !             *buf = '\n';
  1110. !         else if(*buf == 3)    /* Ctrl-C */
  1111. !             bail(0);
  1112. !         else if(*buf == 27)    /* Esc */
  1113. !             break;
  1114.           }
  1115. -         if((i = buf - c) > 0)
  1116. -         {
  1117. -         show_input(me, c, i);
  1118. -         send_users(c, i);
  1119. -         }
  1120.       }
  1121.   
  1122.       /* start a menu if necessary */
  1123. --- 1272,1314 ----
  1124.       {
  1125.           /* do normal input */
  1126.   
  1127. !         while(len > 0)
  1128.           {
  1129. !         c = buf;
  1130. !         for(; len > 0; buf++, len--)
  1131. !         {
  1132. !             if(*buf == me->old_rub)
  1133. !             *buf = me->RUB;
  1134. !             else if(*buf == '\r')
  1135. !             *buf = '\n';
  1136. !             else if(*buf == 3)    /* Ctrl-C */
  1137. !             bail(0);
  1138. !             else if(*buf == 27)    /* Esc */
  1139. !             break;
  1140. !             else if(*buf == 12 || *buf == 18) /* ^L or ^R */
  1141. !             break;
  1142. !         }
  1143. !         if((i = buf - c) > 0)
  1144. !         {
  1145. !             if(user != NULL && user != me && !(def_flags & FL_ASIDE))
  1146. !             putc(7, stderr);
  1147. !             else
  1148. !             {
  1149. !             show_input(me, c, i);
  1150. !             send_users(user, c, i);
  1151. !             }
  1152. !         }
  1153. !         if(len > 0)    /* we broke for a special char */
  1154. !         {
  1155. !             if(*buf == 27) /* ESC */
  1156. !             break;
  1157. !             if(*buf == 12 || *buf == 18) /* ^L or ^R */
  1158. !             {
  1159. !             redraw_all_terms();
  1160. !             buf++, len--;
  1161. !             }
  1162. !         }
  1163.           }
  1164.       }
  1165.   
  1166.       /* start a menu if necessary */
  1167. ***************
  1168. *** 1269,1276 ****
  1169.   
  1170.       if(len > 0)
  1171.       {
  1172. !         buf++;
  1173. !         len--;
  1174.           show_main_menu();
  1175.           if(len <= 0)
  1176.           update_menu();
  1177. --- 1315,1321 ----
  1178.   
  1179.       if(len > 0)
  1180.       {
  1181. !         buf++, len--;
  1182.           show_main_menu();
  1183.           if(len <= 0)
  1184.           update_menu();
  1185. ***************
  1186. *** 1280,1286 ****
  1187.   
  1188.   void
  1189.   lock_flags(flags)
  1190. !   u_long flags;
  1191.   {
  1192.       register yuser *u;
  1193.   
  1194. --- 1325,1331 ----
  1195.   
  1196.   void
  1197.   lock_flags(flags)
  1198. !   ylong flags;
  1199.   {
  1200.       register yuser *u;
  1201.   
  1202. *** 3.0.0/fd.c    Mon Aug 23 14:05:04 1993
  1203. --- fd.c    Tue Aug 24 11:12:15 1993
  1204. ***************
  1205. *** 103,127 ****
  1206.   
  1207.   /* -- MAIN LOOPS -- */
  1208.   
  1209. ! static long lastping, curtime;
  1210.   
  1211.   void
  1212.   main_loop()
  1213.   {
  1214.       register int fd, rc;
  1215. -     int mask, old_mask;
  1216.       struct timeval tv;
  1217.   
  1218.       /* Some signals need to be blocked while doing internal
  1219.        * processing, else some craziness might occur.
  1220.        */
  1221.   
  1222.       mask = 0;
  1223.   
  1224. ! #ifdef SIGWINCH
  1225.       mask |= sigmask(SIGWINCH);
  1226.   #endif
  1227.   
  1228.       /* For housecleaning to occur every CLEAN_INTERVAL seconds, we make
  1229.        * our own little timer system.  SIGALRM is nice; in fact it's so
  1230.        * useful that we'll be using it in other parts of YTalk.  Since
  1231. --- 103,139 ----
  1232.   
  1233.   /* -- MAIN LOOPS -- */
  1234.   
  1235. ! static ylong lastping, curtime;
  1236.   
  1237.   void
  1238.   main_loop()
  1239.   {
  1240.       register int fd, rc;
  1241.       struct timeval tv;
  1242. + #ifndef Y_USE_SIGHOLD
  1243. +     int mask, old_mask;
  1244. + #endif
  1245.   
  1246.       /* Some signals need to be blocked while doing internal
  1247.        * processing, else some craziness might occur.
  1248.        */
  1249.   
  1250. + #ifndef Y_USE_SIGHOLD
  1251.       mask = 0;
  1252.   
  1253. ! # ifdef SIGWINCH
  1254.       mask |= sigmask(SIGWINCH);
  1255. + # endif
  1256.   #endif
  1257.   
  1258. + #if defined(SIGCHLD)
  1259. +     signal(SIGCHLD, SIG_IGN);
  1260. + #elif defined(SIGCLD)
  1261. +     signal(SIGCLD, SIG_IGN);
  1262. + #endif
  1263.       /* For housecleaning to occur every CLEAN_INTERVAL seconds, we make
  1264.        * our own little timer system.  SIGALRM is nice; in fact it's so
  1265.        * useful that we'll be using it in other parts of YTalk.  Since
  1266. ***************
  1267. *** 129,135 ****
  1268.        */
  1269.   
  1270.       house_clean();
  1271. !     curtime = lastping = time(NULL);
  1272.       for(;;)
  1273.       {
  1274.       /* check if we're done */
  1275. --- 141,147 ----
  1276.        */
  1277.   
  1278.       house_clean();
  1279. !     curtime = lastping = (ylong)time(NULL);
  1280.       for(;;)
  1281.       {
  1282.       /* check if we're done */
  1283. ***************
  1284. *** 154,160 ****
  1285. --- 166,178 ----
  1286.   
  1287.       /* block signals while doing internal processing */
  1288.   
  1289. + #ifdef Y_USE_SIGHOLD
  1290. + # ifdef SIGWINCH
  1291. +     sighold(SIGWINCH);
  1292. + # endif
  1293. + #else
  1294.       old_mask = sigblock(mask);
  1295. + #endif
  1296.   
  1297.       /* process file descriptors with input waiting */
  1298.   
  1299. ***************
  1300. *** 170,185 ****
  1301.   
  1302.       /* check timer */
  1303.   
  1304. !     curtime = time(NULL);
  1305.       if(curtime - lastping >= CLEAN_INTERVAL)
  1306.       {
  1307.           house_clean();
  1308. !         lastping = time(NULL);
  1309.       }
  1310.   
  1311.       /* re-allow signals */
  1312.   
  1313.       sigsetmask(old_mask);
  1314.       if(user_winch)
  1315.       {
  1316.           /* This is a cute hack that updates a user menu
  1317. --- 188,209 ----
  1318.   
  1319.       /* check timer */
  1320.   
  1321. !     curtime = (ylong)time(NULL);
  1322.       if(curtime - lastping >= CLEAN_INTERVAL)
  1323.       {
  1324.           house_clean();
  1325. !         lastping = (ylong)time(NULL);
  1326.       }
  1327.   
  1328.       /* re-allow signals */
  1329.   
  1330. + #ifdef Y_USE_SIGHOLD
  1331. + # ifdef SIGWINCH
  1332. +     sigrelse(SIGWINCH);
  1333. + # endif
  1334. + #else
  1335.       sigsetmask(old_mask);
  1336. + #endif
  1337.       if(user_winch)
  1338.       {
  1339.           /* This is a cute hack that updates a user menu
  1340. ***************
  1341. *** 248,259 ****
  1342.   
  1343.       /* check timer */
  1344.   
  1345. !     curtime = time(NULL);
  1346.       if(curtime - lastping >= CLEAN_INTERVAL)
  1347.       {
  1348.           input_flag = 1;
  1349.           house_clean();
  1350. !         lastping = time(NULL);
  1351.       }
  1352.       }
  1353.       input_flag = 0;
  1354. --- 272,283 ----
  1355.   
  1356.       /* check timer */
  1357.   
  1358. !     curtime = (ylong)time(NULL);
  1359.       if(curtime - lastping >= CLEAN_INTERVAL)
  1360.       {
  1361.           input_flag = 1;
  1362.           house_clean();
  1363. !         lastping = (ylong)time(NULL);
  1364.       }
  1365.       }
  1366.       input_flag = 0;
  1367. *** 3.0.0/menu.c    Mon Aug 23 14:05:04 1993
  1368. --- menu.c    Mon Aug 23 11:31:43 1993
  1369. ***************
  1370. *** 175,185 ****
  1371.     ychar key;
  1372.   {
  1373.       register yuser *u;
  1374. !     u_long old_flags;
  1375.   
  1376.       old_flags = def_flags;
  1377.       switch(key)
  1378.       {
  1379.       case 's':    /* toggle scrolling */
  1380.           def_flags ^= FL_SCROLL;
  1381.           break;
  1382. --- 175,188 ----
  1383.     ychar key;
  1384.   {
  1385.       register yuser *u;
  1386. !     ylong old_flags;
  1387.   
  1388.       old_flags = def_flags;
  1389.       switch(key)
  1390.       {
  1391. +     case 'a':    /* toggle asides */
  1392. +         def_flags ^= FL_ASIDE;
  1393. +         break;
  1394.       case 's':    /* toggle scrolling */
  1395.           def_flags ^= FL_SCROLL;
  1396.           break;
  1397. ***************
  1398. *** 713,718 ****
  1399. --- 716,732 ----
  1400.       option_menu[i].func = option_menu_sel;
  1401.       option_menu[i].key = 'r';
  1402.       i++;
  1403. +     if(term_does_asides())
  1404. +     {
  1405. +     if(def_flags & FL_ASIDE)
  1406. +         option_menu[i].item = "turn asides off";
  1407. +     else
  1408. +         option_menu[i].item = "turn asides on";
  1409. +     option_menu[i].func = option_menu_sel;
  1410. +     option_menu[i].key = 'a';
  1411. +     i++;
  1412. +     }
  1413.   
  1414.       return show_menu(option_menu, i);
  1415.   }
  1416. *** 3.0.0/exec.c    Mon Aug 23 14:05:04 1993
  1417. --- exec.c    Tue Aug 24 14:40:49 1993
  1418. ***************
  1419. *** 102,108 ****
  1420.       return;
  1421.       }
  1422.       show_input(me, buf, rc);
  1423. !     send_users(buf, rc);
  1424.   }
  1425.   
  1426.   static void
  1427. --- 102,108 ----
  1428.       return;
  1429.       }
  1430.       show_input(me, buf, rc);
  1431. !     send_users(me, buf, rc);
  1432.   }
  1433.   
  1434.   static void
  1435. ***************
  1436. *** 147,157 ****
  1437.       msg_term(me, "cannot get pseudo terminal");
  1438.       return;
  1439.       }
  1440. !     if((shell = getenv("SHELL")) == NULL)
  1441.       shell = "/bin/sh";
  1442.       calculate_size(&prows, &pcols);
  1443.       if((pid = fork()) == 0)
  1444.       {
  1445.       close_all();
  1446.           if(setsid() < 0)
  1447.               exit(-1);
  1448. --- 147,158 ----
  1449.       msg_term(me, "cannot get pseudo terminal");
  1450.       return;
  1451.       }
  1452. !     if((shell = (char *)getenv("SHELL")) == NULL)
  1453.       shell = "/bin/sh";
  1454.       calculate_size(&prows, &pcols);
  1455.       if((pid = fork()) == 0)
  1456.       {
  1457. +     close(fd);
  1458.       close_all();
  1459.           if(setsid() < 0)
  1460.               exit(-1);
  1461. ***************
  1462. *** 161,166 ****
  1463. --- 162,173 ----
  1464.           dup2(fd, 1);
  1465.           dup2(fd, 2);
  1466.   
  1467. +     /* tricky bit -- ignore WINCH */
  1468. + #ifdef SIGWINCH
  1469. +     signal(SIGWINCH, SIG_IGN);
  1470. + #endif
  1471.       /* set terminal characteristics */
  1472.   
  1473.       set_terminal_flags(fd);
  1474. ***************
  1475. *** 188,193 ****
  1476. --- 195,201 ----
  1477.       pfd = fd;
  1478.       running_process = 1;
  1479.       lock_flags(FL_RAW | FL_SCROLL);
  1480. +     set_raw_term();
  1481.       add_fd(fd, exec_input);
  1482.   }
  1483.   
  1484. ***************
  1485. *** 211,216 ****
  1486. --- 219,225 ----
  1487.       close(pfd);
  1488.       running_process = 0;
  1489.       unlock_flags();
  1490. +     set_cooked_term();
  1491.       end_win_region(me);
  1492.   }
  1493.   
  1494. ***************
  1495. *** 223,231 ****
  1496. --- 232,250 ----
  1497.   
  1498.       if(!running_process)
  1499.       return;
  1500. +     /* if the winch has no effect, return now */
  1501.       calculate_size(&rows, &cols);
  1502.       if(rows == prows && cols == pcols)
  1503. +     {
  1504. +     if(prows != me->rows || pcols != me->cols)
  1505. +         set_win_region(me, prows, pcols);
  1506.       return;
  1507. +     }
  1508. +     /* oh well -- redo everything */
  1509.       prows = rows;
  1510.       pcols = cols;
  1511.       set_terminal_size(pfd, prows, pcols);
  1512. *** 3.0.0/rc.c    Mon Aug 23 14:05:05 1993
  1513. --- rc.c    Tue Aug 24 14:41:04 1993
  1514. ***************
  1515. *** 46,52 ****
  1516.   set_option(opt, value)
  1517.     char *opt, *value;
  1518.   {
  1519. !     u_long mask = 0L;
  1520.       int set_it;
  1521.   
  1522.       if(strcmp(value, "true") == 0 || strcmp(value, "on") == 0)
  1523. --- 46,52 ----
  1524.   set_option(opt, value)
  1525.     char *opt, *value;
  1526.   {
  1527. !     ylong mask = 0;
  1528.       int set_it;
  1529.   
  1530.       if(strcmp(value, "true") == 0 || strcmp(value, "on") == 0)
  1531. ***************
  1532. *** 81,87 ****
  1533.       || strcmp(opt, "autoinvite") == 0
  1534.       || strcmp(opt, "aiv") == 0
  1535.       || strcmp(opt, "av") == 0)
  1536. !     mask |= FL_IMPORT;
  1537.   
  1538.       if(strcmp(opt, "ring") == 0
  1539.       || strcmp(opt, "auto-ring") == 0
  1540. --- 81,87 ----
  1541.       || strcmp(opt, "autoinvite") == 0
  1542.       || strcmp(opt, "aiv") == 0
  1543.       || strcmp(opt, "av") == 0)
  1544. !     mask |= FL_INVITE;
  1545.   
  1546.       if(strcmp(opt, "ring") == 0
  1547.       || strcmp(opt, "auto-ring") == 0
  1548. ***************
  1549. *** 98,103 ****
  1550. --- 98,108 ----
  1551.       || strcmp(opt, "x") == 0
  1552.       || strcmp(opt, "X") == 0)
  1553.       mask |= FL_XWIN;
  1554. +     if(strcmp(opt, "asides") == 0
  1555. +     || strcmp(opt, "aside") == 0
  1556. +     || strcmp(opt, "as") == 0)
  1557. +     mask |= FL_ASIDE;
  1558.       
  1559.       if(!mask)
  1560.       return -1;
  1561. ***************
  1562. *** 110,137 ****
  1563.       return 0;
  1564.   }
  1565.   
  1566. ! /* ---- global functions ---- */
  1567. ! void
  1568. ! read_ytalkrc()
  1569.   {
  1570.       FILE *fp;
  1571.       char *buf, *ptr;
  1572.       char *w, *arg1, *arg2, *arg3;
  1573.       int line_no, errline;
  1574. -     yuser *u;
  1575.   
  1576. !     if((w = getenv("HOME")) == NULL)
  1577. !     return;
  1578. !     buf = get_mem(BUFSIZ);
  1579. !     sprintf(buf, "%s/.ytalkrc", w);
  1580. !     if((fp = fopen(buf, "r")) == NULL)
  1581.       {
  1582.       if(errno != ENOENT)
  1583. !         show_error(buf);
  1584. !     free(buf);
  1585.       return;
  1586.       }
  1587.   
  1588.       line_no = errline = 0;
  1589.       while(fgets(buf, BUFSIZ, fp) != NULL)
  1590. --- 115,136 ----
  1591.       return 0;
  1592.   }
  1593.   
  1594. ! static void
  1595. ! read_rcfile(fname)
  1596. !   char *fname;
  1597.   {
  1598.       FILE *fp;
  1599.       char *buf, *ptr;
  1600.       char *w, *arg1, *arg2, *arg3;
  1601.       int line_no, errline;
  1602.   
  1603. !     if((fp = fopen(fname, "r")) == NULL)
  1604.       {
  1605.       if(errno != ENOENT)
  1606. !         show_error(fname);
  1607.       return;
  1608.       }
  1609. +     buf = get_mem(BUFSIZ);
  1610.   
  1611.       line_no = errline = 0;
  1612.       while(fgets(buf, BUFSIZ, fp) != NULL)
  1613. ***************
  1614. *** 177,183 ****
  1615.       }
  1616.       if(errline)
  1617.       {
  1618. !     sprintf(errstr, ".ytalkrc: syntax error at line %d", errline);
  1619.       errno = 0;
  1620.       show_error(errstr);
  1621.       }
  1622. --- 176,182 ----
  1623.       }
  1624.       if(errline)
  1625.       {
  1626. !     sprintf(errstr, "%s: syntax error at line %d", fname, errline);
  1627.       errno = 0;
  1628.       show_error(errstr);
  1629.       }
  1630. ***************
  1631. *** 184,189 ****
  1632. --- 183,214 ----
  1633.   
  1634.       free(buf);
  1635.       fclose(fp);
  1636. + }
  1637. + /* ---- global functions ---- */
  1638. + void
  1639. + read_ytalkrc()
  1640. + {
  1641. +     char *w;
  1642. +     yuser *u;
  1643. +     char fname[256];
  1644. +     /* read the system ytalkrc file */
  1645. + #ifdef SYSTEM_YTALKRC
  1646. +     read_rcfile(SYSTEM_YTALKRC);
  1647. + #endif
  1648. +     /* read the user's ytalkrc file */
  1649. +     if((w = (char *)getenv("HOME")) != NULL)
  1650. +     {
  1651. +     sprintf(fname, "%s/.ytalkrc", w);
  1652. +     read_rcfile(fname);
  1653. +     }
  1654. +     /* set all default flags */
  1655.   
  1656.       for(u = user_list; u != NULL; u = u->unext)
  1657.       if(!(u->flags & FL_LOCKED))
  1658. *** 3.0.0/socket.c    Mon Aug 23 14:05:05 1993
  1659. --- socket.c    Sun Aug 22 21:03:21 1993
  1660. ***************
  1661. *** 35,42 ****
  1662.   
  1663.   static int autofd = -1;            /* auto invite socket fd */
  1664.   static struct sockaddr_in autosock;    /* auto invite socket */
  1665. ! static long autoid[MAXDAEMON+1];    /* auto invite seq numbers */
  1666. ! static u_long announce_id = 0;        /* announce sequence id */
  1667.   static readdr *readdr_list = NULL;    /* list of re-addresses */
  1668.   
  1669.   #define IN_ADDR(s)    ((s).sin_addr.s_addr)
  1670. --- 35,42 ----
  1671.   
  1672.   static int autofd = -1;            /* auto invite socket fd */
  1673.   static struct sockaddr_in autosock;    /* auto invite socket */
  1674. ! static ylong autoid[MAXDAEMON+1];    /* auto invite seq numbers */
  1675. ! static ylong announce_id = 0;        /* announce sequence id */
  1676.   static readdr *readdr_list = NULL;    /* list of re-addresses */
  1677.   
  1678.   #define IN_ADDR(s)    ((s).sin_addr.s_addr)
  1679. ***************
  1680. *** 188,194 ****
  1681.       show_error("init_autoport: listen() failed");
  1682.       return;
  1683.       }
  1684. !     (void)memset(autoid, 0, (MAXDAEMON + 1) * sizeof(long));
  1685.       add_fd(autofd, read_autoport);
  1686.   }
  1687.   
  1688. --- 188,194 ----
  1689.       show_error("init_autoport: listen() failed");
  1690.       return;
  1691.       }
  1692. !     (void)memset(autoid, 0, (MAXDAEMON + 1) * sizeof(ylong));
  1693.       add_fd(autofd, read_autoport);
  1694.   }
  1695.   
  1696. ***************
  1697. *** 198,204 ****
  1698.   static void
  1699.   place_my_address(sock, addr)
  1700.     struct sockaddr_in *sock;
  1701. !   register u_long addr;
  1702.   {
  1703.       register readdr *r;
  1704.   
  1705. --- 198,204 ----
  1706.   static void
  1707.   place_my_address(sock, addr)
  1708.     struct sockaddr_in *sock;
  1709. !   register ylong addr;
  1710.   {
  1711.       register readdr *r;
  1712.   
  1713. ***************
  1714. *** 220,226 ****
  1715.    */
  1716.   static int
  1717.   sendit(addr, d)
  1718. !   u_long addr;    /* host internet address */
  1719.     int d;    /* daemon number */
  1720.   {
  1721.       int n;
  1722. --- 220,226 ----
  1723.    */
  1724.   static int
  1725.   sendit(addr, d)
  1726. !   ylong addr;    /* host internet address */
  1727.     int d;    /* daemon number */
  1728.   {
  1729.       int n;
  1730. ***************
  1731. *** 379,385 ****
  1732.    */
  1733.   static int
  1734.   find_daemon(addr)
  1735. !   u_long addr;
  1736.   {
  1737.       register hostinfo *h;
  1738.       register int n, i, d;
  1739. --- 379,385 ----
  1740.    */
  1741.   static int
  1742.   find_daemon(addr)
  1743. !   ylong addr;
  1744.   {
  1745.       register hostinfo *h;
  1746.       register int n, i, d;
  1747. ***************
  1748. *** 468,486 ****
  1749.       return 0;
  1750.   }
  1751.   
  1752. ! static u_long
  1753.   make_net_mask(addr)
  1754. !   u_long addr;
  1755.   {
  1756. !     if(addr & (u_long)0xff)
  1757. !     return (u_long)0xffffffff;
  1758. !     if(addr & (u_long)0xffff)
  1759. !     return (u_long)0xffffff00;
  1760. !     if(addr & (u_long)0xffffff)
  1761. !     return (u_long)0xffff0000;
  1762.       if(addr)
  1763. !     return (u_long)0xff000000;
  1764. !     return (u_long)0;
  1765.   }
  1766.   
  1767.   /* ---- global functions ---- */
  1768. --- 468,486 ----
  1769.       return 0;
  1770.   }
  1771.   
  1772. ! static ylong
  1773.   make_net_mask(addr)
  1774. !   ylong addr;
  1775.   {
  1776. !     if(addr & (ylong)0xff)
  1777. !     return (ylong)0xffffffff;
  1778. !     if(addr & (ylong)0xffff)
  1779. !     return (ylong)0xffffff00;
  1780. !     if(addr & (ylong)0xffffff)
  1781. !     return (ylong)0xffff0000;
  1782.       if(addr)
  1783. !     return (ylong)0xff000000;
  1784. !     return (ylong)0;
  1785.   }
  1786.   
  1787.   /* ---- global functions ---- */
  1788. ***************
  1789. *** 540,546 ****
  1790.     yuser *user;
  1791.     u_char type;
  1792.   {
  1793. !     u_long addr;
  1794.       int d;
  1795.   
  1796.       /* set up the message type and where to send it */
  1797. --- 540,546 ----
  1798.     yuser *user;
  1799.     u_char type;
  1800.   {
  1801. !     ylong addr;
  1802.       int d;
  1803.   
  1804.       /* set up the message type and where to send it */
  1805. ***************
  1806. *** 822,834 ****
  1807.   
  1808.   /* Find a host's address.
  1809.    */
  1810. ! u_long
  1811.   get_host_addr(hostname)
  1812.     char *hostname;
  1813.   {
  1814.       struct hostent *host;
  1815. !     u_long addr;
  1816. !     u_long inet_addr();
  1817.   
  1818.       if((host = (struct hostent *) gethostbyname(hostname)) != NULL)
  1819.       {
  1820. --- 822,834 ----
  1821.   
  1822.   /* Find a host's address.
  1823.    */
  1824. ! ylong
  1825.   get_host_addr(hostname)
  1826.     char *hostname;
  1827.   {
  1828.       struct hostent *host;
  1829. !     ylong addr;
  1830. !     ylong inet_addr();
  1831.   
  1832.       if((host = (struct hostent *) gethostbyname(hostname)) != NULL)
  1833.       {
  1834. ***************
  1835. *** 836,847 ****
  1836.       {
  1837.           sprintf(errstr, "Bad IN addr: %s\n", hostname);
  1838.           show_error(errstr);
  1839. !         return (u_long)-1;
  1840.       }
  1841.       (void)memcpy(&addr, host->h_addr, sizeof(addr));
  1842.       }
  1843. !     else if((addr = inet_addr(hostname)) == (u_long)-1)
  1844. !     return (u_long)-1;
  1845.       return addr;
  1846.   }
  1847.   
  1848. --- 836,847 ----
  1849.       {
  1850.           sprintf(errstr, "Bad IN addr: %s\n", hostname);
  1851.           show_error(errstr);
  1852. !         return (ylong)-1;
  1853.       }
  1854.       (void)memcpy(&addr, host->h_addr, sizeof(addr));
  1855.       }
  1856. !     else if((addr = (ylong)inet_addr(hostname)) == (ylong)-1)
  1857. !     return (ylong)-1;
  1858.       return addr;
  1859.   }
  1860.   
  1861. ***************
  1862. *** 849,855 ****
  1863.    */
  1864.   char *
  1865.   host_name(addr)
  1866. !   u_long addr;
  1867.   {
  1868.       struct hostent *host;
  1869.       char *inet_ntoa();
  1870. --- 849,855 ----
  1871.    */
  1872.   char *
  1873.   host_name(addr)
  1874. !   ylong addr;
  1875.   {
  1876.       struct hostent *host;
  1877.       char *inet_ntoa();
  1878. ***************
  1879. *** 873,894 ****
  1880.     char *from_id, *to_id, *on_id;
  1881.   {
  1882.       register readdr *new;
  1883. !     u_long from_addr, to_addr, on_addr;
  1884. !     u_long from_mask, to_mask, on_mask;
  1885.   
  1886. !     if((from_addr = get_host_addr(from_id)) == (u_long)-1)
  1887.       {
  1888.       sprintf(errstr, "Unknown host: '%s'\n", from_id);
  1889.       show_error(errstr);
  1890.       return;
  1891.       }
  1892. !     if((to_addr = get_host_addr(to_id)) == (u_long)-1)
  1893.       {
  1894.       sprintf(errstr, "Unknown host: '%s'\n", to_id);
  1895.       show_error(errstr);
  1896.       return;
  1897.       }
  1898. !     if((on_addr = get_host_addr(on_id)) == (u_long)-1)
  1899.       {
  1900.       sprintf(errstr, "Unknown host: '%s'\n", on_id);
  1901.       show_error(errstr);
  1902. --- 873,894 ----
  1903.     char *from_id, *to_id, *on_id;
  1904.   {
  1905.       register readdr *new;
  1906. !     ylong from_addr, to_addr, on_addr;
  1907. !     ylong from_mask, to_mask, on_mask;
  1908.   
  1909. !     if((from_addr = get_host_addr(from_id)) == (ylong)-1)
  1910.       {
  1911.       sprintf(errstr, "Unknown host: '%s'\n", from_id);
  1912.       show_error(errstr);
  1913.       return;
  1914.       }
  1915. !     if((to_addr = get_host_addr(to_id)) == (ylong)-1)
  1916.       {
  1917.       sprintf(errstr, "Unknown host: '%s'\n", to_id);
  1918.       show_error(errstr);
  1919.       return;
  1920.       }
  1921. !     if((on_addr = get_host_addr(on_id)) == (ylong)-1)
  1922.       {
  1923.       sprintf(errstr, "Unknown host: '%s'\n", on_id);
  1924.       show_error(errstr);
  1925. *** 3.0.0/user.c    Mon Aug 23 14:05:05 1993
  1926. --- user.c    Tue Aug 24 15:44:59 1993
  1927. ***************
  1928. *** 27,34 ****
  1929.   yuser *wait_list;        /* list of connected users */
  1930.   yuser *fd_to_user[MAX_FILES];    /* convert file descriptors to users */
  1931.   yuser *key_to_user[128];    /* convert menu ident chars to users */
  1932. ! u_long def_flags = 0L;        /* default FL_* flags */
  1933. ! static u_long daemon_id;    /* running daemon ID counter */
  1934.   
  1935.   /* ---- local functions ----- */
  1936.   
  1937. --- 27,34 ----
  1938.   yuser *wait_list;        /* list of connected users */
  1939.   yuser *fd_to_user[MAX_FILES];    /* convert file descriptors to users */
  1940.   yuser *key_to_user[128];    /* convert menu ident chars to users */
  1941. ! ylong def_flags = 0L;        /* default FL_* flags */
  1942. ! static ylong daemon_id;    /* running daemon ID counter */
  1943.   
  1944.   /* ---- local functions ----- */
  1945.   
  1946. ***************
  1947. *** 41,47 ****
  1948.       register struct passwd *pw;
  1949.       passwd_opened = 1;
  1950.       if((pw = getpwnam(name)) == NULL)
  1951. !     return -1;
  1952.       return pw->pw_uid;
  1953.   }
  1954.   
  1955. --- 41,47 ----
  1956.       register struct passwd *pw;
  1957.       passwd_opened = 1;
  1958.       if((pw = getpwnam(name)) == NULL)
  1959. !     return -60000;    /* for most archs, an impossible user ID */
  1960.       return pw->pw_uid;
  1961.   }
  1962.   
  1963. ***************
  1964. *** 59,69 ****
  1965.   static void
  1966.   close_passwd()
  1967.   {
  1968. -     extern void endpwent();
  1969.       if(passwd_opened)
  1970.       {
  1971. !     endpwent();
  1972.       passwd_opened = 0;
  1973.       }
  1974.   }
  1975. --- 59,67 ----
  1976.   static void
  1977.   close_passwd()
  1978.   {
  1979.       if(passwd_opened)
  1980.       {
  1981. !     (void)endpwent();
  1982.       passwd_opened = 0;
  1983.       }
  1984.   }
  1985. ***************
  1986. *** 147,157 ****
  1987.       /* get my username */
  1988.   
  1989.       if((my_name = getlogin()) != NULL)
  1990. !     if(my_uid < 0 || user_id(my_name) != my_uid)
  1991.           my_name = NULL;
  1992.       if(my_name == NULL)
  1993. !     my_name = user_name(getuid());
  1994.       if(my_name == NULL)
  1995.       {
  1996.       show_error("Who are you?");
  1997.       bail(YTE_ERROR);
  1998. --- 145,157 ----
  1999.       /* get my username */
  2000.   
  2001.       if((my_name = getlogin()) != NULL)
  2002. !     if(user_id(my_name) != my_uid)
  2003.           my_name = NULL;
  2004.       if(my_name == NULL)
  2005. !     my_name = user_name(my_uid);
  2006.       if(my_name == NULL)
  2007. +     my_name = getlogin();
  2008. +     if(my_name == NULL || my_name[0] == '\0')
  2009.       {
  2010.       show_error("Who are you?");
  2011.       bail(YTE_ERROR);
  2012. ***************
  2013. *** 184,190 ****
  2014.     char *name, *hostname, *tty;
  2015.   {
  2016.       register yuser *out, *u;
  2017. !     u_long addr;
  2018.   
  2019.       /* find the host address */
  2020.   
  2021. --- 184,190 ----
  2022.     char *name, *hostname, *tty;
  2023.   {
  2024.       register yuser *out, *u;
  2025. !     ylong addr;
  2026.   
  2027.       /* find the host address */
  2028.   
  2029. ***************
  2030. *** 193,199 ****
  2031.       hostname = me->host_name;
  2032.       addr = me->host_addr;
  2033.       }
  2034. !     else if((addr = get_host_addr(hostname)) == (u_long)-1)
  2035.       {
  2036.       sprintf(errstr, "new_user: bad host: '%s'\n", hostname);
  2037.       show_error(errstr);
  2038. --- 193,199 ----
  2039.       hostname = me->host_name;
  2040.       addr = me->host_addr;
  2041.       }
  2042. !     else if((addr = get_host_addr(hostname)) == (ylong)-1)
  2043.       {
  2044.       sprintf(errstr, "new_user: bad host: '%s'\n", hostname);
  2045.       show_error(errstr);
  2046. ***************
  2047. *** 298,324 ****
  2048.   }
  2049.   
  2050.   /* Find a user by name/host/pid.  If name is NULL, then it is not checked.
  2051. !  * If host_addr is (u_long)-1 then it is not checked.  If pid is (u_long)-1
  2052.    * then it is not checked.
  2053.    */
  2054.   yuser *
  2055.   find_user(name, host_addr, pid)
  2056.     char *name;
  2057. !   u_long host_addr, pid;
  2058.   {
  2059.       register yuser *u;
  2060.   
  2061.       for(u = user_list; u; u = u->unext)
  2062.       if(name == NULL || strcmp(u->user_name, name) == 0)
  2063. !         if(host_addr == (u_long)-1 || u->host_addr == host_addr)
  2064. !         if(pid == (u_long)-1 || u->remote.pid == pid)
  2065.               return u;
  2066.       
  2067.       /* it could be _me_! */
  2068.   
  2069.       if(name == NULL || strcmp(me->user_name, name) == 0)
  2070. !     if(host_addr == (u_long)-1 || me->host_addr == host_addr)
  2071. !         if(pid == (u_long)-1 || me->remote.pid == pid)
  2072.           return me;
  2073.   
  2074.       /* nobody I know */
  2075. --- 298,324 ----
  2076.   }
  2077.   
  2078.   /* Find a user by name/host/pid.  If name is NULL, then it is not checked.
  2079. !  * If host_addr is (ylong)-1 then it is not checked.  If pid is (ylong)-1
  2080.    * then it is not checked.
  2081.    */
  2082.   yuser *
  2083.   find_user(name, host_addr, pid)
  2084.     char *name;
  2085. !   ylong host_addr, pid;
  2086.   {
  2087.       register yuser *u;
  2088.   
  2089.       for(u = user_list; u; u = u->unext)
  2090.       if(name == NULL || strcmp(u->user_name, name) == 0)
  2091. !         if(host_addr == (ylong)-1 || u->host_addr == host_addr)
  2092. !         if(pid == (ylong)-1 || u->remote.pid == pid)
  2093.               return u;
  2094.       
  2095.       /* it could be _me_! */
  2096.   
  2097.       if(name == NULL || strcmp(me->user_name, name) == 0)
  2098. !     if(host_addr == (ylong)-1 || me->host_addr == host_addr)
  2099. !         if(pid == (ylong)-1 || me->remote.pid == pid)
  2100.           return me;
  2101.   
  2102.       /* nobody I know */
  2103. *** 3.0.0/term.c    Mon Aug 23 14:05:05 1993
  2104. --- term.c    Tue Aug 24 11:00:02 1993
  2105. ***************
  2106. *** 26,32 ****
  2107.   #else
  2108.   # include <termios.h>
  2109.   #endif
  2110. ! #include "curses.h"
  2111.   #include "xwin.h"
  2112.   #include "menu.h"
  2113.   
  2114. --- 26,32 ----
  2115.   #else
  2116.   # include <termios.h>
  2117.   #endif
  2118. ! #include "cwin.h"
  2119.   #include "xwin.h"
  2120.   #include "menu.h"
  2121.   
  2122. ***************
  2123. *** 170,176 ****
  2124.   
  2125.       /* set me up a terminal */
  2126.   
  2127. !     sprintf(tmpstr, "YTalk version %d.%d", VMAJOR, VMINOR);
  2128.       if(open_term(me, tmpstr) < 0)
  2129.       {
  2130.       end_term();
  2131. --- 170,176 ----
  2132.   
  2133.       /* set me up a terminal */
  2134.   
  2135. !     sprintf(tmpstr, "YTalk version %d.%d (%d)", VMAJOR, VMINOR, VPATCH);
  2136.       if(open_term(me, tmpstr) < 0)
  2137.       {
  2138.       end_term();
  2139. ***************
  2140. *** 386,391 ****
  2141. --- 386,392 ----
  2142.   {
  2143.       register int i;
  2144.       register ychar *c;
  2145. +     int sy, sx;
  2146.   
  2147.       if(user->sc_bot > user->sc_top)
  2148.       {
  2149. ***************
  2150. *** 406,413 ****
  2151. --- 407,417 ----
  2152.       }
  2153.       else
  2154.       {
  2155. +     sy = user->y;
  2156. +     sx = user->x;
  2157.       move_term(user, user->sc_top, 0);
  2158.       clreol_term(user);
  2159. +     move_term(user, sy, sx);
  2160.       }
  2161.   }
  2162.   
  2163. ***************
  2164. *** 419,424 ****
  2165. --- 423,429 ----
  2166.   {
  2167.       register int i;
  2168.       register ychar *c;
  2169. +     int sy, sx;
  2170.   
  2171.       if(user->sc_bot > user->sc_top)
  2172.       {
  2173. ***************
  2174. *** 439,446 ****
  2175. --- 444,454 ----
  2176.       }
  2177.       else
  2178.       {
  2179. +     sy = user->y;
  2180. +     sx = user->x;
  2181.       move_term(user, user->sc_top, 0);
  2182.       clreol_term(user);
  2183. +     move_term(user, sy, sx);
  2184.       }
  2185.   }
  2186.   
  2187. ***************
  2188. *** 1022,1027 ****
  2189. --- 1030,1037 ----
  2190.       old_width = user->cols;
  2191.       user->rows = user->t_rows;
  2192.       user->cols = user->t_cols;
  2193. +     user->sc_top = 0;
  2194. +     user->sc_bot = user->rows - 1;
  2195.       if(old_height < user->t_rows || old_width < user->t_cols)
  2196.       draw_box(user, old_height, old_width, ' ');
  2197.       user->region_set = 0;
  2198. ***************
  2199. *** 1166,1169 ****
  2200. --- 1176,1239 ----
  2201.       if(n >= width)
  2202.       return 0;
  2203.       return (width - n) >> 1;
  2204. + }
  2205. + void
  2206. + redraw_all_terms()
  2207. + {
  2208. +     register yuser *u;
  2209. +     switch(term_type)
  2210. +     {
  2211. +     case 1:        /* curses */
  2212. +         redisplay_curses();
  2213. +         break;
  2214. +     default:
  2215. +         redraw_term(me, 0);
  2216. +         flush_term(me);
  2217. +         for(u = connect_list; u; u = u->next)
  2218. +         {
  2219. +         redraw_term(u, 0);
  2220. +         flush_term(u);
  2221. +         }
  2222. +     }
  2223. + }
  2224. + void
  2225. + set_raw_term()
  2226. + {
  2227. +     /* only some terminal systems need to do this */
  2228. +     switch(term_type)
  2229. +     {
  2230. +     case 1:        /* curses */
  2231. +         set_raw_curses();
  2232. +         break;
  2233. +     }
  2234. + }
  2235. + void
  2236. + set_cooked_term()
  2237. + {
  2238. +     /* only some terminal systems need to do this */
  2239. +     switch(term_type)
  2240. +     {
  2241. +     case 1:        /* curses */
  2242. +         set_cooked_curses();
  2243. +         break;
  2244. +     }
  2245. + }
  2246. + int
  2247. + term_does_asides()
  2248. + {
  2249. +     /* only some terminal systems can do this */
  2250. +     switch(term_type)
  2251. +     {
  2252. +     case 2:        /* X11 */
  2253. +         return 1;
  2254. +     }
  2255. +     return 0;
  2256.   }
  2257. *** 3.0.0/cwin.c    Mon Aug 23 14:05:06 1993
  2258. --- cwin.c    Tue Aug 24 11:31:34 1993
  2259. ***************
  2260. *** 1,4 ****
  2261. ! /* curses.c -- curses interface */
  2262.   
  2263.   /*               NOTICE
  2264.    *
  2265. --- 1,4 ----
  2266. ! /* cwin.c -- curses interface */
  2267.   
  2268.   /*               NOTICE
  2269.    *
  2270. ***************
  2271. *** 19,25 ****
  2272.   #include "header.h"
  2273.   #include <curses.h>
  2274.   #include <sys/signal.h>
  2275. ! #include "curses.h"
  2276.   
  2277.   typedef struct _ywin {
  2278.       struct _ywin *next;        /* next ywin in linked list */
  2279. --- 19,25 ----
  2280.   #include "header.h"
  2281.   #include <curses.h>
  2282.   #include <sys/signal.h>
  2283. ! #include "cwin.h"
  2284.   
  2285.   typedef struct _ywin {
  2286.       struct _ywin *next;        /* next ywin in linked list */
  2287. ***************
  2288. *** 49,55 ****
  2289.           bail(YTE_SUCCESS);
  2290.       bail(YTE_ERROR);
  2291.       }
  2292. !     my_input(buf, rc);
  2293.   }
  2294.   
  2295.   static ywin *
  2296. --- 49,55 ----
  2297.           bail(YTE_SUCCESS);
  2298.       bail(YTE_ERROR);
  2299.       }
  2300. !     my_input(me, buf, rc);
  2301.   }
  2302.   
  2303.   static ywin *
  2304. ***************
  2305. *** 188,194 ****
  2306.   {
  2307.       LINES = COLS = 0;    /* so resizes will work */
  2308.       initscr();
  2309. !     raw();
  2310.       crmode();
  2311.       noecho();
  2312.       clear();
  2313. --- 188,194 ----
  2314.   {
  2315.       LINES = COLS = 0;    /* so resizes will work */
  2316.       initscr();
  2317. !     noraw();
  2318.       crmode();
  2319.       noecho();
  2320.       clear();
  2321. ***************
  2322. *** 382,387 ****
  2323. --- 382,394 ----
  2324.       scrollok(w->win, TRUE);
  2325.       scroll(w->win);
  2326.       scrollok(w->win, FALSE);
  2327. +     /* Some curses won't leave the cursor in the same place, and some
  2328. +      * curses programs won't erase the bottom line properly.
  2329. +      */
  2330. +     wmove(w->win, user->t_rows - 1, 0);
  2331. +     wclrtoeol(w->win);
  2332. +     wmove(w->win, user->y, user->x);
  2333.   }
  2334.   
  2335.   void
  2336. ***************
  2337. *** 392,395 ****
  2338. --- 399,436 ----
  2339.   
  2340.       w = (ywin *)(user->term);
  2341.       wrefresh(w->win);
  2342. + }
  2343. + /* Clear and redisplay.
  2344. +  */
  2345. + void
  2346. + redisplay_curses()
  2347. + {
  2348. +     register ywin *w;
  2349. +     clear();
  2350. +     refresh();
  2351. +     for(w = head; w; w = w->next)
  2352. +     {
  2353. +     redraw_term(w->user, 0);
  2354. +     draw_title(w);
  2355. +     refresh();
  2356. +     wrefresh(w->win);
  2357. +     }
  2358. + }
  2359. + /* Set raw mode.
  2360. +  */
  2361. + void
  2362. + set_raw_curses()
  2363. + {
  2364. +     raw();
  2365. + }
  2366. + /* Set cooked mode.
  2367. +  */
  2368. + void
  2369. + set_cooked_curses()
  2370. + {
  2371. +     noraw();
  2372.   }
  2373. *** 3.0.0/xwin.c    Mon Aug 23 14:05:06 1993
  2374. --- xwin.c    Tue Aug 24 14:47:49 1993
  2375. ***************
  2376. *** 30,36 ****
  2377.   static XFontStruct     *text_font;    /* font */
  2378.   static GC        textGC,        /* text graphic context */
  2379.               invertGC;    /* graphic context for inverts */
  2380. ! static u_long        whitepix,    /* white pixel */
  2381.               blackpix;    /* black pixel */
  2382.   static int        font_width,    /* font width */
  2383.               font_height,    /* font height */
  2384. --- 30,36 ----
  2385.   static XFontStruct     *text_font;    /* font */
  2386.   static GC        textGC,        /* text graphic context */
  2387.               invertGC;    /* graphic context for inverts */
  2388. ! static ylong        whitepix,    /* white pixel */
  2389.               blackpix;    /* black pixel */
  2390.   static int        font_width,    /* font width */
  2391.               font_height,    /* font height */
  2392. ***************
  2393. *** 88,97 ****
  2394.   make_GC(gc, font, fgpixel, bgpixel, l_width, l_style, l_cap, l_join, gcfunc)
  2395.     GC *gc;
  2396.     XFontStruct *font;
  2397. !   u_long fgpixel, bgpixel;
  2398.     int l_width, l_style, l_cap, l_join, gcfunc;
  2399.   {
  2400. !     u_long mask = 0;
  2401.       XGCValues values;
  2402.   
  2403.       if(font != NULL)
  2404. --- 88,97 ----
  2405.   make_GC(gc, font, fgpixel, bgpixel, l_width, l_style, l_cap, l_join, gcfunc)
  2406.     GC *gc;
  2407.     XFontStruct *font;
  2408. !   ylong fgpixel, bgpixel;
  2409.     int l_width, l_style, l_cap, l_join, gcfunc;
  2410.   {
  2411. !     ylong mask = 0;
  2412.       XGCValues values;
  2413.   
  2414.       if(font != NULL)
  2415. ***************
  2416. *** 160,167 ****
  2417.           }
  2418.           break;
  2419.           case KeyPress:
  2420. !         n = XLookupString(&report, buf, 512, NULL, NULL);
  2421. !         my_input(buf, n);
  2422.           break;
  2423.       }
  2424.       }
  2425. --- 160,167 ----
  2426.           }
  2427.           break;
  2428.           case KeyPress:
  2429. !         n = XLookupString((XKeyEvent *) &report, buf, 512, NULL, NULL);
  2430. !         my_input(win_user(report.xkeymap.window), buf, n);
  2431.           break;
  2432.       }
  2433.       }
  2434. ***************
  2435. *** 184,190 ****
  2436.   void
  2437.   init_xwin()
  2438.   {
  2439. !     extern char *getenv();
  2440.       char    *displayName;
  2441.       char    *rfn, str[256];
  2442.       int        xfd;
  2443. --- 184,190 ----
  2444.   void
  2445.   init_xwin()
  2446.   {
  2447. !     char    *xrmstr;
  2448.       char    *displayName;
  2449.       char    *rfn, str[256];
  2450.       int        xfd;
  2451. ***************
  2452. *** 203,218 ****
  2453.   
  2454.       /* read all options */
  2455.   
  2456. !     db = XrmGetStringDatabase(XResourceManagerString(display));
  2457. !     if((rfn = getenv("HOME")) != NULL)
  2458.       {
  2459.       sprintf(str, "%s/.Xdefaults", rfn);
  2460.       if(access(str, 0) == 0)
  2461. !         XrmMergeDatabases(XrmGetFileDatabase(str), &db);
  2462.       }
  2463. !     if((rfn = getenv("XENVIRONMENT")) != NULL)
  2464. !     if(access(rfn, 0) == 0)
  2465. !         XrmMergeDatabases(XrmGetFileDatabase(rfn), &db);
  2466.       if(getOption("YTalk.reverse"))
  2467.       {
  2468.       whitepix = BlackPixel(display, screen_num);
  2469. --- 203,223 ----
  2470.   
  2471.       /* read all options */
  2472.   
  2473. !     db = NULL;
  2474. !     XrmInitialize();
  2475. !     if((xrmstr = XResourceManagerString(display)) != NULL)
  2476. !     db = XrmGetStringDatabase(xrmstr);
  2477. !     else if((rfn = (char *)getenv("XENVIRONMENT")) != NULL
  2478. !         && access(rfn, 0) == 0)
  2479. !     db = XrmGetFileDatabase(rfn);
  2480. !     else if((rfn = (char *)getenv("HOME")) != NULL)
  2481.       {
  2482.       sprintf(str, "%s/.Xdefaults", rfn);
  2483.       if(access(str, 0) == 0)
  2484. !         db = XrmGetFileDatabase(str);
  2485.       }
  2486. !     if(db == NULL)
  2487. !     db = XrmGetStringDatabase("");
  2488.       if(getOption("YTalk.reverse"))
  2489.       {
  2490.       whitepix = BlackPixel(display, screen_num);
  2491. ***************
  2492. *** 279,285 ****
  2493.       if(getOption("YTalk.geometry"))
  2494.       {
  2495.       XParseGeometry(getOption("YTalk.geometry"),
  2496. !         &size.x, &size.y, &size.width, &size.height);
  2497.   
  2498.       /* don't set USPosition -- it confuses tvtwm */
  2499.       }
  2500. --- 284,290 ----
  2501.       if(getOption("YTalk.geometry"))
  2502.       {
  2503.       XParseGeometry(getOption("YTalk.geometry"),
  2504. !         &size.x, &size.y, (u_int *)&size.width, (u_int *)&size.height);
  2505.   
  2506.       /* don't set USPosition -- it confuses tvtwm */
  2507.       }
  2508.