summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2012-07-08 11:58:20 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2012-07-21 23:47:00 -0700
commitb8160915909e59fc65cc08855fb32fee6f5d89ad (patch)
tree4cb5717e10917d33b66c88a34398b55d31392eb2
parent5b30118f1504fb065cf0b4aca150703834881d9e (diff)
downloadxscope-b8160915909e59fc65cc08855fb32fee6f5d89ad.tar.gz
Convert to X.Org standard indentation & cleanup whitespace
Performed with util/modular/x-indent-all.sh, followed by manual fixups Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--README30
-rw-r--r--audio.c621
-rw-r--r--bigreqscope.h6
-rw-r--r--common.c319
-rw-r--r--decode11.c1895
-rw-r--r--decode_bigreq.c60
-rw-r--r--decode_glx.c468
-rw-r--r--decode_lbx.c181
-rw-r--r--decode_randr.c113
-rw-r--r--decode_render.c764
-rw-r--r--decode_shm.c129
-rw-r--r--decode_wcp.c130
-rw-r--r--decodenas.c556
-rw-r--r--extensions.c242
-rw-r--r--extensions.h54
-rw-r--r--fd.c692
-rw-r--r--fd.h54
-rw-r--r--glxscope.h106
-rw-r--r--lbxscope.h39
-rw-r--r--nas.h155
-rw-r--r--print11.c6242
-rw-r--r--print_bigreq.c31
-rw-r--r--print_glx.c693
-rw-r--r--print_lbx.c262
-rw-r--r--print_randr.c201
-rw-r--r--print_render.c1010
-rw-r--r--print_shm.c228
-rw-r--r--print_wcp.c617
-rw-r--r--printnas.c834
-rw-r--r--proto.h556
-rw-r--r--prtype.c1340
-rw-r--r--randrscope.h19
-rw-r--r--renderscope.h95
-rw-r--r--scope-transport.c1
-rw-r--r--scope.c1709
-rw-r--r--scope.h60
-rw-r--r--server.c893
-rw-r--r--shmscope.h19
-rw-r--r--table11.c2006
-rw-r--r--tablenas.c6
-rw-r--r--wcpscope.h21
-rw-r--r--x11.h366
-rw-r--r--xstats.c188
43 files changed, 11748 insertions, 12263 deletions
diff --git a/README b/README
index 73b367e..ae51c0d 100644
--- a/README
+++ b/README
@@ -35,23 +35,23 @@ on different machines:
X11 -- the X11 window server will be running on machine "A" for Display "B".
("A" is a machine name; "B" is a display number).
-xscope -- xscope must be told where the X11 window server is
- (what machine and what display). The options for xscope are
- -h<X11-host> and -d<display-number>. In our example, -hA and -dB.
- Typically the display-number is not given. xscope will not try to
+xscope -- xscope must be told where the X11 window server is
+ (what machine and what display). The options for xscope are
+ -h<X11-host> and -d<display-number>. In our example, -hA and -dB.
+ Typically the display-number is not given. xscope will not try to
connect to X11 until the client connects to xscope.
-client -- the client should connect to xscope rather than X11. To avoid
- changing the code for the client, xscope listens on the same port
- as X11. If X11 and xscope are on different machines, this works
- well. However, if X11 and xscope are on the same machine, this
- creates a port conflict. To resolve this conflict, xscope can
- be given a different input or output port number, as necessary
- to avoid the port that X11 is listening to. The client must connect
- to this offset port number. The input port for xscope is set by
- -i<port-number>; the output port is set by -o<port-number>. The
+client -- the client should connect to xscope rather than X11. To avoid
+ changing the code for the client, xscope listens on the same port
+ as X11. If X11 and xscope are on different machines, this works
+ well. However, if X11 and xscope are on the same machine, this
+ creates a port conflict. To resolve this conflict, xscope can
+ be given a different input or output port number, as necessary
+ to avoid the port that X11 is listening to. The client must connect
+ to this offset port number. The input port for xscope is set by
+ -i<port-number>; the output port is set by -o<port-number>. The
default input port is 1; the default output port is 0. These ports
- are offset by the X11 base (6000) and the display number. The client
+ are offset by the X11 base (6000) and the display number. The client
attaches to xscope by changing its display number by the port offset.
For example, with X11 running on "bagel", display 0 (the default), and
@@ -82,7 +82,7 @@ should probably be generated from the XCB xml protocol descriptions.
There is some code to interpret typed commands from the keyboard.
It would be possible to extend the a command language to create
- artificial characters to be sent to X11 or the client as if they were
+ artificial characters to be sent to X11 or the client as if they were
generated by the other, or to dynamically alter requests or replies.
------------------------------------------------------------
diff --git a/audio.c b/audio.c
index d7258f7..7eabc10 100644
--- a/audio.c
+++ b/audio.c
@@ -15,7 +15,7 @@
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NCD.
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Author: Keith Packard, Network Computing Devices
@@ -24,331 +24,285 @@
#include "scope.h"
#include "nas.h"
-#include <sys/uio.h> /* for struct iovec, used by socket.h */
-#include <sys/socket.h> /* for AF_INET, SOCK_STREAM, ... */
-#include <sys/ioctl.h> /* for FIONCLEX, FIONBIO, ... */
+#include <sys/uio.h> /* for struct iovec, used by socket.h */
+#include <sys/socket.h> /* for AF_INET, SOCK_STREAM, ... */
+#include <sys/ioctl.h> /* for FIONCLEX, FIONBIO, ... */
#if !defined(FIOCLEX) && defined(HAVE_SYS_FILIO_H)
#include <sys/filio.h>
#endif
#include <fcntl.h>
-#include <netinet/in.h> /* struct sockaddr_in */
+#include <netinet/in.h> /* struct sockaddr_in */
#include <netinet/tcp.h>
-#include <netdb.h> /* struct servent * and struct hostent * */
-#include <errno.h> /* for EINTR, EADDRINUSE, ... */
+#include <netdb.h> /* struct servent * and struct hostent * */
+#include <errno.h> /* for EINTR, EADDRINUSE, ... */
static void
-ReportFromAudioClient (
- FD fd,
- unsigned char *buf,
- long n)
+ReportFromAudioClient(FD fd, unsigned char *buf, long n)
{
if (NasVerbose) {
- if (ScopeEnabled) {
- PrintTime ();
- fprintf(stdout, "NAS Client%s --> %4ld %s\n",
- ClientName(fd), n, (n == 1 ? "byte" : "bytes"));
- }
+ if (ScopeEnabled) {
+ PrintTime();
+ fprintf(stdout, "NAS Client%s --> %4ld %s\n",
+ ClientName(fd), n, (n == 1 ? "byte" : "bytes"));
+ }
}
- ProcessBuffer (fd, buf, n);
+ ProcessBuffer(fd, buf, n);
}
static void
-ReportFromAudioServer(
- FD fd,
- const unsigned char *buf,
- long n)
+ReportFromAudioServer(FD fd, const unsigned char *buf, long n)
{
if (NasVerbose) {
- if (ScopeEnabled) {
- PrintTime();
- fprintf(stdout, "\t\t\t\t\t%4ld %s <-- NAS Server%s\n",
- n, (n == 1 ? "byte" : "bytes"), ClientName(fd));
- }
+ if (ScopeEnabled) {
+ PrintTime();
+ fprintf(stdout, "\t\t\t\t\t%4ld %s <-- NAS Server%s\n",
+ n, (n == 1 ? "byte" : "bytes"), ClientName(fd));
+ }
}
ProcessBuffer(fd, buf, n);
}
-static long StartAudioSetUpMessage (FD fd, const unsigned char *buf, long n);
-static long FinishAudioSetUpMessage (FD fd, const unsigned char *buf, long n);
-static long StartAudioRequest (FD fd, const unsigned char *buf, long n);
-static long FinishAudioRequest (FD fd, const unsigned char *buf, long n);
-static long StartAudioSetUpReply (FD fd, const unsigned char *buf, long n);
-static long FinishAudioSetUpReply (FD fd, const unsigned char *buf, long n);
-static long FinishAudioReply (FD fd, const unsigned char *buf, long n);
-static long AudioServerPacket (FD fd, const unsigned char *buf, long n);
+static long StartAudioSetUpMessage(FD fd, const unsigned char *buf, long n);
+static long FinishAudioSetUpMessage(FD fd, const unsigned char *buf, long n);
+static long StartAudioRequest(FD fd, const unsigned char *buf, long n);
+static long FinishAudioRequest(FD fd, const unsigned char *buf, long n);
+static long StartAudioSetUpReply(FD fd, const unsigned char *buf, long n);
+static long FinishAudioSetUpReply(FD fd, const unsigned char *buf, long n);
+static long FinishAudioReply(FD fd, const unsigned char *buf, long n);
+static long AudioServerPacket(FD fd, const unsigned char *buf, long n);
static void
-StartAudioClientConnection(
- FD fd)
+StartAudioClientConnection(FD fd)
{
- enterprocedure("StartAudioClientConnection");
- /* when a new connection is started, we have no saved bytes */
- CS[fd].SavedBytes = NULL;
- CS[fd].SizeofSavedBytes = 0;
- CS[fd].NumberofSavedBytes = 0;
- CS[fd].NumberofBytesProcessed = 0;
-
- /* when a new connection is started, we have no reply Queue */
- FlushReplyQ(fd);
-
- /* each new connection gets a request sequence number */
- CS[fd].SequenceNumber = 0;
-
- /* we need 12 bytes to start a SetUp message */
- CS[fd].ByteProcessing = StartAudioSetUpMessage;
- CS[fd].NumberofBytesNeeded = 12;
+ enterprocedure("StartAudioClientConnection");
+ /* when a new connection is started, we have no saved bytes */
+ CS[fd].SavedBytes = NULL;
+ CS[fd].SizeofSavedBytes = 0;
+ CS[fd].NumberofSavedBytes = 0;
+ CS[fd].NumberofBytesProcessed = 0;
+
+ /* when a new connection is started, we have no reply Queue */
+ FlushReplyQ(fd);
+
+ /* each new connection gets a request sequence number */
+ CS[fd].SequenceNumber = 0;
+
+ /* we need 12 bytes to start a SetUp message */
+ CS[fd].ByteProcessing = StartAudioSetUpMessage;
+ CS[fd].NumberofBytesNeeded = 12;
}
static void
-StopAudioClientConnection(
- FD fd)
+StopAudioClientConnection(FD fd)
{
- enterprocedure("StopAudioClientConnection");
- /* when a new connection is stopped, discard the old buffer */
+ enterprocedure("StopAudioClientConnection");
+ /* when a new connection is stopped, discard the old buffer */
- if (CS[fd].SizeofSavedBytes > 0)
- free(CS[fd].SavedBytes);
+ if (CS[fd].SizeofSavedBytes > 0)
+ free(CS[fd].SavedBytes);
}
static long
-StartAudioSetUpMessage (
- FD fd,
- const unsigned char *buf,
- long n)
+StartAudioSetUpMessage(FD fd, const unsigned char *buf, long n)
{
- short namelength;
- short datalength;
-
- enterprocedure("StartSetUpMessage");
- /*
- we need the first 12 bytes to be able to determine if, and how many,
- additional bytes we need for name and data authorization. However, we
- can't process the first 12 bytes until we get all of them, so
- return zero bytes used, and increase the number of bytes needed
- */
-
- CS[fd].littleEndian = (buf[0] == 'l');
- CS[ServerHalf(fd)].littleEndian = CS[fd].littleEndian;
- littleEndian = CS[fd].littleEndian;
- namelength = IShort(&buf[6]);
- datalength = IShort(&buf[8]);
- CS[fd].ByteProcessing = FinishAudioSetUpMessage;
- CS[fd].NumberofBytesNeeded = n
- + pad((long)namelength) + pad((long)datalength);
- debug(8,(stderr, "need %ld bytes to finish startup\n",
- CS[fd].NumberofBytesNeeded - n));
- return(0);
+ short namelength;
+ short datalength;
+
+ enterprocedure("StartSetUpMessage");
+ /*
+ we need the first 12 bytes to be able to determine if, and how many,
+ additional bytes we need for name and data authorization. However, we
+ can't process the first 12 bytes until we get all of them, so
+ return zero bytes used, and increase the number of bytes needed
+ */
+
+ CS[fd].littleEndian = (buf[0] == 'l');
+ CS[ServerHalf(fd)].littleEndian = CS[fd].littleEndian;
+ littleEndian = CS[fd].littleEndian;
+ namelength = IShort(&buf[6]);
+ datalength = IShort(&buf[8]);
+ CS[fd].ByteProcessing = FinishAudioSetUpMessage;
+ CS[fd].NumberofBytesNeeded = n
+ + pad((long) namelength) + pad((long) datalength);
+ debug(8, (stderr, "need %ld bytes to finish startup\n",
+ CS[fd].NumberofBytesNeeded - n));
+ return (0);
}
static long
-FinishAudioSetUpMessage (
- FD fd,
- const unsigned char *buf,
- long n)
+FinishAudioSetUpMessage(FD fd, const unsigned char *buf, long n)
{
- enterprocedure("FinishSetUpMessage");
- if (ScopeEnabled)
- PrintAudioSetUpMessage(buf);
-
- /* after a set-up message, we expect a string of requests */
- CS[fd].ByteProcessing = StartAudioRequest;
- CS[fd].NumberofBytesNeeded = 4;
- return(n);
+ enterprocedure("FinishSetUpMessage");
+ if (ScopeEnabled)
+ PrintAudioSetUpMessage(buf);
+
+ /* after a set-up message, we expect a string of requests */
+ CS[fd].ByteProcessing = StartAudioRequest;
+ CS[fd].NumberofBytesNeeded = 4;
+ return (n);
}
-
static long
-StartAudioRequest (
- FD fd,
- const unsigned char *buf,
- long n)
+StartAudioRequest(FD fd, const unsigned char *buf, long n)
{
- unsigned short requestlength;
- enterprocedure("StartRequest");
-
- /* bytes 0,1 are ignored now; bytes 2,3 tell us the request length */
- requestlength = IShort(&buf[2]);
- CS[fd].ByteProcessing = FinishAudioRequest;
- CS[fd].NumberofBytesNeeded = 4 * requestlength;
- debug(8,(stderr, "need %ld more bytes to finish request\n",
- CS[fd].NumberofBytesNeeded - n));
- return(0);
-}
+ unsigned short requestlength;
+ enterprocedure("StartRequest");
+
+ /* bytes 0,1 are ignored now; bytes 2,3 tell us the request length */
+ requestlength = IShort(&buf[2]);
+ CS[fd].ByteProcessing = FinishAudioRequest;
+ CS[fd].NumberofBytesNeeded = 4 * requestlength;
+ debug(8, (stderr, "need %ld more bytes to finish request\n",
+ CS[fd].NumberofBytesNeeded - n));
+ return (0);
+}
static long
-FinishAudioRequest (
- FD fd,
- const unsigned char *buf,
- long n)
+FinishAudioRequest(FD fd, const unsigned char *buf, long n)
{
- enterprocedure("FinishRequest");
- CS[fd].ByteProcessing = StartAudioRequest;
- CS[fd].NumberofBytesNeeded = 4;
- if (ScopeEnabled)
- DecodeAudioRequest(fd, buf, n);
- return(n);
+ enterprocedure("FinishRequest");
+ CS[fd].ByteProcessing = StartAudioRequest;
+ CS[fd].NumberofBytesNeeded = 4;
+ if (ScopeEnabled)
+ DecodeAudioRequest(fd, buf, n);
+ return (n);
}
static void
-StartAudioServerConnection(
- FD fd)
+StartAudioServerConnection(FD fd)
{
- enterprocedure("StartAudioServerConnection");
- /* when a new connection is started, we have no saved bytes */
- CS[fd].SavedBytes = NULL;
- CS[fd].SizeofSavedBytes = 0;
- CS[fd].NumberofSavedBytes = 0;
- CS[fd].NumberofBytesProcessed = 0;
-
- /* when a new connection is started, we have no reply Queue */
- FlushReplyQ(fd);
-
- /* we need 8 bytes to start a SetUp reply */
- CS[fd].ByteProcessing = StartAudioSetUpReply;
- CS[fd].NumberofBytesNeeded = 8;
+ enterprocedure("StartAudioServerConnection");
+ /* when a new connection is started, we have no saved bytes */
+ CS[fd].SavedBytes = NULL;
+ CS[fd].SizeofSavedBytes = 0;
+ CS[fd].NumberofSavedBytes = 0;
+ CS[fd].NumberofBytesProcessed = 0;
+
+ /* when a new connection is started, we have no reply Queue */
+ FlushReplyQ(fd);
+
+ /* we need 8 bytes to start a SetUp reply */
+ CS[fd].ByteProcessing = StartAudioSetUpReply;
+ CS[fd].NumberofBytesNeeded = 8;
}
static void
-StopAudioServerConnection(
- FD fd)
+StopAudioServerConnection(FD fd)
{
- enterprocedure("StopAudioServerConnection");
- /* when a new connection is stopped, discard the old buffer */
+ enterprocedure("StopAudioServerConnection");
+ /* when a new connection is stopped, discard the old buffer */
- if (CS[fd].SizeofSavedBytes > 0)
- free(CS[fd].SavedBytes);
+ if (CS[fd].SizeofSavedBytes > 0)
+ free(CS[fd].SavedBytes);
}
static long
-StartAudioSetUpReply (
- FD fd,
- const unsigned char *buf,
- long n)
+StartAudioSetUpReply(FD fd, const unsigned char *buf, long n)
{
- short replylength;
-
- enterprocedure("StartSetUpReply");
- replylength = IShort(&buf[6]);
- CS[fd].ByteProcessing = FinishAudioSetUpReply;
- CS[fd].NumberofBytesNeeded = n + 4 * replylength;
- debug(8,(stderr, "need %ld bytes to finish startup reply\n",
- CS[fd].NumberofBytesNeeded - n));
- return(0);
+ short replylength;
+
+ enterprocedure("StartSetUpReply");
+ replylength = IShort(&buf[6]);
+ CS[fd].ByteProcessing = FinishAudioSetUpReply;
+ CS[fd].NumberofBytesNeeded = n + 4 * replylength;
+ debug(8, (stderr, "need %ld bytes to finish startup reply\n",
+ CS[fd].NumberofBytesNeeded - n));
+ return (0);
}
static long
-FinishAudioSetUpReply (
- FD fd,
- const unsigned char *buf,
- long n)
+FinishAudioSetUpReply(FD fd, const unsigned char *buf, long n)
{
- enterprocedure("FinishSetUpReply");
- if (ScopeEnabled)
- PrintAudioSetUpReply(buf);
- CS[fd].ByteProcessing = AudioServerPacket;
- CS[fd].NumberofBytesNeeded = 32;
- return(n);
+ enterprocedure("FinishSetUpReply");
+ if (ScopeEnabled)
+ PrintAudioSetUpReply(buf);
+ CS[fd].ByteProcessing = AudioServerPacket;
+ CS[fd].NumberofBytesNeeded = 32;
+ return (n);
}
/* ************************************************************ */
static long
-AudioErrorPacket (
- FD fd,
- const unsigned char *buf,
- long n)
+AudioErrorPacket(FD fd, const unsigned char *buf, long n)
{
- CS[fd].ByteProcessing = AudioServerPacket;
- CS[fd].NumberofBytesNeeded = 32;
- DecodeAudioError(fd, buf, n);
- return(n);
+ CS[fd].ByteProcessing = AudioServerPacket;
+ CS[fd].NumberofBytesNeeded = 32;
+ DecodeAudioError(fd, buf, n);
+ return (n);
}
-
static long
-AudioEventPacket (
- FD fd,
- const unsigned char *buf,
- long n)
+AudioEventPacket(FD fd, const unsigned char *buf, long n)
{
- CS[fd].ByteProcessing = AudioServerPacket;
- CS[fd].NumberofBytesNeeded = 32;
- if (ScopeEnabled)
- DecodeAudioEvent(fd, buf, n);
- return(n);
+ CS[fd].ByteProcessing = AudioServerPacket;
+ CS[fd].NumberofBytesNeeded = 32;
+ if (ScopeEnabled)
+ DecodeAudioEvent(fd, buf, n);
+ return (n);
}
-
static long
-AudioReplyPacket (
- FD fd,
- const unsigned char *buf,
- long n)
+AudioReplyPacket(FD fd, const unsigned char *buf, long n)
{
- long replylength;
-
- replylength = ILong(&buf[4]);
-
- /*
- Replies may need more bytes, so we compute how many more
- bytes are needed and ask for them, not using any of the bytes
- we were given (return(0) to say that no bytes were used).
- If the replylength is zero (we don't need any more bytes), the
- number of bytes needed will be the same as what we have, and
- so the top-level loop will call the next routine immediately
- with the same buffer of bytes that we were given.
- */
-
- CS[fd].ByteProcessing = FinishAudioReply;
- CS[fd].NumberofBytesNeeded = n + 4 * replylength;
- debug(8,(stderr, "need %ld bytes to finish reply\n", (4 * replylength)));
- return(0);
+ long replylength;
+
+ replylength = ILong(&buf[4]);
+
+ /*
+ Replies may need more bytes, so we compute how many more
+ bytes are needed and ask for them, not using any of the bytes
+ we were given (return(0) to say that no bytes were used).
+ If the replylength is zero (we don't need any more bytes), the
+ number of bytes needed will be the same as what we have, and
+ so the top-level loop will call the next routine immediately
+ with the same buffer of bytes that we were given.
+ */
+
+ CS[fd].ByteProcessing = FinishAudioReply;
+ CS[fd].NumberofBytesNeeded = n + 4 * replylength;
+ debug(8, (stderr, "need %ld bytes to finish reply\n", (4 * replylength)));
+ return (0);
}
static long
-FinishAudioReply (
- FD fd,
- const unsigned char *buf,
- long n)
+FinishAudioReply(FD fd, const unsigned char *buf, long n)
{
- CS[fd].ByteProcessing = AudioServerPacket;
- CS[fd].NumberofBytesNeeded = 32;
- enterprocedure("FinishAudioReply");
- if (ScopeEnabled)
- DecodeAudioReply(fd, buf, n);
- return(n);
+ CS[fd].ByteProcessing = AudioServerPacket;
+ CS[fd].NumberofBytesNeeded = 32;
+ enterprocedure("FinishAudioReply");
+ if (ScopeEnabled)
+ DecodeAudioReply(fd, buf, n);
+ return (n);
}
static long
-AudioServerPacket (
- FD fd,
- const unsigned char *buf,
- long n)
+AudioServerPacket(FD fd, const unsigned char *buf, long n)
{
- short PacketType;
- enterprocedure("ServerPacket");
-
- PacketType = IByte(&buf[0]);
- if (PacketType == 0)
- return(AudioErrorPacket(fd, buf, n));
- if (PacketType == 1)
- return(AudioReplyPacket(fd, buf, n));
- return(AudioEventPacket(fd, buf, n));
+ short PacketType;
+
+ enterprocedure("ServerPacket");
+
+ PacketType = IByte(&buf[0]);
+ if (PacketType == 0)
+ return (AudioErrorPacket(fd, buf, n));
+ if (PacketType == 1)
+ return (AudioReplyPacket(fd, buf, n));
+ return (AudioEventPacket(fd, buf, n));
}
static void
-CloseAudioConnection(
- FD fd)
+CloseAudioConnection(FD fd)
{
- debug(4,(stderr, "close %d and %d\n", fd, FDPair(fd)));
- StopAudioClientConnection(ServerHalf(fd));
- StopAudioServerConnection(ClientHalf(fd));
-
- (void)close(fd);
- NotUsingFD(fd);
- (void)close(FDPair(fd));
- NotUsingFD(FDPair(fd));
+ debug(4, (stderr, "close %d and %d\n", fd, FDPair(fd)));
+ StopAudioClientConnection(ServerHalf(fd));
+ StopAudioServerConnection(ClientHalf(fd));
+
+ (void) close(fd);
+ NotUsingFD(fd);
+ (void) close(FDPair(fd));
+ NotUsingFD(FDPair(fd));
}
/* when we get data from a client, we read it in, copy it to the
@@ -356,50 +310,45 @@ CloseAudioConnection(
have to have a server, if there isn't one. */
static void
-DataFromAudioClient(
- FD fd)
+DataFromAudioClient(FD fd)
{
- long n;
- FD ServerFD;
-
- Verbose = NasVerbose;
- enterprocedure("DataFromAudioClient");
- ServerFD = FDPair(fd);
- if (ServerFD < 0)
- {
- ServerFD = ConnectToServer(false);
- if (ServerFD < 0)
- {
- CloseAudioConnection(fd);
- return;
- }
- SetUpPair(fd, ServerFD);
+ long n;
+ FD ServerFD;
+
+ Verbose = NasVerbose;
+ enterprocedure("DataFromAudioClient");
+ ServerFD = FDPair(fd);
+ if (ServerFD < 0) {
+ ServerFD = ConnectToServer(false);
+ if (ServerFD < 0) {
+ CloseAudioConnection(fd);
+ return;
+ }
+ SetUpPair(fd, ServerFD);
}
- n = read(fd, FDinfo[ServerFD].buffer, BUFFER_SIZE);
- debug(4,(stderr, "read %ld bytes from Client%s\n", n, ClientName(fd)));
- if (n < 0)
- {
- PrintTime();
- perror("Client --> read error:");
- CloseAudioConnection(fd);
- return;
+ n = read(fd, FDinfo[ServerFD].buffer, BUFFER_SIZE);
+ debug(4, (stderr, "read %ld bytes from Client%s\n", n, ClientName(fd)));
+ if (n < 0) {
+ PrintTime();
+ perror("Client --> read error:");
+ CloseAudioConnection(fd);
+ return;
}
- if (n == 0)
- {
- PrintTime();
- if (NasVerbose >= 0)
- fprintf(stdout, "Client%s --> EOF\n", ClientName(fd));
- CloseAudioConnection(fd);
- return;
+ if (n == 0) {
+ PrintTime();
+ if (NasVerbose >= 0)
+ fprintf(stdout, "Client%s --> EOF\n", ClientName(fd));
+ CloseAudioConnection(fd);
+ return;
}
- FDinfo[ServerFD].bufcount = n;
- FDinfo[ServerFD].bufstart = 0;
+ FDinfo[ServerFD].bufcount = n;
+ FDinfo[ServerFD].bufstart = 0;
- FlushFD (ServerFD);
- /* also report the bytes to standard out */
- ReportFromAudioClient(fd, FDinfo[ServerFD].buffer, n);
+ FlushFD(ServerFD);
+ /* also report the bytes to standard out */
+ ReportFromAudioClient(fd, FDinfo[ServerFD].buffer, n);
}
/* ********************************************** */
@@ -410,89 +359,85 @@ DataFromAudioClient(
we close the connection down -- don't need a server with no client. */
static void
-DataFromAudioServer(
- FD fd)
+DataFromAudioServer(FD fd)
{
- long n;
- FD ClientFD;
-
- Verbose = NasVerbose;
- ClientFD = FDPair(fd);
- if (ClientFD < 0)
- {
- CloseAudioConnection(fd);
- return;
+ long n;
+ FD ClientFD;
+
+ Verbose = NasVerbose;
+ ClientFD = FDPair(fd);
+ if (ClientFD < 0) {
+ CloseAudioConnection(fd);
+ return;
}
- enterprocedure("DataFromAudioServer");
- n = read(fd, (char *)FDinfo[ClientFD].buffer, BUFFER_SIZE);
- debug(4,(stderr, "read %ld bytes from Server%s\n", n, ClientName(fd)));
- if (n < 0)
- {
- PrintTime();
- perror("read error <- Server");
- CloseAudioConnection(fd);
- return;
+ enterprocedure("DataFromAudioServer");
+ n = read(fd, (char *) FDinfo[ClientFD].buffer, BUFFER_SIZE);
+ debug(4, (stderr, "read %ld bytes from Server%s\n", n, ClientName(fd)));
+ if (n < 0) {
+ PrintTime();
+ perror("read error <- Server");
+ CloseAudioConnection(fd);
+ return;
}
- if (n == 0)
- {
- PrintTime();
- if (NasVerbose >= 0)
- fprintf(stdout, "EOF <-- Server%s\n", ClientName(fd));
- CloseAudioConnection(fd);
- return;
+ if (n == 0) {
+ PrintTime();
+ if (NasVerbose >= 0)
+ fprintf(stdout, "EOF <-- Server%s\n", ClientName(fd));
+ CloseAudioConnection(fd);
+ return;
}
- FDinfo[ClientFD].bufcount = n;
- FDinfo[ClientFD].bufstart = 0;
- FlushFD (ClientFD);
+ FDinfo[ClientFD].bufcount = n;
+ FDinfo[ClientFD].bufstart = 0;
+ FlushFD(ClientFD);
- /* also report the bytes to standard out */
- ReportFromAudioServer(fd, FDinfo[ClientFD].buffer, n);
+ /* also report the bytes to standard out */
+ ReportFromAudioServer(fd, FDinfo[ClientFD].buffer, n);
}
static FD
-ConnectToAudioClient(
- FD ConnectionSocket)
+ConnectToAudioClient(FD ConnectionSocket)
{
- FD ClientFD;
- ClientFD = AcceptConnection(ConnectionSocket);
- UsingFD(ClientFD, DataFromAudioClient, FlushFD, NULL);
- StartAudioClientConnection(ClientFD);
- return(ClientFD);
+ FD ClientFD;
+
+ ClientFD = AcceptConnection(ConnectionSocket);
+ UsingFD(ClientFD, DataFromAudioClient, FlushFD, NULL);
+ StartAudioClientConnection(ClientFD);
+ return (ClientFD);
}
-static FD ConnectToAudioServer(
- Boolean report)
+static FD
+ConnectToAudioServer(Boolean report)
{
- FD ServerFD;
- XtransConnInfo trans_conn = NULL; /* transport connection object */
-
- if (!AudioServerHostName[0])
- strcpy (AudioServerHostName, ServerHostName);
- ServerFD = MakeConnection (AudioServerHostName, GetServerport () + 2000, report, &trans_conn);
- if (ServerFD >= 0)
- {
- UsingFD(ServerFD, DataFromAudioServer, FlushFD, trans_conn);
- StartAudioServerConnection(ServerFD);
+ FD ServerFD;
+ XtransConnInfo trans_conn = NULL; /* transport connection object */
+
+ if (!AudioServerHostName[0])
+ strcpy(AudioServerHostName, ServerHostName);
+ ServerFD =
+ MakeConnection(AudioServerHostName, GetServerport() + 2000, report,
+ &trans_conn);
+ if (ServerFD >= 0) {
+ UsingFD(ServerFD, DataFromAudioServer, FlushFD, trans_conn);
+ StartAudioServerConnection(ServerFD);
}
- return(ServerFD);
+ return (ServerFD);
}
void
-NewAudio (
- FD fd)
+NewAudio(FD fd)
{
- FD ServerFD = -1;
- FD ClientFD = -1;
+ FD ServerFD = -1;
+ FD ClientFD = -1;
- ClientFD = ConnectToAudioClient(fd);
- ServerFD = ConnectToAudioServer(true);
- SetUpPair(ClientFD, ServerFD);
+ ClientFD = ConnectToAudioClient(fd);
+ ServerFD = ConnectToAudioServer(true);
+ SetUpPair(ClientFD, ServerFD);
}
void
-InitializeAudio (void)
+InitializeAudio(void)
{
- InitializeAudioDecode ();
+ InitializeAudioDecode();
}
diff --git a/bigreqscope.h b/bigreqscope.h
index 00e9c08..5bb1e01 100644
--- a/bigreqscope.h
+++ b/bigreqscope.h
@@ -1,7 +1,6 @@
#ifndef _BIGREQSCOPE_H_
#define _BIGREQSCOPE_H_
-
#define BIGREQREQUESTHEADER "BIGREQREQUEST"
#define BIGREQREPLYHEADER "BIGREQREPLY"
@@ -13,8 +12,7 @@
#define printfield(a,b,c,d,e) if (Verbose > 1) PrintField(a,b,c,d,e)
-extern void BigreqEnable (FD fd, const unsigned char *buf);
-extern void BigreqEnableReply (FD fd, const unsigned char *buf);
+extern void BigreqEnable(FD fd, const unsigned char *buf);
+extern void BigreqEnableReply(FD fd, const unsigned char *buf);
#endif
-
diff --git a/common.c b/common.c
index a0d240b..d6f4d7c 100644
--- a/common.c
+++ b/common.c
@@ -1,8 +1,8 @@
-/* ************************************************************ *\
- * *
- * Common support routines for sockets *
- * *
- * James L. Peterson *
+/*
+ * Common support routines for sockets
+ *
+ * James L. Peterson
+ *
* Copyright (C) 1987 MCC
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -22,8 +22,9 @@
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
- * *
- * *
+ *
+ */
+/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -44,8 +45,8 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
- * *
- \* *********************************************************** */
+ *
+ */
#include "scope.h"
#include <fcntl.h>
@@ -58,22 +59,22 @@
/* ********************************************** */
void
-enterprocedure (const char *s)
+enterprocedure(const char *s)
{
- debug(2,(stderr, "-> %s\n", s));
+ debug(2, (stderr, "-> %s\n", s));
}
void
-warn (const char *s)
+warn(const char *s)
{
- fprintf(stderr, "####### %s\n", s);
+ fprintf(stderr, "####### %s\n", s);
}
void
-panic (const char *s)
+panic(const char *s)
{
- fprintf(stderr, "%s\n", s);
- exit(1);
+ fprintf(stderr, "%s\n", s);
+ exit(1);
}
/* ************************************************************ */
@@ -85,65 +86,73 @@ panic (const char *s)
#define __USE_BSD_SIGNAL
#include <signal.h>
-static void SignalURG(int sig)
+static void
+SignalURG(int sig)
{
- debug(1,(stderr, "==> SIGURG received\n"));
+ debug(1, (stderr, "==> SIGURG received\n"));
}
-static void SignalPIPE(int sig)
+static void
+SignalPIPE(int sig)
{
- signal (SIGPIPE, SignalPIPE);
- debug(1,(stderr, "==> SIGPIPE received\n"));
+ signal(SIGPIPE, SignalPIPE);
+ debug(1, (stderr, "==> SIGPIPE received\n"));
}
-static void SignalINT(int sig)
+static void
+SignalINT(int sig)
{
- signal (SIGINT, SignalINT);
- debug(1,(stderr, "==> SIGINT received\n"));
- Interrupt = 1;
+ signal(SIGINT, SignalINT);
+ debug(1, (stderr, "==> SIGINT received\n"));
+ Interrupt = 1;
}
-static void SignalQUIT(int sig)
+static void
+SignalQUIT(int sig)
{
- debug(1,(stderr, "==> SIGQUIT received\n"));
- exit(1);
+ debug(1, (stderr, "==> SIGQUIT received\n"));
+ exit(1);
}
-static void SignalTERM(int sig)
+static void
+SignalTERM(int sig)
{
- debug(1,(stderr, "==> SIGTERM received\n"));
- exit(1);
+ debug(1, (stderr, "==> SIGTERM received\n"));
+ exit(1);
}
-static void SignalTSTP(int sig)
+static void
+SignalTSTP(int sig)
{
- debug(1,(stderr, "==> SIGTSTP received\n"));
+ debug(1, (stderr, "==> SIGTSTP received\n"));
}
-static void SignalCONT(int sig)
+static void
+SignalCONT(int sig)
{
- debug(1,(stderr, "==> SIGCONT received\n"));
+ debug(1, (stderr, "==> SIGCONT received\n"));
}
-static void SignalUSR1(int sig)
+static void
+SignalUSR1(int sig)
{
- debug(1,(stderr, "==> SIGUSR1 received\n"));
- ScopeEnabled = ! ScopeEnabled;
+ debug(1, (stderr, "==> SIGUSR1 received\n"));
+ ScopeEnabled = !ScopeEnabled;
}
void
SetSignalHandling(void)
{
- enterprocedure("SetSignalHandling");
- (void)signal(SIGURG, SignalURG);
- (void)signal(SIGPIPE, SignalPIPE);
- (void)signal(SIGINT, SignalINT);
- (void)signal(SIGQUIT, SignalQUIT);
- (void)signal(SIGTERM, SignalTERM);
- (void)signal(SIGTSTP, SignalTSTP);
- (void)signal(SIGCONT, SignalCONT);
- if (HandleSIGUSR1)
- (void)signal(SIGUSR1, SignalUSR1);
+ enterprocedure("SetSignalHandling");
+ (void) signal(SIGURG, SignalURG);
+ (void) signal(SIGPIPE, SignalPIPE);
+ (void) signal(SIGINT, SignalINT);
+ (void) signal(SIGQUIT, SignalQUIT);
+ (void) signal(SIGTERM, SignalTERM);
+ (void) signal(SIGTSTP, SignalTSTP);
+ (void) signal(SIGCONT, SignalCONT);
+ if (HandleSIGUSR1)
+ (void) signal(SIGUSR1, SignalUSR1);
}
@@ -160,160 +169,160 @@ SetSignalHandling(void)
#define TRANS_SERVER
#define X11_t
#include <X11/Xtrans/Xtrans.h>
-static XtransConnInfo *ListenTransConns = NULL;
-static int *ListenTransFds = NULL;
-static int ListenTransCount;
+static XtransConnInfo *ListenTransConns = NULL;
+static int *ListenTransFds = NULL;
+static int ListenTransCount;
#else
-#include <sys/types.h> /* needed by sys/socket.h and netinet/in.h */
-#include <sys/uio.h> /* for struct iovec, used by socket.h */
-#include <sys/socket.h> /* for AF_INET, SOCK_STREAM, ... */
-#include <sys/ioctl.h> /* for FIONCLEX, FIONBIO, ... */
-#include <sys/fcntl.h> /* for FIONCLEX, FIONBIO, ... */
+#include <sys/types.h> /* needed by sys/socket.h and netinet/in.h */
+#include <sys/uio.h> /* for struct iovec, used by socket.h */
+#include <sys/socket.h> /* for AF_INET, SOCK_STREAM, ... */
+#include <sys/ioctl.h> /* for FIONCLEX, FIONBIO, ... */
+#include <sys/fcntl.h> /* for FIONCLEX, FIONBIO, ... */
#if !defined(FIOCLEX) && defined(HAVE_SYS_FILIO_H)
#include <sys/filio.h>
#endif
-#include <netinet/in.h> /* struct sockaddr_in */
-#include <netdb.h> /* struct servent * and struct hostent * */
+#include <netinet/in.h> /* struct sockaddr_in */
+#include <netdb.h> /* struct servent * and struct hostent * */
+
+static int ON = 1; /* used in ioctl */
-static int ON = 1 /* used in ioctl */ ;
#define BACKLOG 5
#endif
void
-SetUpConnectionSocket(
- int iport,
- void (*connectionFunc)(int))
+SetUpConnectionSocket(int iport, void (*connectionFunc) (int))
{
#ifdef USE_XTRANS
- char port[20];
- int partial;
- int i;
+ char port[20];
+ int partial;
+ int i;
#else
- FD ConnectionSocket;
- struct sockaddr_in sin;
- short port;
- int one = 1;
+ FD ConnectionSocket;
+ struct sockaddr_in sin;
+ short port;
+ int one = 1;
#ifndef SO_DONTLINGER
- struct linger linger;
-#endif /* SO_DONTLINGER */
+ struct linger linger;
+#endif /* SO_DONTLINGER */
#endif
- char MyHostName[256];
+ char MyHostName[256];
- enterprocedure("SetUpConnectionSocket");
+ enterprocedure("SetUpConnectionSocket");
- (void) gethostname(MyHostName, sizeof(MyHostName));
- ScopeHost = strdup(MyHostName);
- if (ScopeHost == NULL)
- panic("Can't allocate memory for hostname");
+ (void) gethostname(MyHostName, sizeof(MyHostName));
+ ScopeHost = strdup(MyHostName);
+ if (ScopeHost == NULL)
+ panic("Can't allocate memory for hostname");
#ifdef USE_XTRANS
- ScopePort = iport - ServerBasePort;
- sprintf (port, "%d", ScopePort);
- if ((_X11TransMakeAllCOTSServerListeners (port, &partial,
- &ListenTransCount, &ListenTransConns) >= 0) &&
+ ScopePort = iport - ServerBasePort;
+ sprintf(port, "%d", ScopePort);
+ if ((_X11TransMakeAllCOTSServerListeners(port, &partial, &ListenTransCount,
+ &ListenTransConns) >= 0) &&
(ListenTransCount >= 1)) {
- if (partial) {
- debug(4,(stderr,
- "Warning: Failed to establish listening connections on some transports\n"));
- }
- ListenTransFds = malloc (ListenTransCount * sizeof (int));
- if (ListenTransFds == NULL)
- panic("Can't allocate memory for ListenTransFds");
-
- for (i = 0; i < ListenTransCount; i++)
- {
- int fd = _X11TransGetConnectionNumber (ListenTransConns[i]);
-
- ListenTransFds[i] = fd;
- debug(4,(stderr, "Listening on FD %d\n", fd));
- UsingFD(fd, NewConnection, NULL, ListenTransConns[i]);
- }
- } else {
- panic("Could not open any listening connections");
- }
+ if (partial) {
+ debug(4, (stderr,
+ "Warning: Failed to establish listening connections on some transports\n"));
+ }
+ ListenTransFds = malloc(ListenTransCount * sizeof(int));
+ if (ListenTransFds == NULL)
+ panic("Can't allocate memory for ListenTransFds");
+
+ for (i = 0; i < ListenTransCount; i++) {
+ int fd = _X11TransGetConnectionNumber(ListenTransConns[i]);
+
+ ListenTransFds[i] = fd;
+ debug(4, (stderr, "Listening on FD %d\n", fd));
+ UsingFD(fd, NewConnection, NULL, ListenTransConns[i]);
+ }
+ }
+ else {
+ panic("Could not open any listening connections");
+ }
#else
- /* create the connection socket and set its parameters of use */
- ConnectionSocket = socket(AF_INET, SOCK_STREAM, 0);
- if (ConnectionSocket < 0)
- {
- perror("socket");
- exit(-1);
+ /* create the connection socket and set its parameters of use */
+ ConnectionSocket = socket(AF_INET, SOCK_STREAM, 0);
+ if (ConnectionSocket < 0) {
+ perror("socket");
+ exit(-1);
}
- (void)setsockopt(ConnectionSocket, SOL_SOCKET, SO_REUSEADDR, (char *)&one, sizeof (int));
+ (void) setsockopt(ConnectionSocket, SOL_SOCKET, SO_REUSEADDR, (char *) &one,
+ sizeof(int));
#ifdef SO_USELOOPBACK
- (void)setsockopt(ConnectionSocket, SOL_SOCKET, SO_USELOOPBACK, (char *)NULL, 0);
+ (void) setsockopt(ConnectionSocket, SOL_SOCKET, SO_USELOOPBACK,
+ (char *) NULL, 0);
#endif
#ifdef SO_DONTLINGER
- (void)setsockopt(ConnectionSocket, SOL_SOCKET, SO_DONTLINGER, (char *)NULL, 0);
-#else /* SO_DONTLINGER */
- linger.l_onoff = 0;
- linger.l_linger = 0;
- (void)setsockopt(ConnectionSocket, SOL_SOCKET, SO_LINGER, (char *)&linger, sizeof linger);
-#endif /* SO_DONTLINGER */
-
- /* define the name and port to be used with the connection socket */
- bzero((char *)&sin, sizeof(sin));
- sin.sin_family = AF_INET;
-
- /* the address of the socket is composed of two parts: the host machine and
- the port number. We need the host machine address for the current host
- */
- {
- /* define the host part of the address */
- struct hostent *hp = gethostbyname(MyHostName);
- if (hp == NULL)
- panic("No address for our host");
- bcopy((char *)hp->h_addr, (char*)&sin.sin_addr, hp->h_length);
- }
+ (void) setsockopt(ConnectionSocket, SOL_SOCKET, SO_DONTLINGER,
+ (char *) NULL, 0);
+#else /* SO_DONTLINGER */
+ linger.l_onoff = 0;
+ linger.l_linger = 0;
+ (void) setsockopt(ConnectionSocket, SOL_SOCKET, SO_LINGER, (char *) &linger,
+ sizeof linger);
+#endif /* SO_DONTLINGER */
+
+ /* define the name and port to be used with the connection socket */
+ bzero((char *) &sin, sizeof(sin));
+ sin.sin_family = AF_INET;
+
+ /* the address of the socket is composed of two parts: the host machine and
+ the port number. We need the host machine address for the current host
+ */
+ {
+ /* define the host part of the address */
+ struct hostent *hp = gethostbyname(MyHostName);
+
+ if (hp == NULL)
+ panic("No address for our host");
+ bcopy((char *) hp->h_addr, (char *) &sin.sin_addr, hp->h_length);
+ }
/* new code -- INADDR_ANY should be better than using the name of the
host machine. The host machine may have several different network
addresses. INADDR_ANY should work with all of them at once. */
- sin.sin_addr.s_addr = INADDR_ANY;
+ sin.sin_addr.s_addr = INADDR_ANY;
- port = iport;
- sin.sin_port = htons (port);
- ScopePort = port;
+ port = iport;
+ sin.sin_port = htons(port);
+ ScopePort = port;
- /* bind the name and port number to the connection socket */
- if (bind(ConnectionSocket, (struct sockaddr *)&sin, sizeof(sin)) < 0)
- {
- perror("bind");
- exit(-1);
+ /* bind the name and port number to the connection socket */
+ if (bind(ConnectionSocket, (struct sockaddr *) &sin, sizeof(sin)) < 0) {
+ perror("bind");
+ exit(-1);
}
- debug(4,(stderr, "Socket is FD %d for %s,%d\n",
- ConnectionSocket, ScopeHost, ScopePort));
+ debug(4, (stderr, "Socket is FD %d for %s,%d\n",
+ ConnectionSocket, ScopeHost, ScopePort));
- /* now activate the named connection socket to get messages */
- if (listen(ConnectionSocket, BACKLOG) < 0)
- {
- perror("listen");
- exit(-1);
+ /* now activate the named connection socket to get messages */
+ if (listen(ConnectionSocket, BACKLOG) < 0) {
+ perror("listen");
+ exit(-1);
};
- /* a few more parameter settings */
+ /* a few more parameter settings */
#ifdef FD_CLOEXEC
- (void)fcntl(ConnectionSocket, F_SETFD, FD_CLOEXEC);
+ (void) fcntl(ConnectionSocket, F_SETFD, FD_CLOEXEC);
#else
- (void)ioctl(ConnectionSocket, FIOCLEX, 0);
+ (void) ioctl(ConnectionSocket, FIOCLEX, 0);
#endif
- /* ultrix reads hang on Unix sockets, hpux reads fail */
+ /* ultrix reads hang on Unix sockets, hpux reads fail */
#if defined(O_NONBLOCK) && (!defined(ultrix) && !defined(hpux))
- (void) fcntl (ConnectionSocket, F_SETFL, O_NONBLOCK);
+ (void) fcntl(ConnectionSocket, F_SETFL, O_NONBLOCK);
#else
#ifdef FIOSNBIO
- (void) ioctl (ConnectionSocket, FIOSNBIO, &ON);
+ (void) ioctl(ConnectionSocket, FIOSNBIO, &ON);
#else
- (void) fcntl (ConnectionSocket, F_SETFL, FNDELAY);
+ (void) fcntl(ConnectionSocket, F_SETFL, FNDELAY);
#endif
#endif
- debug(4,(stderr, "Listening on FD %d\n", ConnectionSocket));
- UsingFD(ConnectionSocket, connectionFunc, NULL, NULL);
+ debug(4, (stderr, "Listening on FD %d\n", ConnectionSocket));
+ UsingFD(ConnectionSocket, connectionFunc, NULL, NULL);
#endif
}
-
diff --git a/decode11.c b/decode11.c
index f4d721c..89a4c48 100644
--- a/decode11.c
+++ b/decode11.c
@@ -1,8 +1,8 @@
-/* ************************************************************ *
- * *
- * Decoding and switching routines for the X11 protocol *
- * *
- * James Peterson, 1988 *
+/*
+ * Decoding and switching routines for the X11 protocol
+ *
+ * James Peterson, 1988
+ *
* Copyright (C) 1988 MCC
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -22,8 +22,9 @@
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
- * *
- * *
+ *
+ */
+/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -45,7 +46,7 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
- * ************************************************************ */
+ */
#include "scope.h"
#include "x11.h"
@@ -82,107 +83,100 @@
to be handled as a FIFO queue.
*/
-struct QueueEntry
-{
- struct QueueEntry *Next;
- long SequenceNumber;
- short Request;
- short RequestMinor;
+struct QueueEntry {
+ struct QueueEntry *Next;
+ long SequenceNumber;
+ short Request;
+ short RequestMinor;
};
/* free space list of Q entries */
-static struct QueueEntry *FreeQEntries = NULL;
+static struct QueueEntry *FreeQEntries = NULL;
/* ************************************************************ */
-static struct QueueEntry *
-NewQEntry (
- long SequenceNumber,
- short Request,
- short RequestMinor)
+static struct QueueEntry *
+NewQEntry(long SequenceNumber, short Request, short RequestMinor)
{
- struct QueueEntry *p;
-
- /* Get a Queue Entry */
- if (FreeQEntries == NULL)
- {
- /* create new queue entry */
- p = malloc (sizeof (*p));
- if (p == NULL)
- panic("unable to allocate new QueueEntry");
+ struct QueueEntry *p;
+
+ /* Get a Queue Entry */
+ if (FreeQEntries == NULL) {
+ /* create new queue entry */
+ p = malloc(sizeof(*p));
+ if (p == NULL)
+ panic("unable to allocate new QueueEntry");
}
- else
- {
- /* reuse an old queue entry */
- p = FreeQEntries;
- FreeQEntries = FreeQEntries->Next;
+ else {
+ /* reuse an old queue entry */
+ p = FreeQEntries;
+ FreeQEntries = FreeQEntries->Next;
}
- /* fill in its values */
- p->Next = NULL;
- p->SequenceNumber = SequenceNumber;
- p->Request = Request;
- p->RequestMinor = RequestMinor;
- return(p);
+ /* fill in its values */
+ p->Next = NULL;
+ p->SequenceNumber = SequenceNumber;
+ p->Request = Request;
+ p->RequestMinor = RequestMinor;
+ return (p);
}
+
/* ************************************************************ */
/* define a queue of entries for each FD */
-struct QueueHeader
-{
- struct QueueEntry *Head;
- struct QueueEntry *Tail;
+struct QueueHeader {
+ struct QueueEntry *Head;
+ struct QueueEntry *Tail;
};
-static struct QueueHeader *ReplyQ;
+static struct QueueHeader *ReplyQ;
/* ************************************************************ */
void
-InitReplyQ (void)
+InitReplyQ(void)
{
- ReplyQ = calloc(MaxFD, sizeof(struct QueueHeader));
- if (ReplyQ == NULL)
- panic("unable to allocate ReplyQ");
+ ReplyQ = calloc(MaxFD, sizeof(struct QueueHeader));
+ if (ReplyQ == NULL)
+ panic("unable to allocate ReplyQ");
}
void
-FlushReplyQ (
- FD fd)
+FlushReplyQ(FD fd)
{
- struct QueueEntry *p;
- struct QueueEntry *NextQEntry;
+ struct QueueEntry *p;
+ struct QueueEntry *NextQEntry;
- /* go down the reply queue and free all entries */
- for (p = ReplyQ[fd].Head; p != NULL; p = NextQEntry)
- {
- NextQEntry = p->Next;
-
- /* put freed entry on list of free entries (for later reuse) */
- p->Next = FreeQEntries;
- FreeQEntries = p;
+ /* go down the reply queue and free all entries */
+ for (p = ReplyQ[fd].Head; p != NULL; p = NextQEntry) {
+ NextQEntry = p->Next;
+
+ /* put freed entry on list of free entries (for later reuse) */
+ p->Next = FreeQEntries;
+ FreeQEntries = p;
}
-
- ReplyQ[fd].Head = NULL;
- ReplyQ[fd].Tail = NULL;
+
+ ReplyQ[fd].Head = NULL;
+ ReplyQ[fd].Tail = NULL;
}
static void
-DumpReplyQ (
- FD fd)
+DumpReplyQ(FD fd)
{
- fprintf(stderr, "ReplyQ[%d] = { Head 0x%lx; Tail 0x%lx }\n",
- fd, (unsigned long)ReplyQ[fd].Head, (unsigned long)ReplyQ[fd].Tail);
- {
- struct QueueEntry *p;
- for (p = ReplyQ[fd].Head; p != NULL; p = p->Next)
- fprintf(stderr,
- "0x%lx = { Next 0x%lx; SequenceNumber %ld; Request %d }\n",
- (unsigned long) p, (unsigned long) p->Next,
- (unsigned long) p->SequenceNumber, p->Request);
- }
+ fprintf(stderr, "ReplyQ[%d] = { Head 0x%lx; Tail 0x%lx }\n", fd,
+ (unsigned long) ReplyQ[fd].Head, (unsigned long) ReplyQ[fd].Tail);
+ {
+ struct QueueEntry *p;
+
+ for (p = ReplyQ[fd].Head; p != NULL; p = p->Next)
+ fprintf(stderr,
+ "0x%lx = { Next 0x%lx; SequenceNumber %ld; Request %d }\n",
+ (unsigned long) p, (unsigned long) p->Next,
+ (unsigned long) p->SequenceNumber, p->Request);
+ }
}
+
/* ************************************************************ */
/* */
/* */
@@ -192,36 +186,33 @@ DumpReplyQ (
with this one */
static void
-SequencedReplyExpected (
- FD fd,
- long SequenceNumber,
- short RequestType,
- short RequestMinorType)
+SequencedReplyExpected(FD fd, long SequenceNumber,
+ short RequestType, short RequestMinorType)
{
- struct QueueEntry *p;
-
- debug(8,(stderr,
- "Reply expected: sequence %ld and request type %d,%d for fd %d\n",
- SequenceNumber, RequestType, RequestMinorType, fd));
- /* create a new queue entry */
- p = NewQEntry(SequenceNumber, RequestType, RequestMinorType);
-
- /* find the server associated with this client */
- fd = FDPair(fd);
- if (fd < 0 || fd >= MaxFD) return;
-
- /* attach the new queue entry to the end of the queue for the Server */
- if (ReplyQ[fd].Tail != NULL)
- (ReplyQ[fd].Tail)->Next = p;
- else
- ReplyQ[fd].Head = p;
- ReplyQ[fd].Tail = p;
-
- debug(8,(stderr, "Save sequence %ld and request type %d,%d for fd %d\n",
- p->SequenceNumber, p->Request, p->RequestMinor, fd));
+ struct QueueEntry *p;
+
+ debug(8, (stderr,
+ "Reply expected: sequence %ld and request type %d,%d for fd %d\n",
+ SequenceNumber, RequestType, RequestMinorType, fd));
+ /* create a new queue entry */
+ p = NewQEntry(SequenceNumber, RequestType, RequestMinorType);
+
+ /* find the server associated with this client */
+ fd = FDPair(fd);
+ if (fd < 0 || fd >= MaxFD)
+ return;
+
+ /* attach the new queue entry to the end of the queue for the Server */
+ if (ReplyQ[fd].Tail != NULL)
+ (ReplyQ[fd].Tail)->Next = p;
+ else
+ ReplyQ[fd].Head = p;
+ ReplyQ[fd].Tail = p;
+
+ debug(8, (stderr, "Save sequence %ld and request type %d,%d for fd %d\n",
+ p->SequenceNumber, p->Request, p->RequestMinor, fd));
}
-
static FD Lastfd;
static long LastSequenceNumber;
static short LastReplyType;
@@ -231,51 +222,46 @@ static short LastReplyMinorType;
to the given sequence number for this fd */
short
-CheckReplyTable (
- FD fd,
- short SequenceNumber,
- short *minorp)
+CheckReplyTable(FD fd, short SequenceNumber, short *minorp)
{
- struct QueueEntry *p;
- struct QueueEntry *trailer;
-
- if (debuglevel & 128) DumpReplyQ(fd);
- for (trailer = NULL, p = ReplyQ[fd].Head;
- p != NULL;
- trailer = p, p = p->Next)
- {
- /* look for matching sequence number in queue of this fd */
- if (SequenceNumber == ((short)(0xFFFF & p->SequenceNumber)))
- {
- /* save the Request type */
- Lastfd = fd;
- LastSequenceNumber = p->SequenceNumber;
- LastReplyType = p->Request;
- LastReplyMinorType = p->RequestMinor;
-
- /* pull the queue entry out of the queue for this fd */
- if (trailer == NULL)
- ReplyQ[fd].Head = p->Next;
- else
- trailer->Next = p->Next;
- if (ReplyQ[fd].Tail == p) ReplyQ[fd].Tail = trailer;
-
-
- /* put freed entry on list of free entries (for later reuse) */
- p->Next = FreeQEntries;
- FreeQEntries = p;
-
- debug(8,(stderr, "Reply on fd %d for sequence %d is type %d,%x\n",
- fd, SequenceNumber, LastReplyType, LastReplyMinorType));
- *minorp = LastReplyMinorType;
- return(LastReplyType);
- }
+ struct QueueEntry *p;
+ struct QueueEntry *trailer;
+
+ if (debuglevel & 128)
+ DumpReplyQ(fd);
+ for (trailer = NULL, p = ReplyQ[fd].Head;
+ p != NULL; trailer = p, p = p->Next) {
+ /* look for matching sequence number in queue of this fd */
+ if (SequenceNumber == ((short) (0xFFFF & p->SequenceNumber))) {
+ /* save the Request type */
+ Lastfd = fd;
+ LastSequenceNumber = p->SequenceNumber;
+ LastReplyType = p->Request;
+ LastReplyMinorType = p->RequestMinor;
+
+ /* pull the queue entry out of the queue for this fd */
+ if (trailer == NULL)
+ ReplyQ[fd].Head = p->Next;
+ else
+ trailer->Next = p->Next;
+ if (ReplyQ[fd].Tail == p)
+ ReplyQ[fd].Tail = trailer;
+
+ /* put freed entry on list of free entries (for later reuse) */
+ p->Next = FreeQEntries;
+ FreeQEntries = p;
+
+ debug(8, (stderr, "Reply on fd %d for sequence %d is type %d,%x\n",
+ fd, SequenceNumber, LastReplyType, LastReplyMinorType));
+ *minorp = LastReplyMinorType;
+ return (LastReplyType);
+ }
}
- /* not expecting a reply for that sequence number */
- debug(8,(stderr, "Reply on fd %d for sequence %d is not found\n",
- fd, SequenceNumber));
- return(0);
+ /* not expecting a reply for that sequence number */
+ debug(8, (stderr, "Reply on fd %d for sequence %d is not found\n",
+ fd, SequenceNumber));
+ return (0);
}
@@ -284,31 +270,26 @@ CheckReplyTable (
sequence number associated with this fd */
void
-ReplyExpected (
- FD fd,
- short Request)
+ReplyExpected(FD fd, short Request)
{
- SequencedReplyExpected(fd, CS[fd].SequenceNumber, Request, 0);
+ SequencedReplyExpected(fd, CS[fd].SequenceNumber, Request, 0);
}
void
-ExtendedReplyExpected (
- FD fd,
- short Request,
- short RequestMinor)
+ExtendedReplyExpected(FD fd, short Request, short RequestMinor)
{
- SequencedReplyExpected(fd, CS[fd].SequenceNumber, Request, RequestMinor);
+ SequencedReplyExpected(fd, CS[fd].SequenceNumber, Request, RequestMinor);
}
/* ************************************************************ */
/* another reply is expected for the same reply as we just had */
/* This is only used with ListFontsWithInfo */
-void
-KeepLastReplyExpected (void)
+void
+KeepLastReplyExpected(void)
{
- SequencedReplyExpected(Lastfd, LastSequenceNumber, LastReplyType,
- LastReplyMinorType);
+ SequencedReplyExpected(Lastfd, LastSequenceNumber, LastReplyType,
+ LastReplyMinorType);
}
#define DUMP_REQUEST 0
@@ -316,7 +297,7 @@ KeepLastReplyExpected (void)
#define DUMP_EVENT 2
#define DUMP_ERROR 3
-static const char * const simple_names[] = {
+static const char *const simple_names[] = {
"REQUEST",
"REPLY ",
"EVENT ",
@@ -324,470 +305,463 @@ static const char * const simple_names[] = {
};
static void
-SimpleDump (int type, FD fd, short Major, short Minor, long bytes)
+SimpleDump(int type, FD fd, short Major, short Minor, long bytes)
{
- PrintTime ();
- fprintf (stdout, "@@%s %3d %3d %3d %7ld\n",
- simple_names[type],
- ClientNumber(fd),
- Major, Minor, bytes);
+ PrintTime();
+ fprintf(stdout, "@@%s %3d %3d %3d %7ld\n",
+ simple_names[type], ClientNumber(fd), Major, Minor, bytes);
}
-
+
/* ************************************************************ */
/* */
/* */
/* ************************************************************ */
void
-DecodeRequest (
- FD fd,
- const unsigned char *buf,
- long n)
+DecodeRequest(FD fd, const unsigned char *buf, long n)
{
- short Request = IByte (&buf[0]);
- short RequestMinor = Request >= 128 ? IByte (&buf[1]) : 0;
- unsigned long seq;
-
- CS[fd].SequenceNumber += 1;
- seq = CS[fd].SequenceNumber;
- if (CS[fd].littleEndian) {
- SBf[0] = seq;
- SBf[1] = seq >> 8;
- SBf[2] = seq >> 16;
- SBf[3] = seq >> 24;
- } else {
- SBf[0] = seq >> 24;
- SBf[1] = seq >> 16;
- SBf[2] = seq >> 8;
- SBf[3] = seq;
- }
- SetIndentLevel(PRINTCLIENT);
-
- /* Special handling of QueryExtension to save extension names */
- if (Request == 98)
- {
- ProcessQueryExtensionRequest(seq, buf);
- }
-
- if (Verbose < 0)
- {
- SimpleDump (DUMP_REQUEST, fd, Request, RequestMinor, n);
- return;
- }
-
- if (Raw || (Verbose > 3))
- DumpItem("Request", fd, buf, n);
-
- if (Request < 0 || 127 < Request)
- {
- ExtensionRequest(fd, buf, Request);
- }
- else switch (Request)
- {
- case 1:
- CreateWindow(fd, buf);
- break;
- case 2:
- ChangeWindowAttributes(fd, buf);
- break;
- case 3:
- GetWindowAttributes(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 4:
- DestroyWindow(fd, buf);
- break;
- case 5:
- DestroySubwindows(fd, buf);
- break;
- case 6:
- ChangeSaveSet(fd, buf);
- break;
- case 7:
- ReparentWindow(fd, buf);
- break;
- case 8:
- MapWindow(fd, buf);
- break;
- case 9:
- MapSubwindows(fd, buf);
- break;
- case 10:
- UnmapWindow(fd, buf);
- break;
- case 11:
- UnmapSubwindows(fd, buf);
- break;
- case 12:
- ConfigureWindow(fd, buf);
- break;
- case 13:
- CirculateWindow(fd, buf);
- break;
- case 14:
- GetGeometry(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 15:
- QueryTree(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 16:
- InternAtom(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 17:
- GetAtomName(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 18:
- ChangeProperty(fd, buf);
- break;
- case 19:
- DeleteProperty(fd, buf);
- break;
- case 20:
- GetProperty(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 21:
- ListProperties(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 22:
- SetSelectionOwner(fd, buf);
- break;
- case 23:
- GetSelectionOwner(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 24:
- ConvertSelection(fd, buf);
- break;
- case 25:
- SendEvent(fd, buf);
- break;
- case 26:
- GrabPointer(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 27:
- UngrabPointer(fd, buf);
- break;
- case 28:
- GrabButton(fd, buf);
- break;
- case 29:
- UngrabButton(fd, buf);
- break;
- case 30:
- ChangeActivePointerGrab(fd, buf);
- break;
- case 31:
- GrabKeyboard(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 32:
- UngrabKeyboard(fd, buf);
- break;
- case 33:
- GrabKey(fd, buf);
- break;
- case 34:
- UngrabKey(fd, buf);
- break;
- case 35:
- AllowEvents(fd, buf);
- break;
- case 36:
- GrabServer(fd, buf);
- break;
- case 37:
- UngrabServer(fd, buf);
- break;
- case 38:
- QueryPointer(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 39:
- GetMotionEvents(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 40:
- TranslateCoordinates(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 41:
- WarpPointer(fd, buf);
- break;
- case 42:
- SetInputFocus(fd, buf);
- break;
- case 43:
- GetInputFocus(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 44:
- QueryKeymap(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 45:
- OpenFont(fd, buf);
- break;
- case 46:
- CloseFont(fd, buf);
- break;
- case 47:
- QueryFont(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 48:
- QueryTextExtents(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 49:
- ListFonts(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 50:
- ListFontsWithInfo(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 51:
- SetFontPath(fd, buf);
- break;
- case 52:
- GetFontPath(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 53:
- CreatePixmap(fd, buf);
- break;
- case 54:
- FreePixmap(fd, buf);
- break;
- case 55:
- CreateGC(fd, buf);
- break;
- case 56:
- ChangeGC(fd, buf);
- break;
- case 57:
- CopyGC(fd, buf);
- break;
- case 58:
- SetDashes(fd, buf);
- break;
- case 59:
- SetClipRectangles(fd, buf);
- break;
- case 60:
- FreeGC(fd, buf);
- break;
- case 61:
- ClearArea(fd, buf);
- break;
- case 62:
- CopyArea(fd, buf);
- break;
- case 63:
- CopyPlane(fd, buf);
- break;
- case 64:
- PolyPoint(fd, buf);
- break;
- case 65:
- PolyLine(fd, buf);
- break;
- case 66:
- PolySegment(fd, buf);
- break;
- case 67:
- PolyRectangle(fd, buf);
- break;
- case 68:
- PolyArc(fd, buf);
- break;
- case 69:
- FillPoly(fd, buf);
- break;
- case 70:
- PolyFillRectangle(fd, buf);
- break;
- case 71:
- PolyFillArc(fd, buf);
- break;
- case 72:
- PutImage(fd, buf);
- break;
- case 73:
- GetImage(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 74:
- PolyText8(fd, buf);
- break;
- case 75:
- PolyText16(fd, buf);
- break;
- case 76:
- ImageText8(fd, buf);
- break;
- case 77:
- ImageText16(fd, buf);
- break;
- case 78:
- CreateColormap(fd, buf);
- break;
- case 79:
- FreeColormap(fd, buf);
- break;
- case 80:
- CopyColormapAndFree(fd, buf);
- break;
- case 81:
- InstallColormap(fd, buf);
- break;
- case 82:
- UninstallColormap(fd, buf);
- break;
- case 83:
- ListInstalledColormaps(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 84:
- AllocColor(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 85:
- AllocNamedColor(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 86:
- AllocColorCells(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 87:
- AllocColorPlanes(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 88:
- FreeColors(fd, buf);
- break;
- case 89:
- StoreColors(fd, buf);
- break;
- case 90:
- StoreNamedColor(fd, buf);
- break;
- case 91:
- QueryColors(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 92:
- LookupColor(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 93:
- CreateCursor(fd, buf);
- break;
- case 94:
- CreateGlyphCursor(fd, buf);
- break;
- case 95:
- FreeCursor(fd, buf);
- break;
- case 96:
- RecolorCursor(fd, buf);
- break;
- case 97:
- QueryBestSize(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 98:
- QueryExtension(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 99:
- ListExtensions(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 100:
- ChangeKeyboardMapping(fd, buf);
- break;
- case 101:
- GetKeyboardMapping(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 102:
- ChangeKeyboardControl(fd, buf);
- break;
- case 103:
- GetKeyboardControl(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 104:
- Bell(fd, buf);
- break;
- case 105:
- ChangePointerControl(fd, buf);
- break;
- case 106:
- GetPointerControl(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 107:
- SetScreenSaver(fd, buf);
- break;
- case 108:
- GetScreenSaver(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 109:
- ChangeHosts(fd, buf);
- break;
- case 110:
- ListHosts(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 111:
- SetAccessControl(fd, buf);
- break;
- case 112:
- SetCloseDownMode(fd, buf);
- break;
- case 113:
- KillClient(fd, buf);
- break;
- case 114:
- RotateProperties(fd, buf);
- break;
- case 115:
- ForceScreenSaver(fd, buf);
- break;
- case 116:
- SetPointerMapping(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 117:
- GetPointerMapping(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 118:
- SetModifierMapping(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 119:
- GetModifierMapping(fd, buf);
- ReplyExpected(fd, Request);
- break;
- case 127:
- NoOperation(fd, buf);
- break;
- default:
- warn("Unimplemented request opcode");
- break;
- }
+ short Request = IByte(&buf[0]);
+ short RequestMinor = Request >= 128 ? IByte(&buf[1]) : 0;
+ unsigned long seq;
+
+ CS[fd].SequenceNumber += 1;
+ seq = CS[fd].SequenceNumber;
+ if (CS[fd].littleEndian) {
+ SBf[0] = seq;
+ SBf[1] = seq >> 8;
+ SBf[2] = seq >> 16;
+ SBf[3] = seq >> 24;
+ }
+ else {
+ SBf[0] = seq >> 24;
+ SBf[1] = seq >> 16;
+ SBf[2] = seq >> 8;
+ SBf[3] = seq;
+ }
+ SetIndentLevel(PRINTCLIENT);
+
+ /* Special handling of QueryExtension to save extension names */
+ if (Request == 98) {
+ ProcessQueryExtensionRequest(seq, buf);
+ }
+
+ if (Verbose < 0) {
+ SimpleDump(DUMP_REQUEST, fd, Request, RequestMinor, n);
+ return;
+ }
+
+ if (Raw || (Verbose > 3))
+ DumpItem("Request", fd, buf, n);
+
+ if (Request < 0 || 127 < Request) {
+ ExtensionRequest(fd, buf, Request);
+ }
+ else
+ switch (Request) {
+ case 1:
+ CreateWindow(fd, buf);
+ break;
+ case 2:
+ ChangeWindowAttributes(fd, buf);
+ break;
+ case 3:
+ GetWindowAttributes(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 4:
+ DestroyWindow(fd, buf);
+ break;
+ case 5:
+ DestroySubwindows(fd, buf);
+ break;
+ case 6:
+ ChangeSaveSet(fd, buf);
+ break;
+ case 7:
+ ReparentWindow(fd, buf);
+ break;
+ case 8:
+ MapWindow(fd, buf);
+ break;
+ case 9:
+ MapSubwindows(fd, buf);
+ break;
+ case 10:
+ UnmapWindow(fd, buf);
+ break;
+ case 11:
+ UnmapSubwindows(fd, buf);
+ break;
+ case 12:
+ ConfigureWindow(fd, buf);
+ break;
+ case 13:
+ CirculateWindow(fd, buf);
+ break;
+ case 14:
+ GetGeometry(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 15:
+ QueryTree(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 16:
+ InternAtom(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 17:
+ GetAtomName(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 18:
+ ChangeProperty(fd, buf);
+ break;
+ case 19:
+ DeleteProperty(fd, buf);
+ break;
+ case 20:
+ GetProperty(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 21:
+ ListProperties(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 22:
+ SetSelectionOwner(fd, buf);
+ break;
+ case 23:
+ GetSelectionOwner(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 24:
+ ConvertSelection(fd, buf);
+ break;
+ case 25:
+ SendEvent(fd, buf);
+ break;
+ case 26:
+ GrabPointer(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 27:
+ UngrabPointer(fd, buf);
+ break;
+ case 28:
+ GrabButton(fd, buf);
+ break;
+ case 29:
+ UngrabButton(fd, buf);
+ break;
+ case 30:
+ ChangeActivePointerGrab(fd, buf);
+ break;
+ case 31:
+ GrabKeyboard(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 32:
+ UngrabKeyboard(fd, buf);
+ break;
+ case 33:
+ GrabKey(fd, buf);
+ break;
+ case 34:
+ UngrabKey(fd, buf);
+ break;
+ case 35:
+ AllowEvents(fd, buf);
+ break;
+ case 36:
+ GrabServer(fd, buf);
+ break;
+ case 37:
+ UngrabServer(fd, buf);
+ break;
+ case 38:
+ QueryPointer(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 39:
+ GetMotionEvents(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 40:
+ TranslateCoordinates(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 41:
+ WarpPointer(fd, buf);
+ break;
+ case 42:
+ SetInputFocus(fd, buf);
+ break;
+ case 43:
+ GetInputFocus(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 44:
+ QueryKeymap(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 45:
+ OpenFont(fd, buf);
+ break;
+ case 46:
+ CloseFont(fd, buf);
+ break;
+ case 47:
+ QueryFont(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 48:
+ QueryTextExtents(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 49:
+ ListFonts(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 50:
+ ListFontsWithInfo(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 51:
+ SetFontPath(fd, buf);
+ break;
+ case 52:
+ GetFontPath(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 53:
+ CreatePixmap(fd, buf);
+ break;
+ case 54:
+ FreePixmap(fd, buf);
+ break;
+ case 55:
+ CreateGC(fd, buf);
+ break;
+ case 56:
+ ChangeGC(fd, buf);
+ break;
+ case 57:
+ CopyGC(fd, buf);
+ break;
+ case 58:
+ SetDashes(fd, buf);
+ break;
+ case 59:
+ SetClipRectangles(fd, buf);
+ break;
+ case 60:
+ FreeGC(fd, buf);
+ break;
+ case 61:
+ ClearArea(fd, buf);
+ break;
+ case 62:
+ CopyArea(fd, buf);
+ break;
+ case 63:
+ CopyPlane(fd, buf);
+ break;
+ case 64:
+ PolyPoint(fd, buf);
+ break;
+ case 65:
+ PolyLine(fd, buf);
+ break;
+ case 66:
+ PolySegment(fd, buf);
+ break;
+ case 67:
+ PolyRectangle(fd, buf);
+ break;
+ case 68:
+ PolyArc(fd, buf);
+ break;
+ case 69:
+ FillPoly(fd, buf);
+ break;
+ case 70:
+ PolyFillRectangle(fd, buf);
+ break;
+ case 71:
+ PolyFillArc(fd, buf);
+ break;
+ case 72:
+ PutImage(fd, buf);
+ break;
+ case 73:
+ GetImage(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 74:
+ PolyText8(fd, buf);
+ break;
+ case 75:
+ PolyText16(fd, buf);
+ break;
+ case 76:
+ ImageText8(fd, buf);
+ break;
+ case 77:
+ ImageText16(fd, buf);
+ break;
+ case 78:
+ CreateColormap(fd, buf);
+ break;
+ case 79:
+ FreeColormap(fd, buf);
+ break;
+ case 80:
+ CopyColormapAndFree(fd, buf);
+ break;
+ case 81:
+ InstallColormap(fd, buf);
+ break;
+ case 82:
+ UninstallColormap(fd, buf);
+ break;
+ case 83:
+ ListInstalledColormaps(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 84:
+ AllocColor(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 85:
+ AllocNamedColor(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 86:
+ AllocColorCells(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 87:
+ AllocColorPlanes(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 88:
+ FreeColors(fd, buf);
+ break;
+ case 89:
+ StoreColors(fd, buf);
+ break;
+ case 90:
+ StoreNamedColor(fd, buf);
+ break;
+ case 91:
+ QueryColors(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 92:
+ LookupColor(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 93:
+ CreateCursor(fd, buf);
+ break;
+ case 94:
+ CreateGlyphCursor(fd, buf);
+ break;
+ case 95:
+ FreeCursor(fd, buf);
+ break;
+ case 96:
+ RecolorCursor(fd, buf);
+ break;
+ case 97:
+ QueryBestSize(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 98:
+ QueryExtension(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 99:
+ ListExtensions(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 100:
+ ChangeKeyboardMapping(fd, buf);
+ break;
+ case 101:
+ GetKeyboardMapping(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 102:
+ ChangeKeyboardControl(fd, buf);
+ break;
+ case 103:
+ GetKeyboardControl(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 104:
+ Bell(fd, buf);
+ break;
+ case 105:
+ ChangePointerControl(fd, buf);
+ break;
+ case 106:
+ GetPointerControl(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 107:
+ SetScreenSaver(fd, buf);
+ break;
+ case 108:
+ GetScreenSaver(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 109:
+ ChangeHosts(fd, buf);
+ break;
+ case 110:
+ ListHosts(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 111:
+ SetAccessControl(fd, buf);
+ break;
+ case 112:
+ SetCloseDownMode(fd, buf);
+ break;
+ case 113:
+ KillClient(fd, buf);
+ break;
+ case 114:
+ RotateProperties(fd, buf);
+ break;
+ case 115:
+ ForceScreenSaver(fd, buf);
+ break;
+ case 116:
+ SetPointerMapping(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 117:
+ GetPointerMapping(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 118:
+ SetModifierMapping(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 119:
+ GetModifierMapping(fd, buf);
+ ReplyExpected(fd, Request);
+ break;
+ case 127:
+ NoOperation(fd, buf);
+ break;
+ default:
+ warn("Unimplemented request opcode");
+ break;
+ }
}
/* ************************************************************ */
@@ -796,165 +770,159 @@ DecodeRequest (
/* ************************************************************ */
void
-DecodeReply (
- FD fd,
- const unsigned char *buf,
- long n)
+DecodeReply(FD fd, const unsigned char *buf, long n)
{
- short SequenceNumber = IShort (&buf[2]);
- short RequestMinor;
- short Request = CheckReplyTable (fd, SequenceNumber, &RequestMinor);
-
- /* Special handling of QueryExtension to save extension names */
- if (Request == 98)
- {
- ProcessQueryExtensionReply(SequenceNumber, buf);
- }
-
- if (Verbose < 0)
- {
- SimpleDump (DUMP_REPLY, fd, Request, RequestMinor, n);
- return;
- }
-
- SetIndentLevel(PRINTSERVER);
- RBf[0] = Request /* for the PrintField in the Reply procedure */ ;
- RBf[1] = RequestMinor;
- if (Raw || (Verbose > 3))
- DumpItem("Reply", fd, buf, n);
- if (Request < 0 || 127 < Request)
- {
- ExtensionReply(fd, buf, Request, RequestMinor);
- }
- else switch (Request)
- {
- case 0:
- UnknownReply(buf);
- break;
- case 3:
- GetWindowAttributesReply(buf);
- break;
- case 14:
- GetGeometryReply(buf);
- break;
- case 15:
- QueryTreeReply(buf);
- break;
- case 16:
- InternAtomReply(buf);
- break;
- case 17:
- GetAtomNameReply(buf);
- break;
- case 20:
- GetPropertyReply(buf);
- break;
- case 21:
- ListPropertiesReply(buf);
- break;
- case 23:
- GetSelectionOwnerReply(buf);
- break;
- case 26:
- GrabPointerReply(buf);
- break;
- case 31:
- GrabKeyboardReply(buf);
- break;
- case 38:
- QueryPointerReply(buf);
- break;
- case 39:
- GetMotionEventsReply(buf);
- break;
- case 40:
- TranslateCoordinatesReply(buf);
- break;
- case 43:
- GetInputFocusReply(buf);
- break;
- case 44:
- QueryKeymapReply(buf);
- break;
- case 47:
- QueryFontReply(buf);
- break;
- case 48:
- QueryTextExtentsReply(buf);
- break;
- case 49:
- ListFontsReply(buf);
- break;
- case 50:
- ListFontsWithInfoReply(buf);
- break;
- case 52:
- GetFontPathReply(buf);
- break;
- case 73:
- GetImageReply(buf);
- break;
- case 83:
- ListInstalledColormapsReply(buf);
- break;
- case 84:
- AllocColorReply(buf);
- break;
- case 85:
- AllocNamedColorReply(buf);
- break;
- case 86:
- AllocColorCellsReply(buf);
- break;
- case 87:
- AllocColorPlanesReply(buf);
- break;
- case 91:
- QueryColorsReply(buf);
- break;
- case 92:
- LookupColorReply(buf);
- break;
- case 97:
- QueryBestSizeReply(buf);
- break;
- case 98:
- QueryExtensionReply(buf);
- break;
- case 99:
- ListExtensionsReply(buf);
- break;
- case 101:
- GetKeyboardMappingReply(buf);
- break;
- case 103:
- GetKeyboardControlReply(buf);
- break;
- case 106:
- GetPointerControlReply(buf);
- break;
- case 108:
- GetScreenSaverReply(buf);
- break;
- case 110:
- ListHostsReply(buf);
- break;
- case 116:
- SetPointerMappingReply(buf);
- break;
- case 117:
- GetPointerMappingReply(buf);
- break;
- case 118:
- SetModifierMappingReply(buf);
- break;
- case 119:
- GetModifierMappingReply(buf);
- break;
- default:
- warn("Unimplemented reply opcode");
- break;
+ short SequenceNumber = IShort(&buf[2]);
+ short RequestMinor;
+ short Request = CheckReplyTable(fd, SequenceNumber, &RequestMinor);
+
+ /* Special handling of QueryExtension to save extension names */
+ if (Request == 98) {
+ ProcessQueryExtensionReply(SequenceNumber, buf);
}
+
+ if (Verbose < 0) {
+ SimpleDump(DUMP_REPLY, fd, Request, RequestMinor, n);
+ return;
+ }
+
+ SetIndentLevel(PRINTSERVER);
+ RBf[0] = Request; /* for the PrintField in the Reply procedure */
+ RBf[1] = RequestMinor;
+ if (Raw || (Verbose > 3))
+ DumpItem("Reply", fd, buf, n);
+ if (Request < 0 || 127 < Request) {
+ ExtensionReply(fd, buf, Request, RequestMinor);
+ }
+ else
+ switch (Request) {
+ case 0:
+ UnknownReply(buf);
+ break;
+ case 3:
+ GetWindowAttributesReply(buf);
+ break;
+ case 14:
+ GetGeometryReply(buf);
+ break;
+ case 15:
+ QueryTreeReply(buf);
+ break;
+ case 16:
+ InternAtomReply(buf);
+ break;
+ case 17:
+ GetAtomNameReply(buf);
+ break;
+ case 20:
+ GetPropertyReply(buf);
+ break;
+ case 21:
+ ListPropertiesReply(buf);
+ break;
+ case 23:
+ GetSelectionOwnerReply(buf);
+ break;
+ case 26:
+ GrabPointerReply(buf);
+ break;
+ case 31:
+ GrabKeyboardReply(buf);
+ break;
+ case 38:
+ QueryPointerReply(buf);
+ break;
+ case 39:
+ GetMotionEventsReply(buf);
+ break;
+ case 40:
+ TranslateCoordinatesReply(buf);
+ break;
+ case 43:
+ GetInputFocusReply(buf);
+ break;
+ case 44:
+ QueryKeymapReply(buf);
+ break;
+ case 47:
+ QueryFontReply(buf);
+ break;
+ case 48:
+ QueryTextExtentsReply(buf);
+ break;
+ case 49:
+ ListFontsReply(buf);
+ break;
+ case 50:
+ ListFontsWithInfoReply(buf);
+ break;
+ case 52:
+ GetFontPathReply(buf);
+ break;
+ case 73:
+ GetImageReply(buf);
+ break;
+ case 83:
+ ListInstalledColormapsReply(buf);
+ break;
+ case 84:
+ AllocColorReply(buf);
+ break;
+ case 85:
+ AllocNamedColorReply(buf);
+ break;
+ case 86:
+ AllocColorCellsReply(buf);
+ break;
+ case 87:
+ AllocColorPlanesReply(buf);
+ break;
+ case 91:
+ QueryColorsReply(buf);
+ break;
+ case 92:
+ LookupColorReply(buf);
+ break;
+ case 97:
+ QueryBestSizeReply(buf);
+ break;
+ case 98:
+ QueryExtensionReply(buf);
+ break;
+ case 99:
+ ListExtensionsReply(buf);
+ break;
+ case 101:
+ GetKeyboardMappingReply(buf);
+ break;
+ case 103:
+ GetKeyboardControlReply(buf);
+ break;
+ case 106:
+ GetPointerControlReply(buf);
+ break;
+ case 108:
+ GetScreenSaverReply(buf);
+ break;
+ case 110:
+ ListHostsReply(buf);
+ break;
+ case 116:
+ SetPointerMappingReply(buf);
+ break;
+ case 117:
+ GetPointerMappingReply(buf);
+ break;
+ case 118:
+ SetModifierMappingReply(buf);
+ break;
+ case 119:
+ GetModifierMappingReply(buf);
+ break;
+ default:
+ warn("Unimplemented reply opcode");
+ break;
+ }
}
/* ************************************************************ */
@@ -963,89 +931,84 @@ DecodeReply (
/* ************************************************************ */
void
-DecodeError (
- FD fd,
- const unsigned char *buf,
- long n)
+DecodeError(FD fd, const unsigned char *buf, long n)
{
- short Error = IByte (&buf[1]);
- short Request = 0;
- short RequestMinor = 0;
+ short Error = IByte(&buf[1]);
+ short Request = 0;
+ short RequestMinor = 0;
- Request = CheckReplyTable (fd, (short)IShort(&buf[2]), &RequestMinor);
+ Request = CheckReplyTable(fd, (short) IShort(&buf[2]), &RequestMinor);
- if (Verbose < 0)
- {
- SimpleDump (DUMP_ERROR, fd, Request, RequestMinor, n);
- return;
+ if (Verbose < 0) {
+ SimpleDump(DUMP_ERROR, fd, Request, RequestMinor, n);
+ return;
}
SetIndentLevel(PRINTSERVER);
if (Raw || (Verbose > 3))
- DumpItem("Error", fd, buf, n);
+ DumpItem("Error", fd, buf, n);
- if (Error < 1 || Error > 17)
- {
- ExtensionError(fd, buf, Error);
- }
- else switch (Error)
- {
- case 1:
- RequestError(buf);
- break;
- case 2:
- ValueError(buf);
- break;
- case 3:
- WindowError(buf);
- break;
- case 4:
- PixmapError(buf);
- break;
- case 5:
- AtomError(buf);
- break;
- case 6:
- CursorError(buf);
- break;
- case 7:
- FontError(buf);
- break;
- case 8:
- MatchError(buf);
- break;
- case 9:
- DrawableError(buf);
- break;
- case 10:
- AccessError(buf);
- break;
- case 11:
- AllocError(buf);
- break;
- case 12:
- ColormapError(buf);
- break;
- case 13:
- GContextError(buf);
- break;
- case 14:
- IDChoiceError(buf);
- break;
- case 15:
- NameError(buf);
- break;
- case 16:
- LengthError(buf);
- break;
- case 17:
- ImplementationError(buf);
- break;
- default:
- warn("Unimplemented error code");
- UnknownError(buf);
- break;
+ if (Error < 1 || Error > 17) {
+ ExtensionError(fd, buf, Error);
}
+ else
+ switch (Error) {
+ case 1:
+ RequestError(buf);
+ break;
+ case 2:
+ ValueError(buf);
+ break;
+ case 3:
+ WindowError(buf);
+ break;
+ case 4:
+ PixmapError(buf);
+ break;
+ case 5:
+ AtomError(buf);
+ break;
+ case 6:
+ CursorError(buf);
+ break;
+ case 7:
+ FontError(buf);
+ break;
+ case 8:
+ MatchError(buf);
+ break;
+ case 9:
+ DrawableError(buf);
+ break;
+ case 10:
+ AccessError(buf);
+ break;
+ case 11:
+ AllocError(buf);
+ break;
+ case 12:
+ ColormapError(buf);
+ break;
+ case 13:
+ GContextError(buf);
+ break;
+ case 14:
+ IDChoiceError(buf);
+ break;
+ case 15:
+ NameError(buf);
+ break;
+ case 16:
+ LengthError(buf);
+ break;
+ case 17:
+ ImplementationError(buf);
+ break;
+ default:
+ warn("Unimplemented error code");
+ UnknownError(buf);
+ break;
+ }
}
/* ************************************************************ */
@@ -1054,138 +1017,132 @@ DecodeError (
/* ************************************************************ */
void
-DecodeEvent (
- FD fd,
- const unsigned char *buf,
- long n)
+DecodeEvent(FD fd, const unsigned char *buf, long n)
{
- short Event = IByte (&buf[0]);
- short EventMinor = Event == LBXEvent ? IByte (&buf[1]) : 0;
+ short Event = IByte(&buf[0]);
+ short EventMinor = Event == LBXEvent ? IByte(&buf[1]) : 0;
- if (Verbose < 0)
- {
- SimpleDump (DUMP_EVENT, fd, Event, EventMinor, n);
- return;
+ if (Verbose < 0) {
+ SimpleDump(DUMP_EVENT, fd, Event, EventMinor, n);
+ return;
}
SetIndentLevel(PRINTSERVER);
if (Raw || (Verbose > 3))
- DumpItem("Event", fd, buf, n);
+ DumpItem("Event", fd, buf, n);
/* high-order bit means SendEvent generated */
- if (Event & 0x80)
- {
- debug(8,(stderr, "SendEvent generated event 0x%x\n", Event));
- Event = Event & 0x7F;
+ if (Event & 0x80) {
+ debug(8, (stderr, "SendEvent generated event 0x%x\n", Event));
+ Event = Event & 0x7F;
}
- if (Event < 2 || Event > 34)
- {
- ExtensionEvent(fd, buf, Event);
- }
- else switch (Event)
- {
- case 2:
- KeyPressEvent(buf);
- break;
- case 3:
- KeyReleaseEvent(buf);
- break;
- case 4:
- ButtonPressEvent(buf);
- break;
- case 5:
- ButtonReleaseEvent(buf);
- break;
- case 6:
- MotionNotifyEvent(buf);
- break;
- case 7:
- EnterNotifyEvent(buf);
- break;
- case 8:
- LeaveNotifyEvent(buf);
- break;
- case 9:
- FocusInEvent(buf);
- break;
- case 10:
- FocusOutEvent(buf);
- break;
- case 11:
- KeymapNotifyEvent(buf);
- break;
- case 12:
- ExposeEvent(buf);
- break;
- case 13:
- GraphicsExposureEvent(buf);
- break;
- case 14:
- NoExposureEvent(buf);
- break;
- case 15:
- VisibilityNotifyEvent(buf);
- break;
- case 16:
- CreateNotifyEvent(buf);
- break;
- case 17:
- DestroyNotifyEvent(buf);
- break;
- case 18:
- UnmapNotifyEvent(buf);
- break;
- case 19:
- MapNotifyEvent(buf);
- break;
- case 20:
- MapRequestEvent(buf);
- break;
- case 21:
- ReparentNotifyEvent(buf);
- break;
- case 22:
- ConfigureNotifyEvent(buf);
- break;
- case 23:
- ConfigureRequestEvent(buf);
- break;
- case 24:
- GravityNotifyEvent(buf);
- break;
- case 25:
- ResizeRequestEvent(buf);
- break;
- case 26:
- CirculateNotifyEvent(buf);
- break;
- case 27:
- CirculateRequestEvent(buf);
- break;
- case 28:
- PropertyNotifyEvent(buf);
- break;
- case 29:
- SelectionClearEvent(buf);
- break;
- case 30:
- SelectionRequestEvent(buf);
- break;
- case 31:
- SelectionNotifyEvent(buf);
- break;
- case 32:
- ColormapNotifyEvent(buf);
- break;
- case 33:
- ClientMessageEvent(buf);
- break;
- case 34:
- MappingNotifyEvent(buf);
- break;
- default:
- warn("Unimplemented event code");
- UnknownEvent(buf);
- break;
+ if (Event < 2 || Event > 34) {
+ ExtensionEvent(fd, buf, Event);
}
+ else
+ switch (Event) {
+ case 2:
+ KeyPressEvent(buf);
+ break;
+ case 3:
+ KeyReleaseEvent(buf);
+ break;
+ case 4:
+ ButtonPressEvent(buf);
+ break;
+ case 5:
+ ButtonReleaseEvent(buf);
+ break;
+ case 6:
+ MotionNotifyEvent(buf);
+ break;
+ case 7:
+ EnterNotifyEvent(buf);
+ break;
+ case 8:
+ LeaveNotifyEvent(buf);
+ break;
+ case 9:
+ FocusInEvent(buf);
+ break;
+ case 10:
+ FocusOutEvent(buf);
+ break;
+ case 11:
+ KeymapNotifyEvent(buf);
+ break;
+ case 12:
+ ExposeEvent(buf);
+ break;
+ case 13:
+ GraphicsExposureEvent(buf);
+ break;
+ case 14:
+ NoExposureEvent(buf);
+ break;
+ case 15:
+ VisibilityNotifyEvent(buf);
+ break;
+ case 16:
+ CreateNotifyEvent(buf);
+ break;
+ case 17:
+ DestroyNotifyEvent(buf);
+ break;
+ case 18:
+ UnmapNotifyEvent(buf);
+ break;
+ case 19:
+ MapNotifyEvent(buf);
+ break;
+ case 20:
+ MapRequestEvent(buf);
+ break;
+ case 21:
+ ReparentNotifyEvent(buf);
+ break;
+ case 22:
+ ConfigureNotifyEvent(buf);
+ break;
+ case 23:
+ ConfigureRequestEvent(buf);
+ break;
+ case 24:
+ GravityNotifyEvent(buf);
+ break;
+ case 25:
+ ResizeRequestEvent(buf);
+ break;
+ case 26:
+ CirculateNotifyEvent(buf);
+ break;
+ case 27:
+ CirculateRequestEvent(buf);
+ break;
+ case 28:
+ PropertyNotifyEvent(buf);
+ break;
+ case 29:
+ SelectionClearEvent(buf);
+ break;
+ case 30:
+ SelectionRequestEvent(buf);
+ break;
+ case 31:
+ SelectionNotifyEvent(buf);
+ break;
+ case 32:
+ ColormapNotifyEvent(buf);
+ break;
+ case 33:
+ ClientMessageEvent(buf);
+ break;
+ case 34:
+ MappingNotifyEvent(buf);
+ break;
+ default:
+ warn("Unimplemented event code");
+ UnknownEvent(buf);
+ break;
+ }
}
diff --git a/decode_bigreq.c b/decode_bigreq.c
index 242f16c..18f727c 100644
--- a/decode_bigreq.c
+++ b/decode_bigreq.c
@@ -21,7 +21,6 @@
* DEALINGS IN THE SOFTWARE.
*/
-
#include <stdio.h>
#include <X11/X.h>
#include <X11/Xproto.h>
@@ -33,51 +32,50 @@
static unsigned char BIGREQRequest;
static void
-bigreq_decode_req (
- FD fd,
- const unsigned char *buf)
+bigreq_decode_req(FD fd, const unsigned char *buf)
{
- short Major = IByte (&buf[0]);
- short Minor = IByte (&buf[1]);
+ short Major = IByte(&buf[0]);
+ short Minor = IByte(&buf[1]);
- switch (Minor) {
- case 0:
- CS[fd].bigreqEnabled = 1;
- BigreqEnable (fd, buf);
- ExtendedReplyExpected (fd, Major, Minor); break;
- default:
- break;
- }
+ switch (Minor) {
+ case 0:
+ CS[fd].bigreqEnabled = 1;
+ BigreqEnable(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ default:
+ break;
+ }
}
static void
-bigreq_decode_reply (
- FD fd,
- const unsigned char *buf,
- short RequestMinor)
+bigreq_decode_reply(FD fd, const unsigned char *buf, short RequestMinor)
{
switch (RequestMinor) {
- case 0: BigreqEnableReply (fd, buf); break;
+ case 0:
+ BigreqEnableReply(fd, buf);
+ break;
}
}
void
-InitializeBIGREQ(
- const unsigned char *buf)
+InitializeBIGREQ(const unsigned char *buf)
{
- TYPE p;
+ TYPE p;
- BIGREQRequest = (unsigned char)(buf[9]);
+ BIGREQRequest = (unsigned char) (buf[9]);
- DefineEValue (&TD[REQUEST], (unsigned long) BIGREQRequest, "BigreqRequest");
- DefineEValue (&TD[REPLY], (unsigned long) BIGREQRequest, "BigreqReply");
+ DefineEValue(&TD[REQUEST], (unsigned long) BIGREQRequest, "BigreqRequest");
+ DefineEValue(&TD[REPLY], (unsigned long) BIGREQRequest, "BigreqReply");
- p = DefineType(BIGREQREQUEST, ENUMERATED, "BIGREQREQUEST", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "BigreqEnable");
+ p = DefineType(BIGREQREQUEST, ENUMERATED, "BIGREQREQUEST",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "BigreqEnable");
- p = DefineType(BIGREQREPLY, ENUMERATED, "BIGREQREPLY", (PrintProcType) PrintENUMERATED);
- DefineEValue (p, 0L, "BigreqEnable");
+ p = DefineType(BIGREQREPLY, ENUMERATED, "BIGREQREPLY",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "BigreqEnable");
- InitializeExtensionDecoder(BIGREQRequest, bigreq_decode_req,
- bigreq_decode_reply);
+ InitializeExtensionDecoder(BIGREQRequest, bigreq_decode_req,
+ bigreq_decode_reply);
}
diff --git a/decode_glx.c b/decode_glx.c
index 1d33fa5..b0a732c 100644
--- a/decode_glx.c
+++ b/decode_glx.c
@@ -36,204 +36,326 @@
#include "extensions.h"
static unsigned char GLXRequest, GLXError, GLXEvent;
-#define GLXNError 13
+#define GLXNError 13
static void
-glx_decode_req (
- FD fd,
- const unsigned char *buf)
+glx_decode_req(FD fd, const unsigned char *buf)
{
- short Major = IByte (&buf[0]);
- short Minor = IByte (&buf[1]);
-
- switch (Minor) {
- case 1: GLXRender (fd, buf); break;
- case 2: GLXRenderLarge (fd, buf); break;
- case 3: GLXCreateContext (fd, buf); break;
- case 4: GLXDestroyContext (fd, buf); break;
- case 5: GLXMakeCurrent (fd, buf); ExtendedReplyExpected (fd, Major, Minor); break;
- case 6: GLXIsDirect (fd, buf); ExtendedReplyExpected (fd, Major, Minor); break;
- case 7: GLXQueryVersion (fd, buf); ExtendedReplyExpected (fd, Major, Minor); break;
- case 8: GLXWaitGL (fd, buf); break;
- case 9: GLXWaitX (fd, buf); break;
- case 10: GLXCopyContext (fd, buf); break;
- case 11: GLXSwapBuffers (fd, buf); break;
- case 12: GLXUseXFont (fd, buf); break;
- case 13: GLXCreateGLXPixmap (fd, buf); break;
- case 14: GLXGetVisualConfigs (fd, buf); ExtendedReplyExpected (fd, Major, Minor); break;
- case 15: GLXDestroyGLXPixmap (fd, buf); break;
- case 16: GLXVendorPrivate (fd, buf); break;
- case 17: GLXVendorPrivateWithReply (fd, buf); ExtendedReplyExpected (fd, Major, Minor); break;
- case 18: GLXQueryExtensionsString (fd, buf); ExtendedReplyExpected (fd, Major, Minor); break;
- case 19: GLXQueryServerString (fd, buf); ExtendedReplyExpected (fd, Major, Minor); break;
- case 20: GLXClientInfo (fd, buf); break;
- case 21: GLXGetFBConfigs (fd, buf); ExtendedReplyExpected (fd, Major, Minor); break;
- case 22: GLXCreatePixmap (fd, buf); break;
- case 23: GLXDestroyPixmap (fd, buf); break;
- case 24: GLXCreateNewContext (fd, buf); break;
- case 25: GLXQueryContext (fd, buf); ExtendedReplyExpected (fd, Major, Minor); break;
- case 26: GLXMakeContextCurrent (fd, buf); ExtendedReplyExpected (fd, Major, Minor); break;
- case 27: GLXCreatePbuffer (fd, buf); break;
- case 28: GLXDestroyPbuffer (fd, buf); break;
- case 29: GLXGetDrawableAttributes (fd, buf); ExtendedReplyExpected (fd, Major, Minor); break;
- case 30: GLXChangeDrawableAttributes (fd, buf); break;
- case 31: GLXCreateWindow (fd, buf); break;
- case 32: GLXDestroyWindow (fd, buf); break;
- default:
- ExtendedRequest(fd, buf);
- ExtendedReplyExpected(fd, Major, Minor);
- break;
- }
+ short Major = IByte(&buf[0]);
+ short Minor = IByte(&buf[1]);
+
+ switch (Minor) {
+ case 1:
+ GLXRender(fd, buf);
+ break;
+ case 2:
+ GLXRenderLarge(fd, buf);
+ break;
+ case 3:
+ GLXCreateContext(fd, buf);
+ break;
+ case 4:
+ GLXDestroyContext(fd, buf);
+ break;
+ case 5:
+ GLXMakeCurrent(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 6:
+ GLXIsDirect(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 7:
+ GLXQueryVersion(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 8:
+ GLXWaitGL(fd, buf);
+ break;
+ case 9:
+ GLXWaitX(fd, buf);
+ break;
+ case 10:
+ GLXCopyContext(fd, buf);
+ break;
+ case 11:
+ GLXSwapBuffers(fd, buf);
+ break;
+ case 12:
+ GLXUseXFont(fd, buf);
+ break;
+ case 13:
+ GLXCreateGLXPixmap(fd, buf);
+ break;
+ case 14:
+ GLXGetVisualConfigs(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 15:
+ GLXDestroyGLXPixmap(fd, buf);
+ break;
+ case 16:
+ GLXVendorPrivate(fd, buf);
+ break;
+ case 17:
+ GLXVendorPrivateWithReply(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 18:
+ GLXQueryExtensionsString(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 19:
+ GLXQueryServerString(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 20:
+ GLXClientInfo(fd, buf);
+ break;
+ case 21:
+ GLXGetFBConfigs(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 22:
+ GLXCreatePixmap(fd, buf);
+ break;
+ case 23:
+ GLXDestroyPixmap(fd, buf);
+ break;
+ case 24:
+ GLXCreateNewContext(fd, buf);
+ break;
+ case 25:
+ GLXQueryContext(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 26:
+ GLXMakeContextCurrent(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 27:
+ GLXCreatePbuffer(fd, buf);
+ break;
+ case 28:
+ GLXDestroyPbuffer(fd, buf);
+ break;
+ case 29:
+ GLXGetDrawableAttributes(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 30:
+ GLXChangeDrawableAttributes(fd, buf);
+ break;
+ case 31:
+ GLXCreateWindow(fd, buf);
+ break;
+ case 32:
+ GLXDestroyWindow(fd, buf);
+ break;
+ default:
+ ExtendedRequest(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ }
}
static void
-glx_decode_reply (
- FD fd,
- const unsigned char *buf,
- short RequestMinor)
+glx_decode_reply(FD fd, const unsigned char *buf, short RequestMinor)
{
switch (RequestMinor) {
- case 5: GLXMakeCurrentReply (fd, buf); break;
- case 6: GLXIsDirectReply (fd, buf); break;
- case 7: GLXQueryVersionReply (fd, buf); break;
- case 14: GLXGetVisualConfigsReply (fd, buf); break;
- case 17: GLXVendorPrivateWithReplyReply (fd, buf); break;
- case 18: GLXQueryExtensionsStringReply (fd, buf); break;
- case 19: GLXQueryServerStringReply (fd, buf); break;
- case 21: GLXGetFBConfigsReply (fd, buf); break;
- case 25: GLXQueryContextReply (fd, buf); break;
- case 26: GLXMakeContextCurrentReply (fd, buf); break;
- case 29: GLXGetDrawableAttributesReply (fd, buf); break;
- default: UnknownReply(buf); break;
+ case 5:
+ GLXMakeCurrentReply(fd, buf);
+ break;
+ case 6:
+ GLXIsDirectReply(fd, buf);
+ break;
+ case 7:
+ GLXQueryVersionReply(fd, buf);
+ break;
+ case 14:
+ GLXGetVisualConfigsReply(fd, buf);
+ break;
+ case 17:
+ GLXVendorPrivateWithReplyReply(fd, buf);
+ break;
+ case 18:
+ GLXQueryExtensionsStringReply(fd, buf);
+ break;
+ case 19:
+ GLXQueryServerStringReply(fd, buf);
+ break;
+ case 21:
+ GLXGetFBConfigsReply(fd, buf);
+ break;
+ case 25:
+ GLXQueryContextReply(fd, buf);
+ break;
+ case 26:
+ GLXMakeContextCurrentReply(fd, buf);
+ break;
+ case 29:
+ GLXGetDrawableAttributesReply(fd, buf);
+ break;
+ default:
+ UnknownReply(buf);
+ break;
}
}
static void
-glx_decode_error (
- FD fd,
- const unsigned char *buf)
+glx_decode_error(FD fd, const unsigned char *buf)
{
short error = IByte(&buf[1]) - GLXError;
-
+
switch (error) {
- case 0: GLXBadContextError (fd, buf); break;
- case 1: GLXBadContextStateError (fd, buf); break;
- case 2: GLXBadDrawableError (fd, buf); break;
- case 3: GLXBadPixmapError (fd, buf); break;
- case 4: GLXBadContextTagError (fd, buf); break;
- case 5: GLXBadCurrentWindowError (fd, buf); break;
- case 6: GLXBadRenderRequestError (fd, buf); break;
- case 7: GLXBadLargeRequestError (fd, buf); break;
- case 8: GLXUnsupportedPrivateRequestError (fd, buf); break;
- case 9: GLXBadFBConfigError (fd, buf); break;
- case 10: GLXBadPbufferError (fd, buf); break;
- case 11: GLXBadCurrentDrawableError (fd, buf); break;
- case 12: GLXBadWindowError (fd, buf); break;
+ case 0:
+ GLXBadContextError(fd, buf);
+ break;
+ case 1:
+ GLXBadContextStateError(fd, buf);
+ break;
+ case 2:
+ GLXBadDrawableError(fd, buf);
+ break;
+ case 3:
+ GLXBadPixmapError(fd, buf);
+ break;
+ case 4:
+ GLXBadContextTagError(fd, buf);
+ break;
+ case 5:
+ GLXBadCurrentWindowError(fd, buf);
+ break;
+ case 6:
+ GLXBadRenderRequestError(fd, buf);
+ break;
+ case 7:
+ GLXBadLargeRequestError(fd, buf);
+ break;
+ case 8:
+ GLXUnsupportedPrivateRequestError(fd, buf);
+ break;
+ case 9:
+ GLXBadFBConfigError(fd, buf);
+ break;
+ case 10:
+ GLXBadPbufferError(fd, buf);
+ break;
+ case 11:
+ GLXBadCurrentDrawableError(fd, buf);
+ break;
+ case 12:
+ GLXBadWindowError(fd, buf);
+ break;
default:
- break;
+ break;
}
}
static void
-glx_decode_event (
- FD fd,
- const unsigned char *buf)
+glx_decode_event(FD fd, const unsigned char *buf)
{
- short event = IByte(&buf[0]) - GLXEvent;
+ short event = IByte(&buf[0]) - GLXEvent;
- switch (event) {
- break;
- }
+ switch (event) {
+ break;
+ }
}
void
-InitializeGLX (const unsigned char *buf)
+InitializeGLX(const unsigned char *buf)
{
- TYPE p;
- int errcode;
-
- GLXRequest = (unsigned char)(buf[9]);
- GLXEvent = (unsigned char)(buf[10]);
- GLXError = (unsigned char)(buf[11]);
-
- DefineEValue (&TD[REQUEST], (unsigned long) GLXRequest, "GlxRequest");
- DefineEValue (&TD[REPLY], (unsigned long) GLXRequest, "GlxReply");
-
- DefineEValue (&TD[EVENT], (unsigned long) GLXEvent, "GlxEvent");
-
- DefineEValue (&TD[ERROR], (unsigned long) GLXError + 0, "GLXBadContext");
- DefineEValue (&TD[ERROR], (unsigned long) GLXError + 1, "GLXBadContextState");
- DefineEValue (&TD[ERROR], (unsigned long) GLXError + 2, "GLXBadDrawable");
- DefineEValue (&TD[ERROR], (unsigned long) GLXError + 3, "GLXBadPixmap");
- DefineEValue (&TD[ERROR], (unsigned long) GLXError + 4, "GLXBadContextTag");
- DefineEValue (&TD[ERROR], (unsigned long) GLXError + 5, "GLXBadCurrentWindow");
- DefineEValue (&TD[ERROR], (unsigned long) GLXError + 6, "GLXBadRenderRequest");
- DefineEValue (&TD[ERROR], (unsigned long) GLXError + 7, "GLXBadLargeRequest");
- DefineEValue (&TD[ERROR], (unsigned long) GLXError + 8, "GLXUnsupportedPrivateRequest");
- DefineEValue (&TD[ERROR], (unsigned long) GLXError + 9, "GLXBadFBConfig");
- DefineEValue (&TD[ERROR], (unsigned long) GLXError + 10, "GLXBadPbuffer");
- DefineEValue (&TD[ERROR], (unsigned long) GLXError + 11, "GLXBadCurrentDrawable");
- DefineEValue (&TD[ERROR], (unsigned long) GLXError + 12, "GLXBadWindow");
-
-
- p = DefineType(GLXREQUEST, ENUMERATED, "GLXREQUEST", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 1L, "GLXRender");
- DefineEValue(p, 2L, "GLXRenderLarge");
- DefineEValue(p, 3L, "GLXCreateContext");
- DefineEValue(p, 4L, "GLXDestroyContext");
- DefineEValue(p, 5L, "GLXMakeCurrent");
- DefineEValue(p, 6L, "GLXIsDirect");
- DefineEValue(p, 7L, "GLXQueryVersion");
- DefineEValue(p, 8L, "GLXWaitGL");
- DefineEValue(p, 9L, "GLXWaitX");
- DefineEValue(p, 10L, "GLXCopyContext");
- DefineEValue(p, 11L, "GLXSwapBuffers");
- DefineEValue(p, 12L, "GLXUseXFont");
- DefineEValue(p, 13L, "GLXCreateGLXPixmap");
- DefineEValue(p, 14L, "GLXGetVisualConfigs");
- DefineEValue(p, 15L, "GLXDestroyGLXPixmap");
- DefineEValue(p, 16L, "GLXVendorPrivate");
- DefineEValue(p, 17L, "GLXVendorPrivateWithReply");
- DefineEValue(p, 18L, "GLXQueryExtensionsString");
- DefineEValue(p, 19L, "GLXQueryServerString");
- DefineEValue(p, 20L, "GLXClientInfo");
- DefineEValue(p, 21L, "GLXGetFBConfigs");
- DefineEValue(p, 22L, "GLXCreatePixmap");
- DefineEValue(p, 23L, "GLXDestroyPixmap");
- DefineEValue(p, 24L, "GLXCreateNewContext");
- DefineEValue(p, 25L, "GLXQueryContext");
- DefineEValue(p, 26L, "GLXMakeContextCurrent");
- DefineEValue(p, 27L, "GLXCreatePbuffer");
- DefineEValue(p, 28L, "GLXDestroyPbuffer");
- DefineEValue(p, 29L, "GLXGetDrawableAttributes");
- DefineEValue(p, 30L, "GLXChangeDrawableAttributes");
- DefineEValue(p, 31L, "GLXCreateWindow");
- DefineEValue(p, 32L, "GLXDestroyWindow");
-
- p = DefineType(GLXREPLY, ENUMERATED, "GLXREPLY", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 17L, "GLXVendorPrivateWithReply");
- DefineEValue(p, 5L, "GLXMakeCurrentReply");
- DefineEValue(p, 6L, "GLXIsDirectReply");
- DefineEValue(p, 7L, "GLXQueryVersionReply");
- DefineEValue(p, 14L, "GLXGetVisualConfigsReply");
- DefineEValue(p, 17L, "GLXVendorPrivateWithReplyReply");
- DefineEValue(p, 18L, "GLXQueryExtensionsStringReply");
- DefineEValue(p, 19L, "GLXQueryServerStringReply");
- DefineEValue(p, 21L, "GLXGetFBConfigsReply");
- DefineEValue(p, 25L, "GLXQueryContextReply");
- DefineEValue(p, 26L, "GLXMakeContextCurrentReply");
- DefineEValue(p, 29L, "GLXGetDrawableAttributesReply");
-
- p = DefineType(GLXEVENT, ENUMERATED, "GLXEVENT", (PrintProcType) PrintENUMERATED);
- DefineEValue (p, 0L, "PbufferClobberEvent");
- DefineEValue (p, 1L, "BufferSwapComplete");
-
- InitializeExtensionDecoder(GLXRequest, glx_decode_req,
- glx_decode_reply);
- InitializeExtensionEventDecoder(GLXEvent, glx_decode_event);
- for (errcode = GLXError; errcode < (GLXError + GLXNError) ;
- errcode ++) {
- InitializeExtensionErrorDecoder(errcode, glx_decode_error);
- }
+ TYPE p;
+ int errcode;
+
+ GLXRequest = (unsigned char) (buf[9]);
+ GLXEvent = (unsigned char) (buf[10]);
+ GLXError = (unsigned char) (buf[11]);
+
+ DefineEValue(&TD[REQUEST], (unsigned long) GLXRequest, "GlxRequest");
+ DefineEValue(&TD[REPLY], (unsigned long) GLXRequest, "GlxReply");
+
+ DefineEValue(&TD[EVENT], (unsigned long) GLXEvent, "GlxEvent");
+
+ DefineEValue(&TD[ERROR], (unsigned long) GLXError + 0, "GLXBadContext");
+ DefineEValue(&TD[ERROR], (unsigned long) GLXError + 1,
+ "GLXBadContextState");
+ DefineEValue(&TD[ERROR], (unsigned long) GLXError + 2, "GLXBadDrawable");
+ DefineEValue(&TD[ERROR], (unsigned long) GLXError + 3, "GLXBadPixmap");
+ DefineEValue(&TD[ERROR], (unsigned long) GLXError + 4, "GLXBadContextTag");
+ DefineEValue(&TD[ERROR], (unsigned long) GLXError + 5,
+ "GLXBadCurrentWindow");
+ DefineEValue(&TD[ERROR], (unsigned long) GLXError + 6,
+ "GLXBadRenderRequest");
+ DefineEValue(&TD[ERROR], (unsigned long) GLXError + 7,
+ "GLXBadLargeRequest");
+ DefineEValue(&TD[ERROR], (unsigned long) GLXError + 8,
+ "GLXUnsupportedPrivateRequest");
+ DefineEValue(&TD[ERROR], (unsigned long) GLXError + 9, "GLXBadFBConfig");
+ DefineEValue(&TD[ERROR], (unsigned long) GLXError + 10, "GLXBadPbuffer");
+ DefineEValue(&TD[ERROR], (unsigned long) GLXError + 11,
+ "GLXBadCurrentDrawable");
+ DefineEValue(&TD[ERROR], (unsigned long) GLXError + 12, "GLXBadWindow");
+
+ p = DefineType(GLXREQUEST, ENUMERATED, "GLXREQUEST",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 1L, "GLXRender");
+ DefineEValue(p, 2L, "GLXRenderLarge");
+ DefineEValue(p, 3L, "GLXCreateContext");
+ DefineEValue(p, 4L, "GLXDestroyContext");
+ DefineEValue(p, 5L, "GLXMakeCurrent");
+ DefineEValue(p, 6L, "GLXIsDirect");
+ DefineEValue(p, 7L, "GLXQueryVersion");
+ DefineEValue(p, 8L, "GLXWaitGL");
+ DefineEValue(p, 9L, "GLXWaitX");
+ DefineEValue(p, 10L, "GLXCopyContext");
+ DefineEValue(p, 11L, "GLXSwapBuffers");
+ DefineEValue(p, 12L, "GLXUseXFont");
+ DefineEValue(p, 13L, "GLXCreateGLXPixmap");
+ DefineEValue(p, 14L, "GLXGetVisualConfigs");
+ DefineEValue(p, 15L, "GLXDestroyGLXPixmap");
+ DefineEValue(p, 16L, "GLXVendorPrivate");
+ DefineEValue(p, 17L, "GLXVendorPrivateWithReply");
+ DefineEValue(p, 18L, "GLXQueryExtensionsString");
+ DefineEValue(p, 19L, "GLXQueryServerString");
+ DefineEValue(p, 20L, "GLXClientInfo");
+ DefineEValue(p, 21L, "GLXGetFBConfigs");
+ DefineEValue(p, 22L, "GLXCreatePixmap");
+ DefineEValue(p, 23L, "GLXDestroyPixmap");
+ DefineEValue(p, 24L, "GLXCreateNewContext");
+ DefineEValue(p, 25L, "GLXQueryContext");
+ DefineEValue(p, 26L, "GLXMakeContextCurrent");
+ DefineEValue(p, 27L, "GLXCreatePbuffer");
+ DefineEValue(p, 28L, "GLXDestroyPbuffer");
+ DefineEValue(p, 29L, "GLXGetDrawableAttributes");
+ DefineEValue(p, 30L, "GLXChangeDrawableAttributes");
+ DefineEValue(p, 31L, "GLXCreateWindow");
+ DefineEValue(p, 32L, "GLXDestroyWindow");
+
+ p = DefineType(GLXREPLY, ENUMERATED, "GLXREPLY",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 17L, "GLXVendorPrivateWithReply");
+ DefineEValue(p, 5L, "GLXMakeCurrentReply");
+ DefineEValue(p, 6L, "GLXIsDirectReply");
+ DefineEValue(p, 7L, "GLXQueryVersionReply");
+ DefineEValue(p, 14L, "GLXGetVisualConfigsReply");
+ DefineEValue(p, 17L, "GLXVendorPrivateWithReplyReply");
+ DefineEValue(p, 18L, "GLXQueryExtensionsStringReply");
+ DefineEValue(p, 19L, "GLXQueryServerStringReply");
+ DefineEValue(p, 21L, "GLXGetFBConfigsReply");
+ DefineEValue(p, 25L, "GLXQueryContextReply");
+ DefineEValue(p, 26L, "GLXMakeContextCurrentReply");
+ DefineEValue(p, 29L, "GLXGetDrawableAttributesReply");
+
+ p = DefineType(GLXEVENT, ENUMERATED, "GLXEVENT",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "PbufferClobberEvent");
+ DefineEValue(p, 1L, "BufferSwapComplete");
+
+ InitializeExtensionDecoder(GLXRequest, glx_decode_req, glx_decode_reply);
+ InitializeExtensionEventDecoder(GLXEvent, glx_decode_event);
+ for (errcode = GLXError; errcode < (GLXError + GLXNError); errcode++) {
+ InitializeExtensionErrorDecoder(errcode, glx_decode_error);
+ }
}
diff --git a/decode_lbx.c b/decode_lbx.c
index 5be6483..259aa47 100644
--- a/decode_lbx.c
+++ b/decode_lbx.c
@@ -15,7 +15,7 @@
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NCD.
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Author: Keith Packard, Network Computing Devices
@@ -31,125 +31,118 @@
#include "extensions.h"
static unsigned char LBXRequest, LBXError;
-unsigned char LBXEvent; /* exported for DecodeEvent in decode11.c */
+unsigned char LBXEvent; /* exported for DecodeEvent in decode11.c */
static void
-lbx_decode_req (
- FD fd,
- const unsigned char *buf)
+lbx_decode_req(FD fd, const unsigned char *buf)
{
- short Major = IByte (&buf[0]);
- short Minor = IByte (&buf[1]);
-
- switch (Minor) {
- case 0:
- LbxQueryVersion (fd, buf);
- ExtendedReplyExpected (fd, Major, Minor);
- break;
- case 1:
- LbxStartProxy (fd, buf);
- break;
- case 2:
- LbxStopProxy (fd, buf);
- break;
- case 3:
- LbxSwitch (fd, buf);
- break;
- case 4:
- LbxNewClient(fd, buf);
- break;
- case 5:
- LbxCloseClient (fd, buf);
- break;
- case 6:
- LbxModifySequence (fd, buf);
- break;
- default:
- break;
- }
+ short Major = IByte(&buf[0]);
+ short Minor = IByte(&buf[1]);
+
+ switch (Minor) {
+ case 0:
+ LbxQueryVersion(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 1:
+ LbxStartProxy(fd, buf);
+ break;
+ case 2:
+ LbxStopProxy(fd, buf);
+ break;
+ case 3:
+ LbxSwitch(fd, buf);
+ break;
+ case 4:
+ LbxNewClient(fd, buf);
+ break;
+ case 5:
+ LbxCloseClient(fd, buf);
+ break;
+ case 6:
+ LbxModifySequence(fd, buf);
+ break;
+ default:
+ break;
+ }
}
static void
-lbx_decode_reply (
- FD fd,
- const unsigned char *buf,
- short RequestMinor)
+lbx_decode_reply(FD fd, const unsigned char *buf, short RequestMinor)
{
switch (RequestMinor) {
case 0:
- LbxQueryVersionReply (fd, buf);
- break;
+ LbxQueryVersionReply(fd, buf);
+ break;
default:
- break;
+ break;
}
}
static void
-lbx_decode_error (
- FD fd,
- const unsigned char *buf)
+lbx_decode_error(FD fd, const unsigned char *buf)
{
short error = IByte(&buf[1]) - LBXError;
-
+
switch (error) {
case 0:
- break;
+ break;
default:
- break;
+ break;
}
}
static void
-lbx_decode_event (
- FD fd,
- const unsigned char *buf)
+lbx_decode_event(FD fd, const unsigned char *buf)
{
- short event = IByte(&buf[0]) - LBXEvent;
-
- switch (event) {
- case 0:
- LbxSwitchEvent (fd, buf);
- break;
- case 1:
- LbxCloseEvent (fd, buf);
- break;
- default:
- break;
- }
+ short event = IByte(&buf[0]) - LBXEvent;
+
+ switch (event) {
+ case 0:
+ LbxSwitchEvent(fd, buf);
+ break;
+ case 1:
+ LbxCloseEvent(fd, buf);
+ break;
+ default:
+ break;
+ }
}
void
-InitializeLBX (
- const unsigned char *buf)
+InitializeLBX(const unsigned char *buf)
{
- TYPE p;
-
- LBXRequest = (unsigned char)(buf[9]);
- LBXEvent = (unsigned char)(buf[10]);
- LBXError = (unsigned char)(buf[11]);
-
- DefineEValue (&TD[REQUEST], (unsigned long) LBXRequest, "LbxRequest");
- DefineEValue (&TD[REPLY], (unsigned long) LBXRequest, "LbxReply");
- DefineEValue (&TD[EVENT], (unsigned long) LBXEvent, "LbxEvent");
- DefineEValue (&TD[ERROR], (unsigned long) LBXError, "LbxError");
-
- p = DefineType(LBXREQUEST, ENUMERATED, "LBXREQUEST", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "QueryVersion");
- DefineEValue(p, 1L, "StartProxy");
- DefineEValue(p, 2L, "StopProxy");
- DefineEValue(p, 3L, "Switch");
- DefineEValue(p, 4L, "NewClient");
- DefineEValue(p, 5L, "CloseClient");
- DefineEValue(p, 6L, "ModifySequence");
-
- p = DefineType(LBXREPLY, ENUMERATED, "LBXREPLY", (PrintProcType) PrintENUMERATED);
- DefineEValue (p, 0L, "QueryVersion");
-
- p = DefineType(LBXEVENT, ENUMERATED, "LBXEVENT", (PrintProcType) PrintENUMERATED);
- DefineEValue (p, 0L, "SwitchEvent");
- DefineEValue (p, 1L, "CloseEvent");
-
- InitializeExtensionDecoder(LBXRequest, lbx_decode_req, lbx_decode_reply);
- InitializeExtensionErrorDecoder(LBXError, lbx_decode_error);
- InitializeExtensionEventDecoder(LBXEvent, lbx_decode_event);
+ TYPE p;
+
+ LBXRequest = (unsigned char) (buf[9]);
+ LBXEvent = (unsigned char) (buf[10]);
+ LBXError = (unsigned char) (buf[11]);
+
+ DefineEValue(&TD[REQUEST], (unsigned long) LBXRequest, "LbxRequest");
+ DefineEValue(&TD[REPLY], (unsigned long) LBXRequest, "LbxReply");
+ DefineEValue(&TD[EVENT], (unsigned long) LBXEvent, "LbxEvent");
+ DefineEValue(&TD[ERROR], (unsigned long) LBXError, "LbxError");
+
+ p = DefineType(LBXREQUEST, ENUMERATED, "LBXREQUEST",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "QueryVersion");
+ DefineEValue(p, 1L, "StartProxy");
+ DefineEValue(p, 2L, "StopProxy");
+ DefineEValue(p, 3L, "Switch");
+ DefineEValue(p, 4L, "NewClient");
+ DefineEValue(p, 5L, "CloseClient");
+ DefineEValue(p, 6L, "ModifySequence");
+
+ p = DefineType(LBXREPLY, ENUMERATED, "LBXREPLY",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "QueryVersion");
+
+ p = DefineType(LBXEVENT, ENUMERATED, "LBXEVENT",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "SwitchEvent");
+ DefineEValue(p, 1L, "CloseEvent");
+
+ InitializeExtensionDecoder(LBXRequest, lbx_decode_req, lbx_decode_reply);
+ InitializeExtensionErrorDecoder(LBXError, lbx_decode_error);
+ InitializeExtensionEventDecoder(LBXEvent, lbx_decode_event);
}
diff --git a/decode_randr.c b/decode_randr.c
index 33940ad..7bba005 100644
--- a/decode_randr.c
+++ b/decode_randr.c
@@ -34,76 +34,89 @@
static unsigned char RANDRRequest, RANDRError, RANDREvent;
static void
-randr_decode_req (
- FD fd,
- const unsigned char *buf)
+randr_decode_req(FD fd, const unsigned char *buf)
{
- short Major = IByte (&buf[0]);
- short Minor = IByte (&buf[1]);
+ short Major = IByte(&buf[0]);
+ short Minor = IByte(&buf[1]);
- switch (Minor) {
- case 0: RandrQueryVersion (fd, buf); ExtendedReplyExpected (fd, Major, Minor); break;
- case 1: RandrGetScreenInfo (fd, buf); ExtendedReplyExpected (fd, Major, Minor); break;
- case 2: RandrSetScreenConfig (fd, buf); ExtendedReplyExpected (fd, Major, Minor); break;
- case 3: RandrScreenChangeSelectInput (fd, buf);
- default:
- ExtendedRequest(fd, buf);
- ExtendedReplyExpected(fd, Major, Minor);
- break;
- }
+ switch (Minor) {
+ case 0:
+ RandrQueryVersion(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 1:
+ RandrGetScreenInfo(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 2:
+ RandrSetScreenConfig(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 3:
+ RandrScreenChangeSelectInput(fd, buf);
+ default:
+ ExtendedRequest(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ }
}
static void
-randr_decode_reply (
- FD fd,
- const unsigned char *buf,
- short RequestMinor)
+randr_decode_reply(FD fd, const unsigned char *buf, short RequestMinor)
{
switch (RequestMinor) {
- case 0: RandrQueryVersionReply (fd, buf); break;
- case 1: RandrGetScreenInfoReply (fd, buf); break;
- case 2: RandrSetScreenConfigReply (fd, buf); break;
- default: UnknownReply(buf); break;
+ case 0:
+ RandrQueryVersionReply(fd, buf);
+ break;
+ case 1:
+ RandrGetScreenInfoReply(fd, buf);
+ break;
+ case 2:
+ RandrSetScreenConfigReply(fd, buf);
+ break;
+ default:
+ UnknownReply(buf);
+ break;
}
}
static void
-randr_decode_event (
- FD fd,
- const unsigned char *buf)
+randr_decode_event(FD fd, const unsigned char *buf)
{
- RandrScreenChangeNotifyEvent (buf);
+ RandrScreenChangeNotifyEvent(buf);
}
void
-InitializeRANDR (
- const unsigned char *buf)
+InitializeRANDR(const unsigned char *buf)
{
- TYPE p;
+ TYPE p;
- RANDRRequest = (unsigned char)(buf[9]);
- RANDREvent = (unsigned char)(buf[10]);
- RANDRError = (unsigned char)(buf[11]);
+ RANDRRequest = (unsigned char) (buf[9]);
+ RANDREvent = (unsigned char) (buf[10]);
+ RANDRError = (unsigned char) (buf[11]);
- DefineEValue (&TD[REQUEST], (unsigned long) RANDRRequest, "RandrRequest");
- DefineEValue (&TD[REPLY], (unsigned long) RANDRRequest, "RandrReply");
- DefineEValue (&TD[EVENT], (unsigned long) RANDREvent, "RRScreenChangeNotify");
+ DefineEValue(&TD[REQUEST], (unsigned long) RANDRRequest, "RandrRequest");
+ DefineEValue(&TD[REPLY], (unsigned long) RANDRRequest, "RandrReply");
+ DefineEValue(&TD[EVENT], (unsigned long) RANDREvent,
+ "RRScreenChangeNotify");
- p = DefineType(RANDRREQUEST, ENUMERATED, "RANDRREQUEST", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "RandrQueryVersion");
- DefineEValue(p, 1L, "RandrGetScreenInfo");
- DefineEValue(p, 2L, "RandrSetScreenConfig");
- DefineEValue(p, 3L, "RandrScreenChangeSelectInput");
+ p = DefineType(RANDRREQUEST, ENUMERATED, "RANDRREQUEST",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "RandrQueryVersion");
+ DefineEValue(p, 1L, "RandrGetScreenInfo");
+ DefineEValue(p, 2L, "RandrSetScreenConfig");
+ DefineEValue(p, 3L, "RandrScreenChangeSelectInput");
- p = DefineType(RANDRREPLY, ENUMERATED, "RANDRREPLY", (PrintProcType) PrintENUMERATED);
- DefineEValue (p, 0L, "QueryVersion");
- DefineEValue (p, 1L, "GetScreenInfo");
- DefineEValue (p, 2L, "SetScreenConfig");
+ p = DefineType(RANDRREPLY, ENUMERATED, "RANDRREPLY",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "QueryVersion");
+ DefineEValue(p, 1L, "GetScreenInfo");
+ DefineEValue(p, 2L, "SetScreenConfig");
- InitializeExtensionDecoder(RANDRRequest, randr_decode_req,
- randr_decode_reply);
- /* Not yet implemented:
- InitializeExtensionErrorDecoder(RANDRError, randr_decode_error); */
- InitializeExtensionEventDecoder(RANDREvent, randr_decode_event);
+ InitializeExtensionDecoder(RANDRRequest, randr_decode_req,
+ randr_decode_reply);
+ /* Not yet implemented:
+ InitializeExtensionErrorDecoder(RANDRError, randr_decode_error); */
+ InitializeExtensionEventDecoder(RANDREvent, randr_decode_event);
}
diff --git a/decode_render.c b/decode_render.c
index cafbf73..5f62d39 100644
--- a/decode_render.c
+++ b/decode_render.c
@@ -22,8 +22,6 @@
* DEALINGS IN THE SOFTWARE.
*/
-
-
#include <stdio.h>
#include <X11/X.h>
#include <X11/Xproto.h>
@@ -34,419 +32,521 @@
#include "extensions.h"
static unsigned char RENDERRequest, RENDERError;
-#define RENDERNError 5
+#define RENDERNError 5
static void
-render_decode_req (
- FD fd,
- const unsigned char *buf)
+render_decode_req(FD fd, const unsigned char *buf)
{
- short Major = IByte (&buf[0]);
- short Minor = IByte (&buf[1]);
-
- switch (Minor) {
- case 0: RenderQueryVersion (fd, buf); ExtendedReplyExpected (fd, Major, Minor); break;
- case 1: RenderQueryPictFormats (fd, buf); ExtendedReplyExpected (fd, Major, Minor); break;
- case 2: RenderQueryPictIndexValues (fd, buf); ExtendedReplyExpected (fd, Major, Minor); break;
- case 3: RenderQueryDithers (fd, buf); ExtendedReplyExpected (fd, Major, Minor); break;
- case 4: RenderCreatePicture (fd, buf); break;
- case 5: RenderChangePicture (fd, buf); break;
- case 6: RenderSetPictureClipRectangles (fd, buf); break;
- case 7: RenderFreePicture (fd, buf); break;
- case 8: RenderComposite (fd, buf); break;
- case 9: RenderScale (fd, buf); break;
- case 10: RenderTrapezoids (fd, buf); break;
- case 11: RenderTriangles (fd, buf); break;
- case 12: RenderTriStrip (fd, buf); break;
- case 13: RenderTriFan (fd, buf); break;
- case 14: RenderColorTrapezoids (fd, buf); break;
- case 15: RenderColorTriangles (fd, buf); break;
- case 16: RenderTransform (fd, buf); break;
- case 17: RenderCreateGlyphSet (fd, buf); break;
- case 18: RenderReferenceGlyphSet (fd, buf); break;
- case 19: RenderFreeGlyphSet (fd, buf); break;
- case 20: RenderAddGlyphs (fd, buf); break;
- case 21: RenderAddGlyphsFromPicture (fd, buf); break;
- case 22: RenderFreeGlyphs (fd, buf); break;
- case 23: RenderCompositeGlyphs8 (fd, buf); break;
- case 24: RenderCompositeGlyphs16 (fd, buf); break;
- case 25: RenderCompositeGlyphs32 (fd, buf); break;
- case 26: RenderFillRectangles (fd, buf); break;
- case 27: RenderCreateCursor (fd, buf); break;
- case 28: RenderSetPictureTransform (fd, buf); break;
- case 29: RenderQueryFilters (fd, buf); ExtendedReplyExpected (fd, Major, Minor); break;
- case 30: RenderSetPictureFilter (fd, buf); break;
- case 31: RenderCreateAnimCursor (fd, buf); break;
- case 32: RenderAddTraps (fd, buf); break;
- case 33: RenderCreateSolidFill (fd, buf); break;
- case 34: RenderCreateLinearGradient (fd, buf); break;
- case 35: RenderCreateRadialGradient (fd, buf); break;
- case 36: RenderCreateConicalGradient (fd, buf); break;
- default:
- ExtendedRequest(fd, buf);
- ExtendedReplyExpected(fd, Major, Minor);
- break;
- }
+ short Major = IByte(&buf[0]);
+ short Minor = IByte(&buf[1]);
+
+ switch (Minor) {
+ case 0:
+ RenderQueryVersion(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 1:
+ RenderQueryPictFormats(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 2:
+ RenderQueryPictIndexValues(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 3:
+ RenderQueryDithers(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 4:
+ RenderCreatePicture(fd, buf);
+ break;
+ case 5:
+ RenderChangePicture(fd, buf);
+ break;
+ case 6:
+ RenderSetPictureClipRectangles(fd, buf);
+ break;
+ case 7:
+ RenderFreePicture(fd, buf);
+ break;
+ case 8:
+ RenderComposite(fd, buf);
+ break;
+ case 9:
+ RenderScale(fd, buf);
+ break;
+ case 10:
+ RenderTrapezoids(fd, buf);
+ break;
+ case 11:
+ RenderTriangles(fd, buf);
+ break;
+ case 12:
+ RenderTriStrip(fd, buf);
+ break;
+ case 13:
+ RenderTriFan(fd, buf);
+ break;
+ case 14:
+ RenderColorTrapezoids(fd, buf);
+ break;
+ case 15:
+ RenderColorTriangles(fd, buf);
+ break;
+ case 16:
+ RenderTransform(fd, buf);
+ break;
+ case 17:
+ RenderCreateGlyphSet(fd, buf);
+ break;
+ case 18:
+ RenderReferenceGlyphSet(fd, buf);
+ break;
+ case 19:
+ RenderFreeGlyphSet(fd, buf);
+ break;
+ case 20:
+ RenderAddGlyphs(fd, buf);
+ break;
+ case 21:
+ RenderAddGlyphsFromPicture(fd, buf);
+ break;
+ case 22:
+ RenderFreeGlyphs(fd, buf);
+ break;
+ case 23:
+ RenderCompositeGlyphs8(fd, buf);
+ break;
+ case 24:
+ RenderCompositeGlyphs16(fd, buf);
+ break;
+ case 25:
+ RenderCompositeGlyphs32(fd, buf);
+ break;
+ case 26:
+ RenderFillRectangles(fd, buf);
+ break;
+ case 27:
+ RenderCreateCursor(fd, buf);
+ break;
+ case 28:
+ RenderSetPictureTransform(fd, buf);
+ break;
+ case 29:
+ RenderQueryFilters(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 30:
+ RenderSetPictureFilter(fd, buf);
+ break;
+ case 31:
+ RenderCreateAnimCursor(fd, buf);
+ break;
+ case 32:
+ RenderAddTraps(fd, buf);
+ break;
+ case 33:
+ RenderCreateSolidFill(fd, buf);
+ break;
+ case 34:
+ RenderCreateLinearGradient(fd, buf);
+ break;
+ case 35:
+ RenderCreateRadialGradient(fd, buf);
+ break;
+ case 36:
+ RenderCreateConicalGradient(fd, buf);
+ break;
+ default:
+ ExtendedRequest(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ }
}
static void
-render_decode_reply (
- FD fd,
- const unsigned char *buf,
- short RequestMinor)
+render_decode_reply(FD fd, const unsigned char *buf, short RequestMinor)
{
switch (RequestMinor) {
- case 0: RenderQueryVersionReply (fd, buf); break;
- case 1: RenderQueryPictFormatsReply (fd, buf); break;
- case 2: RenderQueryPictIndexValuesReply (fd, buf); break;
- case 3: RenderQueryDithersReply (fd, buf); break;
- case 29: RenderQueryFiltersReply (fd, buf); break;
- default: UnknownReply(buf); break;
+ case 0:
+ RenderQueryVersionReply(fd, buf);
+ break;
+ case 1:
+ RenderQueryPictFormatsReply(fd, buf);
+ break;
+ case 2:
+ RenderQueryPictIndexValuesReply(fd, buf);
+ break;
+ case 3:
+ RenderQueryDithersReply(fd, buf);
+ break;
+ case 29:
+ RenderQueryFiltersReply(fd, buf);
+ break;
+ default:
+ UnknownReply(buf);
+ break;
}
}
static void
-render_decode_error (
- FD fd,
- const unsigned char *buf)
+render_decode_error(FD fd, const unsigned char *buf)
{
short error = IByte(&buf[1]) - RENDERError;
-
+
switch (error) {
- case 0: RenderPictFormatError (fd, buf); break;
- case 1: RenderPictureError (fd, buf); break;
- case 2: RenderPictOpError (fd, buf); break;
- case 3: RenderGlyphSetError (fd, buf); break;
- case 4: RenderGlyphError (fd, buf); break;
+ case 0:
+ RenderPictFormatError(fd, buf);
+ break;
+ case 1:
+ RenderPictureError(fd, buf);
+ break;
+ case 2:
+ RenderPictOpError(fd, buf);
+ break;
+ case 3:
+ RenderGlyphSetError(fd, buf);
+ break;
+ case 4:
+ RenderGlyphError(fd, buf);
+ break;
default:
- break;
+ break;
}
}
static int
-PrintPICTURE (
- const unsigned char *buf)
+PrintPICTURE(const unsigned char *buf)
{
/* print a WINDOW -- CARD32 plus 0 = None */
- long n = ILong (buf);
+ long n = ILong(buf);
+
if (n == 0)
- fprintf(stdout, "None");
+ fprintf(stdout, "None");
else
- fprintf(stdout, "PICTURE %08lx", n);
- return(4);
+ fprintf(stdout, "PICTURE %08lx", n);
+ return (4);
}
static int
-PrintPICTFORMAT (
- const unsigned char *buf)
+PrintPICTFORMAT(const unsigned char *buf)
{
/* print a WINDOW -- CARD32 plus 0 = None */
- long n = ILong (buf);
+ long n = ILong(buf);
+
if (n == 0)
- fprintf(stdout, "None");
+ fprintf(stdout, "None");
else
- fprintf(stdout, "PICTFORMAT %08lx", n);
- return(4);
+ fprintf(stdout, "PICTFORMAT %08lx", n);
+ return (4);
}
static int
-PrintPICTFORMINFO (
- const unsigned char *buf)
+PrintPICTFORMINFO(const unsigned char *buf)
{
- /* print a PictFormInfo */
- long n = ILong(buf);
- short t = IByte(buf+4);
- short d = IByte(buf+5);
-
- fprintf (stdout, "PICTFORMINFO %08lx %s %d ",
- n, t == 0 ? "Indexed" : "Direct", d);
- if (t == 0) {
- long c = ILong(buf+20);
- fprintf (stdout, "cmap %08lx", c);
- } else {
- short r = IShort(buf+8);
- short g = IShort(buf+12);
- short b = IShort(buf+16);
- short a = IShort(buf+20);
- fprintf (stdout, "%d %d %d %d", a, r, g, b);
- }
- return(28);
+ /* print a PictFormInfo */
+ long n = ILong(buf);
+ short t = IByte(buf + 4);
+ short d = IByte(buf + 5);
+
+ fprintf(stdout, "PICTFORMINFO %08lx %s %d ",
+ n, t == 0 ? "Indexed" : "Direct", d);
+ if (t == 0) {
+ long c = ILong(buf + 20);
+
+ fprintf(stdout, "cmap %08lx", c);
+ }
+ else {
+ short r = IShort(buf + 8);
+ short g = IShort(buf + 12);
+ short b = IShort(buf + 16);
+ short a = IShort(buf + 20);
+
+ fprintf(stdout, "%d %d %d %d", a, r, g, b);
+ }
+ return (28);
}
static int
-PrintGLYPHSET (
- const unsigned char *buf)
+PrintGLYPHSET(const unsigned char *buf)
{
/* print a GLYPHSET -- CARD32 plus 0 = None */
- long n = ILong (buf);
+ long n = ILong(buf);
+
if (n == 0)
- fprintf(stdout, "None");
+ fprintf(stdout, "None");
else
- fprintf(stdout, "GLYPHSET %08lx", n);
- return(4);
+ fprintf(stdout, "GLYPHSET %08lx", n);
+ return (4);
}
static int
-PrintRENDERCOLOR (
- const unsigned char *buf)
+PrintRENDERCOLOR(const unsigned char *buf)
{
/* print a RENDERCOLOR */
- unsigned short r, g, b, a;
-
+ unsigned short r, g, b, a;
+
r = IShort(buf);
- g = IShort(buf+2);
- b = IShort(buf+4);
- a = IShort(buf+6);
+ g = IShort(buf + 2);
+ b = IShort(buf + 4);
+ a = IShort(buf + 6);
fprintf(stdout, "COLOR r:%04x g:%04x b:%04x a:%04x", r, g, b, a);
- return(8);
+ return (8);
}
static int
-PrintFIXED (
- const unsigned char *buf)
+PrintFIXED(const unsigned char *buf)
{
- /* print a PICTURE */
- long n = ILong (buf);
- fprintf (stdout, "FIXED %7.2f", n / 65536.0);
- return 4;
+ /* print a PICTURE */
+ long n = ILong(buf);
+
+ fprintf(stdout, "FIXED %7.2f", n / 65536.0);
+ return 4;
}
static int
-PrintPOINTFIXED (
- const unsigned char *buf)
+PrintPOINTFIXED(const unsigned char *buf)
{
- long x = ILong (buf);
- long y = ILong (buf+4);
- fprintf (stdout, "POINT %7.2f, %7.2f", x / 65536.0, y / 65536.0);
- return 8;
+ long x = ILong(buf);
+ long y = ILong(buf + 4);
+
+ fprintf(stdout, "POINT %7.2f, %7.2f", x / 65536.0, y / 65536.0);
+ return 8;
}
static int
-PrintTRAPEZOID (
- const unsigned char *buf)
+PrintTRAPEZOID(const unsigned char *buf)
{
/* print a TRAPEZOID */
- PrintField (buf, 0, 4, FIXED, "top");
- PrintField (buf, 4, 4, FIXED, "bottom");
- PrintField (buf, 8, 8, POINTFIXED, "left top");
- PrintField (buf, 16, 8, POINTFIXED, "left bottom");
- PrintField (buf, 24, 8, POINTFIXED, "right top");
- PrintField (buf, 32, 8, POINTFIXED, "right bottom");
- return 40;
+ PrintField(buf, 0, 4, FIXED, "top");
+ PrintField(buf, 4, 4, FIXED, "bottom");
+ PrintField(buf, 8, 8, POINTFIXED, "left top");
+ PrintField(buf, 16, 8, POINTFIXED, "left bottom");
+ PrintField(buf, 24, 8, POINTFIXED, "right top");
+ PrintField(buf, 32, 8, POINTFIXED, "right bottom");
+ return 40;
}
static int
-PrintTRIANGLE (
- const unsigned char *buf)
+PrintTRIANGLE(const unsigned char *buf)
{
/* print a TRIANGLE */
- PrintField (buf, 0, 8, POINTFIXED, "p1");
- PrintField (buf, 8, 8, POINTFIXED, "p2");
- PrintField (buf,16, 8, POINTFIXED, "p3");
+ PrintField(buf, 0, 8, POINTFIXED, "p1");
+ PrintField(buf, 8, 8, POINTFIXED, "p2");
+ PrintField(buf, 16, 8, POINTFIXED, "p3");
return 24;
}
static int
-PrintFILTERALIAS (
- const unsigned char *buf)
+PrintFILTERALIAS(const unsigned char *buf)
{
/* print a FILTERALIAS -- CARD16 plus -1 = None */
- short n = IShort (buf);
+ short n = IShort(buf);
+
if (n == -1)
- fprintf(stdout, "AliasNone");
+ fprintf(stdout, "AliasNone");
else
- fprintf(stdout, "FILTERALIAS %04x", n);
- return(2);
+ fprintf(stdout, "FILTERALIAS %04x", n);
+ return (2);
}
static int
PrintRENDERTRANSFORM(const unsigned char *buf)
{
- const unsigned char *next = buf;
- int i, j;
-
- for (i = 0 ; i < 3; i++) {
- for (j = 0 ; j < 3; j++) {
- long f = ILong(next);
- next += 4;
- fprintf(stdout, " %7.2f", f / 65536.0);
- }
- if (i < 2) {
- fprintf(stdout, "\n%s%20s ", Leader, "");
- } else {
- fprintf(stdout, "\n");
- }
- }
- return (next - buf);
+ const unsigned char *next = buf;
+ int i, j;
+
+ for (i = 0; i < 3; i++) {
+ for (j = 0; j < 3; j++) {
+ long f = ILong(next);
+
+ next += 4;
+ fprintf(stdout, " %7.2f", f / 65536.0);
+ }
+ if (i < 2) {
+ fprintf(stdout, "\n%s%20s ", Leader, "");
+ }
+ else {
+ fprintf(stdout, "\n");
+ }
+ }
+ return (next - buf);
}
-
void
-InitializeRENDER (
- const unsigned char *buf)
+InitializeRENDER(const unsigned char *buf)
{
- TYPE p;
- int errcode;
-
- RENDERRequest = (unsigned char)(buf[9]);
- RENDERError = (unsigned char)(buf[11]);
-
- DefineEValue (&TD[REQUEST], (unsigned long) RENDERRequest, "RenderRequest");
- DefineEValue (&TD[REPLY], (unsigned long) RENDERRequest, "RenderReply");
-
- DefineEValue (&TD[ERROR], (unsigned long) RENDERError + 0, "BadPictFormat");
- DefineEValue (&TD[ERROR], (unsigned long) RENDERError + 1, "BadPicture");
- DefineEValue (&TD[ERROR], (unsigned long) RENDERError + 2, "BadPictOp");
- DefineEValue (&TD[ERROR], (unsigned long) RENDERError + 3, "BadGlyphSet");
- DefineEValue (&TD[ERROR], (unsigned long) RENDERError + 4, "BadGlyph");
-
- p = DefineType(RENDERREQUEST, ENUMERATED, "RENDERREQUEST", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "RenderQueryVersion");
- DefineEValue(p, 1L, "RenderQueryPictFormats");
- DefineEValue(p, 2L, "RenderQueryPictIndexValues");
- DefineEValue(p, 3L, "RenderQueryDithers");
- DefineEValue(p, 4L, "RenderCreatePicture");
- DefineEValue(p, 5L, "RenderChangePicture");
- DefineEValue(p, 6L, "RenderSetPictureClipRectangles");
- DefineEValue(p, 7L, "RenderFreePicture");
- DefineEValue(p, 8L, "RenderComposite");
- DefineEValue(p, 9L, "RenderScale");
- DefineEValue(p, 10L, "RenderTrapezoids");
- DefineEValue(p, 11L, "RenderTriangles");
- DefineEValue(p, 12L, "RenderTriStrip");
- DefineEValue(p, 13L, "RenderTriFan");
- DefineEValue(p, 14L, "RenderColorTrapezoids");
- DefineEValue(p, 15L, "RenderColorTriangles");
- DefineEValue(p, 16L, "RenderTransform");
- DefineEValue(p, 17L, "RenderCreateGlyphSet");
- DefineEValue(p, 18L, "RenderReferenceGlyphSet");
- DefineEValue(p, 19L, "RenderFreeGlyphSet");
- DefineEValue(p, 20L, "RenderAddGlyphs");
- DefineEValue(p, 21L, "RenderAddGlyphsFromPicture");
- DefineEValue(p, 22L, "RenderFreeGlyphs");
- DefineEValue(p, 23L, "RenderCompositeGlyphs8");
- DefineEValue(p, 24L, "RenderCompositeGlyphs16");
- DefineEValue(p, 25L, "RenderCompositeGlyphs32");
- DefineEValue(p, 26L, "RenderFillRectangles");
- /* Added in 0.5: */
- DefineEValue(p, 27L, "RenderCreateCursor");
- /* Added in 0.6: */
- DefineEValue(p, 28L, "RenderSetPictureTransform");
- DefineEValue(p, 29L, "RenderQueryFilters");
- DefineEValue(p, 30L, "RenderSetPictureFilter");
- /* Added in 0.8: */
- DefineEValue(p, 31L, "RenderCreateAnimCursor");
- /* Added in 0.9: */
- DefineEValue(p, 32L, "RenderAddTraps");
- /* Added in 0.10: */
- DefineEValue(p, 33L, "RenderCreateSolidFill");
- DefineEValue(p, 34L, "RenderCreateLinearGradient");
- DefineEValue(p, 35L, "RenderCreateRadialGradient");
- DefineEValue(p, 36L, "RenderCreateConicalGradient");
- /* no new requests in 0.11 */
-
- p = DefineType(RENDERREPLY, ENUMERATED, "RENDERREPLY", (PrintProcType) PrintENUMERATED);
- DefineEValue (p, 0L, "QueryVersion");
- DefineEValue (p, 1L, "QueryPictFormats");
- DefineEValue (p, 2L, "QueryPictIndexValues");
- DefineEValue (p, 3L, "QueryDithers");
- /* Added in 0.6: */
- DefineEValue (p, 29L, "QueryFilters");
-
- DefineType(PICTURE, BUILTIN, "PICTURE", PrintPICTURE);
- DefineType(PICTFORMAT, BUILTIN, "PICTFORMAT", PrintPICTFORMAT);
- DefineType(GLYPHSET, BUILTIN, "GLYPHSET", PrintGLYPHSET);
- DefineType(RENDERCOLOR, BUILTIN, "RENDERCOLOR", PrintRENDERCOLOR);
- DefineType(PICTFORMINFO, BUILTIN, "PICTFORMINFO", PrintPICTFORMINFO);
-
- p = DefineType(PICTURE_BITMASK, SET, "PICTURE_BITMASK", (PrintProcType) PrintSET);
-
- DefineValues(p, 0x00000001L, 1, BOOL, "repeat");
- DefineValues(p, 0x00000002L, 1, PICTURE, "alpha-map");
- DefineValues(p, 0x00000004L, 1, INT16, "alpha-x-origin");
- DefineValues(p, 0x00000008L, 1, INT16, "alpha-y-origin");
- DefineValues(p, 0x00000010L, 1, INT16, "clip-x-origin");
- DefineValues(p, 0x00000020L, 1, INT16, "clip-y-origin");
- DefineValues(p, 0x00000040L, 1, PIXMAP, "clip-mask");
- DefineValues(p, 0x00000080L, 1, BOOL, "graphics-exposures");
- DefineValues(p, 0x00000100L, 1, SUBWINMODE, "repeat");
- DefineValues(p, 0x00000200L, 1, BOOL, "poly-edge");
- DefineValues(p, 0x00000400L, 1, BOOL, "poly-mode");
- DefineValues(p, 0x00000800L, 1, ATOM, "dither");
- DefineValues(p, 0x00001000L, 1, BOOL, "component-alpha");
-
- p = DefineType(PICTOP, ENUMERATED, "PICTOP", (PrintProcType) PrintENUMERATED);
- DefineEValue (p, 0L, "Clear");
- DefineEValue (p, 1L, "Src");
- DefineEValue (p, 2L, "Dst");
- DefineEValue (p, 3L, "Over");
- DefineEValue (p, 4L, "OverReverse");
- DefineEValue (p, 5L, "In");
- DefineEValue (p, 6L, "InReverse");
- DefineEValue (p, 7L, "Out");
- DefineEValue (p, 8L, "OutReverse");
- DefineEValue (p, 9L, "Atop");
- DefineEValue (p, 10L, "AtopReverse");
- DefineEValue (p, 11L, "Xor");
- DefineEValue (p, 12L, "Add");
- DefineEValue (p, 13L, "Saturate");
-
- /* Operators only available in version 0.2 */
- DefineEValue (p, 0x10, "PictOpDisjointClear");
- DefineEValue (p, 0x11, "PictOpDisjointSrc");
- DefineEValue (p, 0x12, "PictOpDisjointDst");
- DefineEValue (p, 0x13, "PictOpDisjointOver");
- DefineEValue (p, 0x14, "PictOpDisjointOverReverse");
- DefineEValue (p, 0x15, "PictOpDisjointIn");
- DefineEValue (p, 0x16, "PictOpDisjointInReverse");
- DefineEValue (p, 0x17, "PictOpDisjointOut");
- DefineEValue (p, 0x18, "PictOpDisjointOutReverse");
- DefineEValue (p, 0x19, "PictOpDisjointAtop");
- DefineEValue (p, 0x1a, "PictOpDisjointAtopReverse");
- DefineEValue (p, 0x1b, "PictOpDisjointXor");
-
- DefineEValue (p, 0x20, "PictOpConjointClear");
- DefineEValue (p, 0x21, "PictOpConjointSrc");
- DefineEValue (p, 0x22, "PictOpConjointDst");
- DefineEValue (p, 0x23, "PictOpConjointOver");
- DefineEValue (p, 0x24, "PictOpConjointOverReverse");
- DefineEValue (p, 0x25, "PictOpConjointIn");
- DefineEValue (p, 0x26, "PictOpConjointInReverse");
- DefineEValue (p, 0x27, "PictOpConjointOut");
- DefineEValue (p, 0x28, "PictOpConjointOutReverse");
- DefineEValue (p, 0x29, "PictOpConjointAtop");
- DefineEValue (p, 0x2a, "PictOpConjointAtopReverse");
- DefineEValue (p, 0x2b, "PictOpConjointXor");
-
- /* Operators only available in version 0.11 */
- DefineEValue (p, 0x30, "PictOpMultiply");
- DefineEValue (p, 0x31, "PictOpScreen");
- DefineEValue (p, 0x32, "PictOpOverlay");
- DefineEValue (p, 0x33, "PictOpDarken");
- DefineEValue (p, 0x34, "PictOpLighten");
- DefineEValue (p, 0x35, "PictOpColorDodge");
- DefineEValue (p, 0x36, "PictOpColorBurn");
- DefineEValue (p, 0x37, "PictOpHardLight");
- DefineEValue (p, 0x38, "PictOpSoftLight");
- DefineEValue (p, 0x39, "PictOpDifference");
- DefineEValue (p, 0x3a, "PictOpExclusion");
- DefineEValue (p, 0x3b, "PictOpHSLHue");
- DefineEValue (p, 0x3c, "PictOpHSLSaturation");
- DefineEValue (p, 0x3d, "PictOpHSLColor");
- DefineEValue (p, 0x3e, "PictOpHSLLuminosity");
-
- DefineType(FIXED, BUILTIN, "FIXED", PrintFIXED);
- DefineType(POINTFIXED, BUILTIN, "POINTFIXED", PrintPOINTFIXED);
- DefineType(TRIANGLE, RECORD, "TRIANGLE", PrintTRIANGLE);
- DefineType(TRAPEZOID, RECORD, "TRAPEZOID", PrintTRAPEZOID);
- DefineType(FILTERALIAS, BUILTIN, "FILTERALIAS", PrintFILTERALIAS);
- DefineType(RENDERTRANSFORM, BUILTIN, "RENDERTRANSFORM", PrintRENDERTRANSFORM);
-
- InitializeExtensionDecoder(RENDERRequest, render_decode_req,
- render_decode_reply);
- for (errcode = RENDERError; errcode < (RENDERError + RENDERNError) ;
- errcode ++) {
- InitializeExtensionErrorDecoder(errcode, render_decode_error);
- }
+ TYPE p;
+ int errcode;
+
+ RENDERRequest = (unsigned char) (buf[9]);
+ RENDERError = (unsigned char) (buf[11]);
+
+ DefineEValue(&TD[REQUEST], (unsigned long) RENDERRequest, "RenderRequest");
+ DefineEValue(&TD[REPLY], (unsigned long) RENDERRequest, "RenderReply");
+
+ DefineEValue(&TD[ERROR], (unsigned long) RENDERError + 0, "BadPictFormat");
+ DefineEValue(&TD[ERROR], (unsigned long) RENDERError + 1, "BadPicture");
+ DefineEValue(&TD[ERROR], (unsigned long) RENDERError + 2, "BadPictOp");
+ DefineEValue(&TD[ERROR], (unsigned long) RENDERError + 3, "BadGlyphSet");
+ DefineEValue(&TD[ERROR], (unsigned long) RENDERError + 4, "BadGlyph");
+
+ p = DefineType(RENDERREQUEST, ENUMERATED, "RENDERREQUEST",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "RenderQueryVersion");
+ DefineEValue(p, 1L, "RenderQueryPictFormats");
+ DefineEValue(p, 2L, "RenderQueryPictIndexValues");
+ DefineEValue(p, 3L, "RenderQueryDithers");
+ DefineEValue(p, 4L, "RenderCreatePicture");
+ DefineEValue(p, 5L, "RenderChangePicture");
+ DefineEValue(p, 6L, "RenderSetPictureClipRectangles");
+ DefineEValue(p, 7L, "RenderFreePicture");
+ DefineEValue(p, 8L, "RenderComposite");
+ DefineEValue(p, 9L, "RenderScale");
+ DefineEValue(p, 10L, "RenderTrapezoids");
+ DefineEValue(p, 11L, "RenderTriangles");
+ DefineEValue(p, 12L, "RenderTriStrip");
+ DefineEValue(p, 13L, "RenderTriFan");
+ DefineEValue(p, 14L, "RenderColorTrapezoids");
+ DefineEValue(p, 15L, "RenderColorTriangles");
+ DefineEValue(p, 16L, "RenderTransform");
+ DefineEValue(p, 17L, "RenderCreateGlyphSet");
+ DefineEValue(p, 18L, "RenderReferenceGlyphSet");
+ DefineEValue(p, 19L, "RenderFreeGlyphSet");
+ DefineEValue(p, 20L, "RenderAddGlyphs");
+ DefineEValue(p, 21L, "RenderAddGlyphsFromPicture");
+ DefineEValue(p, 22L, "RenderFreeGlyphs");
+ DefineEValue(p, 23L, "RenderCompositeGlyphs8");
+ DefineEValue(p, 24L, "RenderCompositeGlyphs16");
+ DefineEValue(p, 25L, "RenderCompositeGlyphs32");
+ DefineEValue(p, 26L, "RenderFillRectangles");
+ /* Added in 0.5: */
+ DefineEValue(p, 27L, "RenderCreateCursor");
+ /* Added in 0.6: */
+ DefineEValue(p, 28L, "RenderSetPictureTransform");
+ DefineEValue(p, 29L, "RenderQueryFilters");
+ DefineEValue(p, 30L, "RenderSetPictureFilter");
+ /* Added in 0.8: */
+ DefineEValue(p, 31L, "RenderCreateAnimCursor");
+ /* Added in 0.9: */
+ DefineEValue(p, 32L, "RenderAddTraps");
+ /* Added in 0.10: */
+ DefineEValue(p, 33L, "RenderCreateSolidFill");
+ DefineEValue(p, 34L, "RenderCreateLinearGradient");
+ DefineEValue(p, 35L, "RenderCreateRadialGradient");
+ DefineEValue(p, 36L, "RenderCreateConicalGradient");
+ /* no new requests in 0.11 */
+
+ p = DefineType(RENDERREPLY, ENUMERATED, "RENDERREPLY",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "QueryVersion");
+ DefineEValue(p, 1L, "QueryPictFormats");
+ DefineEValue(p, 2L, "QueryPictIndexValues");
+ DefineEValue(p, 3L, "QueryDithers");
+ /* Added in 0.6: */
+ DefineEValue(p, 29L, "QueryFilters");
+
+ DefineType(PICTURE, BUILTIN, "PICTURE", PrintPICTURE);
+ DefineType(PICTFORMAT, BUILTIN, "PICTFORMAT", PrintPICTFORMAT);
+ DefineType(GLYPHSET, BUILTIN, "GLYPHSET", PrintGLYPHSET);
+ DefineType(RENDERCOLOR, BUILTIN, "RENDERCOLOR", PrintRENDERCOLOR);
+ DefineType(PICTFORMINFO, BUILTIN, "PICTFORMINFO", PrintPICTFORMINFO);
+
+ p = DefineType(PICTURE_BITMASK, SET, "PICTURE_BITMASK",
+ (PrintProcType) PrintSET);
+
+ DefineValues(p, 0x00000001L, 1, BOOL, "repeat");
+ DefineValues(p, 0x00000002L, 1, PICTURE, "alpha-map");
+ DefineValues(p, 0x00000004L, 1, INT16, "alpha-x-origin");
+
+ DefineValues(p, 0x00000008L, 1, INT16, "alpha-y-origin");
+
+ DefineValues(p, 0x00000010L, 1, INT16, "clip-x-origin");
+
+ DefineValues(p, 0x00000020L, 1, INT16, "clip-y-origin");
+
+ DefineValues(p, 0x00000040L, 1, PIXMAP, "clip-mask");
+ DefineValues(p, 0x00000080L, 1, BOOL, "graphics-exposures");
+ DefineValues(p, 0x00000100L, 1, SUBWINMODE, "repeat");
+ DefineValues(p, 0x00000200L, 1, BOOL, "poly-edge");
+ DefineValues(p, 0x00000400L, 1, BOOL, "poly-mode");
+ DefineValues(p, 0x00000800L, 1, ATOM, "dither");
+ DefineValues(p, 0x00001000L, 1, BOOL, "component-alpha");
+
+ p = DefineType(PICTOP, ENUMERATED, "PICTOP",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "Clear");
+ DefineEValue(p, 1L, "Src");
+ DefineEValue(p, 2L, "Dst");
+ DefineEValue(p, 3L, "Over");
+ DefineEValue(p, 4L, "OverReverse");
+ DefineEValue(p, 5L, "In");
+ DefineEValue(p, 6L, "InReverse");
+ DefineEValue(p, 7L, "Out");
+ DefineEValue(p, 8L, "OutReverse");
+ DefineEValue(p, 9L, "Atop");
+ DefineEValue(p, 10L, "AtopReverse");
+ DefineEValue(p, 11L, "Xor");
+ DefineEValue(p, 12L, "Add");
+ DefineEValue(p, 13L, "Saturate");
+
+ /* Operators only available in version 0.2 */
+ DefineEValue(p, 0x10, "PictOpDisjointClear");
+ DefineEValue(p, 0x11, "PictOpDisjointSrc");
+ DefineEValue(p, 0x12, "PictOpDisjointDst");
+ DefineEValue(p, 0x13, "PictOpDisjointOver");
+ DefineEValue(p, 0x14, "PictOpDisjointOverReverse");
+ DefineEValue(p, 0x15, "PictOpDisjointIn");
+ DefineEValue(p, 0x16, "PictOpDisjointInReverse");
+ DefineEValue(p, 0x17, "PictOpDisjointOut");
+ DefineEValue(p, 0x18, "PictOpDisjointOutReverse");
+ DefineEValue(p, 0x19, "PictOpDisjointAtop");
+ DefineEValue(p, 0x1a, "PictOpDisjointAtopReverse");
+ DefineEValue(p, 0x1b, "PictOpDisjointXor");
+
+ DefineEValue(p, 0x20, "PictOpConjointClear");
+ DefineEValue(p, 0x21, "PictOpConjointSrc");
+ DefineEValue(p, 0x22, "PictOpConjointDst");
+ DefineEValue(p, 0x23, "PictOpConjointOver");
+ DefineEValue(p, 0x24, "PictOpConjointOverReverse");
+ DefineEValue(p, 0x25, "PictOpConjointIn");
+ DefineEValue(p, 0x26, "PictOpConjointInReverse");
+ DefineEValue(p, 0x27, "PictOpConjointOut");
+ DefineEValue(p, 0x28, "PictOpConjointOutReverse");
+ DefineEValue(p, 0x29, "PictOpConjointAtop");
+ DefineEValue(p, 0x2a, "PictOpConjointAtopReverse");
+ DefineEValue(p, 0x2b, "PictOpConjointXor");
+
+ /* Operators only available in version 0.11 */
+ DefineEValue(p, 0x30, "PictOpMultiply");
+ DefineEValue(p, 0x31, "PictOpScreen");
+ DefineEValue(p, 0x32, "PictOpOverlay");
+ DefineEValue(p, 0x33, "PictOpDarken");
+ DefineEValue(p, 0x34, "PictOpLighten");
+ DefineEValue(p, 0x35, "PictOpColorDodge");
+ DefineEValue(p, 0x36, "PictOpColorBurn");
+ DefineEValue(p, 0x37, "PictOpHardLight");
+ DefineEValue(p, 0x38, "PictOpSoftLight");
+ DefineEValue(p, 0x39, "PictOpDifference");
+ DefineEValue(p, 0x3a, "PictOpExclusion");
+ DefineEValue(p, 0x3b, "PictOpHSLHue");
+ DefineEValue(p, 0x3c, "PictOpHSLSaturation");
+ DefineEValue(p, 0x3d, "PictOpHSLColor");
+ DefineEValue(p, 0x3e, "PictOpHSLLuminosity");
+
+ DefineType(FIXED, BUILTIN, "FIXED", PrintFIXED);
+ DefineType(POINTFIXED, BUILTIN, "POINTFIXED", PrintPOINTFIXED);
+ DefineType(TRIANGLE, RECORD, "TRIANGLE", PrintTRIANGLE);
+ DefineType(TRAPEZOID, RECORD, "TRAPEZOID", PrintTRAPEZOID);
+ DefineType(FILTERALIAS, BUILTIN, "FILTERALIAS", PrintFILTERALIAS);
+ DefineType(RENDERTRANSFORM, BUILTIN, "RENDERTRANSFORM",
+ PrintRENDERTRANSFORM);
+
+ InitializeExtensionDecoder(RENDERRequest, render_decode_req,
+ render_decode_reply);
+ for (errcode = RENDERError; errcode < (RENDERError + RENDERNError);
+ errcode++) {
+ InitializeExtensionErrorDecoder(errcode, render_decode_error);
+ }
}
diff --git a/decode_shm.c b/decode_shm.c
index 58a1f5e..a941b06 100644
--- a/decode_shm.c
+++ b/decode_shm.c
@@ -21,7 +21,6 @@
* DEALINGS IN THE SOFTWARE.
*/
-
#include <stdio.h>
#include <X11/X.h>
#include <X11/Xproto.h>
@@ -33,91 +32,103 @@
static unsigned char MITSHMRequest, MITSHMError, MITSHMEvent;
static void
-mitshm_decode_req (
- FD fd,
- const unsigned char *buf)
+mitshm_decode_req(FD fd, const unsigned char *buf)
{
- short Major = IByte (&buf[0]);
- short Minor = IByte (&buf[1]);
+ short Major = IByte(&buf[0]);
+ short Minor = IByte(&buf[1]);
- switch (Minor) {
- case 0: MitshmQueryVersion (fd, buf); ExtendedReplyExpected (fd, Major, Minor); break;
- case 1: MitshmAttach (fd, buf); break;
- case 2: MitshmDetach (fd, buf); break;
- case 3: MitshmPutImage (fd, buf); break;
- case 4: MitshmGetImage (fd, buf); ExtendedReplyExpected (fd, Major, Minor); break;
- case 5: MitshmCreatePixmap (fd, buf); break;
- default:
- break;
- }
+ switch (Minor) {
+ case 0:
+ MitshmQueryVersion(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 1:
+ MitshmAttach(fd, buf);
+ break;
+ case 2:
+ MitshmDetach(fd, buf);
+ break;
+ case 3:
+ MitshmPutImage(fd, buf);
+ break;
+ case 4:
+ MitshmGetImage(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 5:
+ MitshmCreatePixmap(fd, buf);
+ break;
+ default:
+ break;
+ }
}
static void
-mitshm_decode_reply (
- FD fd,
- const unsigned char *buf,
- short RequestMinor)
+mitshm_decode_reply(FD fd, const unsigned char *buf, short RequestMinor)
{
switch (RequestMinor) {
- case 0: MitshmQueryVersionReply (fd, buf); break;
- case 4: MitshmGetImageReply (fd, buf); break;
+ case 0:
+ MitshmQueryVersionReply(fd, buf);
+ break;
+ case 4:
+ MitshmGetImageReply(fd, buf);
+ break;
}
}
static void
-mitshm_decode_event (
- FD fd,
- const unsigned char *buf)
+mitshm_decode_event(FD fd, const unsigned char *buf)
{
}
-
+
static void
-mitshm_decode_error (
- FD fd,
- const unsigned char *buf)
+mitshm_decode_error(FD fd, const unsigned char *buf)
{
short error = IByte(&buf[0]) - MITSHMError;
-
+
switch (error) {
- case 0: MitshmShmSegError (fd, buf); break;
+ case 0:
+ MitshmShmSegError(fd, buf);
+ break;
default:
- break;
+ break;
}
}
-
void
-InitializeMITSHM (
- const unsigned char *buf)
+InitializeMITSHM(const unsigned char *buf)
{
- TYPE p;
+ TYPE p;
- MITSHMRequest = (unsigned char)(buf[9]);
- MITSHMEvent = (unsigned char)(buf[10]);
- MITSHMError = (unsigned char)(buf[11]);
+ MITSHMRequest = (unsigned char) (buf[9]);
+ MITSHMEvent = (unsigned char) (buf[10]);
+ MITSHMError = (unsigned char) (buf[11]);
- DefineEValue (&TD[REQUEST], (unsigned long) MITSHMRequest, "MitshmRequest");
- DefineEValue (&TD[REPLY], (unsigned long) MITSHMRequest, "MitshmReply");
- DefineEValue (&TD[EVENT], (unsigned long) MITSHMEvent, "MitshmEvent");
- DefineEValue (&TD[ERROR], (unsigned long) MITSHMError, "MitshmError");
+ DefineEValue(&TD[REQUEST], (unsigned long) MITSHMRequest, "MitshmRequest");
+ DefineEValue(&TD[REPLY], (unsigned long) MITSHMRequest, "MitshmReply");
+ DefineEValue(&TD[EVENT], (unsigned long) MITSHMEvent, "MitshmEvent");
+ DefineEValue(&TD[ERROR], (unsigned long) MITSHMError, "MitshmError");
- p = DefineType(MITSHMREQUEST, ENUMERATED, "MITSHMREQUEST", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "MitshmQueryVersion");
- DefineEValue(p, 1L, "MitshmAttach");
- DefineEValue(p, 2L, "MitshmDetach");
- DefineEValue(p, 3L, "MitshmPutImage");
- DefineEValue(p, 4L, "MitshmGetImage");
- DefineEValue(p, 5L, "MitshmCreatePixmap");
+ p = DefineType(MITSHMREQUEST, ENUMERATED, "MITSHMREQUEST",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "MitshmQueryVersion");
+ DefineEValue(p, 1L, "MitshmAttach");
+ DefineEValue(p, 2L, "MitshmDetach");
+ DefineEValue(p, 3L, "MitshmPutImage");
+ DefineEValue(p, 4L, "MitshmGetImage");
+ DefineEValue(p, 5L, "MitshmCreatePixmap");
- p = DefineType(MITSHMREPLY, ENUMERATED, "MITSHMREPLY", (PrintProcType) PrintENUMERATED);
- DefineEValue (p, 0L, "QueryVersion");
- DefineEValue (p, 4L, "GetImage");
+ p = DefineType(MITSHMREPLY, ENUMERATED, "MITSHMREPLY",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "QueryVersion");
+ DefineEValue(p, 4L, "GetImage");
- p = DefineType(MITSHMEVENT, ENUMERATED, "MITSHMEVENT", (PrintProcType) PrintENUMERATED);
- DefineEValue (p, 0L, "CompletionEvent");
+ p = DefineType(MITSHMEVENT, ENUMERATED, "MITSHMEVENT",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "CompletionEvent");
- InitializeExtensionDecoder(MITSHMRequest, mitshm_decode_req,
- mitshm_decode_reply);
- InitializeExtensionErrorDecoder(MITSHMError, mitshm_decode_error);
- InitializeExtensionEventDecoder(MITSHMEvent, mitshm_decode_event);
+ InitializeExtensionDecoder(MITSHMRequest, mitshm_decode_req,
+ mitshm_decode_reply);
+ InitializeExtensionErrorDecoder(MITSHMError, mitshm_decode_error);
+ InitializeExtensionEventDecoder(MITSHMEvent, mitshm_decode_event);
}
diff --git a/decode_wcp.c b/decode_wcp.c
index b335ae8..b5109c2 100644
--- a/decode_wcp.c
+++ b/decode_wcp.c
@@ -15,7 +15,7 @@
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NCD.
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Author: Keith Packard, Network Computing Devices
@@ -33,100 +33,94 @@
static unsigned char WCPRequest, WCPError;
static void
-wcp_decode_req (
- FD fd,
- const unsigned char *buf)
+wcp_decode_req(FD fd, const unsigned char *buf)
{
- short Major = IByte (&buf[0]);
- short Minor = IByte (&buf[1]);
+ short Major = IByte(&buf[0]);
+ short Minor = IByte(&buf[1]);
- switch (Minor) {
- case 0:
- WcpQueryVersion (fd, buf);
- ExtendedReplyExpected (fd, Major, Minor);
- break;
- case 1:
- WcpPutImage (fd, buf);
- break;
- case 2:
- WcpGetImage (fd, buf);
- ExtendedReplyExpected (fd, Major, Minor);
- break;
- case 3:
- WcpCreateColorCursor (fd, buf);
- break;
- case 4:
- WcpCreateLut (fd, buf);
- break;
- case 5:
- WcpFreeLut (fd, buf);
- break;
- case 6:
- WcpCopyArea (fd, buf);
- break;
- default:
- break;
- }
+ switch (Minor) {
+ case 0:
+ WcpQueryVersion(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 1:
+ WcpPutImage(fd, buf);
+ break;
+ case 2:
+ WcpGetImage(fd, buf);
+ ExtendedReplyExpected(fd, Major, Minor);
+ break;
+ case 3:
+ WcpCreateColorCursor(fd, buf);
+ break;
+ case 4:
+ WcpCreateLut(fd, buf);
+ break;
+ case 5:
+ WcpFreeLut(fd, buf);
+ break;
+ case 6:
+ WcpCopyArea(fd, buf);
+ break;
+ default:
+ break;
+ }
}
static void
-wcp_decode_reply (
- FD fd,
- const unsigned char *buf,
- short RequestMinor)
+wcp_decode_reply(FD fd, const unsigned char *buf, short RequestMinor)
{
switch (RequestMinor) {
case 0:
- WcpQueryVersionReply (fd, buf);
- break;
+ WcpQueryVersionReply(fd, buf);
+ break;
case 2:
- WcpGetImageReply (fd, buf);
- break;
+ WcpGetImageReply(fd, buf);
+ break;
default:
- break;
+ break;
}
}
static void
-wcp_decode_error (
- FD fd,
- const unsigned char *buf)
+wcp_decode_error(FD fd, const unsigned char *buf)
{
short error = IByte(&buf[1]) - WCPError;
-
+
switch (error) {
case 0:
- break;
+ break;
default:
- break;
+ break;
}
}
void
-InitializeWCP (
- const unsigned char *buf)
+InitializeWCP(const unsigned char *buf)
{
- TYPE p;
+ TYPE p;
- WCPRequest = (unsigned char)(buf[9]);
- WCPError = (unsigned char)(buf[11]);
+ WCPRequest = (unsigned char) (buf[9]);
+ WCPError = (unsigned char) (buf[11]);
- DefineEValue (&TD[REQUEST], (unsigned long) WCPRequest, "WcpRequest");
- DefineEValue (&TD[REPLY], (unsigned long) WCPRequest, "WcpReply");
- DefineEValue (&TD[ERROR], (unsigned long) WCPError, "WcpError");
+ DefineEValue(&TD[REQUEST], (unsigned long) WCPRequest, "WcpRequest");
+ DefineEValue(&TD[REPLY], (unsigned long) WCPRequest, "WcpReply");
+ DefineEValue(&TD[ERROR], (unsigned long) WCPError, "WcpError");
- p = DefineType(WCPREQUEST, ENUMERATED, "WCPREQUEST", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "WcpQueryVersion");
- DefineEValue(p, 1L, "WcpPutImage");
- DefineEValue(p, 2L, "WcpGetImage");
- DefineEValue(p, 3L, "WcpCreateColorCursor");
- DefineEValue(p, 4L, "WcpCreateLut");
- DefineEValue(p, 5L, "WcpFreeLut");
- DefineEValue(p, 6L, "WcpCopyArea");
+ p = DefineType(WCPREQUEST, ENUMERATED, "WCPREQUEST",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "WcpQueryVersion");
+ DefineEValue(p, 1L, "WcpPutImage");
+ DefineEValue(p, 2L, "WcpGetImage");
+ DefineEValue(p, 3L, "WcpCreateColorCursor");
+ DefineEValue(p, 4L, "WcpCreateLut");
+ DefineEValue(p, 5L, "WcpFreeLut");
+ DefineEValue(p, 6L, "WcpCopyArea");
- p = DefineType(WCPREPLY, ENUMERATED, "WCPREPLY", (PrintProcType) PrintENUMERATED);
- DefineEValue (p, 0L, "QueryVersion");
+ p = DefineType(WCPREPLY, ENUMERATED, "WCPREPLY",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "QueryVersion");
- InitializeExtensionDecoder(WCPRequest, wcp_decode_req, wcp_decode_reply);
- InitializeExtensionErrorDecoder(WCPError, wcp_decode_error);
+ InitializeExtensionDecoder(WCPRequest, wcp_decode_req, wcp_decode_reply);
+ InitializeExtensionErrorDecoder(WCPError, wcp_decode_error);
}
diff --git a/decodenas.c b/decodenas.c
index befa2eb..a9cc191 100644
--- a/decodenas.c
+++ b/decodenas.c
@@ -8,7 +8,7 @@
* ************************************************************ */
#include "scope.h"
-#include "nas.h"
+#include "nas.h"
/*
There are 4 types of things in NAS: requests, replies, errors, and events.
@@ -26,13 +26,11 @@
from that request we can determine the type of the reply.
*/
-
/* ************************************************************ */
/* */
/* */
/* ************************************************************ */
-
/*
We need to keep the sequence number for a request to match it with
an expected reply. The sequence number is associated only with the
@@ -45,7 +43,7 @@
#define DUMP_EVENT 2
#define DUMP_ERROR 3
-static const char * const simple_names[] = {
+static const char *const simple_names[] = {
"REQUEST",
"REPLY ",
"EVENT ",
@@ -53,186 +51,180 @@ static const char * const simple_names[] = {
};
static void
-AudioSimpleDump (int type, FD fd, short Major, short Minor, long bytes)
+AudioSimpleDump(int type, FD fd, short Major, short Minor, long bytes)
{
- PrintTime ();
- fprintf (stdout, "@@%s %3d %3d %3d %7ld\n",
- simple_names[type],
- ClientNumber(fd),
- Major, Minor, bytes);
+ PrintTime();
+ fprintf(stdout, "@@%s %3d %3d %3d %7ld\n",
+ simple_names[type], ClientNumber(fd), Major, Minor, bytes);
}
-
+
/* ************************************************************ */
/* */
/* */
/* ************************************************************ */
void
-DecodeAudioRequest(
- FD fd,
- const unsigned char *buf,
- long n)
+DecodeAudioRequest(FD fd, const unsigned char *buf, long n)
{
- short Request = IByte (&buf[0]);
- short RequestMinor = Request >= 128 ? IByte (&buf[1]) : 0;
- unsigned long seq;
+ short Request = IByte(&buf[0]);
+ short RequestMinor = Request >= 128 ? IByte(&buf[1]) : 0;
+ unsigned long seq;
- CS[fd].SequenceNumber += 1;
- seq = CS[fd].SequenceNumber;
- if (CS[fd].littleEndian) {
- SBf[0] = seq;
- SBf[1] = seq >> 8;
- SBf[2] = seq >> 16;
- SBf[3] = seq >> 24;
- } else {
- SBf[0] = seq >> 24;
- SBf[1] = seq >> 16;
- SBf[2] = seq >> 8;
- SBf[3] = seq;
- }
- SetIndentLevel(PRINTCLIENT);
+ CS[fd].SequenceNumber += 1;
+ seq = CS[fd].SequenceNumber;
+ if (CS[fd].littleEndian) {
+ SBf[0] = seq;
+ SBf[1] = seq >> 8;
+ SBf[2] = seq >> 16;
+ SBf[3] = seq >> 24;
+ }
+ else {
+ SBf[0] = seq >> 24;
+ SBf[1] = seq >> 16;
+ SBf[2] = seq >> 8;
+ SBf[3] = seq;
+ }
+ SetIndentLevel(PRINTCLIENT);
- if (NasVerbose == 0)
- {
- AudioSimpleDump (DUMP_REQUEST, fd, Request, RequestMinor, n);
- return;
- }
-
- if (NasVerbose > 3)
- DumpItem("Request", fd, buf, n);
- switch (Request)
- {
+ if (NasVerbose == 0) {
+ AudioSimpleDump(DUMP_REQUEST, fd, Request, RequestMinor, n);
+ return;
+ }
+
+ if (NasVerbose > 3)
+ DumpItem("Request", fd, buf, n);
+ switch (Request) {
case 1:
- AudioListDevices (buf);
- ReplyExpected(fd, Request);
- break;
+ AudioListDevices(buf);
+ ReplyExpected(fd, Request);
+ break;
case 2:
- AudioGetDeviceAttributes(buf);
- ReplyExpected(fd, Request);
- break;
+ AudioGetDeviceAttributes(buf);
+ ReplyExpected(fd, Request);
+ break;
case 3:
- AudioSetDeviceAttributes (buf);
- break;
+ AudioSetDeviceAttributes(buf);
+ break;
case 4:
- AudioCreateBucket (buf);
- break;
+ AudioCreateBucket(buf);
+ break;
case 5:
- AudioDestroyBucket (buf);
- break;
+ AudioDestroyBucket(buf);
+ break;
case 6:
- AudioListBuckets (buf);
- ReplyExpected (fd, Request);
- break;
+ AudioListBuckets(buf);
+ ReplyExpected(fd, Request);
+ break;
case 7:
- AudioGetBucketAttributes (buf);
- ReplyExpected (fd, Request);
- break;
+ AudioGetBucketAttributes(buf);
+ ReplyExpected(fd, Request);
+ break;
case 8:
- AudioSetBucketAttributes (buf);
- break;
+ AudioSetBucketAttributes(buf);
+ break;
case 9:
- AudioCreateRadio (buf);
- break;
+ AudioCreateRadio(buf);
+ break;
case 10:
- AudioDestroyRadio (buf);
- break;
+ AudioDestroyRadio(buf);
+ break;
case 11:
- AudioListRadios (buf);
- ReplyExpected (fd, Request);
- break;
+ AudioListRadios(buf);
+ ReplyExpected(fd, Request);
+ break;
case 12:
- AudioGetRadioAttributes (buf);
- ReplyExpected (fd, Request);
- break;
+ AudioGetRadioAttributes(buf);
+ ReplyExpected(fd, Request);
+ break;
case 13:
- AudioSetRadioAttributes (buf);
- break;
+ AudioSetRadioAttributes(buf);
+ break;
case 14:
- AudioCreateFlow (buf);
- break;
+ AudioCreateFlow(buf);
+ break;
case 15:
- AudioDestroyFlow (buf);
- break;
+ AudioDestroyFlow(buf);
+ break;
case 16:
- AudioGetFlowAttributes (buf);
- ReplyExpected (fd, Request);
- break;
+ AudioGetFlowAttributes(buf);
+ ReplyExpected(fd, Request);
+ break;
case 17:
- AudioSetFlowAttributes (buf);
- break;
+ AudioSetFlowAttributes(buf);
+ break;
case 18:
- AudioGetElements (buf);
- ReplyExpected (fd, Request);
- break;
+ AudioGetElements(buf);
+ ReplyExpected(fd, Request);
+ break;
case 19:
- AudioSetElements (buf);
- break;
+ AudioSetElements(buf);
+ break;
case 20:
- AudioGetElementStates (buf);
- ReplyExpected (fd, Request);
- break;
+ AudioGetElementStates(buf);
+ ReplyExpected(fd, Request);
+ break;
case 21:
- AudioSetElementStates (buf);
- break;
+ AudioSetElementStates(buf);
+ break;
case 22:
- AudioGetElementParameters (buf);
- ReplyExpected (fd, Request);
- break;
+ AudioGetElementParameters(buf);
+ ReplyExpected(fd, Request);
+ break;
case 23:
- AudioSetElementParameters (buf);
- break;
+ AudioSetElementParameters(buf);
+ break;
case 24:
- AudioWriteElement (buf);
- break;
+ AudioWriteElement(buf);
+ break;
case 25:
- AudioReadElement (buf);
- ReplyExpected (fd, Request);
- break;
+ AudioReadElement(buf);
+ ReplyExpected(fd, Request);
+ break;
case 26:
- AudioGrabComponent (buf);
- break;
+ AudioGrabComponent(buf);
+ break;
case 27:
- AudioUngrabComponent (buf);
- break;
+ AudioUngrabComponent(buf);
+ break;
case 28:
- AudioSendEvent (buf);
- break;
+ AudioSendEvent(buf);
+ break;
case 29:
- AudioGetAllowedUsers (buf);
- ReplyExpected (fd, Request);
- break;
+ AudioGetAllowedUsers(buf);
+ ReplyExpected(fd, Request);
+ break;
case 30:
- AudioSetAllowedUsers (buf);
- break;
+ AudioSetAllowedUsers(buf);
+ break;
case 31:
- AudioListExtensions (buf);
- ReplyExpected (fd, Request);
- break;
+ AudioListExtensions(buf);
+ ReplyExpected(fd, Request);
+ break;
case 32:
- AudioQueryExtension (buf);
- ReplyExpected (fd, Request);
- break;
+ AudioQueryExtension(buf);
+ ReplyExpected(fd, Request);
+ break;
case 33:
- AudioGetCloseDownMode (buf);
- ReplyExpected (fd, Request);
- break;
+ AudioGetCloseDownMode(buf);
+ ReplyExpected(fd, Request);
+ break;
case 34:
- AudioSetCloseDownMode (buf);
- break;
+ AudioSetCloseDownMode(buf);
+ break;
case 35:
- AudioKillClient (buf);
- break;
+ AudioKillClient(buf);
+ break;
case 36:
- AudioGetServerTime (buf);
- ReplyExpected (fd, Request);
- break;
+ AudioGetServerTime(buf);
+ ReplyExpected(fd, Request);
+ break;
case 37:
- AudioNoOperation (buf);
- break;
+ AudioNoOperation(buf);
+ break;
default:
- warn("Unimplemented request opcode");
- break;
- }
+ warn("Unimplemented request opcode");
+ break;
+ }
}
/* ************************************************************ */
@@ -241,82 +233,77 @@ DecodeAudioRequest(
/* ************************************************************ */
void
-DecodeAudioReply(
- FD fd,
- const unsigned char *buf,
- long n)
+DecodeAudioReply(FD fd, const unsigned char *buf, long n)
{
- short SequenceNumber = IShort (&buf[2]);
- short RequestMinor;
- short Request = CheckReplyTable (fd, SequenceNumber, &RequestMinor);
+ short SequenceNumber = IShort(&buf[2]);
+ short RequestMinor;
+ short Request = CheckReplyTable(fd, SequenceNumber, &RequestMinor);
- if (NasVerbose == 0)
- {
- AudioSimpleDump (DUMP_REPLY, fd, Request, RequestMinor, n);
- return;
+ if (NasVerbose == 0) {
+ AudioSimpleDump(DUMP_REPLY, fd, Request, RequestMinor, n);
+ return;
}
SetIndentLevel(PRINTSERVER);
- RBf[0] = Request /* for the PrintField in the Reply procedure */ ;
+ RBf[0] = Request; /* for the PrintField in the Reply procedure */
RBf[1] = RequestMinor;
if (NasVerbose > 3)
- DumpItem("Reply", fd, buf, n);
- switch (Request)
- {
+ DumpItem("Reply", fd, buf, n);
+ switch (Request) {
case 0:
- UnknownAudioReply(buf);
- break;
+ UnknownAudioReply(buf);
+ break;
case 1:
- AudioListDevicesReply (buf);
- break;
+ AudioListDevicesReply(buf);
+ break;
case 2:
- AudioGetDeviceAttributesReply (buf);
- break;
+ AudioGetDeviceAttributesReply(buf);
+ break;
case 6:
- AudioListBucketsReply (buf);
- break;
+ AudioListBucketsReply(buf);
+ break;
case 7:
- AudioGetBucketAttributesReply (buf);
- break;
+ AudioGetBucketAttributesReply(buf);
+ break;
case 11:
- AudioListRadiosReply (buf);
- break;
+ AudioListRadiosReply(buf);
+ break;
case 12:
- AudioGetRadioAttributesReply (buf);
- break;
+ AudioGetRadioAttributesReply(buf);
+ break;
case 16:
- AudioGetFlowAttributesReply (buf);
- break;
+ AudioGetFlowAttributesReply(buf);
+ break;
case 18:
- AudioGetElementsReply (buf);
- break;
+ AudioGetElementsReply(buf);
+ break;
case 20:
- AudioGetElementStatesReply (buf);
- break;
+ AudioGetElementStatesReply(buf);
+ break;
case 22:
- AudioGetElementParametersReply (buf);
- break;
+ AudioGetElementParametersReply(buf);
+ break;
case 25:
- AudioReadElementReply (buf);
- break;
+ AudioReadElementReply(buf);
+ break;
case 29:
- AudioGetAllowedUsersReply (buf);
- break;
+ AudioGetAllowedUsersReply(buf);
+ break;
case 31:
- AudioListExtensionsReply (buf);
- break;
+ AudioListExtensionsReply(buf);
+ break;
case 32:
- AudioQueryExtensionReply (buf);
- break;
+ AudioQueryExtensionReply(buf);
+ break;
case 33:
- AudioGetCloseDownModeReply (buf);
- break;
+ AudioGetCloseDownModeReply(buf);
+ break;
case 36:
- AudioGetServerTimeReply (buf);
- break;
+ AudioGetServerTimeReply(buf);
+ break;
default:
- warn("Unimplemented reply opcode");
- break;
+ warn("Unimplemented reply opcode");
+ break;
}
}
@@ -326,26 +313,22 @@ DecodeAudioReply(
/* ************************************************************ */
void
-DecodeAudioError(
- FD fd,
- const unsigned char *buf,
- long n)
+DecodeAudioError(FD fd, const unsigned char *buf, long n)
{
- short Error = IByte (&buf[1]);
- short Request = 0;
- short RequestMinor = 0;
+ short Error = IByte(&buf[1]);
+ short Request = 0;
+ short RequestMinor = 0;
- Request = CheckReplyTable (fd, (short)IShort(&buf[2]), &RequestMinor);
+ Request = CheckReplyTable(fd, (short) IShort(&buf[2]), &RequestMinor);
- if (NasVerbose == 0)
- {
- AudioSimpleDump (DUMP_ERROR, fd, Request, RequestMinor, n);
- return;
+ if (NasVerbose == 0) {
+ AudioSimpleDump(DUMP_ERROR, fd, Request, RequestMinor, n);
+ return;
}
SetIndentLevel(PRINTSERVER);
if (NasVerbose > 3)
- DumpItem("Error", fd, buf, n);
+ DumpItem("Error", fd, buf, n);
}
/* ************************************************************ */
@@ -354,117 +337,114 @@ DecodeAudioError(
/* ************************************************************ */
void
-DecodeAudioEvent(
- FD fd,
- const unsigned char *buf,
- long n)
+DecodeAudioEvent(FD fd, const unsigned char *buf, long n)
{
- short Event = IByte (&buf[0]);
- short EventMinor = 0;
+ short Event = IByte(&buf[0]);
+ short EventMinor = 0;
- if (NasVerbose == 0)
- {
- AudioSimpleDump (DUMP_EVENT, fd, Event, EventMinor, n);
- return;
+ if (NasVerbose == 0) {
+ AudioSimpleDump(DUMP_EVENT, fd, Event, EventMinor, n);
+ return;
}
SetIndentLevel(PRINTSERVER);
if (NasVerbose > 3)
- DumpItem("Event", fd, buf, n);
+ DumpItem("Event", fd, buf, n);
/* high-order bit means SendEvent generated */
- if (Event & 0x80)
- {
- debug(8,(stderr, "SendEvent generated event 0x%x\n", Event));
- Event = Event & 0x7F;
+ if (Event & 0x80) {
+ debug(8, (stderr, "SendEvent generated event 0x%x\n", Event));
+ Event = Event & 0x7F;
}
- switch (Event)
- {
+ switch (Event) {
case 2:
- AudioElementNotify (buf);
- break;
+ AudioElementNotify(buf);
+ break;
case 3:
- AudioGrabNotify (buf);
- break;
+ AudioGrabNotify(buf);
+ break;
case 4:
- AudioMonitorNotify (buf);
- break;
+ AudioMonitorNotify(buf);
+ break;
case 5:
- AudioBucketNotify (buf);
- break;
+ AudioBucketNotify(buf);
+ break;
case 6:
- AudioDeviceNotify (buf);
- break;
+ AudioDeviceNotify(buf);
+ break;
default:
- warn("Unimplemented event code");
- break;
+ warn("Unimplemented event code");
+ break;
}
}
void
-InitializeAudioDecode (void)
+InitializeAudioDecode(void)
{
- TYPE p;
-
- p = DefineType (NASREQUEST, ENUMERATED, "NASREQUEST", (PrintProcType) PrintENUMERATED);
- DefineEValue (p, 1L, "ListDevices");
- DefineEValue (p, 2L, "GetDeviceAttributes");
- DefineEValue (p, 3L, "SetDeviceAttributes");
- DefineEValue (p, 4L, "CreateBucket");
- DefineEValue (p, 5L, "DestroyBucket");
- DefineEValue (p, 6L, "ListBuckets");
- DefineEValue (p, 7L, "GetBucketAttributes");
- DefineEValue (p, 8L, "SetBucketAttributes");
- DefineEValue (p, 9L, "CreateRadio");
- DefineEValue (p, 10L, "DestroyRadio");
- DefineEValue (p, 11L, "ListRadios");
- DefineEValue (p, 12L, "GetRadioAttributes");
- DefineEValue (p, 13L, "SetRadioAttributes");
- DefineEValue (p, 14L, "CreateFlow");
- DefineEValue (p, 15L, "DestroyFlow");
- DefineEValue (p, 16L, "GetFlowAttributes");
- DefineEValue (p, 17L, "SetFlowAttributes");
- DefineEValue (p, 18L, "GetElements");
- DefineEValue (p, 19L, "SetElements");
- DefineEValue (p, 20L, "GetElementStates");
- DefineEValue (p, 21L, "SetElementStates");
- DefineEValue (p, 22L, "GetElementParameters");
- DefineEValue (p, 23L, "SetElementParameters");
- DefineEValue (p, 24L, "WriteElement");
- DefineEValue (p, 25L, "ReadElement");
- DefineEValue (p, 26L, "GrabComponent");
- DefineEValue (p, 27L, "UngrabComponent");
- DefineEValue (p, 28L, "SendEvent");
- DefineEValue (p, 29L, "GetAllowedUsers");
- DefineEValue (p, 30L, "SetAllowedUsers");
- DefineEValue (p, 31L, "ListExtensions");
- DefineEValue (p, 32L, "QuerExtension");
- DefineEValue (p, 33L, "GetCloseDownMode");
- DefineEValue (p, 34L, "SetCloseDownMode");
- DefineEValue (p, 35L, "KillClient");
- DefineEValue (p, 36L, "GetServerTime");
- DefineEValue (p, 37L, "NoOperation");
- p = DefineType (NASREPLY, ENUMERATED, "NASREPLY", (PrintProcType) PrintENUMERATED);
- DefineEValue (p, 1L, "ListDevices");
- DefineEValue (p, 2L, "GetDeviceAttributes");
- DefineEValue (p, 6L, "ListBuckets");
- DefineEValue (p, 7L, "GetBucketAttributes");
- DefineEValue (p, 11L, "ListRadios");
- DefineEValue (p, 12L, "GetRadioAttributes");
- DefineEValue (p, 16L, "GetFlowAttributes");
- DefineEValue (p, 18L, "GetElements");
- DefineEValue (p, 20L, "GetElementStates");
- DefineEValue (p, 22L, "GetElementParameters");
- DefineEValue (p, 25L, "ReadElement");
- DefineEValue (p, 29L, "GetAllowedUsers");
- DefineEValue (p, 31L, "ListExtensions");
- DefineEValue (p, 32L, "QueryExtension");
- DefineEValue (p, 33L, "GetCloseDownMode");
- DefineEValue (p, 36L, "GetServerTime");
- p = DefineType (NASEVENT, ENUMERATED, "NASEVENT", (PrintProcType) PrintENUMERATED);
+ TYPE p;
+
+ p = DefineType(NASREQUEST, ENUMERATED, "NASREQUEST",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 1L, "ListDevices");
+ DefineEValue(p, 2L, "GetDeviceAttributes");
+ DefineEValue(p, 3L, "SetDeviceAttributes");
+ DefineEValue(p, 4L, "CreateBucket");
+ DefineEValue(p, 5L, "DestroyBucket");
+ DefineEValue(p, 6L, "ListBuckets");
+ DefineEValue(p, 7L, "GetBucketAttributes");
+ DefineEValue(p, 8L, "SetBucketAttributes");
+ DefineEValue(p, 9L, "CreateRadio");
+ DefineEValue(p, 10L, "DestroyRadio");
+ DefineEValue(p, 11L, "ListRadios");
+ DefineEValue(p, 12L, "GetRadioAttributes");
+ DefineEValue(p, 13L, "SetRadioAttributes");
+ DefineEValue(p, 14L, "CreateFlow");
+ DefineEValue(p, 15L, "DestroyFlow");
+ DefineEValue(p, 16L, "GetFlowAttributes");
+ DefineEValue(p, 17L, "SetFlowAttributes");
+ DefineEValue(p, 18L, "GetElements");
+ DefineEValue(p, 19L, "SetElements");
+ DefineEValue(p, 20L, "GetElementStates");
+ DefineEValue(p, 21L, "SetElementStates");
+ DefineEValue(p, 22L, "GetElementParameters");
+ DefineEValue(p, 23L, "SetElementParameters");
+ DefineEValue(p, 24L, "WriteElement");
+ DefineEValue(p, 25L, "ReadElement");
+ DefineEValue(p, 26L, "GrabComponent");
+ DefineEValue(p, 27L, "UngrabComponent");
+ DefineEValue(p, 28L, "SendEvent");
+ DefineEValue(p, 29L, "GetAllowedUsers");
+ DefineEValue(p, 30L, "SetAllowedUsers");
+ DefineEValue(p, 31L, "ListExtensions");
+ DefineEValue(p, 32L, "QuerExtension");
+ DefineEValue(p, 33L, "GetCloseDownMode");
+ DefineEValue(p, 34L, "SetCloseDownMode");
+ DefineEValue(p, 35L, "KillClient");
+ DefineEValue(p, 36L, "GetServerTime");
+ DefineEValue(p, 37L, "NoOperation");
+ p = DefineType(NASREPLY, ENUMERATED, "NASREPLY",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 1L, "ListDevices");
+ DefineEValue(p, 2L, "GetDeviceAttributes");
+ DefineEValue(p, 6L, "ListBuckets");
+ DefineEValue(p, 7L, "GetBucketAttributes");
+ DefineEValue(p, 11L, "ListRadios");
+ DefineEValue(p, 12L, "GetRadioAttributes");
+ DefineEValue(p, 16L, "GetFlowAttributes");
+ DefineEValue(p, 18L, "GetElements");
+ DefineEValue(p, 20L, "GetElementStates");
+ DefineEValue(p, 22L, "GetElementParameters");
+ DefineEValue(p, 25L, "ReadElement");
+ DefineEValue(p, 29L, "GetAllowedUsers");
+ DefineEValue(p, 31L, "ListExtensions");
+ DefineEValue(p, 32L, "QueryExtension");
+ DefineEValue(p, 33L, "GetCloseDownMode");
+ DefineEValue(p, 36L, "GetServerTime");
+ p = DefineType(NASEVENT, ENUMERATED, "NASEVENT",
+ (PrintProcType) PrintENUMERATED);
DefineEValue(p, 2L, "ElementNotify");
DefineEValue(p, 3L, "GrabNotify");
DefineEValue(p, 4L, "MonitorNotify");
DefineEValue(p, 5L, "BucketNotify");
DefineEValue(p, 6L, "DeviceNotify");
-
+
}
diff --git a/extensions.c b/extensions.c
index cf5421f..53b45b3 100644
--- a/extensions.c
+++ b/extensions.c
@@ -32,18 +32,18 @@
/* Extensions we know how to decode */
struct extension_decoders {
const char *name;
- void (*init_func)(const unsigned char *buf);
+ void (*init_func) (const unsigned char *buf);
};
static const struct extension_decoders decodable_extensions[] = {
- { "BIG-REQUESTS", InitializeBIGREQ },
- { "LBX", InitializeLBX },
- { "MIT-SHM", InitializeMITSHM },
- { "NCD-WinCenterPro", InitializeWCP },
- { "RANDR", InitializeRANDR },
- { "RENDER", InitializeRENDER },
- { "GLX", InitializeGLX },
- { NULL, NULL } /* List terminator - keep last */
+ {"BIG-REQUESTS", InitializeBIGREQ},
+ {"LBX", InitializeLBX},
+ {"MIT-SHM", InitializeMITSHM},
+ {"NCD-WinCenterPro", InitializeWCP},
+ {"RANDR", InitializeRANDR},
+ {"RENDER", InitializeRENDER},
+ {"GLX", InitializeGLX},
+ {NULL, NULL} /* List terminator - keep last */
};
/* all extensions we know about */
@@ -52,7 +52,7 @@ struct extension_info {
unsigned char request;
unsigned char event;
unsigned char error;
- long query_seq; /* sequence id of QueryExtension request */
+ long query_seq; /* sequence id of QueryExtension request */
struct extension_info *next;
};
@@ -68,28 +68,28 @@ DefineExtNameValue(int type, unsigned char value, const char *extname)
char *exttypename;
switch (type) {
- case REQUEST:
- typename = "-Request";
- break;
- case REPLY:
- typename = "-Reply";
- break;
- case EVENT:
- typename = "-Event";
- break;
- case ERROR:
- typename = "-Error";
- break;
- case EXTENSION:
- typename = "";
- break;
- default:
- panic("Impossible argument to DefineExtNameValue");
+ case REQUEST:
+ typename = "-Request";
+ break;
+ case REPLY:
+ typename = "-Reply";
+ break;
+ case EVENT:
+ typename = "-Event";
+ break;
+ case ERROR:
+ typename = "-Error";
+ break;
+ case EXTENSION:
+ typename = "";
+ break;
+ default:
+ panic("Impossible argument to DefineExtNameValue");
}
namelen += strlen(typename);
exttypename = malloc(namelen);
if (exttypename == NULL)
- panic("Can't allocate memory for ExtNameValue");
+ panic("Can't allocate memory for ExtNameValue");
snprintf(exttypename, namelen, "%s%s", extname, typename);
DefineEValue(&TD[type], (unsigned long) value, exttypename);
}
@@ -102,22 +102,22 @@ ProcessQueryExtensionRequest(long seq, const unsigned char *buf)
struct extension_info *qe;
if (extname == NULL)
- panic("Can't allocate memory for ExtensionRequest name");
+ panic("Can't allocate memory for ExtensionRequest name");
memcpy(extname, &buf[8], namelen);
extname[namelen] = '\0';
for (qe = query_list; qe != NULL; qe = qe->next) {
- if (strcmp(extname, qe->name) == 0) {
- /* already in list, no need to add */
- free(extname);
- return;
- }
+ if (strcmp(extname, qe->name) == 0) {
+ /* already in list, no need to add */
+ free(extname);
+ return;
+ }
}
/* add to list */
qe = malloc(sizeof(struct extension_info));
if (qe == NULL)
- panic("Can't allocate memory for extension_info");
+ panic("Can't allocate memory for extension_info");
qe->name = extname;
qe->request = 0;
qe->event = 0;
@@ -134,62 +134,62 @@ ProcessQueryExtensionReply(long seq, const unsigned char *buf)
int i;
if (buf[8] == 0) {
- /* Extension not present, nothing to record */
- return;
+ /* Extension not present, nothing to record */
+ return;
}
for (qe = query_list; qe != NULL; qe = qe->next) {
- if (qe->query_seq == seq) {
- qe->request = buf[9];
- qe->event = buf[10];
- qe->error = buf[11];
-
- ext_by_request[qe->request - EXTENSION_MIN_REQ] = qe;
-
- DefineExtNameValue(EXTENSION, qe->request, qe->name);
-
- for (i = 0; decodable_extensions[i].name != NULL ; i++) {
- if (strcmp(qe->name, decodable_extensions[i].name) == 0) {
- decodable_extensions[i].init_func(buf);
- break;
- }
- }
- if (decodable_extensions[i].name == NULL) {
- /* Not found - initialize values as best we can generically */
- DefineExtNameValue(REQUEST, qe->request, qe->name);
- DefineExtNameValue(REPLY, qe->request, qe->name);
- if (qe->event != 0) {
- DefineExtNameValue(EVENT, qe->event, qe->name);
- }
- if (qe->error != 0) {
- DefineExtNameValue(ERROR, qe->error, qe->name);
- }
- }
-
- return;
- }
+ if (qe->query_seq == seq) {
+ qe->request = buf[9];
+ qe->event = buf[10];
+ qe->error = buf[11];
+
+ ext_by_request[qe->request - EXTENSION_MIN_REQ] = qe;
+
+ DefineExtNameValue(EXTENSION, qe->request, qe->name);
+
+ for (i = 0; decodable_extensions[i].name != NULL; i++) {
+ if (strcmp(qe->name, decodable_extensions[i].name) == 0) {
+ decodable_extensions[i].init_func(buf);
+ break;
+ }
+ }
+ if (decodable_extensions[i].name == NULL) {
+ /* Not found - initialize values as best we can generically */
+ DefineExtNameValue(REQUEST, qe->request, qe->name);
+ DefineExtNameValue(REPLY, qe->request, qe->name);
+ if (qe->event != 0) {
+ DefineExtNameValue(EVENT, qe->event, qe->name);
+ }
+ if (qe->error != 0) {
+ DefineExtNameValue(ERROR, qe->error, qe->name);
+ }
+ }
+
+ return;
+ }
}
}
/* Decoding for specific/known extensions */
-static extension_decode_req_ptr ExtensionRequestDecoder[NUM_EXTENSIONS];
+static extension_decode_req_ptr ExtensionRequestDecoder[NUM_EXTENSIONS];
static extension_decode_reply_ptr ExtensionReplyDecoder[NUM_EXTENSIONS];
static extension_decode_error_ptr ExtensionErrorDecoder[NUM_EXTENSIONS];
static extension_decode_event_ptr ExtensionEventDecoder[NUM_EXT_EVENTS];
static extension_decode_event_ptr GenericEventDecoder[NUM_EXTENSIONS];
void
-InitializeExtensionDecoder (int Request, extension_decode_req_ptr reqd,
- extension_decode_reply_ptr repd)
+InitializeExtensionDecoder(int Request, extension_decode_req_ptr reqd,
+ extension_decode_reply_ptr repd)
{
if ((Request > EXTENSION_MAX_REQ) || (Request < EXTENSION_MIN_REQ)) {
- char errmsg[128];
+ char errmsg[128];
- snprintf(errmsg, sizeof(errmsg), "Failed to register decoder"
- " for invalid extension request code %d.", Request);
- warn(errmsg);
- return;
+ snprintf(errmsg, sizeof(errmsg), "Failed to register decoder"
+ " for invalid extension request code %d.", Request);
+ warn(errmsg);
+ return;
}
ExtensionRequestDecoder[Request - EXTENSION_MIN_REQ] = reqd;
ExtensionReplyDecoder[Request - EXTENSION_MIN_REQ] = repd;
@@ -199,12 +199,12 @@ void
InitializeExtensionErrorDecoder(int Error, extension_decode_error_ptr errd)
{
if ((Error > EXTENSION_MAX_ERR) || (Error < EXTENSION_MIN_ERR)) {
- char errmsg[128];
+ char errmsg[128];
- snprintf(errmsg, sizeof(errmsg), "Failed to register decoder"
- " for invalid extension error code %d.", Error);
- warn(errmsg);
- return;
+ snprintf(errmsg, sizeof(errmsg), "Failed to register decoder"
+ " for invalid extension error code %d.", Error);
+ warn(errmsg);
+ return;
}
ExtensionErrorDecoder[Error - EXTENSION_MIN_ERR] = errd;
}
@@ -213,100 +213,106 @@ void
InitializeExtensionEventDecoder(int Event, extension_decode_event_ptr evd)
{
if ((Event > EXTENSION_MAX_EV) || (Event < EXTENSION_MIN_EV)) {
- char errmsg[128];
+ char errmsg[128];
- snprintf(errmsg, sizeof(errmsg), "Failed to register decoder"
- " for invalid extension event code %d.", Event);
- warn(errmsg);
- return;
+ snprintf(errmsg, sizeof(errmsg), "Failed to register decoder"
+ " for invalid extension event code %d.", Event);
+ warn(errmsg);
+ return;
}
ExtensionEventDecoder[Event - EXTENSION_MIN_EV] = evd;
}
-
void
InitializeGenericEventDecoder(int Request, extension_decode_event_ptr evd)
{
if ((Request > EXTENSION_MAX_REQ) || (Request < EXTENSION_MIN_REQ)) {
- char errmsg[128];
+ char errmsg[128];
- snprintf(errmsg, sizeof(errmsg), "Failed to register decoder"
- " for invalid generic extension event code %d.", Request);
- warn(errmsg);
- return;
+ snprintf(errmsg, sizeof(errmsg), "Failed to register decoder"
+ " for invalid generic extension event code %d.", Request);
+ warn(errmsg);
+ return;
}
GenericEventDecoder[Request - EXTENSION_MIN_REQ] = evd;
}
void
-ExtensionRequest (FD fd, const unsigned char *buf, short Request)
+ExtensionRequest(FD fd, const unsigned char *buf, short Request)
{
extension_decode_req_ptr decode_req = NULL;
if ((Request <= EXTENSION_MAX_REQ) && (Request >= EXTENSION_MIN_REQ)) {
- decode_req = ExtensionRequestDecoder[Request - EXTENSION_MIN_REQ];
+ decode_req = ExtensionRequestDecoder[Request - EXTENSION_MIN_REQ];
}
if (decode_req != NULL) {
- decode_req(fd, buf);
- } else {
+ decode_req(fd, buf);
+ }
+ else {
ExtendedRequest(fd, buf);
- ReplyExpected(fd, Request);
+ ReplyExpected(fd, Request);
}
}
void
-ExtensionReply (FD fd, const unsigned char *buf,
- short Request, short RequestMinor)
+ExtensionReply(FD fd, const unsigned char *buf,
+ short Request, short RequestMinor)
{
extension_decode_reply_ptr decode_reply = NULL;
if ((Request <= EXTENSION_MAX_REQ) && (Request >= EXTENSION_MIN_REQ)) {
- decode_reply = ExtensionReplyDecoder[Request - EXTENSION_MIN_REQ];
+ decode_reply = ExtensionReplyDecoder[Request - EXTENSION_MIN_REQ];
}
if (decode_reply != NULL) {
- decode_reply(fd, buf, RequestMinor);
- } else {
- UnknownReply(buf);
+ decode_reply(fd, buf, RequestMinor);
+ }
+ else {
+ UnknownReply(buf);
}
}
void
-ExtensionError (FD fd, const unsigned char *buf, short Error)
+ExtensionError(FD fd, const unsigned char *buf, short Error)
{
extension_decode_error_ptr decode_error = NULL;
if ((Error <= EXTENSION_MAX_ERR) && (Error >= EXTENSION_MIN_ERR)) {
- decode_error = ExtensionErrorDecoder[Error - EXTENSION_MIN_ERR];
+ decode_error = ExtensionErrorDecoder[Error - EXTENSION_MIN_ERR];
}
if (decode_error != NULL) {
- decode_error(fd, buf);
- } else {
- UnknownError(buf);
+ decode_error(fd, buf);
+ }
+ else {
+ UnknownError(buf);
}
}
void
-ExtensionEvent (FD fd, const unsigned char *buf, short Event)
+ExtensionEvent(FD fd, const unsigned char *buf, short Event)
{
extension_decode_event_ptr decode_event = NULL;
if ((Event <= EXTENSION_MAX_EV) && (Event >= EXTENSION_MIN_EV)) {
- decode_event = ExtensionEventDecoder[Event - EXTENSION_MIN_EV];
- } else if (Event == Event_Type_Generic) {
- int Request = IByte (&buf[1]);
- if ((Request <= EXTENSION_MAX_REQ) && (Request >= EXTENSION_MIN_REQ)) {
- decode_event = GenericEventDecoder[Request - EXTENSION_MIN_REQ];
- }
+ decode_event = ExtensionEventDecoder[Event - EXTENSION_MIN_EV];
+ }
+ else if (Event == Event_Type_Generic) {
+ int Request = IByte(&buf[1]);
+
+ if ((Request <= EXTENSION_MAX_REQ) && (Request >= EXTENSION_MIN_REQ)) {
+ decode_event = GenericEventDecoder[Request - EXTENSION_MIN_REQ];
+ }
}
if (decode_event != NULL) {
- decode_event(fd, buf);
- } else if (Event == Event_Type_Generic) {
- UnknownGenericEvent(buf);
- } else {
- UnknownEvent(buf);
+ decode_event(fd, buf);
+ }
+ else if (Event == Event_Type_Generic) {
+ UnknownGenericEvent(buf);
+ }
+ else {
+ UnknownEvent(buf);
}
}
diff --git a/extensions.h b/extensions.h
index b43730e..87888ac 100644
--- a/extensions.h
+++ b/extensions.h
@@ -26,14 +26,14 @@
#include "scope.h"
-#define EXTENSION_MIN_REQ 128 /* lowest possible extension request code */
-#define EXTENSION_MAX_REQ 255 /* highest possible extension request code */
-#define EXTENSION_MIN_EV 64 /* lowest possible extension event code */
-#define EXTENSION_MAX_EV 127 /* highest possible extension event code */
-#define EXTENSION_MIN_ERR 128 /* lowest possible extension error code */
-#define EXTENSION_MAX_ERR 255 /* highest possible extension error code */
-#define NUM_EXTENSIONS 128 /* maximum possible number of extensions */
-#define NUM_EXT_EVENTS 64 /* maximum possible number of extension events */
+#define EXTENSION_MIN_REQ 128 /* lowest possible extension request code */
+#define EXTENSION_MAX_REQ 255 /* highest possible extension request code */
+#define EXTENSION_MIN_EV 64 /* lowest possible extension event code */
+#define EXTENSION_MAX_EV 127 /* highest possible extension event code */
+#define EXTENSION_MIN_ERR 128 /* lowest possible extension error code */
+#define EXTENSION_MAX_ERR 255 /* highest possible extension error code */
+#define NUM_EXTENSIONS 128 /* maximum possible number of extensions */
+#define NUM_EXT_EVENTS 64 /* maximum possible number of extension events */
/* special processing in extensions.c to capture extension info */
extern void ProcessQueryExtensionRequest(long seq, const unsigned char *buf);
@@ -41,36 +41,34 @@ extern void ProcessQueryExtensionReply(long seq, const unsigned char *buf);
extern void ExtensionRequest(FD fd, const unsigned char *buf, short Request);
extern void ExtensionReply(FD fd, const unsigned char *buf,
- short Request, short RequestMinor);
+ short Request, short RequestMinor);
extern void ExtensionError(FD fd, const unsigned char *buf, short Error);
extern void ExtensionEvent(FD fd, const unsigned char *buf, short Event);
-
/* X11 Extension decoders in decode_*.c */
-extern void InitializeBIGREQ (const unsigned char *buf);
-extern void InitializeGLX (const unsigned char *buf);
-extern void InitializeLBX (const unsigned char *buf);
-extern void InitializeMITSHM (const unsigned char *buf);
-extern void InitializeRANDR (const unsigned char *buf);
-extern void InitializeRENDER (const unsigned char *buf);
-extern void InitializeWCP (const unsigned char *buf);
+extern void InitializeBIGREQ(const unsigned char *buf);
+extern void InitializeGLX(const unsigned char *buf);
+extern void InitializeLBX(const unsigned char *buf);
+extern void InitializeMITSHM(const unsigned char *buf);
+extern void InitializeRANDR(const unsigned char *buf);
+extern void InitializeRENDER(const unsigned char *buf);
+extern void InitializeWCP(const unsigned char *buf);
/* Called from Initialize* to register the extension-specific decoders */
-
-typedef void (*extension_decode_req_ptr) (FD fd, const unsigned char *buf);
+typedef void (*extension_decode_req_ptr) (FD fd, const unsigned char *buf);
typedef void (*extension_decode_reply_ptr) (FD fd, const unsigned char *buf,
- short RequestMinor);
+ short RequestMinor);
typedef void (*extension_decode_error_ptr) (FD fd, const unsigned char *buf);
typedef void (*extension_decode_event_ptr) (FD fd, const unsigned char *buf);
-extern void InitializeExtensionDecoder (int Request,
- extension_decode_req_ptr reqd,
- extension_decode_reply_ptr repd);
+extern void InitializeExtensionDecoder(int Request,
+ extension_decode_req_ptr reqd,
+ extension_decode_reply_ptr repd);
extern void InitializeExtensionErrorDecoder(int Error,
- extension_decode_error_ptr errd);
+ extension_decode_error_ptr errd);
extern void InitializeExtensionEventDecoder(int Event,
- extension_decode_event_ptr evd);
-extern void InitializeGenericEventDecoder (int Request,
- extension_decode_event_ptr evd);
+ extension_decode_event_ptr evd);
+extern void InitializeGenericEventDecoder(int Request,
+ extension_decode_event_ptr evd);
-#endif /* XSCOPE_EXTENSIONS_H */
+#endif /* XSCOPE_EXTENSIONS_H */
diff --git a/fd.c b/fd.c
index 9cf8026..c026b0f 100644
--- a/fd.c
+++ b/fd.c
@@ -1,8 +1,8 @@
-/* ************************************************************ *\
- * *
- * Support routines for file descriptors (FD) *
- * *
- * James Peterson, 1987 *
+/*
+ * Support routines for file descriptors (FD)
+ *
+ * James Peterson, 1987
+ *
* Copyright (C) 1987 MCC
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -22,8 +22,9 @@
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
- * *
- * *
+ *
+ */
+/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -45,29 +46,29 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
- \* *********************************************************** */
+ */
-#include <X11/Xpoll.h> /* for XFD_* macros - must come before
- scope.h include to avoid INT32 clash */
+#include <X11/Xpoll.h> /* for XFD_* macros - must come before
+ scope.h include to avoid INT32 clash */
#include "scope.h"
#include <unistd.h>
-#include <sys/uio.h> /* for struct iovec, used by socket.h */
-#include <sys/socket.h> /* for AF_INET, SOCK_STREAM, ... */
-#include <sys/ioctl.h> /* for FIONCLEX, FIONBIO, ... */
+#include <sys/uio.h> /* for struct iovec, used by socket.h */
+#include <sys/socket.h> /* for AF_INET, SOCK_STREAM, ... */
+#include <sys/ioctl.h> /* for FIONCLEX, FIONBIO, ... */
#if !defined(FIOCLEX) && defined(HAVE_SYS_FILIO_H)
#include <sys/filio.h>
#endif
#include <fcntl.h>
-#include <netinet/in.h> /* struct sockaddr_in */
-#include <sys/un.h> /* struct sockaddr_un */
+#include <netinet/in.h> /* struct sockaddr_in */
+#include <sys/un.h> /* struct sockaddr_un */
#include <netinet/tcp.h>
-#include <netdb.h> /* struct servent * and struct hostent * */
-#include <errno.h> /* for EINTR, EADDRINUSE, ... */
+#include <netdb.h> /* struct servent * and struct hostent * */
+#include <errno.h> /* for EINTR, EADDRINUSE, ... */
#ifndef USE_XTRANS
-#include <arpa/inet.h> /* for inet_addr */
+#include <arpa/inet.h> /* for inet_addr */
#endif
/*
@@ -87,110 +88,109 @@
void
InitializeFD(void)
{
- int i;
+ int i;
- enterprocedure("InitializeFD");
- /* get the number of file descriptors the system will let us use */
+ enterprocedure("InitializeFD");
+ /* get the number of file descriptors the system will let us use */
#ifdef _SC_OPEN_MAX
- MaxFD = sysconf(_SC_OPEN_MAX);
+ MaxFD = sysconf(_SC_OPEN_MAX);
#elif defined(HAVE_GETDTABLESIZE)
- MaxFD = getdtablesize();
+ MaxFD = getdtablesize();
#else
- MaxFD = _NFILE - 1;
+ MaxFD = _NFILE - 1;
#endif
- if (MaxFD > FD_SETSIZE) {
- MaxFD = FD_SETSIZE;
- }
-
- /* allocate space for a File Descriptor (FD) Table */
- FDD = calloc (MaxFD, sizeof (struct FDDescriptor));
- if (FDD == NULL) {
- panic("Can't allocate memory for file descriptor table");
- }
- FDinfo = calloc(MaxFD, sizeof (struct fdinfo));
- if (FDinfo == NULL) {
- panic("Can't allocate memory for file descriptor info table");
- }
-
- /* be sure all fd's are closed and marked not busy */
- for (i = 0; i < MaxFD; i++)
- {
- /* 0, 1, 2 are special (stdin, stdout, stderr) */
- if (i > 2)
- close(i);
- /* FDD[i].Busy = false; - not needed since false==0*/
+ if (MaxFD > FD_SETSIZE) {
+ MaxFD = FD_SETSIZE;
}
- /* save one FD for single file input or output like debugging */
- /* also the getservbyname call is currently using an FD */
- MaxFD -= 4;
+ /* allocate space for a File Descriptor (FD) Table */
+ FDD = calloc(MaxFD, sizeof(struct FDDescriptor));
+ if (FDD == NULL) {
+ panic("Can't allocate memory for file descriptor table");
+ }
+ FDinfo = calloc(MaxFD, sizeof(struct fdinfo));
+ if (FDinfo == NULL) {
+ panic("Can't allocate memory for file descriptor info table");
+ }
+
+ /* be sure all fd's are closed and marked not busy */
+ for (i = 0; i < MaxFD; i++) {
+ /* 0, 1, 2 are special (stdin, stdout, stderr) */
+ if (i > 2)
+ close(i);
+ /* FDD[i].Busy = false; - not needed since false==0 */
+ }
- nFDsInUse = 0 /* stdin, stdout, stderr */ ;
- FD_ZERO(&ReadDescriptors);
- HighestFD = 0;
+ /* save one FD for single file input or output like debugging */
+ /* also the getservbyname call is currently using an FD */
+ MaxFD -= 4;
- UsingFD(fileno(stdin), NULL, NULL, NULL);
- UsingFD(fileno(stdout), NULL, NULL, NULL);
- UsingFD(fileno(stderr), NULL, NULL, NULL);
+ nFDsInUse = 0; /* stdin, stdout, stderr */
+ FD_ZERO(&ReadDescriptors);
+ HighestFD = 0;
+
+ UsingFD(fileno(stdin), NULL, NULL, NULL);
+ UsingFD(fileno(stdout), NULL, NULL, NULL);
+ UsingFD(fileno(stderr), NULL, NULL, NULL);
}
/* ************************************************************ */
void
-UsingFD(
- FD fd,
- void (*Handler)(int),
- void (*FlushHandler)(int),
- XtransConnInfo trans_conn)
+UsingFD(FD fd,
+ void (*Handler) (int),
+ void (*FlushHandler) (int),
+ XtransConnInfo trans_conn)
{
- if (FDD[fd].Busy)
- NotUsingFD(fd);
- nFDsInUse += 1;
+ if (FDD[fd].Busy)
+ NotUsingFD(fd);
+ nFDsInUse += 1;
- FDD[fd].Busy = true;
- FDD[fd].InputHandler = Handler;
- FDD[fd].FlushHandler = FlushHandler;
+ FDD[fd].Busy = true;
+ FDD[fd].InputHandler = Handler;
+ FDD[fd].FlushHandler = FlushHandler;
#ifdef USE_XTRANS
- FDD[fd].trans_conn = trans_conn;
+ FDD[fd].trans_conn = trans_conn;
#endif
- if (Handler == NULL)
- FD_CLR(fd,&ReadDescriptors) /* clear fd bit */ ;
- else
- FD_SET(fd,&ReadDescriptors) /* set fd bit */ ;
+ if (Handler == NULL)
+ FD_CLR(fd, &ReadDescriptors); /* clear fd bit */
+ else
+ FD_SET(fd, &ReadDescriptors); /* set fd bit */
- if (fd > HighestFD)
- HighestFD = fd;
+ if (fd > HighestFD)
+ HighestFD = fd;
- if (nFDsInUse >= MaxFD)
- panic("no more FDs");
+ if (nFDsInUse >= MaxFD)
+ panic("no more FDs");
- debug(128,(stderr, "Using FD %d, %d of %d in use\n", fd, nFDsInUse, MaxFD));
+ debug(128,
+ (stderr, "Using FD %d, %d of %d in use\n", fd, nFDsInUse, MaxFD));
}
/* ************************************************************ */
void
-NotUsingFD(
- FD fd)
+NotUsingFD(FD fd)
{
- debug(128,(stderr, "Not Using FD %d\n", fd));
+ debug(128, (stderr, "Not Using FD %d\n", fd));
- if (FDD[fd].Busy)
- nFDsInUse -= 1;
+ if (FDD[fd].Busy)
+ nFDsInUse -= 1;
- FDD[fd].Busy = false;
- FD_CLR(fd,&ReadDescriptors) /* clear fd bit */ ;
+ FDD[fd].Busy = false;
+ FD_CLR(fd, &ReadDescriptors); /* clear fd bit */
- while (!FDD[HighestFD].Busy && HighestFD > 0)
- HighestFD -= 1;
+ while (!FDD[HighestFD].Busy && HighestFD > 0)
+ HighestFD -= 1;
- debug(128,(stderr, "Highest FD %d, in use %d\n", HighestFD, nFDsInUse));
+ debug(128, (stderr, "Highest FD %d, in use %d\n", HighestFD, nFDsInUse));
}
/* ************************************************************ */
#ifdef USE_XTRANS
-XtransConnInfo GetXTransConnInfo(FD fd)
+XtransConnInfo
+GetXTransConnInfo(FD fd)
{
return FDD[fd].trans_conn;
}
@@ -199,215 +199,204 @@ XtransConnInfo GetXTransConnInfo(FD fd)
/* ************************************************************ */
static void
-EOFonFD (
- FD fd)
+EOFonFD(FD fd)
{
- enterprocedure("EOFonFD");
- debug(128,(stderr, "EOF on %d\n", fd));
+ enterprocedure("EOFonFD");
+ debug(128, (stderr, "EOF on %d\n", fd));
#ifdef USE_XTRANS
- if (FDD[fd].trans_conn)
- _X11TransClose(FDD[fd].trans_conn);
- else
+ if (FDD[fd].trans_conn)
+ _X11TransClose(FDD[fd].trans_conn);
+ else
#endif
- close(fd);
- NotUsingFD(fd);
+ close(fd);
+ NotUsingFD(fd);
}
FD
-AcceptConnection (
- FD ConnectionSocket)
+AcceptConnection(FD ConnectionSocket)
{
- FD ClientFD;
- struct sockaddr_in from;
- socklen_t len = sizeof (from);
- int tmp = 1;
-
- enterprocedure("ConnectToClient");
-
- ClientFD = accept(ConnectionSocket, (struct sockaddr *)&from, &len);
- debug(4,(stderr, "Connect To Client: FD %d\n", ClientFD));
- if (ClientFD < 0 && errno == EWOULDBLOCK)
- {
- debug(4,(stderr, "Almost blocked accepting FD %d\n", ClientFD));
- panic("Can't connect to Client");
+ FD ClientFD;
+ struct sockaddr_in from;
+ socklen_t len = sizeof(from);
+ int tmp = 1;
+
+ enterprocedure("ConnectToClient");
+
+ ClientFD = accept(ConnectionSocket, (struct sockaddr *) &from, &len);
+ debug(4, (stderr, "Connect To Client: FD %d\n", ClientFD));
+ if (ClientFD < 0 && errno == EWOULDBLOCK) {
+ debug(4, (stderr, "Almost blocked accepting FD %d\n", ClientFD));
+ panic("Can't connect to Client");
}
- if (ClientFD < 0)
- {
- debug(4,(stderr, "NewConnection: error %d\n", errno));
- panic("Can't connect to Client");
+ if (ClientFD < 0) {
+ debug(4, (stderr, "NewConnection: error %d\n", errno));
+ panic("Can't connect to Client");
}
#ifdef FD_CLOEXEC
- (void)fcntl(ClientFD, F_SETFD, FD_CLOEXEC);
+ (void) fcntl(ClientFD, F_SETFD, FD_CLOEXEC);
#else
- (void)ioctl(ClientFD, FIOCLEX, 0);
+ (void) ioctl(ClientFD, FIOCLEX, 0);
#endif
- /* ultrix reads hang on Unix sockets, hpux reads fail */
+ /* ultrix reads hang on Unix sockets, hpux reads fail */
#if defined(O_NONBLOCK) && (!defined(ultrix) && !defined(hpux))
- (void) fcntl (ClientFD, F_SETFL, O_NONBLOCK);
+ (void) fcntl(ClientFD, F_SETFL, O_NONBLOCK);
#else
#ifdef FIOSNBIO
- ioctl (ClientFD, FIOSNBIO, &ON);
+ ioctl(ClientFD, FIOSNBIO, &ON);
#else
- (void) fcntl (ClientFD, F_SETFL, FNDELAY);
+ (void) fcntl(ClientFD, F_SETFL, FNDELAY);
#endif
#endif
- (void) setsockopt(ClientFD, IPPROTO_TCP, TCP_NODELAY, (char *) &tmp, sizeof (int));
- return(ClientFD);
+ (void) setsockopt(ClientFD, IPPROTO_TCP, TCP_NODELAY, (char *) &tmp,
+ sizeof(int));
+ return (ClientFD);
}
FD
-MakeConnection(
- const char *server,
- short port,
- int report,
- XtransConnInfo *trans_conn /* transport connection object */
- )
+MakeConnection(const char *server, short port, int report,
+ XtransConnInfo *trans_conn /* transport connection object */)
{
- FD ServerFD;
+ FD ServerFD;
+
#ifdef USE_XTRANS
- char address[256];
- int connect_stat;
- const char *protocols[] = {"local", "unix", "tcp", "inet6", "inet", NULL};
- const char **s;
-
- enterprocedure("ConnectToServer");
- s = protocols;
- while (*s) {
- *trans_conn = NULL;
- snprintf (address, sizeof(address), "%s/%s:%ld", *s++, server, port - ServerBasePort);
- debug(4,(stderr, "Trying %s ", address));
- *trans_conn = _X11TransOpenCOTSClient(address);
- if(*trans_conn == NULL) {
- debug(1,(stderr, "OpenCOTSClient %s failed\n", address));
- continue;
- }
- debug(4,(stderr, "Opened "));
- if ((connect_stat = _X11TransConnect(*trans_conn,address)) < 0 ) {
- if ((connect_stat != TRANS_TRY_CONNECT_AGAIN) ||
- (_X11TransConnect(*trans_conn,address) < 0 )) {
- _X11TransClose(*trans_conn);
- *trans_conn = NULL;
- debug(1,(stderr, "TransConnect %s failed\n", address));
+ char address[256];
+ int connect_stat;
+ const char *protocols[] = { "local", "unix", "tcp", "inet6", "inet", NULL };
+ const char **s;
+
+ enterprocedure("ConnectToServer");
+ s = protocols;
+ while (*s) {
+ *trans_conn = NULL;
+ snprintf(address, sizeof(address), "%s/%s:%ld",
+ *s++, server, port - ServerBasePort);
+ debug(4, (stderr, "Trying %s ", address));
+ *trans_conn = _X11TransOpenCOTSClient(address);
+ if (*trans_conn == NULL) {
+ debug(1, (stderr, "OpenCOTSClient %s failed\n", address));
continue;
}
+ debug(4, (stderr, "Opened "));
+ if ((connect_stat = _X11TransConnect(*trans_conn, address)) < 0) {
+ if ((connect_stat != TRANS_TRY_CONNECT_AGAIN) ||
+ (_X11TransConnect(*trans_conn, address) < 0)) {
+ _X11TransClose(*trans_conn);
+ *trans_conn = NULL;
+ debug(1, (stderr, "TransConnect %s failed\n", address));
+ continue;
+ }
+ }
+ debug(4, (stderr, "Connected\n"));
+ break;
+ }
+ if (*trans_conn == NULL) {
+ panic("Can't open connection to Server");
}
- debug(4,(stderr, "Connected\n"));
- break;
- }
- if (*trans_conn == NULL) {
- panic("Can't open connection to Server");
- }
-
- ServerFD = _X11TransGetConnectionNumber(*trans_conn);
-#else /* !USE_XTRANS */
- char HostName[512];
- struct sockaddr_in sin;
- struct sockaddr_un sun;
- struct sockaddr *saddr;
- int salen;
- struct hostent *hp;
- int tmp = 1;
+
+ ServerFD = _X11TransGetConnectionNumber(*trans_conn);
+#else /* !USE_XTRANS */
+ char HostName[512];
+ struct sockaddr_in sin;
+ struct sockaddr_un sun;
+ struct sockaddr *saddr;
+ int salen;
+ struct hostent *hp;
+ int tmp = 1;
#ifndef SO_DONTLINGER
- struct linger linger;
-#endif /* SO_DONTLINGER */
-
- enterprocedure("ConnectToServer");
-
- /* establish a socket to the name server for this host */
- /* determine the host machine for this process */
- if (*server == '\0')
- {
- sun.sun_family = AF_UNIX;
- sprintf (sun.sun_path, "/tmp/.X11-unix/X%d", port - 6000);
- salen = sizeof (sun.sun_family) + strlen (sun.sun_path) + 1;
- saddr = (struct sockaddr *) &sun;
- }
- else
- {
- debug(4,(stderr, "try to connect on %s\n", server));
-
- bzero((char *)&sin, sizeof(sin));
- sin.sin_addr.s_addr = inet_addr (server);
- if ((long) sin.sin_addr.s_addr == -1)
- {
- hp = gethostbyname(server);
- if (hp == 0)
- {
- perror("gethostbyname failed");
- debug(1,(stderr, "gethostbyname failed for %s\n", server));
- panic("Can't open connection to Server");
- }
- bcopy((char *)hp->h_addr, (char *)&sin.sin_addr, hp->h_length);
+ struct linger linger;
+#endif /* SO_DONTLINGER */
+
+ enterprocedure("ConnectToServer");
+
+ /* establish a socket to the name server for this host */
+ /* determine the host machine for this process */
+ if (*server == '\0') {
+ sun.sun_family = AF_UNIX;
+ sprintf(sun.sun_path, "/tmp/.X11-unix/X%d", port - 6000);
+ salen = sizeof(sun.sun_family) + strlen(sun.sun_path) + 1;
+ saddr = (struct sockaddr *) &sun;
+ }
+ else {
+ debug(4, (stderr, "try to connect on %s\n", server));
+
+ bzero((char *) &sin, sizeof(sin));
+ sin.sin_addr.s_addr = inet_addr(server);
+ if ((long) sin.sin_addr.s_addr == -1) {
+ hp = gethostbyname(server);
+ if (hp == 0) {
+ perror("gethostbyname failed");
+ debug(1, (stderr, "gethostbyname failed for %s\n", server));
+ panic("Can't open connection to Server");
+ }
+ bcopy((char *) hp->h_addr, (char *) &sin.sin_addr, hp->h_length);
+ }
+
+ sin.sin_family = AF_INET;
+
+ if (port == ScopePort && strcmp(server, ScopeHost) == 0) {
+ char error_message[100];
+
+ (void) sprintf(error_message, "Trying to attach to myself: %s,%d\n",
+ server, sin.sin_port);
+ panic(error_message);
+ }
+
+ sin.sin_port = htons(port);
+ salen = sizeof(sin);
+ saddr = (struct sockaddr *) &sin;
}
-
- sin.sin_family = AF_INET;
-
- if (port == ScopePort
- && strcmp(server, ScopeHost) == 0)
- {
- char error_message[100];
- (void)sprintf(error_message, "Trying to attach to myself: %s,%d\n",
- server, sin.sin_port);
- panic(error_message);
- }
-
- sin.sin_port = htons (port);
- salen = sizeof (sin);
- saddr = (struct sockaddr *) &sin;
- }
-
- ServerFD = socket(saddr->sa_family, SOCK_STREAM, 0);
- if (ServerFD < 0)
- {
- perror("socket() to Server failed");
- debug(1,(stderr, "socket failed\n"));
- panic("Can't open connection to Server");
+
+ ServerFD = socket(saddr->sa_family, SOCK_STREAM, 0);
+ if (ServerFD < 0) {
+ perror("socket() to Server failed");
+ debug(1, (stderr, "socket failed\n"));
+ panic("Can't open connection to Server");
}
- (void) setsockopt(ServerFD, SOL_SOCKET, SO_REUSEADDR, (char *) NULL, 0);
+ (void) setsockopt(ServerFD, SOL_SOCKET, SO_REUSEADDR, (char *) NULL, 0);
#ifdef SO_USELOOPBACK
- (void) setsockopt(ServerFD, SOL_SOCKET, SO_USELOOPBACK,(char *) NULL, 0);
+ (void) setsockopt(ServerFD, SOL_SOCKET, SO_USELOOPBACK, (char *) NULL, 0);
#endif
- (void) setsockopt(ServerFD, IPPROTO_TCP, TCP_NODELAY, (char *) &tmp, sizeof (int));
+ (void) setsockopt(ServerFD, IPPROTO_TCP, TCP_NODELAY, (char *) &tmp,
+ sizeof(int));
#ifdef SO_DONTLINGER
- (void) setsockopt(ServerFD, SOL_SOCKET, SO_DONTLINGER, (char *) NULL, 0);
-#else /* SO_DONTLINGER */
- linger.l_onoff = 0;
- linger.l_linger = 0;
- (void) setsockopt(ServerFD, SOL_SOCKET, SO_LINGER, (char *)&linger, sizeof linger);
-#endif /* SO_DONTLINGER */
-
- /* ******************************************************** */
- /* try to connect to Server */
-
- if (connect(ServerFD, saddr, salen) < 0)
- {
- debug(4,(stderr, "connect returns errno of %d\n", errno));
- if (errno != 0)
- if (report)
- perror("connect");
- switch (errno)
- {
- case ECONNREFUSED:
- /* experience says this is because there is no Server
- to connect to */
- (void)close(ServerFD);
- debug(1,(stderr, "No Server\n"));
- if (report)
- warn("Can't open connection to Server");
- return(-1);
-
- default:
- (void)close(ServerFD);
- panic("Can't open connection to Server");
- }
+ (void) setsockopt(ServerFD, SOL_SOCKET, SO_DONTLINGER, (char *) NULL, 0);
+#else /* SO_DONTLINGER */
+ linger.l_onoff = 0;
+ linger.l_linger = 0;
+ (void) setsockopt(ServerFD, SOL_SOCKET, SO_LINGER, (char *) &linger,
+ sizeof linger);
+#endif /* SO_DONTLINGER */
+
+ /* ******************************************************** */
+ /* try to connect to Server */
+
+ if (connect(ServerFD, saddr, salen) < 0) {
+ debug(4, (stderr, "connect returns errno of %d\n", errno));
+ if (errno != 0)
+ if (report)
+ perror("connect");
+ switch (errno) {
+ case ECONNREFUSED:
+ /* experience says this is because there is no Server
+ to connect to */
+ (void) close(ServerFD);
+ debug(1, (stderr, "No Server\n"));
+ if (report)
+ warn("Can't open connection to Server");
+ return (-1);
+
+ default:
+ (void) close(ServerFD);
+ panic("Can't open connection to Server");
+ }
}
-#endif /* USE_XTRANS */
+#endif /* USE_XTRANS */
- debug(4,(stderr, "Connect To Server: FD %d\n", ServerFD));
- return(ServerFD);
+ debug(4, (stderr, "Connect To Server: FD %d\n", ServerFD));
+ return (ServerFD);
}
-
+
/* ************************************************************ */
/* */
/* Main Loop -- wait for input from any source and Process */
@@ -417,101 +406,94 @@ MakeConnection(
int
MainLoop(void)
{
- enterprocedure("MainLoop");
-
- while (true)
- {
- fd_set rfds, wfds, xfds;
- short nfds;
- short fd;
-
- /* wait for something */
-
- /* rfds = ReadDescriptors & ~BlockedReadDescriptors; */
- rfds = ReadDescriptors;
- XFD_UNSET(&rfds, &BlockedReadDescriptors);
-
- xfds = rfds;
-
- /* wfds = ReadDescriptors & WriteDescriptors; */
- XFD_ANDSET(&wfds, &ReadDescriptors, &WriteDescriptors);
-
- debug(128,(stderr, "select %d, rfds = %#lx, wfds = %#lx, RD=%#lx, BRD=%#lx, WD=%#lx\n",
- HighestFD + 1, __XFDS_BITS(&rfds, 0), __XFDS_BITS(&wfds, 0),
- __XFDS_BITS(&ReadDescriptors, 0),
- __XFDS_BITS(&BlockedReadDescriptors, 0),
- __XFDS_BITS(&WriteDescriptors, 0)));
-
- if (Interrupt || (!XFD_ANYSET(&rfds) && !XFD_ANYSET(&wfds)))
- {
- ReadCommands ();
- Interrupt = 0;
- continue;
- }
- nfds = select(HighestFD + 1, &rfds, &wfds, &xfds, (struct timeval *)NULL);
- debug(128,(stderr, "select nfds = %d, rfds = %#lx, wfds = %#lx, xfds = %#lx\n",
- nfds, __XFDS_BITS(&rfds, 0), __XFDS_BITS(&wfds, 0),
- __XFDS_BITS(&xfds, 0)));
-
- if (nfds < 0)
- {
- if (errno == EINTR)
- continue /* to end of while loop */ ;
- debug(1,(stderr, "Bad select - errno = %d\n", errno));
- if (errno == EBADF)
- {
- /* one of the bits in rfds is invalid, close down
- files until it goes away */
- EOFonFD(HighestFD);
- continue;
- }
-
- if (Interrupt)
- {
- ReadCommands ();
- Interrupt = 0;
- }
- else
- {
- panic("Select returns error");
- }
- continue /* to end of while loop */ ;
- }
-
- if (nfds == 0)
- {
- TimerExpired();
- continue;
- }
-
- /* check each fd to see if it has input */
- for (fd = 0; fd <= HighestFD; fd++)
- {
- /*
- check all returned fd's; this prevents
- starvation of later clients by earlier clients
- */
-
- if (FD_ISSET(fd,&rfds))
- {
- if (FDD[fd].InputHandler == NULL)
- {
- panic("FD selected with no handler");
- debug(1,(stderr, "FD %d has NULL handler\n", fd));
- }
- else
- (FDD[fd].InputHandler)(fd);
- }
- if (FD_ISSET(fd,&wfds))
- {
- if (FDD[fd].FlushHandler == NULL)
- {
- panic("FD selected with no flush handler");
- }
- else
- (FDD[fd].FlushHandler)(fd);
- }
- }
+ enterprocedure("MainLoop");
+
+ while (true) {
+ fd_set rfds, wfds, xfds;
+ short nfds;
+ short fd;
+
+ /* wait for something */
+
+ /* rfds = ReadDescriptors & ~BlockedReadDescriptors; */
+ rfds = ReadDescriptors;
+ XFD_UNSET(&rfds, &BlockedReadDescriptors);
+
+ xfds = rfds;
+
+ /* wfds = ReadDescriptors & WriteDescriptors; */
+ XFD_ANDSET(&wfds, &ReadDescriptors, &WriteDescriptors);
+
+ debug(128,
+ (stderr,
+ "select %d, rfds = %#lx, wfds = %#lx, RD=%#lx, BRD=%#lx, WD=%#lx\n",
+ HighestFD + 1, __XFDS_BITS(&rfds, 0), __XFDS_BITS(&wfds, 0),
+ __XFDS_BITS(&ReadDescriptors, 0),
+ __XFDS_BITS(&BlockedReadDescriptors, 0),
+ __XFDS_BITS(&WriteDescriptors, 0)));
+
+ if (Interrupt || (!XFD_ANYSET(&rfds) && !XFD_ANYSET(&wfds))) {
+ ReadCommands();
+ Interrupt = 0;
+ continue;
+ }
+ nfds =
+ select(HighestFD + 1, &rfds, &wfds, &xfds, (struct timeval *) NULL);
+ debug(128,
+ (stderr,
+ "select nfds = %d, rfds = %#lx, wfds = %#lx, xfds = %#lx\n",
+ nfds, __XFDS_BITS(&rfds, 0), __XFDS_BITS(&wfds, 0),
+ __XFDS_BITS(&xfds, 0)));
+
+ if (nfds < 0) {
+ if (errno == EINTR)
+ continue; /* to end of while loop */
+ debug(1, (stderr, "Bad select - errno = %d\n", errno));
+ if (errno == EBADF) {
+ /* one of the bits in rfds is invalid, close down
+ files until it goes away */
+ EOFonFD(HighestFD);
+ continue;
+ }
+
+ if (Interrupt) {
+ ReadCommands();
+ Interrupt = 0;
+ }
+ else {
+ panic("Select returns error");
+ }
+ continue; /* to end of while loop */
+ }
+
+ if (nfds == 0) {
+ TimerExpired();
+ continue;
+ }
+
+ /* check each fd to see if it has input */
+ for (fd = 0; fd <= HighestFD; fd++) {
+ /*
+ check all returned fd's; this prevents
+ starvation of later clients by earlier clients
+ */
+
+ if (FD_ISSET(fd, &rfds)) {
+ if (FDD[fd].InputHandler == NULL) {
+ panic("FD selected with no handler");
+ debug(1, (stderr, "FD %d has NULL handler\n", fd));
+ }
+ else
+ (FDD[fd].InputHandler) (fd);
+ }
+ if (FD_ISSET(fd, &wfds)) {
+ if (FDD[fd].FlushHandler == NULL) {
+ panic("FD selected with no flush handler");
+ }
+ else
+ (FDD[fd].FlushHandler) (fd);
+ }
+ }
}
- return 0;
+ return 0;
}
diff --git a/fd.h b/fd.h
index 005e62d..85cdd25 100644
--- a/fd.h
+++ b/fd.h
@@ -1,8 +1,8 @@
-/* **********************************************
- * *
- * header file file descriptor (FD) code *
- * *
- * James Peterson, 1987 *
+/*
+ * header file for file descriptor (FD) code
+ *
+ * James Peterson, 1987
+ *
* Copyright (C) 1987 MCC
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -22,8 +22,9 @@
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
- * *
- * *
+ *
+ */
+/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -45,12 +46,12 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
- ********************************************** */
+ */
#ifndef XSCOPE_FD_H
#define XSCOPE_FD_H
-/*
+/*
the following structure remembers for each file descriptor its
state. In particular, we need to know if it is busy or free
and if it is in use, by whom.
@@ -67,34 +68,33 @@ typedef void *XtransConnInfo;
typedef int FD;
-struct FDDescriptor
-{
+struct FDDescriptor {
Boolean Busy;
- void (*InputHandler)(int);
- void (*FlushHandler)(int);
+ void (*InputHandler) (int);
+ void (*FlushHandler) (int);
#ifdef USE_XTRANS
XtransConnInfo trans_conn;
#endif
};
-extern struct FDDescriptor *FDD /* array of FD descriptors */ ;
-extern int MaxFD /* maximum number of FD's possible */ ;
+extern struct FDDescriptor *FDD; /* array of FD descriptors */
+extern int MaxFD; /* maximum number of FD's possible */
+extern int nFDsInUse; /* number of FD's actually in use */
-extern int nFDsInUse /* number of FD's actually in use */ ;
-
-extern fd_set ReadDescriptors /* bit map of FD's in use -- for select */ ;
-extern fd_set WriteDescriptors /* bit map of write blocked FD's -- for select */;
-extern fd_set BlockedReadDescriptors /* bit map of FD's blocked from reading */;
-extern int HighestFD /* highest FD in use -- for select */ ;
+extern fd_set ReadDescriptors; /* bit map of FD's in use -- for select */
+extern fd_set WriteDescriptors; /* bit map of write blocked FD's -- for select */
+extern fd_set BlockedReadDescriptors; /* bit map of FD's blocked from reading */
+extern int HighestFD; /* highest FD in use -- for select */
extern void InitializeFD(void);
-extern void UsingFD(FD fd, void (*Handler)(int), void (*FlushHandler)(int),
- XtransConnInfo trans_conn);
+
+extern void UsingFD(FD fd, void (*Handler) (int), void (*FlushHandler) (int),
+ XtransConnInfo trans_conn);
extern void NotUsingFD(FD fd);
-extern FD AcceptConnection (FD ConnectionSocket);
-extern FD MakeConnection (const char *server, short port, int report,
- XtransConnInfo *trans_conn);
+extern FD AcceptConnection(FD ConnectionSocket);
+extern FD MakeConnection(const char *server, short port, int report,
+ XtransConnInfo * trans_conn);
extern int MainLoop(void);
@@ -102,4 +102,4 @@ extern int MainLoop(void);
extern XtransConnInfo GetXTransConnInfo(FD fd);
#endif
-#endif /* XSCOPE_FD_H */
+#endif /* XSCOPE_FD_H */
diff --git a/glxscope.h b/glxscope.h
index 89f1227..24e19d9 100644
--- a/glxscope.h
+++ b/glxscope.h
@@ -12,63 +12,61 @@
#define printfield(a,b,c,d,e) if (Verbose > 1) PrintField(a,b,c,d,e)
-extern void GLXRender (FD fd, const unsigned char *buf);
-extern void GLXRenderLarge (FD fd, const unsigned char *buf);
-extern void GLXCreateContext (FD fd, const unsigned char *buf);
-extern void GLXDestroyContext (FD fd, const unsigned char *buf);
-extern void GLXMakeCurrent (FD fd, const unsigned char *buf);
-extern void GLXMakeCurrentReply (FD fd, const unsigned char *buf);
-extern void GLXIsDirect (FD fd, const unsigned char *buf);
-extern void GLXIsDirectReply (FD fd, const unsigned char *buf);
-extern void GLXQueryVersion (FD fd, const unsigned char *buf);
-extern void GLXQueryVersionReply (FD fd, const unsigned char *buf);
-extern void GLXWaitGL (FD fd, const unsigned char *buf);
-extern void GLXWaitX (FD fd, const unsigned char *buf);
-extern void GLXCopyContext (FD fd, const unsigned char *buf);
-extern void GLXSwapBuffers (FD fd, const unsigned char *buf);
-extern void GLXUseXFont (FD fd, const unsigned char *buf);
-extern void GLXCreateGLXPixmap (FD fd, const unsigned char *buf);
-extern void GLXGetVisualConfigs (FD fd, const unsigned char *buf);
-extern void GLXGetVisualConfigsReply (FD fd, const unsigned char *buf);
-extern void GLXDestroyGLXPixmap (FD fd, const unsigned char *buf);
-extern void GLXVendorPrivate (FD fd, const unsigned char *buf);
-extern void GLXVendorPrivateWithReply (FD fd, const unsigned char *buf);
+extern void GLXRender(FD fd, const unsigned char *buf);
+extern void GLXRenderLarge(FD fd, const unsigned char *buf);
+extern void GLXCreateContext(FD fd, const unsigned char *buf);
+extern void GLXDestroyContext(FD fd, const unsigned char *buf);
+extern void GLXMakeCurrent(FD fd, const unsigned char *buf);
+extern void GLXMakeCurrentReply(FD fd, const unsigned char *buf);
+extern void GLXIsDirect(FD fd, const unsigned char *buf);
+extern void GLXIsDirectReply(FD fd, const unsigned char *buf);
+extern void GLXQueryVersion(FD fd, const unsigned char *buf);
+extern void GLXQueryVersionReply(FD fd, const unsigned char *buf);
+extern void GLXWaitGL(FD fd, const unsigned char *buf);
+extern void GLXWaitX(FD fd, const unsigned char *buf);
+extern void GLXCopyContext(FD fd, const unsigned char *buf);
+extern void GLXSwapBuffers(FD fd, const unsigned char *buf);
+extern void GLXUseXFont(FD fd, const unsigned char *buf);
+extern void GLXCreateGLXPixmap(FD fd, const unsigned char *buf);
+extern void GLXGetVisualConfigs(FD fd, const unsigned char *buf);
+extern void GLXGetVisualConfigsReply(FD fd, const unsigned char *buf);
+extern void GLXDestroyGLXPixmap(FD fd, const unsigned char *buf);
+extern void GLXVendorPrivate(FD fd, const unsigned char *buf);
+extern void GLXVendorPrivateWithReply(FD fd, const unsigned char *buf);
extern void GLXVendorPrivateWithReplyReply(FD fd, const unsigned char *buf);
-extern void GLXQueryExtensionsString (FD fd, const unsigned char *buf);
+extern void GLXQueryExtensionsString(FD fd, const unsigned char *buf);
extern void GLXQueryExtensionsStringReply(FD fd, const unsigned char *buf);
-extern void GLXQueryServerString (FD fd, const unsigned char *buf);
-extern void GLXQueryServerStringReply (FD fd, const unsigned char *buf);
-extern void GLXClientInfo (FD fd, const unsigned char *buf);
-extern void GLXGetFBConfigs (FD fd, const unsigned char *buf);
-extern void GLXGetFBConfigsReply (FD fd, const unsigned char *buf);
-extern void GLXCreatePixmap (FD fd, const unsigned char *buf);
-extern void GLXDestroyPixmap (FD fd, const unsigned char *buf);
-extern void GLXCreateNewContext (FD fd, const unsigned char *buf);
-extern void GLXQueryContext (FD fd, const unsigned char *buf);
-extern void GLXQueryContextReply (FD fd, const unsigned char *buf);
-extern void GLXMakeContextCurrent (FD fd, const unsigned char *buf);
-extern void GLXMakeContextCurrentReply (FD fd, const unsigned char *buf);
-extern void GLXCreatePbuffer (FD fd, const unsigned char *buf);
-extern void GLXDestroyPbuffer (FD fd, const unsigned char *buf);
-extern void GLXGetDrawableAttributes (FD fd, const unsigned char *buf);
+extern void GLXQueryServerString(FD fd, const unsigned char *buf);
+extern void GLXQueryServerStringReply(FD fd, const unsigned char *buf);
+extern void GLXClientInfo(FD fd, const unsigned char *buf);
+extern void GLXGetFBConfigs(FD fd, const unsigned char *buf);
+extern void GLXGetFBConfigsReply(FD fd, const unsigned char *buf);
+extern void GLXCreatePixmap(FD fd, const unsigned char *buf);
+extern void GLXDestroyPixmap(FD fd, const unsigned char *buf);
+extern void GLXCreateNewContext(FD fd, const unsigned char *buf);
+extern void GLXQueryContext(FD fd, const unsigned char *buf);
+extern void GLXQueryContextReply(FD fd, const unsigned char *buf);
+extern void GLXMakeContextCurrent(FD fd, const unsigned char *buf);
+extern void GLXMakeContextCurrentReply(FD fd, const unsigned char *buf);
+extern void GLXCreatePbuffer(FD fd, const unsigned char *buf);
+extern void GLXDestroyPbuffer(FD fd, const unsigned char *buf);
+extern void GLXGetDrawableAttributes(FD fd, const unsigned char *buf);
extern void GLXGetDrawableAttributesReply(FD fd, const unsigned char *buf);
-extern void GLXChangeDrawableAttributes (FD fd, const unsigned char *buf);
-extern void GLXCreateWindow (FD fd, const unsigned char *buf);
-extern void GLXDestroyWindow (FD fd, const unsigned char *buf);
-
-extern void GLXBadContextError (FD fd, const unsigned char *buf);
-extern void GLXBadContextStateError (FD fd, const unsigned char *buf);
-extern void GLXBadDrawableError (FD fd, const unsigned char *buf);
-extern void GLXBadPixmapError (FD fd, const unsigned char *buf);
-extern void GLXBadContextTagError (FD fd, const unsigned char *buf);
-extern void GLXBadCurrentWindowError (FD fd, const unsigned char *buf);
-extern void GLXBadRenderRequestError (FD fd, const unsigned char *buf);
-extern void GLXBadLargeRequestError (FD fd, const unsigned char *buf);
+extern void GLXChangeDrawableAttributes(FD fd, const unsigned char *buf);
+extern void GLXCreateWindow(FD fd, const unsigned char *buf);
+extern void GLXDestroyWindow(FD fd, const unsigned char *buf);
+extern void GLXBadContextError(FD fd, const unsigned char *buf);
+extern void GLXBadContextStateError(FD fd, const unsigned char *buf);
+extern void GLXBadDrawableError(FD fd, const unsigned char *buf);
+extern void GLXBadPixmapError(FD fd, const unsigned char *buf);
+extern void GLXBadContextTagError(FD fd, const unsigned char *buf);
+extern void GLXBadCurrentWindowError(FD fd, const unsigned char *buf);
+extern void GLXBadRenderRequestError(FD fd, const unsigned char *buf);
+extern void GLXBadLargeRequestError(FD fd, const unsigned char *buf);
extern void GLXUnsupportedPrivateRequestError(FD fd, const unsigned char *buf);
-extern void GLXBadFBConfigError (FD fd, const unsigned char *buf);
-extern void GLXBadPbufferError (FD fd, const unsigned char *buf);
-extern void GLXBadCurrentDrawableError (FD fd, const unsigned char *buf);
-extern void GLXBadWindowError (FD fd, const unsigned char *buf);
+extern void GLXBadFBConfigError(FD fd, const unsigned char *buf);
+extern void GLXBadPbufferError(FD fd, const unsigned char *buf);
+extern void GLXBadCurrentDrawableError(FD fd, const unsigned char *buf);
+extern void GLXBadWindowError(FD fd, const unsigned char *buf);
#endif
-
diff --git a/lbxscope.h b/lbxscope.h
index 267033e..f32b396 100644
--- a/lbxscope.h
+++ b/lbxscope.h
@@ -3,18 +3,18 @@ Copyright 1990, 1991 by Sun Microsystems, Inc. and the X Consortium.
All Rights Reserved
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
+both that copyright notice and this permission notice appear in
supporting documentation, and that the names of Sun Microsystems,
-the X Consortium, and MIT not be used in advertising or publicity
-pertaining to distribution of the software without specific, written
-prior permission.
+the X Consortium, and MIT not be used in advertising or publicity
+pertaining to distribution of the software without specific, written
+prior permission.
-SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
-SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
+SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
@@ -39,16 +39,15 @@ SOFTWARE.
extern unsigned char LBXEvent;
-extern void LbxQueryVersion (FD fd, const unsigned char *buf);
-extern void LbxQueryVersionReply (FD fd, const unsigned char *buf);
-extern void LbxStartProxy (FD fd, const unsigned char *buf);
-extern void LbxStopProxy (FD fd, const unsigned char *buf);
-extern void LbxNewClient (FD fd, const unsigned char *buf);
-extern void LbxCloseClient (FD fd, const unsigned char *buf);
-extern void LbxSwitch (FD fd, const unsigned char *buf);
-extern void LbxModifySequence (FD fd, const unsigned char *buf);
-extern void LbxSwitchEvent (FD fd, const unsigned char *buf);
-extern void LbxCloseEvent (FD fd, const unsigned char *buf);
+extern void LbxQueryVersion(FD fd, const unsigned char *buf);
+extern void LbxQueryVersionReply(FD fd, const unsigned char *buf);
+extern void LbxStartProxy(FD fd, const unsigned char *buf);
+extern void LbxStopProxy(FD fd, const unsigned char *buf);
+extern void LbxNewClient(FD fd, const unsigned char *buf);
+extern void LbxCloseClient(FD fd, const unsigned char *buf);
+extern void LbxSwitch(FD fd, const unsigned char *buf);
+extern void LbxModifySequence(FD fd, const unsigned char *buf);
+extern void LbxSwitchEvent(FD fd, const unsigned char *buf);
+extern void LbxCloseEvent(FD fd, const unsigned char *buf);
#endif
-
diff --git a/nas.h b/nas.h
index 04d169f..bcbccf0 100644
--- a/nas.h
+++ b/nas.h
@@ -15,7 +15,7 @@
/* */
/* ************************************************************ */
-/*
+/*
In general, we are called with a buffer of bytes and are supposed to
try to make sense of these bytes according to the NAS protocol. There
are two different types of communication: requests from the client to
@@ -32,7 +32,7 @@
have until more bytes arrive.
In general, we do two things: we wait for some number of bytes, and
- then we interpret this set of bytes. To interpret this data we use
+ then we interpret this set of bytes. To interpret this data we use
a modified state machine. We keep two pieces of information:
(1) the number of bytes that we need
@@ -46,7 +46,7 @@
The data going from the client to the x11 server consists of a
set-up message followed by an infinite stream of variable length
- requests.
+ requests.
Our overall flow is then:
@@ -55,7 +55,7 @@
length of the rest of the message.
(c) Wait for the rest of the set-up message.
(d) Interpret and print the set-up message.
-
+
*** end of set-up phase -- start normal request loop ***
(e) Wait for 4 bytes.
@@ -96,19 +96,19 @@
This latter seems more effective. It appears reply/error/event formats
were selected to allow waiting for 32 bytes, and it will allow short packets
which are only 32 bytes long, to be processed completely in one step.
-
- Thus, For normal reply/error/event processing we have
+
+ Thus, For normal reply/error/event processing we have
(e) Wait for 32 bytes.
(f) Interpret these 32 bytes. If possible, go back to step (e).
(g) If the packet is a reply with bytes 4-7 non-zero, wait for the
remainder of the the reply.
(h) Interpret and print the longer reply. Go back to step (e).
-
+
The similarity in approach to how both the client and server are handled
suggests we can use the same control structure to drive the interpretation
- of both types of communication client->server and server->client.
+ of both types of communication client->server and server->client.
Accordingly, we package up the relevant variables in a ConnState
record. The ConnState record contains the buffer of saved bytes (if any),
the size and length of this buffer, the number of bytes we are waiting for
@@ -123,77 +123,76 @@
*/
/* audio.c */
-extern void NewAudio (FD fd);
-extern void InitializeAudio (void);
+extern void NewAudio(FD fd);
+extern void InitializeAudio(void);
/* decodenas.c */
-extern void DecodeAudioRequest (FD fd, const unsigned char *buf, long n);
-extern void DecodeAudioReply (FD fd, const unsigned char *buf, long n);
-extern void DecodeAudioEvent (FD fd, const unsigned char *buf, long n);
-extern void DecodeAudioError (FD fd, const unsigned char *buf, long n);
-
-extern void InitializeAudioDecode (void);
+extern void DecodeAudioRequest(FD fd, const unsigned char *buf, long n);
+extern void DecodeAudioReply(FD fd, const unsigned char *buf, long n);
+extern void DecodeAudioEvent(FD fd, const unsigned char *buf, long n);
+extern void DecodeAudioError(FD fd, const unsigned char *buf, long n);
+extern void InitializeAudioDecode(void);
/* printnas.c */
-extern void PrintAudioSetUpMessage (const unsigned char *buf);
-extern void PrintAudioSetUpReply (const unsigned char *buf);
-extern void AudioElementNotify (const unsigned char *buf);
-extern void AudioGrabNotify (const unsigned char *buf);
-extern void AudioMonitorNotify (const unsigned char *buf);
-extern void AudioBucketNotify (const unsigned char *buf);
-extern void AudioDeviceNotify (const unsigned char *buf);
-extern void UnknownAudioReply (const unsigned char *buf);
-extern void AudioListDevices (const unsigned char *buf);
-extern void AudioListDevicesReply (const unsigned char *buf);
-extern void AudioGetDeviceAttributes (const unsigned char *buf);
-extern void AudioGetDeviceAttributesReply (const unsigned char *buf);
-extern void AudioSetDeviceAttributes (const unsigned char *buf);
-extern void AudioCreateBucket (const unsigned char *buf);
-extern void AudioDestroyBucket (const unsigned char *buf);
-extern void AudioListBuckets (const unsigned char *buf);
-extern void AudioListBucketsReply (const unsigned char *buf);
-extern void AudioGetBucketAttributes (const unsigned char *buf);
-extern void AudioGetBucketAttributesReply (const unsigned char *buf);
-extern void AudioSetBucketAttributes (const unsigned char *buf);
-extern void AudioCreateRadio (const unsigned char *buf);
-extern void AudioDestroyRadio (const unsigned char *buf);
-extern void AudioListRadios (const unsigned char *buf);
-extern void AudioListRadiosReply (const unsigned char *buf);
-extern void AudioGetRadioAttributes (const unsigned char *buf);
-extern void AudioGetRadioAttributesReply (const unsigned char *buf);
-extern void AudioSetRadioAttributes (const unsigned char *buf);
-extern void AudioCreateFlow (const unsigned char *buf);
-extern void AudioDestroyFlow (const unsigned char *buf);
-extern void AudioGetFlowAttributes (const unsigned char *buf);
-extern void AudioGetFlowAttributesReply (const unsigned char *buf);
-extern void AudioSetFlowAttributes (const unsigned char *buf);
-extern void AudioGetElements (const unsigned char *buf);
-extern void AudioGetElementsReply (const unsigned char *buf);
-extern void AudioSetElements (const unsigned char *buf);
-extern void AudioGetElementStates (const unsigned char *buf);
-extern void AudioElementState (const unsigned char *buf);
-extern void AudioGetElementStatesReply (const unsigned char *buf);
-extern void AudioSetElementStates (const unsigned char *buf);
-extern void AudioGetElementParameters (const unsigned char *buf);
-extern void AudioGetElementParametersReply (const unsigned char *buf);
-extern void AudioSetElementParameters (const unsigned char *buf);
-extern void AudioWriteElement (const unsigned char *buf);
-extern void AudioReadElement (const unsigned char *buf);
-extern void AudioReadElementReply (const unsigned char *buf);
-extern void AudioGrabComponent (const unsigned char *buf);
-extern void AudioUngrabComponent (const unsigned char *buf);
-extern void AudioSendEvent (const unsigned char *buf);
-extern void AudioGetAllowedUsers (const unsigned char *buf);
-extern void AudioGetAllowedUsersReply (const unsigned char *buf);
-extern void AudioSetAllowedUsers (const unsigned char *buf);
-extern void AudioListExtensions (const unsigned char *buf);
-extern void AudioListExtensionsReply (const unsigned char *buf);
-extern void AudioQueryExtension (const unsigned char *buf);
-extern void AudioQueryExtensionReply (const unsigned char *buf);
-extern void AudioGetCloseDownMode (const unsigned char *buf);
-extern void AudioGetCloseDownModeReply (const unsigned char *buf);
-extern void AudioSetCloseDownMode (const unsigned char *buf);
-extern void AudioKillClient (const unsigned char *buf);
-extern void AudioGetServerTime (const unsigned char *buf);
-extern void AudioGetServerTimeReply (const unsigned char *buf);
-extern void AudioNoOperation (const unsigned char *buf);
+extern void PrintAudioSetUpMessage(const unsigned char *buf);
+extern void PrintAudioSetUpReply(const unsigned char *buf);
+extern void AudioElementNotify(const unsigned char *buf);
+extern void AudioGrabNotify(const unsigned char *buf);
+extern void AudioMonitorNotify(const unsigned char *buf);
+extern void AudioBucketNotify(const unsigned char *buf);
+extern void AudioDeviceNotify(const unsigned char *buf);
+extern void UnknownAudioReply(const unsigned char *buf);
+extern void AudioListDevices(const unsigned char *buf);
+extern void AudioListDevicesReply(const unsigned char *buf);
+extern void AudioGetDeviceAttributes(const unsigned char *buf);
+extern void AudioGetDeviceAttributesReply(const unsigned char *buf);
+extern void AudioSetDeviceAttributes(const unsigned char *buf);
+extern void AudioCreateBucket(const unsigned char *buf);
+extern void AudioDestroyBucket(const unsigned char *buf);
+extern void AudioListBuckets(const unsigned char *buf);
+extern void AudioListBucketsReply(const unsigned char *buf);
+extern void AudioGetBucketAttributes(const unsigned char *buf);
+extern void AudioGetBucketAttributesReply(const unsigned char *buf);
+extern void AudioSetBucketAttributes(const unsigned char *buf);
+extern void AudioCreateRadio(const unsigned char *buf);
+extern void AudioDestroyRadio(const unsigned char *buf);
+extern void AudioListRadios(const unsigned char *buf);
+extern void AudioListRadiosReply(const unsigned char *buf);
+extern void AudioGetRadioAttributes(const unsigned char *buf);
+extern void AudioGetRadioAttributesReply(const unsigned char *buf);
+extern void AudioSetRadioAttributes(const unsigned char *buf);
+extern void AudioCreateFlow(const unsigned char *buf);
+extern void AudioDestroyFlow(const unsigned char *buf);
+extern void AudioGetFlowAttributes(const unsigned char *buf);
+extern void AudioGetFlowAttributesReply(const unsigned char *buf);
+extern void AudioSetFlowAttributes(const unsigned char *buf);
+extern void AudioGetElements(const unsigned char *buf);
+extern void AudioGetElementsReply(const unsigned char *buf);
+extern void AudioSetElements(const unsigned char *buf);
+extern void AudioGetElementStates(const unsigned char *buf);
+extern void AudioElementState(const unsigned char *buf);
+extern void AudioGetElementStatesReply(const unsigned char *buf);
+extern void AudioSetElementStates(const unsigned char *buf);
+extern void AudioGetElementParameters(const unsigned char *buf);
+extern void AudioGetElementParametersReply(const unsigned char *buf);
+extern void AudioSetElementParameters(const unsigned char *buf);
+extern void AudioWriteElement(const unsigned char *buf);
+extern void AudioReadElement(const unsigned char *buf);
+extern void AudioReadElementReply(const unsigned char *buf);
+extern void AudioGrabComponent(const unsigned char *buf);
+extern void AudioUngrabComponent(const unsigned char *buf);
+extern void AudioSendEvent(const unsigned char *buf);
+extern void AudioGetAllowedUsers(const unsigned char *buf);
+extern void AudioGetAllowedUsersReply(const unsigned char *buf);
+extern void AudioSetAllowedUsers(const unsigned char *buf);
+extern void AudioListExtensions(const unsigned char *buf);
+extern void AudioListExtensionsReply(const unsigned char *buf);
+extern void AudioQueryExtension(const unsigned char *buf);
+extern void AudioQueryExtensionReply(const unsigned char *buf);
+extern void AudioGetCloseDownMode(const unsigned char *buf);
+extern void AudioGetCloseDownModeReply(const unsigned char *buf);
+extern void AudioSetCloseDownMode(const unsigned char *buf);
+extern void AudioKillClient(const unsigned char *buf);
+extern void AudioGetServerTime(const unsigned char *buf);
+extern void AudioGetServerTimeReply(const unsigned char *buf);
+extern void AudioNoOperation(const unsigned char *buf);
diff --git a/print11.c b/print11.c
index 400ec20..e7da143 100644
--- a/print11.c
+++ b/print11.c
@@ -1,8 +1,8 @@
-/* ************************************************** *
- * *
- * Request, Reply, Event, Error Printing *
- * *
- * James Peterson, 1988 *
+/*
+ * Request, Reply, Event, Error Printing
+ *
+ * James Peterson, 1988
+ *
* Copyright (C) 1988 MCC
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -22,7 +22,9 @@
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
- * *
+ *
+ */
+/*
* Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -44,7 +46,7 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
- * ************************************************** */
+ */
#include "scope.h"
#include "x11.h"
@@ -90,89 +92,86 @@ static void ListFontsWithInfoReply2(const unsigned char *buf);
/* ************************************************************ */
void
-PrintSetUpMessage (
- const unsigned char *buf)
+PrintSetUpMessage(const unsigned char *buf)
{
- short n;
- short d;
+ short n;
+ short d;
- enterprocedure("PrintSetUpMessage");
- if (Verbose < 1)
- return;
- SetIndentLevel(PRINTCLIENT);
- PrintField(buf, 0, 1, BYTEMODE, "byte-order");
- PrintField(buf, 2, 2, CARD16, "major-version");
- PrintField(buf, 4, 2, CARD16, "minor-version");
- printfield(buf, 6, 2, DVALUE2(n), "length of name");
- n = IShort(&buf[6]);
- printfield(buf, 8, 2, DVALUE2(d), "length of data");
- d = IShort(&buf[8]);
- PrintString8(&buf[12], n, "authorization-protocol-name");
- PrintString8(&buf[pad((long)(12 + n))], d, "authorization-protocol-data");
+ enterprocedure("PrintSetUpMessage");
+ if (Verbose < 1)
+ return;
+ SetIndentLevel(PRINTCLIENT);
+ PrintField(buf, 0, 1, BYTEMODE, "byte-order");
+ PrintField(buf, 2, 2, CARD16, "major-version");
+ PrintField(buf, 4, 2, CARD16, "minor-version");
+ printfield(buf, 6, 2, DVALUE2(n), "length of name");
+ n = IShort(&buf[6]);
+ printfield(buf, 8, 2, DVALUE2(d), "length of data");
+ d = IShort(&buf[8]);
+ PrintString8(&buf[12], n, "authorization-protocol-name");
+ PrintString8(&buf[pad((long) (12 + n))], d, "authorization-protocol-data");
}
void
-PrintSetUpReply (
- const unsigned char *buf)
+PrintSetUpReply(const unsigned char *buf)
{
- enterprocedure("PrintSetUpReply");
- SetIndentLevel(PRINTSERVER);
- if (IByte(&buf[0]))
- PrintSuccessfulSetUpReply(buf);
- else
- PrintFailedSetUpReply(buf);
+ enterprocedure("PrintSetUpReply");
+ SetIndentLevel(PRINTSERVER);
+ if (IByte(&buf[0]))
+ PrintSuccessfulSetUpReply(buf);
+ else
+ PrintFailedSetUpReply(buf);
}
static void
-PrintFailedSetUpReply (
- const unsigned char *buf)
+PrintFailedSetUpReply(const unsigned char *buf)
{
- short n;
+ short n;
- PrintField(buf, 0, 1, 0, "SetUp Failed");
- if (Verbose < 1)
- return;
- printfield(buf, 1, 1, DVALUE1(n), "length of reason in bytes");
- n = IByte(&buf[1]);
- PrintField(buf, 2, 2, CARD16, "major-version");
- PrintField(buf, 4, 2, CARD16, "minor-version");
- printfield(buf, 6, 2, DVALUE2((n + p) / 4), "length of data");
- PrintString8(&buf[8], n, "reason");
+ PrintField(buf, 0, 1, 0, "SetUp Failed");
+ if (Verbose < 1)
+ return;
+ printfield(buf, 1, 1, DVALUE1(n), "length of reason in bytes");
+ n = IByte(&buf[1]);
+ PrintField(buf, 2, 2, CARD16, "major-version");
+ PrintField(buf, 4, 2, CARD16, "minor-version");
+ printfield(buf, 6, 2, DVALUE2((n + p) / 4), "length of data");
+ PrintString8(&buf[8], n, "reason");
}
static void
-PrintSuccessfulSetUpReply (
- const unsigned char *buf)
-{
- short v;
- short n;
- short m;
-
- if (Verbose < 1)
- return;
- PrintField(buf, 2, 2, CARD16, "protocol-major-version");
- PrintField(buf, 4, 2, CARD16, "protocol-minor-version");
- printfield(buf, 6, 2, DVALUE2(8 + 2*n + (v + p + m) / 4), "length of data");
- PrintField(buf, 8, 4, CARD32, "release-number");
- PrintField(buf, 12, 4, CARD32, "resource-id-base");
- PrintField(buf, 16, 4, CARD32, "resource-id-mask");
- PrintField(buf, 20, 4, CARD32, "motion-buffer-size");
- printfield(buf, 24, 2, DVALUE2(v), "length of vendor");
- v = IShort(&buf[24]);
- printfield(buf, 26, 2, CARD16, "maximum-request-length");
- printfield(buf, 28, 1, CARD8, "number of roots");
- m = IByte(&buf[28]);
- printfield(buf, 29, 1, DVALUE1(n), "number of pixmap-formats");
- n = IByte(&buf[29]);
- PrintField(buf, 30, 1, BYTEORDER, "image-byte-order");
- PrintField(buf, 31, 1, BYTEORDER, "bitmap-format-bit-order");
- PrintField(buf, 32, 1, CARD8, "bitmap-format-scanline-unit");
- PrintField(buf, 33, 1, CARD8, "bitmap-format-scanline-pad");
- PrintField(buf, 34, 1, KEYCODE, "min-keycode");
- PrintField(buf, 35, 1, KEYCODE, "max-keycode");
- PrintString8(&buf[40], v, "vendor");
- PrintList(&buf[pad((long)(40 + v))], (long)n, FORMAT, "pixmap-formats");
- PrintList(&buf[pad((long)(40 + v) + 8 * n)], (long)m, SCREEN, "roots");
+PrintSuccessfulSetUpReply(const unsigned char *buf)
+{
+ short v;
+ short n;
+ short m;
+
+ if (Verbose < 1)
+ return;
+ PrintField(buf, 2, 2, CARD16, "protocol-major-version");
+ PrintField(buf, 4, 2, CARD16, "protocol-minor-version");
+ printfield(buf, 6, 2, DVALUE2(8 + 2 * n + (v + p + m) / 4),
+ "length of data");
+ PrintField(buf, 8, 4, CARD32, "release-number");
+ PrintField(buf, 12, 4, CARD32, "resource-id-base");
+ PrintField(buf, 16, 4, CARD32, "resource-id-mask");
+ PrintField(buf, 20, 4, CARD32, "motion-buffer-size");
+ printfield(buf, 24, 2, DVALUE2(v), "length of vendor");
+ v = IShort(&buf[24]);
+ printfield(buf, 26, 2, CARD16, "maximum-request-length");
+ printfield(buf, 28, 1, CARD8, "number of roots");
+ m = IByte(&buf[28]);
+ printfield(buf, 29, 1, DVALUE1(n), "number of pixmap-formats");
+ n = IByte(&buf[29]);
+ PrintField(buf, 30, 1, BYTEORDER, "image-byte-order");
+ PrintField(buf, 31, 1, BYTEORDER, "bitmap-format-bit-order");
+ PrintField(buf, 32, 1, CARD8, "bitmap-format-scanline-unit");
+ PrintField(buf, 33, 1, CARD8, "bitmap-format-scanline-pad");
+ PrintField(buf, 34, 1, KEYCODE, "min-keycode");
+ PrintField(buf, 35, 1, KEYCODE, "max-keycode");
+ PrintString8(&buf[40], v, "vendor");
+ PrintList(&buf[pad((long) (40 + v))], (long) n, FORMAT, "pixmap-formats");
+ PrintList(&buf[pad((long) (40 + v) + 8 * n)], (long) m, SCREEN, "roots");
}
/* ************************************************************ */
@@ -194,230 +193,212 @@ const char REPLYHEADER[] = "..............REPLY";
/* Error Printing procedures */
void
-RequestError (
- const unsigned char *buf)
+RequestError(const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Request */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Request */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
void
-ValueError (
- const unsigned char *buf)
+ValueError(const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Value */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, INT32, "bad value");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Value */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, INT32, "bad value");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
void
-WindowError (
- const unsigned char *buf)
+WindowError(const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Window */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, CARD32, "bad resource id");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Window */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, CARD32, "bad resource id");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
void
-PixmapError (
- const unsigned char *buf)
+PixmapError(const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Pixmap */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, CARD32, "bad resource id");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Pixmap */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, CARD32, "bad resource id");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
void
-AtomError (
- const unsigned char *buf)
+AtomError(const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Atom */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, CARD32, "bad atom id");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Atom */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, CARD32, "bad atom id");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
void
-CursorError (
- const unsigned char *buf)
+CursorError(const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Cursor */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, CARD32, "bad resource id");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Cursor */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, CARD32, "bad resource id");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
void
-FontError (
- const unsigned char *buf)
+FontError(const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Font */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, CARD32, "bad resource id");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Font */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, CARD32, "bad resource id");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
void
-MatchError (
- const unsigned char *buf)
+MatchError(const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Match */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Match */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
void
-DrawableError (
- const unsigned char *buf)
+DrawableError(const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Drawable */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, CARD32, "bad resource id");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Drawable */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, CARD32, "bad resource id");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
void
-AccessError (
- const unsigned char *buf)
+AccessError(const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Access */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Access */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
void
-AllocError (
- const unsigned char *buf)
+AllocError(const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Alloc */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Alloc */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
void
-ColormapError (
- const unsigned char *buf)
+ColormapError(const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Colormap */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, CARD32, "bad resource id");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Colormap */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, CARD32, "bad resource id");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
void
-GContextError (
- const unsigned char *buf)
+GContextError(const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* GContext */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, CARD32, "bad resource id");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* GContext */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, CARD32, "bad resource id");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
void
-IDChoiceError (
- const unsigned char *buf)
+IDChoiceError(const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* IDChoice */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, CARD32, "bad resource id");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* IDChoice */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, CARD32, "bad resource id");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
void
-NameError (
- const unsigned char *buf)
+NameError(const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Name */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Name */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
void
-LengthError (
- const unsigned char *buf)
+LengthError(const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Length */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Length */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
void
-ImplementationError (
- const unsigned char *buf)
+ImplementationError(const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Implementation */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Implementation */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
void
-UnknownError (
- const unsigned char *buf)
+UnknownError(const unsigned char *buf)
{
- PrintField(RBf, 1, 1, ERROR, ERRORHEADER);
- if (Verbose < 1)
- return;
- printfield (buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, CARD32, "bad resource id");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(RBf, 1, 1, ERROR, ERRORHEADER);
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, CARD32, "bad resource id");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
/* ************************************************************ */
@@ -428,552 +409,518 @@ UnknownError (
/* Event Printing procedures */
void
-KeyPressEvent (
- const unsigned char *buf)
-{
- PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* KeyPress */ ;
- if (Verbose < 1)
- return;
- PrintField(buf, 1, 1, KEYCODE, "detail");
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, TIMESTAMP, "time");
- PrintField(buf, 8, 4, WINDOW, "root");
- PrintField(buf, 12, 4, WINDOW, "event");
- PrintField(buf, 16, 4, WINDOW, "child");
- PrintField(buf, 20, 2, INT16, "root-x");
- PrintField(buf, 22, 2, INT16, "root-y");
- PrintField(buf, 24, 2, INT16, "event-x");
- PrintField(buf, 26, 2, INT16, "event-y");
- PrintField(buf, 28, 2, SETofKEYBUTMASK, "state");
- PrintField(buf, 30, 1, BOOL, "same-screen");
-}
-
-void
-KeyReleaseEvent (
- const unsigned char *buf)
-{
- PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* KeyRelease */ ;
- if (Verbose < 1)
- return;
- PrintField(buf, 1, 1, KEYCODE, "detail");
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, TIMESTAMP, "time");
- PrintField(buf, 8, 4, WINDOW, "root");
- PrintField(buf, 12, 4, WINDOW, "event");
- PrintField(buf, 16, 4, WINDOW, "child");
- PrintField(buf, 20, 2, INT16, "root-x");
- PrintField(buf, 22, 2, INT16, "root-y");
- PrintField(buf, 24, 2, INT16, "event-x");
- PrintField(buf, 26, 2, INT16, "event-y");
- PrintField(buf, 28, 2, SETofKEYBUTMASK, "state");
- PrintField(buf, 30, 1, BOOL, "same-screen");
-}
-
-void
-ButtonPressEvent (
- const unsigned char *buf)
-{
- PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* ButtonPress */ ;
- if (Verbose < 1)
- return;
- PrintField(buf, 1, 1, BUTTON, "detail");
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, TIMESTAMP, "time");
- PrintField(buf, 8, 4, WINDOW, "root");
- PrintField(buf, 12, 4, WINDOW, "event");
- PrintField(buf, 16, 4, WINDOW, "child");
- PrintField(buf, 20, 2, INT16, "root-x");
- PrintField(buf, 22, 2, INT16, "root-y");
- PrintField(buf, 24, 2, INT16, "event-x");
- PrintField(buf, 26, 2, INT16, "event-y");
- PrintField(buf, 28, 2, SETofKEYBUTMASK, "state");
- PrintField(buf, 30, 1, BOOL, "same-screen");
-}
-
-void
-ButtonReleaseEvent (
- const unsigned char *buf)
-{
- PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* ButtonRelease */ ;
- if (Verbose < 1)
- return;
- PrintField(buf, 1, 1, BUTTON, "detail");
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, TIMESTAMP, "time");
- PrintField(buf, 8, 4, WINDOW, "root");
- PrintField(buf, 12, 4, WINDOW, "event");
- PrintField(buf, 16, 4, WINDOW, "child");
- PrintField(buf, 20, 2, INT16, "root-x");
- PrintField(buf, 22, 2, INT16, "root-y");
- PrintField(buf, 24, 2, INT16, "event-x");
- PrintField(buf, 26, 2, INT16, "event-y");
- PrintField(buf, 28, 2, SETofKEYBUTMASK, "state");
- PrintField(buf, 30, 1, BOOL, "same-screen");
-}
-
-void
-MotionNotifyEvent (
- const unsigned char *buf)
-{
- PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* MotionNotify */ ;
- if (Verbose < 1)
- return;
- PrintField(buf, 1, 1, MOTIONDETAIL, "detail");
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, TIMESTAMP, "time");
- PrintField(buf, 8, 4, WINDOW, "root");
- PrintField(buf, 12, 4, WINDOW, "event");
- PrintField(buf, 16, 4, WINDOW, "child");
- PrintField(buf, 20, 2, INT16, "root-x");
- PrintField(buf, 22, 2, INT16, "root-y");
- PrintField(buf, 24, 2, INT16, "event-x");
- PrintField(buf, 26, 2, INT16, "event-y");
- PrintField(buf, 28, 2, SETofKEYBUTMASK, "state");
- PrintField(buf, 30, 1, BOOL, "same-screen");
-}
-
-void
-EnterNotifyEvent (
- const unsigned char *buf)
-{
- PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* EnterNotify */ ;
- if (Verbose < 1)
- return;
- PrintField(buf, 1, 1, ENTERDETAIL, "detail");
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, TIMESTAMP, "time");
- PrintField(buf, 8, 4, WINDOW, "root");
- PrintField(buf, 12, 4, WINDOW, "event");
- PrintField(buf, 16, 4, WINDOW, "child");
- PrintField(buf, 20, 2, INT16, "root-x");
- PrintField(buf, 22, 2, INT16, "root-y");
- PrintField(buf, 24, 2, INT16, "event-x");
- PrintField(buf, 26, 2, INT16, "event-y");
- PrintField(buf, 28, 2, SETofKEYBUTMASK, "state");
- PrintField(buf, 30, 1, BUTTONMODE, "mode");
- PrintField(buf, 31, 1, SCREENFOCUS, "same-screen, focus");
-}
-
-void
-LeaveNotifyEvent (
- const unsigned char *buf)
-{
- PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* LeaveNotify */ ;
- if (Verbose < 1)
- return;
- PrintField(buf, 1, 1, ENTERDETAIL, "detail");
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, TIMESTAMP, "time");
- PrintField(buf, 8, 4, WINDOW, "root");
- PrintField(buf, 12, 4, WINDOW, "event");
- PrintField(buf, 16, 4, WINDOW, "child");
- PrintField(buf, 20, 2, INT16, "root-x");
- PrintField(buf, 22, 2, INT16, "root-y");
- PrintField(buf, 24, 2, INT16, "event-x");
- PrintField(buf, 26, 2, INT16, "event-y");
- PrintField(buf, 28, 2, SETofKEYBUTMASK, "state");
- PrintField(buf, 30, 1, BUTTONMODE, "mode");
- PrintField(buf, 31, 1, SCREENFOCUS, "same-screen, focus");
-}
-
-void
-FocusInEvent (
- const unsigned char *buf)
-{
- PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* FocusIn */ ;
- if (Verbose < 1)
- return;
- PrintField(buf, 1, 1, ENTERDETAIL, "detail");
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, WINDOW, "event");
- PrintField(buf, 8, 1, BUTTONMODE, "mode");
-}
+KeyPressEvent(const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* KeyPress */
+ if (Verbose < 1)
+ return;
+ PrintField(buf, 1, 1, KEYCODE, "detail");
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, TIMESTAMP, "time");
+ PrintField(buf, 8, 4, WINDOW, "root");
+ PrintField(buf, 12, 4, WINDOW, "event");
+ PrintField(buf, 16, 4, WINDOW, "child");
+ PrintField(buf, 20, 2, INT16, "root-x");
+ PrintField(buf, 22, 2, INT16, "root-y");
+ PrintField(buf, 24, 2, INT16, "event-x");
+ PrintField(buf, 26, 2, INT16, "event-y");
+ PrintField(buf, 28, 2, SETofKEYBUTMASK, "state");
+ PrintField(buf, 30, 1, BOOL, "same-screen");
+}
+
+void
+KeyReleaseEvent(const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* KeyRelease */
+ if (Verbose < 1)
+ return;
+ PrintField(buf, 1, 1, KEYCODE, "detail");
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, TIMESTAMP, "time");
+ PrintField(buf, 8, 4, WINDOW, "root");
+ PrintField(buf, 12, 4, WINDOW, "event");
+ PrintField(buf, 16, 4, WINDOW, "child");
+ PrintField(buf, 20, 2, INT16, "root-x");
+ PrintField(buf, 22, 2, INT16, "root-y");
+ PrintField(buf, 24, 2, INT16, "event-x");
+ PrintField(buf, 26, 2, INT16, "event-y");
+ PrintField(buf, 28, 2, SETofKEYBUTMASK, "state");
+ PrintField(buf, 30, 1, BOOL, "same-screen");
+}
+
+void
+ButtonPressEvent(const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* ButtonPress */
+ if (Verbose < 1)
+ return;
+ PrintField(buf, 1, 1, BUTTON, "detail");
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, TIMESTAMP, "time");
+ PrintField(buf, 8, 4, WINDOW, "root");
+ PrintField(buf, 12, 4, WINDOW, "event");
+ PrintField(buf, 16, 4, WINDOW, "child");
+ PrintField(buf, 20, 2, INT16, "root-x");
+ PrintField(buf, 22, 2, INT16, "root-y");
+ PrintField(buf, 24, 2, INT16, "event-x");
+ PrintField(buf, 26, 2, INT16, "event-y");
+ PrintField(buf, 28, 2, SETofKEYBUTMASK, "state");
+ PrintField(buf, 30, 1, BOOL, "same-screen");
+}
+
+void
+ButtonReleaseEvent(const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* ButtonRelease */
+ if (Verbose < 1)
+ return;
+ PrintField(buf, 1, 1, BUTTON, "detail");
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, TIMESTAMP, "time");
+ PrintField(buf, 8, 4, WINDOW, "root");
+ PrintField(buf, 12, 4, WINDOW, "event");
+ PrintField(buf, 16, 4, WINDOW, "child");
+ PrintField(buf, 20, 2, INT16, "root-x");
+ PrintField(buf, 22, 2, INT16, "root-y");
+ PrintField(buf, 24, 2, INT16, "event-x");
+ PrintField(buf, 26, 2, INT16, "event-y");
+ PrintField(buf, 28, 2, SETofKEYBUTMASK, "state");
+ PrintField(buf, 30, 1, BOOL, "same-screen");
+}
+
+void
+MotionNotifyEvent(const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* MotionNotify */
+ if (Verbose < 1)
+ return;
+ PrintField(buf, 1, 1, MOTIONDETAIL, "detail");
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, TIMESTAMP, "time");
+ PrintField(buf, 8, 4, WINDOW, "root");
+ PrintField(buf, 12, 4, WINDOW, "event");
+ PrintField(buf, 16, 4, WINDOW, "child");
+ PrintField(buf, 20, 2, INT16, "root-x");
+ PrintField(buf, 22, 2, INT16, "root-y");
+ PrintField(buf, 24, 2, INT16, "event-x");
+ PrintField(buf, 26, 2, INT16, "event-y");
+ PrintField(buf, 28, 2, SETofKEYBUTMASK, "state");
+ PrintField(buf, 30, 1, BOOL, "same-screen");
+}
+
+void
+EnterNotifyEvent(const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* EnterNotify */
+ if (Verbose < 1)
+ return;
+ PrintField(buf, 1, 1, ENTERDETAIL, "detail");
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, TIMESTAMP, "time");
+ PrintField(buf, 8, 4, WINDOW, "root");
+ PrintField(buf, 12, 4, WINDOW, "event");
+ PrintField(buf, 16, 4, WINDOW, "child");
+ PrintField(buf, 20, 2, INT16, "root-x");
+ PrintField(buf, 22, 2, INT16, "root-y");
+ PrintField(buf, 24, 2, INT16, "event-x");
+ PrintField(buf, 26, 2, INT16, "event-y");
+ PrintField(buf, 28, 2, SETofKEYBUTMASK, "state");
+ PrintField(buf, 30, 1, BUTTONMODE, "mode");
+ PrintField(buf, 31, 1, SCREENFOCUS, "same-screen, focus");
+}
+
+void
+LeaveNotifyEvent(const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* LeaveNotify */
+ if (Verbose < 1)
+ return;
+ PrintField(buf, 1, 1, ENTERDETAIL, "detail");
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, TIMESTAMP, "time");
+ PrintField(buf, 8, 4, WINDOW, "root");
+ PrintField(buf, 12, 4, WINDOW, "event");
+ PrintField(buf, 16, 4, WINDOW, "child");
+ PrintField(buf, 20, 2, INT16, "root-x");
+ PrintField(buf, 22, 2, INT16, "root-y");
+ PrintField(buf, 24, 2, INT16, "event-x");
+ PrintField(buf, 26, 2, INT16, "event-y");
+ PrintField(buf, 28, 2, SETofKEYBUTMASK, "state");
+ PrintField(buf, 30, 1, BUTTONMODE, "mode");
+ PrintField(buf, 31, 1, SCREENFOCUS, "same-screen, focus");
+}
+
+void
+FocusInEvent(const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* FocusIn */
+ if (Verbose < 1)
+ return;
+ PrintField(buf, 1, 1, ENTERDETAIL, "detail");
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, WINDOW, "event");
+ PrintField(buf, 8, 1, BUTTONMODE, "mode");
+}
void
-FocusOutEvent (
- const unsigned char *buf)
-{
- PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* FocusOut */ ;
- if (Verbose < 1)
- return;
- PrintField(buf, 1, 1, ENTERDETAIL, "detail");
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, WINDOW, "event");
- PrintField(buf, 8, 1, BUTTONMODE, "mode");
+FocusOutEvent(const unsigned char *buf)
+{
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* FocusOut */
+ if (Verbose < 1)
+ return;
+ PrintField(buf, 1, 1, ENTERDETAIL, "detail");
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, WINDOW, "event");
+ PrintField(buf, 8, 1, BUTTONMODE, "mode");
}
void
-KeymapNotifyEvent (
- const unsigned char *buf)
+KeymapNotifyEvent(const unsigned char *buf)
{
- PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* KeymapNotify */ ;
- if (Verbose < 1)
- return;
- PrintBytes(&buf[1], (long)31,"keys");
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* KeymapNotify */
+ if (Verbose < 1)
+ return;
+ PrintBytes(&buf[1], (long) 31, "keys");
}
void
-ExposeEvent (
- const unsigned char *buf)
+ExposeEvent(const unsigned char *buf)
{
- PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* Expose */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, WINDOW, "window");
- PrintField(buf, 8, 2, CARD16, "x");
- PrintField(buf, 10, 2, CARD16, "y");
- PrintField(buf, 12, 2, CARD16, "width");
- PrintField(buf, 14, 2, CARD16, "height");
- PrintField(buf, 16, 2, CARD16, "count");
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* Expose */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, WINDOW, "window");
+ PrintField(buf, 8, 2, CARD16, "x");
+ PrintField(buf, 10, 2, CARD16, "y");
+ PrintField(buf, 12, 2, CARD16, "width");
+ PrintField(buf, 14, 2, CARD16, "height");
+ PrintField(buf, 16, 2, CARD16, "count");
}
void
-GraphicsExposureEvent (
- const unsigned char *buf)
+GraphicsExposureEvent(const unsigned char *buf)
{
- PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* GraphicsExposure */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, DRAWABLE, "drawable");
- PrintField(buf, 8, 2, CARD16, "x");
- PrintField(buf, 10, 2, CARD16, "y");
- PrintField(buf, 12, 2, CARD16, "width");
- PrintField(buf, 14, 2, CARD16, "height");
- PrintField(buf, 16, 2, CARD16, "minor-opcode");
- PrintField(buf, 18, 2, CARD16, "count");
- PrintField(buf, 20, 1, CARD8, "major-opcode");
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* GraphicsExposure */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, DRAWABLE, "drawable");
+ PrintField(buf, 8, 2, CARD16, "x");
+ PrintField(buf, 10, 2, CARD16, "y");
+ PrintField(buf, 12, 2, CARD16, "width");
+ PrintField(buf, 14, 2, CARD16, "height");
+ PrintField(buf, 16, 2, CARD16, "minor-opcode");
+ PrintField(buf, 18, 2, CARD16, "count");
+ PrintField(buf, 20, 1, CARD8, "major-opcode");
}
void
-NoExposureEvent (
- const unsigned char *buf)
+NoExposureEvent(const unsigned char *buf)
{
- PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* NoExposure */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, DRAWABLE, "drawable");
- PrintField(buf, 8, 2, CARD16, "minor-opcode");
- PrintField(buf, 10, 1, CARD8, "major-opcode");
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* NoExposure */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, DRAWABLE, "drawable");
+ PrintField(buf, 8, 2, CARD16, "minor-opcode");
+ PrintField(buf, 10, 1, CARD8, "major-opcode");
}
void
-VisibilityNotifyEvent (
- const unsigned char *buf)
+VisibilityNotifyEvent(const unsigned char *buf)
{
- PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* VisibilityNotify */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, WINDOW, "window");
- PrintField(buf, 8, 1, VISIBLE, "state");
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* VisibilityNotify */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, WINDOW, "window");
+ PrintField(buf, 8, 1, VISIBLE, "state");
}
void
-CreateNotifyEvent (
- const unsigned char *buf)
+CreateNotifyEvent(const unsigned char *buf)
{
- PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* CreateNotify */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, WINDOW, "parent");
- PrintField(buf, 8, 4, WINDOW, "window");
- PrintField(buf, 12, 2, INT16, "x");
- PrintField(buf, 14, 2, INT16, "y");
- PrintField(buf, 16, 2, CARD16, "width");
- PrintField(buf, 18, 2, CARD16, "height");
- PrintField(buf, 20, 2, CARD16, "border-width");
- PrintField(buf, 22, 1, BOOL, "override-redirect");
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* CreateNotify */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, WINDOW, "parent");
+ PrintField(buf, 8, 4, WINDOW, "window");
+ PrintField(buf, 12, 2, INT16, "x");
+ PrintField(buf, 14, 2, INT16, "y");
+ PrintField(buf, 16, 2, CARD16, "width");
+ PrintField(buf, 18, 2, CARD16, "height");
+ PrintField(buf, 20, 2, CARD16, "border-width");
+ PrintField(buf, 22, 1, BOOL, "override-redirect");
}
void
-DestroyNotifyEvent (
- const unsigned char *buf)
+DestroyNotifyEvent(const unsigned char *buf)
{
- PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* DestroyNotify */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, WINDOW, "event");
- PrintField(buf, 8, 4, WINDOW, "window");
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* DestroyNotify */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, WINDOW, "event");
+ PrintField(buf, 8, 4, WINDOW, "window");
}
void
-UnmapNotifyEvent (
- const unsigned char *buf)
+UnmapNotifyEvent(const unsigned char *buf)
{
- PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* UnmapNotify */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, WINDOW, "event");
- PrintField(buf, 8, 4, WINDOW, "window");
- PrintField(buf, 12, 1, BOOL, "from-configure");
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* UnmapNotify */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, WINDOW, "event");
+ PrintField(buf, 8, 4, WINDOW, "window");
+ PrintField(buf, 12, 1, BOOL, "from-configure");
}
void
-MapNotifyEvent (
- const unsigned char *buf)
+MapNotifyEvent(const unsigned char *buf)
{
- PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* MapNotify */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, WINDOW, "event");
- PrintField(buf, 8, 4, WINDOW, "window");
- PrintField(buf, 12, 1, BOOL, "override-redirect");
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* MapNotify */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, WINDOW, "event");
+ PrintField(buf, 8, 4, WINDOW, "window");
+ PrintField(buf, 12, 1, BOOL, "override-redirect");
}
void
-MapRequestEvent (
- const unsigned char *buf)
+MapRequestEvent(const unsigned char *buf)
{
- PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* MapRequest */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, WINDOW, "parent");
- PrintField(buf, 8, 4, WINDOW, "window");
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* MapRequest */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, WINDOW, "parent");
+ PrintField(buf, 8, 4, WINDOW, "window");
}
void
-ReparentNotifyEvent (
- const unsigned char *buf)
+ReparentNotifyEvent(const unsigned char *buf)
{
- PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* ReparentNotify */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, WINDOW, "event");
- PrintField(buf, 8, 4, WINDOW, "window");
- PrintField(buf, 12, 4, WINDOW, "parent");
- PrintField(buf, 16, 2, INT16, "x");
- PrintField(buf, 18, 2, INT16, "y");
- PrintField(buf, 20, 1, BOOL, "override-redirect");
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* ReparentNotify */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, WINDOW, "event");
+ PrintField(buf, 8, 4, WINDOW, "window");
+ PrintField(buf, 12, 4, WINDOW, "parent");
+ PrintField(buf, 16, 2, INT16, "x");
+ PrintField(buf, 18, 2, INT16, "y");
+ PrintField(buf, 20, 1, BOOL, "override-redirect");
}
void
-ConfigureNotifyEvent (
- const unsigned char *buf)
+ConfigureNotifyEvent(const unsigned char *buf)
{
- PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* ConfigureNotify */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, WINDOW, "event");
- PrintField(buf, 8, 4, WINDOW, "window");
- PrintField(buf, 12, 4, WINDOW, "above-sibling");
- PrintField(buf, 16, 2, INT16, "x");
- PrintField(buf, 18, 2, INT16, "y");
- PrintField(buf, 20, 2, CARD16, "width");
- PrintField(buf, 22, 2, CARD16, "height");
- PrintField(buf, 24, 2, CARD16, "border-width");
- PrintField(buf, 26, 1, BOOL, "override-redirect");
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* ConfigureNotify */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, WINDOW, "event");
+ PrintField(buf, 8, 4, WINDOW, "window");
+ PrintField(buf, 12, 4, WINDOW, "above-sibling");
+ PrintField(buf, 16, 2, INT16, "x");
+ PrintField(buf, 18, 2, INT16, "y");
+ PrintField(buf, 20, 2, CARD16, "width");
+ PrintField(buf, 22, 2, CARD16, "height");
+ PrintField(buf, 24, 2, CARD16, "border-width");
+ PrintField(buf, 26, 1, BOOL, "override-redirect");
}
void
-ConfigureRequestEvent (
- const unsigned char *buf)
+ConfigureRequestEvent(const unsigned char *buf)
{
- PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* ConfigureRequest */ ;
- if (Verbose < 1)
- return;
- PrintField(buf, 1, 1, STACKMODE, "stack-mode");
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, WINDOW, "parent");
- PrintField(buf, 8, 4, WINDOW, "window");
- PrintField(buf, 12, 4, WINDOW, "sibling");
- PrintField(buf, 16, 2, INT16, "x");
- PrintField(buf, 18, 2, INT16, "y");
- PrintField(buf, 20, 2, CARD16, "width");
- PrintField(buf, 22, 2, CARD16, "height");
- PrintField(buf, 24, 2, CARD16, "border-width");
- PrintField(buf, 26, 2, CONFIGURE_BITMASK, "value-mask");
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* ConfigureRequest */
+ if (Verbose < 1)
+ return;
+ PrintField(buf, 1, 1, STACKMODE, "stack-mode");
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, WINDOW, "parent");
+ PrintField(buf, 8, 4, WINDOW, "window");
+ PrintField(buf, 12, 4, WINDOW, "sibling");
+ PrintField(buf, 16, 2, INT16, "x");
+ PrintField(buf, 18, 2, INT16, "y");
+ PrintField(buf, 20, 2, CARD16, "width");
+ PrintField(buf, 22, 2, CARD16, "height");
+ PrintField(buf, 24, 2, CARD16, "border-width");
+ PrintField(buf, 26, 2, CONFIGURE_BITMASK, "value-mask");
}
void
-GravityNotifyEvent (
- const unsigned char *buf)
+GravityNotifyEvent(const unsigned char *buf)
{
- PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* GravityNotify */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, WINDOW, "event");
- PrintField(buf, 8, 4, WINDOW, "window");
- PrintField(buf, 12, 2, INT16, "x");
- PrintField(buf, 14, 2, INT16, "y");
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* GravityNotify */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, WINDOW, "event");
+ PrintField(buf, 8, 4, WINDOW, "window");
+ PrintField(buf, 12, 2, INT16, "x");
+ PrintField(buf, 14, 2, INT16, "y");
}
void
-ResizeRequestEvent (
- const unsigned char *buf)
+ResizeRequestEvent(const unsigned char *buf)
{
- PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* ResizeRequest */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, WINDOW, "window");
- PrintField(buf, 8, 2, CARD16, "width");
- PrintField(buf, 10, 2, CARD16, "height");
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* ResizeRequest */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, WINDOW, "window");
+ PrintField(buf, 8, 2, CARD16, "width");
+ PrintField(buf, 10, 2, CARD16, "height");
}
void
-CirculateNotifyEvent (
- const unsigned char *buf)
+CirculateNotifyEvent(const unsigned char *buf)
{
- PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* CirculateNotify */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, WINDOW, "event");
- PrintField(buf, 8, 4, WINDOW, "window");
- PrintField(buf, 12, 4, WINDOW, "parent");
- PrintField(buf, 16, 1, CIRSTAT, "place");
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* CirculateNotify */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, WINDOW, "event");
+ PrintField(buf, 8, 4, WINDOW, "window");
+ PrintField(buf, 12, 4, WINDOW, "parent");
+ PrintField(buf, 16, 1, CIRSTAT, "place");
}
void
-CirculateRequestEvent (
- const unsigned char *buf)
+CirculateRequestEvent(const unsigned char *buf)
{
- PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* CirculateRequest */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, WINDOW, "parent");
- PrintField(buf, 8, 4, WINDOW, "window");
- PrintField(buf, 16, 1, CIRSTAT, "place");
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* CirculateRequest */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, WINDOW, "parent");
+ PrintField(buf, 8, 4, WINDOW, "window");
+ PrintField(buf, 16, 1, CIRSTAT, "place");
}
void
-PropertyNotifyEvent (
- const unsigned char *buf)
+PropertyNotifyEvent(const unsigned char *buf)
{
- PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* PropertyNotify */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, WINDOW, "window");
- PrintField(buf, 8, 4, ATOM, "atom");
- PrintField(buf, 12, 4, TIMESTAMP, "time");
- PrintField(buf, 16, 1, PROPCHANGE, "state");
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* PropertyNotify */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, WINDOW, "window");
+ PrintField(buf, 8, 4, ATOM, "atom");
+ PrintField(buf, 12, 4, TIMESTAMP, "time");
+ PrintField(buf, 16, 1, PROPCHANGE, "state");
}
void
-SelectionClearEvent (
- const unsigned char *buf)
+SelectionClearEvent(const unsigned char *buf)
{
- PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* SelectionClear */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, TIMESTAMP, "time");
- PrintField(buf, 8, 4, WINDOW, "owner");
- PrintField(buf, 12, 4, ATOM, "selection");
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* SelectionClear */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, TIMESTAMP, "time");
+ PrintField(buf, 8, 4, WINDOW, "owner");
+ PrintField(buf, 12, 4, ATOM, "selection");
}
void
-SelectionRequestEvent (
- const unsigned char *buf)
+SelectionRequestEvent(const unsigned char *buf)
{
- PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* SelectionRequest */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, TIMESTAMP, "time");
- PrintField(buf, 8, 4, WINDOW, "owner");
- PrintField(buf, 12, 4, WINDOW, "requestor");
- PrintField(buf, 16, 4, ATOM, "selection");
- PrintField(buf, 20, 4, ATOM, "target");
- PrintField(buf, 24, 4, ATOM, "property");
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* SelectionRequest */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, TIMESTAMP, "time");
+ PrintField(buf, 8, 4, WINDOW, "owner");
+ PrintField(buf, 12, 4, WINDOW, "requestor");
+ PrintField(buf, 16, 4, ATOM, "selection");
+ PrintField(buf, 20, 4, ATOM, "target");
+ PrintField(buf, 24, 4, ATOM, "property");
}
void
-SelectionNotifyEvent (
- const unsigned char *buf)
+SelectionNotifyEvent(const unsigned char *buf)
{
- PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* SelectionNotify */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, TIMESTAMP, "time");
- PrintField(buf, 8, 4, WINDOW, "requestor");
- PrintField(buf, 12, 4, ATOM, "selection");
- PrintField(buf, 16, 4, ATOM, "target");
- PrintField(buf, 20, 4, ATOM, "property");
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* SelectionNotify */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, TIMESTAMP, "time");
+ PrintField(buf, 8, 4, WINDOW, "requestor");
+ PrintField(buf, 12, 4, ATOM, "selection");
+ PrintField(buf, 16, 4, ATOM, "target");
+ PrintField(buf, 20, 4, ATOM, "property");
}
void
-ColormapNotifyEvent (
- const unsigned char *buf)
+ColormapNotifyEvent(const unsigned char *buf)
{
- PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* ColormapNotify */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, WINDOW, "window");
- PrintField(buf, 8, 4, COLORMAP, "colormap");
- PrintField(buf, 12, 1, BOOL, "new");
- PrintField(buf, 13, 1, CMAPCHANGE, "state");
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* ColormapNotify */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, WINDOW, "window");
+ PrintField(buf, 8, 4, COLORMAP, "colormap");
+ PrintField(buf, 12, 1, BOOL, "new");
+ PrintField(buf, 13, 1, CMAPCHANGE, "state");
}
void
-ClientMessageEvent (
- const unsigned char *buf)
+ClientMessageEvent(const unsigned char *buf)
{
- PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* ClientMessage */ ;
- if (Verbose < 1)
- return;
- PrintField(buf, 1, 1, CARD8, "format");
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, WINDOW, "window");
- PrintField(buf, 8, 4, ATOM, "type");
- PrintBytes(&buf[12], (long)20,"data");
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* ClientMessage */
+ if (Verbose < 1)
+ return;
+ PrintField(buf, 1, 1, CARD8, "format");
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, WINDOW, "window");
+ PrintField(buf, 8, 4, ATOM, "type");
+ PrintBytes(&buf[12], (long) 20, "data");
}
void
-MappingNotifyEvent (
- const unsigned char *buf)
+MappingNotifyEvent(const unsigned char *buf)
{
- PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* MappingNotify */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 1, MAPOBJECT, "request");
- PrintField(buf, 5, 1, KEYCODE, "first-keycode");
- PrintField(buf, 6, 1, CARD8, "count");
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* MappingNotify */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 1, MAPOBJECT, "request");
+ PrintField(buf, 5, 1, KEYCODE, "first-keycode");
+ PrintField(buf, 6, 1, CARD8, "count");
}
void
-UnknownGenericEvent (
- const unsigned char *buf)
+UnknownGenericEvent(const unsigned char *buf)
{
- long n;
+ long n;
- PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* GenericEvent */;
- if (Verbose < 1)
- return;
- PrintField(buf, 1, 1, EXTENSION, "extension");
- printfield (buf, 2, 2, CARD16, "sequence number");
- printfield (buf, 4, 4, DVALUE4(n), "event length");
- PrintField(buf, 2, 8, CARD16, "event type");
- n = ILong (&buf[4]) + 5;
- (void) PrintList (&buf[12], n, CARD32, "data");
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* GenericEvent */
+ if (Verbose < 1)
+ return;
+ PrintField(buf, 1, 1, EXTENSION, "extension");
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(n), "event length");
+ PrintField(buf, 2, 8, CARD16, "event type");
+
+ n = ILong(&buf[4]) + 5;
+ (void) PrintList(&buf[12], n, CARD32, "data");
}
void
-UnknownEvent (
- const unsigned char *buf)
+UnknownEvent(const unsigned char *buf)
{
- PrintField(buf, 0, 1, EVENT, EVENTHEADER);
- if (Verbose < 1)
- return;
- PrintField(buf, 1, 1, CARD8, "detail");
- printfield (buf, 2, 2, CARD16, "sequence number");
- PrintBytes(&buf[4], 28, "data");
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER);
+ if (Verbose < 1)
+ return;
+ PrintField(buf, 1, 1, CARD8, "detail");
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintBytes(&buf[4], 28, "data");
}
/* ************************************************************ */
@@ -984,3187 +931,2944 @@ UnknownEvent (
/* Request and Reply Printing procedures */
void
-ExtendedRequest (
- int fd,
- const unsigned char *buf)
+ExtendedRequest(int fd, const unsigned char *buf)
{
- short n;
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER);
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
- PrintField(buf, 1, 1, CARD8, "minor opcode");
- printreqlen(buf, fd, DVALUE2(n-1));
-
- n = CS[fd].requestLen - 1;
- (void) PrintList (&buf[4], n, CARD32, "data");
-}
-
-void
-UnknownReply (
- const unsigned char *buf)
+ short n;
+
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER);
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ PrintField(buf, 1, 1, CARD8, "minor opcode");
+ printreqlen(buf, fd, DVALUE2(n - 1));
+
+ n = CS[fd].requestLen - 1;
+ (void) PrintList(&buf[4], n, CARD32, "data");
+}
+
+void
+UnknownReply(const unsigned char *buf)
{
- long n;
-
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER);
- PrintField(buf, 1, 1, CARD8, "data");
- printfield (buf, 2, 2, CARD16, "sequence number");
- printfield (buf, 4, 4, DVALUE4(n), "reply length");
- n = ILong (&buf[4]) + 6;
- (void) PrintList (&buf[8], n, CARD32, "data");
-}
-
-void
-CreateWindow (
- FD fd,
- const unsigned char *buf)
+ long n;
+
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER);
+ PrintField(buf, 1, 1, CARD8, "data");
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(n), "reply length");
+ n = ILong(&buf[4]) + 6;
+ (void) PrintList(&buf[8], n, CARD32, "data");
+}
+
+void
+CreateWindow(FD fd, const unsigned char *buf)
{
- /* Request CreateWindow is opcode 1 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* CreateWindow */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request CreateWindow is opcode 1 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* CreateWindow */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- PrintField(buf, 1, 1, CARD8, "depth");
- printreqlen(buf, fd, DVALUE2(8 + n));
- PrintField(buf, 4, 4, WINDOW, "wid");
- PrintField(buf, 8, 4, WINDOW, "parent");
- PrintField(buf, 12, 2, INT16, "x");
- PrintField(buf, 14, 2, INT16, "y");
- PrintField(buf, 16, 2, CARD16, "width");
- PrintField(buf, 18, 2, CARD16, "height");
- PrintField(buf, 20, 2, CARD16, "border-width");
- PrintField(buf, 22, 2, WINDOWCLASS, "class");
- PrintField(buf, 24, 4, VISUALIDC, "visual");
- PrintField(buf, 28, 4, WINDOW_BITMASK, "value-mask");
- PrintValues(&buf[28], 4, WINDOW_BITMASK, &buf[32], "value-list");
+ PrintField(buf, 1, 1, CARD8, "depth");
+ printreqlen(buf, fd, DVALUE2(8 + n));
+ PrintField(buf, 4, 4, WINDOW, "wid");
+ PrintField(buf, 8, 4, WINDOW, "parent");
+ PrintField(buf, 12, 2, INT16, "x");
+ PrintField(buf, 14, 2, INT16, "y");
+ PrintField(buf, 16, 2, CARD16, "width");
+ PrintField(buf, 18, 2, CARD16, "height");
+ PrintField(buf, 20, 2, CARD16, "border-width");
+ PrintField(buf, 22, 2, WINDOWCLASS, "class");
+ PrintField(buf, 24, 4, VISUALIDC, "visual");
+ PrintField(buf, 28, 4, WINDOW_BITMASK, "value-mask");
+ PrintValues(&buf[28], 4, WINDOW_BITMASK, &buf[32], "value-list");
}
void
-ChangeWindowAttributes (
- FD fd,
- const unsigned char *buf)
+ChangeWindowAttributes(FD fd, const unsigned char *buf)
{
- /* Request ChangeWindowAttributes is opcode 2 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* ChangeWindowAttributes */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request ChangeWindowAttributes is opcode 2 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* ChangeWindowAttributes */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, DVALUE2(3 + n));
- PrintField(buf, 4, 4, WINDOW, "window");
- PrintField(buf, 8, 4, WINDOW_BITMASK, "value-mask");
- PrintValues(&buf[8], 4, WINDOW_BITMASK, &buf[12], "value-list");
+ printreqlen(buf, fd, DVALUE2(3 + n));
+ PrintField(buf, 4, 4, WINDOW, "window");
+ PrintField(buf, 8, 4, WINDOW_BITMASK, "value-mask");
+ PrintValues(&buf[8], 4, WINDOW_BITMASK, &buf[12], "value-list");
}
void
-GetWindowAttributes (
- FD fd,
- const unsigned char *buf)
+GetWindowAttributes(FD fd, const unsigned char *buf)
{
- /* Request GetWindowAttributes is opcode 3 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* GetWindowAttributes */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request GetWindowAttributes is opcode 3 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* GetWindowAttributes */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, WINDOW, "window");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, WINDOW, "window");
}
void
-GetWindowAttributesReply (
- const unsigned char *buf)
+GetWindowAttributesReply(const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* GetWindowAttributes */ ;
- if (Verbose < 1)
- return;
- PrintField(buf, 1, 1, BACKSTORE, "backing-store");
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, CONST4(3), "reply length");
- PrintField(buf, 8, 4, VISUALID, "visual");
- PrintField(buf, 12, 2, WINDOWCLASS, "class");
- PrintField(buf, 14, 1, BITGRAVITY, "bit-gravity");
- PrintField(buf, 15, 1, WINGRAVITY, "win-gravity");
- PrintField(buf, 16, 4, CARD32, "backing-planes");
- PrintField(buf, 20, 4, CARD32, "backing-pixel");
- PrintField(buf, 24, 1, BOOL, "save-under");
- PrintField(buf, 25, 1, BOOL, "map-is-installed");
- PrintField(buf, 26, 1, MAPSTATE, "map-state");
- PrintField(buf, 27, 1, BOOL, "override-redirect");
- PrintField(buf, 28, 4, COLORMAP, "colormap");
- PrintField(buf, 32, 4, SETofEVENT, "all-event-masks");
- PrintField(buf, 36, 4, SETofEVENT, "your-event-mask");
- PrintField(buf, 40, 2, SETofDEVICEEVENT, "do-not-propagate-mask");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* GetWindowAttributes */
+ if (Verbose < 1)
+ return;
+ PrintField(buf, 1, 1, BACKSTORE, "backing-store");
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, CONST4(3), "reply length");
+ PrintField(buf, 8, 4, VISUALID, "visual");
+ PrintField(buf, 12, 2, WINDOWCLASS, "class");
+ PrintField(buf, 14, 1, BITGRAVITY, "bit-gravity");
+ PrintField(buf, 15, 1, WINGRAVITY, "win-gravity");
+ PrintField(buf, 16, 4, CARD32, "backing-planes");
+ PrintField(buf, 20, 4, CARD32, "backing-pixel");
+ PrintField(buf, 24, 1, BOOL, "save-under");
+ PrintField(buf, 25, 1, BOOL, "map-is-installed");
+ PrintField(buf, 26, 1, MAPSTATE, "map-state");
+ PrintField(buf, 27, 1, BOOL, "override-redirect");
+ PrintField(buf, 28, 4, COLORMAP, "colormap");
+ PrintField(buf, 32, 4, SETofEVENT, "all-event-masks");
+ PrintField(buf, 36, 4, SETofEVENT, "your-event-mask");
+ PrintField(buf, 40, 2, SETofDEVICEEVENT, "do-not-propagate-mask");
}
void
-DestroyWindow (
- FD fd,
- const unsigned char *buf)
+DestroyWindow(FD fd, const unsigned char *buf)
{
- /* Request DestroyWindow is opcode 4 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* DestroyWindow */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request DestroyWindow is opcode 4 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* DestroyWindow */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, WINDOW, "window");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, WINDOW, "window");
}
void
-DestroySubwindows (
- FD fd,
- const unsigned char *buf)
+DestroySubwindows(FD fd, const unsigned char *buf)
{
- /* Request DestroySubwindows is opcode 5 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* DestroySubwindows */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request DestroySubwindows is opcode 5 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* DestroySubwindows */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, WINDOW, "window");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, WINDOW, "window");
}
void
-ChangeSaveSet (
- FD fd,
- const unsigned char *buf)
+ChangeSaveSet(FD fd, const unsigned char *buf)
{
- /* Request ChangeSaveSet is opcode 6 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* ChangeSaveSet */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request ChangeSaveSet is opcode 6 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* ChangeSaveSet */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- PrintField(buf, 1, 1, INS_DEL, "mode");
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, WINDOW, "window");
+ PrintField(buf, 1, 1, INS_DEL, "mode");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, WINDOW, "window");
}
void
-ReparentWindow (
- FD fd,
- const unsigned char *buf)
+ReparentWindow(FD fd, const unsigned char *buf)
{
- /* Request ReparentWindow is opcode 7 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* ReparentWindow */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request ReparentWindow is opcode 7 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* ReparentWindow */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(4));
- PrintField(buf, 4, 4, WINDOW, "window");
- PrintField(buf, 8, 4, WINDOW, "parent");
- PrintField(buf, 12, 2, INT16, "x");
- PrintField(buf, 14, 2, INT16, "y");
+ printreqlen(buf, fd, CONST2(4));
+ PrintField(buf, 4, 4, WINDOW, "window");
+ PrintField(buf, 8, 4, WINDOW, "parent");
+ PrintField(buf, 12, 2, INT16, "x");
+ PrintField(buf, 14, 2, INT16, "y");
}
void
-MapWindow (
- FD fd,
- const unsigned char *buf)
+MapWindow(FD fd, const unsigned char *buf)
{
- /* Request MapWindow is opcode 8 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* MapWindow */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request MapWindow is opcode 8 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* MapWindow */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, WINDOW, "window");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, WINDOW, "window");
}
void
-MapSubwindows (
- FD fd,
- const unsigned char *buf)
+MapSubwindows(FD fd, const unsigned char *buf)
{
- /* Request MapSubwindows is opcode 9 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* MapSubwindows */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request MapSubwindows is opcode 9 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* MapSubwindows */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, WINDOW, "window");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, WINDOW, "window");
}
void
-UnmapWindow (
- FD fd,
- const unsigned char *buf)
+UnmapWindow(FD fd, const unsigned char *buf)
{
- /* Request UnmapWindow is opcode 10 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* UnmapWindow */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request UnmapWindow is opcode 10 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* UnmapWindow */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, WINDOW, "window");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, WINDOW, "window");
}
void
-UnmapSubwindows (
- FD fd,
- const unsigned char *buf)
+UnmapSubwindows(FD fd, const unsigned char *buf)
{
- /* Request UnmapSubwindows is opcode 11 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* UnmapSubwindows */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request UnmapSubwindows is opcode 11 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* UnmapSubwindows */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, WINDOW, "window");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, WINDOW, "window");
}
void
-ConfigureWindow (
- FD fd,
- const unsigned char *buf)
+ConfigureWindow(FD fd, const unsigned char *buf)
{
- /* Request ConfigureWindow is opcode 12 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* ConfigureWindow */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request ConfigureWindow is opcode 12 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* ConfigureWindow */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, DVALUE2(3 + n));
- PrintField(buf, 4, 4, WINDOW, "window");
- PrintField(buf, 8, 2, CONFIGURE_BITMASK, "value-mask");
- PrintValues(&buf[8], 2, CONFIGURE_BITMASK, &buf[12], "value-list");
+ printreqlen(buf, fd, DVALUE2(3 + n));
+ PrintField(buf, 4, 4, WINDOW, "window");
+ PrintField(buf, 8, 2, CONFIGURE_BITMASK, "value-mask");
+ PrintValues(&buf[8], 2, CONFIGURE_BITMASK, &buf[12], "value-list");
}
void
-CirculateWindow (
- FD fd,
- const unsigned char *buf)
+CirculateWindow(FD fd, const unsigned char *buf)
{
- /* Request CirculateWindow is opcode 13 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* CirculateWindow */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request CirculateWindow is opcode 13 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* CirculateWindow */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- PrintField(buf, 1, 1, CIRMODE, "direction");
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, WINDOW, "window");
+ PrintField(buf, 1, 1, CIRMODE, "direction");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, WINDOW, "window");
}
void
-GetGeometry (
- FD fd,
- const unsigned char *buf)
+GetGeometry(FD fd, const unsigned char *buf)
{
- /* Request GetGeometry is opcode 14 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* GetGeometry */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request GetGeometry is opcode 14 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* GetGeometry */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, DRAWABLE, "drawable");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, DRAWABLE, "drawable");
}
void
-GetGeometryReply (
- const unsigned char *buf)
+GetGeometryReply(const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* GetGeometry */ ;
- if (Verbose < 1)
- return;
- PrintField(buf, 1, 1, CARD8, "depth");
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, CONST4(0), "reply length");
- PrintField(buf, 8, 4, WINDOW, "root");
- PrintField(buf, 12, 2, INT16, "x");
- PrintField(buf, 14, 2, INT16, "y");
- PrintField(buf, 16, 2, CARD16, "width");
- PrintField(buf, 18, 2, CARD16, "height");
- PrintField(buf, 20, 2, CARD16, "border-width");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* GetGeometry */
+ if (Verbose < 1)
+ return;
+ PrintField(buf, 1, 1, CARD8, "depth");
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, CONST4(0), "reply length");
+ PrintField(buf, 8, 4, WINDOW, "root");
+ PrintField(buf, 12, 2, INT16, "x");
+ PrintField(buf, 14, 2, INT16, "y");
+ PrintField(buf, 16, 2, CARD16, "width");
+ PrintField(buf, 18, 2, CARD16, "height");
+ PrintField(buf, 20, 2, CARD16, "border-width");
}
void
-QueryTree (
- FD fd,
- const unsigned char *buf)
+QueryTree(FD fd, const unsigned char *buf)
{
- /* Request QueryTree is opcode 15 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* QueryTree */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request QueryTree is opcode 15 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* QueryTree */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, WINDOW, "window");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, WINDOW, "window");
}
void
-QueryTreeReply (
- const unsigned char *buf)
+QueryTreeReply(const unsigned char *buf)
{
- short n;
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* QueryTree */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4(n), "reply length");
- PrintField(buf, 8, 4, WINDOW, "root");
- PrintField(buf, 12, 4, WINDOW, "parent");
- printfield(buf, 16, 2, DVALUE2(n), "number of children");
- n = IShort(&buf[16]);
- PrintList(&buf[32], (long)n, WINDOW, "children");
+ short n;
+
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* QueryTree */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(n), "reply length");
+ PrintField(buf, 8, 4, WINDOW, "root");
+ PrintField(buf, 12, 4, WINDOW, "parent");
+ printfield(buf, 16, 2, DVALUE2(n), "number of children");
+ n = IShort(&buf[16]);
+ PrintList(&buf[32], (long) n, WINDOW, "children");
}
void
-InternAtom (
- FD fd,
- const unsigned char *buf)
+InternAtom(FD fd, const unsigned char *buf)
{
- short n;
- /* Request InternAtom is opcode 16 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* InternAtom */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ short n;
+
+ /* Request InternAtom is opcode 16 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* InternAtom */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- PrintField(buf, 1, 1, BOOL, "only-if-exists");
- printreqlen(buf, fd, DVALUE2(2 + (n + p) / 4));
- printfield(buf, 4, 2, DVALUE2(n), "length of name");
- n = IShort(&buf[4]);
- PrintString8(&buf[8], n, "name");
+ PrintField(buf, 1, 1, BOOL, "only-if-exists");
+ printreqlen(buf, fd, DVALUE2(2 + (n + p) / 4));
+ printfield(buf, 4, 2, DVALUE2(n), "length of name");
+ n = IShort(&buf[4]);
+ PrintString8(&buf[8], n, "name");
}
void
-InternAtomReply (
- const unsigned char *buf)
+InternAtomReply(const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* InternAtom */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, CONST4(0), "reply length");
- PrintField(buf, 8, 4, ATOM, "atom");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* InternAtom */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, CONST4(0), "reply length");
+ PrintField(buf, 8, 4, ATOM, "atom");
}
void
-GetAtomName (
- FD fd,
- const unsigned char *buf)
+GetAtomName(FD fd, const unsigned char *buf)
{
- /* Request GetAtomName is opcode 17 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* GetAtomName */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request GetAtomName is opcode 17 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* GetAtomName */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, ATOM, "atom");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, ATOM, "atom");
}
void
-GetAtomNameReply (
- const unsigned char *buf)
-{
- short n;
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* GetAtomName */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4((n + p) / 4), "reply length");
- printfield(buf, 8, 2, DVALUE2(n), "length of name");
- n = IShort(&buf[8]);
- PrintString8(&buf[32], n, "name");
+GetAtomNameReply(const unsigned char *buf)
+{
+ short n;
+
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* GetAtomName */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4((n + p) / 4), "reply length");
+ printfield(buf, 8, 2, DVALUE2(n), "length of name");
+ n = IShort(&buf[8]);
+ PrintString8(&buf[32], n, "name");
}
void
-ChangeProperty (
- FD fd,
- const unsigned char *buf)
+ChangeProperty(FD fd, const unsigned char *buf)
{
- long n;
- short unit;
- long type;
+ long n;
+ short unit;
+ long type;
- /* Request ChangeProperty is opcode 18 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* ChangeProperty */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request ChangeProperty is opcode 18 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* ChangeProperty */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- PrintField(buf, 1, 1, CHANGEMODE, "mode");
- printreqlen(buf, fd, DVALUE2(6 + (n + p) / 4));
- PrintField(buf, 4, 4, WINDOW, "window");
- PrintField(buf, 8, 4, ATOM, "property");
- PrintField(buf, 12, 4, ATOM, "type");
- type = ILong(&buf[12]);
- PrintField(buf, 16, 1, CARD8, "format");
- unit = IByte(&buf[16]) / 8;
- printfield(buf, 20, 4, CARD32, "length of data");
- n = ILong(&buf[20]);
- if (type == 31 /* string */)
- PrintString8(&buf[24], n * unit, "data");
- else
- PrintBytes(&buf[24], n * unit, "data");
+ PrintField(buf, 1, 1, CHANGEMODE, "mode");
+ printreqlen(buf, fd, DVALUE2(6 + (n + p) / 4));
+ PrintField(buf, 4, 4, WINDOW, "window");
+ PrintField(buf, 8, 4, ATOM, "property");
+ PrintField(buf, 12, 4, ATOM, "type");
+ type = ILong(&buf[12]);
+ PrintField(buf, 16, 1, CARD8, "format");
+ unit = IByte(&buf[16]) / 8;
+ printfield(buf, 20, 4, CARD32, "length of data");
+ n = ILong(&buf[20]);
+ if (type == 31 /* string */ )
+ PrintString8(&buf[24], n * unit, "data");
+ else
+ PrintBytes(&buf[24], n * unit, "data");
}
void
-DeleteProperty (
- FD fd,
- const unsigned char *buf)
+DeleteProperty(FD fd, const unsigned char *buf)
{
- /* Request DeleteProperty is opcode 19 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* DeleteProperty */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request DeleteProperty is opcode 19 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* DeleteProperty */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(3));
- PrintField(buf, 4, 4, WINDOW, "window");
- PrintField(buf, 8, 4, ATOM, "property");
+ printreqlen(buf, fd, CONST2(3));
+ PrintField(buf, 4, 4, WINDOW, "window");
+ PrintField(buf, 8, 4, ATOM, "property");
}
void
-GetProperty (
- FD fd,
- const unsigned char *buf)
+GetProperty(FD fd, const unsigned char *buf)
{
- /* Request GetProperty is opcode 20 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* GetProperty */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request GetProperty is opcode 20 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* GetProperty */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- PrintField(buf, 1, 1, BOOL, "delete");
- printreqlen(buf, fd, CONST2(6));
- PrintField(buf, 4, 4, WINDOW, "window");
- PrintField(buf, 8, 4, ATOM, "property");
- PrintField(buf, 12, 4, ATOMT, "type");
- PrintField(buf, 16, 4, CARD32, "long-offset");
- printfield(buf, 20, 4, CARD32, "long-length");
+ PrintField(buf, 1, 1, BOOL, "delete");
+ printreqlen(buf, fd, CONST2(6));
+ PrintField(buf, 4, 4, WINDOW, "window");
+ PrintField(buf, 8, 4, ATOM, "property");
+ PrintField(buf, 12, 4, ATOMT, "type");
+ PrintField(buf, 16, 4, CARD32, "long-offset");
+ printfield(buf, 20, 4, CARD32, "long-length");
}
void
-GetPropertyReply (
- const unsigned char *buf)
+GetPropertyReply(const unsigned char *buf)
{
- long n;
- short unit;
- long type;
+ long n;
+ short unit;
+ long type;
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* GetProperty */ ;
- if (Verbose < 1)
- return;
- PrintField(buf, 1, 1, CARD8, "format");
- unit = IByte(&buf[1]) / 8;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4((n + p) / 4), "reply length");
- PrintField(buf, 8, 4, ATOM, "type");
- type = ILong(&buf[8]);
- PrintField(buf, 12, 4, CARD32, "bytes-after");
- printfield(buf, 16, 4, CARD32, "length of value");
- n = ILong(&buf[16]);
- if (type == 31 /* string */)
- PrintString8(&buf[32], n * unit, "value");
- else
- PrintBytes(&buf[32], n * unit, "value");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* GetProperty */
+ if (Verbose < 1)
+ return;
+ PrintField(buf, 1, 1, CARD8, "format");
+ unit = IByte(&buf[1]) / 8;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4((n + p) / 4), "reply length");
+ PrintField(buf, 8, 4, ATOM, "type");
+ type = ILong(&buf[8]);
+ PrintField(buf, 12, 4, CARD32, "bytes-after");
+ printfield(buf, 16, 4, CARD32, "length of value");
+ n = ILong(&buf[16]);
+ if (type == 31 /* string */ )
+ PrintString8(&buf[32], n * unit, "value");
+ else
+ PrintBytes(&buf[32], n * unit, "value");
}
void
-ListProperties (
- FD fd,
- const unsigned char *buf)
+ListProperties(FD fd, const unsigned char *buf)
{
- /* Request ListProperties is opcode 21 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* ListProperties */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request ListProperties is opcode 21 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* ListProperties */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, WINDOW, "window");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, WINDOW, "window");
}
void
-ListPropertiesReply (
- const unsigned char *buf)
+ListPropertiesReply(const unsigned char *buf)
{
- short n;
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* ListProperties */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4(n), "reply length");
- printfield(buf, 8, 2, DVALUE2(n), "number of atoms");
- n = IShort(&buf[8]);
- PrintList(&buf[32], (long)n, ATOM, "atoms");
+ short n;
+
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* ListProperties */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(n), "reply length");
+ printfield(buf, 8, 2, DVALUE2(n), "number of atoms");
+ n = IShort(&buf[8]);
+ PrintList(&buf[32], (long) n, ATOM, "atoms");
}
void
-SetSelectionOwner (
- FD fd,
- const unsigned char *buf)
+SetSelectionOwner(FD fd, const unsigned char *buf)
{
- /* Request SetSelectionOwner is opcode 22 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* SetSelectionOwner */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request SetSelectionOwner is opcode 22 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* SetSelectionOwner */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(4));
- PrintField(buf, 4, 4, WINDOW, "owner");
- PrintField(buf, 8, 4, ATOM, "selection");
- PrintField(buf, 12, 4, TIMESTAMP, "time");
+ printreqlen(buf, fd, CONST2(4));
+ PrintField(buf, 4, 4, WINDOW, "owner");
+ PrintField(buf, 8, 4, ATOM, "selection");
+ PrintField(buf, 12, 4, TIMESTAMP, "time");
}
void
-GetSelectionOwner (
- FD fd,
- const unsigned char *buf)
+GetSelectionOwner(FD fd, const unsigned char *buf)
{
- /* Request GetSelectionOwner is opcode 23 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* GetSelectionOwner */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request GetSelectionOwner is opcode 23 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* GetSelectionOwner */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, ATOM, "selection");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, ATOM, "selection");
}
void
-GetSelectionOwnerReply (
- const unsigned char *buf)
+GetSelectionOwnerReply(const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* GetSelectionOwner */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, CONST4(0), "reply length");
- PrintField(buf, 8, 4, WINDOW, "owner");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* GetSelectionOwner */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, CONST4(0), "reply length");
+ PrintField(buf, 8, 4, WINDOW, "owner");
}
void
-ConvertSelection (
- FD fd,
- const unsigned char *buf)
+ConvertSelection(FD fd, const unsigned char *buf)
{
- /* Request ConvertSelection is opcode 24 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* ConvertSelection */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request ConvertSelection is opcode 24 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* ConvertSelection */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(6));
- PrintField(buf, 4, 4, WINDOW, "requestor");
- PrintField(buf, 8, 4, ATOM, "selection");
- PrintField(buf, 12, 4, ATOM, "target");
- PrintField(buf, 16, 4, ATOM, "property");
- PrintField(buf, 20, 4, TIMESTAMP, "time");
+ printreqlen(buf, fd, CONST2(6));
+ PrintField(buf, 4, 4, WINDOW, "requestor");
+ PrintField(buf, 8, 4, ATOM, "selection");
+ PrintField(buf, 12, 4, ATOM, "target");
+ PrintField(buf, 16, 4, ATOM, "property");
+ PrintField(buf, 20, 4, TIMESTAMP, "time");
}
void
-SendEvent (
- FD fd,
- const unsigned char *buf)
+SendEvent(FD fd, const unsigned char *buf)
{
- /* Request SendEvent is opcode 25 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* SendEvent */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request SendEvent is opcode 25 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* SendEvent */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- PrintField(buf, 1, 1, BOOL, "propagate");
- printreqlen(buf, fd, CONST2(11));
- PrintField(buf, 4, 4, WINDOWD, "destination");
- PrintField(buf, 8, 4, SETofEVENT, "event-mask");
- PrintField(buf, 12, 32, EVENTFORM, "event");
+ PrintField(buf, 1, 1, BOOL, "propagate");
+ printreqlen(buf, fd, CONST2(11));
+ PrintField(buf, 4, 4, WINDOWD, "destination");
+ PrintField(buf, 8, 4, SETofEVENT, "event-mask");
+ PrintField(buf, 12, 32, EVENTFORM, "event");
}
void
-GrabPointer (
- FD fd,
- const unsigned char *buf)
+GrabPointer(FD fd, const unsigned char *buf)
{
- /* Request GrabPointer is opcode 26 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* GrabPointer */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request GrabPointer is opcode 26 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* GrabPointer */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- PrintField(buf, 1, 1, BOOL, "owner-events");
- printreqlen(buf, fd, CONST2(6));
- PrintField(buf, 4, 4, WINDOW, "grab-window");
- PrintField(buf, 8, 2, SETofPOINTEREVENT, "event-mask");
- PrintField(buf, 10, 1, PK_MODE, "pointer-mode");
- PrintField(buf, 11, 1, PK_MODE, "keyboard-mode");
- PrintField(buf, 12, 4, WINDOW, "confine-to");
- PrintField(buf, 16, 4, CURSOR, "cursor");
- PrintField(buf, 20, 4, TIMESTAMP, "time");
+ PrintField(buf, 1, 1, BOOL, "owner-events");
+ printreqlen(buf, fd, CONST2(6));
+ PrintField(buf, 4, 4, WINDOW, "grab-window");
+ PrintField(buf, 8, 2, SETofPOINTEREVENT, "event-mask");
+ PrintField(buf, 10, 1, PK_MODE, "pointer-mode");
+ PrintField(buf, 11, 1, PK_MODE, "keyboard-mode");
+ PrintField(buf, 12, 4, WINDOW, "confine-to");
+ PrintField(buf, 16, 4, CURSOR, "cursor");
+ PrintField(buf, 20, 4, TIMESTAMP, "time");
}
void
-GrabPointerReply (
- const unsigned char *buf)
+GrabPointerReply(const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* GrabPointer */ ;
- if (Verbose < 1)
- return;
- PrintField(buf, 1, 1, GRABSTAT, "status");
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, CONST4(0), "reply length");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* GrabPointer */
+ if (Verbose < 1)
+ return;
+ PrintField(buf, 1, 1, GRABSTAT, "status");
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, CONST4(0), "reply length");
}
void
-UngrabPointer (
- FD fd,
- const unsigned char *buf)
+UngrabPointer(FD fd, const unsigned char *buf)
{
- /* Request UngrabPointer is opcode 27 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* UngrabPointer */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request UngrabPointer is opcode 27 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* UngrabPointer */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, TIMESTAMP, "time");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, TIMESTAMP, "time");
}
void
-GrabButton (
- FD fd,
- const unsigned char *buf)
+GrabButton(FD fd, const unsigned char *buf)
{
- /* Request GrabButton is opcode 28 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* GrabButton */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request GrabButton is opcode 28 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* GrabButton */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- PrintField(buf, 1, 1, BOOL, "owner-events");
- printreqlen(buf, fd, CONST2(6));
- PrintField(buf, 4, 4, WINDOW, "grab-window");
- PrintField(buf, 8, 2, SETofPOINTEREVENT, "event-mask");
- PrintField(buf, 10, 1, PK_MODE, "pointer-mode");
- PrintField(buf, 11, 1, PK_MODE, "keyboard-mode");
- PrintField(buf, 12, 4, WINDOW, "confine-to");
- PrintField(buf, 16, 4, CURSOR, "cursor");
- PrintField(buf, 20, 1, BUTTONA, "button");
- PrintField(buf, 22, 2, SETofKEYMASK, "modifiers");
+ PrintField(buf, 1, 1, BOOL, "owner-events");
+ printreqlen(buf, fd, CONST2(6));
+ PrintField(buf, 4, 4, WINDOW, "grab-window");
+ PrintField(buf, 8, 2, SETofPOINTEREVENT, "event-mask");
+ PrintField(buf, 10, 1, PK_MODE, "pointer-mode");
+ PrintField(buf, 11, 1, PK_MODE, "keyboard-mode");
+ PrintField(buf, 12, 4, WINDOW, "confine-to");
+ PrintField(buf, 16, 4, CURSOR, "cursor");
+ PrintField(buf, 20, 1, BUTTONA, "button");
+ PrintField(buf, 22, 2, SETofKEYMASK, "modifiers");
}
void
-UngrabButton (
- FD fd,
- const unsigned char *buf)
+UngrabButton(FD fd, const unsigned char *buf)
{
- /* Request UngrabButton is opcode 29 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* UngrabButton */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request UngrabButton is opcode 29 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* UngrabButton */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- PrintField(buf, 1, 1, BUTTONA, "button");
- printreqlen(buf, fd, CONST2(3));
- PrintField(buf, 4, 4, WINDOW, "grab-window");
- PrintField(buf, 8, 2, SETofKEYMASK, "modifiers");
+ PrintField(buf, 1, 1, BUTTONA, "button");
+ printreqlen(buf, fd, CONST2(3));
+ PrintField(buf, 4, 4, WINDOW, "grab-window");
+ PrintField(buf, 8, 2, SETofKEYMASK, "modifiers");
}
void
-ChangeActivePointerGrab (
- FD fd,
- const unsigned char *buf)
+ChangeActivePointerGrab(FD fd, const unsigned char *buf)
{
- /* Request ChangeActivePointerGrab is opcode 30 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* ChangeActivePointerGrab */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request ChangeActivePointerGrab is opcode 30 */
+ PrintField(buf, 0, 1, REQUEST,
+ REQUESTHEADER); /* ChangeActivePointerGrab */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(4));
- PrintField(buf, 4, 4, CURSOR, "cursor");
- PrintField(buf, 8, 4, TIMESTAMP, "time");
- PrintField(buf, 12, 2, SETofPOINTEREVENT, "event-mask");
+ printreqlen(buf, fd, CONST2(4));
+ PrintField(buf, 4, 4, CURSOR, "cursor");
+ PrintField(buf, 8, 4, TIMESTAMP, "time");
+ PrintField(buf, 12, 2, SETofPOINTEREVENT, "event-mask");
}
void
-GrabKeyboard (
- FD fd,
- const unsigned char *buf)
+GrabKeyboard(FD fd, const unsigned char *buf)
{
- /* Request GrabKeyboard is opcode 31 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* GrabKeyboard */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request GrabKeyboard is opcode 31 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* GrabKeyboard */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- PrintField(buf, 1, 1, BOOL, "owner-events");
- printreqlen(buf, fd, CONST2(4));
- PrintField(buf, 4, 4, WINDOW, "grab-window");
- PrintField(buf, 8, 4, TIMESTAMP, "time");
- PrintField(buf, 12, 1, PK_MODE, "pointer-mode");
- PrintField(buf, 13, 1, PK_MODE, "keyboard-mode");
+ PrintField(buf, 1, 1, BOOL, "owner-events");
+ printreqlen(buf, fd, CONST2(4));
+ PrintField(buf, 4, 4, WINDOW, "grab-window");
+ PrintField(buf, 8, 4, TIMESTAMP, "time");
+ PrintField(buf, 12, 1, PK_MODE, "pointer-mode");
+ PrintField(buf, 13, 1, PK_MODE, "keyboard-mode");
}
void
-GrabKeyboardReply (
- const unsigned char *buf)
+GrabKeyboardReply(const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* GrabKeyboard */ ;
- if (Verbose < 1)
- return;
- PrintField(buf, 1, 1, GRABSTAT, "status");
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, CONST4(0), "reply length");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* GrabKeyboard */
+ if (Verbose < 1)
+ return;
+ PrintField(buf, 1, 1, GRABSTAT, "status");
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, CONST4(0), "reply length");
}
void
-UngrabKeyboard (
- FD fd,
- const unsigned char *buf)
+UngrabKeyboard(FD fd, const unsigned char *buf)
{
- /* Request UngrabKeyboard is opcode 32 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* UngrabKeyboard */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request UngrabKeyboard is opcode 32 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* UngrabKeyboard */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, TIMESTAMP, "time");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, TIMESTAMP, "time");
}
void
-GrabKey (
- FD fd,
- const unsigned char *buf)
+GrabKey(FD fd, const unsigned char *buf)
{
- /* Request GrabKey is opcode 33 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* GrabKey */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request GrabKey is opcode 33 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* GrabKey */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- PrintField(buf, 1, 1, BOOL, "owner-events");
- printreqlen(buf, fd, CONST2(4));
- PrintField(buf, 4, 4, WINDOW, "grab-window");
- PrintField(buf, 8, 2, SETofKEYMASK, "modifiers");
- PrintField(buf, 10, 1, KEYCODEA, "key");
- PrintField(buf, 11, 1, PK_MODE, "pointer-mode");
- PrintField(buf, 12, 1, PK_MODE, "keyboard-mode");
+ PrintField(buf, 1, 1, BOOL, "owner-events");
+ printreqlen(buf, fd, CONST2(4));
+ PrintField(buf, 4, 4, WINDOW, "grab-window");
+ PrintField(buf, 8, 2, SETofKEYMASK, "modifiers");
+ PrintField(buf, 10, 1, KEYCODEA, "key");
+ PrintField(buf, 11, 1, PK_MODE, "pointer-mode");
+ PrintField(buf, 12, 1, PK_MODE, "keyboard-mode");
}
void
-UngrabKey (
- FD fd,
- const unsigned char *buf)
+UngrabKey(FD fd, const unsigned char *buf)
{
- /* Request UngrabKey is opcode 34 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* UngrabKey */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request UngrabKey is opcode 34 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* UngrabKey */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- PrintField(buf, 1, 1, KEYCODEA, "key");
- printreqlen(buf, fd, CONST2(3));
- PrintField(buf, 4, 4, WINDOW, "grab-window");
- PrintField(buf, 8, 2, SETofKEYMASK, "modifiers");
+ PrintField(buf, 1, 1, KEYCODEA, "key");
+ printreqlen(buf, fd, CONST2(3));
+ PrintField(buf, 4, 4, WINDOW, "grab-window");
+ PrintField(buf, 8, 2, SETofKEYMASK, "modifiers");
}
void
-AllowEvents (
- FD fd,
- const unsigned char *buf)
+AllowEvents(FD fd, const unsigned char *buf)
{
- /* Request AllowEvents is opcode 35 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* AllowEvents */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request AllowEvents is opcode 35 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* AllowEvents */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- PrintField(buf, 1, 1, EVENTMODE, "mode");
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, TIMESTAMP, "time");
+ PrintField(buf, 1, 1, EVENTMODE, "mode");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, TIMESTAMP, "time");
}
void
-GrabServer (
- FD fd,
- const unsigned char *buf)
+GrabServer(FD fd, const unsigned char *buf)
{
- /* Request GrabServer is opcode 36 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* GrabServer */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request GrabServer is opcode 36 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* GrabServer */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(1));
+ printreqlen(buf, fd, CONST2(1));
}
void
-UngrabServer (
- FD fd,
- const unsigned char *buf)
+UngrabServer(FD fd, const unsigned char *buf)
{
- /* Request UngrabServer is opcode 37 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* UngrabServer */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request UngrabServer is opcode 37 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* UngrabServer */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(1));
+ printreqlen(buf, fd, CONST2(1));
}
void
-QueryPointer (
- FD fd,
- const unsigned char *buf)
+QueryPointer(FD fd, const unsigned char *buf)
{
- /* Request QueryPointer is opcode 38 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* QueryPointer */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request QueryPointer is opcode 38 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* QueryPointer */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, WINDOW, "window");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, WINDOW, "window");
}
void
-QueryPointerReply (
- const unsigned char *buf)
+QueryPointerReply(const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* QueryPointer */ ;
- if (Verbose < 1)
- return;
- PrintField(buf, 1, 1, BOOL, "same-screen");
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, CONST4(0), "reply length");
- PrintField(buf, 8, 4, WINDOW, "root");
- PrintField(buf, 12, 4, WINDOW, "child");
- PrintField(buf, 16, 2, INT16, "root-x");
- PrintField(buf, 18, 2, INT16, "root-y");
- PrintField(buf, 20, 2, INT16, "win-x");
- PrintField(buf, 22, 2, INT16, "win-y");
- PrintField(buf, 24, 2, SETofKEYBUTMASK, "mask");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* QueryPointer */
+ if (Verbose < 1)
+ return;
+ PrintField(buf, 1, 1, BOOL, "same-screen");
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, CONST4(0), "reply length");
+ PrintField(buf, 8, 4, WINDOW, "root");
+ PrintField(buf, 12, 4, WINDOW, "child");
+ PrintField(buf, 16, 2, INT16, "root-x");
+ PrintField(buf, 18, 2, INT16, "root-y");
+ PrintField(buf, 20, 2, INT16, "win-x");
+ PrintField(buf, 22, 2, INT16, "win-y");
+ PrintField(buf, 24, 2, SETofKEYBUTMASK, "mask");
}
void
-GetMotionEvents (
- FD fd,
- const unsigned char *buf)
+GetMotionEvents(FD fd, const unsigned char *buf)
{
- /* Request GetMotionEvents is opcode 39 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* GetMotionEvents */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request GetMotionEvents is opcode 39 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* GetMotionEvents */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(4));
- PrintField(buf, 4, 4, WINDOW, "window");
- PrintField(buf, 8, 4, TIMESTAMP, "start");
- PrintField(buf, 12, 4, TIMESTAMP, "stop");
+ printreqlen(buf, fd, CONST2(4));
+ PrintField(buf, 4, 4, WINDOW, "window");
+ PrintField(buf, 8, 4, TIMESTAMP, "start");
+ PrintField(buf, 12, 4, TIMESTAMP, "stop");
}
void
-GetMotionEventsReply (
- const unsigned char *buf)
+GetMotionEventsReply(const unsigned char *buf)
{
- long n;
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* GetMotionEvents */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4(2*n), "reply length");
- printfield(buf, 8, 4, DVALUE4(n), "number of events");
- n = ILong(&buf[8]);
- PrintList(&buf[32], n, TIMECOORD, "events");
+ long n;
+
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* GetMotionEvents */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(2 * n), "reply length");
+ printfield(buf, 8, 4, DVALUE4(n), "number of events");
+ n = ILong(&buf[8]);
+ PrintList(&buf[32], n, TIMECOORD, "events");
}
void
-TranslateCoordinates (
- FD fd,
- const unsigned char *buf)
+TranslateCoordinates(FD fd, const unsigned char *buf)
{
- /* Request TranslateCoordinates is opcode 40 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* TranslateCoordinates */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request TranslateCoordinates is opcode 40 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* TranslateCoordinates */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(4));
- PrintField(buf, 4, 4, WINDOW, "src-window");
- PrintField(buf, 8, 4, WINDOW, "dst-window");
- PrintField(buf, 12, 2, INT16, "src-x");
- PrintField(buf, 14, 2, INT16, "src-y");
+ printreqlen(buf, fd, CONST2(4));
+ PrintField(buf, 4, 4, WINDOW, "src-window");
+ PrintField(buf, 8, 4, WINDOW, "dst-window");
+ PrintField(buf, 12, 2, INT16, "src-x");
+ PrintField(buf, 14, 2, INT16, "src-y");
}
void
-TranslateCoordinatesReply (
- const unsigned char *buf)
+TranslateCoordinatesReply(const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* TranslateCoordinates */ ;
- if (Verbose < 1)
- return;
- PrintField(buf, 1, 1, BOOL, "same-screen");
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, CONST4(0), "reply length");
- PrintField(buf, 8, 4, WINDOW, "child");
- PrintField(buf, 12, 2, INT16, "dst-x");
- PrintField(buf, 14, 2, INT16, "dst-y");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* TranslateCoordinates */
+ if (Verbose < 1)
+ return;
+ PrintField(buf, 1, 1, BOOL, "same-screen");
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, CONST4(0), "reply length");
+ PrintField(buf, 8, 4, WINDOW, "child");
+ PrintField(buf, 12, 2, INT16, "dst-x");
+ PrintField(buf, 14, 2, INT16, "dst-y");
}
void
-WarpPointer (
- FD fd,
- const unsigned char *buf)
+WarpPointer(FD fd, const unsigned char *buf)
{
- /* Request WarpPointer is opcode 41 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* WarpPointer */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request WarpPointer is opcode 41 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* WarpPointer */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(6));
- PrintField(buf, 4, 4, WINDOW, "src-window");
- PrintField(buf, 8, 4, WINDOW, "dst-window");
- PrintField(buf, 12, 2, INT16, "src-x");
- PrintField(buf, 14, 2, INT16, "src-y");
- PrintField(buf, 16, 2, CARD16, "src-width");
- PrintField(buf, 18, 2, CARD16, "src-height");
- PrintField(buf, 20, 2, INT16, "dst-x");
- PrintField(buf, 22, 2, INT16, "dst-y");
+ printreqlen(buf, fd, CONST2(6));
+ PrintField(buf, 4, 4, WINDOW, "src-window");
+ PrintField(buf, 8, 4, WINDOW, "dst-window");
+ PrintField(buf, 12, 2, INT16, "src-x");
+ PrintField(buf, 14, 2, INT16, "src-y");
+ PrintField(buf, 16, 2, CARD16, "src-width");
+ PrintField(buf, 18, 2, CARD16, "src-height");
+ PrintField(buf, 20, 2, INT16, "dst-x");
+ PrintField(buf, 22, 2, INT16, "dst-y");
}
void
-SetInputFocus (
- FD fd,
- const unsigned char *buf)
+SetInputFocus(FD fd, const unsigned char *buf)
{
- /* Request SetInputFocus is opcode 42 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* SetInputFocus */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request SetInputFocus is opcode 42 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* SetInputFocus */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- PrintField(buf, 1, 1, FOCUSAGENT, "revert-to");
- printreqlen(buf, fd, CONST2(3));
- PrintField(buf, 4, 4, WINDOWNR, "focus");
- PrintField(buf, 8, 4, TIMESTAMP, "time");
+ PrintField(buf, 1, 1, FOCUSAGENT, "revert-to");
+ printreqlen(buf, fd, CONST2(3));
+ PrintField(buf, 4, 4, WINDOWNR, "focus");
+ PrintField(buf, 8, 4, TIMESTAMP, "time");
}
void
-GetInputFocus (
- FD fd,
- const unsigned char *buf)
+GetInputFocus(FD fd, const unsigned char *buf)
{
- /* Request GetInputFocus is opcode 43 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* GetInputFocus */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request GetInputFocus is opcode 43 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* GetInputFocus */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(1));
+ printreqlen(buf, fd, CONST2(1));
}
void
-GetInputFocusReply (
- const unsigned char *buf)
+GetInputFocusReply(const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* GetInputFocus */ ;
- if (Verbose < 1)
- return;
- PrintField(buf, 1, 1, FOCUSAGENT, "revert-to");
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, CONST4(0), "reply length");
- PrintField(buf, 8, 4, WINDOWNR, "focus");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* GetInputFocus */
+ if (Verbose < 1)
+ return;
+ PrintField(buf, 1, 1, FOCUSAGENT, "revert-to");
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, CONST4(0), "reply length");
+ PrintField(buf, 8, 4, WINDOWNR, "focus");
}
void
-QueryKeymap (
- FD fd,
- const unsigned char *buf)
+QueryKeymap(FD fd, const unsigned char *buf)
{
- /* Request QueryKeymap is opcode 44 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* QueryKeymap */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request QueryKeymap is opcode 44 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* QueryKeymap */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(1));
+ printreqlen(buf, fd, CONST2(1));
}
void
-QueryKeymapReply (
- const unsigned char *buf)
+QueryKeymapReply(const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* QueryKeymap */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, CONST4(2), "reply length");
- PrintBytes(&buf[8], 32L, "keys");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* QueryKeymap */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, CONST4(2), "reply length");
+ PrintBytes(&buf[8], 32L, "keys");
}
void
-OpenFont (
- FD fd,
- const unsigned char *buf)
+OpenFont(FD fd, const unsigned char *buf)
{
- short n;
- /* Request OpenFont is opcode 45 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* OpenFont */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ short n;
+
+ /* Request OpenFont is opcode 45 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* OpenFont */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, DVALUE2(3 + (n + p) / 4));
- PrintField(buf, 4, 4, FONT, "font-id");
- printfield(buf, 8, 2, DVALUE2(n), "length of name");
- n = IShort(&buf[8]);
- PrintString8(&buf[12], n, "name");
+ printreqlen(buf, fd, DVALUE2(3 + (n + p) / 4));
+ PrintField(buf, 4, 4, FONT, "font-id");
+ printfield(buf, 8, 2, DVALUE2(n), "length of name");
+ n = IShort(&buf[8]);
+ PrintString8(&buf[12], n, "name");
}
void
-CloseFont (
- FD fd,
- const unsigned char *buf)
+CloseFont(FD fd, const unsigned char *buf)
{
- /* Request CloseFont is opcode 46 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* CloseFont */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request CloseFont is opcode 46 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* CloseFont */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, FONT, "font");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, FONT, "font");
}
void
-QueryFont (
- FD fd,
- const unsigned char *buf)
+QueryFont(FD fd, const unsigned char *buf)
{
- /* Request QueryFont is opcode 47 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* QueryFont */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request QueryFont is opcode 47 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* QueryFont */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, FONTABLE, "font");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, FONTABLE, "font");
}
void
-QueryFontReply (
- const unsigned char *buf)
+QueryFontReply(const unsigned char *buf)
{
- short n;
- long m;
- long k;
+ short n;
+ long m;
+ long k;
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* QueryFont */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4(7 + 2*n + 3*m), "reply length");
- PrintField(buf, 8, 12, CHARINFO, "min-bounds");
- PrintField(buf, 24, 12, CHARINFO, "max-bounds");
- PrintField(buf, 40, 2, CARD16, "min-char-or-byte2");
- PrintField(buf, 42, 2, CARD16, "max-char-or-byte2");
- PrintField(buf, 44, 2, CARD16, "default-char");
- printfield(buf, 46, 2, DVALUE2(n), "number of FONTPROPs");
- n = IShort(&buf[46]);
- PrintField(buf, 48, 1, DIRECT, "draw-direction");
- PrintField(buf, 49, 1, CARD8, "min-byte1");
- PrintField(buf, 50, 1, CARD8, "max-byte1");
- PrintField(buf, 51, 1, BOOL, "all-chars-exist");
- PrintField(buf, 52, 2, INT16, "font-ascent");
- PrintField(buf, 54, 2, INT16, "font-descent");
- printfield(buf, 56, 4, DVALUE4(m), "number of CHARINFOs");
- m = ILong(&buf[56]);
- k = PrintList(&buf[60], (long)n, FONTPROP, "properties");
- PrintList(&buf[60 + k], (long)m, CHARINFO, "char-infos");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* QueryFont */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(7 + 2 * n + 3 * m), "reply length");
+ PrintField(buf, 8, 12, CHARINFO, "min-bounds");
+ PrintField(buf, 24, 12, CHARINFO, "max-bounds");
+ PrintField(buf, 40, 2, CARD16, "min-char-or-byte2");
+ PrintField(buf, 42, 2, CARD16, "max-char-or-byte2");
+ PrintField(buf, 44, 2, CARD16, "default-char");
+ printfield(buf, 46, 2, DVALUE2(n), "number of FONTPROPs");
+ n = IShort(&buf[46]);
+ PrintField(buf, 48, 1, DIRECT, "draw-direction");
+ PrintField(buf, 49, 1, CARD8, "min-byte1");
+ PrintField(buf, 50, 1, CARD8, "max-byte1");
+ PrintField(buf, 51, 1, BOOL, "all-chars-exist");
+ PrintField(buf, 52, 2, INT16, "font-ascent");
+ PrintField(buf, 54, 2, INT16, "font-descent");
+ printfield(buf, 56, 4, DVALUE4(m), "number of CHARINFOs");
+ m = ILong(&buf[56]);
+ k = PrintList(&buf[60], (long) n, FONTPROP, "properties");
+ PrintList(&buf[60 + k], (long) m, CHARINFO, "char-infos");
}
void
-QueryTextExtents (
- FD fd,
- const unsigned char *buf)
+QueryTextExtents(FD fd, const unsigned char *buf)
{
- int n;
+ int n;
- /* Request QueryTextExtents is opcode 48 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* QueryTextExtents */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request QueryTextExtents is opcode 48 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* QueryTextExtents */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printfield(buf, 1, 1, BOOL, "odd length?");
- printreqlen(buf, fd, DVALUE2(2 + (2*n + p) / 4));
- n = (IShort(&buf[2]) - 2) * 4 / 2;
- if (IBool(&buf[1]))
- n -= 1;
- PrintField(buf, 4, 4, FONTABLE, "font");
- PrintString16(&buf[8], n, "string");
-}
-
-void
-QueryTextExtentsReply (
- const unsigned char *buf)
+ printfield(buf, 1, 1, BOOL, "odd length?");
+ printreqlen(buf, fd, DVALUE2(2 + (2 * n + p) / 4));
+ n = (IShort(&buf[2]) - 2) * 4 / 2;
+ if (IBool(&buf[1]))
+ n -= 1;
+ PrintField(buf, 4, 4, FONTABLE, "font");
+ PrintString16(&buf[8], n, "string");
+}
+
+void
+QueryTextExtentsReply(const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* QueryTextExtents */ ;
- if (Verbose < 1)
- return;
- PrintField(buf, 1, 1, DIRECT, "draw-direction");
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, CONST4(0), "reply length");
- PrintField(buf, 8, 2, INT16, "font-ascent");
- PrintField(buf, 10, 2, INT16, "font-descent");
- PrintField(buf, 12, 2, INT16, "overall-ascent");
- PrintField(buf, 14, 2, INT16, "overall-descent");
- PrintField(buf, 16, 4, INT32, "overall-width");
- PrintField(buf, 20, 4, INT32, "overall-left");
- PrintField(buf, 24, 4, INT32, "overall-right");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* QueryTextExtents */
+ if (Verbose < 1)
+ return;
+ PrintField(buf, 1, 1, DIRECT, "draw-direction");
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, CONST4(0), "reply length");
+ PrintField(buf, 8, 2, INT16, "font-ascent");
+ PrintField(buf, 10, 2, INT16, "font-descent");
+ PrintField(buf, 12, 2, INT16, "overall-ascent");
+ PrintField(buf, 14, 2, INT16, "overall-descent");
+ PrintField(buf, 16, 4, INT32, "overall-width");
+ PrintField(buf, 20, 4, INT32, "overall-left");
+ PrintField(buf, 24, 4, INT32, "overall-right");
}
-
-void
-ListFonts (
- FD fd,
- const unsigned char *buf)
+
+void
+ListFonts(FD fd, const unsigned char *buf)
{
- short n;
- /* Request ListFonts is opcode 49 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* ListFonts */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, DVALUE2(2 + (n + p) / 4));
- PrintField(buf, 4, 2, CARD16, "max-names");
- printfield(buf, 6, 2, DVALUE2(n), "length of pattern");
- n = IShort(&buf[6]);
- PrintString8(&buf[8], n, "pattern");
-}
-
-void
-ListFontsReply (
- const unsigned char *buf)
-{
- short n;
-
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* ListFonts */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4((n + p) / 4), "reply length");
- printfield(buf, 8, 2, CARD16, "number of names");
- n = IShort(&buf[8]);
- PrintListSTR(&buf[32], (long)n, "names");
-}
-
-void
-ListFontsWithInfo (
- FD fd,
- const unsigned char *buf)
-{
- short n;
- /* Request ListFontsWithInfo is opcode 50 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* ListFontsWithInfo */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ short n;
+
+ /* Request ListFonts is opcode 49 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* ListFonts */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, DVALUE2(2 + (n + p) / 4));
- PrintField(buf, 4, 2, CARD16, "max-names");
- printfield(buf, 6, 2, DVALUE2(n), "length of pattern");
- n = IShort(&buf[6]);
- PrintString8(&buf[8], n, "pattern");
+ printreqlen(buf, fd, DVALUE2(2 + (n + p) / 4));
+ PrintField(buf, 4, 2, CARD16, "max-names");
+ printfield(buf, 6, 2, DVALUE2(n), "length of pattern");
+ n = IShort(&buf[6]);
+ PrintString8(&buf[8], n, "pattern");
}
void
-ListFontsWithInfoReply (
- const unsigned char *buf)
+ListFontsReply(const unsigned char *buf)
{
- short which;
+ short n;
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* ListFontsWithInfo */ ;
- if (Verbose < 1) return;
- which = IByte(&buf[1]);
- if (which != 0)
- {
- ListFontsWithInfoReply1(buf);
- KeepLastReplyExpected();
- }
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* ListFonts */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4((n + p) / 4), "reply length");
+ printfield(buf, 8, 2, CARD16, "number of names");
+ n = IShort(&buf[8]);
+ PrintListSTR(&buf[32], (long) n, "names");
+}
+
+void
+ListFontsWithInfo(FD fd, const unsigned char *buf)
+{
+ short n;
+
+ /* Request ListFontsWithInfo is opcode 50 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* ListFontsWithInfo */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, DVALUE2(2 + (n + p) / 4));
+ PrintField(buf, 4, 2, CARD16, "max-names");
+ printfield(buf, 6, 2, DVALUE2(n), "length of pattern");
+ n = IShort(&buf[6]);
+ PrintString8(&buf[8], n, "pattern");
+}
+
+void
+ListFontsWithInfoReply(const unsigned char *buf)
+{
+ short which;
- else
- ListFontsWithInfoReply2(buf);
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* ListFontsWithInfo */
+ if (Verbose < 1)
+ return;
+ which = IByte(&buf[1]);
+ if (which != 0) {
+ ListFontsWithInfoReply1(buf);
+ KeepLastReplyExpected();
+ }
+ else
+ ListFontsWithInfoReply2(buf);
}
static void
-ListFontsWithInfoReply1 (
- const unsigned char *buf)
-{
- short n;
- short m;
- printfield(buf, 1, 1, DVALUE1(n), "length of name in bytes");
- n = IByte(&buf[1]);
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4(7 + 2*m + (n + p) / 4), "reply length");
- PrintField(buf, 8, 12, CHARINFO, "min-bounds");
- PrintField(buf, 24, 12, CHARINFO, "max-bounds");
- PrintField(buf, 40, 2, CARD16, "min-char-or-byte2");
- PrintField(buf, 42, 2, CARD16, "max-char-or-byte2");
- PrintField(buf, 44, 2, CARD16, "default-char");
- printfield(buf, 46, 2, DVALUE2(m), "number of FONTPROPs");
- m = IShort(&buf[46]);
- PrintField(buf, 48, 1, DIRECT, "draw-direction");
- PrintField(buf, 49, 1, CARD8, "min-byte1");
- PrintField(buf, 50, 1, CARD8, "max-byte1");
- PrintField(buf, 51, 1, BOOL, "all-chars-exist");
- PrintField(buf, 52, 2, INT16, "font-ascent");
- PrintField(buf, 54, 2, INT16, "font-descent");
- PrintField(buf, 56, 4, CARD32, "replies-hint");
- PrintList(&buf[60], (long)m, FONTPROP, "properties");
- PrintString8(&buf[60 + 8 * m], n, "name");
+ListFontsWithInfoReply1(const unsigned char *buf)
+{
+ short n;
+ short m;
+
+ printfield(buf, 1, 1, DVALUE1(n), "length of name in bytes");
+ n = IByte(&buf[1]);
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(7 + 2 * m + (n + p) / 4), "reply length");
+ PrintField(buf, 8, 12, CHARINFO, "min-bounds");
+ PrintField(buf, 24, 12, CHARINFO, "max-bounds");
+ PrintField(buf, 40, 2, CARD16, "min-char-or-byte2");
+ PrintField(buf, 42, 2, CARD16, "max-char-or-byte2");
+ PrintField(buf, 44, 2, CARD16, "default-char");
+ printfield(buf, 46, 2, DVALUE2(m), "number of FONTPROPs");
+ m = IShort(&buf[46]);
+ PrintField(buf, 48, 1, DIRECT, "draw-direction");
+ PrintField(buf, 49, 1, CARD8, "min-byte1");
+ PrintField(buf, 50, 1, CARD8, "max-byte1");
+ PrintField(buf, 51, 1, BOOL, "all-chars-exist");
+ PrintField(buf, 52, 2, INT16, "font-ascent");
+ PrintField(buf, 54, 2, INT16, "font-descent");
+ PrintField(buf, 56, 4, CARD32, "replies-hint");
+ PrintList(&buf[60], (long) m, FONTPROP, "properties");
+ PrintString8(&buf[60 + 8 * m], n, "name");
}
static void
-ListFontsWithInfoReply2 (
- const unsigned char *buf)
+ListFontsWithInfoReply2(const unsigned char *buf)
+{
+ PrintField(buf, 1, 1, CONST1(0), "last-reply indicator");
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, CONST4(7), "reply length");
+}
+
+void
+SetFontPath(FD fd, const unsigned char *buf)
+{
+ short n;
+
+ /* Request SetFontPath is opcode 51 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* SetFontPath */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, DVALUE2(2 + (n + p) / 4));
+ printfield(buf, 4, 2, CARD16, "number of paths");
+ n = IShort(&buf[4]);
+ PrintListSTR(&buf[8], (long) n, "paths");
+}
+
+void
+GetFontPath(FD fd, const unsigned char *buf)
{
- PrintField(buf, 1, 1, CONST1(0), "last-reply indicator");
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, CONST4(7), "reply length");
+ /* Request GetFontPath is opcode 52 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* GetFontPath */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ PrintField(buf, 2, 2, CONST2(1), "request list");
}
void
-SetFontPath (
- FD fd,
- const unsigned char *buf)
-{
- short n;
- /* Request SetFontPath is opcode 51 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* SetFontPath */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, DVALUE2(2 + (n + p) / 4));
- printfield(buf, 4, 2, CARD16, "number of paths");
- n = IShort(&buf[4]);
- PrintListSTR(&buf[8], (long)n, "paths");
-}
-
-void
-GetFontPath (
- FD fd,
- const unsigned char *buf)
-{
- /* Request GetFontPath is opcode 52 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* GetFontPath */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- PrintField(buf, 2, 2, CONST2(1), "request list");
-}
-
-void
-GetFontPathReply (
- const unsigned char *buf)
-{
- short n;
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* GetFontPath */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4((n + p) / 4), "reply length");
- printfield(buf, 8, 2, CARD16, "number of paths");
- n = IShort(&buf[8]);
- PrintListSTR(&buf[32], (long)n, "paths");
-}
-
-void
-CreatePixmap (
- FD fd,
- const unsigned char *buf)
-{
- /* Request CreatePixmap is opcode 53 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* CreatePixmap */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- PrintField(buf, 1, 1, CARD8, "depth");
- printreqlen(buf, fd, CONST2(4));
- PrintField(buf, 4, 4, PIXMAP, "pixmap-id");
- PrintField(buf, 8, 4, DRAWABLE, "drawable");
- PrintField(buf, 12, 2, CARD16, "width");
- PrintField(buf, 14, 2, CARD16, "height");
-}
-
-void
-FreePixmap (
- FD fd,
- const unsigned char *buf)
-{
- /* Request FreePixmap is opcode 54 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* FreePixmap */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, PIXMAP, "pixmap");
-}
-
-static const unsigned long GCDefaults[] = {
- 3, /* function GXcopy */
- ~0, /* planemask */
- 0, /* foreground */
- 1, /* background */
- 0, /* line width */
- 0, /* line style Solid */
- 1, /* cap style Butt */
- 0, /* join style Miter */
- 0, /* fill style Solid */
- 0, /* fill rule EvenOdd */
- 0, /* tile */
- 0, /* stipple */
- 0, /* ts org x */
- 0, /* ts org y */
- 0, /* font */
- 0, /* sub window mode ClipByChildren */
- 1, /* graphics expose True */
- 0, /* clip x org */
- 0, /* clip y org */
- 0, /* clip mask */
- 0, /* dash offset */
- 4, /* dashes */
- 1, /* arc mode PieSlice */
+GetFontPathReply(const unsigned char *buf)
+{
+ short n;
+
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* GetFontPath */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4((n + p) / 4), "reply length");
+ printfield(buf, 8, 2, CARD16, "number of paths");
+
+ n = IShort(&buf[8]);
+ PrintListSTR(&buf[32], (long) n, "paths");
+}
+
+void
+CreatePixmap(FD fd, const unsigned char *buf)
+{
+ /* Request CreatePixmap is opcode 53 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* CreatePixmap */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ PrintField(buf, 1, 1, CARD8, "depth");
+ printreqlen(buf, fd, CONST2(4));
+ PrintField(buf, 4, 4, PIXMAP, "pixmap-id");
+ PrintField(buf, 8, 4, DRAWABLE, "drawable");
+ PrintField(buf, 12, 2, CARD16, "width");
+ PrintField(buf, 14, 2, CARD16, "height");
+}
+
+void
+FreePixmap(FD fd, const unsigned char *buf)
+{
+ /* Request FreePixmap is opcode 54 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* FreePixmap */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, PIXMAP, "pixmap");
+}
+
+static const unsigned long GCDefaults[] = {
+ 3, /* function GXcopy */
+ ~0, /* planemask */
+ 0, /* foreground */
+ 1, /* background */
+ 0, /* line width */
+ 0, /* line style Solid */
+ 1, /* cap style Butt */
+ 0, /* join style Miter */
+ 0, /* fill style Solid */
+ 0, /* fill rule EvenOdd */
+ 0, /* tile */
+ 0, /* stipple */
+ 0, /* ts org x */
+ 0, /* ts org y */
+ 0, /* font */
+ 0, /* sub window mode ClipByChildren */
+ 1, /* graphics expose True */
+ 0, /* clip x org */
+ 0, /* clip y org */
+ 0, /* clip mask */
+ 0, /* dash offset */
+ 4, /* dashes */
+ 1, /* arc mode PieSlice */
};
void
-CreateGC (
- FD fd,
- const unsigned char *buf)
+CreateGC(FD fd, const unsigned char *buf)
+{
+ CreateValueRec(ILong(buf + 4), 23, GCDefaults);
+ SetValueRec(ILong(buf + 4), &buf[12], 4, GC_BITMASK, &buf[16]);
+
+ /* Request CreateGC is opcode 55 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* CreateGC */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, DVALUE2(4 + n));
+ PrintField(buf, 4, 4, GCONTEXT, "graphic-context-id");
+ PrintField(buf, 8, 4, DRAWABLE, "drawable");
+ PrintField(buf, 12, 4, GC_BITMASK, "value-mask");
+ PrintValues(&buf[12], 4, GC_BITMASK, &buf[16], "value-list");
+}
+
+void
+ChangeGC(FD fd, const unsigned char *buf)
+{
+ SetValueRec(ILong(buf + 4), &buf[8], 4, GC_BITMASK, &buf[12]);
+
+ /* Request ChangeGC is opcode 56 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* ChangeGC */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, DVALUE2(3 + n));
+ PrintField(buf, 4, 4, GCONTEXT, "gc");
+ PrintField(buf, 8, 4, GC_BITMASK, "value-mask");
+ PrintValues(&buf[8], 4, GC_BITMASK, &buf[12], "value-list");
+}
+
+void
+CopyGC(FD fd, const unsigned char *buf)
+{
+ /* Request CopyGC is opcode 57 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* CopyGC */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(4));
+ PrintField(buf, 4, 4, GCONTEXT, "src-gc");
+ PrintField(buf, 8, 4, GCONTEXT, "dst-gc");
+ PrintField(buf, 12, 4, GC_BITMASK, "value-mask");
+}
+
+void
+SetDashes(FD fd, const unsigned char *buf)
+{
+ short n;
+
+ /* Request SetDashes is opcode 58 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* SetDashes */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, DVALUE2(3 + (n + p) / 4));
+ PrintField(buf, 4, 4, GCONTEXT, "gc");
+ PrintField(buf, 8, 2, CARD16, "dash-offset");
+ printfield(buf, 10, 2, DVALUE2(n), "length of dashes");
+ n = IShort(&buf[10]);
+ PrintBytes(&buf[12], (long) n, "dashes");
+}
+
+void
+SetClipRectangles(FD fd, const unsigned char *buf)
+{
+ short n;
+
+ /* Request SetClipRectangles is opcode 59 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* SetClipRectangles */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ PrintField(buf, 1, 1, RECTORDER, "ordering");
+ printreqlen(buf, fd, DVALUE2(3 + 2 * n));
+ n = (IShort(&buf[2]) - 3) / 2;
+ PrintField(buf, 4, 4, GCONTEXT, "gc");
+ PrintField(buf, 8, 2, INT16, "clip-x-origin");
+ PrintField(buf, 10, 2, INT16, "clip-y-origin");
+ PrintList(&buf[12], (long) n, RECTANGLE, "rectangles");
+}
+
+void
+FreeGC(FD fd, const unsigned char *buf)
{
- CreateValueRec (ILong(buf+4), 23, GCDefaults);
- SetValueRec (ILong(buf+4), &buf[12], 4, GC_BITMASK, &buf[16]);
-
- /* Request CreateGC is opcode 55 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* CreateGC */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ DeleteValueRec(ILong(&buf[4]));
- printreqlen(buf, fd, DVALUE2(4 + n));
- PrintField(buf, 4, 4, GCONTEXT, "graphic-context-id");
- PrintField(buf, 8, 4, DRAWABLE, "drawable");
- PrintField(buf, 12, 4, GC_BITMASK, "value-mask");
- PrintValues(&buf[12], 4, GC_BITMASK, &buf[16], "value-list");
+ /* Request FreeGC is opcode 60 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* FreeGC */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, GCONTEXT, "gc");
}
void
-ChangeGC (
- FD fd,
- const unsigned char *buf)
+ClearArea(FD fd, const unsigned char *buf)
{
- SetValueRec (ILong(buf+4), &buf[8], 4, GC_BITMASK, &buf[12]);
-
- /* Request ChangeGC is opcode 56 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* ChangeGC */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request ClearArea is opcode 61 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* ClearArea */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, DVALUE2(3 + n));
- PrintField(buf, 4, 4, GCONTEXT, "gc");
- PrintField(buf, 8, 4, GC_BITMASK, "value-mask");
- PrintValues(&buf[8], 4, GC_BITMASK, &buf[12], "value-list");
+ PrintField(buf, 1, 1, BOOL, "exposures");
+ printreqlen(buf, fd, CONST2(4));
+ PrintField(buf, 4, 4, WINDOW, "window");
+ PrintField(buf, 8, 2, INT16, "x");
+ PrintField(buf, 10, 2, INT16, "y");
+ PrintField(buf, 12, 2, CARD16, "width");
+ PrintField(buf, 14, 2, CARD16, "height");
}
void
-CopyGC (
- FD fd,
- const unsigned char *buf)
+CopyArea(FD fd, const unsigned char *buf)
+{
+ /* Request CopyArea is opcode 62 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* CopyArea */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(7));
+ PrintField(buf, 4, 4, DRAWABLE, "src-drawable");
+ PrintField(buf, 8, 4, DRAWABLE, "dst-drawable");
+ PrintField(buf, 12, 4, GCONTEXT, "gc");
+ if (Verbose > 2)
+ PrintValueRec(ILong(&buf[12]),
+ GC_function | GC_plane_mask | GC_graphics_exposures,
+ GC_BITMASK);
+ PrintField(buf, 16, 2, INT16, "src-x");
+ PrintField(buf, 18, 2, INT16, "src-y");
+ PrintField(buf, 20, 2, INT16, "dst-x");
+ PrintField(buf, 22, 2, INT16, "dst-y");
+ PrintField(buf, 24, 2, CARD16, "width");
+ PrintField(buf, 26, 2, CARD16, "height");
+}
+
+void
+CopyPlane(FD fd, const unsigned char *buf)
+{
+ /* Request CopyPlane is opcode 63 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* CopyPlane */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(8));
+ PrintField(buf, 4, 4, DRAWABLE, "src-drawable");
+ PrintField(buf, 8, 4, DRAWABLE, "dst-drawable");
+ PrintField(buf, 12, 4, GCONTEXT, "gc");
+ if (Verbose > 2)
+ PrintValueRec(ILong(&buf[12]),
+ GC_function |
+ GC_plane_mask |
+ GC_foreground |
+ GC_background |
+ GC_graphics_exposures,
+ GC_BITMASK);
+ PrintField(buf, 16, 2, INT16, "src-x");
+ PrintField(buf, 18, 2, INT16, "src-y");
+ PrintField(buf, 20, 2, INT16, "dst-x");
+ PrintField(buf, 22, 2, INT16, "dst-y");
+ PrintField(buf, 24, 2, CARD16, "width");
+ PrintField(buf, 26, 2, CARD16, "height");
+ PrintField(buf, 28, 4, CARD32, "bit-plane");
+}
+
+void
+PolyPoint(FD fd, const unsigned char *buf)
+{
+ short n;
+
+ /* Request PolyPoint is opcode 64 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* PolyPoint */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ PrintField(buf, 1, 1, COORMODE, "coordinate-mode");
+ printreqlen(buf, fd, DVALUE2(3 + n));
+ n = (IShort(&buf[2]) - 3);
+ PrintField(buf, 4, 4, DRAWABLE, "drawable");
+ PrintField(buf, 8, 4, GCONTEXT, "gc");
+ if (Verbose > 2)
+ PrintValueRec(ILong(&buf[8]),
+ GC_function | GC_plane_mask | GC_foreground, GC_BITMASK);
+ (void) PrintList(&buf[12], (long) n, POINT, "points");
+}
+
+void
+PolyLine(FD fd, const unsigned char *buf)
+{
+ short n;
+
+ /* Request PolyLine is opcode 65 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* PolyLine */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ PrintField(buf, 1, 1, COORMODE, "coordinate-mode");
+ printreqlen(buf, fd, DVALUE2(3 + n));
+ n = (IShort(&buf[2]) - 3);
+ PrintField(buf, 4, 4, DRAWABLE, "drawable");
+ PrintField(buf, 8, 4, GCONTEXT, "gc");
+ if (Verbose > 2)
+ PrintValueRec(ILong(&buf[8]),
+ GC_function |
+ GC_plane_mask |
+ GC_line_width |
+ GC_line_style |
+ GC_cap_style |
+ GC_join_style |
+ GC_fill_style |
+ GC_foreground |
+ GC_background |
+ GC_tile |
+ GC_stipple,
+ GC_BITMASK);
+ (void) PrintList(&buf[12], (long) n, POINT, "points");
+}
+
+void
+PolySegment(FD fd, const unsigned char *buf)
+{
+ short n;
+
+ /* Request PolySegment is opcode 66 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* PolySegment */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, DVALUE2(3 + 2 * n));
+ n = (IShort(&buf[2]) - 3) / 2;
+ PrintField(buf, 4, 4, DRAWABLE, "drawable");
+ PrintField(buf, 8, 4, GCONTEXT, "gc");
+ if (Verbose > 2)
+ PrintValueRec(ILong(&buf[8]),
+ GC_function |
+ GC_plane_mask |
+ GC_line_width |
+ GC_line_style |
+ GC_cap_style |
+ GC_fill_style |
+ GC_foreground |
+ GC_background |
+ GC_tile |
+ GC_stipple,
+ GC_BITMASK);
+ (void) PrintList(&buf[12], (long) n, SEGMENT, "segments");
+}
+
+void
+PolyRectangle(FD fd, const unsigned char *buf)
+{
+ short n;
+
+ /* Request PolyRectangle is opcode 67 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* PolyRectangle */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, DVALUE2(3 + 2 * n));
+ n = (IShort(&buf[2]) - 3) / 2;
+ PrintField(buf, 4, 4, DRAWABLE, "drawable");
+ PrintField(buf, 8, 4, GCONTEXT, "gc");
+ if (Verbose > 2)
+ PrintValueRec(ILong(&buf[8]),
+ GC_function |
+ GC_plane_mask |
+ GC_line_width |
+ GC_line_style |
+ GC_cap_style |
+ GC_join_style |
+ GC_fill_style |
+ GC_foreground |
+ GC_background |
+ GC_tile |
+ GC_stipple,
+ GC_BITMASK);
+ (void) PrintList(&buf[12], (long) n, RECTANGLE, "rectangles");
+}
+
+void
+PolyArc(FD fd, const unsigned char *buf)
+{
+ short n;
+
+ /* Request PolyArc is opcode 68 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* PolyArc */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, DVALUE2(3 + 3 * n));
+ n = (IShort(&buf[2]) - 3) / 3;
+ PrintField(buf, 4, 4, DRAWABLE, "drawable");
+ PrintField(buf, 8, 4, GCONTEXT, "gc");
+ if (Verbose > 2)
+ PrintValueRec(ILong(&buf[8]),
+ GC_function |
+ GC_plane_mask |
+ GC_line_width |
+ GC_line_style |
+ GC_cap_style |
+ GC_join_style |
+ GC_fill_style |
+ GC_foreground |
+ GC_background |
+ GC_tile |
+ GC_stipple,
+ GC_BITMASK);
+ (void) PrintList(&buf[12], (long) n, ARC, "arcs");
+}
+
+void
+FillPoly(FD fd, const unsigned char *buf)
+{
+ short n;
+
+ /* Request FillPoly is opcode 69 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* FillPoly */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, DVALUE2(4 + n));
+ n = (IShort(&buf[2]) - 4);
+ PrintField(buf, 4, 4, DRAWABLE, "drawable");
+ PrintField(buf, 8, 4, GCONTEXT, "gc");
+ if (Verbose > 2)
+ PrintValueRec(ILong(buf + 8),
+ GC_function |
+ GC_plane_mask |
+ GC_fill_style |
+ GC_fill_rule |
+ GC_foreground |
+ GC_background |
+ GC_tile |
+ GC_stipple,
+ GC_BITMASK);
+ PrintField(buf, 12, 1, POLYSHAPE, "shape");
+ PrintField(buf, 13, 1, COORMODE, "coordinate-mode");
+ PrintList(&buf[16], (long) n, POINT, "points");
+}
+
+void
+PolyFillRectangle(FD fd, const unsigned char *buf)
+{
+ short n;
+
+ /* Request PolyFillRectangle is opcode 70 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* PolyFillRectangle */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, DVALUE2(3 + 2 * n));
+ n = (IShort(&buf[2]) - 3) / 2;
+ PrintField(buf, 4, 4, DRAWABLE, "drawable");
+ PrintField(buf, 8, 4, GCONTEXT, "gc");
+ if (Verbose > 2)
+ PrintValueRec(ILong(buf + 8),
+ GC_function |
+ GC_plane_mask |
+ GC_fill_style |
+ GC_foreground |
+ GC_background |
+ GC_tile |
+ GC_stipple,
+ GC_BITMASK);
+ (void) PrintList(&buf[12], (long) n, RECTANGLE, "rectangles");
+}
+
+void
+PolyFillArc(FD fd, const unsigned char *buf)
+{
+ short n;
+
+ /* Request PolyFillArc is opcode 71 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* PolyFillArc */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, DVALUE2(3 + 3 * n));
+ n = (IShort(&buf[2]) - 3) / 3;
+ PrintField(buf, 4, 4, DRAWABLE, "drawable");
+ PrintField(buf, 8, 4, GCONTEXT, "gc");
+ if (Verbose > 2)
+ PrintValueRec(ILong(&buf[8]),
+ GC_function |
+ GC_plane_mask |
+ GC_arc_mode |
+ GC_fill_style |
+ GC_foreground |
+ GC_background |
+ GC_tile |
+ GC_stipple,
+ GC_BITMASK);
+ (void) PrintList(&buf[12], (long) n, ARC, "arcs");
+}
+
+void
+PutImage(FD fd, const unsigned char *buf)
+{
+ int n;
+
+ /* Request PutImage is opcode 72 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* PutImage */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ PrintField(buf, 1, 1, IMAGEMODE, "format");
+ printreqlen(buf, fd, DVALUE2(6 + (n + p) / 4));
+
+ /* the size of the Image is overestimated by the following computation of n,
+ because we ignore that padding of the request to a multiple of 4 bytes.
+ The image may not be a multiple of 4 bytes. The actual size of the image
+ is determined as follows: for format = Bitmap or format = XYPixmap, the
+ size is (left-pad + width) [ pad to multiple of bitmap-scanline-pad from
+ SetUpReply ] divide by 8 to get bytes times height times depth for format
+ = ZPixmap, take the depth and use it to find the bits-per-pixel and
+ scanline-pad given in one of the SetUpReply DEPTH records. width *
+ bits-per-pixel pad to multiple of scanline-pad divide by 8 to get bytes
+ times height times depth For simplicity, we ignore all this and just use
+ the request length to (over)estimate the size of the image */
+
+ n = (IShort(&buf[2]) - 6) * 4;
+ PrintField(buf, 4, 4, DRAWABLE, "drawable");
+ PrintField(buf, 8, 4, GCONTEXT, "gc");
+ if (Verbose > 2)
+ PrintValueRec(ILong(&buf[8]),
+ GC_function |
+ GC_plane_mask |
+ GC_foreground |
+ GC_background,
+ GC_BITMASK);
+ PrintField(buf, 12, 2, CARD16, "width");
+ PrintField(buf, 14, 2, CARD16, "height");
+ PrintField(buf, 16, 2, INT16, "dst-x");
+ PrintField(buf, 18, 2, INT16, "dst-y");
+ PrintField(buf, 20, 1, CARD8, "left-pad");
+ PrintField(buf, 21, 1, CARD8, "depth");
+
+ if (Verbose > 3)
+ PrintBytes(&buf[24], (long) n, "data");
+}
+
+void
+GetImage(FD fd, const unsigned char *buf)
+{
+ /* Request GetImage is opcode 73 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* GetImage */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ PrintField(buf, 1, 1, IMAGEMODE, "format");
+ printreqlen(buf, fd, CONST2(5));
+ PrintField(buf, 4, 4, DRAWABLE, "drawable");
+ PrintField(buf, 8, 2, INT16, "x");
+ PrintField(buf, 10, 2, INT16, "y");
+ PrintField(buf, 12, 2, CARD16, "width");
+ PrintField(buf, 14, 2, CARD16, "height");
+ PrintField(buf, 16, 4, CARD32, "plane-mask");
+}
+
+void
+GetImageReply(const unsigned char *buf)
+{
+ long n;
+
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* GetImage */
+ if (Verbose < 1)
+ return;
+ PrintField(buf, 1, 1, CARD8, "depth");
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4((n + p) / 4), "reply length");
+
+ /* to properly compute the actual size of the image, we have to remember the
+ width and height values from the request. Again, we (over)estimate its
+ length from the length of the reply */
+ n = ILong(&buf[4]) * 4;
+ PrintField(buf, 8, 4, VISUALID, "visual");
+ if (Verbose > 3)
+ PrintBytes(&buf[32], n, "data");
+}
+
+void
+PolyText8(FD fd, const unsigned char *buf)
+{
+ int n;
+
+ /* Request PolyText8 is opcode 74 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* PolyText8 */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, DVALUE2(4 + (n + p) / 4));
+ n = (IShort(&buf[2]) - 4) * 4;
+ PrintField(buf, 4, 4, DRAWABLE, "drawable");
+ PrintField(buf, 8, 4, GCONTEXT, "gc");
+ if (Verbose > 2)
+ PrintValueRec(ILong(&buf[8]),
+ GC_function |
+ GC_plane_mask |
+ GC_fill_style |
+ GC_font |
+ GC_foreground |
+ GC_background |
+ GC_tile |
+ GC_stipple,
+ GC_BITMASK);
+ PrintField(buf, 12, 2, INT16, "x");
+ PrintField(buf, 14, 2, INT16, "y");
+ PrintTextList8(&buf[16], n, "items");
+}
+
+void
+PolyText16(FD fd, const unsigned char *buf)
+{
+ int n;
+
+ /* Request PolyText16 is opcode 75 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* PolyText16 */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, DVALUE2(4 + (n + p) / 4));
+ n = (IShort(&buf[2]) - 4) * 4;
+ PrintField(buf, 4, 4, DRAWABLE, "drawable");
+ PrintField(buf, 8, 4, GCONTEXT, "gc");
+ if (Verbose > 2)
+ PrintValueRec(ILong(&buf[8]),
+ GC_function |
+ GC_plane_mask |
+ GC_fill_style |
+ GC_font |
+ GC_foreground |
+ GC_background |
+ GC_tile |
+ GC_stipple,
+ GC_BITMASK);
+ PrintField(buf, 12, 2, INT16, "x");
+ PrintField(buf, 14, 2, INT16, "y");
+ PrintTextList16(&buf[16], n, "items");
+}
+
+void
+ImageText8(FD fd, const unsigned char *buf)
+{
+ short n;
+
+ /* Request ImageText8 is opcode 76 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* ImageText8 */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printfield(buf, 1, 1, DVALUE1(n), "length of string");
+ n = IByte(&buf[1]);
+ printreqlen(buf, fd, DVALUE2(4 + (n + p) / 4));
+ PrintField(buf, 4, 4, DRAWABLE, "drawable");
+ PrintField(buf, 8, 4, GCONTEXT, "gc");
+ if (Verbose > 2)
+ PrintValueRec(ILong(&buf[8]),
+ GC_plane_mask |
+ GC_font |
+ GC_foreground |
+ GC_background,
+ GC_BITMASK);
+ PrintField(buf, 12, 2, INT16, "x");
+ PrintField(buf, 14, 2, INT16, "y");
+ PrintTString8(&buf[16], (long) n, "string");
+}
+
+void
+ImageText16(FD fd, const unsigned char *buf)
{
- /* Request CopyGC is opcode 57 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* CopyGC */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ short n;
- printreqlen(buf, fd, CONST2(4));
- PrintField(buf, 4, 4, GCONTEXT, "src-gc");
- PrintField(buf, 8, 4, GCONTEXT, "dst-gc");
- PrintField(buf, 12, 4, GC_BITMASK, "value-mask");
+ /* Request ImageText16 is opcode 77 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* ImageText16 */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printfield(buf, 1, 1, DVALUE1(n), "length of string");
+ n = IByte(&buf[1]);
+ printreqlen(buf, fd, DVALUE2(4 + (2 * n + p) / 4));
+ PrintField(buf, 4, 4, DRAWABLE, "drawable");
+ PrintField(buf, 8, 4, GCONTEXT, "gc");
+ if (Verbose > 2)
+ PrintValueRec(ILong(&buf[8]),
+ GC_plane_mask |
+ GC_font |
+ GC_foreground |
+ GC_background,
+ GC_BITMASK);
+ PrintField(buf, 12, 2, INT16, "x");
+ PrintField(buf, 14, 2, INT16, "y");
+ PrintTString16(&buf[16], (long) n, "string");
}
void
-SetDashes (
- FD fd,
- const unsigned char *buf)
-{
- short n;
- /* Request SetDashes is opcode 58 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* SetDashes */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, DVALUE2(3 + (n + p) / 4));
- PrintField(buf, 4, 4, GCONTEXT, "gc");
- PrintField(buf, 8, 2, CARD16, "dash-offset");
- printfield(buf, 10, 2, DVALUE2(n), "length of dashes");
- n = IShort(&buf[10]);
- PrintBytes(&buf[12], (long)n, "dashes");
-}
-
-void
-SetClipRectangles (
- FD fd,
- const unsigned char *buf)
-{
- short n;
-
- /* Request SetClipRectangles is opcode 59 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* SetClipRectangles */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- PrintField(buf, 1, 1, RECTORDER, "ordering");
- printreqlen(buf, fd, DVALUE2(3 + 2*n));
- n = (IShort(&buf[2]) - 3) / 2;
- PrintField(buf, 4, 4, GCONTEXT, "gc");
- PrintField(buf, 8, 2, INT16, "clip-x-origin");
- PrintField(buf, 10, 2, INT16, "clip-y-origin");
- PrintList(&buf[12], (long)n, RECTANGLE, "rectangles");
-}
-
-void
-FreeGC (
- FD fd,
- const unsigned char *buf)
-{
- DeleteValueRec (ILong (&buf[4]));
-
- /* Request FreeGC is opcode 60 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* FreeGC */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, GCONTEXT, "gc");
-}
-
-void
-ClearArea (
- FD fd,
- const unsigned char *buf)
-{
- /* Request ClearArea is opcode 61 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* ClearArea */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- PrintField(buf, 1, 1, BOOL, "exposures");
- printreqlen(buf, fd, CONST2(4));
- PrintField(buf, 4, 4, WINDOW, "window");
- PrintField(buf, 8, 2, INT16, "x");
- PrintField(buf, 10, 2, INT16, "y");
- PrintField(buf, 12, 2, CARD16, "width");
- PrintField(buf, 14, 2, CARD16, "height");
-}
-
-void
-CopyArea (
- FD fd,
- const unsigned char *buf)
-{
- /* Request CopyArea is opcode 62 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* CopyArea */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, CONST2(7));
- PrintField(buf, 4, 4, DRAWABLE, "src-drawable");
- PrintField(buf, 8, 4, DRAWABLE, "dst-drawable");
- PrintField(buf, 12, 4, GCONTEXT, "gc");
- if (Verbose > 2)
- PrintValueRec (ILong (&buf[12]),
- GC_function|
- GC_plane_mask|
- GC_graphics_exposures,
- GC_BITMASK);
- PrintField(buf, 16, 2, INT16, "src-x");
- PrintField(buf, 18, 2, INT16, "src-y");
- PrintField(buf, 20, 2, INT16, "dst-x");
- PrintField(buf, 22, 2, INT16, "dst-y");
- PrintField(buf, 24, 2, CARD16, "width");
- PrintField(buf, 26, 2, CARD16, "height");
-}
-
-void
-CopyPlane (
- FD fd,
- const unsigned char *buf)
-{
- /* Request CopyPlane is opcode 63 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* CopyPlane */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, CONST2(8));
- PrintField(buf, 4, 4, DRAWABLE, "src-drawable");
- PrintField(buf, 8, 4, DRAWABLE, "dst-drawable");
- PrintField(buf, 12, 4, GCONTEXT, "gc");
- if (Verbose > 2)
- PrintValueRec (ILong (&buf[12]),
- GC_function|
- GC_plane_mask|
- GC_foreground|
- GC_background|
- GC_graphics_exposures,
- GC_BITMASK);
- PrintField(buf, 16, 2, INT16, "src-x");
- PrintField(buf, 18, 2, INT16, "src-y");
- PrintField(buf, 20, 2, INT16, "dst-x");
- PrintField(buf, 22, 2, INT16, "dst-y");
- PrintField(buf, 24, 2, CARD16, "width");
- PrintField(buf, 26, 2, CARD16, "height");
- PrintField(buf, 28, 4, CARD32, "bit-plane");
-}
-
-void
-PolyPoint (
- FD fd,
- const unsigned char *buf)
-{
- short n;
- /* Request PolyPoint is opcode 64 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* PolyPoint */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- PrintField(buf, 1, 1, COORMODE, "coordinate-mode");
- printreqlen(buf, fd, DVALUE2(3 + n));
- n = (IShort(&buf[2]) - 3);
- PrintField(buf, 4, 4, DRAWABLE, "drawable");
- PrintField(buf, 8, 4, GCONTEXT, "gc");
- if (Verbose > 2)
- PrintValueRec (ILong (&buf[8]),
- GC_function|
- GC_plane_mask|
- GC_foreground,
- GC_BITMASK);
- (void)PrintList(&buf[12], (long)n, POINT, "points");
-}
-
-void
-PolyLine (
- FD fd,
- const unsigned char *buf)
-{
- short n;
- /* Request PolyLine is opcode 65 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* PolyLine */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- PrintField(buf, 1, 1, COORMODE, "coordinate-mode");
- printreqlen(buf, fd, DVALUE2(3 + n));
- n = (IShort(&buf[2]) - 3);
- PrintField(buf, 4, 4, DRAWABLE, "drawable");
- PrintField(buf, 8, 4, GCONTEXT, "gc");
- if (Verbose > 2)
- PrintValueRec (ILong (&buf[8]),
- GC_function|
- GC_plane_mask|
- GC_line_width|
- GC_line_style|
- GC_cap_style|
- GC_join_style|
- GC_fill_style|
- GC_foreground|
- GC_background|
- GC_tile|
- GC_stipple,
- GC_BITMASK);
- (void)PrintList(&buf[12], (long)n, POINT, "points");
-}
-
-void
-PolySegment (
- FD fd,
- const unsigned char *buf)
-{
- short n;
- /* Request PolySegment is opcode 66 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* PolySegment */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, DVALUE2(3 + 2*n));
- n = (IShort(&buf[2]) - 3) / 2;
- PrintField(buf, 4, 4, DRAWABLE, "drawable");
- PrintField(buf, 8, 4, GCONTEXT, "gc");
- if (Verbose > 2)
- PrintValueRec (ILong (&buf[8]),
- GC_function|
- GC_plane_mask|
- GC_line_width|
- GC_line_style|
- GC_cap_style|
- GC_fill_style|
- GC_foreground|
- GC_background|
- GC_tile|
- GC_stipple,
- GC_BITMASK);
- (void)PrintList(&buf[12], (long)n, SEGMENT, "segments");
-}
-
-void
-PolyRectangle (
- FD fd,
- const unsigned char *buf)
-{
- short n;
- /* Request PolyRectangle is opcode 67 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* PolyRectangle */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, DVALUE2(3 + 2*n));
- n = (IShort(&buf[2]) - 3) / 2;
- PrintField(buf, 4, 4, DRAWABLE, "drawable");
- PrintField(buf, 8, 4, GCONTEXT, "gc");
- if (Verbose > 2)
- PrintValueRec (ILong (&buf[8]),
- GC_function|
- GC_plane_mask|
- GC_line_width|
- GC_line_style|
- GC_cap_style|
- GC_join_style|
- GC_fill_style|
- GC_foreground|
- GC_background|
- GC_tile|
- GC_stipple,
- GC_BITMASK);
- (void)PrintList(&buf[12], (long)n, RECTANGLE, "rectangles");
-}
-
-void
-PolyArc (
- FD fd,
- const unsigned char *buf)
-{
- short n;
- /* Request PolyArc is opcode 68 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* PolyArc */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, DVALUE2(3 + 3*n));
- n = (IShort(&buf[2]) - 3) / 3;
- PrintField(buf, 4, 4, DRAWABLE, "drawable");
- PrintField(buf, 8, 4, GCONTEXT, "gc");
- if (Verbose > 2)
- PrintValueRec (ILong (&buf[8]),
- GC_function|
- GC_plane_mask|
- GC_line_width|
- GC_line_style|
- GC_cap_style|
- GC_join_style|
- GC_fill_style|
- GC_foreground|
- GC_background|
- GC_tile|
- GC_stipple,
- GC_BITMASK);
- (void)PrintList(&buf[12], (long)n, ARC, "arcs");
-}
-
-void
-FillPoly (
- FD fd,
- const unsigned char *buf)
-{
- short n;
- /* Request FillPoly is opcode 69 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* FillPoly */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, DVALUE2(4 + n));
- n = (IShort(&buf[2]) - 4);
- PrintField(buf, 4, 4, DRAWABLE, "drawable");
- PrintField(buf, 8, 4, GCONTEXT, "gc");
- if (Verbose > 2)
- PrintValueRec (ILong(buf+8),
- GC_function|
- GC_plane_mask|
- GC_fill_style|
- GC_fill_rule|
- GC_foreground|
- GC_background|
- GC_tile|
- GC_stipple,
- GC_BITMASK);
- PrintField(buf, 12, 1, POLYSHAPE, "shape");
- PrintField(buf, 13, 1, COORMODE, "coordinate-mode");
- PrintList(&buf[16], (long)n, POINT, "points");
-}
-
-void
-PolyFillRectangle (
- FD fd,
- const unsigned char *buf)
-{
- short n;
- /* Request PolyFillRectangle is opcode 70 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* PolyFillRectangle */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, DVALUE2(3 + 2*n));
- n = (IShort(&buf[2]) - 3) / 2;
- PrintField(buf, 4, 4, DRAWABLE, "drawable");
- PrintField(buf, 8, 4, GCONTEXT, "gc");
- if (Verbose > 2)
- PrintValueRec (ILong(buf+8),
- GC_function|
- GC_plane_mask|
- GC_fill_style|
- GC_foreground|
- GC_background|
- GC_tile|
- GC_stipple,
- GC_BITMASK);
- (void)PrintList(&buf[12], (long)n, RECTANGLE, "rectangles");
-}
-
-void
-PolyFillArc (
- FD fd,
- const unsigned char *buf)
-{
- short n;
- /* Request PolyFillArc is opcode 71 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* PolyFillArc */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, DVALUE2(3 + 3*n));
- n = (IShort(&buf[2]) - 3) / 3;
- PrintField(buf, 4, 4, DRAWABLE, "drawable");
- PrintField(buf, 8, 4, GCONTEXT, "gc");
- if (Verbose > 2)
- PrintValueRec (ILong (&buf[8]),
- GC_function|
- GC_plane_mask|
- GC_arc_mode|
- GC_fill_style|
- GC_foreground|
- GC_background|
- GC_tile|
- GC_stipple,
- GC_BITMASK);
- (void)PrintList(&buf[12], (long)n, ARC, "arcs");
-}
-
-void
-PutImage (
- FD fd,
- const unsigned char *buf)
-{
- int n;
- /* Request PutImage is opcode 72 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* PutImage */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- PrintField(buf, 1, 1, IMAGEMODE, "format");
- printreqlen(buf, fd, DVALUE2(6 + (n + p) / 4));
-
- /* the size of the Image is overestimated by the following computation of n,
- because we ignore that padding of the request to a multiple of 4 bytes.
- The image may not be a multiple of 4 bytes. The actual size of the image
- is determined as follows: for format = Bitmap or format = XYPixmap, the
- size is (left-pad + width) [ pad to multiple of bitmap-scanline-pad from
- SetUpReply ] divide by 8 to get bytes times height times depth for format
- = ZPixmap, take the depth and use it to find the bits-per-pixel and
- scanline-pad given in one of the SetUpReply DEPTH records. width *
- bits-per-pixel pad to multiple of scanline-pad divide by 8 to get bytes
- times height times depth For simplicity, we ignore all this and just use
- the request length to (over)estimate the size of the image */
-
- n = (IShort(&buf[2]) - 6) * 4;
- PrintField(buf, 4, 4, DRAWABLE, "drawable");
- PrintField(buf, 8, 4, GCONTEXT, "gc");
- if (Verbose > 2)
- PrintValueRec (ILong (&buf[8]),
- GC_function|
- GC_plane_mask|
- GC_foreground|
- GC_background,
- GC_BITMASK);
- PrintField(buf, 12, 2, CARD16, "width");
- PrintField(buf, 14, 2, CARD16, "height");
- PrintField(buf, 16, 2, INT16, "dst-x");
- PrintField(buf, 18, 2, INT16, "dst-y");
- PrintField(buf, 20, 1, CARD8, "left-pad");
- PrintField(buf, 21, 1, CARD8, "depth");
- if (Verbose > 3)
- PrintBytes(&buf[24], (long)n, "data");
-}
-
-void
-GetImage (
- FD fd,
- const unsigned char *buf)
-{
- /* Request GetImage is opcode 73 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* GetImage */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- PrintField(buf, 1, 1, IMAGEMODE, "format");
- printreqlen(buf, fd, CONST2(5));
- PrintField(buf, 4, 4, DRAWABLE, "drawable");
- PrintField(buf, 8, 2, INT16, "x");
- PrintField(buf, 10, 2, INT16, "y");
- PrintField(buf, 12, 2, CARD16, "width");
- PrintField(buf, 14, 2, CARD16, "height");
- PrintField(buf, 16, 4, CARD32, "plane-mask");
-}
-
-void
-GetImageReply (
- const unsigned char *buf)
-{
- long n;
-
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* GetImage */ ;
- if (Verbose < 1)
- return;
- PrintField(buf, 1, 1, CARD8, "depth");
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4((n + p) / 4), "reply length");
-
- /* to properly compute the actual size of the image, we have to remember the
- width and height values from the request. Again, we (over)estimate its
- length from the length of the reply */
- n = ILong(&buf[4]) * 4;
- PrintField(buf, 8, 4, VISUALID, "visual");
- if (Verbose > 3)
- PrintBytes(&buf[32], n, "data");
-}
-
-void
-PolyText8 (
- FD fd,
- const unsigned char *buf)
-{
- int n;
-
- /* Request PolyText8 is opcode 74 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* PolyText8 */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, DVALUE2(4 + (n + p) / 4));
- n = (IShort(&buf[2]) - 4) * 4;
- PrintField(buf, 4, 4, DRAWABLE, "drawable");
- PrintField(buf, 8, 4, GCONTEXT, "gc");
- if (Verbose > 2)
- PrintValueRec (ILong (&buf[8]),
- GC_function|
- GC_plane_mask|
- GC_fill_style|
- GC_font|
- GC_foreground|
- GC_background|
- GC_tile|
- GC_stipple,
- GC_BITMASK);
- PrintField(buf, 12, 2, INT16, "x");
- PrintField(buf, 14, 2, INT16, "y");
- PrintTextList8(&buf[16], n, "items");
-}
-
-void
-PolyText16 (
- FD fd,
- const unsigned char *buf)
-{
- int n;
-
- /* Request PolyText16 is opcode 75 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* PolyText16 */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, DVALUE2(4 + (n + p) / 4));
- n = (IShort(&buf[2]) - 4) * 4;
- PrintField(buf, 4, 4, DRAWABLE, "drawable");
- PrintField(buf, 8, 4, GCONTEXT, "gc");
- if (Verbose > 2)
- PrintValueRec (ILong (&buf[8]),
- GC_function|
- GC_plane_mask|
- GC_fill_style|
- GC_font|
- GC_foreground|
- GC_background|
- GC_tile|
- GC_stipple,
- GC_BITMASK);
- PrintField(buf, 12, 2, INT16, "x");
- PrintField(buf, 14, 2, INT16, "y");
- PrintTextList16(&buf[16], n, "items");
-}
-
-void
-ImageText8 (
- FD fd,
- const unsigned char *buf)
-{
- short n;
- /* Request ImageText8 is opcode 76 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* ImageText8 */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printfield(buf, 1, 1, DVALUE1(n), "length of string");
- n = IByte(&buf[1]);
- printreqlen(buf, fd, DVALUE2(4 + (n + p) / 4));
- PrintField(buf, 4, 4, DRAWABLE, "drawable");
- PrintField(buf, 8, 4, GCONTEXT, "gc");
- if (Verbose > 2)
- PrintValueRec (ILong (&buf[8]),
- GC_plane_mask|
- GC_font|
- GC_foreground|
- GC_background,
- GC_BITMASK);
- PrintField(buf, 12, 2, INT16, "x");
- PrintField(buf, 14, 2, INT16, "y");
- PrintTString8(&buf[16], (long)n, "string");
-}
-
-void
-ImageText16 (
- FD fd,
- const unsigned char *buf)
-{
- short n;
- /* Request ImageText16 is opcode 77 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* ImageText16 */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printfield(buf, 1, 1, DVALUE1(n), "length of string");
- n = IByte(&buf[1]);
- printreqlen(buf, fd, DVALUE2(4 + (2*n + p) / 4));
- PrintField(buf, 4, 4, DRAWABLE, "drawable");
- PrintField(buf, 8, 4, GCONTEXT, "gc");
- if (Verbose > 2)
- PrintValueRec (ILong (&buf[8]),
- GC_plane_mask|
- GC_font|
- GC_foreground|
- GC_background,
- GC_BITMASK);
- PrintField(buf, 12, 2, INT16, "x");
- PrintField(buf, 14, 2, INT16, "y");
- PrintTString16(&buf[16], (long)n, "string");
-}
-
-void
-CreateColormap (
- FD fd,
- const unsigned char *buf)
+CreateColormap(FD fd, const unsigned char *buf)
{
- /* Request CreateColormap is opcode 78 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* CreateColormap */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- PrintField(buf, 1, 1, ALLORNONE, "alloc");
- printreqlen(buf, fd, CONST2(4));
- PrintField(buf, 4, 4, COLORMAP, "color-map-id");
- PrintField(buf, 8, 4, WINDOW, "window");
- PrintField(buf, 12, 4, VISUALID, "visual");
-}
-
-void
-FreeColormap (
- FD fd,
- const unsigned char *buf)
-{
- /* Request FreeColormap is opcode 79 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* FreeColormap */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, COLORMAP, "cmap");
+ /* Request CreateColormap is opcode 78 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* CreateColormap */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ PrintField(buf, 1, 1, ALLORNONE, "alloc");
+ printreqlen(buf, fd, CONST2(4));
+ PrintField(buf, 4, 4, COLORMAP, "color-map-id");
+ PrintField(buf, 8, 4, WINDOW, "window");
+ PrintField(buf, 12, 4, VISUALID, "visual");
}
void
-CopyColormapAndFree (
- FD fd,
- const unsigned char *buf)
+FreeColormap(FD fd, const unsigned char *buf)
{
- /* Request CopyColormapAndFree is opcode 80 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* CopyColormapAndFree */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, CONST2(3));
- PrintField(buf, 4, 4, COLORMAP, "color-map-id");
- PrintField(buf, 8, 4, COLORMAP, "src-cmap");
+ /* Request FreeColormap is opcode 79 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* FreeColormap */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, COLORMAP, "cmap");
}
void
-InstallColormap (
- FD fd,
- const unsigned char *buf)
+CopyColormapAndFree(FD fd, const unsigned char *buf)
{
- /* Request InstallColormap is opcode 81 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* InstallColormap */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request CopyColormapAndFree is opcode 80 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* CopyColormapAndFree */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, COLORMAP, "cmap");
+ printreqlen(buf, fd, CONST2(3));
+ PrintField(buf, 4, 4, COLORMAP, "color-map-id");
+ PrintField(buf, 8, 4, COLORMAP, "src-cmap");
}
void
-UninstallColormap (
- FD fd,
- const unsigned char *buf)
+InstallColormap(FD fd, const unsigned char *buf)
{
- /* Request UninstallColormap is opcode 82 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* UninstallColormap */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request InstallColormap is opcode 81 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* InstallColormap */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, COLORMAP, "cmap");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, COLORMAP, "cmap");
}
void
-ListInstalledColormaps (
- FD fd,
- const unsigned char *buf)
+UninstallColormap(FD fd, const unsigned char *buf)
{
- /* Request ListInstalledColormaps is opcode 83 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* ListInstalledColormaps */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request UninstallColormap is opcode 82 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* UninstallColormap */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, COLORMAP, "cmap");
+}
+
+void
+ListInstalledColormaps(FD fd, const unsigned char *buf)
+{
+ /* Request ListInstalledColormaps is opcode 83 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* ListInstalledColormaps */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, WINDOW, "window");
+}
+
+void
+ListInstalledColormapsReply(const unsigned char *buf)
+{
+ short n;
+
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* ListInstalledColormaps */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(n), "reply length");
+ printfield(buf, 8, 2, DVALUE2(n), "number of cmaps");
+ n = IShort(&buf[8]);
+ PrintList(&buf[32], (long) n, COLORMAP, "cmaps");
+}
+
+void
+AllocColor(FD fd, const unsigned char *buf)
+{
+ /* Request AllocColor is opcode 84 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* AllocColor */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(4));
+ PrintField(buf, 4, 4, COLORMAP, "cmap");
+ PrintField(buf, 8, 2, CARD16, "red");
+ PrintField(buf, 10, 2, CARD16, "green");
+ PrintField(buf, 12, 2, CARD16, "blue");
+}
+
+void
+AllocColorReply(const unsigned char *buf)
+{
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* AllocColor */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, CONST4(0), "reply length");
+ PrintField(buf, 8, 2, CARD16, "red");
+ PrintField(buf, 10, 2, CARD16, "green");
+ PrintField(buf, 12, 2, CARD16, "blue");
+ PrintField(buf, 16, 4, CARD32, "pixel");
+}
+
+void
+AllocNamedColor(FD fd, const unsigned char *buf)
+{
+ short n;
+
+ /* Request AllocNamedColor is opcode 85 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* AllocNamedColor */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, WINDOW, "window");
+ printreqlen(buf, fd, DVALUE2(3 + (n + p) / 4));
+ PrintField(buf, 4, 4, COLORMAP, "cmap");
+ printfield(buf, 8, 2, DVALUE2(n), "length of name");
+ n = IShort(&buf[8]);
+ PrintString8(&buf[12], n, "name");
}
void
-ListInstalledColormapsReply (
- const unsigned char *buf)
+AllocNamedColorReply(const unsigned char *buf)
{
- short n;
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* ListInstalledColormaps */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4(n), "reply length");
- printfield(buf, 8, 2, DVALUE2(n), "number of cmaps");
- n = IShort(&buf[8]);
- PrintList(&buf[32], (long)n, COLORMAP, "cmaps");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* AllocNamedColor */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, CONST4(0), "reply length");
+ PrintField(buf, 8, 4, CARD32, "pixel");
+ PrintField(buf, 12, 2, CARD16, "exact-red");
+ PrintField(buf, 14, 2, CARD16, "exact-green");
+ PrintField(buf, 16, 2, CARD16, "exact-blue");
+ PrintField(buf, 18, 2, CARD16, "visual-red");
+ PrintField(buf, 20, 2, CARD16, "visual-green");
+ PrintField(buf, 22, 2, CARD16, "visual-blue");
}
void
-AllocColor (
- FD fd,
- const unsigned char *buf)
+AllocColorCells(FD fd, const unsigned char *buf)
{
- /* Request AllocColor is opcode 84 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* AllocColor */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request AllocColorCells is opcode 86 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* AllocColorCells */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(4));
- PrintField(buf, 4, 4, COLORMAP, "cmap");
- PrintField(buf, 8, 2, CARD16, "red");
- PrintField(buf, 10, 2, CARD16, "green");
- PrintField(buf, 12, 2, CARD16, "blue");
+ PrintField(buf, 1, 1, BOOL, "contiguous");
+ printreqlen(buf, fd, CONST2(3));
+ PrintField(buf, 4, 4, COLORMAP, "cmap");
+ PrintField(buf, 8, 2, CARD16, "colors");
+ PrintField(buf, 10, 2, CARD16, "planes");
}
void
-AllocColorReply (
- const unsigned char *buf)
+AllocColorCellsReply(const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* AllocColor */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, CONST4(0), "reply length");
- PrintField(buf, 8, 2, CARD16, "red");
- PrintField(buf, 10, 2, CARD16, "green");
- PrintField(buf, 12, 2, CARD16, "blue");
- PrintField(buf, 16, 4, CARD32, "pixel");
+ short n;
+ short m;
+ short k;
+
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* AllocColorCells */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(n + m), "reply length");
+ printfield(buf, 8, 2, DVALUE2(n), "number of pixels");
+ n = IShort(&buf[8]);
+ printfield(buf, 10, 2, DVALUE2(m), "number of masks");
+ m = IShort(&buf[10]);
+ k = PrintList(&buf[32], (long) n, CARD32, "pixels");
+ PrintList(&buf[32 + k], (long) m, CARD32, "masks");
}
void
-AllocNamedColor (
- FD fd,
- const unsigned char *buf)
+AllocColorPlanes(FD fd, const unsigned char *buf)
{
- short n;
- /* Request AllocNamedColor is opcode 85 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* AllocNamedColor */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request AllocColorPlanes is opcode 87 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* AllocColorPlanes */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, DVALUE2(3 + (n + p) / 4));
- PrintField(buf, 4, 4, COLORMAP, "cmap");
- printfield(buf, 8, 2, DVALUE2(n), "length of name");
- n = IShort(&buf[8]);
- PrintString8(&buf[12], n, "name");
+ PrintField(buf, 1, 1, BOOL, "contiguous");
+ printreqlen(buf, fd, CONST2(4));
+ PrintField(buf, 4, 4, COLORMAP, "cmap");
+ PrintField(buf, 8, 2, CARD16, "colors");
+ PrintField(buf, 10, 2, CARD16, "reds");
+ PrintField(buf, 12, 2, CARD16, "greens");
+ PrintField(buf, 14, 2, CARD16, "blues");
}
void
-AllocNamedColorReply (
- const unsigned char *buf)
+AllocColorPlanesReply(const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* AllocNamedColor */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, CONST4(0), "reply length");
- PrintField(buf, 8, 4, CARD32, "pixel");
- PrintField(buf, 12, 2, CARD16, "exact-red");
- PrintField(buf, 14, 2, CARD16, "exact-green");
- PrintField(buf, 16, 2, CARD16, "exact-blue");
- PrintField(buf, 18, 2, CARD16, "visual-red");
- PrintField(buf, 20, 2, CARD16, "visual-green");
- PrintField(buf, 22, 2, CARD16, "visual-blue");
+ short n;
+
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* AllocColorPlanes */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(n), "reply length");
+ printfield(buf, 8, 2, DVALUE2(n), "number of pixels");
+ n = IShort(&buf[8]);
+ PrintField(buf, 12, 4, CARD32, "red-mask");
+ PrintField(buf, 16, 4, CARD32, "green-mask");
+ PrintField(buf, 20, 4, CARD32, "blue-mask");
+ PrintList(&buf[32], (long) n, CARD32, "pixels");
}
void
-AllocColorCells (
- FD fd,
- const unsigned char *buf)
+FreeColors(FD fd, const unsigned char *buf)
{
- /* Request AllocColorCells is opcode 86 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* AllocColorCells */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ short n;
+
+ /* Request FreeColors is opcode 88 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* FreeColors */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- PrintField(buf, 1, 1, BOOL, "contiguous");
- printreqlen(buf, fd, CONST2(3));
- PrintField(buf, 4, 4, COLORMAP, "cmap");
- PrintField(buf, 8, 2, CARD16, "colors");
- PrintField(buf, 10, 2, CARD16, "planes");
-}
+ printreqlen(buf, fd, DVALUE2(3 + n));
+ n = IShort(&buf[2]) - 3;
+ PrintField(buf, 4, 4, COLORMAP, "cmap");
+ PrintField(buf, 8, 4, CARD32, "plane-mask");
+ PrintList(&buf[12], (long) n, CARD32, "pixels");
+}
void
-AllocColorCellsReply (
- const unsigned char *buf)
+StoreColors(FD fd, const unsigned char *buf)
{
- short n;
- short m;
- short k;
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* AllocColorCells */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4(n + m), "reply length");
- printfield(buf, 8, 2, DVALUE2(n), "number of pixels");
- n = IShort(&buf[8]);
- printfield(buf, 10, 2, DVALUE2(m), "number of masks");
- m = IShort(&buf[10]);
- k = PrintList(&buf[32], (long)n, CARD32, "pixels");
- PrintList(&buf[32 + k], (long)m, CARD32, "masks");
-}
-
+ short n;
+
+ /* Request StoreColors is opcode 89 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* StoreColors */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, DVALUE2(2 + 3 * n));
+ n = (IShort(&buf[2]) - 2) / 3;
+ PrintField(buf, 4, 4, COLORMAP, "cmap");
+ PrintList(&buf[8], (long) n, COLORITEM, "items");
+}
+
void
-AllocColorPlanes (
- FD fd,
- const unsigned char *buf)
+StoreNamedColor(FD fd, const unsigned char *buf)
{
- /* Request AllocColorPlanes is opcode 87 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* AllocColorPlanes */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- PrintField(buf, 1, 1, BOOL, "contiguous");
- printreqlen(buf, fd, CONST2(4));
- PrintField(buf, 4, 4, COLORMAP, "cmap");
- PrintField(buf, 8, 2, CARD16, "colors");
- PrintField(buf, 10, 2, CARD16, "reds");
- PrintField(buf, 12, 2, CARD16, "greens");
- PrintField(buf, 14, 2, CARD16, "blues");
+ short n;
+
+ /* Request StoreNamedColor is opcode 90 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* StoreNamedColor */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ PrintField(buf, 1, 1, COLORMASK, "which colors?");
+ printreqlen(buf, fd, DVALUE2(4 + (n + p) / 4));
+ PrintField(buf, 4, 4, COLORMAP, "cmap");
+ PrintField(buf, 8, 4, CARD32, "pixel");
+ printfield(buf, 12, 2, DVALUE2(n), "length of name");
+ n = IShort(&buf[12]);
+ PrintString8(&buf[16], n, "name");
}
void
-AllocColorPlanesReply (
- const unsigned char *buf)
-{
- short n;
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* AllocColorPlanes */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4(n), "reply length");
- printfield(buf, 8, 2, DVALUE2(n), "number of pixels");
- n = IShort(&buf[8]);
- PrintField(buf, 12, 4, CARD32, "red-mask");
- PrintField(buf, 16, 4, CARD32, "green-mask");
- PrintField(buf, 20, 4, CARD32, "blue-mask");
- PrintList(&buf[32], (long)n, CARD32, "pixels");
+QueryColors(FD fd, const unsigned char *buf)
+{
+ short n;
+
+ /* Request QueryColors is opcode 91 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* QueryColors */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, DVALUE2(2 + n));
+ n = IShort(&buf[2]) - 2;
+ PrintField(buf, 4, 4, COLORMAP, "cmap");
+ PrintList(&buf[8], (long) n, CARD32, "pixels");
}
void
-FreeColors (
- FD fd,
- const unsigned char *buf)
-{
- short n;
-
- /* Request FreeColors is opcode 88 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* FreeColors */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, DVALUE2(3 + n));
- n = IShort(&buf[2]) - 3;
- PrintField(buf, 4, 4, COLORMAP, "cmap");
- PrintField(buf, 8, 4, CARD32, "plane-mask");
- PrintList(&buf[12], (long)n, CARD32, "pixels");
+QueryColorsReply(const unsigned char *buf)
+{
+ short n;
+
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* QueryColors */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(2 * n), "reply length");
+ printfield(buf, 8, 2, DVALUE2(n), "number of colors");
+ n = IShort(&buf[8]);
+ PrintList(&buf[32], (long) n, RGB, "colors");
}
void
-StoreColors (
- FD fd,
- const unsigned char *buf)
-{
- short n;
- /* Request StoreColors is opcode 89 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* StoreColors */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+LookupColor(FD fd, const unsigned char *buf)
+{
+ short n;
+
+ /* Request LookupColor is opcode 92 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* LookupColor */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, DVALUE2(2 + 3*n));
- n = (IShort(&buf[2]) - 2) / 3;
- PrintField(buf, 4, 4, COLORMAP, "cmap");
- PrintList(&buf[8], (long)n, COLORITEM, "items");
+ printreqlen(buf, fd, DVALUE2(3 + (n + p) / 4));
+ PrintField(buf, 4, 4, COLORMAP, "cmap");
+ printfield(buf, 8, 2, DVALUE2(n), "length of name");
+ n = IShort(&buf[8]);
+ PrintString8(&buf[12], n, "name");
}
void
-StoreNamedColor (
- FD fd,
- const unsigned char *buf)
-{
- short n;
- /* Request StoreNamedColor is opcode 90 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* StoreNamedColor */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- PrintField(buf, 1, 1, COLORMASK, "which colors?");
- printreqlen(buf, fd, DVALUE2(4 + (n + p) / 4));
- PrintField(buf, 4, 4, COLORMAP, "cmap");
- PrintField(buf, 8, 4, CARD32, "pixel");
- printfield(buf, 12, 2, DVALUE2(n), "length of name");
- n = IShort(&buf[12]);
- PrintString8(&buf[16], n, "name");
+LookupColorReply(const unsigned char *buf)
+{
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* LookupColor */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, CONST4(0), "reply length");
+ PrintField(buf, 8, 2, CARD16, "exact-red");
+ PrintField(buf, 10, 2, CARD16, "exact-green");
+ PrintField(buf, 12, 2, CARD16, "exact-blue");
+ PrintField(buf, 14, 2, CARD16, "visual-red");
+ PrintField(buf, 16, 2, CARD16, "visual-green");
+ PrintField(buf, 18, 2, CARD16, "visual-blue");
}
-
-void
-QueryColors (
- FD fd,
- const unsigned char *buf)
-{
- short n;
- /* Request QueryColors is opcode 91 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* QueryColors */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, DVALUE2(2 + n));
- n = IShort(&buf[2]) - 2;
- PrintField(buf, 4, 4, COLORMAP, "cmap");
- PrintList(&buf[8], (long)n, CARD32, "pixels");
-}
-
-void
-QueryColorsReply (
- const unsigned char *buf)
-{
- short n;
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* QueryColors */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4(2*n), "reply length");
- printfield(buf, 8, 2, DVALUE2(n), "number of colors");
- n = IShort(&buf[8]);
- PrintList(&buf[32], (long)n, RGB, "colors");
-}
-
-void
-LookupColor (
- FD fd,
- const unsigned char *buf)
-{
- short n;
- /* Request LookupColor is opcode 92 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* LookupColor */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, DVALUE2(3 + (n + p) / 4));
- PrintField(buf, 4, 4, COLORMAP, "cmap");
- printfield(buf, 8, 2, DVALUE2(n), "length of name");
- n = IShort(&buf[8]);
- PrintString8(&buf[12], n, "name");
-}
-
-void
-LookupColorReply (
- const unsigned char *buf)
-{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* LookupColor */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, CONST4(0), "reply length");
- PrintField(buf, 8, 2, CARD16, "exact-red");
- PrintField(buf, 10, 2, CARD16, "exact-green");
- PrintField(buf, 12, 2, CARD16, "exact-blue");
- PrintField(buf, 14, 2, CARD16, "visual-red");
- PrintField(buf, 16, 2, CARD16, "visual-green");
- PrintField(buf, 18, 2, CARD16, "visual-blue");
-}
-
-void
-CreateCursor (
- FD fd,
- const unsigned char *buf)
-{
- /* Request CreateCursor is opcode 93 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* CreateCursor */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, CONST2(8));
- PrintField(buf, 4, 4, CURSOR, "cursor-id");
- PrintField(buf, 8, 4, PIXMAP, "source");
- PrintField(buf, 12, 4, PIXMAP, "mask");
- PrintField(buf, 16, 2, CARD16, "fore-red");
- PrintField(buf, 18, 2, CARD16, "fore-green");
- PrintField(buf, 20, 2, CARD16, "fore-blue");
- PrintField(buf, 22, 2, CARD16, "back-red");
- PrintField(buf, 24, 2, CARD16, "back-green");
- PrintField(buf, 26, 2, CARD16, "back-blue");
- PrintField(buf, 28, 2, CARD16, "x");
- PrintField(buf, 30, 2, CARD16, "y");
+
+void
+CreateCursor(FD fd, const unsigned char *buf)
+{
+ /* Request CreateCursor is opcode 93 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* CreateCursor */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(8));
+ PrintField(buf, 4, 4, CURSOR, "cursor-id");
+ PrintField(buf, 8, 4, PIXMAP, "source");
+ PrintField(buf, 12, 4, PIXMAP, "mask");
+ PrintField(buf, 16, 2, CARD16, "fore-red");
+ PrintField(buf, 18, 2, CARD16, "fore-green");
+ PrintField(buf, 20, 2, CARD16, "fore-blue");
+ PrintField(buf, 22, 2, CARD16, "back-red");
+ PrintField(buf, 24, 2, CARD16, "back-green");
+ PrintField(buf, 26, 2, CARD16, "back-blue");
+ PrintField(buf, 28, 2, CARD16, "x");
+ PrintField(buf, 30, 2, CARD16, "y");
}
void
-CreateGlyphCursor (
- FD fd,
- const unsigned char *buf)
-{
- /* Request CreateGlyphCursor is opcode 94 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* CreateGlyphCursor */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, CONST2(8));
- PrintField(buf, 4, 4, CURSOR, "cursor-id");
- PrintField(buf, 8, 4, FONT, "source-font");
- PrintField(buf, 12, 4, FONT, "mask-font");
- PrintField(buf, 16, 2, CARD16, "source-char");
- PrintField(buf, 18, 2, CARD16, "mask-char");
- PrintField(buf, 20, 2, CARD16, "fore-red");
- PrintField(buf, 22, 2, CARD16, "fore-green");
- PrintField(buf, 24, 2, CARD16, "fore-blue");
- PrintField(buf, 26, 2, CARD16, "back-red");
- PrintField(buf, 28, 2, CARD16, "back-green");
- PrintField(buf, 30, 2, CARD16, "back-blue");
-}
-
-void
-FreeCursor (
- FD fd,
- const unsigned char *buf)
+CreateGlyphCursor(FD fd, const unsigned char *buf)
{
- /* Request FreeCursor is opcode 95 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* FreeCursor */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, CURSOR, "cursor");
-}
-
-void
-RecolorCursor (
- FD fd,
- const unsigned char *buf)
+ /* Request CreateGlyphCursor is opcode 94 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* CreateGlyphCursor */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(8));
+ PrintField(buf, 4, 4, CURSOR, "cursor-id");
+ PrintField(buf, 8, 4, FONT, "source-font");
+ PrintField(buf, 12, 4, FONT, "mask-font");
+ PrintField(buf, 16, 2, CARD16, "source-char");
+ PrintField(buf, 18, 2, CARD16, "mask-char");
+ PrintField(buf, 20, 2, CARD16, "fore-red");
+ PrintField(buf, 22, 2, CARD16, "fore-green");
+ PrintField(buf, 24, 2, CARD16, "fore-blue");
+ PrintField(buf, 26, 2, CARD16, "back-red");
+ PrintField(buf, 28, 2, CARD16, "back-green");
+ PrintField(buf, 30, 2, CARD16, "back-blue");
+}
+
+void
+FreeCursor(FD fd, const unsigned char *buf)
{
- /* Request RecolorCursor is opcode 96 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* RecolorCursor */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request FreeCursor is opcode 95 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* FreeCursor */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(5));
- PrintField(buf, 4, 4, CURSOR, "cursor");
- PrintField(buf, 8, 2, CARD16, "fore-red");
- PrintField(buf, 10, 2, CARD16, "fore-green");
- PrintField(buf, 12, 2, CARD16, "fore-blue");
- PrintField(buf, 14, 2, CARD16, "back-red");
- PrintField(buf, 16, 2, CARD16, "back-green");
- PrintField(buf, 18, 2, CARD16, "back-blue");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, CURSOR, "cursor");
}
void
-QueryBestSize (
- FD fd,
- const unsigned char *buf)
+RecolorCursor(FD fd, const unsigned char *buf)
{
- /* Request QueryBestSize is opcode 97 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* QueryBestSize */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request RecolorCursor is opcode 96 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RecolorCursor */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- PrintField(buf, 1, 1, OBJECTCLASS, "class");
- printreqlen(buf, fd, CONST2(3));
- PrintField(buf, 4, 4, DRAWABLE, "drawable");
- PrintField(buf, 8, 2, CARD16, "width");
- PrintField(buf, 10, 2, CARD16, "height");
-}
+ printreqlen(buf, fd, CONST2(5));
+ PrintField(buf, 4, 4, CURSOR, "cursor");
+ PrintField(buf, 8, 2, CARD16, "fore-red");
+ PrintField(buf, 10, 2, CARD16, "fore-green");
+ PrintField(buf, 12, 2, CARD16, "fore-blue");
+ PrintField(buf, 14, 2, CARD16, "back-red");
+ PrintField(buf, 16, 2, CARD16, "back-green");
+ PrintField(buf, 18, 2, CARD16, "back-blue");
+}
void
-QueryBestSizeReply (
- const unsigned char *buf)
+QueryBestSize(FD fd, const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* QueryBestSize */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, CONST4(0), "reply length");
- PrintField(buf, 8, 2, CARD16, "width");
- PrintField(buf, 10, 2, CARD16, "height");
+ /* Request QueryBestSize is opcode 97 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* QueryBestSize */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ PrintField(buf, 1, 1, OBJECTCLASS, "class");
+ printreqlen(buf, fd, CONST2(3));
+ PrintField(buf, 4, 4, DRAWABLE, "drawable");
+ PrintField(buf, 8, 2, CARD16, "width");
+ PrintField(buf, 10, 2, CARD16, "height");
}
void
-QueryExtension (
- FD fd,
- const unsigned char *buf)
+QueryBestSizeReply(const unsigned char *buf)
{
- short n;
- /* Request QueryExtension is opcode 98 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* QueryExtension */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* QueryBestSize */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, CONST4(0), "reply length");
+ PrintField(buf, 8, 2, CARD16, "width");
+ PrintField(buf, 10, 2, CARD16, "height");
+}
+
+void
+QueryExtension(FD fd, const unsigned char *buf)
+{
+ short n;
+
+ /* Request QueryExtension is opcode 98 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* QueryExtension */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, DVALUE2(2 + (n + p) / 4));
- printfield(buf, 4, 2, DVALUE2(n), "length of name");
- n = IShort(&buf[4]);
- PrintString8(&buf[8], (long)n, "name");
+ printreqlen(buf, fd, DVALUE2(2 + (n + p) / 4));
+ printfield(buf, 4, 2, DVALUE2(n), "length of name");
+ n = IShort(&buf[4]);
+ PrintString8(&buf[8], (long) n, "name");
}
void
-QueryExtensionReply (
- const unsigned char *buf)
+QueryExtensionReply(const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* QueryExtension */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, CONST4(0), "reply length");
- PrintField(buf, 8, 1, BOOL, "present");
- PrintField(buf, 9, 1, CARD8, "major-opcode");
- PrintField(buf, 10, 1, CARD8, "first-event");
- PrintField(buf, 11, 1, CARD8, "first-error");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* QueryExtension */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, CONST4(0), "reply length");
+ PrintField(buf, 8, 1, BOOL, "present");
+ PrintField(buf, 9, 1, CARD8, "major-opcode");
+ PrintField(buf, 10, 1, CARD8, "first-event");
+ PrintField(buf, 11, 1, CARD8, "first-error");
}
void
-ListExtensions (
- FD fd,
- const unsigned char *buf)
+ListExtensions(FD fd, const unsigned char *buf)
{
- /* Request ListExtensions is opcode 99 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* ListExtensions */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request ListExtensions is opcode 99 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* ListExtensions */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(1));
+ printreqlen(buf, fd, CONST2(1));
}
void
-ListExtensionsReply (
- const unsigned char *buf)
+ListExtensionsReply(const unsigned char *buf)
{
- short n;
+ short n;
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* ListExtensions */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 1, 1, CARD8, "number names");
- n = IByte(&buf[1]);
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4((n + p) / 4), "reply length");
- PrintListSTR(&buf[32], (long)n, "names");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* ListExtensions */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 1, 1, CARD8, "number names");
+ n = IByte(&buf[1]);
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4((n + p) / 4), "reply length");
+ PrintListSTR(&buf[32], (long) n, "names");
}
void
-ChangeKeyboardMapping (
- FD fd,
- const unsigned char *buf)
+ChangeKeyboardMapping(FD fd, const unsigned char *buf)
{
- short n;
- short m;
- /* Request ChangeKeyboardMapping is opcode 100 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* ChangeKeyboardMapping */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ short n;
+ short m;
- PrintField(buf, 1, 1, DVALUE1(n), "keycode-count");
- n = IByte(&buf[1]);
- printreqlen(buf, fd, DVALUE2(2 + nm));
- PrintField(buf, 4, 1, KEYCODE, "first-keycode");
- PrintField(buf, 5, 1, DVALUE1(m), "keysyms-per-keycode");
- m = IByte(&buf[5]);
- PrintList(&buf[8], (long)(n * m), KEYSYM, "keysyms");
+ /* Request ChangeKeyboardMapping is opcode 100 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* ChangeKeyboardMapping */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ PrintField(buf, 1, 1, DVALUE1(n), "keycode-count");
+ n = IByte(&buf[1]);
+ printreqlen(buf, fd, DVALUE2(2 + nm));
+ PrintField(buf, 4, 1, KEYCODE, "first-keycode");
+ PrintField(buf, 5, 1, DVALUE1(m), "keysyms-per-keycode");
+ m = IByte(&buf[5]);
+ PrintList(&buf[8], (long) (n * m), KEYSYM, "keysyms");
}
void
-GetKeyboardMapping (
- FD fd,
- const unsigned char *buf)
+GetKeyboardMapping(FD fd, const unsigned char *buf)
{
- /* Request GetKeyboardMapping is opcode 101 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* GetKeyboardMapping */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request GetKeyboardMapping is opcode 101 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* GetKeyboardMapping */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 1, KEYCODE, "first-keycode");
- PrintField(buf, 5, 1, CARD8, "count");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 1, KEYCODE, "first-keycode");
+ PrintField(buf, 5, 1, CARD8, "count");
}
void
-GetKeyboardMappingReply (
- const unsigned char *buf)
+GetKeyboardMappingReply(const unsigned char *buf)
{
- long n;
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* GetKeyboardMapping */ ;
- if (Verbose < 1)
- return;
- PrintField(buf, 1, 1, DVALUE1(n), "keysyms-per-keycode");
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4(n*m), "reply length");
- n = ILong(&buf[4]);
- PrintList(&buf[32], n, KEYSYM, "keysyms");
+ long n;
+
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* GetKeyboardMapping */
+ if (Verbose < 1)
+ return;
+ PrintField(buf, 1, 1, DVALUE1(n), "keysyms-per-keycode");
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(n * m), "reply length");
+ n = ILong(&buf[4]);
+ PrintList(&buf[32], n, KEYSYM, "keysyms");
}
void
-ChangeKeyboardControl (
- FD fd,
- const unsigned char *buf)
+ChangeKeyboardControl(FD fd, const unsigned char *buf)
{
- /* Request ChangeKeyboardControl is opcode 102 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* ChangeKeyboardControl */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request ChangeKeyboardControl is opcode 102 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* ChangeKeyboardControl */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, DVALUE2(2 + n));
- PrintField(buf, 4, 4, KEYBOARD_BITMASK, "value-mask");
- PrintValues(&buf[4], 4, KEYBOARD_BITMASK, &buf[8], "value-list");
+ printreqlen(buf, fd, DVALUE2(2 + n));
+ PrintField(buf, 4, 4, KEYBOARD_BITMASK, "value-mask");
+ PrintValues(&buf[4], 4, KEYBOARD_BITMASK, &buf[8], "value-list");
}
void
-GetKeyboardControl (
- FD fd,
- const unsigned char *buf)
+GetKeyboardControl(FD fd, const unsigned char *buf)
{
- /* Request GetKeyboardControl is opcode 103 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* GetKeyboardControl */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request GetKeyboardControl is opcode 103 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* GetKeyboardControl */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(1));
+ printreqlen(buf, fd, CONST2(1));
}
void
-GetKeyboardControlReply (
- const unsigned char *buf)
+GetKeyboardControlReply(const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* GetKeyboardControl */ ;
- if (Verbose < 1)
- return;
- PrintField(buf, 1, 1, OFF_ON, "global-auto-repeat");
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, CONST4(5), "reply length");
- PrintField(buf, 8, 4, CARD32, "led-mask");
- PrintField(buf, 12, 1, CARD8, "key-click-percent");
- PrintField(buf, 13, 1, CARD8, "bell-percent");
- PrintField(buf, 14, 2, CARD16, "bell-pitch");
- PrintField(buf, 16, 2, CARD16, "bell-duration");
- PrintBytes(&buf[20], 32L, "auto-repeats");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* GetKeyboardControl */
+ if (Verbose < 1)
+ return;
+ PrintField(buf, 1, 1, OFF_ON, "global-auto-repeat");
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, CONST4(5), "reply length");
+ PrintField(buf, 8, 4, CARD32, "led-mask");
+ PrintField(buf, 12, 1, CARD8, "key-click-percent");
+ PrintField(buf, 13, 1, CARD8, "bell-percent");
+ PrintField(buf, 14, 2, CARD16, "bell-pitch");
+ PrintField(buf, 16, 2, CARD16, "bell-duration");
+ PrintBytes(&buf[20], 32L, "auto-repeats");
}
void
-Bell (
- FD fd,
- const unsigned char *buf)
+Bell(FD fd, const unsigned char *buf)
{
- /* Request Bell is opcode 104 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* Bell */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request Bell is opcode 104 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* Bell */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- PrintField(buf, 1, 1, INT8, "percent");
- printreqlen(buf, fd, CONST2(1));
+ PrintField(buf, 1, 1, INT8, "percent");
+ printreqlen(buf, fd, CONST2(1));
}
void
-ChangePointerControl (
- FD fd,
- const unsigned char *buf)
+ChangePointerControl(FD fd, const unsigned char *buf)
{
- /* Request ChangePointerControl is opcode 105 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* ChangePointerControl */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request ChangePointerControl is opcode 105 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* ChangePointerControl */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(3));
- PrintField(buf, 4, 2, INT16, "acceleration-numerator");
- PrintField(buf, 6, 2, INT16, "acceleration-denominator");
- PrintField(buf, 8, 2, INT16, "threshold");
- PrintField(buf, 10, 1, BOOL, "do-acceleration");
- PrintField(buf, 11, 1, BOOL, "do-threshold");
+ printreqlen(buf, fd, CONST2(3));
+ PrintField(buf, 4, 2, INT16, "acceleration-numerator");
+ PrintField(buf, 6, 2, INT16, "acceleration-denominator");
+ PrintField(buf, 8, 2, INT16, "threshold");
+ PrintField(buf, 10, 1, BOOL, "do-acceleration");
+ PrintField(buf, 11, 1, BOOL, "do-threshold");
}
void
-GetPointerControl (
- FD fd,
- const unsigned char *buf)
+GetPointerControl(FD fd, const unsigned char *buf)
{
- /* Request GetPointerControl is opcode 106 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* GetPointerControl */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request GetPointerControl is opcode 106 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* GetPointerControl */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(1));
+ printreqlen(buf, fd, CONST2(1));
}
void
-GetPointerControlReply (
- const unsigned char *buf)
+GetPointerControlReply(const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* GetPointerControl */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, CONST4(0), "reply length");
- PrintField(buf, 8, 2, CARD16, "acceleration-numerator");
- PrintField(buf, 10, 2, CARD16, "acceleration-denominator");
- PrintField(buf, 12, 2, CARD16, "threshold");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* GetPointerControl */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, CONST4(0), "reply length");
+ PrintField(buf, 8, 2, CARD16, "acceleration-numerator");
+ PrintField(buf, 10, 2, CARD16, "acceleration-denominator");
+ PrintField(buf, 12, 2, CARD16, "threshold");
}
void
-SetScreenSaver (
- FD fd,
- const unsigned char *buf)
+SetScreenSaver(FD fd, const unsigned char *buf)
{
- /* Request SetScreenSaver is opcode 107 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* SetScreenSaver */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request SetScreenSaver is opcode 107 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* SetScreenSaver */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(3));
- PrintField(buf, 4, 2, INT16, "timeout");
- PrintField(buf, 6, 2, INT16, "interval");
- PrintField(buf, 8, 1, NO_YES, "prefer-blanking");
- PrintField(buf, 9, 1, NO_YES, "allow-exposures");
+ printreqlen(buf, fd, CONST2(3));
+ PrintField(buf, 4, 2, INT16, "timeout");
+ PrintField(buf, 6, 2, INT16, "interval");
+ PrintField(buf, 8, 1, NO_YES, "prefer-blanking");
+ PrintField(buf, 9, 1, NO_YES, "allow-exposures");
}
void
-GetScreenSaver (
- FD fd,
- const unsigned char *buf)
+GetScreenSaver(FD fd, const unsigned char *buf)
{
- /* Request GetScreenSaver is opcode 108 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* GetScreenSaver */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request GetScreenSaver is opcode 108 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* GetScreenSaver */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(1));
+ printreqlen(buf, fd, CONST2(1));
}
void
-GetScreenSaverReply (
- const unsigned char *buf)
+GetScreenSaverReply(const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* GetScreenSaver */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, CONST4(0), "reply length");
- PrintField(buf, 8, 2, CARD16, "timeout");
- PrintField(buf, 10, 2, CARD16, "interval");
- PrintField(buf, 12, 1, NO_YES, "prefer-blanking");
- PrintField(buf, 13, 1, NO_YES, "allow-exposures");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* GetScreenSaver */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, CONST4(0), "reply length");
+ PrintField(buf, 8, 2, CARD16, "timeout");
+ PrintField(buf, 10, 2, CARD16, "interval");
+ PrintField(buf, 12, 1, NO_YES, "prefer-blanking");
+ PrintField(buf, 13, 1, NO_YES, "allow-exposures");
}
void
-ChangeHosts (
- FD fd,
- const unsigned char *buf)
+ChangeHosts(FD fd, const unsigned char *buf)
{
- short n;
- /* Request ChangeHosts is opcode 109 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* ChangeHosts */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ short n;
+
+ /* Request ChangeHosts is opcode 109 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* ChangeHosts */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- PrintField(buf, 1, 1, INS_DEL, "mode");
- printreqlen(buf, fd, DVALUE2(2 + (n + p) / 4));
- n = IShort(&buf[6]);
- PrintField(buf, 4, 4+n, HOST, "host");
+ PrintField(buf, 1, 1, INS_DEL, "mode");
+ printreqlen(buf, fd, DVALUE2(2 + (n + p) / 4));
+ n = IShort(&buf[6]);
+ PrintField(buf, 4, 4 + n, HOST, "host");
}
void
-ListHosts (
- FD fd,
- const unsigned char *buf)
+ListHosts(FD fd, const unsigned char *buf)
{
- /* Request ListHosts is opcode 110 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* ListHosts */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request ListHosts is opcode 110 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* ListHosts */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(1));
+ printreqlen(buf, fd, CONST2(1));
}
void
-ListHostsReply (
- const unsigned char *buf)
+ListHostsReply(const unsigned char *buf)
{
- short n;
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* ListHosts */ ;
- if (Verbose < 1)
- return;
- PrintField(buf, 1, 1, DIS_EN, "mode");
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4(n / 4), "reply length");
- printfield(buf, 8, 2, CARD16, "number of hosts");
- n = IShort(&buf[8]);
- PrintList(&buf[32], (long)n, HOST, "hosts");
+ short n;
+
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* ListHosts */
+ if (Verbose < 1)
+ return;
+ PrintField(buf, 1, 1, DIS_EN, "mode");
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(n / 4), "reply length");
+ printfield(buf, 8, 2, CARD16, "number of hosts");
+
+ n = IShort(&buf[8]);
+ PrintList(&buf[32], (long) n, HOST, "hosts");
}
void
-SetAccessControl (
- FD fd,
- const unsigned char *buf)
+SetAccessControl(FD fd, const unsigned char *buf)
{
- /* Request SetAccessControl is opcode 111 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* SetAccessControl */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request SetAccessControl is opcode 111 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* SetAccessControl */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- PrintField(buf, 1, 1, DIS_EN, "mode");
- printreqlen(buf, fd, CONST2(1));
+ PrintField(buf, 1, 1, DIS_EN, "mode");
+ printreqlen(buf, fd, CONST2(1));
}
void
-SetCloseDownMode (
- FD fd,
- const unsigned char *buf)
+SetCloseDownMode(FD fd, const unsigned char *buf)
{
- /* Request SetCloseDownMode is opcode 112 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* SetCloseDownMode */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request SetCloseDownMode is opcode 112 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* SetCloseDownMode */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- PrintField(buf, 1, 1, CLOSEMODE, "mode");
- printreqlen(buf, fd, CONST2(1));
+ PrintField(buf, 1, 1, CLOSEMODE, "mode");
+ printreqlen(buf, fd, CONST2(1));
}
void
-KillClient (
- FD fd,
- const unsigned char *buf)
+KillClient(FD fd, const unsigned char *buf)
{
- /* Request KillClient is opcode 113 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* KillClient */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request KillClient is opcode 113 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* KillClient */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, RESOURCEID, "resource");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, RESOURCEID, "resource");
}
void
-RotateProperties (
- FD fd,
- const unsigned char *buf)
+RotateProperties(FD fd, const unsigned char *buf)
{
- short n;
- /* Request RotateProperties is opcode 114 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* RotateProperties */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ short n;
- printreqlen(buf, fd, DVALUE2(3 + n));
- PrintField(buf, 4, 4, WINDOW, "window");
- printfield(buf, 8, 2, DVALUE2(n), "number of properties");
- n = IShort(&buf[8]);
- PrintField(buf, 10, 2, INT16, "delta");
- PrintList(&buf[12], (long)n, ATOM, "properties");
+ /* Request RotateProperties is opcode 114 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RotateProperties */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, DVALUE2(3 + n));
+ PrintField(buf, 4, 4, WINDOW, "window");
+ printfield(buf, 8, 2, DVALUE2(n), "number of properties");
+ n = IShort(&buf[8]);
+ PrintField(buf, 10, 2, INT16, "delta");
+ PrintList(&buf[12], (long) n, ATOM, "properties");
}
void
-ForceScreenSaver (
- FD fd,
- const unsigned char *buf)
+ForceScreenSaver(FD fd, const unsigned char *buf)
{
- /* Request ForceScreenSaver is opcode 115 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* ForceScreenSaver */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request ForceScreenSaver is opcode 115 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* ForceScreenSaver */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- PrintField(buf, 1, 1, SAVEMODE, "mode");
- printreqlen(buf, fd, CONST2(1));
+ PrintField(buf, 1, 1, SAVEMODE, "mode");
+ printreqlen(buf, fd, CONST2(1));
}
void
-SetPointerMapping (
- FD fd,
- const unsigned char *buf)
+SetPointerMapping(FD fd, const unsigned char *buf)
{
- short n;
- /* Request SetPointerMapping is opcode 116 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* SetPointerMapping */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ short n;
+
+ /* Request SetPointerMapping is opcode 116 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* SetPointerMapping */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printfield(buf, 1, 1, DVALUE1(n), "length of map");
- n = IByte(&buf[1]);
- printreqlen(buf, fd, DVALUE2(1 + (n + p) / 4));
- PrintBytes(&buf[4], (long)n,"map");
+ printfield(buf, 1, 1, DVALUE1(n), "length of map");
+ n = IByte(&buf[1]);
+ printreqlen(buf, fd, DVALUE2(1 + (n + p) / 4));
+ PrintBytes(&buf[4], (long) n, "map");
}
void
-SetPointerMappingReply (
- const unsigned char *buf)
+SetPointerMappingReply(const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* SetPointerMapping */ ;
- if (Verbose < 1)
- return;
- PrintField(buf, 1, 1, RSTATUS, "status");
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, CONST4(0), "reply length");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* SetPointerMapping */
+ if (Verbose < 1)
+ return;
+ PrintField(buf, 1, 1, RSTATUS, "status");
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, CONST4(0), "reply length");
}
void
-GetPointerMapping (
- FD fd,
- const unsigned char *buf)
+GetPointerMapping(FD fd, const unsigned char *buf)
{
- /* Request GetPointerMapping is opcode 117 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* GetPointerMapping */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request GetPointerMapping is opcode 117 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* GetPointerMapping */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(1));
+ printreqlen(buf, fd, CONST2(1));
}
void
-GetPointerMappingReply (
- const unsigned char *buf)
+GetPointerMappingReply(const unsigned char *buf)
{
- short n;
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* GetPointerMapping */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 1, 1, DVALUE1(n), "length of map");
- n = IByte(&buf[1]);
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4((n + p) / 4), "reply length");
- PrintBytes(&buf[32], (long)n,"map");
+ short n;
+
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* GetPointerMapping */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 1, 1, DVALUE1(n), "length of map");
+ n = IByte(&buf[1]);
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4((n + p) / 4), "reply length");
+ PrintBytes(&buf[32], (long) n, "map");
}
void
-SetModifierMapping (
- FD fd,
- const unsigned char *buf)
+SetModifierMapping(FD fd, const unsigned char *buf)
{
- short n;
- /* Request SetModifierMapping is opcode 118 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* SetModifierMapping */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ short n;
- PrintField(buf, 1, 1, DVALUE1(n), "keycodes-per-modifier");
- n = IByte(&buf[1]);
- printreqlen(buf, fd, DVALUE2(1 + 2*n));
- PrintBytes(&buf[4 + 0 * n], (long)n,"Shift keycodes");
- PrintBytes(&buf[4 + 1 * n], (long)n,"Lock keycodes");
- PrintBytes(&buf[4 + 2 * n], (long)n,"Control keycodes");
- PrintBytes(&buf[4 + 3 * n], (long)n,"Mod1 keycodes");
- PrintBytes(&buf[4 + 4 * n], (long)n,"Mod2 keycodes");
- PrintBytes(&buf[4 + 5 * n], (long)n,"Mod3 keycodes");
- PrintBytes(&buf[4 + 6 * n], (long)n,"Mod4 keycodes");
- PrintBytes(&buf[4 + 7 * n], (long)n,"Mod5 keycodes");
+ /* Request SetModifierMapping is opcode 118 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* SetModifierMapping */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ PrintField(buf, 1, 1, DVALUE1(n), "keycodes-per-modifier");
+ n = IByte(&buf[1]);
+ printreqlen(buf, fd, DVALUE2(1 + 2 * n));
+ PrintBytes(&buf[4 + 0 * n], (long) n, "Shift keycodes");
+ PrintBytes(&buf[4 + 1 * n], (long) n, "Lock keycodes");
+ PrintBytes(&buf[4 + 2 * n], (long) n, "Control keycodes");
+ PrintBytes(&buf[4 + 3 * n], (long) n, "Mod1 keycodes");
+ PrintBytes(&buf[4 + 4 * n], (long) n, "Mod2 keycodes");
+ PrintBytes(&buf[4 + 5 * n], (long) n, "Mod3 keycodes");
+ PrintBytes(&buf[4 + 6 * n], (long) n, "Mod4 keycodes");
+ PrintBytes(&buf[4 + 7 * n], (long) n, "Mod5 keycodes");
}
void
-SetModifierMappingReply (
- const unsigned char *buf)
+SetModifierMappingReply(const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* SetModifierMapping */ ;
- if (Verbose < 1)
- return;
- PrintField(buf, 1, 1, RSTATUS, "status");
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, CONST4(0), "reply length");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* SetModifierMapping */
+ if (Verbose < 1)
+ return;
+ PrintField(buf, 1, 1, RSTATUS, "status");
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, CONST4(0), "reply length");
}
void
-GetModifierMapping (
- FD fd,
- const unsigned char *buf)
+GetModifierMapping(FD fd, const unsigned char *buf)
{
- /* Request GetModifierMapping is opcode 119 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* GetModifierMapping */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request GetModifierMapping is opcode 119 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* GetModifierMapping */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(1));
+ printreqlen(buf, fd, CONST2(1));
}
void
-GetModifierMappingReply (
- const unsigned char *buf)
+GetModifierMappingReply(const unsigned char *buf)
{
- short n;
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* GetModifierMapping */ ;
- if (Verbose < 1)
- return;
- PrintField(buf, 1, 1, DVALUE1(n), "keycodes-per-modifier");
- n = IByte(&buf[1]);
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4(2*n), "reply length");
- PrintList(&buf[32], (long)n, KEYCODE, "keycodes");
+ short n;
+
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* GetModifierMapping */
+ if (Verbose < 1)
+ return;
+ PrintField(buf, 1, 1, DVALUE1(n), "keycodes-per-modifier");
+ n = IByte(&buf[1]);
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(2 * n), "reply length");
+ PrintList(&buf[32], (long) n, KEYCODE, "keycodes");
}
void
-NoOperation (
- FD fd,
- const unsigned char *buf)
+NoOperation(FD fd, const unsigned char *buf)
{
- /* Request NoOperation is opcode 127 */
- PrintField(buf, 0, 1, REQUEST, REQUESTHEADER) /* NoOperation */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ /* Request NoOperation is opcode 127 */
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* NoOperation */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(1));
+ printreqlen(buf, fd, CONST2(1));
}
diff --git a/print_bigreq.c b/print_bigreq.c
index 35d1816..6bf0551 100644
--- a/print_bigreq.c
+++ b/print_bigreq.c
@@ -27,25 +27,26 @@
#include "bigreqscope.h"
void
-BigreqEnable (FD fd, const unsigned char *buf)
+BigreqEnable(FD fd, const unsigned char *buf)
{
- PrintField (buf, 0, 1, REQUEST, REQUESTHEADER) /* BigreqRequest */ ;
- PrintField (buf, 1, 1, BIGREQREQUEST, BIGREQREQUESTHEADER) /* BigreqSwitch */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* BigreqRequest */
+ PrintField(buf, 1, 1, BIGREQREQUEST,
+ BIGREQREQUESTHEADER); /* BigreqSwitch */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
void
-BigreqEnableReply (FD fd, const unsigned char *buf)
+BigreqEnableReply(FD fd, const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* BigreqRequest reply */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4(0), "reply length");
- PrintField(buf, 8, 4, CARD32, "max-request-size");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* BigreqRequest reply */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
+ PrintField(buf, 8, 4, CARD32, "max-request-size");
}
diff --git a/print_glx.c b/print_glx.c
index afb683a..5e2b507 100644
--- a/print_glx.c
+++ b/print_glx.c
@@ -31,606 +31,607 @@
/* Print the portion of the glx request header common to all requests */
static inline void
-GlxRequestHeader (FD fd, const unsigned char *buf)
+GlxRequestHeader(FD fd, const unsigned char *buf)
{
- PrintField (buf, 0, 1, REQUEST, REQUESTHEADER);
- PrintField (buf, 1, 1, GLXREQUEST, GLXREQUESTHEADER);
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER);
+ PrintField(buf, 1, 1, GLXREQUEST, GLXREQUESTHEADER);
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
}
void
-GLXRender (FD fd, const unsigned char *buf)
+GLXRender(FD fd, const unsigned char *buf)
{
- GlxRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ GlxRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
void
-GLXRenderLarge (FD fd, const unsigned char *buf)
+GLXRenderLarge(FD fd, const unsigned char *buf)
{
- GlxRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ GlxRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
void
-GLXCreateContext (FD fd, const unsigned char *buf)
+GLXCreateContext(FD fd, const unsigned char *buf)
{
- GlxRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ GlxRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
void
-GLXDestroyContext (FD fd, const unsigned char *buf)
+GLXDestroyContext(FD fd, const unsigned char *buf)
{
- GlxRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ GlxRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
void
-GLXMakeCurrent (FD fd, const unsigned char *buf)
+GLXMakeCurrent(FD fd, const unsigned char *buf)
{
- GlxRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ GlxRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
-void GLXMakeCurrentReply (FD fd, const unsigned char *buf)
+void
+GLXMakeCurrentReply(FD fd, const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER);
- PrintField(RBf, 1, 1, GLXREPLY, GLXREPLYHEADER);
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4(0), "reply length");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER);
+ PrintField(RBf, 1, 1, GLXREPLY, GLXREPLYHEADER);
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
}
void
-GLXIsDirect (FD fd, const unsigned char *buf)
+GLXIsDirect(FD fd, const unsigned char *buf)
{
- GlxRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ GlxRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
void
-GLXIsDirectReply (FD fd, const unsigned char *buf)
+GLXIsDirectReply(FD fd, const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER);
- PrintField(RBf, 1, 1, GLXREPLY, GLXREPLYHEADER);
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4(0), "reply length");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER);
+ PrintField(RBf, 1, 1, GLXREPLY, GLXREPLYHEADER);
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
}
void
-GLXQueryVersion (FD fd, const unsigned char *buf)
+GLXQueryVersion(FD fd, const unsigned char *buf)
{
- GlxRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ GlxRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
void
-GLXQueryVersionReply (FD fd, const unsigned char *buf)
+GLXQueryVersionReply(FD fd, const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER);
- PrintField(RBf, 1, 1, GLXREPLY, GLXREPLYHEADER);
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4(0), "reply length");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER);
+ PrintField(RBf, 1, 1, GLXREPLY, GLXREPLYHEADER);
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
}
void
-GLXWaitGL (FD fd, const unsigned char *buf)
+GLXWaitGL(FD fd, const unsigned char *buf)
{
- GlxRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ GlxRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
void
-GLXWaitX (FD fd, const unsigned char *buf)
+GLXWaitX(FD fd, const unsigned char *buf)
{
- GlxRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ GlxRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
void
-GLXCopyContext (FD fd, const unsigned char *buf)
+GLXCopyContext(FD fd, const unsigned char *buf)
{
- GlxRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ GlxRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
void
-GLXSwapBuffers (FD fd, const unsigned char *buf)
+GLXSwapBuffers(FD fd, const unsigned char *buf)
{
- GlxRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ GlxRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
void
-GLXUseXFont (FD fd, const unsigned char *buf)
+GLXUseXFont(FD fd, const unsigned char *buf)
{
- GlxRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ GlxRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
void
-GLXCreateGLXPixmap (FD fd, const unsigned char *buf)
+GLXCreateGLXPixmap(FD fd, const unsigned char *buf)
{
- GlxRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ GlxRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
void
-GLXGetVisualConfigs (FD fd, const unsigned char *buf)
+GLXGetVisualConfigs(FD fd, const unsigned char *buf)
{
- GlxRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ GlxRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
void
- GLXGetVisualConfigsReply (FD fd, const unsigned char *buf)
+GLXGetVisualConfigsReply(FD fd, const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER);
- PrintField(RBf, 1, 1, GLXREPLY, GLXREPLYHEADER);
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4(0), "reply length");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER);
+ PrintField(RBf, 1, 1, GLXREPLY, GLXREPLYHEADER);
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
}
void
-GLXDestroyGLXPixmap (FD fd, const unsigned char *buf)
+GLXDestroyGLXPixmap(FD fd, const unsigned char *buf)
{
- GlxRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ GlxRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
void
-GLXVendorPrivate (FD fd, const unsigned char *buf)
+GLXVendorPrivate(FD fd, const unsigned char *buf)
{
- GlxRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ GlxRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
void
-GLXVendorPrivateWithReply (FD fd, const unsigned char *buf)
+GLXVendorPrivateWithReply(FD fd, const unsigned char *buf)
{
- GlxRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ GlxRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
void
-GLXVendorPrivateWithReplyReply (FD fd, const unsigned char *buf)
+GLXVendorPrivateWithReplyReply(FD fd, const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER);
- PrintField(RBf, 1, 1, GLXREPLY, GLXREPLYHEADER);
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4(0), "reply length");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER);
+ PrintField(RBf, 1, 1, GLXREPLY, GLXREPLYHEADER);
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
}
void
-GLXQueryExtensionsString (FD fd, const unsigned char *buf)
+GLXQueryExtensionsString(FD fd, const unsigned char *buf)
{
- GlxRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ GlxRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
void
- GLXQueryExtensionsStringReply (FD fd, const unsigned char *buf)
+GLXQueryExtensionsStringReply(FD fd, const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER);
- PrintField(RBf, 1, 1, GLXREPLY, GLXREPLYHEADER);
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4(0), "reply length");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER);
+ PrintField(RBf, 1, 1, GLXREPLY, GLXREPLYHEADER);
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
}
void
-GLXQueryServerString (FD fd, const unsigned char *buf)
+GLXQueryServerString(FD fd, const unsigned char *buf)
{
- GlxRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ GlxRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
void
- GLXQueryServerStringReply (FD fd, const unsigned char *buf)
+GLXQueryServerStringReply(FD fd, const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER);
- PrintField(RBf, 1, 1, GLXREPLY, GLXREPLYHEADER);
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4(0), "reply length");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER);
+ PrintField(RBf, 1, 1, GLXREPLY, GLXREPLYHEADER);
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
}
void
-GLXClientInfo (FD fd, const unsigned char *buf)
+GLXClientInfo(FD fd, const unsigned char *buf)
{
- GlxRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ GlxRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
void
-GLXGetFBConfigs (FD fd, const unsigned char *buf)
+GLXGetFBConfigs(FD fd, const unsigned char *buf)
{
- GlxRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ GlxRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
void
- GLXGetFBConfigsReply (FD fd, const unsigned char *buf)
+GLXGetFBConfigsReply(FD fd, const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER);
- PrintField(RBf, 1, 1, GLXREPLY, GLXREPLYHEADER);
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4(0), "reply length");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER);
+ PrintField(RBf, 1, 1, GLXREPLY, GLXREPLYHEADER);
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
}
void
-GLXCreatePixmap (FD fd, const unsigned char *buf)
+GLXCreatePixmap(FD fd, const unsigned char *buf)
{
- GlxRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ GlxRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
void
-GLXDestroyPixmap (FD fd, const unsigned char *buf)
+GLXDestroyPixmap(FD fd, const unsigned char *buf)
{
- GlxRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ GlxRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
void
-GLXCreateNewContext (FD fd, const unsigned char *buf)
+GLXCreateNewContext(FD fd, const unsigned char *buf)
{
- GlxRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ GlxRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
void
-GLXQueryContext (FD fd, const unsigned char *buf)
+GLXQueryContext(FD fd, const unsigned char *buf)
{
- GlxRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ GlxRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
void
- GLXQueryContextReply (FD fd, const unsigned char *buf)
+GLXQueryContextReply(FD fd, const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER);
- PrintField(RBf, 1, 1, GLXREPLY, GLXREPLYHEADER);
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4(0), "reply length");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER);
+ PrintField(RBf, 1, 1, GLXREPLY, GLXREPLYHEADER);
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
}
void
-GLXMakeContextCurrent (FD fd, const unsigned char *buf)
+GLXMakeContextCurrent(FD fd, const unsigned char *buf)
{
- GlxRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ GlxRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
void
- GLXMakeContextCurrentReply (FD fd, const unsigned char *buf)
+GLXMakeContextCurrentReply(FD fd, const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER);
- PrintField(RBf, 1, 1, GLXREPLY, GLXREPLYHEADER);
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4(0), "reply length");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER);
+ PrintField(RBf, 1, 1, GLXREPLY, GLXREPLYHEADER);
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
}
void
-GLXCreatePbuffer (FD fd, const unsigned char *buf)
+GLXCreatePbuffer(FD fd, const unsigned char *buf)
{
- GlxRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ GlxRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
void
-GLXDestroyPbuffer (FD fd, const unsigned char *buf)
+GLXDestroyPbuffer(FD fd, const unsigned char *buf)
{
- GlxRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ GlxRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
void
-GLXGetDrawableAttributes (FD fd, const unsigned char *buf)
+GLXGetDrawableAttributes(FD fd, const unsigned char *buf)
{
- GlxRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ GlxRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
void
- GLXGetDrawableAttributesReply (FD fd, const unsigned char *buf)
+GLXGetDrawableAttributesReply(FD fd, const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER);
- PrintField(RBf, 1, 1, GLXREPLY, GLXREPLYHEADER);
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4(0), "reply length");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER);
+ PrintField(RBf, 1, 1, GLXREPLY, GLXREPLYHEADER);
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
}
void
-GLXChangeDrawableAttributes (FD fd, const unsigned char *buf)
+GLXChangeDrawableAttributes(FD fd, const unsigned char *buf)
{
- GlxRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ GlxRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
void
-GLXCreateWindow (FD fd, const unsigned char *buf)
+GLXCreateWindow(FD fd, const unsigned char *buf)
{
- GlxRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ GlxRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
void
-GLXDestroyWindow (FD fd, const unsigned char *buf)
+GLXDestroyWindow(FD fd, const unsigned char *buf)
{
- GlxRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ GlxRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
void
-GLXBadContextError (FD fd, const unsigned char *buf)
+GLXBadContextError(FD fd, const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Request */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, PICTFORMAT, "format");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Request */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, PICTFORMAT, "format");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
void
-GLXBadContextStateError (FD fd, const unsigned char *buf)
+GLXBadContextStateError(FD fd, const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Request */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, PICTFORMAT, "format");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Request */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, PICTFORMAT, "format");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
void
-GLXBadDrawableError (FD fd, const unsigned char *buf)
+GLXBadDrawableError(FD fd, const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Request */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, PICTFORMAT, "format");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Request */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, PICTFORMAT, "format");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
void
-GLXBadPixmapError (FD fd, const unsigned char *buf)
+GLXBadPixmapError(FD fd, const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Request */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, PICTFORMAT, "format");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Request */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, PICTFORMAT, "format");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
void
-GLXBadContextTagError (FD fd, const unsigned char *buf)
+GLXBadContextTagError(FD fd, const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Request */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, PICTFORMAT, "format");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Request */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, PICTFORMAT, "format");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
void
-GLXBadCurrentWindowError (FD fd, const unsigned char *buf)
+GLXBadCurrentWindowError(FD fd, const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Request */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, PICTFORMAT, "format");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Request */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, PICTFORMAT, "format");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
void
-GLXBadRenderRequestError (FD fd, const unsigned char *buf)
+GLXBadRenderRequestError(FD fd, const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Request */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, PICTFORMAT, "format");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Request */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, PICTFORMAT, "format");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
void
-GLXBadLargeRequestError (FD fd, const unsigned char *buf)
+GLXBadLargeRequestError(FD fd, const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Request */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, PICTFORMAT, "format");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Request */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, PICTFORMAT, "format");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
void
-GLXUnsupportedPrivateRequestError (FD fd, const unsigned char *buf)
+GLXUnsupportedPrivateRequestError(FD fd, const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Request */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, PICTFORMAT, "format");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Request */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, PICTFORMAT, "format");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
void
-GLXBadFBConfigError (FD fd, const unsigned char *buf)
+GLXBadFBConfigError(FD fd, const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Request */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, PICTFORMAT, "format");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Request */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, PICTFORMAT, "format");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
void
-GLXBadPbufferError (FD fd, const unsigned char *buf)
+GLXBadPbufferError(FD fd, const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Request */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, PICTFORMAT, "format");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Request */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, PICTFORMAT, "format");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
void
-GLXBadCurrentDrawableError (FD fd, const unsigned char *buf)
+GLXBadCurrentDrawableError(FD fd, const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Request */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, PICTFORMAT, "format");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Request */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, PICTFORMAT, "format");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
void
-GLXBadWindowError (FD fd, const unsigned char *buf)
+GLXBadWindowError(FD fd, const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Request */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, PICTFORMAT, "format");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Request */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, PICTFORMAT, "format");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
diff --git a/print_lbx.c b/print_lbx.c
index d110c0c..3dcdda5 100644
--- a/print_lbx.c
+++ b/print_lbx.c
@@ -15,194 +15,174 @@
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NCD.
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Author: Keith Packard, Network Computing Devices
*/
-
+
#include "scope.h"
#include "x11.h"
#include "lbxscope.h"
-static unsigned long sequences[256];
-static unsigned char starting_server[256];
-static unsigned char starting_client[256];
-static int client_client;
+static unsigned long sequences[256];
+static unsigned char starting_server[256];
+static unsigned char starting_client[256];
+static int client_client;
void
-LbxQueryVersion (
- FD fd,
- const unsigned char *buf)
+LbxQueryVersion(FD fd, const unsigned char *buf)
{
- PrintField (buf, 0, 1, REQUEST, REQUESTHEADER) /* LbxRequest */ ;
- PrintField (buf, 1, 1, LBXREQUEST, LBXREQUESTHEADER) /* LbxSwitch */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* LbxRequest */
+ PrintField(buf, 1, 1, LBXREQUEST, LBXREQUESTHEADER); /* LbxSwitch */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(2));
}
void
-LbxQueryVersionReply (
- FD fd,
- const unsigned char *buf)
+LbxQueryVersionReply(FD fd, const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* LbxRequest reply */ ;
- PrintField(RBf, 1, 1, LBXREPLY, LBXREPLYHEADER) /* LbxQueryVersion reply */;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4(0), "reply length");
- PrintField(buf, 8, 2, CARD16, "major-version");
- PrintField(buf, 10, 2, CARD16, "minor-version");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* LbxRequest reply */
+ PrintField(RBf, 1, 1, LBXREPLY,
+ LBXREPLYHEADER); /* LbxQueryVersion reply */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
+ PrintField(buf, 8, 2, CARD16, "major-version");
+ PrintField(buf, 10, 2, CARD16, "minor-version");
}
-
+
void
-LbxStartProxy (
- FD fd,
- const unsigned char *buf)
+LbxStartProxy(FD fd, const unsigned char *buf)
{
- PrintField (buf, 0, 1, REQUEST, REQUESTHEADER) /* LbxRequest */ ;
- PrintField (buf, 1, 1, LBXREQUEST, LBXREQUESTHEADER) /* LbxSwitch */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* LbxRequest */
+ PrintField(buf, 1, 1, LBXREQUEST, LBXREQUESTHEADER); /* LbxSwitch */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(2));
}
void
-LbxStopProxy (
- FD fd,
- const unsigned char *buf)
+LbxStopProxy(FD fd, const unsigned char *buf)
{
- PrintField (buf, 0, 1, REQUEST, REQUESTHEADER) /* LbxRequest */ ;
- PrintField (buf, 1, 1, LBXREQUEST, LBXREQUESTHEADER) /* LbxSwitch */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* LbxRequest */
+ PrintField(buf, 1, 1, LBXREQUEST, LBXREQUESTHEADER); /* LbxSwitch */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(2));
}
void
-LbxNewClient (
- FD fd,
- const unsigned char *buf)
+LbxNewClient(FD fd, const unsigned char *buf)
{
- unsigned long c;
-
- c = ILong(&buf[4]);
- starting_client[c] = 1;
- starting_server[c] = 1;
- sequences[c] = 0;
-
- PrintField (buf, 0, 1, REQUEST, REQUESTHEADER) /* LbxRequest */ ;
- PrintField (buf, 1, 1, LBXREQUEST, LBXREQUESTHEADER) /* LbxSwitch */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, CARD32, "new-client-id");
+ unsigned long c;
+
+ c = ILong(&buf[4]);
+ starting_client[c] = 1;
+ starting_server[c] = 1;
+ sequences[c] = 0;
+
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* LbxRequest */
+ PrintField(buf, 1, 1, LBXREQUEST, LBXREQUESTHEADER); /* LbxSwitch */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, CARD32, "new-client-id");
}
void
-LbxCloseClient (
- FD fd,
- const unsigned char *buf)
+LbxCloseClient(FD fd, const unsigned char *buf)
{
}
void
-LbxSwitch (
- FD fd,
- const unsigned char *buf)
+LbxSwitch(FD fd, const unsigned char *buf)
{
- unsigned long c;
- c = ILong(&buf[4]);
- CS[fd].SequenceNumber--;
- sequences[client_client] = CS[fd].SequenceNumber;
- if (starting_client[c])
- {
- CS[fd].ByteProcessing = StartSetUpMessage;
- CS[fd].NumberofBytesNeeded = 12;
- starting_client[c] = 0;
- }
- CS[fd].SequenceNumber = sequences[c];
- client_client = c;
-
-
- PrintField (buf, 0, 1, REQUEST, REQUESTHEADER) /* LbxRequest */ ;
- PrintField (buf, 1, 1, LBXREQUEST, LBXREQUESTHEADER) /* LbxSwitch */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, CARD32, "client number");
+ unsigned long c;
+
+ c = ILong(&buf[4]);
+ CS[fd].SequenceNumber--;
+ sequences[client_client] = CS[fd].SequenceNumber;
+ if (starting_client[c]) {
+ CS[fd].ByteProcessing = StartSetUpMessage;
+ CS[fd].NumberofBytesNeeded = 12;
+ starting_client[c] = 0;
+ }
+ CS[fd].SequenceNumber = sequences[c];
+ client_client = c;
+
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* LbxRequest */
+ PrintField(buf, 1, 1, LBXREQUEST, LBXREQUESTHEADER); /* LbxSwitch */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, CARD32, "client number");
}
void
-LbxModifySequence (
- FD fd,
- const unsigned char *buf)
+LbxModifySequence(FD fd, const unsigned char *buf)
{
- int mod;
+ int mod;
- mod = ILong(&buf[4]);
- CS[fd].SequenceNumber += mod;
+ mod = ILong(&buf[4]);
+ CS[fd].SequenceNumber += mod;
- PrintField (buf, 0, 1, REQUEST, REQUESTHEADER) /* LbxRequest */ ;
- PrintField (buf, 1, 1, LBXREQUEST, LBXREQUESTHEADER) /* LbxModifySequence */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* LbxRequest */
+ PrintField(buf, 1, 1, LBXREQUEST,
+ LBXREQUESTHEADER); /* LbxModifySequence */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(2));
- printfield(buf, 4, 4, INT32, "adjustment");
+ printreqlen(buf, fd, CONST2(2));
+ printfield(buf, 4, 4, INT32, "adjustment");
}
void
-LbxSwitchEvent (
- FD fd,
- const unsigned char *buf)
+LbxSwitchEvent(FD fd, const unsigned char *buf)
{
- unsigned long c;
-
- c = ILong(&buf[4]);
- if (starting_server[c])
- {
- CS[fd].ByteProcessing = StartSetUpReply;
- CS[fd].NumberofBytesNeeded = 8;
- starting_server[c] = 0;
- }
-
- PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* LbxEvent */ ;
- PrintField(buf, 1, 1, LBXEVENT, LBXEVENTHEADER) /* LbxSwitchEvent */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, CARD32, "client");
+ unsigned long c;
+
+ c = ILong(&buf[4]);
+ if (starting_server[c]) {
+ CS[fd].ByteProcessing = StartSetUpReply;
+ CS[fd].NumberofBytesNeeded = 8;
+ starting_server[c] = 0;
+ }
+
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* LbxEvent */
+ PrintField(buf, 1, 1, LBXEVENT, LBXEVENTHEADER); /* LbxSwitchEvent */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, CARD32, "client");
}
void
-LbxCloseEvent (
- FD fd,
- const unsigned char *buf)
+LbxCloseEvent(FD fd, const unsigned char *buf)
{
- PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* LbxEvent */ ;
- PrintField(buf, 1, 1, LBXEVENT, LBXEVENTHEADER) /* LbxSwitchEvent */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, CARD32, "client");
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* LbxEvent */
+ PrintField(buf, 1, 1, LBXEVENT, LBXEVENTHEADER); /* LbxSwitchEvent */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, CARD32, "client");
}
diff --git a/print_randr.c b/print_randr.c
index 36ad7fc..2682fdd 100644
--- a/print_randr.c
+++ b/print_randr.c
@@ -26,142 +26,143 @@
#include "randrscope.h"
void
-RandrQueryVersion (FD fd, const unsigned char *buf)
+RandrQueryVersion(FD fd, const unsigned char *buf)
{
- PrintField (buf, 0, 1, REQUEST, REQUESTHEADER) /* RandrRequest */ ;
- PrintField (buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER) /* RandrSwitch */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrSwitch */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
void
-RandrQueryVersionReply (FD fd, const unsigned char *buf)
+RandrQueryVersionReply(FD fd, const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* RandrRequest reply */ ;
- PrintField(RBf, 1, 1, RANDRREPLY, RANDRREPLYHEADER) /* RandrQueryVersion reply */;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4(0), "reply length");
- PrintField(buf, 8, 2, CARD16, "major-version");
- PrintField(buf, 10, 2, CARD16, "minor-version");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* RandrRequest reply */
+ PrintField(RBf, 1, 1, RANDRREPLY,
+ RANDRREPLYHEADER); /* RandrQueryVersion reply */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
+ PrintField(buf, 8, 2, CARD16, "major-version");
+ PrintField(buf, 10, 2, CARD16, "minor-version");
}
void
-RandrGetScreenInfo (FD fd, const unsigned char *buf)
+RandrGetScreenInfo(FD fd, const unsigned char *buf)
{
- PrintField (buf, 0, 1, REQUEST, REQUESTHEADER) /* RandrRequest */ ;
- PrintField (buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER) /* RandrSwitch */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrSwitch */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, WINDOW, "window");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, WINDOW, "window");
}
void
-RandrGetScreenInfoReply (FD fd, const unsigned char *buf)
+RandrGetScreenInfoReply(FD fd, const unsigned char *buf)
{
- unsigned short nsize;
- unsigned short nvg;
- unsigned short ngvg;
+ unsigned short nsize;
+ unsigned short nvg;
+ unsigned short ngvg;
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* RandrRequest reply */ ;
- if (Verbose < 1)
- return;
- PrintField(buf, 1, 1, CARD8, "set-of-rotations");
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4(0), "reply length");
- PrintField(buf, 8, 4, WINDOW, "root");
- PrintField(buf,12, 4, TIMESTAMP, "timestamp");
- PrintField(buf,16, 4, TIMESTAMP, "config-timestamp");
- PrintField(buf,20, 2, CARD16, "num-visual-groups");
- nvg = IShort (&buf[20]);
- PrintField(buf,22, 2, CARD16, "num-groups-of-visual-groups");
- ngvg = IShort (&buf[22]);
- PrintField(buf,24, 2, CARD16, "num-sizes");
- nsize = IShort (&buf[24]);
- PrintField(buf,26, 2, CARD16, "size-id");
- PrintField(buf,28, 2, CARD16, "visual-group-id");
- PrintField(buf,30, 2, CARD16, "rotation");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* RandrRequest reply */
+ if (Verbose < 1)
+ return;
+ PrintField(buf, 1, 1, CARD8, "set-of-rotations");
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
+ PrintField(buf, 8, 4, WINDOW, "root");
+ PrintField(buf, 12, 4, TIMESTAMP, "timestamp");
+ PrintField(buf, 16, 4, TIMESTAMP, "config-timestamp");
+ PrintField(buf, 20, 2, CARD16, "num-visual-groups");
+ nvg = IShort(&buf[20]);
+ PrintField(buf, 22, 2, CARD16, "num-groups-of-visual-groups");
+ ngvg = IShort(&buf[22]);
+ PrintField(buf, 24, 2, CARD16, "num-sizes");
+ nsize = IShort(&buf[24]);
+ PrintField(buf, 26, 2, CARD16, "size-id");
+ PrintField(buf, 28, 2, CARD16, "visual-group-id");
+ PrintField(buf, 30, 2, CARD16, "rotation");
}
void
-RandrSetScreenConfig (FD fd, const unsigned char *buf)
+RandrSetScreenConfig(FD fd, const unsigned char *buf)
{
- PrintField (buf, 0, 1, REQUEST, REQUESTHEADER) /* RandrRequest */ ;
- PrintField (buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER) /* RandrSwitch */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrSwitch */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, DRAWABLE, "drawable");
- PrintField(buf, 8, 4, TIMESTAMP, "timestamp");
- PrintField(buf,12, 4, TIMESTAMP, "config-timestamp");
- PrintField(buf,16, 2, CARD16, "size-id");
- PrintField(buf,18, 2, CARD16, "rotation");
- PrintField(buf,20, 2, CARD16, "visual-group-id");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, DRAWABLE, "drawable");
+ PrintField(buf, 8, 4, TIMESTAMP, "timestamp");
+ PrintField(buf, 12, 4, TIMESTAMP, "config-timestamp");
+ PrintField(buf, 16, 2, CARD16, "size-id");
+ PrintField(buf, 18, 2, CARD16, "rotation");
+ PrintField(buf, 20, 2, CARD16, "visual-group-id");
}
void
-RandrSetScreenConfigReply (FD fd, const unsigned char *buf)
+RandrSetScreenConfigReply(FD fd, const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* RandrRequest reply */ ;
- PrintField(buf, 1, 1, BOOL, "success") /* RandrQueryVersion reply */;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4(0), "reply length");
- PrintField(buf, 8, 4, TIMESTAMP, "new-timestamp");
- PrintField(buf,12, 4, TIMESTAMP, "new-config-timestamp");
- PrintField(buf,16, 4, WINDOW, "root");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* RandrRequest reply */
+ PrintField(buf, 1, 1, BOOL, "success"); /* RandrQueryVersion reply */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
+ PrintField(buf, 8, 4, TIMESTAMP, "new-timestamp");
+ PrintField(buf, 12, 4, TIMESTAMP, "new-config-timestamp");
+ PrintField(buf, 16, 4, WINDOW, "root");
}
void
-RandrScreenChangeSelectInput (FD fd, const unsigned char *buf)
+RandrScreenChangeSelectInput(FD fd, const unsigned char *buf)
{
- PrintField (buf, 0, 1, REQUEST, REQUESTHEADER) /* RandrRequest */ ;
- PrintField (buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER) /* RandrSwitch */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RandrRequest */
+ PrintField(buf, 1, 1, RANDRREQUEST, RANDRREQUESTHEADER); /* RandrSwitch */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, WINDOW, "window");
- PrintField(buf, 8, 1, BOOL, "enable");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, WINDOW, "window");
+ PrintField(buf, 8, 1, BOOL, "enable");
}
void
-RandrScreenSizes (const unsigned char *buf)
+RandrScreenSizes(const unsigned char *buf)
{
- PrintField(buf, 0, 2, CARD16, "width-in-pixels");
- PrintField(buf, 2, 2, CARD16, "height-in-pixels");
- PrintField(buf, 4, 2, CARD16, "width-in-millimeters");
- PrintField(buf, 6, 2, CARD16, "height-in-millimeters");
- PrintField(buf, 8, 2, CARD16, "visual-group");
+ PrintField(buf, 0, 2, CARD16, "width-in-pixels");
+ PrintField(buf, 2, 2, CARD16, "height-in-pixels");
+ PrintField(buf, 4, 2, CARD16, "width-in-millimeters");
+ PrintField(buf, 6, 2, CARD16, "height-in-millimeters");
+ PrintField(buf, 8, 2, CARD16, "visual-group");
}
void
-RandrScreenChangeNotifyEvent (const unsigned char *buf)
+RandrScreenChangeNotifyEvent(const unsigned char *buf)
{
- PrintField(buf, 0, 1, EVENT, EVENTHEADER) /* RRScreenChangeNotify */ ;
- if (Verbose < 1)
- return;
- PrintField(buf, 1, 1, BOOL, "resident");
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, TIMESTAMP, "timestamp");
- PrintField(buf, 8, 4, TIMESTAMP, "config-timestamp");
- PrintField(buf,12, 4, WINDOW, "root");
- PrintField(buf,16, 2, CARD16, "size id");
- PrintField(buf,18, 2, CARD16, "rotation");
- RandrScreenSizes (buf + 20);
+ PrintField(buf, 0, 1, EVENT, EVENTHEADER); /* RRScreenChangeNotify */
+ if (Verbose < 1)
+ return;
+ PrintField(buf, 1, 1, BOOL, "resident");
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, TIMESTAMP, "timestamp");
+ PrintField(buf, 8, 4, TIMESTAMP, "config-timestamp");
+ PrintField(buf, 12, 4, WINDOW, "root");
+ PrintField(buf, 16, 2, CARD16, "size id");
+ PrintField(buf, 18, 2, CARD16, "rotation");
+ RandrScreenSizes(buf + 20);
}
diff --git a/print_render.c b/print_render.c
index a75c3a5..f8d14e3 100644
--- a/print_render.c
+++ b/print_render.c
@@ -28,739 +28,755 @@
/* Print the portion of the render request header common to all requests */
static inline void
-RenderRequestHeader (FD fd, const unsigned char *buf)
+RenderRequestHeader(FD fd, const unsigned char *buf)
{
- PrintField (buf, 0, 1, REQUEST, REQUESTHEADER) /* RenderRequest */ ;
- PrintField (buf, 1, 1, RENDERREQUEST, RENDERREQUESTHEADER) /* minor op */ ;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* RenderRequest */
+ PrintField(buf, 1, 1, RENDERREQUEST, RENDERREQUESTHEADER); /* minor op */
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
}
void
-RenderQueryVersion (FD fd, const unsigned char *buf)
+RenderQueryVersion(FD fd, const unsigned char *buf)
{
- RenderRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ RenderRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, CARD32, "major-version");
- PrintField(buf, 8, 4, CARD32, "minor-version");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, CARD32, "major-version");
+ PrintField(buf, 8, 4, CARD32, "minor-version");
}
void
-RenderQueryVersionReply (FD fd, const unsigned char *buf)
+RenderQueryVersionReply(FD fd, const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* RenderRequest reply */ ;
- PrintField(RBf, 1, 1, RENDERREPLY, RENDERREPLYHEADER) /* RenderQueryVersion reply */;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4(0), "reply length");
- PrintField(buf, 8, 4, CARD32, "major-version");
- PrintField(buf, 12, 4, CARD32, "minor-version");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* RenderRequest reply */
+ PrintField(RBf, 1, 1, RENDERREPLY,
+ RENDERREPLYHEADER); /* RenderQueryVersion reply */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
+ PrintField(buf, 8, 4, CARD32, "major-version");
+ PrintField(buf, 12, 4, CARD32, "minor-version");
}
void
-RenderQueryPictFormats (FD fd, const unsigned char *buf)
+RenderQueryPictFormats(FD fd, const unsigned char *buf)
{
- RenderRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ RenderRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
void
-RenderQueryPictFormatsReply (FD fd, const unsigned char *buf)
+RenderQueryPictFormatsReply(FD fd, const unsigned char *buf)
{
- long n;
- long f;
- long s;
- long d;
- long v;
+ long n;
+ long f;
+ long s;
+ long d;
+ long v;
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* RenderRequest reply */ ;
- PrintField(RBf, 1, 1, RENDERREPLY, RENDERREPLYHEADER) /* RenderQueryVersion reply */;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4(0), "reply length");
- n = ILong (&buf[4]);
- f = ILong (&buf[8]);
- s = ILong (&buf[12]);
- d = ILong (&buf[16]);
- v = ILong (&buf[20]);
- PrintList (&buf[32], (long) f, PICTFORMINFO, "pict-formats");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* RenderRequest reply */
+ PrintField(RBf, 1, 1, RENDERREPLY,
+ RENDERREPLYHEADER); /* RenderQueryVersion reply */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
+ n = ILong(&buf[4]);
+ f = ILong(&buf[8]);
+ s = ILong(&buf[12]);
+ d = ILong(&buf[16]);
+ v = ILong(&buf[20]);
+ PrintList(&buf[32], (long) f, PICTFORMINFO, "pict-formats");
}
void
-RenderQueryPictIndexValues (FD fd, const unsigned char *buf)
+RenderQueryPictIndexValues(FD fd, const unsigned char *buf)
{
- RenderRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ RenderRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, PICTFORMAT, "format");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, PICTFORMAT, "format");
}
void
-RenderQueryPictIndexValuesReply (FD fd, const unsigned char *buf)
+RenderQueryPictIndexValuesReply(FD fd, const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* RenderRequest reply */ ;
- PrintField(RBf, 1, 1, RENDERREPLY, RENDERREPLYHEADER) /* RenderQueryVersion reply */;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4(0), "reply length");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* RenderRequest reply */
+ PrintField(RBf, 1, 1, RENDERREPLY,
+ RENDERREPLYHEADER); /* RenderQueryVersion reply */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
}
void
-RenderQueryDithers (FD fd, const unsigned char *buf)
+RenderQueryDithers(FD fd, const unsigned char *buf)
{
- RenderRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ RenderRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
void
-RenderQueryDithersReply (FD fd, const unsigned char *buf)
+RenderQueryDithersReply(FD fd, const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* RenderRequest reply */ ;
- PrintField(RBf, 1, 1, RENDERREPLY, RENDERREPLYHEADER) /* RenderQueryVersion reply */;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4(0), "reply length");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* RenderRequest reply */
+ PrintField(RBf, 1, 1, RENDERREPLY,
+ RENDERREPLYHEADER); /* RenderQueryVersion reply */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
}
void
-RenderCreatePicture (FD fd, const unsigned char *buf)
+RenderCreatePicture(FD fd, const unsigned char *buf)
{
- RenderRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ RenderRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, DVALUE2(5+n));
- PrintField(buf, 4, 4, PICTURE, "picture");
- PrintField(buf, 8, 4, DRAWABLE, "drawable");
- PrintField(buf, 12, 4, PICTFORMAT, "format");
- PrintField(buf, 16, 4, PICTURE_BITMASK, "value-mask");
- PrintValues(&buf[16], 4, PICTURE_BITMASK, &buf[20], "value-list");
+ printreqlen(buf, fd, DVALUE2(5 + n));
+ PrintField(buf, 4, 4, PICTURE, "picture");
+ PrintField(buf, 8, 4, DRAWABLE, "drawable");
+ PrintField(buf, 12, 4, PICTFORMAT, "format");
+ PrintField(buf, 16, 4, PICTURE_BITMASK, "value-mask");
+ PrintValues(&buf[16], 4, PICTURE_BITMASK, &buf[20], "value-list");
}
void
-RenderChangePicture (FD fd, const unsigned char *buf)
+RenderChangePicture(FD fd, const unsigned char *buf)
{
- RenderRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ RenderRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, DVALUE2(3+n));
- PrintField(buf, 4, 4, PICTURE, "picture");
- PrintField(buf, 8, 4, PICTURE_BITMASK, "value-mask");
- PrintValues(&buf[8], 4, PICTURE_BITMASK, &buf[12], "value-list");
+ printreqlen(buf, fd, DVALUE2(3 + n));
+ PrintField(buf, 4, 4, PICTURE, "picture");
+ PrintField(buf, 8, 4, PICTURE_BITMASK, "value-mask");
+ PrintValues(&buf[8], 4, PICTURE_BITMASK, &buf[12], "value-list");
}
void
-RenderSetPictureClipRectangles (FD fd, const unsigned char *buf)
+RenderSetPictureClipRectangles(FD fd, const unsigned char *buf)
{
- RenderRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ RenderRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
void
-RenderFreePicture (FD fd, const unsigned char *buf)
+RenderFreePicture(FD fd, const unsigned char *buf)
{
- RenderRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ RenderRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, PICTURE, "picture");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, PICTURE, "picture");
}
void
-RenderComposite (FD fd, const unsigned char *buf)
+RenderComposite(FD fd, const unsigned char *buf)
{
- RenderRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ RenderRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
- PrintField (buf, 4, 1, PICTOP, "op");
- PrintField(buf, 8, 4, PICTURE, "source");
- PrintField(buf, 12, 4, PICTURE, "mask");
- PrintField(buf, 16, 4, PICTURE, "dest");
- PrintField(buf, 20, 2, INT16, "source x");
- PrintField(buf, 22, 2, INT16, "source y");
- PrintField(buf, 24, 2, INT16, "mask x");
- PrintField(buf, 26, 2, INT16, "mask y");
- PrintField(buf, 28, 2, INT16, "dest x");
- PrintField(buf, 30, 2, INT16, "dest y");
- PrintField(buf, 32, 2, CARD16, "width");
- PrintField(buf, 34, 2, CARD16, "height");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 1, PICTOP, "op");
+ PrintField(buf, 8, 4, PICTURE, "source");
+ PrintField(buf, 12, 4, PICTURE, "mask");
+ PrintField(buf, 16, 4, PICTURE, "dest");
+ PrintField(buf, 20, 2, INT16, "source x");
+ PrintField(buf, 22, 2, INT16, "source y");
+ PrintField(buf, 24, 2, INT16, "mask x");
+ PrintField(buf, 26, 2, INT16, "mask y");
+ PrintField(buf, 28, 2, INT16, "dest x");
+ PrintField(buf, 30, 2, INT16, "dest y");
+ PrintField(buf, 32, 2, CARD16, "width");
+ PrintField(buf, 34, 2, CARD16, "height");
}
void
-RenderScale (FD fd, const unsigned char *buf)
+RenderScale(FD fd, const unsigned char *buf)
{
- RenderRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ RenderRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, PICTURE, "source");
- PrintField(buf, 8, 4, PICTURE, "dest");
- PrintField(buf, 12, 4, CARD32, "color scale");
- PrintField(buf, 16, 4, CARD32, "alpha scale");
- PrintField(buf, 20, 2, INT16, "source x");
- PrintField(buf, 22, 2, INT16, "source y");
- PrintField(buf, 24, 2, INT16, "dest x");
- PrintField(buf, 26, 2, INT16, "dest y");
- PrintField(buf, 28, 2, CARD16, "width");
- PrintField(buf, 30, 2, CARD16, "height");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, PICTURE, "source");
+ PrintField(buf, 8, 4, PICTURE, "dest");
+ PrintField(buf, 12, 4, CARD32, "color scale");
+ PrintField(buf, 16, 4, CARD32, "alpha scale");
+ PrintField(buf, 20, 2, INT16, "source x");
+ PrintField(buf, 22, 2, INT16, "source y");
+ PrintField(buf, 24, 2, INT16, "dest x");
+ PrintField(buf, 26, 2, INT16, "dest y");
+ PrintField(buf, 28, 2, CARD16, "width");
+ PrintField(buf, 30, 2, CARD16, "height");
}
void
-RenderTrapezoids (FD fd, const unsigned char *buf)
+RenderTrapezoids(FD fd, const unsigned char *buf)
{
- int n;
- RenderRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ int n;
- printreqlen(buf, fd, CONST2(2));
- PrintField (buf, 4, 1, PICTOP, "op");
- PrintField(buf, 8, 4, PICTURE, "source");
- PrintField(buf, 12, 4, PICTURE, "dest");
- PrintField(buf, 16, 4, PICTFORMAT, "mask format");
- PrintField(buf, 20, 2, INT16, "source x");
- PrintField(buf, 22, 2, INT16, "source y");
- n = (CS[fd].requestLen - 6) / 10;
- PrintList(&buf[24], (long)n, TRAPEZOID, "trapezoids");
+ RenderRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
+
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 1, PICTOP, "op");
+ PrintField(buf, 8, 4, PICTURE, "source");
+ PrintField(buf, 12, 4, PICTURE, "dest");
+ PrintField(buf, 16, 4, PICTFORMAT, "mask format");
+ PrintField(buf, 20, 2, INT16, "source x");
+ PrintField(buf, 22, 2, INT16, "source y");
+
+ n = (CS[fd].requestLen - 6) / 10;
+ PrintList(&buf[24], (long) n, TRAPEZOID, "trapezoids");
}
void
-RenderTriangles (FD fd, const unsigned char *buf)
+RenderTriangles(FD fd, const unsigned char *buf)
{
- long n;
- RenderRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ long n;
+
+ RenderRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
- PrintField (buf, 4, 1, PICTOP, "op");
- PrintField(buf, 8, 4, PICTURE, "source");
- PrintField(buf, 12, 4, PICTURE, "dest");
- PrintField(buf, 16, 4, PICTFORMAT, "mask format");
- PrintField(buf, 20, 2, INT16, "source x");
- PrintField(buf, 22, 2, INT16, "source y");
- n = (CS[fd].requestLen - 6) / 6;
- PrintList(&buf[24], (long)n, TRIANGLE, "triangles");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 1, PICTOP, "op");
+ PrintField(buf, 8, 4, PICTURE, "source");
+ PrintField(buf, 12, 4, PICTURE, "dest");
+ PrintField(buf, 16, 4, PICTFORMAT, "mask format");
+ PrintField(buf, 20, 2, INT16, "source x");
+ PrintField(buf, 22, 2, INT16, "source y");
+
+ n = (CS[fd].requestLen - 6) / 6;
+ PrintList(&buf[24], (long) n, TRIANGLE, "triangles");
}
void
-RenderTriStrip (FD fd, const unsigned char *buf)
+RenderTriStrip(FD fd, const unsigned char *buf)
{
- long n;
- RenderRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ long n;
+
+ RenderRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
+
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 1, PICTOP, "op");
+ PrintField(buf, 8, 4, PICTURE, "source");
+ PrintField(buf, 12, 4, PICTURE, "dest");
+ PrintField(buf, 16, 4, PICTFORMAT, "mask format");
+ PrintField(buf, 20, 2, INT16, "source x");
+ PrintField(buf, 22, 2, INT16, "source y");
- printreqlen(buf, fd, CONST2(2));
- PrintField (buf, 4, 1, PICTOP, "op");
- PrintField(buf, 8, 4, PICTURE, "source");
- PrintField(buf, 12, 4, PICTURE, "dest");
- PrintField(buf, 16, 4, PICTFORMAT, "mask format");
- PrintField(buf, 20, 2, INT16, "source x");
- PrintField(buf, 22, 2, INT16, "source y");
- n = (CS[fd].requestLen - 6) / 2;
- PrintList(&buf[24], n, POINTFIXED, "points");
+ n = (CS[fd].requestLen - 6) / 2;
+ PrintList(&buf[24], n, POINTFIXED, "points");
}
void
-RenderTriFan (FD fd, const unsigned char *buf)
+RenderTriFan(FD fd, const unsigned char *buf)
{
- long n;
- RenderRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ long n;
- printreqlen(buf, fd, CONST2(2));
- PrintField (buf, 4, 1, PICTOP, "op");
- PrintField(buf, 8, 4, PICTURE, "source");
- PrintField(buf, 12, 4, PICTURE, "dest");
- PrintField(buf, 16, 4, PICTFORMAT, "mask format");
- PrintField(buf, 20, 2, INT16, "source x");
- PrintField(buf, 22, 2, INT16, "source y");
- n = (CS[fd].requestLen - 6) / 2;
- PrintList(&buf[24], n, POINTFIXED, "points");
+ RenderRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
+
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 1, PICTOP, "op");
+ PrintField(buf, 8, 4, PICTURE, "source");
+ PrintField(buf, 12, 4, PICTURE, "dest");
+ PrintField(buf, 16, 4, PICTFORMAT, "mask format");
+ PrintField(buf, 20, 2, INT16, "source x");
+ PrintField(buf, 22, 2, INT16, "source y");
+
+ n = (CS[fd].requestLen - 6) / 2;
+ PrintList(&buf[24], n, POINTFIXED, "points");
}
void
-RenderColorTrapezoids (FD fd, const unsigned char *buf)
+RenderColorTrapezoids(FD fd, const unsigned char *buf)
{
- RenderRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ RenderRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
void
-RenderColorTriangles (FD fd, const unsigned char *buf)
+RenderColorTriangles(FD fd, const unsigned char *buf)
{
- RenderRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ RenderRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
void
-RenderTransform (FD fd, const unsigned char *buf)
+RenderTransform(FD fd, const unsigned char *buf)
{
- RenderRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ RenderRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
+ printreqlen(buf, fd, CONST2(2));
}
void
-RenderCreateGlyphSet (FD fd, const unsigned char *buf)
+RenderCreateGlyphSet(FD fd, const unsigned char *buf)
{
- RenderRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ RenderRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, GLYPHSET, "glyphset");
- PrintField(buf, 8, 4, PICTFORMAT, "format");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, GLYPHSET, "glyphset");
+ PrintField(buf, 8, 4, PICTFORMAT, "format");
}
void
-RenderReferenceGlyphSet (FD fd, const unsigned char *buf)
+RenderReferenceGlyphSet(FD fd, const unsigned char *buf)
{
- RenderRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ RenderRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, GLYPHSET, "glyphset");
- PrintField(buf, 4, 4, GLYPHSET, "existing");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, GLYPHSET, "glyphset");
+ PrintField(buf, 4, 4, GLYPHSET, "existing");
}
void
-RenderFreeGlyphSet (FD fd, const unsigned char *buf)
+RenderFreeGlyphSet(FD fd, const unsigned char *buf)
{
- RenderRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ RenderRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, GLYPHSET, "glyphset");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, GLYPHSET, "glyphset");
}
static void
PrintGlyphs(const unsigned char *buf, int n, const char *name)
{
- const unsigned char *gids;
- const unsigned char *glyphs;
- int i;
-
- fprintf(stdout, "%s%20s:\n", Leader, name);
- gids = buf;
- glyphs = gids + 4 * n;
- for (i = 0; i < n; i++)
- {
- PrintField(gids, 0, 4, CARD32, "glyphid");
- PrintField(glyphs, 0, 2, CARD16, "width");
- PrintField(glyphs, 2, 2, CARD16, "height");
- PrintField(glyphs, 4, 2, INT16, "x");
- PrintField(glyphs, 6, 2, INT16, "y");
- PrintField(glyphs, 8, 2, INT16, "xOff");
- PrintField(glyphs, 10, 2, INT16, "yOff");
- glyphs += 12;
- }
+ const unsigned char *gids;
+ const unsigned char *glyphs;
+ int i;
+
+ fprintf(stdout, "%s%20s:\n", Leader, name);
+ gids = buf;
+ glyphs = gids + 4 * n;
+ for (i = 0; i < n; i++) {
+ PrintField(gids, 0, 4, CARD32, "glyphid");
+ PrintField(glyphs, 0, 2, CARD16, "width");
+ PrintField(glyphs, 2, 2, CARD16, "height");
+ PrintField(glyphs, 4, 2, INT16, "x");
+ PrintField(glyphs, 6, 2, INT16, "y");
+ PrintField(glyphs, 8, 2, INT16, "xOff");
+ PrintField(glyphs, 10, 2, INT16, "yOff");
+
+ glyphs += 12;
+ }
}
void
-RenderAddGlyphs (FD fd, const unsigned char *buf)
+RenderAddGlyphs(FD fd, const unsigned char *buf)
{
- RenderRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ RenderRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, GLYPHSET, "glyphset");
- PrintField(buf, 8, 4, CARD32, "nglyphs");
- PrintGlyphs(&buf[12], ILong(&buf[8]), "glyphs");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, GLYPHSET, "glyphset");
+ PrintField(buf, 8, 4, CARD32, "nglyphs");
+ PrintGlyphs(&buf[12], ILong(&buf[8]), "glyphs");
}
void
-RenderAddGlyphsFromPicture (FD fd, const unsigned char *buf)
+RenderAddGlyphsFromPicture(FD fd, const unsigned char *buf)
{
- RenderRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ RenderRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, GLYPHSET, "glyphset");
- /* Todo: print list of glyphs */
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, GLYPHSET, "glyphset");
+ /* Todo: print list of glyphs */
}
void
-RenderFreeGlyphs (FD fd, const unsigned char *buf)
+RenderFreeGlyphs(FD fd, const unsigned char *buf)
{
- unsigned short n;
- RenderRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ unsigned short n;
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, GLYPHSET, "glyphset");
- n = (IShort(&buf[2]) - 2);
- (void)PrintList(&buf[8], (long)n, CARD32, "glyphs");
+ RenderRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
+
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, GLYPHSET, "glyphset");
+ n = (IShort(&buf[2]) - 2);
+ (void) PrintList(&buf[8], (long) n, CARD32, "glyphs");
}
static void
PrintGlyphList(const unsigned char *buf, int length, const char *name, int size)
{
- short n;
-
- fprintf(stdout, "%s%20s:\n", Leader, name);
- while (length >= 8)
- {
- n = IByte(&buf[0]);
- if (n != 255)
- {
- printfield(buf, 0, 1, CARD8, "length");
- PrintField(buf, 4, 2, INT16, "delta x");
- PrintField(buf, 6, 2, INT16, "delta y");
- switch (size) {
- case 1:
- PrintTString8(&buf[8], (long) n, "glyph item 8 string"); break;
- case 2:
- PrintTString16(&buf[8], (long) n, "glyph item 16 string"); break;
- case 4:
- break;
- }
- n = ((n * size + 8) + 3) & ~3;
- buf += n;
- length -= n;
- }
- else
- {
- PrintField(buf, 8, 4, GLYPHSET, "glyphset");
- buf += 12;
- length -= 12;
+ short n;
+
+ fprintf(stdout, "%s%20s:\n", Leader, name);
+ while (length >= 8) {
+ n = IByte(&buf[0]);
+ if (n != 255) {
+ printfield(buf, 0, 1, CARD8, "length");
+ PrintField(buf, 4, 2, INT16, "delta x");
+ PrintField(buf, 6, 2, INT16, "delta y");
+
+ switch (size) {
+ case 1:
+ PrintTString8(&buf[8], (long) n, "glyph item 8 string");
+ break;
+ case 2:
+ PrintTString16(&buf[8], (long) n, "glyph item 16 string");
+ break;
+ case 4:
+ break;
+ }
+ n = ((n * size + 8) + 3) & ~3;
+ buf += n;
+ length -= n;
+ }
+ else {
+ PrintField(buf, 8, 4, GLYPHSET, "glyphset");
+ buf += 12;
+ length -= 12;
+ }
}
- }
}
-
+
void
-RenderCompositeGlyphs8 (FD fd, const unsigned char *buf)
+RenderCompositeGlyphs8(FD fd, const unsigned char *buf)
{
- int n;
-
- RenderRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ int n;
+
+ RenderRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
- n = (CS[fd].requestLen - 7) * 4;
- PrintField(buf, 4, 1, PICTOP, "op");
- PrintField(buf, 8, 4, PICTURE, "source");
- PrintField(buf, 12, 4, PICTURE, "dest");
- PrintField(buf, 16, 4, PICTFORMAT, "mask format");
- PrintField(buf, 20, 4, GLYPHSET, "glyphset");
- PrintField(buf, 24, 2, INT16, "x-src");
- PrintField(buf, 26, 2, INT16, "y-src");
- PrintGlyphList(&buf[28], n, "items", 1);
+ printreqlen(buf, fd, CONST2(2));
+ n = (CS[fd].requestLen - 7) * 4;
+ PrintField(buf, 4, 1, PICTOP, "op");
+ PrintField(buf, 8, 4, PICTURE, "source");
+ PrintField(buf, 12, 4, PICTURE, "dest");
+ PrintField(buf, 16, 4, PICTFORMAT, "mask format");
+ PrintField(buf, 20, 4, GLYPHSET, "glyphset");
+ PrintField(buf, 24, 2, INT16, "x-src");
+ PrintField(buf, 26, 2, INT16, "y-src");
+ PrintGlyphList(&buf[28], n, "items", 1);
}
void
-RenderCompositeGlyphs16 (FD fd, const unsigned char *buf)
+RenderCompositeGlyphs16(FD fd, const unsigned char *buf)
{
- int n;
-
- RenderRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ int n;
+
+ RenderRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
- n = (CS[fd].requestLen - 7) * 4;
-
- PrintField(buf, 4, 1, PICTOP, "op");
- PrintField(buf, 8, 4, PICTURE, "source");
- PrintField(buf, 12, 4, PICTURE, "dest");
- PrintField(buf, 16, 4, PICTFORMAT, "mask format");
- PrintField(buf, 20, 4, GLYPHSET, "glyphset");
- PrintField(buf, 24, 2, INT16, "x-src");
- PrintField(buf, 26, 2, INT16, "y-src");
- PrintGlyphList(&buf[28], n, "items", 2);
+ printreqlen(buf, fd, CONST2(2));
+ n = (CS[fd].requestLen - 7) * 4;
+
+ PrintField(buf, 4, 1, PICTOP, "op");
+ PrintField(buf, 8, 4, PICTURE, "source");
+ PrintField(buf, 12, 4, PICTURE, "dest");
+ PrintField(buf, 16, 4, PICTFORMAT, "mask format");
+ PrintField(buf, 20, 4, GLYPHSET, "glyphset");
+ PrintField(buf, 24, 2, INT16, "x-src");
+ PrintField(buf, 26, 2, INT16, "y-src");
+ PrintGlyphList(&buf[28], n, "items", 2);
}
void
-RenderCompositeGlyphs32 (FD fd, const unsigned char *buf)
+RenderCompositeGlyphs32(FD fd, const unsigned char *buf)
{
- int n;
-
- RenderRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ int n;
+
+ RenderRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
- n = (CS[fd].requestLen - 7) * 4;
- PrintField(buf, 4, 1, PICTOP, "op");
- PrintField(buf, 8, 4, PICTURE, "source");
- PrintField(buf, 12, 4, PICTURE, "dest");
- PrintField(buf, 16, 4, PICTFORMAT, "mask format");
- PrintField(buf, 20, 4, GLYPHSET, "glyphset");
- PrintField(buf, 24, 2, INT16, "x-src");
- PrintField(buf, 26, 2, INT16, "y-src");
- PrintGlyphList(&buf[28], n, "items", 4);
+ printreqlen(buf, fd, CONST2(2));
+ n = (CS[fd].requestLen - 7) * 4;
+ PrintField(buf, 4, 1, PICTOP, "op");
+ PrintField(buf, 8, 4, PICTURE, "source");
+ PrintField(buf, 12, 4, PICTURE, "dest");
+ PrintField(buf, 16, 4, PICTFORMAT, "mask format");
+ PrintField(buf, 20, 4, GLYPHSET, "glyphset");
+ PrintField(buf, 24, 2, INT16, "x-src");
+ PrintField(buf, 26, 2, INT16, "y-src");
+ PrintGlyphList(&buf[28], n, "items", 4);
}
void
-RenderFillRectangles (FD fd, const unsigned char *buf)
+RenderFillRectangles(FD fd, const unsigned char *buf)
{
- int n;
- RenderRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ int n;
+
+ RenderRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
- n = (CS[fd].requestLen - 5) / 2;
- PrintField(buf, 4, 1, PICTOP, "op");
- PrintField(buf, 8, 4, PICTURE, "dest");
- PrintField(buf, 12, 8, RENDERCOLOR, "color");
- (void)PrintList(&buf[20], (long)n, RECTANGLE, "rectangles");
+ printreqlen(buf, fd, CONST2(2));
+ n = (CS[fd].requestLen - 5) / 2;
+ PrintField(buf, 4, 1, PICTOP, "op");
+ PrintField(buf, 8, 4, PICTURE, "dest");
+ PrintField(buf, 12, 8, RENDERCOLOR, "color");
+ (void) PrintList(&buf[20], (long) n, RECTANGLE, "rectangles");
}
void
-RenderCreateCursor (FD fd, const unsigned char *buf)
+RenderCreateCursor(FD fd, const unsigned char *buf)
{
- RenderRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ RenderRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, CURSOR, "cursor-id");
- PrintField(buf, 8, 4, PICTURE, "source");
- PrintField(buf, 12, 2, CARD16, "x");
- PrintField(buf, 14, 2, CARD16, "y");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, CURSOR, "cursor-id");
+ PrintField(buf, 8, 4, PICTURE, "source");
+ PrintField(buf, 12, 2, CARD16, "x");
+ PrintField(buf, 14, 2, CARD16, "y");
}
void
-RenderSetPictureTransform (FD fd, const unsigned char *buf)
+RenderSetPictureTransform(FD fd, const unsigned char *buf)
{
- RenderRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ RenderRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, PICTURE, "picture");
- PrintField(buf, 8, 9 * 8, RENDERTRANSFORM, "transform");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, PICTURE, "picture");
+ PrintField(buf, 8, 9 * 8, RENDERTRANSFORM, "transform");
}
void
-RenderQueryFilters (FD fd, const unsigned char *buf)
+RenderQueryFilters(FD fd, const unsigned char *buf)
{
- RenderRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ RenderRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, DRAWABLE, "drawable");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, DRAWABLE, "drawable");
}
void
-RenderQueryFiltersReply (FD fd, const unsigned char *buf)
+RenderQueryFiltersReply(FD fd, const unsigned char *buf)
{
- long a;
- long f;
+ long a;
+ long f;
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* RenderRequest reply */ ;
- PrintField(RBf, 1, 1, RENDERREPLY, RENDERREPLYHEADER) /* RenderQueryFilters reply */;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4(0), "reply length");
- a = ILong (&buf[8]);
- f = ILong (&buf[12]);
- PrintList (&buf[32], a, FILTERALIAS, "aliases");
- PrintListSTR (&buf[32 + (2 * a)], f, "filters");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* RenderRequest reply */
+ PrintField(RBf, 1, 1, RENDERREPLY,
+ RENDERREPLYHEADER); /* RenderQueryFilters reply */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
+ a = ILong(&buf[8]);
+ f = ILong(&buf[12]);
+ PrintList(&buf[32], a, FILTERALIAS, "aliases");
+ PrintListSTR(&buf[32 + (2 * a)], f, "filters");
}
-
void
-RenderSetPictureFilter (FD fd, const unsigned char *buf)
+RenderSetPictureFilter(FD fd, const unsigned char *buf)
{
- int n;
- RenderRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ int n;
+
+ RenderRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, PICTURE, "picture");
- n = IShort(&buf[8]);
- PrintString8(&buf[12], n, "filter");
- /* Todo: print list of optional values */
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, PICTURE, "picture");
+ n = IShort(&buf[8]);
+ PrintString8(&buf[12], n, "filter");
+ /* Todo: print list of optional values */
}
void
-RenderCreateAnimCursor (FD fd, const unsigned char *buf)
+RenderCreateAnimCursor(FD fd, const unsigned char *buf)
{
- RenderRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ RenderRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, CURSOR, "cursor-id");
- /* Todo: print list of cursor animation elements */
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, CURSOR, "cursor-id");
+ /* Todo: print list of cursor animation elements */
}
void
-RenderAddTraps (FD fd, const unsigned char *buf)
+RenderAddTraps(FD fd, const unsigned char *buf)
{
- int n;
- RenderRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ int n;
+
+ RenderRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, PICTURE, "picture");
- PrintField(buf, 8, 2, CARD16, "xOff");
- PrintField(buf, 10, 2, CARD16, "yOff");
- n = (CS[fd].requestLen - 3) / 10;
- PrintList(&buf[24], (long)n, TRAPEZOID, "trapezoids");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, PICTURE, "picture");
+ PrintField(buf, 8, 2, CARD16, "xOff");
+ PrintField(buf, 10, 2, CARD16, "yOff");
+
+ n = (CS[fd].requestLen - 3) / 10;
+ PrintList(&buf[24], (long) n, TRAPEZOID, "trapezoids");
}
void
-RenderCreateSolidFill (FD fd, const unsigned char *buf)
+RenderCreateSolidFill(FD fd, const unsigned char *buf)
{
- RenderRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ RenderRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, PICTURE, "picture");
- PrintField(buf, 8, 8, RENDERCOLOR, "color");
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, PICTURE, "picture");
+ PrintField(buf, 8, 8, RENDERCOLOR, "color");
}
void
-RenderCreateLinearGradient (FD fd, const unsigned char *buf)
+RenderCreateLinearGradient(FD fd, const unsigned char *buf)
{
- RenderRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ RenderRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, PICTURE, "picture");
- PrintField(buf, 8, 8, POINTFIXED, "p1");
- PrintField(buf, 16, 8, POINTFIXED, "p2");
- PrintField(buf, 24, 4, CARD32, "num stops");
- /* Todo: print list of stops & colors for each */
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, PICTURE, "picture");
+ PrintField(buf, 8, 8, POINTFIXED, "p1");
+ PrintField(buf, 16, 8, POINTFIXED, "p2");
+ PrintField(buf, 24, 4, CARD32, "num stops");
+ /* Todo: print list of stops & colors for each */
}
void
-RenderCreateRadialGradient (FD fd, const unsigned char *buf)
+RenderCreateRadialGradient(FD fd, const unsigned char *buf)
{
- RenderRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ RenderRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, PICTURE, "picture");
- PrintField(buf, 8, 8, POINTFIXED, "inner");
- PrintField(buf, 16, 8, POINTFIXED, "outer");
- PrintField(buf, 24, 4, FIXED, "inner_radius");
- PrintField(buf, 28, 4, FIXED, "outer_radius");
- PrintField(buf, 32, 4, CARD32, "num stops");
- /* Todo: print list of stops & colors for each */
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, PICTURE, "picture");
+ PrintField(buf, 8, 8, POINTFIXED, "inner");
+ PrintField(buf, 16, 8, POINTFIXED, "outer");
+ PrintField(buf, 24, 4, FIXED, "inner_radius");
+ PrintField(buf, 28, 4, FIXED, "outer_radius");
+ PrintField(buf, 32, 4, CARD32, "num stops");
+ /* Todo: print list of stops & colors for each */
}
void
-RenderCreateConicalGradient (FD fd, const unsigned char *buf)
+RenderCreateConicalGradient(FD fd, const unsigned char *buf)
{
- RenderRequestHeader (fd, buf);
- if (Verbose < 1)
- return;
+ RenderRequestHeader(fd, buf);
+ if (Verbose < 1)
+ return;
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, PICTURE, "picture");
- PrintField(buf, 8, 8, POINTFIXED, "center");
- PrintField(buf, 16, 4, FIXED, "angle");
- PrintField(buf, 20, 4, CARD32, "num stops");
- /* Todo: print list of stops & colors for each */
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, PICTURE, "picture");
+ PrintField(buf, 8, 8, POINTFIXED, "center");
+ PrintField(buf, 16, 4, FIXED, "angle");
+ PrintField(buf, 20, 4, CARD32, "num stops");
+ /* Todo: print list of stops & colors for each */
}
-
void
-RenderPictFormatError (FD fd, const unsigned char *buf)
+RenderPictFormatError(FD fd, const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Request */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, PICTFORMAT, "format");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Request */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, PICTFORMAT, "format");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
void
-RenderPictureError (FD fd, const unsigned char *buf)
+RenderPictureError(FD fd, const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Request */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, PICTURE, "picture");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Request */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, PICTURE, "picture");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
void
-RenderPictOpError (FD fd, const unsigned char *buf)
+RenderPictOpError(FD fd, const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Request */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, PICTOP, "pictop");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Request */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, PICTOP, "pictop");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
void
-RenderGlyphSetError (FD fd, const unsigned char *buf)
+RenderGlyphSetError(FD fd, const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Request */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, GLYPHSET, "glyphset");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Request */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, GLYPHSET, "glyphset");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
void
-RenderGlyphError (FD fd, const unsigned char *buf)
+RenderGlyphError(FD fd, const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Request */ ;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, CARD32, "glyph");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Request */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, CARD32, "glyph");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
diff --git a/print_shm.c b/print_shm.c
index 9d8a15e..4d1fbde 100644
--- a/print_shm.c
+++ b/print_shm.c
@@ -26,148 +26,154 @@
#include "shmscope.h"
void
-MitshmQueryVersion (FD fd, const unsigned char *buf)
+MitshmQueryVersion(FD fd, const unsigned char *buf)
{
- PrintField (buf, 0, 1, REQUEST, REQUESTHEADER) /* MitshmRequest */ ;
- PrintField (buf, 1, 1, MITSHMREQUEST, MITSHMREQUESTHEADER) /* MitshmSwitch */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* MitshmRequest */
+ PrintField(buf, 1, 1, MITSHMREQUEST,
+ MITSHMREQUESTHEADER); /* MitshmSwitch */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(2));
}
void
-MitshmQueryVersionReply (FD fd, const unsigned char *buf)
+MitshmQueryVersionReply(FD fd, const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* MitshmRequest reply */ ;
- if (Verbose < 1)
- return;
- PrintField(RBf, 1, 1, BOOL, "shared-pixmaps") /* shared Pixmaps */;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4(0), "reply length");
- PrintField(buf, 8, 2, CARD16, "major-version");
- PrintField(buf, 10, 2, CARD16, "minor-version");
- PrintField(buf, 12, 2, CARD16, "uid");
- PrintField(buf, 14, 2, CARD16, "gid");
- PrintField(buf, 16, 1, CARD8, "pixmap-format");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* MitshmRequest reply */
+ if (Verbose < 1)
+ return;
+ PrintField(RBf, 1, 1, BOOL, "shared-pixmaps"); /* shared Pixmaps */
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
+ PrintField(buf, 8, 2, CARD16, "major-version");
+ PrintField(buf, 10, 2, CARD16, "minor-version");
+ PrintField(buf, 12, 2, CARD16, "uid");
+ PrintField(buf, 14, 2, CARD16, "gid");
+ PrintField(buf, 16, 1, CARD8, "pixmap-format");
}
void
-MitshmAttach (FD fd, const unsigned char *buf)
+MitshmAttach(FD fd, const unsigned char *buf)
{
- PrintField (buf, 0, 1, REQUEST, REQUESTHEADER) /* MitshmRequest */ ;
- PrintField (buf, 1, 1, MITSHMREQUEST, MITSHMREQUESTHEADER) /* MitshmSwitch */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, CARD32, "shmseg");
- PrintField(buf, 8, 4, CARD32, "shmid");
- PrintField(buf, 12, 1, BOOL, "read-only");
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* MitshmRequest */
+ PrintField(buf, 1, 1, MITSHMREQUEST,
+ MITSHMREQUESTHEADER); /* MitshmSwitch */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, CARD32, "shmseg");
+ PrintField(buf, 8, 4, CARD32, "shmid");
+ PrintField(buf, 12, 1, BOOL, "read-only");
}
void
-MitshmDetach (FD fd, const unsigned char *buf)
+MitshmDetach(FD fd, const unsigned char *buf)
{
- PrintField (buf, 0, 1, REQUEST, REQUESTHEADER) /* MitshmRequest */ ;
- PrintField (buf, 1, 1, MITSHMREQUEST, MITSHMREQUESTHEADER) /* MitshmSwitch */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, CONST2(2));
- PrintField (buf, 4, 4, CARD32, "shmseg");
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* MitshmRequest */
+ PrintField(buf, 1, 1, MITSHMREQUEST,
+ MITSHMREQUESTHEADER); /* MitshmSwitch */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, CARD32, "shmseg");
}
void
-MitshmPutImage (FD fd, const unsigned char *buf)
+MitshmPutImage(FD fd, const unsigned char *buf)
{
- PrintField (buf, 0, 1, REQUEST, REQUESTHEADER) /* MitshmRequest */ ;
- PrintField (buf, 1, 1, MITSHMREQUEST, MITSHMREQUESTHEADER) /* MitshmSwitch */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, CONST2(2));
- PrintField (buf, 4, 4, DRAWABLE, "drawable");
- PrintField (buf, 8, 4, GCONTEXT, "gc");
- PrintField (buf, 12, 2, CARD16, "total-width");
- PrintField (buf, 14, 2, CARD16, "total-height");
- PrintField (buf, 16, 2, CARD16, "src-x");
- PrintField (buf, 18, 2, CARD16, "src-y");
- PrintField (buf, 20, 2, CARD16, "src-width");
- PrintField (buf, 22, 2, CARD16, "src-height");
- PrintField (buf, 24, 2, INT16, "dst-x");
- PrintField (buf, 26, 2, INT16, "dst-y");
- PrintField (buf, 28, 1, CARD8, "depth");
- PrintField (buf, 29, 1, CARD8, "format");
- PrintField (buf, 30, 1, BOOL, "send-event");
- PrintField (buf, 31, 1, CARD8, "bpad");
- PrintField (buf, 32, 4, CARD32, "shmseg");
- PrintField (buf, 36, 4, CARD32, "offset");
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* MitshmRequest */
+ PrintField(buf, 1, 1, MITSHMREQUEST,
+ MITSHMREQUESTHEADER); /* MitshmSwitch */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, DRAWABLE, "drawable");
+ PrintField(buf, 8, 4, GCONTEXT, "gc");
+ PrintField(buf, 12, 2, CARD16, "total-width");
+ PrintField(buf, 14, 2, CARD16, "total-height");
+ PrintField(buf, 16, 2, CARD16, "src-x");
+ PrintField(buf, 18, 2, CARD16, "src-y");
+ PrintField(buf, 20, 2, CARD16, "src-width");
+ PrintField(buf, 22, 2, CARD16, "src-height");
+ PrintField(buf, 24, 2, INT16, "dst-x");
+ PrintField(buf, 26, 2, INT16, "dst-y");
+ PrintField(buf, 28, 1, CARD8, "depth");
+ PrintField(buf, 29, 1, CARD8, "format");
+ PrintField(buf, 30, 1, BOOL, "send-event");
+ PrintField(buf, 31, 1, CARD8, "bpad");
+ PrintField(buf, 32, 4, CARD32, "shmseg");
+ PrintField(buf, 36, 4, CARD32, "offset");
}
void
-MitshmGetImage (FD fd, const unsigned char *buf)
+MitshmGetImage(FD fd, const unsigned char *buf)
{
- PrintField (buf, 0, 1, REQUEST, REQUESTHEADER) /* MitshmRequest */ ;
- PrintField (buf, 1, 1, MITSHMREQUEST, MITSHMREQUESTHEADER) /* MitshmSwitch */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, DVALUE2(5+n));
- PrintField (buf, 4, 4, DRAWABLE, "drawable");
- PrintField (buf, 8, 2, INT16, "x");
- PrintField (buf, 10, 2, INT16, "y");
- PrintField (buf, 12, 2, CARD16, "width");
- PrintField (buf, 14, 2, CARD16, "height");
- PrintField (buf, 16, 4, CARD32, "planemask");
- PrintField (buf, 20, 1, CARD8, "format");
- PrintField (buf, 24, 4, CARD32, "shmseg");
- PrintField (buf, 28, 4, CARD32, "offset");
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* MitshmRequest */
+ PrintField(buf, 1, 1, MITSHMREQUEST,
+ MITSHMREQUESTHEADER); /* MitshmSwitch */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, DVALUE2(5 + n));
+ PrintField(buf, 4, 4, DRAWABLE, "drawable");
+ PrintField(buf, 8, 2, INT16, "x");
+ PrintField(buf, 10, 2, INT16, "y");
+ PrintField(buf, 12, 2, CARD16, "width");
+ PrintField(buf, 14, 2, CARD16, "height");
+ PrintField(buf, 16, 4, CARD32, "planemask");
+ PrintField(buf, 20, 1, CARD8, "format");
+ PrintField(buf, 24, 4, CARD32, "shmseg");
+ PrintField(buf, 28, 4, CARD32, "offset");
}
void
-MitshmGetImageReply (FD fd, const unsigned char *buf)
+MitshmGetImageReply(FD fd, const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* MitshmRequest reply */ ;
- if (Verbose < 1)
- return;
- PrintField(RBf, 1, 1, CARD8, "depth") /* shared Pixmaps */;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4(0), "reply length");
- PrintField(buf, 8, 4, VISUALID, "visual");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* MitshmRequest reply */
+ if (Verbose < 1)
+ return;
+ PrintField(RBf, 1, 1, CARD8, "depth"); /* shared Pixmaps */
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
+ PrintField(buf, 8, 4, VISUALID, "visual");
}
void
-MitshmCreatePixmap (FD fd, const unsigned char *buf)
+MitshmCreatePixmap(FD fd, const unsigned char *buf)
{
- PrintField (buf, 0, 1, REQUEST, REQUESTHEADER) /* MitshmRequest */ ;
- PrintField (buf, 1, 1, MITSHMREQUEST, MITSHMREQUESTHEADER) /* MitshmSwitch */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, DVALUE2(3+n));
- PrintField(buf, 4, 4, PIXMAP, "pid");
- PrintField(buf, 8, 4, DRAWABLE, "drawable");
- PrintField(buf, 12, 2, CARD16, "width");
- PrintField(buf, 14, 2, CARD16, "height");
- PrintField(buf, 16, 1, CARD8, "depth");
- PrintField(buf, 20, 4, CARD32, "shmseg");
- PrintField(buf, 24, 4, CARD32, "offset");
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* MitshmRequest */
+ PrintField(buf, 1, 1, MITSHMREQUEST,
+ MITSHMREQUESTHEADER); /* MitshmSwitch */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, DVALUE2(3 + n));
+ PrintField(buf, 4, 4, PIXMAP, "pid");
+ PrintField(buf, 8, 4, DRAWABLE, "drawable");
+ PrintField(buf, 12, 2, CARD16, "width");
+ PrintField(buf, 14, 2, CARD16, "height");
+ PrintField(buf, 16, 1, CARD8, "depth");
+ PrintField(buf, 20, 4, CARD32, "shmseg");
+ PrintField(buf, 24, 4, CARD32, "offset");
}
void
-MitshmShmSegError (FD fd, const unsigned char *buf)
+MitshmShmSegError(FD fd, const unsigned char *buf)
{
}
diff --git a/print_wcp.c b/print_wcp.c
index 3011857..f8b5506 100644
--- a/print_wcp.c
+++ b/print_wcp.c
@@ -15,7 +15,7 @@
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NCD.
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Author: Keith Packard, Network Computing Devices
@@ -26,102 +26,86 @@
#include "wcpscope.h"
void
-WcpQueryVersion (
- FD fd,
- register const unsigned char *buf)
+WcpQueryVersion(FD fd, register const unsigned char *buf)
{
- PrintField (buf, 0, 1, REQUEST, REQUESTHEADER) /* WcpRequest */ ;
- PrintField (buf, 1, 1, WCPREQUEST, WCPREQUESTHEADER) /* WcpSwitch */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* WcpRequest */
+ PrintField(buf, 1, 1, WCPREQUEST, WCPREQUESTHEADER); /* WcpSwitch */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(2));
}
void
-WcpQueryVersionReply (
- FD fd,
- const unsigned char *buf)
+WcpQueryVersionReply(FD fd, const unsigned char *buf)
{
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* WcpRequest reply */ ;
- PrintField(RBf, 1, 1, WCPREPLY, WCPREPLYHEADER) /* WcpQueryVersion reply */;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4(0), "reply length");
- PrintField(buf, 8, 2, CARD16, "major-version");
- PrintField(buf, 10, 2, CARD16, "minor-version");
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* WcpRequest reply */
+ PrintField(RBf, 1, 1, WCPREPLY,
+ WCPREPLYHEADER); /* WcpQueryVersion reply */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(0), "reply length");
+ PrintField(buf, 8, 2, CARD16, "major-version");
+ PrintField(buf, 10, 2, CARD16, "minor-version");
}
-
+
#define NextByte(dst) if (!len--) { error = "Out of data"; break; } dst = *data++;
static void
-WcpAnalyzeImage1RLL (
- const char *buf,
- int len,
- int width,
- int height)
+WcpAnalyzeImage1RLL(const char *buf, int len, int width, int height)
{
- unsigned char byte;
- unsigned char *data = (unsigned char *) buf;
- int x, y;
- const char *error = NULL;
- int bytewidth;
- int i;
- int w;
-
+ unsigned char byte;
+ unsigned char *data = (unsigned char *) buf;
+ int x, y;
+ const char *error = NULL;
+ int bytewidth;
+ int i;
+ int w;
+
y = 0;
- bytewidth = (width + 7) >> 3;
- while (!error && height--)
- {
- x = 0;
- if (Verbose > 2)
- fprintf (stdout, "%s %9d %9d:", Leader, y, (char *) data - buf);
- NextByte (byte);
- if (Verbose > 2)
- fprintf (stdout, " %2x", byte);
- switch (byte) {
- case 0xff:
- for (i = 0; i < bytewidth; i++)
- {
- NextByte(byte);
- }
- break;
- default:
- w = width;
- while (w)
- {
- NextByte(byte);
- if (Verbose > 2)
- fprintf (stdout, " %3d", byte);
- if (byte > w)
- {
- error = "bad run";
- break;
- }
- x += byte;
- w -= byte;
- }
- break;
- }
- if (Verbose > 2)
- fprintf (stdout, "\n");
- y++;
+ bytewidth = (width + 7) >> 3;
+ while (!error && height--) {
+ x = 0;
+ if (Verbose > 2)
+ fprintf(stdout, "%s %9d %9d:", Leader, y, (char *) data - buf);
+ NextByte(byte);
+ if (Verbose > 2)
+ fprintf(stdout, " %2x", byte);
+ switch (byte) {
+ case 0xff:
+ for (i = 0; i < bytewidth; i++) {
+ NextByte(byte);
+ }
+ break;
+ default:
+ w = width;
+ while (w) {
+ NextByte(byte);
+ if (Verbose > 2)
+ fprintf(stdout, " %3d", byte);
+ if (byte > w) {
+ error = "bad run";
+ break;
+ }
+ x += byte;
+ w -= byte;
+ }
+ break;
+ }
+ if (Verbose > 2)
+ fprintf(stdout, "\n");
+ y++;
}
if (error)
- fprintf (stdout, "%s%20s: %d, %d %d\n", Leader, error,
- x, y - 1, (char *) data - buf);
+ fprintf(stdout, "%s%20s: %d, %d %d\n", Leader, error,
+ x, y - 1, (char *) data - buf);
}
static void
-WcpAnalyzeImageNRLL (
- const char *buf,
- int len,
- int width,
- int height,
- int bytes)
+WcpAnalyzeImageNRLL(const char *buf, int len, int width, int height, int bytes)
{
}
@@ -132,331 +116,292 @@ WcpAnalyzeImageNRLL (
#define LRU_CACHE 0xf
#define LRU_MISS 0xf
-typedef unsigned long PIXEL;
+typedef unsigned long PIXEL;
static void
-init_cache (
- PIXEL cache[LRU_CACHE],
- int BPP)
+init_cache(PIXEL cache[LRU_CACHE], int BPP)
{
- int e;
-
+ int e;
+
/*
* initialize cache values
*/
- for (e = 0; e < 8; e++)
- {
- cache[e] = e;
- cache[LRU_CACHE-e-1] = ((1 << BPP) - 1) - e;
+ for (e = 0; e < 8; e++) {
+ cache[e] = e;
+ cache[LRU_CACHE - e - 1] = ((1 << BPP) - 1) - e;
}
}
static void
-push (
- PIXEL cache[LRU_CACHE],
- PIXEL pixel)
+push(PIXEL cache[LRU_CACHE], PIXEL pixel)
{
- int e;
+ int e;
e = LRU_CACHE - 1;
while (--e >= 0)
- cache[e+1] = cache[e];
+ cache[e + 1] = cache[e];
cache[0] = pixel;
}
static PIXEL
-use (
- PIXEL cache[LRU_CACHE],
- int e)
+use(PIXEL cache[LRU_CACHE], int e)
{
- PIXEL tmp;
+ PIXEL tmp;
tmp = cache[e];
- if (e)
- {
- while (--e >= 0)
- cache[e+1] = cache[e];
- cache[0] = tmp;
+ if (e) {
+ while (--e >= 0)
+ cache[e + 1] = cache[e];
+ cache[0] = tmp;
}
return tmp;
}
static void
-WcpAnalyzeImageNLRU (
- const char *buf,
- int len,
- int width,
- int height,
- int bytes)
+WcpAnalyzeImageNLRU(const char *buf, int len, int width, int height, int bytes)
{
- unsigned char *data = (unsigned char *) buf;
- unsigned char byte;
- int x, y;
- int w;
- int i;
- int bytewidth;
- int cache;
- unsigned long run;
- PIXEL lru[LRU_CACHE];
- PIXEL pix;
- const char *error = NULL;
+ unsigned char *data = (unsigned char *) buf;
+ unsigned char byte;
+ int x, y;
+ int w;
+ int i;
+ int bytewidth;
+ int cache;
+ unsigned long run;
+ PIXEL lru[LRU_CACHE];
+ PIXEL pix;
+ const char *error = NULL;
y = 0;
bytewidth = width * bytes;
- while (!error && height--)
- {
- x = 0;
- if (Verbose > 2)
- fprintf (stdout, "%s %9d %9d:", Leader, y, (char *) data - buf);
- NextByte (byte);
- if (Verbose > 2)
- fprintf (stdout, " %2x", byte);
- switch (byte) {
- case 0xff:
- for (i = 0; i < bytewidth; i++)
- {
- NextByte (byte);
- }
- break;
- default:
- init_cache (lru, bytes * 8);
- w = width;
- while (w)
- {
- NextByte (byte);
- run = byte >> 4;
- cache = byte & 0xf;
- if (run == LRU_LONG)
- {
- NextByte (byte);
- run = (int) byte + MAX_LRU_SHORT;
- }
- run++;
- if (cache == LRU_MISS)
- {
- pix = 0;
- for (i = 0; i < bytes; i++)
- {
- pix = pix << 8;
- NextByte (byte);
- pix |= byte;
- }
- push (lru, pix);
- }
- else
- {
- pix = use (lru, cache);
- }
- w -= run;
- if (w < 0)
- {
- error = "bad run";
- break;
- }
- x += run;
- fprintf (stdout, " %3ld:%0*x", run, bytes * 2, pix);
- }
- break;
- }
- if (Verbose > 2)
- fprintf (stdout, "\n");
- y++;
+ while (!error && height--) {
+ x = 0;
+ if (Verbose > 2)
+ fprintf(stdout, "%s %9d %9d:", Leader, y, (char *) data - buf);
+ NextByte(byte);
+ if (Verbose > 2)
+ fprintf(stdout, " %2x", byte);
+ switch (byte) {
+ case 0xff:
+ for (i = 0; i < bytewidth; i++) {
+ NextByte(byte);
+ }
+ break;
+ default:
+ init_cache(lru, bytes * 8);
+ w = width;
+ while (w) {
+ NextByte(byte);
+ run = byte >> 4;
+ cache = byte & 0xf;
+ if (run == LRU_LONG) {
+ NextByte(byte);
+ run = (int) byte + MAX_LRU_SHORT;
+ }
+ run++;
+ if (cache == LRU_MISS) {
+ pix = 0;
+ for (i = 0; i < bytes; i++) {
+ pix = pix << 8;
+ NextByte(byte);
+ pix |= byte;
+ }
+ push(lru, pix);
+ }
+ else {
+ pix = use(lru, cache);
+ }
+ w -= run;
+ if (w < 0) {
+ error = "bad run";
+ break;
+ }
+ x += run;
+ fprintf(stdout, " %3ld:%0*x", run, bytes * 2, pix);
+ }
+ break;
+ }
+ if (Verbose > 2)
+ fprintf(stdout, "\n");
+ y++;
}
if (error)
- fprintf (stdout, "%s%20s: %d, %d %d\n", Leader, error,
- x, y - 1, (char *) data - buf);
+ fprintf(stdout, "%s%20s: %d, %d %d\n", Leader, error,
+ x, y - 1, (char *) data - buf);
}
static void
-WcpAnalyzeImage (
- const char *buf,
- int len,
- int depth,
- int encoding,
- int width,
- int height)
+WcpAnalyzeImage(const char *buf,
+ int len, int depth, int encoding, int width, int height)
{
- int bytes;
-
+ int bytes;
+
bytes = depth / 8;
switch (depth) {
case 1:
- switch (encoding) {
- case 1:
- case 2:
- case 3:
- case 4:
- WcpAnalyzeImage1RLL (buf, len, width, height);
- return;
- default:
- break;
- }
- break;
+ switch (encoding) {
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ WcpAnalyzeImage1RLL(buf, len, width, height);
+ return;
+ default:
+ break;
+ }
+ break;
case 4:
- switch (encoding) {
- case 1:
- case 2:
- case 3:
- case 4:
- default:
- break;
- }
- break;
+ switch (encoding) {
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ default:
+ break;
+ }
+ break;
case 8:
case 16:
case 24:
- switch (encoding) {
- case 1:
- case 2:
- case 3:
- WcpAnalyzeImageNRLL (buf, len, width, height, bytes);
- return;
- case 4:
- WcpAnalyzeImageNLRU (buf, len, width, height, bytes);
- return;
- default:
- break;
- }
- break;
+ switch (encoding) {
+ case 1:
+ case 2:
+ case 3:
+ WcpAnalyzeImageNRLL(buf, len, width, height, bytes);
+ return;
+ case 4:
+ WcpAnalyzeImageNLRU(buf, len, width, height, bytes);
+ return;
+ default:
+ break;
+ }
+ break;
}
- fprintf (stdout, "%s%20s: ", Leader, "invalid");
- fprintf (stdout, "encoding %d depth %d\n", encoding, depth);
+ fprintf(stdout, "%s%20s: ", Leader, "invalid");
+ fprintf(stdout, "encoding %d depth %d\n", encoding, depth);
}
void
-WcpPutImage (
- FD fd,
- const unsigned char *buf)
+WcpPutImage(FD fd, const unsigned char *buf)
{
- int n;
- PrintField (buf, 0, 1, REQUEST, REQUESTHEADER) /* WcpRequest */ ;
- PrintField (buf, 1, 1, WCPREQUEST, WCPREQUESTHEADER) /* WcpSwitch */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- n = (IShort(&buf[2]) - 7) * 4;
- printreqlen(buf, fd, DVALUE2(7 + (n + p) / 4));
- PrintField(buf, 4, 4, DRAWABLE, "drawable");
- PrintField(buf, 8, 4, GCONTEXT, "gc");
- if (Verbose > 2)
- PrintValueRec (ILong(&buf[8]),
- GC_function|
- GC_plane_mask|
- GC_foreground|
- GC_background,
- GC_BITMASK);
- PrintField(buf, 12, 4, CARD32, "lut");
- PrintField(buf, 16, 2, INT16, "dst-x");
- PrintField(buf, 18, 2, INT16, "dst-y");
- PrintField(buf, 20, 2, CARD16, "width");
- PrintField(buf, 22, 2, CARD16, "height");
- PrintField(buf, 24, 1, CARD8, "depth");
- PrintField(buf, 25, 1, CARD8, "encoding");
- PrintField(buf, 26, 1, CARD8, "left-pad");
- WcpAnalyzeImage ((const char *) &buf[28], (long) n, buf[24], buf[25],
- IShort(&buf[20]) + buf[26],
- IShort(&buf[22]));
- PrintBytes(&buf[28], (long)n, "data");
+ int n;
+
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* WcpRequest */
+ PrintField(buf, 1, 1, WCPREQUEST, WCPREQUESTHEADER); /* WcpSwitch */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ n = (IShort(&buf[2]) - 7) * 4;
+ printreqlen(buf, fd, DVALUE2(7 + (n + p) / 4));
+ PrintField(buf, 4, 4, DRAWABLE, "drawable");
+ PrintField(buf, 8, 4, GCONTEXT, "gc");
+ if (Verbose > 2)
+ PrintValueRec(ILong(&buf[8]),
+ GC_function |
+ GC_plane_mask |
+ GC_foreground |
+ GC_background,
+ GC_BITMASK);
+ PrintField(buf, 12, 4, CARD32, "lut");
+ PrintField(buf, 16, 2, INT16, "dst-x");
+ PrintField(buf, 18, 2, INT16, "dst-y");
+ PrintField(buf, 20, 2, CARD16, "width");
+ PrintField(buf, 22, 2, CARD16, "height");
+ PrintField(buf, 24, 1, CARD8, "depth");
+ PrintField(buf, 25, 1, CARD8, "encoding");
+ PrintField(buf, 26, 1, CARD8, "left-pad");
+ WcpAnalyzeImage((const char *) &buf[28], (long) n, buf[24], buf[25],
+ IShort(&buf[20]) + buf[26], IShort(&buf[22]));
+ PrintBytes(&buf[28], (long) n, "data");
}
void
-WcpGetImage (
- FD fd,
- const unsigned char *buf)
+WcpGetImage(FD fd, const unsigned char *buf)
{
- PrintField (buf, 0, 1, REQUEST, REQUESTHEADER) /* WcpRequest */ ;
- PrintField (buf, 1, 1, WCPREQUEST, WCPREQUESTHEADER) /* WcpSwitch */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, CONST2(2));
- PrintField(buf, 4, 4, DRAWABLE, "drawable");
- PrintField(buf, 8, 4, CARD32, "lut");
- PrintField(buf, 12, 2, INT16, "x");
- PrintField(buf, 14, 2, INT16, "y");
- PrintField(buf, 16, 2, CARD16, "width");
- PrintField(buf, 18, 2, CARD16, "height");
- PrintField(buf, 20, 1, CARD8, "encoding");
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* WcpRequest */
+ PrintField(buf, 1, 1, WCPREQUEST, WCPREQUESTHEADER); /* WcpSwitch */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 4, 4, DRAWABLE, "drawable");
+ PrintField(buf, 8, 4, CARD32, "lut");
+ PrintField(buf, 12, 2, INT16, "x");
+ PrintField(buf, 14, 2, INT16, "y");
+ PrintField(buf, 16, 2, CARD16, "width");
+ PrintField(buf, 18, 2, CARD16, "height");
+ PrintField(buf, 20, 1, CARD8, "encoding");
}
void
-WcpGetImageReply (
- FD fd,
- const unsigned char *buf)
+WcpGetImageReply(FD fd, const unsigned char *buf)
{
- long n;
-
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* WcpRequest reply */ ;
- PrintField(RBf, 1, 1, WCPREPLY, WCPREPLYHEADER) /* WcpGetImage reply */;
- if (Verbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- printfield(buf, 4, 4, DVALUE4(n), "reply length");
- PrintField(buf, 8, 4, CARD32, "visual");
- n = ILong (&buf[4]) * 4;
- PrintBytes (&buf[32], n, "data");
+ long n;
+
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* WcpRequest reply */
+ PrintField(RBf, 1, 1, WCPREPLY, WCPREPLYHEADER); /* WcpGetImage reply */
+ if (Verbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(n), "reply length");
+ PrintField(buf, 8, 4, CARD32, "visual");
+
+ n = ILong(&buf[4]) * 4;
+ PrintBytes(&buf[32], n, "data");
}
void
-WcpCreateColorCursor (
- FD fd,
- const unsigned char *buf)
+WcpCreateColorCursor(FD fd, const unsigned char *buf)
{
- PrintField (buf, 0, 1, REQUEST, REQUESTHEADER) /* WcpRequest */ ;
- PrintField (buf, 1, 1, WCPREQUEST, WCPREQUESTHEADER) /* WcpSwitch */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* WcpRequest */
+ PrintField(buf, 1, 1, WCPREQUEST, WCPREQUESTHEADER); /* WcpSwitch */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(2));
}
void
-WcpCreateLut (
- FD fd,
- const unsigned char *buf)
+WcpCreateLut(FD fd, const unsigned char *buf)
{
- PrintField (buf, 0, 1, REQUEST, REQUESTHEADER) /* WcpRequest */ ;
- PrintField (buf, 1, 1, WCPREQUEST, WCPREQUESTHEADER) /* WcpSwitch */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* WcpRequest */
+ PrintField(buf, 1, 1, WCPREQUEST, WCPREQUESTHEADER); /* WcpSwitch */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(2));
}
void
-WcpFreeLut (
- FD fd,
- const unsigned char *buf)
+WcpFreeLut(FD fd, const unsigned char *buf)
{
- PrintField (buf, 0, 1, REQUEST, REQUESTHEADER) /* WcpRequest */ ;
- PrintField (buf, 1, 1, WCPREQUEST, WCPREQUESTHEADER) /* WcpSwitch */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* WcpRequest */
+ PrintField(buf, 1, 1, WCPREQUEST, WCPREQUESTHEADER); /* WcpSwitch */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(2));
}
void
-WcpCopyArea (
- FD fd,
- const unsigned char *buf)
+WcpCopyArea(FD fd, const unsigned char *buf)
{
- PrintField (buf, 0, 1, REQUEST, REQUESTHEADER) /* WcpRequest */ ;
- PrintField (buf, 1, 1, WCPREQUEST, WCPREQUESTHEADER) /* WcpSwitch */ ;
- if (Verbose < 1)
- return;
- if (Verbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
-
- printreqlen(buf, fd, CONST2(2));
+ PrintField(buf, 0, 1, REQUEST, REQUESTHEADER); /* WcpRequest */
+ PrintField(buf, 1, 1, WCPREQUEST, WCPREQUESTHEADER); /* WcpSwitch */
+ if (Verbose < 1)
+ return;
+ if (Verbose > 1)
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
+ printreqlen(buf, fd, CONST2(2));
}
diff --git a/printnas.c b/printnas.c
index 64d8dad..f1a8421 100644
--- a/printnas.c
+++ b/printnas.c
@@ -40,8 +40,8 @@
#define printfield(a,b,c,d,e) if (NasVerbose > 1) PrintField(a,b,c,d,e)
-static void PrintFailedAudioSetUpReply (const unsigned char *buf);
-static void PrintSuccessfulAudioSetUpReply (const unsigned char *buf);
+static void PrintFailedAudioSetUpReply(const unsigned char *buf);
+static void PrintSuccessfulAudioSetUpReply(const unsigned char *buf);
/* ************************************************************ */
/* */
@@ -49,90 +49,88 @@ static void PrintSuccessfulAudioSetUpReply (const unsigned char *buf);
/* ************************************************************ */
void
-PrintAudioSetUpMessage(
- const unsigned char *buf)
+PrintAudioSetUpMessage(const unsigned char *buf)
{
- short n;
- short d;
+ short n;
+ short d;
- enterprocedure("PrintSetUpMessage");
- if (NasVerbose < 1)
- return;
- SetIndentLevel(PRINTCLIENT);
- PrintField(buf, 0, 1, BYTEMODE, "byte-order");
- PrintField(buf, 2, 2, CARD16, "major-version");
- PrintField(buf, 4, 2, CARD16, "minor-version");
- printfield(buf, 6, 2, DVALUE2(n), "length of name");
- n = IShort(&buf[6]);
- printfield(buf, 8, 2, DVALUE2(d), "length of data");
- d = IShort(&buf[8]);
- PrintString8(&buf[12], (long)n, "authorization-protocol-name");
- PrintString8(&buf[pad((long)(12+n))], (long)d, "authorization-protocol-data");
+ enterprocedure("PrintSetUpMessage");
+ if (NasVerbose < 1)
+ return;
+ SetIndentLevel(PRINTCLIENT);
+ PrintField(buf, 0, 1, BYTEMODE, "byte-order");
+ PrintField(buf, 2, 2, CARD16, "major-version");
+ PrintField(buf, 4, 2, CARD16, "minor-version");
+ printfield(buf, 6, 2, DVALUE2(n), "length of name");
+ n = IShort(&buf[6]);
+ printfield(buf, 8, 2, DVALUE2(d), "length of data");
+ d = IShort(&buf[8]);
+ PrintString8(&buf[12], (long) n, "authorization-protocol-name");
+ PrintString8(&buf[pad((long) (12 + n))], (long) d,
+ "authorization-protocol-data");
}
void
PrintAudioSetUpReply(const unsigned char *buf)
{
- enterprocedure("PrintSetUpReply");
- SetIndentLevel(PRINTSERVER);
- if (IByte(&buf[0]))
- PrintSuccessfulAudioSetUpReply(buf);
- else
- PrintFailedAudioSetUpReply(buf);
+ enterprocedure("PrintSetUpReply");
+ SetIndentLevel(PRINTSERVER);
+ if (IByte(&buf[0]))
+ PrintSuccessfulAudioSetUpReply(buf);
+ else
+ PrintFailedAudioSetUpReply(buf);
}
static void
PrintFailedAudioSetUpReply(const unsigned char *buf)
{
- short n;
+ short n;
- PrintField(buf, 0, 1, 0, "SetUp Failed");
- if (NasVerbose < 1)
- return;
- printfield(buf, 1, 1, DVALUE1(n), "length of reason in bytes");
- n = IByte(&buf[1]);
- PrintField(buf, 2, 2, CARD16, "major-version");
- PrintField(buf, 4, 2, CARD16, "minor-version");
- printfield(buf, 6, 2, DVALUE2((n + p) / 4), "length of data");
- PrintString8(&buf[8], (long)n, "reason");
+ PrintField(buf, 0, 1, 0, "SetUp Failed");
+ if (NasVerbose < 1)
+ return;
+ printfield(buf, 1, 1, DVALUE1(n), "length of reason in bytes");
+ n = IByte(&buf[1]);
+ PrintField(buf, 2, 2, CARD16, "major-version");
+ PrintField(buf, 4, 2, CARD16, "minor-version");
+ printfield(buf, 6, 2, DVALUE2((n + p) / 4), "length of data");
+ PrintString8(&buf[8], (long) n, "reason");
}
static void
-PrintSuccessfulAudioSetUpReply(
- const unsigned char *buf)
-{
- short v;
- short n;
- short m;
-
- if (NasVerbose < 1)
- return;
- PrintField(buf, 2, 2, CARD16, "protocol-major-version");
- PrintField(buf, 4, 2, CARD16, "protocol-minor-version");
- printfield(buf, 6, 2, DVALUE2(8 + 2*n + (v + p + m) / 4), "length of data");
- PrintField(buf, 8, 4, CARD32, "release-number");
- PrintField(buf, 12, 4, CARD32, "resource-id-base");
- PrintField(buf, 16, 4, CARD32, "resource-id-mask");
- PrintField(buf, 20, 2, CARD16, "min-sample-rate");
- PrintField(buf, 22, 2, CARD16, "max-sample-rate");
- printfield(buf, 24, 2, DVALUE2(v), "length of vendor");
- v = IShort(&buf[24]);
- printfield(buf, 26, 2, CARD16, "maximum-request-length");
- printfield(buf, 28, 1, CARD8, "max-tracks");
- m = IByte(&buf[28]);
- printfield(buf, 29, 1, DVALUE1(n), "number of audio formats");
- n = IByte(&buf[29]);
- PrintField(buf, 30, 1, CARD8, "number of element-types");
- PrintField(buf, 31, 1, CARD8, "number of wave-forms");
- PrintField(buf, 32, 1, CARD8, "number of actions");
- PrintField(buf, 33, 1, CARD8, "number of devices");
- PrintField(buf, 34, 1, CARD8, "number of buckets");
- PrintField(buf, 35, 1, CARD8, "number of radios");
- PrintString8(&buf[36], (long)v, "vendor");
+PrintSuccessfulAudioSetUpReply(const unsigned char *buf)
+{
+ short v;
+ short n;
+ short m;
+
+ if (NasVerbose < 1)
+ return;
+ PrintField(buf, 2, 2, CARD16, "protocol-major-version");
+ PrintField(buf, 4, 2, CARD16, "protocol-minor-version");
+ printfield(buf, 6, 2, DVALUE2(8 + 2 * n + (v + p + m) / 4),
+ "length of data");
+ PrintField(buf, 8, 4, CARD32, "release-number");
+ PrintField(buf, 12, 4, CARD32, "resource-id-base");
+ PrintField(buf, 16, 4, CARD32, "resource-id-mask");
+ PrintField(buf, 20, 2, CARD16, "min-sample-rate");
+ PrintField(buf, 22, 2, CARD16, "max-sample-rate");
+ printfield(buf, 24, 2, DVALUE2(v), "length of vendor");
+ v = IShort(&buf[24]);
+ printfield(buf, 26, 2, CARD16, "maximum-request-length");
+ printfield(buf, 28, 1, CARD8, "max-tracks");
+ m = IByte(&buf[28]);
+ printfield(buf, 29, 1, DVALUE1(n), "number of audio formats");
+ n = IByte(&buf[29]);
+ PrintField(buf, 30, 1, CARD8, "number of element-types");
+ PrintField(buf, 31, 1, CARD8, "number of wave-forms");
+ PrintField(buf, 32, 1, CARD8, "number of actions");
+ PrintField(buf, 33, 1, CARD8, "number of devices");
+ PrintField(buf, 34, 1, CARD8, "number of buckets");
+ PrintField(buf, 35, 1, CARD8, "number of radios");
+ PrintString8(&buf[36], (long) v, "vendor");
}
-
-
/* ************************************************************ */
/* */
/* */
@@ -141,101 +139,93 @@ PrintSuccessfulAudioSetUpReply(
/* Error Printing procedures */
static void
-AudioRequestError(
- const unsigned char *buf)
+AudioRequestError(const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Request */ ;
- if (NasVerbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Request */
+ if (NasVerbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
static void
-AudioValueError(
- const unsigned char *buf)
+AudioValueError(const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Value */ ;
- if (NasVerbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, INT32, "bad value");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Value */
+ if (NasVerbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, INT32, "bad value");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
static void
-AudioMatchError(
- const unsigned char *buf)
+AudioMatchError(const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Match */ ;
- if (NasVerbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Match */
+ if (NasVerbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
static void
-AudioAccessError(
- const unsigned char *buf)
+AudioAccessError(const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Access */ ;
- if (NasVerbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Access */
+ if (NasVerbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
static void
-AudioAllocError(
- const unsigned char *buf)
+AudioAllocError(const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Alloc */ ;
- if (NasVerbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Alloc */
+ if (NasVerbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
static void
-AudioIDChoiceError(
- const unsigned char *buf)
+AudioIDChoiceError(const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* IDChoice */ ;
- if (NasVerbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 4, 4, CARD32, "bad resource id");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* IDChoice */
+ if (NasVerbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 4, 4, CARD32, "bad resource id");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
static void
-AudioLengthError(
- const unsigned char *buf)
+AudioLengthError(const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Length */ ;
- if (NasVerbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Length */
+ if (NasVerbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
static void
-AudioImplementationError(
- const unsigned char *buf)
+AudioImplementationError(const unsigned char *buf)
{
- PrintField(buf, 1, 1, ERROR, ERRORHEADER) /* Implementation */ ;
- if (NasVerbose < 1)
- return;
- printfield(buf, 2, 2, CARD16, "sequence number");
- PrintField(buf, 8, 2, CARD16, "minor opcode");
- PrintField(buf, 10, 1, CARD8, "major opcode");
+ PrintField(buf, 1, 1, ERROR, ERRORHEADER); /* Implementation */
+ if (NasVerbose < 1)
+ return;
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ PrintField(buf, 8, 2, CARD16, "minor opcode");
+ PrintField(buf, 10, 1, CARD8, "major opcode");
}
/* ************************************************************ */
@@ -246,12 +236,11 @@ AudioImplementationError(
/* Event Printing procedures */
void
-AudioElementNotify (
- const unsigned char *buf)
+AudioElementNotify(const unsigned char *buf)
{
PrintField(buf, 0, 1, NASEVENT, EVENTHEADER);
if (NasVerbose < 1)
- return;
+ return;
printfield(buf, 1, 1, CARD8, "detail");
printfield(buf, 2, 2, CARD16, "sequence number");
PrintField(buf, 4, 4, TIMESTAMP, "time");
@@ -265,18 +254,16 @@ AudioElementNotify (
}
void
-AudioGrabNotify (
- const unsigned char *buf)
+AudioGrabNotify(const unsigned char *buf)
{
}
void
-AudioMonitorNotify (
- const unsigned char *buf)
+AudioMonitorNotify(const unsigned char *buf)
{
PrintField(buf, 0, 1, NASEVENT, EVENTHEADER);
if (NasVerbose < 1)
- return;
+ return;
printfield(buf, 1, 1, CARD8, "detail");
printfield(buf, 2, 2, CARD16, "sequence number");
PrintField(buf, 4, 4, TIMESTAMP, "time");
@@ -292,14 +279,12 @@ AudioMonitorNotify (
}
void
-AudioBucketNotify (
- const unsigned char *buf)
+AudioBucketNotify(const unsigned char *buf)
{
}
void
-AudioDeviceNotify (
- const unsigned char *buf)
+AudioDeviceNotify(const unsigned char *buf)
{
}
@@ -311,63 +296,63 @@ AudioDeviceNotify (
/* Request and Reply Printing procedures */
void
-UnknownAudioReply(
- const unsigned char *buf)
+UnknownAudioReply(const unsigned char *buf)
{
- long n;
-
- PrintField(RBf, 0, 1, NASREPLY, REPLYHEADER);
- PrintField(buf, 1, 1, CARD8, "data");
- printfield (buf, 2, 2, CARD16, "sequence number");
- printfield (buf, 4, 4, DVALUE4(n), "reply length");
- n = ILong (&buf[4]) + 6;
- (void) PrintList (&buf[8], n, CARD32, "data");
+ long n;
+
+ PrintField(RBf, 0, 1, NASREPLY, REPLYHEADER);
+ PrintField(buf, 1, 1, CARD8, "data");
+ printfield(buf, 2, 2, CARD16, "sequence number");
+ printfield(buf, 4, 4, DVALUE4(n), "reply length");
+ n = ILong(&buf[4]) + 6;
+ (void) PrintList(&buf[8], n, CARD32, "data");
}
void
-AudioListDevices (
- const unsigned char *buf)
+AudioListDevices(const unsigned char *buf)
{
- PrintField (buf, 0, 1, NASREQUEST, REQUESTHEADER) /* ListDevices */;
+ PrintField(buf, 0, 1, NASREQUEST, REQUESTHEADER); /* ListDevices */
if (NasVerbose < 1)
- return;
+ return;
if (NasVerbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
printfield(buf, 2, 2, DVALUE2(8 + n), "request length");
}
void
-AudioListDevicesReply(
- const unsigned char *buf)
+AudioListDevicesReply(const unsigned char *buf)
{
- long n;
- PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* GetWindowAttributes */ ;
+ long n;
+
+ PrintField(RBf, 0, 1, REPLY, REPLYHEADER); /* GetWindowAttributes */
if (NasVerbose < 1)
- return;
+ return;
printfield(buf, 2, 2, CARD16, "sequence number");
printfield(buf, 4, 4, CARD32, "reply length");
printfield(buf, 8, 4, CARD32, "num devices");
+
n = ILong(&buf[8]);
}
static long
-AuString (
- const unsigned char *buf)
+AuString(const unsigned char *buf)
{
- long n;
-
+ long n;
+
printfield(buf, 0, 1, CARD8, "type");
printfield(buf, 4, 4, CARD32, "length");
+
n = ILong(&buf[8]);
PrintString8(&buf[8], n, "string");
return 8 + pad(n);
}
static void
-AuDeviceAttributes (
- const unsigned char *buf)
+AuDeviceAttributes(const unsigned char *buf)
{
- int l;
+ int l;
+
printfield(buf, 0, 4, CARD32, "value mask");
printfield(buf, 4, 4, CARD32, "changable mask");
printfield(buf, 8, 4, CARD32, "id");
@@ -376,320 +361,314 @@ AuDeviceAttributes (
printfield(buf, 14, 1, CARD8, "format");
printfield(buf, 15, 1, CARD8, "num tracks");
printfield(buf, 16, 4, CARD32, "access");
+
l = 20 + AuString(&buf[20]);
}
void
-AudioGetDeviceAttributes (
- const unsigned char *buf)
+AudioGetDeviceAttributes(const unsigned char *buf)
{
- PrintField (buf, 0, 1, NASREQUEST, REQUESTHEADER);
+ PrintField(buf, 0, 1, NASREQUEST, REQUESTHEADER);
if (NasVerbose < 1)
- return;
+ return;
if (NasVerbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
printfield(buf, 2, 2, DVALUE2(8 + n), "request length");
}
void
-AudioGetDeviceAttributesReply (
- const unsigned char *buf)
+AudioGetDeviceAttributesReply(const unsigned char *buf)
{
- PrintField (RBf, 0, 1, NASREPLY, REPLYHEADER);
+ PrintField(RBf, 0, 1, NASREPLY, REPLYHEADER);
if (NasVerbose < 1)
- return;
+ return;
printfield(buf, 2, 2, CARD16, "sequence number");
printfield(buf, 4, 4, DVALUE4((n + p) / 4), "reply length");
- AuDeviceAttributes (&buf[32]);
+ AuDeviceAttributes(&buf[32]);
}
void
-AudioSetDeviceAttributes (
- const unsigned char *buf)
+AudioSetDeviceAttributes(const unsigned char *buf)
{
- PrintField (buf, 0, 1, NASREQUEST, REQUESTHEADER);
+ PrintField(buf, 0, 1, NASREQUEST, REQUESTHEADER);
if (NasVerbose < 1)
- return;
+ return;
if (NasVerbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
printfield(buf, 2, 2, DVALUE2(8 + n), "request length");
- printfield(buf, 4, 4, CARD32, "device");
- AuDeviceAttributes (&buf[8]);
+ printfield(buf, 4, 4, CARD32, "device");
+
+ AuDeviceAttributes(&buf[8]);
}
void
-AudioCreateBucket (
- const unsigned char *buf)
+AudioCreateBucket(const unsigned char *buf)
{
- PrintField (buf, 0, 1, NASREQUEST, REQUESTHEADER);
+ PrintField(buf, 0, 1, NASREQUEST, REQUESTHEADER);
if (NasVerbose < 1)
- return;
+ return;
if (NasVerbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
printfield(buf, 2, 2, DVALUE2(8 + n), "request length");
}
void
-AudioDestroyBucket (
- const unsigned char *buf)
+AudioDestroyBucket(const unsigned char *buf)
{
- PrintField (buf, 0, 1, NASREQUEST, REQUESTHEADER);
+ PrintField(buf, 0, 1, NASREQUEST, REQUESTHEADER);
if (NasVerbose < 1)
- return;
+ return;
if (NasVerbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
printfield(buf, 2, 2, DVALUE2(8 + n), "request length");
}
void
-AudioListBuckets (
- const unsigned char *buf)
+AudioListBuckets(const unsigned char *buf)
{
- PrintField (buf, 0, 1, NASREQUEST, REQUESTHEADER);
+ PrintField(buf, 0, 1, NASREQUEST, REQUESTHEADER);
if (NasVerbose < 1)
- return;
+ return;
if (NasVerbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
printfield(buf, 2, 2, DVALUE2(8 + n), "request length");
}
void
-AudioListBucketsReply (
- const unsigned char *buf)
+AudioListBucketsReply(const unsigned char *buf)
{
- PrintField (RBf, 0, 1, NASREPLY, REPLYHEADER);
+ PrintField(RBf, 0, 1, NASREPLY, REPLYHEADER);
if (NasVerbose < 1)
- return;
+ return;
printfield(buf, 2, 2, CARD16, "sequence number");
printfield(buf, 4, 4, DVALUE4((n + p) / 4), "reply length");
}
void
-AudioGetBucketAttributes (
- const unsigned char *buf)
+AudioGetBucketAttributes(const unsigned char *buf)
{
- PrintField (buf, 0, 1, NASREQUEST, REQUESTHEADER);
+ PrintField(buf, 0, 1, NASREQUEST, REQUESTHEADER);
if (NasVerbose < 1)
- return;
+ return;
if (NasVerbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
printfield(buf, 2, 2, DVALUE2(8 + n), "request length");
}
void
-AudioGetBucketAttributesReply (
- const unsigned char *buf)
+AudioGetBucketAttributesReply(const unsigned char *buf)
{
- PrintField (RBf, 0, 1, NASREPLY, REPLYHEADER);
+ PrintField(RBf, 0, 1, NASREPLY, REPLYHEADER);
if (NasVerbose < 1)
- return;
+ return;
printfield(buf, 2, 2, CARD16, "sequence number");
printfield(buf, 4, 4, DVALUE4((n + p) / 4), "reply length");
}
void
-AudioSetBucketAttributes (
- const unsigned char *buf)
+AudioSetBucketAttributes(const unsigned char *buf)
{
- PrintField (buf, 0, 1, NASREQUEST, REQUESTHEADER);
+ PrintField(buf, 0, 1, NASREQUEST, REQUESTHEADER);
if (NasVerbose < 1)
- return;
+ return;
if (NasVerbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
printfield(buf, 2, 2, DVALUE2(8 + n), "request length");
}
void
-AudioCreateRadio (
- const unsigned char *buf)
+AudioCreateRadio(const unsigned char *buf)
{
- PrintField (buf, 0, 1, NASREQUEST, REQUESTHEADER);
+ PrintField(buf, 0, 1, NASREQUEST, REQUESTHEADER);
if (NasVerbose < 1)
- return;
+ return;
if (NasVerbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
printfield(buf, 2, 2, DVALUE2(8 + n), "request length");
}
void
-AudioDestroyRadio (
- const unsigned char *buf)
+AudioDestroyRadio(const unsigned char *buf)
{
- PrintField (buf, 0, 1, NASREQUEST, REQUESTHEADER);
+ PrintField(buf, 0, 1, NASREQUEST, REQUESTHEADER);
if (NasVerbose < 1)
- return;
+ return;
if (NasVerbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
printfield(buf, 2, 2, DVALUE2(8 + n), "request length");
}
void
-AudioListRadios (
- const unsigned char *buf)
+AudioListRadios(const unsigned char *buf)
{
- PrintField (buf, 0, 1, NASREQUEST, REQUESTHEADER);
+ PrintField(buf, 0, 1, NASREQUEST, REQUESTHEADER);
if (NasVerbose < 1)
- return;
+ return;
if (NasVerbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
printfield(buf, 2, 2, DVALUE2(8 + n), "request length");
}
void
-AudioListRadiosReply (
- const unsigned char *buf)
+AudioListRadiosReply(const unsigned char *buf)
{
- PrintField (RBf, 0, 1, NASREPLY, REPLYHEADER);
+ PrintField(RBf, 0, 1, NASREPLY, REPLYHEADER);
if (NasVerbose < 1)
- return;
+ return;
printfield(buf, 2, 2, CARD16, "sequence number");
printfield(buf, 4, 4, DVALUE4((n + p) / 4), "reply length");
}
void
-AudioGetRadioAttributes (
- const unsigned char *buf)
+AudioGetRadioAttributes(const unsigned char *buf)
{
- PrintField (buf, 0, 1, NASREQUEST, REQUESTHEADER);
+ PrintField(buf, 0, 1, NASREQUEST, REQUESTHEADER);
if (NasVerbose < 1)
- return;
+ return;
if (NasVerbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
printfield(buf, 2, 2, DVALUE2(8 + n), "request length");
}
void
-AudioGetRadioAttributesReply (
- const unsigned char *buf)
+AudioGetRadioAttributesReply(const unsigned char *buf)
{
- PrintField (RBf, 0, 1, NASREPLY, REPLYHEADER);
+ PrintField(RBf, 0, 1, NASREPLY, REPLYHEADER);
if (NasVerbose < 1)
- return;
+ return;
printfield(buf, 2, 2, CARD16, "sequence number");
printfield(buf, 4, 4, DVALUE4((n + p) / 4), "reply length");
}
void
-AudioSetRadioAttributes (
- const unsigned char *buf)
+AudioSetRadioAttributes(const unsigned char *buf)
{
- PrintField (buf, 0, 1, NASREQUEST, REQUESTHEADER);
+ PrintField(buf, 0, 1, NASREQUEST, REQUESTHEADER);
if (NasVerbose < 1)
- return;
+ return;
if (NasVerbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
printfield(buf, 2, 2, DVALUE2(8 + n), "request length");
}
void
-AudioCreateFlow (
- const unsigned char *buf)
+AudioCreateFlow(const unsigned char *buf)
{
- PrintField (buf, 0, 1, NASREQUEST, REQUESTHEADER);
+ PrintField(buf, 0, 1, NASREQUEST, REQUESTHEADER);
if (NasVerbose < 1)
- return;
+ return;
if (NasVerbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
printfield(buf, 2, 2, DVALUE2(8 + n), "request length");
}
void
-AudioDestroyFlow (
- const unsigned char *buf)
+AudioDestroyFlow(const unsigned char *buf)
{
- PrintField (buf, 0, 1, NASREQUEST, REQUESTHEADER);
+ PrintField(buf, 0, 1, NASREQUEST, REQUESTHEADER);
if (NasVerbose < 1)
- return;
+ return;
if (NasVerbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
printfield(buf, 2, 2, DVALUE2(8 + n), "request length");
}
void
-AudioGetFlowAttributes (
- const unsigned char *buf)
+AudioGetFlowAttributes(const unsigned char *buf)
{
- PrintField (buf, 0, 1, NASREQUEST, REQUESTHEADER);
+ PrintField(buf, 0, 1, NASREQUEST, REQUESTHEADER);
if (NasVerbose < 1)
- return;
+ return;
if (NasVerbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
printfield(buf, 2, 2, DVALUE2(8 + n), "request length");
}
void
-AudioGetFlowAttributesReply (
- const unsigned char *buf)
+AudioGetFlowAttributesReply(const unsigned char *buf)
{
- PrintField (RBf, 0, 1, NASREPLY, REPLYHEADER);
+ PrintField(RBf, 0, 1, NASREPLY, REPLYHEADER);
if (NasVerbose < 1)
- return;
+ return;
printfield(buf, 2, 2, CARD16, "sequence number");
printfield(buf, 4, 4, DVALUE4((n + p) / 4), "reply length");
}
void
-AudioSetFlowAttributes (
- const unsigned char *buf)
+AudioSetFlowAttributes(const unsigned char *buf)
{
- PrintField (buf, 0, 1, NASREQUEST, REQUESTHEADER);
+ PrintField(buf, 0, 1, NASREQUEST, REQUESTHEADER);
if (NasVerbose < 1)
- return;
+ return;
if (NasVerbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
printfield(buf, 2, 2, DVALUE2(8 + n), "request length");
}
void
-AudioGetElements (
- const unsigned char *buf)
+AudioGetElements(const unsigned char *buf)
{
- PrintField (buf, 0, 1, NASREQUEST, REQUESTHEADER);
+ PrintField(buf, 0, 1, NASREQUEST, REQUESTHEADER);
if (NasVerbose < 1)
- return;
+ return;
if (NasVerbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
printfield(buf, 2, 2, DVALUE2(8 + n), "request length");
}
void
-AudioGetElementsReply (
- const unsigned char *buf)
+AudioGetElementsReply(const unsigned char *buf)
{
- PrintField (RBf, 0, 1, NASREPLY, REPLYHEADER);
+ PrintField(RBf, 0, 1, NASREPLY, REPLYHEADER);
if (NasVerbose < 1)
- return;
+ return;
printfield(buf, 2, 2, CARD16, "sequence number");
printfield(buf, 4, 4, DVALUE4((n + p) / 4), "reply length");
}
void
-AudioSetElements (
- const unsigned char *buf)
+AudioSetElements(const unsigned char *buf)
{
- PrintField (buf, 0, 1, NASREQUEST, REQUESTHEADER);
+ PrintField(buf, 0, 1, NASREQUEST, REQUESTHEADER);
if (NasVerbose < 1)
- return;
+ return;
if (NasVerbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
printfield(buf, 2, 2, DVALUE2(8 + n), "request length");
}
void
-AudioGetElementStates (
- const unsigned char *buf)
+AudioGetElementStates(const unsigned char *buf)
{
- PrintField (buf, 0, 1, NASREQUEST, REQUESTHEADER);
+ PrintField(buf, 0, 1, NASREQUEST, REQUESTHEADER);
if (NasVerbose < 1)
- return;
+ return;
if (NasVerbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
printfield(buf, 2, 2, DVALUE2(8 + n), "request length");
}
void
-AudioElementState (
- const unsigned char *buf)
+AudioElementState(const unsigned char *buf)
{
printfield(buf, 0, 4, CARD32, "flow");
printfield(buf, 4, 1, CARD8, "element number");
@@ -697,92 +676,91 @@ AudioElementState (
}
void
-AudioGetElementStatesReply (
- const unsigned char *buf)
+AudioGetElementStatesReply(const unsigned char *buf)
{
- int n, i;
- int o;
-
- PrintField (RBf, 0, 1, NASREPLY, REPLYHEADER);
+ int n, i;
+
+ int o;
+
+ PrintField(RBf, 0, 1, NASREPLY, REPLYHEADER);
if (NasVerbose < 1)
- return;
+ return;
printfield(buf, 2, 2, CARD16, "sequence number");
printfield(buf, 4, 4, DVALUE4((n + p) / 4), "reply length");
n = ILong(&buf[8]);
o = 32;
- for (i = 0; i < n; i++)
- {
- AudioElementState (buf+o);
- o += 8;
+ for (i = 0; i < n; i++) {
+ AudioElementState(buf + o);
+ o += 8;
}
}
void
-AudioSetElementStates (
- const unsigned char *buf)
+AudioSetElementStates(const unsigned char *buf)
{
- int nstates, i;
- int o;
- PrintField (buf, 0, 1, NASREQUEST, REQUESTHEADER);
+ int nstates, i;
+ int o;
+
+ PrintField(buf, 0, 1, NASREQUEST, REQUESTHEADER);
if (NasVerbose < 1)
- return;
+ return;
if (NasVerbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
printfield(buf, 2, 2, DVALUE2(8 + n), "request length");
printfield(buf, 4, 4, CARD32, "number states");
+
nstates = ILong(&buf[4]);
o = 8;
- for (i = 0; i < nstates; i++)
- {
- AudioElementState (buf+o);
- o += 8;
+ for (i = 0; i < nstates; i++) {
+ AudioElementState(buf + o);
+ o += 8;
}
}
void
-AudioGetElementParameters (
- const unsigned char *buf)
+AudioGetElementParameters(const unsigned char *buf)
{
- PrintField (buf, 0, 1, NASREQUEST, REQUESTHEADER);
+ PrintField(buf, 0, 1, NASREQUEST, REQUESTHEADER);
if (NasVerbose < 1)
- return;
+ return;
if (NasVerbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
printfield(buf, 2, 2, DVALUE2(8 + n), "request length");
}
void
-AudioGetElementParametersReply (
- const unsigned char *buf)
+AudioGetElementParametersReply(const unsigned char *buf)
{
- PrintField (RBf, 0, 1, NASREPLY, REPLYHEADER);
+ PrintField(RBf, 0, 1, NASREPLY, REPLYHEADER);
if (NasVerbose < 1)
- return;
+ return;
printfield(buf, 2, 2, CARD16, "sequence number");
printfield(buf, 4, 4, DVALUE4((n + p) / 4), "reply length");
}
void
-AudioSetElementParameters (
- const unsigned char *buf)
+AudioSetElementParameters(const unsigned char *buf)
{
- PrintField (buf, 0, 1, NASREQUEST, REQUESTHEADER);
+ PrintField(buf, 0, 1, NASREQUEST, REQUESTHEADER);
if (NasVerbose < 1)
- return;
+ return;
if (NasVerbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
printfield(buf, 2, 2, DVALUE2(8 + n), "request length");
}
void
-AudioWriteElement (
- const unsigned char *buf)
+AudioWriteElement(const unsigned char *buf)
{
- PrintField (buf, 0, 1, NASREQUEST, REQUESTHEADER);
+ PrintField(buf, 0, 1, NASREQUEST, REQUESTHEADER);
if (NasVerbose < 1)
- return;
+ return;
if (NasVerbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
printfield(buf, 2, 2, DVALUE2(8 + n), "request length");
printfield(buf, 4, 4, CARD32, "flow");
printfield(buf, 8, 4, CARD32, "num bytes");
@@ -790,223 +768,217 @@ AudioWriteElement (
}
void
-AudioReadElement (
- const unsigned char *buf)
+AudioReadElement(const unsigned char *buf)
{
- PrintField (buf, 0, 1, NASREQUEST, REQUESTHEADER);
+ PrintField(buf, 0, 1, NASREQUEST, REQUESTHEADER);
if (NasVerbose < 1)
- return;
+ return;
if (NasVerbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
printfield(buf, 2, 2, DVALUE2(8 + n), "request length");
}
void
-AudioReadElementReply (
- const unsigned char *buf)
+AudioReadElementReply(const unsigned char *buf)
{
- PrintField (RBf, 0, 1, NASREPLY, REPLYHEADER);
+ PrintField(RBf, 0, 1, NASREPLY, REPLYHEADER);
if (NasVerbose < 1)
- return;
+ return;
printfield(buf, 2, 2, CARD16, "sequence number");
printfield(buf, 4, 4, DVALUE4((n + p) / 4), "reply length");
}
void
-AudioGrabComponent (
- const unsigned char *buf)
+AudioGrabComponent(const unsigned char *buf)
{
- PrintField (buf, 0, 1, NASREQUEST, REQUESTHEADER);
+ PrintField(buf, 0, 1, NASREQUEST, REQUESTHEADER);
if (NasVerbose < 1)
- return;
+ return;
if (NasVerbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
printfield(buf, 2, 2, DVALUE2(8 + n), "request length");
}
void
-AudioUngrabComponent (
- const unsigned char *buf)
+AudioUngrabComponent(const unsigned char *buf)
{
- PrintField (buf, 0, 1, NASREQUEST, REQUESTHEADER);
+ PrintField(buf, 0, 1, NASREQUEST, REQUESTHEADER);
if (NasVerbose < 1)
- return;
+ return;
if (NasVerbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
printfield(buf, 2, 2, DVALUE2(8 + n), "request length");
}
void
-AudioSendEvent (
- const unsigned char *buf)
+AudioSendEvent(const unsigned char *buf)
{
- PrintField (buf, 0, 1, NASREQUEST, REQUESTHEADER);
+ PrintField(buf, 0, 1, NASREQUEST, REQUESTHEADER);
if (NasVerbose < 1)
- return;
+ return;
if (NasVerbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
printfield(buf, 2, 2, DVALUE2(8 + n), "request length");
}
void
-AudioGetAllowedUsers (
- const unsigned char *buf)
+AudioGetAllowedUsers(const unsigned char *buf)
{
- PrintField (buf, 0, 1, NASREQUEST, REQUESTHEADER);
+ PrintField(buf, 0, 1, NASREQUEST, REQUESTHEADER);
if (NasVerbose < 1)
- return;
+ return;
if (NasVerbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
printfield(buf, 2, 2, DVALUE2(8 + n), "request length");
}
void
-AudioGetAllowedUsersReply (
- const unsigned char *buf)
+AudioGetAllowedUsersReply(const unsigned char *buf)
{
- PrintField (RBf, 0, 1, NASREPLY, REPLYHEADER);
+ PrintField(RBf, 0, 1, NASREPLY, REPLYHEADER);
if (NasVerbose < 1)
- return;
+ return;
printfield(buf, 2, 2, CARD16, "sequence number");
printfield(buf, 4, 4, DVALUE4((n + p) / 4), "reply length");
}
void
-AudioSetAllowedUsers (
- const unsigned char *buf)
+AudioSetAllowedUsers(const unsigned char *buf)
{
- PrintField (buf, 0, 1, NASREQUEST, REQUESTHEADER);
+ PrintField(buf, 0, 1, NASREQUEST, REQUESTHEADER);
if (NasVerbose < 1)
- return;
+ return;
if (NasVerbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
printfield(buf, 2, 2, DVALUE2(8 + n), "request length");
}
void
-AudioListExtensions (
- const unsigned char *buf)
+AudioListExtensions(const unsigned char *buf)
{
- PrintField (buf, 0, 1, NASREQUEST, REQUESTHEADER);
+ PrintField(buf, 0, 1, NASREQUEST, REQUESTHEADER);
if (NasVerbose < 1)
- return;
+ return;
if (NasVerbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
printfield(buf, 2, 2, DVALUE2(8 + n), "request length");
}
void
-AudioListExtensionsReply (
- const unsigned char *buf)
+AudioListExtensionsReply(const unsigned char *buf)
{
- PrintField (RBf, 0, 1, NASREPLY, REPLYHEADER);
+ PrintField(RBf, 0, 1, NASREPLY, REPLYHEADER);
if (NasVerbose < 1)
- return;
+ return;
printfield(buf, 2, 2, CARD16, "sequence number");
printfield(buf, 4, 4, DVALUE4((n + p) / 4), "reply length");
}
void
-AudioQueryExtension (
- const unsigned char *buf)
+AudioQueryExtension(const unsigned char *buf)
{
- PrintField (buf, 0, 1, NASREQUEST, REQUESTHEADER);
+ PrintField(buf, 0, 1, NASREQUEST, REQUESTHEADER);
if (NasVerbose < 1)
- return;
+ return;
if (NasVerbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
printfield(buf, 2, 2, DVALUE2(8 + n), "request length");
}
void
-AudioQueryExtensionReply (
- const unsigned char *buf)
+AudioQueryExtensionReply(const unsigned char *buf)
{
- PrintField (RBf, 0, 1, NASREPLY, REPLYHEADER);
+ PrintField(RBf, 0, 1, NASREPLY, REPLYHEADER);
if (NasVerbose < 1)
- return;
+ return;
printfield(buf, 2, 2, CARD16, "sequence number");
printfield(buf, 4, 4, DVALUE4((n + p) / 4), "reply length");
}
void
-AudioGetCloseDownMode (
- const unsigned char *buf)
+AudioGetCloseDownMode(const unsigned char *buf)
{
- PrintField (buf, 0, 1, NASREQUEST, REQUESTHEADER);
+ PrintField(buf, 0, 1, NASREQUEST, REQUESTHEADER);
if (NasVerbose < 1)
- return;
+ return;
if (NasVerbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
printfield(buf, 2, 2, DVALUE2(8 + n), "request length");
}
void
-AudioGetCloseDownModeReply (
- const unsigned char *buf)
+AudioGetCloseDownModeReply(const unsigned char *buf)
{
- PrintField (RBf, 0, 1, NASREPLY, REPLYHEADER);
+ PrintField(RBf, 0, 1, NASREPLY, REPLYHEADER);
if (NasVerbose < 1)
- return;
+ return;
printfield(buf, 2, 2, CARD16, "sequence number");
printfield(buf, 4, 4, DVALUE4((n + p) / 4), "reply length");
}
void
-AudioSetCloseDownMode (
- const unsigned char *buf)
+AudioSetCloseDownMode(const unsigned char *buf)
{
- PrintField (buf, 0, 1, NASREQUEST, REQUESTHEADER);
+ PrintField(buf, 0, 1, NASREQUEST, REQUESTHEADER);
if (NasVerbose < 1)
- return;
+ return;
if (NasVerbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
printfield(buf, 2, 2, DVALUE2(8 + n), "request length");
}
void
-AudioKillClient (
- const unsigned char *buf)
+AudioKillClient(const unsigned char *buf)
{
- PrintField (buf, 0, 1, NASREQUEST, REQUESTHEADER);
+ PrintField(buf, 0, 1, NASREQUEST, REQUESTHEADER);
if (NasVerbose < 1)
- return;
+ return;
if (NasVerbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
printfield(buf, 2, 2, DVALUE2(8 + n), "request length");
}
void
-AudioGetServerTime (
- const unsigned char *buf)
+AudioGetServerTime(const unsigned char *buf)
{
- PrintField (buf, 0, 1, NASREQUEST, REQUESTHEADER);
+ PrintField(buf, 0, 1, NASREQUEST, REQUESTHEADER);
if (NasVerbose < 1)
- return;
+ return;
if (NasVerbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
printfield(buf, 2, 2, DVALUE2(8 + n), "request length");
}
void
-AudioGetServerTimeReply (
- const unsigned char *buf)
+AudioGetServerTimeReply(const unsigned char *buf)
{
- PrintField (RBf, 0, 1, NASREPLY, REPLYHEADER);
+ PrintField(RBf, 0, 1, NASREPLY, REPLYHEADER);
if (NasVerbose < 1)
- return;
+ return;
printfield(buf, 2, 2, CARD16, "sequence number");
printfield(buf, 4, 4, DVALUE4((n + p) / 4), "reply length");
}
void
-AudioNoOperation (
- const unsigned char *buf)
+AudioNoOperation(const unsigned char *buf)
{
- PrintField (buf, 0, 1, NASREQUEST, REQUESTHEADER);
+ PrintField(buf, 0, 1, NASREQUEST, REQUESTHEADER);
if (NasVerbose < 1)
- return;
+ return;
if (NasVerbose > 1)
- PrintField(SBf, 0, 4, CARD32, "sequence number");
+ PrintField(SBf, 0, 4, CARD32, "sequence number");
+
printfield(buf, 2, 2, DVALUE2(8 + n), "request length");
}
diff --git a/proto.h b/proto.h
index d86e55b..5232d59 100644
--- a/proto.h
+++ b/proto.h
@@ -2,300 +2,298 @@
#include <X11/Xfuncproto.h>
/* common.c */
-extern void enterprocedure (const char *s);
-extern void warn (const char *s);
-extern void panic (const char *s) _X_NORETURN;
-extern void SetSignalHandling (void);
-extern void SetUpConnectionSocket (int iport, void (*connectionFunc) (int));
+extern void enterprocedure(const char *s);
+extern void warn(const char *s);
+extern void panic(const char *s) _X_NORETURN;
+extern void SetSignalHandling(void);
+extern void SetUpConnectionSocket(int iport, void (*connectionFunc) (int));
/* decode11.c */
-extern void InitReplyQ (void);
-extern void FlushReplyQ (FD fd);
-extern short CheckReplyTable (FD fd, short SequenceNumber, short *minorp);
-extern void ReplyExpected (FD fd, short Request);
-extern void ExtendedReplyExpected (FD fd, short Request, short RequestMinor);
-extern void KeepLastReplyExpected (void);
+extern void InitReplyQ(void);
+extern void FlushReplyQ(FD fd);
+extern short CheckReplyTable(FD fd, short SequenceNumber, short *minorp);
+extern void ReplyExpected(FD fd, short Request);
+extern void ExtendedReplyExpected(FD fd, short Request, short RequestMinor);
+extern void KeepLastReplyExpected(void);
-extern void DecodeRequest (FD fd, const unsigned char *buf, long n);
-extern void DecodeReply (FD fd, const unsigned char *buf, long n);
-extern void DecodeError (FD fd, const unsigned char *buf, long n);
-extern void DecodeEvent (FD fd, const unsigned char *buf, long n);
+extern void DecodeRequest(FD fd, const unsigned char *buf, long n);
+extern void DecodeReply(FD fd, const unsigned char *buf, long n);
+extern void DecodeError(FD fd, const unsigned char *buf, long n);
+extern void DecodeEvent(FD fd, const unsigned char *buf, long n);
/* print11.c */
-extern void PrintSetUpMessage (const unsigned char *buf);
-extern void PrintSetUpReply (const unsigned char *buf);
+extern void PrintSetUpMessage(const unsigned char *buf);
+extern void PrintSetUpReply(const unsigned char *buf);
-extern void RequestError (const unsigned char *buf);
-extern void ValueError (const unsigned char *buf);
-extern void WindowError (const unsigned char *buf);
-extern void PixmapError (const unsigned char *buf);
-extern void AtomError (const unsigned char *buf);
-extern void CursorError (const unsigned char *buf);
-extern void FontError (const unsigned char *buf);
-extern void MatchError (const unsigned char *buf);
-extern void DrawableError (const unsigned char *buf);
-extern void AccessError (const unsigned char *buf);
-extern void AllocError (const unsigned char *buf);
-extern void ColormapError (const unsigned char *buf);
-extern void GContextError (const unsigned char *buf);
-extern void IDChoiceError (const unsigned char *buf);
-extern void NameError (const unsigned char *buf);
-extern void LengthError (const unsigned char *buf);
-extern void ImplementationError (const unsigned char *buf);
-extern void UnknownError (const unsigned char *buf);
+extern void RequestError(const unsigned char *buf);
+extern void ValueError(const unsigned char *buf);
+extern void WindowError(const unsigned char *buf);
+extern void PixmapError(const unsigned char *buf);
+extern void AtomError(const unsigned char *buf);
+extern void CursorError(const unsigned char *buf);
+extern void FontError(const unsigned char *buf);
+extern void MatchError(const unsigned char *buf);
+extern void DrawableError(const unsigned char *buf);
+extern void AccessError(const unsigned char *buf);
+extern void AllocError(const unsigned char *buf);
+extern void ColormapError(const unsigned char *buf);
+extern void GContextError(const unsigned char *buf);
+extern void IDChoiceError(const unsigned char *buf);
+extern void NameError(const unsigned char *buf);
+extern void LengthError(const unsigned char *buf);
+extern void ImplementationError(const unsigned char *buf);
+extern void UnknownError(const unsigned char *buf);
-extern void KeyPressEvent (const unsigned char *buf);
-extern void KeyReleaseEvent (const unsigned char *buf);
-extern void ButtonPressEvent (const unsigned char *buf);
-extern void ButtonReleaseEvent (const unsigned char *buf);
-extern void MotionNotifyEvent (const unsigned char *buf);
-extern void EnterNotifyEvent (const unsigned char *buf);
-extern void LeaveNotifyEvent (const unsigned char *buf);
-extern void FocusInEvent (const unsigned char *buf);
-extern void FocusOutEvent (const unsigned char *buf);
-extern void KeymapNotifyEvent (const unsigned char *buf);
-extern void ExposeEvent (const unsigned char *buf);
-extern void GraphicsExposureEvent (const unsigned char *buf);
-extern void NoExposureEvent (const unsigned char *buf);
-extern void VisibilityNotifyEvent (const unsigned char *buf);
-extern void CreateNotifyEvent (const unsigned char *buf);
-extern void DestroyNotifyEvent (const unsigned char *buf);
-extern void UnmapNotifyEvent (const unsigned char *buf);
-extern void MapNotifyEvent (const unsigned char *buf);
-extern void MapRequestEvent (const unsigned char *buf);
-extern void ReparentNotifyEvent (const unsigned char *buf);
-extern void ConfigureNotifyEvent (const unsigned char *buf);
-extern void ConfigureRequestEvent (const unsigned char *buf);
-extern void GravityNotifyEvent (const unsigned char *buf);
-extern void ResizeRequestEvent (const unsigned char *buf);
-extern void CirculateNotifyEvent (const unsigned char *buf);
-extern void CirculateRequestEvent (const unsigned char *buf);
-extern void PropertyNotifyEvent (const unsigned char *buf);
-extern void SelectionClearEvent (const unsigned char *buf);
-extern void SelectionRequestEvent (const unsigned char *buf);
-extern void SelectionNotifyEvent (const unsigned char *buf);
-extern void ColormapNotifyEvent (const unsigned char *buf);
-extern void ClientMessageEvent (const unsigned char *buf);
-extern void MappingNotifyEvent (const unsigned char *buf);
-extern void UnknownGenericEvent (const unsigned char *buf);
-extern void UnknownEvent (const unsigned char *buf);
+extern void KeyPressEvent(const unsigned char *buf);
+extern void KeyReleaseEvent(const unsigned char *buf);
+extern void ButtonPressEvent(const unsigned char *buf);
+extern void ButtonReleaseEvent(const unsigned char *buf);
+extern void MotionNotifyEvent(const unsigned char *buf);
+extern void EnterNotifyEvent(const unsigned char *buf);
+extern void LeaveNotifyEvent(const unsigned char *buf);
+extern void FocusInEvent(const unsigned char *buf);
+extern void FocusOutEvent(const unsigned char *buf);
+extern void KeymapNotifyEvent(const unsigned char *buf);
+extern void ExposeEvent(const unsigned char *buf);
+extern void GraphicsExposureEvent(const unsigned char *buf);
+extern void NoExposureEvent(const unsigned char *buf);
+extern void VisibilityNotifyEvent(const unsigned char *buf);
+extern void CreateNotifyEvent(const unsigned char *buf);
+extern void DestroyNotifyEvent(const unsigned char *buf);
+extern void UnmapNotifyEvent(const unsigned char *buf);
+extern void MapNotifyEvent(const unsigned char *buf);
+extern void MapRequestEvent(const unsigned char *buf);
+extern void ReparentNotifyEvent(const unsigned char *buf);
+extern void ConfigureNotifyEvent(const unsigned char *buf);
+extern void ConfigureRequestEvent(const unsigned char *buf);
+extern void GravityNotifyEvent(const unsigned char *buf);
+extern void ResizeRequestEvent(const unsigned char *buf);
+extern void CirculateNotifyEvent(const unsigned char *buf);
+extern void CirculateRequestEvent(const unsigned char *buf);
+extern void PropertyNotifyEvent(const unsigned char *buf);
+extern void SelectionClearEvent(const unsigned char *buf);
+extern void SelectionRequestEvent(const unsigned char *buf);
+extern void SelectionNotifyEvent(const unsigned char *buf);
+extern void ColormapNotifyEvent(const unsigned char *buf);
+extern void ClientMessageEvent(const unsigned char *buf);
+extern void MappingNotifyEvent(const unsigned char *buf);
+extern void UnknownGenericEvent(const unsigned char *buf);
+extern void UnknownEvent(const unsigned char *buf);
-extern void ExtendedRequest (int fd, const unsigned char *buf);
-extern void UnknownReply (const unsigned char *buf);
+extern void ExtendedRequest(int fd, const unsigned char *buf);
+extern void UnknownReply(const unsigned char *buf);
-extern void CreateWindow (FD fd, const unsigned char *buf);
-extern void ChangeWindowAttributes (FD fd, const unsigned char *buf);
-extern void GetWindowAttributes (FD fd, const unsigned char *buf);
-extern void GetWindowAttributesReply (const unsigned char *buf);
-extern void DestroyWindow (FD fd, const unsigned char *buf);
-extern void DestroySubwindows (FD fd, const unsigned char *buf);
-extern void ChangeSaveSet (FD fd, const unsigned char *buf);
-extern void ReparentWindow (FD fd, const unsigned char *buf);
-extern void MapWindow (FD fd, const unsigned char *buf);
-extern void MapSubwindows (FD fd, const unsigned char *buf);
-extern void UnmapWindow (FD fd, const unsigned char *buf);
-extern void UnmapSubwindows (FD fd, const unsigned char *buf);
-extern void ConfigureWindow (FD fd, const unsigned char *buf);
-extern void CirculateWindow (FD fd, const unsigned char *buf);
-extern void GetGeometry (FD fd, const unsigned char *buf);
-extern void GetGeometryReply (const unsigned char *buf);
-extern void QueryTree (FD fd, const unsigned char *buf);
-extern void QueryTreeReply (const unsigned char *buf);
-extern void InternAtom (FD fd, const unsigned char *buf);
-extern void InternAtomReply (const unsigned char *buf);
-extern void GetAtomName (FD fd, const unsigned char *buf);
-extern void GetAtomNameReply (const unsigned char *buf);
-extern void ChangeProperty (FD fd, const unsigned char *buf);
-extern void DeleteProperty (FD fd, const unsigned char *buf);
-extern void GetProperty (FD fd, const unsigned char *buf);
-extern void GetPropertyReply (const unsigned char *buf);
-extern void ListProperties (FD fd, const unsigned char *buf);
-extern void ListPropertiesReply (const unsigned char *buf);
-extern void SetSelectionOwner (FD fd, const unsigned char *buf);
-extern void GetSelectionOwner (FD fd, const unsigned char *buf);
-extern void GetSelectionOwnerReply (const unsigned char *buf);
-extern void ConvertSelection (FD fd, const unsigned char *buf);
-extern void SendEvent (FD fd, const unsigned char *buf);
-extern void GrabPointer (FD fd, const unsigned char *buf);
-extern void GrabPointerReply (const unsigned char *buf);
-extern void UngrabPointer (FD fd, const unsigned char *buf);
-extern void GrabButton (FD fd, const unsigned char *buf);
-extern void UngrabButton (FD fd, const unsigned char *buf);
-extern void ChangeActivePointerGrab (FD fd, const unsigned char *buf);
-extern void GrabKeyboard (FD fd, const unsigned char *buf);
-extern void GrabKeyboardReply (const unsigned char *buf);
-extern void UngrabKeyboard (FD fd, const unsigned char *buf);
-extern void GrabKey (FD fd, const unsigned char *buf);
-extern void UngrabKey (FD fd, const unsigned char *buf);
-extern void AllowEvents (FD fd, const unsigned char *buf);
-extern void GrabServer (FD fd, const unsigned char *buf);
-extern void UngrabServer (FD fd, const unsigned char *buf);
-extern void QueryPointer (FD fd, const unsigned char *buf);
-extern void QueryPointerReply (const unsigned char *buf);
-extern void GetMotionEvents (FD fd, const unsigned char *buf);
-extern void GetMotionEventsReply (const unsigned char *buf);
-extern void TranslateCoordinates (FD fd, const unsigned char *buf);
-extern void TranslateCoordinatesReply (const unsigned char *buf);
-extern void WarpPointer (FD fd, const unsigned char *buf);
-extern void SetInputFocus (FD fd, const unsigned char *buf);
-extern void GetInputFocus (FD fd, const unsigned char *buf);
-extern void GetInputFocusReply (const unsigned char *buf);
-extern void QueryKeymap (FD fd, const unsigned char *buf);
-extern void QueryKeymapReply (const unsigned char *buf);
-extern void OpenFont (FD fd, const unsigned char *buf);
-extern void CloseFont (FD fd, const unsigned char *buf);
-extern void QueryFont (FD fd, const unsigned char *buf);
-extern void QueryFontReply (const unsigned char *buf);
-extern void QueryTextExtents (FD fd, const unsigned char *buf);
-extern void QueryTextExtentsReply (const unsigned char *buf);
-extern void ListFonts (FD fd, const unsigned char *buf);
-extern void ListFontsReply (const unsigned char *buf);
-extern void ListFontsWithInfo (FD fd, const unsigned char *buf);
-extern void ListFontsWithInfoReply (const unsigned char *buf);
-extern void SetFontPath (FD fd, const unsigned char *buf);
-extern void GetFontPath (FD fd, const unsigned char *buf);
-extern void GetFontPathReply (const unsigned char *buf);
-extern void CreatePixmap (FD fd, const unsigned char *buf);
-extern void FreePixmap (FD fd, const unsigned char *buf);
-extern void CreateGC (FD fd, const unsigned char *buf);
-extern void ChangeGC (FD fd, const unsigned char *buf);
-extern void CopyGC (FD fd, const unsigned char *buf);
-extern void SetDashes (FD fd, const unsigned char *buf);
-extern void SetClipRectangles (FD fd, const unsigned char *buf);
-extern void FreeGC (FD fd, const unsigned char *buf);
-extern void ClearArea (FD fd, const unsigned char *buf);
-extern void CopyArea (FD fd, const unsigned char *buf);
-extern void CopyPlane (FD fd, const unsigned char *buf);
-extern void PolyPoint (FD fd, const unsigned char *buf);
-extern void PolyLine (FD fd, const unsigned char *buf);
-extern void PolySegment (FD fd, const unsigned char *buf);
-extern void PolyRectangle (FD fd, const unsigned char *buf);
-extern void PolyArc (FD fd, const unsigned char *buf);
-extern void FillPoly (FD fd, const unsigned char *buf);
-extern void PolyFillRectangle (FD fd, const unsigned char *buf);
-extern void PolyFillArc (FD fd, const unsigned char *buf);
-extern void PutImage (FD fd, const unsigned char *buf);
-extern void GetImage (FD fd, const unsigned char *buf);
-extern void GetImageReply (const unsigned char *buf);
-extern void PolyText8 (FD fd, const unsigned char *buf);
-extern void PolyText16 (FD fd, const unsigned char *buf);
-extern void ImageText8 (FD fd, const unsigned char *buf);
-extern void ImageText16 (FD fd, const unsigned char *buf);
-extern void CreateColormap (FD fd, const unsigned char *buf);
-extern void FreeColormap (FD fd, const unsigned char *buf);
-extern void CopyColormapAndFree (FD fd, const unsigned char *buf);
-extern void InstallColormap (FD fd, const unsigned char *buf);
-extern void UninstallColormap (FD fd, const unsigned char *buf);
-extern void ListInstalledColormaps (FD fd, const unsigned char *buf);
-extern void ListInstalledColormapsReply (const unsigned char *buf);
-extern void AllocColor (FD fd, const unsigned char *buf);
-extern void AllocColorReply (const unsigned char *buf);
-extern void AllocNamedColor (FD fd, const unsigned char *buf);
-extern void AllocNamedColorReply (const unsigned char *buf);
-extern void AllocColorCells (FD fd, const unsigned char *buf);
-extern void AllocColorCellsReply (const unsigned char *buf);
-extern void AllocColorPlanes (FD fd, const unsigned char *buf);
-extern void AllocColorPlanesReply (const unsigned char *buf);
-extern void FreeColors (FD fd, const unsigned char *buf);
-extern void StoreColors (FD fd, const unsigned char *buf);
-extern void StoreNamedColor (FD fd, const unsigned char *buf);
-extern void QueryColors (FD fd, const unsigned char *buf);
-extern void QueryColorsReply (const unsigned char *buf);
-extern void LookupColor (FD fd, const unsigned char *buf);
-extern void LookupColorReply (const unsigned char *buf);
-extern void CreateCursor (FD fd, const unsigned char *buf);
-extern void CreateGlyphCursor (FD fd, const unsigned char *buf);
-extern void FreeCursor (FD fd, const unsigned char *buf);
-extern void RecolorCursor (FD fd, const unsigned char *buf);
-extern void QueryBestSize (FD fd, const unsigned char *buf);
-extern void QueryBestSizeReply (const unsigned char *buf);
-extern void QueryExtension (FD fd, const unsigned char *buf);
-extern void QueryExtensionReply (const unsigned char *buf);
-extern void ListExtensions (FD fd, const unsigned char *buf);
-extern void ListExtensionsReply (const unsigned char *buf);
-extern void ChangeKeyboardMapping (FD fd, const unsigned char *buf);
-extern void GetKeyboardMapping (FD fd, const unsigned char *buf);
-extern void GetKeyboardMappingReply (const unsigned char *buf);
-extern void ChangeKeyboardControl (FD fd, const unsigned char *buf);
-extern void GetKeyboardControl (FD fd, const unsigned char *buf);
-extern void GetKeyboardControlReply (const unsigned char *buf);
-extern void Bell (FD fd, const unsigned char *buf);
-extern void ChangePointerControl (FD fd, const unsigned char *buf);
-extern void GetPointerControl (FD fd, const unsigned char *buf);
-extern void GetPointerControlReply (const unsigned char *buf);
-extern void SetScreenSaver (FD fd, const unsigned char *buf);
-extern void GetScreenSaver (FD fd, const unsigned char *buf);
-extern void GetScreenSaverReply (const unsigned char *buf);
-extern void ChangeHosts (FD fd, const unsigned char *buf);
-extern void ListHosts (FD fd, const unsigned char *buf);
-extern void ListHostsReply (const unsigned char *buf);
-extern void SetAccessControl (FD fd, const unsigned char *buf);
-extern void SetCloseDownMode (FD fd, const unsigned char *buf);
-extern void KillClient (FD fd, const unsigned char *buf);
-extern void RotateProperties (FD fd, const unsigned char *buf);
-extern void ForceScreenSaver (FD fd, const unsigned char *buf);
-extern void SetPointerMapping (FD fd, const unsigned char *buf);
-extern void SetPointerMappingReply (const unsigned char *buf);
-extern void GetPointerMapping (FD fd, const unsigned char *buf);
-extern void GetPointerMappingReply (const unsigned char *buf);
-extern void SetModifierMapping (FD fd, const unsigned char *buf);
-extern void SetModifierMappingReply (const unsigned char *buf);
-extern void GetModifierMapping (FD fd, const unsigned char *buf);
-extern void GetModifierMappingReply (const unsigned char *buf);
-extern void NoOperation (FD fd, const unsigned char *buf);
+extern void CreateWindow(FD fd, const unsigned char *buf);
+extern void ChangeWindowAttributes(FD fd, const unsigned char *buf);
+extern void GetWindowAttributes(FD fd, const unsigned char *buf);
+extern void GetWindowAttributesReply(const unsigned char *buf);
+extern void DestroyWindow(FD fd, const unsigned char *buf);
+extern void DestroySubwindows(FD fd, const unsigned char *buf);
+extern void ChangeSaveSet(FD fd, const unsigned char *buf);
+extern void ReparentWindow(FD fd, const unsigned char *buf);
+extern void MapWindow(FD fd, const unsigned char *buf);
+extern void MapSubwindows(FD fd, const unsigned char *buf);
+extern void UnmapWindow(FD fd, const unsigned char *buf);
+extern void UnmapSubwindows(FD fd, const unsigned char *buf);
+extern void ConfigureWindow(FD fd, const unsigned char *buf);
+extern void CirculateWindow(FD fd, const unsigned char *buf);
+extern void GetGeometry(FD fd, const unsigned char *buf);
+extern void GetGeometryReply(const unsigned char *buf);
+extern void QueryTree(FD fd, const unsigned char *buf);
+extern void QueryTreeReply(const unsigned char *buf);
+extern void InternAtom(FD fd, const unsigned char *buf);
+extern void InternAtomReply(const unsigned char *buf);
+extern void GetAtomName(FD fd, const unsigned char *buf);
+extern void GetAtomNameReply(const unsigned char *buf);
+extern void ChangeProperty(FD fd, const unsigned char *buf);
+extern void DeleteProperty(FD fd, const unsigned char *buf);
+extern void GetProperty(FD fd, const unsigned char *buf);
+extern void GetPropertyReply(const unsigned char *buf);
+extern void ListProperties(FD fd, const unsigned char *buf);
+extern void ListPropertiesReply(const unsigned char *buf);
+extern void SetSelectionOwner(FD fd, const unsigned char *buf);
+extern void GetSelectionOwner(FD fd, const unsigned char *buf);
+extern void GetSelectionOwnerReply(const unsigned char *buf);
+extern void ConvertSelection(FD fd, const unsigned char *buf);
+extern void SendEvent(FD fd, const unsigned char *buf);
+extern void GrabPointer(FD fd, const unsigned char *buf);
+extern void GrabPointerReply(const unsigned char *buf);
+extern void UngrabPointer(FD fd, const unsigned char *buf);
+extern void GrabButton(FD fd, const unsigned char *buf);
+extern void UngrabButton(FD fd, const unsigned char *buf);
+extern void ChangeActivePointerGrab(FD fd, const unsigned char *buf);
+extern void GrabKeyboard(FD fd, const unsigned char *buf);
+extern void GrabKeyboardReply(const unsigned char *buf);
+extern void UngrabKeyboard(FD fd, const unsigned char *buf);
+extern void GrabKey(FD fd, const unsigned char *buf);
+extern void UngrabKey(FD fd, const unsigned char *buf);
+extern void AllowEvents(FD fd, const unsigned char *buf);
+extern void GrabServer(FD fd, const unsigned char *buf);
+extern void UngrabServer(FD fd, const unsigned char *buf);
+extern void QueryPointer(FD fd, const unsigned char *buf);
+extern void QueryPointerReply(const unsigned char *buf);
+extern void GetMotionEvents(FD fd, const unsigned char *buf);
+extern void GetMotionEventsReply(const unsigned char *buf);
+extern void TranslateCoordinates(FD fd, const unsigned char *buf);
+extern void TranslateCoordinatesReply(const unsigned char *buf);
+extern void WarpPointer(FD fd, const unsigned char *buf);
+extern void SetInputFocus(FD fd, const unsigned char *buf);
+extern void GetInputFocus(FD fd, const unsigned char *buf);
+extern void GetInputFocusReply(const unsigned char *buf);
+extern void QueryKeymap(FD fd, const unsigned char *buf);
+extern void QueryKeymapReply(const unsigned char *buf);
+extern void OpenFont(FD fd, const unsigned char *buf);
+extern void CloseFont(FD fd, const unsigned char *buf);
+extern void QueryFont(FD fd, const unsigned char *buf);
+extern void QueryFontReply(const unsigned char *buf);
+extern void QueryTextExtents(FD fd, const unsigned char *buf);
+extern void QueryTextExtentsReply(const unsigned char *buf);
+extern void ListFonts(FD fd, const unsigned char *buf);
+extern void ListFontsReply(const unsigned char *buf);
+extern void ListFontsWithInfo(FD fd, const unsigned char *buf);
+extern void ListFontsWithInfoReply(const unsigned char *buf);
+extern void SetFontPath(FD fd, const unsigned char *buf);
+extern void GetFontPath(FD fd, const unsigned char *buf);
+extern void GetFontPathReply(const unsigned char *buf);
+extern void CreatePixmap(FD fd, const unsigned char *buf);
+extern void FreePixmap(FD fd, const unsigned char *buf);
+extern void CreateGC(FD fd, const unsigned char *buf);
+extern void ChangeGC(FD fd, const unsigned char *buf);
+extern void CopyGC(FD fd, const unsigned char *buf);
+extern void SetDashes(FD fd, const unsigned char *buf);
+extern void SetClipRectangles(FD fd, const unsigned char *buf);
+extern void FreeGC(FD fd, const unsigned char *buf);
+extern void ClearArea(FD fd, const unsigned char *buf);
+extern void CopyArea(FD fd, const unsigned char *buf);
+extern void CopyPlane(FD fd, const unsigned char *buf);
+extern void PolyPoint(FD fd, const unsigned char *buf);
+extern void PolyLine(FD fd, const unsigned char *buf);
+extern void PolySegment(FD fd, const unsigned char *buf);
+extern void PolyRectangle(FD fd, const unsigned char *buf);
+extern void PolyArc(FD fd, const unsigned char *buf);
+extern void FillPoly(FD fd, const unsigned char *buf);
+extern void PolyFillRectangle(FD fd, const unsigned char *buf);
+extern void PolyFillArc(FD fd, const unsigned char *buf);
+extern void PutImage(FD fd, const unsigned char *buf);
+extern void GetImage(FD fd, const unsigned char *buf);
+extern void GetImageReply(const unsigned char *buf);
+extern void PolyText8(FD fd, const unsigned char *buf);
+extern void PolyText16(FD fd, const unsigned char *buf);
+extern void ImageText8(FD fd, const unsigned char *buf);
+extern void ImageText16(FD fd, const unsigned char *buf);
+extern void CreateColormap(FD fd, const unsigned char *buf);
+extern void FreeColormap(FD fd, const unsigned char *buf);
+extern void CopyColormapAndFree(FD fd, const unsigned char *buf);
+extern void InstallColormap(FD fd, const unsigned char *buf);
+extern void UninstallColormap(FD fd, const unsigned char *buf);
+extern void ListInstalledColormaps(FD fd, const unsigned char *buf);
+extern void ListInstalledColormapsReply(const unsigned char *buf);
+extern void AllocColor(FD fd, const unsigned char *buf);
+extern void AllocColorReply(const unsigned char *buf);
+extern void AllocNamedColor(FD fd, const unsigned char *buf);
+extern void AllocNamedColorReply(const unsigned char *buf);
+extern void AllocColorCells(FD fd, const unsigned char *buf);
+extern void AllocColorCellsReply(const unsigned char *buf);
+extern void AllocColorPlanes(FD fd, const unsigned char *buf);
+extern void AllocColorPlanesReply(const unsigned char *buf);
+extern void FreeColors(FD fd, const unsigned char *buf);
+extern void StoreColors(FD fd, const unsigned char *buf);
+extern void StoreNamedColor(FD fd, const unsigned char *buf);
+extern void QueryColors(FD fd, const unsigned char *buf);
+extern void QueryColorsReply(const unsigned char *buf);
+extern void LookupColor(FD fd, const unsigned char *buf);
+extern void LookupColorReply(const unsigned char *buf);
+extern void CreateCursor(FD fd, const unsigned char *buf);
+extern void CreateGlyphCursor(FD fd, const unsigned char *buf);
+extern void FreeCursor(FD fd, const unsigned char *buf);
+extern void RecolorCursor(FD fd, const unsigned char *buf);
+extern void QueryBestSize(FD fd, const unsigned char *buf);
+extern void QueryBestSizeReply(const unsigned char *buf);
+extern void QueryExtension(FD fd, const unsigned char *buf);
+extern void QueryExtensionReply(const unsigned char *buf);
+extern void ListExtensions(FD fd, const unsigned char *buf);
+extern void ListExtensionsReply(const unsigned char *buf);
+extern void ChangeKeyboardMapping(FD fd, const unsigned char *buf);
+extern void GetKeyboardMapping(FD fd, const unsigned char *buf);
+extern void GetKeyboardMappingReply(const unsigned char *buf);
+extern void ChangeKeyboardControl(FD fd, const unsigned char *buf);
+extern void GetKeyboardControl(FD fd, const unsigned char *buf);
+extern void GetKeyboardControlReply(const unsigned char *buf);
+extern void Bell(FD fd, const unsigned char *buf);
+extern void ChangePointerControl(FD fd, const unsigned char *buf);
+extern void GetPointerControl(FD fd, const unsigned char *buf);
+extern void GetPointerControlReply(const unsigned char *buf);
+extern void SetScreenSaver(FD fd, const unsigned char *buf);
+extern void GetScreenSaver(FD fd, const unsigned char *buf);
+extern void GetScreenSaverReply(const unsigned char *buf);
+extern void ChangeHosts(FD fd, const unsigned char *buf);
+extern void ListHosts(FD fd, const unsigned char *buf);
+extern void ListHostsReply(const unsigned char *buf);
+extern void SetAccessControl(FD fd, const unsigned char *buf);
+extern void SetCloseDownMode(FD fd, const unsigned char *buf);
+extern void KillClient(FD fd, const unsigned char *buf);
+extern void RotateProperties(FD fd, const unsigned char *buf);
+extern void ForceScreenSaver(FD fd, const unsigned char *buf);
+extern void SetPointerMapping(FD fd, const unsigned char *buf);
+extern void SetPointerMappingReply(const unsigned char *buf);
+extern void GetPointerMapping(FD fd, const unsigned char *buf);
+extern void GetPointerMappingReply(const unsigned char *buf);
+extern void SetModifierMapping(FD fd, const unsigned char *buf);
+extern void SetModifierMappingReply(const unsigned char *buf);
+extern void GetModifierMapping(FD fd, const unsigned char *buf);
+extern void GetModifierMappingReply(const unsigned char *buf);
+extern void NoOperation(FD fd, const unsigned char *buf);
/* prtype.c */
-extern void SetIndentLevel (short which);
-extern void DumpHexBuffer (const unsigned char *buf, long n);
-extern void DumpItem (const char *name, FD fd,
- const unsigned char *buf, long n);
-extern void PrintField (const unsigned char *buf, short start, short length,
- short FieldType, const char *name);
-extern int PrintBytes (const unsigned char *buf, long number,
- const char *name);
-extern void PrintValues (const unsigned char *control, int clength, int ctype,
- const unsigned char *values, const char *name);
-extern void PrintTextList8 (const unsigned char *buf, int length,
- const char *name);
-extern void PrintTextList16 (const unsigned char *buf, int length,
- const char *name);
+extern void SetIndentLevel(short which);
+extern void DumpHexBuffer(const unsigned char *buf, long n);
+extern void DumpItem(const char *name, FD fd, const unsigned char *buf, long n);
+extern void PrintField(const unsigned char *buf, short start, short length,
+ short FieldType, const char *name);
+extern int PrintBytes(const unsigned char *buf, long number, const char *name);
+extern void PrintValues(const unsigned char *control, int clength, int ctype,
+ const unsigned char *values, const char *name);
+extern void PrintTextList8(const unsigned char *buf, int length,
+ const char *name);
+extern void PrintTextList16(const unsigned char *buf, int length,
+ const char *name);
/* scope.c */
-extern void TestBreakPoints (const unsigned char *buf, long n);
-extern void TimerExpired (void);
-extern void SetUpPair (FD client, FD server);
-extern FD FDPair (FD fd);
-extern FD ClientHalf (FD fd);
-extern FD ServerHalf (FD fd);
-extern const char *ClientName (FD fd);
-extern int ClientNumber (FD fd);
-extern void NewConnection (FD fd);
-extern void FlushFD (FD fd);
-extern short GetServerport (void);
-extern void ReadCommands (void);
+extern void TestBreakPoints(const unsigned char *buf, long n);
+extern void TimerExpired(void);
+extern void SetUpPair(FD client, FD server);
+extern FD FDPair(FD fd);
+extern FD ClientHalf(FD fd);
+extern FD ServerHalf(FD fd);
+extern const char *ClientName(FD fd);
+extern int ClientNumber(FD fd);
+extern void NewConnection(FD fd);
+extern void FlushFD(FD fd);
+extern short GetServerport(void);
+extern void ReadCommands(void);
/* server.c */
-extern FD ConnectToServer (Boolean report);
-extern void ProcessBuffer (FD fd, const unsigned char *buf, long n);
-extern void ReportFromClient (FD fd, const unsigned char *buf, long n);
-extern void ReportFromServer (FD fd, const unsigned char *buf, long n);
-extern void PrintTime (void);
-extern void SetBufLimit (FD fd);
-extern void ClearBufLimit (FD fd);
-extern void StartClientConnection (FD fd);
-extern void StopClientConnection (FD fd);
-extern void StartServerConnection (FD fd);
-extern void StopServerConnection (FD fd);
-extern long StartSetUpMessage (FD fd, const unsigned char *buf, long n);
-extern long StartSetUpReply (FD fd, const unsigned char *buf, long n);
+extern FD ConnectToServer(Boolean report);
+extern void ProcessBuffer(FD fd, const unsigned char *buf, long n);
+extern void ReportFromClient(FD fd, const unsigned char *buf, long n);
+extern void ReportFromServer(FD fd, const unsigned char *buf, long n);
+extern void PrintTime(void);
+extern void SetBufLimit(FD fd);
+extern void ClearBufLimit(FD fd);
+extern void StartClientConnection(FD fd);
+extern void StopClientConnection(FD fd);
+extern void StartServerConnection(FD fd);
+extern void StopServerConnection(FD fd);
+extern long StartSetUpMessage(FD fd, const unsigned char *buf, long n);
+extern long StartSetUpReply(FD fd, const unsigned char *buf, long n);
-extern long GetXRequestFromName (const char *name);
+extern long GetXRequestFromName(const char *name);
/* table11.c */
-extern void InitializeX11 (void);
-extern TYPE DefineType (short typeid, short class, const char *name,
- int (*printproc)(const unsigned char *));
-extern void DefineEValue (TYPE type, long value, const char *name);
-extern void DefineValues (TYPE type, long value, short length,
- short ctype, const char *name);
-extern long GetEValue (short typeid, const char *name);
+extern void InitializeX11(void);
+extern TYPE DefineType(short typeid, short class, const char *name,
+ int (*printproc) (const unsigned char *));
+extern void DefineEValue(TYPE type, long value, const char *name);
+extern void DefineValues(TYPE type, long value, short length,
+ short ctype, const char *name);
+extern long GetEValue(short typeid, const char *name);
diff --git a/prtype.c b/prtype.c
index be80806..1fb917d 100644
--- a/prtype.c
+++ b/prtype.c
@@ -1,8 +1,8 @@
-/* ************************************************** *
- * *
- * Type Printing for X11 protocol *
- * *
- * James Peterson, 1988 *
+/*
+ * Type Printing for X11 protocol
+ *
+ * James Peterson, 1988
+ *
* Copyright (C) 1988 MCC
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -22,7 +22,9 @@
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
- * *
+ *
+ */
+/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -44,7 +46,7 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
- * ************************************************** */
+ */
#include "scope.h"
#include "x11.h"
@@ -66,48 +68,42 @@
/* */
/* ************************************************************ */
-
/* print representation of a character for debugging */
static const char *
-printrep (unsigned short c)
+printrep(unsigned short c)
{
- static char pr[8];
-
- if (c < 32)
- {
- /* control characters */
- pr[0] = '^';
- pr[1] = c + 64;
- pr[2] = '\0';
+ static char pr[8];
+
+ if (c < 32) {
+ /* control characters */
+ pr[0] = '^';
+ pr[1] = c + 64;
+ pr[2] = '\0';
+ }
+ else if (c < 127) {
+ /* printing characters */
+ pr[0] = (char) c;
+ pr[1] = '\0';
}
- else if (c < 127)
- {
- /* printing characters */
- pr[0] = (char) c;
- pr[1] = '\0';
- }
else if (c == 127)
- return("<del>");
- else if (c <= 0377)
- {
- /* upper 128 codes from 128 to 255; print as \ooo - octal */
- pr[0] = '\\';
- pr[3] = '0' + (c & 7);
- c = c >> 3;
- pr[2] = '0' + (c & 7);
- c = c >> 3;
- pr[1] = '0' + (c & 3);
- pr[4] = '\0';
- }
- else
- {
- /* very large number -- print as 0xffff - 4 digit hex */
- sprintf(pr, "0x%04x", c);
- }
- return(pr);
+ return ("<del>");
+ else if (c <= 0377) {
+ /* upper 128 codes from 128 to 255; print as \ooo - octal */
+ pr[0] = '\\';
+ pr[3] = '0' + (c & 7);
+ c = c >> 3;
+ pr[2] = '0' + (c & 7);
+ c = c >> 3;
+ pr[1] = '0' + (c & 3);
+ pr[4] = '\0';
+ }
+ else {
+ /* very large number -- print as 0xffff - 4 digit hex */
+ sprintf(pr, "0x%04x", c);
+ }
+ return (pr);
}
-
/* ************************************************************ */
/* */
/* */
@@ -125,40 +121,38 @@ printrep (unsigned short c)
#define MaxIndent 10
char Leader[MaxIndent + 1];
-static short CurrentLevel = 0;
+static short CurrentLevel = 0;
void
-SetIndentLevel (
- short which)
+SetIndentLevel(short which)
{
- short i;
-
- if (which > MaxIndent)
- which = MaxIndent;
- if (which < 0)
- which = 0;
- if (which == CurrentLevel)
- return;
-
- /* set the indent level to <which> */
- /* -> set the Print Leader to <which> tabs */
- for (i = 0; i < which; i++)
- Leader[i] = '\t';
- Leader[which] = '\0';
- CurrentLevel = which;
+ short i;
+
+ if (which > MaxIndent)
+ which = MaxIndent;
+ if (which < 0)
+ which = 0;
+ if (which == CurrentLevel)
+ return;
+
+ /* set the indent level to <which> */
+ /* -> set the Print Leader to <which> tabs */
+ for (i = 0; i < which; i++)
+ Leader[i] = '\t';
+ Leader[which] = '\0';
+ CurrentLevel = which;
}
static void
-ModifyIndentLevel (
- short amount)
+ModifyIndentLevel(short amount)
{
- SetIndentLevel(CurrentLevel + amount);
+ SetIndentLevel(CurrentLevel + amount);
}
static short
-SizeofLeader (void)
+SizeofLeader(void)
{
- return (CurrentLevel * 8);
+ return (CurrentLevel * 8);
}
/* ************************************************************ */
@@ -169,19 +163,15 @@ SizeofLeader (void)
/* if we want verbose enough output, we will dump the buffer in hex */
void
-DumpItem (
- const char *name,
- FD fd,
- const unsigned char *buf,
- long n)
+DumpItem(const char *name, FD fd, const unsigned char *buf, long n)
{
- if (n == 0)
- return;
+ if (n == 0)
+ return;
- fprintf(stdout, "%s%20s (fd %d): ", Leader, name, fd);
+ fprintf(stdout, "%s%20s (fd %d): ", Leader, name, fd);
- DumpHexBuffer(buf, n);
- fprintf(stdout, "\n");
+ DumpHexBuffer(buf, n);
+ fprintf(stdout, "\n");
}
/* ************************************************************ */
@@ -192,32 +182,35 @@ DumpItem (
int
PrintINT8(const unsigned char *buf)
{
- /* print a INT8 -- 8-bit signed integer */
- short n = IByte (buf);
- if (n > 127)
- n = 256 - n;
- fprintf(stdout, "%d", n);
- return 1;
+ /* print a INT8 -- 8-bit signed integer */
+ short n = IByte(buf);
+
+ if (n > 127)
+ n = 256 - n;
+ fprintf(stdout, "%d", n);
+ return 1;
}
int
PrintINT16(const unsigned char *buf)
{
- /* print a INT16 -- 16-bit signed integer */
- long n = IShort (buf);
- if (n > 32767)
- n = 65536 - n;
- fprintf(stdout, "%ld", n);
- return 2;
+ /* print a INT16 -- 16-bit signed integer */
+ long n = IShort(buf);
+
+ if (n > 32767)
+ n = 65536 - n;
+ fprintf(stdout, "%ld", n);
+ return 2;
}
int
PrintINT32(const unsigned char *buf)
{
- /* print a INT32 -- 32-bit signed integer */
- long n = ILong (buf);
- fprintf(stdout, "%ld", n);
- return 4;
+ /* print a INT32 -- 32-bit signed integer */
+ long n = ILong(buf);
+
+ fprintf(stdout, "%ld", n);
+ return 4;
}
/* ************************************************************ */
@@ -225,28 +218,31 @@ PrintINT32(const unsigned char *buf)
int
PrintCARD8(const unsigned char *buf)
{
- /* print a CARD8 -- 8-bit unsigned integer */
- unsigned short n = IByte (buf);
- fprintf(stdout, "%02x", (unsigned)(n & 0xff));
- return 1;
+ /* print a CARD8 -- 8-bit unsigned integer */
+ unsigned short n = IByte(buf);
+
+ fprintf(stdout, "%02x", (unsigned) (n & 0xff));
+ return 1;
}
int
PrintCARD16(const unsigned char *buf)
{
- /* print a CARD16 -- 16-bit unsigned integer */
- unsigned long n = IShort (buf);
- fprintf(stdout, "%04x", (unsigned)(n & 0xffff));
- return 1;
+ /* print a CARD16 -- 16-bit unsigned integer */
+ unsigned long n = IShort(buf);
+
+ fprintf(stdout, "%04x", (unsigned) (n & 0xffff));
+ return 1;
}
int
PrintCARD32(const unsigned char *buf)
{
- /* print a CARD32 -- 32-bit unsigned integer */
- unsigned long n = ILong (buf);
- fprintf(stdout, "%08lx", n);
- return(4);
+ /* print a CARD32 -- 32-bit unsigned integer */
+ unsigned long n = ILong(buf);
+
+ fprintf(stdout, "%08lx", n);
+ return (4);
}
/* ************************************************************ */
@@ -254,43 +250,45 @@ PrintCARD32(const unsigned char *buf)
int
PrintBYTE(const unsigned char *buf)
{
- /* print a BYTE -- 8-bit value */
- short n = IByte (buf);
- fprintf(stdout, "%02x", n);
- return(1);
-}
+ /* print a BYTE -- 8-bit value */
+ short n = IByte(buf);
+ fprintf(stdout, "%02x", n);
+ return (1);
+}
int
PrintCHAR8(const unsigned char *buf)
{
- /* print a CHAR8 -- 8-bit character */
- unsigned short n = IByte (buf);
- fprintf(stdout, "%s", printrep(n));
- return(1);
-}
+ /* print a CHAR8 -- 8-bit character */
+ unsigned short n = IByte(buf);
+ fprintf(stdout, "%s", printrep(n));
+ return (1);
+}
int
PrintSTRING16(const unsigned char *buf)
{
- /* print a CHAR2B -- 16-bit character which is never byte-swapped */
- unsigned short n = IChar2B (buf);
- fprintf(stdout, "%s", printrep(n));
- return 2 + n;
+ /* print a CHAR2B -- 16-bit character which is never byte-swapped */
+ unsigned short n = IChar2B(buf);
+
+ fprintf(stdout, "%s", printrep(n));
+ return 2 + n;
}
int
PrintSTR(const unsigned char *buf)
{
- /* STR have the length (1 byte) then a string of CHAR8 */
- short n;
- short i;
-
- n = IByte(buf++);
- for (i = 0; i < n; i++)
- fprintf(stdout, "%s", printrep(buf[i]));
- return(n+1);
+ /* STR have the length (1 byte) then a string of CHAR8 */
+ short n;
+
+ short i;
+
+ n = IByte(buf++);
+ for (i = 0; i < n; i++)
+ fprintf(stdout, "%s", printrep(buf[i]));
+ return (n + 1);
}
/* ************************************************************ */
@@ -298,184 +296,190 @@ PrintSTR(const unsigned char *buf)
int
PrintWINDOW(const unsigned char *buf)
{
- /* print a WINDOW -- CARD32 plus 0 = None */
- long n = ILong (buf);
- if (n == 0)
- fprintf(stdout, "None");
- else
- fprintf(stdout, "WIN %08lx", n);
- return(4);
+ /* print a WINDOW -- CARD32 plus 0 = None */
+ long n = ILong(buf);
+
+ if (n == 0)
+ fprintf(stdout, "None");
+ else
+ fprintf(stdout, "WIN %08lx", n);
+ return (4);
}
int
PrintWINDOWD(const unsigned char *buf)
{
- /* print a WINDOWD -- CARD32 plus 0 = PointerWindow, 1 = InputFocus */
- long n = ILong (buf);
- if (n == 0)
- fprintf(stdout, "PointerWindow");
- else if (n == 1)
- fprintf(stdout, "InputFocus");
+ /* print a WINDOWD -- CARD32 plus 0 = PointerWindow, 1 = InputFocus */
+ long n = ILong(buf);
+
+ if (n == 0)
+ fprintf(stdout, "PointerWindow");
+ else if (n == 1)
+ fprintf(stdout, "InputFocus");
else
- (void)PrintWINDOW(buf);
- return 4;
+ (void) PrintWINDOW(buf);
+ return 4;
}
int
PrintWINDOWNR(const unsigned char *buf)
{
- /* print a WINDOWNR -- CARD32 plus 0 = None, 1 = PointerRoot */
- long n = ILong (buf);
- if (n == 0)
- fprintf(stdout, "None");
- else if (n == 1)
- fprintf(stdout, "PointerRoot");
+ /* print a WINDOWNR -- CARD32 plus 0 = None, 1 = PointerRoot */
+ long n = ILong(buf);
+
+ if (n == 0)
+ fprintf(stdout, "None");
+ else if (n == 1)
+ fprintf(stdout, "PointerRoot");
else
- (void)PrintWINDOW(buf);
- return 4;
+ (void) PrintWINDOW(buf);
+ return 4;
}
-
int
PrintPIXMAP(const unsigned char *buf)
{
- /* print a PIXMAP -- CARD32 plus 0 = None */
- long n = ILong (buf);
- if (n == 0)
- fprintf(stdout, "None");
- else
- fprintf(stdout, "PXM %08lx", n);
- return 4;
+ /* print a PIXMAP -- CARD32 plus 0 = None */
+ long n = ILong(buf);
+
+ if (n == 0)
+ fprintf(stdout, "None");
+ else
+ fprintf(stdout, "PXM %08lx", n);
+ return 4;
}
int
PrintPIXMAPNPR(const unsigned char *buf)
{
- /* print a PIXMAPNPR -- CARD32 plus 0 = None, 1 = ParentRelative */
- long n = ILong (buf);
- if (n == 0)
- fprintf(stdout, "None");
- else if (n == 1)
- fprintf(stdout, "ParentRelative");
+ /* print a PIXMAPNPR -- CARD32 plus 0 = None, 1 = ParentRelative */
+ long n = ILong(buf);
+
+ if (n == 0)
+ fprintf(stdout, "None");
+ else if (n == 1)
+ fprintf(stdout, "ParentRelative");
else
- PrintPIXMAP(buf);
- return 4;
+ PrintPIXMAP(buf);
+ return 4;
}
int
PrintPIXMAPC(const unsigned char *buf)
{
- /* print a PIXMAPC -- CARD32 plus 0 = CopyFromParent */
- long n = ILong (buf);
- if (n == 0)
- fprintf(stdout, "CopyFromParent");
- else
- PrintPIXMAP(buf);
- return 4;
-}
+ /* print a PIXMAPC -- CARD32 plus 0 = CopyFromParent */
+ long n = ILong(buf);
+ if (n == 0)
+ fprintf(stdout, "CopyFromParent");
+ else
+ PrintPIXMAP(buf);
+ return 4;
+}
int
PrintCURSOR(const unsigned char *buf)
{
- /* print a CURSOR -- CARD32 plus 0 = None */
- long n = ILong (buf);
- if (n == 0)
- fprintf(stdout, "None");
- else
- fprintf(stdout, "CUR %08lx", n);
- return 4;
-}
+ /* print a CURSOR -- CARD32 plus 0 = None */
+ long n = ILong(buf);
+ if (n == 0)
+ fprintf(stdout, "None");
+ else
+ fprintf(stdout, "CUR %08lx", n);
+ return 4;
+}
int
PrintFONT(const unsigned char *buf)
{
- /* print a FONT -- CARD32 plus 0 = None */
- long n = ILong (buf);
- if (n == 0)
- fprintf(stdout, "None");
- else
- fprintf(stdout, "FNT %08lx", n);
- return 4;
-}
+ /* print a FONT -- CARD32 plus 0 = None */
+ long n = ILong(buf);
+ if (n == 0)
+ fprintf(stdout, "None");
+ else
+ fprintf(stdout, "FNT %08lx", n);
+ return 4;
+}
int
PrintGCONTEXT(const unsigned char *buf)
{
- /* print a GCONTEXT -- CARD32 */
- long n = ILong (buf);
- fprintf(stdout, "GXC %08lx", n);
- return 4;
-}
+ /* print a GCONTEXT -- CARD32 */
+ long n = ILong(buf);
+ fprintf(stdout, "GXC %08lx", n);
+ return 4;
+}
int
PrintCOLORMAP(const unsigned char *buf)
{
- /* print a COLORMAP -- CARD32 plus 0 = None */
- long n = ILong (buf);
- if (n == 0)
- fprintf(stdout, "None");
- else
- fprintf(stdout, "CMP %08lx", n);
- return(4);
+ /* print a COLORMAP -- CARD32 plus 0 = None */
+ long n = ILong(buf);
+
+ if (n == 0)
+ fprintf(stdout, "None");
+ else
+ fprintf(stdout, "CMP %08lx", n);
+ return (4);
}
int
PrintCOLORMAPC(const unsigned char *buf)
{
- /* print a COLORMAPC -- CARD32 plus 0 = CopyFromParent */
- long n = ILong (buf);
- if (n == 0)
- fprintf(stdout, "CopyFromParent");
- else
- (void)PrintCOLORMAP(buf);
- return 4;
-}
+ /* print a COLORMAPC -- CARD32 plus 0 = CopyFromParent */
+ long n = ILong(buf);
+ if (n == 0)
+ fprintf(stdout, "CopyFromParent");
+ else
+ (void) PrintCOLORMAP(buf);
+ return 4;
+}
int
PrintDRAWABLE(const unsigned char *buf)
{
- /* print a DRAWABLE -- CARD32 */
- long n = ILong (buf);
- fprintf(stdout, "DWB %08lx", n);
- return 4;
+ /* print a DRAWABLE -- CARD32 */
+ long n = ILong(buf);
+
+ fprintf(stdout, "DWB %08lx", n);
+ return 4;
}
int
PrintFONTABLE(const unsigned char *buf)
{
- /* print a FONTABLE -- CARD32 */
- long n = ILong (buf);
- fprintf(stdout, "FTB %08lx", n);
- return 4;
+ /* print a FONTABLE -- CARD32 */
+ long n = ILong(buf);
+
+ fprintf(stdout, "FTB %08lx", n);
+ return 4;
}
/* ************************************************************ */
#define NumberofAtoms 68
-static const char * const AtomTable[NumberofAtoms + 1] =
-{
- "NONE", "PRIMARY", "SECONDARY", "ARC", "ATOM", "BITMAP", "CARDINAL",
- "COLORMAP", "CURSOR", "CUT_BUFFER0", "CUT_BUFFER1", "CUT_BUFFER2",
- "CUT_BUFFER3", "CUT_BUFFER4", "CUT_BUFFER5", "CUT_BUFFER6",
- "CUT_BUFFER7", "DRAWABLE", "FONT", "INTEGER", "PIXMAP", "POINT",
- "RECTANGLE", "RESOURCE_MANAGER", "RGB_COLOR_MAP", "RGB_BEST_MAP",
- "RGB_BLUE_MAP", "RGB_DEFAULT_MAP", "RGB_GRAY_MAP", "RGB_GREEN_MAP",
- "RGB_RED_MAP", "STRING", "VISUALID", "WINDOW", "WM_COMMAND",
- "WM_HINTS", "WM_CLIENT_MACHINE", "WM_ICON_NAME", "WM_ICON_SIZE",
- "WM_NAME", "WM_NORMAL_HINTS", "WM_SIZE_HINTS", "WM_ZOOM_HINTS",
- "MIN_SPACE", "NORM_SPACE", "MAX_SPACE", "END_SPACE", "SUPERSCRIPT_X",
- "SUPERSCRIPT_Y", "SUBSCRIPT_X", "SUBSCRIPT_Y", "UNDERLINE_POSITION",
- "UNDERLINE_THICKNESS", "STRIKEOUT_ASCENT", "STRIKEOUT_DESCENT",
- "ITALIC_ANGLE", "X_HEIGHT", "QUAD_WIDTH", "WEIGHT", "POINT_SIZE",
- "RESOLUTION", "COPYRIGHT", "NOTICE", "FONT_NAME", "FAMILY_NAME",
- "FULL_NAME", "CAP_HEIGHT", "WM_CLASS", "WM_TRANSIENT_FOR"
- };
+static const char *const AtomTable[NumberofAtoms + 1] = {
+ "NONE", "PRIMARY", "SECONDARY", "ARC", "ATOM", "BITMAP", "CARDINAL",
+ "COLORMAP", "CURSOR", "CUT_BUFFER0", "CUT_BUFFER1", "CUT_BUFFER2",
+ "CUT_BUFFER3", "CUT_BUFFER4", "CUT_BUFFER5", "CUT_BUFFER6",
+ "CUT_BUFFER7", "DRAWABLE", "FONT", "INTEGER", "PIXMAP", "POINT",
+ "RECTANGLE", "RESOURCE_MANAGER", "RGB_COLOR_MAP", "RGB_BEST_MAP",
+ "RGB_BLUE_MAP", "RGB_DEFAULT_MAP", "RGB_GRAY_MAP", "RGB_GREEN_MAP",
+ "RGB_RED_MAP", "STRING", "VISUALID", "WINDOW", "WM_COMMAND",
+ "WM_HINTS", "WM_CLIENT_MACHINE", "WM_ICON_NAME", "WM_ICON_SIZE",
+ "WM_NAME", "WM_NORMAL_HINTS", "WM_SIZE_HINTS", "WM_ZOOM_HINTS",
+ "MIN_SPACE", "NORM_SPACE", "MAX_SPACE", "END_SPACE", "SUPERSCRIPT_X",
+ "SUPERSCRIPT_Y", "SUBSCRIPT_X", "SUBSCRIPT_Y", "UNDERLINE_POSITION",
+ "UNDERLINE_THICKNESS", "STRIKEOUT_ASCENT", "STRIKEOUT_DESCENT",
+ "ITALIC_ANGLE", "X_HEIGHT", "QUAD_WIDTH", "WEIGHT", "POINT_SIZE",
+ "RESOLUTION", "COPYRIGHT", "NOTICE", "FONT_NAME", "FAMILY_NAME",
+ "FULL_NAME", "CAP_HEIGHT", "WM_CLASS", "WM_TRANSIENT_FOR"
+};
/* for atoms, we print the built-in atoms. We could expand to printing
the user defined ones, too. */
@@ -483,274 +487,265 @@ static const char * const AtomTable[NumberofAtoms + 1] =
int
PrintATOM(const unsigned char *buf)
{
- /* print a ATOM -- CARD32 plus 0 = None */
- long n = ILong (buf);
- if (0 <= n && n <= NumberofAtoms)
- fprintf(stdout, "<%s>", AtomTable[n]);
- else
- fprintf(stdout, "ATM %08lx", n);
- return(4);
+ /* print a ATOM -- CARD32 plus 0 = None */
+ long n = ILong(buf);
+
+ if (0 <= n && n <= NumberofAtoms)
+ fprintf(stdout, "<%s>", AtomTable[n]);
+ else
+ fprintf(stdout, "ATM %08lx", n);
+ return (4);
}
int
PrintATOMT(const unsigned char *buf)
{
- /* print a ATOMT -- CARD32 plus 0 = AnyPropertyType */
- long n = ILong (buf);
- if (n == 0)
- fprintf(stdout, "AnyPropertyType");
- else
- (void)PrintATOM(buf);
- return 4;
-}
+ /* print a ATOMT -- CARD32 plus 0 = AnyPropertyType */
+ long n = ILong(buf);
+ if (n == 0)
+ fprintf(stdout, "AnyPropertyType");
+ else
+ (void) PrintATOM(buf);
+ return 4;
+}
int
PrintVISUALID(const unsigned char *buf)
{
- /* print a VISUALID -- CARD32 plus 0 = None */
- long n = ILong (buf);
- if (n == 0)
- fprintf(stdout, "None");
- else
- fprintf(stdout, "VIS %08lx", n);
- return 4;
+ /* print a VISUALID -- CARD32 plus 0 = None */
+ long n = ILong(buf);
+
+ if (n == 0)
+ fprintf(stdout, "None");
+ else
+ fprintf(stdout, "VIS %08lx", n);
+ return 4;
}
int
PrintVISUALIDC(const unsigned char *buf)
{
- /* print a VISUALIDC -- CARD32 plus 0 = CopyFromParent */
- long n = ILong (buf);
- if (n == 0)
- fprintf(stdout, "CopyFromParent");
- else
- PrintVISUALID(buf);
- return 4;
-}
+ /* print a VISUALIDC -- CARD32 plus 0 = CopyFromParent */
+ long n = ILong(buf);
+ if (n == 0)
+ fprintf(stdout, "CopyFromParent");
+ else
+ PrintVISUALID(buf);
+ return 4;
+}
int
PrintTIMESTAMP(const unsigned char *buf)
{
- /* print a TIMESTAMP -- CARD32 plus 0 as the current time */
- long n = ILong (buf);
- if (n == 0)
- fprintf(stdout, "CurrentTime");
- else
- fprintf(stdout, "TIM %08lx", n);
- return 4;
-}
+ /* print a TIMESTAMP -- CARD32 plus 0 as the current time */
+ long n = ILong(buf);
+ if (n == 0)
+ fprintf(stdout, "CurrentTime");
+ else
+ fprintf(stdout, "TIM %08lx", n);
+ return 4;
+}
int
PrintRESOURCEID(const unsigned char *buf)
{
- /* print a RESOURCEID -- CARD32 plus 0 = AllTemporary */
- long n = ILong (buf);
- if (n == 0)
- fprintf(stdout, "AllTemporary");
- else
- fprintf(stdout, "RID %08lx", n);
- return 4;
-}
+ /* print a RESOURCEID -- CARD32 plus 0 = AllTemporary */
+ long n = ILong(buf);
+ if (n == 0)
+ fprintf(stdout, "AllTemporary");
+ else
+ fprintf(stdout, "RID %08lx", n);
+ return 4;
+}
int
PrintKEYSYM(const unsigned char *buf)
{
- /* print a KEYSYM -- CARD32 */
- long n = ILong (buf);
- fprintf(stdout, "KYS %08lx", n);
- return(4);
+ /* print a KEYSYM -- CARD32 */
+ long n = ILong(buf);
+
+ fprintf(stdout, "KYS %08lx", n);
+ return (4);
}
int
PrintKEYCODE(const unsigned char *buf)
{
- /* print a KEYCODE -- CARD8 */
- unsigned short n = IByte (buf);
- fprintf(stdout, "%d (%s)", n, printrep(n));
- return(1);
+ /* print a KEYCODE -- CARD8 */
+ unsigned short n = IByte(buf);
+
+ fprintf(stdout, "%d (%s)", n, printrep(n));
+ return (1);
}
int
PrintKEYCODEA(const unsigned char *buf)
{
- /* print a KEYCODEA -- CARD8 plus 0 = AnyKey */
- long n = IByte (buf);
- if (n == 0)
- fprintf(stdout, "AnyKey");
- else
- (void)PrintKEYCODE(buf);
- return 1;
-}
+ /* print a KEYCODEA -- CARD8 plus 0 = AnyKey */
+ long n = IByte(buf);
+ if (n == 0)
+ fprintf(stdout, "AnyKey");
+ else
+ (void) PrintKEYCODE(buf);
+ return 1;
+}
int
PrintBUTTON(const unsigned char *buf)
{
- /* print a BUTTON -- CARD8 */
- unsigned short n = IByte (buf);
- fprintf(stdout, "%d (%s)", n, printrep(n));
- return 1;
+ /* print a BUTTON -- CARD8 */
+ unsigned short n = IByte(buf);
+
+ fprintf(stdout, "%d (%s)", n, printrep(n));
+ return 1;
}
int
PrintBUTTONA(const unsigned char *buf)
{
- /* print a BUTTONA -- CARD8 plus 0 = AnyButton */
- long n = IByte (buf);
- if (n == 0)
- fprintf(stdout, "AnyButton");
- else
- PrintBUTTON(buf);
- return 1;
-}
+ /* print a BUTTONA -- CARD8 plus 0 = AnyButton */
+ long n = IByte(buf);
+ if (n == 0)
+ fprintf(stdout, "AnyButton");
+ else
+ PrintBUTTON(buf);
+ return 1;
+}
/* this is an interesting cheat -- we call DecodeEvent to print an event */
/* should work, but its never been tried */
int
PrintEVENTFORM(const unsigned char *buf)
{
- /* print an EVENT_FORM -- event format */
- DecodeEvent(-1, buf, (long)-1);
- return 32;
+ /* print an EVENT_FORM -- event format */
+ DecodeEvent(-1, buf, (long) -1);
+ return 32;
}
/* ************************************************************ */
int
-PrintENUMERATED(
- const unsigned char *buf,
- short length,
- struct ValueListEntry *ValueList)
+PrintENUMERATED(const unsigned char *buf,
+ short length, struct ValueListEntry *ValueList)
{
- long n;
- struct ValueListEntry *p;
+ long n;
+ struct ValueListEntry *p;
- if (length == 1)
- n = IByte(buf);
- else if (length == 2)
- n = IShort(buf);
+ if (length == 1)
+ n = IByte(buf);
+ else if (length == 2)
+ n = IShort(buf);
else
- n = ILong(buf);
+ n = ILong(buf);
- p = ValueList;
- while (p != NULL && p->Value != n)
- p = p->Next;
+ p = ValueList;
+ while (p != NULL && p->Value != n)
+ p = p->Next;
- if (p != NULL)
- fprintf(stdout, "%s", p->Name);
- else
- fprintf(stdout, "**INVALID** (%ld)", n);
+ if (p != NULL)
+ fprintf(stdout, "%s", p->Name);
+ else
+ fprintf(stdout, "**INVALID** (%ld)", n);
- return length;
+ return length;
}
/* ************************************************************ */
int
-PrintSET(
- const unsigned char *buf,
- short length,
- struct ValueListEntry *ValueList)
+PrintSET(const unsigned char *buf,
+ short length, struct ValueListEntry *ValueList)
{
- unsigned long n;
- struct ValueListEntry *p;
- Boolean MatchesAll = false;
- Boolean FoundOne = false;
-
- if (length == 1)
- n = IByte(buf);
- else if (length == 2)
- n = IShort(buf);
+ unsigned long n;
+ struct ValueListEntry *p;
+ Boolean MatchesAll = false;
+ Boolean FoundOne = false;
+
+ if (length == 1)
+ n = IByte(buf);
+ else if (length == 2)
+ n = IShort(buf);
else
- n = ILong(buf);
-
- if (n != 0)
- {
- /* first check if the value matches ALL of the bits. */
- MatchesAll = true;
- for (p = ValueList; MatchesAll && (p != NULL); p = p->Next)
- {
- if ((p->Value & n) == 0)
- MatchesAll = false;
- }
-
- if (!MatchesAll)
- /* if it matches some, but not all, print only those it matches */
- for (p = ValueList; p != NULL; p = p->Next)
- {
- if ((p->Value & n) != 0)
- {
- if (FoundOne)
- fprintf(stdout, " | ");
- fprintf(stdout, "%s", p->Name);
- FoundOne = true;
- }
- }
+ n = ILong(buf);
+
+ if (n != 0) {
+ /* first check if the value matches ALL of the bits. */
+ MatchesAll = true;
+ for (p = ValueList; MatchesAll && (p != NULL); p = p->Next) {
+ if ((p->Value & n) == 0)
+ MatchesAll = false;
+ }
+
+ if (!MatchesAll)
+ /* if it matches some, but not all, print only those it matches */
+ for (p = ValueList; p != NULL; p = p->Next) {
+ if ((p->Value & n) != 0) {
+ if (FoundOne)
+ fprintf(stdout, " | ");
+ fprintf(stdout, "%s", p->Name);
+ FoundOne = true;
+ }
+ }
}
- if (MatchesAll)
- fprintf(stdout, "<ALL>");
- else if (!FoundOne)
- fprintf(stdout, "0");
+ if (MatchesAll)
+ fprintf(stdout, "<ALL>");
+ else if (!FoundOne)
+ fprintf(stdout, "0");
- return length;
+ return length;
}
-
/* ************************************************************ */
/* */
/* */
/* ************************************************************ */
void
-PrintField (
- const unsigned char *buf,
- short start,
- short length,
- short FieldType,
- const char *name)
+PrintField(const unsigned char *buf,
+ short start, short length, short FieldType, const char *name)
{
- if (Verbose == 0)
- return;
-
- if (length == 0)
- return;
-
- fprintf(stdout, "%s%20s: ", Leader, name);
-
- if (debuglevel & 8)
- DumpHexBuffer(&(buf[start]), (long)length);
-
- switch (TD[FieldType].Type)
- {
- case BUILTIN:
- (*TD[FieldType].PrintProc)(&buf[start]);
- break;
-
- case ENUMERATED:
- PrintENUMERATED(&buf[start], length, TD[FieldType].ValueList);
- break;
-
- case SET:
- PrintSET(&buf[start], length, TD[FieldType].ValueList);
- break;
-
- case RECORD:
- ModifyIndentLevel(1);
- fprintf(stdout, "\n");
- if (Verbose < 3)
- return;
- (*TD[FieldType].PrintProc)(&buf[start]);
- ModifyIndentLevel(-1);
- break;
+ if (Verbose == 0)
+ return;
+
+ if (length == 0)
+ return;
+
+ fprintf(stdout, "%s%20s: ", Leader, name);
+
+ if (debuglevel & 8)
+ DumpHexBuffer(&(buf[start]), (long) length);
+
+ switch (TD[FieldType].Type) {
+ case BUILTIN:
+ (*TD[FieldType].PrintProc) (&buf[start]);
+ break;
+
+ case ENUMERATED:
+ PrintENUMERATED(&buf[start], length, TD[FieldType].ValueList);
+ break;
+
+ case SET:
+ PrintSET(&buf[start], length, TD[FieldType].ValueList);
+ break;
+
+ case RECORD:
+ ModifyIndentLevel(1);
+ fprintf(stdout, "\n");
+ if (Verbose < 3)
+ return;
+ (*TD[FieldType].PrintProc) (&buf[start]);
+ ModifyIndentLevel(-1);
+ break;
}
- fprintf(stdout, "\n");
- fflush(stdout);
+ fprintf(stdout, "\n");
+ fflush(stdout);
}
/* ************************************************************ */
@@ -762,47 +757,42 @@ PrintField (
They start at <buf>. There are <number> things in the list */
long
-PrintList (
- const unsigned char *buf,
- long number,
- short ListType,
- const char *name)
+PrintList(const unsigned char *buf,
+ long number, short ListType, const char *name)
{
- long n;
- long i;
- long sum;
-
- if (number == 0)
- return(0);
-
- fprintf(stdout, "%s%20s: (%ld)\n", Leader, name, number);
- if (Verbose < 2)
- return(0);
-
- ModifyIndentLevel(1);
- sum = 0;
- for (i = 0; i < number; i++)
- {
- switch (TD[ListType].Type)
- {
- case BUILTIN:
- n = (*TD[ListType].PrintProc)(buf);
- break;
- case RECORD:
- n = (*TD[ListType].PrintProc)(buf);
- break;
- default:
- fprintf(stdout, "**INVALID**");
- n = 0;
- break;
- }
- buf = buf + n;
- sum = sum + n;
- fprintf(stdout, "%s---\n", Leader);
+ long n;
+ long i;
+ long sum;
+
+ if (number == 0)
+ return (0);
+
+ fprintf(stdout, "%s%20s: (%ld)\n", Leader, name, number);
+ if (Verbose < 2)
+ return (0);
+
+ ModifyIndentLevel(1);
+ sum = 0;
+ for (i = 0; i < number; i++) {
+ switch (TD[ListType].Type) {
+ case BUILTIN:
+ n = (*TD[ListType].PrintProc) (buf);
+ break;
+ case RECORD:
+ n = (*TD[ListType].PrintProc) (buf);
+ break;
+ default:
+ fprintf(stdout, "**INVALID**");
+ n = 0;
+ break;
+ }
+ buf = buf + n;
+ sum = sum + n;
+ fprintf(stdout, "%s---\n", Leader);
}
- ModifyIndentLevel(-1);
- return(sum);
+ ModifyIndentLevel(-1);
+ return (sum);
}
/* ************************************************************ */
@@ -814,35 +804,31 @@ PrintList (
They start at <buf>. There are <number> things in the list */
long
-PrintListSTR (
- const unsigned char *buf,
- long number,
- const char *name)
+PrintListSTR(const unsigned char *buf, long number, const char *name)
{
- long n;
- long i;
- long sum;
-
- if (number == 0)
- return(0);
-
- fprintf(stdout, "%s%20s: (%ld)\n", Leader, name, number);
- if (Verbose < 2)
- return(0);
-
- ModifyIndentLevel(1);
- sum = 0;
- for (i = 0; i < number; i++)
- {
- fprintf(stdout, "%s", Leader);
- n = PrintSTR(buf);
- buf = buf + n;
- sum = sum + n;
- fprintf(stdout, "\n");
+ long n;
+ long i;
+ long sum;
+
+ if (number == 0)
+ return (0);
+
+ fprintf(stdout, "%s%20s: (%ld)\n", Leader, name, number);
+ if (Verbose < 2)
+ return (0);
+
+ ModifyIndentLevel(1);
+ sum = 0;
+ for (i = 0; i < number; i++) {
+ fprintf(stdout, "%s", Leader);
+ n = PrintSTR(buf);
+ buf = buf + n;
+ sum = sum + n;
+ fprintf(stdout, "\n");
}
- ModifyIndentLevel(-1);
- return(sum);
+ ModifyIndentLevel(-1);
+ return (sum);
}
@@ -853,35 +839,30 @@ PrintListSTR (
int
-PrintBytes(
- const unsigned char *buf,
- long number,
- const char *name)
+PrintBytes(const unsigned char *buf, long number, const char *name)
{
- /* print a list of BYTE -- 8-bit character */
- long i;
- short column;
-
- if (number == 0)
- return(0);
-
- fprintf(stdout, "%s%20s: ", Leader, name);
- column = SizeofLeader() + 25;
- for (i = 0; i < number; i++)
- {
- if (column > 80)
- {
- if (Verbose < 2)
- break;
- fprintf(stdout, "\n%s%20s: ", Leader, "");
- column = SizeofLeader() + 25;
- }
- fprintf(stdout, "%02x ",((unsigned int) buf[i]));
- column += 3;
+ /* print a list of BYTE -- 8-bit character */
+ long i;
+ short column;
+
+ if (number == 0)
+ return (0);
+
+ fprintf(stdout, "%s%20s: ", Leader, name);
+ column = SizeofLeader() + 25;
+ for (i = 0; i < number; i++) {
+ if (column > 80) {
+ if (Verbose < 2)
+ break;
+ fprintf(stdout, "\n%s%20s: ", Leader, "");
+ column = SizeofLeader() + 25;
+ }
+ fprintf(stdout, "%02x ", ((unsigned int) buf[i]));
+ column += 3;
}
- fprintf(stdout, "\n");
+ fprintf(stdout, "\n");
- return(number);
+ return (number);
}
@@ -894,98 +875,83 @@ PrintBytes(
/* print a String of CHAR8 -- 8-bit characters */
int
-PrintString8(
- const unsigned char *buf,
- int number,
- const char *name)
+PrintString8(const unsigned char *buf, int number, const char *name)
{
- short i;
+ short i;
- if (number == 0)
- return(0);
+ if (number == 0)
+ return (0);
- fprintf(stdout, "%s%20s: \"", Leader, name);
- for (i = 0; i < number; i++)
- fprintf(stdout, "%s", printrep(buf[i]));
- fprintf(stdout, "\"\n");
+ fprintf(stdout, "%s%20s: \"", Leader, name);
+ for (i = 0; i < number; i++)
+ fprintf(stdout, "%s", printrep(buf[i]));
+ fprintf(stdout, "\"\n");
- return(number);
+ return (number);
}
-
/* print a String of CHAR16 -- 16-bit characters */
int
-PrintString16(
- const unsigned char *buf,
- int number,
- const char *name)
+PrintString16(const unsigned char *buf, int number, const char *name)
{
- long i;
- unsigned short c;
+ long i;
+ unsigned short c;
- if (number == 0)
- return(0);
+ if (number == 0)
+ return (0);
- fprintf(stdout, "%s%20s: \"", Leader, name);
- for (i = 0; i < number*2; i += 2)
- {
- c = IChar2B(&buf[i]);
- fprintf(stdout, "%s", printrep(c));
+ fprintf(stdout, "%s%20s: \"", Leader, name);
+ for (i = 0; i < number * 2; i += 2) {
+ c = IChar2B(&buf[i]);
+ fprintf(stdout, "%s", printrep(c));
}
- fprintf(stdout, "\"\n");
+ fprintf(stdout, "\"\n");
- return(number);
+ return (number);
}
void
-PrintTString8(
- const unsigned char *buf,
- long number,
- const char *name)
+PrintTString8(const unsigned char *buf, long number, const char *name)
{
- long i;
- int off;
-
- if (number == 0)
- return;
-
- off = 0;
- if (TranslateText)
- off = 0x20;
- fprintf(stdout, "%s%20s: \"", Leader, name);
- for (i = 0; i < number; i++)
- fprintf(stdout, "%s", printrep(buf[i] + off));
- fprintf(stdout, "\"\n");
+ long i;
+ int off;
+
+ if (number == 0)
+ return;
+
+ off = 0;
+ if (TranslateText)
+ off = 0x20;
+ fprintf(stdout, "%s%20s: \"", Leader, name);
+ for (i = 0; i < number; i++)
+ fprintf(stdout, "%s", printrep(buf[i] + off));
+ fprintf(stdout, "\"\n");
}
-
/* print a String of CHAR2B -- 16-bit characters */
void
-PrintTString16(
- const unsigned char *buf,
- long number,
- const char *name)
+PrintTString16(const unsigned char *buf, long number, const char *name)
{
- long i;
- unsigned short c;
- int off;
-
- if (number == 0)
- return;
-
- off = 0;
- if (TranslateText)
- off = 0x20;
- fprintf(stdout, "%s%20s: \"", Leader, name);
- for (i = 0; i < number*2; i += 2)
- {
- c = IChar2B(&buf[i]);
- fprintf(stdout, "%s", printrep(c + off));
+ long i;
+ unsigned short c;
+ int off;
+
+ if (number == 0)
+ return;
+
+ off = 0;
+ if (TranslateText)
+ off = 0x20;
+ fprintf(stdout, "%s%20s: \"", Leader, name);
+ for (i = 0; i < number * 2; i += 2) {
+ c = IChar2B(&buf[i]);
+ fprintf(stdout, "%s", printrep(c + off));
}
- fprintf(stdout, "\"\n");
+ fprintf(stdout, "\"\n");
}
+
/* ************************************************************ */
/* */
/* */
@@ -1000,49 +966,44 @@ PrintTString16(
*/
void
-PrintValues(
- const unsigned char *control,
- int clength,
- int ctype,
- const unsigned char *values,
- const char *name)
+PrintValues(const unsigned char *control,
+ int clength,
+ int ctype, const unsigned char *values, const char *name)
{
- long cmask;
- struct ValueListEntry *p;
-
- /* first get the control mask */
- if (clength == 1)
- cmask = IByte(control);
- else if (clength == 2)
- cmask = IShort(control);
+ long cmask;
+ struct ValueListEntry *p;
+
+ /* first get the control mask */
+ if (clength == 1)
+ cmask = IByte(control);
+ else if (clength == 2)
+ cmask = IShort(control);
else
- cmask = ILong(control);
-
- /* now if it is zero, ignore and return */
- if (cmask == 0)
- return;
-
- /* there are bits in the controlling bitmask, figure out which */
- /* the ctype is a set type, so this code is similar to PrintSET */
- fprintf(stdout, "%s%20s:\n", Leader, name);
- ModifyIndentLevel(1);
- for (p = TD[ctype].ValueList; p != NULL; p = p->Next)
- {
- if ((p->Value & cmask) != 0)
- {
- short m;
- if (littleEndian)
- m=0;
- else
- m = 4 - p->Length;
- PrintField(values, m, p->Length, p->Type, p->Name);
- values += 4;
- }
+ cmask = ILong(control);
+
+ /* now if it is zero, ignore and return */
+ if (cmask == 0)
+ return;
+
+ /* there are bits in the controlling bitmask, figure out which */
+ /* the ctype is a set type, so this code is similar to PrintSET */
+ fprintf(stdout, "%s%20s:\n", Leader, name);
+ ModifyIndentLevel(1);
+ for (p = TD[ctype].ValueList; p != NULL; p = p->Next) {
+ if ((p->Value & cmask) != 0) {
+ short m;
+
+ if (littleEndian)
+ m = 0;
+ else
+ m = 4 - p->Length;
+ PrintField(values, m, p->Length, p->Type, p->Name);
+ values += 4;
+ }
}
- ModifyIndentLevel(-1);
+ ModifyIndentLevel(-1);
}
-
/* ************************************************************ */
/* */
/* */
@@ -1052,62 +1013,49 @@ PrintValues(
font changes in them. */
void
-PrintTextList8(
- const unsigned char *buf,
- int length,
- const char *name)
+PrintTextList8(const unsigned char *buf, int length, const char *name)
{
- short n;
-
- fprintf(stdout, "%s%20s:\n", Leader, name);
- while (length > 1)
- {
- n = IByte(&buf[0]);
- if (n != 255)
- {
- PrintField(buf, 1, 1, INT8, "delta");
- PrintTString8(&buf[2], (long)n, "text item 8 string");
- buf += n + 2;
- length -= n + 2;
- }
- else
- {
- PrintField(buf, 1, 4, FONT, "font-shift-id");
- buf += 4;
- length -= 4;
- }
+ short n;
+
+ fprintf(stdout, "%s%20s:\n", Leader, name);
+ while (length > 1) {
+ n = IByte(&buf[0]);
+ if (n != 255) {
+ PrintField(buf, 1, 1, INT8, "delta");
+ PrintTString8(&buf[2], (long) n, "text item 8 string");
+ buf += n + 2;
+ length -= n + 2;
+ }
+ else {
+ PrintField(buf, 1, 4, FONT, "font-shift-id");
+ buf += 4;
+ length -= 4;
+ }
}
}
void
-PrintTextList16(
- const unsigned char *buf,
- int length,
- const char *name)
+PrintTextList16(const unsigned char *buf, int length, const char *name)
{
- short n;
-
- fprintf(stdout, "%s%20s:\n", Leader, name);
- while (length > 1)
- {
- n = IByte(&buf[0]);
- if (n != 255)
- {
- PrintField(buf, 1, 1, INT8, "delta");
- PrintTString16(&buf[2], (long)n, "text item 16 string");
- buf += n + 2;
- length -= n + 2;
- }
- else
- {
- PrintField(buf, 1, 4, FONT, "font-shift-id");
- buf += 4;
- length -= 4;
- }
+ short n;
+
+ fprintf(stdout, "%s%20s:\n", Leader, name);
+ while (length > 1) {
+ n = IByte(&buf[0]);
+ if (n != 255) {
+ PrintField(buf, 1, 1, INT8, "delta");
+ PrintTString16(&buf[2], (long) n, "text item 16 string");
+ buf += n + 2;
+ length -= n + 2;
+ }
+ else {
+ PrintField(buf, 1, 4, FONT, "font-shift-id");
+ buf += 4;
+ length -= 4;
+ }
}
}
-
/* ************************************************************ */
/* */
/* */
@@ -1116,66 +1064,58 @@ PrintTextList16(
#define MAXline 78
void
-DumpHexBuffer(
- const unsigned char *buf,
- long n)
+DumpHexBuffer(const unsigned char *buf, long n)
{
- long i;
- short column;
- char h[6] /* one hex or octal character */ ;
-
- column = 27 + SizeofLeader();
- for (i = 0; i < n; i++)
- {
- /* get the hex representations */
- sprintf(h, "%02x",(0xff & buf[i]));
-
- /* check if these characters will fit on this line */
- if ((column + strlen(h) + 1) > MAXline)
- {
- /* line will be too long -- print it */
- fprintf(stdout, "\n");
- column = 0;
- }
- fprintf(stdout, "%s ", h);
- column += 3;
+ long i;
+ short column;
+ char h[6]; /* one hex or octal character */
+
+ column = 27 + SizeofLeader();
+ for (i = 0; i < n; i++) {
+ /* get the hex representations */
+ sprintf(h, "%02x", (0xff & buf[i]));
+
+ /* check if these characters will fit on this line */
+ if ((column + strlen(h) + 1) > MAXline) {
+ /* line will be too long -- print it */
+ fprintf(stdout, "\n");
+ column = 0;
+ }
+ fprintf(stdout, "%s ", h);
+ column += 3;
}
}
void
-PrintValueRec (
- unsigned long key,
- unsigned long cmask,
- short ctype)
+PrintValueRec(unsigned long key, unsigned long cmask, short ctype)
{
- unsigned char *values;
- struct ValueListEntry *p;
- ValuePtr value;
+ unsigned char *values;
+ struct ValueListEntry *p;
+ ValuePtr value;
- value = GetValueRec (key);
+ value = GetValueRec(key);
if (!value)
- return;
+ return;
values = (unsigned char *) value->values;
-
+
/* now if it is zero, ignore and return */
if (cmask == 0)
- return;
+ return;
/* there are bits in the controlling bitmask, figure out which */
/* the ctype is a set type, so this code is similar to PrintSET */
ModifyIndentLevel(1);
- for (p = TD[ctype].ValueList; p != NULL; p = p->Next)
- {
- if ((p->Value & cmask) != 0)
- {
- short m;
- if (littleEndian)
- m=0;
- else
- m = 4 - p->Length;
- PrintField(values, m, p->Length, p->Type, p->Name);
- }
- values += 4;
+ for (p = TD[ctype].ValueList; p != NULL; p = p->Next) {
+ if ((p->Value & cmask) != 0) {
+ short m;
+
+ if (littleEndian)
+ m = 0;
+ else
+ m = 4 - p->Length;
+ PrintField(values, m, p->Length, p->Type, p->Name);
+ }
+ values += 4;
}
ModifyIndentLevel(-1);
}
diff --git a/randrscope.h b/randrscope.h
index efb0129..4cfdd4d 100644
--- a/randrscope.h
+++ b/randrscope.h
@@ -12,15 +12,14 @@
#define printfield(a,b,c,d,e) if (Verbose > 1) PrintField(a,b,c,d,e)
-extern void RandrQueryVersion (FD fd, const unsigned char *buf);
-extern void RandrQueryVersionReply (FD fd, const unsigned char *buf);
-extern void RandrGetScreenInfo (FD fd, const unsigned char *buf);
-extern void RandrGetScreenInfoReply (FD fd, const unsigned char *buf);
-extern void RandrSetScreenConfig (FD fd, const unsigned char *buf);
-extern void RandrSetScreenConfigReply (FD fd, const unsigned char *buf);
-extern void RandrScreenChangeSelectInput (FD fd, const unsigned char *buf);
-extern void RandrScreenSizes (const unsigned char *buf);
-extern void RandrScreenChangeNotifyEvent (const unsigned char *buf);
+extern void RandrQueryVersion(FD fd, const unsigned char *buf);
+extern void RandrQueryVersionReply(FD fd, const unsigned char *buf);
+extern void RandrGetScreenInfo(FD fd, const unsigned char *buf);
+extern void RandrGetScreenInfoReply(FD fd, const unsigned char *buf);
+extern void RandrSetScreenConfig(FD fd, const unsigned char *buf);
+extern void RandrSetScreenConfigReply(FD fd, const unsigned char *buf);
+extern void RandrScreenChangeSelectInput(FD fd, const unsigned char *buf);
+extern void RandrScreenSizes(const unsigned char *buf);
+extern void RandrScreenChangeNotifyEvent(const unsigned char *buf);
#endif
-
diff --git a/renderscope.h b/renderscope.h
index db9e718..aa27721 100644
--- a/renderscope.h
+++ b/renderscope.h
@@ -12,54 +12,53 @@
#define printfield(a,b,c,d,e) if (Verbose > 1) PrintField(a,b,c,d,e)
-extern void RenderQueryVersion (FD fd, const unsigned char *buf);
-extern void RenderQueryVersionReply (FD fd, const unsigned char *buf);
-extern void RenderQueryPictFormats (FD fd, const unsigned char *buf);
-extern void RenderQueryPictFormatsReply (FD fd, const unsigned char *buf);
-extern void RenderQueryPictIndexValues (FD fd, const unsigned char *buf);
-extern void RenderQueryPictIndexValuesReply (FD fd, const unsigned char *buf);
-extern void RenderQueryDithers (FD fd, const unsigned char *buf);
-extern void RenderQueryDithersReply (FD fd, const unsigned char *buf);
-extern void RenderCreatePicture (FD fd, const unsigned char *buf);
-extern void RenderChangePicture (FD fd, const unsigned char *buf);
-extern void RenderSetPictureClipRectangles (FD fd, const unsigned char *buf);
-extern void RenderFreePicture (FD fd, const unsigned char *buf);
-extern void RenderComposite (FD fd, const unsigned char *buf);
-extern void RenderScale (FD fd, const unsigned char *buf);
-extern void RenderTrapezoids (FD fd, const unsigned char *buf);
-extern void RenderTriangles (FD fd, const unsigned char *buf);
-extern void RenderTriStrip (FD fd, const unsigned char *buf);
-extern void RenderTriFan (FD fd, const unsigned char *buf);
-extern void RenderColorTrapezoids (FD fd, const unsigned char *buf);
-extern void RenderColorTriangles (FD fd, const unsigned char *buf);
-extern void RenderTransform (FD fd, const unsigned char *buf);
-extern void RenderCreateGlyphSet (FD fd, const unsigned char *buf);
-extern void RenderReferenceGlyphSet (FD fd, const unsigned char *buf);
-extern void RenderFreeGlyphSet (FD fd, const unsigned char *buf);
-extern void RenderAddGlyphs (FD fd, const unsigned char *buf);
-extern void RenderAddGlyphsFromPicture (FD fd, const unsigned char *buf);
-extern void RenderFreeGlyphs (FD fd, const unsigned char *buf);
-extern void RenderCompositeGlyphs8 (FD fd, const unsigned char *buf);
-extern void RenderCompositeGlyphs16 (FD fd, const unsigned char *buf);
-extern void RenderCompositeGlyphs32 (FD fd, const unsigned char *buf);
-extern void RenderFillRectangles (FD fd, const unsigned char *buf);
-extern void RenderCreateCursor (FD fd, const unsigned char *buf);
-extern void RenderSetPictureTransform (FD fd, const unsigned char *buf);
-extern void RenderQueryFilters (FD fd, const unsigned char *buf);
-extern void RenderQueryFiltersReply (FD fd, const unsigned char *buf);
-extern void RenderSetPictureFilter (FD fd, const unsigned char *buf);
-extern void RenderCreateAnimCursor (FD fd, const unsigned char *buf);
-extern void RenderAddTraps (FD fd, const unsigned char *buf);
-extern void RenderCreateSolidFill (FD fd, const unsigned char *buf);
-extern void RenderCreateLinearGradient (FD fd, const unsigned char *buf);
-extern void RenderCreateRadialGradient (FD fd, const unsigned char *buf);
-extern void RenderCreateConicalGradient (FD fd, const unsigned char *buf);
+extern void RenderQueryVersion(FD fd, const unsigned char *buf);
+extern void RenderQueryVersionReply(FD fd, const unsigned char *buf);
+extern void RenderQueryPictFormats(FD fd, const unsigned char *buf);
+extern void RenderQueryPictFormatsReply(FD fd, const unsigned char *buf);
+extern void RenderQueryPictIndexValues(FD fd, const unsigned char *buf);
+extern void RenderQueryPictIndexValuesReply(FD fd, const unsigned char *buf);
+extern void RenderQueryDithers(FD fd, const unsigned char *buf);
+extern void RenderQueryDithersReply(FD fd, const unsigned char *buf);
+extern void RenderCreatePicture(FD fd, const unsigned char *buf);
+extern void RenderChangePicture(FD fd, const unsigned char *buf);
+extern void RenderSetPictureClipRectangles(FD fd, const unsigned char *buf);
+extern void RenderFreePicture(FD fd, const unsigned char *buf);
+extern void RenderComposite(FD fd, const unsigned char *buf);
+extern void RenderScale(FD fd, const unsigned char *buf);
+extern void RenderTrapezoids(FD fd, const unsigned char *buf);
+extern void RenderTriangles(FD fd, const unsigned char *buf);
+extern void RenderTriStrip(FD fd, const unsigned char *buf);
+extern void RenderTriFan(FD fd, const unsigned char *buf);
+extern void RenderColorTrapezoids(FD fd, const unsigned char *buf);
+extern void RenderColorTriangles(FD fd, const unsigned char *buf);
+extern void RenderTransform(FD fd, const unsigned char *buf);
+extern void RenderCreateGlyphSet(FD fd, const unsigned char *buf);
+extern void RenderReferenceGlyphSet(FD fd, const unsigned char *buf);
+extern void RenderFreeGlyphSet(FD fd, const unsigned char *buf);
+extern void RenderAddGlyphs(FD fd, const unsigned char *buf);
+extern void RenderAddGlyphsFromPicture(FD fd, const unsigned char *buf);
+extern void RenderFreeGlyphs(FD fd, const unsigned char *buf);
+extern void RenderCompositeGlyphs8(FD fd, const unsigned char *buf);
+extern void RenderCompositeGlyphs16(FD fd, const unsigned char *buf);
+extern void RenderCompositeGlyphs32(FD fd, const unsigned char *buf);
+extern void RenderFillRectangles(FD fd, const unsigned char *buf);
+extern void RenderCreateCursor(FD fd, const unsigned char *buf);
+extern void RenderSetPictureTransform(FD fd, const unsigned char *buf);
+extern void RenderQueryFilters(FD fd, const unsigned char *buf);
+extern void RenderQueryFiltersReply(FD fd, const unsigned char *buf);
+extern void RenderSetPictureFilter(FD fd, const unsigned char *buf);
+extern void RenderCreateAnimCursor(FD fd, const unsigned char *buf);
+extern void RenderAddTraps(FD fd, const unsigned char *buf);
+extern void RenderCreateSolidFill(FD fd, const unsigned char *buf);
+extern void RenderCreateLinearGradient(FD fd, const unsigned char *buf);
+extern void RenderCreateRadialGradient(FD fd, const unsigned char *buf);
+extern void RenderCreateConicalGradient(FD fd, const unsigned char *buf);
-extern void RenderPictFormatError (FD fd, const unsigned char *buf);
-extern void RenderPictureError (FD fd, const unsigned char *buf);
-extern void RenderPictOpError (FD fd, const unsigned char *buf);
-extern void RenderGlyphSetError (FD fd, const unsigned char *buf);
-extern void RenderGlyphError (FD fd, const unsigned char *buf);
+extern void RenderPictFormatError(FD fd, const unsigned char *buf);
+extern void RenderPictureError(FD fd, const unsigned char *buf);
+extern void RenderPictOpError(FD fd, const unsigned char *buf);
+extern void RenderGlyphSetError(FD fd, const unsigned char *buf);
+extern void RenderGlyphError(FD fd, const unsigned char *buf);
#endif
-
diff --git a/scope-transport.c b/scope-transport.c
index 624d292..d8acfbb 100644
--- a/scope-transport.c
+++ b/scope-transport.c
@@ -3,6 +3,7 @@
#include "config.h"
extern short debuglevel;
+
#define DEBUG ((debuglevel & 4) ? 4 : 1)
#define TRANS_CLIENT
#define TRANS_SERVER
diff --git a/scope.c b/scope.c
index e665255..9928bad 100644
--- a/scope.c
+++ b/scope.c
@@ -1,8 +1,8 @@
-/* ******************************************************
- * *
- * A spy program to reveal X11 traffic *
- * *
- * James Peterson, 1988 *
+/*
+ * A spy program to reveal X11 traffic
+ *
+ * James Peterson, 1988
+ *
* Copyright (C) 1988 MCC
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -22,8 +22,9 @@
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
- * *
- * *
+ *
+ */
+/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -45,7 +46,7 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
- ***************************************************** */
+ */
#include "scope.h"
#include "nas.h"
@@ -54,18 +55,18 @@
#include <ctype.h>
#include <unistd.h>
-#include <sys/types.h> /* needed by sys/socket.h and netinet/in.h */
-#include <sys/uio.h> /* for struct iovec, used by socket.h */
-#include <sys/socket.h> /* for AF_INET, SOCK_STREAM, ... */
-#include <sys/ioctl.h> /* for FIONCLEX, FIONBIO, ... */
+#include <sys/types.h> /* needed by sys/socket.h and netinet/in.h */
+#include <sys/uio.h> /* for struct iovec, used by socket.h */
+#include <sys/socket.h> /* for AF_INET, SOCK_STREAM, ... */
+#include <sys/ioctl.h> /* for FIONCLEX, FIONBIO, ... */
#if !defined(FIOCLEX) && defined(HAVE_SYS_FILIO_H)
#include <sys/filio.h>
#endif
#include <fcntl.h>
-#include <netinet/in.h> /* struct sockaddr_in */
+#include <netinet/in.h> /* struct sockaddr_in */
#include <netinet/tcp.h>
-#include <netdb.h> /* struct servent * and struct hostent * */
-#include <errno.h> /* for EINTR, EADDRINUSE, ... */
+#include <netdb.h> /* struct servent * and struct hostent * */
+#include <errno.h> /* for EINTR, EADDRINUSE, ... */
/* ********************************************** */
@@ -74,23 +75,23 @@
#define DefaultPort 6000
- char ServerHostName[MAXHOSTNAMELEN];
- char AudioServerHostName[MAXHOSTNAMELEN];
- long ServerBasePort = DefaultPort;
-static long ServerInPort = 1;
-static long ServerOutPort = 0;
-static long ServerDisplay = 0;
+char ServerHostName[MAXHOSTNAMELEN];
+char AudioServerHostName[MAXHOSTNAMELEN];
+long ServerBasePort = DefaultPort;
+static long ServerInPort = 1;
+static long ServerOutPort = 0;
+static long ServerDisplay = 0;
static FD ConnectToClient(FD ConnectionSocket);
static void DataFromClient(FD fd);
static void SetUpStdin(void);
-long TranslateText = 0;
-char ScopeEnabled = 1;
-char HandleSIGUSR1 = 0;
-char DoAudio = 0;
-char TerminateClose = 0;
-int Interrupt = 0;
+long TranslateText = 0;
+char ScopeEnabled = 1;
+char HandleSIGUSR1 = 0;
+char DoAudio = 0;
+char TerminateClose = 0;
+int Interrupt = 0;
struct FDDescriptor *FDD = NULL;
int MaxFD = 0;
@@ -100,66 +101,66 @@ fd_set WriteDescriptors;
fd_set BlockedReadDescriptors;
int HighestFD;
-short debuglevel = 0;
-short Verbose = 0;
-short XVerbose = 0;
-short NasVerbose = 0;
-short Raw = 0;
-int ScopePort = 0;
-char *ScopeHost = NULL;
+short debuglevel = 0;
+short Verbose = 0;
+short XVerbose = 0;
+short NasVerbose = 0;
+short Raw = 0;
+int ScopePort = 0;
+char *ScopeHost = NULL;
typedef struct _BreakPoint {
- struct _BreakPoint *next;
- int number;
- unsigned char request;
- int minorop;
- Boolean enabled;
+ struct _BreakPoint *next;
+ int number;
+ unsigned char request;
+ int minorop;
+ Boolean enabled;
} BP;
typedef enum _CMDResult { CMDProceed, CMDDebug, CMDSyntax, CMDError } CMDResult;
-static CMDResult CMDStep (int argc, char **argv);
-static CMDResult CMDCont (int argc, char **argv);
-static CMDResult CMDBreak (int argc, char **argv);
-static CMDResult CMDDelete (int argc, char **argv);
-static CMDResult CMDDisable (int argc, char **argv);
-static CMDResult CMDEnable (int argc, char **argv);
-static CMDResult CMDLevel (int argc, char **argv);
-static CMDResult CMDAudio (int argc, char **argv);
-static CMDResult CMDQuit (int argc, char **argv);
-static CMDResult CMDHelp (int argc, char **argv);
+static CMDResult CMDStep(int argc, char **argv);
+static CMDResult CMDCont(int argc, char **argv);
+static CMDResult CMDBreak(int argc, char **argv);
+static CMDResult CMDDelete(int argc, char **argv);
+static CMDResult CMDDisable(int argc, char **argv);
+static CMDResult CMDEnable(int argc, char **argv);
+static CMDResult CMDLevel(int argc, char **argv);
+static CMDResult CMDAudio(int argc, char **argv);
+static CMDResult CMDQuit(int argc, char **argv);
+static CMDResult CMDHelp(int argc, char **argv);
typedef struct _CMDFunc {
- const char *name;
- const char *alias;
- CMDResult (*func)(int argc, char **argv);
- const char *usage;
- const char *help;
+ const char *name;
+ const char *alias;
+ CMDResult(*func) (int argc, char **argv);
+ const char *usage;
+ const char *help;
} CMDFuncRec;
typedef const CMDFuncRec *CMDFuncPtr;
-static const CMDFuncRec CMDFuncs[] = {
- { "audio", "a", CMDAudio, "[a]udio",
- "Set audio output level\n" },
- { "break", "b", CMDBreak, "[b]reak",
- "Create breakpoints\n" },
- { "cont", "c", CMDCont, "[c]ont",
- "Continue scoping\n" },
- { "delete", "del", CMDDelete, "[del]ete",
- "Delete breakpoints\n" },
- { "disable","d", CMDDisable, "[d]isable",
- "Disable breakpoints\n" },
- { "enable", "e", CMDEnable, "[e]nable",
- "Enable breakpoints\n" },
- { "help", "?", CMDHelp, "help",
- "Print this list\n" },
- { "level", "l", CMDLevel, "[l]evel",
- "Set output level\n" },
- { "quit", "q", CMDQuit, "[q]uit",
- "Quit Xscope\n" },
- { "step", "s", CMDStep, "[s]tep",
- "Step trace one request\n" },
+static const CMDFuncRec CMDFuncs[] = {
+ {"audio", "a", CMDAudio, "[a]udio",
+ "Set audio output level\n"},
+ {"break", "b", CMDBreak, "[b]reak",
+ "Create breakpoints\n"},
+ {"cont", "c", CMDCont, "[c]ont",
+ "Continue scoping\n"},
+ {"delete", "del", CMDDelete, "[del]ete",
+ "Delete breakpoints\n"},
+ {"disable", "d", CMDDisable, "[d]isable",
+ "Disable breakpoints\n"},
+ {"enable", "e", CMDEnable, "[e]nable",
+ "Enable breakpoints\n"},
+ {"help", "?", CMDHelp, "help",
+ "Print this list\n"},
+ {"level", "l", CMDLevel, "[l]evel",
+ "Set output level\n"},
+ {"quit", "q", CMDQuit, "[q]uit",
+ "Quit Xscope\n"},
+ {"step", "s", CMDStep, "[s]tep",
+ "Step trace one request\n"},
};
#define NumCMDFuncs (sizeof CMDFuncs / sizeof CMDFuncs[0])
@@ -170,202 +171,182 @@ static const CMDFuncRec CMDFuncs[] = {
#endif
static int
-CMDStringToInt (
- char *s,
- int *v)
+CMDStringToInt(char *s, int *v)
{
- int sign = 1;
+ int sign = 1;
switch (*s) {
case '-':
- sign = -1;
- s++;
- break;
+ sign = -1;
+ s++;
+ break;
case '+':
- s++;
- break;
+ s++;
+ break;
}
- if (!strncmp (s, "0x", 2))
- {
- sscanf (s + 2, "%x", v);
- }
- else if (*s == '0')
- {
- sscanf (s, "%o", v);
+ if (!strncmp(s, "0x", 2)) {
+ sscanf(s + 2, "%x", v);
}
- else if (isdigit (*s))
- {
- sscanf (s, "%d", v);
+ else if (*s == '0') {
+ sscanf(s, "%o", v);
}
- else if (*s == '\'')
- {
- s++;
- if (*s == '\\') {
- s++;
- switch (*s) {
- case 'n':
- *v = '\n';
- break;
- case 't':
- *v = '\t';
- break;
- default:
- *v = (int) *s;
- break;
- }
- } else
- *v = (int) *s;
- s++;
- if (*s != '\'')
- return FALSE;
+ else if (isdigit(*s)) {
+ sscanf(s, "%d", v);
+ }
+ else if (*s == '\'') {
+ s++;
+ if (*s == '\\') {
+ s++;
+ switch (*s) {
+ case 'n':
+ *v = '\n';
+ break;
+ case 't':
+ *v = '\t';
+ break;
+ default:
+ *v = (int) *s;
+ break;
+ }
+ }
+ else
+ *v = (int) *s;
+ s++;
+ if (*s != '\'')
+ return FALSE;
}
else
- return FALSE;
+ return FALSE;
*v *= sign;
return TRUE;
}
static CMDFuncPtr
-CMDStringToFunc (
- const char *name)
+CMDStringToFunc(const char *name)
{
- int i;
- for (i = 0; i < NumCMDFuncs; i++)
- {
- if (!strcmp (name, CMDFuncs[i].name) ||
- !strcmp (name, CMDFuncs[i].alias))
- {
- return &CMDFuncs[i];
- }
+ int i;
+
+ for (i = 0; i < NumCMDFuncs; i++) {
+ if (!strcmp(name, CMDFuncs[i].name) || !strcmp(name, CMDFuncs[i].alias)) {
+ return &CMDFuncs[i];
+ }
}
return NULL;
-}
+}
static int
-CMDSplitIntoWords (
- char *line,
- char **argv)
+CMDSplitIntoWords(char *line, char **argv)
{
- char quotechar;
- int argc;
-
+ char quotechar;
+ int argc;
+
argc = 0;
while (*line) {
- while (isspace(*line))
- line++;
- if (!*line)
- break;
- if (*line == '"')
- {
- quotechar = *line++;
- *argv++ = line;
- argc++;
- while (*line && *line != quotechar)
- line++;
- if (*line)
- *line++ = '\0';
- }
- else
- {
- *argv++ = line;
- argc++;
- while (*line && !isspace(*line))
- line++;
- if (*line)
- *line++ = '\0';
- }
+ while (isspace(*line))
+ line++;
+ if (!*line)
+ break;
+ if (*line == '"') {
+ quotechar = *line++;
+ *argv++ = line;
+ argc++;
+ while (*line && *line != quotechar)
+ line++;
+ if (*line)
+ *line++ = '\0';
+ }
+ else {
+ *argv++ = line;
+ argc++;
+ while (*line && !isspace(*line))
+ line++;
+ if (*line)
+ *line++ = '\0';
+ }
}
*argv = NULL;
return argc;
}
static CMDResult
-CMDHelp(
- int argc,
- char **argv)
+CMDHelp(int argc, char **argv)
{
- int i;
- CMDFuncPtr func;
-
- if (argc == 1)
- {
- for (i = 0; i < NumCMDFuncs; i++)
- printf("%-10s%s\n", CMDFuncs[i].name, CMDFuncs[i].usage);
+ int i;
+ CMDFuncPtr func;
+
+ if (argc == 1) {
+ for (i = 0; i < NumCMDFuncs; i++)
+ printf("%-10s%s\n", CMDFuncs[i].name, CMDFuncs[i].usage);
}
- else
- {
- for (i = 1; i < argc; i++)
- {
- func = CMDStringToFunc (argv[i]);
- if (!func)
- {
- printf ("%-10s unknown command\n", argv[i]);
- return CMDSyntax;
- }
- printf ("%-10s %s\n%s", func->name, func->usage, func->help);
- }
+ else {
+ for (i = 1; i < argc; i++) {
+ func = CMDStringToFunc(argv[i]);
+ if (!func) {
+ printf("%-10s unknown command\n", argv[i]);
+ return CMDSyntax;
+ }
+ printf("%-10s %s\n%s", func->name, func->usage, func->help);
+ }
}
return CMDDebug;
}
-
+
static void
-CMDSyntaxError(
- int argc,
- char **argv)
+CMDSyntaxError(int argc, char **argv)
{
printf("Syntax error in:");
while (*argv)
- printf(" %s", *argv++);
+ printf(" %s", *argv++);
printf("\n");
}
void
-ReadCommands (void)
+ReadCommands(void)
{
- int argc;
- char line[1024];
- char *argv[20];
- CMDResult result;
- CMDFuncPtr func;
- static int here;
-
+ int argc;
+ char line[1024];
+ char *argv[20];
+ CMDResult result;
+ CMDFuncPtr func;
+ static int here;
+
if (here)
- return;
+ return;
here = 1;
for (;;) {
- printf ("> ");
- if (!fgets (line, sizeof line, stdin)) {
- if(feof(stdin)) {
- strncpy(line, "quit", sizeof(line));
- } else {
- printf("Error: %s\n", strerror(errno));
- break;
- }
- }
- argc = CMDSplitIntoWords(line, argv);
- if (argc > 0) {
- func = CMDStringToFunc (argv[0]);
- if (!func)
- CMDSyntaxError (argc, argv);
- else
- {
- result = (*func->func)(argc, argv);
- switch (result) {
- case CMDSyntax:
- CMDSyntaxError(argc, argv);
- break;
- case CMDError:
- printf ("Error\n");
- break;
- case CMDProceed:
- here = 0;
- return;
- default:
- break;
- }
- }
- }
+ printf("> ");
+ if (!fgets(line, sizeof line, stdin)) {
+ if (feof(stdin)) {
+ strncpy(line, "quit", sizeof(line));
+ }
+ else {
+ printf("Error: %s\n", strerror(errno));
+ break;
+ }
+ }
+ argc = CMDSplitIntoWords(line, argv);
+ if (argc > 0) {
+ func = CMDStringToFunc(argv[0]);
+ if (!func)
+ CMDSyntaxError(argc, argv);
+ else {
+ result = (*func->func) (argc, argv);
+ switch (result) {
+ case CMDSyntax:
+ CMDSyntaxError(argc, argv);
+ break;
+ case CMDError:
+ printf("Error\n");
+ break;
+ case CMDProceed:
+ here = 0;
+ return;
+ default:
+ break;
+ }
+ }
+ }
}
printf("...\n");
here = 0;
@@ -373,263 +354,222 @@ ReadCommands (void)
int SingleStep;
int BreakPoint;
-BP *breakPoints;
-int breakPointNumber;
+BP *breakPoints;
+int breakPointNumber;
void
-TestBreakPoints (
- const unsigned char *buf,
- long n)
+TestBreakPoints(const unsigned char *buf, long n)
{
- BP *bp;
-
- for (bp = breakPoints; bp; bp = bp->next)
- {
- if (bp->enabled)
- {
- if (bp->request == buf[0])
- {
- if (bp->request < EXTENSION_MIN_REQ) /* Core protocol, not extension */
- break;
- else if ((bp->minorop == -1) || (bp->minorop == buf[1]))
- /* extension, either matching minor opcode or all minor opcodes */
- break;
- }
+ BP *bp;
+
+ for (bp = breakPoints; bp; bp = bp->next) {
+ if (bp->enabled) {
+ if (bp->request == buf[0]) {
+ if (bp->request < EXTENSION_MIN_REQ) /* Core protocol, not extension */
+ break;
+ else if ((bp->minorop == -1) || (bp->minorop == buf[1]))
+ /* extension, either matching minor opcode or all minor opcodes */
+ break;
+ }
+ }
+ }
+ if (bp) {
+ if (bp->request < EXTENSION_MIN_REQ)
+ printf("Breakpoint on request %d\n", bp->request);
+ else if (bp->minorop == -1)
+ printf("Breakpoint on extension %d\n", bp->request);
+ else
+ printf("Breakpoint on extension %d, minor request %d\n",
+ bp->request, bp->minorop);
+ ReadCommands();
}
- }
- if (bp)
- {
- if (bp->request < EXTENSION_MIN_REQ)
- printf ("Breakpoint on request %d\n", bp->request);
- else if (bp->minorop == -1)
- printf ("Breakpoint on extension %d\n", bp->request);
- else
- printf ("Breakpoint on extension %d, minor request %d\n",
- bp->request, bp->minorop);
- ReadCommands ();
- }
}
static void
-setBreakPoint (void)
+setBreakPoint(void)
{
- Boolean b = false;
- BP *bp;
- FD fd;
-
- if (SingleStep)
- b = true;
- else
- {
- for (bp = breakPoints; bp; bp = bp->next)
- {
- if (bp->enabled)
- {
- b = true;
- break;
- }
+ Boolean b = false;
+ BP *bp;
+ FD fd;
+
+ if (SingleStep)
+ b = true;
+ else {
+ for (bp = breakPoints; bp; bp = bp->next) {
+ if (bp->enabled) {
+ b = true;
+ break;
+ }
+ }
}
- }
- if (b != BreakPoint)
- {
- BreakPoint = b;
- for (fd = 0; fd < HighestFD; fd++)
- {
- if (FDD[fd].Busy && FDD[fd].InputHandler == DataFromClient)
- {
- if (BreakPoint)
- SetBufLimit (fd);
- else
- ClearBufLimit (fd);
- }
+ if (b != BreakPoint) {
+ BreakPoint = b;
+ for (fd = 0; fd < HighestFD; fd++) {
+ if (FDD[fd].Busy && FDD[fd].InputHandler == DataFromClient) {
+ if (BreakPoint)
+ SetBufLimit(fd);
+ else
+ ClearBufLimit(fd);
+ }
+ }
}
- }
}
static CMDResult
-CMDBreak (
- int argc,
- char **argv)
+CMDBreak(int argc, char **argv)
{
- BP *bp, **prev;
- int request, minorop;
- char *minorname;
-
- if (argc == 1)
- {
- for (bp = breakPoints; bp; bp = bp->next)
- {
- printf ("%3d: %s %3d ", bp->number,
- bp->enabled ? "enabled" : "disabled",
- bp->request);
- PrintENUMERATED(&bp->request, 1, TD[REQUEST].ValueList);
- if (bp->minorop != -1)
- printf (":%d", bp->minorop);
- printf ("\n");
+ BP *bp, **prev;
+ int request, minorop;
+ char *minorname;
+
+ if (argc == 1) {
+ for (bp = breakPoints; bp; bp = bp->next) {
+ printf("%3d: %s %3d ", bp->number,
+ bp->enabled ? "enabled" : "disabled", bp->request);
+ PrintENUMERATED(&bp->request, 1, TD[REQUEST].ValueList);
+ if (bp->minorop != -1)
+ printf(":%d", bp->minorop);
+ printf("\n");
+ }
}
- }
- else
- {
- for (prev = &breakPoints; *prev; prev = &(*prev)->next);
- while (*++argv) {
- if ((minorname = strchr(*argv, ':'))) {
- *minorname = '\0';
- if (!CMDStringToInt (minorname + 1, &minorop) ||
- (minorop < 0) || (minorop > 255)) {
- *minorname = ':'; /* restore string for error message */
- return CMDSyntax;
- }
- } else {
- minorop = -1;
- }
- request = GetXRequestFromName (*argv);
- if (request < 0 && !CMDStringToInt (*argv, &request))
- return CMDSyntax;
- if ((request < EXTENSION_MIN_REQ) && (minorname != NULL)) {
- *minorname = ':'; /* restore string for error message */
- return CMDSyntax;
- }
- bp = malloc (sizeof (BP));
- bp->number = ++breakPointNumber;
- bp->request = request;
- bp->minorop = minorop;
- bp->enabled = true;
- bp->next = NULL;
- *prev = bp;
- prev = &bp->next;
+ else {
+ for (prev = &breakPoints; *prev; prev = &(*prev)->next);
+ while (*++argv) {
+ if ((minorname = strchr(*argv, ':'))) {
+ *minorname = '\0';
+ if (!CMDStringToInt(minorname + 1, &minorop) ||
+ (minorop < 0) || (minorop > 255)) {
+ *minorname = ':'; /* restore string for error message */
+ return CMDSyntax;
+ }
+ }
+ else {
+ minorop = -1;
+ }
+ request = GetXRequestFromName(*argv);
+ if (request < 0 && !CMDStringToInt(*argv, &request))
+ return CMDSyntax;
+ if ((request < EXTENSION_MIN_REQ) && (minorname != NULL)) {
+ *minorname = ':'; /* restore string for error message */
+ return CMDSyntax;
+ }
+ bp = malloc(sizeof(BP));
+ bp->number = ++breakPointNumber;
+ bp->request = request;
+ bp->minorop = minorop;
+ bp->enabled = true;
+ bp->next = NULL;
+ *prev = bp;
+ prev = &bp->next;
+ }
}
- }
- setBreakPoint ();
- return CMDDebug;
+ setBreakPoint();
+ return CMDDebug;
}
static CMDResult
-CMDCont (
- int argc,
- char **argv)
+CMDCont(int argc, char **argv)
{
SingleStep = 0;
return CMDProceed;
}
static CMDResult
-CMDDisable (
- int argc,
- char **argv)
+CMDDisable(int argc, char **argv)
{
- BP *bp;
- int number;
-
- if (argc == 1)
- {
- printf ("Disabling all breakpoints...\n");
- for (bp = breakPoints; bp; bp = bp->next)
- bp->enabled = false;
- }
- else
- {
- while (*++argv) {
- if (!CMDStringToInt (*argv, &number))
- return CMDSyntax;
- for (bp = breakPoints; bp; bp = bp->next)
- if (bp->number == number)
- {
- bp->enabled = false;
- break;
- }
- if (!bp)
- {
- printf ("No such breakpoint %s\n", *argv);
- }
+ BP *bp;
+ int number;
+
+ if (argc == 1) {
+ printf("Disabling all breakpoints...\n");
+ for (bp = breakPoints; bp; bp = bp->next)
+ bp->enabled = false;
}
- }
- setBreakPoint ();
- return CMDDebug;
+ else {
+ while (*++argv) {
+ if (!CMDStringToInt(*argv, &number))
+ return CMDSyntax;
+ for (bp = breakPoints; bp; bp = bp->next)
+ if (bp->number == number) {
+ bp->enabled = false;
+ break;
+ }
+ if (!bp) {
+ printf("No such breakpoint %s\n", *argv);
+ }
+ }
+ }
+ setBreakPoint();
+ return CMDDebug;
}
static CMDResult
-CMDDelete (
- int argc,
- char **argv)
+CMDDelete(int argc, char **argv)
{
- BP *bp, **prev;
- int number;
-
- if (argc == 1)
- {
- printf ("Deleting all breakpoints...\n");
- while ((bp = breakPoints) != NULL)
- {
- breakPoints = bp->next;
- free (bp);
+ BP *bp, **prev;
+ int number;
+
+ if (argc == 1) {
+ printf("Deleting all breakpoints...\n");
+ while ((bp = breakPoints) != NULL) {
+ breakPoints = bp->next;
+ free(bp);
+ }
}
- }
- else
- {
- while (*++argv) {
- if (!CMDStringToInt (*argv, &number))
- return CMDSyntax;
- for (prev = &breakPoints; (bp = *prev) != NULL; prev = &bp->next)
- {
- if (bp->number == number)
- {
- *prev = bp->next;
- free (bp);
- break;
- }
- }
- if (!bp)
- {
- printf ("No such breakpoint %s\n", *argv);
- }
+ else {
+ while (*++argv) {
+ if (!CMDStringToInt(*argv, &number))
+ return CMDSyntax;
+ for (prev = &breakPoints; (bp = *prev) != NULL; prev = &bp->next) {
+ if (bp->number == number) {
+ *prev = bp->next;
+ free(bp);
+ break;
+ }
+ }
+ if (!bp) {
+ printf("No such breakpoint %s\n", *argv);
+ }
+ }
}
- }
- setBreakPoint ();
- return CMDDebug;
+ setBreakPoint();
+ return CMDDebug;
}
static CMDResult
-CMDEnable (
- int argc,
- char **argv)
+CMDEnable(int argc, char **argv)
{
- BP *bp;
- int number;
-
- if (argc == 1)
- {
- printf ("Enabling all breakpoints...\n");
- for (bp = breakPoints; bp; bp = bp->next)
- bp->enabled = true;
- }
- else
- {
- while (*++argv) {
- if (!CMDStringToInt (*argv, &number))
- return CMDSyntax;
- for (bp = breakPoints; bp; bp = bp->next)
- if (bp->number == number)
- {
- bp->enabled = true;
- break;
- }
- if (!bp)
- {
- printf ("No such breakpoint %s\n", *argv);
- }
+ BP *bp;
+ int number;
+
+ if (argc == 1) {
+ printf("Enabling all breakpoints...\n");
+ for (bp = breakPoints; bp; bp = bp->next)
+ bp->enabled = true;
+ }
+ else {
+ while (*++argv) {
+ if (!CMDStringToInt(*argv, &number))
+ return CMDSyntax;
+ for (bp = breakPoints; bp; bp = bp->next)
+ if (bp->number == number) {
+ bp->enabled = true;
+ break;
+ }
+ if (!bp) {
+ printf("No such breakpoint %s\n", *argv);
+ }
+ }
}
- }
- setBreakPoint ();
- return CMDDebug;
+ setBreakPoint();
+ return CMDDebug;
}
static CMDResult
-CMDStep (
- int argc,
- char **argv)
+CMDStep(int argc, char **argv)
{
SingleStep = 1;
- setBreakPoint ();
+ setBreakPoint();
return CMDProceed;
}
@@ -639,44 +579,38 @@ CMDStep (
#endif
static CMDResult
-CMDQuit (
- int argc,
- char **argv)
+CMDQuit(int argc, char **argv)
{
- printf ("exiting...\n");
- exit (0);
+ printf("exiting...\n");
+ exit(0);
}
static CMDResult
-CMDLevel (
- int argc,
- char **argv)
+CMDLevel(int argc, char **argv)
{
- int level;
-
- if (argc == 1)
- printf ("Level: %d\n", XVerbose);
- else if (argc == 2 && CMDStringToInt (argv[1], &level))
- XVerbose = level;
- else
- return CMDSyntax;
- return CMDDebug;
+ int level;
+
+ if (argc == 1)
+ printf("Level: %d\n", XVerbose);
+ else if (argc == 2 && CMDStringToInt(argv[1], &level))
+ XVerbose = level;
+ else
+ return CMDSyntax;
+ return CMDDebug;
}
static CMDResult
-CMDAudio (
- int argc,
- char **argv)
+CMDAudio(int argc, char **argv)
{
- int level;
-
- if (argc == 1)
- printf ("Audio Level: %d\n", NasVerbose);
- else if (argc == 2 && CMDStringToInt (argv[1], &level))
- NasVerbose = level;
- else
- return CMDSyntax;
- return CMDDebug;
+ int level;
+
+ if (argc == 1)
+ printf("Audio Level: %d\n", NasVerbose);
+ else if (argc == 2 && CMDStringToInt(argv[1], &level))
+ NasVerbose = level;
+ else
+ return CMDSyntax;
+ return CMDDebug;
}
/* ********************************************** */
@@ -685,176 +619,170 @@ CMDAudio (
/* ********************************************** */
short
-GetServerport (void)
+GetServerport(void)
{
- short port;
+ short port;
- enterprocedure("GetServerport");
+ enterprocedure("GetServerport");
- port = ServerBasePort + ServerOutPort + ServerDisplay;
- debug(4,(stderr, "Server service is on port %d\n", port));
- return(port);
+ port = ServerBasePort + ServerOutPort + ServerDisplay;
+ debug(4, (stderr, "Server service is on port %d\n", port));
+ return (port);
}
static short
-GetScopePort (void)
+GetScopePort(void)
{
- short port;
+ short port;
- enterprocedure("GetScopePort");
+ enterprocedure("GetScopePort");
- port = ServerBasePort + ServerInPort + ServerDisplay;
- debug(4,(stderr, "scope service is on port %d\n", port));
- return(port);
+ port = ServerBasePort + ServerInPort + ServerDisplay;
+ debug(4, (stderr, "scope service is on port %d\n", port));
+ return (port);
}
/* ********************************************** */
/* */
/* ********************************************** */
-static void
+static void
Usage(void)
{
- fprintf(stderr, "Usage: xscope\n");
- fprintf(stderr, " [-h<server-host>]\n");
- fprintf(stderr, " [-i<in-port>]\n");
- fprintf(stderr, " [-o<out-port>]\n");
- fprintf(stderr, " [-d<display-number>]\n");
- fprintf(stderr, " [-v<n>] -- verbose output\n");
- fprintf(stderr, " [-r] -- raw output\n");
- fprintf(stderr, " [-a<n>] -- audio verbose output\n");
- fprintf(stderr, " [-q] -- quiet output\n");
- fprintf(stderr, " [-D<debug-level>]\n");
- fprintf(stderr, " [-S<n>] -- start/stop on SIGUSR1\n");
- fprintf(stderr, " [-t] -- terminate when all clients close\n");
- exit(1);
+ fprintf(stderr, "Usage: xscope\n");
+ fprintf(stderr, " [-h<server-host>]\n");
+ fprintf(stderr, " [-i<in-port>]\n");
+ fprintf(stderr, " [-o<out-port>]\n");
+ fprintf(stderr, " [-d<display-number>]\n");
+ fprintf(stderr, " [-v<n>] -- verbose output\n");
+ fprintf(stderr, " [-r] -- raw output\n");
+ fprintf(stderr, " [-a<n>] -- audio verbose output\n");
+ fprintf(stderr, " [-q] -- quiet output\n");
+ fprintf(stderr, " [-D<debug-level>]\n");
+ fprintf(stderr, " [-S<n>] -- start/stop on SIGUSR1\n");
+ fprintf(stderr, " [-t] -- terminate when all clients close\n");
+ exit(1);
}
-
static void
-ScanArgs (
- int argc,
- char **argv)
+ScanArgs(int argc, char **argv)
{
- XVerbose = 1 /* default verbose-ness level */;
- NasVerbose = 1;
- Raw = 0 ;
-
- /* Scan argument list */
- while (--argc > 0)
- {
- ++argv;
- if (**argv == '-')
- switch (*++*argv)
- {
- /*
- debug levels:
- 2 - trace each procedure entry
- 4 - I/O, connections
- 8 - Scope internals
- 16 - Message protocol
- 32 - 64 - was malloc, now unused
- 128 - 256 - really low level
- */
- case 'D':
- debuglevel = atoi(++*argv);
- if (debuglevel == 0)
- debuglevel = 255;
- XVerbose = 7;
- debug(1,(stderr, "debuglevel = %d\n", debuglevel));
- break;
-
- case 'S':
- HandleSIGUSR1 = 1;
- ScopeEnabled = atoi(++*argv);
- break;
-
- case 'q': /* quiet mode */
- XVerbose = 0;
- debug(1,(stderr, "Verbose = %d\n", XVerbose));
- break;
-
- case 'r': /* raw mode */
- Raw = 1 ;
- debug(1,(stderr, "Raw = %d\n", Raw));
- break;
-
- case 'v': /* verbose mode */
- XVerbose = atoi(++*argv);
- debug(1,(stderr, "Verbose = %d\n", XVerbose));
- break;
-
- case 'o':
- ServerOutPort = atoi(++*argv);
- if (ServerOutPort <= 0)
- ServerOutPort = 0;
- debug(1,(stderr, "ServerOutPort = %ld\n", ServerOutPort));
- break;
-
- case 'd':
- ServerDisplay = atoi(++*argv);
- if (ServerDisplay <= 0)
- ServerDisplay = 0;
- debug(1,(stderr, "ServerDisplay = %ld\n", ServerDisplay));
- break;
-
- case 'i':
- ServerInPort = atoi(++*argv);
- if (ServerInPort <= 0)
- ServerInPort = 0;
- debug(1,(stderr, "ServerInPort = %ld\n", ServerInPort));
- break;
-
- case 'h':
- if (++*argv != NULL && **argv != '\0'
- && (strlen(*argv) < sizeof(ServerHostName)))
- strcpy(ServerHostName, *argv);
- debug(1,(stderr, "ServerHostName=%s\n", ServerHostName));
- break;
-
- case 'T':
- TranslateText = 1;
- break;
-
- case 'A':
- DoAudio = 1;
- break;
-
- case 'a': /* verbose mode */
- NasVerbose = atoi(++*argv);
- debug(1,(stderr, "NasVerbose = %d\n", NasVerbose));
- break;
-
- case 'n': /* NAS server host */
- if (++*argv != NULL && **argv != '\0')
- (void)strcpy(AudioServerHostName, *argv);
- debug(1,(stderr, "AudioServerHostName=%s\n", AudioServerHostName));
- break;
- case 't':
- TerminateClose = 1;
- break;
-
- default:
- fprintf(stderr, "Unknown option %c\n", **argv);
- Usage();
- break;
-
- }
- else
- {
- /* file argument to scope -- error */
- Usage();
- }
+ XVerbose = 1; /* default verbose-ness level */
+ NasVerbose = 1;
+ Raw = 0;
+
+ /* Scan argument list */
+ while (--argc > 0) {
+ ++argv;
+ if (**argv == '-')
+ switch (*++*argv) {
+ /*
+ debug levels:
+ 2 - trace each procedure entry
+ 4 - I/O, connections
+ 8 - Scope internals
+ 16 - Message protocol
+ 32 - 64 - was malloc, now unused
+ 128 - 256 - really low level
+ */
+ case 'D':
+ debuglevel = atoi(++*argv);
+ if (debuglevel == 0)
+ debuglevel = 255;
+ XVerbose = 7;
+ debug(1, (stderr, "debuglevel = %d\n", debuglevel));
+ break;
+
+ case 'S':
+ HandleSIGUSR1 = 1;
+ ScopeEnabled = atoi(++*argv);
+ break;
+
+ case 'q': /* quiet mode */
+ XVerbose = 0;
+ debug(1, (stderr, "Verbose = %d\n", XVerbose));
+ break;
+
+ case 'r': /* raw mode */
+ Raw = 1;
+ debug(1, (stderr, "Raw = %d\n", Raw));
+ break;
+
+ case 'v': /* verbose mode */
+ XVerbose = atoi(++*argv);
+ debug(1, (stderr, "Verbose = %d\n", XVerbose));
+ break;
+
+ case 'o':
+ ServerOutPort = atoi(++*argv);
+ if (ServerOutPort <= 0)
+ ServerOutPort = 0;
+ debug(1, (stderr, "ServerOutPort = %ld\n", ServerOutPort));
+ break;
+
+ case 'd':
+ ServerDisplay = atoi(++*argv);
+ if (ServerDisplay <= 0)
+ ServerDisplay = 0;
+ debug(1, (stderr, "ServerDisplay = %ld\n", ServerDisplay));
+ break;
+
+ case 'i':
+ ServerInPort = atoi(++*argv);
+ if (ServerInPort <= 0)
+ ServerInPort = 0;
+ debug(1, (stderr, "ServerInPort = %ld\n", ServerInPort));
+ break;
+
+ case 'h':
+ if (++*argv != NULL && **argv != '\0'
+ && (strlen(*argv) < sizeof(ServerHostName)))
+ strcpy(ServerHostName, *argv);
+ debug(1, (stderr, "ServerHostName = %s\n", ServerHostName));
+ break;
+
+ case 'T':
+ TranslateText = 1;
+ break;
+
+ case 'A':
+ DoAudio = 1;
+ break;
+
+ case 'a': /* verbose mode */
+ NasVerbose = atoi(++*argv);
+ debug(1, (stderr, "NasVerbose = %d\n", NasVerbose));
+ break;
+
+ case 'n': /* NAS server host */
+ if (++*argv != NULL && **argv != '\0')
+ (void) strcpy(AudioServerHostName, *argv);
+ debug(1, (stderr, "AudioServerHostName = %s\n",
+ AudioServerHostName));
+ break;
+ case 't':
+ TerminateClose = 1;
+ break;
+
+ default:
+ fprintf(stderr, "Unknown option %c\n", **argv);
+ Usage();
+ break;
+
+ }
+ else {
+ /* file argument to scope -- error */
+ Usage();
+ }
}
- /* check for different port numbers or different machines */
- if (ServerInPort == ServerOutPort)
- if (ServerHostName[0] == '\0')
- {
- fprintf(stderr, "Can't have xscope on same port as server (%ld)\n",
- ServerInPort);
- Usage();
- }
+ /* check for different port numbers or different machines */
+ if (ServerInPort == ServerOutPort)
+ if (ServerHostName[0] == '\0') {
+ fprintf(stderr, "Can't have xscope on same port as server (%ld)\n",
+ ServerInPort);
+ Usage();
+ }
}
@@ -864,28 +792,26 @@ ScanArgs (
/* ********************************************** */
int
-main (
- int argc,
- char **argv)
+main(int argc, char **argv)
{
- ScanArgs(argc, argv);
- InitializeFD();
- InitializeX11();
- if (DoAudio)
- InitializeAudio();
- SetUpStdin();
- SetUpConnectionSocket(GetScopePort(), NewConnection);
- if (DoAudio)
- SetUpConnectionSocket (GetScopePort() + 2000, NewAudio);
- SetSignalHandling();
-
- return MainLoop();
+ ScanArgs(argc, argv);
+ InitializeFD();
+ InitializeX11();
+ if (DoAudio)
+ InitializeAudio();
+ SetUpStdin();
+ SetUpConnectionSocket(GetScopePort(), NewConnection);
+ if (DoAudio)
+ SetUpConnectionSocket(GetScopePort() + 2000, NewAudio);
+ SetSignalHandling();
+
+ return MainLoop();
}
void
-TimerExpired (void)
+TimerExpired(void)
{
- debug(16,(stderr, "Timer tick\n"));
+ debug(16, (stderr, "Timer tick\n"));
}
/* ********************************************** */
@@ -905,22 +831,21 @@ TimerExpired (void)
*/
static void
-ReadStdin (
- FD fd)
+ReadStdin(FD fd)
{
- char buf[2048];
- long n;
+ char buf[2048];
+ long n;
- enterprocedure("ReadStdin");
- n = read(fd, buf, 2048);
- debug(4,(stderr, "read %ld bytes from stdin\n", n));
+ enterprocedure("ReadStdin");
+ n = read(fd, buf, 2048);
+ debug(4, (stderr, "read %ld bytes from stdin\n", n));
}
static void
-SetUpStdin (void)
+SetUpStdin(void)
{
- enterprocedure("SetUpStdin");
- UsingFD(fileno(stdin), ReadStdin, NULL, NULL);
+ enterprocedure("SetUpStdin");
+ UsingFD(fileno(stdin), ReadStdin, NULL, NULL);
}
/* ************************************************************ */
@@ -938,138 +863,121 @@ SetUpStdin (void)
*/
static long clientNumber = 0;
-struct fdinfo *FDinfo;
+struct fdinfo *FDinfo;
void
-SetUpPair(
- FD client,
- FD server)
+SetUpPair(FD client, FD server)
{
- if (client >= 0)
- {
- clientNumber += 1;
- FDinfo[client].Server = false;
- FDinfo[client].pair = server;
- FDinfo[client].ClientNumber = clientNumber;
- if (FDinfo[client].buffer == NULL)
- {
- FDinfo[client].buffer = calloc(1, BUFFER_SIZE);
- if (FDinfo[client].buffer == NULL)
- panic("unable to allocate client buffer");
- }
- FDinfo[client].bufcount = 0;
- FDinfo[client].buflimit = -1;
- FDinfo[client].bufdelivered = 0;
- if (server >= 0)
- {
- FDinfo[server].Server = true;
- FDinfo[server].pair = client;
- FDinfo[server].ClientNumber = FDinfo[client].ClientNumber;
- if (FDinfo[server].buffer == NULL)
- {
- FDinfo[server].buffer = calloc(1, BUFFER_SIZE);
- if (FDinfo[server].buffer == NULL)
- panic("unable to allocate server buffer");
- }
- FDinfo[server].bufcount = 0;
- FDinfo[server].buflimit = -1;
- FDinfo[server].bufdelivered = 0;
- }
+ if (client >= 0) {
+ clientNumber += 1;
+ FDinfo[client].Server = false;
+ FDinfo[client].pair = server;
+ FDinfo[client].ClientNumber = clientNumber;
+ if (FDinfo[client].buffer == NULL) {
+ FDinfo[client].buffer = calloc(1, BUFFER_SIZE);
+ if (FDinfo[client].buffer == NULL)
+ panic("unable to allocate client buffer");
+ }
+ FDinfo[client].bufcount = 0;
+ FDinfo[client].buflimit = -1;
+ FDinfo[client].bufdelivered = 0;
+ if (server >= 0) {
+ FDinfo[server].Server = true;
+ FDinfo[server].pair = client;
+ FDinfo[server].ClientNumber = FDinfo[client].ClientNumber;
+ if (FDinfo[server].buffer == NULL) {
+ FDinfo[server].buffer = calloc(1, BUFFER_SIZE);
+ if (FDinfo[server].buffer == NULL)
+ panic("unable to allocate server buffer");
+ }
+ FDinfo[server].bufcount = 0;
+ FDinfo[server].buflimit = -1;
+ FDinfo[server].bufdelivered = 0;
+ }
+ }
+ else if (server >= 0) {
+ close(server);
+ NotUsingFD(server);
}
- else if (server >= 0)
- {
- close(server);
- NotUsingFD(server);
- }
}
static void
-ResetPair (
- FD client,
- FD server)
+ResetPair(FD client, FD server)
{
- if (client >= 0)
- {
- free(FDinfo[client].buffer);
- FDinfo[client].buffer = NULL;
- FDinfo[client].bufcount = 0;
- FDinfo[client].buflimit = -1;
- FDinfo[client].bufdelivered = 0;
- }
- if (server >= 0)
- {
- free(FDinfo[server].buffer);
- FDinfo[server].buffer = NULL;
- FDinfo[server].bufcount = 0;
- FDinfo[server].buflimit = -1;
- FDinfo[server].bufdelivered = 0;
- }
+ if (client >= 0) {
+ free(FDinfo[client].buffer);
+ FDinfo[client].buffer = NULL;
+ FDinfo[client].bufcount = 0;
+ FDinfo[client].buflimit = -1;
+ FDinfo[client].bufdelivered = 0;
+ }
+ if (server >= 0) {
+ free(FDinfo[server].buffer);
+ FDinfo[server].buffer = NULL;
+ FDinfo[server].bufcount = 0;
+ FDinfo[server].buflimit = -1;
+ FDinfo[server].bufdelivered = 0;
+ }
}
static void
-CloseConnection (
- FD fd)
+CloseConnection(FD fd)
{
- debug(4,(stderr, "close %d and %d\n", fd, FDPair(fd)));
- ResetPair (ClientHalf(fd), ServerHalf(fd));
- StopClientConnection(ServerHalf(fd));
- StopServerConnection(ClientHalf(fd));
+ debug(4, (stderr, "close %d and %d\n", fd, FDPair(fd)));
+ ResetPair(ClientHalf(fd), ServerHalf(fd));
+ StopClientConnection(ServerHalf(fd));
+ StopServerConnection(ClientHalf(fd));
#ifdef USE_XTRANS
- _X11TransClose(GetXTransConnInfo(fd));
- _X11TransClose(GetXTransConnInfo(FDPair(fd)));
+ _X11TransClose(GetXTransConnInfo(fd));
+ _X11TransClose(GetXTransConnInfo(FDPair(fd)));
#else
- close(fd);
- close(FDPair(fd));
+ close(fd);
+ close(FDPair(fd));
#endif
- NotUsingFD(fd);
- NotUsingFD(FDPair(fd));
- if (TerminateClose)
- exit (0);
+ NotUsingFD(fd);
+ NotUsingFD(FDPair(fd));
+ if (TerminateClose)
+ exit(0);
}
/* ************************************************************ */
FD
-FDPair (
- FD fd)
+FDPair(FD fd)
{
- return(FDinfo[fd].pair);
+ return (FDinfo[fd].pair);
}
FD
-ClientHalf (
- FD fd)
+ClientHalf(FD fd)
{
- if (FDinfo[fd].Server)
- return(FDinfo[fd].pair);
- return(fd);
+ if (FDinfo[fd].Server)
+ return (FDinfo[fd].pair);
+ return (fd);
}
FD
-ServerHalf (
- FD fd)
+ServerHalf(FD fd)
{
- if (FDinfo[fd].Server)
- return(fd);
- return(FDinfo[fd].pair);
+ if (FDinfo[fd].Server)
+ return (fd);
+ return (FDinfo[fd].pair);
}
const char *
-ClientName (
- FD fd)
+ClientName(FD fd)
{
- static char name[12];
+ static char name[12];
- if (clientNumber <= 1)
- return("");
- (void)sprintf(name, " %d", FDinfo[fd].ClientNumber);
- return(name);
+ if (clientNumber <= 1)
+ return ("");
+ (void) sprintf(name, " %d", FDinfo[fd].ClientNumber);
+ return (name);
}
int
-ClientNumber (
- FD fd)
+ClientNumber(FD fd)
{
return FDinfo[fd].ClientNumber;
}
@@ -1084,59 +992,52 @@ ClientNumber (
* data
*/
void
-FlushFD (
- FD fd)
+FlushFD(FD fd)
{
- long BytesToWrite = FDinfo[fd].bufcount - FDinfo[fd].bufstart;
- unsigned char *p = FDinfo[fd].buffer + FDinfo[fd].bufstart;
- int PeerFD;
-
- PeerFD = FDPair (fd);
- if (FDinfo[fd].buflimit >= 0)
- {
- if (FDinfo[fd].bufdelivered + BytesToWrite > FDinfo[fd].buflimit)
- BytesToWrite = FDinfo[fd].buflimit - FDinfo[fd].bufdelivered;
- }
- while (BytesToWrite > 0)
- {
- int n1 = write (fd, (char *)p, (int)BytesToWrite);
- debug(4,(stderr, "write %d bytes\n", n1));
- if (n1 < 0)
- {
- if (errno != EWOULDBLOCK && errno != EAGAIN)
- {
- perror("Error on write");
- if (PeerFD >= 0)
- CloseConnection(PeerFD);
- BytesToWrite = 0;
- }
- break;
- }
- else
- {
- FDinfo[fd].bufstart += n1;
- FDinfo[fd].bufdelivered += n1;
- BytesToWrite -= n1;
- p += n1;
+ long BytesToWrite = FDinfo[fd].bufcount - FDinfo[fd].bufstart;
+ unsigned char *p = FDinfo[fd].buffer + FDinfo[fd].bufstart;
+ int PeerFD;
+
+ PeerFD = FDPair(fd);
+ if (FDinfo[fd].buflimit >= 0) {
+ if (FDinfo[fd].bufdelivered + BytesToWrite > FDinfo[fd].buflimit)
+ BytesToWrite = FDinfo[fd].buflimit - FDinfo[fd].bufdelivered;
}
- }
- if (FDinfo[fd].bufstart == FDinfo[fd].bufcount)
- {
- if (PeerFD >= 0) {
- FD_CLR(PeerFD, &BlockedReadDescriptors);
+ while (BytesToWrite > 0) {
+ int n1 = write(fd, (char *) p, (int) BytesToWrite);
+
+ debug(4, (stderr, "write %d bytes\n", n1));
+ if (n1 < 0) {
+ if (errno != EWOULDBLOCK && errno != EAGAIN) {
+ perror("Error on write");
+ if (PeerFD >= 0)
+ CloseConnection(PeerFD);
+ BytesToWrite = 0;
+ }
+ break;
+ }
+ else {
+ FDinfo[fd].bufstart += n1;
+ FDinfo[fd].bufdelivered += n1;
+ BytesToWrite -= n1;
+ p += n1;
+ }
}
- FD_CLR(fd, &WriteDescriptors);
- FDinfo[fd].bufcount = FDinfo[fd].bufstart = 0;
- }
- else
- {
- if (PeerFD >= 0) {
- FD_SET(PeerFD, &BlockedReadDescriptors);
+ if (FDinfo[fd].bufstart == FDinfo[fd].bufcount) {
+ if (PeerFD >= 0) {
+ FD_CLR(PeerFD, &BlockedReadDescriptors);
+ }
+ FD_CLR(fd, &WriteDescriptors);
+ FDinfo[fd].bufcount = FDinfo[fd].bufstart = 0;
}
- if (FDinfo[fd].buflimit != FDinfo[fd].bufdelivered) {
- FD_SET(fd, &WriteDescriptors);
+ else {
+ if (PeerFD >= 0) {
+ FD_SET(PeerFD, &BlockedReadDescriptors);
+ }
+ if (FDinfo[fd].buflimit != FDinfo[fd].bufdelivered) {
+ FD_SET(fd, &WriteDescriptors);
+ }
}
- }
}
/* when we get data from a client, we read it in, copy it to the
@@ -1144,50 +1045,45 @@ FlushFD (
have to have a server, if there isn't one. */
static void
-DataFromClient (
- FD fd)
+DataFromClient(FD fd)
{
- long n;
- FD ServerFD;
-
- Verbose = XVerbose;
- enterprocedure("DataFromClient");
- ServerFD = FDPair(fd);
- if (ServerFD < 0)
- {
- ServerFD = ConnectToServer(false);
- if (ServerFD < 0)
- {
- CloseConnection(fd);
- return;
- }
- SetUpPair(fd, ServerFD);
+ long n;
+ FD ServerFD;
+
+ Verbose = XVerbose;
+ enterprocedure("DataFromClient");
+ ServerFD = FDPair(fd);
+ if (ServerFD < 0) {
+ ServerFD = ConnectToServer(false);
+ if (ServerFD < 0) {
+ CloseConnection(fd);
+ return;
+ }
+ SetUpPair(fd, ServerFD);
}
- n = read(fd, FDinfo[ServerFD].buffer, BUFFER_SIZE);
- debug(4,(stderr, "read %ld bytes from Client%s\n", n, ClientName(fd)));
- if (n < 0)
- {
- PrintTime();
- perror("Client --> read error:");
- CloseConnection(fd);
- return;
+ n = read(fd, FDinfo[ServerFD].buffer, BUFFER_SIZE);
+ debug(4, (stderr, "read %ld bytes from Client%s\n", n, ClientName(fd)));
+ if (n < 0) {
+ PrintTime();
+ perror("Client --> read error:");
+ CloseConnection(fd);
+ return;
}
- if (n == 0)
- {
- PrintTime();
- if (Verbose >= 0)
- fprintf(stdout, "Client%s --> EOF\n", ClientName(fd));
- CloseConnection(fd);
- return;
+ if (n == 0) {
+ PrintTime();
+ if (Verbose >= 0)
+ fprintf(stdout, "Client%s --> EOF\n", ClientName(fd));
+ CloseConnection(fd);
+ return;
}
- FDinfo[ServerFD].bufcount = n;
- FDinfo[ServerFD].bufstart = 0;
+ FDinfo[ServerFD].bufcount = n;
+ FDinfo[ServerFD].bufstart = 0;
- FlushFD (ServerFD);
- /* also report the bytes to standard out */
- ReportFromClient(fd, FDinfo[ServerFD].buffer, n);
+ FlushFD(ServerFD);
+ /* also report the bytes to standard out */
+ ReportFromClient(fd, FDinfo[ServerFD].buffer, n);
}
/* ********************************************** */
@@ -1198,116 +1094,107 @@ DataFromClient (
we close the connection down -- don't need a server with no client. */
static void
-DataFromServer (
- FD fd)
+DataFromServer(FD fd)
{
- long n;
- FD ClientFD;
-
- Verbose = XVerbose;
- ClientFD = FDPair(fd);
- if (ClientFD < 0)
- {
- CloseConnection(fd);
- return;
+ long n;
+ FD ClientFD;
+
+ Verbose = XVerbose;
+ ClientFD = FDPair(fd);
+ if (ClientFD < 0) {
+ CloseConnection(fd);
+ return;
}
- enterprocedure("DataFromServer");
- n = read(fd, (char *)FDinfo[ClientFD].buffer, BUFFER_SIZE);
- debug(4,(stderr, "read %ld bytes from Server%s\n", n, ClientName(fd)));
- if (n < 0)
- {
- PrintTime();
- perror("read error <- Server");
- CloseConnection(fd);
- return;
+ enterprocedure("DataFromServer");
+ n = read(fd, (char *) FDinfo[ClientFD].buffer, BUFFER_SIZE);
+ debug(4, (stderr, "read %ld bytes from Server%s\n", n, ClientName(fd)));
+ if (n < 0) {
+ PrintTime();
+ perror("read error <- Server");
+ CloseConnection(fd);
+ return;
}
- if (n == 0)
- {
- PrintTime();
- if (Verbose >= 0)
- fprintf(stdout, "EOF <-- Server%s\n", ClientName(fd));
- CloseConnection(fd);
- return;
+ if (n == 0) {
+ PrintTime();
+ if (Verbose >= 0)
+ fprintf(stdout, "EOF <-- Server%s\n", ClientName(fd));
+ CloseConnection(fd);
+ return;
}
- FDinfo[ClientFD].bufcount = n;
- FDinfo[ClientFD].bufstart = 0;
- FlushFD (ClientFD);
+ FDinfo[ClientFD].bufcount = n;
+ FDinfo[ClientFD].bufstart = 0;
+ FlushFD(ClientFD);
- /* also report the bytes to standard out */
- ReportFromServer(fd, FDinfo[ClientFD].buffer, n);
+ /* also report the bytes to standard out */
+ ReportFromServer(fd, FDinfo[ClientFD].buffer, n);
}
-
/* ************************************************************ */
/* */
/* Create New Connection to a client program and to Server */
/* */
/* ************************************************************ */
-
void
-NewConnection (
- FD fd)
+NewConnection(FD fd)
{
- FD ClientFD = ConnectToClient(fd);
- FD ServerFD = ConnectToServer(true);
+ FD ClientFD = ConnectToClient(fd);
+ FD ServerFD = ConnectToServer(true);
- SetUpPair(ClientFD, ServerFD);
+ SetUpPair(ClientFD, ServerFD);
}
/* ************************************************************ */
static FD
-ConnectToClient (
- FD ConnectionSocket)
+ConnectToClient(FD ConnectionSocket)
{
- FD ClientFD;
- XtransConnInfo trans_conn = NULL;
+ FD ClientFD;
+ XtransConnInfo trans_conn = NULL;
+
#ifdef USE_XTRANS
- XtransConnInfo listen_conn;
- int status;
+ XtransConnInfo listen_conn;
+ int status;
#else
- struct sockaddr_in from;
- int len = sizeof (from);
- int ON = 1 /* used in ioctl */ ;
+ struct sockaddr_in from;
+ int len = sizeof(from);
+ int ON = 1; /* used in ioctl */
#endif
- enterprocedure("ConnectToClient");
+ enterprocedure("ConnectToClient");
#ifdef USE_XTRANS
- listen_conn = GetXTransConnInfo(ConnectionSocket);
- if ((trans_conn = _X11TransAccept (listen_conn, &status)) == NULL) {
- debug(4,(stderr, "Failed to accept connection\n"));
- return -1;
- }
- _X11TransSetOption(trans_conn, TRANS_NONBLOCKING, 1);
- ClientFD = _X11TransGetConnectionNumber(trans_conn);
+ listen_conn = GetXTransConnInfo(ConnectionSocket);
+ if ((trans_conn = _X11TransAccept(listen_conn, &status)) == NULL) {
+ debug(4, (stderr, "Failed to accept connection\n"));
+ return -1;
+ }
+ _X11TransSetOption(trans_conn, TRANS_NONBLOCKING, 1);
+ ClientFD = _X11TransGetConnectionNumber(trans_conn);
#else
- ClientFD = AcceptConnection(ConnectionSocket);
+ ClientFD = AcceptConnection(ConnectionSocket);
#endif
- debug(4,(stderr, "Connect To Client: FD %d\n", ClientFD));
- if (ClientFD < 0 && errno == EWOULDBLOCK)
- {
- debug(4,(stderr, "Almost blocked accepting FD %d\n", ClientFD));
- panic("Can't connect to Client");
+ debug(4, (stderr, "Connect To Client: FD %d\n", ClientFD));
+ if (ClientFD < 0 && errno == EWOULDBLOCK) {
+ debug(4, (stderr, "Almost blocked accepting FD %d\n", ClientFD));
+ panic("Can't connect to Client");
}
- if (ClientFD < 0)
- {
- debug(4,(stderr, "NewConnection: error %d\n", errno));
- panic("Can't connect to Client");
+ if (ClientFD < 0) {
+ debug(4, (stderr, "NewConnection: error %d\n", errno));
+ panic("Can't connect to Client");
}
- UsingFD(ClientFD, DataFromClient, FlushFD, trans_conn);
+ UsingFD(ClientFD, DataFromClient, FlushFD, trans_conn);
#ifndef USE_XTRANS
- ioctl(ClientFD, FIOCLEX, 0);
- ioctl(ClientFD, FIONBIO, &ON);
+ ioctl(ClientFD, FIOCLEX, 0);
+ ioctl(ClientFD, FIONBIO, &ON);
#endif
- StartClientConnection(ClientFD);
- return(ClientFD);
+ StartClientConnection(ClientFD);
+ return (ClientFD);
}
/* ************************************************************ */
@@ -1316,35 +1203,33 @@ ConnectToClient (
/* ************************************************************ */
-
FD
-ConnectToServer (
- Boolean report)
+ConnectToServer(Boolean report)
{
- FD ServerFD;
- XtransConnInfo trans_conn = NULL; /* transport connection object */
- short port;
+ FD ServerFD;
+ XtransConnInfo trans_conn = NULL; /* transport connection object */
+ short port;
- enterprocedure("ConnectToServer");
+ enterprocedure("ConnectToServer");
- port = GetServerport ();
+ port = GetServerport();
- if (port == ScopePort &&
- ((ServerHostName[0] == '\0') || strcmp(ServerHostName, ScopeHost) == 0))
+ if (port == ScopePort &&
+ ((ServerHostName[0] == '\0') || strcmp(ServerHostName, ScopeHost) == 0))
{
- char error_message[100];
- sprintf(error_message, "Trying to attach to myself: %s,%d\n",
- ServerHostName, port);
- panic(error_message);
+ char error_message[100];
+
+ sprintf(error_message, "Trying to attach to myself: %s,%d\n",
+ ServerHostName, port);
+ panic(error_message);
}
- ServerFD = MakeConnection (ServerHostName, port, report, &trans_conn);
+ ServerFD = MakeConnection(ServerHostName, port, report, &trans_conn);
- debug(4,(stderr, "Connect To Server: FD %d\n", ServerFD));
- if (ServerFD >= 0)
- {
- UsingFD(ServerFD, DataFromServer, FlushFD, trans_conn);
- StartServerConnection(ServerFD);
+ debug(4, (stderr, "Connect To Server: FD %d\n", ServerFD));
+ if (ServerFD >= 0) {
+ UsingFD(ServerFD, DataFromServer, FlushFD, trans_conn);
+ StartServerConnection(ServerFD);
}
- return(ServerFD);
+ return (ServerFD);
}
diff --git a/scope.h b/scope.h
index b04c331..426d67a 100644
--- a/scope.h
+++ b/scope.h
@@ -1,8 +1,8 @@
-/* **********************************************
- * *
- * header file for the Server spy scope *
- * *
- * James Peterson, 1987 *
+/*
+ * header file for the Server spy scope
+ *
+ * James Peterson, 1987
+ *
* Copyright (C) 1987 MCC
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -22,8 +22,9 @@
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
- * *
- * *
+ *
+ */
+/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -45,7 +46,7 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
- ********************************************** */
+ */
#ifndef XSCOPE_SCOPE_H
#define XSCOPE_SCOPE_H
@@ -75,22 +76,21 @@
#define Assert(b) (b)
#define debug(n,f) (void)((debuglevel & n) ? (fprintf f,fflush(stderr)) : 0)
-extern short debuglevel;
+extern short debuglevel;
/* ********************************************** */
/* */
/* ********************************************** */
-extern short Verbose /* quiet (0) or increasingly verbose ( > 0) */ ;
-extern short XVerbose;
-extern short NasVerbose;
-extern short Raw /* raw data output only */ ;
+extern short Verbose; /* quiet (0) or increasingly verbose (> 0) */
+extern short XVerbose;
+extern short NasVerbose;
+extern short Raw; /* raw data output only */
+extern int ScopePort;
+extern char *ScopeHost;
-extern int ScopePort;
-extern char *ScopeHost;
-
-extern int Interrupt, SingleStep, BreakPoint;
+extern int Interrupt, SingleStep, BreakPoint;
extern char ServerHostName[MAXHOSTNAMELEN];
extern char AudioServerHostName[MAXHOSTNAMELEN];
@@ -104,20 +104,19 @@ extern char AudioServerHostName[MAXHOSTNAMELEN];
#define BUFFER_SIZE (1024 * 32)
-struct fdinfo
-{
- Boolean Server;
- int ClientNumber;
- FD pair;
- unsigned char *buffer;
- int bufcount;
- int bufstart;
- int buflimit; /* limited writes */
- int bufdelivered; /* total bytes delivered */
- Boolean writeblocked;
+struct fdinfo {
+ Boolean Server;
+ int ClientNumber;
+ FD pair;
+ unsigned char *buffer;
+ int bufcount;
+ int bufstart;
+ int buflimit; /* limited writes */
+ int bufdelivered; /* total bytes delivered */
+ Boolean writeblocked;
};
-extern struct fdinfo *FDinfo;
+extern struct fdinfo *FDinfo;
extern int littleEndian;
extern char HandleSIGUSR1;
extern char Leader[];
@@ -125,5 +124,4 @@ extern long ServerBasePort;
extern char ScopeEnabled;
extern long TranslateText;
-
-#endif /* XSCOPE_SCOPE_H */
+#endif /* XSCOPE_SCOPE_H */
diff --git a/server.c b/server.c
index a65eaee..b0019ee 100644
--- a/server.c
+++ b/server.c
@@ -1,8 +1,8 @@
-/* ************************************************** *
- * *
- * Code to decode and print X11 protocol *
- * *
- * James Peterson, 1988 *
+/*
+ * Code to decode and print X11 protocol
+ *
+ * James Peterson, 1988
+ *
* Copyright (C) 1988 MCC
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -22,8 +22,9 @@
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
- * *
- * *
+ *
+ */
+/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -45,15 +46,15 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
- * ************************************************** */
+ */
#include "scope.h"
#include "x11.h"
-struct TypeDef TD[MaxTypes];
-unsigned char RBf[2];
-unsigned char SBf[4];
-struct ConnState *CS;
+struct TypeDef TD[MaxTypes];
+unsigned char RBf[2];
+unsigned char SBf[4];
+struct ConnState *CS;
/* ************************************************************ */
/* */
@@ -61,34 +62,27 @@ struct ConnState *CS;
/* ************************************************************ */
void
-ReportFromClient(
- FD fd,
- const unsigned char *buf,
- long n)
-{
- if (Verbose > 0)
- {
- if (ScopeEnabled) {
- PrintTime();
- fprintf(stdout, "Client%s --> %4ld %s\n",
- ClientName(fd), n, (n == 1 ? "byte" : "bytes"));
- }
+ReportFromClient(FD fd, const unsigned char *buf, long n)
+{
+ if (Verbose > 0) {
+ if (ScopeEnabled) {
+ PrintTime();
+ fprintf(stdout, "Client%s --> %4ld %s\n",
+ ClientName(fd), n, (n == 1 ? "byte" : "bytes"));
+ }
}
ProcessBuffer(fd, buf, n);
}
void
-ReportFromServer (
- FD fd,
- const unsigned char *buf,
- long n)
+ReportFromServer(FD fd, const unsigned char *buf, long n)
{
if (Verbose > 0) {
- if (ScopeEnabled) {
- PrintTime();
- fprintf(stdout, "\t\t\t\t\t%4ld %s <-- X11 Server%s\n",
- n, (n == 1 ? "byte" : "bytes"), ClientName(fd));
- }
+ if (ScopeEnabled) {
+ PrintTime();
+ fprintf(stdout, "\t\t\t\t\t%4ld %s <-- X11 Server%s\n",
+ n, (n == 1 ? "byte" : "bytes"), ClientName(fd));
+ }
}
ProcessBuffer(fd, buf, n);
}
@@ -101,33 +95,31 @@ ReportFromServer (
static long ZeroTime1 = -1;
static long ZeroTime2 = -1;
-static struct timeval tp;
+static struct timeval tp;
/* print the time since we started in hundredths (1/100) of seconds */
void
PrintTime(void)
{
- static long lastsec = 0;
- long sec /* seconds */ ;
- long hsec /* hundredths of a second */ ;
+ static long lastsec = 0;
+ long sec; /* seconds */
+ long hsec; /* hundredths of a second */
- gettimeofday(&tp, (struct timezone *)NULL);
- if (ZeroTime1 == -1 || (tp.tv_sec - lastsec) >= 1000)
- {
- ZeroTime1 = tp.tv_sec;
- ZeroTime2 = tp.tv_usec / 10000;
+ gettimeofday(&tp, (struct timezone *) NULL);
+ if (ZeroTime1 == -1 || (tp.tv_sec - lastsec) >= 1000) {
+ ZeroTime1 = tp.tv_sec;
+ ZeroTime2 = tp.tv_usec / 10000;
}
- lastsec = tp.tv_sec;
- sec = tp.tv_sec - ZeroTime1;
- hsec = tp.tv_usec / 10000 - ZeroTime2;
- if (hsec < 0)
- {
- hsec += 100;
- sec -= 1;
+ lastsec = tp.tv_sec;
+ sec = tp.tv_sec - ZeroTime1;
+ hsec = tp.tv_usec / 10000 - ZeroTime2;
+ if (hsec < 0) {
+ hsec += 100;
+ sec -= 1;
}
- fprintf(stdout, "%2ld.%02ld: ", sec, hsec);
+ fprintf(stdout, "%2ld.%02ld: ", sec, hsec);
}
/* ************************************************************ */
@@ -140,56 +132,50 @@ PrintTime(void)
support the types built into X11 */
long
-pad (
- long n)
+pad(long n)
{
- /* round up to next multiple of 4 */
- return((n + 3) & ~0x3);
+ /* round up to next multiple of 4 */
+ return ((n + 3) & ~0x3);
}
unsigned long
-ILong (
- const unsigned char buf[])
+ILong(const unsigned char buf[])
{
- /* check for byte-swapping */
- if (littleEndian)
- return((((((buf[3] << 8) | buf[2]) << 8) | buf[1]) << 8) | buf[0]);
- return((((((buf[0] << 8) | buf[1]) << 8) | buf[2]) << 8) | buf[3]);
+ /* check for byte-swapping */
+ if (littleEndian)
+ return ((((((buf[3] << 8) | buf[2]) << 8) | buf[1]) << 8) | buf[0]);
+ return ((((((buf[0] << 8) | buf[1]) << 8) | buf[2]) << 8) | buf[3]);
}
unsigned short
-IShort (
- const unsigned char buf[])
+IShort(const unsigned char buf[])
{
- /* check for byte-swapping */
- if (littleEndian)
- return (buf[1] << 8) | buf[0];
- return((buf[0] << 8) | buf[1]);
+ /* check for byte-swapping */
+ if (littleEndian)
+ return (buf[1] << 8) | buf[0];
+ return ((buf[0] << 8) | buf[1]);
}
unsigned short
-IChar2B (
- const unsigned char buf[])
+IChar2B(const unsigned char buf[])
{
- /* CHAR2B is like an IShort, but not byte-swapped */
- return((buf[0] << 8) | buf[1]);
+ /* CHAR2B is like an IShort, but not byte-swapped */
+ return ((buf[0] << 8) | buf[1]);
}
unsigned short
-IByte (
- const unsigned char buf[])
+IByte(const unsigned char buf[])
{
- return(buf[0]);
+ return (buf[0]);
}
Boolean
-IBool (
- const unsigned char buf[])
+IBool(const unsigned char buf[])
{
- if (buf[0] != 0)
- return(true);
- else
- return(false);
+ if (buf[0] != 0)
+ return (true);
+ else
+ return (false);
}
@@ -202,49 +188,44 @@ IBool (
interpret. The following procedures provide this ability */
static void
-SaveBytes (
- FD fd,
- const unsigned char *buf,
- long n)
-{
- /* check if there is enough space to hold the bytes we want */
- if (CS[fd].NumberofSavedBytes + n > CS[fd].SizeofSavedBytes)
- {
- /* not enough room so far; malloc more space and copy */
- long SizeofNewBytes = (CS[fd].NumberofSavedBytes + n + 1);
- unsigned char *NewBytes = realloc (CS[fd].SavedBytes, SizeofNewBytes);
- if (NewBytes == NULL)
- panic("Can't allocate memory for SavedBytes");
- CS[fd].SavedBytes = NewBytes;
- CS[fd].SizeofSavedBytes = SizeofNewBytes;
+SaveBytes(FD fd, const unsigned char *buf, long n)
+{
+ /* check if there is enough space to hold the bytes we want */
+ if (CS[fd].NumberofSavedBytes + n > CS[fd].SizeofSavedBytes) {
+ /* not enough room so far; malloc more space and copy */
+ long SizeofNewBytes = (CS[fd].NumberofSavedBytes + n + 1);
+ unsigned char *NewBytes = realloc(CS[fd].SavedBytes, SizeofNewBytes);
+
+ if (NewBytes == NULL)
+ panic("Can't allocate memory for SavedBytes");
+ CS[fd].SavedBytes = NewBytes;
+ CS[fd].SizeofSavedBytes = SizeofNewBytes;
}
- /* now copy the new bytes onto the end of the old bytes */
- bcopy(/* from */(char *)buf,
- /* to */(char *)(CS[fd].SavedBytes + CS[fd].NumberofSavedBytes),
- /* count */(int)n);
- CS[fd].NumberofSavedBytes += n;
+ /* now copy the new bytes onto the end of the old bytes */
+ bcopy( /* from */ (char *) buf,
+ /* to */ (char *) (CS[fd].SavedBytes + CS[fd].NumberofSavedBytes),
+ /* count */ (int) n);
+ CS[fd].NumberofSavedBytes += n;
}
static void
-RemoveSavedBytes (
- FD fd,
- long n)
-{
- /* check if all bytes are being removed -- easiest case */
- if (CS[fd].NumberofSavedBytes <= n)
- CS[fd].NumberofSavedBytes = 0;
- else if (n == 0)
- return;
- else
- {
- /* not all bytes are being removed -- shift the remaining ones down */
- register unsigned char *p = CS[fd].SavedBytes;
- register unsigned char *q = CS[fd].SavedBytes + n;
- register long i = CS[fd].NumberofSavedBytes - n;
- while (i-- > 0)
- *p++ = *q++;
- CS[fd].NumberofSavedBytes -= n;
+RemoveSavedBytes(FD fd, long n)
+{
+ /* check if all bytes are being removed -- easiest case */
+ if (CS[fd].NumberofSavedBytes <= n)
+ CS[fd].NumberofSavedBytes = 0;
+ else if (n == 0)
+ return;
+ else {
+ /* not all bytes are being removed -- shift the remaining ones down */
+ register unsigned char *p = CS[fd].SavedBytes;
+ register unsigned char *q = CS[fd].SavedBytes + n;
+ register long i = CS[fd].NumberofSavedBytes - n;
+
+ while (i-- > 0)
+ *p++ = *q++;
+ CS[fd].NumberofSavedBytes -= n;
}
}
@@ -274,108 +255,95 @@ static long FinishReply(FD fd, const unsigned char *buf, long n);
int littleEndian;
void
-ProcessBuffer (
- FD fd,
- const unsigned char *buf,
- long n)
+ProcessBuffer(FD fd, const unsigned char *buf, long n)
{
- const unsigned char *BytesToProcess;
- long NumberofUsedBytes;
+ const unsigned char *BytesToProcess;
+ long NumberofUsedBytes;
- /* as long as we have enough bytes to do anything -- do it */
+ /* as long as we have enough bytes to do anything -- do it */
- if (Verbose > 4)
- {
- fprintf (stdout, "\nRead from fd %d\n", fd);
- DumpHexBuffer (buf, n);
+ if (Verbose > 4) {
+ fprintf(stdout, "\nRead from fd %d\n", fd);
+ DumpHexBuffer(buf, n);
}
- while (CS[fd].NumberofSavedBytes + n >= CS[fd].NumberofBytesNeeded)
- {
- /*
- we have enough bytes to do something. We want the bytes to be
- grouped together into one contiguous block of bytes. We have three
- cases:
-
- (1) NumberofSavedBytes = 0; so all needed bytes are in the
- read buffer, buf.
-
- (2) NumberofSavedBytes >= NumberofBytesNeeded; in this case we
- will not need to copy any extra bytes into the save buffer.
-
- (3) 0 < NumberofSavedBytes < NumberofBytesNeeded; so
- some bytes are in the save buffer and others are in the read
- buffer. In this case we need to copy some of the bytes from the
- read buffer to the save buffer to get as many bytes as we need,
- then use these bytes.
- */
-
- if (CS[fd].NumberofSavedBytes == 0)
- {
- /* no saved bytes, so just process the first bytes in the
- read buffer */
- BytesToProcess = buf /* address of request bytes */;
- }
- else
- {
- if (CS[fd].NumberofSavedBytes < CS[fd].NumberofBytesNeeded)
- {
- /* first determine the number of bytes we need to
- transfer; then transfer them and remove them from
- the read buffer. (there may be additional requests
- in the read buffer) */
- long m;
- m = CS[fd].NumberofBytesNeeded - CS[fd].NumberofSavedBytes;
- SaveBytes(fd, buf, m);
- buf += m;
- n -= m;
- }
- BytesToProcess = CS[fd].SavedBytes /* address of request bytes */;
- }
-
- /*
- BytesToProcess points to a contiguous block of NumberofBytesNeeded
- bytes that we should process. The type of processing depends upon
- the state we are in. The processing routine should return the
- number of bytes that it actually used.
- */
- littleEndian = CS[fd].littleEndian;
- NumberofUsedBytes = (*CS[fd].ByteProcessing)
- (fd, BytesToProcess, CS[fd].NumberofBytesNeeded);
-
- /* the number of bytes that were actually used is normally (but not
- always) the number of bytes needed. Discard the bytes that were
- actually used, not the bytes that were needed. The number of used
- bytes must be less than or equal to the number of needed bytes. */
-
- if (NumberofUsedBytes > 0)
- {
- CS[fd].NumberofBytesProcessed += NumberofUsedBytes;
- if (CS[fd].NumberofSavedBytes > 0)
- RemoveSavedBytes(fd, NumberofUsedBytes);
- else
- {
- /* there are no saved bytes, so the bytes that were
- used must have been in the read buffer */
- buf += NumberofUsedBytes;
- n -= NumberofUsedBytes;
- }
- }
- } /* end of while (NumberofSavedBytes + n >= NumberofBytesNeeded) */
+ while (CS[fd].NumberofSavedBytes + n >= CS[fd].NumberofBytesNeeded) {
+ /*
+ we have enough bytes to do something. We want the bytes to be
+ grouped together into one contiguous block of bytes. We have three
+ cases:
+
+ (1) NumberofSavedBytes = 0; so all needed bytes are in the
+ read buffer, buf.
+
+ (2) NumberofSavedBytes >= NumberofBytesNeeded; in this case we
+ will not need to copy any extra bytes into the save buffer.
+
+ (3) 0 < NumberofSavedBytes < NumberofBytesNeeded; so
+ some bytes are in the save buffer and others are in the read
+ buffer. In this case we need to copy some of the bytes from the
+ read buffer to the save buffer to get as many bytes as we need,
+ then use these bytes.
+ */
+
+ if (CS[fd].NumberofSavedBytes == 0) {
+ /* no saved bytes, so just process the first bytes in the
+ read buffer */
+ BytesToProcess = buf; /* address of request bytes */
+ }
+ else {
+ if (CS[fd].NumberofSavedBytes < CS[fd].NumberofBytesNeeded) {
+ /* first determine the number of bytes we need to
+ transfer; then transfer them and remove them from
+ the read buffer. (there may be additional requests
+ in the read buffer) */
+ long m;
+
+ m = CS[fd].NumberofBytesNeeded - CS[fd].NumberofSavedBytes;
+ SaveBytes(fd, buf, m);
+ buf += m;
+ n -= m;
+ }
+ BytesToProcess = CS[fd].SavedBytes; /* address of request bytes */
+ }
+
+ /*
+ BytesToProcess points to a contiguous block of NumberofBytesNeeded
+ bytes that we should process. The type of processing depends upon
+ the state we are in. The processing routine should return the
+ number of bytes that it actually used.
+ */
+ littleEndian = CS[fd].littleEndian;
+ NumberofUsedBytes = (*CS[fd].ByteProcessing)
+ (fd, BytesToProcess, CS[fd].NumberofBytesNeeded);
+
+ /* the number of bytes that were actually used is normally (but not
+ always) the number of bytes needed. Discard the bytes that were
+ actually used, not the bytes that were needed. The number of used
+ bytes must be less than or equal to the number of needed bytes. */
+
+ if (NumberofUsedBytes > 0) {
+ CS[fd].NumberofBytesProcessed += NumberofUsedBytes;
+ if (CS[fd].NumberofSavedBytes > 0)
+ RemoveSavedBytes(fd, NumberofUsedBytes);
+ else {
+ /* there are no saved bytes, so the bytes that were
+ used must have been in the read buffer */
+ buf += NumberofUsedBytes;
+ n -= NumberofUsedBytes;
+ }
+ }
+ } /* end of while (NumberofSavedBytes + n >= NumberofBytesNeeded) */
if (Verbose > 3)
- fprintf (stdout, "Have %ld need %ld\n",
- CS[fd].NumberofSavedBytes + n,
- CS[fd].NumberofBytesNeeded);
- /* not enough bytes -- just save the new bytes for more later */
- if (n > 0)
- {
- SaveBytes(fd, buf, n);
- }
- return;
+ fprintf(stdout, "Have %ld need %ld\n",
+ CS[fd].NumberofSavedBytes + n, CS[fd].NumberofBytesNeeded);
+ /* not enough bytes -- just save the new bytes for more later */
+ if (n > 0) {
+ SaveBytes(fd, buf, n);
+ }
+ return;
}
-
-
/* ************************************************************ */
/* */
/* */
@@ -386,206 +354,181 @@ ProcessBuffer (
*/
void
-SetBufLimit (
- FD fd)
+SetBufLimit(FD fd)
{
- int ServerFD = FDPair (fd);
- FDinfo[ServerFD].buflimit = (CS[fd].NumberofBytesProcessed +
- CS[fd].NumberofBytesNeeded);
+ int ServerFD = FDPair(fd);
+
+ FDinfo[ServerFD].buflimit = (CS[fd].NumberofBytesProcessed +
+ CS[fd].NumberofBytesNeeded);
}
void
-ClearBufLimit (
- FD fd)
+ClearBufLimit(FD fd)
{
- int ServerFD = FDPair (fd);
- FDinfo[ServerFD].buflimit = -1;
+ int ServerFD = FDPair(fd);
+
+ FDinfo[ServerFD].buflimit = -1;
}
static void
-StartStuff (
- FD fd)
+StartStuff(FD fd)
{
- if (BreakPoint)
- {
- int ServerFD = FDPair (fd);
- FDinfo[ServerFD].buflimit = (CS[fd].NumberofBytesProcessed +
- CS[fd].NumberofBytesNeeded);
- FlushFD (ServerFD);
- }
+ if (BreakPoint) {
+ int ServerFD = FDPair(fd);
+
+ FDinfo[ServerFD].buflimit = (CS[fd].NumberofBytesProcessed +
+ CS[fd].NumberofBytesNeeded);
+ FlushFD(ServerFD);
+ }
}
static void
-FinishStuff (
- FD fd,
- const unsigned char *buf,
- long n)
-{
- if (BreakPoint)
- {
- int ServerFD = FDPair (fd);
-
- FlushFD (ServerFD);
- if (SingleStep)
- ReadCommands ();
- else if (BreakPoint)
- TestBreakPoints (buf, n);
- if (!BreakPoint)
- {
- FDinfo[ServerFD].buflimit = -1;
- FlushFD (ServerFD);
+FinishStuff(FD fd, const unsigned char *buf, long n)
+{
+ if (BreakPoint) {
+ int ServerFD = FDPair(fd);
+
+ FlushFD(ServerFD);
+ if (SingleStep)
+ ReadCommands();
+ else if (BreakPoint)
+ TestBreakPoints(buf, n);
+ if (!BreakPoint) {
+ FDinfo[ServerFD].buflimit = -1;
+ FlushFD(ServerFD);
+ }
}
- }
}
void
-StartClientConnection (
- FD fd)
+StartClientConnection(FD fd)
{
- enterprocedure("StartClientConnection");
- /* when a new connection is started, we have no saved bytes */
- CS[fd].SavedBytes = NULL;
- CS[fd].SizeofSavedBytes = 0;
- CS[fd].NumberofSavedBytes = 0;
- CS[fd].NumberofBytesProcessed = 0;
+ enterprocedure("StartClientConnection");
+
+ /* when a new connection is started, we have no saved bytes */
+ CS[fd].SavedBytes = NULL;
+ CS[fd].SizeofSavedBytes = 0;
+ CS[fd].NumberofSavedBytes = 0;
+ CS[fd].NumberofBytesProcessed = 0;
- /* when a new connection is started, we have no reply Queue */
- FlushReplyQ(fd);
+ /* when a new connection is started, we have no reply Queue */
+ FlushReplyQ(fd);
- /* each new connection gets a request sequence number */
- CS[fd].SequenceNumber = 0;
+ /* each new connection gets a request sequence number */
+ CS[fd].SequenceNumber = 0;
- /* we need 12 bytes to start a SetUp message */
- CS[fd].ByteProcessing = StartSetUpMessage;
- CS[fd].NumberofBytesNeeded = 12;
- StartStuff (fd);
+ /* we need 12 bytes to start a SetUp message */
+ CS[fd].ByteProcessing = StartSetUpMessage;
+ CS[fd].NumberofBytesNeeded = 12;
+ StartStuff(fd);
}
void
-StopClientConnection (
- FD fd)
+StopClientConnection(FD fd)
{
- enterprocedure("StopClientConnection");
- /* when a new connection is stopped, discard the old buffer */
+ enterprocedure("StopClientConnection");
- if (CS[fd].SizeofSavedBytes > 0)
- free(CS[fd].SavedBytes);
+ /* when a new connection is stopped, discard the old buffer */
+ if (CS[fd].SizeofSavedBytes > 0)
+ free(CS[fd].SavedBytes);
}
long
-StartSetUpMessage (
- FD fd,
- const unsigned char *buf,
- long n)
-{
- unsigned short namelength;
- unsigned short datalength;
-
- enterprocedure("StartSetUpMessage");
- /*
- we need the first 12 bytes to be able to determine if, and how many,
- additional bytes we need for name and data authorization. However, we
- can't process the first 12 bytes until we get all of them, so
- return zero bytes used, and increase the number of bytes needed
- */
- CS[fd].littleEndian = (buf[0] == 'l');
- CS[ServerHalf(fd)].littleEndian = CS[fd].littleEndian;
- littleEndian = CS[fd].littleEndian;
-
- namelength = IShort(&buf[6]);
- datalength = IShort(&buf[8]);
- CS[fd].ByteProcessing = FinishSetUpMessage;
- CS[fd].NumberofBytesNeeded = n
- + pad((long)namelength) + pad((long)datalength);
- debug(8,(stderr, "need %ld bytes to finish startup\n",
- CS[fd].NumberofBytesNeeded - n));
- StartStuff (fd);
- return(0);
+StartSetUpMessage(FD fd, const unsigned char *buf, long n)
+{
+ unsigned short namelength;
+ unsigned short datalength;
+
+ enterprocedure("StartSetUpMessage");
+ /*
+ we need the first 12 bytes to be able to determine if, and how many,
+ additional bytes we need for name and data authorization. However, we
+ can't process the first 12 bytes until we get all of them, so
+ return zero bytes used, and increase the number of bytes needed
+ */
+ CS[fd].littleEndian = (buf[0] == 'l');
+ CS[ServerHalf(fd)].littleEndian = CS[fd].littleEndian;
+ littleEndian = CS[fd].littleEndian;
+
+ namelength = IShort(&buf[6]);
+ datalength = IShort(&buf[8]);
+ CS[fd].ByteProcessing = FinishSetUpMessage;
+ CS[fd].NumberofBytesNeeded = n
+ + pad((long) namelength) + pad((long) datalength);
+ debug(8, (stderr, "need %ld bytes to finish startup\n",
+ CS[fd].NumberofBytesNeeded - n));
+ StartStuff(fd);
+ return (0);
}
static long
-FinishSetUpMessage (
- FD fd,
- const unsigned char *buf,
- long n)
-{
- enterprocedure("FinishSetUpMessage");
- if( Raw || (Verbose > 3) )
- DumpItem("Client Connect", fd, buf, n) ;
- CS[fd].littleEndian = (buf[0] == 'l');
- CS[ServerHalf(fd)].littleEndian = CS[fd].littleEndian;
- littleEndian = CS[fd].littleEndian;
- if (ScopeEnabled)
- PrintSetUpMessage(buf);
-
- /* after a set-up message, we expect a string of requests */
- CS[fd].ByteProcessing = StartRequest;
- CS[fd].NumberofBytesNeeded = 4;
- FinishStuff (fd, buf, n);
- return(n);
+FinishSetUpMessage(FD fd, const unsigned char *buf, long n)
+{
+ enterprocedure("FinishSetUpMessage");
+ if (Raw || (Verbose > 3))
+ DumpItem("Client Connect", fd, buf, n);
+ CS[fd].littleEndian = (buf[0] == 'l');
+ CS[ServerHalf(fd)].littleEndian = CS[fd].littleEndian;
+ littleEndian = CS[fd].littleEndian;
+ if (ScopeEnabled)
+ PrintSetUpMessage(buf);
+
+ /* after a set-up message, we expect a string of requests */
+ CS[fd].ByteProcessing = StartRequest;
+ CS[fd].NumberofBytesNeeded = 4;
+ FinishStuff(fd, buf, n);
+ return (n);
}
static long
-StartBigRequest (
- FD fd,
- const unsigned char *buf,
- long n)
+StartBigRequest(FD fd, const unsigned char *buf, long n)
{
- enterprocedure("StartBigRequest");
+ enterprocedure("StartBigRequest");
- /* bytes 0-3 are ignored now; bytes 4-8 tell us the request length */
- CS[fd].requestLen = ILong(&buf[4]);
-
- CS[fd].ByteProcessing = FinishRequest;
- CS[fd].NumberofBytesNeeded = 4 * CS[fd].requestLen;
- debug(8,(stderr, "need %ld more bytes to finish request\n",
- CS[fd].NumberofBytesNeeded - n));
- StartStuff (fd);
- return(0);
-}
+ /* bytes 0-3 are ignored now; bytes 4-8 tell us the request length */
+ CS[fd].requestLen = ILong(&buf[4]);
-static long
-StartRequest (
- FD fd,
- const unsigned char *buf,
- long n)
-{
- enterprocedure("StartRequest");
-
- /* bytes 0,1 are ignored now; bytes 2,3 tell us the request length */
- CS[fd].requestLen = IShort(&buf[2]);
- if (CS[fd].requestLen == 0 && CS[fd].bigreqEnabled)
- {
- CS[fd].ByteProcessing = StartBigRequest;
- CS[fd].NumberofBytesNeeded = 8;
- }
- else
- {
- if (CS[fd].requestLen == 0)
- CS[fd].requestLen = 1;
CS[fd].ByteProcessing = FinishRequest;
CS[fd].NumberofBytesNeeded = 4 * CS[fd].requestLen;
- debug(8,(stderr, "need %ld more bytes to finish request\n",
- CS[fd].NumberofBytesNeeded - n));
- }
- StartStuff (fd);
- return(0);
+ debug(8, (stderr, "need %ld more bytes to finish request\n",
+ CS[fd].NumberofBytesNeeded - n));
+ StartStuff(fd);
+ return (0);
}
+static long
+StartRequest(FD fd, const unsigned char *buf, long n)
+{
+ enterprocedure("StartRequest");
+
+ /* bytes 0,1 are ignored now; bytes 2,3 tell us the request length */
+ CS[fd].requestLen = IShort(&buf[2]);
+ if (CS[fd].requestLen == 0 && CS[fd].bigreqEnabled) {
+ CS[fd].ByteProcessing = StartBigRequest;
+ CS[fd].NumberofBytesNeeded = 8;
+ }
+ else {
+ if (CS[fd].requestLen == 0)
+ CS[fd].requestLen = 1;
+ CS[fd].ByteProcessing = FinishRequest;
+ CS[fd].NumberofBytesNeeded = 4 * CS[fd].requestLen;
+ debug(8, (stderr, "need %ld more bytes to finish request\n",
+ CS[fd].NumberofBytesNeeded - n));
+ }
+ StartStuff(fd);
+ return (0);
+}
static long
-FinishRequest (
- FD fd,
- const unsigned char *buf,
- long n)
+FinishRequest(FD fd, const unsigned char *buf, long n)
{
- enterprocedure("FinishRequest");
- CS[fd].ByteProcessing = StartRequest;
- CS[fd].NumberofBytesNeeded = 4;
- if (ScopeEnabled)
- DecodeRequest(fd, buf, n);
- FinishStuff (fd, buf, n);
- return(n);
+ enterprocedure("FinishRequest");
+ CS[fd].ByteProcessing = StartRequest;
+ CS[fd].NumberofBytesNeeded = 4;
+ if (ScopeEnabled)
+ DecodeRequest(fd, buf, n);
+ FinishStuff(fd, buf, n);
+ return (n);
}
/* ************************************************************ */
@@ -594,80 +537,70 @@ FinishRequest (
/* ************************************************************ */
void
-StartServerConnection (
- FD fd)
+StartServerConnection(FD fd)
{
- enterprocedure("StartServerConnection");
- /* when a new connection is started, we have no saved bytes */
- CS[fd].SavedBytes = NULL;
- CS[fd].SizeofSavedBytes = 0;
- CS[fd].NumberofSavedBytes = 0;
- CS[fd].NumberofBytesProcessed = 0;
+ enterprocedure("StartServerConnection");
+
+ /* when a new connection is started, we have no saved bytes */
+ CS[fd].SavedBytes = NULL;
+ CS[fd].SizeofSavedBytes = 0;
+ CS[fd].NumberofSavedBytes = 0;
+ CS[fd].NumberofBytesProcessed = 0;
- /* when a new connection is started, we have no reply Queue */
- FlushReplyQ(fd);
+ /* when a new connection is started, we have no reply Queue */
+ FlushReplyQ(fd);
- /* we need 8 bytes to start a SetUp reply */
- CS[fd].ByteProcessing = StartSetUpReply;
- CS[fd].NumberofBytesNeeded = 8;
+ /* we need 8 bytes to start a SetUp reply */
+ CS[fd].ByteProcessing = StartSetUpReply;
+ CS[fd].NumberofBytesNeeded = 8;
}
void
-StopServerConnection (
- FD fd)
+StopServerConnection(FD fd)
{
- enterprocedure("StopServerConnection");
- /* when a new connection is stopped, discard the old buffer */
+ enterprocedure("StopServerConnection");
- if (CS[fd].SizeofSavedBytes > 0)
- free(CS[fd].SavedBytes);
+ /* when a new connection is stopped, discard the old buffer */
+ if (CS[fd].SizeofSavedBytes > 0)
+ free(CS[fd].SavedBytes);
}
long
-StartSetUpReply (
- FD fd,
- const unsigned char *buf,
- long n)
+StartSetUpReply(FD fd, const unsigned char *buf, long n)
{
- unsigned short replylength;
+ unsigned short replylength;
- enterprocedure("StartSetUpReply");
- replylength = IShort(&buf[6]);
- CS[fd].ByteProcessing = FinishSetUpReply;
- CS[fd].NumberofBytesNeeded = n + 4 * replylength;
- debug(8,(stderr, "need %ld bytes to finish startup reply\n",
- CS[fd].NumberofBytesNeeded - n));
- return(0);
+ enterprocedure("StartSetUpReply");
+ replylength = IShort(&buf[6]);
+ CS[fd].ByteProcessing = FinishSetUpReply;
+ CS[fd].NumberofBytesNeeded = n + 4 * replylength;
+ debug(8, (stderr, "need %ld bytes to finish startup reply\n",
+ CS[fd].NumberofBytesNeeded - n));
+ return (0);
}
static long
-FinishSetUpReply (
- FD fd,
- const unsigned char *buf,
- long n)
+FinishSetUpReply(FD fd, const unsigned char *buf, long n)
{
- enterprocedure("FinishSetUpReply");
- if( Raw || (Verbose > 3) )
- DumpItem("Server Connect", fd, buf, n) ;
- if (ScopeEnabled)
- PrintSetUpReply(buf);
- CS[fd].ByteProcessing = ServerPacket;
- CS[fd].NumberofBytesNeeded = 32;
- return(n);
+ enterprocedure("FinishSetUpReply");
+ if (Raw || (Verbose > 3))
+ DumpItem("Server Connect", fd, buf, n);
+ if (ScopeEnabled)
+ PrintSetUpReply(buf);
+ CS[fd].ByteProcessing = ServerPacket;
+ CS[fd].NumberofBytesNeeded = 32;
+ return (n);
}
/* ************************************************************ */
static long
-ErrorPacket (
- FD fd,
- const unsigned char *buf,
- long n)
+ErrorPacket(FD fd, const unsigned char *buf, long n)
{
- CS[fd].ByteProcessing = ServerPacket;
- CS[fd].NumberofBytesNeeded = 32;
- DecodeError(fd, buf, n);
- return(n);
+ CS[fd].ByteProcessing = ServerPacket;
+ CS[fd].NumberofBytesNeeded = 32;
+ DecodeError(fd, buf, n);
+ return (n);
}
/* FinishEvent/EventPacket: since GenericEvents may be longer than 32 bytes
@@ -675,104 +608,88 @@ ErrorPacket (
data length to handle them. */
static long
-FinishEvent (
- FD fd,
- const unsigned char *buf,
- long n)
+FinishEvent(FD fd, const unsigned char *buf, long n)
{
- CS[fd].ByteProcessing = ServerPacket;
- CS[fd].NumberofBytesNeeded = 32;
- enterprocedure("FinishEvent");
- if (ScopeEnabled)
- DecodeEvent(fd, buf, n);
- return(n);
+ CS[fd].ByteProcessing = ServerPacket;
+ CS[fd].NumberofBytesNeeded = 32;
+ enterprocedure("FinishEvent");
+ if (ScopeEnabled)
+ DecodeEvent(fd, buf, n);
+ return (n);
}
static long
-EventPacket (
- FD fd,
- const unsigned char *buf,
- long n)
+EventPacket(FD fd, const unsigned char *buf, long n)
{
- short Event = IByte (&buf[0]);
- long eventlength = 0;
+ short Event = IByte(&buf[0]);
+ long eventlength = 0;
- CS[fd].ByteProcessing = FinishEvent;
- CS[fd].NumberofBytesNeeded = 32;
- if (Event == Event_Type_Generic) {
- eventlength = ILong(&buf[4]);
- CS[fd].NumberofBytesNeeded += (4 * eventlength);
- }
- debug(8,(stderr, "need %ld bytes to finish reply\n", (4 * eventlength)));
- return(0);
+ CS[fd].ByteProcessing = FinishEvent;
+ CS[fd].NumberofBytesNeeded = 32;
+ if (Event == Event_Type_Generic) {
+ eventlength = ILong(&buf[4]);
+ CS[fd].NumberofBytesNeeded += (4 * eventlength);
+ }
+ debug(8, (stderr, "need %ld bytes to finish reply\n", (4 * eventlength)));
+ return (0);
}
-
static long
-ReplyPacket (
- FD fd,
- const unsigned char *buf,
- long n)
+ReplyPacket(FD fd, const unsigned char *buf, long n)
{
- long replylength;
+ long replylength;
- replylength = ILong(&buf[4]);
+ replylength = ILong(&buf[4]);
- /*
- Replies may need more bytes, so we compute how many more
- bytes are needed and ask for them, not using any of the bytes
- we were given (return(0) to say that no bytes were used).
- If the replylength is zero (we don't need any more bytes), the
- number of bytes needed will be the same as what we have, and
- so the top-level loop will call the next routine immediately
- with the same buffer of bytes that we were given.
- */
+ /*
+ Replies may need more bytes, so we compute how many more
+ bytes are needed and ask for them, not using any of the bytes
+ we were given (return(0) to say that no bytes were used).
+ If the replylength is zero (we don't need any more bytes), the
+ number of bytes needed will be the same as what we have, and
+ so the top-level loop will call the next routine immediately
+ with the same buffer of bytes that we were given.
+ */
- CS[fd].ByteProcessing = FinishReply;
- CS[fd].NumberofBytesNeeded = n + 4 * replylength;
- debug(8,(stderr, "need %ld bytes to finish reply\n", (4 * replylength)));
- return(0);
+ CS[fd].ByteProcessing = FinishReply;
+ CS[fd].NumberofBytesNeeded = n + 4 * replylength;
+ debug(8, (stderr, "need %ld bytes to finish reply\n", (4 * replylength)));
+ return (0);
}
static long
-ServerPacket (
- FD fd,
- const unsigned char *buf,
- long n)
+ServerPacket(FD fd, const unsigned char *buf, long n)
{
- short PacketType;
- enterprocedure("ServerPacket");
+ short PacketType;
+
+ enterprocedure("ServerPacket");
- PacketType = IByte(&buf[0]);
- if (PacketType == 0)
- return(ErrorPacket(fd, buf, n));
- if (PacketType == 1)
- return(ReplyPacket(fd, buf, n));
- return(EventPacket(fd, buf, n));
+ PacketType = IByte(&buf[0]);
+ if (PacketType == 0)
+ return (ErrorPacket(fd, buf, n));
+ if (PacketType == 1)
+ return (ReplyPacket(fd, buf, n));
+ return (EventPacket(fd, buf, n));
}
long
-FinishReply (
- FD fd,
- const unsigned char *buf,
- long n)
+FinishReply(FD fd, const unsigned char *buf, long n)
{
- CS[fd].ByteProcessing = ServerPacket;
- CS[fd].NumberofBytesNeeded = 32;
- enterprocedure("FinishReply");
- if (ScopeEnabled)
- DecodeReply(fd, buf, n);
- return(n);
+ CS[fd].ByteProcessing = ServerPacket;
+ CS[fd].NumberofBytesNeeded = 32;
+ enterprocedure("FinishReply");
+ if (ScopeEnabled)
+ DecodeReply(fd, buf, n);
+ return (n);
}
long
-GetXRequestFromName (
- const char *name)
+GetXRequestFromName(const char *name)
{
- long req = GetEValue (REQUEST, name);
+ long req = GetEValue(REQUEST, name);
if (req < 0)
- req = GetEValue (EXTENSION, name);
+ req = GetEValue(EXTENSION, name);
return req;
}
diff --git a/shmscope.h b/shmscope.h
index dc4a40d..c045d81 100644
--- a/shmscope.h
+++ b/shmscope.h
@@ -12,15 +12,14 @@
#define printfield(a,b,c,d,e) if (Verbose > 1) PrintField(a,b,c,d,e)
-extern void MitshmQueryVersion (FD fd, const unsigned char *buf);
-extern void MitshmQueryVersionReply (FD fd, const unsigned char *buf);
-extern void MitshmAttach (FD fd, const unsigned char *buf);
-extern void MitshmDetach (FD fd, const unsigned char *buf);
-extern void MitshmPutImage (FD fd, const unsigned char *buf);
-extern void MitshmGetImage (FD fd, const unsigned char *buf);
-extern void MitshmGetImageReply (FD fd, const unsigned char *buf);
-extern void MitshmCreatePixmap (FD fd, const unsigned char *buf);
-extern void MitshmShmSegError (FD fd, const unsigned char *buf);
+extern void MitshmQueryVersion(FD fd, const unsigned char *buf);
+extern void MitshmQueryVersionReply(FD fd, const unsigned char *buf);
+extern void MitshmAttach(FD fd, const unsigned char *buf);
+extern void MitshmDetach(FD fd, const unsigned char *buf);
+extern void MitshmPutImage(FD fd, const unsigned char *buf);
+extern void MitshmGetImage(FD fd, const unsigned char *buf);
+extern void MitshmGetImageReply(FD fd, const unsigned char *buf);
+extern void MitshmCreatePixmap(FD fd, const unsigned char *buf);
+extern void MitshmShmSegError(FD fd, const unsigned char *buf);
#endif
-
diff --git a/table11.c b/table11.c
index a3c4735..3d9d99c 100644
--- a/table11.c
+++ b/table11.c
@@ -1,8 +1,8 @@
-/* ************************************************** *
- * *
- * Table initialization for X11 protocol *
- * *
- * James Peterson, 1988 *
+/*
+ * Table initialization for X11 protocol
+ *
+ * James Peterson, 1988
+ *
* Copyright (C) 1988 MCC
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -22,7 +22,9 @@
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
- * *
+ *
+ */
+/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -44,7 +46,7 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
- * ************************************************** */
+ */
#include "scope.h"
#include "x11.h"
@@ -105,57 +107,52 @@ static int PrintVISUALTYPE(const unsigned char *buf);
*/
void
-InitializeX11 (void)
+InitializeX11(void)
{
- CS = calloc(MaxFD, sizeof(struct ConnState));
- if (CS == NULL)
- panic("unable to allocate ConnState table");
- InitReplyQ();
-
- InitBuiltInTypes();
- InitEnumeratedTypes();
- InitSetTypes();
- InitValuesTypes();
- InitRecordTypes();
+ CS = calloc(MaxFD, sizeof(struct ConnState));
+ if (CS == NULL)
+ panic("unable to allocate ConnState table");
+ InitReplyQ();
+
+ InitBuiltInTypes();
+ InitEnumeratedTypes();
+ InitSetTypes();
+ InitValuesTypes();
+ InitRecordTypes();
}
#define HASH_SIZE 997
-ValuePtr buckets[HASH_SIZE];
+ValuePtr buckets[HASH_SIZE];
#define HASH(key) ((key) % HASH_SIZE)
ValuePtr
-GetValueRec (
- unsigned long key)
+GetValueRec(unsigned long key)
{
- ValuePtr *bucket, value;
+ ValuePtr *bucket, value;
bucket = &buckets[HASH(key)];
- for (value = *bucket; value; value = value->next)
- {
- if (value->key == key)
- return value;
+ for (value = *bucket; value; value = value->next) {
+ if (value->key == key)
+ return value;
}
return NULL;
}
void
-CreateValueRec (
- unsigned long key,
- int size,
- const unsigned long *def)
+CreateValueRec(unsigned long key, int size, const unsigned long *def)
{
- ValuePtr *bucket, value;
- int i;
-
+ ValuePtr *bucket, value;
+ int i;
+
bucket = &buckets[HASH(key)];
- value = malloc (sizeof (ValueRec) + (size * sizeof (unsigned long)));
+ value = malloc(sizeof(ValueRec) + (size * sizeof(unsigned long)));
if (!value)
- return;
+ return;
value->values = (unsigned long *) (value + 1);
for (i = 0; i < size; i++)
- value->values[i] = ILong((const unsigned char *) (def + i));
+ value->values[i] = ILong((const unsigned char *) (def + i));
value->size = size;
value->key = key;
value->next = *bucket;
@@ -163,58 +160,51 @@ CreateValueRec (
}
void
-DeleteValueRec (
- unsigned long key)
+DeleteValueRec(unsigned long key)
{
- ValuePtr *bucket, value;
-
- for (bucket = &buckets[HASH(key)]; (value = *bucket) != NULL; bucket = &value->next)
- {
- if (value->key == key)
- {
- *bucket = value->next;
- free (value);
- return;
- }
+ ValuePtr *bucket, value;
+
+ for (bucket = &buckets[HASH(key)]; (value = *bucket) != NULL;
+ bucket = &value->next) {
+ if (value->key == key) {
+ *bucket = value->next;
+ free(value);
+ return;
+ }
}
}
void
-SetValueRec (
- unsigned long key,
- const unsigned char *control,
- short clength,
- short ctype,
- const unsigned char *values)
+SetValueRec(unsigned long key,
+ const unsigned char *control,
+ short clength, short ctype, const unsigned char *values)
{
- long cmask;
- struct ValueListEntry *p;
- ValuePtr value;
- int i;
+ long cmask;
+ struct ValueListEntry *p;
+ ValuePtr value;
+ int i;
- value = GetValueRec (key);
+ value = GetValueRec(key);
if (!value)
- return;
+ return;
/* first get the control mask */
if (clength == 1)
- cmask = IByte(control);
+ cmask = IByte(control);
else if (clength == 2)
- cmask = IShort(control);
+ cmask = IShort(control);
else
- cmask = ILong(control);
+ cmask = ILong(control);
/* now if it is zero, ignore and return */
if (cmask == 0)
- return;
+ return;
/* there are bits in the controlling bitmask, figure out which */
/* the ctype is a set type, so this code is similar to PrintSET */
- for (p = TD[ctype].ValueList, i = 0; p != NULL; p = p->Next, i++)
- {
- if ((p->Value & cmask) != 0)
- {
- memcpy (&value->values[i], values, sizeof (unsigned long));
- values += 4;
- }
+ for (p = TD[ctype].ValueList, i = 0; p != NULL; p = p->Next, i++) {
+ if ((p->Value & cmask) != 0) {
+ memcpy(&value->values[i], values, sizeof(unsigned long));
+ values += 4;
+ }
}
}
@@ -226,70 +216,62 @@ SetValueRec (
/* define the various types */
TYPE
-DefineType (
- short typeid,
- short class,
- const char *name,
- int (*printproc)(const unsigned char *))
+DefineType(short typeid,
+ short class,
+ const char *name, int (*printproc) (const unsigned char *))
{
- TD[typeid].Name = name;
- TD[typeid].Type = class;
- TD[typeid].ValueList = NULL;
- TD[typeid].PrintProc = printproc;
- return(&TD[typeid]);
+ TD[typeid].Name = name;
+ TD[typeid].Type = class;
+ TD[typeid].ValueList = NULL;
+ TD[typeid].PrintProc = printproc;
+ return (&TD[typeid]);
}
/* ************************************************************ */
/* define an Enumerated Value (or a Set Value) */
void
-DefineEValue(
- TYPE type,
- long value,
- const char *name)
+DefineEValue(TYPE type, long value, const char *name)
{
- struct ValueListEntry *p;
-
- /* define the new value */
- p = malloc (sizeof (struct ValueListEntry));
- if (p == NULL)
- panic("Can't allocate memory for Enum ValueListEntry");
- p->Name = name;
- p->Value = value;
-
- /* add an new value to the list. */
- if (type->ValueList == NULL || type->ValueList->Value > p->Value)
- {
- p->Next = type->ValueList;
- type->ValueList = p;
+ struct ValueListEntry *p;
+
+ /* define the new value */
+ p = malloc(sizeof(struct ValueListEntry));
+ if (p == NULL)
+ panic("Can't allocate memory for Enum ValueListEntry");
+ p->Name = name;
+ p->Value = value;
+
+ /* add an new value to the list. */
+ if (type->ValueList == NULL || type->ValueList->Value > p->Value) {
+ p->Next = type->ValueList;
+ type->ValueList = p;
}
- else
- {
- /* keep the list sorted, smallest to largest */
- struct ValueListEntry *q = type->ValueList;
- while (q->Next != NULL && q->Next->Value < p->Value)
- q = q->Next;
- p->Next = q->Next;
- q->Next = p;
+ else {
+ /* keep the list sorted, smallest to largest */
+ struct ValueListEntry *q = type->ValueList;
+
+ while (q->Next != NULL && q->Next->Value < p->Value)
+ q = q->Next;
+ p->Next = q->Next;
+ q->Next = p;
}
}
long
-GetEValue (
- short typeid,
- const char *name)
+GetEValue(short typeid, const char *name)
{
- TYPE p;
- struct ValueListEntry *v;
+ TYPE p;
+ struct ValueListEntry *v;
if (typeid < 0 || MaxTypes <= typeid)
- return -1;
+ return -1;
p = &TD[typeid];
if (!p)
- return -2;
+ return -2;
for (v = p->ValueList; v; v = v->Next)
- if (!strcmp (name, v->Name))
- return v->Value;
+ if (!strcmp(name, v->Name))
+ return v->Value;
return -3;
}
@@ -302,33 +284,31 @@ GetEValue (
associated value for each bit */
void
-DefineValues(TYPE type, long value, short length, short ctype,
- const char *name)
+DefineValues(TYPE type, long value, short length, short ctype, const char *name)
{
- struct ValueListEntry *p;
-
- p = malloc (sizeof (struct ValueListEntry));
- if (p == NULL)
- panic("Can't allocate memory for ValueListEntry");
- p->Name = name;
- p->Type = ctype;
- p->Length = length;
- p->Value = value;
-
- /* add an new value to the list. */
- if (type->ValueList == NULL || type->ValueList->Value > p->Value)
- {
- p->Next = type->ValueList;
- type->ValueList = p;
+ struct ValueListEntry *p;
+
+ p = malloc(sizeof(struct ValueListEntry));
+ if (p == NULL)
+ panic("Can't allocate memory for ValueListEntry");
+ p->Name = name;
+ p->Type = ctype;
+ p->Length = length;
+ p->Value = value;
+
+ /* add an new value to the list. */
+ if (type->ValueList == NULL || type->ValueList->Value > p->Value) {
+ p->Next = type->ValueList;
+ type->ValueList = p;
}
- else
- {
- /* keep the list sorted, smallest to largest */
- struct ValueListEntry *q = type->ValueList;
- while (q->Next != NULL && q->Next->Value < p->Value)
- q = q->Next;
- p->Next = q->Next;
- q->Next = p;
+ else {
+ /* keep the list sorted, smallest to largest */
+ struct ValueListEntry *q = type->ValueList;
+
+ while (q->Next != NULL && q->Next->Value < p->Value)
+ q = q->Next;
+ p->Next = q->Next;
+ q->Next = p;
}
}
@@ -337,43 +317,43 @@ DefineValues(TYPE type, long value, short length, short ctype,
/* ************************************************************ */
static void
-InitBuiltInTypes (void)
+InitBuiltInTypes(void)
{
- (void) DefineType(INT8, BUILTIN, "INT8", PrintINT8);
- (void) DefineType(INT16, BUILTIN, "INT16", PrintINT16);
- (void) DefineType(INT32, BUILTIN, "INT32", PrintINT32);
- (void) DefineType(CARD8, BUILTIN, "CARD8", PrintCARD8);
- (void) DefineType(CARD16, BUILTIN, "CARD16", PrintCARD16);
- (void) DefineType(CARD32, BUILTIN, "CARD32", PrintCARD32);
- (void) DefineType(BYTE, BUILTIN, "BYTE", PrintBYTE);
- (void) DefineType(CHAR8, BUILTIN, "CHAR8", PrintCHAR8);
- (void) DefineType(STRING16, BUILTIN, "STRING16", PrintSTRING16);
- (void) DefineType(STR, BUILTIN, "STR", PrintSTR);
- (void) DefineType(WINDOW, BUILTIN, "WINDOW", PrintWINDOW);
- (void) DefineType(WINDOWD, BUILTIN, "WINDOWD", PrintWINDOWD);
- (void) DefineType(WINDOWNR, BUILTIN, "WINDOWNR", PrintWINDOWNR);
- (void) DefineType(PIXMAP, BUILTIN, "PIXMAP", PrintPIXMAP);
- (void) DefineType(PIXMAPNPR, BUILTIN, "PIXMAPNPR", PrintPIXMAPNPR);
- (void) DefineType(PIXMAPC, BUILTIN, "PIXMAPC", PrintPIXMAPC);
- (void) DefineType(CURSOR, BUILTIN, "CURSOR", PrintCURSOR);
- (void) DefineType(FONT, BUILTIN, "FONT", PrintFONT);
- (void) DefineType(GCONTEXT, BUILTIN, "GCONTEXT", PrintGCONTEXT);
- (void) DefineType(COLORMAP, BUILTIN, "COLORMAP", PrintCOLORMAP);
- (void) DefineType(COLORMAPC, BUILTIN, "COLORMAPC", PrintCOLORMAPC);
- (void) DefineType(DRAWABLE, BUILTIN, "DRAWABLE", PrintDRAWABLE);
- (void) DefineType(FONTABLE, BUILTIN, "FONTABLE", PrintFONTABLE);
- (void) DefineType(ATOM, BUILTIN, "ATOM", PrintATOM);
- (void) DefineType(ATOMT, BUILTIN, "ATOMT", PrintATOMT);
- (void) DefineType(VISUALID, BUILTIN, "VISUALID", PrintVISUALID);
- (void) DefineType(VISUALIDC, BUILTIN, "VISUALIDC", PrintVISUALIDC);
- (void) DefineType(TIMESTAMP, BUILTIN, "TIMESTAMP", PrintTIMESTAMP);
- (void) DefineType(RESOURCEID, BUILTIN, "RESOURCEID", PrintRESOURCEID);
- (void) DefineType(KEYSYM, BUILTIN, "KEYSYM", PrintKEYSYM);
- (void) DefineType(KEYCODE, BUILTIN, "KEYCODE", PrintKEYCODE);
- (void) DefineType(KEYCODEA, BUILTIN, "KEYCODEA", PrintKEYCODEA);
- (void) DefineType(BUTTON, BUILTIN, "BUTTON", PrintBUTTON);
- (void) DefineType(BUTTONA, BUILTIN, "BUTTONA", PrintBUTTONA);
- (void) DefineType(EVENTFORM, BUILTIN, "EVENTFORM", PrintEVENTFORM);
+ (void) DefineType(INT8, BUILTIN, "INT8", PrintINT8);
+ (void) DefineType(INT16, BUILTIN, "INT16", PrintINT16);
+ (void) DefineType(INT32, BUILTIN, "INT32", PrintINT32);
+ (void) DefineType(CARD8, BUILTIN, "CARD8", PrintCARD8);
+ (void) DefineType(CARD16, BUILTIN, "CARD16", PrintCARD16);
+ (void) DefineType(CARD32, BUILTIN, "CARD32", PrintCARD32);
+ (void) DefineType(BYTE, BUILTIN, "BYTE", PrintBYTE);
+ (void) DefineType(CHAR8, BUILTIN, "CHAR8", PrintCHAR8);
+ (void) DefineType(STRING16, BUILTIN, "STRING16", PrintSTRING16);
+ (void) DefineType(STR, BUILTIN, "STR", PrintSTR);
+ (void) DefineType(WINDOW, BUILTIN, "WINDOW", PrintWINDOW);
+ (void) DefineType(WINDOWD, BUILTIN, "WINDOWD", PrintWINDOWD);
+ (void) DefineType(WINDOWNR, BUILTIN, "WINDOWNR", PrintWINDOWNR);
+ (void) DefineType(PIXMAP, BUILTIN, "PIXMAP", PrintPIXMAP);
+ (void) DefineType(PIXMAPNPR, BUILTIN, "PIXMAPNPR", PrintPIXMAPNPR);
+ (void) DefineType(PIXMAPC, BUILTIN, "PIXMAPC", PrintPIXMAPC);
+ (void) DefineType(CURSOR, BUILTIN, "CURSOR", PrintCURSOR);
+ (void) DefineType(FONT, BUILTIN, "FONT", PrintFONT);
+ (void) DefineType(GCONTEXT, BUILTIN, "GCONTEXT", PrintGCONTEXT);
+ (void) DefineType(COLORMAP, BUILTIN, "COLORMAP", PrintCOLORMAP);
+ (void) DefineType(COLORMAPC, BUILTIN, "COLORMAPC", PrintCOLORMAPC);
+ (void) DefineType(DRAWABLE, BUILTIN, "DRAWABLE", PrintDRAWABLE);
+ (void) DefineType(FONTABLE, BUILTIN, "FONTABLE", PrintFONTABLE);
+ (void) DefineType(ATOM, BUILTIN, "ATOM", PrintATOM);
+ (void) DefineType(ATOMT, BUILTIN, "ATOMT", PrintATOMT);
+ (void) DefineType(VISUALID, BUILTIN, "VISUALID", PrintVISUALID);
+ (void) DefineType(VISUALIDC, BUILTIN, "VISUALIDC", PrintVISUALIDC);
+ (void) DefineType(TIMESTAMP, BUILTIN, "TIMESTAMP", PrintTIMESTAMP);
+ (void) DefineType(RESOURCEID, BUILTIN, "RESOURCEID", PrintRESOURCEID);
+ (void) DefineType(KEYSYM, BUILTIN, "KEYSYM", PrintKEYSYM);
+ (void) DefineType(KEYCODE, BUILTIN, "KEYCODE", PrintKEYCODE);
+ (void) DefineType(KEYCODEA, BUILTIN, "KEYCODEA", PrintKEYCODEA);
+ (void) DefineType(BUTTON, BUILTIN, "BUTTON", PrintBUTTON);
+ (void) DefineType(BUTTONA, BUILTIN, "BUTTONA", PrintBUTTONA);
+ (void) DefineType(EVENTFORM, BUILTIN, "EVENTFORM", PrintEVENTFORM);
}
/* ************************************************************ */
@@ -382,503 +362,550 @@ InitBuiltInTypes (void)
/* ************************************************************ */
static void
-InitEnumeratedTypes (void)
+InitEnumeratedTypes(void)
{
- TYPE p;
-
- p = DefineType(REQUEST, ENUMERATED, "REQUEST", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 1L, "CreateWindow");
- DefineEValue(p, 2L, "ChangeWindowAttributes");
- DefineEValue(p, 3L, "GetWindowAttributes");
- DefineEValue(p, 4L, "DestroyWindow");
- DefineEValue(p, 5L, "DestroySubwindows");
- DefineEValue(p, 6L, "ChangeSaveSet");
- DefineEValue(p, 7L, "ReparentWindow");
- DefineEValue(p, 8L, "MapWindow");
- DefineEValue(p, 9L, "MapSubwindows");
- DefineEValue(p, 10L, "UnmapWindow");
- DefineEValue(p, 11L, "UnmapSubwindows");
- DefineEValue(p, 12L, "ConfigureWindow");
- DefineEValue(p, 13L, "CirculateWindow");
- DefineEValue(p, 14L, "GetGeometry");
- DefineEValue(p, 15L, "QueryTree");
- DefineEValue(p, 16L, "InternAtom");
- DefineEValue(p, 17L, "GetAtomName");
- DefineEValue(p, 18L, "ChangeProperty");
- DefineEValue(p, 19L, "DeleteProperty");
- DefineEValue(p, 20L, "GetProperty");
- DefineEValue(p, 21L, "ListProperties");
- DefineEValue(p, 22L, "SetSelectionOwner");
- DefineEValue(p, 23L, "GetSelectionOwner");
- DefineEValue(p, 24L, "ConvertSelection");
- DefineEValue(p, 25L, "SendEvent");
- DefineEValue(p, 26L, "GrabPointer");
- DefineEValue(p, 27L, "UngrabPointer");
- DefineEValue(p, 28L, "GrabButton");
- DefineEValue(p, 29L, "UngrabButton");
- DefineEValue(p, 30L, "ChangeActivePointerGrab");
- DefineEValue(p, 31L, "GrabKeyboard");
- DefineEValue(p, 32L, "UngrabKeyboard");
- DefineEValue(p, 33L, "GrabKey");
- DefineEValue(p, 34L, "UngrabKey");
- DefineEValue(p, 35L, "AllowEvents");
- DefineEValue(p, 36L, "GrabServer");
- DefineEValue(p, 37L, "UngrabServer");
- DefineEValue(p, 38L, "QueryPointer");
- DefineEValue(p, 39L, "GetMotionEvents");
- DefineEValue(p, 40L, "TranslateCoordinates");
- DefineEValue(p, 41L, "WarpPointer");
- DefineEValue(p, 42L, "SetInputFocus");
- DefineEValue(p, 43L, "GetInputFocus");
- DefineEValue(p, 44L, "QueryKeymap");
- DefineEValue(p, 45L, "OpenFont");
- DefineEValue(p, 46L, "CloseFont");
- DefineEValue(p, 47L, "QueryFont");
- DefineEValue(p, 48L, "QueryTextExtents");
- DefineEValue(p, 49L, "ListFonts");
- DefineEValue(p, 50L, "ListFontsWithInfo");
- DefineEValue(p, 51L, "SetFontPath");
- DefineEValue(p, 52L, "GetFontPath");
- DefineEValue(p, 53L, "CreatePixmap");
- DefineEValue(p, 54L, "FreePixmap");
- DefineEValue(p, 55L, "CreateGC");
- DefineEValue(p, 56L, "ChangeGC");
- DefineEValue(p, 57L, "CopyGC");
- DefineEValue(p, 58L, "SetDashes");
- DefineEValue(p, 59L, "SetClipRectangles");
- DefineEValue(p, 60L, "FreeGC");
- DefineEValue(p, 61L, "ClearArea");
- DefineEValue(p, 62L, "CopyArea");
- DefineEValue(p, 63L, "CopyPlane");
- DefineEValue(p, 64L, "PolyPoint");
- DefineEValue(p, 65L, "PolyLine");
- DefineEValue(p, 66L, "PolySegment");
- DefineEValue(p, 67L, "PolyRectangle");
- DefineEValue(p, 68L, "PolyArc");
- DefineEValue(p, 69L, "FillPoly");
- DefineEValue(p, 70L, "PolyFillRectangle");
- DefineEValue(p, 71L, "PolyFillArc");
- DefineEValue(p, 72L, "PutImage");
- DefineEValue(p, 73L, "GetImage");
- DefineEValue(p, 74L, "PolyText8");
- DefineEValue(p, 75L, "PolyText16");
- DefineEValue(p, 76L, "ImageText8");
- DefineEValue(p, 77L, "ImageText16");
- DefineEValue(p, 78L, "CreateColormap");
- DefineEValue(p, 79L, "FreeColormap");
- DefineEValue(p, 80L, "CopyColormapAndFree");
- DefineEValue(p, 81L, "InstallColormap");
- DefineEValue(p, 82L, "UninstallColormap");
- DefineEValue(p, 83L, "ListInstalledColormaps");
- DefineEValue(p, 84L, "AllocColor");
- DefineEValue(p, 85L, "AllocNamedColor");
- DefineEValue(p, 86L, "AllocColorCells");
- DefineEValue(p, 87L, "AllocColorPlanes");
- DefineEValue(p, 88L, "FreeColors");
- DefineEValue(p, 89L, "StoreColors");
- DefineEValue(p, 90L, "StoreNamedColor");
- DefineEValue(p, 91L, "QueryColors");
- DefineEValue(p, 92L, "LookupColor");
- DefineEValue(p, 93L, "CreateCursor");
- DefineEValue(p, 94L, "CreateGlyphCursor");
- DefineEValue(p, 95L, "FreeCursor");
- DefineEValue(p, 96L, "RecolorCursor");
- DefineEValue(p, 97L, "QueryBestSize");
- DefineEValue(p, 98L, "QueryExtension");
- DefineEValue(p, 99L, "ListExtensions");
- DefineEValue(p, 100L, "ChangeKeyboardMapping");
- DefineEValue(p, 101L, "GetKeyboardMapping");
- DefineEValue(p, 102L, "ChangeKeyboardControl");
- DefineEValue(p, 103L, "GetKeyboardControl");
- DefineEValue(p, 104L, "Bell");
- DefineEValue(p, 105L, "ChangePointerControl");
- DefineEValue(p, 106L, "GetPointerControl");
- DefineEValue(p, 107L, "SetScreenSaver");
- DefineEValue(p, 108L, "GetScreenSaver");
- DefineEValue(p, 109L, "ChangeHosts");
- DefineEValue(p, 110L, "ListHosts");
- DefineEValue(p, 111L, "SetAccessControl");
- DefineEValue(p, 112L, "SetCloseDownMode");
- DefineEValue(p, 113L, "KillClient");
- DefineEValue(p, 114L, "RotateProperties");
- DefineEValue(p, 115L, "ForceScreenSaver");
- DefineEValue(p, 116L, "SetPointerMapping");
- DefineEValue(p, 117L, "GetPointerMapping");
- DefineEValue(p, 118L, "SetModifierMapping");
- DefineEValue(p, 119L, "GetModifierMapping");
- DefineEValue(p, 127L, "NoOperation");
-
- p = DefineType(REPLY, ENUMERATED, "REPLY", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 3L, "GetWindowAttributes");
- DefineEValue(p, 14L, "GetGeometry");
- DefineEValue(p, 15L, "QueryTree");
- DefineEValue(p, 16L, "InternAtom");
- DefineEValue(p, 17L, "GetAtomName");
- DefineEValue(p, 20L, "GetProperty");
- DefineEValue(p, 21L, "ListProperties");
- DefineEValue(p, 23L, "GetSelectionOwner");
- DefineEValue(p, 26L, "GrabPointer");
- DefineEValue(p, 31L, "GrabKeyboard");
- DefineEValue(p, 38L, "QueryPointer");
- DefineEValue(p, 39L, "GetMotionEvents");
- DefineEValue(p, 40L, "TranslateCoordinates");
- DefineEValue(p, 43L, "GetInputFocus");
- DefineEValue(p, 44L, "QueryKeymap");
- DefineEValue(p, 47L, "QueryFont");
- DefineEValue(p, 48L, "QueryTextExtents");
- DefineEValue(p, 49L, "ListFonts");
- DefineEValue(p, 50L, "ListFontsWithInfo");
- DefineEValue(p, 52L, "GetFontPath");
- DefineEValue(p, 73L, "GetImage");
- DefineEValue(p, 83L, "ListInstalledColormaps");
- DefineEValue(p, 84L, "AllocColor");
- DefineEValue(p, 85L, "AllocNamedColor");
- DefineEValue(p, 86L, "AllocColorCells");
- DefineEValue(p, 87L, "AllocColorPlanes");
- DefineEValue(p, 91L, "QueryColors");
- DefineEValue(p, 92L, "LookupColor");
- DefineEValue(p, 97L, "QueryBestSize");
- DefineEValue(p, 98L, "QueryExtension");
- DefineEValue(p, 99L, "ListExtensions");
- DefineEValue(p, 101L, "GetKeyboardMapping");
- DefineEValue(p, 103L, "GetKeyboardControl");
- DefineEValue(p, 106L, "GetPointerControl");
- DefineEValue(p, 108L, "GetScreenSaver");
- DefineEValue(p, 110L, "ListHosts");
- DefineEValue(p, 116L, "SetPointerMapping");
- DefineEValue(p, 117L, "GetPointerMapping");
- DefineEValue(p, 118L, "SetModifierMapping");
- DefineEValue(p, 119L, "GetModifierMapping");
-
- p = DefineType(ERROR, ENUMERATED, "ERROR", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 1L, "Request");
- DefineEValue(p, 2L, "Value");
- DefineEValue(p, 3L, "Window");
- DefineEValue(p, 4L, "Pixmap");
- DefineEValue(p, 5L, "Atom");
- DefineEValue(p, 6L, "Cursor");
- DefineEValue(p, 7L, "Font");
- DefineEValue(p, 8L, "Match");
- DefineEValue(p, 9L, "Drawable");
- DefineEValue(p, 10L, "Access");
- DefineEValue(p, 11L, "Alloc");
- DefineEValue(p, 12L, "Colormap");
- DefineEValue(p, 13L, "GContext");
- DefineEValue(p, 14L, "IDChoice");
- DefineEValue(p, 15L, "Name");
- DefineEValue(p, 16L, "Length");
- DefineEValue(p, 17L, "Implementation");
-
- p = DefineType(EVENT, ENUMERATED, "EVENT", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 2L, "KeyPress");
- DefineEValue(p, 3L, "KeyRelease");
- DefineEValue(p, 4L, "ButtonPress");
- DefineEValue(p, 5L, "ButtonRelease");
- DefineEValue(p, 6L, "MotionNotify");
- DefineEValue(p, 7L, "EnterNotify");
- DefineEValue(p, 8L, "LeaveNotify");
- DefineEValue(p, 9L, "FocusIn");
- DefineEValue(p, 10L, "FocusOut");
- DefineEValue(p, 11L, "KeymapNotify");
- DefineEValue(p, 12L, "Expose");
- DefineEValue(p, 13L, "GraphicsExposure");
- DefineEValue(p, 14L, "NoExposure");
- DefineEValue(p, 15L, "VisibilityNotify");
- DefineEValue(p, 16L, "CreateNotify");
- DefineEValue(p, 17L, "DestroyNotify");
- DefineEValue(p, 18L, "UnmapNotify");
- DefineEValue(p, 19L, "MapNotify");
- DefineEValue(p, 20L, "MapRequest");
- DefineEValue(p, 21L, "ReparentNotify");
- DefineEValue(p, 22L, "ConfigureNotify");
- DefineEValue(p, 23L, "ConfigureRequest");
- DefineEValue(p, 24L, "GravityNotify");
- DefineEValue(p, 25L, "ResizeRequest");
- DefineEValue(p, 26L, "CirculateNotify");
- DefineEValue(p, 27L, "CirculateRequest");
- DefineEValue(p, 28L, "PropertyNotify");
- DefineEValue(p, 29L, "SelectionClear");
- DefineEValue(p, 30L, "SelectionRequest");
- DefineEValue(p, 31L, "SelectionNotify");
- DefineEValue(p, 32L, "ColormapNotify");
- DefineEValue(p, 33L, "ClientMessage");
- DefineEValue(p, 34L, "MappingNotify");
- DefineEValue(p, 35L, "GenericEvent");
-
-
- p = DefineType(BITGRAVITY, ENUMERATED, "BITGRAVITY", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "Forget");
- DefineEValue(p, 1L, "NorthWest");
- DefineEValue(p, 2L, "North");
- DefineEValue(p, 3L, "NorthEast");
- DefineEValue(p, 4L, "West");
- DefineEValue(p, 5L, "Center");
- DefineEValue(p, 6L, "East");
- DefineEValue(p, 7L, "SouthWest");
- DefineEValue(p, 8L, "South");
- DefineEValue(p, 9L, "SouthEast");
- DefineEValue(p, 10L, "Static");
-
- p = DefineType(WINGRAVITY, ENUMERATED, "WINGRAVITY", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "Unmap");
- DefineEValue(p, 1L, "NorthWest");
- DefineEValue(p, 2L, "North");
- DefineEValue(p, 3L, "NorthEast");
- DefineEValue(p, 4L, "West");
- DefineEValue(p, 5L, "Center");
- DefineEValue(p, 6L, "East");
- DefineEValue(p, 7L, "SouthWest");
- DefineEValue(p, 8L, "South");
- DefineEValue(p, 9L, "SouthEast");
- DefineEValue(p, 10L, "Static");
-
- p = DefineType(BOOL, ENUMERATED, "BOOL", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "False");
- DefineEValue(p, 1L, "True");
-
- p = DefineType(HOSTFAMILY, ENUMERATED, "HOSTFAMILY", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "Internet");
- DefineEValue(p, 1L, "DECnet");
- DefineEValue(p, 2L, "Chaos");
- DefineEValue(p, 5L, "ServerInterpreted");
- DefineEValue(p, 6L, "InternetV6");
- DefineEValue(p, 252L, "LocalHost");
- DefineEValue(p, 253L, "Kerberos5");
- DefineEValue(p, 254L, "SecureRPC");
-
- p = DefineType(PK_MODE, ENUMERATED, "PK_MODE", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "Synchronous");
- DefineEValue(p, 1L, "Asynchronous");
-
- p = DefineType(NO_YES, ENUMERATED, "NO_YES", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "No");
- DefineEValue(p, 1L, "Yes");
- DefineEValue(p, 2L, "Default");
-
- p = DefineType(WINDOWCLASS, ENUMERATED, "WINDOWCLASS", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "CopyFromParent");
- DefineEValue(p, 1L, "InputOutput");
- DefineEValue(p, 2L, "InputOnly");
-
- p = DefineType(BACKSTORE, ENUMERATED, "BACKSTORE", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "NotUseful");
- DefineEValue(p, 1L, "WhenMapped");
- DefineEValue(p, 2L, "Always");
-
- p = DefineType(MAPSTATE, ENUMERATED, "MAPSTATE", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "Unmapped");
- DefineEValue(p, 1L, "Unviewable");
- DefineEValue(p, 2L, "Viewable");
-
- p = DefineType(STACKMODE, ENUMERATED, "STACKMODE", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "Above");
- DefineEValue(p, 1L, "Below");
- DefineEValue(p, 2L, "TopIf");
- DefineEValue(p, 3L, "BottomIf");
- DefineEValue(p, 4L, "Opposite");
-
- p = DefineType(CIRMODE, ENUMERATED, "CIRMODE", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "RaiseLowest");
- DefineEValue(p, 1L, "LowerHighest");
-
- p = DefineType(CHANGEMODE, ENUMERATED, "CHANGEMODE", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "Replace");
- DefineEValue(p, 1L, "Prepend");
- DefineEValue(p, 2L, "Append");
-
- p = DefineType(GRABSTAT, ENUMERATED, "GRABSTAT", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "Success");
- DefineEValue(p, 1L, "AlreadyGrabbed");
- DefineEValue(p, 2L, "InvalidTime");
- DefineEValue(p, 3L, "NotViewable");
- DefineEValue(p, 4L, "Frozen");
-
- p = DefineType(EVENTMODE, ENUMERATED, "EVENTMODE", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "AsyncPointer");
- DefineEValue(p, 1L, "SyncPointer");
- DefineEValue(p, 2L, "ReplayPointer");
- DefineEValue(p, 3L, "AsyncKeyboard");
- DefineEValue(p, 4L, "SyncKeyboard");
- DefineEValue(p, 5L, "ReplayKeyboard");
- DefineEValue(p, 6L, "AsyncBoth");
- DefineEValue(p, 7L, "SyncBoth");
-
- p = DefineType(FOCUSAGENT, ENUMERATED, "FOCUSAGENT", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "None");
- DefineEValue(p, 1L, "PointerRoot");
- DefineEValue(p, 2L, "Parent");
-
- p = DefineType(DIRECT, ENUMERATED, "DIRECT", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "LeftToRight");
- DefineEValue(p, 1L, "RightToLeft");
-
- p = DefineType(GCFUNC, ENUMERATED, "GCFUNC", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "Clear");
- DefineEValue(p, 1L, "And");
- DefineEValue(p, 2L, "AndReverse");
- DefineEValue(p, 3L, "Copy");
- DefineEValue(p, 4L, "AndInverted");
- DefineEValue(p, 5L, "Noop");
- DefineEValue(p, 6L, "Xor");
- DefineEValue(p, 7L, "Or");
- DefineEValue(p, 8L, "Nor");
- DefineEValue(p, 9L, "Equiv");
- DefineEValue(p, 10L, "Invert");
- DefineEValue(p, 11L, "OrReverse");
- DefineEValue(p, 12L, "CopyInverted");
- DefineEValue(p, 13L, "OrInverted");
- DefineEValue(p, 14L, "Nand");
- DefineEValue(p, 15L, "Set");
-
- p = DefineType(LINESTYLE, ENUMERATED, "LINESTYLE", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "Solid");
- DefineEValue(p, 1L, "OnOffDash");
- DefineEValue(p, 2L, "DoubleDash");
-
- p = DefineType(CAPSTYLE, ENUMERATED, "CAPSTYLE", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "NotLast");
- DefineEValue(p, 1L, "Butt");
- DefineEValue(p, 2L, "Round");
- DefineEValue(p, 3L, "Projecting");
-
- p = DefineType(JOINSTYLE, ENUMERATED, "JOINSTYLE", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "Miter");
- DefineEValue(p, 1L, "Round");
- DefineEValue(p, 2L, "Bevel");
-
- p = DefineType(FILLSTYLE, ENUMERATED, "FILLSTYLE", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "Solid");
- DefineEValue(p, 1L, "Tiled");
- DefineEValue(p, 2L, "Stippled");
- DefineEValue(p, 3L, "OpaqueStippled");
-
- p = DefineType(FILLRULE, ENUMERATED, "FILLRULE", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "EvenOdd");
- DefineEValue(p, 1L, "Winding");
-
- p = DefineType(SUBWINMODE, ENUMERATED, "SUBWINMODE", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "ClipByChildren");
- DefineEValue(p, 1L, "IncludeInferiors");
-
- p = DefineType(ARCMODE, ENUMERATED, "ARCMODE", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "Chord");
- DefineEValue(p, 1L, "PieSlice");
-
- p = DefineType(RECTORDER, ENUMERATED, "RECTORDER", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "UnSorted");
- DefineEValue(p, 1L, "YSorted");
- DefineEValue(p, 2L, "YXSorted");
- DefineEValue(p, 3L, "YXBanded");
-
- p = DefineType(COORMODE, ENUMERATED, "COORMODE", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "Origin");
- DefineEValue(p, 1L, "Previous");
-
- p = DefineType(POLYSHAPE, ENUMERATED, "POLYSHAPE", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "Complex");
- DefineEValue(p, 1L, "Nonconvex");
- DefineEValue(p, 2L, "Convex");
-
- p = DefineType(IMAGEMODE, ENUMERATED, "IMAGEMODE", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "Bitmap");
- DefineEValue(p, 1L, "XYPixmap");
- DefineEValue(p, 2L, "ZPixmap");
-
- p = DefineType(ALLORNONE, ENUMERATED, "ALLORNONE", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "None");
- DefineEValue(p, 1L, "All");
-
- p = DefineType(OBJECTCLASS, ENUMERATED, "OBJECTCLASS", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "Cursor");
- DefineEValue(p, 1L, "Tile");
- DefineEValue(p, 2L, "Stipple");
-
- p = DefineType(OFF_ON, ENUMERATED, "OFF_ON", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "Off");
- DefineEValue(p, 1L, "On");
- DefineEValue(p, 2L, "Default");
-
- p = DefineType(INS_DEL, ENUMERATED, "INS_DEL", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "Insert");
- DefineEValue(p, 1L, "Delete");
-
- p = DefineType(DIS_EN, ENUMERATED, "DIS_EN", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "Disabled");
- DefineEValue(p, 1L, "Enabled");
-
- p = DefineType(CLOSEMODE, ENUMERATED, "CLOSEMODE", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "Destroy");
- DefineEValue(p, 1L, "RetainPermanent");
- DefineEValue(p, 2L, "RetainTemporary");
-
- p = DefineType(SAVEMODE, ENUMERATED, "SAVEMODE", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "Reset");
- DefineEValue(p, 1L, "Activate");
-
- p = DefineType(RSTATUS, ENUMERATED, "RSTATUS", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "Success");
- DefineEValue(p, 1L, "Busy");
- DefineEValue(p, 2L, "Failed");
-
- p = DefineType(MOTIONDETAIL, ENUMERATED, "MOTIONDETAIL", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "Normal");
- DefineEValue(p, 1L, "Hint");
-
- p = DefineType(ENTERDETAIL, ENUMERATED, "ENTERDETAIL", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "Ancestor");
- DefineEValue(p, 1L, "Virtual");
- DefineEValue(p, 2L, "Inferior");
- DefineEValue(p, 3L, "Nonlinear");
- DefineEValue(p, 4L, "NonlinearVirtual");
- DefineEValue(p, 5L, "Pointer");
- DefineEValue(p, 6L, "PointerRoot");
- DefineEValue(p, 7L, "None");
-
- p = DefineType(BUTTONMODE, ENUMERATED, "BUTTONMODE", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "Normal");
- DefineEValue(p, 1L, "Grab");
- DefineEValue(p, 2L, "Ungrab");
- DefineEValue(p, 3L, "WhileGrabbed");
-
- p = DefineType(VISIBLE, ENUMERATED, "VISIBLE", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "Unobscured");
- DefineEValue(p, 1L, "PartiallyObscured");
- DefineEValue(p, 2L, "FullyObscured");
-
- p = DefineType(CIRSTAT, ENUMERATED, "CIRSTAT", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "Top");
- DefineEValue(p, 1L, "Bottom");
-
- p = DefineType(PROPCHANGE, ENUMERATED, "PROPCHANGE", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "NewValue");
- DefineEValue(p, 1L, "Deleted");
-
- p = DefineType(CMAPCHANGE, ENUMERATED, "CMAPCHANGE", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "Uninstalled");
- DefineEValue(p, 1L, "Installed");
-
- p = DefineType(MAPOBJECT, ENUMERATED, "MAPOBJECT", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "Modifier");
- DefineEValue(p, 1L, "Keyboard");
- DefineEValue(p, 2L, "Pointer");
-
- p = DefineType(BYTEMODE, ENUMERATED, "BYTEMODE", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0x42L, "MSB first");
- DefineEValue(p, 0x6CL, "LSB first");
-
- p = DefineType(BYTEORDER, ENUMERATED, "BYTEORDER", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "LSB first");
- DefineEValue(p, 1L, "MSB first");
-
- p = DefineType(COLORCLASS, ENUMERATED, "COLORCLASS", (PrintProcType) PrintENUMERATED);
- DefineEValue(p, 0L, "StaticGray");
- DefineEValue(p, 1L, "GrayScale");
- DefineEValue(p, 2L, "StaticColor");
- DefineEValue(p, 3L, "PseudoColor");
- DefineEValue(p, 4L, "TrueColor");
- DefineEValue(p, 5L, "DirectColor");
-
- p = DefineType(EXTENSION, ENUMERATED, "EXTENSION", (PrintProcType) PrintENUMERATED);
+ TYPE p;
+
+ p = DefineType(REQUEST, ENUMERATED, "REQUEST",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 1L, "CreateWindow");
+ DefineEValue(p, 2L, "ChangeWindowAttributes");
+ DefineEValue(p, 3L, "GetWindowAttributes");
+ DefineEValue(p, 4L, "DestroyWindow");
+ DefineEValue(p, 5L, "DestroySubwindows");
+ DefineEValue(p, 6L, "ChangeSaveSet");
+ DefineEValue(p, 7L, "ReparentWindow");
+ DefineEValue(p, 8L, "MapWindow");
+ DefineEValue(p, 9L, "MapSubwindows");
+ DefineEValue(p, 10L, "UnmapWindow");
+ DefineEValue(p, 11L, "UnmapSubwindows");
+ DefineEValue(p, 12L, "ConfigureWindow");
+ DefineEValue(p, 13L, "CirculateWindow");
+ DefineEValue(p, 14L, "GetGeometry");
+ DefineEValue(p, 15L, "QueryTree");
+ DefineEValue(p, 16L, "InternAtom");
+ DefineEValue(p, 17L, "GetAtomName");
+ DefineEValue(p, 18L, "ChangeProperty");
+ DefineEValue(p, 19L, "DeleteProperty");
+ DefineEValue(p, 20L, "GetProperty");
+ DefineEValue(p, 21L, "ListProperties");
+ DefineEValue(p, 22L, "SetSelectionOwner");
+ DefineEValue(p, 23L, "GetSelectionOwner");
+ DefineEValue(p, 24L, "ConvertSelection");
+ DefineEValue(p, 25L, "SendEvent");
+ DefineEValue(p, 26L, "GrabPointer");
+ DefineEValue(p, 27L, "UngrabPointer");
+ DefineEValue(p, 28L, "GrabButton");
+ DefineEValue(p, 29L, "UngrabButton");
+ DefineEValue(p, 30L, "ChangeActivePointerGrab");
+ DefineEValue(p, 31L, "GrabKeyboard");
+ DefineEValue(p, 32L, "UngrabKeyboard");
+ DefineEValue(p, 33L, "GrabKey");
+ DefineEValue(p, 34L, "UngrabKey");
+ DefineEValue(p, 35L, "AllowEvents");
+ DefineEValue(p, 36L, "GrabServer");
+ DefineEValue(p, 37L, "UngrabServer");
+ DefineEValue(p, 38L, "QueryPointer");
+ DefineEValue(p, 39L, "GetMotionEvents");
+ DefineEValue(p, 40L, "TranslateCoordinates");
+ DefineEValue(p, 41L, "WarpPointer");
+ DefineEValue(p, 42L, "SetInputFocus");
+ DefineEValue(p, 43L, "GetInputFocus");
+ DefineEValue(p, 44L, "QueryKeymap");
+ DefineEValue(p, 45L, "OpenFont");
+ DefineEValue(p, 46L, "CloseFont");
+ DefineEValue(p, 47L, "QueryFont");
+ DefineEValue(p, 48L, "QueryTextExtents");
+ DefineEValue(p, 49L, "ListFonts");
+ DefineEValue(p, 50L, "ListFontsWithInfo");
+ DefineEValue(p, 51L, "SetFontPath");
+ DefineEValue(p, 52L, "GetFontPath");
+ DefineEValue(p, 53L, "CreatePixmap");
+ DefineEValue(p, 54L, "FreePixmap");
+ DefineEValue(p, 55L, "CreateGC");
+ DefineEValue(p, 56L, "ChangeGC");
+ DefineEValue(p, 57L, "CopyGC");
+ DefineEValue(p, 58L, "SetDashes");
+ DefineEValue(p, 59L, "SetClipRectangles");
+ DefineEValue(p, 60L, "FreeGC");
+ DefineEValue(p, 61L, "ClearArea");
+ DefineEValue(p, 62L, "CopyArea");
+ DefineEValue(p, 63L, "CopyPlane");
+ DefineEValue(p, 64L, "PolyPoint");
+ DefineEValue(p, 65L, "PolyLine");
+ DefineEValue(p, 66L, "PolySegment");
+ DefineEValue(p, 67L, "PolyRectangle");
+ DefineEValue(p, 68L, "PolyArc");
+ DefineEValue(p, 69L, "FillPoly");
+ DefineEValue(p, 70L, "PolyFillRectangle");
+ DefineEValue(p, 71L, "PolyFillArc");
+ DefineEValue(p, 72L, "PutImage");
+ DefineEValue(p, 73L, "GetImage");
+ DefineEValue(p, 74L, "PolyText8");
+ DefineEValue(p, 75L, "PolyText16");
+ DefineEValue(p, 76L, "ImageText8");
+ DefineEValue(p, 77L, "ImageText16");
+ DefineEValue(p, 78L, "CreateColormap");
+ DefineEValue(p, 79L, "FreeColormap");
+ DefineEValue(p, 80L, "CopyColormapAndFree");
+ DefineEValue(p, 81L, "InstallColormap");
+ DefineEValue(p, 82L, "UninstallColormap");
+ DefineEValue(p, 83L, "ListInstalledColormaps");
+ DefineEValue(p, 84L, "AllocColor");
+ DefineEValue(p, 85L, "AllocNamedColor");
+ DefineEValue(p, 86L, "AllocColorCells");
+ DefineEValue(p, 87L, "AllocColorPlanes");
+ DefineEValue(p, 88L, "FreeColors");
+ DefineEValue(p, 89L, "StoreColors");
+ DefineEValue(p, 90L, "StoreNamedColor");
+ DefineEValue(p, 91L, "QueryColors");
+ DefineEValue(p, 92L, "LookupColor");
+ DefineEValue(p, 93L, "CreateCursor");
+ DefineEValue(p, 94L, "CreateGlyphCursor");
+ DefineEValue(p, 95L, "FreeCursor");
+ DefineEValue(p, 96L, "RecolorCursor");
+ DefineEValue(p, 97L, "QueryBestSize");
+ DefineEValue(p, 98L, "QueryExtension");
+ DefineEValue(p, 99L, "ListExtensions");
+ DefineEValue(p, 100L, "ChangeKeyboardMapping");
+ DefineEValue(p, 101L, "GetKeyboardMapping");
+ DefineEValue(p, 102L, "ChangeKeyboardControl");
+ DefineEValue(p, 103L, "GetKeyboardControl");
+ DefineEValue(p, 104L, "Bell");
+ DefineEValue(p, 105L, "ChangePointerControl");
+ DefineEValue(p, 106L, "GetPointerControl");
+ DefineEValue(p, 107L, "SetScreenSaver");
+ DefineEValue(p, 108L, "GetScreenSaver");
+ DefineEValue(p, 109L, "ChangeHosts");
+ DefineEValue(p, 110L, "ListHosts");
+ DefineEValue(p, 111L, "SetAccessControl");
+ DefineEValue(p, 112L, "SetCloseDownMode");
+ DefineEValue(p, 113L, "KillClient");
+ DefineEValue(p, 114L, "RotateProperties");
+ DefineEValue(p, 115L, "ForceScreenSaver");
+ DefineEValue(p, 116L, "SetPointerMapping");
+ DefineEValue(p, 117L, "GetPointerMapping");
+ DefineEValue(p, 118L, "SetModifierMapping");
+ DefineEValue(p, 119L, "GetModifierMapping");
+ DefineEValue(p, 127L, "NoOperation");
+
+ p = DefineType(REPLY, ENUMERATED, "REPLY", (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 3L, "GetWindowAttributes");
+ DefineEValue(p, 14L, "GetGeometry");
+ DefineEValue(p, 15L, "QueryTree");
+ DefineEValue(p, 16L, "InternAtom");
+ DefineEValue(p, 17L, "GetAtomName");
+ DefineEValue(p, 20L, "GetProperty");
+ DefineEValue(p, 21L, "ListProperties");
+ DefineEValue(p, 23L, "GetSelectionOwner");
+ DefineEValue(p, 26L, "GrabPointer");
+ DefineEValue(p, 31L, "GrabKeyboard");
+ DefineEValue(p, 38L, "QueryPointer");
+ DefineEValue(p, 39L, "GetMotionEvents");
+ DefineEValue(p, 40L, "TranslateCoordinates");
+ DefineEValue(p, 43L, "GetInputFocus");
+ DefineEValue(p, 44L, "QueryKeymap");
+ DefineEValue(p, 47L, "QueryFont");
+ DefineEValue(p, 48L, "QueryTextExtents");
+ DefineEValue(p, 49L, "ListFonts");
+ DefineEValue(p, 50L, "ListFontsWithInfo");
+ DefineEValue(p, 52L, "GetFontPath");
+ DefineEValue(p, 73L, "GetImage");
+ DefineEValue(p, 83L, "ListInstalledColormaps");
+ DefineEValue(p, 84L, "AllocColor");
+ DefineEValue(p, 85L, "AllocNamedColor");
+ DefineEValue(p, 86L, "AllocColorCells");
+ DefineEValue(p, 87L, "AllocColorPlanes");
+ DefineEValue(p, 91L, "QueryColors");
+ DefineEValue(p, 92L, "LookupColor");
+ DefineEValue(p, 97L, "QueryBestSize");
+ DefineEValue(p, 98L, "QueryExtension");
+ DefineEValue(p, 99L, "ListExtensions");
+ DefineEValue(p, 101L, "GetKeyboardMapping");
+ DefineEValue(p, 103L, "GetKeyboardControl");
+ DefineEValue(p, 106L, "GetPointerControl");
+ DefineEValue(p, 108L, "GetScreenSaver");
+ DefineEValue(p, 110L, "ListHosts");
+ DefineEValue(p, 116L, "SetPointerMapping");
+ DefineEValue(p, 117L, "GetPointerMapping");
+ DefineEValue(p, 118L, "SetModifierMapping");
+ DefineEValue(p, 119L, "GetModifierMapping");
+
+ p = DefineType(ERROR, ENUMERATED, "ERROR", (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 1L, "Request");
+ DefineEValue(p, 2L, "Value");
+ DefineEValue(p, 3L, "Window");
+ DefineEValue(p, 4L, "Pixmap");
+ DefineEValue(p, 5L, "Atom");
+ DefineEValue(p, 6L, "Cursor");
+ DefineEValue(p, 7L, "Font");
+ DefineEValue(p, 8L, "Match");
+ DefineEValue(p, 9L, "Drawable");
+ DefineEValue(p, 10L, "Access");
+ DefineEValue(p, 11L, "Alloc");
+ DefineEValue(p, 12L, "Colormap");
+ DefineEValue(p, 13L, "GContext");
+ DefineEValue(p, 14L, "IDChoice");
+ DefineEValue(p, 15L, "Name");
+ DefineEValue(p, 16L, "Length");
+ DefineEValue(p, 17L, "Implementation");
+
+ p = DefineType(EVENT, ENUMERATED, "EVENT", (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 2L, "KeyPress");
+ DefineEValue(p, 3L, "KeyRelease");
+ DefineEValue(p, 4L, "ButtonPress");
+ DefineEValue(p, 5L, "ButtonRelease");
+ DefineEValue(p, 6L, "MotionNotify");
+ DefineEValue(p, 7L, "EnterNotify");
+ DefineEValue(p, 8L, "LeaveNotify");
+ DefineEValue(p, 9L, "FocusIn");
+ DefineEValue(p, 10L, "FocusOut");
+ DefineEValue(p, 11L, "KeymapNotify");
+ DefineEValue(p, 12L, "Expose");
+ DefineEValue(p, 13L, "GraphicsExposure");
+ DefineEValue(p, 14L, "NoExposure");
+ DefineEValue(p, 15L, "VisibilityNotify");
+ DefineEValue(p, 16L, "CreateNotify");
+ DefineEValue(p, 17L, "DestroyNotify");
+ DefineEValue(p, 18L, "UnmapNotify");
+ DefineEValue(p, 19L, "MapNotify");
+ DefineEValue(p, 20L, "MapRequest");
+ DefineEValue(p, 21L, "ReparentNotify");
+ DefineEValue(p, 22L, "ConfigureNotify");
+ DefineEValue(p, 23L, "ConfigureRequest");
+ DefineEValue(p, 24L, "GravityNotify");
+ DefineEValue(p, 25L, "ResizeRequest");
+ DefineEValue(p, 26L, "CirculateNotify");
+ DefineEValue(p, 27L, "CirculateRequest");
+ DefineEValue(p, 28L, "PropertyNotify");
+ DefineEValue(p, 29L, "SelectionClear");
+ DefineEValue(p, 30L, "SelectionRequest");
+ DefineEValue(p, 31L, "SelectionNotify");
+ DefineEValue(p, 32L, "ColormapNotify");
+ DefineEValue(p, 33L, "ClientMessage");
+ DefineEValue(p, 34L, "MappingNotify");
+ DefineEValue(p, 35L, "GenericEvent");
+
+ p = DefineType(BITGRAVITY, ENUMERATED, "BITGRAVITY",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "Forget");
+ DefineEValue(p, 1L, "NorthWest");
+ DefineEValue(p, 2L, "North");
+ DefineEValue(p, 3L, "NorthEast");
+ DefineEValue(p, 4L, "West");
+ DefineEValue(p, 5L, "Center");
+ DefineEValue(p, 6L, "East");
+ DefineEValue(p, 7L, "SouthWest");
+ DefineEValue(p, 8L, "South");
+ DefineEValue(p, 9L, "SouthEast");
+ DefineEValue(p, 10L, "Static");
+
+ p = DefineType(WINGRAVITY, ENUMERATED, "WINGRAVITY",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "Unmap");
+ DefineEValue(p, 1L, "NorthWest");
+ DefineEValue(p, 2L, "North");
+ DefineEValue(p, 3L, "NorthEast");
+ DefineEValue(p, 4L, "West");
+ DefineEValue(p, 5L, "Center");
+ DefineEValue(p, 6L, "East");
+ DefineEValue(p, 7L, "SouthWest");
+ DefineEValue(p, 8L, "South");
+ DefineEValue(p, 9L, "SouthEast");
+ DefineEValue(p, 10L, "Static");
+
+ p = DefineType(BOOL, ENUMERATED, "BOOL", (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "False");
+ DefineEValue(p, 1L, "True");
+
+ p = DefineType(HOSTFAMILY, ENUMERATED, "HOSTFAMILY",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "Internet");
+ DefineEValue(p, 1L, "DECnet");
+ DefineEValue(p, 2L, "Chaos");
+ DefineEValue(p, 5L, "ServerInterpreted");
+ DefineEValue(p, 6L, "InternetV6");
+ DefineEValue(p, 252L, "LocalHost");
+ DefineEValue(p, 253L, "Kerberos5");
+ DefineEValue(p, 254L, "SecureRPC");
+
+ p = DefineType(PK_MODE, ENUMERATED, "PK_MODE",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "Synchronous");
+ DefineEValue(p, 1L, "Asynchronous");
+
+ p = DefineType(NO_YES, ENUMERATED, "NO_YES",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "No");
+ DefineEValue(p, 1L, "Yes");
+ DefineEValue(p, 2L, "Default");
+
+ p = DefineType(WINDOWCLASS, ENUMERATED, "WINDOWCLASS",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "CopyFromParent");
+ DefineEValue(p, 1L, "InputOutput");
+ DefineEValue(p, 2L, "InputOnly");
+
+ p = DefineType(BACKSTORE, ENUMERATED, "BACKSTORE",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "NotUseful");
+ DefineEValue(p, 1L, "WhenMapped");
+ DefineEValue(p, 2L, "Always");
+
+ p = DefineType(MAPSTATE, ENUMERATED, "MAPSTATE",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "Unmapped");
+ DefineEValue(p, 1L, "Unviewable");
+ DefineEValue(p, 2L, "Viewable");
+
+ p = DefineType(STACKMODE, ENUMERATED, "STACKMODE",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "Above");
+ DefineEValue(p, 1L, "Below");
+ DefineEValue(p, 2L, "TopIf");
+ DefineEValue(p, 3L, "BottomIf");
+ DefineEValue(p, 4L, "Opposite");
+
+ p = DefineType(CIRMODE, ENUMERATED, "CIRMODE",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "RaiseLowest");
+ DefineEValue(p, 1L, "LowerHighest");
+
+ p = DefineType(CHANGEMODE, ENUMERATED, "CHANGEMODE",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "Replace");
+ DefineEValue(p, 1L, "Prepend");
+ DefineEValue(p, 2L, "Append");
+
+ p = DefineType(GRABSTAT, ENUMERATED, "GRABSTAT",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "Success");
+ DefineEValue(p, 1L, "AlreadyGrabbed");
+ DefineEValue(p, 2L, "InvalidTime");
+ DefineEValue(p, 3L, "NotViewable");
+ DefineEValue(p, 4L, "Frozen");
+
+ p = DefineType(EVENTMODE, ENUMERATED, "EVENTMODE",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "AsyncPointer");
+ DefineEValue(p, 1L, "SyncPointer");
+ DefineEValue(p, 2L, "ReplayPointer");
+ DefineEValue(p, 3L, "AsyncKeyboard");
+ DefineEValue(p, 4L, "SyncKeyboard");
+ DefineEValue(p, 5L, "ReplayKeyboard");
+ DefineEValue(p, 6L, "AsyncBoth");
+ DefineEValue(p, 7L, "SyncBoth");
+
+ p = DefineType(FOCUSAGENT, ENUMERATED, "FOCUSAGENT",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "None");
+ DefineEValue(p, 1L, "PointerRoot");
+ DefineEValue(p, 2L, "Parent");
+
+ p = DefineType(DIRECT, ENUMERATED, "DIRECT",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "LeftToRight");
+ DefineEValue(p, 1L, "RightToLeft");
+
+ p = DefineType(GCFUNC, ENUMERATED, "GCFUNC",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "Clear");
+ DefineEValue(p, 1L, "And");
+ DefineEValue(p, 2L, "AndReverse");
+ DefineEValue(p, 3L, "Copy");
+ DefineEValue(p, 4L, "AndInverted");
+ DefineEValue(p, 5L, "Noop");
+ DefineEValue(p, 6L, "Xor");
+ DefineEValue(p, 7L, "Or");
+ DefineEValue(p, 8L, "Nor");
+ DefineEValue(p, 9L, "Equiv");
+ DefineEValue(p, 10L, "Invert");
+ DefineEValue(p, 11L, "OrReverse");
+ DefineEValue(p, 12L, "CopyInverted");
+ DefineEValue(p, 13L, "OrInverted");
+ DefineEValue(p, 14L, "Nand");
+ DefineEValue(p, 15L, "Set");
+
+ p = DefineType(LINESTYLE, ENUMERATED, "LINESTYLE",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "Solid");
+ DefineEValue(p, 1L, "OnOffDash");
+ DefineEValue(p, 2L, "DoubleDash");
+
+ p = DefineType(CAPSTYLE, ENUMERATED, "CAPSTYLE",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "NotLast");
+ DefineEValue(p, 1L, "Butt");
+ DefineEValue(p, 2L, "Round");
+ DefineEValue(p, 3L, "Projecting");
+
+ p = DefineType(JOINSTYLE, ENUMERATED, "JOINSTYLE",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "Miter");
+ DefineEValue(p, 1L, "Round");
+ DefineEValue(p, 2L, "Bevel");
+
+ p = DefineType(FILLSTYLE, ENUMERATED, "FILLSTYLE",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "Solid");
+ DefineEValue(p, 1L, "Tiled");
+ DefineEValue(p, 2L, "Stippled");
+ DefineEValue(p, 3L, "OpaqueStippled");
+
+ p = DefineType(FILLRULE, ENUMERATED, "FILLRULE",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "EvenOdd");
+ DefineEValue(p, 1L, "Winding");
+
+ p = DefineType(SUBWINMODE, ENUMERATED, "SUBWINMODE",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "ClipByChildren");
+ DefineEValue(p, 1L, "IncludeInferiors");
+
+ p = DefineType(ARCMODE, ENUMERATED, "ARCMODE",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "Chord");
+ DefineEValue(p, 1L, "PieSlice");
+
+ p = DefineType(RECTORDER, ENUMERATED, "RECTORDER",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "UnSorted");
+ DefineEValue(p, 1L, "YSorted");
+ DefineEValue(p, 2L, "YXSorted");
+ DefineEValue(p, 3L, "YXBanded");
+
+ p = DefineType(COORMODE, ENUMERATED, "COORMODE",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "Origin");
+ DefineEValue(p, 1L, "Previous");
+
+ p = DefineType(POLYSHAPE, ENUMERATED, "POLYSHAPE",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "Complex");
+ DefineEValue(p, 1L, "Nonconvex");
+ DefineEValue(p, 2L, "Convex");
+
+ p = DefineType(IMAGEMODE, ENUMERATED, "IMAGEMODE",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "Bitmap");
+ DefineEValue(p, 1L, "XYPixmap");
+ DefineEValue(p, 2L, "ZPixmap");
+
+ p = DefineType(ALLORNONE, ENUMERATED, "ALLORNONE",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "None");
+ DefineEValue(p, 1L, "All");
+
+ p = DefineType(OBJECTCLASS, ENUMERATED, "OBJECTCLASS",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "Cursor");
+ DefineEValue(p, 1L, "Tile");
+ DefineEValue(p, 2L, "Stipple");
+
+ p = DefineType(OFF_ON, ENUMERATED, "OFF_ON",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "Off");
+ DefineEValue(p, 1L, "On");
+ DefineEValue(p, 2L, "Default");
+
+ p = DefineType(INS_DEL, ENUMERATED, "INS_DEL",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "Insert");
+ DefineEValue(p, 1L, "Delete");
+
+ p = DefineType(DIS_EN, ENUMERATED, "DIS_EN",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "Disabled");
+ DefineEValue(p, 1L, "Enabled");
+
+ p = DefineType(CLOSEMODE, ENUMERATED, "CLOSEMODE",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "Destroy");
+ DefineEValue(p, 1L, "RetainPermanent");
+ DefineEValue(p, 2L, "RetainTemporary");
+
+ p = DefineType(SAVEMODE, ENUMERATED, "SAVEMODE",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "Reset");
+ DefineEValue(p, 1L, "Activate");
+
+ p = DefineType(RSTATUS, ENUMERATED, "RSTATUS",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "Success");
+ DefineEValue(p, 1L, "Busy");
+ DefineEValue(p, 2L, "Failed");
+
+ p = DefineType(MOTIONDETAIL, ENUMERATED, "MOTIONDETAIL",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "Normal");
+ DefineEValue(p, 1L, "Hint");
+
+ p = DefineType(ENTERDETAIL, ENUMERATED, "ENTERDETAIL",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "Ancestor");
+ DefineEValue(p, 1L, "Virtual");
+ DefineEValue(p, 2L, "Inferior");
+ DefineEValue(p, 3L, "Nonlinear");
+ DefineEValue(p, 4L, "NonlinearVirtual");
+ DefineEValue(p, 5L, "Pointer");
+ DefineEValue(p, 6L, "PointerRoot");
+ DefineEValue(p, 7L, "None");
+
+ p = DefineType(BUTTONMODE, ENUMERATED, "BUTTONMODE",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "Normal");
+ DefineEValue(p, 1L, "Grab");
+ DefineEValue(p, 2L, "Ungrab");
+ DefineEValue(p, 3L, "WhileGrabbed");
+
+ p = DefineType(VISIBLE, ENUMERATED, "VISIBLE",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "Unobscured");
+ DefineEValue(p, 1L, "PartiallyObscured");
+ DefineEValue(p, 2L, "FullyObscured");
+
+ p = DefineType(CIRSTAT, ENUMERATED, "CIRSTAT",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "Top");
+ DefineEValue(p, 1L, "Bottom");
+
+ p = DefineType(PROPCHANGE, ENUMERATED, "PROPCHANGE",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "NewValue");
+ DefineEValue(p, 1L, "Deleted");
+
+ p = DefineType(CMAPCHANGE, ENUMERATED, "CMAPCHANGE",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "Uninstalled");
+ DefineEValue(p, 1L, "Installed");
+
+ p = DefineType(MAPOBJECT, ENUMERATED, "MAPOBJECT",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "Modifier");
+ DefineEValue(p, 1L, "Keyboard");
+ DefineEValue(p, 2L, "Pointer");
+
+ p = DefineType(BYTEMODE, ENUMERATED, "BYTEMODE",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0x42L, "MSB first");
+ DefineEValue(p, 0x6CL, "LSB first");
+
+ p = DefineType(BYTEORDER, ENUMERATED, "BYTEORDER",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "LSB first");
+ DefineEValue(p, 1L, "MSB first");
+
+ p = DefineType(COLORCLASS, ENUMERATED, "COLORCLASS",
+ (PrintProcType) PrintENUMERATED);
+ DefineEValue(p, 0L, "StaticGray");
+ DefineEValue(p, 1L, "GrayScale");
+ DefineEValue(p, 2L, "StaticColor");
+ DefineEValue(p, 3L, "PseudoColor");
+ DefineEValue(p, 4L, "TrueColor");
+ DefineEValue(p, 5L, "DirectColor");
+
+ p = DefineType(EXTENSION, ENUMERATED, "EXTENSION",
+ (PrintProcType) PrintENUMERATED);
}
/* ************************************************************ */
@@ -887,99 +914,102 @@ InitEnumeratedTypes (void)
/* ************************************************************ */
static void
-InitSetTypes (void)
+InitSetTypes(void)
{
- TYPE p;
-
- p = DefineType(SETofEVENT, SET, "SETofEVENT", (PrintProcType) PrintSET);
- DefineEValue(p, 0x00000001L, "KeyPress");
- DefineEValue(p, 0x00000002L, "KeyRelease");
- DefineEValue(p, 0x00000004L, "ButtonPress");
- DefineEValue(p, 0x00000008L, "ButtonRelease");
- DefineEValue(p, 0x00000010L, "EnterWindow");
- DefineEValue(p, 0x00000020L, "LeaveWindow");
- DefineEValue(p, 0x00000040L, "PointerMotion");
- DefineEValue(p, 0x00000080L, "PointerMotionHint");
- DefineEValue(p, 0x00000100L, "Button1Motion");
- DefineEValue(p, 0x00000200L, "Button2Motion");
- DefineEValue(p, 0x00000400L, "Button3Motion");
- DefineEValue(p, 0x00000800L, "Button4Motion");
- DefineEValue(p, 0x00001000L, "Button5Motion");
- DefineEValue(p, 0x00002000L, "ButtonMotion");
- DefineEValue(p, 0x00004000L, "KeymapState");
- DefineEValue(p, 0x00008000L, "Exposure");
- DefineEValue(p, 0x00010000L, "VisibilityChange");
- DefineEValue(p, 0x00020000L, "StructureNotify");
- DefineEValue(p, 0x00040000L, "ResizeRedirect");
- DefineEValue(p, 0x00080000L, "SubstructureNotify");
- DefineEValue(p, 0x00100000L, "SubstructureRedirect");
- DefineEValue(p, 0x00200000L, "FocusChange");
- DefineEValue(p, 0x00400000L, "PropertyChange");
- DefineEValue(p, 0x00800000L, "ColormapChange");
- DefineEValue(p, 0x01000000L, "OwnerGrabButton");
-
- p = DefineType(SETofPOINTEREVENT, SET, "SETofPOINTEREVENT", (PrintProcType) PrintSET);
- DefineEValue(p, 0x00000004L, "ButtonPress");
- DefineEValue(p, 0x00000008L, "ButtonRelease");
- DefineEValue(p, 0x00000010L, "EnterWindow");
- DefineEValue(p, 0x00000020L, "LeaveWindow");
- DefineEValue(p, 0x00000040L, "PointerMotion");
- DefineEValue(p, 0x00000080L, "PointerMotionHint");
- DefineEValue(p, 0x00000100L, "Button1Motion");
- DefineEValue(p, 0x00000200L, "Button2Motion");
- DefineEValue(p, 0x00000400L, "Button3Motion");
- DefineEValue(p, 0x00000800L, "Button4Motion");
- DefineEValue(p, 0x00001000L, "Button5Motion");
- DefineEValue(p, 0x00002000L, "ButtonMotion");
- DefineEValue(p, 0x00004000L, "KeymapState");
-
- p = DefineType(SETofDEVICEEVENT, SET, "SETofDEVICEEVENT", (PrintProcType) PrintSET);
- DefineEValue(p, 0x00000001L, "KeyPress");
- DefineEValue(p, 0x00000002L, "KeyRelease");
- DefineEValue(p, 0x00000004L, "ButtonPress");
- DefineEValue(p, 0x00000008L, "ButtonRelease");
- DefineEValue(p, 0x00000040L, "PointerMotion");
- DefineEValue(p, 0x00000100L, "Button1Motion");
- DefineEValue(p, 0x00000200L, "Button2Motion");
- DefineEValue(p, 0x00000400L, "Button3Motion");
- DefineEValue(p, 0x00000800L, "Button4Motion");
- DefineEValue(p, 0x00001000L, "Button5Motion");
- DefineEValue(p, 0x00002000L, "ButtonMotion");
-
- p = DefineType(SETofKEYBUTMASK, SET, "SETofKEYBUTMASK", (PrintProcType) PrintSET);
- DefineEValue(p, 0x0001L, "Shift");
- DefineEValue(p, 0x0002L, "Lock");
- DefineEValue(p, 0x0004L, "Control");
- DefineEValue(p, 0x0008L, "Mod1");
- DefineEValue(p, 0x0010L, "Mod2");
- DefineEValue(p, 0x0020L, "Mod3");
- DefineEValue(p, 0x0040L, "Mod4");
- DefineEValue(p, 0x0080L, "Mod5");
- DefineEValue(p, 0x0100L, "Button1");
- DefineEValue(p, 0x0200L, "Button2");
- DefineEValue(p, 0x0400L, "Button3");
- DefineEValue(p, 0x0800L, "Button4");
- DefineEValue(p, 0x1000L, "Button5");
-
- p = DefineType(SETofKEYMASK, SET, "SETofKEYMASK", (PrintProcType) PrintSET);
- DefineEValue(p, 0x0001L, "Shift");
- DefineEValue(p, 0x0002L, "Lock");
- DefineEValue(p, 0x0004L, "Control");
- DefineEValue(p, 0x0008L, "Mod1");
- DefineEValue(p, 0x0010L, "Mod2");
- DefineEValue(p, 0x0020L, "Mod3");
- DefineEValue(p, 0x0040L, "Mod4");
- DefineEValue(p, 0x0080L, "Mod5");
- DefineEValue(p, 0x8000L, "AnyModifier");
-
- p = DefineType(COLORMASK, SET, "COLORMASK", (PrintProcType) PrintSET);
- DefineEValue(p, 0x01L, "do-red");
- DefineEValue(p, 0x02L, "do-green");
- DefineEValue(p, 0x04L, "do-blue");
-
- p = DefineType(SCREENFOCUS, SET, "SCREENFOCUS", (PrintProcType) PrintSET);
- DefineEValue(p, 0x01L, "focus");
- DefineEValue(p, 0x02L, "same-screen");
+ TYPE p;
+
+ p = DefineType(SETofEVENT, SET, "SETofEVENT", (PrintProcType) PrintSET);
+ DefineEValue(p, 0x00000001L, "KeyPress");
+ DefineEValue(p, 0x00000002L, "KeyRelease");
+ DefineEValue(p, 0x00000004L, "ButtonPress");
+ DefineEValue(p, 0x00000008L, "ButtonRelease");
+ DefineEValue(p, 0x00000010L, "EnterWindow");
+ DefineEValue(p, 0x00000020L, "LeaveWindow");
+ DefineEValue(p, 0x00000040L, "PointerMotion");
+ DefineEValue(p, 0x00000080L, "PointerMotionHint");
+ DefineEValue(p, 0x00000100L, "Button1Motion");
+ DefineEValue(p, 0x00000200L, "Button2Motion");
+ DefineEValue(p, 0x00000400L, "Button3Motion");
+ DefineEValue(p, 0x00000800L, "Button4Motion");
+ DefineEValue(p, 0x00001000L, "Button5Motion");
+ DefineEValue(p, 0x00002000L, "ButtonMotion");
+ DefineEValue(p, 0x00004000L, "KeymapState");
+ DefineEValue(p, 0x00008000L, "Exposure");
+ DefineEValue(p, 0x00010000L, "VisibilityChange");
+ DefineEValue(p, 0x00020000L, "StructureNotify");
+ DefineEValue(p, 0x00040000L, "ResizeRedirect");
+ DefineEValue(p, 0x00080000L, "SubstructureNotify");
+ DefineEValue(p, 0x00100000L, "SubstructureRedirect");
+ DefineEValue(p, 0x00200000L, "FocusChange");
+ DefineEValue(p, 0x00400000L, "PropertyChange");
+ DefineEValue(p, 0x00800000L, "ColormapChange");
+ DefineEValue(p, 0x01000000L, "OwnerGrabButton");
+
+ p = DefineType(SETofPOINTEREVENT, SET, "SETofPOINTEREVENT",
+ (PrintProcType) PrintSET);
+ DefineEValue(p, 0x00000004L, "ButtonPress");
+ DefineEValue(p, 0x00000008L, "ButtonRelease");
+ DefineEValue(p, 0x00000010L, "EnterWindow");
+ DefineEValue(p, 0x00000020L, "LeaveWindow");
+ DefineEValue(p, 0x00000040L, "PointerMotion");
+ DefineEValue(p, 0x00000080L, "PointerMotionHint");
+ DefineEValue(p, 0x00000100L, "Button1Motion");
+ DefineEValue(p, 0x00000200L, "Button2Motion");
+ DefineEValue(p, 0x00000400L, "Button3Motion");
+ DefineEValue(p, 0x00000800L, "Button4Motion");
+ DefineEValue(p, 0x00001000L, "Button5Motion");
+ DefineEValue(p, 0x00002000L, "ButtonMotion");
+ DefineEValue(p, 0x00004000L, "KeymapState");
+
+ p = DefineType(SETofDEVICEEVENT, SET, "SETofDEVICEEVENT",
+ (PrintProcType) PrintSET);
+ DefineEValue(p, 0x00000001L, "KeyPress");
+ DefineEValue(p, 0x00000002L, "KeyRelease");
+ DefineEValue(p, 0x00000004L, "ButtonPress");
+ DefineEValue(p, 0x00000008L, "ButtonRelease");
+ DefineEValue(p, 0x00000040L, "PointerMotion");
+ DefineEValue(p, 0x00000100L, "Button1Motion");
+ DefineEValue(p, 0x00000200L, "Button2Motion");
+ DefineEValue(p, 0x00000400L, "Button3Motion");
+ DefineEValue(p, 0x00000800L, "Button4Motion");
+ DefineEValue(p, 0x00001000L, "Button5Motion");
+ DefineEValue(p, 0x00002000L, "ButtonMotion");
+
+ p = DefineType(SETofKEYBUTMASK, SET, "SETofKEYBUTMASK",
+ (PrintProcType) PrintSET);
+ DefineEValue(p, 0x0001L, "Shift");
+ DefineEValue(p, 0x0002L, "Lock");
+ DefineEValue(p, 0x0004L, "Control");
+ DefineEValue(p, 0x0008L, "Mod1");
+ DefineEValue(p, 0x0010L, "Mod2");
+ DefineEValue(p, 0x0020L, "Mod3");
+ DefineEValue(p, 0x0040L, "Mod4");
+ DefineEValue(p, 0x0080L, "Mod5");
+ DefineEValue(p, 0x0100L, "Button1");
+ DefineEValue(p, 0x0200L, "Button2");
+ DefineEValue(p, 0x0400L, "Button3");
+ DefineEValue(p, 0x0800L, "Button4");
+ DefineEValue(p, 0x1000L, "Button5");
+
+ p = DefineType(SETofKEYMASK, SET, "SETofKEYMASK", (PrintProcType) PrintSET);
+ DefineEValue(p, 0x0001L, "Shift");
+ DefineEValue(p, 0x0002L, "Lock");
+ DefineEValue(p, 0x0004L, "Control");
+ DefineEValue(p, 0x0008L, "Mod1");
+ DefineEValue(p, 0x0010L, "Mod2");
+ DefineEValue(p, 0x0020L, "Mod3");
+ DefineEValue(p, 0x0040L, "Mod4");
+ DefineEValue(p, 0x0080L, "Mod5");
+ DefineEValue(p, 0x8000L, "AnyModifier");
+
+ p = DefineType(COLORMASK, SET, "COLORMASK", (PrintProcType) PrintSET);
+ DefineEValue(p, 0x01L, "do-red");
+ DefineEValue(p, 0x02L, "do-green");
+ DefineEValue(p, 0x04L, "do-blue");
+
+ p = DefineType(SCREENFOCUS, SET, "SCREENFOCUS", (PrintProcType) PrintSET);
+ DefineEValue(p, 0x01L, "focus");
+ DefineEValue(p, 0x02L, "same-screen");
}
@@ -991,247 +1021,238 @@ InitSetTypes (void)
/* Print Routines for builtin record types */
static int
-PrintCHAR2B (
- const unsigned char *buf)
+PrintCHAR2B(const unsigned char *buf)
{
- PrintField(buf, 0, 1, CARD8, "byte1");
- PrintField(buf, 1, 1, CARD8, "byte2");
- return(2);
+ PrintField(buf, 0, 1, CARD8, "byte1");
+ PrintField(buf, 1, 1, CARD8, "byte2");
+ return (2);
}
static int
-PrintPOINT (
- const unsigned char *buf)
+PrintPOINT(const unsigned char *buf)
{
- PrintField(buf, 0, 2, INT16, "x");
- PrintField(buf, 2, 2, INT16, "y");
- return(4);
+ PrintField(buf, 0, 2, INT16, "x");
+ PrintField(buf, 2, 2, INT16, "y");
+ return (4);
}
static int
-PrintRECTANGLE (
- const unsigned char *buf)
+PrintRECTANGLE(const unsigned char *buf)
{
- PrintField(buf, 0, 2, INT16, "x");
- PrintField(buf, 2, 2, INT16, "y");
- PrintField(buf, 4, 2, CARD16, "width");
- PrintField(buf, 6, 2, CARD16, "height");
- return(8);
+ PrintField(buf, 0, 2, INT16, "x");
+ PrintField(buf, 2, 2, INT16, "y");
+ PrintField(buf, 4, 2, CARD16, "width");
+ PrintField(buf, 6, 2, CARD16, "height");
+ return (8);
}
static int
-PrintARC (
- const unsigned char *buf)
+PrintARC(const unsigned char *buf)
{
- PrintField(buf, 0, 2, INT16, "x");
- PrintField(buf, 2, 2, INT16, "y");
- PrintField(buf, 4, 2, CARD16, "width");
- PrintField(buf, 6, 2, CARD16, "height");
- PrintField(buf, 8, 2, INT16, "angle1");
- PrintField(buf, 10, 2, INT16, "angle2");
- return(12);
+ PrintField(buf, 0, 2, INT16, "x");
+ PrintField(buf, 2, 2, INT16, "y");
+ PrintField(buf, 4, 2, CARD16, "width");
+ PrintField(buf, 6, 2, CARD16, "height");
+ PrintField(buf, 8, 2, INT16, "angle1");
+ PrintField(buf, 10, 2, INT16, "angle2");
+ return (12);
}
static int
-PrintHOST (
- const unsigned char *buf)
+PrintHOST(const unsigned char *buf)
{
- short n;
- PrintField(buf, 0, 1, HOSTFAMILY, "family");
- PrintField(buf, 2, 2, DVALUE2(n), "length of address");
- n = IShort(&buf[2]);
- switch (buf[0]) {
+ short n;
+
+ PrintField(buf, 0, 1, HOSTFAMILY, "family");
+ PrintField(buf, 2, 2, DVALUE2(n), "length of address");
+ n = IShort(&buf[2]);
+ switch (buf[0]) {
case 0:
{
- struct in_addr ia;
- char *addr;
- memcpy(&ia, &buf[4], sizeof(ia)); /* Need to get alignment right */
- addr = inet_ntoa(ia);
- PrintString8((unsigned char *)addr, strlen(addr), "address");
- break;
+ struct in_addr ia;
+ char *addr;
+
+ memcpy(&ia, &buf[4], sizeof(ia)); /* Need to get alignment right */
+ addr = inet_ntoa(ia);
+ PrintString8((unsigned char *) addr, strlen(addr), "address");
+ break;
}
#ifdef IPv6
case 6:
{
- struct in6_addr i6a;
+ struct in6_addr i6a;
char addr[INET6_ADDRSTRLEN];
- memcpy(&i6a, &buf[4], sizeof(i6a)); /* Need to get alignment right */
- inet_ntop(AF_INET6, &i6a, addr, sizeof(addr));
- PrintString8((unsigned char *) addr, strlen(addr), "address");
- break;
+
+ memcpy(&i6a, &buf[4], sizeof(i6a)); /* Need to get alignment right */
+ inet_ntop(AF_INET6, &i6a, addr, sizeof(addr));
+ PrintString8((unsigned char *) addr, strlen(addr), "address");
+ break;
}
#endif
- case 5: /* ServerInterpreted */
+ case 5: /* ServerInterpreted */
{
- int i;
- for (i = 0 ; buf[i + 4] != 0 ; i++) { /* empty loop */ }
- PrintString8(&buf[4], i, "type");
- PrintString8(&buf[i+5], n - i - 1, "value");
- break;
+ int i;
+
+ for (i = 0; buf[i + 4] != 0; i++) {
+ /* empty loop */
+ }
+ PrintString8(&buf[4], i, "type");
+ PrintString8(&buf[i + 5], n - i - 1, "value");
+ break;
}
case 254:
- PrintString8(&buf[4], n, "address");
- break;
+ PrintString8(&buf[4], n, "address");
+ break;
default:
- PrintList(&buf[4], (long)n, BYTE, "address");
- }
- return(pad((long)(4 + n)));
+ PrintList(&buf[4], (long) n, BYTE, "address");
+ }
+ return (pad((long) (4 + n)));
}
static int
-PrintTIMECOORD (
- const unsigned char *buf)
+PrintTIMECOORD(const unsigned char *buf)
{
- PrintField(buf, 0, 4, TIMESTAMP, "time");
- PrintField(buf, 4, 2, CARD16, "x");
- PrintField(buf, 6, 2, CARD16, "y");
- return(8);
+ PrintField(buf, 0, 4, TIMESTAMP, "time");
+ PrintField(buf, 4, 2, CARD16, "x");
+ PrintField(buf, 6, 2, CARD16, "y");
+ return (8);
}
static int
-PrintFONTPROP (
- const unsigned char *buf)
+PrintFONTPROP(const unsigned char *buf)
{
- PrintField(buf, 0, 4, ATOM, "name");
- PrintField(buf, 4, 4, INT32, "value");
- return(8);
+ PrintField(buf, 0, 4, ATOM, "name");
+ PrintField(buf, 4, 4, INT32, "value");
+ return (8);
}
static int
-PrintCHARINFO (
- const unsigned char *buf)
+PrintCHARINFO(const unsigned char *buf)
{
- PrintField(buf, 0, 2, INT16, "left-side-bearing");
- PrintField(buf, 2, 2, INT16, "right-side-bearing");
- PrintField(buf, 4, 2, INT16, "character-width");
- PrintField(buf, 6, 2, INT16, "ascent");
- PrintField(buf, 8, 2, INT16, "descent");
- PrintField(buf, 10, 2, CARD16, "attributes");
- return(12);
+ PrintField(buf, 0, 2, INT16, "left-side-bearing");
+ PrintField(buf, 2, 2, INT16, "right-side-bearing");
+ PrintField(buf, 4, 2, INT16, "character-width");
+ PrintField(buf, 6, 2, INT16, "ascent");
+ PrintField(buf, 8, 2, INT16, "descent");
+ PrintField(buf, 10, 2, CARD16, "attributes");
+ return (12);
}
static int
-PrintSEGMENT (
- const unsigned char *buf)
+PrintSEGMENT(const unsigned char *buf)
{
- PrintField(buf, 0, 2, INT16, "x1");
- PrintField(buf, 2, 2, INT16, "y1");
- PrintField(buf, 4, 2, INT16, "x2");
- PrintField(buf, 6, 2, INT16, "y2");
- return(8);
+ PrintField(buf, 0, 2, INT16, "x1");
+ PrintField(buf, 2, 2, INT16, "y1");
+ PrintField(buf, 4, 2, INT16, "x2");
+ PrintField(buf, 6, 2, INT16, "y2");
+ return (8);
}
static int
-PrintCOLORITEM (
- const unsigned char *buf)
+PrintCOLORITEM(const unsigned char *buf)
{
- PrintField(buf, 0, 4, CARD32, "pixel");
- PrintField(buf, 4, 2, CARD16, "red");
- PrintField(buf, 6, 2, CARD16, "green");
- PrintField(buf, 8, 2, CARD16, "blue");
- PrintField(buf, 10, 1, COLORMASK, "component selector");
- return(12);
+ PrintField(buf, 0, 4, CARD32, "pixel");
+ PrintField(buf, 4, 2, CARD16, "red");
+ PrintField(buf, 6, 2, CARD16, "green");
+ PrintField(buf, 8, 2, CARD16, "blue");
+ PrintField(buf, 10, 1, COLORMASK, "component selector");
+ return (12);
}
static int
-PrintRGB (
- const unsigned char *buf)
+PrintRGB(const unsigned char *buf)
{
- PrintField(buf, 0, 2, CARD16, "red");
- PrintField(buf, 2, 2, CARD16, "green");
- PrintField(buf, 4, 2, CARD16, "blue");
- return(8);
+ PrintField(buf, 0, 2, CARD16, "red");
+ PrintField(buf, 2, 2, CARD16, "green");
+ PrintField(buf, 4, 2, CARD16, "blue");
+ return (8);
}
static int
-PrintFORMAT (
- const unsigned char *buf)
+PrintFORMAT(const unsigned char *buf)
{
- PrintField(buf, 0, 1, CARD8, "depth");
- PrintField(buf, 1, 1, CARD8, "bits-per-pixel");
- PrintField(buf, 2, 1, CARD8, "scanline-pad");
- return(8);
+ PrintField(buf, 0, 1, CARD8, "depth");
+ PrintField(buf, 1, 1, CARD8, "bits-per-pixel");
+ PrintField(buf, 2, 1, CARD8, "scanline-pad");
+ return (8);
}
static int
-PrintSCREEN (
- const unsigned char *buf)
+PrintSCREEN(const unsigned char *buf)
{
- short n /* number of elements in List of DEPTH */ ;
- long m /* length (in bytes) of List of DEPTH */ ;
-
- PrintField(buf, 0, 4, WINDOW, "root");
- PrintField(buf, 4, 4, COLORMAP, "default-colormap");
- PrintField(buf, 8, 4, CARD32, "white-pixel");
- PrintField(buf, 12, 4, CARD32, "black-pixel");
- PrintField(buf, 16, 4, SETofEVENT, "current-input-masks");
- PrintField(buf, 20, 2, CARD16, "width-in-pixels");
- PrintField(buf, 22, 2, CARD16, "height-in-pixels");
- PrintField(buf, 24, 2, CARD16, "width-in-millimeters");
- PrintField(buf, 26, 2, CARD16, "height-in-millimeters");
- PrintField(buf, 28, 2, CARD16, "min-installed-maps");
- PrintField(buf, 30, 2, CARD16, "max-installed-maps");
- PrintField(buf, 32, 4, VISUALID, "root-visual");
- PrintField(buf, 36, 1, BACKSTORE, "backing-stores");
- PrintField(buf, 37, 1, BOOL, "save-unders");
- PrintField(buf, 38, 1, CARD8, "root-depth");
- PrintField(buf, 39, 1, CARD8, "number of allowed-depths");
- n = IByte(&buf[39]);
- m = PrintList(&buf[40], (long)n, DEPTH, "allowed-depths");
- return(40 + m);
+ short n; /* number of elements in List of DEPTH */
+ long m; /* length (in bytes) of List of DEPTH */
+
+ PrintField(buf, 0, 4, WINDOW, "root");
+ PrintField(buf, 4, 4, COLORMAP, "default-colormap");
+ PrintField(buf, 8, 4, CARD32, "white-pixel");
+ PrintField(buf, 12, 4, CARD32, "black-pixel");
+ PrintField(buf, 16, 4, SETofEVENT, "current-input-masks");
+ PrintField(buf, 20, 2, CARD16, "width-in-pixels");
+ PrintField(buf, 22, 2, CARD16, "height-in-pixels");
+ PrintField(buf, 24, 2, CARD16, "width-in-millimeters");
+ PrintField(buf, 26, 2, CARD16, "height-in-millimeters");
+ PrintField(buf, 28, 2, CARD16, "min-installed-maps");
+ PrintField(buf, 30, 2, CARD16, "max-installed-maps");
+ PrintField(buf, 32, 4, VISUALID, "root-visual");
+ PrintField(buf, 36, 1, BACKSTORE, "backing-stores");
+ PrintField(buf, 37, 1, BOOL, "save-unders");
+ PrintField(buf, 38, 1, CARD8, "root-depth");
+ PrintField(buf, 39, 1, CARD8, "number of allowed-depths");
+ n = IByte(&buf[39]);
+ m = PrintList(&buf[40], (long) n, DEPTH, "allowed-depths");
+ return (40 + m);
}
static int
-PrintDEPTH (
- const unsigned char *buf)
+PrintDEPTH(const unsigned char *buf)
{
- short n /* number of elements in List of VISUALTYPE */ ;
- short m /* length (in bytes) of List of VISUALTYPE */ ;
-
- PrintField(buf, 0, 1, CARD8, "depth");
- PrintField(buf, 2, 2, DVALUE2(n), "number of visuals");
- n = IShort(&buf[2]);
- m = PrintList(&buf[8], (long)n, VISUALTYPE, "visuals");
- return(8 + m);
+ short n; /* number of elements in List of VISUALTYPE */
+ short m; /* length (in bytes) of List of VISUALTYPE */
+
+ PrintField(buf, 0, 1, CARD8, "depth");
+ PrintField(buf, 2, 2, DVALUE2(n), "number of visuals");
+ n = IShort(&buf[2]);
+ m = PrintList(&buf[8], (long) n, VISUALTYPE, "visuals");
+ return (8 + m);
}
static int
-PrintVISUALTYPE (
- const unsigned char *buf)
+PrintVISUALTYPE(const unsigned char *buf)
{
- PrintField(buf, 0, 4, VISUALID, "visual-id");
- PrintField(buf, 4, 1, COLORCLASS, "class");
- PrintField(buf, 5, 1, CARD8, "bits-per-rgb-value");
- PrintField(buf, 6, 2, CARD16, "colormap-entries");
- PrintField(buf, 8, 4, CARD32, "red-mask");
- PrintField(buf, 12, 4, CARD32, "green-mask");
- PrintField(buf, 16, 4, CARD32, "blue-mask");
- return(24);
+ PrintField(buf, 0, 4, VISUALID, "visual-id");
+ PrintField(buf, 4, 1, COLORCLASS, "class");
+ PrintField(buf, 5, 1, CARD8, "bits-per-rgb-value");
+ PrintField(buf, 6, 2, CARD16, "colormap-entries");
+ PrintField(buf, 8, 4, CARD32, "red-mask");
+ PrintField(buf, 12, 4, CARD32, "green-mask");
+ PrintField(buf, 16, 4, CARD32, "blue-mask");
+ return (24);
}
/* ************************************************************ */
static void
-InitRecordTypes (void)
+InitRecordTypes(void)
{
- (void) DefineType(CHAR2B, RECORD, "CHAR2B", PrintCHAR2B);
- (void) DefineType(POINT, RECORD, "POINT", PrintPOINT);
- (void) DefineType(RECTANGLE, RECORD, "RECTANGLE", PrintRECTANGLE);
- (void) DefineType(ARC, RECORD, "ARC", PrintARC);
- (void) DefineType(HOST, RECORD, "HOST", PrintHOST);
- (void) DefineType(TIMECOORD, RECORD, "TIMECOORD", PrintTIMECOORD);
- (void) DefineType(FONTPROP, RECORD, "FONTPROP", PrintFONTPROP);
- (void) DefineType(CHARINFO, RECORD, "CHARINFO", PrintCHARINFO);
- (void) DefineType(SEGMENT, RECORD, "SEGMENT", PrintSEGMENT);
- (void) DefineType(COLORITEM, RECORD, "COLORITEM", PrintCOLORITEM);
- (void) DefineType(RGB, RECORD, "RGB", PrintRGB);
- (void) DefineType(FORMAT, RECORD, "FORMAT", PrintFORMAT);
- (void) DefineType(SCREEN, RECORD, "SCREEN", PrintSCREEN);
- (void) DefineType(DEPTH, RECORD, "DEPTH", PrintDEPTH);
- (void) DefineType(VISUALTYPE, RECORD, "VISUALTYPE", PrintVISUALTYPE);
+ (void) DefineType(CHAR2B, RECORD, "CHAR2B", PrintCHAR2B);
+ (void) DefineType(POINT, RECORD, "POINT", PrintPOINT);
+ (void) DefineType(RECTANGLE, RECORD, "RECTANGLE", PrintRECTANGLE);
+ (void) DefineType(ARC, RECORD, "ARC", PrintARC);
+ (void) DefineType(HOST, RECORD, "HOST", PrintHOST);
+ (void) DefineType(TIMECOORD, RECORD, "TIMECOORD", PrintTIMECOORD);
+ (void) DefineType(FONTPROP, RECORD, "FONTPROP", PrintFONTPROP);
+ (void) DefineType(CHARINFO, RECORD, "CHARINFO", PrintCHARINFO);
+ (void) DefineType(SEGMENT, RECORD, "SEGMENT", PrintSEGMENT);
+ (void) DefineType(COLORITEM, RECORD, "COLORITEM", PrintCOLORITEM);
+ (void) DefineType(RGB, RECORD, "RGB", PrintRGB);
+ (void) DefineType(FORMAT, RECORD, "FORMAT", PrintFORMAT);
+ (void) DefineType(SCREEN, RECORD, "SCREEN", PrintSCREEN);
+ (void) DefineType(DEPTH, RECORD, "DEPTH", PrintDEPTH);
+ (void) DefineType(VISUALTYPE, RECORD, "VISUALTYPE", PrintVISUALTYPE);
}
@@ -1242,69 +1263,72 @@ InitRecordTypes (void)
/* ************************************************************ */
static void
-InitValuesTypes (void)
+InitValuesTypes(void)
{
- TYPE p;
-
- p = DefineType(WINDOW_BITMASK, SET, "WINDOW_BITMASK", (PrintProcType) PrintSET);
-
- DefineValues(p, 0x00000001L, 4, PIXMAPNPR, "background-pixmap");
- DefineValues(p, 0x00000002L, 4, CARD32, "background-pixel");
- DefineValues(p, 0x00000004L, 4, PIXMAPC, "border-pixmap");
- DefineValues(p, 0x00000008L, 4, CARD32, "border-pixel");
- DefineValues(p, 0x00000010L, 1, BITGRAVITY, "bit-gravity");
- DefineValues(p, 0x00000020L, 1, WINGRAVITY, "win-gravity");
- DefineValues(p, 0x00000040L, 1, BACKSTORE, "backing-store");
- DefineValues(p, 0x00000080L, 4, CARD32, "backing-planes");
- DefineValues(p, 0x00000100L, 4, CARD32, "backing-pixel");
- DefineValues(p, 0x00000200L, 1, BOOL, "override-redirect");
- DefineValues(p, 0x00000400L, 1, BOOL, "save-under");
- DefineValues(p, 0x00000800L, 4, SETofEVENT, "event-mask");
- DefineValues(p, 0x00001000L, 4, SETofDEVICEEVENT, "do-not-propagate-mask");
- DefineValues(p, 0x00002000L, 4, COLORMAPC, "colormap");
- DefineValues(p, 0x00004000L, 4, CURSOR, "cursor");
-
- p = DefineType(CONFIGURE_BITMASK, SET, "CONFIGURE_BITMASK", (PrintProcType) PrintSET);
- DefineValues(p, 0x0001L, 2, INT16, "x");
- DefineValues(p, 0x0002L, 2, INT16, "y");
- DefineValues(p, 0x0004L, 2, CARD16, "width");
- DefineValues(p, 0x0008L, 2, CARD16, "height");
- DefineValues(p, 0x0010L, 2, CARD16, "border-width");
- DefineValues(p, 0x0020L, 4, WINDOW, "sibling");
- DefineValues(p, 0x0040L, 1, STACKMODE, "stack-mode");
-
- p = DefineType(GC_BITMASK, SET, "GC_BITMASK", (PrintProcType) PrintSET);
- DefineValues(p, 0x00000001L, 1, GCFUNC, "function");
- DefineValues(p, 0x00000002L, 4, CARD32, "plane-mask");
- DefineValues(p, 0x00000004L, 4, CARD32, "foreground");
- DefineValues(p, 0x00000008L, 4, CARD32, "background");
- DefineValues(p, 0x00000010L, 2, CARD16, "line-width");
- DefineValues(p, 0x00000020L, 1, LINESTYLE, "line-style");
- DefineValues(p, 0x00000040L, 1, CAPSTYLE, "cap-style");
- DefineValues(p, 0x00000080L, 1, JOINSTYLE, "join-style");
- DefineValues(p, 0x00000100L, 1, FILLSTYLE, "fill-style");
- DefineValues(p, 0x00000200L, 1, FILLRULE, "fill-rule");
- DefineValues(p, 0x00000400L, 4, PIXMAP, "tile");
- DefineValues(p, 0x00000800L, 4, PIXMAP, "stipple");
- DefineValues(p, 0x00001000L, 2, INT16, "tile-stipple-x-origin");
- DefineValues(p, 0x00002000L, 2, INT16, "tile-stipple-y-origin");
- DefineValues(p, 0x00004000L, 4, FONT, "font");
- DefineValues(p, 0x00008000L, 1, SUBWINMODE, "subwindow-mode");
- DefineValues(p, 0x00010000L, 1, BOOL, "graphics-exposures");
- DefineValues(p, 0x00020000L, 2, INT16, "clip-x-origin");
- DefineValues(p, 0x00040000L, 2, INT16, "clip-y-origin");
- DefineValues(p, 0x00080000L, 4, PIXMAP, "clip-mask");
- DefineValues(p, 0x00100000L, 2, CARD16, "dash-offset");
- DefineValues(p, 0x00200000L, 1, CARD8, "dashes");
- DefineValues(p, 0x00400000L, 1, ARCMODE, "arc-mode");
-
- p = DefineType(KEYBOARD_BITMASK, SET, "KEYBOARD_BITMASK", (PrintProcType) PrintSET);
- DefineValues(p, 0x0001L, 1, INT8, "key-click-percent");
- DefineValues(p, 0x0002L, 1, INT8, "bell-percent");
- DefineValues(p, 0x0004L, 2, INT16, "bell-pitch");
- DefineValues(p, 0x0008L, 2, INT16, "bell-duration");
- DefineValues(p, 0x0010L, 1, CARD8, "led");
- DefineValues(p, 0x0020L, 1, OFF_ON, "led-mode");
- DefineValues(p, 0x0040L, 1, KEYCODE, "key");
- DefineValues(p, 0x0080L, 1, OFF_ON, "auto-repeat-mode");
+ TYPE p;
+
+ p = DefineType(WINDOW_BITMASK, SET, "WINDOW_BITMASK",
+ (PrintProcType) PrintSET);
+
+ DefineValues(p, 0x00000001L, 4, PIXMAPNPR, "background-pixmap");
+ DefineValues(p, 0x00000002L, 4, CARD32, "background-pixel");
+ DefineValues(p, 0x00000004L, 4, PIXMAPC, "border-pixmap");
+ DefineValues(p, 0x00000008L, 4, CARD32, "border-pixel");
+ DefineValues(p, 0x00000010L, 1, BITGRAVITY, "bit-gravity");
+ DefineValues(p, 0x00000020L, 1, WINGRAVITY, "win-gravity");
+ DefineValues(p, 0x00000040L, 1, BACKSTORE, "backing-store");
+ DefineValues(p, 0x00000080L, 4, CARD32, "backing-planes");
+ DefineValues(p, 0x00000100L, 4, CARD32, "backing-pixel");
+ DefineValues(p, 0x00000200L, 1, BOOL, "override-redirect");
+ DefineValues(p, 0x00000400L, 1, BOOL, "save-under");
+ DefineValues(p, 0x00000800L, 4, SETofEVENT, "event-mask");
+ DefineValues(p, 0x00001000L, 4, SETofDEVICEEVENT, "do-not-propagate-mask");
+ DefineValues(p, 0x00002000L, 4, COLORMAPC, "colormap");
+ DefineValues(p, 0x00004000L, 4, CURSOR, "cursor");
+
+ p = DefineType(CONFIGURE_BITMASK, SET, "CONFIGURE_BITMASK",
+ (PrintProcType) PrintSET);
+ DefineValues(p, 0x0001L, 2, INT16, "x");
+ DefineValues(p, 0x0002L, 2, INT16, "y");
+ DefineValues(p, 0x0004L, 2, CARD16, "width");
+ DefineValues(p, 0x0008L, 2, CARD16, "height");
+ DefineValues(p, 0x0010L, 2, CARD16, "border-width");
+ DefineValues(p, 0x0020L, 4, WINDOW, "sibling");
+ DefineValues(p, 0x0040L, 1, STACKMODE, "stack-mode");
+
+ p = DefineType(GC_BITMASK, SET, "GC_BITMASK", (PrintProcType) PrintSET);
+ DefineValues(p, 0x00000001L, 1, GCFUNC, "function");
+ DefineValues(p, 0x00000002L, 4, CARD32, "plane-mask");
+ DefineValues(p, 0x00000004L, 4, CARD32, "foreground");
+ DefineValues(p, 0x00000008L, 4, CARD32, "background");
+ DefineValues(p, 0x00000010L, 2, CARD16, "line-width");
+ DefineValues(p, 0x00000020L, 1, LINESTYLE, "line-style");
+ DefineValues(p, 0x00000040L, 1, CAPSTYLE, "cap-style");
+ DefineValues(p, 0x00000080L, 1, JOINSTYLE, "join-style");
+ DefineValues(p, 0x00000100L, 1, FILLSTYLE, "fill-style");
+ DefineValues(p, 0x00000200L, 1, FILLRULE, "fill-rule");
+ DefineValues(p, 0x00000400L, 4, PIXMAP, "tile");
+ DefineValues(p, 0x00000800L, 4, PIXMAP, "stipple");
+ DefineValues(p, 0x00001000L, 2, INT16, "tile-stipple-x-origin");
+ DefineValues(p, 0x00002000L, 2, INT16, "tile-stipple-y-origin");
+ DefineValues(p, 0x00004000L, 4, FONT, "font");
+ DefineValues(p, 0x00008000L, 1, SUBWINMODE, "subwindow-mode");
+ DefineValues(p, 0x00010000L, 1, BOOL, "graphics-exposures");
+ DefineValues(p, 0x00020000L, 2, INT16, "clip-x-origin");
+ DefineValues(p, 0x00040000L, 2, INT16, "clip-y-origin");
+ DefineValues(p, 0x00080000L, 4, PIXMAP, "clip-mask");
+ DefineValues(p, 0x00100000L, 2, CARD16, "dash-offset");
+ DefineValues(p, 0x00200000L, 1, CARD8, "dashes");
+ DefineValues(p, 0x00400000L, 1, ARCMODE, "arc-mode");
+
+ p = DefineType(KEYBOARD_BITMASK, SET, "KEYBOARD_BITMASK",
+ (PrintProcType) PrintSET);
+ DefineValues(p, 0x0001L, 1, INT8, "key-click-percent");
+ DefineValues(p, 0x0002L, 1, INT8, "bell-percent");
+ DefineValues(p, 0x0004L, 2, INT16, "bell-pitch");
+ DefineValues(p, 0x0008L, 2, INT16, "bell-duration");
+ DefineValues(p, 0x0010L, 1, CARD8, "led");
+ DefineValues(p, 0x0020L, 1, OFF_ON, "led-mode");
+ DefineValues(p, 0x0040L, 1, KEYCODE, "key");
+ DefineValues(p, 0x0080L, 1, OFF_ON, "auto-repeat-mode");
}
diff --git a/tablenas.c b/tablenas.c
index 0f93dae..bac71dc 100644
--- a/tablenas.c
+++ b/tablenas.c
@@ -15,13 +15,13 @@
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NCD.
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Author: Keith Packard, Network Computing Devices
*/
-InitializeAudio ()
+InitializeAudio()
{
- ;
+ ;
}
diff --git a/wcpscope.h b/wcpscope.h
index 03a1f71..eab60b6 100644
--- a/wcpscope.h
+++ b/wcpscope.h
@@ -15,7 +15,7 @@
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NCD.
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Author: Keith Packard, Network Computing Devices
@@ -35,15 +35,14 @@
#define printfield(a,b,c,d,e) if (Verbose > 1) PrintField(a,b,c,d,e)
-extern void WcpQueryVersion (FD fd, const unsigned char *buf);
-extern void WcpQueryVersionReply (FD fd, const unsigned char *buf);
-extern void WcpPutImage (FD fd, const unsigned char *buf);
-extern void WcpGetImage (FD fd, const unsigned char *buf);
-extern void WcpGetImageReply (FD fd, const unsigned char *buf);
-extern void WcpCreateColorCursor (FD fd, const unsigned char *buf);
-extern void WcpCreateLut (FD fd, const unsigned char *buf);
-extern void WcpFreeLut (FD fd, const unsigned char *buf);
-extern void WcpCopyArea (FD fd, const unsigned char *buf);
+extern void WcpQueryVersion(FD fd, const unsigned char *buf);
+extern void WcpQueryVersionReply(FD fd, const unsigned char *buf);
+extern void WcpPutImage(FD fd, const unsigned char *buf);
+extern void WcpGetImage(FD fd, const unsigned char *buf);
+extern void WcpGetImageReply(FD fd, const unsigned char *buf);
+extern void WcpCreateColorCursor(FD fd, const unsigned char *buf);
+extern void WcpCreateLut(FD fd, const unsigned char *buf);
+extern void WcpFreeLut(FD fd, const unsigned char *buf);
+extern void WcpCopyArea(FD fd, const unsigned char *buf);
#endif
-
diff --git a/x11.h b/x11.h
index b6c0b9f..ec4760b 100644
--- a/x11.h
+++ b/x11.h
@@ -1,8 +1,8 @@
-/* ************************************************************ *
- * *
- * Type definitions and Connection State for the X11 protocol *
- * *
- * James Peterson, 1988 *
+/*
+ * Type definitions and Connection State for the X11 protocol
+ *
+ * James Peterson, 1988
+ *
* Copyright (C) 1988 MCC
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -22,7 +22,9 @@
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
- * *
+ *
+ */
+/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -44,7 +46,7 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
- * ************************************************************ */
+ */
#ifndef XSCOPE_X11_H
#define XSCOPE_X11_H
@@ -69,60 +71,59 @@
/* Built-in Types */
-#define BYTE 1 /* 8-bit value */
-#define INT8 2 /* 8-bit signed integer */
-#define INT16 3 /* 16-bit signed integer */
-#define INT32 4 /* 32-bit signed integer */
-#define CARD8 5 /* 8-bit unsigned integer */
-#define CARD16 6 /* 16-bit unsigned integer */
-#define CARD32 7 /* 32-bit unsigned integer */
-#define STRING8 8 /* List of CARD8 */
-#define STRING16 9 /* List of CHAR2B */
-#define TEXTITEM8 10 /* STRING8 or Font shift */
-#define TEXTITEM16 11 /* STRING16 or Font shift */
+#define BYTE 1 /* 8-bit value */
+#define INT8 2 /* 8-bit signed integer */
+#define INT16 3 /* 16-bit signed integer */
+#define INT32 4 /* 32-bit signed integer */
+#define CARD8 5 /* 8-bit unsigned integer */
+#define CARD16 6 /* 16-bit unsigned integer */
+#define CARD32 7 /* 32-bit unsigned integer */
+#define STRING8 8 /* List of CARD8 */
+#define STRING16 9 /* List of CHAR2B */
+#define TEXTITEM8 10 /* STRING8 or Font shift */
+#define TEXTITEM16 11 /* STRING16 or Font shift */
-#define WINDOW 12 /* CARD32 plus 0 = None */
-#define WINDOWD 13 /* CARD32 plus 0 = PointerWindow, 1 =
- InputFocus */
-#define WINDOWNR 14 /* CARD32 plus 0 = None, 1 = PointerRoot */
+#define WINDOW 12 /* CARD32 plus 0 = None */
+#define WINDOWD 13 /* CARD32 plus 0 = PointerWindow, 1 =
+ InputFocus */
+#define WINDOWNR 14 /* CARD32 plus 0 = None, 1 = PointerRoot */
-#define PIXMAP 15 /* CARD32 plus 0 = None */
-#define PIXMAPNPR 16 /* CARD32 plus 0 = None, 1 = ParentRelative
- */
-#define PIXMAPC 17 /* CARD32 plus 0 = CopyFromParent */
+#define PIXMAP 15 /* CARD32 plus 0 = None */
+#define PIXMAPNPR 16 /* CARD32 plus 0 = None, 1 = ParentRelative */
+#define PIXMAPC 17 /* CARD32 plus 0 = CopyFromParent */
-#define CURSOR 18 /* CARD32 plus 0 = None */
+#define CURSOR 18 /* CARD32 plus 0 = None */
-#define FONT 19 /* CARD32 plus 0 = None */
+#define FONT 19 /* CARD32 plus 0 = None */
-#define GCONTEXT 20 /* CARD32 */
+#define GCONTEXT 20 /* CARD32 */
-#define COLORMAP 21 /* CARD32 plus 0 = None */
-#define COLORMAPC 22 /* CARD32 plus 0 = CopyFromParent */
+#define COLORMAP 21 /* CARD32 plus 0 = None */
+#define COLORMAPC 22 /* CARD32 plus 0 = CopyFromParent */
-#define DRAWABLE 23 /* CARD32 */
-#define FONTABLE 24 /* CARD32 */
+#define DRAWABLE 23 /* CARD32 */
+#define FONTABLE 24 /* CARD32 */
-#define ATOM 25 /* CARD32 plus 0 = None */
-#define ATOMT 26 /* CARD32 plus 0 = AnyPropertyType */
+#define ATOM 25 /* CARD32 plus 0 = None */
+#define ATOMT 26 /* CARD32 plus 0 = AnyPropertyType */
-#define VISUALID 27 /* CARD32 plus 0 = None */
-#define VISUALIDC 28 /* CARD32 plus 0 = CopyFromParent */
+#define VISUALID 27 /* CARD32 plus 0 = None */
+#define VISUALIDC 28 /* CARD32 plus 0 = CopyFromParent */
-#define TIMESTAMP 29 /* CARD32 plus 0 as the current time */
+#define TIMESTAMP 29 /* CARD32 plus 0 as the current time */
-#define RESOURCEID 30 /* CARD32 plus 0 = AllTemporary */
+#define RESOURCEID 30 /* CARD32 plus 0 = AllTemporary */
-#define KEYSYM 31 /* CARD32 */
-#define KEYCODE 32 /* CARD8 */
-#define KEYCODEA 33 /* CARD8 plus 0 = AnyKey */
+#define KEYSYM 31 /* CARD32 */
+#define KEYCODE 32 /* CARD8 */
+#define KEYCODEA 33 /* CARD8 plus 0 = AnyKey */
-#define BUTTON 34 /* CARD8 */
-#define BUTTONA 35 /* CARD8 plus 0 = AnyButton */
+#define BUTTON 34 /* CARD8 */
+#define BUTTONA 35 /* CARD8 plus 0 = AnyButton */
-#define EVENTFORM 36 /* event format */
-#define CHAR8 37 /* CARD8 interpreted as a character */
-#define STR 38 /* String of CHAR8 with preceding length */
+#define EVENTFORM 36 /* event format */
+#define CHAR8 37 /* CARD8 interpreted as a character */
+#define STR 38 /* String of CHAR8 with preceding length */
/* ************************************************************ */
/* */
@@ -131,72 +132,72 @@
/* Defined types */
-#define BITGRAVITY 40
-#define WINGRAVITY 41
-#define BOOL 42
-#define HOSTFAMILY 43
-#define PK_MODE 44
-#define NO_YES 45
-#define WINDOWCLASS 46
-#define BACKSTORE 47
-#define MAPSTATE 48
-#define STACKMODE 49
-#define CIRMODE 50
-#define CHANGEMODE 51
-#define GRABSTAT 52
-#define EVENTMODE 53
-#define FOCUSAGENT 54
-#define DIRECT 55
-#define GCFUNC 56
-#define LINESTYLE 57
-#define CAPSTYLE 58
-#define JOINSTYLE 59
-#define FILLSTYLE 60
-#define FILLRULE 61
-#define SUBWINMODE 62
-#define ARCMODE 63
-#define RECTORDER 64
-#define COORMODE 65
-#define POLYSHAPE 66
-#define IMAGEMODE 67
-#define ALLORNONE 68
-#define OBJECTCLASS 69
-#define OFF_ON 70
-#define INS_DEL 71
-#define DIS_EN 72
-#define CLOSEMODE 73
-#define SAVEMODE 74
-#define RSTATUS 75
-#define MOTIONDETAIL 76
-#define ENTERDETAIL 77
-#define BUTTONMODE 78
-#define SCREENFOCUS 79
-#define VISIBLE 80
-#define CIRSTAT 81
-#define PROPCHANGE 82
-#define CMAPCHANGE 83
-#define MAPOBJECT 84
-#define SETofEVENT 85
-#define SETofPOINTEREVENT 86
-#define SETofDEVICEEVENT 87
-#define SETofKEYBUTMASK 88
-#define SETofKEYMASK 89
-#define WINDOW_BITMASK 90
-#define CONFIGURE_BITMASK 91
-#define GC_BITMASK 92
-#define KEYBOARD_BITMASK 93
-#define COLORMASK 94
-#define CHAR2B 95
-#define POINT 96
-#define RECTANGLE 97
-#define ARC 98
-#define HOST 99
-#define TIMECOORD 100
-#define FONTPROP 101
-#define CHARINFO 102
-#define SEGMENT 103
-#define COLORITEM 104
-#define RGB 105
+#define BITGRAVITY 40
+#define WINGRAVITY 41
+#define BOOL 42
+#define HOSTFAMILY 43
+#define PK_MODE 44
+#define NO_YES 45
+#define WINDOWCLASS 46
+#define BACKSTORE 47
+#define MAPSTATE 48
+#define STACKMODE 49
+#define CIRMODE 50
+#define CHANGEMODE 51
+#define GRABSTAT 52
+#define EVENTMODE 53
+#define FOCUSAGENT 54
+#define DIRECT 55
+#define GCFUNC 56
+#define LINESTYLE 57
+#define CAPSTYLE 58
+#define JOINSTYLE 59
+#define FILLSTYLE 60
+#define FILLRULE 61
+#define SUBWINMODE 62
+#define ARCMODE 63
+#define RECTORDER 64
+#define COORMODE 65
+#define POLYSHAPE 66
+#define IMAGEMODE 67
+#define ALLORNONE 68
+#define OBJECTCLASS 69
+#define OFF_ON 70
+#define INS_DEL 71
+#define DIS_EN 72
+#define CLOSEMODE 73
+#define SAVEMODE 74
+#define RSTATUS 75
+#define MOTIONDETAIL 76
+#define ENTERDETAIL 77
+#define BUTTONMODE 78
+#define SCREENFOCUS 79
+#define VISIBLE 80
+#define CIRSTAT 81
+#define PROPCHANGE 82
+#define CMAPCHANGE 83
+#define MAPOBJECT 84
+#define SETofEVENT 85
+#define SETofPOINTEREVENT 86
+#define SETofDEVICEEVENT 87
+#define SETofKEYBUTMASK 88
+#define SETofKEYMASK 89
+#define WINDOW_BITMASK 90
+#define CONFIGURE_BITMASK 91
+#define GC_BITMASK 92
+#define KEYBOARD_BITMASK 93
+#define COLORMASK 94
+#define CHAR2B 95
+#define POINT 96
+#define RECTANGLE 97
+#define ARC 98
+#define HOST 99
+#define TIMECOORD 100
+#define FONTPROP 101
+#define CHARINFO 102
+#define SEGMENT 103
+#define COLORITEM 104
+#define RGB 105
#define BYTEMODE 110
#define BYTEORDER 111
#define COLORCLASS 112
@@ -271,7 +272,7 @@
/* Type Definition Table
Each item in the X11 Protocol has a type. There are about 120
- different types. We need to be able to print each item in a
+ different types. We need to be able to print each item in a
format and interpretation which is appropriate for the type of
that item. To do so, we build a table describing each type.
Each type has a name, possibly a list of named values and a
@@ -288,28 +289,26 @@
/* Enumerated and Set types need a list of Named Values */
-struct ValueListEntry
-{
- struct ValueListEntry *Next;
- const char *Name;
- short Type;
- short Length;
- long Value;
+struct ValueListEntry {
+ struct ValueListEntry *Next;
+ const char *Name;
+ short Type;
+ short Length;
+ long Value;
};
typedef int (*PrintProcType) (const unsigned char *);
-struct TypeDef
-{
- const char *Name;
- short Type /* BUILTIN, ENUMERATED, SET, or RECORD */ ;
- struct ValueListEntry *ValueList;
- PrintProcType PrintProc;
+struct TypeDef {
+ const char *Name;
+ short Type; /* BUILTIN, ENUMERATED, SET, or RECORD */
+ struct ValueListEntry *ValueList;
+ PrintProcType PrintProc;
};
typedef struct TypeDef *TYPE;
-extern struct TypeDef TD[MaxTypes];
+extern struct TypeDef TD[MaxTypes];
/* ************************************************************ */
/* */
@@ -355,8 +354,10 @@ extern int PrintKEYCODEA(const unsigned char *buf);
extern int PrintBUTTON(const unsigned char *buf);
extern int PrintBUTTONA(const unsigned char *buf);
extern int PrintEVENTFORM(const unsigned char *buf);
-extern int PrintENUMERATED(const unsigned char *buf, short length, struct ValueListEntry *ValueList);
-extern int PrintSET(const unsigned char *buf, short length, struct ValueListEntry *ValueList);
+extern int PrintENUMERATED(const unsigned char *buf, short length,
+ struct ValueListEntry *ValueList);
+extern int PrintSET(const unsigned char *buf, short length,
+ struct ValueListEntry *ValueList);
/* ************************************************************ */
/* */
@@ -366,24 +367,24 @@ extern int PrintSET(const unsigned char *buf, short length, struct ValueListEntr
/* Reply Buffer: Pseudo-buffer used to provide the opcode for the
request to which this is a reply: Set by DecodeReply
and used in the PrintField of the Reply procedure */
-extern unsigned char RBf[2];
+extern unsigned char RBf[2];
/* Sequence Buffer: Pseudo-buffer used to provide the sequence number for a
- request: Set by DecodeReply and used in a PrintField of
+ request: Set by DecodeReply and used in a PrintField of
the Request procedure */
-extern unsigned char SBf[4];
+extern unsigned char SBf[4];
-#define PRINTSERVER 5 /* indent output as if it comes from server */
-#define PRINTCLIENT 1 /* indent output as if it comes from client */
+#define PRINTSERVER 5 /* indent output as if it comes from server */
+#define PRINTCLIENT 1 /* indent output as if it comes from client */
/* ************************************************************ */
/* */
/* */
/* ************************************************************ */
-/*
+/*
In general, we are called with a buffer of bytes and are supposed to
try to make sense of these bytes according to the X11 protocol. There
are two different types of communication: requests from the client to
@@ -400,7 +401,7 @@ extern unsigned char SBf[4];
have until more bytes arrive.
In general, we do two things: we wait for some number of bytes, and
- then we interpret this set of bytes. To interpret this data we use
+ then we interpret this set of bytes. To interpret this data we use
a modified state machine. We keep two pieces of information:
(1) the number of bytes that we need
@@ -414,7 +415,7 @@ extern unsigned char SBf[4];
The data going from the client to the x11 server consists of a
set-up message followed by an infinite stream of variable length
- requests.
+ requests.
Our overall flow is then:
@@ -423,7 +424,7 @@ extern unsigned char SBf[4];
length of the rest of the message.
(c) Wait for the rest of the set-up message.
(d) Interpret and print the set-up message.
-
+
*** end of set-up phase -- start normal request loop ***
(e) Wait for 4 bytes.
@@ -464,19 +465,19 @@ extern unsigned char SBf[4];
This latter seems more effective. It appears reply/error/event formats
were selected to allow waiting for 32 bytes, and it will allow short packets
which are only 32 bytes long, to be processed completely in one step.
-
- Thus, For normal reply/error/event processing we have
+
+ Thus, For normal reply/error/event processing we have
(e) Wait for 32 bytes.
(f) Interpret these 32 bytes. If possible, go back to step (e).
(g) If the packet is a reply with bytes 4-7 non-zero, wait for the
remainder of the the reply.
(h) Interpret and print the longer reply. Go back to step (e).
-
+
The similarity in approach to how both the client and server are handled
suggests we can use the same control structure to drive the interpretation
- of both types of communication client->server and server->client.
+ of both types of communication client->server and server->client.
Accordingly, we package up the relevant variables in a ConnState
record. The ConnState record contains the buffer of saved bytes (if any),
the size and length of this buffer, the number of bytes we are waiting for
@@ -490,40 +491,38 @@ extern unsigned char SBf[4];
state variables.
*/
-struct ConnState
-{
- unsigned char *SavedBytes;
- int littleEndian;
- int bigreqEnabled;
- long requestLen;
- long SizeofSavedBytes;
- long NumberofSavedBytes;
+struct ConnState {
+ unsigned char *SavedBytes;
+ int littleEndian;
+ int bigreqEnabled;
+ long requestLen;
+ long SizeofSavedBytes;
+ long NumberofSavedBytes;
- long NumberofBytesNeeded;
- long NumberofBytesProcessed;
- long (*ByteProcessing)(FD fd, const unsigned char *buf, long n);
+ long NumberofBytesNeeded;
+ long NumberofBytesProcessed;
+ long (*ByteProcessing) (FD fd, const unsigned char *buf, long n);
- long SequenceNumber;
+ long SequenceNumber;
};
-extern struct ConnState *CS;
+extern struct ConnState *CS;
typedef struct _Value {
- struct _Value *next;
- unsigned long key;
- int size;
- unsigned long *values;
+ struct _Value *next;
+ unsigned long key;
+ int size;
+ unsigned long *values;
} ValueRec, *ValuePtr;
-extern ValuePtr GetValueRec (unsigned long key);
-extern void CreateValueRec (unsigned long key, int size,
- const unsigned long *def);
-extern void DeleteValueRec (unsigned long key);
-extern void SetValueRec (unsigned long key, const unsigned char *control,
- short clength, short ctype,
- const unsigned char *values);
-extern void PrintValueRec (unsigned long key, unsigned long cmask,
- short ctype);
+extern ValuePtr GetValueRec(unsigned long key);
+extern void CreateValueRec(unsigned long key, int size,
+ const unsigned long *def);
+extern void DeleteValueRec(unsigned long key);
+extern void SetValueRec(unsigned long key, const unsigned char *control,
+ short clength, short ctype,
+ const unsigned char *values);
+extern void PrintValueRec(unsigned long key, unsigned long cmask, short ctype);
/* ************************************************************ */
/* */
@@ -532,25 +531,24 @@ extern void PrintValueRec (unsigned long key, unsigned long cmask,
/* declaration of the types of some common functions */
-extern unsigned long ILong(const unsigned char *buf);
-extern unsigned short IShort(const unsigned char *buf);
-extern unsigned short IChar2B(const unsigned char *buf);
-extern unsigned short IByte(const unsigned char *buf);
-extern Boolean IBool(const unsigned char *buf);
+extern unsigned long ILong(const unsigned char *buf);
+extern unsigned short IShort(const unsigned char *buf);
+extern unsigned short IChar2B(const unsigned char *buf);
+extern unsigned short IByte(const unsigned char *buf);
+extern Boolean IBool(const unsigned char *buf);
-extern int PrintString8(const unsigned char *buf, int number,
- const char *name);
+extern int PrintString8(const unsigned char *buf, int number, const char *name);
extern int PrintString16(const unsigned char *buf, int number,
- const char *name);
+ const char *name);
extern void PrintTString8(const unsigned char *buf, long number,
- const char *name);
+ const char *name);
extern void PrintTString16(const unsigned char *buf, long number,
- const char *name);
+ const char *name);
-extern long PrintList (const unsigned char *buf, long number, short ListType,
- const char *name);
-extern long PrintListSTR (const unsigned char *buf, long number,
- const char *name);
+extern long PrintList(const unsigned char *buf, long number, short ListType,
+ const char *name);
+extern long PrintListSTR(const unsigned char *buf, long number,
+ const char *name);
extern long pad(long n);
@@ -593,4 +591,4 @@ extern const char REQUESTHEADER[], EVENTHEADER[], ERRORHEADER[], REPLYHEADER[];
/* Constant defined in Generic Event Protocol 1.0 for event type */
#define Event_Type_Generic 35
-#endif /* XSCOPE_X11_H */
+#endif /* XSCOPE_X11_H */
diff --git a/xstats.c b/xstats.c
index 33ec4c7..7d4297a 100644
--- a/xstats.c
+++ b/xstats.c
@@ -3,112 +3,112 @@
#define ERROR 2
#define EVENT 3
-string_to_action (s)
- char *s;
+string_to_action(s)
+char *s;
{
- if (!strcmp (s, "@@REQUEST")) return REQUEST;
- if (!strcmp (s, "@@REPLY")) return REPLY;
- if (!strcmp (s, "@@ERROR")) return ERROR;
- if (!strcmp (s, "@@EVENT")) return EVENT;
+ if (!strcmp(s, "@@REQUEST"))
+ return REQUEST;
+ if (!strcmp(s, "@@REPLY"))
+ return REPLY;
+ if (!strcmp(s, "@@ERROR"))
+ return ERROR;
+ if (!strcmp(s, "@@EVENT"))
+ return EVENT;
}
-
+
typedef struct {
- double time;
- int action;
- int client;
- int major;
- int minor;
- int len;
+ double time;
+ int action;
+ int client;
+ int major;
+ int minor;
+ int len;
} ActionRec, *ActionPtr;
-unsigned long requestCount[256][256];
-unsigned long replyCount[256][256];
-unsigned long eventCount[256][256];
-unsigned long errorCount[256][256];
+unsigned long requestCount[256][256];
+unsigned long replyCount[256][256];
+unsigned long eventCount[256][256];
+unsigned long errorCount[256][256];
+
+unsigned long requestBytes[256][256];
+unsigned long replyBytes[256][256];
+unsigned long eventBytes[256][256];
+unsigned long errorBytes[256][256];
+
+unsigned long tRequestBytes;
+unsigned long tReplyBytes;
+unsigned long tEventBytes;
+unsigned long tErrorBytes;
-unsigned long requestBytes[256][256];
-unsigned long replyBytes[256][256];
-unsigned long eventBytes[256][256];
-unsigned long errorBytes[256][256];
+unsigned long tRequestCount;
+unsigned long tReplyCount;
+unsigned long tEventCount;
+unsigned long tErrorCount;
-unsigned long tRequestBytes;
-unsigned long tReplyBytes;
-unsigned long tEventBytes;
-unsigned long tErrorBytes;
-
-unsigned long tRequestCount;
-unsigned long tReplyCount;
-unsigned long tEventCount;
-unsigned long tErrorCount;
-
-dump (c, b)
- unsigned long c[256][256];
- unsigned long b[256][256];
+dump(c, b)
+ unsigned long c[256][256];
+ unsigned long b[256][256];
{
- int i, j;
- unsigned long count, bytes;
+ int i, j;
- for (i = 0; i < 256; i++)
- {
- for (j = 0; j < 256; j++)
- {
- if (count = c[i][j])
- {
- bytes = b[i][j];
- printf ("%3d %3d count %5d bytes %7d\n", i, j, count, bytes);
- }
- }
+ unsigned long count, bytes;
+
+ for (i = 0; i < 256; i++) {
+ for (j = 0; j < 256; j++) {
+ if (count = c[i][j]) {
+ bytes = b[i][j];
+ printf("%3d %3d count %5d bytes %7d\n", i, j, count, bytes);
+ }
+ }
}
}
-main ()
+main()
{
- ActionRec a;
- char aname[128];
- int i, j;
-
- while (scanf ("%lf: %s %d %d %d %d\n",
- &a.time, aname, &a.client, &a.major, &a.minor, &a.len) == 6)
- {
- a.action = string_to_action (aname);
- switch (a.action) {
- case REQUEST:
- requestCount[a.major][a.minor]++;
- requestBytes[a.major][a.minor] += a.len;
- tRequestCount++;
- tRequestBytes += a.len;
- break;
- case REPLY:
- replyCount[a.major][a.minor]++;
- replyBytes[a.major][a.minor] += a.len;
- tReplyCount++;
- tReplyBytes += a.len;
- break;
- case EVENT:
- eventCount[a.major][a.minor]++;
- eventBytes[a.major][a.minor] += a.len;
- tEventCount++;
- tEventBytes += a.len;
- break;
- case ERROR:
- errorCount[a.major][a.minor]++;
- errorBytes[a.major][a.minor] += a.len;
- tErrorCount++;
- tErrorBytes += a.len;
- break;
- }
+ ActionRec a;
+ char aname[128];
+ int i, j;
+
+ while (scanf("%lf: %s %d %d %d %d\n",
+ &a.time, aname, &a.client, &a.major, &a.minor, &a.len) == 6) {
+ a.action = string_to_action(aname);
+ switch (a.action) {
+ case REQUEST:
+ requestCount[a.major][a.minor]++;
+ requestBytes[a.major][a.minor] += a.len;
+ tRequestCount++;
+ tRequestBytes += a.len;
+ break;
+ case REPLY:
+ replyCount[a.major][a.minor]++;
+ replyBytes[a.major][a.minor] += a.len;
+ tReplyCount++;
+ tReplyBytes += a.len;
+ break;
+ case EVENT:
+ eventCount[a.major][a.minor]++;
+ eventBytes[a.major][a.minor] += a.len;
+ tEventCount++;
+ tEventBytes += a.len;
+ break;
+ case ERROR:
+ errorCount[a.major][a.minor]++;
+ errorBytes[a.major][a.minor] += a.len;
+ tErrorCount++;
+ tErrorBytes += a.len;
+ break;
+ }
}
- printf ("requests:\n");
- dump (requestCount, requestBytes);
- printf ("replies:\n");
- dump (replyCount, replyBytes);
- printf ("events:\n");
- dump (eventCount, eventBytes);
- printf ("errors:\n");
- dump (errorCount, errorBytes);
- printf ("send count %5d bytes %7d\n",
- tRequestCount, tRequestBytes);
- printf ("recv count %5d bytes %7d\n",
- tEventCount + tErrorCount + tReplyCount,
- tEventBytes + tErrorBytes + tReplyBytes);
+ printf("requests:\n");
+ dump(requestCount, requestBytes);
+ printf("replies:\n");
+ dump(replyCount, replyBytes);
+ printf("events:\n");
+ dump(eventCount, eventBytes);
+ printf("errors:\n");
+ dump(errorCount, errorBytes);
+ printf("send count %5d bytes %7d\n", tRequestCount, tRequestBytes);
+ printf("recv count %5d bytes %7d\n",
+ tEventCount + tErrorCount + tReplyCount,
+ tEventBytes + tErrorBytes + tReplyBytes);
}