Is there a maintainer for proto/trapproto, lib/libXTrap, app/xtrap, and Xorg XTRAP extension?

Peter Breitenlohner peb at mppmu.mpg.de
Wed Nov 12 03:23:59 PST 2008


On Tue, 11 Nov 2008, Adam Jackson wrote:

> On Tue, 2008-11-11 at 16:25 +0100, Peter Breitenlohner wrote:
>
>> I could prepare patches for the items 3.1. and 3.2. from my list, but would
>> need someone to review and apply them. Would you?
>
> Sure.

Thanks, see below

>> Is there a way to move a file between modules while preserving the original
>> author (git blame) of that file?
>
> Not that I'm aware of.  But for this case I'm not too worried about it.

OK, I have removed trailing whitespece from these files.

Attached are two patches for trapproto (000[12]-trapproto-*), three patches
for libXTrap (000[123]-libXTrap-*), and and two patches for xtrap
(000[12]-xtrap-*).

Please review them and, if you agree, apply them.

Some comments:

(1) a new branch trapproto-3.4.4 and corresponding tarballs are required
after 0001-trapproto-* (or maybe after 0002-trapproto-*, depending on Xorg
policies).  Similarly, a new branch libXTrap-1.0.1 and corresponding
tarballs are required after 0003-libXTrap-*

(2) I have left xtrapddmi.h in trapproto, this allows to build xorg-servers
<= 1.5.2 with trapproto >= 3.4.4 (less conflicts at no extra cost).

(3) I have replaced 'git-log' by 'git log' as required by git-1.6.x.
This should eventually be provided by xorg-macros-1.2.0, but may be needed
right now for 'make dist'.

(4) I have compiled libXTrap and xtrap with these gcc flags
 	-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes
 	-Wmissing-declarations -Wnested-externs -fno-strict-aliasing
 	-Wold-style-definition -Wbad-function-cast -Wdeclaration-after-statement
they produce no warnings.

(5) With XTrap being deleted from xorg-server-1.5.3 and git master, wouldn't
it be nice to have example programs demonstrating how to achieve the
functionality of the app/xtrap programs with Record+Test?

Regards,
Peter Breitenlohner <peb at mppmu.mpg.de>
-------------- next part --------------
From 04dece841a2539465fb56834d523737533f46055 Mon Sep 17 00:00:00 2001
From: Peter Breitenlohner <peb at mppmu.mpg.de>
Date: Tue, 11 Nov 2008 17:40:01 +0100
Subject: [PATCH] prepare for reorganization of xtrap headers

move declaration of void_function from xtrapdi.h to xtraplib.h and xtrapddmi.h
move declaration of int_function from xtrapdi.h to xtrapddmi.h

replace 'git-log' by 'git log' as required by git-1.6.x

Version 3.4.4
---
 Makefile.am  |    2 +-
 configure.ac |    2 +-
 xtrapddmi.h  |    3 +++
 xtrapdi.h    |    3 ---
 xtraplib.h   |    2 ++
 5 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 3fd33be..ded6dcd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -19,6 +19,6 @@ MAINTAINERCLEANFILES = ChangeLog
 .PHONY: ChangeLog
 
 ChangeLog:
-	(GIT_DIR=$(top_srcdir)/.git git-log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2)
+	(GIT_DIR=$(top_srcdir)/.git git log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2)
 
 dist-hook: ChangeLog
diff --git a/configure.ac b/configure.ac
index e85e357..a9539c5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
 AC_PREREQ([2.57])
-AC_INIT([TrapProto], [3.4.3], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
+AC_INIT([TrapProto], [3.4.4], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 
 XORG_RELEASE_VERSION
diff --git a/xtrapddmi.h b/xtrapddmi.h
index c187a3a..783a406 100644
--- a/xtrapddmi.h
+++ b/xtrapddmi.h
@@ -46,6 +46,9 @@ SOFTWARE.
 #include <X11/extensions/xtrapbits.h>
 #include "dix.h"
 
+typedef int  (*int_function)();
+typedef void (*void_function)();
+
 #ifndef MIN
 # define MIN(a,b) ((a) < (b) ? (a) : (b))
 #endif
diff --git a/xtrapdi.h b/xtrapdi.h
index d58b907..34aa94c 100644
--- a/xtrapdi.h
+++ b/xtrapdi.h
@@ -80,9 +80,6 @@ SOFTWARE.
 # define False 0L
 #endif
 
-typedef int  (*int_function)();
-typedef void (*void_function)();
-
 /* This is used as flags to indicate desired request traps
  * Note:  This has been padded to a CARD32 to keep structure aligned
  */
diff --git a/xtraplib.h b/xtraplib.h
index f3f273a..50cb3c2 100644
--- a/xtraplib.h
+++ b/xtraplib.h
@@ -52,6 +52,8 @@ SOFTWARE.
 #include <X11/extensions/xtrapdi.h>
 #include <X11/extensions/xtrapemacros.h>
 
+typedef void (*void_function)();
+
 typedef struct  /* Callback structure */
 {
     void_function func;
-- 
1.6.0.3

-------------- next part --------------
From 0a1dc0fd822b3618fbad0c7e33bec8ac81b20ebe Mon Sep 17 00:00:00 2001
From: Peter Breitenlohner <peb at mppmu.mpg.de>
Date: Wed, 12 Nov 2008 11:02:38 +0100
Subject: [PATCH] Remove xtrapemacros.h, xtraplib.h, and xtraplibp.h

These files are now part of libXTrap; they only belong to libXTrap and
should not be part of the protocol headers. For future revisions of
these files refer to git://anongit.freedesktop.org/git/xorg/lib/libXTrap

Similarly, xtrapddmi.h only belongs to the (now defunct) XTrap extension
of the Xorg server, but is kept here for the benefit of versions <= 1.5.2
---
 Makefile.am    |    3 -
 xtrapemacros.h |  387 --------------------------------------------------------
 xtraplib.h     |  130 -------------------
 xtraplibp.h    |  144 ---------------------
 4 files changed, 0 insertions(+), 664 deletions(-)
 delete mode 100644 xtrapemacros.h
 delete mode 100644 xtraplib.h
 delete mode 100644 xtraplibp.h

diff --git a/Makefile.am b/Makefile.am
index ded6dcd..5115233 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,9 +3,6 @@ trap_HEADERS = \
 	xtrapbits.h \
 	xtrapddmi.h \
 	xtrapdi.h \
-	xtrapemacros.h \
-	xtraplib.h \
-	xtraplibp.h \
 	xtrapproto.h
 
 pkgconfigdir = $(libdir)/pkgconfig
diff --git a/xtrapemacros.h b/xtrapemacros.h
deleted file mode 100644
index f59ea33..0000000
--- a/xtrapemacros.h
+++ /dev/null
@@ -1,387 +0,0 @@
-/* $XFree86: xc/include/extensions/xtrapemacros.h,v 1.1 2001/11/02 23:29:26 dawes Exp $ */
-#ifndef __XTRAPEMACROS__
-#define __XTRAPEMACROS__ "@(#)xtrapemacros.h	1.9 - 90/09/18  "
-
-/*****************************************************************************
-Copyright 1987, 1988, 1989, 1990, 1991, 1994 by Digital Equipment Corp., 
-Maynard, MA
-
-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 
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.  
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL 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
-SOFTWARE.
-
-*****************************************************************************/
-/*
- *
- *  CONTRIBUTORS:
- *
- *      Dick Annicchiarico
- *      Robert Chesler
- *      Dan Coutu
- *      Gene Durso
- *      Marc Evans
- *      Alan Jamison
- *      Mark Henry
- *      Ken Miller
- *
- *  DESCRIPTION:
- *      This include file is designed to provide the *visible* 
- *      interface to XTrap data structures.  Fields can be set
- *      using these macros by client programs unless otherwise
- *      specified; however, use of Trap Context convenience
- *      routines is strongly encouraged (XETrapContext.c)
- */
-#include <X11/extensions/xtrapbits.h>
-#include <signal.h>
-
-/* msleep macro to replace msleep() for portability reasons */
-#define msleep(m)   usleep((m)*1000)
-
-/* Copying TC's assumes that the new TC must be created */
-#define XECopyTC(src,mask,dest) \
-    (dest = XECreateTC(((src)->dpy), (mask), (&((src)->values))))
-
-/* Expands to SET each element of the TCValues structure
- * Returns the TCValues Mask so that the Set can be entered
- * as an argument to the XEChangeTC() routine call
- */
-/* Note: req_cb & evt_cb would only be used if you wanted to
- *       *share* callbacks between Trap Contexts.  Normally,
- *       XEAddRequestCB() and XEAddEventCB() would be used.
- */
-#define XETrapSetCfgReqCB(tcv,x)      ((tcv)->req_cb = (x))
-#define XETrapSetCfgEvtCB(tcv,x)      ((tcv)->evt_cb = (x))
-#define XETrapSetCfgMaxPktSize(tcv,x) ((tcv)->v.max_pkt_size = (x))
-#define XETrapSetCfgCmdKey(tcv,x)     ((tcv)->v.cmd_key = (x))
-/* Note: e is only pertinent for "valid" or "data" */
-#define XETrapSetCfgFlags(tcv,e,a)    \
-    memcpy((tcv)->v.flags.e, (a), sizeof((tcv)->v.flags.e))
-#define XETrapSetCfgFlagTimestamp(tcv,e,x) \
-    BitSet((tcv)->v.flags.e, XETrapTimestamp, (x))
-#define XETrapSetCfgFlagCmd(tcv,e,x) \
-    BitSet((tcv)->v.flags.e, XETrapCmd, (x))
-#define XETrapSetCfgFlagCmdKeyMod(tcv,e,x) \
-    BitSet((tcv)->v.flags.e, XETrapCmdKeyMod, (x))
-#define XETrapSetCfgFlagRequest(tcv,e,x) \
-    BitSet((tcv)->v.flags.e, XETrapRequest, (x))
-#define XETrapSetCfgFlagEvent(tcv,e,x) \
-    BitSet((tcv)->v.flags.e, XETrapEvent, (x))
-#define XETrapSetCfgFlagMaxPacket(tcv,e,x) \
-    BitSet((tcv)->v.flags.e, XETrapMaxPacket, (x))
-#define XETrapSetCfgFlagStatistics(tcv,e,x) \
-    BitSet((tcv)->v.flags.e, XETrapStatistics, (x))
-#define XETrapSetCfgFlagWinXY(tcv,e,x) \
-    BitSet((tcv)->v.flags.e, XETrapWinXY, (x))
-#define XETrapSetCfgFlagCursor(tcv,e,x) \
-    BitSet((tcv)->v.flags.e, XETrapCursor, (x))
-#define XETrapSetCfgFlagReq(tcv,request,x) \
-    BitSet((tcv)->v.flags.req, (request), (x))
-#define XETrapSetCfgFlagXInput(tcv,e,x) \
-    BitSet((tcv)->v.flags.e, XETrapXInput, (x))
-#define XETrapSetCfgFlagColorReplies(tcv,e,x) \
-    BitSet((tcv)->v.flags.e, XETrapColorReplies, (x))
-#define XETrapSetCfgFlagGrabServer(tcv,e,x) \
-    BitSet((tcv)->v.flags.e, XETrapGrabServer, (x))
-#define XETrapSetCfgFlagEvt(tcv,evt,x) \
-    BitSet((tcv)->v.flags.event, (evt), (x))
-
-#define XETrapSetValFlagDeltaTimes(tcv,x) \
-    BitSet((tcv)->tc_flags, XETCDeltaTimes, (x))
-
-/* Fields returned in the "GetAvailable" request */
-#define XETrapGetAvailPFIdent(avail)      ((avail)->pf_ident)
-#define XETrapGetAvailRelease(avail)      ((avail)->xtrap_release)
-#define XETrapGetAvailVersion(avail)      ((avail)->xtrap_version)
-#define XETrapGetAvailRevision(avail)     ((avail)->xtrap_revision)
-#define XETrapGetAvailMaxPktSize(avail)   ((avail)->max_pkt_size)
-#define XETrapGetAvailFlags(avail,a)  \
-    memcpy((a), (avail)->valid, sizeof((avail)->valid))
-#define XETrapGetAvailFlagTimestamp(avail) \
-    (BitValue((avail)->valid, XETrapTimestamp))
-#define XETrapGetAvailFlagCmd(avail) \
-    (BitValue((avail)->valid, XETrapCmd))
-#define XETrapGetAvailFlagCmdKeyMod(avail) \
-    (BitValue((avail)->valid, XETrapCmdKeyMod))
-#define XETrapGetAvailFlagRequest(avail) \
-    (BitValue((avail)->valid, XETrapRequest))
-#define XETrapGetAvailFlagEvent(avail) \
-    (BitValue((avail)->valid, XETrapEvent))
-#define XETrapGetAvailFlagMaxPacket(avail) \
-    (BitValue((avail)->valid, XETrapMaxPacket))
-#define XETrapGetAvailFlagStatistics(avail) \
-    (BitValue((avail)->valid, XETrapStatistics))
-#define XETrapGetAvailFlagWinXY(avail) \
-    (BitValue((avail)->valid, XETrapWinXY))
-#define XETrapGetAvailFlagCursor(avail) \
-    (BitValue((avail)->valid, XETrapCursor))
-#define XETrapGetAvailFlagXInput(avail) \
-    (BitValue((avail)->valid, XETrapXInput))
-#define XETrapGetAvailFlagVecEvt(avail) \
-    (BitValue((avail)->valid, XETrapVectorEvents))
-#define XETrapGetAvailFlagColorReplies(avail) \
-    (BitValue((avail)->valid, XETrapColorReplies))
-#define XETrapGetAvailFlagGrabServer(avail) \
-    (BitValue((avail)->valid, XETrapGrabServer))
-#define XETrapGetAvailOpCode(avail)         ((avail)->major_opcode)
-/* Macro's for creating current request and trap context macros */
-#define XETrapGetCfgMaxPktSize(cfg) ((cfg)->max_pkt_size)
-#define XETrapGetCfgCmdKey(cfg)     ((cfg)->cmd_key)
-#define XETrapGetCfgFlags(cfg,e,a)  \
-    memcpy((a), (cfg)->flags.e, sizeof((cfg)->flags.e))
-#define XETrapGetCfgFlagTimestamp(cfg,e) \
-    (BitValue((cfg)->flags.e, XETrapTimestamp))
-#define XETrapGetCfgFlagCmd(cfg,e) \
-    (BitValue((cfg)->flags.e, XETrapCmd))
-#define XETrapGetCfgFlagCmdKeyMod(cfg,e) \
-    (BitValue((cfg)->flags.e, XETrapCmdKeyMod))
-#define XETrapGetCfgFlagRequest(cfg,e) \
-    (BitValue((cfg)->flags.e, XETrapRequest))
-#define XETrapGetCfgFlagEvent(cfg,e) \
-    (BitValue((cfg)->flags.e, XETrapEvent))
-#define XETrapGetCfgFlagMaxPacket(cfg,e) \
-    (BitValue((cfg)->flags.e, XETrapMaxPacket))
-#define XETrapGetCfgFlagStatistics(cfg,e) \
-    (BitValue((cfg)->flags.e, XETrapStatistics))
-#define XETrapGetCfgFlagWinXY(cfg,e) \
-    (BitValue((cfg)->flags.e, XETrapWinXY))
-#define XETrapGetCfgFlagCursor(cfg,e) \
-    (BitValue((cfg)->flags.e, XETrapCursor))
-#define XETrapGetCfgFlagXInput(cfg,e) \
-    (BitValue((cfg)->flags.e, XETrapXInput))
-#define XETrapGetCfgFlagColorReplies(cfg,e) \
-    (BitValue((cfg)->flags.e, XETrapColorReplies))
-#define XETrapGetCfgFlagGrabServer(cfg,e) \
-    (BitValue((cfg)->flags.e, XETrapGrabServer))
-/* Request values are in "Xproto.h" of the flavor X_RequestType */
-#define XETrapGetCfgFlagReq(cfg,request) \
-    (BitValue((cfg)->flags.req, (request)))
-/* Event types are in "X.h" of the flavor EventType (e.g. KeyPress) */
-#define XETrapGetCfgFlagEvt(cfg,evt) \
-    (BitValue((cfg)->flags.event, (evt)))
-
-/* Fields returned int the "GetCurrent" Request */
-#define XETrapGetCurX(avail)              ((avail)->cur_x)
-#define XETrapGetCurY(avail)              ((avail)->cur_y)
-#define XETrapGetCurSFlags(cur,a) \
-    memcpy((a), (cur)->state_flags, sizeof((cur)->state_flags))
-#define XETrapGetCurMaxPktSize(cur) (XETrapGetCfgMaxPktSize(&((cur)->config)))
-#define XETrapGetCurCmdKey(cur)     (XETrapGetCfgCmdKey(&((cur)->config)))
-/* Note: e is only pertinent for "valid" or "data" */
-#define XETrapGetCurCFlags(cur,e,a) (XETrapGetCfgFlags(&((cur)->config),e,a))
-#define XETrapGetCurFlagTimestamp(cur,e) \
-    (XETrapGetCfgFlagTimestamp(&((cur)->config),e))
-#define XETrapGetCurFlagCmd(cur,e)  (XETrapGetCfgFlagCmd(&((cur)->config),e))
-#define XETrapGetCurFlagCmdKeyMod(cur,e) \
-    (XETrapGetCfgFlagCmdKeyMod(&((cur)->config),e))
-#define XETrapGetCurFlagRequest(cur,r) \
-    (XETrapGetCfgFlagRequest(&((cur)->config),r))
-#define XETrapGetCurFlagEvent(cur,e) \
-    (XETrapGetCfgFlagEvent(&((cur)->config),e))
-#define XETrapGetCurFlagMaxPacket(cur,e) \
-    (XETrapGetCfgFlagMaxPacket(&((cur)->config),e))
-#define XETrapGetCurFlagStatistics(cur,e) \
-    (XETrapGetCfgFlagStatistics(&((cur)->config),e))
-#define XETrapGetCurFlagWinXY(cur,e) \
-    (XETrapGetCfgFlagWinXY(&((cur)->config),e))
-#define XETrapGetCurFlagCursor(cur,e) \
-    (XETrapGetCfgFlagCursor(&((cur)->config),e))
-#define XETrapGetCurFlagXInput(cur,e) \
-    (XETrapGetCfgFlagXInput(&((cur)->config),e))
-#define XETrapGetCurFlagColorReplies(cur,e) \
-    (XETrapGetCfgFlagColorReplies(&((cur)->config),e))
-#define XETrapGetCurFlagGrabServer(cur,e) \
-    (XETrapGetCfgFlagGrabServer(&((cur)->config),e))
-/* Request values are in "Xproto.h" of the flavor X_RequestType */
-#define XETrapGetCurFlagReq(cur,r)  (XETrapGetCfgFlagReq(&((cur)->config),r))
-/* Event types are in "X.h" of the flavor EventType (e.g. KeyPress) */
-#define XETrapGetCurFlagEvt(cur,e)  (XETrapGetCfgFlagEvt(&((cur)->config),e))
-
-/* Fields returned int the "GetStatistics" Request */
-#define XETrapGetStatsReq(stat,e)   ((stat)->requests[(e)])
-#define XETrapGetStatsEvt(stat,e)   ((stat)->events[(e)])
-
-/* Fields returned in the "GetVersion" request */
-#define XETrapGetVersRelease(vers)      ((vers)->xtrap_release)
-#define XETrapGetVersVersion(vers)      ((vers)->xtrap_version)
-#define XETrapGetVersRevision(vers)     ((vers)->xtrap_revision)
-
-/* Fields returned in the "GetLastInpTime" request */
-#define XETrapGetLastInpTime(time_rep)      ((time_rep)->last_time)
-
-/* Expands to GET each element of the TCValues structure */
-#define XETrapGetTCReqCB(tc)      ((tc)->values.req_cb)
-#define XETrapGetTCEvtCB(tc)      ((tc)->values.evt_cb)
-#define XETrapGetTCTime(tc)       ((tc)->values.last_time)
-/* TC specific flags */
-#define XETrapGetTCLFlags(tc,a)  \
-    memcpy((a), (tc)->values.tc_flags, sizeof((tc)->values.tc_flags))
-#define XETrapGetTCFlagDeltaTimes(tc) \
-    (BitValue((tc)->values.tc_flags, XETCDeltaTimes))
-#define XETrapGetTCFlagTrapActive(tc) \
-    (BitValue((tc)->values.tc_flags, XETCTrapActive))
-#define XETrapGetTCMaxPktSize(tc) (XETrapGetCfgMaxPktSize(&((tc)->values.v)))
-#define XETrapGetTCCmdKey(tc)     (XETrapGetCfgCmdKey(&((tc)->values.v)))
-/* Note: e is only pertinent for "valid" or "data" */
-#define XETrapGetTCFlags(tc,e,a)  (XETrapGetCfgFlags(&((tc)->values.v),e,a))
-#define XETrapGetTCFlagTimestamp(tc,e) \
-    (XETrapGetCfgFlagTimestamp(&((tc)->values.v),e))
-#define XETrapGetTCFlagCmd(tc,e) \
-    (XETrapGetCfgFlagCmd(&((tc)->values.v),e))
-#define XETrapGetTCFlagCmdKeyMod(tc,e) \
-    (XETrapGetCfgFlagCmdKeyMod(&((tc)->values.v),e))
-#define XETrapGetTCFlagRequest(tc,r) \
-    (XETrapGetCfgFlagRequest(&((tc)->values.v),r))
-#define XETrapGetTCFlagEvent(tc,e) \
-    (XETrapGetCfgFlagEvent(&((tc)->values.v),e))
-#define XETrapGetTCFlagMaxPacket(tc,e) \
-    (XETrapGetCfgFlagMaxPacket(&((tc)->values.v),e))
-#define XETrapGetTCFlagStatistics(tc,e) \
-    (XETrapGetCfgFlagStatistics(&((tc)->values.v),e))
-#define XETrapGetTCFlagWinXY(tc,e) \
-    (XETrapGetCfgFlagWinXY(&((tc)->values.v),e))
-#define XETrapGetTCFlagCursor(tc,e) \
-    (XETrapGetCfgFlagCursor(&((tc)->values.v),e))
-#define XETrapGetTCFlagXInput(tc,e) \
-    (XETrapGetCfgFlagXInput(&((tc)->values.v),e))
-#define XETrapGetTCFlagColorReplies(tc,e) \
-    (XETrapGetCfgFlagColorReplies(&((tc)->values.v),e))
-#define XETrapGetTCFlagGrabServer(tc,e) \
-    (XETrapGetCfgFlagGrabServer(&((tc)->values.v),e))
-/* Request values are in "Xproto.h" of the flavor X_RequestType */
-#define XETrapGetTCFlagReq(tc,r) \
-    (XETrapGetCfgFlagReq(&((tc)->values.v),r))
-/* Event types are in "X.h" of the flavor EventType (e.g. KeyPress) */
-#define XETrapGetTCFlagEvt(tc,e) \
-    (XETrapGetCfgFlagEvt(&((tc)->values.v),e))
-/* The following can/should *not* be set directly! */
-#define XETrapGetNext(tc)        ((tc)->next)
-#define XETrapGetDpy(tc)         ((tc)->dpy)
-#define XETrapGetEventBase(tc)   ((tc)->eventBase)
-#define XETrapGetErrorBase(tc)   ((tc)->errorBase)
-#define XETrapGetExtOpcode(tc)   ((tc)->extOpcode)
-#define XETrapGetXBuff(tc)       ((tc)->xbuff)
-#define XETrapGetXMaxSize(tc)    ((tc)->xmax_size)
-#define XETrapGetExt(tc)         ((tc)->ext_data)
-#define XETrapGetDirty(tc)       ((tc)->dirty)
-#define XETrapGetValues(tc)      memcpy((x),(tc)->values,sizeof((tc)->values))
-#define XETrapGetEventFunc(tc)   ((tc)->eventFunc)
-
-#define XETrapGetHeaderCount(phdr)      ((phdr)->count)
-#define XETrapGetHeaderTimestamp(phdr)  ((phdr)->timestamp)
-#define XETrapGetHeaderType(phdr)       ((phdr)->type)
-#define XETrapGetHeaderScreen(phdr)     ((phdr)->screen)
-#define XETrapGetHeaderWindowX(phdr)    ((phdr)->win_x)
-#define XETrapGetHeaderWindowY(phdr)    ((phdr)->win_y)
-#define XETrapGetHeaderClient(phdr)     ((phdr)->client)
-
-#define XEGetRelease(tc)        ((tc)->release)
-#define XEGetVersion(tc)        ((tc)->version)
-#define XEGetRevision(tc)       ((tc)->revision)
-
-/*  Condition handling macros */
-#if !defined(vms) && \
-    (!defined(_InitExceptionHandling) || !defined(_ClearExceptionHandling))
-# ifndef _SetSIGBUSHandling
-#  ifdef SIGBUS
-#   define _SetSIGBUSHandling(rtn)  (void)signal(SIGBUS, rtn)
-#  else
-#   define _SetSIGBUSHandling(rtn)  /* */
-#  endif
-# endif
-# ifndef _SetSIGSEGVHandling
-#  ifdef SIGSEGV
-#   define _SetSIGSEGVHandling(rtn) (void)signal(SIGSEGV, rtn)
-#  else
-#   define _SetSIGSEGVHandling(rtn) /* */
-#  endif
-# endif
-# ifndef _SetSIGFPEHandling
-#  ifdef SIGFPE
-#   define _SetSIGFPEHandling(rtn)  (void)signal(SIGFPE, rtn)
-#  else
-#   define _SetSIGFPEHandling(rtn)  /* */
-#  endif
-# endif
-# ifndef _SetSIGILLHandling
-#  ifdef SIGILL
-#   define _SetSIGILLHandling(rtn)  (void)signal(SIGILL, rtn)
-#  else
-#   define _SetSIGILLHandling(rtn)  /* */
-#  endif
-# endif
-# ifndef _SetSIGSYSHandling
-#  ifdef SIGSYS
-#   define _SetSIGSYSHandling(rtn)  (void)signal(SIGSYS, rtn)
-#  else
-#   define _SetSIGSYSHandling(rtn)  /* */
-#  endif
-# endif
-# ifndef _SetSIGHUPHandling
-#  ifdef SIGHUP
-#   define _SetSIGHUPHandling(rtn)  (void)signal(SIGHUP, rtn)
-#  else
-#   define _SetSIGHUPHandling(rtn)  /* */
-#  endif
-# endif
-# ifndef _SetSIGPIPEHandling
-#  ifdef SIGPIPE
-#   define _SetSIGPIPEHandling(rtn) (void)signal(SIGPIPE, rtn)
-#  else
-#   define _SetSIGPIPEHandling(rtn) /* */
-#  endif
-# endif
-# ifndef _SetSIGTERMHandling
-#  ifdef SIGTERM
-#   define _SetSIGTERMHandling(rtn) (void)signal(SIGTERM, rtn)
-#  else
-#   define _SetSIGTERMHandling(rtn) /* */
-#  endif
-# endif
-#endif
-#ifndef _InitExceptionHandling
-#ifdef vms
-#define _InitExceptionHandling(rtn)                        \
-    VAXC$ESTABLISH(rtn)   /* VMS exception handler */
-#else /* vms */
-#define _InitExceptionHandling(rtn)                           \
-    _SetSIGBUSHandling(rtn);  /* Bus error */                 \
-    _SetSIGSEGVHandling(rtn); /* Accvio/Segment error */      \
-    _SetSIGFPEHandling(rtn);  /* Floating point exception */  \
-    _SetSIGILLHandling(rtn);  /* Illegal instruction */       \
-    _SetSIGSYSHandling(rtn);  /* Param error in sys call */   \
-    _SetSIGHUPHandling(rtn);                                  \
-    _SetSIGPIPEHandling(rtn);                                 \
-    _SetSIGTERMHandling(rtn)
-#endif /* vms */
-#endif /* _InitExceptionHandling */
-
-#ifndef _ClearExceptionHandling
-#ifdef vms
-#define _ClearExceptionHandling() \
-    LIB$REVERT()
-#else
-#define _ClearExceptionHandling() \
-    _SetSIGBUSHandling(SIG_DFL);   /* Bus error */                 \
-    _SetSIGSEGVHandling(SIG_DFL);  /* Accvio/Segment error */      \
-    _SetSIGFPEHandling(SIG_DFL);   /* Floating point exception */  \
-    _SetSIGILLHandling(SIG_DFL);   /* Illegal instruction */       \
-    _SetSIGSYSHandling(SIG_DFL);   /* Param error in sys call */   \
-    _SetSIGHUPHandling(SIG_DFL);                                   \
-    _SetSIGPIPEHandling(SIG_DFL);                                  \
-    _SetSIGTERMHandling(SIG_DFL)
-#endif /* vms */
-#endif /* _ClearExceptionHandling */
-
-#endif /* __XTRAPEMACROS__ */
diff --git a/xtraplib.h b/xtraplib.h
deleted file mode 100644
index 50cb3c2..0000000
--- a/xtraplib.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/* $XFree86$ */
-#ifndef __XTRAPLIB__
-#define __XTRAPLIB__ 
-
-
-/*****************************************************************************
-Copyright 1987, 1988, 1989, 1990, 1991, 1994 by Digital Equipment Corp., 
-Maynard, MA
-
-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 
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.  
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL 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
-SOFTWARE.
-
-*****************************************************************************/
-/*
- *
- *  CONTRIBUTORS:
- *
- *      Dick Annicchiarico
- *      Robert Chesler
- *      Dan Coutu
- *      Gene Durso
- *      Marc Evans
- *      Alan Jamison
- *      Mark Henry
- *      Ken Miller
- *
- *  DESCRIPTION:
- *      This header file describes all the structures/constants required
- *      for interfacing with the client toolkit *except* the common
- *      client/extension definitions in xtrapdi.h.  Namely, *no* extension-
- *      only information or client/extension information can be found here.
- */
-#ifdef SMT
-#define NEED_EVENTS
-#define NEED_REPLIES
-#endif
-#include <X11/Xlib.h>
-#include <X11/Intrinsic.h>
-#include <X11/extensions/xtrapdi.h>
-#include <X11/extensions/xtrapemacros.h>
-
-typedef void (*void_function)();
-
-typedef struct  /* Callback structure */
-{
-    void_function func;
-    BYTE          *data;
-} XETrapCB;
-
-/* Data structure for setting trap context */
-typedef struct
-{
-    CARD8       tc_flags[2L];  /* Toolkit-side specific flags */
-    XETrapCfg   v;             /* XTrap configuration values */
-    XETrapCB    *req_cb;       /* Pointer to Request Callbacks */
-    XETrapCB    *evt_cb;       /* Pointer to Event Callbacks (starting at 2) */
-    CARD32      last_time B32; /* Last (delta) timestamp */
-} XETCValues;
-
-    /* bits 0 thru 6 are formerly "families" (now obsolete) */
-#define XETCDeltaTimes             7
-#define XETCTrapActive             8
-    /* bits 9 thru 15 are reserved for future expansion */
-
-/* Values bit masks (used when determining what's dirty */
-#define TCStatistics               (1L<<0L)
-#define TCRequests                 (1L<<1L)
-#define TCEvents                   (1L<<2L)
-#define TCMaxPacket                (1L<<3L)
-#define TCCmdKey                   (1L<<4L)
-#define TCTimeStamps               (1L<<5L)
-#define TCWinXY                    (1L<<6L)
-#define TCXInput                   (1L<<7L)
-#define TCReqCBs                   (1L<<8L)
-#define TCEvtCBs                   (1L<<9L)
-#define TCCursor                   (1L<<10L)
-#define TCColorReplies             (1L<<11L)
-#define TCGrabServer               (1L<<12L)
-
-/* This is the representation we use in the library code for XLib transport */
-typedef struct {
-    int type;
-    unsigned long serial;
-    Bool synthetic;
-    Display *display;
-    int detail;
-    unsigned long idx;
-    unsigned char data[sz_EventData];
-} XETrapDataEvent;
-
-/* Trap Context structure for maintaining XTrap State for client */
-typedef struct _XETC 
-{
-    struct _XETC *next;         /* Ptr to next linked-listed TC */
-    Display      *dpy;          /* Display ptr of current TC */
-    INT32        eventBase /*B32*/; /* First event value */
-    INT32        errorBase /*B32*/; /* First error value */
-    INT32        extOpcode /*B32*/; /* Major opcode of the extension */
-    BYTE         *xbuff;        /* Pointer to buffer for XLib Communications */
-    CARD16       xmax_size /*B16*/; /* Max Size of a request */
-    XExtData     *ext_data;     /* hook for extension to hang data */
-    /* 
-     *  The following are initialized with the client-side version number
-     *  However, when either a GetAvailable or GetVersion reply is received,
-     *  these values are updated with the *oldest* version numbers.
-     */
-    CARD16       release /*B16*/;   /* The extension release number */
-    CARD16       version /*B16*/;   /* The xtrap extension version number */
-    CARD16       revision /*B16*/;  /* The xtrap extension revision number */
-    CARD16       protocol /*B16*/;  /* The xtrap extension protocol number */
-    unsigned     dirty /*B32*/;     /* cache dirty bits */
-    XETCValues   values;        /* shadow structure of values */
-    Boolean      (*eventFunc[XETrapNumberEvents])(XETrapDataEvent *event, struct _XETC *tc);
-} XETC;
-
-
-#endif /* __XTRAPLIB__ */
diff --git a/xtraplibp.h b/xtraplibp.h
deleted file mode 100644
index ff2042e..0000000
--- a/xtraplibp.h
+++ /dev/null
@@ -1,144 +0,0 @@
-/* $XFree86$ */
-#ifndef __XTRAPLIBP__
-#define __XTRAPLIBP__
-
-
-/*****************************************************************************
-Copyright 1987, 1988, 1989, 1990, 1991, 1994 by Digital Equipment Corp., 
-Maynard, MA
-
-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 
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.  
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL 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
-SOFTWARE.
-
-*****************************************************************************/
-/*
- *
- *  CONTRIBUTORS:
- *
- *      Dick Annicchiarico
- *      Robert Chesler
- *      Dan Coutu
- *      Gene Durso
- *      Marc Evans
- *      Alan Jamison
- *      Mark Henry
- *      Ken Miller
- *
- *  DESCRIPTION:
- *      This header file contains the function prototypes for client/toolkit
- *      routines sorted by module (globally defined routines *only*).
- */
-
-#include <stdio.h>
-
-/* XEConTxt.c */
-XETC *XECreateTC (Display *dpy , CARD32 valuemask , XETCValues *value );
-int XEChangeTC (XETC *tc , CARD32 mask , XETCValues *values );
-void XEFreeTC (XETC *tc );
-int XETrapSetMaxPacket (XETC *tc , Bool set_flag , CARD16 size );
-int XETrapSetCommandKey (XETC *tc , Bool set_flag , KeySym cmd_key , 
-    Bool mod_flag );
-int XETrapSetTimestamps (XETC *tc , Bool set_flag , Bool delta_flag );
-int XETrapSetWinXY (XETC *tc , Bool set_flag );
-int XETrapSetCursor (XETC *tc , Bool set_flag );
-int XETrapSetXInput (XETC *tc , Bool set_flag );
-int XETrapSetColorReplies (XETC *tc , Bool set_flag );
-int XETrapSetGrabServer (XETC *tc , Bool set_flag );
-int XETrapSetStatistics (XETC *tc , Bool set_flag );
-int XETrapSetRequests (XETC *tc , Bool set_flag , ReqFlags requests );
-int XETrapSetEvents (XETC *tc , Bool set_flag , EventFlags events );
-Bool XESetCmdGateState (XETC *tc , CARD8 type, Bool *gate_closed , 
-    CARD8 *next_key , Bool *key_ignore );
-
-/* XERqsts.c */
-int XEFlushConfig (XETC *tc );
-int XEResetRequest (XETC *tc );
-int XEGetVersionRequest (XETC *tc , XETrapGetVersRep *ret );
-int XEGetLastInpTimeRequest (XETC *tc , XETrapGetLastInpTimeRep *ret );
-int XEGetAvailableRequest (XETC *tc , XETrapGetAvailRep *ret );
-int XEStartTrapRequest (XETC *tc );
-int XEStopTrapRequest (XETC *tc );
-int XESimulateXEventRequest (XETC *tc , CARD8 type , CARD8 detail , 
-    CARD16 x , CARD16 y , CARD8 screen );
-int XEGetCurrentRequest (XETC *tc , XETrapGetCurRep *ret );
-int XEGetStatisticsRequest (XETC *tc , XETrapGetStatsRep *ret );
-
-/* XECallBcks.c */
-int XEAddRequestCB (XETC *tc , CARD8 req , void_function func , BYTE *data );
-int XEAddRequestCBs (XETC *tc , ReqFlags req_flags , void_function func , 
-    BYTE *data );
-int XEAddEventCB (XETC *tc , CARD8 evt , void_function func , BYTE *data );
-int XEAddEventCBs (XETC *tc , EventFlags evt_flags , void_function func , 
-    BYTE *data );
-
-/* The following seem to never be used.  Perhaps they should be removed */
-void XERemoveRequestCB (XETC *tc, CARD8 req);
-void XERemoveRequestCBs (XETC *tc, ReqFlags req_flags);
-void XERemoveAllRequestCBs (XETC *tc);
-void XERemoveEventCB (XETC *tc, CARD8 evt);
-void XERemoveEventCBs (XETC *tc, EventFlags evt_flags);
-void XERemoveAllEventCBs (XETC *tc);
-
-
-/* XEDsptch.c */
-Boolean XETrapDispatchXLib (XETrapDataEvent *event , XETC *tc);
-
-/* XEWrappers.c */
-Boolean XETrapDispatchEvent (XEvent *pevent , XETC *tc );
-XtInputMask XETrapAppPending (XtAppContext app);
-void XETrapAppMainLoop (XtAppContext app , XETC *tc );
-int XETrapAppWhileLoop (XtAppContext app , XETC *tc , Bool *done );
-int XETrapWaitForSomething (XtAppContext app );
-Boolean (*XETrapSetEventHandler(XETC *tc, CARD32 id, Boolean (*pfunc)(XETrapDataEvent *event, XETC *tc))) (XETrapDataEvent *event, XETC *tc);
-
-/* XEPrInfo.c */
-void XEPrintRelease (FILE *ofp , XETrapGetAvailRep *pavail );
-void XEPrintTkRelease ( FILE *ofp, XETC *tc);
-void XEPrintPlatform (FILE *ofp , XETrapGetAvailRep *pavail );
-void XEPrintAvailFlags (FILE *ofp , XETrapGetAvailRep *pavail );
-void XEPrintAvailPktSz (FILE *ofp , XETrapGetAvailRep *pavail );
-void XEPrintStateFlags (FILE *ofp , XETrapGetCurRep *pcur );
-void XEPrintMajOpcode (FILE *ofp , XETrapGetAvailRep *pavail );
-void XEPrintCurXY (FILE *ofp , XETrapGetAvailRep *pavail );
-void XEPrintTkFlags (FILE *ofp , XETC *tc );
-void XEPrintLastTime (FILE *ofp , XETC *tc );
-void XEPrintCfgFlags (FILE *ofp , XETrapGetCurRep *pcur );
-void XEPrintRequests (FILE *ofp , XETrapGetCurRep *pcur );
-void XEPrintEvents (FILE *ofp , XETrapGetCurRep *pcur );
-void XEPrintCurPktSz (FILE *ofp , XETrapGetCurRep *pcur );
-void XEPrintCmdKey (FILE *ofp , XETrapGetCurRep *pcur );
-void XEPrintEvtStats (FILE *ofp , XETrapGetStatsRep *pstats , XETC *tc);
-void XEPrintReqStats (FILE *ofp , XETrapGetStatsRep *pstats , XETC *tc);
-void XEPrintAvail (FILE *ofp , XETrapGetAvailRep *pavail );
-void XEPrintTkState (FILE *ofp , XETC *tc );
-void XEPrintCurrent (FILE *ofp , XETrapGetCurRep *pcur );
-void XEPrintStatistics (FILE *ofp , XETrapGetStatsRep *pstats, XETC *tc );
-
-/* XEStrMap.c */
-INT16 XEEventStringToID (char *string );
-INT16 XERequestStringToID (char *string );
-CARD32 XEPlatformStringToID (char *string );
-char *XEEventIDToString (CARD8 id , XETC *tc);
-char *XERequestIDToExtString (register CARD8 id , XETC *tc);
-char *XERequestIDToString (CARD8 id , XETC *tc);
-char *XEPlatformIDToString (CARD32 id );
-
-/* XETrapInit.c */
-Bool XETrapQueryExtension (Display *dpy,INT32 *event_base_return,
-			  INT32 *error_base_return, INT32 *opcode_return);
-
-
-#endif /* __XTRAPLIBP__ */
-- 
1.6.0.3

-------------- next part --------------
From c85f33ed8df62666e55fdde8878af1e46266559c Mon Sep 17 00:00:00 2001
From: Peter Breitenlohner <peb at mppmu.mpg.de>
Date: Tue, 11 Nov 2008 21:30:22 +0100
Subject: [PATCH] Add XTraplib headers from trapproto package

The files xtrapemacros.h, xtraplib.h, and xtraplibp.h only belong
to libXTrap, they shouldn't have been in the trapproto package in
the first place. For a revision history of these files refer to
git://anongit.freedesktop.org/git/xorg/proto/inputproto

Require trapproto >= 3.4.4
replace 'git-log' by 'git log' as required by git-1.6.x
---
 Makefile.am                           |    2 +-
 configure.ac                          |    2 +-
 include/X11/extensions/xtrapemacros.h |  387 +++++++++++++++++++++++++++++++++
 include/X11/extensions/xtraplib.h     |  130 +++++++++++
 include/X11/extensions/xtraplibp.h    |  144 ++++++++++++
 src/Makefile.am                       |    8 +-
 6 files changed, 670 insertions(+), 3 deletions(-)
 create mode 100644 include/X11/extensions/xtrapemacros.h
 create mode 100644 include/X11/extensions/xtraplib.h
 create mode 100644 include/X11/extensions/xtraplibp.h

diff --git a/Makefile.am b/Makefile.am
index 267448f..e1de4ee 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -34,6 +34,6 @@ MAINTAINERCLEANFILES = ChangeLog
 .PHONY: ChangeLog
 
 ChangeLog:
-	(GIT_DIR=$(top_srcdir)/.git git-log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2)
+	(GIT_DIR=$(top_srcdir)/.git git log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2)
 
 dist-hook: ChangeLog
diff --git a/configure.ac b/configure.ac
index 6690ae2..f2d8d9b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -34,7 +34,7 @@ AC_PROG_CC
 AC_PROG_LIBTOOL
 
 # Check for dependencies
-PKG_CHECK_MODULES(XTRAP, x11 xt trapproto xext xextproto)
+PKG_CHECK_MODULES(XTRAP, x11 xt trapproto >= 3.4.4 xext xextproto)
 AC_SUBST(XTRAP_CFLAGS)
 AC_SUBST(XTRAP_LIBS)
 
diff --git a/include/X11/extensions/xtrapemacros.h b/include/X11/extensions/xtrapemacros.h
new file mode 100644
index 0000000..89c8f63
--- /dev/null
+++ b/include/X11/extensions/xtrapemacros.h
@@ -0,0 +1,387 @@
+/* $XFree86: xc/include/extensions/xtrapemacros.h,v 1.1 2001/11/02 23:29:26 dawes Exp $ */
+#ifndef __XTRAPEMACROS__
+#define __XTRAPEMACROS__ "@(#)xtrapemacros.h	1.9 - 90/09/18  "
+
+/*****************************************************************************
+Copyright 1987, 1988, 1989, 1990, 1991, 1994 by Digital Equipment Corp.,
+Maynard, MA
+
+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
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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
+SOFTWARE.
+
+*****************************************************************************/
+/*
+ *
+ *  CONTRIBUTORS:
+ *
+ *      Dick Annicchiarico
+ *      Robert Chesler
+ *      Dan Coutu
+ *      Gene Durso
+ *      Marc Evans
+ *      Alan Jamison
+ *      Mark Henry
+ *      Ken Miller
+ *
+ *  DESCRIPTION:
+ *      This include file is designed to provide the *visible*
+ *      interface to XTrap data structures.  Fields can be set
+ *      using these macros by client programs unless otherwise
+ *      specified; however, use of Trap Context convenience
+ *      routines is strongly encouraged (XETrapContext.c)
+ */
+#include <X11/extensions/xtrapbits.h>
+#include <signal.h>
+
+/* msleep macro to replace msleep() for portability reasons */
+#define msleep(m)   usleep((m)*1000)
+
+/* Copying TC's assumes that the new TC must be created */
+#define XECopyTC(src,mask,dest) \
+    (dest = XECreateTC(((src)->dpy), (mask), (&((src)->values))))
+
+/* Expands to SET each element of the TCValues structure
+ * Returns the TCValues Mask so that the Set can be entered
+ * as an argument to the XEChangeTC() routine call
+ */
+/* Note: req_cb & evt_cb would only be used if you wanted to
+ *       *share* callbacks between Trap Contexts.  Normally,
+ *       XEAddRequestCB() and XEAddEventCB() would be used.
+ */
+#define XETrapSetCfgReqCB(tcv,x)      ((tcv)->req_cb = (x))
+#define XETrapSetCfgEvtCB(tcv,x)      ((tcv)->evt_cb = (x))
+#define XETrapSetCfgMaxPktSize(tcv,x) ((tcv)->v.max_pkt_size = (x))
+#define XETrapSetCfgCmdKey(tcv,x)     ((tcv)->v.cmd_key = (x))
+/* Note: e is only pertinent for "valid" or "data" */
+#define XETrapSetCfgFlags(tcv,e,a)    \
+    memcpy((tcv)->v.flags.e, (a), sizeof((tcv)->v.flags.e))
+#define XETrapSetCfgFlagTimestamp(tcv,e,x) \
+    BitSet((tcv)->v.flags.e, XETrapTimestamp, (x))
+#define XETrapSetCfgFlagCmd(tcv,e,x) \
+    BitSet((tcv)->v.flags.e, XETrapCmd, (x))
+#define XETrapSetCfgFlagCmdKeyMod(tcv,e,x) \
+    BitSet((tcv)->v.flags.e, XETrapCmdKeyMod, (x))
+#define XETrapSetCfgFlagRequest(tcv,e,x) \
+    BitSet((tcv)->v.flags.e, XETrapRequest, (x))
+#define XETrapSetCfgFlagEvent(tcv,e,x) \
+    BitSet((tcv)->v.flags.e, XETrapEvent, (x))
+#define XETrapSetCfgFlagMaxPacket(tcv,e,x) \
+    BitSet((tcv)->v.flags.e, XETrapMaxPacket, (x))
+#define XETrapSetCfgFlagStatistics(tcv,e,x) \
+    BitSet((tcv)->v.flags.e, XETrapStatistics, (x))
+#define XETrapSetCfgFlagWinXY(tcv,e,x) \
+    BitSet((tcv)->v.flags.e, XETrapWinXY, (x))
+#define XETrapSetCfgFlagCursor(tcv,e,x) \
+    BitSet((tcv)->v.flags.e, XETrapCursor, (x))
+#define XETrapSetCfgFlagReq(tcv,request,x) \
+    BitSet((tcv)->v.flags.req, (request), (x))
+#define XETrapSetCfgFlagXInput(tcv,e,x) \
+    BitSet((tcv)->v.flags.e, XETrapXInput, (x))
+#define XETrapSetCfgFlagColorReplies(tcv,e,x) \
+    BitSet((tcv)->v.flags.e, XETrapColorReplies, (x))
+#define XETrapSetCfgFlagGrabServer(tcv,e,x) \
+    BitSet((tcv)->v.flags.e, XETrapGrabServer, (x))
+#define XETrapSetCfgFlagEvt(tcv,evt,x) \
+    BitSet((tcv)->v.flags.event, (evt), (x))
+
+#define XETrapSetValFlagDeltaTimes(tcv,x) \
+    BitSet((tcv)->tc_flags, XETCDeltaTimes, (x))
+
+/* Fields returned in the "GetAvailable" request */
+#define XETrapGetAvailPFIdent(avail)      ((avail)->pf_ident)
+#define XETrapGetAvailRelease(avail)      ((avail)->xtrap_release)
+#define XETrapGetAvailVersion(avail)      ((avail)->xtrap_version)
+#define XETrapGetAvailRevision(avail)     ((avail)->xtrap_revision)
+#define XETrapGetAvailMaxPktSize(avail)   ((avail)->max_pkt_size)
+#define XETrapGetAvailFlags(avail,a)  \
+    memcpy((a), (avail)->valid, sizeof((avail)->valid))
+#define XETrapGetAvailFlagTimestamp(avail) \
+    (BitValue((avail)->valid, XETrapTimestamp))
+#define XETrapGetAvailFlagCmd(avail) \
+    (BitValue((avail)->valid, XETrapCmd))
+#define XETrapGetAvailFlagCmdKeyMod(avail) \
+    (BitValue((avail)->valid, XETrapCmdKeyMod))
+#define XETrapGetAvailFlagRequest(avail) \
+    (BitValue((avail)->valid, XETrapRequest))
+#define XETrapGetAvailFlagEvent(avail) \
+    (BitValue((avail)->valid, XETrapEvent))
+#define XETrapGetAvailFlagMaxPacket(avail) \
+    (BitValue((avail)->valid, XETrapMaxPacket))
+#define XETrapGetAvailFlagStatistics(avail) \
+    (BitValue((avail)->valid, XETrapStatistics))
+#define XETrapGetAvailFlagWinXY(avail) \
+    (BitValue((avail)->valid, XETrapWinXY))
+#define XETrapGetAvailFlagCursor(avail) \
+    (BitValue((avail)->valid, XETrapCursor))
+#define XETrapGetAvailFlagXInput(avail) \
+    (BitValue((avail)->valid, XETrapXInput))
+#define XETrapGetAvailFlagVecEvt(avail) \
+    (BitValue((avail)->valid, XETrapVectorEvents))
+#define XETrapGetAvailFlagColorReplies(avail) \
+    (BitValue((avail)->valid, XETrapColorReplies))
+#define XETrapGetAvailFlagGrabServer(avail) \
+    (BitValue((avail)->valid, XETrapGrabServer))
+#define XETrapGetAvailOpCode(avail)         ((avail)->major_opcode)
+/* Macro's for creating current request and trap context macros */
+#define XETrapGetCfgMaxPktSize(cfg) ((cfg)->max_pkt_size)
+#define XETrapGetCfgCmdKey(cfg)     ((cfg)->cmd_key)
+#define XETrapGetCfgFlags(cfg,e,a)  \
+    memcpy((a), (cfg)->flags.e, sizeof((cfg)->flags.e))
+#define XETrapGetCfgFlagTimestamp(cfg,e) \
+    (BitValue((cfg)->flags.e, XETrapTimestamp))
+#define XETrapGetCfgFlagCmd(cfg,e) \
+    (BitValue((cfg)->flags.e, XETrapCmd))
+#define XETrapGetCfgFlagCmdKeyMod(cfg,e) \
+    (BitValue((cfg)->flags.e, XETrapCmdKeyMod))
+#define XETrapGetCfgFlagRequest(cfg,e) \
+    (BitValue((cfg)->flags.e, XETrapRequest))
+#define XETrapGetCfgFlagEvent(cfg,e) \
+    (BitValue((cfg)->flags.e, XETrapEvent))
+#define XETrapGetCfgFlagMaxPacket(cfg,e) \
+    (BitValue((cfg)->flags.e, XETrapMaxPacket))
+#define XETrapGetCfgFlagStatistics(cfg,e) \
+    (BitValue((cfg)->flags.e, XETrapStatistics))
+#define XETrapGetCfgFlagWinXY(cfg,e) \
+    (BitValue((cfg)->flags.e, XETrapWinXY))
+#define XETrapGetCfgFlagCursor(cfg,e) \
+    (BitValue((cfg)->flags.e, XETrapCursor))
+#define XETrapGetCfgFlagXInput(cfg,e) \
+    (BitValue((cfg)->flags.e, XETrapXInput))
+#define XETrapGetCfgFlagColorReplies(cfg,e) \
+    (BitValue((cfg)->flags.e, XETrapColorReplies))
+#define XETrapGetCfgFlagGrabServer(cfg,e) \
+    (BitValue((cfg)->flags.e, XETrapGrabServer))
+/* Request values are in "Xproto.h" of the flavor X_RequestType */
+#define XETrapGetCfgFlagReq(cfg,request) \
+    (BitValue((cfg)->flags.req, (request)))
+/* Event types are in "X.h" of the flavor EventType (e.g. KeyPress) */
+#define XETrapGetCfgFlagEvt(cfg,evt) \
+    (BitValue((cfg)->flags.event, (evt)))
+
+/* Fields returned int the "GetCurrent" Request */
+#define XETrapGetCurX(avail)              ((avail)->cur_x)
+#define XETrapGetCurY(avail)              ((avail)->cur_y)
+#define XETrapGetCurSFlags(cur,a) \
+    memcpy((a), (cur)->state_flags, sizeof((cur)->state_flags))
+#define XETrapGetCurMaxPktSize(cur) (XETrapGetCfgMaxPktSize(&((cur)->config)))
+#define XETrapGetCurCmdKey(cur)     (XETrapGetCfgCmdKey(&((cur)->config)))
+/* Note: e is only pertinent for "valid" or "data" */
+#define XETrapGetCurCFlags(cur,e,a) (XETrapGetCfgFlags(&((cur)->config),e,a))
+#define XETrapGetCurFlagTimestamp(cur,e) \
+    (XETrapGetCfgFlagTimestamp(&((cur)->config),e))
+#define XETrapGetCurFlagCmd(cur,e)  (XETrapGetCfgFlagCmd(&((cur)->config),e))
+#define XETrapGetCurFlagCmdKeyMod(cur,e) \
+    (XETrapGetCfgFlagCmdKeyMod(&((cur)->config),e))
+#define XETrapGetCurFlagRequest(cur,r) \
+    (XETrapGetCfgFlagRequest(&((cur)->config),r))
+#define XETrapGetCurFlagEvent(cur,e) \
+    (XETrapGetCfgFlagEvent(&((cur)->config),e))
+#define XETrapGetCurFlagMaxPacket(cur,e) \
+    (XETrapGetCfgFlagMaxPacket(&((cur)->config),e))
+#define XETrapGetCurFlagStatistics(cur,e) \
+    (XETrapGetCfgFlagStatistics(&((cur)->config),e))
+#define XETrapGetCurFlagWinXY(cur,e) \
+    (XETrapGetCfgFlagWinXY(&((cur)->config),e))
+#define XETrapGetCurFlagCursor(cur,e) \
+    (XETrapGetCfgFlagCursor(&((cur)->config),e))
+#define XETrapGetCurFlagXInput(cur,e) \
+    (XETrapGetCfgFlagXInput(&((cur)->config),e))
+#define XETrapGetCurFlagColorReplies(cur,e) \
+    (XETrapGetCfgFlagColorReplies(&((cur)->config),e))
+#define XETrapGetCurFlagGrabServer(cur,e) \
+    (XETrapGetCfgFlagGrabServer(&((cur)->config),e))
+/* Request values are in "Xproto.h" of the flavor X_RequestType */
+#define XETrapGetCurFlagReq(cur,r)  (XETrapGetCfgFlagReq(&((cur)->config),r))
+/* Event types are in "X.h" of the flavor EventType (e.g. KeyPress) */
+#define XETrapGetCurFlagEvt(cur,e)  (XETrapGetCfgFlagEvt(&((cur)->config),e))
+
+/* Fields returned int the "GetStatistics" Request */
+#define XETrapGetStatsReq(stat,e)   ((stat)->requests[(e)])
+#define XETrapGetStatsEvt(stat,e)   ((stat)->events[(e)])
+
+/* Fields returned in the "GetVersion" request */
+#define XETrapGetVersRelease(vers)      ((vers)->xtrap_release)
+#define XETrapGetVersVersion(vers)      ((vers)->xtrap_version)
+#define XETrapGetVersRevision(vers)     ((vers)->xtrap_revision)
+
+/* Fields returned in the "GetLastInpTime" request */
+#define XETrapGetLastInpTime(time_rep)      ((time_rep)->last_time)
+
+/* Expands to GET each element of the TCValues structure */
+#define XETrapGetTCReqCB(tc)      ((tc)->values.req_cb)
+#define XETrapGetTCEvtCB(tc)      ((tc)->values.evt_cb)
+#define XETrapGetTCTime(tc)       ((tc)->values.last_time)
+/* TC specific flags */
+#define XETrapGetTCLFlags(tc,a)  \
+    memcpy((a), (tc)->values.tc_flags, sizeof((tc)->values.tc_flags))
+#define XETrapGetTCFlagDeltaTimes(tc) \
+    (BitValue((tc)->values.tc_flags, XETCDeltaTimes))
+#define XETrapGetTCFlagTrapActive(tc) \
+    (BitValue((tc)->values.tc_flags, XETCTrapActive))
+#define XETrapGetTCMaxPktSize(tc) (XETrapGetCfgMaxPktSize(&((tc)->values.v)))
+#define XETrapGetTCCmdKey(tc)     (XETrapGetCfgCmdKey(&((tc)->values.v)))
+/* Note: e is only pertinent for "valid" or "data" */
+#define XETrapGetTCFlags(tc,e,a)  (XETrapGetCfgFlags(&((tc)->values.v),e,a))
+#define XETrapGetTCFlagTimestamp(tc,e) \
+    (XETrapGetCfgFlagTimestamp(&((tc)->values.v),e))
+#define XETrapGetTCFlagCmd(tc,e) \
+    (XETrapGetCfgFlagCmd(&((tc)->values.v),e))
+#define XETrapGetTCFlagCmdKeyMod(tc,e) \
+    (XETrapGetCfgFlagCmdKeyMod(&((tc)->values.v),e))
+#define XETrapGetTCFlagRequest(tc,r) \
+    (XETrapGetCfgFlagRequest(&((tc)->values.v),r))
+#define XETrapGetTCFlagEvent(tc,e) \
+    (XETrapGetCfgFlagEvent(&((tc)->values.v),e))
+#define XETrapGetTCFlagMaxPacket(tc,e) \
+    (XETrapGetCfgFlagMaxPacket(&((tc)->values.v),e))
+#define XETrapGetTCFlagStatistics(tc,e) \
+    (XETrapGetCfgFlagStatistics(&((tc)->values.v),e))
+#define XETrapGetTCFlagWinXY(tc,e) \
+    (XETrapGetCfgFlagWinXY(&((tc)->values.v),e))
+#define XETrapGetTCFlagCursor(tc,e) \
+    (XETrapGetCfgFlagCursor(&((tc)->values.v),e))
+#define XETrapGetTCFlagXInput(tc,e) \
+    (XETrapGetCfgFlagXInput(&((tc)->values.v),e))
+#define XETrapGetTCFlagColorReplies(tc,e) \
+    (XETrapGetCfgFlagColorReplies(&((tc)->values.v),e))
+#define XETrapGetTCFlagGrabServer(tc,e) \
+    (XETrapGetCfgFlagGrabServer(&((tc)->values.v),e))
+/* Request values are in "Xproto.h" of the flavor X_RequestType */
+#define XETrapGetTCFlagReq(tc,r) \
+    (XETrapGetCfgFlagReq(&((tc)->values.v),r))
+/* Event types are in "X.h" of the flavor EventType (e.g. KeyPress) */
+#define XETrapGetTCFlagEvt(tc,e) \
+    (XETrapGetCfgFlagEvt(&((tc)->values.v),e))
+/* The following can/should *not* be set directly! */
+#define XETrapGetNext(tc)        ((tc)->next)
+#define XETrapGetDpy(tc)         ((tc)->dpy)
+#define XETrapGetEventBase(tc)   ((tc)->eventBase)
+#define XETrapGetErrorBase(tc)   ((tc)->errorBase)
+#define XETrapGetExtOpcode(tc)   ((tc)->extOpcode)
+#define XETrapGetXBuff(tc)       ((tc)->xbuff)
+#define XETrapGetXMaxSize(tc)    ((tc)->xmax_size)
+#define XETrapGetExt(tc)         ((tc)->ext_data)
+#define XETrapGetDirty(tc)       ((tc)->dirty)
+#define XETrapGetValues(tc)      memcpy((x),(tc)->values,sizeof((tc)->values))
+#define XETrapGetEventFunc(tc)   ((tc)->eventFunc)
+
+#define XETrapGetHeaderCount(phdr)      ((phdr)->count)
+#define XETrapGetHeaderTimestamp(phdr)  ((phdr)->timestamp)
+#define XETrapGetHeaderType(phdr)       ((phdr)->type)
+#define XETrapGetHeaderScreen(phdr)     ((phdr)->screen)
+#define XETrapGetHeaderWindowX(phdr)    ((phdr)->win_x)
+#define XETrapGetHeaderWindowY(phdr)    ((phdr)->win_y)
+#define XETrapGetHeaderClient(phdr)     ((phdr)->client)
+
+#define XEGetRelease(tc)        ((tc)->release)
+#define XEGetVersion(tc)        ((tc)->version)
+#define XEGetRevision(tc)       ((tc)->revision)
+
+/*  Condition handling macros */
+#if !defined(vms) && \
+    (!defined(_InitExceptionHandling) || !defined(_ClearExceptionHandling))
+# ifndef _SetSIGBUSHandling
+#  ifdef SIGBUS
+#   define _SetSIGBUSHandling(rtn)  (void)signal(SIGBUS, rtn)
+#  else
+#   define _SetSIGBUSHandling(rtn)  /* */
+#  endif
+# endif
+# ifndef _SetSIGSEGVHandling
+#  ifdef SIGSEGV
+#   define _SetSIGSEGVHandling(rtn) (void)signal(SIGSEGV, rtn)
+#  else
+#   define _SetSIGSEGVHandling(rtn) /* */
+#  endif
+# endif
+# ifndef _SetSIGFPEHandling
+#  ifdef SIGFPE
+#   define _SetSIGFPEHandling(rtn)  (void)signal(SIGFPE, rtn)
+#  else
+#   define _SetSIGFPEHandling(rtn)  /* */
+#  endif
+# endif
+# ifndef _SetSIGILLHandling
+#  ifdef SIGILL
+#   define _SetSIGILLHandling(rtn)  (void)signal(SIGILL, rtn)
+#  else
+#   define _SetSIGILLHandling(rtn)  /* */
+#  endif
+# endif
+# ifndef _SetSIGSYSHandling
+#  ifdef SIGSYS
+#   define _SetSIGSYSHandling(rtn)  (void)signal(SIGSYS, rtn)
+#  else
+#   define _SetSIGSYSHandling(rtn)  /* */
+#  endif
+# endif
+# ifndef _SetSIGHUPHandling
+#  ifdef SIGHUP
+#   define _SetSIGHUPHandling(rtn)  (void)signal(SIGHUP, rtn)
+#  else
+#   define _SetSIGHUPHandling(rtn)  /* */
+#  endif
+# endif
+# ifndef _SetSIGPIPEHandling
+#  ifdef SIGPIPE
+#   define _SetSIGPIPEHandling(rtn) (void)signal(SIGPIPE, rtn)
+#  else
+#   define _SetSIGPIPEHandling(rtn) /* */
+#  endif
+# endif
+# ifndef _SetSIGTERMHandling
+#  ifdef SIGTERM
+#   define _SetSIGTERMHandling(rtn) (void)signal(SIGTERM, rtn)
+#  else
+#   define _SetSIGTERMHandling(rtn) /* */
+#  endif
+# endif
+#endif
+#ifndef _InitExceptionHandling
+#ifdef vms
+#define _InitExceptionHandling(rtn)                        \
+    VAXC$ESTABLISH(rtn)   /* VMS exception handler */
+#else /* vms */
+#define _InitExceptionHandling(rtn)                           \
+    _SetSIGBUSHandling(rtn);  /* Bus error */                 \
+    _SetSIGSEGVHandling(rtn); /* Accvio/Segment error */      \
+    _SetSIGFPEHandling(rtn);  /* Floating point exception */  \
+    _SetSIGILLHandling(rtn);  /* Illegal instruction */       \
+    _SetSIGSYSHandling(rtn);  /* Param error in sys call */   \
+    _SetSIGHUPHandling(rtn);                                  \
+    _SetSIGPIPEHandling(rtn);                                 \
+    _SetSIGTERMHandling(rtn)
+#endif /* vms */
+#endif /* _InitExceptionHandling */
+
+#ifndef _ClearExceptionHandling
+#ifdef vms
+#define _ClearExceptionHandling() \
+    LIB$REVERT()
+#else
+#define _ClearExceptionHandling() \
+    _SetSIGBUSHandling(SIG_DFL);   /* Bus error */                 \
+    _SetSIGSEGVHandling(SIG_DFL);  /* Accvio/Segment error */      \
+    _SetSIGFPEHandling(SIG_DFL);   /* Floating point exception */  \
+    _SetSIGILLHandling(SIG_DFL);   /* Illegal instruction */       \
+    _SetSIGSYSHandling(SIG_DFL);   /* Param error in sys call */   \
+    _SetSIGHUPHandling(SIG_DFL);                                   \
+    _SetSIGPIPEHandling(SIG_DFL);                                  \
+    _SetSIGTERMHandling(SIG_DFL)
+#endif /* vms */
+#endif /* _ClearExceptionHandling */
+
+#endif /* __XTRAPEMACROS__ */
diff --git a/include/X11/extensions/xtraplib.h b/include/X11/extensions/xtraplib.h
new file mode 100644
index 0000000..2ed3169
--- /dev/null
+++ b/include/X11/extensions/xtraplib.h
@@ -0,0 +1,130 @@
+/* $XFree86$ */
+#ifndef __XTRAPLIB__
+#define __XTRAPLIB__
+
+
+/*****************************************************************************
+Copyright 1987, 1988, 1989, 1990, 1991, 1994 by Digital Equipment Corp.,
+Maynard, MA
+
+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
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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
+SOFTWARE.
+
+*****************************************************************************/
+/*
+ *
+ *  CONTRIBUTORS:
+ *
+ *      Dick Annicchiarico
+ *      Robert Chesler
+ *      Dan Coutu
+ *      Gene Durso
+ *      Marc Evans
+ *      Alan Jamison
+ *      Mark Henry
+ *      Ken Miller
+ *
+ *  DESCRIPTION:
+ *      This header file describes all the structures/constants required
+ *      for interfacing with the client toolkit *except* the common
+ *      client/extension definitions in xtrapdi.h.  Namely, *no* extension-
+ *      only information or client/extension information can be found here.
+ */
+#ifdef SMT
+#define NEED_EVENTS
+#define NEED_REPLIES
+#endif
+#include <X11/Xlib.h>
+#include <X11/Intrinsic.h>
+#include <X11/extensions/xtrapdi.h>
+#include <X11/extensions/xtrapemacros.h>
+
+typedef void (*void_function)();
+
+typedef struct  /* Callback structure */
+{
+    void_function func;
+    BYTE          *data;
+} XETrapCB;
+
+/* Data structure for setting trap context */
+typedef struct
+{
+    CARD8       tc_flags[2L];  /* Toolkit-side specific flags */
+    XETrapCfg   v;             /* XTrap configuration values */
+    XETrapCB    *req_cb;       /* Pointer to Request Callbacks */
+    XETrapCB    *evt_cb;       /* Pointer to Event Callbacks (starting at 2) */
+    CARD32      last_time B32; /* Last (delta) timestamp */
+} XETCValues;
+
+    /* bits 0 thru 6 are formerly "families" (now obsolete) */
+#define XETCDeltaTimes             7
+#define XETCTrapActive             8
+    /* bits 9 thru 15 are reserved for future expansion */
+
+/* Values bit masks (used when determining what's dirty */
+#define TCStatistics               (1L<<0L)
+#define TCRequests                 (1L<<1L)
+#define TCEvents                   (1L<<2L)
+#define TCMaxPacket                (1L<<3L)
+#define TCCmdKey                   (1L<<4L)
+#define TCTimeStamps               (1L<<5L)
+#define TCWinXY                    (1L<<6L)
+#define TCXInput                   (1L<<7L)
+#define TCReqCBs                   (1L<<8L)
+#define TCEvtCBs                   (1L<<9L)
+#define TCCursor                   (1L<<10L)
+#define TCColorReplies             (1L<<11L)
+#define TCGrabServer               (1L<<12L)
+
+/* This is the representation we use in the library code for XLib transport */
+typedef struct {
+    int type;
+    unsigned long serial;
+    Bool synthetic;
+    Display *display;
+    int detail;
+    unsigned long idx;
+    unsigned char data[sz_EventData];
+} XETrapDataEvent;
+
+/* Trap Context structure for maintaining XTrap State for client */
+typedef struct _XETC
+{
+    struct _XETC *next;         /* Ptr to next linked-listed TC */
+    Display      *dpy;          /* Display ptr of current TC */
+    INT32        eventBase /*B32*/; /* First event value */
+    INT32        errorBase /*B32*/; /* First error value */
+    INT32        extOpcode /*B32*/; /* Major opcode of the extension */
+    BYTE         *xbuff;        /* Pointer to buffer for XLib Communications */
+    CARD16       xmax_size /*B16*/; /* Max Size of a request */
+    XExtData     *ext_data;     /* hook for extension to hang data */
+    /*
+     *  The following are initialized with the client-side version number
+     *  However, when either a GetAvailable or GetVersion reply is received,
+     *  these values are updated with the *oldest* version numbers.
+     */
+    CARD16       release /*B16*/;   /* The extension release number */
+    CARD16       version /*B16*/;   /* The xtrap extension version number */
+    CARD16       revision /*B16*/;  /* The xtrap extension revision number */
+    CARD16       protocol /*B16*/;  /* The xtrap extension protocol number */
+    unsigned     dirty /*B32*/;     /* cache dirty bits */
+    XETCValues   values;        /* shadow structure of values */
+    Boolean      (*eventFunc[XETrapNumberEvents])(XETrapDataEvent *event, struct _XETC *tc);
+} XETC;
+
+
+#endif /* __XTRAPLIB__ */
diff --git a/include/X11/extensions/xtraplibp.h b/include/X11/extensions/xtraplibp.h
new file mode 100644
index 0000000..6c6eaf2
--- /dev/null
+++ b/include/X11/extensions/xtraplibp.h
@@ -0,0 +1,144 @@
+/* $XFree86$ */
+#ifndef __XTRAPLIBP__
+#define __XTRAPLIBP__
+
+
+/*****************************************************************************
+Copyright 1987, 1988, 1989, 1990, 1991, 1994 by Digital Equipment Corp.,
+Maynard, MA
+
+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
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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
+SOFTWARE.
+
+*****************************************************************************/
+/*
+ *
+ *  CONTRIBUTORS:
+ *
+ *      Dick Annicchiarico
+ *      Robert Chesler
+ *      Dan Coutu
+ *      Gene Durso
+ *      Marc Evans
+ *      Alan Jamison
+ *      Mark Henry
+ *      Ken Miller
+ *
+ *  DESCRIPTION:
+ *      This header file contains the function prototypes for client/toolkit
+ *      routines sorted by module (globally defined routines *only*).
+ */
+
+#include <stdio.h>
+
+/* XEConTxt.c */
+XETC *XECreateTC (Display *dpy , CARD32 valuemask , XETCValues *value );
+int XEChangeTC (XETC *tc , CARD32 mask , XETCValues *values );
+void XEFreeTC (XETC *tc );
+int XETrapSetMaxPacket (XETC *tc , Bool set_flag , CARD16 size );
+int XETrapSetCommandKey (XETC *tc , Bool set_flag , KeySym cmd_key ,
+    Bool mod_flag );
+int XETrapSetTimestamps (XETC *tc , Bool set_flag , Bool delta_flag );
+int XETrapSetWinXY (XETC *tc , Bool set_flag );
+int XETrapSetCursor (XETC *tc , Bool set_flag );
+int XETrapSetXInput (XETC *tc , Bool set_flag );
+int XETrapSetColorReplies (XETC *tc , Bool set_flag );
+int XETrapSetGrabServer (XETC *tc , Bool set_flag );
+int XETrapSetStatistics (XETC *tc , Bool set_flag );
+int XETrapSetRequests (XETC *tc , Bool set_flag , ReqFlags requests );
+int XETrapSetEvents (XETC *tc , Bool set_flag , EventFlags events );
+Bool XESetCmdGateState (XETC *tc , CARD8 type, Bool *gate_closed ,
+    CARD8 *next_key , Bool *key_ignore );
+
+/* XERqsts.c */
+int XEFlushConfig (XETC *tc );
+int XEResetRequest (XETC *tc );
+int XEGetVersionRequest (XETC *tc , XETrapGetVersRep *ret );
+int XEGetLastInpTimeRequest (XETC *tc , XETrapGetLastInpTimeRep *ret );
+int XEGetAvailableRequest (XETC *tc , XETrapGetAvailRep *ret );
+int XEStartTrapRequest (XETC *tc );
+int XEStopTrapRequest (XETC *tc );
+int XESimulateXEventRequest (XETC *tc , CARD8 type , CARD8 detail ,
+    CARD16 x , CARD16 y , CARD8 screen );
+int XEGetCurrentRequest (XETC *tc , XETrapGetCurRep *ret );
+int XEGetStatisticsRequest (XETC *tc , XETrapGetStatsRep *ret );
+
+/* XECallBcks.c */
+int XEAddRequestCB (XETC *tc , CARD8 req , void_function func , BYTE *data );
+int XEAddRequestCBs (XETC *tc , ReqFlags req_flags , void_function func ,
+    BYTE *data );
+int XEAddEventCB (XETC *tc , CARD8 evt , void_function func , BYTE *data );
+int XEAddEventCBs (XETC *tc , EventFlags evt_flags , void_function func ,
+    BYTE *data );
+
+/* The following seem to never be used.  Perhaps they should be removed */
+void XERemoveRequestCB (XETC *tc, CARD8 req);
+void XERemoveRequestCBs (XETC *tc, ReqFlags req_flags);
+void XERemoveAllRequestCBs (XETC *tc);
+void XERemoveEventCB (XETC *tc, CARD8 evt);
+void XERemoveEventCBs (XETC *tc, EventFlags evt_flags);
+void XERemoveAllEventCBs (XETC *tc);
+
+
+/* XEDsptch.c */
+Boolean XETrapDispatchXLib (XETrapDataEvent *event , XETC *tc);
+
+/* XEWrappers.c */
+Boolean XETrapDispatchEvent (XEvent *pevent , XETC *tc );
+XtInputMask XETrapAppPending (XtAppContext app);
+void XETrapAppMainLoop (XtAppContext app , XETC *tc );
+int XETrapAppWhileLoop (XtAppContext app , XETC *tc , Bool *done );
+int XETrapWaitForSomething (XtAppContext app );
+Boolean (*XETrapSetEventHandler(XETC *tc, CARD32 id, Boolean (*pfunc)(XETrapDataEvent *event, XETC *tc))) (XETrapDataEvent *event, XETC *tc);
+
+/* XEPrInfo.c */
+void XEPrintRelease (FILE *ofp , XETrapGetAvailRep *pavail );
+void XEPrintTkRelease ( FILE *ofp, XETC *tc);
+void XEPrintPlatform (FILE *ofp , XETrapGetAvailRep *pavail );
+void XEPrintAvailFlags (FILE *ofp , XETrapGetAvailRep *pavail );
+void XEPrintAvailPktSz (FILE *ofp , XETrapGetAvailRep *pavail );
+void XEPrintStateFlags (FILE *ofp , XETrapGetCurRep *pcur );
+void XEPrintMajOpcode (FILE *ofp , XETrapGetAvailRep *pavail );
+void XEPrintCurXY (FILE *ofp , XETrapGetAvailRep *pavail );
+void XEPrintTkFlags (FILE *ofp , XETC *tc );
+void XEPrintLastTime (FILE *ofp , XETC *tc );
+void XEPrintCfgFlags (FILE *ofp , XETrapGetCurRep *pcur );
+void XEPrintRequests (FILE *ofp , XETrapGetCurRep *pcur );
+void XEPrintEvents (FILE *ofp , XETrapGetCurRep *pcur );
+void XEPrintCurPktSz (FILE *ofp , XETrapGetCurRep *pcur );
+void XEPrintCmdKey (FILE *ofp , XETrapGetCurRep *pcur );
+void XEPrintEvtStats (FILE *ofp , XETrapGetStatsRep *pstats , XETC *tc);
+void XEPrintReqStats (FILE *ofp , XETrapGetStatsRep *pstats , XETC *tc);
+void XEPrintAvail (FILE *ofp , XETrapGetAvailRep *pavail );
+void XEPrintTkState (FILE *ofp , XETC *tc );
+void XEPrintCurrent (FILE *ofp , XETrapGetCurRep *pcur );
+void XEPrintStatistics (FILE *ofp , XETrapGetStatsRep *pstats, XETC *tc );
+
+/* XEStrMap.c */
+INT16 XEEventStringToID (char *string );
+INT16 XERequestStringToID (char *string );
+CARD32 XEPlatformStringToID (char *string );
+char *XEEventIDToString (CARD8 id , XETC *tc);
+char *XERequestIDToExtString (register CARD8 id , XETC *tc);
+char *XERequestIDToString (CARD8 id , XETC *tc);
+char *XEPlatformIDToString (CARD32 id );
+
+/* XETrapInit.c */
+Bool XETrapQueryExtension (Display *dpy,INT32 *event_base_return,
+			  INT32 *error_base_return, INT32 *opcode_return);
+
+
+#endif /* __XTRAPLIBP__ */
diff --git a/src/Makefile.am b/src/Makefile.am
index 99f47aa..ddb8a82 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -10,8 +10,14 @@ libXTrap_la_SOURCES = 	\
 	XETrapInit.c	\
 	XEWrappers.c	
 
-AM_CFLAGS = @XTRAP_CFLAGS@
+AM_CFLAGS = -I${top_srcdir}/include @XTRAP_CFLAGS@
 
 libXTrap_la_LIBADD = @XTRAP_LIBS@
 
 libXTrap_la_LDFLAGS = -version-number 6:4:0 -no-undefined
+
+libXTrapincludedir=$(includedir)/X11/extensions
+libXTrapinclude_HEADERS=\
+	$(top_srcdir)/include/X11/extensions/xtrapemacros.h \
+	$(top_srcdir)/include/X11/extensions/xtraplib.h \
+	$(top_srcdir)/include/X11/extensions/xtraplibp.h
-- 
1.6.0.3

-------------- next part --------------
From f0d56d29daa96f73dad5f62d54440414b97cb941 Mon Sep 17 00:00:00 2001
From: Peter Breitenlohner <peb at mppmu.mpg.de>
Date: Tue, 11 Nov 2008 22:27:07 +0100
Subject: [PATCH] convert to strict ANSI C

declare function pointer types XETrapHandler and XETrapCallBack
replacing void_function (without proper prototype)

remove superfluous casts of NULL
---
 include/X11/extensions/xtraplib.h  |   28 ++++++++++++++++++----------
 include/X11/extensions/xtraplibp.h |   10 +++++-----
 src/XECallBcks.c                   |   16 ++++++++--------
 src/XEDsptch.c                     |    2 +-
 src/XEWrappers.c                   |    7 ++++---
 5 files changed, 36 insertions(+), 27 deletions(-)

diff --git a/include/X11/extensions/xtraplib.h b/include/X11/extensions/xtraplib.h
index 2ed3169..c907251 100644
--- a/include/X11/extensions/xtraplib.h
+++ b/include/X11/extensions/xtraplib.h
@@ -52,21 +52,17 @@ SOFTWARE.
 #include <X11/extensions/xtrapdi.h>
 #include <X11/extensions/xtrapemacros.h>
 
-typedef void (*void_function)();
-
-typedef struct  /* Callback structure */
-{
-    void_function func;
-    BYTE          *data;
-} XETrapCB;
+/* Forward declarations */
+struct _XETrapCB;	/* Callback structure */
+struct _XETC;		/* Trap Context structure */
 
 /* Data structure for setting trap context */
 typedef struct
 {
     CARD8       tc_flags[2L];  /* Toolkit-side specific flags */
     XETrapCfg   v;             /* XTrap configuration values */
-    XETrapCB    *req_cb;       /* Pointer to Request Callbacks */
-    XETrapCB    *evt_cb;       /* Pointer to Event Callbacks (starting at 2) */
+    struct _XETrapCB    *req_cb;       /* Pointer to Request Callbacks */
+    struct _XETrapCB    *evt_cb;       /* Pointer to Event Callbacks (starting at 2) */
     CARD32      last_time B32; /* Last (delta) timestamp */
 } XETCValues;
 
@@ -101,6 +97,9 @@ typedef struct {
     unsigned char data[sz_EventData];
 } XETrapDataEvent;
 
+/* Trap Handler function pointer type */
+typedef Boolean (*XETrapHandler)(XETrapDataEvent *event, struct _XETC *tc);
+
 /* Trap Context structure for maintaining XTrap State for client */
 typedef struct _XETC
 {
@@ -123,8 +122,17 @@ typedef struct _XETC
     CARD16       protocol /*B16*/;  /* The xtrap extension protocol number */
     unsigned     dirty /*B32*/;     /* cache dirty bits */
     XETCValues   values;        /* shadow structure of values */
-    Boolean      (*eventFunc[XETrapNumberEvents])(XETrapDataEvent *event, struct _XETC *tc);
+    XETrapHandler eventFunc[XETrapNumberEvents];
 } XETC;
 
+/* Trap Callback function pointer type */
+typedef void (*XETrapCallBack)(XETC *, XETrapDatum *, BYTE *);
+
+typedef struct _XETrapCB  /* Callback structure */
+{
+    XETrapCallBack func;
+    BYTE          *data;
+} XETrapCB;
+
 
 #endif /* __XTRAPLIB__ */
diff --git a/include/X11/extensions/xtraplibp.h b/include/X11/extensions/xtraplibp.h
index 6c6eaf2..5a532ce 100644
--- a/include/X11/extensions/xtraplibp.h
+++ b/include/X11/extensions/xtraplibp.h
@@ -77,11 +77,11 @@ int XEGetCurrentRequest (XETC *tc , XETrapGetCurRep *ret );
 int XEGetStatisticsRequest (XETC *tc , XETrapGetStatsRep *ret );
 
 /* XECallBcks.c */
-int XEAddRequestCB (XETC *tc , CARD8 req , void_function func , BYTE *data );
-int XEAddRequestCBs (XETC *tc , ReqFlags req_flags , void_function func ,
+int XEAddRequestCB (XETC *tc , CARD8 req , XETrapCallBack func , BYTE *data );
+int XEAddRequestCBs (XETC *tc , ReqFlags req_flags , XETrapCallBack func ,
     BYTE *data );
-int XEAddEventCB (XETC *tc , CARD8 evt , void_function func , BYTE *data );
-int XEAddEventCBs (XETC *tc , EventFlags evt_flags , void_function func ,
+int XEAddEventCB (XETC *tc , CARD8 evt , XETrapCallBack func , BYTE *data );
+int XEAddEventCBs (XETC *tc , EventFlags evt_flags , XETrapCallBack func ,
     BYTE *data );
 
 /* The following seem to never be used.  Perhaps they should be removed */
@@ -102,7 +102,7 @@ XtInputMask XETrapAppPending (XtAppContext app);
 void XETrapAppMainLoop (XtAppContext app , XETC *tc );
 int XETrapAppWhileLoop (XtAppContext app , XETC *tc , Bool *done );
 int XETrapWaitForSomething (XtAppContext app );
-Boolean (*XETrapSetEventHandler(XETC *tc, CARD32 id, Boolean (*pfunc)(XETrapDataEvent *event, XETC *tc))) (XETrapDataEvent *event, XETC *tc);
+XETrapHandler XETrapSetEventHandler(XETC *tc, CARD32 id, XETrapHandler pfunc);
 
 /* XEPrInfo.c */
 void XEPrintRelease (FILE *ofp , XETrapGetAvailRep *pavail );
diff --git a/src/XECallBcks.c b/src/XECallBcks.c
index fb1e089..507210f 100644
--- a/src/XECallBcks.c
+++ b/src/XECallBcks.c
@@ -43,7 +43,7 @@ SOFTWARE.
 #include <X11/extensions/xtraplib.h>
 #include <X11/extensions/xtraplibp.h>
 
-int XEAddRequestCB(XETC *tc, CARD8 req, void_function func, BYTE *data)
+int XEAddRequestCB(XETC *tc, CARD8 req, XETrapCallBack func, BYTE *data)
 {
     if (!tc->values.req_cb)
     {   /* This is the first time for this particular TC, need to malloc */
@@ -60,7 +60,7 @@ int XEAddRequestCB(XETC *tc, CARD8 req, void_function func, BYTE *data)
     return(True);
 }
 
-int XEAddRequestCBs(XETC *tc, ReqFlags req_flags, void_function func,
+int XEAddRequestCBs(XETC *tc, ReqFlags req_flags, XETrapCallBack func,
     BYTE *data)
 {
     int i;
@@ -76,7 +76,7 @@ int XEAddRequestCBs(XETC *tc, ReqFlags req_flags, void_function func,
     return(status);
 }
 
-int XEAddEventCB(XETC *tc, CARD8 evt, void_function func, BYTE *data)
+int XEAddEventCB(XETC *tc, CARD8 evt, XETrapCallBack func, BYTE *data)
 {
     if (!tc->values.evt_cb)
     {   /* This is the first time for this particular TC, need to malloc */
@@ -93,7 +93,7 @@ int XEAddEventCB(XETC *tc, CARD8 evt, void_function func, BYTE *data)
     return(True);
 }
 
-int XEAddEventCBs(XETC *tc, EventFlags evt_flags, void_function func,
+int XEAddEventCBs(XETC *tc, EventFlags evt_flags, XETrapCallBack func,
     BYTE *data)
 {
     int i;
@@ -115,8 +115,8 @@ void XERemoveRequestCB(XETC *tc, CARD8 req)
     {   /* We gotta problem!  CB struct not allocated! */
         return;
     }
-    tc->values.req_cb[req].func = (void_function)NULL;
-    tc->values.req_cb[req].data = (BYTE *)NULL;
+    tc->values.req_cb[req].func = NULL;
+    tc->values.req_cb[req].data = NULL;
     return;
 }
 void XERemoveRequestCBs(XETC *tc, ReqFlags req_flags)
@@ -147,8 +147,8 @@ void XERemoveEventCB(XETC *tc, CARD8 evt)
     {   /* We gotta problem!  CB struct not allocated! */
         return;
     }
-    tc->values.evt_cb[evt].func = (void_function)NULL;
-    tc->values.evt_cb[evt].data = (BYTE *)NULL;
+    tc->values.evt_cb[evt].func = NULL;
+    tc->values.evt_cb[evt].data = NULL;
     return;
 }
 
diff --git a/src/XEDsptch.c b/src/XEDsptch.c
index b503926..cbcf70d 100644
--- a/src/XEDsptch.c
+++ b/src/XEDsptch.c
@@ -41,7 +41,7 @@ SOFTWARE.
 
 static void XETrapDispatchCB(XETC *tc, XETrapDatum *pdatum)
 {
-    void_function pfunc = NULL;
+    XETrapCallBack pfunc = NULL;
     BYTE *userp = NULL;
 
     /* Need to deal with Delta Timestamps here before calling client CB */
diff --git a/src/XEWrappers.c b/src/XEWrappers.c
index 40b7e21..7a75bb9 100644
--- a/src/XEWrappers.c
+++ b/src/XEWrappers.c
@@ -102,13 +102,14 @@ typedef	struct Fd_set {
  * implementations do, as compared to using one of the core input event masks.
  */
 
-Boolean (*XETrapGetEventHandler(XETC *tc, CARD32 id))(XETrapDataEvent *event, XETC *tc)
+static XETrapHandler
+XETrapGetEventHandler(XETC *tc, CARD32 id)
 {
     return((id < XETrapNumberEvents) ? tc->eventFunc[id] : NULL);
 }
 
-Boolean (*XETrapSetEventHandler(XETC *tc, CARD32 id,
-			Boolean (*pfunc)(XETrapDataEvent *event, XETC *tc)))(XETrapDataEvent *event, XETC *tc)
+XETrapHandler
+XETrapSetEventHandler(XETC *tc, CARD32 id, XETrapHandler pfunc)
 {
     register Boolean (*rfunc)(XETrapDataEvent *event, XETC *tc) = NULL;
 
-- 
1.6.0.3

-------------- next part --------------
From bf88a3f14e00f05946d84686cbdf4bf482cef9bf Mon Sep 17 00:00:00 2001
From: Peter Breitenlohner <peb at mppmu.mpg.de>
Date: Tue, 11 Nov 2008 22:43:22 +0100
Subject: [PATCH] Version 1.0.1

---
 configure.ac |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index f2d8d9b..97e3088 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@ dnl Process this file with autoconf to create configure.
 
 AC_PREREQ([2.57])
 
-AC_INIT(libXTrap, 1.0.0, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], libXTrap)
+AC_INIT(libXTrap, 1.0.1, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], libXTrap)
 AM_INIT_AUTOMAKE([dist-bzip2])
 AM_MAINTAINER_MODE
 
-- 
1.6.0.3

-------------- next part --------------
From c820e7a0f596cb931c4b4c53eabbc6258a325e27 Mon Sep 17 00:00:00 2001
From: Peter Breitenlohner <peb at mppmu.mpg.de>
Date: Tue, 11 Nov 2008 23:10:52 +0100
Subject: [PATCH] require xtrap >= 1.0.1

replace 'git-log' by 'git log' as required by git-1.6.x
avoid use of void_function
use AM_CFLAGS instead of xtrap*_CFLAGS to avoid need for AM_PROG_CC_C_O
---
 Makefile.am  |   11 +++--------
 configure.ac |    2 +-
 xtrapout.c   |    4 ++--
 3 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index e10e853..de538fb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -30,10 +30,11 @@ bin_PROGRAMS = \
 	xtrapinfo
 
 
+AM_CFLAGS = $(XTRAP_APP_CFLAGS) -D_BSD_SOURCE
+
 # 
 # xtrapchar
 #
-xtrapchar_CFLAGS = $(XTRAP_APP_CFLAGS)
 xtrapchar_LDADD = $(XTRAP_APP_LIBS)
 
 xtrapchar_SOURCES = \
@@ -46,7 +47,6 @@ xtrapchar_SOURCES = \
 #
 # xtrapin
 # 
-xtrapin_CFLAGS = $(XTRAP_APP_CFLAGS) -D_BSD_SOURCE
 xtrapin_LDADD = $(XTRAP_APP_LIBS)
 
 xtrapin_SOURCES = \
@@ -57,7 +57,6 @@ xtrapin_SOURCES = \
 #
 # xtrapout
 #
-xtrapout_CFLAGS = $(XTRAP_APP_CFLAGS) -D_BSD_SOURCE
 xtrapout_LDADD = $(XTRAP_APP_LIBS)
 
 xtrapout_SOURCES = \
@@ -68,7 +67,6 @@ xtrapout_SOURCES = \
 #
 # xtrapproto
 #
-xtrapproto_CFLAGS = $(XTRAP_APP_CFLAGS)
 xtrapproto_LDADD = $(XTRAP_APP_LIBS)
 
 xtrapproto_SOURCES = \
@@ -77,7 +75,6 @@ xtrapproto_SOURCES = \
 #
 # xtrapreset
 #
-xtrapreset_CFLAGS = $(XTRAP_APP_CFLAGS)
 xtrapreset_LDADD = $(XTRAP_APP_LIBS)
 
 xtrapreset_SOURCES = \
@@ -86,7 +83,6 @@ xtrapreset_SOURCES = \
 #
 # xtrapstats
 #
-xtrapstats_CFLAGS = $(XTRAP_APP_CFLAGS)
 xtrapstats_LDADD = $(XTRAP_APP_LIBS)
 
 xtrapstats_SOURCES = \
@@ -95,7 +91,6 @@ xtrapstats_SOURCES = \
 #
 # xtrapinfo
 #
-xtrapinfo_CFLAGS = $(XTRAP_APP_CFLAGS)
 xtrapinfo_LDADD = $(XTRAP_APP_LIBS)
 
 xtrapinfo_SOURCES = \
@@ -164,6 +159,6 @@ MAINTAINERCLEANFILES = ChangeLog
 .PHONY: ChangeLog
 
 ChangeLog:
-	(GIT_DIR=$(top_srcdir)/.git git-log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2)
+	(GIT_DIR=$(top_srcdir)/.git git log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2)
 
 dist-hook: ChangeLog
diff --git a/configure.ac b/configure.ac
index ddf96fa..5010157 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,7 +32,7 @@ AC_PROG_CC
 AC_PROG_INSTALL
 
 # Checks for pkg-config packages
-PKG_CHECK_MODULES(XTRAP_APP, x11 xtrap)
+PKG_CHECK_MODULES(XTRAP_APP, x11 xtrap >= 1.0.1)
 AC_SUBST(XTRAP_APP_CFLAGS)
 AC_SUBST(XTRAP_APP_LIBS)
 
diff --git a/xtrapout.c b/xtrapout.c
index 35c70f7..3802fe7 100644
--- a/xtrapout.c
+++ b/xtrapout.c
@@ -273,8 +273,8 @@ main(int argc, char *argv[])
     XEPrintCurrent(stderr,&ret_cur);
 
     /* Add signal handlers so that we clean up properly */
-    _InitExceptionHandling((void_function)SetGlobalDone);
-    (void)XEEnableCtrlKeys((void_function)SetGlobalDone);
+    _InitExceptionHandling(SetGlobalDone);
+    (void)XEEnableCtrlKeys(SetGlobalDone);
              
     XETrapAppWhileLoop(app,tc,&GlobalDone);
 
-- 
1.6.0.3

-------------- next part --------------
From 63107223c905bab50375604ccaac4b53db7de001 Mon Sep 17 00:00:00 2001
From: Peter Breitenlohner <peb at mppmu.mpg.de>
Date: Tue, 11 Nov 2008 23:28:23 +0100
Subject: [PATCH] strict ANSI C

convert old style function declarations
correct type of signal handler from void(*)(void) to void(*)(int)
correct arg3 of XTrap handler from char* to BYTE*
---
 xtrapchar.c |   32 +++++++++++---------------------
 xtrapout.c  |   12 ++++++------
 2 files changed, 17 insertions(+), 27 deletions(-)

diff --git a/xtrapchar.c b/xtrapchar.c
index 06b9400..bdec2d3 100644
--- a/xtrapchar.c
+++ b/xtrapchar.c
@@ -368,12 +368,9 @@ main(int argc, char *argv[])
     exit(0L);
 }
 
-static int get_csi_key(tc, private, param, nparam, inter, ninter, final)
-    XETC    *tc;
-    int     private;
-    int     param[], nparam;
-    int     inter[], ninter;
-    int     final;
+static int
+get_csi_key(XETC *tc, int private, int param[], int nparam,
+    int inter[], int ninter, int final)
 {
     KeySym keysym = 0;
     switch(param[1])
@@ -445,12 +442,9 @@ static int get_csi_key(tc, private, param, nparam, inter, ninter, final)
      *                                  pointer position)
      *
      */    
-static void send_special(tc, private, param, nparam, inter, ninter, final)
-    XETC    *tc;
-    int     private;
-    int     param[], nparam;
-    int     inter[], ninter;
-    int     final;
+static void
+send_special(XETC *tc, int private, int param[], int nparam,
+    int inter[], int ninter, int final)
 {
     switch(private)
     {
@@ -619,12 +613,9 @@ static void send_special(tc, private, param, nparam, inter, ninter, final)
     }
 }
 
-static int get_ss3_key(tc, private, param, nparam, inter, ninter, final)
-    XETC    *tc;
-    int     private;
-    int     param[], nparam;
-    int     inter[], ninter;
-    int     final;
+static int
+get_ss3_key(XETC *tc, int private, int param[], int nparam,
+    int inter[], int ninter, int final)
 {
     KeySym keysym = 0;
     switch(param[1])
@@ -665,9 +656,8 @@ static int get_ss3_key(tc, private, param, nparam, inter, ninter, final)
     return(get_keycode(tc, keysym));
 }
 
-static KeyCode get_typical_char(tc, keysym)
-    XETC    *tc;
-    CARD32  keysym;
+static KeyCode
+get_typical_char(XETC *tc, CARD32 keysym)
 {
     if (iscntrl(keysym))
     {   
diff --git a/xtrapout.c b/xtrapout.c
index 3802fe7..9f7058f 100644
--- a/xtrapout.c
+++ b/xtrapout.c
@@ -109,11 +109,11 @@ extern int opterr;
 
 
 /* Forward declarations */
-static void SetGlobalDone (void );
+static void SetGlobalDone (int signum);
 static void print_req_callback (XETC *tc , XETrapDatum *data , 
-    char *my_buf );
+    BYTE *my_buf );
 static void print_evt_callback (XETC *tc , XETrapDatum *data , 
-    char *my_buf );
+    BYTE *my_buf );
 
 
 FILE *ofp;
@@ -125,14 +125,14 @@ XrmOptionDescRec optionTable [] =
     {"-v",     "*verbose",   XrmoptionSkipArg, (caddr_t) NULL},
 };
 
-static void SetGlobalDone(void)
+static void SetGlobalDone(int signum)
 {
     GlobalDone = 1L;
     fprintf(stderr,"Process Completed!\n");
     return;
 }
 
-static void print_req_callback(XETC *tc, XETrapDatum *data, char *my_buf)
+static void print_req_callback(XETC *tc, XETrapDatum *data, BYTE *my_buf)
 {
     char *req_type;
     req_type = (data->u.req.reqType == XETrapGetExtOpcode(tc) ? "XTrap" :
@@ -142,7 +142,7 @@ static void print_req_callback(XETC *tc, XETrapDatum *data, char *my_buf)
         (long)data->u.req.id);
 }
 
-static void print_evt_callback(XETC *tc, XETrapDatum *data, char *my_buf)
+static void print_evt_callback(XETC *tc, XETrapDatum *data, BYTE *my_buf)
 {
     static Time last_time = 0;
     int delta;
-- 
1.6.0.3



More information about the xorg mailing list