home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume2 / xmonitor / patch1 < prev    next >
Encoding:
Text File  |  1988-12-22  |  50.3 KB  |  1,893 lines

  1. Path: uunet!wyse!mikew
  2. From: mikew@wyse.wyse.com (Mike Wexler)
  3. Newsgroups: comp.sources.x
  4. Subject: v02i050:  monitor X11 Server/Client communications, Patch1
  5. Message-ID: <1928@wyse.wyse.com>
  6. Date: 22 Dec 88 17:48:05 GMT
  7. Organization: Wyse Technology, San Jose
  8. Lines: 1882
  9. Approved: mikew@wyse.com
  10.  
  11. Submitted-by: peterson@sw.MCC.COM (James Peterson)
  12. Posting-number: Volume 2, Issue 50
  13. Archive-name: xmonitor/patch1
  14.  
  15.  
  16. These patches fix a number of minor problems:
  17.  
  18. 1. Lint problems.
  19. 2. Portability problems with DONTLINGER and errno.h
  20. 3. Setting up to handle byte-swapping.
  21. 4. SendEvent generated events.
  22.  
  23. diff -c distribution/patchlevel.h ./patchlevel.h
  24. *** distribution/patchlevel.h    Thu Dec 22 09:42:09 1988
  25. --- ./patchlevel.h    Thu Dec 22 09:42:18 1988
  26. ***************
  27. *** 1,2 ****
  28. ! #define PATCHLEVEL 0
  29.   
  30. --- 1,2 ----
  31. ! #define PATCHLEVEL 1
  32.   
  33. diff -c distribution/common.c ./common.c
  34. *** distribution/common.c    Tue Dec 20 15:46:33 1988
  35. --- ./common.c    Tue Dec 20 17:37:11 1988
  36. ***************
  37. *** 112,124 ****
  38.   SetSignalHandling()
  39.   {
  40.     enterprocedure("SetSignalHandling");
  41. !   signal(SIGURG, SignalURG);
  42. !   signal(SIGPIPE, SignalPIPE);
  43. !   signal(SIGINT, SignalINT);
  44. !   signal(SIGQUIT, SignalQUIT);
  45. !   signal(SIGTERM, SignalTERM);
  46. !   signal(SIGTSTP, SignalTSTP);
  47. !   signal(SIGCONT, SignalCONT);
  48.   }
  49.   
  50.   
  51. --- 112,124 ----
  52.   SetSignalHandling()
  53.   {
  54.     enterprocedure("SetSignalHandling");
  55. !   (void)signal(SIGURG, SignalURG);
  56. !   (void)signal(SIGPIPE, SignalPIPE);
  57. !   (void)signal(SIGINT, SignalINT);
  58. !   (void)signal(SIGQUIT, SignalQUIT);
  59. !   (void)signal(SIGTERM, SignalTERM);
  60. !   (void)signal(SIGTSTP, SignalTSTP);
  61. !   (void)signal(SIGCONT, SignalCONT);
  62.   }
  63.   
  64.   
  65. ***************
  66. *** 148,153 ****
  67. --- 148,156 ----
  68.   {
  69.     FD ConnectionSocket;
  70.     struct sockaddr_in  sin;
  71. + #ifndef    SO_DONTLINGER
  72. +   struct linger linger;
  73. + #endif    SO_DONTLINGER
  74.   
  75.     enterprocedure("SetUpConnectionSocket");
  76.   
  77. ***************
  78. *** 160,166 ****
  79. --- 163,175 ----
  80.       }
  81.     (void)setsockopt(ConnectionSocket, SOL_SOCKET, SO_REUSEADDR,   (char *)NULL, 0);
  82.     (void)setsockopt(ConnectionSocket, SOL_SOCKET, SO_USELOOPBACK, (char *)NULL, 0);
  83. + #ifdef    SO_DONTLINGER
  84.     (void)setsockopt(ConnectionSocket, SOL_SOCKET, SO_DONTLINGER,  (char *)NULL, 0);
  85. + #else    SO_DONTLINGER
  86. +   linger.l_onoff = 0;
  87. +   linger.l_linger = 0;
  88. +   (void)setsockopt(ConnectionSocket, SOL_SOCKET, SO_LINGER, (char *)&linger, sizeof linger);
  89. + #endif    SO_DONTLINGER
  90.   
  91.     /* define the name and port to be used with the connection socket */
  92.     bzero((char *)&sin, sizeof(sin));
  93. ***************
  94. *** 176,182 ****
  95.   
  96.       (void) gethostname(MyHostName, sizeof(MyHostName));
  97.       ScopeHost = (char *) Malloc((long)strlen(MyHostName));
  98. !     strcpy(ScopeHost, MyHostName);
  99.       hp = gethostbyname(MyHostName);
  100.       if (hp == NULL)
  101.         panic("No address for our host");
  102. --- 185,191 ----
  103.   
  104.       (void) gethostname(MyHostName, sizeof(MyHostName));
  105.       ScopeHost = (char *) Malloc((long)strlen(MyHostName));
  106. !     (void)strcpy(ScopeHost, MyHostName);
  107.       hp = gethostbyname(MyHostName);
  108.       if (hp == NULL)
  109.         panic("No address for our host");
  110. ***************
  111. *** 208,215 ****
  112.       };
  113.   
  114.     /* a few more parameter settings */
  115. !   ioctl(ConnectionSocket, FIOCLEX, 0);
  116. !   ioctl(ConnectionSocket, FIONBIO, &ON);
  117.   
  118.     debug(4,(stderr, "Listening on FD %d\n", ConnectionSocket));
  119.     UsingFD(ConnectionSocket, NewConnection);
  120. --- 217,224 ----
  121.       };
  122.   
  123.     /* a few more parameter settings */
  124. !   (void)ioctl(ConnectionSocket, FIOCLEX, 0);
  125. !   (void)ioctl(ConnectionSocket, FIONBIO, &ON);
  126.   
  127.     debug(4,(stderr, "Listening on FD %d\n", ConnectionSocket));
  128.     UsingFD(ConnectionSocket, NewConnection);
  129. diff -c distribution/decode11.c ./decode11.c
  130. *** distribution/decode11.c    Tue Dec 20 15:46:34 1988
  131. --- ./decode11.c    Tue Dec 20 17:37:14 1988
  132. ***************
  133. *** 911,916 ****
  134. --- 911,922 ----
  135.     SetIndentLevel(PRINTSERVER);
  136.     if (Verbose > 3)
  137.       DumpItem("Event", fd, buf, n);
  138. +   /* high-order bit means SendEvent generated */
  139. +   if (Event & 0x80)
  140. +     {
  141. +       debug(8,(stderr, "SendEvent generated event 0x%x\n", Event));
  142. +       Event = Event & 0x7F;
  143. +     }
  144.     if (Event < 2 || Event > 34)
  145.       warn("Extended Event code");
  146.     else switch (Event)
  147. diff -c distribution/fd.c ./fd.c
  148. *** distribution/fd.c    Tue Dec 20 15:46:40 1988
  149. --- ./fd.c    Tue Dec 20 17:37:17 1988
  150. ***************
  151. *** 32,37 ****
  152. --- 32,42 ----
  153.     enterprocedure("InitializeFD");
  154.     /* get the number of file descriptors the system will let us use */
  155.     MaxFD = getdtablesize();
  156. +   if (MaxFD > StaticMaxFD)
  157. +     {
  158. +       fprintf(stderr, "Recompile with larger StaticMaxFD value %d\n", MaxFD);
  159. +       MaxFD = StaticMaxFD;
  160. +     }
  161.   
  162.     /* allocate space for a File Descriptor (FD) Table */
  163.     FDD = (struct FDDescriptor *)
  164. ***************
  165. *** 42,48 ****
  166.       {
  167.         /* 0, 1, 2 are special (stdin, stdout, stderr) */
  168.         if (i > 2)
  169. !     close(i);
  170.         FDD[i].Busy = false;
  171.       }
  172.   
  173. --- 47,53 ----
  174.       {
  175.         /* 0, 1, 2 are special (stdin, stdout, stderr) */
  176.         if (i > 2)
  177. !     (void)close(i);
  178.         FDD[i].Busy = false;
  179.       }
  180.   
  181. ***************
  182. *** 111,117 ****
  183.   {
  184.     enterprocedure("EOFonFD");
  185.     debug(128,(stderr, "EOF on %d\n", fd));
  186. !   close(fd);
  187.     NotUsingFD(fd);
  188.   }
  189.   
  190. --- 116,122 ----
  191.   {
  192.     enterprocedure("EOFonFD");
  193.     debug(128,(stderr, "EOF on %d\n", fd));
  194. !   (void)close(fd);
  195.     NotUsingFD(fd);
  196.   }
  197.   
  198. ***************
  199. *** 122,128 ****
  200.   /*                                */
  201.   /* ************************************************************ */
  202.   
  203. ! #include <errno.h>           /* for EINTR, EADDRINUSE, ... */
  204.   extern int  errno;
  205.   
  206.   
  207. --- 127,134 ----
  208.   /*                                */
  209.   /* ************************************************************ */
  210.   
  211. ! #include <sys/time.h>       /* for struct timeval * */
  212. ! #include <errno.h>        /* for EINTR, EADDRINUSE, ... */
  213.   extern int  errno;
  214.   
  215.   
  216. ***************
  217. *** 142,148 ****
  218.         xfds = rfds;
  219.   
  220.         debug(128,(stderr, "select %d, rfds = 0%o\n", HighestFD + 1, rfds));
  221. !       nfds = select(HighestFD + 1, &rfds, &wfds, &xfds, NULL);
  222.         debug(128,(stderr, "select nfds = 0%o, rfds = 0%o, 0%o, xfds 0%o\n",
  223.            nfds, rfds, wfds, xfds));
  224.   
  225. --- 148,154 ----
  226.         xfds = rfds;
  227.   
  228.         debug(128,(stderr, "select %d, rfds = 0%o\n", HighestFD + 1, rfds));
  229. !       nfds = select(HighestFD + 1, &rfds, &wfds, &xfds, (struct timeval *)NULL);
  230.         debug(128,(stderr, "select nfds = 0%o, rfds = 0%o, 0%o, xfds 0%o\n",
  231.            nfds, rfds, wfds, xfds));
  232.   
  233. diff -c distribution/print11.c ./print11.c
  234. *** distribution/print11.c    Tue Dec 20 15:47:08 1988
  235. --- ./print11.c    Tue Dec 20 17:37:28 1988
  236. ***************
  237. *** 63,70 ****
  238.     n = IShort(&buf[6]);
  239.     printfield(buf, 8, 2, DVALUE2(d), "length of data");
  240.     d = IShort(&buf[8]);
  241. !   PrintString8(&buf[12], n, "authorization-protocol-name");
  242. !   PrintString8(&buf[pad((long)(12 + n))], d, "authorization-protocol-data");
  243.   }
  244.   
  245.   PrintSetUpReply(buf)
  246. --- 63,70 ----
  247.     n = IShort(&buf[6]);
  248.     printfield(buf, 8, 2, DVALUE2(d), "length of data");
  249.     d = IShort(&buf[8]);
  250. !   PrintString8(&buf[12], (long)n, "authorization-protocol-name");
  251. !   PrintString8(&buf[pad((long)(12+n))], (long)d, "authorization-protocol-data");
  252.   }
  253.   
  254.   PrintSetUpReply(buf)
  255. ***************
  256. *** 91,97 ****
  257.     PrintField(buf, 2, 2, CARD16, "major-version");
  258.     PrintField(buf, 4, 2, CARD16, "minor-version");
  259.     printfield(buf, 6, 2, DVALUE2((n + p) / 4), "length of data");
  260. !   PrintString8(&buf[8], n, "reason");
  261.   }
  262.   
  263.   PrintSuccessfulSetUpReply(buf)
  264. --- 91,97 ----
  265.     PrintField(buf, 2, 2, CARD16, "major-version");
  266.     PrintField(buf, 4, 2, CARD16, "minor-version");
  267.     printfield(buf, 6, 2, DVALUE2((n + p) / 4), "length of data");
  268. !   PrintString8(&buf[8], (long)n, "reason");
  269.   }
  270.   
  271.   PrintSuccessfulSetUpReply(buf)
  272. ***************
  273. *** 123,131 ****
  274.     PrintField(buf, 33, 1, CARD8, "bitmap-format-scanline-pad");
  275.     PrintField(buf, 34, 1, KEYCODE, "min-keycode");
  276.     PrintField(buf, 35, 1, KEYCODE, "max-keycode");
  277. !   PrintString8(&buf[40], v, "vendor");
  278. !   PrintList(&buf[pad((long)(40 + v))], (long)n, FORMAT, "pixmap-formats");
  279. !   PrintList(&buf[pad((long)(40 + v) + 8 * n)], (long)m, SCREEN, "roots");
  280.   }
  281.   
  282.   
  283. --- 123,131 ----
  284.     PrintField(buf, 33, 1, CARD8, "bitmap-format-scanline-pad");
  285.     PrintField(buf, 34, 1, KEYCODE, "min-keycode");
  286.     PrintField(buf, 35, 1, KEYCODE, "max-keycode");
  287. !   PrintString8(&buf[40], (long)v, "vendor");
  288. !   (void)PrintList(&buf[pad((long)(40+v))], (long)n, FORMAT, "pixmap-formats");
  289. !   (void)PrintList(&buf[pad((long)(40+v) + 8 * n)], (long)m, SCREEN, "roots");
  290.   }
  291.   
  292.   
  293. ***************
  294. *** 816,829 ****
  295.   ClientMessageEvent(buf)
  296.        unsigned char *buf;
  297.   {
  298.     PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* ClientMessage */ ;
  299.     if (Verbose < 1)
  300.       return;
  301.     PrintField(buf, 1, 1, CARD8, "format");
  302.     printfield(buf, 2, 2, CARD16, "sequence number");
  303.     PrintField(buf, 4, 4, WINDOW, "window");
  304.     PrintField(buf, 8, 4, ATOM, "type");
  305. !   PrintBytes(&buf[12], (long)20,"data");
  306.   }
  307.   
  308.   MappingNotifyEvent(buf)
  309. --- 816,841 ----
  310.   ClientMessageEvent(buf)
  311.        unsigned char *buf;
  312.   {
  313. +   short format;
  314. +   long type;
  315. +   
  316.     PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* ClientMessage */ ;
  317.     if (Verbose < 1)
  318.       return;
  319.     PrintField(buf, 1, 1, CARD8, "format");
  320. +   format = IByte(&buf[1]);
  321.     printfield(buf, 2, 2, CARD16, "sequence number");
  322.     PrintField(buf, 4, 4, WINDOW, "window");
  323.     PrintField(buf, 8, 4, ATOM, "type");
  324. !   type = ILong(&buf[8]);
  325. !   if (type == 31 /* string */)
  326. !     PrintString8(&buf[12], 20L, "data");
  327. !   else if (format == 16)
  328. !     (void)PrintList(&buf[12], 10L, INT16, "data");
  329. !   else if (format == 32)
  330. !     (void)PrintList(&buf[12], 5L, INT32, "data");
  331. !   else
  332. !     PrintBytes(&buf[12], 20L, "data");
  333.   }
  334.   
  335.   MappingNotifyEvent(buf)
  336. ***************
  337. *** 1130,1136 ****
  338.     PrintField(buf, 12, 4, WINDOW, "parent");
  339.     printfield(buf, 16, 2, DVALUE2(n), "number of children");
  340.     n = IShort(&buf[16]);
  341. !   PrintList(&buf[32], (long)n, WINDOW, "children");
  342.   }
  343.   
  344.   InternAtom(buf)
  345. --- 1142,1148 ----
  346.     PrintField(buf, 12, 4, WINDOW, "parent");
  347.     printfield(buf, 16, 2, DVALUE2(n), "number of children");
  348.     n = IShort(&buf[16]);
  349. !   (void)PrintList(&buf[32], (long)n, WINDOW, "children");
  350.   }
  351.   
  352.   InternAtom(buf)
  353. ***************
  354. *** 1148,1154 ****
  355.     printfield(buf, 2, 2, DVALUE2(2 + (n + p) / 4), "request length");
  356.     printfield(buf, 4, 2, DVALUE2(n), "length of name");
  357.     n = IShort(&buf[4]);
  358. !   PrintString8(&buf[8], n, "name");
  359.   }
  360.   
  361.   InternAtomReply(buf)
  362. --- 1160,1166 ----
  363.     printfield(buf, 2, 2, DVALUE2(2 + (n + p) / 4), "request length");
  364.     printfield(buf, 4, 2, DVALUE2(n), "length of name");
  365.     n = IShort(&buf[4]);
  366. !   PrintString8(&buf[8], (long)n, "name");
  367.   }
  368.   
  369.   InternAtomReply(buf)
  370. ***************
  371. *** 1187,1193 ****
  372.     printfield(buf, 4, 4, DVALUE4((n + p) / 4), "reply length");
  373.     printfield(buf, 8, 2, DVALUE2(n), "length of name");
  374.     n = IShort(&buf[8]);
  375. !   PrintString8(&buf[32], n, "name");
  376.   }
  377.   
  378.   ChangeProperty(buf)
  379. --- 1199,1205 ----
  380.     printfield(buf, 4, 4, DVALUE4((n + p) / 4), "reply length");
  381.     printfield(buf, 8, 2, DVALUE2(n), "length of name");
  382.     n = IShort(&buf[8]);
  383. !   PrintString8(&buf[32], (long)n, "name");
  384.   }
  385.   
  386.   ChangeProperty(buf)
  387. ***************
  388. *** 1194,1200 ****
  389.        unsigned char *buf;
  390.   {
  391.     long    n;
  392. !   short   unit;
  393.     long    type;
  394.   
  395.     /* Request ChangeProperty is opcode 18 */
  396. --- 1206,1212 ----
  397.        unsigned char *buf;
  398.   {
  399.     long    n;
  400. !   short   format;
  401.     long    type;
  402.   
  403.     /* Request ChangeProperty is opcode 18 */
  404. ***************
  405. *** 1211,1223 ****
  406.     PrintField(buf, 12, 4, ATOM, "type");
  407.     type = ILong(&buf[12]);
  408.     PrintField(buf, 16, 1, CARD8, "format");
  409. !   unit = IByte(&buf[16]) / 8;
  410.     printfield(buf, 20, 4, CARD32, "length of data");
  411.     n = ILong(&buf[20]);
  412.     if (type == 31 /* string */)
  413. !     PrintString8(&buf[24], n * unit, "data");
  414.     else
  415. !     PrintBytes(&buf[24], n * unit, "data");
  416.   }
  417.   
  418.   DeleteProperty(buf)
  419. --- 1223,1239 ----
  420.     PrintField(buf, 12, 4, ATOM, "type");
  421.     type = ILong(&buf[12]);
  422.     PrintField(buf, 16, 1, CARD8, "format");
  423. !   format = IByte(&buf[16]);
  424.     printfield(buf, 20, 4, CARD32, "length of data");
  425.     n = ILong(&buf[20]);
  426.     if (type == 31 /* string */)
  427. !     PrintString8(&buf[24], n * format/8, "data");
  428. !   else if (format == 16)
  429. !     (void)PrintList(&buf[24], n, INT16, "data");
  430. !   else if (format == 32)
  431. !     (void)PrintList(&buf[24], n, INT32, "data");
  432.     else
  433. !     PrintBytes(&buf[24], n * format/8, "data");
  434.   }
  435.   
  436.   DeleteProperty(buf)
  437. ***************
  438. *** 1258,1264 ****
  439.        unsigned char *buf;
  440.   {
  441.     long    n;
  442. !   short   unit;
  443.     long    type;
  444.   
  445.     PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* GetProperty */ ;
  446. --- 1274,1280 ----
  447.        unsigned char *buf;
  448.   {
  449.     long    n;
  450. !   short   format;
  451.     long    type;
  452.   
  453.     PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* GetProperty */ ;
  454. ***************
  455. *** 1265,1271 ****
  456.     if (Verbose < 1)
  457.       return;
  458.     PrintField(buf, 1, 1, CARD8, "format");
  459. !   unit = IByte(&buf[1]) / 8;
  460.     printfield(buf, 2, 2, CARD16, "sequence number");
  461.     printfield(buf, 4, 4, DVALUE4((n + p) / 4), "reply length");
  462.     PrintField(buf, 8, 4, ATOM, "type");
  463. --- 1281,1287 ----
  464.     if (Verbose < 1)
  465.       return;
  466.     PrintField(buf, 1, 1, CARD8, "format");
  467. !   format = IByte(&buf[1]);
  468.     printfield(buf, 2, 2, CARD16, "sequence number");
  469.     printfield(buf, 4, 4, DVALUE4((n + p) / 4), "reply length");
  470.     PrintField(buf, 8, 4, ATOM, "type");
  471. ***************
  472. *** 1274,1282 ****
  473.     printfield(buf, 16, 4, CARD32, "length of value");
  474.     n = ILong(&buf[16]);
  475.     if (type == 31 /* string */)
  476. !     PrintString8(&buf[32], n * unit, "value");
  477.     else
  478. !     PrintBytes(&buf[32], n * unit, "value");
  479.   }
  480.   
  481.   ListProperties(buf)
  482. --- 1290,1302 ----
  483.     printfield(buf, 16, 4, CARD32, "length of value");
  484.     n = ILong(&buf[16]);
  485.     if (type == 31 /* string */)
  486. !     PrintString8(&buf[32], n * format/8, "value");
  487. !   else if (format == 16)
  488. !     (void)PrintList(&buf[32], n, INT16, "value");
  489. !   else if (format == 32)
  490. !     (void)PrintList(&buf[32], n, INT32, "value");
  491.     else
  492. !     PrintBytes(&buf[32], n * format/8, "value");
  493.   }
  494.   
  495.   ListProperties(buf)
  496. ***************
  497. *** 1304,1310 ****
  498.     printfield(buf, 4, 4, DVALUE4(n), "reply length");
  499.     printfield(buf, 8, 2, DVALUE2(n), "number of atoms");
  500.     n = IShort(&buf[8]);
  501. !   PrintList(&buf[32], (long)n, ATOM, "atoms");
  502.   }
  503.   
  504.   SetSelectionOwner(buf)
  505. --- 1324,1330 ----
  506.     printfield(buf, 4, 4, DVALUE4(n), "reply length");
  507.     printfield(buf, 8, 2, DVALUE2(n), "number of atoms");
  508.     n = IShort(&buf[8]);
  509. !   (void)PrintList(&buf[32], (long)n, ATOM, "atoms");
  510.   }
  511.   
  512.   SetSelectionOwner(buf)
  513. ***************
  514. *** 1661,1667 ****
  515.     printfield(buf, 4, 4, DVALUE4(2*n), "reply length");
  516.     printfield(buf, 8, 4, DVALUE4(n), "number of events");
  517.     n = ILong(&buf[8]);
  518. !   PrintList(&buf[32], n, TIMECOORD, "events");
  519.   }
  520.   
  521.   TranslateCoordinates(buf)
  522. --- 1681,1687 ----
  523.     printfield(buf, 4, 4, DVALUE4(2*n), "reply length");
  524.     printfield(buf, 8, 4, DVALUE4(n), "number of events");
  525.     n = ILong(&buf[8]);
  526. !   (void)PrintList(&buf[32], n, TIMECOORD, "events");
  527.   }
  528.   
  529.   TranslateCoordinates(buf)
  530. ***************
  531. *** 1785,1790 ****
  532. --- 1805,1811 ----
  533.        unsigned char *buf;
  534.   {
  535.     short   n;
  536.     /* Request OpenFont is opcode 45 */
  537.     PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* OpenFont */ ;
  538.     if (Verbose < 1)
  539. ***************
  540. *** 1796,1802 ****
  541.     PrintField(buf, 4, 4, FONT, "font-id");
  542.     printfield(buf, 8, 2, DVALUE2(n), "length of name");
  543.     n = IShort(&buf[8]);
  544. !   PrintString8(&buf[12], n, "name");
  545.   }
  546.   
  547.   CloseFont(buf)
  548. --- 1817,1823 ----
  549.     PrintField(buf, 4, 4, FONT, "font-id");
  550.     printfield(buf, 8, 2, DVALUE2(n), "length of name");
  551.     n = IShort(&buf[8]);
  552. !   PrintString8(&buf[12], (long)n, "name");
  553.   }
  554.   
  555.   CloseFont(buf)
  556. ***************
  557. *** 1855,1861 ****
  558.     printfield(buf, 56, 4, DVALUE4(m), "number of CHARINFOs");
  559.     m = ILong(&buf[56]);
  560.     k = PrintList(&buf[60], (long)n, FONTPROP, "properties");
  561. !   PrintList(&buf[60 + k], (long)m, CHARINFO, "char-infos");
  562.   }
  563.   
  564.   QueryTextExtents(buf)
  565. --- 1876,1882 ----
  566.     printfield(buf, 56, 4, DVALUE4(m), "number of CHARINFOs");
  567.     m = ILong(&buf[56]);
  568.     k = PrintList(&buf[60], (long)n, FONTPROP, "properties");
  569. !   (void)PrintList(&buf[60 + k], (long)m, CHARINFO, "char-infos");
  570.   }
  571.   
  572.   QueryTextExtents(buf)
  573. ***************
  574. *** 1876,1882 ****
  575.     if (IBool(&buf[1]))
  576.       n -= 1;
  577.     PrintField(buf, 4, 4, FONTABLE, "font");
  578. !   PrintString16(&buf[8], n, "string");
  579.   }
  580.   
  581.   QueryTextExtentsReply(buf)
  582. --- 1897,1903 ----
  583.     if (IBool(&buf[1]))
  584.       n -= 1;
  585.     PrintField(buf, 4, 4, FONTABLE, "font");
  586. !   PrintString16(&buf[8], (long)n, "string");
  587.   }
  588.   
  589.   QueryTextExtentsReply(buf)
  590. ***************
  591. *** 1901,1906 ****
  592. --- 1922,1928 ----
  593.        unsigned char *buf;
  594.   {
  595.     short   n;
  596.     /* Request ListFonts is opcode 49 */
  597.     PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* ListFonts */ ;
  598.     if (Verbose < 1)
  599. ***************
  600. *** 1912,1918 ****
  601.     PrintField(buf, 4, 2, CARD16, "max-names");
  602.     printfield(buf, 6, 2, DVALUE2(n), "length of pattern");
  603.     n = IShort(&buf[6]);
  604. !   PrintString8(&buf[8], n, "pattern");
  605.   }
  606.   
  607.   ListFontsReply(buf)
  608. --- 1934,1940 ----
  609.     PrintField(buf, 4, 2, CARD16, "max-names");
  610.     printfield(buf, 6, 2, DVALUE2(n), "length of pattern");
  611.     n = IShort(&buf[6]);
  612. !   PrintString8(&buf[8], (long)n, "pattern");
  613.   }
  614.   
  615.   ListFontsReply(buf)
  616. ***************
  617. *** 1934,1939 ****
  618. --- 1956,1962 ----
  619.        unsigned char *buf;
  620.   {
  621.     short   n;
  622.     /* Request ListFontsWithInfo is opcode 50 */
  623.     PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* ListFontsWithInfo */ ;
  624.     if (Verbose < 1)
  625. ***************
  626. *** 1945,1951 ****
  627.     PrintField(buf, 4, 2, CARD16, "max-names");
  628.     printfield(buf, 6, 2, DVALUE2(n), "length of pattern");
  629.     n = IShort(&buf[6]);
  630. !   PrintString8(&buf[8], n, "pattern");
  631.   }
  632.   
  633.   ListFontsWithInfoReply(buf)
  634. --- 1968,1974 ----
  635.     PrintField(buf, 4, 2, CARD16, "max-names");
  636.     printfield(buf, 6, 2, DVALUE2(n), "length of pattern");
  637.     n = IShort(&buf[6]);
  638. !   PrintString8(&buf[8], (long)n, "pattern");
  639.   }
  640.   
  641.   ListFontsWithInfoReply(buf)
  642. ***************
  643. *** 1988,1995 ****
  644.     PrintField(buf, 52, 2, INT16, "font-ascent");
  645.     PrintField(buf, 54, 2, INT16, "font-descent");
  646.     PrintField(buf, 56, 4, CARD32, "replies-hint");
  647. !   PrintList(&buf[60], (long)m, FONTPROP, "properties");
  648. !   PrintString8(&buf[60 + 8 * m], n, "name");
  649.   }
  650.   
  651.   ListFontsWithInfoReply2(buf)
  652. --- 2011,2018 ----
  653.     PrintField(buf, 52, 2, INT16, "font-ascent");
  654.     PrintField(buf, 54, 2, INT16, "font-descent");
  655.     PrintField(buf, 56, 4, CARD32, "replies-hint");
  656. !   (void)PrintList(&buf[60], (long)m, FONTPROP, "properties");
  657. !   PrintString8(&buf[60 + 8 * m], (long)n, "name");
  658.   }
  659.   
  660.   ListFontsWithInfoReply2(buf)
  661. ***************
  662. *** 2162,2168 ****
  663.     PrintField(buf, 4, 4, GCONTEXT, "gc");
  664.     PrintField(buf, 8, 2, INT16, "clip-x-origin");
  665.     PrintField(buf, 10, 2, INT16, "clip-y-origin");
  666. !   PrintList(&buf[12], (long)n, RECTANGLE, "rectangles");
  667.   }
  668.   
  669.   FreeGC(buf)
  670. --- 2185,2191 ----
  671.     PrintField(buf, 4, 4, GCONTEXT, "gc");
  672.     PrintField(buf, 8, 2, INT16, "clip-x-origin");
  673.     PrintField(buf, 10, 2, INT16, "clip-y-origin");
  674. !   (void)PrintList(&buf[12], (long)n, RECTANGLE, "rectangles");
  675.   }
  676.   
  677.   FreeGC(buf)
  678. ***************
  679. *** 2259,2265 ****
  680.     n = (IShort(&buf[2]) - 3);
  681.     PrintField(buf, 4, 4, DRAWABLE, "drawable");
  682.     PrintField(buf, 8, 4, GCONTEXT, "gc");
  683. !   PrintList(&buf[12], (long)n, POINT, "points");
  684.   }
  685.   
  686.   PolyLine(buf)
  687. --- 2282,2288 ----
  688.     n = (IShort(&buf[2]) - 3);
  689.     PrintField(buf, 4, 4, DRAWABLE, "drawable");
  690.     PrintField(buf, 8, 4, GCONTEXT, "gc");
  691. !   (void)PrintList(&buf[12], (long)n, POINT, "points");
  692.   }
  693.   
  694.   PolyLine(buf)
  695. ***************
  696. *** 2278,2284 ****
  697.     n = (IShort(&buf[2]) - 3);
  698.     PrintField(buf, 4, 4, DRAWABLE, "drawable");
  699.     PrintField(buf, 8, 4, GCONTEXT, "gc");
  700. !   PrintList(&buf[12], (long)n, POINT, "points");
  701.   }
  702.   
  703.   PolySegment(buf)
  704. --- 2301,2307 ----
  705.     n = (IShort(&buf[2]) - 3);
  706.     PrintField(buf, 4, 4, DRAWABLE, "drawable");
  707.     PrintField(buf, 8, 4, GCONTEXT, "gc");
  708. !   (void)PrintList(&buf[12], (long)n, POINT, "points");
  709.   }
  710.   
  711.   PolySegment(buf)
  712. ***************
  713. *** 2296,2302 ****
  714.     n = (IShort(&buf[2]) - 3) / 2;
  715.     PrintField(buf, 4, 4, DRAWABLE, "drawable");
  716.     PrintField(buf, 8, 4, GCONTEXT, "gc");
  717. !   PrintList(&buf[12], (long)n, SEGMENT, "segments");
  718.   }
  719.   
  720.   PolyRectangle(buf)
  721. --- 2319,2325 ----
  722.     n = (IShort(&buf[2]) - 3) / 2;
  723.     PrintField(buf, 4, 4, DRAWABLE, "drawable");
  724.     PrintField(buf, 8, 4, GCONTEXT, "gc");
  725. !   (void)PrintList(&buf[12], (long)n, SEGMENT, "segments");
  726.   }
  727.   
  728.   PolyRectangle(buf)
  729. ***************
  730. *** 2314,2320 ****
  731.     n = (IShort(&buf[2]) - 3) / 2;
  732.     PrintField(buf, 4, 4, DRAWABLE, "drawable");
  733.     PrintField(buf, 8, 4, GCONTEXT, "gc");
  734. !   PrintList(&buf[12], (long)n, RECTANGLE, "rectangles");
  735.   }
  736.   
  737.   PolyArc(buf)
  738. --- 2337,2343 ----
  739.     n = (IShort(&buf[2]) - 3) / 2;
  740.     PrintField(buf, 4, 4, DRAWABLE, "drawable");
  741.     PrintField(buf, 8, 4, GCONTEXT, "gc");
  742. !   (void)PrintList(&buf[12], (long)n, RECTANGLE, "rectangles");
  743.   }
  744.   
  745.   PolyArc(buf)
  746. ***************
  747. *** 2332,2338 ****
  748.     n = (IShort(&buf[2]) - 3) / 3;
  749.     PrintField(buf, 4, 4, DRAWABLE, "drawable");
  750.     PrintField(buf, 8, 4, GCONTEXT, "gc");
  751. !   PrintList(&buf[12], (long)n, ARC, "arcs");
  752.   }
  753.   
  754.   FillPoly(buf)
  755. --- 2355,2361 ----
  756.     n = (IShort(&buf[2]) - 3) / 3;
  757.     PrintField(buf, 4, 4, DRAWABLE, "drawable");
  758.     PrintField(buf, 8, 4, GCONTEXT, "gc");
  759. !   (void)PrintList(&buf[12], (long)n, ARC, "arcs");
  760.   }
  761.   
  762.   FillPoly(buf)
  763. ***************
  764. *** 2352,2358 ****
  765.     PrintField(buf, 8, 4, GCONTEXT, "gc");
  766.     PrintField(buf, 12, 1, POLYSHAPE, "shape");
  767.     PrintField(buf, 13, 1, COORMODE, "coordinate-mode");
  768. !   PrintList(&buf[16], (long)n, POINT, "points");
  769.   }
  770.   
  771.   PolyFillRectangle(buf)
  772. --- 2375,2381 ----
  773.     PrintField(buf, 8, 4, GCONTEXT, "gc");
  774.     PrintField(buf, 12, 1, POLYSHAPE, "shape");
  775.     PrintField(buf, 13, 1, COORMODE, "coordinate-mode");
  776. !   (void)PrintList(&buf[16], (long)n, POINT, "points");
  777.   }
  778.   
  779.   PolyFillRectangle(buf)
  780. ***************
  781. *** 2370,2376 ****
  782.     n = (IShort(&buf[2]) - 3) / 2;
  783.     PrintField(buf, 4, 4, DRAWABLE, "drawable");
  784.     PrintField(buf, 8, 4, GCONTEXT, "gc");
  785. !   PrintList(&buf[12], (long)n, RECTANGLE, "rectangles");
  786.   }
  787.   
  788.   PolyFillArc(buf)
  789. --- 2393,2399 ----
  790.     n = (IShort(&buf[2]) - 3) / 2;
  791.     PrintField(buf, 4, 4, DRAWABLE, "drawable");
  792.     PrintField(buf, 8, 4, GCONTEXT, "gc");
  793. !   (void)PrintList(&buf[12], (long)n, RECTANGLE, "rectangles");
  794.   }
  795.   
  796.   PolyFillArc(buf)
  797. ***************
  798. *** 2388,2394 ****
  799.     n = (IShort(&buf[2]) - 3) / 3;
  800.     PrintField(buf, 4, 4, DRAWABLE, "drawable");
  801.     PrintField(buf, 8, 4, GCONTEXT, "gc");
  802. !   PrintList(&buf[12], (long)n, ARC, "arcs");
  803.   }
  804.   
  805.   PutImage(buf)
  806. --- 2411,2417 ----
  807.     n = (IShort(&buf[2]) - 3) / 3;
  808.     PrintField(buf, 4, 4, DRAWABLE, "drawable");
  809.     PrintField(buf, 8, 4, GCONTEXT, "gc");
  810. !   (void)PrintList(&buf[12], (long)n, ARC, "arcs");
  811.   }
  812.   
  813.   PutImage(buf)
  814. ***************
  815. *** 2529,2535 ****
  816.     PrintField(buf, 8, 4, GCONTEXT, "gc");
  817.     PrintField(buf, 12, 2, INT16, "x");
  818.     PrintField(buf, 14, 2, INT16, "y");
  819. !   PrintString8(&buf[16], n, "string");
  820.   }
  821.   
  822.   ImageText16(buf)
  823. --- 2552,2558 ----
  824.     PrintField(buf, 8, 4, GCONTEXT, "gc");
  825.     PrintField(buf, 12, 2, INT16, "x");
  826.     PrintField(buf, 14, 2, INT16, "y");
  827. !   PrintString8(&buf[16], (long)n, "string");
  828.   }
  829.   
  830.   ImageText16(buf)
  831. ***************
  832. *** 2550,2556 ****
  833.     PrintField(buf, 8, 4, GCONTEXT, "gc");
  834.     PrintField(buf, 12, 2, INT16, "x");
  835.     PrintField(buf, 14, 2, INT16, "y");
  836. !   PrintString16(&buf[16], n, "string");
  837.   }
  838.   
  839.   CreateColormap(buf)
  840. --- 2573,2579 ----
  841.     PrintField(buf, 8, 4, GCONTEXT, "gc");
  842.     PrintField(buf, 12, 2, INT16, "x");
  843.     PrintField(buf, 14, 2, INT16, "y");
  844. !   PrintString16(&buf[16], (long)n, "string");
  845.   }
  846.   
  847.   CreateColormap(buf)
  848. ***************
  849. *** 2652,2658 ****
  850.     printfield(buf, 4, 4, DVALUE4(n), "reply length");
  851.     printfield(buf, 8, 2, DVALUE2(n), "number of cmaps");
  852.     n = IShort(&buf[8]);
  853. !   PrintList(&buf[32], (long)n, COLORMAP, "cmaps");
  854.   }
  855.   
  856.   AllocColor(buf)
  857. --- 2675,2681 ----
  858.     printfield(buf, 4, 4, DVALUE4(n), "reply length");
  859.     printfield(buf, 8, 2, DVALUE2(n), "number of cmaps");
  860.     n = IShort(&buf[8]);
  861. !   (void)PrintList(&buf[32], (long)n, COLORMAP, "cmaps");
  862.   }
  863.   
  864.   AllocColor(buf)
  865. ***************
  866. *** 2701,2707 ****
  867.     PrintField(buf, 4, 4, COLORMAP, "cmap");
  868.     printfield(buf, 8, 2, DVALUE2(n), "length of name");
  869.     n = IShort(&buf[8]);
  870. !   PrintString8(&buf[12], n, "name");
  871.   }
  872.   
  873.   AllocNamedColorReply(buf)
  874. --- 2724,2730 ----
  875.     PrintField(buf, 4, 4, COLORMAP, "cmap");
  876.     printfield(buf, 8, 2, DVALUE2(n), "length of name");
  877.     n = IShort(&buf[8]);
  878. !   PrintString8(&buf[12], (long)n, "name");
  879.   }
  880.   
  881.   AllocNamedColorReply(buf)
  882. ***************
  883. *** 2754,2760 ****
  884.     printfield(buf, 10, 2, DVALUE2(m), "number of masks");
  885.     m = IShort(&buf[10]);
  886.     k = PrintList(&buf[32], (long)n, CARD32, "pixels");
  887. !   PrintList(&buf[32 + k], (long)m, CARD32, "masks");
  888.   }
  889.   
  890.   AllocColorPlanes(buf)
  891. --- 2777,2783 ----
  892.     printfield(buf, 10, 2, DVALUE2(m), "number of masks");
  893.     m = IShort(&buf[10]);
  894.     k = PrintList(&buf[32], (long)n, CARD32, "pixels");
  895. !   (void)PrintList(&buf[32 + k], (long)m, CARD32, "masks");
  896.   }
  897.   
  898.   AllocColorPlanes(buf)
  899. ***************
  900. *** 2790,2796 ****
  901.     PrintField(buf, 12, 4, CARD32, "red-mask");
  902.     PrintField(buf, 16, 4, CARD32, "green-mask");
  903.     PrintField(buf, 20, 4, CARD32, "blue-mask");
  904. !   PrintList(&buf[32], (long)n, CARD32, "pixels");
  905.   }
  906.   
  907.   FreeColors(buf)
  908. --- 2813,2819 ----
  909.     PrintField(buf, 12, 4, CARD32, "red-mask");
  910.     PrintField(buf, 16, 4, CARD32, "green-mask");
  911.     PrintField(buf, 20, 4, CARD32, "blue-mask");
  912. !   (void)PrintList(&buf[32], (long)n, CARD32, "pixels");
  913.   }
  914.   
  915.   FreeColors(buf)
  916. ***************
  917. *** 2809,2815 ****
  918.     n = IShort(&buf[2]) - 3;
  919.     PrintField(buf, 4, 4, COLORMAP, "cmap");
  920.     PrintField(buf, 8, 4, CARD32, "plane-mask");
  921. !   PrintList(&buf[12], (long)n, CARD32, "pixels");
  922.   }
  923.   
  924.   StoreColors(buf)
  925. --- 2832,2838 ----
  926.     n = IShort(&buf[2]) - 3;
  927.     PrintField(buf, 4, 4, COLORMAP, "cmap");
  928.     PrintField(buf, 8, 4, CARD32, "plane-mask");
  929. !   (void)PrintList(&buf[12], (long)n, CARD32, "pixels");
  930.   }
  931.   
  932.   StoreColors(buf)
  933. ***************
  934. *** 2826,2832 ****
  935.     printfield(buf, 2, 2, DVALUE2(2 + 3*n), "request length");
  936.     n = (IShort(&buf[2]) - 2) / 3;
  937.     PrintField(buf, 4, 4, COLORMAP, "cmap");
  938. !   PrintList(&buf[8], (long)n, COLORITEM, "items");
  939.   }
  940.   
  941.   StoreNamedColor(buf)
  942. --- 2849,2855 ----
  943.     printfield(buf, 2, 2, DVALUE2(2 + 3*n), "request length");
  944.     n = (IShort(&buf[2]) - 2) / 3;
  945.     PrintField(buf, 4, 4, COLORMAP, "cmap");
  946. !   (void)PrintList(&buf[8], (long)n, COLORITEM, "items");
  947.   }
  948.   
  949.   StoreNamedColor(buf)
  950. ***************
  951. *** 2846,2852 ****
  952.     PrintField(buf, 8, 4, CARD32, "pixel");
  953.     printfield(buf, 12, 2, DVALUE2(n), "length of name");
  954.     n = IShort(&buf[12]);
  955. !   PrintString8(&buf[16], n, "name");
  956.   }
  957.   
  958.   QueryColors(buf)
  959. --- 2869,2875 ----
  960.     PrintField(buf, 8, 4, CARD32, "pixel");
  961.     printfield(buf, 12, 2, DVALUE2(n), "length of name");
  962.     n = IShort(&buf[12]);
  963. !   PrintString8(&buf[16], (long)n, "name");
  964.   }
  965.   
  966.   QueryColors(buf)
  967. ***************
  968. *** 2863,2869 ****
  969.     printfield(buf, 2, 2, DVALUE2(2 + n), "request length");
  970.     n = IShort(&buf[2]) - 2;
  971.     PrintField(buf, 4, 4, COLORMAP, "cmap");
  972. !   PrintList(&buf[8], (long)n, CARD32, "pixels");
  973.   }
  974.   
  975.   QueryColorsReply(buf)
  976. --- 2886,2892 ----
  977.     printfield(buf, 2, 2, DVALUE2(2 + n), "request length");
  978.     n = IShort(&buf[2]) - 2;
  979.     PrintField(buf, 4, 4, COLORMAP, "cmap");
  980. !   (void)PrintList(&buf[8], (long)n, CARD32, "pixels");
  981.   }
  982.   
  983.   QueryColorsReply(buf)
  984. ***************
  985. *** 2877,2883 ****
  986.     printfield(buf, 4, 4, DVALUE4(2*n), "reply length");
  987.     printfield(buf, 8, 2, DVALUE2(n), "number of colors");
  988.     n = IShort(&buf[8]);
  989. !   PrintList(&buf[32], (long)n, RGB, "colors");
  990.   }
  991.   
  992.   LookupColor(buf)
  993. --- 2900,2906 ----
  994.     printfield(buf, 4, 4, DVALUE4(2*n), "reply length");
  995.     printfield(buf, 8, 2, DVALUE2(n), "number of colors");
  996.     n = IShort(&buf[8]);
  997. !   (void)PrintList(&buf[32], (long)n, RGB, "colors");
  998.   }
  999.   
  1000.   LookupColor(buf)
  1001. ***************
  1002. *** 2895,2901 ****
  1003.     PrintField(buf, 4, 4, COLORMAP, "cmap");
  1004.     printfield(buf, 8, 2, DVALUE2(n), "length of name");
  1005.     n = IShort(&buf[8]);
  1006. !   PrintString8(&buf[12], n, "name");
  1007.   }
  1008.   
  1009.   LookupColorReply(buf)
  1010. --- 2918,2924 ----
  1011.     PrintField(buf, 4, 4, COLORMAP, "cmap");
  1012.     printfield(buf, 8, 2, DVALUE2(n), "length of name");
  1013.     n = IShort(&buf[8]);
  1014. !   PrintString8(&buf[12], (long)n, "name");
  1015.   }
  1016.   
  1017.   LookupColorReply(buf)
  1018. ***************
  1019. *** 3039,3045 ****
  1020.     printfield(buf, 2, 2, DVALUE2(2 + (n + p) / 4), "request length");
  1021.     printfield(buf, 4, 2, DVALUE2(n), "length of name");
  1022.     n = IShort(&buf[4]);
  1023. !   PrintString8(&buf[8], n, "name");
  1024.   }
  1025.   
  1026.   QueryExtensionReply(buf)
  1027. --- 3062,3068 ----
  1028.     printfield(buf, 2, 2, DVALUE2(2 + (n + p) / 4), "request length");
  1029.     printfield(buf, 4, 2, DVALUE2(n), "length of name");
  1030.     n = IShort(&buf[4]);
  1031. !   PrintString8(&buf[8], (long)n, "name");
  1032.   }
  1033.   
  1034.   QueryExtensionReply(buf)
  1035. ***************
  1036. *** 3102,3108 ****
  1037.     PrintField(buf, 4, 1, KEYCODE, "first-keycode");
  1038.     PrintField(buf, 5, 1, DVALUE1(m), "keysyms-per-keycode");
  1039.     m = IByte(&buf[5]);
  1040. !   PrintList(&buf[8], (long)(n * m), KEYSYM, "keysyms");
  1041.   }
  1042.   
  1043.   GetKeyboardMapping(buf)
  1044. --- 3125,3131 ----
  1045.     PrintField(buf, 4, 1, KEYCODE, "first-keycode");
  1046.     PrintField(buf, 5, 1, DVALUE1(m), "keysyms-per-keycode");
  1047.     m = IByte(&buf[5]);
  1048. !   (void)PrintList(&buf[8], (long)(n * m), KEYSYM, "keysyms");
  1049.   }
  1050.   
  1051.   GetKeyboardMapping(buf)
  1052. ***************
  1053. *** 3131,3137 ****
  1054.     printfield(buf, 2, 2, CARD16, "sequence number");
  1055.     printfield(buf, 4, 4, DVALUE4(n*m), "reply length");
  1056.     n = ILong(&buf[4]);
  1057. !   PrintList(&buf[32], n, KEYSYM, "keysyms");
  1058.   }
  1059.   
  1060.   ChangeKeyboardControl(buf)
  1061. --- 3154,3160 ----
  1062.     printfield(buf, 2, 2, CARD16, "sequence number");
  1063.     printfield(buf, 4, 4, DVALUE4(n*m), "reply length");
  1064.     n = ILong(&buf[4]);
  1065. !   (void)PrintList(&buf[32], n, KEYSYM, "keysyms");
  1066.   }
  1067.   
  1068.   ChangeKeyboardControl(buf)
  1069. ***************
  1070. *** 3325,3331 ****
  1071.     printfield(buf, 4, 4, DVALUE4(n / 4), "reply length");
  1072.     printfield(buf, 8, 2, CARD16, "number of hosts");
  1073.     n = IShort(&buf[8]);
  1074. !   PrintList(&buf[32], (long)n, HOST, "hosts");
  1075.   }
  1076.   
  1077.   SetAccessControl(buf)
  1078. --- 3348,3354 ----
  1079.     printfield(buf, 4, 4, DVALUE4(n / 4), "reply length");
  1080.     printfield(buf, 8, 2, CARD16, "number of hosts");
  1081.     n = IShort(&buf[8]);
  1082. !   (void)PrintList(&buf[32], (long)n, HOST, "hosts");
  1083.   }
  1084.   
  1085.   SetAccessControl(buf)
  1086. ***************
  1087. *** 3386,3392 ****
  1088.     printfield(buf, 8, 2, DVALUE2(n), "number of properties");
  1089.     n = IShort(&buf[8]);
  1090.     PrintField(buf, 10, 2, INT16, "delta");
  1091. !   PrintList(&buf[12], (long)n, ATOM, "properties");
  1092.   }
  1093.   
  1094.   ForceScreenSaver(buf)
  1095. --- 3409,3415 ----
  1096.     printfield(buf, 8, 2, DVALUE2(n), "number of properties");
  1097.     n = IShort(&buf[8]);
  1098.     PrintField(buf, 10, 2, INT16, "delta");
  1099. !   (void)PrintList(&buf[12], (long)n, ATOM, "properties");
  1100.   }
  1101.   
  1102.   ForceScreenSaver(buf)
  1103. ***************
  1104. *** 3517,3523 ****
  1105.     n = IByte(&buf[1]);
  1106.     printfield(buf, 2, 2, CARD16, "sequence number");
  1107.     printfield(buf, 4, 4, DVALUE4(2*n), "reply length");
  1108. !   PrintList(&buf[32], (long)n, KEYCODE, "keycodes");
  1109.   }
  1110.   
  1111.   NoOperation(buf)
  1112. --- 3540,3546 ----
  1113.     n = IByte(&buf[1]);
  1114.     printfield(buf, 2, 2, CARD16, "sequence number");
  1115.     printfield(buf, 4, 4, DVALUE4(2*n), "reply length");
  1116. !   (void)PrintList(&buf[32], (long)n, KEYCODE, "keycodes");
  1117.   }
  1118.   
  1119.   NoOperation(buf)
  1120. diff -c distribution/prtype.c ./prtype.c
  1121. *** distribution/prtype.c    Tue Dec 20 15:46:36 1988
  1122. --- ./prtype.c    Tue Dec 20 17:37:31 1988
  1123. ***************
  1124. *** 63,69 ****
  1125.       else
  1126.         {
  1127.           /* very large number -- print as 0xffff - 4 digit hex */
  1128. !         sprintf(pr, "0x%04x", c);
  1129.         }
  1130.     return(pr);
  1131.   }
  1132. --- 63,69 ----
  1133.       else
  1134.         {
  1135.           /* very large number -- print as 0xffff - 4 digit hex */
  1136. !         (void)sprintf(pr, "0x%04x", c);
  1137.         }
  1138.     return(pr);
  1139.   }
  1140. ***************
  1141. *** 226,233 ****
  1142.   PrintSTRING16(buf)
  1143.        unsigned char *buf;
  1144.   {
  1145. !   /* print a CHAR16 -- 16-bit character */
  1146. !   unsigned short   n = IShort (buf);
  1147.     fprintf(stdout, "%s", printrep(n));
  1148.     return(1);
  1149.   }
  1150. --- 226,233 ----
  1151.   PrintSTRING16(buf)
  1152.        unsigned char *buf;
  1153.   {
  1154. !   /* print a CHAR2B -- 16-bit character which is never byte-swapped */
  1155. !   unsigned short   n = IChar2B (buf);
  1156.     fprintf(stdout, "%s", printrep(n));
  1157.     return(1);
  1158.   }
  1159. ***************
  1160. *** 269,275 ****
  1161.     else if (n == 1)
  1162.         fprintf(stdout, "InputFocus");
  1163.       else
  1164. !       PrintWINDOW(buf);
  1165.   }
  1166.   
  1167.   PrintWINDOWNR(buf)
  1168. --- 269,275 ----
  1169.     else if (n == 1)
  1170.         fprintf(stdout, "InputFocus");
  1171.       else
  1172. !       (void)PrintWINDOW(buf);
  1173.   }
  1174.   
  1175.   PrintWINDOWNR(buf)
  1176. ***************
  1177. *** 282,288 ****
  1178.     else if (n == 1)
  1179.         fprintf(stdout, "PointerRoot");
  1180.       else
  1181. !       PrintWINDOW(buf);
  1182.   }
  1183.   
  1184.   
  1185. --- 282,288 ----
  1186.     else if (n == 1)
  1187.         fprintf(stdout, "PointerRoot");
  1188.       else
  1189. !       (void)PrintWINDOW(buf);
  1190.   }
  1191.   
  1192.   
  1193. ***************
  1194. *** 375,381 ****
  1195.     if (n == 0)
  1196.       fprintf(stdout, "CopyFromParent");
  1197.     else
  1198. !     PrintCOLORMAP(buf);
  1199.   }
  1200.   
  1201.   
  1202. --- 375,381 ----
  1203.     if (n == 0)
  1204.       fprintf(stdout, "CopyFromParent");
  1205.     else
  1206. !     (void)PrintCOLORMAP(buf);
  1207.   }
  1208.   
  1209.   
  1210. ***************
  1211. *** 441,447 ****
  1212.     if (n == 0)
  1213.       fprintf(stdout, "AnyPropertyType");
  1214.     else
  1215. !     PrintATOM(buf);
  1216.   }
  1217.   
  1218.   
  1219. --- 441,447 ----
  1220.     if (n == 0)
  1221.       fprintf(stdout, "AnyPropertyType");
  1222.     else
  1223. !     (void)PrintATOM(buf);
  1224.   }
  1225.   
  1226.   
  1227. ***************
  1228. *** 518,524 ****
  1229.     if (n == 0)
  1230.       fprintf(stdout, "AnyKey");
  1231.     else
  1232. !     PrintKEYCODE(buf);
  1233.   }
  1234.   
  1235.   
  1236. --- 518,524 ----
  1237.     if (n == 0)
  1238.       fprintf(stdout, "AnyKey");
  1239.     else
  1240. !     (void)PrintKEYCODE(buf);
  1241.   }
  1242.   
  1243.   
  1244. ***************
  1245. *** 672,678 ****
  1246.            break;
  1247.       }
  1248.     fprintf(stdout, "\n");
  1249. !   fflush(stdout);
  1250.   }
  1251.   
  1252.   /* ************************************************************ */
  1253. --- 672,678 ----
  1254.            break;
  1255.       }
  1256.     fprintf(stdout, "\n");
  1257. !   (void)fflush(stdout);
  1258.   }
  1259.   
  1260.   /* ************************************************************ */
  1261. ***************
  1262. *** 734,740 ****
  1263.   /* print a list of STRs.  Similar to PrintList
  1264.      They start at <buf>.  There are <number> things in the list */
  1265.   
  1266. ! long PrintListSTR(buf, number, name)
  1267.        unsigned char *buf;
  1268.        long   number;
  1269.        char   *name;
  1270. --- 734,740 ----
  1271.   /* print a list of STRs.  Similar to PrintList
  1272.      They start at <buf>.  There are <number> things in the list */
  1273.   
  1274. ! PrintListSTR(buf, number, name)
  1275.        unsigned char *buf;
  1276.        long   number;
  1277.        char   *name;
  1278. ***************
  1279. *** 744,754 ****
  1280.     long    sum;
  1281.   
  1282.     if (number == 0)
  1283. !     return(0);
  1284.   
  1285.     fprintf(stdout, "%s%20s: (%d)\n", Leader, name, number);
  1286.     if (Verbose < 2)
  1287. !     return(0);
  1288.   
  1289.     ModifyIndentLevel(1);
  1290.     sum = 0;
  1291. --- 744,754 ----
  1292.     long    sum;
  1293.   
  1294.     if (number == 0)
  1295. !     return;
  1296.   
  1297.     fprintf(stdout, "%s%20s: (%d)\n", Leader, name, number);
  1298.     if (Verbose < 2)
  1299. !     return;
  1300.   
  1301.     ModifyIndentLevel(1);
  1302.     sum = 0;
  1303. ***************
  1304. *** 762,768 ****
  1305.       }
  1306.   
  1307.     ModifyIndentLevel(-1);
  1308. !   return(sum);
  1309.   }
  1310.   
  1311.   
  1312. --- 762,768 ----
  1313.       }
  1314.   
  1315.     ModifyIndentLevel(-1);
  1316. !   return;
  1317.   }
  1318.   
  1319.   
  1320. ***************
  1321. *** 782,788 ****
  1322.     short   column;
  1323.   
  1324.     if (number == 0)
  1325. !     return(0);
  1326.   
  1327.     fprintf(stdout, "%s%20s: ", Leader, name);
  1328.     column = SizeofLeader() + 25;
  1329. --- 782,788 ----
  1330.     short   column;
  1331.   
  1332.     if (number == 0)
  1333. !     return;
  1334.   
  1335.     fprintf(stdout, "%s%20s: ", Leader, name);
  1336.     column = SizeofLeader() + 25;
  1337. ***************
  1338. *** 800,806 ****
  1339.       }
  1340.     fprintf(stdout, "\n");
  1341.   
  1342. !   return(number);
  1343.   }
  1344.   
  1345.   
  1346. --- 800,806 ----
  1347.       }
  1348.     fprintf(stdout, "\n");
  1349.   
  1350. !   return;
  1351.   }
  1352.   
  1353.   
  1354. ***************
  1355. *** 814,858 ****
  1356.   
  1357.   PrintString8(buf, number, name)
  1358.        unsigned char    buf[];
  1359. !      short   number;
  1360.        char   *name;
  1361.   {
  1362. !   short   i;
  1363.   
  1364.     if (number == 0)
  1365. !     return(0);
  1366.   
  1367.     fprintf(stdout, "%s%20s: \"", Leader, name);
  1368.     for (i = 0; i < number; i++)
  1369.       fprintf(stdout, "%s", printrep(buf[i]));
  1370.     fprintf(stdout, "\"\n");
  1371. -   return(number);
  1372.   }
  1373.   
  1374.   
  1375. ! /* print a String of CHAR16 -- 16-bit characters */
  1376.   
  1377.   PrintString16(buf, number, name)
  1378.        unsigned char    buf[];
  1379. !      short   number;
  1380.        char   *name;
  1381.   {
  1382. !   short   i;
  1383.     unsigned short   c;
  1384.   
  1385.     if (number == 0)
  1386. !     return(0);
  1387.   
  1388.     fprintf(stdout, "%s%20s: \"", Leader, name);
  1389.     for (i = 0; i < number; i += 2)
  1390.       {
  1391. !       c = IShort(&buf[i]);
  1392.         fprintf(stdout, "%s", printrep(c));
  1393.       }
  1394.     fprintf(stdout, "\"\n");
  1395. -   return(number);
  1396.   }
  1397.   
  1398.   /* ************************************************************ */
  1399. --- 814,854 ----
  1400.   
  1401.   PrintString8(buf, number, name)
  1402.        unsigned char    buf[];
  1403. !      long   number;
  1404.        char   *name;
  1405.   {
  1406. !   long   i;
  1407.   
  1408.     if (number == 0)
  1409. !     return;
  1410.   
  1411.     fprintf(stdout, "%s%20s: \"", Leader, name);
  1412.     for (i = 0; i < number; i++)
  1413.       fprintf(stdout, "%s", printrep(buf[i]));
  1414.     fprintf(stdout, "\"\n");
  1415.   }
  1416.   
  1417.   
  1418. ! /* print a String of CHAR2B -- 16-bit characters */
  1419.   
  1420.   PrintString16(buf, number, name)
  1421.        unsigned char    buf[];
  1422. !      long   number;
  1423.        char   *name;
  1424.   {
  1425. !   long   i;
  1426.     unsigned short   c;
  1427.   
  1428.     if (number == 0)
  1429. !     return;
  1430.   
  1431.     fprintf(stdout, "%s%20s: \"", Leader, name);
  1432.     for (i = 0; i < number; i += 2)
  1433.       {
  1434. !       c = IChar2B(&buf[i]);
  1435.         fprintf(stdout, "%s", printrep(c));
  1436.       }
  1437.     fprintf(stdout, "\"\n");
  1438.   }
  1439.   
  1440.   /* ************************************************************ */
  1441. ***************
  1442. *** 929,935 ****
  1443.         if (n != 255)
  1444.       {
  1445.         PrintField(buf, 1, 1, INT8, "delta");
  1446. !       PrintString8(&buf[2], n, "text item 8 string");
  1447.         buf += n + 2;
  1448.         length -= n + 2;
  1449.       }
  1450. --- 925,931 ----
  1451.         if (n != 255)
  1452.       {
  1453.         PrintField(buf, 1, 1, INT8, "delta");
  1454. !       PrintString8(&buf[2], (long)n, "text item 8 string");
  1455.         buf += n + 2;
  1456.         length -= n + 2;
  1457.       }
  1458. ***************
  1459. *** 956,962 ****
  1460.         if (n != 255)
  1461.       {
  1462.         PrintField(buf, 1, 1, INT8, "delta");
  1463. !       PrintString16(&buf[2], n, "text item 16 string");
  1464.         buf += n + 2;
  1465.         length -= n + 2;
  1466.       }
  1467. --- 952,958 ----
  1468.         if (n != 255)
  1469.       {
  1470.         PrintField(buf, 1, 1, INT8, "delta");
  1471. !       PrintString16(&buf[2], (long)n, "text item 16 string");
  1472.         buf += n + 2;
  1473.         length -= n + 2;
  1474.       }
  1475. ***************
  1476. *** 989,995 ****
  1477.     for (i = 0; i < n; i++)
  1478.       {
  1479.         /* get the hex representations */
  1480. !       sprintf(h, "%02x",(0xff & buf[i]));
  1481.   
  1482.         /* check if these characters will fit on this line */
  1483.         if ((column + strlen(h) + 1) > MAXline)
  1484. --- 985,991 ----
  1485.     for (i = 0; i < n; i++)
  1486.       {
  1487.         /* get the hex representations */
  1488. !       (void)sprintf(h, "%02x",(0xff & buf[i]));
  1489.   
  1490.         /* check if these characters will fit on this line */
  1491.         if ((column + strlen(h) + 1) > MAXline)
  1492. diff -c distribution/scope.c ./scope.c
  1493. *** distribution/scope.c    Tue Dec 20 15:46:28 1988
  1494. --- ./scope.c    Tue Dec 20 17:37:34 1988
  1495. ***************
  1496. *** 9,14 ****
  1497. --- 9,22 ----
  1498.   
  1499.   #include "scope.h"
  1500.   
  1501. + #include <sys/types.h>           /* needed by sys/socket.h and netinet/in.h */
  1502. + #include <sys/uio.h>           /* for struct iovec, used by socket.h */
  1503. + #include <sys/socket.h>           /* for AF_INET, SOCK_STREAM, ... */
  1504. + #include <sys/ioctl.h>           /* for FIONCLEX, FIONBIO, ... */
  1505. + #include <netinet/in.h>           /* struct sockaddr_in */
  1506. + #include <netdb.h>           /* struct servent * and struct hostent * */
  1507. + #include <errno.h>           /* for EINTR, EADDRINUSE, ... */
  1508. + extern int  errno;
  1509.   
  1510.   /* ********************************************** */
  1511.   /*                                                */
  1512. ***************
  1513. *** 68,74 ****
  1514.   }
  1515.   
  1516.   
  1517. ! char *OfficialName()  /* forward type declaration */;
  1518.   
  1519.   ScanArgs(argc, argv)
  1520.        int     argc;
  1521. --- 76,82 ----
  1522.   }
  1523.   
  1524.   
  1525. ! char *OfficialName();  /* forward type declaration */
  1526.   
  1527.   ScanArgs(argc, argv)
  1528.        int     argc;
  1529. ***************
  1530. *** 134,140 ****
  1531.   
  1532.         case 'h':
  1533.           if (++*argv != NULL && **argv != '\0')
  1534. !           strcpy(ServerHostName, OfficialName(*argv));
  1535.           debug(1,(stderr, "ServerHostName=%s\n", ServerHostName));
  1536.           break;
  1537.   
  1538. --- 142,148 ----
  1539.   
  1540.         case 'h':
  1541.           if (++*argv != NULL && **argv != '\0')
  1542. !           (void)strcpy(ServerHostName, OfficialName(*argv));
  1543.           debug(1,(stderr, "ServerHostName=%s\n", ServerHostName));
  1544.           break;
  1545.   
  1546. ***************
  1547. *** 262,268 ****
  1548.       }
  1549.     else if (server >= 0)
  1550.         {
  1551. !     close(server);
  1552.       NotUsingFD(server);
  1553.         }
  1554.   }
  1555. --- 270,276 ----
  1556.       }
  1557.     else if (server >= 0)
  1558.         {
  1559. !     (void)close(server);
  1560.       NotUsingFD(server);
  1561.         }
  1562.   }
  1563. ***************
  1564. *** 275,283 ****
  1565.     StopClientConnection(ServerHalf(fd));
  1566.     StopServerConnection(ClientHalf(fd));
  1567.   
  1568. !   close(fd);
  1569.     NotUsingFD(fd);
  1570. !   close(FDPair(fd));
  1571.     NotUsingFD(FDPair(fd));
  1572.   }
  1573.   
  1574. --- 283,291 ----
  1575.     StopClientConnection(ServerHalf(fd));
  1576.     StopServerConnection(ClientHalf(fd));
  1577.   
  1578. !   (void)close(fd);
  1579.     NotUsingFD(fd);
  1580. !   (void)close(FDPair(fd));
  1581.     NotUsingFD(FDPair(fd));
  1582.   }
  1583.   
  1584. ***************
  1585. *** 312,318 ****
  1586.   
  1587.     if (ClientNumber <= 1)
  1588.       return("");
  1589. !   sprintf(name, " %d", FDinfo[fd].ClientNumber);
  1590.     return(name);
  1591.   }
  1592.   
  1593. --- 320,326 ----
  1594.   
  1595.     if (ClientNumber <= 1)
  1596.       return("");
  1597. !   (void)sprintf(name, " %d", FDinfo[fd].ClientNumber);
  1598.     return(name);
  1599.   }
  1600.   
  1601. ***************
  1602. *** 458,472 ****
  1603.   /*                                */
  1604.   /* ************************************************************ */
  1605.   
  1606. - #include <sys/types.h>           /* needed by sys/socket.h and netinet/in.h */
  1607. - #include <sys/uio.h>           /* for struct iovec, used by socket.h */
  1608. - #include <sys/socket.h>           /* for AF_INET, SOCK_STREAM, ... */
  1609. - #include <sys/ioctl.h>           /* for FIONCLEX, FIONBIO, ... */
  1610. - #include <netinet/in.h>           /* struct sockaddr_in */
  1611. - #include <netdb.h>           /* struct servent * and struct hostent * */
  1612. - #include <errno.h>           /* for EINTR, EADDRINUSE, ... */
  1613. - extern int  errno;
  1614.   static int  ON = 1 /* used in ioctl */ ;
  1615.   
  1616.   NewConnection(fd)
  1617. --- 466,471 ----
  1618. ***************
  1619. *** 506,513 ****
  1620.       }
  1621.   
  1622.     UsingFD(ClientFD, DataFromClient);
  1623. !   ioctl(ClientFD, FIOCLEX, 0);
  1624. !   ioctl(ClientFD, FIONBIO, &ON);
  1625.     StartClientConnection(ClientFD);
  1626.     return(ClientFD);
  1627.   }
  1628. --- 505,512 ----
  1629.       }
  1630.   
  1631.     UsingFD(ClientFD, DataFromClient);
  1632. !   (void)ioctl(ClientFD, FIOCLEX, 0);
  1633. !   (void)ioctl(ClientFD, FIONBIO, &ON);
  1634.     StartClientConnection(ClientFD);
  1635.     return(ClientFD);
  1636.   }
  1637. ***************
  1638. *** 527,532 ****
  1639. --- 526,534 ----
  1640.     FD ServerFD;
  1641.     struct sockaddr_in  sin;
  1642.     struct hostent *hp;
  1643. + #ifndef    SO_DONTLINGER
  1644. +   struct linger linger;
  1645. + #endif    SO_DONTLINGER
  1646.   
  1647.     enterprocedure("ConnectToServer");
  1648.   
  1649. ***************
  1650. *** 541,547 ****
  1651. --- 543,555 ----
  1652.       }
  1653.     (void) setsockopt(ServerFD, SOL_SOCKET, SO_REUSEADDR,  (char *) NULL, 0);
  1654.     (void) setsockopt(ServerFD, SOL_SOCKET, SO_USELOOPBACK,(char *) NULL, 0);
  1655. + #ifdef    SO_DONTLINGER
  1656.     (void) setsockopt(ServerFD, SOL_SOCKET, SO_DONTLINGER, (char *) NULL, 0);
  1657. + #else    SO_DONTLINGER
  1658. +   linger.l_onoff = 0;
  1659. +   linger.l_linger = 0;
  1660. +   (void) setsockopt(ServerFD, SOL_SOCKET, SO_LINGER, (char *)&linger, sizeof linger);
  1661. + #endif    SO_DONTLINGER
  1662.   
  1663.     /* determine the host machine for this process */
  1664.     if (ServerHostName[0] == '\0')
  1665. ***************
  1666. *** 564,570 ****
  1667.         && strcmp(ServerHostName, ScopeHost) == 0)
  1668.       {
  1669.         char error_message[100];
  1670. !       sprintf(error_message, "Trying to attach to myself: %s,%d\n",
  1671.             ServerHostName, sin.sin_port);
  1672.         panic(error_message);
  1673.       }
  1674. --- 572,578 ----
  1675.         && strcmp(ServerHostName, ScopeHost) == 0)
  1676.       {
  1677.         char error_message[100];
  1678. !       (void)sprintf(error_message, "Trying to attach to myself: %s,%d\n",
  1679.             ServerHostName, sin.sin_port);
  1680.         panic(error_message);
  1681.       }
  1682. ***************
  1683. *** 583,589 ****
  1684.       case ECONNREFUSED:
  1685.         /* experience says this is because there is no Server
  1686.            to connect to */
  1687. !       close(ServerFD);
  1688.         debug(1,(stderr, "No Server\n"));
  1689.         if (report)
  1690.           warn("Can't open connection to Server");
  1691. --- 591,597 ----
  1692.       case ECONNREFUSED:
  1693.         /* experience says this is because there is no Server
  1694.            to connect to */
  1695. !       (void)close(ServerFD);
  1696.         debug(1,(stderr, "No Server\n"));
  1697.         if (report)
  1698.           warn("Can't open connection to Server");
  1699. ***************
  1700. *** 590,596 ****
  1701.         return(-1);
  1702.   
  1703.       default:
  1704. !       close(ServerFD);
  1705.         panic("Can't open connection to Server");
  1706.       }
  1707.       }
  1708. --- 598,604 ----
  1709.         return(-1);
  1710.   
  1711.       default:
  1712. !       (void)close(ServerFD);
  1713.         panic("Can't open connection to Server");
  1714.       }
  1715.       }
  1716. diff -c distribution/server.c ./server.c
  1717. *** distribution/server.c    Tue Dec 20 15:46:41 1988
  1718. --- ./server.c    Tue Dec 20 17:37:39 1988
  1719. ***************
  1720. *** 56,62 ****
  1721.     long    sec /* seconds */ ;
  1722.     long    hsec /* hundredths of a second */ ;
  1723.   
  1724. !   gettimeofday(&tp, (struct timezone *)NULL);
  1725.     if (ZeroTime1 == -1 || (tp.tv_sec - lastsec) >= 1000)
  1726.       {
  1727.         ZeroTime1 = tp.tv_sec;
  1728. --- 56,62 ----
  1729.     long    sec /* seconds */ ;
  1730.     long    hsec /* hundredths of a second */ ;
  1731.   
  1732. !   (void)gettimeofday(&tp, (struct timezone *)NULL);
  1733.     if (ZeroTime1 == -1 || (tp.tv_sec - lastsec) >= 1000)
  1734.       {
  1735.         ZeroTime1 = tp.tv_sec;
  1736. ***************
  1737. *** 93,98 ****
  1738. --- 93,99 ----
  1739.   unsigned long    ILong (buf)
  1740.        unsigned char   buf[];
  1741.   {
  1742. +   /* check for byte-swapping */
  1743.     return((((((buf[0] << 8) | buf[1]) << 8) | buf[2]) << 8) | buf[3]);
  1744.   }
  1745.   
  1746. ***************
  1747. *** 99,107 ****
  1748. --- 100,116 ----
  1749.   unsigned short   IShort (buf)
  1750.   unsigned char   buf[];
  1751.   {
  1752. +   /* check for byte-swapping */
  1753.     return((buf[0] << 8) | buf[1]);
  1754.   }
  1755.   
  1756. + unsigned short   IChar2B (buf)
  1757. + unsigned char   buf[];
  1758. + {
  1759. +   /* CHAR2B is like an IShort, but not byte-swapped */
  1760. +   return((buf[0] << 8) | buf[1]);
  1761. + }
  1762.   unsigned short   IByte (buf)
  1763.   unsigned char   buf[];
  1764.   {
  1765. ***************
  1766. *** 137,146 ****
  1767.         /* not enough room so far; malloc more space and copy */
  1768.         long    SizeofNewBytes = (CS[fd].NumberofSavedBytes + n + 1);
  1769.         unsigned char   *NewBytes = (unsigned char *)Malloc (SizeofNewBytes);
  1770. !       bcopy(/* from  */(char *)CS[fd].SavedBytes,
  1771. !         /* to    */(char *)NewBytes,
  1772. !         /* count */(int)CS[fd].SizeofSavedBytes);
  1773. !       Free((char *)CS[fd].SavedBytes);
  1774.         CS[fd].SavedBytes = NewBytes;
  1775.         CS[fd].SizeofSavedBytes = SizeofNewBytes;
  1776.       }
  1777. --- 146,158 ----
  1778.         /* not enough room so far; malloc more space and copy */
  1779.         long    SizeofNewBytes = (CS[fd].NumberofSavedBytes + n + 1);
  1780.         unsigned char   *NewBytes = (unsigned char *)Malloc (SizeofNewBytes);
  1781. !       if (CS[fd].NumberofSavedBytes > 0)
  1782. !     {
  1783. !       bcopy(/* from  */(char *)CS[fd].SavedBytes,
  1784. !         /* to    */(char *)NewBytes,
  1785. !         /* count */(int)CS[fd].NumberofSavedBytes);
  1786. !       Free((char *)CS[fd].SavedBytes);
  1787. !     }
  1788.         CS[fd].SavedBytes = NewBytes;
  1789.         CS[fd].SizeofSavedBytes = SizeofNewBytes;
  1790.       }
  1791. diff -c distribution/table11.c ./table11.c
  1792. *** distribution/table11.c    Tue Dec 20 15:46:22 1988
  1793. --- ./table11.c    Tue Dec 20 17:37:43 1988
  1794. ***************
  1795. *** 412,418 ****
  1796. --- 412,452 ----
  1797.     DefineEValue(p, 33L, "ClientMessage");
  1798.     DefineEValue(p, 34L, "MappingNotify");
  1799.   
  1800. +   DefineEValue(p, 0x80L | 2L, "KeyPress (from SendEvent)");
  1801. +   DefineEValue(p, 0x80L | 3L, "KeyRelease (from SendEvent)");
  1802. +   DefineEValue(p, 0x80L | 4L, "ButtonPress (from SendEvent)");
  1803. +   DefineEValue(p, 0x80L | 5L, "ButtonRelease (from SendEvent)");
  1804. +   DefineEValue(p, 0x80L | 6L, "MotionNotify (from SendEvent)");
  1805. +   DefineEValue(p, 0x80L | 7L, "EnterNotify (from SendEvent)");
  1806. +   DefineEValue(p, 0x80L | 8L, "LeaveNotify (from SendEvent)");
  1807. +   DefineEValue(p, 0x80L | 9L, "FocusIn (from SendEvent)");
  1808. +   DefineEValue(p, 0x80L | 10L, "FocusOut (from SendEvent)");
  1809. +   DefineEValue(p, 0x80L | 11L, "KeymapNotify (from SendEvent)");
  1810. +   DefineEValue(p, 0x80L | 12L, "Expose (from SendEvent)");
  1811. +   DefineEValue(p, 0x80L | 13L, "GraphicsExposure (from SendEvent)");
  1812. +   DefineEValue(p, 0x80L | 14L, "NoExposure (from SendEvent)");
  1813. +   DefineEValue(p, 0x80L | 15L, "VisibilityNotify (from SendEvent)");
  1814. +   DefineEValue(p, 0x80L | 16L, "CreateNotify (from SendEvent)");
  1815. +   DefineEValue(p, 0x80L | 17L, "DestroyNotify (from SendEvent)");
  1816. +   DefineEValue(p, 0x80L | 18L, "UnmapNotify (from SendEvent)");
  1817. +   DefineEValue(p, 0x80L | 19L, "MapNotify (from SendEvent)");
  1818. +   DefineEValue(p, 0x80L | 20L, "MapRequest (from SendEvent)");
  1819. +   DefineEValue(p, 0x80L | 21L, "ReparentNotify (from SendEvent)");
  1820. +   DefineEValue(p, 0x80L | 22L, "ConfigureNotify (from SendEvent)");
  1821. +   DefineEValue(p, 0x80L | 23L, "ConfigureRequest (from SendEvent)");
  1822. +   DefineEValue(p, 0x80L | 24L, "GravityNotify (from SendEvent)");
  1823. +   DefineEValue(p, 0x80L | 25L, "ResizeRequest (from SendEvent)");
  1824. +   DefineEValue(p, 0x80L | 26L, "CirculateNotify (from SendEvent)");
  1825. +   DefineEValue(p, 0x80L | 27L, "CirculateRequest (from SendEvent)");
  1826. +   DefineEValue(p, 0x80L | 28L, "PropertyNotify (from SendEvent)");
  1827. +   DefineEValue(p, 0x80L | 29L, "SelectionClear (from SendEvent)");
  1828. +   DefineEValue(p, 0x80L | 30L, "SelectionRequest (from SendEvent)");
  1829. +   DefineEValue(p, 0x80L | 31L, "SelectionNotify (from SendEvent)");
  1830. +   DefineEValue(p, 0x80L | 32L, "ColormapNotify (from SendEvent)");
  1831. +   DefineEValue(p, 0x80L | 33L, "ClientMessage (from SendEvent)");
  1832. +   DefineEValue(p, 0x80L | 34L, "MappingNotify (from SendEvent)");
  1833.   
  1834.     p = DefineType(BITGRAVITY, ENUMERATED, "BITGRAVITY", PrintENUMERATED);
  1835.     DefineEValue(p, 0L, "Forget");
  1836.     DefineEValue(p, 1L, "NorthWest");
  1837. ***************
  1838. *** 833,839 ****
  1839.     PrintField(buf, 0, 1, HOSTFAMILY, "family");
  1840.     PrintField(buf, 2, 2, DVALUE2(n), "length of address");
  1841.     n = IShort(&buf[2]);
  1842. !   PrintList(&buf[4], (long)n, BYTE, "address");
  1843.     return(pad((long)(4 + n)));
  1844.   }
  1845.   
  1846. --- 867,873 ----
  1847.     PrintField(buf, 0, 1, HOSTFAMILY, "family");
  1848.     PrintField(buf, 2, 2, DVALUE2(n), "length of address");
  1849.     n = IShort(&buf[2]);
  1850. !   (void)PrintList(&buf[4], (long)n, BYTE, "address");
  1851.     return(pad((long)(4 + n)));
  1852.   }
  1853.   
  1854. diff -c distribution/x11.h ./x11.h
  1855. *** distribution/x11.h    Tue Dec 20 15:46:42 1988
  1856. --- ./x11.h    Tue Dec 20 17:37:45 1988
  1857. ***************
  1858. *** 422,430 ****
  1859.   
  1860.   extern unsigned long    ILong();
  1861.   extern unsigned short   IShort();
  1862.   extern unsigned short   IByte();
  1863.   extern Boolean          IBool();
  1864.   
  1865.   extern long    PrintList();
  1866. - extern long    PrintListSTR();
  1867.   extern long    pad();
  1868. --- 422,434 ----
  1869.   
  1870.   extern unsigned long    ILong();
  1871.   extern unsigned short   IShort();
  1872. + extern unsigned short   IChar2B();
  1873.   extern unsigned short   IByte();
  1874.   extern Boolean          IBool();
  1875.   
  1876. + extern PrintString8();
  1877. + extern PrintString16();
  1878. + extern PrintListSTR();
  1879.   extern long    PrintList();
  1880.   extern long    pad();
  1881. -- 
  1882. Mike Wexler(wyse!mikew)    Phone: (408)433-1000 x1330
  1883. Moderator of comp.sources.x
  1884.