diff options
Diffstat (limited to 'lbx')
-rw-r--r-- | lbx/lbxcmap.c | 152 | ||||
-rw-r--r-- | lbx/lbxdix.c | 124 | ||||
-rw-r--r-- | lbx/lbxexts.c | 63 | ||||
-rw-r--r-- | lbx/lbxgfx.c | 121 | ||||
-rw-r--r-- | lbx/lbxmain.c | 279 | ||||
-rw-r--r-- | lbx/lbxopts.c | 221 | ||||
-rw-r--r-- | lbx/lbxprop.c | 53 | ||||
-rw-r--r-- | lbx/lbxserve.h | 204 | ||||
-rw-r--r-- | lbx/lbxsquish.c | 6 | ||||
-rw-r--r-- | lbx/lbxsrvopts.h | 43 | ||||
-rw-r--r-- | lbx/lbxswap.c | 138 | ||||
-rw-r--r-- | lbx/lbxtables.c | 8 | ||||
-rw-r--r-- | lbx/lbxtags.c | 59 | ||||
-rw-r--r-- | lbx/lbxtags.h | 57 | ||||
-rw-r--r-- | lbx/lbxzerorep.c | 8 |
15 files changed, 721 insertions, 815 deletions
diff --git a/lbx/lbxcmap.c b/lbx/lbxcmap.c index 6af20b03b..25ef34426 100644 --- a/lbx/lbxcmap.c +++ b/lbx/lbxcmap.c @@ -25,6 +25,7 @@ not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ +/* $XFree86: xc/programs/Xserver/lbx/lbxcmap.c,v 1.10 2001/12/14 19:59:59 dawes Exp $ */ #include <sys/types.h> #define NEED_REPLIES @@ -38,6 +39,7 @@ from The Open Group. #include "resource.h" #include "scrnintstr.h" #include "colormapst.h" +#include "propertyst.h" #define _XLBX_SERVER_ #include "lbxstr.h" #include "lbxserve.h" @@ -50,6 +52,7 @@ static int lbxColormapPrivIndex; /* lbx colormap private index */ typedef struct { /* lbx screen private */ CreateColormapProcPtr CreateColormap; DestroyColormapProcPtr DestroyColormap; + CloseScreenProcPtr CloseScreen; } LbxScreenPriv; typedef struct _LbxStalled { @@ -70,8 +73,7 @@ typedef struct _LbxColormapPriv { /* lbx colormap private */ #define CMAP_GRABBED 1 #define CMAP_WAITING_FOR_UNGRAB 2 -static int LbxUnstallClient(); -void LbxReleaseCmap(); +static int LbxUnstallClient(pointer data, XID id); static RESTYPE StalledResType; @@ -80,8 +82,7 @@ static RESTYPE StalledResType; */ static LbxColormapPriv * -LbxColormapPrivInit (pmap) - ColormapPtr pmap; +LbxColormapPrivInit (ColormapPtr pmap) { LbxColormapPriv *cmapPriv; @@ -103,16 +104,18 @@ LbxColormapPrivInit (pmap) static int -LbxDefCmapPrivInit (pmap) - ColormapPtr pmap; +LbxDefCmapPrivInit (ColormapPtr pmap) { +#if 0 + /* BUG: You can't do that. lbxColormapPrivIndex hasn't + been initialized yet. */ pmap->devPrivates[lbxColormapPrivIndex].ptr = NULL; +#endif return 1; } static Bool -LbxCreateColormap (pmap) - ColormapPtr pmap; +LbxCreateColormap (ColormapPtr pmap) { ScreenPtr pScreen = pmap->pScreen; Bool ret; @@ -129,8 +132,7 @@ LbxCreateColormap (pmap) } static void -LbxDestroyColormap (pmap) - ColormapPtr pmap; +LbxDestroyColormap (ColormapPtr pmap) { ScreenPtr pScreen = pmap->pScreen; @@ -143,15 +145,30 @@ LbxDestroyColormap (pmap) pScreen->DestroyColormap = LbxDestroyColormap; } +static Bool +LbxCloseScreen(int i, ScreenPtr pScreen) +{ + LbxScreenPriv* pLbxScrPriv = ((LbxScreenPriv *) + (pScreen->devPrivates[lbxScreenPrivIndex].ptr)); + + pScreen->CloseScreen = pLbxScrPriv->CloseScreen; + + xfree(pScreen->devPrivates[lbxScreenPrivIndex].ptr); + pScreen->devPrivates[lbxScreenPrivIndex].ptr = NULL; + + return pScreen->CloseScreen(i, pScreen); +} + /* * Initialize LBX colormap private. */ int -LbxCmapInit () +LbxCmapInit (void) { LbxScreenPriv *pScreenPriv; + ColormapPtr defMap; ScreenPtr pScreen; int i; @@ -169,6 +186,12 @@ LbxCmapInit () { pScreen = screenInfo.screens[i]; + defMap = (ColormapPtr) LookupIDByType( + pScreen->defColormap, RT_COLORMAP); + + /* now lbxColormapPrivIndex exists */ + defMap->devPrivates[lbxColormapPrivIndex].ptr = NULL; + pScreenPriv = (LbxScreenPriv *) xalloc (sizeof (LbxScreenPriv)); if (!pScreenPriv) return 0; @@ -177,21 +200,21 @@ LbxCmapInit () pScreen->CreateColormap = LbxCreateColormap; pScreenPriv->DestroyColormap = pScreen->DestroyColormap; pScreen->DestroyColormap = LbxDestroyColormap; + pScreenPriv->CloseScreen = pScreen->CloseScreen; + pScreen->CloseScreen = LbxCloseScreen; pScreen->devPrivates[lbxScreenPrivIndex].ptr = (pointer) pScreenPriv; } return 1; } - /* * Return the number of allocated cells in the PSEUDO colormap. */ static int -NumAllocatedCells (pent, size) - EntryPtr pent; - int size; +NumAllocatedCells (EntryPtr pent, + int size) { Pixel pixel; int count = 0; @@ -222,13 +245,12 @@ NumAllocatedCells (pent, size) */ static CARD8 * -OutputChannel(pmap, chan, size, ptr, flags, channels) - ColormapPtr pmap; - EntryPtr chan; - int size; - CARD8 *ptr; - CARD8 flags; - CARD8 channels; +OutputChannel(ColormapPtr pmap, + EntryPtr chan, + int size, + CARD8 *ptr, + CARD8 flags, + CARD8 channels) { Bool px2; Bool rgb2; @@ -247,7 +269,7 @@ OutputChannel(pmap, chan, size, ptr, flags, channels) else shift = 15 - (flags & LBX_RGB_BITS_MASK); rgb_sz = rgb2 + 1; - if (channels == DoRed|DoGreen|DoBlue) + if (channels == (DoRed|DoGreen|DoBlue)) rgb_sz *= 3; /* kinda gross, but ddxen use AllocAll on static maps */ allocpriv = (pmap->pVisual->class & DynamicClass) ? AllocPrivate : 0; @@ -332,11 +354,10 @@ OutputChannel(pmap, chan, size, ptr, flags, channels) } static void -GetAllocatedCells (pmap, flags, buf, bytes) - ColormapPtr pmap; - CARD8 *flags; - CARD8 *buf; - int *bytes; +GetAllocatedCells (ColormapPtr pmap, + CARD8 *flags, + CARD8 *buf, + int *bytes) { CARD8 *ptr; @@ -368,9 +389,8 @@ GetAllocatedCells (pmap, flags, buf, bytes) */ static void -SendReleaseCmapEvent (proxy, cmap) - LbxProxyPtr proxy; - Colormap cmap; +SendReleaseCmapEvent (LbxProxyPtr proxy, + Colormap cmap) { xLbxReleaseCmapEvent ev; ClientPtr client; @@ -413,9 +433,8 @@ SendReleaseCmapEvent (proxy, cmap) */ static Bool -WaitForServerCmapControl (client, pmap) - register ClientPtr client; - register ColormapPtr pmap; +WaitForServerCmapControl (ClientPtr client, + ColormapPtr pmap) { LbxColormapPriv *cmapPriv = (LbxColormapPriv *) (pmap->devPrivates[lbxColormapPrivIndex].ptr); @@ -449,10 +468,9 @@ WaitForServerCmapControl (client, pmap) */ Bool -LbxCheckColorRequest (client, pmap, req) - ClientPtr client; - ColormapPtr pmap; - xReq *req; +LbxCheckColorRequest (ClientPtr client, + ColormapPtr pmap, + xReq *req) { LbxColormapPriv *cmapPriv = (LbxColormapPriv *) (pmap->devPrivates[lbxColormapPrivIndex].ptr); @@ -543,9 +561,8 @@ LbxCheckColorRequest (client, pmap, req) } static Bool -LbxGrabbedByClient (client, pmap) - ClientPtr client; - ColormapPtr pmap; +LbxGrabbedByClient (ClientPtr client, + ColormapPtr pmap) { LbxColormapPriv *cmapPriv = (LbxColormapPriv *) (pmap->devPrivates[lbxColormapPrivIndex].ptr); @@ -559,8 +576,7 @@ LbxGrabbedByClient (client, pmap) */ int -LbxCheckCmapGrabbed (pmap) - ColormapPtr pmap; +LbxCheckCmapGrabbed (ColormapPtr pmap) { LbxColormapPriv *cmapPriv = (LbxColormapPriv *) (pmap->devPrivates[lbxColormapPrivIndex].ptr); @@ -574,8 +590,7 @@ LbxCheckCmapGrabbed (pmap) */ void -LbxDisableSmartGrab (pmap) - ColormapPtr pmap; +LbxDisableSmartGrab (ColormapPtr pmap) { LbxColormapPriv *cmapPriv = (LbxColormapPriv *) (pmap->devPrivates[lbxColormapPrivIndex].ptr); @@ -590,11 +605,10 @@ LbxDisableSmartGrab (pmap) */ static void -SendFreeCellsEvent (proxy, cmap, pixel_start, pixel_end) - LbxProxyPtr proxy; - Colormap cmap; - Pixel pixel_start; - Pixel pixel_end; +SendFreeCellsEvent (LbxProxyPtr proxy, + Colormap cmap, + Pixel pixel_start, + Pixel pixel_end) { xLbxFreeCellsEvent ev; ClientPtr client; @@ -643,8 +657,7 @@ static long pixel_end; /*ARGSUSED*/ void -LbxBeginFreeCellsEvent (pmap) - ColormapPtr pmap; +LbxBeginFreeCellsEvent (ColormapPtr pmap) { pixel_start = -1; pixel_end = -1; @@ -652,9 +665,8 @@ LbxBeginFreeCellsEvent (pmap) void -LbxAddFreeCellToEvent (pmap, pixel) - ColormapPtr pmap; - Pixel pixel; +LbxAddFreeCellToEvent (ColormapPtr pmap, + Pixel pixel) { /* * We must notify the proxy that has this colormap @@ -688,8 +700,7 @@ LbxAddFreeCellToEvent (pmap, pixel) } void -LbxEndFreeCellsEvent (pmap) - ColormapPtr pmap; +LbxEndFreeCellsEvent (ColormapPtr pmap) { /* * Check if there is an LbxFreeCellEvent we need to write. @@ -713,9 +724,8 @@ LbxEndFreeCellsEvent (pmap) */ void -LbxSortPixelList (pixels, count) - Pixel *pixels; - int count; +LbxSortPixelList (Pixel *pixels, + int count) { int i, j; @@ -735,8 +745,7 @@ LbxSortPixelList (pixels, count) */ int -ProcLbxGrabCmap(client) - register ClientPtr client; +ProcLbxGrabCmap(ClientPtr client) { REQUEST(xLbxGrabCmapReq); xLbxGrabCmapReply *reply; @@ -928,9 +937,8 @@ ProcLbxGrabCmap(client) } static int -LbxUnstallClient(data, id) - pointer data; - XID id; +LbxUnstallClient(pointer data, + XID id) { LbxColormapPriv *cmapPriv = (LbxColormapPriv *)data; LbxStalled **prev; @@ -946,9 +954,8 @@ LbxUnstallClient(data, id) } void -LbxReleaseCmap(pmap, smart) - ColormapPtr pmap; - Bool smart; +LbxReleaseCmap(ColormapPtr pmap, + Bool smart) { LbxColormapPriv *cmapPriv; ColormapPtr *prev; @@ -980,8 +987,7 @@ LbxReleaseCmap(pmap, smart) */ int -ProcLbxReleaseCmap(client) - register ClientPtr client; +ProcLbxReleaseCmap(ClientPtr client) { REQUEST(xLbxReleaseCmapReq); ColormapPtr pmap; @@ -1014,8 +1020,7 @@ ProcLbxReleaseCmap(client) */ int -ProcLbxAllocColor(client) - register ClientPtr client; +ProcLbxAllocColor(ClientPtr client) { REQUEST(xLbxAllocColorReq); ColormapPtr pmap; @@ -1074,8 +1079,7 @@ ProcLbxAllocColor(client) */ int -ProcLbxIncrementPixel(client) - register ClientPtr client; +ProcLbxIncrementPixel(ClientPtr client) { REQUEST(xLbxIncrementPixelReq); ColormapPtr pmap; diff --git a/lbx/lbxdix.c b/lbx/lbxdix.c index e4822f190..5a40614f6 100644 --- a/lbx/lbxdix.c +++ b/lbx/lbxdix.c @@ -46,6 +46,7 @@ in this Software without prior written authorization from The Open Group. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * */ +/* $XFree86: xc/programs/Xserver/lbx/lbxdix.c,v 1.8 2001/12/14 19:59:59 dawes Exp $ */ /* various bits of DIX-level mangling */ @@ -72,18 +73,15 @@ in this Software without prior written authorization from The Open Group. #include "lbxtags.h" #include "lbxdata.h" #include "Xfuncproto.h" +#ifdef XAPPGROUP +#include "Xagsrv.h" +#endif +#include "swaprep.h" -extern void CopySwap32Write(); -extern int (*ProcVector[256]) (); -extern int (*SwappedProcVector[256]) (); -extern void (*ReplySwapVector[256]) (); - -extern void LbxWriteSConnSetupPrefix(); - -int lbx_font_private; +int lbx_font_private = -1; void -LbxDixInit() +LbxDixInit(void) { TagInit(); lbx_font_private = AllocateFontPrivateIndex(); @@ -91,23 +89,20 @@ LbxDixInit() /* ARGSUSED */ void -LbxAllowMotion(client, num) - ClientPtr client; - int num; +LbxAllowMotion(ClientPtr client, + int num) { LbxProxyPtr proxy = LbxProxy(client); proxy->motion_allowed_events += num; } -extern WindowPtr *WindowTable; extern xConnSetupPrefix connSetupPrefix; extern char *ConnectionInfo; extern int connBlockScreenStart; int -LbxSendConnSetup(client, reason) - ClientPtr client; - char *reason; +LbxSendConnSetup(ClientPtr client, + char *reason) { int dlength; int i, ndex, lim, wndex; @@ -190,13 +185,10 @@ LbxSendConnSetup(client, reason) return client->noClientException; } -extern InputInfo inputInfo; - static XID modifier_map_tag; int -LbxGetModifierMapping(client) - ClientPtr client; +LbxGetModifierMapping(ClientPtr client) { TagData td; pointer tagdata; @@ -245,7 +237,7 @@ LbxGetModifierMapping(client) } void -LbxFlushModifierMapTag() +LbxFlushModifierMapTag(void) { if (modifier_map_tag) @@ -255,8 +247,7 @@ LbxFlushModifierMapTag() static XID keyboard_map_tag; int -LbxGetKeyboardMapping(client) - ClientPtr client; +LbxGetKeyboardMapping(ClientPtr client) { TagData td; pointer tagdata; @@ -318,7 +309,7 @@ LbxGetKeyboardMapping(client) WriteToClient(client, sizeof(xLbxGetKeyboardMappingReply), (char *)&rep); if (send_data) { - client->pSwapReplyFunc = CopySwap32Write; + client->pSwapReplyFunc = (ReplySwapPtr)CopySwap32Write; WriteSwappedDataToClient(client, curKeySyms->mapWidth * stuff->count * sizeof(KeySym), &curKeySyms->map[(stuff->firstKeyCode - curKeySyms->minKeyCode) * @@ -328,7 +319,7 @@ LbxGetKeyboardMapping(client) } void -LbxFlushKeyboardMapTag() +LbxFlushKeyboardMapTag(void) { if (keyboard_map_tag) TagDeleteTag(keyboard_map_tag); @@ -336,8 +327,7 @@ LbxFlushKeyboardMapTag() /* counts number of bits needed to hold value */ static int -_bitsize(val) - int val; +_bitsize(int val) { int bits = 1; /* always need one for sign bit */ @@ -364,10 +354,9 @@ _bitsize(val) int _lbx_fi_junklen = sizeof(BYTE) * 2 + sizeof(CARD16) + sizeof(CARD32); static int -squish_font_info(qfr, rlen, sqrep) - xQueryFontReply *qfr; - int rlen; - xLbxFontInfo **sqrep; +squish_font_info(xQueryFontReply *qfr, + int rlen, + xLbxFontInfo **sqrep) { int len, hlen; @@ -459,8 +448,7 @@ squish_font_info(qfr, rlen, sqrep) } int -LbxQueryFont(client) - ClientPtr client; +LbxQueryFont(ClientPtr client) { xQueryFontReply *reply; xLbxQueryFontReply lbxrep; @@ -596,8 +584,7 @@ LbxQueryFont(client) } void -LbxFreeFontTag(pfont) - FontPtr pfont; +LbxFreeFontTag(FontPtr pfont) { FontTagInfoPtr ftip; @@ -606,19 +593,18 @@ LbxFreeFontTag(pfont) TagDeleteTag(ftip->tid); } -LbxInvalidateTag(client, tag) - ClientPtr client; - XID tag; +int +LbxInvalidateTag(ClientPtr client, + XID tag) { TagClearProxy(tag, LbxProxyID(client)); return client->noClientException; } void -LbxSendInvalidateTag(client, tag, tagtype) - ClientPtr client; - XID tag; - int tagtype; +LbxSendInvalidateTag(ClientPtr client, + XID tag, + int tagtype) { xLbxInvalidateTagEvent ev; int n; @@ -641,10 +627,9 @@ LbxSendInvalidateTag(client, tag, tagtype) } static void -LbxSendSendTagData(pid, tag, tagtype) - int pid; - XID tag; - int tagtype; +LbxSendSendTagData(int pid, + XID tag, + int tagtype) { xLbxSendTagDataEvent ev; int n; @@ -693,16 +678,15 @@ static SendTagQPtr queried_tags = NULL; #define LbxSendTagAlreadySent 1 static Bool -LbxQueueSendTag(client, tag) - ClientPtr client; - XID tag; +LbxQueueSendTag(ClientPtr client, + XID tag) { SendTagQPtr stqp, *prev, new; ClientPtr *newlist; /* see if we're asking for one already in the pipeline */ - for (prev = &queried_tags; stqp = *prev; prev = &stqp->next) { + for (prev = &queried_tags; (stqp = *prev); prev = &stqp->next) { if (stqp->tag == tag) { /* add new client to list */ newlist = (ClientPtr *) xrealloc(stqp->stalled_clients, @@ -735,9 +719,8 @@ LbxQueueSendTag(client, tag) return LbxSendTagSendIt; } -SendTagQPtr -LbxFindQTag(tag) - XID tag; +static SendTagQPtr +LbxFindQTag(XID tag) { SendTagQPtr stqp; @@ -749,20 +732,18 @@ LbxFindQTag(tag) } static void -LbxFreeQTag(stqp) - SendTagQPtr stqp; +LbxFreeQTag(SendTagQPtr stqp) { xfree(stqp->stalled_clients); xfree(stqp); } static void -LbxRemoveQTag(tag) - XID tag; +LbxRemoveQTag(XID tag) { SendTagQPtr stqp, *prev; - for (prev = &queried_tags; stqp = *prev; prev = &stqp->next) { + for (prev = &queried_tags; (stqp = *prev); prev = &stqp->next) { if (stqp->tag == tag) { *prev = stqp->next; LbxFreeQTag(stqp); @@ -772,8 +753,7 @@ LbxRemoveQTag(tag) } Bool -LbxFlushQTag(tag) - XID tag; +LbxFlushQTag(XID tag) { SendTagQPtr stqp; ClientPtr *cp; @@ -788,7 +768,7 @@ LbxFlushQTag(tag) } void -ProcessQTagZombies() +ProcessQTagZombies(void) { SendTagQPtr stqp; ClientPtr *out, *in; @@ -810,11 +790,10 @@ ProcessQTagZombies() */ void -LbxQueryTagData(client, owner_pid, tag, tagtype) - ClientPtr client; - int owner_pid; - XID tag; - int tagtype; +LbxQueryTagData(ClientPtr client, + int owner_pid, + XID tag, + int tagtype) { /* save the info and the client being stalled */ if (LbxQueueSendTag(client, tag) == LbxSendTagSendIt) @@ -825,11 +804,10 @@ LbxQueryTagData(client, owner_pid, tag, tagtype) * server recieves this */ int -LbxTagData(client, tag, len, data) - ClientPtr client; - XID tag; - unsigned long len; - pointer data; +LbxTagData(ClientPtr client, + XID tag, + unsigned long len, + pointer data) { TagData td; PropertyPtr pProp; @@ -872,7 +850,7 @@ LbxTagData(client, tag, len, data) /* when server resets, need to reset global tags */ void -LbxResetTags() +LbxResetTags(void) { SendTagQPtr stqp; @@ -880,7 +858,7 @@ LbxResetTags() keyboard_map_tag = 0; /* clean out any pending tag requests */ - while (stqp = queried_tags) { + while ((stqp = queried_tags)) { queried_tags = stqp->next; LbxFreeQTag(stqp); } diff --git a/lbx/lbxexts.c b/lbx/lbxexts.c index 4ee5f87c6..d611a7f2c 100644 --- a/lbx/lbxexts.c +++ b/lbx/lbxexts.c @@ -21,13 +21,17 @@ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * */ +/* $XFree86: xc/programs/Xserver/lbx/lbxexts.c,v 1.4 2001/02/16 13:24:10 eich Exp $ */ #include "X.h" #include "Xproto.h" #include "misc.h" #include "dixstruct.h" +#include "colormapst.h" +#include "propertyst.h" #define _XLBX_SERVER_ #include "lbxstr.h" +#include "lbxserve.h" #ifdef XCSECURITY #define _SECURITY_SERVER #include "extensions/security.h" @@ -54,15 +58,14 @@ static int num_exts = 0; Bool -LbxAddExtension(name, opcode, ev_base, err_base) - char *name; - int opcode; - int ev_base, - err_base; +LbxAddExtension(char *name, + int opcode, + int ev_base, + int err_base) { int i; - register LbxExtensionEntry *ext, - **newexts; + LbxExtensionEntry *ext, + **newexts; ext = (LbxExtensionEntry *) xalloc(sizeof(LbxExtensionEntry)); if (!ext) @@ -102,9 +105,8 @@ LbxAddExtension(name, opcode, ev_base, err_base) } Bool -LbxAddExtensionAlias(idx, alias) - int idx; - char *alias; +LbxAddExtensionAlias(int idx, + char *alias) { char *name; char **aliases; @@ -125,9 +127,8 @@ LbxAddExtensionAlias(idx, alias) } static int -LbxFindExtension(extname, len) - char *extname; - int len; +LbxFindExtension(char *extname, + int len) { int i, j; @@ -145,9 +146,8 @@ LbxFindExtension(extname, len) } void -LbxDeclareExtensionSecurity(extname, secure) - char *extname; - Bool secure; +LbxDeclareExtensionSecurity(char *extname, + Bool secure) { #ifdef XCSECURITY int i = LbxFindExtension(extname, strlen(extname)); @@ -157,11 +157,10 @@ LbxDeclareExtensionSecurity(extname, secure) } Bool -LbxRegisterExtensionGenerationMasks(idx, num_reqs, rep_mask, ev_mask) - int idx; - int num_reqs; - char *rep_mask, - *ev_mask; +LbxRegisterExtensionGenerationMasks(int idx, + int num_reqs, + char *rep_mask, + char *ev_mask) { LbxExtensionEntry *ext = lbx_extensions[idx]; CARD8 *nrm, @@ -186,10 +185,9 @@ LbxRegisterExtensionGenerationMasks(idx, num_reqs, rep_mask, ev_mask) } int -LbxQueryExtension(client, ename, nlen) - ClientPtr client; - char *ename; - int nlen; +LbxQueryExtension(ClientPtr client, + char *ename, + int nlen) { xLbxQueryExtensionReply rep; int i; @@ -237,12 +235,15 @@ LbxQueryExtension(client, ename, nlen) return Success; } -LbxCloseDownExtensions() +void +LbxCloseDownExtensions(void) { - int i; + int i,j; for (i = 0; i < num_exts; i++) { xfree(lbx_extensions[i]->name); + for (j = 0; j < lbx_extensions[i]->num_aliases; j++) + xfree(lbx_extensions[i]->aliases[j]); xfree(lbx_extensions[i]->aliases); xfree(lbx_extensions[i]->rep_mask); xfree(lbx_extensions[i]->ev_mask); @@ -251,13 +252,13 @@ LbxCloseDownExtensions() xfree(lbx_extensions); lbx_extensions = NULL; num_exts = 0; + } void -LbxSetReqMask(mask, req, on) - CARD8 *mask; - int req; - Bool on; +LbxSetReqMask(CARD8 *mask, + int req, + Bool on) { int mword = req / (8 * sizeof(CARD8)); diff --git a/lbx/lbxgfx.c b/lbx/lbxgfx.c index 25e87cc63..6eb7af197 100644 --- a/lbx/lbxgfx.c +++ b/lbx/lbxgfx.c @@ -21,6 +21,7 @@ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * */ +/* $XFree86: xc/programs/Xserver/lbx/lbxgfx.c,v 1.4 2001/08/23 14:46:57 alanh Exp $ */ /* various bits of DIX-level mangling */ @@ -48,21 +49,17 @@ #define DrawableCache(client) (LbxClient(client)->drawableCache) #define GContextCache(client) (LbxClient(client)->gcontextCache) -extern int (*ProcVector[256])(); - static void -push (cache, xid) - XID cache[GFX_CACHE_SIZE]; - XID xid; +push (XID cache[GFX_CACHE_SIZE], + XID xid) { memmove (cache+1, cache, (GFX_CACHE_SIZE - 1) * sizeof (cache[0])); cache[0] = xid; } static XID -use (cache, i) - XID cache[GFX_CACHE_SIZE]; - int i; +use (XID cache[GFX_CACHE_SIZE], + int i) { XID tmp; @@ -77,13 +74,12 @@ use (cache, i) extern char *ConnectionInfo; -int -LbxDecodeGFXCache(client, cacheEnts, after, drawp, gcp) - ClientPtr client; - CARD8 cacheEnts; - char *after; - Drawable *drawp; - GContext *gcp; +static int +LbxDecodeGFXCache(ClientPtr client, + CARD8 cacheEnts, + char *after, + Drawable *drawp, + GContext *gcp) { int skip; int dcache, gcache; @@ -111,12 +107,11 @@ LbxDecodeGFXCache(client, cacheEnts, after, drawp, gcp) return skip; } -int -LbxDecodeDrawableCache(client, cacheEnts, after, drawp) - ClientPtr client; - CARD8 cacheEnts; - char *after; - Drawable *drawp; +static int +LbxDecodeDrawableCache(ClientPtr client, + CARD8 cacheEnts, + char *after, + Drawable *drawp) { int skip; int dcache; @@ -135,12 +130,12 @@ LbxDecodeDrawableCache(client, cacheEnts, after, drawp) return skip; } -int -LbxDecodeGCCache(client, cacheEnts, after, gcp) - ClientPtr client; - CARD8 cacheEnts; - char *after; - GContext *gcp; +#ifdef notyet +static int +LbxDecodeGCCache(ClientPtr client, + CARD8 cacheEnts, + char *after, + GContext *gcp) { int skip; int gcache; @@ -158,6 +153,7 @@ LbxDecodeGCCache(client, cacheEnts, after, gcp) *gcp = use (GContextCache(client), gcache); return skip; } +#endif #define GFX_GET_DRAWABLE_AND_GC(type,in,len) {\ int skip; \ @@ -203,10 +199,9 @@ LbxDecodeGCCache(client, cacheEnts, after, gcp) } int -LbxDecodePoly(client, xreqtype, decode_rtn) - register ClientPtr client; - CARD8 xreqtype; - int (*decode_rtn)(); +LbxDecodePoly(ClientPtr client, + CARD8 xreqtype, + int (*decode_rtn)(char *, char *, short *)) { REQUEST(xLbxPolyPointReq); char *in; @@ -220,7 +215,7 @@ LbxDecodePoly(client, xreqtype, decode_rtn) if ((xreq = (xPolyPointReq *) xalloc(sizeof(xPolyPointReq) + (len << 1))) == NULL) return BadAlloc; - len = (*decode_rtn)(in, in + len - stuff->padBytes, &xreq[1]); + len = (*decode_rtn)(in, in + len - stuff->padBytes, (short *)(&xreq[1])); xreq->reqType = xreqtype; xreq->coordMode = 1; xreq->drawable = drawable; @@ -234,8 +229,7 @@ LbxDecodePoly(client, xreqtype, decode_rtn) } int -LbxDecodeFillPoly(client) - register ClientPtr client; +LbxDecodeFillPoly(ClientPtr client) { REQUEST(xLbxFillPolyReq); char *in; @@ -314,10 +308,9 @@ LbxDecodeFillPoly(client) } int -LbxDecodePoints(in, inend, out) - register char *in; - char *inend; - register short *out; +LbxDecodePoints(char *in, + char *inend, + short *out) { char *start_out = (char *)out; @@ -331,12 +324,11 @@ LbxDecodePoints(in, inend, out) } int -LbxDecodeSegment(in, inend, out) - register char *in; - char *inend; - register short *out; +LbxDecodeSegment(char *in, + char *inend, + short *out) { - register short diff; + short diff; short last_x = 0; short last_y = 0; char *start_out = (char *)out; @@ -362,12 +354,11 @@ LbxDecodeSegment(in, inend, out) } int -LbxDecodeRectangle(in, inend, out) - register char *in; - char *inend; - register short *out; +LbxDecodeRectangle(char *in, + char *inend, + short *out) { - register short diff; + short diff; short last_x = 0; short last_y = 0; char *start_out = (char *)out; @@ -391,12 +382,11 @@ LbxDecodeRectangle(in, inend, out) } int -LbxDecodeArc(in, inend, out) - register char *in; - char *inend; - register short *out; +LbxDecodeArc(char *in, + char *inend, + short *out) { - register short diff; + short diff; short last_x = 0; short last_y = 0; char *start_out = (char *)out; @@ -425,8 +415,7 @@ LbxDecodeArc(in, inend, out) } int -LbxDecodeCopyArea (client) - ClientPtr client; +LbxDecodeCopyArea (ClientPtr client) { REQUEST(xLbxCopyAreaReq); char *in; @@ -452,8 +441,7 @@ LbxDecodeCopyArea (client) } int -LbxDecodeCopyPlane (client) - ClientPtr client; +LbxDecodeCopyPlane (ClientPtr client) { REQUEST(xLbxCopyPlaneReq); char *in; @@ -480,9 +468,8 @@ LbxDecodeCopyPlane (client) } static pointer -get_gfx_buffer(client, len) - ClientPtr client; - int len; +get_gfx_buffer(ClientPtr client, + int len) { LbxClientPtr lbxClient = LbxClient(client); pointer tmp; @@ -499,8 +486,7 @@ get_gfx_buffer(client, len) } int -LbxDecodePolyText (client) - ClientPtr client; +LbxDecodePolyText (ClientPtr client) { REQUEST(xLbxPolyTextReq); char *in, *pos; @@ -527,8 +513,7 @@ LbxDecodePolyText (client) } int -LbxDecodeImageText (client) - ClientPtr client; +LbxDecodeImageText (ClientPtr client) { REQUEST(xLbxImageTextReq); char *in, *pos; @@ -556,8 +541,7 @@ LbxDecodeImageText (client) } int -LbxDecodePutImage (client) - register ClientPtr client; +LbxDecodePutImage (ClientPtr client) { REQUEST (xLbxPutImageReq); char *in, *data; @@ -698,13 +682,12 @@ LbxDecodePutImage (client) } int -LbxDecodeGetImage (client) - register ClientPtr client; +LbxDecodeGetImage (ClientPtr client) { REQUEST (xLbxGetImageReq); xLbxGetImageReply *reply = NULL; int lbxLen, xLen, n; - int method, bytes, status; + int method = 0, bytes, status; xGetImageReply *theImage; REQUEST_SIZE_MATCH(xLbxGetImageReq); diff --git a/lbx/lbxmain.c b/lbx/lbxmain.c index 3fa565fef..1a82ce3b3 100644 --- a/lbx/lbxmain.c +++ b/lbx/lbxmain.c @@ -45,6 +45,7 @@ in this Software without prior written authorization from The Open Group. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * */ +/* $XFree86: xc/programs/Xserver/lbx/lbxmain.c,v 1.13 2001/12/14 20:00:00 dawes Exp $ */ #include <sys/types.h> #define NEED_REPLIES @@ -62,18 +63,20 @@ in this Software without prior written authorization from The Open Group. #include "gcstruct.h" #include "extnsionst.h" #include "servermd.h" -#include "lbxdeltastr.h" #define _XLBX_SERVER_ #include "lbxstr.h" +#include "lbxdeltastr.h" #include "lbxserve.h" #include "lbximage.h" #include "lbxsrvopts.h" +#include "lbxtags.h" #include "Xfuncproto.h" #include <errno.h> -#ifdef X_NOT_STDC_ENV -extern int errno; -#endif +#ifndef Lynx #include <sys/uio.h> +#else +#include <uio.h> +#endif #include <stdio.h> #ifndef X_NOT_POSIX @@ -84,26 +87,17 @@ extern int errno; #define MAXBYTESDIFF 8 -extern void LbxAllowMotion(); -extern int LbxDecodePoints(); -extern int LbxDecodeSegment(); -extern int LbxDecodeRectangle(); -extern int LbxDecodeArc(); - -extern int GrabInProgress; - int LbxWhoAmI = 1; /* * for lbx zlib library to know who we are * server = 1 * proxy = 0 */ -int ProcLbxDispatch(); -extern int SProcLbxDispatch(); -static void LbxResetProc(); -static int DecodeLbxDelta(); -static void LbxFreeClient (); -static void LbxShutdownProxy (); + +static void LbxResetProc ( ExtensionEntry *extEntry ); +static void LbxFreeClient ( ClientPtr client ); +static void LbxShutdownProxy ( LbxProxyPtr proxy ); +static int DecodeLbxDelta ( ClientPtr client ); static LbxProxyPtr proxyList; unsigned char LbxReqCode; @@ -117,7 +111,7 @@ LbxClientPtr lbxClients[MAXCLIENTS]; extern xConnSetupPrefix connSetupPrefix; extern char *ConnectionInfo; -extern int (*LbxInitialVector[3])(); +extern int (*LbxInitialVector[3])(ClientPtr); #ifdef DEBUG int lbxDebug = 0; @@ -125,7 +119,7 @@ int lbxDebug = 0; void -LbxExtensionInit() +LbxExtensionInit(void) { ExtensionEntry *extEntry; @@ -148,16 +142,14 @@ LbxExtensionInit() /*ARGSUSED*/ static void -LbxResetProc (extEntry) -ExtensionEntry *extEntry; +LbxResetProc (ExtensionEntry *extEntry) { LbxResetTags(); uid_seed = 0; } void -LbxCloseClient (client) - ClientPtr client; +LbxCloseClient (ClientPtr client) { xLbxCloseEvent closeEvent; ClientPtr master; @@ -204,10 +196,9 @@ LbxCloseClient (client) } static int -LbxReencodeEvent(client, proxy, buf) - ClientPtr client; - LbxProxyPtr proxy; - char *buf; +LbxReencodeEvent(ClientPtr client, + LbxProxyPtr proxy, + char *buf) { xEvent *ev = (xEvent *)buf; int n; @@ -366,27 +357,26 @@ LbxReencodeEvent(client, proxy, buf) } static int -LbxComposeDelta(proxy, reply, len, buf) - LbxProxyPtr proxy; - char *reply; - int len; - char *buf; +LbxComposeDelta(LbxProxyPtr proxy, + char *reply, + int len, + char *buf) { int diffs; int cindex; int n; xLbxDeltaReq *p = (xLbxDeltaReq *)buf; - diffs = LBXDeltaMinDiffs(&proxy->outdeltas, reply, len, + diffs = LBXDeltaMinDiffs(&proxy->outdeltas, (unsigned char *)reply, len, min(MAXBYTESDIFF, (len - sz_xLbxDeltaReq) >> 1), &cindex); if (diffs < 0) { - LBXAddDeltaOut(&proxy->outdeltas, reply, len); + LBXAddDeltaOut(&proxy->outdeltas, (unsigned char *)reply, len); return 0; } - LBXEncodeDelta(&proxy->outdeltas, reply, diffs, cindex, - &buf[sz_xLbxDeltaReq]); - LBXAddDeltaOut(&proxy->outdeltas, reply, len); + LBXEncodeDelta(&proxy->outdeltas, (unsigned char *)reply, diffs, cindex, + (unsigned char *)(&buf[sz_xLbxDeltaReq])); + LBXAddDeltaOut(&proxy->outdeltas, (unsigned char *)reply, len); p->reqType = LbxEventCode; p->lbxReqType = LbxDeltaEvent; p->diffs = diffs; @@ -400,12 +390,11 @@ LbxComposeDelta(proxy, reply, len, buf) } void -LbxReencodeOutput(client, pbuf, pcount, cbuf, ccount) - ClientPtr client; - char *pbuf; - int *pcount; - char *cbuf; - int *ccount; +LbxReencodeOutput(ClientPtr client, + char *pbuf, + int *pcount, + char *cbuf, + int *ccount) { LbxClientPtr lbxClient = LbxClient(client); LbxProxyPtr proxy = lbxClient->proxy; @@ -497,10 +486,9 @@ LbxReencodeOutput(client, pbuf, pcount, cbuf, ccount) /*ARGSUSED*/ static void -LbxReplyCallback(pcbl, nulldata, calldata) - CallbackListPtr *pcbl; - pointer nulldata; - pointer calldata; +LbxReplyCallback(CallbackListPtr *pcbl, + pointer nulldata, + pointer calldata) { ReplyInfoRec *pri = (ReplyInfoRec *)calldata; ClientPtr client = pri->client; @@ -520,9 +508,8 @@ LbxReplyCallback(pcbl, nulldata, calldata) */ /* ARGSUSED */ static Bool -LbxCheckCompressInput (dummy1, dummy2) - ClientPtr dummy1; - pointer dummy2; +LbxCheckCompressInput (ClientPtr dummy1, + pointer dummy2) { LbxProxyPtr proxy; @@ -538,8 +525,7 @@ LbxCheckCompressInput (dummy1, dummy2) } static Bool -LbxIsClientBlocked (lbxClient) - LbxClientPtr lbxClient; +LbxIsClientBlocked (LbxClientPtr lbxClient) { LbxProxyPtr proxy = lbxClient->proxy; @@ -549,9 +535,8 @@ LbxIsClientBlocked (lbxClient) } static void -LbxSwitchRecv (proxy, lbxClient) - LbxProxyPtr proxy; - LbxClientPtr lbxClient; +LbxSwitchRecv (LbxProxyPtr proxy, + LbxClientPtr lbxClient) { ClientPtr client; @@ -572,9 +557,8 @@ LbxSwitchRecv (proxy, lbxClient) /* ARGSUSED */ static Bool -LbxWaitForUnblocked (client, closure) - ClientPtr client; - pointer closure; +LbxWaitForUnblocked (ClientPtr client, + pointer closure) { LbxClientPtr lbxClient; LbxProxyPtr proxy; @@ -598,8 +582,7 @@ LbxWaitForUnblocked (client, closure) } void -LbxSetForBlock(lbxClient) - LbxClientPtr lbxClient; +LbxSetForBlock(LbxClientPtr lbxClient) { lbxClient->reqs_pending++; if (!lbxClient->input_blocked) @@ -611,9 +594,8 @@ LbxSetForBlock(lbxClient) /* ARGSUSED */ static int -LbxWaitForUngrab (client, closure) - ClientPtr client; - pointer closure; +LbxWaitForUngrab (ClientPtr client, + pointer closure) { LbxClientPtr lbxClient = LbxClient(client); LbxProxyPtr proxy; @@ -637,8 +619,7 @@ LbxWaitForUngrab (client, closure) } static void -LbxServerGrab(proxy) - LbxProxyPtr proxy; +LbxServerGrab(LbxProxyPtr proxy) { LbxClientPtr grabbingLbxClient; xLbxListenToOneEvent grabEvent; @@ -722,8 +703,7 @@ static Bool lbxCacheable[] = { #define NUM(a) (sizeof (a) / sizeof (a[0])) static int -LbxReadRequestFromClient (client) - ClientPtr client; +LbxReadRequestFromClient (ClientPtr client) { int ret; LbxClientPtr lbxClient = LbxClient(client); @@ -801,10 +781,9 @@ LbxReadRequestFromClient (client) } static LbxClientPtr -LbxInitClient (proxy, client, id) - LbxProxyPtr proxy; - ClientPtr client; - CARD32 id; +LbxInitClient (LbxProxyPtr proxy, + ClientPtr client, + CARD32 id) { LbxClientPtr lbxClient; int i; @@ -836,8 +815,7 @@ LbxInitClient (proxy, client, id) } static void -LbxFreeClient (client) - ClientPtr client; +LbxFreeClient (ClientPtr client) { LbxClientPtr lbxClient = LbxClient(client); LbxProxyPtr proxy = lbxClient->proxy; @@ -866,8 +844,7 @@ LbxFreeClient (client) } static void -LbxFreeProxy (proxy) - LbxProxyPtr proxy; +LbxFreeProxy (LbxProxyPtr proxy) { LbxProxyPtr *p; @@ -907,8 +884,7 @@ LbxFreeProxy (proxy) } LbxProxyPtr -LbxPidToProxy(pid) - int pid; +LbxPidToProxy(int pid) { LbxProxyPtr proxy; @@ -920,8 +896,7 @@ LbxPidToProxy(pid) } static void -LbxShutdownProxy (proxy) - LbxProxyPtr proxy; +LbxShutdownProxy (LbxProxyPtr proxy) { int i; ClientPtr client; @@ -945,10 +920,9 @@ LbxShutdownProxy (proxy) int -ProcLbxQueryVersion(client) - register ClientPtr client; +ProcLbxQueryVersion (ClientPtr client) { - REQUEST(xLbxQueryVersionReq); + /* REQUEST(xLbxQueryVersionReq); */ xLbxQueryVersionReply rep; register int n; @@ -971,7 +945,7 @@ ProcLbxQueryVersion(client) } static int -NextProxyID() +NextProxyID (void) { LbxProxyPtr proxy; int id; @@ -986,8 +960,7 @@ NextProxyID() } int -ProcLbxStartProxy(client) - register ClientPtr client; +ProcLbxStartProxy (ClientPtr client) { REQUEST(xLbxStartProxyReq); LbxProxyPtr proxy; @@ -1036,9 +1009,9 @@ ProcLbxStartProxy(client) LbxOptionInit(&negopt); replylen = LbxOptionParse(&negopt, - &stuff[1], + (unsigned char *)&stuff[1], reqlen - sz_xLbxStartProxyReq, - &replybuf->optDataStart); + (unsigned char *)&replybuf->optDataStart); if (replylen < 0) { /* * Didn't understand option format, so we'll just end up @@ -1136,10 +1109,9 @@ ProcLbxStartProxy(client) } int -ProcLbxStopProxy(client) - register ClientPtr client; +ProcLbxStopProxy(ClientPtr client) { - REQUEST(xLbxStopProxyReq); + /* REQUEST(xLbxStopProxyReq); */ LbxProxyPtr proxy; LbxClientPtr lbxClient = LbxClient(client); @@ -1157,8 +1129,7 @@ ProcLbxStopProxy(client) } int -ProcLbxSwitch(client) - register ClientPtr client; +ProcLbxSwitch(ClientPtr client) { REQUEST(xLbxSwitchReq); LbxProxyPtr proxy = LbxMaybeProxy(client); @@ -1180,8 +1151,7 @@ ProcLbxSwitch(client) } int -ProcLbxBeginLargeRequest(client) - register ClientPtr client; +ProcLbxBeginLargeRequest(ClientPtr client) { REQUEST(xLbxBeginLargeRequestReq); @@ -1194,8 +1164,7 @@ ProcLbxBeginLargeRequest(client) int -ProcLbxLargeRequestData(client) - register ClientPtr client; +ProcLbxLargeRequestData(ClientPtr client) { REQUEST(xLbxLargeRequestDataReq); @@ -1209,10 +1178,9 @@ ProcLbxLargeRequestData(client) int -ProcLbxEndLargeRequest(client) - register ClientPtr client; +ProcLbxEndLargeRequest(ClientPtr client) { - REQUEST(xReq); + /* REQUEST(xReq); */ client->sequence--; REQUEST_SIZE_MATCH(xReq); @@ -1221,8 +1189,7 @@ ProcLbxEndLargeRequest(client) int -ProcLbxInternAtoms(client) - register ClientPtr client; +ProcLbxInternAtoms(ClientPtr client) { REQUEST(xLbxInternAtomsReq); LbxClientPtr lbxClient = LbxClient(client); @@ -1288,8 +1255,7 @@ ProcLbxInternAtoms(client) int -ProcLbxGetWinAttrAndGeom(client) - register ClientPtr client; +ProcLbxGetWinAttrAndGeom(ClientPtr client) { REQUEST(xLbxGetWinAttrAndGeomReq); xGetWindowAttributesReply wa; @@ -1368,8 +1334,7 @@ ProcLbxGetWinAttrAndGeom(client) } int -ProcLbxNewClient(client) - register ClientPtr client; +ProcLbxNewClient(ClientPtr client) { REQUEST(xLbxNewClientReq); ClientPtr newClient; @@ -1417,8 +1382,7 @@ ProcLbxNewClient(client) } int -ProcLbxEstablishConnection(client) - register ClientPtr client; +ProcLbxEstablishConnection(ClientPtr client) { char *reason = NULL; char *auth_proto, *auth_string; @@ -1445,8 +1409,7 @@ ProcLbxEstablishConnection(client) } int -ProcLbxCloseClient (client) - register ClientPtr client; +ProcLbxCloseClient (ClientPtr client) { REQUEST(xLbxCloseClientReq); LbxClientPtr lbxClient = LbxClient(client); @@ -1460,8 +1423,7 @@ ProcLbxCloseClient (client) } int -ProcLbxModifySequence (client) - register ClientPtr client; +ProcLbxModifySequence (ClientPtr client) { REQUEST(xLbxModifySequenceReq); @@ -1471,8 +1433,7 @@ ProcLbxModifySequence (client) } int -ProcLbxAllowMotion (client) - register ClientPtr client; +ProcLbxAllowMotion (ClientPtr client) { REQUEST(xLbxAllowMotionReq); @@ -1484,17 +1445,17 @@ ProcLbxAllowMotion (client) static int -DecodeLbxDelta(client) - register ClientPtr client; +DecodeLbxDelta (ClientPtr client) { REQUEST(xLbxDeltaReq); LbxClientPtr lbxClient = LbxClient(client); LbxProxyPtr proxy = lbxClient->proxy; int len; - char *buf; + unsigned char *buf; /* Note that LBXDecodeDelta decodes and adds current msg to the cache */ - len = LBXDecodeDelta(&proxy->indeltas, ((char *)stuff) + sz_xLbxDeltaReq, + len = LBXDecodeDelta(&proxy->indeltas, + (xLbxDiffItem *)(((char *)stuff) + sz_xLbxDeltaReq), stuff->diffs, stuff->cindex, &buf); /* * Some requests, such as FillPoly, result in the protocol input @@ -1511,58 +1472,52 @@ DecodeLbxDelta(client) } int -ProcLbxGetModifierMapping(client) - ClientPtr client; +ProcLbxGetModifierMapping(ClientPtr client) { - REQUEST(xLbxGetModifierMappingReq); + /* REQUEST(xLbxGetModifierMappingReq); */ REQUEST_SIZE_MATCH(xLbxGetModifierMappingReq); return LbxGetModifierMapping(client); } int -ProcLbxGetKeyboardMapping(client) - ClientPtr client; +ProcLbxGetKeyboardMapping(ClientPtr client) { - REQUEST(xLbxGetKeyboardMappingReq); + /* REQUEST(xLbxGetKeyboardMappingReq); */ REQUEST_SIZE_MATCH(xLbxGetKeyboardMappingReq); return LbxGetKeyboardMapping(client); } int -ProcLbxQueryFont(client) - ClientPtr client; +ProcLbxQueryFont(ClientPtr client) { - REQUEST(xLbxQueryFontReq); + /* REQUEST(xLbxQueryFontReq); */ REQUEST_SIZE_MATCH(xLbxQueryFontReq); return LbxQueryFont(client); } int -ProcLbxChangeProperty(client) - ClientPtr client; +ProcLbxChangeProperty(ClientPtr client) { - REQUEST(xLbxChangePropertyReq); + /* REQUEST(xLbxChangePropertyReq); */ REQUEST_SIZE_MATCH(xLbxChangePropertyReq); return LbxChangeProperty(client); } int -ProcLbxGetProperty(client) - ClientPtr client; +ProcLbxGetProperty(ClientPtr client) { - REQUEST(xLbxGetPropertyReq); + /* REQUEST(xLbxGetPropertyReq); */ REQUEST_SIZE_MATCH(xLbxGetPropertyReq); return LbxGetProperty(client); } int -ProcLbxTagData(client) - ClientPtr client; +ProcLbxTagData(ClientPtr client) { REQUEST(xLbxTagDataReq); @@ -1574,8 +1529,7 @@ ProcLbxTagData(client) } int -ProcLbxInvalidateTag(client) - ClientPtr client; +ProcLbxInvalidateTag(ClientPtr client) { REQUEST(xLbxInvalidateTagReq); @@ -1585,93 +1539,80 @@ ProcLbxInvalidateTag(client) } int -ProcLbxPolyPoint(client) - register ClientPtr client; +ProcLbxPolyPoint(ClientPtr client) { return LbxDecodePoly(client, X_PolyPoint, LbxDecodePoints); } int -ProcLbxPolyLine(client) - register ClientPtr client; +ProcLbxPolyLine(ClientPtr client) { return LbxDecodePoly(client, X_PolyLine, LbxDecodePoints); } int -ProcLbxPolySegment(client) - register ClientPtr client; +ProcLbxPolySegment(ClientPtr client) { return LbxDecodePoly(client, X_PolySegment, LbxDecodeSegment); } int -ProcLbxPolyRectangle(client) - register ClientPtr client; +ProcLbxPolyRectangle(ClientPtr client) { return LbxDecodePoly(client, X_PolyRectangle, LbxDecodeRectangle); } int -ProcLbxPolyArc(client) - register ClientPtr client; +ProcLbxPolyArc(ClientPtr client) { return LbxDecodePoly(client, X_PolyArc, LbxDecodeArc); } int -ProcLbxFillPoly(client) - register ClientPtr client; +ProcLbxFillPoly(ClientPtr client) { return LbxDecodeFillPoly(client); } int -ProcLbxPolyFillRectangle(client) - register ClientPtr client; +ProcLbxPolyFillRectangle(ClientPtr client) { return LbxDecodePoly(client, X_PolyFillRectangle, LbxDecodeRectangle); } int -ProcLbxPolyFillArc(client) - register ClientPtr client; +ProcLbxPolyFillArc(ClientPtr client) { return LbxDecodePoly(client, X_PolyFillArc, LbxDecodeArc); } int -ProcLbxCopyArea (client) - register ClientPtr client; +ProcLbxCopyArea(ClientPtr client) { return LbxDecodeCopyArea(client); } int -ProcLbxCopyPlane (client) - register ClientPtr client; +ProcLbxCopyPlane(ClientPtr client) { return LbxDecodeCopyPlane(client); } int -ProcLbxPolyText (client) - register ClientPtr client; +ProcLbxPolyText(ClientPtr client) { return LbxDecodePolyText(client); } int -ProcLbxImageText (client) - register ClientPtr client; +ProcLbxImageText(ClientPtr client) { return LbxDecodeImageText(client); } int -ProcLbxQueryExtension(client) - ClientPtr client; +ProcLbxQueryExtension(ClientPtr client) { REQUEST(xLbxQueryExtensionReq); char *ename; @@ -1682,23 +1623,20 @@ ProcLbxQueryExtension(client) } int -ProcLbxPutImage(client) - register ClientPtr client; +ProcLbxPutImage(ClientPtr client) { return LbxDecodePutImage(client); } int -ProcLbxGetImage(client) - register ClientPtr client; +ProcLbxGetImage(ClientPtr client) { return LbxDecodeGetImage(client); } int -ProcLbxSync(client) - register ClientPtr client; +ProcLbxSync(ClientPtr client) { xLbxSyncReply reply; @@ -1727,8 +1665,7 @@ ProcLbxSync(client) int -ProcLbxDispatch (client) - register ClientPtr client; +ProcLbxDispatch(ClientPtr client) { REQUEST(xReq); switch (stuff->data) diff --git a/lbx/lbxopts.c b/lbx/lbxopts.c index fe9af687e..461f0d778 100644 --- a/lbx/lbxopts.c +++ b/lbx/lbxopts.c @@ -21,6 +21,7 @@ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * */ +/* $XFree86: xc/programs/Xserver/lbx/lbxopts.c,v 1.6 2001/10/28 03:34:12 tsi Exp $ */ #ifdef OPTDEBUG #include <stdio.h> @@ -28,6 +29,8 @@ #include "X.h" #include "Xproto.h" #include "misc.h" +#include "colormapst.h" +#include "propertyst.h" #include "lbxserve.h" #include "lbxstr.h" #include "lbximage.h" @@ -37,22 +40,35 @@ #include "lbxzlib.h" #endif /* NO_ZLIB */ -static int LbxDeltaOpt(); -static int LbxProxyDeltaOpt(); -static int LbxServerDeltaOpt(); -static int LbxStreamCompOpt(); -static int LbxBitmapCompOpt(); -static int LbxPixmapCompOpt(); -static int LbxMessageCompOpt(); -static int LbxUseTagsOpt(); -static int LbxCmapAllOpt(); +static int LbxProxyDeltaOpt ( LbxNegOptsPtr pno, unsigned char *popt, + int optlen, unsigned char *preply ); +static int LbxServerDeltaOpt ( LbxNegOptsPtr pno, unsigned char *popt, + int optlen, unsigned char *preply ); +static int LbxDeltaOpt ( unsigned char *popt, int optlen, + unsigned char *preply, short *pn, short *pmaxlen ); +static int LbxStreamCompOpt ( LbxNegOptsPtr pno, unsigned char *popt, + int optlen, unsigned char *preply ); +static int ZlibParse ( LbxNegOptsPtr pno, unsigned char *popt, int optlen, + unsigned char *preply ); +static int LbxMessageCompOpt ( LbxNegOptsPtr pno, unsigned char *popt, + int optlen, unsigned char *preply ); +static int LbxUseTagsOpt ( LbxNegOptsPtr pno, unsigned char *popt, + int optlen, unsigned char *preply ); +static int LbxBitmapCompOpt ( LbxNegOptsPtr pno, unsigned char *popt, + int optlen, unsigned char *preply ); +static int LbxPixmapCompOpt ( LbxNegOptsPtr pno, unsigned char *popt, + int optlen, unsigned char *preply ); +static int MergeDepths ( int *depths, LbxPixmapCompMethod *method ); +static int LbxCmapAllOpt ( LbxNegOptsPtr pno, unsigned char *popt, + int optlen, unsigned char *preply ); /* * List of LBX options we recognize and are willing to negotiate */ static struct _LbxOptionParser { CARD8 optcode; - int (*parser)(); + int (*parser)(LbxNegOptsPtr, unsigned char *, + int, unsigned char *); } LbxOptions[] = { { LBX_OPT_DELTA_PROXY, LbxProxyDeltaOpt }, { LBX_OPT_DELTA_SERVER, LbxServerDeltaOpt }, @@ -69,8 +85,8 @@ static struct _LbxOptionParser { /* * Set option defaults */ -LbxOptionInit(pno) - LbxNegOptsPtr pno; +void +LbxOptionInit(LbxNegOptsPtr pno) { bzero(pno, sizeof(LbxNegOptsRec)); pno->proxyDeltaN = pno->serverDeltaN = LBX_OPT_DELTA_NCACHE_DFLT; @@ -85,11 +101,10 @@ LbxOptionInit(pno) } int -LbxOptionParse(pno, popt, optlen, preply) - LbxNegOptsPtr pno; - unsigned char *popt; - int optlen; - unsigned char *preply; +LbxOptionParse(LbxNegOptsPtr pno, + unsigned char *popt, + int optlen, + unsigned char *preply) { int i; int nopts = *popt++; @@ -139,34 +154,31 @@ LbxOptionParse(pno, popt, optlen, preply) } static int -LbxProxyDeltaOpt(pno, popt, optlen, preply) - LbxNegOptsPtr pno; - unsigned char *popt; - int optlen; - unsigned char *preply; +LbxProxyDeltaOpt(LbxNegOptsPtr pno, + unsigned char *popt, + int optlen, + unsigned char *preply) { return LbxDeltaOpt(popt, optlen, preply, &pno->proxyDeltaN, &pno->proxyDeltaMaxLen); } static int -LbxServerDeltaOpt(pno, popt, optlen, preply) - LbxNegOptsPtr pno; - unsigned char *popt; - int optlen; - unsigned char *preply; +LbxServerDeltaOpt(LbxNegOptsPtr pno, + unsigned char *popt, + int optlen, + unsigned char *preply) { return LbxDeltaOpt(popt, optlen, preply, &pno->serverDeltaN, &pno->serverDeltaMaxLen); } static int -LbxDeltaOpt(popt, optlen, preply, pn, pmaxlen) - unsigned char *popt; - int optlen; - unsigned char *preply; - short *pn; - short *pmaxlen; +LbxDeltaOpt(unsigned char *popt, + int optlen, + unsigned char *preply, + short *pn, + short *pmaxlen) { short n; short maxlen; @@ -211,12 +223,12 @@ LbxDeltaOpt(popt, optlen, preply, pn, pmaxlen) return LBX_OPT_DELTA_REPLYLEN; } -static int ZlibParse(); static struct _LbxStreamCompParser { int typelen; char *type; - int (*parser)(); + int (*parser)(LbxNegOptsPtr, unsigned char *, + int, unsigned char *); } LbxStreamComp[] = { #ifndef NO_ZLIB { ZLIB_STRCOMP_OPT_LEN, ZLIB_STRCOMP_OPT, ZlibParse }, @@ -227,11 +239,10 @@ static struct _LbxStreamCompParser { (sizeof(LbxStreamComp) / sizeof(struct _LbxStreamCompParser)) static int -LbxStreamCompOpt(pno, popt, optlen, preply) - LbxNegOptsPtr pno; - unsigned char *popt; - int optlen; - unsigned char *preply; +LbxStreamCompOpt(LbxNegOptsPtr pno, + unsigned char *popt, + int optlen, + unsigned char *preply) { int i; int typelen; @@ -277,18 +288,11 @@ LbxStreamCompOpt(pno, popt, optlen, preply) } -extern LbxStreamCompHandle ZlibInit(); -extern int ZlibStuffInput(), ZlibInputAvail(), ZlibFlush(), - ZlibRead(), ZlibWriteV(); -extern void ZlibCompressOn(), ZlibCompressOff(), ZlibFree(); - - static int -ZlibParse(pno, popt, optlen, preply) - LbxNegOptsPtr pno; - unsigned char *popt; - int optlen; - unsigned char *preply; +ZlibParse(LbxNegOptsPtr pno, + unsigned char *popt, + int optlen, + unsigned char *preply) { int level; /* compression level */ @@ -299,8 +303,9 @@ ZlibParse(pno, popt, optlen, preply) if (level < 1 || level > 9) return (-1); - pno->streamOpts.streamCompInit = ZlibInit; - pno->streamOpts.streamCompArg = (pointer) level; + pno->streamOpts.streamCompInit = + (LbxStreamCompHandle (*)(int, pointer))ZlibInit; + pno->streamOpts.streamCompArg = (pointer)(long)level; pno->streamOpts.streamCompStuffInput = ZlibStuffInput; pno->streamOpts.streamCompInputAvail = ZlibInputAvail; pno->streamOpts.streamCompFlush = ZlibFlush; @@ -308,17 +313,17 @@ ZlibParse(pno, popt, optlen, preply) pno->streamOpts.streamCompWriteV = ZlibWriteV; pno->streamOpts.streamCompOn = ZlibCompressOn; pno->streamOpts.streamCompOff = ZlibCompressOff; - pno->streamOpts.streamCompFreeHandle = ZlibFree; + pno->streamOpts.streamCompFreeHandle = + (void (*)(LbxStreamCompHandle))ZlibFree; return (0); } static int -LbxMessageCompOpt(pno, popt, optlen, preply) - LbxNegOptsPtr pno; - unsigned char *popt; - int optlen; - unsigned char *preply; +LbxMessageCompOpt(LbxNegOptsPtr pno, + unsigned char *popt, + int optlen, + unsigned char *preply) { if (optlen == 0) { @@ -334,11 +339,10 @@ LbxMessageCompOpt(pno, popt, optlen, preply) static int -LbxUseTagsOpt(pno, popt, optlen, preply) - LbxNegOptsPtr pno; - unsigned char *popt; - int optlen; - unsigned char *preply; +LbxUseTagsOpt(LbxNegOptsPtr pno, + unsigned char *popt, + int optlen, + unsigned char *preply) { if (optlen == 0) { @@ -404,24 +408,20 @@ LbxPixmapCompMethods [] = { (sizeof (LbxPixmapCompMethods) / sizeof (LbxPixmapCompMethod)) #endif -static int MergeDepths (); - static int -LbxImageCompOpt (pixmap, pno, popt, optlen, preply) - -Bool pixmap; -LbxNegOptsPtr pno; -unsigned char *popt; -int optlen; -unsigned char *preply; +LbxImageCompOpt (Bool pixmap, + LbxNegOptsPtr pno, + unsigned char *popt, + int optlen, + unsigned char *preply) { unsigned char *preplyStart = preply; int numMethods = *popt++; - char *myIndices, *hisIndices; - unsigned *retFormats; - int **retDepths; + unsigned char *myIndices, *hisIndices; + unsigned int *retFormats = NULL; + int **retDepths = NULL; int replyCount = 0; int status, i, j; @@ -436,8 +436,8 @@ unsigned char *preply; return (1); } - myIndices = (char *) xalloc (numMethods); - hisIndices = (char *) xalloc (numMethods); + myIndices = (unsigned char *) xalloc (numMethods); + hisIndices = (unsigned char *) xalloc (numMethods); if (!myIndices || !hisIndices) { @@ -484,8 +484,8 @@ unsigned char *preply; for (i = 0; i < numMethods; i++) { - unsigned formatMask, newFormatMask; - int depthCount, *depths, len; + unsigned int formatMask = 0, newFormatMask = 0; + int depthCount, *depths = NULL, len; int freeDepths; char *methodName; @@ -634,12 +634,10 @@ unsigned char *preply; static int -LbxBitmapCompOpt (pno, popt, optlen, preply) - -LbxNegOptsPtr pno; -unsigned char *popt; -int optlen; -unsigned char *preply; +LbxBitmapCompOpt (LbxNegOptsPtr pno, + unsigned char *popt, + int optlen, + unsigned char *preply) { return (LbxImageCompOpt (0 /* bitmap */, pno, popt, optlen, preply)); @@ -647,12 +645,10 @@ unsigned char *preply; static int -LbxPixmapCompOpt (pno, popt, optlen, preply) - -LbxNegOptsPtr pno; -unsigned char *popt; -int optlen; -unsigned char *preply; +LbxPixmapCompOpt (LbxNegOptsPtr pno, + unsigned char *popt, + int optlen, + unsigned char *preply) { return (LbxImageCompOpt (1 /* Pixmap */, pno, popt, optlen, preply)); @@ -660,10 +656,8 @@ unsigned char *preply; LbxBitmapCompMethod * -LbxSrvrLookupBitmapCompMethod (proxy, methodOpCode) - -LbxProxyPtr proxy; -int methodOpCode; +LbxSrvrLookupBitmapCompMethod (LbxProxyPtr proxy, + int methodOpCode) { int i; @@ -683,10 +677,8 @@ int methodOpCode; LbxPixmapCompMethod * -LbxSrvrLookupPixmapCompMethod (proxy, methodOpCode) - -LbxProxyPtr proxy; -int methodOpCode; +LbxSrvrLookupPixmapCompMethod (LbxProxyPtr proxy, + int methodOpCode) { int i; @@ -706,9 +698,7 @@ int methodOpCode; LbxBitmapCompMethod * -LbxSrvrFindPreferredBitmapCompMethod (proxy) - -LbxProxyPtr proxy; +LbxSrvrFindPreferredBitmapCompMethod (LbxProxyPtr proxy) { if (proxy->numBitmapCompMethods == 0) @@ -720,11 +710,9 @@ LbxProxyPtr proxy; LbxPixmapCompMethod * -LbxSrvrFindPreferredPixmapCompMethod (proxy, format, depth) - -LbxProxyPtr proxy; -int format; -int depth; +LbxSrvrFindPreferredPixmapCompMethod (LbxProxyPtr proxy, + int format, + int depth) { if (proxy->numPixmapCompMethods == 0) @@ -757,10 +745,9 @@ int depth; } -static int MergeDepths (depths, method) - -int *depths; -LbxPixmapCompMethod *method; +static int +MergeDepths (int *depths, + LbxPixmapCompMethod *method) { int i, j, count; @@ -788,12 +775,10 @@ LbxPixmapCompMethod *method; #define LbxCmapAllMethod "XC-CMAP" static int -LbxCmapAllOpt (pno, popt, optlen, preply) - -LbxNegOptsPtr pno; -unsigned char *popt; -int optlen; -unsigned char *preply; +LbxCmapAllOpt (LbxNegOptsPtr pno, + unsigned char *popt, + int optlen, + unsigned char *preply) { int numMethods = *popt++; diff --git a/lbx/lbxprop.c b/lbx/lbxprop.c index b70fade72..e9a6d8a8e 100644 --- a/lbx/lbxprop.c +++ b/lbx/lbxprop.c @@ -46,6 +46,7 @@ in this Software without prior written authorization from The Open Group. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * */ +/* $XFree86: xc/programs/Xserver/lbx/lbxprop.c,v 1.5 2001/12/14 20:00:00 dawes Exp $ */ /* various bits of DIX-level mangling */ @@ -61,6 +62,7 @@ in this Software without prior written authorization from The Open Group. #include "resource.h" #include "servermd.h" #include "propertyst.h" +#include "colormapst.h" #include "windowstr.h" #define _XLBX_SERVER_ #include "lbxstr.h" @@ -71,15 +73,11 @@ in this Software without prior written authorization from The Open Group. #define _SECURITY_SERVER #include "extensions/security.h" #endif - -extern int (*ProcVector[256]) (); -extern void (*ReplySwapVector[256]) (); -extern void CopySwap16Write(), CopySwap32Write(), Swap32Write(); +#include "swaprep.h" void -LbxStallPropRequest(client, pProp) - ClientPtr client; - PropertyPtr pProp; +LbxStallPropRequest(ClientPtr client, + PropertyPtr pProp) { xReq *req = (xReq *) client->requestBuffer; register char n; @@ -139,19 +137,17 @@ LbxStallPropRequest(client, pProp) } int -LbxChangeWindowProperty(client, pWin, property, type, format, mode, len, - have_data, value, sendevent, tag) - ClientPtr client; - WindowPtr pWin; - Atom property, - type; - int format, - mode; - unsigned long len; - Bool have_data; - pointer value; - Bool sendevent; - XID *tag; +LbxChangeWindowProperty(ClientPtr client, + WindowPtr pWin, + Atom property, + Atom type, + int format, + int mode, + unsigned long len, + Bool have_data, + pointer value, + Bool sendevent, + XID *tag) { PropertyPtr pProp; xEvent event; @@ -288,8 +284,7 @@ LbxChangeWindowProperty(client, pWin, property, type, format, mode, len, } int -LbxChangeProperty(client) - ClientPtr client; +LbxChangeProperty(ClientPtr client) { WindowPtr pWin; char format, @@ -370,9 +365,8 @@ LbxChangeProperty(client) } static void -LbxWriteGetpropReply(client, rep) - ClientPtr client; - xLbxGetPropertyReply *rep; +LbxWriteGetpropReply(ClientPtr client, + xLbxGetPropertyReply *rep) { int n; @@ -388,8 +382,7 @@ LbxWriteGetpropReply(client, rep) } int -LbxGetProperty(client) - ClientPtr client; +LbxGetProperty(ClientPtr client) { PropertyPtr pProp, prevProp; @@ -525,13 +518,13 @@ LbxGetProperty(client) if (len) { switch (reply.format) { case 32: - client->pSwapReplyFunc = CopySwap32Write; + client->pSwapReplyFunc = (ReplySwapPtr)CopySwap32Write; break; case 16: - client->pSwapReplyFunc = CopySwap16Write; + client->pSwapReplyFunc = (ReplySwapPtr)CopySwap16Write; break; default: - client->pSwapReplyFunc = (void (*) ()) WriteToClient; + client->pSwapReplyFunc = (ReplySwapPtr) WriteToClient; break; } WriteSwappedDataToClient(client, len, diff --git a/lbx/lbxserve.h b/lbx/lbxserve.h index 3151207be..40a2ff0ae 100644 --- a/lbx/lbxserve.h +++ b/lbx/lbxserve.h @@ -45,12 +45,17 @@ in this Software without prior written authorization from The Open Group. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * */ +/* $XFree86: xc/programs/Xserver/lbx/lbxserve.h,v 1.5 2001/12/14 20:00:00 dawes Exp $ */ #ifndef _LBXSERVE_H_ + +#include "colormap.h" +#include "property.h" + #define _LBXSERVE_H_ -#include "lbxdeltastr.h" #define _XLBX_SERVER_ #include "lbxstr.h" +#include "lbxdeltastr.h" #include "lbxopts.h" #define MAX_LBX_CLIENTS MAXCLIENTS @@ -104,9 +109,9 @@ typedef struct _LbxProxy { LbxStreamOpts streamOpts; int numBitmapCompMethods; - char *bitmapCompMethods; /* array of indices */ + unsigned char *bitmapCompMethods; /* array of indices */ int numPixmapCompMethods; - char *pixmapCompMethods; /* array of indices */ + unsigned char *pixmapCompMethods; /* array of indices */ int **pixmapCompDepths; /* depths supported from each method */ struct _ColormapRec *grabbedCmaps; /* chained via lbx private */ @@ -126,48 +131,155 @@ extern LbxClientPtr lbxClients[MAXCLIENTS]; extern int LbxEventCode; -extern void LbxDixInit( -#if NeedFunctionPrototypes - void -#endif -); - -extern LbxProxyPtr LbxPidToProxy( -#if NeedFunctionPrototypes - int /* pid */ -#endif -); - -extern void LbxReencodeOutput( -#if NeedFunctionPrototypes - ClientPtr /*client*/, - char* /*pbuf*/, - int* /*pcount*/, - char* /*cbuf*/, - int* /*ccount*/ -#endif -); - -extern int UncompressedWriteToClient( -#if NeedFunctionPrototypes - ClientPtr /*who*/, - int /*count*/, - char* /*buf*/ -#endif -); - -extern ClientPtr AllocLbxClientConnection( -#if NeedFunctionPrototypes - ClientPtr /* client */, - LbxProxyPtr /* proxy */ -#endif -); - -extern void LbxProxyConnection( -#if NeedFunctionPrototypes - ClientPtr /* client */, - LbxProxyPtr /* proxy */ -#endif -); + +/* os/connection.c */ +extern ClientPtr AllocLbxClientConnection ( ClientPtr client, + LbxProxyPtr proxy ); +extern void LbxProxyConnection ( ClientPtr client, LbxProxyPtr proxy ); + +/* os/libxio.c */ +extern int UncompressedWriteToClient ( ClientPtr who, int count, char *buf ); +extern void LbxForceOutput ( LbxProxyPtr proxy ); +extern void SwitchClientInput ( ClientPtr client, Bool pending ); +extern int PrepareLargeReqBuffer ( ClientPtr client ); +extern Bool AppendFakeRequest ( ClientPtr client, char *data, int count ); +extern void LbxFreeOsBuffers ( LbxProxyPtr proxy ); +extern Bool AllocateLargeReqBuffer ( ClientPtr client, int size ); +extern Bool AddToLargeReqBuffer ( ClientPtr client, char *data, int size ); +extern void LbxPrimeInput ( ClientPtr client, LbxProxyPtr proxy ); + +/* lbxcmap.c */ +extern int LbxCmapInit ( void ); +extern Bool LbxCheckColorRequest ( ClientPtr client, ColormapPtr pmap, + xReq *req ); +extern int LbxCheckCmapGrabbed ( ColormapPtr pmap ); +extern void LbxDisableSmartGrab ( ColormapPtr pmap ); +extern void LbxBeginFreeCellsEvent ( ColormapPtr pmap ); +extern void LbxAddFreeCellToEvent ( ColormapPtr pmap, Pixel pixel ); +extern void LbxEndFreeCellsEvent ( ColormapPtr pmap ); +extern void LbxSortPixelList ( Pixel *pixels, int count ); +extern int ProcLbxGrabCmap ( ClientPtr client ); +extern void LbxReleaseCmap ( ColormapPtr pmap, Bool smart ); +extern int ProcLbxReleaseCmap ( ClientPtr client ); +extern int ProcLbxAllocColor ( ClientPtr client ); +extern int ProcLbxIncrementPixel ( ClientPtr client ); + +/* lbxdix.h */ +extern void LbxDixInit ( void ); +extern void LbxResetTags ( void ); +extern int LbxSendConnSetup ( ClientPtr client, char *reason ); +extern int LbxGetModifierMapping ( ClientPtr client ); +extern int LbxGetKeyboardMapping ( ClientPtr client ); +extern int LbxQueryFont ( ClientPtr client ); +extern int LbxTagData ( ClientPtr client, XID tag, unsigned long len, + pointer data ); +extern int LbxInvalidateTag ( ClientPtr client, XID tag ); +extern void LbxAllowMotion ( ClientPtr client, int num ); +extern void LbxFlushModifierMapTag ( void ); +extern void LbxFlushKeyboardMapTag ( void ); +extern void LbxFreeFontTag ( FontPtr pfont ); +extern void LbxSendInvalidateTag ( ClientPtr client, XID tag, int tagtype ); +extern Bool LbxFlushQTag ( XID tag ); +extern void ProcessQTagZombies ( void ); +extern void LbxQueryTagData ( ClientPtr client, int owner_pid, XID tag, + int tagtype ); + +/* lbxexts.c */ +extern Bool LbxAddExtension ( char *name, int opcode, int ev_base, + int err_base ); +extern Bool LbxAddExtensionAlias ( int idx, char *alias ); +extern void LbxDeclareExtensionSecurity ( char *extname, Bool secure ); +extern Bool LbxRegisterExtensionGenerationMasks ( int idx, int num_reqs, + char *rep_mask, + char *ev_mask ); +extern int LbxQueryExtension ( ClientPtr client, char *ename, int nlen ); +extern void LbxCloseDownExtensions ( void ); +extern void LbxSetReqMask ( CARD8 *mask, int req, Bool on ); + +/* lbxgfx.c */ +extern int LbxDecodePoly( ClientPtr client, CARD8 xreqtype, + int (*decode_rtn)(char *, char *, short *) ); +extern int LbxDecodeFillPoly ( ClientPtr client ); +extern int LbxDecodeCopyArea ( ClientPtr client ); +extern int LbxDecodeCopyPlane ( ClientPtr client ); +extern int LbxDecodePolyText ( ClientPtr client ); +extern int LbxDecodeImageText ( ClientPtr client ); +extern int LbxDecodePutImage ( ClientPtr client ); +extern int LbxDecodeGetImage ( ClientPtr client ); +extern int LbxDecodePoints ( char *in, char *inend, short *out ); +extern int LbxDecodeSegment ( char *in, char *inend, short *out ); +extern int LbxDecodeRectangle ( char *in, char *inend, short *out ); +extern int LbxDecodeArc ( char *in, char *inend, short *out ); + +/* lbxmain.c */ +extern LbxProxyPtr LbxPidToProxy ( int pid ); +extern void LbxReencodeOutput ( ClientPtr client, char *pbuf, int *pcount, + char *cbuf, int *ccount ); +extern void LbxExtensionInit ( void ); +extern void LbxCloseClient ( ClientPtr client ); +extern void LbxSetForBlock ( LbxClientPtr lbxClient ); +extern int ProcLbxDispatch ( ClientPtr client ); +extern int ProcLbxSwitch ( ClientPtr client ); +extern int ProcLbxQueryVersion ( ClientPtr client ); +extern int ProcLbxStartProxy ( ClientPtr client ); +extern int ProcLbxStopProxy ( ClientPtr client ); +extern int ProcLbxBeginLargeRequest ( ClientPtr client ); +extern int ProcLbxLargeRequestData ( ClientPtr client ); +extern int ProcLbxEndLargeRequest ( ClientPtr client ); +extern int ProcLbxInternAtoms ( ClientPtr client ); +extern int ProcLbxGetWinAttrAndGeom ( ClientPtr client ); +extern int ProcLbxNewClient ( ClientPtr client ); +extern int ProcLbxEstablishConnection ( ClientPtr client ); +extern int ProcLbxCloseClient ( ClientPtr client ); +extern int ProcLbxModifySequence ( ClientPtr client ); +extern int ProcLbxAllowMotion ( ClientPtr client ); +extern int ProcLbxGetModifierMapping ( ClientPtr client ); +extern int ProcLbxGetKeyboardMapping ( ClientPtr client ); +extern int ProcLbxQueryFont ( ClientPtr client ); +extern int ProcLbxChangeProperty ( ClientPtr client ); +extern int ProcLbxGetProperty ( ClientPtr client ); +extern int ProcLbxTagData ( ClientPtr client ); +extern int ProcLbxInvalidateTag ( ClientPtr client ); +extern int ProcLbxPolyPoint ( ClientPtr client ); +extern int ProcLbxPolyLine ( ClientPtr client ); +extern int ProcLbxPolySegment ( ClientPtr client ); +extern int ProcLbxPolyRectangle ( ClientPtr client ); +extern int ProcLbxPolyArc ( ClientPtr client ); +extern int ProcLbxFillPoly ( ClientPtr client ); +extern int ProcLbxPolyFillRectangle ( ClientPtr client ); +extern int ProcLbxPolyFillArc ( ClientPtr client ); +extern int ProcLbxCopyArea ( ClientPtr client ); +extern int ProcLbxCopyPlane ( ClientPtr client ); +extern int ProcLbxPolyText ( ClientPtr client ); +extern int ProcLbxImageText ( ClientPtr client ); +extern int ProcLbxQueryExtension ( ClientPtr client ); +extern int ProcLbxPutImage ( ClientPtr client ); +extern int ProcLbxGetImage ( ClientPtr client ); +extern int ProcLbxSync ( ClientPtr client ); + +/* lbxprop.c */ +extern int LbxChangeProperty ( ClientPtr client ); +extern int LbxGetProperty ( ClientPtr client ); +extern void LbxStallPropRequest ( ClientPtr client, PropertyPtr pProp ); +extern int LbxChangeWindowProperty ( ClientPtr client, WindowPtr pWin, + Atom property, Atom type, int format, + int mode, unsigned long len, + Bool have_data, pointer value, + Bool sendevent, XID *tag ); +/* lbxsquish.c */ +extern int LbxSquishEvent ( char *buf ); + +/* lbwswap.c */ +extern int SProcLbxDispatch( ClientPtr client ); +extern int SProcLbxSwitch ( ClientPtr client ); +extern int SProcLbxBeginLargeRequest ( ClientPtr client ); +extern int SProcLbxLargeRequestData ( ClientPtr client ); +extern int SProcLbxEndLargeRequest ( ClientPtr client ); +extern void LbxWriteSConnSetupPrefix ( ClientPtr pClient, + xLbxConnSetupPrefix *pcsp ); +extern void LbxSwapFontInfo ( xLbxFontInfo *pr, Bool compressed ); + +/* lbxzerorep.c */ +extern void ZeroReplyPadBytes ( char *buf, int reqType ); #endif /* _LBXSERVE_H_ */ diff --git a/lbx/lbxsquish.c b/lbx/lbxsquish.c index 6d3eddbfc..d71647091 100644 --- a/lbx/lbxsquish.c +++ b/lbx/lbxsquish.c @@ -46,12 +46,15 @@ in this Software without prior written authorization from The Open Group. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * */ +/* $XFree86: xc/programs/Xserver/lbx/lbxsquish.c,v 1.4 2001/12/14 20:00:01 dawes Exp $ */ #define NEED_REPLIES #define NEED_EVENTS #include "X.h" #include "Xproto.h" #include "Xos.h" #include "misc.h" +#include "colormapst.h" +#include "propertyst.h" #include "lbxserve.h" #define _XLBX_SERVER_ #include "lbxstr.h" @@ -135,8 +138,7 @@ static char lbxevpad[] = { }; int -LbxSquishEvent(buf) - char *buf; +LbxSquishEvent(char *buf) { int delta = lbxevdelta[((xEvent *)buf)->u.u.type]; int pad = lbxevpad[((xEvent *)buf)->u.u.type]; diff --git a/lbx/lbxsrvopts.h b/lbx/lbxsrvopts.h index a08f1fec8..eeb94f266 100644 --- a/lbx/lbxsrvopts.h +++ b/lbx/lbxsrvopts.h @@ -21,6 +21,7 @@ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * */ +/* $XFree86: xc/programs/Xserver/lbx/lbxsrvopts.h,v 1.3 2001/01/17 22:37:00 dawes Exp $ */ #ifndef _LBX_SRVOPTS_H_ #define _LBX_SRVOPTS_H_ @@ -35,9 +36,9 @@ typedef struct _LbxNegOpts { short serverDeltaMaxLen; LbxStreamOpts streamOpts; int numBitmapCompMethods; - char *bitmapCompMethods; /* array of indices */ + unsigned char *bitmapCompMethods; /* array of indices */ int numPixmapCompMethods; - char *pixmapCompMethods; /* array of indices */ + unsigned char *pixmapCompMethods; /* array of indices */ int **pixmapCompDepths; /* depths supported from each method */ Bool squish; Bool useTags; @@ -46,33 +47,17 @@ typedef struct _LbxNegOpts { typedef LbxNegOptsRec *LbxNegOptsPtr; -extern LbxBitmapCompMethod *LbxSrvrLookupBitmapCompMethod ( -#if NeedFunctionPrototypes - LbxProxyPtr, /* proxy */ - int /* methodOpCode */ -#endif -); - -extern LbxPixmapCompMethod *LbxSrvrLookupPixmapCompMethod ( -#if NeedFunctionPrototypes - LbxProxyPtr, /* proxy */ - int /* methodOpCode */ -#endif -); - -extern LbxBitmapCompMethod *LbxSrvrFindPreferredBitmapCompMethod ( -#if NeedFunctionPrototypes - LbxProxyPtr /* proxy */ -#endif -); - -extern LbxPixmapCompMethod *LbxSrvrFindPreferredPixmapCompMethod ( -#if NeedFunctionPrototypes - LbxProxyPtr, /* proxy */ - int, /* format */ - int /* depth */ -#endif -); +extern void LbxOptionInit ( LbxNegOptsPtr pno ); +extern int LbxOptionParse ( LbxNegOptsPtr pno, unsigned char *popt, + int optlen, unsigned char *preply ); +extern LbxBitmapCompMethod * +LbxSrvrLookupBitmapCompMethod ( LbxProxyPtr proxy, int methodOpCode ); +extern LbxPixmapCompMethod * +LbxSrvrLookupPixmapCompMethod ( LbxProxyPtr proxy, int methodOpCode ); +extern LbxBitmapCompMethod * +LbxSrvrFindPreferredBitmapCompMethod ( LbxProxyPtr proxy ); +extern LbxPixmapCompMethod * +LbxSrvrFindPreferredPixmapCompMethod ( LbxProxyPtr proxy, int format, int depth ); #endif /* _LBX_SRVOPTS_H_ */ diff --git a/lbx/lbxswap.c b/lbx/lbxswap.c index 38ba66b70..edfc0bea7 100644 --- a/lbx/lbxswap.c +++ b/lbx/lbxswap.c @@ -45,6 +45,7 @@ in this Software without prior written authorization from The Open Group. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * */ +/* $XFree86: xc/programs/Xserver/lbx/lbxswap.c,v 1.4 2001/12/14 20:00:01 dawes Exp $ */ #include <sys/types.h> #define NEED_REPLIES @@ -58,6 +59,8 @@ in this Software without prior written authorization from The Open Group. #include "pixmapstr.h" #include "scrnintstr.h" #include "servermd.h" +#include "swaprep.h" +#include "propertyst.h" #define _XLBX_SERVER_ #include "lbxstr.h" #include "lbxserve.h" @@ -66,8 +69,7 @@ in this Software without prior written authorization from The Open Group. #include <stdio.h> static int -SProcLbxQueryVersion(client) - register ClientPtr client; +SProcLbxQueryVersion(ClientPtr client) { register int n; @@ -78,8 +80,7 @@ SProcLbxQueryVersion(client) } static int -SProcLbxStartProxy(client) - register ClientPtr client; +SProcLbxStartProxy(ClientPtr client) { register int n; @@ -90,8 +91,7 @@ SProcLbxStartProxy(client) } static int -SProcLbxStopProxy(client) - register ClientPtr client; +SProcLbxStopProxy(ClientPtr client) { register int n; @@ -102,8 +102,7 @@ SProcLbxStopProxy(client) } int -SProcLbxSwitch(client) - register ClientPtr client; +SProcLbxSwitch(ClientPtr client) { register int n; @@ -115,8 +114,7 @@ SProcLbxSwitch(client) } int -SProcLbxBeginLargeRequest (client) - register ClientPtr client; +SProcLbxBeginLargeRequest (ClientPtr client) { register int n; @@ -128,8 +126,7 @@ SProcLbxBeginLargeRequest (client) } int -SProcLbxLargeRequestData (client) - register ClientPtr client; +SProcLbxLargeRequestData (ClientPtr client) { register int n; @@ -140,8 +137,7 @@ SProcLbxLargeRequestData (client) } int -SProcLbxEndLargeRequest (client) - register ClientPtr client; +SProcLbxEndLargeRequest (ClientPtr client) { register int n; @@ -152,8 +148,7 @@ SProcLbxEndLargeRequest (client) } static int -SProcLbxNewClient(client) - register ClientPtr client; +SProcLbxNewClient(ClientPtr client) { register int n; @@ -165,8 +160,7 @@ SProcLbxNewClient(client) } static int -SProcLbxCloseClient(client) - register ClientPtr client; +SProcLbxCloseClient(ClientPtr client) { register int n; @@ -178,8 +172,7 @@ SProcLbxCloseClient(client) } static int -SProcLbxModifySequence(client) - register ClientPtr client; +SProcLbxModifySequence(ClientPtr client) { register int n; @@ -191,8 +184,7 @@ SProcLbxModifySequence(client) } static int -SProcLbxAllowMotion(client) - register ClientPtr client; +SProcLbxAllowMotion(ClientPtr client) { register int n; @@ -204,8 +196,7 @@ SProcLbxAllowMotion(client) } static int -SProcLbxIncrementPixel(client) - register ClientPtr client; +SProcLbxIncrementPixel(ClientPtr client) { register int n; @@ -218,8 +209,7 @@ SProcLbxIncrementPixel(client) } static int -SProcLbxGrabCmap(client) - register ClientPtr client; +SProcLbxGrabCmap(ClientPtr client) { register int n; @@ -232,8 +222,7 @@ SProcLbxGrabCmap(client) } static int -SProcLbxReleaseCmap(client) - register ClientPtr client; +SProcLbxReleaseCmap(ClientPtr client) { register int n; @@ -246,8 +235,7 @@ SProcLbxReleaseCmap(client) } static int -SProcLbxAllocColor(client) - register ClientPtr client; +SProcLbxAllocColor(ClientPtr client) { register int n; @@ -264,8 +252,7 @@ SProcLbxAllocColor(client) } static int -SProcLbxGetModifierMapping(client) - register ClientPtr client; +SProcLbxGetModifierMapping(ClientPtr client) { register int n; @@ -276,8 +263,7 @@ SProcLbxGetModifierMapping(client) } static int -SProcLbxGetKeyboardMapping(client) - register ClientPtr client; +SProcLbxGetKeyboardMapping(ClientPtr client) { register int n; @@ -288,8 +274,7 @@ SProcLbxGetKeyboardMapping(client) } static int -SProcLbxQueryFont(client) - register ClientPtr client; +SProcLbxQueryFont(ClientPtr client) { register int n; @@ -301,8 +286,7 @@ SProcLbxQueryFont(client) } static int -SProcLbxChangeProperty(client) - register ClientPtr client; +SProcLbxChangeProperty(ClientPtr client) { register int n; @@ -328,8 +312,7 @@ SProcLbxChangeProperty(client) } static int -SProcLbxGetProperty(client) - register ClientPtr client; +SProcLbxGetProperty(ClientPtr client) { register int n; @@ -345,8 +328,7 @@ SProcLbxGetProperty(client) } static int -SProcLbxTagData(client) - register ClientPtr client; +SProcLbxTagData(ClientPtr client) { register int n; @@ -359,8 +341,7 @@ SProcLbxTagData(client) } static int -SProcLbxInvalidateTag(client) - register ClientPtr client; +SProcLbxInvalidateTag(ClientPtr client) { register int n; @@ -372,8 +353,7 @@ SProcLbxInvalidateTag(client) } static int -SProcLbxPoly(client) - register ClientPtr client; +SProcLbxPoly(ClientPtr client) { register int n; @@ -393,8 +373,7 @@ SProcLbxPoly(client) } static int -SProcLbxFillPoly(client) - register ClientPtr client; +SProcLbxFillPoly(ClientPtr client) { register int n; @@ -414,10 +393,9 @@ SProcLbxFillPoly(client) } static int -SProcLbxCopyArea (client) - register ClientPtr client; +SProcLbxCopyArea(ClientPtr client) { - register int n; + int n; REQUEST(xLbxCopyAreaReq); char *after; @@ -440,10 +418,9 @@ SProcLbxCopyArea (client) } static int -SProcLbxCopyPlane (client) - register ClientPtr client; +SProcLbxCopyPlane(ClientPtr client) { - register int n; + int n; REQUEST(xLbxCopyPlaneReq); char *after; @@ -467,8 +444,7 @@ SProcLbxCopyPlane (client) } static int -SProcLbxPolyText(client) - register ClientPtr client; +SProcLbxPolyText(ClientPtr client) { register int n; @@ -488,8 +464,7 @@ SProcLbxPolyText(client) } static int -SProcLbxImageText(client) - register ClientPtr client; +SProcLbxImageText(ClientPtr client) { register int n; @@ -510,8 +485,7 @@ SProcLbxImageText(client) static int -SProcLbxPutImage(client) - register ClientPtr client; +SProcLbxPutImage(ClientPtr client) { register int n; @@ -522,8 +496,7 @@ SProcLbxPutImage(client) } static int -SProcLbxGetImage(client) - register ClientPtr client; +SProcLbxGetImage(ClientPtr client) { register int n; @@ -540,8 +513,7 @@ SProcLbxGetImage(client) } static int -SProcLbxInternAtoms(client) - register ClientPtr client; +SProcLbxInternAtoms(ClientPtr client) { register int n; char *ptr; @@ -569,8 +541,7 @@ SProcLbxInternAtoms(client) static int -SProcLbxGetWinAttrAndGeom(client) - ClientPtr client; +SProcLbxGetWinAttrAndGeom(ClientPtr client) { int n; @@ -585,8 +556,7 @@ SProcLbxGetWinAttrAndGeom(client) static int -SProcLbxQueryExtension(client) - ClientPtr client; +SProcLbxQueryExtension(ClientPtr client) { int n; @@ -598,8 +568,7 @@ SProcLbxQueryExtension(client) } int -SProcLbxDispatch(client) - register ClientPtr client; +SProcLbxDispatch(ClientPtr client) { REQUEST(xReq); switch (stuff->data) { @@ -682,10 +651,9 @@ SProcLbxDispatch(client) #ifdef notyet void -LbxWriteSConnectionInfo(pClient, size, pInfo) - ClientPtr pClient; - unsigned long size; - char *pInfo; +LbxWriteSConnectionInfo(ClientPtr pClient, + unsigned long size, + char *pInfo) { int i, j, k; ScreenPtr pScreen; @@ -741,8 +709,8 @@ LbxWriteSConnectionInfo(pClient, size, pInfo) } void -SwapConnSetup(pConnSetup, pConnSetupT) - xConnSetup *pConnSetup, *pConnSetupT; +SwapConnSetup(xConnSetup *pConnSetup, + xConnSetup *pConnSetupT) { cpswapl(pConnSetup->release, pConnSetupT->release); cpswapl(pConnSetup->ridBase, pConnSetupT->ridBase); @@ -761,8 +729,8 @@ SwapConnSetup(pConnSetup, pConnSetupT) } void -SwapWinRoot(pRoot, pRootT) - xWindowRoot *pRoot, *pRootT; +SwapWinRoot(xWindowRoot *pRoot, + xWindowRoot *pRootT) { cpswapl(pRoot->windowId, pRootT->windowId); cpswapl(pRoot->defaultColormap, pRootT->defaultColormap); @@ -783,8 +751,8 @@ SwapWinRoot(pRoot, pRootT) } void -SwapVisual(pVis, pVisT) - xVisualType *pVis, *pVisT; +SwapVisual(xVisualType *pVis, + xVisualType *pVisT; { cpswapl(pVis->visualID, pVisT->visualID); pVisT->class = pVis->class; @@ -797,9 +765,8 @@ SwapVisual(pVis, pVisT) #endif void -LbxWriteSConnSetupPrefix(pClient, pcsp) - ClientPtr pClient; - xLbxConnSetupPrefix *pcsp; +LbxWriteSConnSetupPrefix(ClientPtr pClient, + xLbxConnSetupPrefix *pcsp) { xLbxConnSetupPrefix cspT; @@ -814,9 +781,8 @@ LbxWriteSConnSetupPrefix(pClient, pcsp) } void -LbxSwapFontInfo(pr, compressed) - xLbxFontInfo *pr; - Bool compressed; +LbxSwapFontInfo(xLbxFontInfo *pr, + Bool compressed) { unsigned i; xCharInfo *pxci; diff --git a/lbx/lbxtables.c b/lbx/lbxtables.c index c3d4f1270..e071846e3 100644 --- a/lbx/lbxtables.c +++ b/lbx/lbxtables.c @@ -21,11 +21,13 @@ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * */ +/* $XFree86: xc/programs/Xserver/lbx/lbxtables.c,v 1.3 2001/01/17 22:37:00 dawes Exp $ */ +#include "dix.h" -extern int ProcInitialConnection(); -extern int ProcLbxEstablishConnection(); +extern int ProcInitialConnection(ClientPtr client); +extern int ProcLbxEstablishConnection(ClientPtr client); -int (* LbxInitialVector[3]) () = +int (* LbxInitialVector[3]) (ClientPtr) = { 0, ProcInitialConnection, diff --git a/lbx/lbxtags.c b/lbx/lbxtags.c index b2bc40ade..5b1d65a4a 100644 --- a/lbx/lbxtags.c +++ b/lbx/lbxtags.c @@ -46,30 +46,31 @@ in this Software without prior written authorization from The Open Group. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * */ +/* $XFree86: xc/programs/Xserver/lbx/lbxtags.c,v 1.4 2001/12/14 20:00:01 dawes Exp $ */ #include "X.h" #include "misc.h" #include "lbxdata.h" #include "resource.h" +#include "colormapst.h" +#include "propertyst.h" #include "lbxtags.h" #define _XLBX_SERVER_ #include "lbxstr.h" #include "propertyst.h" -static int tag_free(); - static RESTYPE TagResType; +extern int _lbx_fi_junklen; + /* ARGSUSED */ static int -tag_free(data, id) - pointer data; - XID id; +tag_free(pointer data, + XID id) { TagData td = (TagData) data; FontTagInfoPtr ftip; char *t; - extern int _lbx_fi_junklen; if (td->global) *(td->global) = 0; @@ -88,21 +89,21 @@ tag_free(data, id) return 0; } -TagInit() +void +TagInit(void) { TagResType = CreateNewResourceType(tag_free); } XID -TagNewTag() +TagNewTag(void) { return FakeClientID(0); } void -TagClearProxy(tid, pid) - XID tid; - int pid; +TagClearProxy(XID tid, + int pid) { TagData td; @@ -112,9 +113,8 @@ TagClearProxy(tid, pid) } void -TagMarkProxy(tid, pid) - XID tid; - int pid; +TagMarkProxy(XID tid, + int pid) { TagData td; @@ -123,9 +123,8 @@ TagMarkProxy(tid, pid) } Bool -TagProxyMarked(tid, pid) - XID tid; - int pid; +TagProxyMarked(XID tid, + int pid) { TagData td; @@ -134,11 +133,10 @@ TagProxyMarked(tid, pid) } XID -TagSaveTag(dtype, size, data, global) - int dtype; - int size; - pointer data; - XID *global; +TagSaveTag(int dtype, + int size, + pointer data, + XID *global) { TagData td; @@ -162,8 +160,7 @@ TagSaveTag(dtype, size, data, global) } void -TagDeleteTag(tid) - XID tid; +TagDeleteTag(XID tid) { int pid; TagData td; @@ -192,8 +189,7 @@ TagDeleteTag(tid) } TagData -TagGetTag(tid) - XID tid; +TagGetTag(XID tid) { TagData td; @@ -202,10 +198,9 @@ TagGetTag(tid) } static void -LbxFlushTag(value, tid, cdata) - pointer value; - XID tid; - pointer cdata; +LbxFlushTag(pointer value, + XID tid, + pointer cdata) { TagData td = (TagData)value; LbxProxyPtr proxy = (LbxProxyPtr)cdata; @@ -231,8 +226,8 @@ LbxFlushTag(value, tid, cdata) /* * clear out markers for proxies */ -LbxFlushTags(proxy) - LbxProxyPtr proxy; +void +LbxFlushTags(LbxProxyPtr proxy) { FindClientResourcesByType(NULL, TagResType, LbxFlushTag, (pointer)proxy); } diff --git a/lbx/lbxtags.h b/lbx/lbxtags.h index 3b6ab731a..e451ad091 100644 --- a/lbx/lbxtags.h +++ b/lbx/lbxtags.h @@ -46,6 +46,7 @@ in this Software without prior written authorization from The Open Group. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * */ +/* $XFree86: xc/programs/Xserver/lbx/lbxtags.h,v 1.4 2001/12/14 20:00:01 dawes Exp $ */ #ifndef _LBXTAGS_H_ #define _LBXTAGS_H_ @@ -68,52 +69,14 @@ typedef struct _tagdata { typedef struct _tagdata *TagData; -extern TagData TagGetTag( -#if NeedFunctionPrototypes - XID /*tid*/ -#endif -); - -extern XID TagNewTag( -#if NeedFunctionPrototypes - void -#endif -); - -extern void TagClearProxy( -#if NeedFunctionPrototypes - XID /*tid*/, - int /*pid*/ -#endif -); - -extern void TagMarkProxy( -#if NeedFunctionPrototypes - XID /*tid*/, - int /*pid*/ -#endif -); - -extern Bool TagProxyMarked( -#if NeedFunctionPrototypes - XID /*tid*/, - int /*pid*/ -#endif -); - -extern void TagDeleteTag( -#if NeedFunctionPrototypes - XID /*tid*/ -#endif -); - -extern XID TagSaveTag( -#if NeedFunctionPrototypes - int /*dtype*/, - int /*size*/, - pointer /*data*/, - XID* /*global*/ -#endif -); +extern void TagInit ( void ); +extern XID TagNewTag ( void ); +extern void TagClearProxy ( XID tid, int pid ); +extern void TagMarkProxy ( XID tid, int pid ); +extern Bool TagProxyMarked ( XID tid, int pid ); +extern XID TagSaveTag ( int dtype, int size, pointer data, XID *global ); +extern void TagDeleteTag ( XID tid ); +extern TagData TagGetTag ( XID tid ); +extern void LbxFlushTags ( LbxProxyPtr proxy ); #endif /* _LBXTAGS_H_ */ diff --git a/lbx/lbxzerorep.c b/lbx/lbxzerorep.c index 350d7f0f9..50b424708 100644 --- a/lbx/lbxzerorep.c +++ b/lbx/lbxzerorep.c @@ -27,6 +27,7 @@ other dealings in this Software without prior written authorization from The Open Group. */ +/* $XFree86: xc/programs/Xserver/lbx/lbxzerorep.c,v 1.4 2001/12/14 20:00:02 dawes Exp $ */ /* * This module handles zeroing out unused pad bytes in core X replies. @@ -38,10 +39,9 @@ from The Open Group. #include "X.h" #include <X11/Xproto.h> - -ZeroReplyPadBytes (buf, reqType) - char *buf; - int reqType; +void +ZeroReplyPadBytes (char *buf, + int reqType) { switch (reqType) { case X_GetWindowAttributes: |