gregm@otc.otca.oz.au (Greg McFarlane) (09/05/90)
Submitted-by: Greg McFarlane <gregm@otc.otca.oz.au> Posting-number: Volume 9, Issue 19 Archive-name: xmon/part05 Submitted-by: gregm@otc.otca.oz.au Archive-name: xmon/part05 ---- Cut Here and unpack ---- #!/bin/sh # This is part 05 of xmon if touch 2>&1 | fgrep 'amc' > /dev/null then TOUCH=touch else TOUCH=true fi # ============= x11.h ============== if test X"$1" != X"-c" -a -f 'x11.h'; then echo "File already exists: skipping 'x11.h'" else echo "x - extracting x11.h (Text)" sed 's/^X//' << 'SHAR_EOF' > x11.h && X/* X * Project: XMON - An X protocol monitor X * X * File: x11.h X * X * Description: Type definitions and Connection State for the X11 protocol X */ X X#ifndef X11_H X#define X11_H X X/* X In general, we are called with a buffer of bytes and are supposed to X try to make sense of these bytes according to the X11 protocol. There X are two different types of communication: requests from the client to X the server and replies/errors/events from the server to the client. X We must interpret these two differently. X X Also, we must consider that the bytes on the communication socket may X be sent asynchronously in any amount. This means that we must be prepared X to read in and save some bytes until we get enough to do something with X them. For example, suppose that we get a buffer from a client. We would X expect it to be a request. The request may be 24 bytes long. We may find, X however, that only 16 bytes have actually arrived -- the other 8 are stuck X in a buffer somewhere. We must be prepared to simply hold the 16 bytes we X have until more bytes arrive. X X In general, we do two things: we wait for some number of bytes, and X then we interpret this set of bytes. To interpret this data we use X a modified state machine. We keep two pieces of information: X X (1) the number of bytes that we need X (2) what to do with those bytes. X X This last piece of information is the "state" of the interpretation. X We keep the state as a pointer to the procedure that is to be executed. X X X CLIENTS: X X The data going from the client to the x11 server consists of a X set-up message followed by an infinite stream of variable length X requests. X X Our overall flow is then: X X (a) Wait for 12 bytes. X (b) Interpret these first 12 bytes of the set-up message to get the X length of the rest of the message. X (c) Wait for the rest of the set-up message. X (d) Interpret and print the set-up message. X X *** end of set-up phase -- start normal request loop *** X X (e) Wait for 4 bytes. X (f) Interpret these 4 bytes to get the length of the rest of the command. X (g) Wait for the rest of the command. X (h) Interpret and print the command. X (i) Go back to step (e). X X SERVERS: X X Again, we have a set-up reply followed by an infinite stream of variable X length replies/errors/events. X X Our overall flow is then: X X (a) Wait for 8 bytes. X (b) Interpret the 8 bytes to get the length of the rest of the set-up reply. X (c) Wait for the rest of the set-up reply. X (d) Interpret and print the set-up reply. X X *** end of set-up phase -- start normal reply/error/event loop *** X X We have the following properties of X11 replies, errors, and events: X X Replies: 32 bytes plus a variable amount. Byte 0 is 1. X Bytes 2-3 are a sequence number; bytes 4-7 are length (n). The X complete length of the reply is 32 + 4 * n. X X Errors: 32 bytes. Byte 0 is 0. X Byte 1 is an error code; bytes 2-3 are a sequence number. X Bytes 8-9 are a major opcode; byte 10 is a minor opcode. X X Events: 32 bytes. Byte 0 is 2, 3, 4, .... X X Looking at this we have two choices: wait for one byte and then separately X wait for replies, errors, and events, or wait for 32 bytes, then separately X process each type. We may have to wait for more, in the event of a reply. X This latter seems more effective. It appears reply/error/event formats X were selected to allow waiting for 32 bytes, and it will allow short packets X which are only 32 bytes long, to be processed completely in one step. X X Thus, For normal reply/error/event processing we have X X (e) Wait for 32 bytes. X (f) Interpret these 32 bytes. If possible, go back to step (e). X (g) If the packet is a reply with bytes 4-7 non-zero, wait for the X remainder of the the reply. X (h) Interpret and print the longer reply. Go back to step (e). X X X The similarity in approach to how both the client and server are handled X suggests we can use the same control structure to drive the interpretation X of both types of communication client->server and server->client. X Accordingly, we package up the relevant variables in a ConnState X record. The ConnState record contains the buffer of saved bytes (if any), X the size and length of this buffer, the number of bytes we are waiting for X and what to do when we get them. A separate ConnState record is kept X for the client and server. X X In addition, we may have several different client or server connections. X Thus we need an array of all the necessary state for each client or server. X A client/server is identified with a file descriptor (fd), so we use the X fd to identify the client/server and use it as an index into an array of X state variables. X*/ X X X/* Some field contents are constants, not just types */ X X#define CONST1(n) CARD8 X#define CONST2(n) CARD16 X#define CONST4(n) CARD32 X X X/* Some field contents define the components of an expression */ X X#define DVALUE1(expression) CARD8 X#define DVALUE2(expression) CARD16 X#define DVALUE4(expression) CARD32 X X X/* Built-in Types */ X X#define BYTE 1 /* 8-bit value */ X#define INT8 2 /* 8-bit signed integer */ X#define INT16 3 /* 16-bit signed integer */ X#define INT32 4 /* 32-bit signed integer */ X#define CARD8 5 /* 8-bit unsigned integer */ X#define CARD16 6 /* 16-bit unsigned integer */ X#define CARD32 7 /* 32-bit unsigned integer */ X#define STRING8 8 /* List of CARD8 */ X#define STRING16 9 /* List of CHAR2B */ X#define TEXTITEM8 10 /* STRING8 or Font shift */ X#define TEXTITEM16 11 /* STRING16 or Font shift */ X X#define WINDOW 12 /* CARD32 plus 0 = None */ X#define WINDOWD 13 /* CARD32 plus 0 = PointerWindow, 1 = X InputFocus */ X#define WINDOWNR 14 /* CARD32 plus 0 = None, 1 = PointerRoot */ X X#define PIXMAP 15 /* CARD32 plus 0 = None */ X#define PIXMAPNPR 16 /* CARD32 plus 0 = None, 1 = ParentRelative X */ X#define PIXMAPC 17 /* CARD32 plus 0 = CopyFromParent */ X X#define CURSOR 18 /* CARD32 plus 0 = None */ X X#define FONT 19 /* CARD32 plus 0 = None */ X X#define GCONTEXT 20 /* CARD32 */ X X#define COLORMAP 21 /* CARD32 plus 0 = None */ X#define COLORMAPC 22 /* CARD32 plus 0 = CopyFromParent */ X X#define DRAWABLE 23 /* CARD32 */ X#define FONTABLE 24 /* CARD32 */ X X#define ATOM 25 /* CARD32 plus 0 = None */ X#define ATOMT 26 /* CARD32 plus 0 = AnyPropertyType */ X X#define VISUALID 27 /* CARD32 plus 0 = None */ X#define VISUALIDC 28 /* CARD32 plus 0 = CopyFromParent */ X X#define TIMESTAMP 29 /* CARD32 plus 0 as the current time */ X X#define RESOURCEID 30 /* CARD32 plus 0 = AllTemporary */ X X#define KEYSYM 31 /* CARD32 */ X#define KEYCODE 32 /* CARD8 */ X#define KEYCODEA 33 /* CARD8 plus 0 = AnyKey */ X X#define BUTTON 34 /* CARD8 */ X#define BUTTONA 35 /* CARD8 plus 0 = AnyButton */ X X#define EVENTFORM 36 /* event format */ X#define CHAR8 37 /* CARD8 interpreted as a character */ X#define STR 38 /* String of CHAR8 with preceding length */ X X/* Defined types */ X X#define BITGRAVITY 40 X#define WINGRAVITY 41 X#define BOOL 42 X#define HOSTFAMILY 43 X#define PK_MODE 44 X#define NO_YES 45 X#define WINDOWCLASS 46 X#define BACKSTORE 47 X#define MAPSTATE 48 X#define STACKMODE 49 X#define CIRMODE 50 X#define CHANGEMODE 51 X#define GRABSTAT 52 X#define EVENTMODE 53 X#define FOCUSAGENT 54 X#define DIRECT 55 X#define GCFUNC 56 X#define LINESTYLE 57 X#define CAPSTYLE 58 X#define JOINSTYLE 59 X#define FILLSTYLE 60 X#define FILLRULE 61 X#define SUBWINMODE 62 X#define ARCMODE 63 X#define RECTORDER 64 X#define COORMODE 65 X#define POLYSHAPE 66 X#define IMAGEMODE 67 X#define ALLORNONE 68 X#define OBJECTCLASS 69 X#define OFF_ON 70 X#define INS_DEL 71 X#define DIS_EN 72 X#define CLOSEMODE 73 X#define SAVEMODE 74 X#define RSTATUS 75 X#define MOTIONDETAIL 76 X#define ENTERDETAIL 77 X#define BUTTONMODE 78 X#define SCREENFOCUS 79 X#define VISIBLE 80 X#define CIRSTAT 81 X#define PROPCHANGE 82 X#define CMAPCHANGE 83 X#define MAPOBJECT 84 X#define SETofEVENT 85 X#define SETofPOINTEREVENT 86 X#define SETofDEVICEEVENT 87 X#define SETofKEYBUTMASK 88 X#define SETofKEYMASK 89 X#define WINDOW_BITMASK 90 X#define CONFIGURE_BITMASK 91 X#define GC_BITMASK 92 X#define KEYBOARD_BITMASK 93 X#define COLORMASK 94 X#define CHAR2B 95 X#define POINT 96 X#define RECTANGLE 97 X#define ARC 98 X#define HOST 99 X#define TIMECOORD 100 X#define FONTPROP 101 X#define CHARINFO 102 X#define SEGMENT 103 X#define COLORITEM 104 X#define RGB 105 X#define BYTEMODE 110 X#define BYTEORDER 111 X#define COLORCLASS 112 X#define FORMAT 113 X#define SCREEN 114 X#define DEPTH 115 X#define VISUALTYPE 116 X X#define REQUEST 117 X#define REPLY 118 X#define ERROR 119 X#define EVENT 120 X X#define MaxTypes 128 X X X/* Type Definition Table X X Each item in the X11 Protocol has a type. There are about 120 X different types. We need to be able to print each item in a X format and interpretation which is appropriate for the type of X that item. To do so, we build a table describing each type. X Each type has a name, possibly a list of named values and a X procedure which knows how to print that type. X*/ X X/* Types of Types */ X X#define BUILTIN 1 X#define ENUMERATED 2 X#define SET 3 X#define RECORD 5 X X X/* Enumerated and Set types need a list of Named Values */ X Xstruct ValueListEntry X{ X struct ValueListEntry *Next; X char *Name; X short Type; X short Length; X long Value; X}; X Xstruct TypeDef X{ X char *Name; X short Type /* BUILTIN, ENUMERATED, SET, or RECORD */ ; X struct ValueListEntry *ValueList; X IntCallback PrintProc; X}; X Xtypedef struct TypeDef *TYPE; X Xstruct TypeDef TD[MaxTypes]; X X X/* Reply Buffer: Pseudo-buffer used to provide the opcode for the X request to which this is a reply: Set by DecodeReply X and used in the PrintField of the Reply procedure */ Xunsigned char RBf[2]; X X X/* Sequence Buffer: Pseudo-buffer used to provide the sequence number for a X request: Set by DecodeReply and used in a PrintField of X the Request procedure */ Xunsigned char SBf[4]; X X X#define PRINTSERVER 5 /* indent output as if it comes from server */ X#define PRINTCLIENT 1 /* indent output as if it comes from client */ X X#endif /* X11_H */ SHAR_EOF $TOUCH -am 0903162990 x11.h && chmod 0664 x11.h || echo "restore of x11.h failed" set `wc -c x11.h`;Wc_c=$1 if test "$Wc_c" != "10536"; then echo original size 10536, current size $Wc_c fi fi # ============= xmond.h ============== if test X"$1" != X"-c" -a -f 'xmond.h'; then echo "File already exists: skipping 'xmond.h'" else echo "x - extracting xmond.h (Text)" sed 's/^X//' << 'SHAR_EOF' > xmond.h && X/* X * Project: XMON - An X protocol monitor X * X * File: xmond.h X * X */ X X#ifndef XMOND_H X#define XMOND_H X X#include <stdio.h> X X#include "common.h" X#include "linkl.h" X X#define debug(n,f) (void)((debuglevel & n) ? (fprintf f,fflush(stderr)) : 0) X Xtypedef struct X{ X char *data; X long num_Saved; X long num_Needed; X long BlockSize; X} X Buffer; X X/* X * File descriptors are grouped into four classes: X * standard input: one FD for reading from standard input X * X port: one FD for listening for new client connections X * clients: FDs connected to clients X * servers: FDs connected to servers X * When input is read from a file desccriptor, an InputHandler function X * is called to deal with the data just read. Each FD class has its own X * input handler. X * X * The InputHandler called and the meaning of the private_data field for X * each FD class is: X * X * FD class InputHandler private_data X * -------- ------------ ------------ X * standard input ReadStdin FD of stdin X * X port NewConnection FD of X port X * clients DataFromClient pointer to Client struct X * servers DataFromServer pointer to Server struct X */ X Xtypedef struct X{ X VoidCallback InputHandler; X Pointer private_data; X int fd; X Buffer inBuffer; X Buffer outBuffer; X IntCallback ByteProcessing; X Bool littleEndian; X} X FDDescriptor; X Xtypedef struct X{ X FDDescriptor *fdd; X LinkList server_list; /* list of Server */ X long SequenceNumber; X long ClientNumber; X} X Client; X Xtypedef struct X{ X FDDescriptor *fdd; X Client *client; X LinkList reply_list; /* list of QueueEntry */ X} X Server; X X/* function prototypes: */ X/* decode11.c: */ XGlobal void InitRequestCount P((void )); XGlobal void ClearRequestCount P((void )); XGlobal void StartRequestCount P((void )); XGlobal void EndRequestCount P((void )); XGlobal void PrintRequestCounts P((void )); XGlobal void PrintZeroRequestCounts P((void )); XGlobal void InitEventCount P((void )); XGlobal void ClearEventCount P((void )); XGlobal void StartEventCount P((void )); XGlobal void EndEventCount P((void )); XGlobal void PrintEventCounts P((void )); XGlobal void PrintZeroEventCounts P((void )); XGlobal void InitErrorCount P((void )); XGlobal void ClearErrorCount P((void )); XGlobal void StartErrorCount P((void )); XGlobal void EndErrorCount P((void )); XGlobal void PrintErrorCounts P((void )); XGlobal void PrintZeroErrorCounts P((void )); XGlobal void DecodeRequest P((Client *client , unsigned char *buf , long n )); XGlobal void DecodeReply P((Server *server , unsigned char *buf , long n )); XGlobal void DecodeError P((Server *server , unsigned char *buf , long n )); XGlobal void DecodeEvent P((Server *server , unsigned char *buf , long n )); XGlobal void KeepLastReplyExpected P((void )); X/* print11.c: */ XGlobal void PrintSetUpMessage P((unsigned char *buf )); XGlobal void PrintSetUpReply P((unsigned char *buf )); XGlobal void RequestError P((unsigned char *buf )); XGlobal void ValueError P((unsigned char *buf )); XGlobal void WindowError P((unsigned char *buf )); XGlobal void PixmapError P((unsigned char *buf )); XGlobal void AtomError P((unsigned char *buf )); XGlobal void CursorError P((unsigned char *buf )); XGlobal void FontError P((unsigned char *buf )); XGlobal void MatchError P((unsigned char *buf )); XGlobal void DrawableError P((unsigned char *buf )); XGlobal void AccessError P((unsigned char *buf )); XGlobal void AllocError P((unsigned char *buf )); XGlobal void ColormapError P((unsigned char *buf )); XGlobal void GContextError P((unsigned char *buf )); XGlobal void IDChoiceError P((unsigned char *buf )); XGlobal void NameError P((unsigned char *buf )); XGlobal void LengthError P((unsigned char *buf )); XGlobal void ImplementationError P((unsigned char *buf )); XGlobal void KeyPressEvent P((unsigned char *buf )); XGlobal void KeyReleaseEvent P((unsigned char *buf )); XGlobal void ButtonPressEvent P((unsigned char *buf )); XGlobal void ButtonReleaseEvent P((unsigned char *buf )); XGlobal void MotionNotifyEvent P((unsigned char *buf )); XGlobal void EnterNotifyEvent P((unsigned char *buf )); XGlobal void LeaveNotifyEvent P((unsigned char *buf )); XGlobal void FocusInEvent P((unsigned char *buf )); XGlobal void FocusOutEvent P((unsigned char *buf )); XGlobal void KeymapNotifyEvent P((unsigned char *buf )); XGlobal void ExposeEvent P((unsigned char *buf )); XGlobal void GraphicsExposureEvent P((unsigned char *buf )); XGlobal void NoExposureEvent P((unsigned char *buf )); XGlobal void VisibilityNotifyEvent P((unsigned char *buf )); XGlobal void CreateNotifyEvent P((unsigned char *buf )); XGlobal void DestroyNotifyEvent P((unsigned char *buf )); XGlobal void UnmapNotifyEvent P((unsigned char *buf )); XGlobal void MapNotifyEvent P((unsigned char *buf )); XGlobal void MapRequestEvent P((unsigned char *buf )); XGlobal void ReparentNotifyEvent P((unsigned char *buf )); XGlobal void ConfigureNotifyEvent P((unsigned char *buf )); XGlobal void ConfigureRequestEvent P((unsigned char *buf )); XGlobal void GravityNotifyEvent P((unsigned char *buf )); XGlobal void ResizeRequestEvent P((unsigned char *buf )); XGlobal void CirculateNotifyEvent P((unsigned char *buf )); XGlobal void CirculateRequestEvent P((unsigned char *buf )); XGlobal void PropertyNotifyEvent P((unsigned char *buf )); XGlobal void SelectionClearEvent P((unsigned char *buf )); XGlobal void SelectionRequestEvent P((unsigned char *buf )); XGlobal void SelectionNotifyEvent P((unsigned char *buf )); XGlobal void ColormapNotifyEvent P((unsigned char *buf )); XGlobal void ClientMessageEvent P((unsigned char *buf )); XGlobal void MappingNotifyEvent P((unsigned char *buf )); XGlobal void CreateWindow P((unsigned char *buf )); XGlobal void ChangeWindowAttributes P((unsigned char *buf )); XGlobal void GetWindowAttributes P((unsigned char *buf )); XGlobal void GetWindowAttributesReply P((unsigned char *buf )); XGlobal void DestroyWindow P((unsigned char *buf )); XGlobal void DestroySubwindows P((unsigned char *buf )); XGlobal void ChangeSaveSet P((unsigned char *buf )); XGlobal void ReparentWindow P((unsigned char *buf )); XGlobal void MapWindow P((unsigned char *buf )); XGlobal void MapSubwindows P((unsigned char *buf )); XGlobal void UnmapWindow P((unsigned char *buf )); XGlobal void UnmapSubwindows P((unsigned char *buf )); XGlobal void ConfigureWindow P((unsigned char *buf )); XGlobal void CirculateWindow P((unsigned char *buf )); XGlobal void GetGeometry P((unsigned char *buf )); XGlobal void GetGeometryReply P((unsigned char *buf )); XGlobal void QueryTree P((unsigned char *buf )); XGlobal void QueryTreeReply P((unsigned char *buf )); XGlobal void InternAtom P((unsigned char *buf )); XGlobal void InternAtomReply P((unsigned char *buf )); XGlobal void GetAtomName P((unsigned char *buf )); XGlobal void GetAtomNameReply P((unsigned char *buf )); XGlobal void ChangeProperty P((unsigned char *buf )); XGlobal void DeleteProperty P((unsigned char *buf )); XGlobal void GetProperty P((unsigned char *buf )); XGlobal void GetPropertyReply P((unsigned char *buf )); XGlobal void ListProperties P((unsigned char *buf )); XGlobal void ListPropertiesReply P((unsigned char *buf )); XGlobal void SetSelectionOwner P((unsigned char *buf )); XGlobal void GetSelectionOwner P((unsigned char *buf )); XGlobal void GetSelectionOwnerReply P((unsigned char *buf )); XGlobal void ConvertSelection P((unsigned char *buf )); XGlobal void SendEvent P((unsigned char *buf )); XGlobal void GrabPointer P((unsigned char *buf )); XGlobal void GrabPointerReply P((unsigned char *buf )); XGlobal void UngrabPointer P((unsigned char *buf )); XGlobal void GrabButton P((unsigned char *buf )); XGlobal void UngrabButton P((unsigned char *buf )); XGlobal void ChangeActivePointerGrab P((unsigned char *buf )); XGlobal void GrabKeyboard P((unsigned char *buf )); XGlobal void GrabKeyboardReply P((unsigned char *buf )); XGlobal void UngrabKeyboard P((unsigned char *buf )); XGlobal void GrabKey P((unsigned char *buf )); XGlobal void UngrabKey P((unsigned char *buf )); XGlobal void AllowEvents P((unsigned char *buf )); XGlobal void GrabServer P((unsigned char *buf )); XGlobal void UngrabServer P((unsigned char *buf )); XGlobal void QueryPointer P((unsigned char *buf )); XGlobal void QueryPointerReply P((unsigned char *buf )); XGlobal void GetMotionEvents P((unsigned char *buf )); XGlobal void GetMotionEventsReply P((unsigned char *buf )); XGlobal void TranslateCoordinates P((unsigned char *buf )); XGlobal void TranslateCoordinatesReply P((unsigned char *buf )); XGlobal void WarpPointer P((unsigned char *buf )); XGlobal void SetInputFocus P((unsigned char *buf )); XGlobal void GetInputFocus P((unsigned char *buf )); XGlobal void GetInputFocusReply P((unsigned char *buf )); XGlobal void QueryKeymap P((unsigned char *buf )); XGlobal void QueryKeymapReply P((unsigned char *buf )); XGlobal void OpenFont P((unsigned char *buf )); XGlobal void CloseFont P((unsigned char *buf )); XGlobal void QueryFont P((unsigned char *buf )); XGlobal void QueryFontReply P((unsigned char *buf )); XGlobal void QueryTextExtents P((unsigned char *buf )); XGlobal void QueryTextExtentsReply P((unsigned char *buf )); XGlobal void ListFonts P((unsigned char *buf )); XGlobal void ListFontsReply P((unsigned char *buf )); XGlobal void ListFontsWithInfo P((unsigned char *buf )); XGlobal void ListFontsWithInfoReply P((unsigned char *buf )); XGlobal void ListFontsWithInfoReply1 P((unsigned char *buf )); XGlobal void ListFontsWithInfoReply2 P((unsigned char *buf )); XGlobal void SetFontPath P((unsigned char *buf )); XGlobal void GetFontPath P((unsigned char *buf )); XGlobal void GetFontPathReply P((unsigned char *buf )); XGlobal void CreatePixmap P((unsigned char *buf )); XGlobal void FreePixmap P((unsigned char *buf )); XGlobal void CreateGC P((unsigned char *buf )); XGlobal void ChangeGC P((unsigned char *buf )); XGlobal void CopyGC P((unsigned char *buf )); XGlobal void SetDashes P((unsigned char *buf )); XGlobal void SetClipRectangles P((unsigned char *buf )); XGlobal void FreeGC P((unsigned char *buf )); XGlobal void ClearArea P((unsigned char *buf )); XGlobal void CopyArea P((unsigned char *buf )); XGlobal void CopyPlane P((unsigned char *buf )); XGlobal void PolyPoint P((unsigned char *buf )); XGlobal void PolyLine P((unsigned char *buf )); XGlobal void PolySegment P((unsigned char *buf )); XGlobal void PolyRectangle P((unsigned char *buf )); XGlobal void PolyArc P((unsigned char *buf )); XGlobal void FillPoly P((unsigned char *buf )); XGlobal void PolyFillRectangle P((unsigned char *buf )); XGlobal void PolyFillArc P((unsigned char *buf )); XGlobal void PutImage P((unsigned char *buf )); XGlobal void GetImage P((unsigned char *buf )); XGlobal void GetImageReply P((unsigned char *buf )); XGlobal void PolyText8 P((unsigned char *buf )); XGlobal void PolyText16 P((unsigned char *buf )); XGlobal void ImageText8 P((unsigned char *buf )); XGlobal void ImageText16 P((unsigned char *buf )); XGlobal void CreateColormap P((unsigned char *buf )); XGlobal void FreeColormap P((unsigned char *buf )); XGlobal void CopyColormapAndFree P((unsigned char *buf )); XGlobal void InstallColormap P((unsigned char *buf )); XGlobal void UninstallColormap P((unsigned char *buf )); XGlobal void ListInstalledColormaps P((unsigned char *buf )); XGlobal void ListInstalledColormapsReply P((unsigned char *buf )); XGlobal void AllocColor P((unsigned char *buf )); XGlobal void AllocColorReply P((unsigned char *buf )); XGlobal void AllocNamedColor P((unsigned char *buf )); XGlobal void AllocNamedColorReply P((unsigned char *buf )); XGlobal void AllocColorCells P((unsigned char *buf )); XGlobal void AllocColorCellsReply P((unsigned char *buf )); XGlobal void AllocColorPlanes P((unsigned char *buf )); XGlobal void AllocColorPlanesReply P((unsigned char *buf )); XGlobal void FreeColors P((unsigned char *buf )); XGlobal void StoreColors P((unsigned char *buf )); XGlobal void StoreNamedColor P((unsigned char *buf )); XGlobal void QueryColors P((unsigned char *buf )); XGlobal void QueryColorsReply P((unsigned char *buf )); XGlobal void LookupColor P((unsigned char *buf )); XGlobal void LookupColorReply P((unsigned char *buf )); XGlobal void CreateCursor P((unsigned char *buf )); XGlobal void CreateGlyphCursor P((unsigned char *buf )); XGlobal void FreeCursor P((unsigned char *buf )); XGlobal void RecolorCursor P((unsigned char *buf )); XGlobal void QueryBestSize P((unsigned char *buf )); XGlobal void QueryBestSizeReply P((unsigned char *buf )); XGlobal void QueryExtension P((unsigned char *buf )); XGlobal void QueryExtensionReply P((unsigned char *buf )); XGlobal void ListExtensions P((unsigned char *buf )); XGlobal void ListExtensionsReply P((unsigned char *buf )); XGlobal void ChangeKeyboardMapping P((unsigned char *buf )); XGlobal void GetKeyboardMapping P((unsigned char *buf )); XGlobal void GetKeyboardMappingReply P((unsigned char *buf )); XGlobal void ChangeKeyboardControl P((unsigned char *buf )); XGlobal void GetKeyboardControl P((unsigned char *buf )); XGlobal void GetKeyboardControlReply P((unsigned char *buf )); XGlobal void Bell P((unsigned char *buf )); XGlobal void ChangePointerControl P((unsigned char *buf )); XGlobal void GetPointerControl P((unsigned char *buf )); XGlobal void GetPointerControlReply P((unsigned char *buf )); XGlobal void SetScreenSaver P((unsigned char *buf )); XGlobal void GetScreenSaver P((unsigned char *buf )); XGlobal void GetScreenSaverReply P((unsigned char *buf )); XGlobal void ChangeHosts P((unsigned char *buf )); XGlobal void ListHosts P((unsigned char *buf )); XGlobal void ListHostsReply P((unsigned char *buf )); XGlobal void SetAccessControl P((unsigned char *buf )); XGlobal void SetCloseDownMode P((unsigned char *buf )); XGlobal void KillClient P((unsigned char *buf )); XGlobal void RotateProperties P((unsigned char *buf )); XGlobal void ForceScreenSaver P((unsigned char *buf )); XGlobal void SetPointerMapping P((unsigned char *buf )); XGlobal void SetPointerMappingReply P((unsigned char *buf )); XGlobal void GetPointerMapping P((unsigned char *buf )); XGlobal void GetPointerMappingReply P((unsigned char *buf )); XGlobal void SetModifierMapping P((unsigned char *buf )); XGlobal void SetModifierMappingReply P((unsigned char *buf )); XGlobal void GetModifierMapping P((unsigned char *buf )); XGlobal void GetModifierMappingReply P((unsigned char *buf )); XGlobal void NoOperation P((unsigned char *buf )); X/* server.c: */ XGlobal void PrintTime P((void )); XGlobal int pad P((long n )); XGlobal unsigned long ILong P((unsigned char buf [])); XGlobal unsigned short IShort P((unsigned char buf [])); XGlobal unsigned short IByte P((unsigned char buf [])); XGlobal Bool IBool P((unsigned char buf [])); XGlobal void StartClientConnection P((Client *client )); XGlobal void StartServerConnection P((Server *server )); X/* fd.c: */ XGlobal void InitializeFD P((void )); XGlobal FDDescriptor *UsingFD P((int fd , VoidCallback Handler , Pointer private_data )); XGlobal void NotUsingFD P((int fd )); XGlobal void EOFonFD P((int fd )); X/* main.c: */ XGlobal void CloseConnection P((Client *client )); XGlobal void enterprocedure P((char *s )); XGlobal void panic P((char *s )); X/* prtype.c: */ XGlobal void SetIndentLevel P((short which )); XGlobal void ModifyIndentLevel P((short amount )); XGlobal void DumpItem P((char *name , int fd , unsigned char *buf , long n )); XGlobal void PrintINT8 P((unsigned char *buf )); XGlobal void PrintINT16 P((unsigned char *buf )); XGlobal void PrintINT32 P((unsigned char *buf )); XGlobal void PrintCARD8 P((unsigned char *buf )); XGlobal void PrintCARD16 P((unsigned char *buf )); XGlobal int PrintCARD32 P((unsigned char *buf )); XGlobal int PrintBYTE P((unsigned char *buf )); XGlobal int PrintCHAR8 P((unsigned char *buf )); XGlobal int PrintSTRING16 P((unsigned char *buf )); XGlobal int PrintSTR P((unsigned char *buf )); XGlobal int PrintWINDOW P((unsigned char *buf )); XGlobal void PrintWINDOWD P((unsigned char *buf )); XGlobal void PrintWINDOWNR P((unsigned char *buf )); XGlobal void PrintPIXMAP P((unsigned char *buf )); XGlobal void PrintPIXMAPNPR P((unsigned char *buf )); XGlobal void PrintPIXMAPC P((unsigned char *buf )); XGlobal void PrintCURSOR P((unsigned char *buf )); XGlobal void PrintFONT P((unsigned char *buf )); XGlobal void PrintGCONTEXT P((unsigned char *buf )); XGlobal int PrintCOLORMAP P((unsigned char *buf )); XGlobal void PrintCOLORMAPC P((unsigned char *buf )); XGlobal void PrintDRAWABLE P((unsigned char *buf )); XGlobal void PrintFONTABLE P((unsigned char *buf )); XGlobal int PrintATOM P((unsigned char *buf )); XGlobal void PrintATOMT P((unsigned char *buf )); XGlobal void PrintVISUALID P((unsigned char *buf )); XGlobal void PrintVISUALIDC P((unsigned char *buf )); XGlobal void PrintTIMESTAMP P((unsigned char *buf )); XGlobal void PrintRESOURCEID P((unsigned char *buf )); XGlobal int PrintKEYSYM P((unsigned char *buf )); XGlobal int PrintKEYCODE P((unsigned char *buf )); XGlobal void PrintKEYCODEA P((unsigned char *buf )); XGlobal void PrintBUTTON P((unsigned char *buf )); XGlobal void PrintBUTTONA P((unsigned char *buf )); XGlobal void PrintEVENTFORM P((unsigned char *buf )); XGlobal void PrintENUMERATED P((unsigned char *buf , short length , struct ValueListEntry *ValueList )); XGlobal void PrintSET P((unsigned char *buf , short length , struct ValueListEntry *ValueList )); XGlobal void PrintField P((unsigned char *buf , short start , short length , short FieldType , char *name )); XGlobal int PrintList P((unsigned char *buf , long number , short ListType , char *name )); XGlobal void PrintListSTR P((unsigned char *buf , long number , char *name )); XGlobal int PrintBytes P((unsigned char buf [], long number , char *name )); XGlobal int PrintString8 P((unsigned char buf [], short number , char *name )); XGlobal int PrintString16 P((unsigned char buf [], short number , char *name )); XGlobal void PrintValues P((unsigned char *control , short clength , short ctype , unsigned char *values , char *name )); XGlobal void PrintTextList8 P((unsigned char *buf , short length , char *name )); XGlobal void PrintTextList16 P((unsigned char *buf , short length , char *name )); XGlobal void DumpHexBuffer P((unsigned char *buf , long n )); X/* table11.c: */ XGlobal void InitializeX11 P((void )); X X/* end function prototypes */ X X#endif /* XMOND_H */ SHAR_EOF $TOUCH -am 0903173390 xmond.h && chmod 0775 xmond.h || echo "restore of xmond.h failed" set `wc -c xmond.h`;Wc_c=$1 if test "$Wc_c" != "18148"; then echo original size 18148, current size $Wc_c fi fi # ============= xmonui.h ============== if test X"$1" != X"-c" -a -f 'xmonui.h'; then echo "File already exists: skipping 'xmonui.h'" else echo "x - extracting xmonui.h (Text)" sed 's/^X//' << 'SHAR_EOF' > xmonui.h && X/* X * Project: XMON - An X protocol monitor X * X * File: xmonui.h X * X */ X X#ifndef XMONUI_H X#define XMONUI_H X X#include <stdio.h> X X#include "common.h" X X/* function prototypes: */ X/* xmonui.c: */ X X/* end function prototypes */ X X#endif /* XMONUI_H */ SHAR_EOF $TOUCH -am 0903173390 xmonui.h && chmod 0775 xmonui.h || echo "restore of xmonui.h failed" set `wc -c xmonui.h`;Wc_c=$1 if test "$Wc_c" != "247"; then echo original size 247, current size $Wc_c fi fi # ============= patchlevel.h ============== if test X"$1" != X"-c" -a -f 'patchlevel.h'; then echo "File already exists: skipping 'patchlevel.h'" else echo "x - extracting patchlevel.h (Text)" sed 's/^X//' << 'SHAR_EOF' > patchlevel.h && X#define PATCHLEVEL 0 SHAR_EOF $TOUCH -am 0903182090 patchlevel.h && chmod 0664 patchlevel.h || echo "restore of patchlevel.h failed" set `wc -c patchlevel.h`;Wc_c=$1 if test "$Wc_c" != "21"; then echo original size 21, current size $Wc_c fi fi exit 0 dan ---------------------------------------------------- O'Reilly && Associates argv@sun.com / argv@ora.com Opinions expressed reflect those of the author only.