home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!stanford.edu!agate!dog.ee.lbl.gov!network.ucsd.edu!mvb.saic.com!vmsnet-sources
- From: mahan@tgv.com (Patrick L. Mahan - TGV Window Washer)
- Newsgroups: vmsnet.sources
- Subject: XSCOPE/VMS 1.0, part 03/08
- Message-ID: <8045406@MVB.SAIC.COM>
- Date: Fri, 04 Sep 1992 05:34:19 GMT
- Reply-To: mahan@tgv.com
- Organization: TGV Incorporated (Tech Support) in Santa Cruz, CA
- Lines: 1694
- Approved: Mark.Berryman@Mvb.Saic.Com
-
- Submitted-by: mahan@tgv.com (Patrick L. Mahan - TGV Window Washer)
- Posting-number: Volume 3, Issue 155
- Archive-name: xscope/part03
-
-
- -+-+-+-+-+-+-+-+ START OF PART 3 -+-+-+-+-+-+-+-+
- X int bytes;
- X int i;
- X
- X#ifdef DNDEBUG
- X `09fprintf(stderr, "socket_writev: start - passed chan %d\n", d);
- X#endif /* DNDEBUG */
- X for(i = 0, totbytes = 0; i < iovcnt; i++)
- X `7B
- X bytes = socket_write((short) d, iov`5Bi`5D.iov_base, MIN(MAX
- V_QIO, iov`5Bi`5D.iov_len));
- X totbytes += bytes;
- X if(bytes < iov`5Bi`5D.iov_len)
- X `7B
- X#ifdef DNDEBUG
- X fprintf(stderr, "Block occured in writev, %d/%d\n",b
- Vytes,
- X iov`5Bi`5D.iov_len);
- X#endif
- X socket_errno = EWOULDBLOCK;
- X return totbytes;
- X `7D
- X `7D
- X return totbytes;
- X`7D
- $ CALL UNPACK DNET_SOCKET_LIBRARY.C;81 1998254311
- $ create 'f'
- XCOMMON.OBJ
- XDECODE11.OBJ
- XFD.OBJ
- XPRINT11.OBJ
- XPRTYPE.OBJ
- XSCOPE.OBJ
- XSERVER.OBJ
- XTABLE11.OBJ
- XDNET_SOCKET_LIBRARY
- XSYS$LIBRARY:VAXCRTL.EXE/SHARE
- $ CALL UNPACK DNXSCOPE.OPT;2 540287428
- $ create 'f'
- X/*
- X * $NCDId: @(#)emulationlib.h,v 4.4 1992/01/31 11:28:04 hardison Exp $
- X *`20
- X * Emulation defines, strutures and macros for the DNET_SOCKET_LIBRARY
- X * OBH - NCD - 3/2/92
- X */
- X#include nfbdef
- X
- X#ifndef _TIME_
- X#define _TIME_
- X#endif /*_TIME_*/
- X
- Xtypedef unsigned short u_short;
- Xtypedef unsigned long u_long;
- X
- X#define BCMP(s1, s2, l) (memcmp ((s1), (s2), (l)))
- X#define BCOPY(s, d, l) (memcpy ((d), (s), (l)))
- X#define BZERO(b,len) memset(b, 0, (size_t)(len))
- X#define DNETALLOC(s)`09(dnMalloc((s)))
- X#define DNETFREE(a)`09(dnFree((a)))
- X#define ENABLE_ASTS (SYS$SETAST(1))
- X#define HIBERNATE (SYS$HIBER())
- X#define DISABLE_ASTS (SYS$SETAST(0))
- X#define WAKE_UP_DAMMIT`09(SYS$WAKE(0, 0))
- X#define MAX_QIO 0xffff
- X#define VMSFAIL(status) (0==(1&(status)))
- X#define BITSPERBYTE 8
- X#define MAX_OPTION 4
- X#define MAX_LINKS 32
- X#define NODNAMSIZ`0916
- X#define NET_RD 1
- X#define NET_WRT 2
- X#define NET_CMD 3
- X#define TEMP_MBX 0
- X#define MAX_MSG 128
- X#define BUF_QUO 128
- X#define EWOULDBLOCK 35
- X#define TASKOBJECT`09"TASK="
- X#define MAXDNETNODES`0930
- X#define HOST_NOT_FOUND 1
- X#define NFB_MAX_FIELD_ID_ENTRIES 10
- X#define AF_DECnet`0912
- X#define AF_INET 2
- X#define DNET_PREFIX "DECNET/"
- X#define DNET_IV_MAXLEN 8
- X#define NCBSIZE 256
- X#define DECNET `09`09"DECnet"
- X#define CPUTYPE `09"Vax"
- X#define OPSYS `09"VMS"
- X#define INADDR_ANY (u_long)0x00000000
- X#define FIONBIO `09126
- X#define SOCK_STREAM 1 `20
- X#define SOL_SOCKET 0xffff`20
- X#define SO_REUSEADDR 0x0004
- X#define SO_USELOOPBACK 0x0040
- X
- X#ifndef MIN
- X#define MIN(a,b) ((a) < (b) ? (a) : (b))
- X#endif /* MIN */
- X
- X#ifndef MAX
- X#define MAX(a,b) ((a) < (b) ? (b) : (a))
- X#endif /* MAX */
- X
- Xstruct io_stat_blk
- X`7B
- X short int status;
- X unsigned short msg_len;
- X int unused;
- X`7D;
- X
- Xstruct astblk
- X`7B
- X `09char type;
- X unsigned short chan;
- X char unused;
- X`7D;
- X
- Xtypedef union
- X`7B
- X int astid;
- X`09struct astblk ast;
- X`7D astParam;
- X
- Xstruct
- X`7B
- X char func;
- X int terminator;
- X`7D nfb = `7B NFB$C_DECLNAME, 0 `7D;
- X
- Xstruct in_addr `7B
- X u_long s_addr;
- X`7D;
- X
- Xstruct sockaddr_in `7B
- X short sin_family;
- X u_short sin_port;
- X struct in_addr sin_addr;
- X char sin_zero`5B8`5D;
- X`7D;
- X
- Xstruct sockaddr
- X`7B
- X unsigned short sa_family;
- X char sa_data`5B14`5D;
- X`7D;
- X
- Xstruct hostent
- X`7B
- X char *h_name;
- X char **h_aliases;
- X int h_addrtype;
- X int h_length;
- X char **h_addr_list;
- X#define h_addr h_addr_list`5B0`5D
- X char *h_cputype;
- X char *h_opsys;
- X char **h_protos;
- X struct sockaddr *h_addresses;
- X`7D;
- X
- Xstruct stackstruct
- X`7B
- X short type;
- X unsigned short channel;
- X`7D;
- X
- X/*
- X * TYPES.H emulation
- X */
- X#define NBBY 8 `09/* number of bits in a byte */
- X#define NBLW (NBBY*sizeof(long))`09/* number of bits in a longword */
- X#ifndef FD_SETSIZE
- X#define FD_SETSIZE 512
- X#endif
- X#define CHANNELSIZE 16 /* Size of a channel */
- X
- Xtypedef long fd_mask;
- X#define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */
- X#ifndef howmany
- X#define howmany(x, y) (((x)+((y)-1))/(y))
- X#endif
- X
- Xtypedef struct fd_set `7B
- X fd_mask bits`5Bhowmany(FD_SETSIZE, NFDBITS)`5D;
- X`7D fd_set;
- X
- X#define FD_SET(n, p) ((p)->bits`5B(n)/CHANNELSIZE/NFDBITS`5D \
- X `7C= (1 << (((n)/CHANNELSIZE) %NFDBITS)))
- X#define FD_CLR(n, p) ((p)->bits`5B(n)/CHANNELSIZE/NFDBITS`5D \
- X &= `7E(1 << (((n)/CHANNELSIZE) %NFDBITS)))
- X#define FD_ISSET(n, p) ((!((n) % CHANNELSIZE)) && ((p)->bits`5B(n)/CHANNELS
- VIZE/NFDBITS`5D \
- X & (1 <<(((n)/CHANNELSIZE) % NFDBITS))))
- X#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p)))
- X
- X/*
- X * Structure returned by gettimeofday(2) system call,
- X * and used in other calls.
- X */
- Xstruct timeval
- X`7B
- X long tv_sec; /* seconds */
- X long tv_usec; /* and microseconds */
- X`7D;
- X
- Xstruct iovec
- X`7B
- X char *iov_base;
- X int iov_len;
- X`7D;
- X/*
- X * The channel table is needed to keep track of each connection's
- X * virtual memory read buffer base address, current (delta) pointer, and
- X * current size. In addition, the structure provides a request reference
- X * variable usde mainly to determine the type of connection (NONBLOCKING or
- V otherwise).
- X * In the future, this mechanism can be used to expand the types of connecti
- Vons
- X * allowed for socket I/O.
- X */
- Xstruct opttable
- X`7B
- X char *option;
- X int optionlen;
- X`7D;
- X
- Xstruct chantable
- X`7B
- X char *base; `09 `09/* base of virt mem for reads */
- X char *delta; `09 `09/* current ptr of virt mem for reads *
- V/
- X`09char`09*nodename;`09`09/* name of attached client node */
- X`09char`09*user;`09`09`09/* user of attached client */
- X `09short`09area;`09`09`09/* DECnet address area number */
- X `09short`09node;`09`09`09/* DECnet address node number */
- X short readAstPend; `09/* 0 = no AST's pending */
- X short readAstDone; `09/* 1 = AST read data available */
- X`09int`09chanDassgn;`09`09/* Channel deassign flag for asynch deallocs */
- X`09int`09unit;`09`09`09/* Network unit number from GETDVI */
- X int len; `09`09/* current len of virt mem */
- X int type; `09/* channel request type from socket_ioctl
- V */
- X int *backLogQueue; `09/* Non-NULL for "accept"ing (_NET:) chann
- Vels only */
- X int backLogQueueLength;
- X`09struct io_stat_blk read_iosb;`09/* IOSB for QIO read returns */
- X`09struct io_stat_blk write_iosb;`09/* IOSB for QIO write returns */
- X struct opttable o`5BMAX_OPTION`5D;
- X`7D;
- X
- X/* *** should be linked to MAXCLIENTS (from site.h or globals.h)*/
- X
- Xtypedef struct
- X`7B
- X `09char`09*nodebuf;
- X `09short`09area;
- X `09short`09node;
- X`7D NCPstruct;
- X
- Xstruct nfbdef`20
- X`7B
- X unsigned char`09fct;
- X unsigned char`09flags;
- X unsigned char`09database;
- X unsigned char`09oper;
- X long `09`09srchKey;
- X long `09`09srch2Key;
- X unsigned char`09oper2;
- X unsigned char`09mbz1;
- X short `09`09cellSize;
- X long`09`09fldid`5BNFB_MAX_FIELD_ID_ENTRIES`5D;
- X`7D;
- X
- Xstruct nfbdef1`20
- X`7B
- X union`20
- X `7B
- X `09long`09paramId;
- X `09struct`20
- X `09`7B
- X `09`09unsigned `09inx : 16;
- X `09`09unsigned `09typ : 2;
- X `09`09unsigned `09spare : 6;
- X `09`09unsigned `09db : 8;
- X `09`7D fields;
- X `7D overlay;
- X`7D;
- X
- Xstruct nfbdef2`20
- X`7B
- X union`20
- X `7B`09
- X `09long`09lngValue;
- X `09long`09bitValue;
- X `09struct`20
- X `09`7B
- X `09`09short `09 `09strCount;
- X `09`09char `09`09strText;
- X `09`7D string;
- X `7D overlay;
- X`7D;
- X
- Xstruct netbuf
- X`7B
- X short netCmd;
- X short unit;
- X char mbxMsg`5BMAX_MSG`5D;
- X`7D nb;
- X
- $ CALL UNPACK EMULATIONLIB.H;15 727015775
- $ create 'f'
- X/* ************************************************************ *\
- X *`09`09`09`09`09`09`09`09*
- X * Support routines for file descriptors (FD) `09`09*
- X *`09`09`09`09`09`09`09`09*
- X *`09James Peterson, 1987 `09 `09`09`09`09*
- X *`09(c) Copyright MCC, 1987`09 `09`09`09`09*
- X * `09`09`09`09 `09`09`09`09*
- X * `09`09`09`09 `09`09`09`09*
- X \* *********************************************************** */
- X#if defined(vax11c) && !defined(MULTINET)
- X#include "emulationlib.h"
- X#endif
- X
- X#include "scope.h"
- X
- X
- X/*
- X All of this code is to support the handling of file descriptors (FD).
- X The idea is to keep a table of the FDs that are in use and why.
- X For each FD that is open for input, we keep the name of a procedure
- X to call if input arrives for that FD. When an FD is created
- X (by an open, pipe, socket, ...) declare that by calling UsingFD.
- X When it is no longer in use (close ...), call NotUsingFD.
- X*/
- X
- X/* ************************************************************ */
- X/*`09`09`09`09`09`09`09`09*/
- X/*`09`09`09`09`09`09`09`09*/
- X/* ************************************************************ */
- X
- XInitializeFD()
- X`7B
- X register short i;
- X
- X enterprocedure("InitializeFD");
- X /* get the number of file descriptors the system will let us use */
- X MaxFD = getdtablesize();
- X
- X /* allocate space for a File Descriptor (FD) Table */
- X FDD = (struct FDDescriptor *)
- X#ifdef vax11c
- X MyMalloc ((long)(MaxFD * sizeof (struct FDDescriptor)));
- X#else
- X Malloc ((long)(MaxFD * sizeof (struct FDDescriptor)));
- X#endif /* vax11c */
- X
- X /* be sure all fd's are closed and marked not busy */
- X for (i = 0; i < MaxFD; i++)
- X `7B
- X /* 0, 1, 2 are special (stdin, stdout, stderr) */
- X if (i > 2)
- X`09close(i);
- X FDD`5Bi`5D.Busy = false;
- X `7D
- X
- X /* save one FD for single file input or output like debugging */
- X /* also the getservbyname call is currently using an FD */
- X MaxFD -= 4;
- X
- X nFDsInUse = 0 /* stdin, stdout, stderr */ ;
- X#ifdef vax11c
- X FD_ZERO(&ReadDescriptors);
- X#else
- X ReadDescriptors = 0;
- X#endif /* vax11c */
- X HighestFD = 0;
- X
- X#ifndef vax11c`09/* we don't use these */
- X UsingFD(fileno(stdin), (int (*)())NULL);
- X UsingFD(fileno(stdout), (int (*)())NULL);
- X UsingFD(fileno(stderr), (int (*)())NULL);
- X#endif /* vax11c */
- X`7D
- X
- X/* ************************************************************ */
- X
- XUsingFD(fd, Handler)
- X FD fd;
- X int (*Handler)();
- X`7B
- X if (FDD`5Bfd`5D.Busy)
- X NotUsingFD(fd);
- X nFDsInUse += 1;
- X
- X FDD`5Bfd`5D.Busy = true;
- X FDD`5Bfd`5D.InputHandler = Handler;
- X if (Handler == NULL)
- X#ifdef vax11c
- X FD_CLR(fd, &ReadDescriptors);
- X#else
- X ReadDescriptors &= `7E(1 << fd) /* clear fd bit */ ;
- X#endif /* vax11c */
- X else
- X#ifdef vax11c
- X FD_SET(fd, &ReadDescriptors);
- X#else
- X ReadDescriptors `7C= 1 << fd /* set fd bit */ ;
- X#endif /* vax11c */
- X
- X if (fd > HighestFD)
- X HighestFD = fd;
- X
- X if (nFDsInUse >= MaxFD)
- X panic("no more FDs");
- X
- X debug(128,(stderr, "Using FD %d, %d of %d in use\n", fd, nFDsInUse, MaxFD)
- V);
- X`7D
- X
- X/* ************************************************************ */
- X
- XNotUsingFD(fd)
- X FD fd;
- X`7B
- X debug(128,(stderr, "Not Using FD %d\n", fd));
- X
- X if (FDD`5Bfd`5D.Busy)
- X nFDsInUse -= 1;
- X
- X FDD`5Bfd`5D.Busy = false;
- X#ifdef vax11c
- X FD_CLR(fd, &ReadDescriptors);
- X#else
- X ReadDescriptors &= `7E(1 << fd) /* clear fd bit */ ;
- X#endif /* vax11c */
- X
- X while (!FDD`5BHighestFD`5D.Busy && HighestFD > 0)
- X HighestFD -= 1;
- X
- X debug(128,(stderr, "Highest FD %d, in use %d\n", HighestFD, nFDsInUse));
- X`7D
- X
- X/* ************************************************************ */
- X
- XEOFonFD(fd)
- X FD fd;
- X`7B
- X enterprocedure("EOFonFD");
- X debug(128,(stderr, "EOF on %d\n", fd));
- X close(fd);
- X NotUsingFD(fd);
- X`7D
- X
- X
- X/* ************************************************************ */
- X/*`09`09`09`09`09`09`09`09*/
- X/* Main Loop -- wait for input from any source and Process */
- X/*`09`09`09`09`09`09`09`09*/
- X/* ************************************************************ */
- X
- X#include <errno.h>`09 /* for EINTR, EADDRINUSE, ... */
- X#ifdef vax11c
- Xextern volatile int noshare errno;
- X#else
- Xextern int errno;
- X#endif /* vax11c */
- X
- X
- XMainLoop()
- X`7B
- X enterprocedure("MainLoop");
- X
- X while (true)
- X `7B
- X#ifdef vax11c
- X fd_set rfds, wfds, xfds;
- X#else
- X int rfds, wfds, xfds;
- X#endif /* vax11c */
- X short nfds;
- X short fd;
- X
- X /* wait for something */
- X rfds = ReadDescriptors;
- X#ifdef vax11c
- X FD_ZERO(&wfds);
- X#else
- X wfds = 0;
- X#endif /* vax11c */
- X xfds = rfds;
- X
- X debug(128,(stderr, "select %d, rfds = 0x%x\n", HighestFD + 1, rfds));
- X#ifdef vax11c
- X nfds = select(HighestFD + 1, &rfds, &wfds, &xfds, NULL);
- X#else
- X#endif /* vax11c */
- X debug(128,(stderr, "select nfds = 0x%x, rfds = 0x%x, 0x%x, xfds 0x%x\n
- V",
- X`09`09 nfds, rfds, wfds, xfds));
- X
- X if (nfds < 0)
- X`09`7B
- X#ifdef vax11c
- X socket_perror("SELECT");
- X#else
- X`09 if (errno == EINTR)
- X`09 continue /* to end of while loop */ ;
- X`09 debug(1,(stderr, "Bad select - errno = %d\n", errno));
- X`09 if (errno == EBADF)
- X`09 `7B
- X`09 /* one of the bits in rfds is invalid, close down
- X`09`09 files until it goes away */
- X`09 EOFonFD(HighestFD);
- X`09 continue;
- X`09 `7D
- X
- X`09 panic("Select returns error");
- X#endif /* vax11c */
- X`09 continue /* to end of while loop */ ;
- X`09`7D
- X
- X if (nfds == 0)
- X`09`7B
- X`09 TimerExpired();
- X`09 continue;
- X`09`7D
- X
- X /* check each fd to see if it has input */
- X#ifdef vax11c`09/* must skip over the stdin, stdout && stderr */
- X for (fd = 4; 0 < nfds && fd <= HighestFD; fd++)
- X#else
- X for (fd = 0; 0 < nfds && fd <= HighestFD; fd++)
- X#endif /* vax11c */
- X`09`7B
- X`09 /*
- X`09 check all returned fd's; this prevents
- X`09 starvation of later clients by earlier clients
- X`09 */
- X
- X#ifdef vax11c
- X`09 if (!FD_ISSET(fd, &rfds))
- X#else
- X`09 if ((rfds & (1 << fd)) == 0)
- X#endif /* vax11c */
- X`09 continue;
- X
- X`09 nfds -= 1;
- X
- X`09 if (FDD`5Bfd`5D.InputHandler == NULL)
- X`09 `7B
- X`09 panic("FD selected with no handler");
- X`09 debug(1,(stderr, "FD %d has NULL handler\n", fd));
- X`09 `7D
- X`09 else
- X`09 (FDD`5Bfd`5D.InputHandler)(fd);
- X`09`7D
- X `7D
- X`7D
- $ CALL UNPACK FD.C;17 1733650262
- $ create 'f'
- X/* **********************************************
- X *`09`09`09`09`09`09*
- X * header file file descriptor (FD) code *
- X *`09`09`09`09`09`09*
- X *`09James Peterson, 1987`09`09`09*
- X *`09(c) Copyright MCC, 1987 `09`09*
- X *`09`09`09`09`09`09*
- X ********************************************** */
- X
- X
- X/*`20
- X the following structure remembers for each file descriptor its
- X state. In particular, we need to know if it is busy or free
- X and if it is in use, by whom.
- X*/
- X
- Xtypedef int FD;
- X
- Xstruct FDDescriptor
- X`7B
- X Boolean Busy;
- X int (*InputHandler)();
- X`7D;
- X
- Xstruct FDDescriptor *FDD /* array of FD descriptors */ ;
- Xshort MaxFD /* maximum number of FD's possible */ ;
- X
- Xshort nFDsInUse /* number of FD's actually in use */ ;
- X
- X#ifdef vax11c
- Xfd_set ReadDescriptors; /* bit map of FD's in use -- for select */
- X#else
- Xlong ReadDescriptors /* bit map of FD's in use -- for select */ ;
- X#endif /* vax11c */
- Xshort HighestFD /* highest FD in use -- for select */ ;
- $ CALL UNPACK FD.H;2 1447173281
- $ create 'f'
- XReceived: from relay1.UU.NET (`5B137.39.1.5`5D) by TGV.COM via INTERNET ;
- X Thu, 16 Apr 92 14:45:26 PDT
- XReceived: from uunet.uu.net (via LOCALHOST.UU.NET) by relay1.UU.NET with SMT
- VP`20
- X`09(5.61/UUNET-internet-primary) id AA27695; Thu, 16 Apr 92 17:45:22 -0400
- XReceived: from lupine.UUCP by uunet.uu.net with UUCP/RMAIL
- X`09(queueing-rmail) id 174438.23346; Thu, 16 Apr 1992 17:44:38 EDT
- XReceived: from hansen1.ncd.com by lupine.ncd.com (4.1/SMI-4.1)
- X`09id AA21354; Thu, 16 Apr 92 14:21:12 PDT
- XReceived: from local by hansen1.ncd.com (4.1/SMI-4.1)
- X`09id AA06337; Thu, 16 Apr 92 14:28:46 PDT
- XMessage-Id: <9204162128.AA06337@hansen1.ncd.com>
- XTo: mahan@tgv.com
- XSubject: 2 changes for DNET_SCOKET_LIBRARY:
- XDate: Thu, 16 Apr 92 14:28:45 PDT
- XFrom: Osborne Hardison (x137) <lupine!hardison@uunet.UU.NET>
- X
- XOz.
- X
- X
- X1. line 519 shouldbe "return NULL;" rather than "return -1;"
- X
- X2. Change the module connect() to be the following:
- X
- X/*
- X * connect():
- X * supports connecting to a "socket" given the network channel (from socket(
- V))
- X */
- Xint
- Xconnect (chan, name, namelen)
- X unsigned short chan;
- X struct sockaddr *name;
- X unsigned int namelen;
- X`7B
- X int status;
- X unsigned short objlen;
- X char *pncb;
- X struct dsc$descriptor ncb_desc;
- X static struct io_stat_blk iosb;
- X struct dsc$descriptor_s *objdsc;
- X char *objstr = DNETALLOC(NCBSIZE);
- X char *hname;
- X int l = 0;
- X char *a;
- X short *port = &name->sa_data`5B0`5D;
- X short *area = &name->sa_data`5B2`5D;
- X short *node = &name->sa_data`5B4`5D;
- X
- X#ifdef DNDEBUG
- X fprintf(stderr, "connect: start - passed chan %d port %d addr %d.%d\
- Vn",
- X chan, *port, *area, *node);
- X#endif /* DNDEBUG */
- X BCOPY (TASKOBJECT, objstr, strlen(TASKOBJECT));
- X hname = NULL;
- X if ((objdsc = nameFromPort (name)))
- X `7B
- X hname = DNETALLOC(32);
- X a = objstr + strlen(TASKOBJECT);
- X BCOPY(objdsc->dsc$a_pointer, a, strlen(objdsc->dsc$a_pointer
- V));
- X a+= strlen(objdsc->dsc$a_pointer);
- X *a = 0x0;
- X sprintf (hname, "%d.%d::", *area, *node);
- X `7D
- X pncb = initNCB(name, &objlen, objstr, hname);
- X if (hname) DNETFREE(hname);
- X ncb_desc.dsc$w_length = objlen;
- X ncb_desc.dsc$a_pointer = pncb;
- X ncb_desc.dsc$b_dtype = DSC$K_DTYPE_T;
- X ncb_desc.dsc$b_class = DSC$K_CLASS_S;
- X
- X status = SYS$QIOW (0, chan, IO$_ACCESS, &iosb, 0, 0, 0, &ncb_desc, 0
- V, 0, 0, 0);
- X if (!VMSFAIL(status)) status = iosb.status;
- X if (!VMSFAIL(status))
- X `7B
- X#ifdef DNDEBUG
- X fprintf(stderr, "connect: Connection to %s on channel %d\n",
- V pncb, chan);
- X#endif
- X DNETFREE (pncb);
- X return 0;
- X `7D
- X else
- X LIB$SIGNAL (status);
- X DNETFREE (pncb);
- X return -1;
- X`7D
- X
- $ CALL UNPACK FIX.INFO;1 989988039
- $ create 'f'
- XLOCAL_LIBRARIES =`20
- XSRCS = prtype.c print11.c table11.c decode11.c server.c fd.c common.c scope.
- Vc
- XOBJS = scope.o common.o fd.o server.o decode11.o table11.o print11.o prtype.
- Vo
- XTOP=/x11
- X
- XComplexProgramTarget(xscope)
- $ CALL UNPACK IMAKEFILE.;1 1781289788
- $ create 'f'
- XCOMMON.OBJ
- XDECODE11.OBJ
- XFD.OBJ
- XPRINT11.OBJ
- XPRTYPE.OBJ
- XSCOPE.OBJ
- XSERVER.OBJ
- XTABLE11.OBJ
- XMULTINET_SOCKET_LIBRARY/SHARE
- XSYS$LIBRARY:VAXCRTL.EXE/SHARE
- $ CALL UNPACK IPXSCOPE.OPT;1 157314395
- $ create 'f'
- X$ SAVE_VERIFY='F$VERIFY(0)
- X$ if p1 .Eqs. "CLEAN" then goto clean
- X$ if p1 .Eqs. "CLOBBER" then goto clobber
- X$ if p1 .Eqs. "INSTALL" then goto install
- X$!
- X$!`09Compile the X11R4 XSCOPE application
- X$!
- X$ Set Symbol/Scope=NoGlobal
- X$!
- X$! Get the compiler options via the logical name COPTS
- X$!
- X$ cc_options = f$trnlnm("COPTS")
- X$!
- X$! Get the linker options via the logical name LOPTS
- X$!
- X$ link_options = f$trnlnm("LOPTS")
- X$!
- X$! Compile the "C" files
- X$!
- X$! procedure target`09command `09`09`09depends upon
- X$! CALL MAKE FILE.OBJ`09"CC ''cc_options' FILE.C"`09FILE.C
- X$!
- X$! Nasty, but we do this to recompile everything correctly
- X$!
- X$ If F$Search("*.OBJ") .Nes. "" Then Delete/Nolog/Noconfirm *.obj;*
- X$ If F$Search("*.EXE") .Nes. "" Then Delete/Nolog/Noconfirm *.exe;*
- X$!
- X$ write sys$output "Compiling DECnet Version of XSCOPE sources"
- X$ CALL MAKE COMMON.OBJ `09"CC ''cc_options' COMMON.C"`09COMMON.C
- X$ CALL MAKE DECODE11.OBJ `09"CC ''cc_options' DECODE11.C"`09DECODE11.C
- X$ CALL MAKE FD.OBJ `09`09"CC ''cc_options' FD.C"`09`09FD.C
- X$ CALL MAKE PRINT11.OBJ `09"CC ''cc_options' PRINT11.C"`09PRINT11.C
- X$ CALL MAKE PRTYPE.OBJ `09"CC ''cc_options' PRTYPE.C"`09PRTYPE.C
- X$ CALL MAKE SCOPE.OBJ `09`09"CC ''cc_options' SCOPE.C"`09SCOPE.C
- X$ CALL MAKE SERVER.OBJ `09"CC ''cc_options' SERVER.C"`09SERVER.C
- X$ CALL MAKE TABLE11.OBJ `09"CC ''cc_options' TABLE11.C"`09TABLE11.C
- X$ CALL MAKE DNET_SOCKET_LIBRARY.OBJ "CC ''cc_options' DNET_SOCKET_LIBRARY.C
- V" DNET_SOCKET_LIBRARY.C
- X$!
- X$ write sys$output "Building DECnet XSCOPE image"
- X$ CALL MAKE DNXSCOPE.EXE`09"LINK /EXE=DNXSCOPE/MAP=DNXSCOPE ''link_options'
- V DNXSCOPE/OPT"`09*.OBJ
- X$!
- X$! If this system has Multinet (or some other vendors TCP/IP) then
- X$! compile xscope for TCP/IP as well
- X$!
- X$ if f$search("multinet:multinet_socket_library.exe") .Eqs. "" Then Goto No_
- VTCPIP
- X$ cc_options = cc_options + "/define=(MULTINET)"
- X$ delete/nolog/noconfirm *.obj;*`09! get rid of the DECnet versions
- X$!
- X$ write sys$output "Compiling TCP/IP Version of XSCOPE sources"
- X$ CALL MAKE COMMON.OBJ `09"CC ''cc_options' COMMON.C"`09COMMON.C
- X$ CALL MAKE DECODE11.OBJ `09"CC ''cc_options' DECODE11.C"`09DECODE11.C
- X$ CALL MAKE FD.OBJ `09`09"CC ''cc_options' FD.C"`09`09FD.C
- X$ CALL MAKE PRINT11.OBJ `09"CC ''cc_options' PRINT11.C"`09PRINT11.C
- X$ CALL MAKE PRTYPE.OBJ `09"CC ''cc_options' PRTYPE.C"`09PRTYPE.C
- X$ CALL MAKE SCOPE.OBJ `09`09"CC ''cc_options' SCOPE.C"`09SCOPE.C
- X$ CALL MAKE SERVER.OBJ `09"CC ''cc_options' SERVER.C"`09SERVER.C
- X$ CALL MAKE TABLE11.OBJ `09"CC ''cc_options' TABLE11.C"`09TABLE11.C
- X$!
- X$ write sys$output "Building TCP/IP XSCOPE image"
- X$ CALL MAKE IPXSCOPE.EXE`09"LINK /EXE=IPXSCOPE/MAP=IPXSCOPE ''link_options'
- V IPXSCOPE/OPT"`09*.OBJ
- X$!
- X$! Jumped to here if this system doesn't have TCP/IP support
- X$!
- X$ No_TCPIP:
- X$!
- X$ exit
- X$!
- X$ Clobber:`09! Delete executables, Purge directory and clean up object files
- V and listings
- X$ Delete/noconfirm/log *.exe;*
- X$ Delete/noconfirm/log *.map;*
- X$!
- X$ Clean:`09! Purge directory, clean up object files and listings
- X$ Purge
- X$ Delete/noconfirm/log *.lis;*
- X$ Delete/noconfirm/log *.obj;*
- X$!
- X$ exit
- X$!
- X$ Install:
- X$ exit
- X$!
- X$ exit
- X$!
- X$MAKE: SUBROUTINE !SUBROUTINE TO CHECK DEPENDENCIES
- X$ V = 'F$Verify(0)
- X$! P1 = What we are trying to make
- X$! P2 = Command to make it
- X$! P3 - P8 What it depends on
- X$
- X$ If F$Search(P1) .Eqs. "" Then Goto Makeit
- X$ Time = F$CvTime(F$File(P1,"RDT"))
- X$arg=3
- X$Loop:
- X$`09Argument = P'arg
- X$`09If Argument .Eqs. "" Then Goto Exit
- X$`09El=0
- X$Loop2:
- X$`09File = F$Element(El," ",Argument)
- X$`09If File .Eqs. " " Then Goto Endl
- X$`09AFile = ""
- X$Loop3:
- X$`09OFile = AFile
- X$`09AFile = F$Search(File)
- X$`09If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl
- X$`09If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit
- X$`09Goto Loop3
- X$NextEL:
- X$`09El = El + 1
- X$`09Goto Loop2
- X$EndL:
- X$ arg=arg+1
- X$ If arg .Le. 8 Then Goto Loop
- X$ Goto Exit
- X$
- X$Makeit:
- X$ Set Verify
- X$ 'P2
- X$ VV='F$Verify(0)
- X$Exit:
- X$ If V Then Set Verify
- X$ENDSUBROUTINE
- $ CALL UNPACK MAKE.COM;20 690516565
- $ create 'f'
- X##################################################################
- X#
- X# X11 xscope - spy on characters to and from an X11 server
- X#
- X#`09Author: JPeterson, MCC
- X#`09(c) Copyright MCC 1988
- X#
- X#
- X#
- XCFLAGS = -g
- XSRCS = prtype.c print11.c table11.c decode11.c server.c fd.c common.c scope.
- Vc
- XOBJS = scope.o common.o fd.o server.o decode11.o table11.o print11.o prtype.
- Vo
- X
- XALL = xscope
- Xall:`09$`7BALL`7D
- X
- X##################################################################
- X#
- X# compilation of xscope
- X#
- X
- Xxscope:`09$`7BOBJS`7D
- X`09$`7BCC`7D $`7BCFLAGS`7D $`7BOBJS`7D -o xscope
- X
- Xscope.o: scope.c scope.h
- X`09$`7BCC`7D $`7BCFLAGS`7D scope.c -c
- X
- X
- X##################################################################
- X#
- X# compilation of common support code
- X#
- Xcommon.o: common.c scope.h
- X`09$`7BCC`7D $`7BCFLAGS`7D common.c -c
- X
- Xfd.o: fd.c fd.h scope.h
- X`09$`7BCC`7D $`7BCFLAGS`7D fd.c -c
- X
- Xserver.o: server.c scope.h x11.h
- X`09$`7BCC`7D $`7BCFLAGS`7D server.c -c
- X
- Xdecode11.o: decode11.c scope.h x11.h
- X`09$`7BCC`7D $`7BCFLAGS`7D decode11.c -c
- X
- Xtable11.o: table11.c scope.h x11.h
- X`09$`7BCC`7D $`7BCFLAGS`7D table11.c -c
- X
- Xprint11.o: print11.c scope.h x11.h
- X`09$`7BCC`7D $`7BCFLAGS`7D print11.c -c
- X
- Xprtype.o: prtype.c scope.h x11.h
- X`09$`7BCC`7D $`7BCFLAGS`7D prtype.c -c
- X
- Xscope.h: fd.h
- X
- X##################################################################
- X#
- X# clean
- X#
- Xclean:
- X`09rm -f *.o $`7BALL`7D *`7E
- X
- Xlint:`09$`7BSRCS`7D
- X`09lint $`7BSRCS`7D
- X
- Xconfig:
- X`09dvc -c Makefile.proto
- X
- X##################################################################
- X#
- X# installation
- X#
- XBINDIR = /usr/project/deli/working/bin
- X
- Xinstall: $`7BALL`7D
- X`09install xscope $`7BBINDIR`7D
- X
- $ CALL UNPACK MAKEFILE.;1 1651249061
- $ create 'f'
- X##################################################################
- X#
- X# X11 xscope - spy on characters to and from an X11 server
- X#
- X#`09Author: JPeterson, MCC
- X#`09(c) Copyright MCC 1988
- X#
- X#
- X#
- XCFLAGS = -g
- XSRCS = prtype.c print11.c table11.c decode11.c server.c fd.c common.c scope.
- Vc
- XOBJS = scope.o common.o fd.o server.o decode11.o table11.o print11.o prtype.
- Vo
- X
- XALL = xscope
- Xall:`09$`7BALL`7D
- X
- X##################################################################
- X#
- X# compilation of xscope
- X#
- X
- Xxscope:`09$`7BOBJS`7D
- X`09$`7BCC`7D $`7BCFLAGS`7D $`7BOBJS`7D -o xscope
- X
- Xscope.o: scope.c scope.h
- X`09$`7BCC`7D $`7BCFLAGS`7D scope.c -c
- X
- X
- X##################################################################
- X#
- X# compilation of common support code
- X#
- Xcommon.o: common.c scope.h
- X`09$`7BCC`7D $`7BCFLAGS`7D common.c -c
- X
- Xfd.o: fd.c fd.h scope.h
- X`09$`7BCC`7D $`7BCFLAGS`7D fd.c -c
- X
- Xserver.o: server.c scope.h x11.h
- X`09$`7BCC`7D $`7BCFLAGS`7D server.c -c
- X
- Xdecode11.o: decode11.c scope.h x11.h
- X`09$`7BCC`7D $`7BCFLAGS`7D decode11.c -c
- X
- Xtable11.o: table11.c scope.h x11.h
- X`09$`7BCC`7D $`7BCFLAGS`7D table11.c -c
- X
- Xprint11.o: print11.c scope.h x11.h
- X`09$`7BCC`7D $`7BCFLAGS`7D print11.c -c
- X
- Xprtype.o: prtype.c scope.h x11.h
- X`09$`7BCC`7D $`7BCFLAGS`7D prtype.c -c
- X
- Xscope.h: fd.h
- X
- X##################################################################
- X#
- X# clean
- X#
- Xclean:
- X`09rm -f *.o $`7BALL`7D *`7E
- X
- Xlint:`09$`7BSRCS`7D
- X`09lint $`7BSRCS`7D
- X
- Xconfig:
- X`09dvc -c Makefile.proto
- X
- X##################################################################
- X#
- X# installation
- X#
- XBINDIR = $<DeliObjRootConfig>/$<DeliVersionConfig>/bin
- X
- Xinstall: $`7BALL`7D
- X`09install xscope $`7BBINDIR`7D
- X
- $ CALL UNPACK MAKEFILE.PROTO;1 456338482
- $ create 'f'
- X/*
- X * This include file contains the socket/object servers correspondence
- X * for a UN*X-to-VMS server conversion.
- X *`20
- X * OBH - NCD - 3/11/92
- X */
- X#include descrip
- X
- X#define X11_PORT 6000
- X#define FONT_SERVER_PORT 7000
- X/*
- X * Add more here!...
- X */
- X
- Xstatic $DESCRIPTOR (x11_dsc, "X$X0");
- Xstatic $DESCRIPTOR (font_server_dsc, "FONT$FS");
- X/*
- X * Add more here!...
- X */
- X
- Xstatic struct translationTable
- X`7B
- X`09int port;
- X`09struct dsc$descriptor *object;
- X`7D transTable`5B`5D =`20
- X`7B
- X`09`7B X11_PORT, &x11_dsc `7D,
- X`09`7B FONT_SERVER_PORT, &font_server_dsc `7D,
- X/*
- X * ...Then add more here!
- X */
- X`7D;
- $ CALL UNPACK PORTOBJ.H;1 1813801882
- $ create 'f'
- X/* ************************************************** *
- X *`09`09`09`09`09`09 *
- X * Request, Reply, Event, Error Printing`09 *
- X *`09`09`09`09`09`09 *
- X *`09James Peterson, 1988`09`09`09 *
- X *`09(c) Copyright MCC, 1988 `09`09 *
- X *`09`09`09`09`09`09 *
- X * ************************************************** */
- X#if defined(vax11c) && !defined(MULTINET)
- X#include "emulationlib.h"
- X#endif
- X
- X#include "scope.h"
- X#include "x11.h"
- X
- X
- X/* ************************************************************ */
- X/*`09`09`09`09`09`09`09`09*/
- X/*`09`09`09`09`09`09`09`09*/
- X/* ************************************************************ */
- X
- X/*
- X In printing the contents of the fields of the X11 packets, some
- X fields are of obvious value, and others are of lesser value. To
- X control the amount of output, we generate our output according
- X to the level of Verbose-ness that was selected by the user.
- X
- X Verbose = 0 == Headers only, time and request/reply/... names.
- X
- X Verbose = 1 == Very useful content fields.
- X
- X Verbose = 2 == Almost everything.
- X
- X Verbose = 3 == Every single bit and byte.
- X
- X*/
- X
- X/*
- X To aid in making the choice between level 1 and level 2, we
- X define the following define, which does not print relatively
- X unimportant fields.
- X*/
- X
- X#define printfield(a,b,c,d,e) if (Verbose > 1) PrintField(a,b,c,d,e)
- X
- X
- X/* ************************************************************ */
- X/*`09`09`09`09`09`09`09`09*/
- X/*`09`09`09`09`09`09`09`09*/
- X/* ************************************************************ */
- X
- XPrintSetUpMessage(buf)
- X unsigned char *buf;
- X`7B
- X short n;
- X short d;
- X
- X enterprocedure("PrintSetUpMessage");
- X if (Verbose < 1)
- X return;
- X SetIndentLevel(PRINTCLIENT);
- X PrintField(buf, 0, 1, BYTEMODE, "byte-order");
- X PrintField(buf, 2, 2, CARD16, "major-version");
- X PrintField(buf, 4, 2, CARD16, "minor-version");
- X printfield(buf, 6, 2, DVALUE2(n), "length of name");
- X n = IShort(&buf`5B6`5D);
- X printfield(buf, 8, 2, DVALUE2(d), "length of data");
- X d = IShort(&buf`5B8`5D);
- X PrintString8(&buf`5B12`5D, n, "authorization-protocol-name");
- X PrintString8(&buf`5Bpad((long)(12 + n))`5D, d, "authorization-protocol-dat
- Va");
- X`7D
- X
- XPrintSetUpReply(buf)
- X unsigned char *buf;
- X`7B
- X enterprocedure("PrintSetUpReply");
- X SetIndentLevel(PRINTSERVER);
- X if (IByte(&buf`5B0`5D))
- X PrintSuccessfulSetUpReply(buf);
- X else
- X PrintFailedSetUpReply(buf);
- X`7D
- X
- XPrintFailedSetUpReply(buf)
- X unsigned char *buf;
- X`7B
- X short n;
- X
- X PrintField(buf, 0, 1, 0, "SetUp Failed");
- X if (Verbose < 1)
- X return;
- X printfield(buf, 1, 1, DVALUE1(n), "length of reason in bytes");
- X n = IByte(&buf`5B1`5D);
- X PrintField(buf, 2, 2, CARD16, "major-version");
- X PrintField(buf, 4, 2, CARD16, "minor-version");
- X printfield(buf, 6, 2, DVALUE2((n + p) / 4), "length of data");
- X PrintString8(&buf`5B8`5D, n, "reason");
- X`7D
- X
- XPrintSuccessfulSetUpReply(buf)
- X unsigned char *buf;
- X`7B
- X short v;
- X short n;
- X short m;
- X
- X if (Verbose < 1)
- X return;
- X PrintField(buf, 2, 2, CARD16, "protocol-major-version");
- X PrintField(buf, 4, 2, CARD16, "protocol-minor-version");
- X printfield(buf, 6, 2, DVALUE2(8 + 2*n + (v + p + m) / 4), "length of data"
- V);
- X PrintField(buf, 8, 4, CARD32, "release-number");
- X PrintField(buf, 12, 4, CARD32, "resource-id-base");
- X PrintField(buf, 16, 4, CARD32, "resource-id-mask");
- X PrintField(buf, 20, 4, CARD32, "motion-buffer-size");
- X printfield(buf, 24, 2, DVALUE2(v), "length of vendor");
- X v = IShort(&buf`5B24`5D);
- X printfield(buf, 26, 2, CARD16, "maximum-request-length");
- X printfield(buf, 28, 1, CARD8, "number of roots");
- X m = IByte(&buf`5B28`5D);
- X printfield(buf, 29, 1, DVALUE1(n), "number of pixmap-formats");
- X n = IByte(&buf`5B29`5D);
- X PrintField(buf, 30, 1, BYTEORDER, "image-byte-order");
- X PrintField(buf, 31, 1, BYTEORDER, "bitmap-format-bit-order");
- X PrintField(buf, 32, 1, CARD8, "bitmap-format-scanline-unit");
- X PrintField(buf, 33, 1, CARD8, "bitmap-format-scanline-pad");
- X PrintField(buf, 34, 1, KEYCODE, "min-keycode");
- X PrintField(buf, 35, 1, KEYCODE, "max-keycode");
- X PrintString8(&buf`5B40`5D, v, "vendor");
- X PrintList(&buf`5Bpad((long)(40 + v))`5D, (long)n, FORMAT, "pixmap-formats"
- V);
- X PrintList(&buf`5Bpad((long)(40 + v) + 8 * n)`5D, (long)m, SCREEN, "roots")
- V;
- X`7D
- X
- X
- X/* ************************************************************ */
- X/*`09`09`09`09`09`09`09`09*/
- X/*`09`09`09`09`09`09`09`09*/
- X/* ************************************************************ */
- X
- Xstatic char *REQUESTHEADER = "............REQUEST";
- Xstatic char *EVENTHEADER = "..............EVENT";
- Xstatic char *ERRORHEADER = "..............ERROR";
- Xstatic char *REPLYHEADER = "..............REPLY";
- X
- X
- X/* ************************************************************ */
- X/*`09`09`09`09`09`09`09`09*/
- X/*`09`09`09`09`09`09`09`09*/
- X/* ************************************************************ */
- X
- X/* Error Printing procedures */
- X
- XRequestError(buf)
- X unsigned char *buf;
- X`7B
- X PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Request */ ;
- X if (Verbose < 1)
- X return;
- X printfield(buf, 2, 2, CARD16, "sequence number");
- X PrintField(buf, 8, 2, CARD16, "minor opcode");
- X PrintField(buf, 10, 1, CARD8, "major opcode");
- X`7D
- X
- XValueError(buf)
- X unsigned char *buf;
- X`7B
- X PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Value */ ;
- X if (Verbose < 1)
- X return;
- X printfield(buf, 2, 2, CARD16, "sequence number");
- X PrintField(buf, 4, 4, INT32, "bad value");
- X PrintField(buf, 8, 2, CARD16, "minor opcode");
- X PrintField(buf, 10, 1, CARD8, "major opcode");
- X`7D
- X
- XWindowError(buf)
- X unsigned char *buf;
- X`7B
- X PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Window */ ;
- X if (Verbose < 1)
- X return;
- X printfield(buf, 2, 2, CARD16, "sequence number");
- X PrintField(buf, 4, 4, CARD32, "bad resource id");
- X PrintField(buf, 8, 2, CARD16, "minor opcode");
- X PrintField(buf, 10, 1, CARD8, "major opcode");
- X`7D
- X
- XPixmapError(buf)
- X unsigned char *buf;
- X`7B
- X PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Pixmap */ ;
- X if (Verbose < 1)
- X return;
- X printfield(buf, 2, 2, CARD16, "sequence number");
- X PrintField(buf, 4, 4, CARD32, "bad resource id");
- X PrintField(buf, 8, 2, CARD16, "minor opcode");
- X PrintField(buf, 10, 1, CARD8, "major opcode");
- X`7D
- X
- XAtomError(buf)
- X unsigned char *buf;
- X`7B
- X PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Atom */ ;
- X if (Verbose < 1)
- X return;
- X printfield(buf, 2, 2, CARD16, "sequence number");
- X PrintField(buf, 4, 4, CARD32, "bad atom id");
- X PrintField(buf, 8, 2, CARD16, "minor opcode");
- X PrintField(buf, 10, 1, CARD8, "major opcode");
- X`7D
- X
- XCursorError(buf)
- X unsigned char *buf;
- X`7B
- X PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Cursor */ ;
- X if (Verbose < 1)
- X return;
- X printfield(buf, 2, 2, CARD16, "sequence number");
- X PrintField(buf, 4, 4, CARD32, "bad resource id");
- X PrintField(buf, 8, 2, CARD16, "minor opcode");
- X PrintField(buf, 10, 1, CARD8, "major opcode");
- X`7D
- X
- XFontError(buf)
- X unsigned char *buf;
- X`7B
- X PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Font */ ;
- X if (Verbose < 1)
- X return;
- X printfield(buf, 2, 2, CARD16, "sequence number");
- X PrintField(buf, 4, 4, CARD32, "bad resource id");
- X PrintField(buf, 8, 2, CARD16, "minor opcode");
- X PrintField(buf, 10, 1, CARD8, "major opcode");
- X`7D
- X
- XMatchError(buf)
- X unsigned char *buf;
- X`7B
- X PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Match */ ;
- X if (Verbose < 1)
- X return;
- X printfield(buf, 2, 2, CARD16, "sequence number");
- X PrintField(buf, 8, 2, CARD16, "minor opcode");
- X PrintField(buf, 10, 1, CARD8, "major opcode");
- X`7D
- X
- XDrawableError(buf)
- X unsigned char *buf;
- X`7B
- X PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Drawable */ ;
- X if (Verbose < 1)
- X return;
- X printfield(buf, 2, 2, CARD16, "sequence number");
- X PrintField(buf, 4, 4, CARD32, "bad resource id");
- X PrintField(buf, 8, 2, CARD16, "minor opcode");
- X PrintField(buf, 10, 1, CARD8, "major opcode");
- X`7D
- X
- XAccessError(buf)
- X unsigned char *buf;
- X`7B
- X PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Access */ ;
- X if (Verbose < 1)
- X return;
- X printfield(buf, 2, 2, CARD16, "sequence number");
- X PrintField(buf, 8, 2, CARD16, "minor opcode");
- X PrintField(buf, 10, 1, CARD8, "major opcode");
- X`7D
- X
- XAllocError(buf)
- X unsigned char *buf;
- X`7B
- X PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Alloc */ ;
- X if (Verbose < 1)
- X return;
- X printfield(buf, 2, 2, CARD16, "sequence number");
- X PrintField(buf, 8, 2, CARD16, "minor opcode");
- X PrintField(buf, 10, 1, CARD8, "major opcode");
- X`7D
- X
- XColormapError(buf)
- X unsigned char *buf;
- X`7B
- X PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Colormap */ ;
- X if (Verbose < 1)
- X return;
- X printfield(buf, 2, 2, CARD16, "sequence number");
- X PrintField(buf, 4, 4, CARD32, "bad resource id");
- X PrintField(buf, 8, 2, CARD16, "minor opcode");
- X PrintField(buf, 10, 1, CARD8, "major opcode");
- X`7D
- X
- XGContextError(buf)
- X unsigned char *buf;
- X`7B
- X PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* GContext */ ;
- X if (Verbose < 1)
- X return;
- X printfield(buf, 2, 2, CARD16, "sequence number");
- X PrintField(buf, 4, 4, CARD32, "bad resource id");
- X PrintField(buf, 8, 2, CARD16, "minor opcode");
- X PrintField(buf, 10, 1, CARD8, "major opcode");
- X`7D
- X
- XIDChoiceError(buf)
- X unsigned char *buf;
- X`7B
- X PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* IDChoice */ ;
- X if (Verbose < 1)
- X return;
- X printfield(buf, 2, 2, CARD16, "sequence number");
- X PrintField(buf, 4, 4, CARD32, "bad resource id");
- X PrintField(buf, 8, 2, CARD16, "minor opcode");
- X PrintField(buf, 10, 1, CARD8, "major opcode");
- X`7D
- X
- XNameError(buf)
- X unsigned char *buf;
- X`7B
- X PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Name */ ;
- X if (Verbose < 1)
- X return;
- X printfield(buf, 2, 2, CARD16, "sequence number");
- X PrintField(buf, 8, 2, CARD16, "minor opcode");
- X PrintField(buf, 10, 1, CARD8, "major opcode");
- X`7D
- X
- XLengthError(buf)
- X unsigned char *buf;
- X`7B
- X PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Length */ ;
- X if (Verbose < 1)
- X return;
- X printfield(buf, 2, 2, CARD16, "sequence number");
- X PrintField(buf, 8, 2, CARD16, "minor opcode");
- X PrintField(buf, 10, 1, CARD8, "major opcode");
- X`7D
- X
- XImplementationError(buf)
- X unsigned char *buf;
- X`7B
- X PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Implementation */ ;
- X if (Verbose < 1)
- X return;
- X printfield(buf, 2, 2, CARD16, "sequence number");
- X PrintField(buf, 8, 2, CARD16, "minor opcode");
- X PrintField(buf, 10, 1, CARD8, "major opcode");
- X`7D
- X
- X/* ************************************************************ */
- X/*`09`09`09`09`09`09`09`09*/
- X/*`09`09`09`09`09`09`09`09*/
- X/* ************************************************************ */
- X
- X/* Event Printing procedures */
- X
- XKeyPressEvent(buf)
- X unsigned char *buf;
- X`7B
- X PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* KeyPress */ ;
- X if (Verbose < 1)
- X return;
- X PrintField(buf, 1, 1, KEYCODE, "detail");
- X printfield(buf, 2, 2, CARD16, "sequence number");
- X PrintField(buf, 4, 4, TIMESTAMP, "time");
- X PrintField(buf, 8, 4, WINDOW, "root");
- X PrintField(buf, 12, 4, WINDOW, "event");
- X PrintField(buf, 16, 4, WINDOW, "child");
- X PrintField(buf, 20, 2, INT16, "root-x");
- X PrintField(buf, 22, 2, INT16, "root-y");
- X PrintField(buf, 24, 2, INT16, "event-x");
- X PrintField(buf, 26, 2, INT16, "event-y");
- X PrintField(buf, 28, 2, SETofKEYBUTMASK, "state");
- X PrintField(buf, 30, 1, BOOL, "same-screen");
- X`7D
- X
- XKeyReleaseEvent(buf)
- X unsigned char *buf;
- X`7B
- X PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* KeyRelease */ ;
- X if (Verbose < 1)
- X return;
- X PrintField(buf, 1, 1, KEYCODE, "detail");
- X printfield(buf, 2, 2, CARD16, "sequence number");
- X PrintField(buf, 4, 4, TIMESTAMP, "time");
- X PrintField(buf, 8, 4, WINDOW, "root");
- X PrintField(buf, 12, 4, WINDOW, "event");
- X PrintField(buf, 16, 4, WINDOW, "child");
- X PrintField(buf, 20, 2, INT16, "root-x");
- X PrintField(buf, 22, 2, INT16, "root-y");
- X PrintField(buf, 24, 2, INT16, "event-x");
- X PrintField(buf, 26, 2, INT16, "event-y");
- X PrintField(buf, 28, 2, SETofKEYBUTMASK, "state");
- X PrintField(buf, 30, 1, BOOL, "same-screen");
- X`7D
- X
- XButtonPressEvent(buf)
- X unsigned char *buf;
- X`7B
- X PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* ButtonPress */ ;
- X if (Verbose < 1)
- X return;
- X PrintField(buf, 1, 1, BUTTON, "detail");
- X printfield(buf, 2, 2, CARD16, "sequence number");
- X PrintField(buf, 4, 4, TIMESTAMP, "time");
- X PrintField(buf, 8, 4, WINDOW, "root");
- X PrintField(buf, 12, 4, WINDOW, "event");
- X PrintField(buf, 16, 4, WINDOW, "child");
- X PrintField(buf, 20, 2, INT16, "root-x");
- X PrintField(buf, 22, 2, INT16, "root-y");
- X PrintField(buf, 24, 2, INT16, "event-x");
- X PrintField(buf, 26, 2, INT16, "event-y");
- X PrintField(buf, 28, 2, SETofKEYBUTMASK, "state");
- X PrintField(buf, 30, 1, BOOL, "same-screen");
- X`7D
- X
- XButtonReleaseEvent(buf)
- X unsigned char *buf;
- X`7B
- X PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* ButtonRelease */ ;
- X if (Verbose < 1)
- X return;
- X PrintField(buf, 1, 1, BUTTON, "detail");
- X printfield(buf, 2, 2, CARD16, "sequence number");
- X PrintField(buf, 4, 4, TIMESTAMP, "time");
- X PrintField(buf, 8, 4, WINDOW, "root");
- X PrintField(buf, 12, 4, WINDOW, "event");
- X PrintField(buf, 16, 4, WINDOW, "child");
- X PrintField(buf, 20, 2, INT16, "root-x");
- X PrintField(buf, 22, 2, INT16, "root-y");
- X PrintField(buf, 24, 2, INT16, "event-x");
- X PrintField(buf, 26, 2, INT16, "event-y");
- X PrintField(buf, 28, 2, SETofKEYBUTMASK, "state");
- X PrintField(buf, 30, 1, BOOL, "same-screen");
- X`7D
- X
- XMotionNotifyEvent(buf)
- X unsigned char *buf;
- X`7B
- X PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* MotionNotify */ ;
- X if (Verbose < 1)
- X return;
- X PrintField(buf, 1, 1, MOTIONDETAIL, "detail");
- X printfield(buf, 2, 2, CARD16, "sequence number");
- X PrintField(buf, 4, 4, TIMESTAMP, "time");
- X PrintField(buf, 8, 4, WINDOW, "root");
- X PrintField(buf, 12, 4, WINDOW, "event");
- X PrintField(buf, 16, 4, WINDOW, "child");
- X PrintField(buf, 20, 2, INT16, "root-x");
- X PrintField(buf, 22, 2, INT16, "root-y");
- X PrintField(buf, 24, 2, INT16, "event-x");
- X PrintField(buf, 26, 2, INT16, "event-y");
- X PrintField(buf, 28, 2, SETofKEYBUTMASK, "state");
- X PrintField(buf, 30, 1, BOOL, "same-screen");
- X`7D
- X
- XEnterNotifyEvent(buf)
- X unsigned char *buf;
- X`7B
- X PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* EnterNotify */ ;
- X if (Verbose < 1)
- X return;
- X PrintField(buf, 1, 1, ENTERDETAIL, "detail");
- X printfield(buf, 2, 2, CARD16, "sequence number");
- X PrintField(buf, 4, 4, TIMESTAMP, "time");
- X PrintField(buf, 8, 4, WINDOW, "root");
- X PrintField(buf, 12, 4, WINDOW, "event");
- X PrintField(buf, 16, 4, WINDOW, "child");
- X PrintField(buf, 20, 2, INT16, "root-x");
- X PrintField(buf, 22, 2, INT16, "root-y");
- X PrintField(buf, 24, 2, INT16, "event-x");
- X PrintField(buf, 26, 2, INT16, "event-y");
- X PrintField(buf, 28, 2, SETofKEYBUTMASK, "state");
- X PrintField(buf, 30, 1, BUTTONMODE, "mode");
- X PrintField(buf, 31, 1, SCREENFOCUS, "same-screen, focus");
- X`7D
- X
- XLeaveNotifyEvent(buf)
- X unsigned char *buf;
- X`7B
- X PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* LeaveNotify */ ;
- X if (Verbose < 1)
- X return;
- X PrintField(buf, 1, 1, ENTERDETAIL, "detail");
- X printfield(buf, 2, 2, CARD16, "sequence number");
- X PrintField(buf, 4, 4, TIMESTAMP, "time");
- X PrintField(buf, 8, 4, WINDOW, "root");
- X PrintField(buf, 12, 4, WINDOW, "event");
- X PrintField(buf, 16, 4, WINDOW, "child");
- X PrintField(buf, 20, 2, INT16, "root-x");
- X PrintField(buf, 22, 2, INT16, "root-y");
- X PrintField(buf, 24, 2, INT16, "event-x");
- X PrintField(buf, 26, 2, INT16, "event-y");
- X PrintField(buf, 28, 2, SETofKEYBUTMASK, "state");
- X PrintField(buf, 30, 1, BUTTONMODE, "mode");
- X PrintField(buf, 31, 1, SCREENFOCUS, "same-screen, focus");
- X`7D
- X
- XFocusInEvent(buf)
- X unsigned char *buf;
- X`7B
- X PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* FocusIn */ ;
- X if (Verbose < 1)
- X return;
- X PrintField(buf, 1, 1, ENTERDETAIL, "detail");
- X printfield(buf, 2, 2, CARD16, "sequence number");
- X PrintField(buf, 4, 4, WINDOW, "event");
- X PrintField(buf, 8, 1, BUTTONMODE, "mode");
- X`7D
- X
- XFocusOutEvent(buf)
- X unsigned char *buf;
- X`7B
- X PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* FocusOut */ ;
- X if (Verbose < 1)
- X return;
- X PrintField(buf, 1, 1, ENTERDETAIL, "detail");
- X printfield(buf, 2, 2, CARD16, "sequence number");
- X PrintField(buf, 4, 4, WINDOW, "event");
- X PrintField(buf, 8, 1, BUTTONMODE, "mode");
- X`7D
- X
- XKeymapNotifyEvent(buf)
- X unsigned char *buf;
- X`7B
- X PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* KeymapNotify */ ;
- X if (Verbose < 1)
- X return;
- X PrintBytes(&buf`5B1`5D, (long)31,"keys");
- X`7D
- X
- XExposeEvent(buf)
- X unsigned char *buf;
- X`7B
- X PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* Expose */ ;
- X if (Verbose < 1)
- X return;
- X printfield(buf, 2, 2, CARD16, "sequence number");
- X PrintField(buf, 4, 4, WINDOW, "window");
- X PrintField(buf, 8, 2, CARD16, "x");
- X PrintField(buf, 10, 2, CARD16, "y");
- X PrintField(buf, 12, 2, CARD16, "width");
- X PrintField(buf, 14, 2, CARD16, "height");
- X PrintField(buf, 16, 2, CARD16, "count");
- X`7D
- X
- XGraphicsExposureEvent(buf)
- X unsigned char *buf;
- X`7B
- X PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* GraphicsExposure */ ;
- X if (Verbose < 1)
- X return;
- X printfield(buf, 2, 2, CARD16, "sequence number");
- X PrintField(buf, 4, 4, DRAWABLE, "drawable");
- X PrintField(buf, 8, 2, CARD16, "x");
- X PrintField(buf, 10, 2, CARD16, "y");
- X PrintField(buf, 12, 2, CARD16, "width");
- X PrintField(buf, 14, 2, CARD16, "height");
- X PrintField(buf, 16, 2, CARD16, "minor-opcode");
- X PrintField(buf, 18, 2, CARD16, "count");
- X PrintField(buf, 20, 1, CARD8, "major-opcode");
- X`7D
- X
- XNoExposureEvent(buf)
- X unsigned char *buf;
- X`7B
- X PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* NoExposure */ ;
- X if (Verbose < 1)
- X return;
- X printfield(buf, 2, 2, CARD16, "sequence number");
- X PrintField(buf, 4, 4, DRAWABLE, "drawable");
- X PrintField(buf, 8, 2, CARD16, "minor-opcode");
- X PrintField(buf, 10, 1, CARD8, "major-opcode");
- X`7D
- X
- XVisibilityNotifyEvent(buf)
- X unsigned char *buf;
- X`7B
- X PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* VisibilityNotify */ ;
- X if (Verbose < 1)
- X return;
- X printfield(buf, 2, 2, CARD16, "sequence number");
- X PrintField(buf, 4, 4, WINDOW, "window");
- X PrintField(buf, 8, 1, VISIBLE, "state");
- X`7D
- X
- XCreateNotifyEvent(buf)
- X unsigned char *buf;
- X`7B
- X PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* CreateNotify */ ;
- X if (Verbose < 1)
- X return;
- X printfield(buf, 2, 2, CARD16, "sequence number");
- X PrintField(buf, 4, 4, WINDOW, "parent");
- X PrintField(buf, 8, 4, WINDOW, "window");
- X PrintField(buf, 12, 2, INT16, "x");
- X PrintField(buf, 14, 2, INT16, "y");
- X PrintField(buf, 16, 2, CARD16, "width");
- X PrintField(buf, 18, 2, CARD16, "height");
- X PrintField(buf, 20, 2, CARD16, "border-width");
- X PrintField(buf, 22, 1, BOOL, "override-redirect");
- X`7D
- X
- XDestroyNotifyEvent(buf)
- X unsigned char *buf;
- X`7B
- X PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* DestroyNotify */ ;
- X if (Verbose < 1)
- X return;
- X printfield(buf, 2, 2, CARD16, "sequence number");
- X PrintField(buf, 4, 4, WINDOW, "event");
- X PrintField(buf, 8, 4, WINDOW, "window");
- X`7D
- X
- XUnmapNotifyEvent(buf)
- X unsigned char *buf;
- X`7B
- X PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* UnmapNotify */ ;
- X if (Verbose < 1)
- X return;
- X printfield(buf, 2, 2, CARD16, "sequence number");
- X PrintField(buf, 4, 4, WINDOW, "event");
- X PrintField(buf, 8, 4, WINDOW, "window");
- X PrintField(buf, 12, 1, BOOL, "from-configure");
- X`7D
- X
- XMapNotifyEvent(buf)
- X unsigned char *buf;
- X`7B
- X PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* MapNotify */ ;
- X if (Verbose < 1)
- X return;
- X printfield(buf, 2, 2, CARD16, "sequence number");
- X PrintField(buf, 4, 4, WINDOW, "event");
- X PrintField(buf, 8, 4, WINDOW, "window");
- X PrintField(buf, 12, 1, BOOL, "override-redirect");
- X`7D
- X
- +-+-+-+-+-+-+-+- END OF PART 3 +-+-+-+-+-+-+-+-
- --
- Patrick L. Mahan
-
- --- TGV Window Washer ------------------------------- Mahan@TGV.COM ---------
-
- Waking a person unnecessarily should not be considered - Lazarus Long
- a capital crime. For a first offense, that is From the Notebooks of
- Lazarus Long
-
-