home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / vmsnet / sources / 350 < prev    next >
Encoding:
Internet Message Format  |  1992-09-03  |  47.5 KB

  1. Path: sparky!uunet!stanford.edu!agate!dog.ee.lbl.gov!network.ucsd.edu!mvb.saic.com!vmsnet-sources
  2. From: mahan@tgv.com (Patrick L. Mahan - TGV Window Washer)
  3. Newsgroups: vmsnet.sources
  4. Subject: XSCOPE/VMS 1.0, part 03/08
  5. Message-ID: <8045406@MVB.SAIC.COM>
  6. Date: Fri, 04 Sep 1992 05:34:19 GMT
  7. Reply-To: mahan@tgv.com
  8. Organization: TGV Incorporated (Tech Support) in Santa Cruz, CA
  9. Lines: 1694
  10. Approved: Mark.Berryman@Mvb.Saic.Com
  11.  
  12. Submitted-by: mahan@tgv.com (Patrick L. Mahan - TGV Window Washer)
  13. Posting-number: Volume 3, Issue 155
  14. Archive-name: xscope/part03
  15.  
  16.  
  17. -+-+-+-+-+-+-+-+ START OF PART 3 -+-+-+-+-+-+-+-+
  18. X        int     bytes;
  19. X        int     i;
  20. X
  21. X#ifdef DNDEBUG
  22. X    `09fprintf(stderr, "socket_writev: start - passed chan %d\n", d);
  23. X#endif /* DNDEBUG */
  24. X        for(i = 0, totbytes = 0; i < iovcnt; i++)
  25. X        `7B
  26. X                bytes = socket_write((short) d, iov`5Bi`5D.iov_base, MIN(MAX
  27. V_QIO, iov`5Bi`5D.iov_len));
  28. X                totbytes += bytes;
  29. X                if(bytes < iov`5Bi`5D.iov_len)
  30. X                `7B
  31. X#ifdef DNDEBUG
  32. X                        fprintf(stderr, "Block occured in writev, %d/%d\n",b
  33. Vytes,
  34. X                                iov`5Bi`5D.iov_len);
  35. X#endif
  36. X                        socket_errno = EWOULDBLOCK;
  37. X                        return totbytes;
  38. X                `7D
  39. X        `7D
  40. X        return totbytes;
  41. X`7D
  42. $ CALL UNPACK DNET_SOCKET_LIBRARY.C;81 1998254311
  43. $ create 'f'
  44. XCOMMON.OBJ
  45. XDECODE11.OBJ
  46. XFD.OBJ
  47. XPRINT11.OBJ
  48. XPRTYPE.OBJ
  49. XSCOPE.OBJ
  50. XSERVER.OBJ
  51. XTABLE11.OBJ
  52. XDNET_SOCKET_LIBRARY
  53. XSYS$LIBRARY:VAXCRTL.EXE/SHARE
  54. $ CALL UNPACK DNXSCOPE.OPT;2 540287428
  55. $ create 'f'
  56. X/*
  57. X * $NCDId: @(#)emulationlib.h,v 4.4 1992/01/31 11:28:04 hardison Exp $
  58. X *`20
  59. X * Emulation defines, strutures and macros for the DNET_SOCKET_LIBRARY
  60. X * OBH - NCD - 3/2/92
  61. X */
  62. X#include nfbdef
  63. X
  64. X#ifndef _TIME_
  65. X#define _TIME_
  66. X#endif /*_TIME_*/
  67. X
  68. Xtypedef unsigned short u_short;
  69. Xtypedef unsigned long u_long;
  70. X
  71. X#define BCMP(s1, s2, l) (memcmp ((s1), (s2), (l)))
  72. X#define BCOPY(s, d, l) (memcpy ((d), (s), (l)))
  73. X#define BZERO(b,len) memset(b, 0, (size_t)(len))
  74. X#define DNETALLOC(s)`09(dnMalloc((s)))
  75. X#define DNETFREE(a)`09(dnFree((a)))
  76. X#define ENABLE_ASTS     (SYS$SETAST(1))
  77. X#define HIBERNATE       (SYS$HIBER())
  78. X#define DISABLE_ASTS    (SYS$SETAST(0))
  79. X#define WAKE_UP_DAMMIT`09(SYS$WAKE(0, 0))
  80. X#define MAX_QIO         0xffff
  81. X#define VMSFAIL(status) (0==(1&(status)))
  82. X#define BITSPERBYTE      8
  83. X#define MAX_OPTION      4
  84. X#define MAX_LINKS       32
  85. X#define NODNAMSIZ`0916
  86. X#define NET_RD          1
  87. X#define NET_WRT         2
  88. X#define NET_CMD         3
  89. X#define TEMP_MBX        0
  90. X#define MAX_MSG         128
  91. X#define BUF_QUO         128
  92. X#define EWOULDBLOCK     35
  93. X#define TASKOBJECT`09"TASK="
  94. X#define MAXDNETNODES`0930
  95. X#define HOST_NOT_FOUND  1
  96. X#define NFB_MAX_FIELD_ID_ENTRIES 10
  97. X#define AF_DECnet`0912
  98. X#define AF_INET         2
  99. X#define DNET_PREFIX     "DECNET/"
  100. X#define DNET_IV_MAXLEN  8
  101. X#define NCBSIZE         256
  102. X#define DECNET `09`09"DECnet"
  103. X#define CPUTYPE `09"Vax"
  104. X#define OPSYS   `09"VMS"
  105. X#define INADDR_ANY              (u_long)0x00000000
  106. X#define FIONBIO `09126
  107. X#define SOCK_STREAM     1     `20
  108. X#define SOL_SOCKET      0xffff`20
  109. X#define SO_REUSEADDR    0x0004
  110. X#define SO_USELOOPBACK  0x0040
  111. X
  112. X#ifndef MIN
  113. X#define MIN(a,b) ((a) < (b) ? (a) : (b))
  114. X#endif /* MIN */
  115. X
  116. X#ifndef MAX
  117. X#define MAX(a,b) ((a) < (b) ? (b) : (a))
  118. X#endif /* MAX */
  119. X
  120. Xstruct io_stat_blk
  121. X`7B
  122. X        short int status;
  123. X        unsigned short msg_len;
  124. X        int unused;
  125. X`7D;
  126. X
  127. Xstruct astblk
  128. X`7B
  129. X    `09char type;
  130. X        unsigned short chan;
  131. X        char unused;
  132. X`7D;
  133. X
  134. Xtypedef union
  135. X`7B
  136. X        int astid;
  137. X`09struct astblk ast;
  138. X`7D astParam;
  139. X
  140. Xstruct
  141. X`7B
  142. X        char func;
  143. X        int terminator;
  144. X`7D nfb = `7B NFB$C_DECLNAME, 0 `7D;
  145. X
  146. Xstruct in_addr `7B
  147. X        u_long s_addr;
  148. X`7D;
  149. X
  150. Xstruct sockaddr_in `7B
  151. X        short   sin_family;
  152. X        u_short sin_port;
  153. X        struct  in_addr sin_addr;
  154. X        char    sin_zero`5B8`5D;
  155. X`7D;
  156. X
  157. Xstruct sockaddr
  158. X`7B
  159. X        unsigned short sa_family;
  160. X        char    sa_data`5B14`5D;
  161. X`7D;
  162. X
  163. Xstruct hostent
  164. X`7B
  165. X        char    *h_name;
  166. X        char    **h_aliases;
  167. X        int     h_addrtype;
  168. X        int     h_length;
  169. X        char    **h_addr_list;
  170. X#define h_addr h_addr_list`5B0`5D
  171. X        char    *h_cputype;
  172. X        char    *h_opsys;
  173. X        char    **h_protos;
  174. X        struct sockaddr *h_addresses;
  175. X`7D;
  176. X
  177. Xstruct stackstruct
  178. X`7B
  179. X        short   type;
  180. X        unsigned short channel;
  181. X`7D;
  182. X
  183. X/*
  184. X * TYPES.H emulation
  185. X */
  186. X#define NBBY    8               `09/* number of bits in a byte */
  187. X#define NBLW    (NBBY*sizeof(long))`09/* number of bits in a longword */
  188. X#ifndef FD_SETSIZE
  189. X#define FD_SETSIZE 512
  190. X#endif
  191. X#define CHANNELSIZE     16      /* Size of a channel */
  192. X
  193. Xtypedef long    fd_mask;
  194. X#define NFDBITS (sizeof(fd_mask) * NBBY)        /* bits per mask */
  195. X#ifndef howmany
  196. X#define howmany(x, y)   (((x)+((y)-1))/(y))
  197. X#endif
  198. X
  199. Xtypedef struct fd_set `7B
  200. X        fd_mask bits`5Bhowmany(FD_SETSIZE, NFDBITS)`5D;
  201. X`7D fd_set;
  202. X
  203. X#define FD_SET(n, p)    ((p)->bits`5B(n)/CHANNELSIZE/NFDBITS`5D \
  204. X                        `7C= (1 << (((n)/CHANNELSIZE) %NFDBITS)))
  205. X#define FD_CLR(n, p)    ((p)->bits`5B(n)/CHANNELSIZE/NFDBITS`5D \
  206. X                        &= `7E(1 << (((n)/CHANNELSIZE) %NFDBITS)))
  207. X#define FD_ISSET(n, p)  ((!((n) % CHANNELSIZE)) && ((p)->bits`5B(n)/CHANNELS
  208. VIZE/NFDBITS`5D \
  209. X                        & (1 <<(((n)/CHANNELSIZE) % NFDBITS))))
  210. X#define FD_ZERO(p)      bzero((char *)(p), sizeof(*(p)))
  211. X
  212. X/*
  213. X * Structure returned by gettimeofday(2) system call,
  214. X * and used in other calls.
  215. X */
  216. Xstruct timeval
  217. X`7B
  218. X        long    tv_sec;         /* seconds */
  219. X        long    tv_usec;        /* and microseconds */
  220. X`7D;
  221. X
  222. Xstruct iovec
  223. X`7B
  224. X        char    *iov_base;
  225. X        int     iov_len;
  226. X`7D;
  227. X/*
  228. X * The channel table is needed to keep track of each connection's
  229. X * virtual memory read buffer base address, current (delta) pointer, and
  230. X * current size.  In addition, the structure provides a request reference
  231. X * variable usde mainly to determine the type of connection (NONBLOCKING or
  232. V otherwise).
  233. X * In the future, this mechanism can be used to expand the types of connecti
  234. Vons
  235. X * allowed for socket I/O.
  236. X */
  237. Xstruct opttable
  238. X`7B
  239. X        char    *option;
  240. X        int     optionlen;
  241. X`7D;
  242. X
  243. Xstruct chantable
  244. X`7B
  245. X        char    *base;    `09      `09/* base of virt mem for reads */
  246. X        char    *delta;   `09      `09/* current ptr of virt mem for reads *
  247. V/
  248. X`09char`09*nodename;`09`09/* name of attached client node */
  249. X`09char`09*user;`09`09`09/* user of attached client */
  250. X    `09short`09area;`09`09`09/* DECnet address area number */
  251. X    `09short`09node;`09`09`09/* DECnet address node number */
  252. X        short   readAstPend;    `09/* 0 = no AST's pending */
  253. X        short   readAstDone;    `09/* 1 = AST read data available */
  254. X`09int`09chanDassgn;`09`09/* Channel deassign flag for asynch deallocs */
  255. X`09int`09unit;`09`09`09/* Network unit number from GETDVI */
  256. X        int     len;           `09`09/* current len of virt mem */
  257. X        int     type;           `09/* channel request type from socket_ioctl
  258. V */
  259. X        int     *backLogQueue;  `09/* Non-NULL for "accept"ing (_NET:) chann
  260. Vels only */
  261. X        int     backLogQueueLength;
  262. X`09struct io_stat_blk read_iosb;`09/* IOSB for QIO read returns */
  263. X`09struct io_stat_blk write_iosb;`09/* IOSB for QIO write returns */
  264. X        struct opttable o`5BMAX_OPTION`5D;
  265. X`7D;
  266. X
  267. X/* *** should be linked to MAXCLIENTS (from site.h or globals.h)*/
  268. X
  269. Xtypedef struct
  270. X`7B
  271. X    `09char`09*nodebuf;
  272. X    `09short`09area;
  273. X    `09short`09node;
  274. X`7D NCPstruct;
  275. X
  276. Xstruct nfbdef`20
  277. X`7B
  278. X    unsigned char`09fct;
  279. X    unsigned char`09flags;
  280. X    unsigned char`09database;
  281. X    unsigned char`09oper;
  282. X    long `09`09srchKey;
  283. X    long `09`09srch2Key;
  284. X    unsigned char`09oper2;
  285. X    unsigned char`09mbz1;
  286. X    short `09`09cellSize;
  287. X    long`09`09fldid`5BNFB_MAX_FIELD_ID_ENTRIES`5D;
  288. X`7D;
  289. X
  290. Xstruct nfbdef1`20
  291. X`7B
  292. X    union`20
  293. X    `7B
  294. X    `09long`09paramId;
  295. X    `09struct`20
  296. X    `09`7B
  297. X    `09`09unsigned `09inx : 16;
  298. X    `09`09unsigned `09typ : 2;
  299. X    `09`09unsigned `09spare : 6;
  300. X    `09`09unsigned `09db : 8;
  301. X    `09`7D fields;
  302. X    `7D overlay;
  303. X`7D;
  304. X
  305. Xstruct nfbdef2`20
  306. X`7B
  307. X    union`20
  308. X    `7B`09
  309. X    `09long`09lngValue;
  310. X    `09long`09bitValue;
  311. X    `09struct`20
  312. X    `09`7B
  313. X    `09`09short `09 `09strCount;
  314. X    `09`09char `09`09strText;
  315. X    `09`7D string;
  316. X    `7D overlay;
  317. X`7D;
  318. X
  319. Xstruct netbuf
  320. X`7B
  321. X        short netCmd;
  322. X        short unit;
  323. X        char mbxMsg`5BMAX_MSG`5D;
  324. X`7D nb;
  325. X
  326. $ CALL UNPACK EMULATIONLIB.H;15 727015775
  327. $ create 'f'
  328. X/* ************************************************************ *\
  329. X *`09`09`09`09`09`09`09`09*
  330. X *    Support routines for file descriptors (FD) `09`09*
  331. X *`09`09`09`09`09`09`09`09*
  332. X *`09James Peterson, 1987  `09 `09`09`09`09*
  333. X *`09(c) Copyright MCC, 1987`09 `09`09`09`09*
  334. X * `09`09`09`09  `09`09`09`09*
  335. X * `09`09`09`09  `09`09`09`09*
  336. X \* *********************************************************** */
  337. X#if defined(vax11c) && !defined(MULTINET)
  338. X#include "emulationlib.h"
  339. X#endif
  340. X
  341. X#include "scope.h"
  342. X
  343. X
  344. X/*
  345. X  All of this code is to support the handling of file descriptors (FD).
  346. X  The idea is to keep a table of the FDs that are in use and why.
  347. X  For each FD that is open for input, we keep the name of a procedure
  348. X  to call if input arrives for that FD.  When an FD is created
  349. X  (by an open, pipe, socket, ...) declare that by calling UsingFD.
  350. X  When it is no longer in use (close ...), call NotUsingFD.
  351. X*/
  352. X
  353. X/* ************************************************************ */
  354. X/*`09`09`09`09`09`09`09`09*/
  355. X/*`09`09`09`09`09`09`09`09*/
  356. X/* ************************************************************ */
  357. X
  358. XInitializeFD()
  359. X`7B
  360. X  register short  i;
  361. X
  362. X  enterprocedure("InitializeFD");
  363. X  /* get the number of file descriptors the system will let us use */
  364. X  MaxFD = getdtablesize();
  365. X
  366. X  /* allocate space for a File Descriptor (FD) Table */
  367. X  FDD = (struct FDDescriptor *)
  368. X#ifdef vax11c
  369. X    MyMalloc ((long)(MaxFD * sizeof (struct FDDescriptor)));
  370. X#else
  371. X    Malloc ((long)(MaxFD * sizeof (struct FDDescriptor)));
  372. X#endif /* vax11c */
  373. X
  374. X  /* be sure all fd's are closed and marked not busy */
  375. X  for (i = 0; i < MaxFD; i++)
  376. X    `7B
  377. X      /* 0, 1, 2 are special (stdin, stdout, stderr) */
  378. X      if (i > 2)
  379. X`09close(i);
  380. X      FDD`5Bi`5D.Busy = false;
  381. X    `7D
  382. X
  383. X  /* save one FD for single file input or output like debugging */
  384. X  /* also the getservbyname call is currently using an FD */
  385. X  MaxFD -= 4;
  386. X
  387. X  nFDsInUse = 0 /* stdin, stdout, stderr */ ;
  388. X#ifdef vax11c
  389. X  FD_ZERO(&ReadDescriptors);
  390. X#else
  391. X  ReadDescriptors = 0;
  392. X#endif /* vax11c */
  393. X  HighestFD = 0;
  394. X
  395. X#ifndef vax11c`09/* we don't use these */
  396. X  UsingFD(fileno(stdin),  (int (*)())NULL);
  397. X  UsingFD(fileno(stdout), (int (*)())NULL);
  398. X  UsingFD(fileno(stderr), (int (*)())NULL);
  399. X#endif /* vax11c */
  400. X`7D
  401. X
  402. X/* ************************************************************ */
  403. X
  404. XUsingFD(fd, Handler)
  405. X     FD fd;
  406. X     int     (*Handler)();
  407. X`7B
  408. X  if (FDD`5Bfd`5D.Busy)
  409. X    NotUsingFD(fd);
  410. X  nFDsInUse += 1;
  411. X
  412. X  FDD`5Bfd`5D.Busy = true;
  413. X  FDD`5Bfd`5D.InputHandler = Handler;
  414. X  if (Handler == NULL)
  415. X#ifdef vax11c
  416. X    FD_CLR(fd, &ReadDescriptors);
  417. X#else
  418. X    ReadDescriptors &= `7E(1 << fd) /* clear fd bit */ ;
  419. X#endif /* vax11c */
  420. X  else
  421. X#ifdef vax11c
  422. X    FD_SET(fd, &ReadDescriptors);
  423. X#else
  424. X    ReadDescriptors `7C= 1 << fd /* set fd bit */ ;
  425. X#endif /* vax11c */
  426. X
  427. X  if (fd > HighestFD)
  428. X    HighestFD = fd;
  429. X
  430. X  if (nFDsInUse >= MaxFD)
  431. X    panic("no more FDs");
  432. X
  433. X  debug(128,(stderr, "Using FD %d, %d of %d in use\n", fd, nFDsInUse, MaxFD)
  434. V);
  435. X`7D
  436. X
  437. X/* ************************************************************ */
  438. X
  439. XNotUsingFD(fd)
  440. X     FD fd;
  441. X`7B
  442. X  debug(128,(stderr, "Not Using FD %d\n", fd));
  443. X
  444. X  if (FDD`5Bfd`5D.Busy)
  445. X    nFDsInUse -= 1;
  446. X
  447. X  FDD`5Bfd`5D.Busy = false;
  448. X#ifdef vax11c
  449. X  FD_CLR(fd, &ReadDescriptors);
  450. X#else
  451. X  ReadDescriptors &= `7E(1 << fd) /* clear fd bit */ ;
  452. X#endif /* vax11c */
  453. X
  454. X  while (!FDD`5BHighestFD`5D.Busy && HighestFD > 0)
  455. X    HighestFD -= 1;
  456. X
  457. X  debug(128,(stderr, "Highest FD %d, in use %d\n", HighestFD, nFDsInUse));
  458. X`7D
  459. X
  460. X/* ************************************************************ */
  461. X
  462. XEOFonFD(fd)
  463. X     FD fd;
  464. X`7B
  465. X  enterprocedure("EOFonFD");
  466. X  debug(128,(stderr, "EOF on %d\n", fd));
  467. X  close(fd);
  468. X  NotUsingFD(fd);
  469. X`7D
  470. X
  471. X
  472. X/* ************************************************************ */
  473. X/*`09`09`09`09`09`09`09`09*/
  474. X/*     Main Loop -- wait for input from any source and Process  */
  475. X/*`09`09`09`09`09`09`09`09*/
  476. X/* ************************************************************ */
  477. X
  478. X#include <errno.h>`09       /* for EINTR, EADDRINUSE, ... */
  479. X#ifdef vax11c
  480. Xextern volatile int noshare errno;
  481. X#else
  482. Xextern int  errno;
  483. X#endif /* vax11c */
  484. X
  485. X
  486. XMainLoop()
  487. X`7B
  488. X  enterprocedure("MainLoop");
  489. X
  490. X  while (true)
  491. X    `7B
  492. X#ifdef vax11c
  493. X      fd_set rfds, wfds, xfds;
  494. X#else
  495. X      int     rfds, wfds, xfds;
  496. X#endif /* vax11c */
  497. X      short   nfds;
  498. X      short   fd;
  499. X
  500. X      /* wait for something */
  501. X      rfds = ReadDescriptors;
  502. X#ifdef vax11c
  503. X      FD_ZERO(&wfds);
  504. X#else
  505. X      wfds = 0;
  506. X#endif /* vax11c */
  507. X      xfds = rfds;
  508. X
  509. X      debug(128,(stderr, "select %d, rfds = 0x%x\n", HighestFD + 1, rfds));
  510. X#ifdef vax11c
  511. X      nfds = select(HighestFD + 1, &rfds, &wfds, &xfds, NULL);
  512. X#else
  513. X#endif /* vax11c */
  514. X      debug(128,(stderr, "select nfds = 0x%x, rfds = 0x%x, 0x%x, xfds 0x%x\n
  515. V",
  516. X`09`09 nfds, rfds, wfds, xfds));
  517. X
  518. X      if (nfds < 0)
  519. X`09`7B
  520. X#ifdef vax11c
  521. X          socket_perror("SELECT");
  522. X#else
  523. X`09  if (errno == EINTR)
  524. X`09    continue /* to end of while loop */ ;
  525. X`09  debug(1,(stderr, "Bad select - errno = %d\n", errno));
  526. X`09  if (errno == EBADF)
  527. X`09    `7B
  528. X`09      /* one of the bits in rfds is invalid, close down
  529. X`09`09 files until it goes away */
  530. X`09      EOFonFD(HighestFD);
  531. X`09      continue;
  532. X`09    `7D
  533. X
  534. X`09  panic("Select returns error");
  535. X#endif /* vax11c */
  536. X`09  continue /* to end of while loop */ ;
  537. X`09`7D
  538. X
  539. X      if (nfds == 0)
  540. X`09`7B
  541. X`09  TimerExpired();
  542. X`09  continue;
  543. X`09`7D
  544. X
  545. X      /* check each fd to see if it has input */
  546. X#ifdef vax11c`09/* must skip over the stdin, stdout && stderr */
  547. X      for (fd = 4; 0 < nfds && fd <= HighestFD; fd++)
  548. X#else
  549. X      for (fd = 0; 0 < nfds && fd <= HighestFD; fd++)
  550. X#endif /* vax11c */
  551. X`09`7B
  552. X`09  /*
  553. X`09    check all returned fd's; this prevents
  554. X`09    starvation of later clients by earlier clients
  555. X`09  */
  556. X
  557. X#ifdef vax11c
  558. X`09  if (!FD_ISSET(fd, &rfds))
  559. X#else
  560. X`09  if ((rfds & (1 << fd)) == 0)
  561. X#endif /* vax11c */
  562. X`09    continue;
  563. X
  564. X`09  nfds -= 1;
  565. X
  566. X`09  if (FDD`5Bfd`5D.InputHandler == NULL)
  567. X`09    `7B
  568. X`09      panic("FD selected with no handler");
  569. X`09      debug(1,(stderr, "FD %d has NULL handler\n", fd));
  570. X`09    `7D
  571. X`09  else
  572. X`09    (FDD`5Bfd`5D.InputHandler)(fd);
  573. X`09`7D
  574. X    `7D
  575. X`7D
  576. $ CALL UNPACK FD.C;17 1733650262
  577. $ create 'f'
  578. X/* **********************************************
  579. X *`09`09`09`09`09`09*
  580. X * header file file descriptor (FD) code        *
  581. X *`09`09`09`09`09`09*
  582. X *`09James Peterson, 1987`09`09`09*
  583. X *`09(c) Copyright MCC, 1987 `09`09*
  584. X *`09`09`09`09`09`09*
  585. X ********************************************** */
  586. X
  587. X
  588. X/*`20
  589. X   the following structure remembers for each file descriptor its
  590. X   state.  In particular, we need to know if it is busy or free
  591. X   and if it is in use, by whom.
  592. X*/
  593. X
  594. Xtypedef int FD;
  595. X
  596. Xstruct FDDescriptor
  597. X`7B
  598. X    Boolean Busy;
  599. X    int     (*InputHandler)();
  600. X`7D;
  601. X
  602. Xstruct FDDescriptor *FDD /* array of FD descriptors */ ;
  603. Xshort   MaxFD /* maximum number of FD's possible */ ;
  604. X
  605. Xshort   nFDsInUse /* number of FD's actually in use */ ;
  606. X
  607. X#ifdef vax11c
  608. Xfd_set ReadDescriptors; /* bit map of FD's in use -- for select */
  609. X#else
  610. Xlong    ReadDescriptors /* bit map of FD's in use -- for select  */ ;
  611. X#endif /* vax11c */
  612. Xshort   HighestFD /* highest FD in use -- for select */ ;
  613. $ CALL UNPACK FD.H;2 1447173281
  614. $ create 'f'
  615. XReceived: from relay1.UU.NET (`5B137.39.1.5`5D) by TGV.COM via INTERNET ;
  616. X          Thu, 16 Apr 92 14:45:26 PDT
  617. XReceived: from uunet.uu.net (via LOCALHOST.UU.NET) by relay1.UU.NET with SMT
  618. VP`20
  619. X`09(5.61/UUNET-internet-primary) id AA27695; Thu, 16 Apr 92 17:45:22 -0400
  620. XReceived: from lupine.UUCP by uunet.uu.net with UUCP/RMAIL
  621. X`09(queueing-rmail) id 174438.23346; Thu, 16 Apr 1992 17:44:38 EDT
  622. XReceived: from hansen1.ncd.com by lupine.ncd.com (4.1/SMI-4.1)
  623. X`09id AA21354; Thu, 16 Apr 92 14:21:12 PDT
  624. XReceived: from local by hansen1.ncd.com (4.1/SMI-4.1)
  625. X`09id AA06337; Thu, 16 Apr 92 14:28:46 PDT
  626. XMessage-Id: <9204162128.AA06337@hansen1.ncd.com>
  627. XTo: mahan@tgv.com
  628. XSubject: 2 changes for DNET_SCOKET_LIBRARY:
  629. XDate: Thu, 16 Apr 92 14:28:45 PDT
  630. XFrom: Osborne Hardison (x137) <lupine!hardison@uunet.UU.NET>
  631. X
  632. XOz.
  633. X
  634. X
  635. X1. line 519 shouldbe "return NULL;" rather than "return -1;"
  636. X
  637. X2. Change the module connect() to be the following:
  638. X
  639. X/*
  640. X * connect():
  641. X * supports connecting to a "socket" given the network channel (from socket(
  642. V))
  643. X */
  644. Xint
  645. Xconnect (chan, name, namelen)
  646. X        unsigned short chan;
  647. X        struct sockaddr *name;
  648. X        unsigned int namelen;
  649. X`7B
  650. X        int             status;
  651. X        unsigned short  objlen;
  652. X        char *pncb;
  653. X        struct dsc$descriptor ncb_desc;
  654. X        static struct io_stat_blk iosb;
  655. X        struct dsc$descriptor_s *objdsc;
  656. X        char *objstr = DNETALLOC(NCBSIZE);
  657. X        char *hname;
  658. X        int l = 0;
  659. X        char *a;
  660. X        short *port = &name->sa_data`5B0`5D;
  661. X        short *area = &name->sa_data`5B2`5D;
  662. X        short *node = &name->sa_data`5B4`5D;
  663. X
  664. X#ifdef DNDEBUG
  665. X        fprintf(stderr, "connect: start - passed chan %d port %d addr %d.%d\
  666. Vn",
  667. X                chan, *port, *area, *node);
  668. X#endif /* DNDEBUG */
  669. X        BCOPY (TASKOBJECT, objstr, strlen(TASKOBJECT));
  670. X        hname = NULL;
  671. X        if ((objdsc = nameFromPort (name)))
  672. X        `7B
  673. X                hname = DNETALLOC(32);
  674. X                a = objstr + strlen(TASKOBJECT);
  675. X                BCOPY(objdsc->dsc$a_pointer, a, strlen(objdsc->dsc$a_pointer
  676. V));
  677. X                a+= strlen(objdsc->dsc$a_pointer);
  678. X                *a = 0x0;
  679. X                sprintf (hname, "%d.%d::", *area, *node);
  680. X        `7D
  681. X        pncb = initNCB(name, &objlen, objstr, hname);
  682. X        if (hname) DNETFREE(hname);
  683. X        ncb_desc.dsc$w_length = objlen;
  684. X        ncb_desc.dsc$a_pointer = pncb;
  685. X        ncb_desc.dsc$b_dtype = DSC$K_DTYPE_T;
  686. X        ncb_desc.dsc$b_class = DSC$K_CLASS_S;
  687. X
  688. X        status = SYS$QIOW (0, chan, IO$_ACCESS, &iosb, 0, 0, 0, &ncb_desc, 0
  689. V, 0, 0, 0);
  690. X        if (!VMSFAIL(status)) status = iosb.status;
  691. X        if (!VMSFAIL(status))
  692. X        `7B
  693. X#ifdef DNDEBUG
  694. X                fprintf(stderr, "connect: Connection to %s on channel %d\n",
  695. V pncb, chan);
  696. X#endif
  697. X                DNETFREE (pncb);
  698. X                return 0;
  699. X        `7D
  700. X        else
  701. X                LIB$SIGNAL (status);
  702. X        DNETFREE (pncb);
  703. X        return -1;
  704. X`7D
  705. X
  706. $ CALL UNPACK FIX.INFO;1 989988039
  707. $ create 'f'
  708. XLOCAL_LIBRARIES =`20
  709. XSRCS = prtype.c print11.c table11.c decode11.c server.c fd.c common.c scope.
  710. Vc
  711. XOBJS = scope.o common.o fd.o server.o decode11.o table11.o print11.o prtype.
  712. Vo
  713. XTOP=/x11
  714. X
  715. XComplexProgramTarget(xscope)
  716. $ CALL UNPACK IMAKEFILE.;1 1781289788
  717. $ create 'f'
  718. XCOMMON.OBJ
  719. XDECODE11.OBJ
  720. XFD.OBJ
  721. XPRINT11.OBJ
  722. XPRTYPE.OBJ
  723. XSCOPE.OBJ
  724. XSERVER.OBJ
  725. XTABLE11.OBJ
  726. XMULTINET_SOCKET_LIBRARY/SHARE
  727. XSYS$LIBRARY:VAXCRTL.EXE/SHARE
  728. $ CALL UNPACK IPXSCOPE.OPT;1 157314395
  729. $ create 'f'
  730. X$ SAVE_VERIFY='F$VERIFY(0)
  731. X$ if p1 .Eqs. "CLEAN" then goto clean
  732. X$ if p1 .Eqs. "CLOBBER" then goto clobber
  733. X$ if p1 .Eqs. "INSTALL" then goto install
  734. X$!
  735. X$!`09Compile the X11R4 XSCOPE application
  736. X$!
  737. X$ Set Symbol/Scope=NoGlobal
  738. X$!
  739. X$!  Get the compiler options via the logical name COPTS
  740. X$!
  741. X$ cc_options = f$trnlnm("COPTS")
  742. X$!
  743. X$!  Get the linker options via the logical name LOPTS
  744. X$!
  745. X$ link_options = f$trnlnm("LOPTS")
  746. X$!
  747. X$!  Compile the "C" files
  748. X$!
  749. X$! procedure target`09command `09`09`09depends upon
  750. X$! CALL MAKE FILE.OBJ`09"CC ''cc_options' FILE.C"`09FILE.C
  751. X$!
  752. X$! Nasty, but we do this to recompile everything correctly
  753. X$!
  754. X$ If F$Search("*.OBJ") .Nes. "" Then Delete/Nolog/Noconfirm *.obj;*
  755. X$ If F$Search("*.EXE") .Nes. "" Then Delete/Nolog/Noconfirm *.exe;*
  756. X$!
  757. X$ write sys$output "Compiling DECnet Version of XSCOPE sources"
  758. X$ CALL MAKE COMMON.OBJ  `09"CC ''cc_options' COMMON.C"`09COMMON.C
  759. X$ CALL MAKE DECODE11.OBJ  `09"CC ''cc_options' DECODE11.C"`09DECODE11.C
  760. X$ CALL MAKE FD.OBJ  `09`09"CC ''cc_options' FD.C"`09`09FD.C
  761. X$ CALL MAKE PRINT11.OBJ  `09"CC ''cc_options' PRINT11.C"`09PRINT11.C
  762. X$ CALL MAKE PRTYPE.OBJ  `09"CC ''cc_options' PRTYPE.C"`09PRTYPE.C
  763. X$ CALL MAKE SCOPE.OBJ  `09`09"CC ''cc_options' SCOPE.C"`09SCOPE.C
  764. X$ CALL MAKE SERVER.OBJ  `09"CC ''cc_options' SERVER.C"`09SERVER.C
  765. X$ CALL MAKE TABLE11.OBJ  `09"CC ''cc_options' TABLE11.C"`09TABLE11.C
  766. X$ CALL MAKE DNET_SOCKET_LIBRARY.OBJ  "CC ''cc_options' DNET_SOCKET_LIBRARY.C
  767. V" DNET_SOCKET_LIBRARY.C
  768. X$!
  769. X$ write sys$output "Building DECnet XSCOPE image"
  770. X$ CALL MAKE DNXSCOPE.EXE`09"LINK /EXE=DNXSCOPE/MAP=DNXSCOPE ''link_options'
  771. V DNXSCOPE/OPT"`09*.OBJ
  772. X$!
  773. X$! If this system has Multinet (or some other vendors TCP/IP) then
  774. X$! compile xscope for TCP/IP as well
  775. X$!
  776. X$ if f$search("multinet:multinet_socket_library.exe") .Eqs. "" Then Goto No_
  777. VTCPIP
  778. X$ cc_options = cc_options + "/define=(MULTINET)"
  779. X$ delete/nolog/noconfirm *.obj;*`09! get rid of the DECnet versions
  780. X$!
  781. X$ write sys$output "Compiling TCP/IP Version of XSCOPE sources"
  782. X$ CALL MAKE COMMON.OBJ  `09"CC ''cc_options' COMMON.C"`09COMMON.C
  783. X$ CALL MAKE DECODE11.OBJ  `09"CC ''cc_options' DECODE11.C"`09DECODE11.C
  784. X$ CALL MAKE FD.OBJ  `09`09"CC ''cc_options' FD.C"`09`09FD.C
  785. X$ CALL MAKE PRINT11.OBJ  `09"CC ''cc_options' PRINT11.C"`09PRINT11.C
  786. X$ CALL MAKE PRTYPE.OBJ  `09"CC ''cc_options' PRTYPE.C"`09PRTYPE.C
  787. X$ CALL MAKE SCOPE.OBJ  `09`09"CC ''cc_options' SCOPE.C"`09SCOPE.C
  788. X$ CALL MAKE SERVER.OBJ  `09"CC ''cc_options' SERVER.C"`09SERVER.C
  789. X$ CALL MAKE TABLE11.OBJ  `09"CC ''cc_options' TABLE11.C"`09TABLE11.C
  790. X$!
  791. X$ write sys$output "Building TCP/IP XSCOPE image"
  792. X$ CALL MAKE IPXSCOPE.EXE`09"LINK /EXE=IPXSCOPE/MAP=IPXSCOPE ''link_options'
  793. V IPXSCOPE/OPT"`09*.OBJ
  794. X$!
  795. X$! Jumped to here if this system doesn't have TCP/IP support
  796. X$!
  797. X$ No_TCPIP:
  798. X$!
  799. X$ exit
  800. X$!
  801. X$ Clobber:`09! Delete executables, Purge directory and clean up object files
  802. V and listings
  803. X$ Delete/noconfirm/log *.exe;*
  804. X$ Delete/noconfirm/log *.map;*
  805. X$!
  806. X$ Clean:`09! Purge directory, clean up object files and listings
  807. X$ Purge
  808. X$ Delete/noconfirm/log *.lis;*
  809. X$ Delete/noconfirm/log *.obj;*
  810. X$!
  811. X$ exit
  812. X$!
  813. X$ Install:
  814. X$ exit
  815. X$!
  816. X$ exit
  817. X$!
  818. X$MAKE: SUBROUTINE   !SUBROUTINE TO CHECK DEPENDENCIES
  819. X$ V = 'F$Verify(0)
  820. X$! P1 = What we are trying to make
  821. X$! P2 = Command to make it
  822. X$! P3 - P8  What it depends on
  823. X$
  824. X$ If F$Search(P1) .Eqs. "" Then Goto Makeit
  825. X$ Time = F$CvTime(F$File(P1,"RDT"))
  826. X$arg=3
  827. X$Loop:
  828. X$`09Argument = P'arg
  829. X$`09If Argument .Eqs. "" Then Goto Exit
  830. X$`09El=0
  831. X$Loop2:
  832. X$`09File = F$Element(El," ",Argument)
  833. X$`09If File .Eqs. " " Then Goto Endl
  834. X$`09AFile = ""
  835. X$Loop3:
  836. X$`09OFile = AFile
  837. X$`09AFile = F$Search(File)
  838. X$`09If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl
  839. X$`09If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit
  840. X$`09Goto Loop3
  841. X$NextEL:
  842. X$`09El = El + 1
  843. X$`09Goto Loop2
  844. X$EndL:
  845. X$ arg=arg+1
  846. X$ If arg .Le. 8 Then Goto Loop
  847. X$ Goto Exit
  848. X$
  849. X$Makeit:
  850. X$ Set Verify
  851. X$ 'P2
  852. X$ VV='F$Verify(0)
  853. X$Exit:
  854. X$ If V Then Set Verify
  855. X$ENDSUBROUTINE
  856. $ CALL UNPACK MAKE.COM;20 690516565
  857. $ create 'f'
  858. X##################################################################
  859. X#
  860. X#   X11 xscope - spy on characters to and from an X11 server
  861. X#
  862. X#`09Author: JPeterson, MCC
  863. X#`09(c) Copyright MCC 1988
  864. X#
  865. X#
  866. X#
  867. XCFLAGS = -g
  868. XSRCS = prtype.c print11.c table11.c decode11.c server.c fd.c common.c scope.
  869. Vc
  870. XOBJS = scope.o common.o fd.o server.o decode11.o table11.o print11.o prtype.
  871. Vo
  872. X
  873. XALL = xscope
  874. Xall:`09$`7BALL`7D
  875. X
  876. X##################################################################
  877. X#
  878. X#   compilation of xscope
  879. X#
  880. X
  881. Xxscope:`09$`7BOBJS`7D
  882. X`09$`7BCC`7D $`7BCFLAGS`7D $`7BOBJS`7D -o xscope
  883. X
  884. Xscope.o:  scope.c scope.h
  885. X`09$`7BCC`7D $`7BCFLAGS`7D scope.c -c
  886. X
  887. X
  888. X##################################################################
  889. X#
  890. X#   compilation of common support code
  891. X#
  892. Xcommon.o: common.c scope.h
  893. X`09$`7BCC`7D $`7BCFLAGS`7D common.c -c
  894. X
  895. Xfd.o: fd.c fd.h scope.h
  896. X`09$`7BCC`7D $`7BCFLAGS`7D fd.c -c
  897. X
  898. Xserver.o: server.c scope.h x11.h
  899. X`09$`7BCC`7D $`7BCFLAGS`7D server.c -c
  900. X
  901. Xdecode11.o: decode11.c scope.h x11.h
  902. X`09$`7BCC`7D $`7BCFLAGS`7D decode11.c -c
  903. X
  904. Xtable11.o: table11.c scope.h x11.h
  905. X`09$`7BCC`7D $`7BCFLAGS`7D table11.c -c
  906. X
  907. Xprint11.o: print11.c scope.h x11.h
  908. X`09$`7BCC`7D $`7BCFLAGS`7D print11.c -c
  909. X
  910. Xprtype.o: prtype.c scope.h x11.h
  911. X`09$`7BCC`7D $`7BCFLAGS`7D prtype.c -c
  912. X
  913. Xscope.h:  fd.h
  914. X
  915. X##################################################################
  916. X#
  917. X#   clean
  918. X#
  919. Xclean:
  920. X`09rm -f *.o $`7BALL`7D *`7E
  921. X
  922. Xlint:`09$`7BSRCS`7D
  923. X`09lint $`7BSRCS`7D
  924. X
  925. Xconfig:
  926. X`09dvc -c Makefile.proto
  927. X
  928. X##################################################################
  929. X#
  930. X#   installation
  931. X#
  932. XBINDIR = /usr/project/deli/working/bin
  933. X
  934. Xinstall: $`7BALL`7D
  935. X`09install xscope       $`7BBINDIR`7D
  936. X
  937. $ CALL UNPACK MAKEFILE.;1 1651249061
  938. $ create 'f'
  939. X##################################################################
  940. X#
  941. X#   X11 xscope - spy on characters to and from an X11 server
  942. X#
  943. X#`09Author: JPeterson, MCC
  944. X#`09(c) Copyright MCC 1988
  945. X#
  946. X#
  947. X#
  948. XCFLAGS = -g
  949. XSRCS = prtype.c print11.c table11.c decode11.c server.c fd.c common.c scope.
  950. Vc
  951. XOBJS = scope.o common.o fd.o server.o decode11.o table11.o print11.o prtype.
  952. Vo
  953. X
  954. XALL = xscope
  955. Xall:`09$`7BALL`7D
  956. X
  957. X##################################################################
  958. X#
  959. X#   compilation of xscope
  960. X#
  961. X
  962. Xxscope:`09$`7BOBJS`7D
  963. X`09$`7BCC`7D $`7BCFLAGS`7D $`7BOBJS`7D -o xscope
  964. X
  965. Xscope.o:  scope.c scope.h
  966. X`09$`7BCC`7D $`7BCFLAGS`7D scope.c -c
  967. X
  968. X
  969. X##################################################################
  970. X#
  971. X#   compilation of common support code
  972. X#
  973. Xcommon.o: common.c scope.h
  974. X`09$`7BCC`7D $`7BCFLAGS`7D common.c -c
  975. X
  976. Xfd.o: fd.c fd.h scope.h
  977. X`09$`7BCC`7D $`7BCFLAGS`7D fd.c -c
  978. X
  979. Xserver.o: server.c scope.h x11.h
  980. X`09$`7BCC`7D $`7BCFLAGS`7D server.c -c
  981. X
  982. Xdecode11.o: decode11.c scope.h x11.h
  983. X`09$`7BCC`7D $`7BCFLAGS`7D decode11.c -c
  984. X
  985. Xtable11.o: table11.c scope.h x11.h
  986. X`09$`7BCC`7D $`7BCFLAGS`7D table11.c -c
  987. X
  988. Xprint11.o: print11.c scope.h x11.h
  989. X`09$`7BCC`7D $`7BCFLAGS`7D print11.c -c
  990. X
  991. Xprtype.o: prtype.c scope.h x11.h
  992. X`09$`7BCC`7D $`7BCFLAGS`7D prtype.c -c
  993. X
  994. Xscope.h:  fd.h
  995. X
  996. X##################################################################
  997. X#
  998. X#   clean
  999. X#
  1000. Xclean:
  1001. X`09rm -f *.o $`7BALL`7D *`7E
  1002. X
  1003. Xlint:`09$`7BSRCS`7D
  1004. X`09lint $`7BSRCS`7D
  1005. X
  1006. Xconfig:
  1007. X`09dvc -c Makefile.proto
  1008. X
  1009. X##################################################################
  1010. X#
  1011. X#   installation
  1012. X#
  1013. XBINDIR = $<DeliObjRootConfig>/$<DeliVersionConfig>/bin
  1014. X
  1015. Xinstall: $`7BALL`7D
  1016. X`09install xscope       $`7BBINDIR`7D
  1017. X
  1018. $ CALL UNPACK MAKEFILE.PROTO;1 456338482
  1019. $ create 'f'
  1020. X/*
  1021. X * This include file contains the socket/object servers correspondence
  1022. X * for a UN*X-to-VMS server conversion.
  1023. X *`20
  1024. X * OBH - NCD - 3/11/92
  1025. X */
  1026. X#include descrip
  1027. X
  1028. X#define X11_PORT         6000
  1029. X#define FONT_SERVER_PORT 7000
  1030. X/*
  1031. X * Add more here!...
  1032. X */
  1033. X
  1034. Xstatic $DESCRIPTOR (x11_dsc, "X$X0");
  1035. Xstatic $DESCRIPTOR (font_server_dsc, "FONT$FS");
  1036. X/*
  1037. X * Add more here!...
  1038. X */
  1039. X
  1040. Xstatic struct translationTable
  1041. X`7B
  1042. X`09int port;
  1043. X`09struct dsc$descriptor *object;
  1044. X`7D transTable`5B`5D =`20
  1045. X`7B
  1046. X`09`7B X11_PORT, &x11_dsc `7D,
  1047. X`09`7B FONT_SERVER_PORT, &font_server_dsc `7D,
  1048. X/*
  1049. X * ...Then add more here!
  1050. X */
  1051. X`7D;
  1052. $ CALL UNPACK PORTOBJ.H;1 1813801882
  1053. $ create 'f'
  1054. X/* ************************************************** *
  1055. X *`09`09`09`09`09`09      *
  1056. X *  Request, Reply, Event, Error Printing`09      *
  1057. X *`09`09`09`09`09`09      *
  1058. X *`09James Peterson, 1988`09`09`09      *
  1059. X *`09(c) Copyright MCC, 1988 `09`09      *
  1060. X *`09`09`09`09`09`09      *
  1061. X * ************************************************** */
  1062. X#if defined(vax11c) && !defined(MULTINET)
  1063. X#include "emulationlib.h"
  1064. X#endif
  1065. X
  1066. X#include "scope.h"
  1067. X#include "x11.h"
  1068. X
  1069. X
  1070. X/* ************************************************************ */
  1071. X/*`09`09`09`09`09`09`09`09*/
  1072. X/*`09`09`09`09`09`09`09`09*/
  1073. X/* ************************************************************ */
  1074. X
  1075. X/*
  1076. X  In printing the contents of the fields of the X11 packets, some
  1077. X  fields are of obvious value, and others are of lesser value.  To
  1078. X  control the amount of output, we generate our output according
  1079. X  to the level of Verbose-ness that was selected by the user.
  1080. X
  1081. X  Verbose = 0 ==  Headers only, time and request/reply/... names.
  1082. X
  1083. X  Verbose = 1 ==  Very useful content fields.
  1084. X
  1085. X  Verbose = 2 ==  Almost everything.
  1086. X
  1087. X  Verbose = 3 ==  Every single bit and byte.
  1088. X
  1089. X*/
  1090. X
  1091. X/*
  1092. X  To aid in making the choice between level 1 and level 2, we
  1093. X  define the following define, which does not print relatively
  1094. X  unimportant fields.
  1095. X*/
  1096. X
  1097. X#define printfield(a,b,c,d,e) if (Verbose > 1) PrintField(a,b,c,d,e)
  1098. X
  1099. X
  1100. X/* ************************************************************ */
  1101. X/*`09`09`09`09`09`09`09`09*/
  1102. X/*`09`09`09`09`09`09`09`09*/
  1103. X/* ************************************************************ */
  1104. X
  1105. XPrintSetUpMessage(buf)
  1106. X     unsigned char *buf;
  1107. X`7B
  1108. X  short   n;
  1109. X  short   d;
  1110. X
  1111. X  enterprocedure("PrintSetUpMessage");
  1112. X  if (Verbose < 1)
  1113. X    return;
  1114. X  SetIndentLevel(PRINTCLIENT);
  1115. X  PrintField(buf, 0, 1, BYTEMODE, "byte-order");
  1116. X  PrintField(buf, 2, 2, CARD16, "major-version");
  1117. X  PrintField(buf, 4, 2, CARD16, "minor-version");
  1118. X  printfield(buf, 6, 2, DVALUE2(n), "length of name");
  1119. X  n = IShort(&buf`5B6`5D);
  1120. X  printfield(buf, 8, 2, DVALUE2(d), "length of data");
  1121. X  d = IShort(&buf`5B8`5D);
  1122. X  PrintString8(&buf`5B12`5D, n, "authorization-protocol-name");
  1123. X  PrintString8(&buf`5Bpad((long)(12 + n))`5D, d, "authorization-protocol-dat
  1124. Va");
  1125. X`7D
  1126. X
  1127. XPrintSetUpReply(buf)
  1128. X     unsigned char *buf;
  1129. X`7B
  1130. X  enterprocedure("PrintSetUpReply");
  1131. X  SetIndentLevel(PRINTSERVER);
  1132. X  if (IByte(&buf`5B0`5D))
  1133. X    PrintSuccessfulSetUpReply(buf);
  1134. X  else
  1135. X    PrintFailedSetUpReply(buf);
  1136. X`7D
  1137. X
  1138. XPrintFailedSetUpReply(buf)
  1139. X     unsigned char *buf;
  1140. X`7B
  1141. X  short   n;
  1142. X
  1143. X  PrintField(buf, 0, 1, 0, "SetUp Failed");
  1144. X  if (Verbose < 1)
  1145. X    return;
  1146. X  printfield(buf, 1, 1, DVALUE1(n), "length of reason in bytes");
  1147. X  n = IByte(&buf`5B1`5D);
  1148. X  PrintField(buf, 2, 2, CARD16, "major-version");
  1149. X  PrintField(buf, 4, 2, CARD16, "minor-version");
  1150. X  printfield(buf, 6, 2, DVALUE2((n + p) / 4), "length of data");
  1151. X  PrintString8(&buf`5B8`5D, n, "reason");
  1152. X`7D
  1153. X
  1154. XPrintSuccessfulSetUpReply(buf)
  1155. X     unsigned char *buf;
  1156. X`7B
  1157. X  short   v;
  1158. X  short   n;
  1159. X  short   m;
  1160. X
  1161. X  if (Verbose < 1)
  1162. X    return;
  1163. X  PrintField(buf, 2, 2, CARD16, "protocol-major-version");
  1164. X  PrintField(buf, 4, 2, CARD16, "protocol-minor-version");
  1165. X  printfield(buf, 6, 2, DVALUE2(8 + 2*n + (v + p + m) / 4), "length of data"
  1166. V);
  1167. X  PrintField(buf, 8, 4, CARD32, "release-number");
  1168. X  PrintField(buf, 12, 4, CARD32, "resource-id-base");
  1169. X  PrintField(buf, 16, 4, CARD32, "resource-id-mask");
  1170. X  PrintField(buf, 20, 4, CARD32, "motion-buffer-size");
  1171. X  printfield(buf, 24, 2, DVALUE2(v), "length of vendor");
  1172. X  v = IShort(&buf`5B24`5D);
  1173. X  printfield(buf, 26, 2, CARD16, "maximum-request-length");
  1174. X  printfield(buf, 28, 1, CARD8, "number of roots");
  1175. X  m = IByte(&buf`5B28`5D);
  1176. X  printfield(buf, 29, 1, DVALUE1(n), "number of pixmap-formats");
  1177. X  n = IByte(&buf`5B29`5D);
  1178. X  PrintField(buf, 30, 1, BYTEORDER, "image-byte-order");
  1179. X  PrintField(buf, 31, 1, BYTEORDER, "bitmap-format-bit-order");
  1180. X  PrintField(buf, 32, 1, CARD8, "bitmap-format-scanline-unit");
  1181. X  PrintField(buf, 33, 1, CARD8, "bitmap-format-scanline-pad");
  1182. X  PrintField(buf, 34, 1, KEYCODE, "min-keycode");
  1183. X  PrintField(buf, 35, 1, KEYCODE, "max-keycode");
  1184. X  PrintString8(&buf`5B40`5D, v, "vendor");
  1185. X  PrintList(&buf`5Bpad((long)(40 + v))`5D, (long)n, FORMAT, "pixmap-formats"
  1186. V);
  1187. X  PrintList(&buf`5Bpad((long)(40 + v) + 8 * n)`5D, (long)m, SCREEN, "roots")
  1188. V;
  1189. X`7D
  1190. X
  1191. X
  1192. X/* ************************************************************ */
  1193. X/*`09`09`09`09`09`09`09`09*/
  1194. X/*`09`09`09`09`09`09`09`09*/
  1195. X/* ************************************************************ */
  1196. X
  1197. Xstatic char *REQUESTHEADER = "............REQUEST";
  1198. Xstatic char *EVENTHEADER = "..............EVENT";
  1199. Xstatic char *ERRORHEADER = "..............ERROR";
  1200. Xstatic char *REPLYHEADER = "..............REPLY";
  1201. X
  1202. X
  1203. X/* ************************************************************ */
  1204. X/*`09`09`09`09`09`09`09`09*/
  1205. X/*`09`09`09`09`09`09`09`09*/
  1206. X/* ************************************************************ */
  1207. X
  1208. X/* Error Printing procedures */
  1209. X
  1210. XRequestError(buf)
  1211. X     unsigned char *buf;
  1212. X`7B
  1213. X  PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Request */ ;
  1214. X  if (Verbose < 1)
  1215. X    return;
  1216. X  printfield(buf, 2, 2, CARD16, "sequence number");
  1217. X  PrintField(buf, 8, 2, CARD16, "minor opcode");
  1218. X  PrintField(buf, 10, 1, CARD8, "major opcode");
  1219. X`7D
  1220. X
  1221. XValueError(buf)
  1222. X     unsigned char *buf;
  1223. X`7B
  1224. X  PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Value */ ;
  1225. X  if (Verbose < 1)
  1226. X    return;
  1227. X  printfield(buf, 2, 2, CARD16, "sequence number");
  1228. X  PrintField(buf, 4, 4, INT32, "bad value");
  1229. X  PrintField(buf, 8, 2, CARD16, "minor opcode");
  1230. X  PrintField(buf, 10, 1, CARD8, "major opcode");
  1231. X`7D
  1232. X
  1233. XWindowError(buf)
  1234. X     unsigned char *buf;
  1235. X`7B
  1236. X  PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Window */ ;
  1237. X  if (Verbose < 1)
  1238. X    return;
  1239. X  printfield(buf, 2, 2, CARD16, "sequence number");
  1240. X  PrintField(buf, 4, 4, CARD32, "bad resource id");
  1241. X  PrintField(buf, 8, 2, CARD16, "minor opcode");
  1242. X  PrintField(buf, 10, 1, CARD8, "major opcode");
  1243. X`7D
  1244. X
  1245. XPixmapError(buf)
  1246. X     unsigned char *buf;
  1247. X`7B
  1248. X  PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Pixmap */ ;
  1249. X  if (Verbose < 1)
  1250. X    return;
  1251. X  printfield(buf, 2, 2, CARD16, "sequence number");
  1252. X  PrintField(buf, 4, 4, CARD32, "bad resource id");
  1253. X  PrintField(buf, 8, 2, CARD16, "minor opcode");
  1254. X  PrintField(buf, 10, 1, CARD8, "major opcode");
  1255. X`7D
  1256. X
  1257. XAtomError(buf)
  1258. X     unsigned char *buf;
  1259. X`7B
  1260. X  PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Atom */ ;
  1261. X  if (Verbose < 1)
  1262. X    return;
  1263. X  printfield(buf, 2, 2, CARD16, "sequence number");
  1264. X  PrintField(buf, 4, 4, CARD32, "bad atom id");
  1265. X  PrintField(buf, 8, 2, CARD16, "minor opcode");
  1266. X  PrintField(buf, 10, 1, CARD8, "major opcode");
  1267. X`7D
  1268. X
  1269. XCursorError(buf)
  1270. X     unsigned char *buf;
  1271. X`7B
  1272. X  PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Cursor */ ;
  1273. X  if (Verbose < 1)
  1274. X    return;
  1275. X  printfield(buf, 2, 2, CARD16, "sequence number");
  1276. X  PrintField(buf, 4, 4, CARD32, "bad resource id");
  1277. X  PrintField(buf, 8, 2, CARD16, "minor opcode");
  1278. X  PrintField(buf, 10, 1, CARD8, "major opcode");
  1279. X`7D
  1280. X
  1281. XFontError(buf)
  1282. X     unsigned char *buf;
  1283. X`7B
  1284. X  PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Font */ ;
  1285. X  if (Verbose < 1)
  1286. X    return;
  1287. X  printfield(buf, 2, 2, CARD16, "sequence number");
  1288. X  PrintField(buf, 4, 4, CARD32, "bad resource id");
  1289. X  PrintField(buf, 8, 2, CARD16, "minor opcode");
  1290. X  PrintField(buf, 10, 1, CARD8, "major opcode");
  1291. X`7D
  1292. X
  1293. XMatchError(buf)
  1294. X     unsigned char *buf;
  1295. X`7B
  1296. X  PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Match */ ;
  1297. X  if (Verbose < 1)
  1298. X    return;
  1299. X  printfield(buf, 2, 2, CARD16, "sequence number");
  1300. X  PrintField(buf, 8, 2, CARD16, "minor opcode");
  1301. X  PrintField(buf, 10, 1, CARD8, "major opcode");
  1302. X`7D
  1303. X
  1304. XDrawableError(buf)
  1305. X     unsigned char *buf;
  1306. X`7B
  1307. X  PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Drawable */ ;
  1308. X  if (Verbose < 1)
  1309. X    return;
  1310. X  printfield(buf, 2, 2, CARD16, "sequence number");
  1311. X  PrintField(buf, 4, 4, CARD32, "bad resource id");
  1312. X  PrintField(buf, 8, 2, CARD16, "minor opcode");
  1313. X  PrintField(buf, 10, 1, CARD8, "major opcode");
  1314. X`7D
  1315. X
  1316. XAccessError(buf)
  1317. X     unsigned char *buf;
  1318. X`7B
  1319. X  PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Access */ ;
  1320. X  if (Verbose < 1)
  1321. X    return;
  1322. X  printfield(buf, 2, 2, CARD16, "sequence number");
  1323. X  PrintField(buf, 8, 2, CARD16, "minor opcode");
  1324. X  PrintField(buf, 10, 1, CARD8, "major opcode");
  1325. X`7D
  1326. X
  1327. XAllocError(buf)
  1328. X     unsigned char *buf;
  1329. X`7B
  1330. X  PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Alloc */ ;
  1331. X  if (Verbose < 1)
  1332. X    return;
  1333. X  printfield(buf, 2, 2, CARD16, "sequence number");
  1334. X  PrintField(buf, 8, 2, CARD16, "minor opcode");
  1335. X  PrintField(buf, 10, 1, CARD8, "major opcode");
  1336. X`7D
  1337. X
  1338. XColormapError(buf)
  1339. X     unsigned char *buf;
  1340. X`7B
  1341. X  PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Colormap */ ;
  1342. X  if (Verbose < 1)
  1343. X    return;
  1344. X  printfield(buf, 2, 2, CARD16, "sequence number");
  1345. X  PrintField(buf, 4, 4, CARD32, "bad resource id");
  1346. X  PrintField(buf, 8, 2, CARD16, "minor opcode");
  1347. X  PrintField(buf, 10, 1, CARD8, "major opcode");
  1348. X`7D
  1349. X
  1350. XGContextError(buf)
  1351. X     unsigned char *buf;
  1352. X`7B
  1353. X  PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* GContext */ ;
  1354. X  if (Verbose < 1)
  1355. X    return;
  1356. X  printfield(buf, 2, 2, CARD16, "sequence number");
  1357. X  PrintField(buf, 4, 4, CARD32, "bad resource id");
  1358. X  PrintField(buf, 8, 2, CARD16, "minor opcode");
  1359. X  PrintField(buf, 10, 1, CARD8, "major opcode");
  1360. X`7D
  1361. X
  1362. XIDChoiceError(buf)
  1363. X     unsigned char *buf;
  1364. X`7B
  1365. X  PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* IDChoice */ ;
  1366. X  if (Verbose < 1)
  1367. X    return;
  1368. X  printfield(buf, 2, 2, CARD16, "sequence number");
  1369. X  PrintField(buf, 4, 4, CARD32, "bad resource id");
  1370. X  PrintField(buf, 8, 2, CARD16, "minor opcode");
  1371. X  PrintField(buf, 10, 1, CARD8, "major opcode");
  1372. X`7D
  1373. X
  1374. XNameError(buf)
  1375. X     unsigned char *buf;
  1376. X`7B
  1377. X  PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Name */ ;
  1378. X  if (Verbose < 1)
  1379. X    return;
  1380. X  printfield(buf, 2, 2, CARD16, "sequence number");
  1381. X  PrintField(buf, 8, 2, CARD16, "minor opcode");
  1382. X  PrintField(buf, 10, 1, CARD8, "major opcode");
  1383. X`7D
  1384. X
  1385. XLengthError(buf)
  1386. X     unsigned char *buf;
  1387. X`7B
  1388. X  PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Length */ ;
  1389. X  if (Verbose < 1)
  1390. X    return;
  1391. X  printfield(buf, 2, 2, CARD16, "sequence number");
  1392. X  PrintField(buf, 8, 2, CARD16, "minor opcode");
  1393. X  PrintField(buf, 10, 1, CARD8, "major opcode");
  1394. X`7D
  1395. X
  1396. XImplementationError(buf)
  1397. X     unsigned char *buf;
  1398. X`7B
  1399. X  PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Implementation */ ;
  1400. X  if (Verbose < 1)
  1401. X    return;
  1402. X  printfield(buf, 2, 2, CARD16, "sequence number");
  1403. X  PrintField(buf, 8, 2, CARD16, "minor opcode");
  1404. X  PrintField(buf, 10, 1, CARD8, "major opcode");
  1405. X`7D
  1406. X
  1407. X/* ************************************************************ */
  1408. X/*`09`09`09`09`09`09`09`09*/
  1409. X/*`09`09`09`09`09`09`09`09*/
  1410. X/* ************************************************************ */
  1411. X
  1412. X/* Event Printing procedures */
  1413. X
  1414. XKeyPressEvent(buf)
  1415. X     unsigned char *buf;
  1416. X`7B
  1417. X  PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* KeyPress */ ;
  1418. X  if (Verbose < 1)
  1419. X    return;
  1420. X  PrintField(buf, 1, 1, KEYCODE, "detail");
  1421. X  printfield(buf, 2, 2, CARD16, "sequence number");
  1422. X  PrintField(buf, 4, 4, TIMESTAMP, "time");
  1423. X  PrintField(buf, 8, 4, WINDOW, "root");
  1424. X  PrintField(buf, 12, 4, WINDOW, "event");
  1425. X  PrintField(buf, 16, 4, WINDOW, "child");
  1426. X  PrintField(buf, 20, 2, INT16, "root-x");
  1427. X  PrintField(buf, 22, 2, INT16, "root-y");
  1428. X  PrintField(buf, 24, 2, INT16, "event-x");
  1429. X  PrintField(buf, 26, 2, INT16, "event-y");
  1430. X  PrintField(buf, 28, 2, SETofKEYBUTMASK, "state");
  1431. X  PrintField(buf, 30, 1, BOOL, "same-screen");
  1432. X`7D
  1433. X
  1434. XKeyReleaseEvent(buf)
  1435. X     unsigned char *buf;
  1436. X`7B
  1437. X  PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* KeyRelease */ ;
  1438. X  if (Verbose < 1)
  1439. X    return;
  1440. X  PrintField(buf, 1, 1, KEYCODE, "detail");
  1441. X  printfield(buf, 2, 2, CARD16, "sequence number");
  1442. X  PrintField(buf, 4, 4, TIMESTAMP, "time");
  1443. X  PrintField(buf, 8, 4, WINDOW, "root");
  1444. X  PrintField(buf, 12, 4, WINDOW, "event");
  1445. X  PrintField(buf, 16, 4, WINDOW, "child");
  1446. X  PrintField(buf, 20, 2, INT16, "root-x");
  1447. X  PrintField(buf, 22, 2, INT16, "root-y");
  1448. X  PrintField(buf, 24, 2, INT16, "event-x");
  1449. X  PrintField(buf, 26, 2, INT16, "event-y");
  1450. X  PrintField(buf, 28, 2, SETofKEYBUTMASK, "state");
  1451. X  PrintField(buf, 30, 1, BOOL, "same-screen");
  1452. X`7D
  1453. X
  1454. XButtonPressEvent(buf)
  1455. X     unsigned char *buf;
  1456. X`7B
  1457. X  PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* ButtonPress */ ;
  1458. X  if (Verbose < 1)
  1459. X    return;
  1460. X  PrintField(buf, 1, 1, BUTTON, "detail");
  1461. X  printfield(buf, 2, 2, CARD16, "sequence number");
  1462. X  PrintField(buf, 4, 4, TIMESTAMP, "time");
  1463. X  PrintField(buf, 8, 4, WINDOW, "root");
  1464. X  PrintField(buf, 12, 4, WINDOW, "event");
  1465. X  PrintField(buf, 16, 4, WINDOW, "child");
  1466. X  PrintField(buf, 20, 2, INT16, "root-x");
  1467. X  PrintField(buf, 22, 2, INT16, "root-y");
  1468. X  PrintField(buf, 24, 2, INT16, "event-x");
  1469. X  PrintField(buf, 26, 2, INT16, "event-y");
  1470. X  PrintField(buf, 28, 2, SETofKEYBUTMASK, "state");
  1471. X  PrintField(buf, 30, 1, BOOL, "same-screen");
  1472. X`7D
  1473. X
  1474. XButtonReleaseEvent(buf)
  1475. X     unsigned char *buf;
  1476. X`7B
  1477. X  PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* ButtonRelease */ ;
  1478. X  if (Verbose < 1)
  1479. X    return;
  1480. X  PrintField(buf, 1, 1, BUTTON, "detail");
  1481. X  printfield(buf, 2, 2, CARD16, "sequence number");
  1482. X  PrintField(buf, 4, 4, TIMESTAMP, "time");
  1483. X  PrintField(buf, 8, 4, WINDOW, "root");
  1484. X  PrintField(buf, 12, 4, WINDOW, "event");
  1485. X  PrintField(buf, 16, 4, WINDOW, "child");
  1486. X  PrintField(buf, 20, 2, INT16, "root-x");
  1487. X  PrintField(buf, 22, 2, INT16, "root-y");
  1488. X  PrintField(buf, 24, 2, INT16, "event-x");
  1489. X  PrintField(buf, 26, 2, INT16, "event-y");
  1490. X  PrintField(buf, 28, 2, SETofKEYBUTMASK, "state");
  1491. X  PrintField(buf, 30, 1, BOOL, "same-screen");
  1492. X`7D
  1493. X
  1494. XMotionNotifyEvent(buf)
  1495. X     unsigned char *buf;
  1496. X`7B
  1497. X  PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* MotionNotify */ ;
  1498. X  if (Verbose < 1)
  1499. X    return;
  1500. X  PrintField(buf, 1, 1, MOTIONDETAIL, "detail");
  1501. X  printfield(buf, 2, 2, CARD16, "sequence number");
  1502. X  PrintField(buf, 4, 4, TIMESTAMP, "time");
  1503. X  PrintField(buf, 8, 4, WINDOW, "root");
  1504. X  PrintField(buf, 12, 4, WINDOW, "event");
  1505. X  PrintField(buf, 16, 4, WINDOW, "child");
  1506. X  PrintField(buf, 20, 2, INT16, "root-x");
  1507. X  PrintField(buf, 22, 2, INT16, "root-y");
  1508. X  PrintField(buf, 24, 2, INT16, "event-x");
  1509. X  PrintField(buf, 26, 2, INT16, "event-y");
  1510. X  PrintField(buf, 28, 2, SETofKEYBUTMASK, "state");
  1511. X  PrintField(buf, 30, 1, BOOL, "same-screen");
  1512. X`7D
  1513. X
  1514. XEnterNotifyEvent(buf)
  1515. X     unsigned char *buf;
  1516. X`7B
  1517. X  PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* EnterNotify */ ;
  1518. X  if (Verbose < 1)
  1519. X    return;
  1520. X  PrintField(buf, 1, 1, ENTERDETAIL, "detail");
  1521. X  printfield(buf, 2, 2, CARD16, "sequence number");
  1522. X  PrintField(buf, 4, 4, TIMESTAMP, "time");
  1523. X  PrintField(buf, 8, 4, WINDOW, "root");
  1524. X  PrintField(buf, 12, 4, WINDOW, "event");
  1525. X  PrintField(buf, 16, 4, WINDOW, "child");
  1526. X  PrintField(buf, 20, 2, INT16, "root-x");
  1527. X  PrintField(buf, 22, 2, INT16, "root-y");
  1528. X  PrintField(buf, 24, 2, INT16, "event-x");
  1529. X  PrintField(buf, 26, 2, INT16, "event-y");
  1530. X  PrintField(buf, 28, 2, SETofKEYBUTMASK, "state");
  1531. X  PrintField(buf, 30, 1, BUTTONMODE, "mode");
  1532. X  PrintField(buf, 31, 1, SCREENFOCUS, "same-screen, focus");
  1533. X`7D
  1534. X
  1535. XLeaveNotifyEvent(buf)
  1536. X     unsigned char *buf;
  1537. X`7B
  1538. X  PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* LeaveNotify */ ;
  1539. X  if (Verbose < 1)
  1540. X    return;
  1541. X  PrintField(buf, 1, 1, ENTERDETAIL, "detail");
  1542. X  printfield(buf, 2, 2, CARD16, "sequence number");
  1543. X  PrintField(buf, 4, 4, TIMESTAMP, "time");
  1544. X  PrintField(buf, 8, 4, WINDOW, "root");
  1545. X  PrintField(buf, 12, 4, WINDOW, "event");
  1546. X  PrintField(buf, 16, 4, WINDOW, "child");
  1547. X  PrintField(buf, 20, 2, INT16, "root-x");
  1548. X  PrintField(buf, 22, 2, INT16, "root-y");
  1549. X  PrintField(buf, 24, 2, INT16, "event-x");
  1550. X  PrintField(buf, 26, 2, INT16, "event-y");
  1551. X  PrintField(buf, 28, 2, SETofKEYBUTMASK, "state");
  1552. X  PrintField(buf, 30, 1, BUTTONMODE, "mode");
  1553. X  PrintField(buf, 31, 1, SCREENFOCUS, "same-screen, focus");
  1554. X`7D
  1555. X
  1556. XFocusInEvent(buf)
  1557. X     unsigned char *buf;
  1558. X`7B
  1559. X  PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* FocusIn */ ;
  1560. X  if (Verbose < 1)
  1561. X    return;
  1562. X  PrintField(buf, 1, 1, ENTERDETAIL, "detail");
  1563. X  printfield(buf, 2, 2, CARD16, "sequence number");
  1564. X  PrintField(buf, 4, 4, WINDOW, "event");
  1565. X  PrintField(buf, 8, 1, BUTTONMODE, "mode");
  1566. X`7D
  1567. X
  1568. XFocusOutEvent(buf)
  1569. X     unsigned char *buf;
  1570. X`7B
  1571. X  PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* FocusOut */ ;
  1572. X  if (Verbose < 1)
  1573. X    return;
  1574. X  PrintField(buf, 1, 1, ENTERDETAIL, "detail");
  1575. X  printfield(buf, 2, 2, CARD16, "sequence number");
  1576. X  PrintField(buf, 4, 4, WINDOW, "event");
  1577. X  PrintField(buf, 8, 1, BUTTONMODE, "mode");
  1578. X`7D
  1579. X
  1580. XKeymapNotifyEvent(buf)
  1581. X     unsigned char *buf;
  1582. X`7B
  1583. X  PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* KeymapNotify */ ;
  1584. X  if (Verbose < 1)
  1585. X    return;
  1586. X  PrintBytes(&buf`5B1`5D, (long)31,"keys");
  1587. X`7D
  1588. X
  1589. XExposeEvent(buf)
  1590. X     unsigned char *buf;
  1591. X`7B
  1592. X  PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* Expose */ ;
  1593. X  if (Verbose < 1)
  1594. X    return;
  1595. X  printfield(buf, 2, 2, CARD16, "sequence number");
  1596. X  PrintField(buf, 4, 4, WINDOW, "window");
  1597. X  PrintField(buf, 8, 2, CARD16, "x");
  1598. X  PrintField(buf, 10, 2, CARD16, "y");
  1599. X  PrintField(buf, 12, 2, CARD16, "width");
  1600. X  PrintField(buf, 14, 2, CARD16, "height");
  1601. X  PrintField(buf, 16, 2, CARD16, "count");
  1602. X`7D
  1603. X
  1604. XGraphicsExposureEvent(buf)
  1605. X     unsigned char *buf;
  1606. X`7B
  1607. X  PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* GraphicsExposure */ ;
  1608. X  if (Verbose < 1)
  1609. X    return;
  1610. X  printfield(buf, 2, 2, CARD16, "sequence number");
  1611. X  PrintField(buf, 4, 4, DRAWABLE, "drawable");
  1612. X  PrintField(buf, 8, 2, CARD16, "x");
  1613. X  PrintField(buf, 10, 2, CARD16, "y");
  1614. X  PrintField(buf, 12, 2, CARD16, "width");
  1615. X  PrintField(buf, 14, 2, CARD16, "height");
  1616. X  PrintField(buf, 16, 2, CARD16, "minor-opcode");
  1617. X  PrintField(buf, 18, 2, CARD16, "count");
  1618. X  PrintField(buf, 20, 1, CARD8, "major-opcode");
  1619. X`7D
  1620. X
  1621. XNoExposureEvent(buf)
  1622. X     unsigned char *buf;
  1623. X`7B
  1624. X  PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* NoExposure */ ;
  1625. X  if (Verbose < 1)
  1626. X    return;
  1627. X  printfield(buf, 2, 2, CARD16, "sequence number");
  1628. X  PrintField(buf, 4, 4, DRAWABLE, "drawable");
  1629. X  PrintField(buf, 8, 2, CARD16, "minor-opcode");
  1630. X  PrintField(buf, 10, 1, CARD8, "major-opcode");
  1631. X`7D
  1632. X
  1633. XVisibilityNotifyEvent(buf)
  1634. X     unsigned char *buf;
  1635. X`7B
  1636. X  PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* VisibilityNotify */ ;
  1637. X  if (Verbose < 1)
  1638. X    return;
  1639. X  printfield(buf, 2, 2, CARD16, "sequence number");
  1640. X  PrintField(buf, 4, 4, WINDOW, "window");
  1641. X  PrintField(buf, 8, 1, VISIBLE, "state");
  1642. X`7D
  1643. X
  1644. XCreateNotifyEvent(buf)
  1645. X     unsigned char *buf;
  1646. X`7B
  1647. X  PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* CreateNotify */ ;
  1648. X  if (Verbose < 1)
  1649. X    return;
  1650. X  printfield(buf, 2, 2, CARD16, "sequence number");
  1651. X  PrintField(buf, 4, 4, WINDOW, "parent");
  1652. X  PrintField(buf, 8, 4, WINDOW, "window");
  1653. X  PrintField(buf, 12, 2, INT16, "x");
  1654. X  PrintField(buf, 14, 2, INT16, "y");
  1655. X  PrintField(buf, 16, 2, CARD16, "width");
  1656. X  PrintField(buf, 18, 2, CARD16, "height");
  1657. X  PrintField(buf, 20, 2, CARD16, "border-width");
  1658. X  PrintField(buf, 22, 1, BOOL, "override-redirect");
  1659. X`7D
  1660. X
  1661. XDestroyNotifyEvent(buf)
  1662. X     unsigned char *buf;
  1663. X`7B
  1664. X  PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* DestroyNotify */ ;
  1665. X  if (Verbose < 1)
  1666. X    return;
  1667. X  printfield(buf, 2, 2, CARD16, "sequence number");
  1668. X  PrintField(buf, 4, 4, WINDOW, "event");
  1669. X  PrintField(buf, 8, 4, WINDOW, "window");
  1670. X`7D
  1671. X
  1672. XUnmapNotifyEvent(buf)
  1673. X     unsigned char *buf;
  1674. X`7B
  1675. X  PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* UnmapNotify */ ;
  1676. X  if (Verbose < 1)
  1677. X    return;
  1678. X  printfield(buf, 2, 2, CARD16, "sequence number");
  1679. X  PrintField(buf, 4, 4, WINDOW, "event");
  1680. X  PrintField(buf, 8, 4, WINDOW, "window");
  1681. X  PrintField(buf, 12, 1, BOOL, "from-configure");
  1682. X`7D
  1683. X
  1684. XMapNotifyEvent(buf)
  1685. X     unsigned char *buf;
  1686. X`7B
  1687. X  PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* MapNotify */ ;
  1688. X  if (Verbose < 1)
  1689. X    return;
  1690. X  printfield(buf, 2, 2, CARD16, "sequence number");
  1691. X  PrintField(buf, 4, 4, WINDOW, "event");
  1692. X  PrintField(buf, 8, 4, WINDOW, "window");
  1693. X  PrintField(buf, 12, 1, BOOL, "override-redirect");
  1694. X`7D
  1695. X
  1696. +-+-+-+-+-+-+-+-  END  OF PART 3 +-+-+-+-+-+-+-+-
  1697. --
  1698. Patrick L. Mahan
  1699.  
  1700. --- TGV Window Washer ------------------------------- Mahan@TGV.COM ---------
  1701.  
  1702. Waking a person unnecessarily should not be considered  - Lazarus Long
  1703. a capital crime.  For a first offense, that is            From the Notebooks of
  1704.                               Lazarus Long
  1705.  
  1706.