summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am2
-rw-r--r--bigreqscope.h1
-rw-r--r--decode11.c114
-rw-r--r--decode_bigreq.c4
-rw-r--r--decode_lbx.c4
-rw-r--r--decode_randr.c4
-rw-r--r--decode_render.c4
-rw-r--r--decode_shm.c4
-rw-r--r--decode_wcp.c4
-rw-r--r--extensions.c233
-rw-r--r--extensions.h72
-rw-r--r--lbxscope.h1
-rw-r--r--print11.c25
-rw-r--r--proto.h22
-rw-r--r--randrscope.h1
-rw-r--r--renderscope.h1
-rw-r--r--scope.h4
-rw-r--r--shmscope.h1
-rw-r--r--wcpscope.h1
19 files changed, 352 insertions, 150 deletions
diff --git a/Makefile.am b/Makefile.am
index ef3d731..7bbf2e6 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -45,6 +45,8 @@ xscope_SOURCES = \
decode_shm.c \
decode_wcp.c \
decodenas.c \
+ extensions.c \
+ extensions.h \
fd.c \
fd.h \
lbxscope.h \
diff --git a/bigreqscope.h b/bigreqscope.h
index 64ba248..0b182c0 100644
--- a/bigreqscope.h
+++ b/bigreqscope.h
@@ -13,7 +13,6 @@
#define printfield(a,b,c,d,e) if (Verbose > 1) PrintField(a,b,c,d,e)
-extern unsigned char LookForBIGREQFlag;
extern unsigned char BIGREQRequest;
extern void BigreqEnable (FD fd, const unsigned char *buf);
diff --git a/decode11.c b/decode11.c
index f30d34a..e7c9995 100644
--- a/decode11.c
+++ b/decode11.c
@@ -54,13 +54,9 @@
* ************************************************************ */
#include "scope.h"
-#include "x11.h"
-#include "bigreqscope.h"
+#include "x11.h"
+#include "extensions.h"
#include "lbxscope.h"
-#include "randrscope.h"
-#include "renderscope.h"
-#include "shmscope.h"
-#include "wcpscope.h"
#ifdef SYSV
#define bzero(s,l) memset(s, 0, l)
@@ -382,6 +378,13 @@ DecodeRequest (
CS[fd].requestLen--;
buf += 4;
}
+
+ /* Special handling of QueryExtension to save extension names */
+ if (Request == 98)
+ {
+ ProcessQueryExtensionRequest(seq, buf);
+ }
+
if (Verbose < 0)
{
SimpleDump (DUMP_REQUEST, fd, Request, RequestMinor, n);
@@ -390,27 +393,13 @@ DecodeRequest (
if (Raw || (Verbose > 3))
DumpItem("Request", fd, buf, n);
- if (Request < 0 || 127 < Request) {
- if (Request == LBXRequest) {
- lbx_decode_req(fd, buf);
- } else
- if (Request == WCPRequest) {
- wcp_decode_req(fd, buf);
- } else if (Request == RENDERRequest) {
- render_decode_req(fd,buf);
- } else if (Request == RANDRRequest) {
- randr_decode_req(fd,buf);
- } else if (Request == MITSHMRequest) {
- mitshm_decode_req(fd,buf);
- } else if (Request == BIGREQRequest) {
- bigreq_decode_req(fd,buf);
- } else
- {
- ExtendedRequest(fd, buf);
- ReplyExpected(fd, Request);
- }
- } else switch (Request)
- {
+
+ if (Request < 0 || 127 < Request)
+ {
+ ExtensionRequest(fd, buf, Request);
+ }
+ else switch (Request)
+ {
case 1:
CreateWindow(buf);
break;
@@ -733,25 +722,6 @@ DecodeRequest (
break;
case 98:
QueryExtension(buf);
-
- if (strncmp("LBX",(char *)&buf[8],3) == 0)
- LookForLBXFlag=1;
-
- if (strncmp("NCD-WinCenterPro",(char *)&buf[8],16) == 0)
- LookForWCPFlag=1;
-
- if (strncmp("RENDER",(char *)&buf[8],6) == 0)
- LookForRENDERFlag=1;
-
- if (strncmp("RANDR",(char *)&buf[8],6) == 0)
- LookForRANDRFlag=1;
-
- if (strncmp("MIT-SHM",(char *)&buf[8],7) == 0)
- LookForMITSHMFlag=1;
-
- if (strncmp ("BIG-REQUESTS",(char *)&buf[8],12) == 0)
- LookForBIGREQFlag=1;
-
ReplyExpected(fd, Request);
break;
case 99:
@@ -851,6 +821,12 @@ DecodeReply (
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);
@@ -862,21 +838,10 @@ DecodeReply (
RBf[1] = RequestMinor;
if (Raw || (Verbose > 3))
DumpItem("Reply", fd, buf, n);
- if (Request == LBXRequest)
- lbx_decode_reply(fd, buf, RequestMinor);
- else
- if (Request == WCPRequest)
- wcp_decode_reply(fd, buf, RequestMinor);
- else if (Request == RENDERRequest)
- render_decode_reply(fd, buf, RequestMinor);
- else if (Request == RANDRRequest)
- randr_decode_reply(fd, buf, RequestMinor);
- else if (Request == MITSHMRequest)
- mitshm_decode_reply(fd, buf, RequestMinor);
- else if (Request == BIGREQRequest)
- bigreq_decode_reply(fd, buf, RequestMinor);
- else if (Request < 0 || 127 < Request)
- warn("Extended reply opcode");
+ if (Request < 0 || 127 < Request)
+ {
+ ExtensionReply(fd, buf, Request, RequestMinor);
+ }
else switch (Request)
{
case 0:
@@ -1035,16 +1000,10 @@ DecodeError (
if (Raw || (Verbose > 3))
DumpItem("Error", fd, buf, n);
- if (Error == LBXError)
- lbx_decode_error(fd, buf);
- else if (Error == WCPError)
- wcp_decode_error(fd, buf);
- else if (Error >= RENDERError && Error < RENDERError + RENDERNError)
- render_decode_error(fd,buf);
- else if (Error == MITSHMError)
- mitshm_decode_error(fd, buf);
- else if (Error < 1 || Error > 17)
- warn("Extended Error code");
+ if (Error < 1 || Error > 17)
+ {
+ ExtensionError(fd, buf, Error);
+ }
else switch (Error)
{
case 1:
@@ -1133,14 +1092,11 @@ DecodeEvent (
debug(8,(stderr, "SendEvent generated event 0x%x\n", Event));
Event = Event & 0x7F;
}
- if (Event == LBXEvent)
- lbx_decode_event (fd, buf);
- else if (Event == RANDREvent)
- randr_decode_event (fd, buf);
- else if (Event == MITSHMEvent)
- mitshm_decode_event (fd, buf);
- else if (Event < 2 || Event > 34)
- warn("Extended Event code");
+
+ if (Event < 2 || Event > 34)
+ {
+ ExtensionEvent(fd, buf, Event);
+ }
else switch (Event)
{
case 2:
diff --git a/decode_bigreq.c b/decode_bigreq.c
index 087a65d..be0d597 100644
--- a/decode_bigreq.c
+++ b/decode_bigreq.c
@@ -29,8 +29,7 @@
#include "scope.h"
#include "x11.h"
#include "bigreqscope.h"
-
-unsigned char LookForBIGREQFlag;
+#include "extensions.h"
unsigned char BIGREQRequest;
@@ -70,7 +69,6 @@ InitializeBIGREQ(
TYPE p;
BIGREQRequest = (unsigned char)(buf[9]);
- LookForBIGREQFlag = 0;
DefineEValue (&TD[REQUEST], (unsigned long) BIGREQRequest, "BigreqRequest");
DefineEValue (&TD[REPLY], (unsigned long) BIGREQRequest, "BigreqReply");
diff --git a/decode_lbx.c b/decode_lbx.c
index fc7e7f2..dd74657 100644
--- a/decode_lbx.c
+++ b/decode_lbx.c
@@ -30,8 +30,7 @@
#include "scope.h"
#include "x11.h"
#include "lbxscope.h"
-
-unsigned char LookForLBXFlag;
+#include "extensions.h"
unsigned char LBXRequest, LBXEvent, LBXError;
@@ -129,7 +128,6 @@ InitializeLBX (
LBXRequest = (unsigned char)(buf[9]);
LBXEvent = (unsigned char)(buf[10]);
LBXError = (unsigned char)(buf[11]);
- LookForLBXFlag = 0;
DefineEValue (&TD[REQUEST], (unsigned long) LBXRequest, "LbxRequest");
DefineEValue (&TD[REPLY], (unsigned long) LBXRequest, "LbxReply");
diff --git a/decode_randr.c b/decode_randr.c
index bb54d6a..b6a1ce3 100644
--- a/decode_randr.c
+++ b/decode_randr.c
@@ -30,8 +30,7 @@
#include "scope.h"
#include "x11.h"
#include "randrscope.h"
-
-unsigned char LookForRANDRFlag;
+#include "extensions.h"
unsigned char RANDRRequest, RANDRError, RANDREvent;
@@ -83,7 +82,6 @@ InitializeRANDR (
RANDRRequest = (unsigned char)(buf[9]);
RANDREvent = (unsigned char)(buf[10]);
RANDRError = (unsigned char)(buf[11]);
- LookForRANDRFlag = 0;
DefineEValue (&TD[REQUEST], (unsigned long) RANDRRequest, "RandrRequest");
DefineEValue (&TD[REPLY], (unsigned long) RANDRRequest, "RandrReply");
diff --git a/decode_render.c b/decode_render.c
index 8cf2317..6c46381 100644
--- a/decode_render.c
+++ b/decode_render.c
@@ -30,8 +30,7 @@
#include "scope.h"
#include "x11.h"
#include "renderscope.h"
-
-unsigned char LookForRENDERFlag;
+#include "extensions.h"
unsigned char RENDERRequest, RENDERError;
@@ -239,7 +238,6 @@ InitializeRENDER (
RENDERRequest = (unsigned char)(buf[9]);
RENDERError = (unsigned char)(buf[11]);
- LookForRENDERFlag = 0;
DefineEValue (&TD[REQUEST], (unsigned long) RENDERRequest, "RenderRequest");
DefineEValue (&TD[REPLY], (unsigned long) RENDERRequest, "RenderReply");
diff --git a/decode_shm.c b/decode_shm.c
index 4c2876e..938c770 100644
--- a/decode_shm.c
+++ b/decode_shm.c
@@ -29,8 +29,7 @@
#include "scope.h"
#include "x11.h"
#include "shmscope.h"
-
-unsigned char LookForMITSHMFlag;
+#include "extensions.h"
unsigned char MITSHMRequest, MITSHMError, MITSHMEvent;
@@ -97,7 +96,6 @@ InitializeMITSHM (
MITSHMRequest = (unsigned char)(buf[9]);
MITSHMEvent = (unsigned char)(buf[10]);
MITSHMError = (unsigned char)(buf[11]);
- LookForMITSHMFlag = 0;
DefineEValue (&TD[REQUEST], (unsigned long) MITSHMRequest, "MitshmRequest");
DefineEValue (&TD[REPLY], (unsigned long) MITSHMRequest, "MitshmReply");
diff --git a/decode_wcp.c b/decode_wcp.c
index bcf0653..fdb7664 100644
--- a/decode_wcp.c
+++ b/decode_wcp.c
@@ -30,8 +30,7 @@
#include "scope.h"
#include "x11.h"
#include "wcpscope.h"
-
-unsigned char LookForWCPFlag;
+#include "extensions.h"
unsigned char WCPRequest, WCPError;
@@ -113,7 +112,6 @@ InitializeWCP (
WCPRequest = (unsigned char)(buf[9]);
WCPError = (unsigned char)(buf[11]);
- LookForWCPFlag = 0;
DefineEValue (&TD[REQUEST], (unsigned long) WCPRequest, "WcpRequest");
DefineEValue (&TD[REPLY], (unsigned long) WCPRequest, "WcpReply");
diff --git a/extensions.c b/extensions.c
new file mode 100644
index 0000000..d053c06
--- /dev/null
+++ b/extensions.c
@@ -0,0 +1,233 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, provided that the above
+ * copyright notice(s) and this permission notice appear in all copies of
+ * the Software and that both the above copyright notice(s) and this
+ * permission notice appear in supporting documentation.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+ * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR 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 SOFTWARE.
+ *
+ * Except as contained in this notice, the name of a copyright holder
+ * shall not be used in advertising or otherwise to promote the sale, use
+ * or other dealings in this Software without prior written authorization
+ * of the copyright holder.
+ */
+
+#include "extensions.h"
+#include "bigreqscope.h"
+#include "lbxscope.h"
+#include "randrscope.h"
+#include "renderscope.h"
+#include "shmscope.h"
+#include "wcpscope.h"
+
+/* Extensions we know how to decode */
+struct extension_decoders {
+ const char *name;
+ void (*init_func)(const unsigned char *buf);
+};
+
+static const struct extension_decoders decodable_extensions[] = {
+ { "BIG-REQUESTS", InitializeBIGREQ },
+ { "LBX", InitializeLBX },
+ { "MITSHM", InitializeMITSHM },
+ { "NCD-WinCenterPro", InitializeWCP },
+ { "RANDR", InitializeRANDR },
+ { "RENDER", InitializeRENDER },
+ { NULL, NULL } /* List terminator - keep last */
+};
+
+/* all extensions we know about */
+struct extension_info {
+ const char *name;
+ unsigned char request;
+ unsigned char event;
+ unsigned char error;
+ long query_seq; /* sequence id of QueryExtension request */
+ struct extension_info *next;
+};
+
+struct extension_info *query_list;
+
+struct extension_info *ext_by_request[NUM_EXTENSIONS];
+
+static void
+DefineExtNameValue(int type, unsigned char value, const char *extname)
+{
+ int namelen = strlen(extname) + 1;
+ const char *typename = NULL;
+ char *exttypename;
+
+ switch (type) {
+ case REQUEST:
+ typename = "-Request";
+ break;
+ case REPLY:
+ typename = "-Reply";
+ break;
+ case EVENT:
+ typename = "-Event";
+ break;
+ case ERROR:
+ typename = "-Error";
+ break;
+ default:
+ panic("Impossible argument to DefineExtNameValue");
+ }
+ namelen += strlen(typename);
+ exttypename = Malloc(namelen);
+ snprintf(exttypename, namelen, "%s%s", extname, typename);
+ DefineEValue(&TD[type], (unsigned long) value, exttypename);
+}
+
+void
+ProcessQueryExtensionRequest(long seq, const unsigned char *buf)
+{
+ int namelen = IShort(&buf[4]);
+ char *extname = Malloc(namelen + 1);
+ struct extension_info *qe;
+
+ 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;
+ }
+ }
+
+ /* add to list */
+ qe = Malloc(sizeof(struct extension_info));
+ qe->name = extname;
+ qe->request = 0;
+ qe->event = 0;
+ qe->error = 0;
+ qe->query_seq = seq;
+ qe->next = query_list;
+ query_list = qe;
+}
+
+void
+ProcessQueryExtensionReply(long seq, const unsigned char *buf)
+{
+ struct extension_info *qe;
+ int i;
+
+ 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] = qe;
+
+ 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;
+ }
+ }
+}
+
+void
+ExtensionRequest (FD fd, const unsigned char *buf, short Request)
+{
+ if (Request == LBXRequest) {
+ lbx_decode_req(fd, buf);
+ } else if (Request == WCPRequest) {
+ wcp_decode_req(fd, buf);
+ } else if (Request == RENDERRequest) {
+ render_decode_req(fd,buf);
+ } else if (Request == RANDRRequest) {
+ randr_decode_req(fd,buf);
+ } else if (Request == MITSHMRequest) {
+ mitshm_decode_req(fd,buf);
+ } else if (Request == BIGREQRequest) {
+ bigreq_decode_req(fd,buf);
+ } else {
+ ExtendedRequest(fd, buf);
+ ReplyExpected(fd, Request);
+ }
+}
+
+void
+ExtensionReply (FD fd, const unsigned char *buf,
+ short Request, short RequestMinor)
+{
+ if (Request == LBXRequest) {
+ lbx_decode_reply(fd, buf, RequestMinor);
+ } else if (Request == WCPRequest) {
+ wcp_decode_reply(fd, buf, RequestMinor);
+ } else if (Request == RENDERRequest) {
+ render_decode_reply(fd, buf, RequestMinor);
+ } else if (Request == RANDRRequest) {
+ randr_decode_reply(fd, buf, RequestMinor);
+ } else if (Request == MITSHMRequest) {
+ mitshm_decode_reply(fd, buf, RequestMinor);
+ } else if (Request == BIGREQRequest) {
+ bigreq_decode_reply(fd, buf, RequestMinor);
+ } else {
+ warn("Extended reply opcode");
+ }
+}
+
+void
+ExtensionError (FD fd, const unsigned char *buf, short Error)
+{
+ if (Error == LBXError) {
+ lbx_decode_error(fd, buf);
+ } else if (Error == WCPError) {
+ wcp_decode_error(fd, buf);
+ } else if (Error >= RENDERError && Error < RENDERError + RENDERNError) {
+ render_decode_error(fd,buf);
+ } else if (Error == MITSHMError) {
+ mitshm_decode_error(fd, buf);
+ } else {
+ warn("Extended Error code");
+ }
+}
+
+void
+ExtensionEvent (FD fd, const unsigned char *buf, short Event)
+{
+ if (Event == LBXEvent) {
+ lbx_decode_event (fd, buf);
+ } else if (Event == RANDREvent) {
+ randr_decode_event (fd, buf);
+ } else if (Event == MITSHMEvent) {
+ mitshm_decode_event (fd, buf);
+ } else {
+ warn("Extended Event code");
+ }
+}
diff --git a/extensions.h b/extensions.h
new file mode 100644
index 0000000..18107e8
--- /dev/null
+++ b/extensions.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, provided that the above
+ * copyright notice(s) and this permission notice appear in all copies of
+ * the Software and that both the above copyright notice(s) and this
+ * permission notice appear in supporting documentation.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+ * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR 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 SOFTWARE.
+ *
+ * Except as contained in this notice, the name of a copyright holder
+ * shall not be used in advertising or otherwise to promote the sale, use
+ * or other dealings in this Software without prior written authorization
+ * of the copyright holder.
+ */
+
+#ifndef XSCOPE_EXTENSIONS_H
+#define XSCOPE_EXTENSIONS_H
+
+#include "scope.h"
+
+#define EXTENSION_MIN 128 /* lowest possible extension request code */
+#define EXTENSION_MAX 255 /* highest possible extension request code */
+#define NUM_EXTENSIONS 128 /* maximum possible number of extensions */
+
+/* special processing in extensions.c to capture extension info */
+extern void ProcessQueryExtensionRequest(long seq, const unsigned char *buf);
+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);
+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 */
+#define extension_decode_prototypes(ext) \
+ extern void ext##_decode_req (FD fd, const unsigned char *buf); \
+ extern void ext##_decode_reply (FD fd, const unsigned char *buf, \
+ short RequestMinor); \
+ extern void ext##_decode_error (FD fd, const unsigned char *buf); \
+ extern void ext##_decode_event (FD fd, const unsigned char *buf)
+
+extension_decode_prototypes(bigreq);
+extension_decode_prototypes(lbx);
+extension_decode_prototypes(mitshm);
+extension_decode_prototypes(randr);
+extension_decode_prototypes(render);
+extension_decode_prototypes(wcp);
+
+extern void InitializeBIGREQ (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);
+
+#endif /* XSCOPE_EXTENSIONS_H */
diff --git a/lbxscope.h b/lbxscope.h
index 6daee15..cf2d5e2 100644
--- a/lbxscope.h
+++ b/lbxscope.h
@@ -39,7 +39,6 @@ SOFTWARE.
#define printfield(a,b,c,d,e) if (Verbose > 1) PrintField(a,b,c,d,e)
-extern unsigned char LookForLBXFlag;
extern unsigned char LBXRequest;
extern unsigned char LBXError;
extern unsigned char LBXEvent;
diff --git a/print11.c b/print11.c
index 63de109..78abce0 100644
--- a/print11.c
+++ b/print11.c
@@ -54,12 +54,6 @@
#include "scope.h"
#include "x11.h"
-#include "bigreqscope.h"
-#include "lbxscope.h"
-#include "randrscope.h"
-#include "renderscope.h"
-#include "shmscope.h"
-#include "wcpscope.h"
static void PrintFailedSetUpReply(const unsigned char *buf);
static void PrintSuccessfulSetUpReply(const unsigned char *buf);
@@ -3500,25 +3494,6 @@ void
QueryExtensionReply (
const unsigned char *buf)
{
- if (LookForLBXFlag) {
- InitializeLBX(buf);
- LookForLBXFlag = 0;
- }
- if (LookForWCPFlag) {
- InitializeWCP(buf);
- }
- if (LookForRENDERFlag) {
- InitializeRENDER(buf);
- }
- if (LookForRANDRFlag) {
- InitializeRANDR(buf);
- }
- if (LookForMITSHMFlag) {
- InitializeMITSHM(buf);
- }
- if (LookForBIGREQFlag) {
- InitializeBIGREQ(buf);
- }
PrintField(RBf, 0, 1, REPLY, REPLYHEADER) /* QueryExtension */ ;
if (Verbose < 1)
return;
diff --git a/proto.h b/proto.h
index 232c6ee..0d1e610 100644
--- a/proto.h
+++ b/proto.h
@@ -22,28 +22,6 @@ 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);
-/* X11 Extension decoders in decode_*.c */
-#define extension_decode_prototypes(ext) \
- extern void ext##_decode_req (FD fd, const unsigned char *buf); \
- extern void ext##_decode_reply (FD fd, const unsigned char *buf, \
- short RequestMinor); \
- extern void ext##_decode_error (FD fd, const unsigned char *buf); \
- extern void ext##_decode_event (FD fd, const unsigned char *buf)
-
-extension_decode_prototypes(bigreq);
-extension_decode_prototypes(lbx);
-extension_decode_prototypes(mitshm);
-extension_decode_prototypes(randr);
-extension_decode_prototypes(render);
-extension_decode_prototypes(wcp);
-
-extern void InitializeBIGREQ (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);
-
/* print11.c */
extern void PrintSetUpMessage (const unsigned char *buf);
extern void PrintSetUpReply (const unsigned char *buf);
diff --git a/randrscope.h b/randrscope.h
index 94f3fc1..5b63b06 100644
--- a/randrscope.h
+++ b/randrscope.h
@@ -12,7 +12,6 @@
#define printfield(a,b,c,d,e) if (Verbose > 1) PrintField(a,b,c,d,e)
-extern unsigned char LookForRANDRFlag;
extern unsigned char RANDRRequest;
extern unsigned char RANDREvent;
diff --git a/renderscope.h b/renderscope.h
index 17fc226..201e339 100644
--- a/renderscope.h
+++ b/renderscope.h
@@ -12,7 +12,6 @@
#define printfield(a,b,c,d,e) if (Verbose > 1) PrintField(a,b,c,d,e)
-extern unsigned char LookForRENDERFlag;
extern unsigned char RENDERRequest;
extern unsigned char RENDERError;
#define RENDERNError 5
diff --git a/scope.h b/scope.h
index 7a1f97e..a0a536d 100644
--- a/scope.h
+++ b/scope.h
@@ -53,6 +53,9 @@
*
********************************************** */
+#ifndef XSCOPE_SCOPE_H
+#define XSCOPE_SCOPE_H
+
#include <X11/Xos.h>
#include <X11/Xfuncs.h>
#include <stdio.h>
@@ -130,3 +133,4 @@ extern char ScopeEnabled;
extern long TranslateText;
+#endif /* XSCOPE_SCOPE_H */
diff --git a/shmscope.h b/shmscope.h
index 412e51d..6d56f4c 100644
--- a/shmscope.h
+++ b/shmscope.h
@@ -12,7 +12,6 @@
#define printfield(a,b,c,d,e) if (Verbose > 1) PrintField(a,b,c,d,e)
-extern unsigned char LookForMITSHMFlag;
extern unsigned char MITSHMRequest;
extern unsigned char MITSHMError;
extern unsigned char MITSHMEvent;
diff --git a/wcpscope.h b/wcpscope.h
index 2e92843..6556f6f 100644
--- a/wcpscope.h
+++ b/wcpscope.h
@@ -37,7 +37,6 @@
#define printfield(a,b,c,d,e) if (Verbose > 1) PrintField(a,b,c,d,e)
-extern unsigned char LookForWCPFlag;
extern unsigned char WCPRequest;
extern unsigned char WCPError;