diff options
Diffstat (limited to 'xkb')
-rw-r--r-- | xkb/XKBAlloc.c | 92 | ||||
-rw-r--r-- | xkb/XKBGAlloc.c | 365 | ||||
-rw-r--r-- | xkb/XKBMAlloc.c | 92 | ||||
-rw-r--r-- | xkb/XKBMisc.c | 98 | ||||
-rw-r--r-- | xkb/ddxBeep.c | 20 | ||||
-rw-r--r-- | xkb/ddxConfig.c | 16 | ||||
-rw-r--r-- | xkb/ddxCtrls.c | 20 | ||||
-rw-r--r-- | xkb/ddxDevBtn.c | 9 | ||||
-rw-r--r-- | xkb/ddxFakeBtn.c | 7 | ||||
-rw-r--r-- | xkb/ddxFakeMtn.c | 23 | ||||
-rw-r--r-- | xkb/ddxInit.c | 6 | ||||
-rw-r--r-- | xkb/ddxKeyClick.c | 8 | ||||
-rw-r--r-- | xkb/ddxKillSrv.c | 9 | ||||
-rw-r--r-- | xkb/ddxLEDs.c | 14 | ||||
-rw-r--r-- | xkb/ddxList.c | 28 | ||||
-rw-r--r-- | xkb/ddxLoad.c | 57 | ||||
-rw-r--r-- | xkb/ddxPrivate.c | 24 | ||||
-rw-r--r-- | xkb/ddxVT.c | 9 | ||||
-rw-r--r-- | xkb/maprules.c | 218 | ||||
-rw-r--r-- | xkb/xkb.c | 747 | ||||
-rw-r--r-- | xkb/xkbAccessX.c | 108 | ||||
-rw-r--r-- | xkb/xkbActions.c | 191 | ||||
-rw-r--r-- | xkb/xkbDflts.h | 13 | ||||
-rw-r--r-- | xkb/xkbEvents.c | 126 | ||||
-rw-r--r-- | xkb/xkbInit.c | 146 | ||||
-rw-r--r-- | xkb/xkbLEDs.c | 159 | ||||
-rw-r--r-- | xkb/xkbPrKeyEv.c | 16 | ||||
-rw-r--r-- | xkb/xkbPrOtherEv.c | 10 | ||||
-rw-r--r-- | xkb/xkbSwap.c | 171 | ||||
-rw-r--r-- | xkb/xkbUtils.c | 201 | ||||
-rw-r--r-- | xkb/xkbconfig.c | 148 | ||||
-rw-r--r-- | xkb/xkbfmisc.c | 95 | ||||
-rw-r--r-- | xkb/xkbout.c | 154 | ||||
-rw-r--r-- | xkb/xkbtext.c | 267 | ||||
-rw-r--r-- | xkb/xkmread.c | 173 |
35 files changed, 133 insertions, 3707 deletions
diff --git a/xkb/XKBAlloc.c b/xkb/XKBAlloc.c index c6fd855fe..5bc7f65fc 100644 --- a/xkb/XKBAlloc.c +++ b/xkb/XKBAlloc.c @@ -24,7 +24,7 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/X11/XKBAlloc.c,v 3.5 2001/01/17 19:41:48 dawes Exp $ */ +/* $XFree86: xc/lib/X11/XKBAlloc.c,v 3.6 2003/11/17 22:20:09 dawes Exp $ */ #ifndef XKB_IN_SERVER @@ -55,14 +55,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. /*ARGSUSED*/ Status -#if NeedFunctionPrototypes XkbAllocCompatMap(XkbDescPtr xkb,unsigned which,unsigned nSI) -#else -XkbAllocCompatMap(xkb,which,nSI) - XkbDescPtr xkb; - unsigned which; - unsigned nSI; -#endif { XkbCompatMapPtr compat; XkbSymInterpretRec *prev_interpret; @@ -109,14 +102,7 @@ XkbSymInterpretRec *prev_interpret; void -#if NeedFunctionPrototypes XkbFreeCompatMap(XkbDescPtr xkb,unsigned which,Bool freeMap) -#else -XkbFreeCompatMap(xkb,which,freeMap) - XkbDescPtr xkb; - unsigned which; - Bool freeMap; -#endif { register XkbCompatMapPtr compat; @@ -143,15 +129,7 @@ register XkbCompatMapPtr compat; /***===================================================================***/ Status -#if NeedFunctionPrototypes XkbAllocNames(XkbDescPtr xkb,unsigned which,int nTotalRG,int nTotalAliases) -#else -XkbAllocNames(xkb,which,nTotalRG,nTotalAliases) - XkbDescPtr xkb; - unsigned which; - int nTotalRG; - int nTotalAliases; -#endif { XkbNamesPtr names; @@ -231,14 +209,7 @@ XkbNamesPtr names; } void -#if NeedFunctionPrototypes XkbFreeNames(XkbDescPtr xkb,unsigned which,Bool freeMap) -#else -XkbFreeNames(xkb,which,freeMap) - XkbDescPtr xkb; - unsigned which; - Bool freeMap; -#endif { XkbNamesPtr names; @@ -287,13 +258,7 @@ XkbNamesPtr names; /*ARGSUSED*/ Status -#if NeedFunctionPrototypes XkbAllocControls(XkbDescPtr xkb,unsigned which) -#else -XkbAllocControls(xkb,which) - XkbDescPtr xkb; - unsigned which; -#endif { if (xkb==NULL) return BadMatch; @@ -308,14 +273,7 @@ XkbAllocControls(xkb,which) /*ARGSUSED*/ void -#if NeedFunctionPrototypes XkbFreeControls(XkbDescPtr xkb,unsigned which,Bool freeMap) -#else -XkbFreeControls(xkb,which,freeMap) - XkbDescPtr xkb; - unsigned which; - Bool freeMap; -#endif { if (freeMap && (xkb!=NULL) && (xkb->ctrls!=NULL)) { _XkbFree(xkb->ctrls); @@ -327,12 +285,7 @@ XkbFreeControls(xkb,which,freeMap) /***===================================================================***/ Status -#if NeedFunctionPrototypes XkbAllocIndicatorMaps(XkbDescPtr xkb) -#else -XkbAllocIndicatorMaps(xkb) - XkbDescPtr xkb; -#endif { if (xkb==NULL) return BadMatch; @@ -345,12 +298,7 @@ XkbAllocIndicatorMaps(xkb) } void -#if NeedFunctionPrototypes XkbFreeIndicatorMaps(XkbDescPtr xkb) -#else -XkbFreeIndicatorMaps(xkb) - XkbDescPtr xkb; -#endif { if ((xkb!=NULL)&&(xkb->indicators!=NULL)) { _XkbFree(xkb->indicators); @@ -362,11 +310,7 @@ XkbFreeIndicatorMaps(xkb) /***====================================================================***/ XkbDescRec * -#if NeedFunctionPrototypes XkbAllocKeyboard(void) -#else -XkbAllocKeyboard() -#endif { XkbDescRec *xkb; @@ -377,14 +321,7 @@ XkbDescRec *xkb; } void -#if NeedFunctionPrototypes XkbFreeKeyboard(XkbDescPtr xkb,unsigned which,Bool freeAll) -#else -XkbFreeKeyboard(xkb,which,freeAll) - XkbDescPtr xkb; - unsigned which; - Bool freeAll; -#endif { if (xkb==NULL) return; @@ -412,14 +349,7 @@ XkbFreeKeyboard(xkb,which,freeAll) /***====================================================================***/ XkbDeviceLedInfoPtr -#if NeedFunctionPrototypes XkbAddDeviceLedInfo(XkbDeviceInfoPtr devi,unsigned ledClass,unsigned ledId) -#else -XkbAddDeviceLedInfo(devi,ledClass,ledId) - XkbDeviceInfoPtr devi; - unsigned ledClass; - unsigned ledId; -#endif { XkbDeviceLedInfoPtr devli; register int i; @@ -457,13 +387,7 @@ register int i; } Status -#if NeedFunctionPrototypes XkbResizeDeviceButtonActions(XkbDeviceInfoPtr devi,unsigned newTotal) -#else -XkbResizeDeviceButtonActions(devi,newTotal) - XkbDeviceInfoPtr devi; - unsigned newTotal; -#endif { XkbAction *prev_btn_acts; @@ -497,14 +421,7 @@ XkbResizeDeviceButtonActions(devi,newTotal) /*ARGSUSED*/ XkbDeviceInfoPtr -#if NeedFunctionPrototypes XkbAllocDeviceInfo(unsigned deviceSpec,unsigned nButtons,unsigned szLeds) -#else -XkbAllocDeviceInfo(deviceSpec,nButtons,szLeds) - unsigned deviceSpec; - unsigned nButtons; - unsigned szLeds; -#endif { XkbDeviceInfoPtr devi; @@ -543,14 +460,7 @@ XkbDeviceInfoPtr devi; void -#if NeedFunctionPrototypes XkbFreeDeviceInfo(XkbDeviceInfoPtr devi,unsigned which,Bool freeDevI) -#else -XkbFreeDeviceInfo(devi,which,freeDevI) - XkbDeviceInfoPtr devi; - unsigned which; - Bool freeDevI; -#endif { if (devi) { if (freeDevI) { diff --git a/xkb/XKBGAlloc.c b/xkb/XKBGAlloc.c index 44a74c6a8..209631e72 100644 --- a/xkb/XKBGAlloc.c +++ b/xkb/XKBGAlloc.c @@ -24,7 +24,7 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/X11/XKBGAlloc.c,v 3.4 2001/01/17 19:41:48 dawes Exp $ */ +/* $XFree86: xc/lib/X11/XKBGAlloc.c,v 3.5 2003/11/17 22:20:09 dawes Exp $ */ #define NEED_EVENTS #define NEED_REPLIES @@ -58,7 +58,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. /***====================================================================***/ static void -#if NeedFunctionPrototypes _XkbFreeGeomLeafElems( Bool freeAll, int first, int count, @@ -66,16 +65,6 @@ _XkbFreeGeomLeafElems( Bool freeAll, unsigned short * sz_inout, char ** elems, unsigned int elem_sz) -#else -_XkbFreeGeomLeafElems(freeAll,first,count,num_inout,sz_inout,elems,elem_sz) - Bool freeAll; - int first; - int count; - unsigned short * num_inout; - unsigned short * sz_inout; - char ** elems; - unsigned int elem_sz; -#endif { if ((freeAll)||(*elems==NULL)) { *num_inout= *sz_inout= 0; @@ -106,13 +95,10 @@ _XkbFreeGeomLeafElems(freeAll,first,count,num_inout,sz_inout,elems,elem_sz) } typedef void (*ContentsClearFunc)( -#if NeedFunctionPrototypes char * /* priv */ -#endif ); static void -#if NeedFunctionPrototypes _XkbFreeGeomNonLeafElems( Bool freeAll, int first, int count, @@ -121,18 +107,6 @@ _XkbFreeGeomNonLeafElems( Bool freeAll, char ** elems, unsigned int elem_sz, ContentsClearFunc freeFunc) -#else -_XkbFreeGeomNonLeafElems(freeAll,first,count,num_inout,sz_inout,elems,elem_sz, - freeFunc) - Bool freeAll; - int first; - int count; - unsigned short * num_inout; - unsigned short * sz_inout; - char ** elems; - unsigned int elem_sz; - ContentsClearFunc freeFunc; -#endif { register int i; register char *ptr; @@ -177,12 +151,7 @@ register char *ptr; /***====================================================================***/ static void -#if NeedFunctionPrototypes _XkbClearProperty(char *prop_in) -#else -_XkbClearProperty(prop_in) - char * prop_in; -#endif { XkbPropertyPtr prop= (XkbPropertyPtr)prop_in; @@ -198,18 +167,10 @@ XkbPropertyPtr prop= (XkbPropertyPtr)prop_in; } void -#if NeedFunctionPrototypes XkbFreeGeomProperties( XkbGeometryPtr geom, int first, int count, Bool freeAll) -#else -XkbFreeGeomProperties(geom,first,count,freeAll) - XkbGeometryPtr geom; - int first; - int count; - Bool freeAll; -#endif { _XkbFreeGeomNonLeafElems(freeAll,first,count, &geom->num_properties,&geom->sz_properties, @@ -221,18 +182,10 @@ XkbFreeGeomProperties(geom,first,count,freeAll) /***====================================================================***/ void -#if NeedFunctionPrototypes XkbFreeGeomKeyAliases( XkbGeometryPtr geom, int first, int count, Bool freeAll) -#else -XkbFreeGeomKeyAliases(geom,first,count,freeAll) - XkbGeometryPtr geom; - int first; - int count; - Bool freeAll; -#endif { _XkbFreeGeomLeafElems(freeAll,first,count, &geom->num_key_aliases,&geom->sz_key_aliases, @@ -244,12 +197,7 @@ XkbFreeGeomKeyAliases(geom,first,count,freeAll) /***====================================================================***/ static void -#if NeedFunctionPrototypes _XkbClearColor(char *color_in) -#else -_XkbClearColor(color_in) - char * color_in; -#endif { XkbColorPtr color= (XkbColorPtr)color_in; @@ -259,15 +207,7 @@ XkbColorPtr color= (XkbColorPtr)color_in; } void -#if NeedFunctionPrototypes XkbFreeGeomColors(XkbGeometryPtr geom,int first,int count,Bool freeAll) -#else -XkbFreeGeomColors(geom,first,count,freeAll) - XkbGeometryPtr geom; - int first; - int count; - Bool freeAll; -#endif { _XkbFreeGeomNonLeafElems(freeAll,first,count, &geom->num_colors,&geom->sz_colors, @@ -279,15 +219,7 @@ XkbFreeGeomColors(geom,first,count,freeAll) /***====================================================================***/ void -#if NeedFunctionPrototypes XkbFreeGeomPoints(XkbOutlinePtr outline,int first,int count,Bool freeAll) -#else -XkbFreeGeomPoints(outline,first,count,freeAll) - XkbOutlinePtr outline; - int first; - int count; - Bool freeAll; -#endif { _XkbFreeGeomLeafElems(freeAll,first,count, &outline->num_points,&outline->sz_points, @@ -299,12 +231,7 @@ XkbFreeGeomPoints(outline,first,count,freeAll) /***====================================================================***/ static void -#if NeedFunctionPrototypes _XkbClearOutline(char *outline_in) -#else -_XkbClearOutline(outline_in) - char * outline_in; -#endif { XkbOutlinePtr outline= (XkbOutlinePtr)outline_in; @@ -314,15 +241,7 @@ XkbOutlinePtr outline= (XkbOutlinePtr)outline_in; } void -#if NeedFunctionPrototypes XkbFreeGeomOutlines(XkbShapePtr shape,int first,int count,Bool freeAll) -#else -XkbFreeGeomOutlines(shape,first,count,freeAll) - XkbShapePtr shape; - int first; - int count; - Bool freeAll; -#endif { _XkbFreeGeomNonLeafElems(freeAll,first,count, &shape->num_outlines,&shape->sz_outlines, @@ -335,12 +254,7 @@ XkbFreeGeomOutlines(shape,first,count,freeAll) /***====================================================================***/ static void -#if NeedFunctionPrototypes _XkbClearShape(char *shape_in) -#else -_XkbClearShape(shape_in) - char * shape_in; -#endif { XkbShapePtr shape= (XkbShapePtr)shape_in; @@ -350,15 +264,7 @@ XkbShapePtr shape= (XkbShapePtr)shape_in; } void -#if NeedFunctionPrototypes XkbFreeGeomShapes(XkbGeometryPtr geom,int first,int count,Bool freeAll) -#else -XkbFreeGeomShapes(geom,first,count,freeAll) - XkbGeometryPtr geom; - int first; - int count; - Bool freeAll; -#endif { _XkbFreeGeomNonLeafElems(freeAll,first,count, &geom->num_shapes,&geom->sz_shapes, @@ -370,15 +276,7 @@ XkbFreeGeomShapes(geom,first,count,freeAll) /***====================================================================***/ void -#if NeedFunctionPrototypes XkbFreeGeomOverlayKeys(XkbOverlayRowPtr row,int first,int count,Bool freeAll) -#else -XkbFreeGeomOverlayKeys(row,first,count,freeAll) - XkbOverlayRowPtr row; - int first; - int count; - Bool freeAll; -#endif { _XkbFreeGeomLeafElems(freeAll,first,count, &row->num_keys,&row->sz_keys, @@ -390,12 +288,7 @@ XkbFreeGeomOverlayKeys(row,first,count,freeAll) /***====================================================================***/ static void -#if NeedFunctionPrototypes _XkbClearOverlayRow(char *row_in) -#else -_XkbClearOverlayRow(row_in) - char * row_in; -#endif { XkbOverlayRowPtr row= (XkbOverlayRowPtr)row_in; @@ -405,15 +298,7 @@ XkbOverlayRowPtr row= (XkbOverlayRowPtr)row_in; } void -#if NeedFunctionPrototypes XkbFreeGeomOverlayRows(XkbOverlayPtr overlay,int first,int count,Bool freeAll) -#else -XkbFreeGeomOverlayRows(overlay,first,count,freeAll) - XkbOverlayPtr overlay; - int first; - int count; - Bool freeAll; -#endif { _XkbFreeGeomNonLeafElems(freeAll,first,count, &overlay->num_rows,&overlay->sz_rows, @@ -425,12 +310,7 @@ XkbFreeGeomOverlayRows(overlay,first,count,freeAll) /***====================================================================***/ static void -#if NeedFunctionPrototypes _XkbClearOverlay(char *overlay_in) -#else -_XkbClearOverlay(overlay_in) - char * overlay_in; -#endif { XkbOverlayPtr overlay= (XkbOverlayPtr)overlay_in; @@ -440,15 +320,7 @@ XkbOverlayPtr overlay= (XkbOverlayPtr)overlay_in; } void -#if NeedFunctionPrototypes XkbFreeGeomOverlays(XkbSectionPtr section,int first,int count,Bool freeAll) -#else -XkbFreeGeomOverlays(section,first,count,freeAll) - XkbSectionPtr section; - int first; - int count; - Bool freeAll; -#endif { _XkbFreeGeomNonLeafElems(freeAll,first,count, §ion->num_overlays,§ion->sz_overlays, @@ -460,15 +332,7 @@ XkbFreeGeomOverlays(section,first,count,freeAll) /***====================================================================***/ void -#if NeedFunctionPrototypes XkbFreeGeomKeys(XkbRowPtr row,int first,int count,Bool freeAll) -#else -XkbFreeGeomKeys(row,first,count,freeAll) - XkbRowPtr row; - int first; - int count; - Bool freeAll; -#endif { _XkbFreeGeomLeafElems(freeAll,first,count, &row->num_keys,&row->sz_keys, @@ -480,12 +344,7 @@ XkbFreeGeomKeys(row,first,count,freeAll) /***====================================================================***/ static void -#if NeedFunctionPrototypes _XkbClearRow(char *row_in) -#else -_XkbClearRow(row_in) - char * row_in; -#endif { XkbRowPtr row= (XkbRowPtr)row_in; @@ -495,15 +354,7 @@ XkbRowPtr row= (XkbRowPtr)row_in; } void -#if NeedFunctionPrototypes XkbFreeGeomRows(XkbSectionPtr section,int first,int count,Bool freeAll) -#else -XkbFreeGeomRows(section,first,count,freeAll) - XkbSectionPtr section; - int first; - int count; - Bool freeAll; -#endif { _XkbFreeGeomNonLeafElems(freeAll,first,count, §ion->num_rows,§ion->sz_rows, @@ -514,12 +365,7 @@ XkbFreeGeomRows(section,first,count,freeAll) /***====================================================================***/ static void -#if NeedFunctionPrototypes _XkbClearSection(char *section_in) -#else -_XkbClearSection(section_in) - char * section_in; -#endif { XkbSectionPtr section= (XkbSectionPtr)section_in; @@ -533,15 +379,7 @@ XkbSectionPtr section= (XkbSectionPtr)section_in; } void -#if NeedFunctionPrototypes XkbFreeGeomSections(XkbGeometryPtr geom,int first,int count,Bool freeAll) -#else -XkbFreeGeomSections(geom,first,count,freeAll) - XkbGeometryPtr geom; - int first; - int count; - Bool freeAll; -#endif { _XkbFreeGeomNonLeafElems(freeAll,first,count, &geom->num_sections,&geom->sz_sections, @@ -553,12 +391,7 @@ XkbFreeGeomSections(geom,first,count,freeAll) /***====================================================================***/ static void -#if NeedFunctionPrototypes _XkbClearDoodad(char *doodad_in) -#else -_XkbClearDoodad(doodad_in) - char * doodad_in; -#endif { XkbDoodadPtr doodad= (XkbDoodadPtr)doodad_in; @@ -588,14 +421,7 @@ XkbDoodadPtr doodad= (XkbDoodadPtr)doodad_in; } void -#if NeedFunctionPrototypes XkbFreeGeomDoodads(XkbDoodadPtr doodads,int nDoodads,Bool freeAll) -#else -XkbFreeGeomDoodads(doodads,nDoodads,freeAll) - XkbDoodadPtr doodads; - int nDoodads; - Bool freeAll; -#endif { register int i; register XkbDoodadPtr doodad; @@ -611,14 +437,7 @@ register XkbDoodadPtr doodad; } void -#if NeedFunctionPrototypes XkbFreeGeometry(XkbGeometryPtr geom,unsigned which,Bool freeMap) -#else -XkbFreeGeometry(geom,which,freeMap) - XkbGeometryPtr geom; - unsigned which; - Bool freeMap; -#endif { if (geom==NULL) return; @@ -652,20 +471,11 @@ XkbFreeGeometry(geom,which,freeMap) /***====================================================================***/ static Status -#if NeedFunctionPrototypes _XkbGeomAlloc( XPointer * old, unsigned short * num, unsigned short * total, int num_new, Size_t sz_elem) -#else -_XkbGeomAlloc(old,num,total,num_new,sz_elem) - XPointer * old; - unsigned short * num; - unsigned short * total; - int num_new; - Size_t sz_elem; -#endif { if (num_new<1) return Success; @@ -733,181 +543,91 @@ _XkbGeomAlloc(old,num,total,num_new,sz_elem) (n),sizeof(XkbOverlayKeyRec)) Status -#if NeedFunctionPrototypes XkbAllocGeomProps(XkbGeometryPtr geom,int nProps) -#else -XkbAllocGeomProps(geom,nProps) - XkbGeometryPtr geom; - int nProps; -#endif { return _XkbAllocProps(geom,nProps); } Status -#if NeedFunctionPrototypes XkbAllocGeomColors(XkbGeometryPtr geom,int nColors) -#else -XkbAllocGeomColors(geom,nColors) - XkbGeometryPtr geom; - int nColors; -#endif { return _XkbAllocColors(geom,nColors); } Status -#if NeedFunctionPrototypes XkbAllocGeomKeyAliases(XkbGeometryPtr geom,int nKeyAliases) -#else -XkbAllocGeomKeyAliases(geom,nKeyAliases) - XkbGeometryPtr geom; - int nKeyAliases; -#endif { return _XkbAllocKeyAliases(geom,nKeyAliases); } Status -#if NeedFunctionPrototypes XkbAllocGeomShapes(XkbGeometryPtr geom,int nShapes) -#else -XkbAllocGeomShapes(geom,nShapes) - XkbGeometryPtr geom; - int nShapes; -#endif { return _XkbAllocShapes(geom,nShapes); } Status -#if NeedFunctionPrototypes XkbAllocGeomSections(XkbGeometryPtr geom,int nSections) -#else -XkbAllocGeomSections(geom,nSections) - XkbGeometryPtr geom; - int nSections; -#endif { return _XkbAllocSections(geom,nSections); } Status -#if NeedFunctionPrototypes XkbAllocGeomOverlays(XkbSectionPtr section,int nOverlays) -#else -XkbAllocGeomOverlays(section,nOverlays) - XkbSectionPtr section; - int nOverlays; -#endif { return _XkbAllocOverlays(section,nOverlays); } Status -#if NeedFunctionPrototypes XkbAllocGeomOverlayRows(XkbOverlayPtr overlay,int nRows) -#else -XkbAllocGeomOverlayRows(overlay,nRows) - XkbOverlayPtr overlay; - int nRows; -#endif { return _XkbAllocOverlayRows(overlay,nRows); } Status -#if NeedFunctionPrototypes XkbAllocGeomOverlayKeys(XkbOverlayRowPtr row,int nKeys) -#else -XkbAllocGeomOverlayKeys(row,nKeys) - XkbOverlayRowPtr row; - int nKeys; -#endif { return _XkbAllocOverlayKeys(row,nKeys); } Status -#if NeedFunctionPrototypes XkbAllocGeomDoodads(XkbGeometryPtr geom,int nDoodads) -#else -XkbAllocGeomDoodads(geom,nDoodads) - XkbGeometryPtr geom; - int nDoodads; -#endif { return _XkbAllocDoodads(geom,nDoodads); } Status -#if NeedFunctionPrototypes XkbAllocGeomSectionDoodads(XkbSectionPtr section,int nDoodads) -#else -XkbAllocGeomSectionDoodads(section,nDoodads) - XkbSectionPtr section; - int nDoodads; -#endif { return _XkbAllocDoodads(section,nDoodads); } Status -#if NeedFunctionPrototypes XkbAllocGeomOutlines(XkbShapePtr shape,int nOL) -#else -XkbAllocGeomOutlines(shape,nOL) - XkbShapePtr shape; - int nOL; -#endif { return _XkbAllocOutlines(shape,nOL); } Status -#if NeedFunctionPrototypes XkbAllocGeomRows(XkbSectionPtr section,int nRows) -#else -XkbAllocGeomRows(section,nRows) - XkbSectionPtr section; - int nRows; -#endif { return _XkbAllocRows(section,nRows); } Status -#if NeedFunctionPrototypes XkbAllocGeomPoints(XkbOutlinePtr ol,int nPts) -#else -XkbAllocGeomPoints(ol,nPts) - XkbOutlinePtr ol; - int nPts; -#endif { return _XkbAllocPoints(ol,nPts); } Status -#if NeedFunctionPrototypes XkbAllocGeomKeys(XkbRowPtr row,int nKeys) -#else -XkbAllocGeomKeys(row,nKeys) - XkbRowPtr row; - int nKeys; -#endif { return _XkbAllocKeys(row,nKeys); } Status -#if NeedFunctionPrototypes XkbAllocGeometry(XkbDescPtr xkb,XkbGeometrySizesPtr sizes) -#else -XkbAllocGeometry(xkb,sizes) - XkbDescPtr xkb; - XkbGeometrySizesPtr sizes; -#endif { XkbGeometryPtr geom; Status rtrn; @@ -952,14 +672,7 @@ BAIL: /***====================================================================***/ XkbPropertyPtr -#if NeedFunctionPrototypes XkbAddGeomProperty(XkbGeometryPtr geom,char *name,char *value) -#else -XkbAddGeomProperty(geom,name,value) - XkbGeometryPtr geom; - char * name; - char * value; -#endif { register int i; register XkbPropertyPtr prop; @@ -997,14 +710,7 @@ register XkbPropertyPtr prop; } XkbKeyAliasPtr -#if NeedFunctionPrototypes XkbAddGeomKeyAlias(XkbGeometryPtr geom,char *aliasStr,char *realStr) -#else -XkbAddGeomKeyAlias(geom,aliasStr,realStr) - XkbGeometryPtr geom; - char * aliasStr; - char * realStr; -#endif { register int i; register XkbKeyAliasPtr alias; @@ -1031,14 +737,7 @@ register XkbKeyAliasPtr alias; } XkbColorPtr -#if NeedFunctionPrototypes XkbAddGeomColor(XkbGeometryPtr geom,char *spec,unsigned int pixel) -#else -XkbAddGeomColor(geom,spec,pixel) - XkbGeometryPtr geom; - char * spec; - unsigned int pixel; -#endif { register int i; register XkbColorPtr color; @@ -1066,13 +765,7 @@ register XkbColorPtr color; } XkbOutlinePtr -#if NeedFunctionPrototypes XkbAddGeomOutline(XkbShapePtr shape,int sz_points) -#else -XkbAddGeomOutline(shape,sz_points) - XkbShapePtr shape; - int sz_points; -#endif { XkbOutlinePtr outline; @@ -1091,14 +784,7 @@ XkbOutlinePtr outline; } XkbShapePtr -#if NeedFunctionPrototypes XkbAddGeomShape(XkbGeometryPtr geom,Atom name,int sz_outlines) -#else -XkbAddGeomShape(geom,name,sz_outlines) - XkbGeometryPtr geom; - Atom name; - int sz_outlines; -#endif { XkbShapePtr shape; register int i; @@ -1125,12 +811,7 @@ register int i; } XkbKeyPtr -#if NeedFunctionPrototypes XkbAddGeomKey(XkbRowPtr row) -#else -XkbAddGeomKey(row) - XkbRowPtr row; -#endif { XkbKeyPtr key; if (!row) @@ -1143,13 +824,7 @@ XkbKeyPtr key; } XkbRowPtr -#if NeedFunctionPrototypes XkbAddGeomRow(XkbSectionPtr section,int sz_keys) -#else -XkbAddGeomRow(section,sz_keys) - XkbSectionPtr section; - int sz_keys; -#endif { XkbRowPtr row; @@ -1167,20 +842,11 @@ XkbRowPtr row; } XkbSectionPtr -#if NeedFunctionPrototypes XkbAddGeomSection( XkbGeometryPtr geom, Atom name, int sz_rows, int sz_doodads, int sz_over) -#else -XkbAddGeomSection(geom,name,sz_rows,sz_doodads,sz_over) - XkbGeometryPtr geom; - Atom name; - int sz_rows; - int sz_doodads; - int sz_over; -#endif { register int i; XkbSectionPtr section; @@ -1216,14 +882,7 @@ XkbSectionPtr section; } XkbDoodadPtr -#if NeedFunctionPrototypes XkbAddGeomDoodad(XkbGeometryPtr geom,XkbSectionPtr section,Atom name) -#else -XkbAddGeomDoodad(geom,section,name) - XkbGeometryPtr geom; - XkbSectionPtr section; - Atom name; -#endif { XkbDoodadPtr old,doodad; register int i,nDoodads; @@ -1261,18 +920,10 @@ register int i,nDoodads; } XkbOverlayKeyPtr -#if NeedFunctionPrototypes XkbAddGeomOverlayKey( XkbOverlayPtr overlay, XkbOverlayRowPtr row, char * over, char * under) -#else -XkbAddGeomOverlayKey(overlay,row,over,under) - XkbOverlayPtr overlay; - XkbOverlayRowPtr row; - char * over; - char * under; -#endif { register int i; XkbOverlayKeyPtr key; @@ -1304,14 +955,7 @@ Bool found; } XkbOverlayRowPtr -#if NeedFunctionPrototypes XkbAddGeomOverlayRow(XkbOverlayPtr overlay,int row_under,int sz_keys) -#else -XkbAddGeomOverlayRow(overlay,row_under,sz_keys) - XkbOverlayPtr overlay; - int row_under; - int sz_keys; -#endif { register int i; XkbOverlayRowPtr row; @@ -1343,14 +987,7 @@ XkbOverlayRowPtr row; } XkbOverlayPtr -#if NeedFunctionPrototypes XkbAddGeomOverlay(XkbSectionPtr section,Atom name,int sz_rows) -#else -XkbAddGeomOverlay(section,name,sz_rows) - XkbSectionPtr section; - Atom name; - int sz_rows; -#endif { register int i; XkbOverlayPtr overlay; diff --git a/xkb/XKBMAlloc.c b/xkb/XKBMAlloc.c index 29cdc3c80..20def46ba 100644 --- a/xkb/XKBMAlloc.c +++ b/xkb/XKBMAlloc.c @@ -24,7 +24,7 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/X11/XKBMAlloc.c,v 3.11 2001/01/17 19:41:48 dawes Exp $ */ +/* $XFree86: xc/lib/X11/XKBMAlloc.c,v 3.12 2003/11/17 22:20:09 dawes Exp $ */ #ifndef XKB_IN_SERVER @@ -54,14 +54,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. /***====================================================================***/ Status -#if NeedFunctionPrototypes XkbAllocClientMap(XkbDescPtr xkb,unsigned which,unsigned nTotalTypes) -#else -XkbAllocClientMap(xkb,which,nTotalTypes) - XkbDescPtr xkb; - unsigned which; - unsigned nTotalTypes; -#endif { register int i; XkbClientMapPtr map; @@ -144,14 +137,7 @@ fprintf(stderr,"bad keycode (%d,%d) in XkbAllocClientMap\n", } Status -#if NeedFunctionPrototypes XkbAllocServerMap(XkbDescPtr xkb,unsigned which,unsigned nNewActions) -#else -XkbAllocServerMap(xkb,which,nNewActions) - XkbDescPtr xkb; - unsigned which; - unsigned nNewActions; -#endif { register int i; XkbServerMapPtr map; @@ -245,13 +231,7 @@ XkbServerMapPtr map; /***====================================================================***/ Status -#if NeedFunctionPrototypes XkbCopyKeyType(XkbKeyTypePtr from,XkbKeyTypePtr into) -#else -XkbCopyKeyType(from,into) - XkbKeyTypePtr from; - XkbKeyTypePtr into; -#endif { if ((!from)||(!into)) return BadMatch; @@ -292,14 +272,7 @@ XkbCopyKeyType(from,into) } Status -#if NeedFunctionPrototypes XkbCopyKeyTypes(XkbKeyTypePtr from,XkbKeyTypePtr into,int num_types) -#else -XkbCopyKeyTypes(from,into,num_types) - XkbKeyTypePtr from; - XkbKeyTypePtr into; - int num_types; -#endif { register int i,rtrn; @@ -313,20 +286,11 @@ register int i,rtrn; } XkbKeyTypePtr -#if NeedFunctionPrototypes XkbAddKeyType( XkbDescPtr xkb, Atom name, int map_count, Bool want_preserve, int num_lvls) -#else -XkbAddKeyType(xkb,name,map_count,want_preserve,num_lvls) - XkbDescPtr xkb; - Atom name; - int map_count; - Bool want_preserve; - int num_lvls; -#endif { register int i; unsigned tmp; @@ -397,20 +361,11 @@ XkbClientMapPtr map; } Status -#if NeedFunctionPrototypes XkbResizeKeyType( XkbDescPtr xkb, int type_ndx, int map_count, Bool want_preserve, int new_num_lvls) -#else -XkbResizeKeyType(xkb,type_ndx,map_count,want_preserve,new_num_lvls) - XkbDescPtr xkb; - int type_ndx; - int map_count; - Bool want_preserve; - int new_num_lvls; -#endif { XkbKeyTypePtr type; KeyCode matchingKeys[XkbMaxKeyCount],nMatchingKeys; @@ -604,14 +559,7 @@ KeyCode matchingKeys[XkbMaxKeyCount],nMatchingKeys; } KeySym * -#if NeedFunctionPrototypes XkbResizeKeySyms(XkbDescPtr xkb,int key,int needed) -#else -XkbResizeKeySyms(xkb,key,needed) - XkbDescPtr xkb; - int key; - int needed; -#endif { register int i,nSyms,nKeySyms; unsigned nOldSyms; @@ -666,20 +614,11 @@ KeySym *newSyms; } static unsigned -#if NeedFunctionPrototypes _ExtendRange( unsigned int old_flags, unsigned int flag, KeyCode newKC, KeyCode * old_min, unsigned char * old_num) -#else -_ExtendRange(old_flags,flag,newKC,old_min,old_num) - unsigned int old_flags; - unsigned int flag; - KeyCode newKC; - KeyCode * old_min; - unsigned char * old_num; -#endif { if ((old_flags&flag)==0) { old_flags|= flag; @@ -700,18 +639,10 @@ _ExtendRange(old_flags,flag,newKC,old_min,old_num) } Status -#if NeedFunctionPrototypes XkbChangeKeycodeRange( XkbDescPtr xkb, int minKC, int maxKC, XkbChangesPtr changes) -#else -XkbChangeKeycodeRange(xkb,minKC,maxKC,changes) - XkbDescPtr xkb; - int minKC; - int maxKC; - XkbChangesPtr changes; -#endif { int tmp; @@ -908,14 +839,7 @@ int tmp; } XkbAction * -#if NeedFunctionPrototypes XkbResizeKeyActions(XkbDescPtr xkb,int key,int needed) -#else -XkbResizeKeyActions(xkb,key,needed) - XkbDescPtr xkb; - int key; - int needed; -#endif { register int i,nActs; XkbAction *newActs; @@ -965,14 +889,7 @@ XkbAction *newActs; } void -#if NeedFunctionPrototypes XkbFreeClientMap(XkbDescPtr xkb,unsigned what,Bool freeMap) -#else -XkbFreeClientMap(xkb,what,freeMap) - XkbDescPtr xkb; - unsigned what; - Bool freeMap; -#endif { XkbClientMapPtr map; @@ -1030,14 +947,7 @@ XkbClientMapPtr map; } void -#if NeedFunctionPrototypes XkbFreeServerMap(XkbDescPtr xkb,unsigned what,Bool freeMap) -#else -XkbFreeServerMap(xkb,what,freeMap) - XkbDescPtr xkb; - unsigned what; - Bool freeMap; -#endif { XkbServerMapPtr map; diff --git a/xkb/XKBMisc.c b/xkb/XKBMisc.c index f3de9295e..06660ff89 100644 --- a/xkb/XKBMisc.c +++ b/xkb/XKBMisc.c @@ -24,7 +24,7 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/X11/XKBMisc.c,v 3.5 2001/10/28 03:32:33 tsi Exp $ */ +/* $XFree86: xc/lib/X11/XKBMisc.c,v 3.6 2003/11/17 22:20:09 dawes Exp $ */ #ifndef XKB_IN_SERVER @@ -102,14 +102,7 @@ static XkbKeyTypeRec canonicalTypes[XkbNumRequiredTypes] = { }; Status -#if NeedFunctionPrototypes XkbInitCanonicalKeyTypes(XkbDescPtr xkb,unsigned which,int keypadVMod) -#else -XkbInitCanonicalKeyTypes(xkb,which,keypadVMod) - XkbDescPtr xkb; - unsigned which; - int keypadVMod; -#endif { XkbClientMapPtr map; XkbKeyTypePtr from,to; @@ -159,23 +152,12 @@ Status rtrn; #define XKB_OFFSET(g,l) (((g)*groupsWidth)+(l)) int -#if NeedFunctionPrototypes XkbKeyTypesForCoreSymbols( XkbDescPtr xkb, int map_width, KeySym * core_syms, unsigned int protected, int * types_inout, KeySym * xkb_syms_rtrn) -#else -XkbKeyTypesForCoreSymbols(xkb,map_width,core_syms,protected,types_inout, - xkb_syms_rtrn) - XkbDescPtr xkb; - int map_width; - KeySym * core_syms; - unsigned int protected; - int * types_inout; - KeySym * xkb_syms_rtrn; -#endif { register int i; unsigned int empty; @@ -340,18 +322,10 @@ int nGroups,tmp,groupsWidth; } static XkbSymInterpretPtr -#if NeedFunctionPrototypes _XkbFindMatchingInterp( XkbDescPtr xkb, KeySym sym, unsigned int real_mods, unsigned int level) -#else -_XkbFindMatchingInterp(xkb,sym,real_mods,level) - XkbDescPtr xkb; - KeySym sym; - unsigned int real_mods; - unsigned int level; -#endif { register unsigned i; XkbSymInterpretPtr interp,rtrn; @@ -399,14 +373,7 @@ CARD8 mods; } static void -#if NeedFunctionPrototypes _XkbAddKeyChange(KeyCode *pFirst,unsigned char *pNum,KeyCode newKey) -#else -_XkbAddKeyChange(pFirst,pNum,newKey) - KeyCode * pFirst; - unsigned char * pNum; - KeyCode newKey; -#endif { KeyCode last; @@ -422,14 +389,7 @@ KeyCode last; } static void -#if NeedFunctionPrototypes _XkbSetActionKeyMods(XkbDescPtr xkb,XkbAction *act,unsigned mods) -#else -_XkbSetActionKeyMods(xkb,act,mods) - XkbDescPtr xkb; - XkbAction * act; - unsigned mods; -#endif { unsigned tmp; @@ -457,14 +417,7 @@ unsigned tmp; #define IBUF_SIZE 8 Bool -#if NeedFunctionPrototypes XkbApplyCompatMapToKey(XkbDescPtr xkb,KeyCode key,XkbChangesPtr changes) -#else -XkbApplyCompatMapToKey(xkb,key,changes) - XkbDescPtr xkb; - KeyCode key; - XkbChangesPtr changes; -#endif { KeySym * syms; unsigned char explicit,mods; @@ -613,22 +566,12 @@ unsigned changed,tmp; } Bool -#if NeedFunctionPrototypes XkbUpdateMapFromCore( XkbDescPtr xkb, KeyCode first_key, int num_keys, int map_width, KeySym * core_keysyms, XkbChangesPtr changes) -#else -XkbUpdateMapFromCore(xkb,first_key,num_keys,map_width,core_keysyms,changes) - XkbDescPtr xkb; - KeyCode first_key; - int num_keys; - int map_width; - KeySym * core_keysyms; - XkbChangesPtr changes; -#endif { register int key,last_key; KeySym * syms; @@ -705,22 +648,12 @@ KeySym * syms; } Status -#if NeedFunctionPrototypes XkbChangeTypesOfKey( XkbDescPtr xkb, int key, int nGroups, unsigned groups, int * newTypesIn, XkbMapChangesPtr changes) -#else -XkbChangeTypesOfKey(xkb,key,nGroups,groups,newTypesIn,changes) - XkbDescPtr xkb; - int key; - int nGroups; - unsigned groups; - int * newTypesIn; - XkbMapChangesPtr changes; -#endif { XkbKeyTypePtr pOldType,pNewType; register int i; @@ -839,14 +772,7 @@ int width,nOldGroups,oldWidth,newTypes[XkbNumKbdGroups]; /***====================================================================***/ Bool -#if NeedFunctionPrototypes XkbVirtualModsToReal(XkbDescPtr xkb,unsigned virtual_mask,unsigned *mask_rtrn) -#else -XkbVirtualModsToReal(xkb,virtual_mask,mask_rtrn) - XkbDescPtr xkb; - unsigned virtual_mask; - unsigned * mask_rtrn; -#endif { register int i,bit; register unsigned mask; @@ -870,14 +796,7 @@ register unsigned mask; /***====================================================================***/ Bool -#if NeedFunctionPrototypes XkbUpdateActionVirtualMods(XkbDescPtr xkb,XkbAction *act,unsigned changed) -#else -XkbUpdateActionVirtualMods(xkb,act,changed) - XkbDescPtr xkb; - XkbAction * act; - unsigned changed; -#endif { unsigned int tmp; @@ -903,18 +822,10 @@ unsigned int tmp; } void -#if NeedFunctionPrototypes XkbUpdateKeyTypeVirtualMods( XkbDescPtr xkb, XkbKeyTypePtr type, unsigned int changed, XkbChangesPtr changes) -#else -XkbUpdateKeyTypeVirtualMods(xkb,type,changed,changes) - XkbDescPtr xkb; - XkbKeyTypePtr type; - unsigned int changed; - XkbChangesPtr changes; -#endif { register unsigned int i; unsigned int mask; @@ -959,14 +870,7 @@ unsigned int mask; } Bool -#if NeedFunctionPrototypes XkbApplyVirtualModChanges(XkbDescPtr xkb,unsigned changed,XkbChangesPtr changes) -#else -XkbApplyVirtualModChanges(xkb,changed,changes) - XkbDescPtr xkb; - unsigned changed; - XkbChangesPtr changes; -#endif { register int i; unsigned int checkState = 0; diff --git a/xkb/ddxBeep.c b/xkb/ddxBeep.c index 74352161c..bb02619f3 100644 --- a/xkb/ddxBeep.c +++ b/xkb/ddxBeep.c @@ -24,7 +24,7 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/ddxBeep.c,v 3.9 2002/12/05 21:59:00 paulo Exp $ */ +/* $XFree86: xc/programs/Xserver/xkb/ddxBeep.c,v 3.10 2003/11/17 22:20:44 dawes Exp $ */ #include <stdio.h> #define NEED_EVENTS 1 @@ -97,11 +97,7 @@ static char doesPitch = 1; #define MAKE_ATOM(a) MakeAtom(a,sizeof(a)-1,True) static void -#if NeedFunctionPrototypes _XkbDDXBeepInitAtoms(void) -#else -_XkbDDXBeepInitAtoms() -#endif { featureOn= MAKE_ATOM(FEATURE_ON); featureOff= MAKE_ATOM(FEATURE_OFF); @@ -148,14 +144,7 @@ _XkbDDXBeepInitAtoms() } static CARD32 -#if NeedFunctionPrototypes _XkbDDXBeepExpire(OsTimerPtr timer,CARD32 now,pointer arg) -#else -_XkbDDXBeepExpire(timer,now,arg) - OsTimerPtr timer; - CARD32 now; - pointer arg; -#endif { DeviceIntPtr dev= (DeviceIntPtr)arg; KbdFeedbackPtr feed; @@ -360,14 +349,7 @@ Atom name; } int -#if NeedFunctionPrototypes XkbDDXAccessXBeep(DeviceIntPtr dev,unsigned what,unsigned which) -#else -XkbDDXAccessXBeep(dev,what,which) - DeviceIntPtr dev; - unsigned what; - unsigned which; -#endif { XkbSrvInfoRec *xkbInfo= dev->key->xkbInfo; CARD32 next; diff --git a/xkb/ddxConfig.c b/xkb/ddxConfig.c index 58fc138bd..2485488d2 100644 --- a/xkb/ddxConfig.c +++ b/xkb/ddxConfig.c @@ -24,7 +24,7 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/ddxConfig.c,v 3.8 2002/12/20 20:18:35 paulo Exp $ */ +/* $XFree86: xc/programs/Xserver/xkb/ddxConfig.c,v 3.9 2003/11/17 22:20:45 dawes Exp $ */ #include <stdio.h> #define NEED_EVENTS 1 @@ -40,13 +40,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include <X11/extensions/XKBconfig.h> Bool -#if NeedFunctionPrototypes XkbDDXApplyConfig(XPointer cfg_in,XkbSrvInfoPtr info) -#else -XkbDDXApplyConfig(cfg_in,info) - XPointer cfg_in; - XkbSrvInfoPtr info; -#endif { XkbConfigRtrnPtr rtrn; XkbDescPtr xkb; @@ -90,18 +84,10 @@ XkbEventCauseRec cause; } XPointer -#if NeedFunctionPrototypes XkbDDXPreloadConfig( char ** rulesRtrn, XkbRF_VarDefsPtr defs, XkbComponentNamesPtr names, DeviceIntPtr dev) -#else -XkbDDXPreloadConfig(rulesRtrn,defs,names,dev) - char ** rulesRtrn; - XkbRF_VarDefsPtr defs; - XkbComponentNamesPtr names; - DeviceIntPtr dev; -#endif { char buf[PATH_MAX]; char * dName; diff --git a/xkb/ddxCtrls.c b/xkb/ddxCtrls.c index 4dfb03df2..c7c8f18b8 100644 --- a/xkb/ddxCtrls.c +++ b/xkb/ddxCtrls.c @@ -24,7 +24,7 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/ddxCtrls.c,v 1.3 2001/01/17 22:37:14 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/xkb/ddxCtrls.c,v 1.4 2003/11/17 22:20:45 dawes Exp $ */ #include <stdio.h> #define NEED_EVENTS 1 @@ -38,13 +38,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "XI.h" void -#if NeedFunctionPrototypes XkbDDXKeybdCtrlProc(DeviceIntPtr dev,KeybdCtrl *ctrl) -#else -XkbDDXKeybdCtrlProc(dev,ctrl) - DeviceIntPtr dev; - KeybdCtrl * ctrl; -#endif { int realRepeat; @@ -65,12 +59,7 @@ if (xkbDebugFlags&0x4) { int -#if NeedFunctionPrototypes XkbDDXUsesSoftRepeat(DeviceIntPtr pXDev) -#else -XkbDDXUsesSoftRepeat(pXDev) - DeviceIntPtr pXDev; -#endif { #ifndef XKB_ALWAYS_USES_SOFT_REPEAT if (pXDev && pXDev->kbdfeed ) { @@ -96,14 +85,7 @@ XkbDDXUsesSoftRepeat(pXDev) } void -#if NeedFunctionPrototypes XkbDDXChangeControls(DeviceIntPtr dev,XkbControlsPtr old,XkbControlsPtr new) -#else -XkbDDXChangeControls(dev,old,new) - DeviceIntPtr dev; - XkbControlsPtr old; - XkbControlsPtr new; -#endif { unsigned changed, i; unsigned char *rep_old, *rep_new, *rep_fb; diff --git a/xkb/ddxDevBtn.c b/xkb/ddxDevBtn.c index 47a757823..5f5ebc9b4 100644 --- a/xkb/ddxDevBtn.c +++ b/xkb/ddxDevBtn.c @@ -24,7 +24,7 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/ddxDevBtn.c,v 3.3 2001/08/23 21:49:51 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/xkb/ddxDevBtn.c,v 3.4 2003/11/17 22:20:45 dawes Exp $ */ #include <stdio.h> #define NEED_EVENTS 1 @@ -41,14 +41,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. extern int DeviceValuator; void -#if NeedFunctionPrototypes XkbDDXFakeDeviceButton(DeviceIntPtr dev,Bool press,int button) -#else -XkbDDXFakeDeviceButton(dev,press,button) - DeviceIntPtr dev; - Bool press; - int button; -#endif { int * devVal; INT32 * evVal; diff --git a/xkb/ddxFakeBtn.c b/xkb/ddxFakeBtn.c index 9394c4772..9f54cae6f 100644 --- a/xkb/ddxFakeBtn.c +++ b/xkb/ddxFakeBtn.c @@ -24,6 +24,7 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/xkb/ddxFakeBtn.c,v 1.2 2003/11/17 22:20:45 dawes Exp $ */ #include <stdio.h> #define NEED_EVENTS 1 @@ -37,13 +38,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "XI.h" void -#if NeedFunctionPrototypes XkbDDXFakePointerButton(int event,int button) -#else -XkbDDXFakePointerButton(event,button) - int event; - int button; -#endif { xEvent ev; int x,y; diff --git a/xkb/ddxFakeMtn.c b/xkb/ddxFakeMtn.c index c92f2f1da..289fa3bfb 100644 --- a/xkb/ddxFakeMtn.c +++ b/xkb/ddxFakeMtn.c @@ -24,7 +24,7 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/ddxFakeMtn.c,v 1.4 2001/01/17 22:37:14 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/xkb/ddxFakeMtn.c,v 1.6 2003/11/17 22:20:45 dawes Exp $ */ #include <stdio.h> #define NEED_EVENTS 1 @@ -45,29 +45,8 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "mipointer.h" #include "mipointrst.h" -extern WindowPtr GetSpriteWindow( -#if NeedFunctionPrototypes - void -#endif -); - -extern void NewCurrentScreen( -#if NeedFunctionPrototypes - ScreenPtr /* newScreen */, - int /* x */, - int /* y */ -#endif -); - void -#if NeedFunctionPrototypes XkbDDXFakePointerMotion(unsigned flags,int x,int y) -#else -XkbDDXFakePointerMotion(flags,x,y) - unsigned flags; - int x; - int y; -#endif { int oldX,oldY; ScreenPtr pScreen, oldScreen; diff --git a/xkb/ddxInit.c b/xkb/ddxInit.c index 12dbfe838..a8c436ea2 100644 --- a/xkb/ddxInit.c +++ b/xkb/ddxInit.c @@ -24,6 +24,7 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/xkb/ddxInit.c,v 1.2 2003/11/17 22:20:45 dawes Exp $ */ #include <stdio.h> #define NEED_EVENTS 1 @@ -37,12 +38,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "XI.h" int -#if NeedFunctionPrototypes XkbDDXInitDevice(DeviceIntPtr dev) -#else -XkbDDXInitDevice(dev) - DeviceIntPtr dev; -#endif { return 1; } diff --git a/xkb/ddxKeyClick.c b/xkb/ddxKeyClick.c index af1185f72..afd028fcd 100644 --- a/xkb/ddxKeyClick.c +++ b/xkb/ddxKeyClick.c @@ -24,6 +24,7 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/xkb/ddxKeyClick.c,v 1.2 2003/11/17 22:20:45 dawes Exp $ */ #include <stdio.h> #define NEED_EVENTS 1 @@ -37,14 +38,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "XI.h" void -#if NeedFunctionPrototypes XkbDDXKeyClick(DeviceIntPtr pXDev,int keycode,int synthetic) -#else -XkbDDXKeyClick(pXDev,keycode,synthetic) - DeviceIntPtr pXDev; - int keycode; - int synthetic; -#endif { #ifdef DEBUG if (xkbDebugFlags) diff --git a/xkb/ddxKillSrv.c b/xkb/ddxKillSrv.c index 3c57f8786..9ac7d3300 100644 --- a/xkb/ddxKillSrv.c +++ b/xkb/ddxKillSrv.c @@ -24,7 +24,7 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/ddxKillSrv.c,v 1.3 2002/11/23 19:27:50 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/xkb/ddxKillSrv.c,v 1.4 2003/11/17 22:20:45 dawes Exp $ */ #include <stdio.h> #define NEED_EVENTS 1 @@ -42,14 +42,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #endif int -#if NeedFunctionPrototypes XkbDDXTerminateServer(DeviceIntPtr dev,KeyCode key,XkbAction *act) -#else -XkbDDXTerminateServer(dev,key,act) - DeviceIntPtr dev; - KeyCode key; - XkbAction *act; -#endif { #ifdef XF86DDXACTIONS xf86ProcessActionEvent(ACTION_TERMINATE, NULL); diff --git a/xkb/ddxLEDs.c b/xkb/ddxLEDs.c index f6ea86965..ab757c6fc 100644 --- a/xkb/ddxLEDs.c +++ b/xkb/ddxLEDs.c @@ -24,6 +24,7 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/xkb/ddxLEDs.c,v 1.2 2003/11/17 22:20:45 dawes Exp $ */ #include <stdio.h> #define NEED_EVENTS 1 @@ -37,13 +38,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "XI.h" void -#if NeedFunctionPrototypes XkbDDXUpdateIndicators(DeviceIntPtr dev,CARD32 new) -#else -XkbDDXUpdateIndicators(dev,new) - DeviceIntPtr dev; - CARD32 new; -#endif { dev->kbdfeed->ctrl.leds= new; (*dev->kbdfeed->CtrlProc)(dev,&dev->kbdfeed->ctrl); @@ -51,16 +46,9 @@ XkbDDXUpdateIndicators(dev,new) } void -#if NeedFunctionPrototypes XkbDDXUpdateDeviceIndicators( DeviceIntPtr dev, XkbSrvLedInfoPtr sli, CARD32 new) -#else -XkbDDXUpdateDeviceIndicators(dev,sli,new) - DeviceIntPtr dev; - XkbSrvLedInfoPtr sli; - CARD32 new; -#endif { if (sli->fb.kf==dev->kbdfeed) XkbDDXUpdateIndicators(dev,new); diff --git a/xkb/ddxList.c b/xkb/ddxList.c index 8337022a3..5101de53b 100644 --- a/xkb/ddxList.c +++ b/xkb/ddxList.c @@ -24,7 +24,7 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/ddxList.c,v 3.7 2001/10/28 03:34:19 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/xkb/ddxList.c,v 3.9 2003/11/17 22:20:45 dawes Exp $ */ #include <stdio.h> #include <ctype.h> @@ -57,21 +57,12 @@ static char *componentDirs[_XkbListNumComponents] = { /***====================================================================***/ -Status -#if NeedFunctionPrototypes +static Status _AddListComponent( XkbSrvListInfoPtr list, int what, unsigned flags, char * str, ClientPtr client) -#else -_AddListComponent(list,what,flags,str,client) - XkbSrvListInfoPtr list; - int what; - unsigned flags; - char * str; - ClientPtr client; -#endif { int slen,wlen; unsigned char * wire8; @@ -119,18 +110,10 @@ char * tmp; /***====================================================================***/ static Status -#if NeedFunctionPrototypes XkbDDXListComponent( DeviceIntPtr dev, int what, XkbSrvListInfoPtr list, ClientPtr client) -#else -XkbDDXListComponent(dev,what,list,client) - DeviceIntPtr dev; - int what; - XkbSrvListInfoPtr list; - ClientPtr client; -#endif { char *file,*map,*tmp,buf[PATH_MAX]; FILE *in; @@ -284,14 +267,7 @@ char tmpname[32]; /* ARGSUSED */ Status -#if NeedFunctionPrototypes XkbDDXList(DeviceIntPtr dev,XkbSrvListInfoPtr list,ClientPtr client) -#else -XkbDDXList(dev,list,client) - DeviceIntPtr dev; - XkbSrvListInfoPtr list; - ClientPtr client; -#endif { Status status; diff --git a/xkb/ddxLoad.c b/xkb/ddxLoad.c index 82129d401..9f7704c5a 100644 --- a/xkb/ddxLoad.c +++ b/xkb/ddxLoad.c @@ -24,7 +24,7 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/ddxLoad.c,v 3.30 2002/05/31 18:46:06 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/xkb/ddxLoad.c,v 3.36 2003/11/17 22:20:45 dawes Exp $ */ #include <stdio.h> #include <ctype.h> @@ -40,6 +40,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #define XKBSRV_NEED_FILE_FUNCS #include "XKBsrv.h" #include "XI.h" +#include "xkb.h" #if defined(CSRG_BASED) || defined(linux) || defined(__sgi) || defined(AIXV3) || defined(__osf__) || defined(__GNU__) #include <paths.h> @@ -71,8 +72,8 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #define POST_ERROR_MSG2 "\"End of messages from xkbcomp\"" static void -OutputDirectory (outdir) - char* outdir; +OutputDirectory( + char* outdir) { #ifndef WIN32 if (getuid() == 0) { @@ -93,18 +94,10 @@ OutputDirectory (outdir) } Bool -#if NeedFunctionPrototypes XkbDDXCompileNamedKeymap( XkbDescPtr xkb, XkbComponentNamesPtr names, char * nameRtrn, int nameRtrnLen) -#else -XkbDDXCompileNamedKeymap(xkb,names,nameRtrn,nameRtrnLen) - XkbDescPtr xkb; - XkbComponentNamesPtr names; - char * nameRtrn; - int nameRtrnLen; -#endif { char cmd[PATH_MAX],file[PATH_MAX],xkm_output_dir[PATH_MAX],*map,*outFile; @@ -202,22 +195,12 @@ char cmd[PATH_MAX],file[PATH_MAX],xkm_output_dir[PATH_MAX],*map,*outFile; } Bool -#if NeedFunctionPrototypes XkbDDXCompileKeymapByNames( XkbDescPtr xkb, XkbComponentNamesPtr names, unsigned want, unsigned need, char * nameRtrn, int nameRtrnLen) -#else -XkbDDXCompileKeymapByNames(xkb,names,want,need,nameRtrn,nameRtrnLen) - XkbDescPtr xkb; - XkbComponentNamesPtr names; - unsigned want; - unsigned need; - char * nameRtrn; - int nameRtrnLen; -#endif { FILE * out; char buf[PATH_MAX],keymap[PATH_MAX],xkm_output_dir[PATH_MAX]; @@ -387,14 +370,7 @@ int i; } FILE * -#if NeedFunctionPrototypes XkbDDXOpenConfigFile(char *mapName,char *fileNameRtrn,int fileNameRtrnLen) -#else -XkbDDXOpenConfigFile(mapName,fileNameRtrn,fileNameRtrnLen) - char * mapName; - char * fileNameRtrn; - int fileNameRtrnLen; -#endif { char buf[PATH_MAX],xkm_output_dir[PATH_MAX]; FILE * file; @@ -413,7 +389,7 @@ FILE * file; else if (strlen(xkm_output_dir)+strlen(mapName)+5 <= PATH_MAX) sprintf(buf,"%s%s.xkm",xkm_output_dir,mapName); if (buf[0] != '\0') - file= fopen(buf,"r"); + file= fopen(buf,"rb"); else file= NULL; } else file= NULL; @@ -425,7 +401,6 @@ FILE * file; } unsigned -#if NeedFunctionPrototypes XkbDDXLoadKeymapByNames( DeviceIntPtr keybd, XkbComponentNamesPtr names, unsigned want, @@ -433,16 +408,6 @@ XkbDDXLoadKeymapByNames( DeviceIntPtr keybd, XkbFileInfo * finfoRtrn, char * nameRtrn, int nameRtrnLen) -#else -XkbDDXLoadKeymapByNames(keybd,names,want,need,finfoRtrn,nameRtrn,nameRtrnLen) - DeviceIntPtr keybd; - XkbComponentNamesPtr names; - unsigned want; - unsigned need; - XkbFileInfo * finfoRtrn; - char * nameRtrn; - int nameRtrnLen; -#endif { XkbDescPtr xkb; FILE * file; @@ -482,12 +447,12 @@ unsigned missing; } file= XkbDDXOpenConfigFile(nameRtrn,fileName,PATH_MAX); if (file==NULL) { - ErrorF("Couldn't open compiled keymap file %s\n",fileName); + LogMessage(X_ERROR, "Couldn't open compiled keymap file %s\n",fileName); return 0; } missing= XkmReadFile(file,need,want,finfoRtrn); if (finfoRtrn->xkb==NULL) { - ErrorF("Error loading keymap %s\n",fileName); + LogMessage(X_ERROR, "Error loading keymap %s\n",fileName); fclose(file); (void) unlink (fileName); return 0; @@ -503,18 +468,10 @@ unsigned missing; } Bool -#if NeedFunctionPrototypes XkbDDXNamesFromRules( DeviceIntPtr keybd, char * rules_name, XkbRF_VarDefsPtr defs, XkbComponentNamesPtr names) -#else -XkbDDXNamesFromRules(keybd,rules_name,defs,names) - DeviceIntPtr keybd; - char * rules_name; - XkbRF_VarDefsPtr defs; - XkbComponentNamesPtr names; -#endif { char buf[PATH_MAX]; FILE * file; diff --git a/xkb/ddxPrivate.c b/xkb/ddxPrivate.c index 880efed4b..dd7ef4630 100644 --- a/xkb/ddxPrivate.c +++ b/xkb/ddxPrivate.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/xkb/ddxPrivate.c,v 1.1 2002/11/20 04:49:02 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/xkb/ddxPrivate.c,v 1.3 2003/11/17 22:20:45 dawes Exp $ */ #include <stdio.h> #define NEED_EVENTS 1 @@ -12,25 +12,15 @@ #endif int -#if NeedFunctionPrototypes XkbDDXPrivate(DeviceIntPtr dev,KeyCode key,XkbAction *act) -#else -XkbDDXPrivate(dev,key,act) - DeviceIntPtr dev; - KeyCode key; - XkbAction *act; -#endif { #ifdef XF86DDXACTIONS - XkbMessageAction *msgact = &(act->msg); - char msgbuf[7]; - int x; + XkbAnyAction *xf86act = &(act->any); + char msgbuf[XkbAnyActionDataSize+1]; - if (msgact->type == XkbSA_XFree86Private) { - msgbuf[0]= msgact->flags; - for (x=0; x<5; x++) - msgbuf[x+1] = msgact->message[x]; - msgbuf[6]= '\0'; + if (xf86act->type == XkbSA_XFree86Private) { + memcpy(msgbuf, xf86act->data, XkbAnyActionDataSize); + msgbuf[XkbAnyActionDataSize]= '\0'; if (_XkbStrCaseCmp(msgbuf, "-vmode")==0) xf86ProcessActionEvent(ACTION_PREV_MODE, NULL); else if (_XkbStrCaseCmp(msgbuf, "+vmode")==0) @@ -39,6 +29,8 @@ XkbDDXPrivate(dev,key,act) xf86ProcessActionEvent(ACTION_DISABLEGRAB, NULL); else if (_XkbStrCaseCmp(msgbuf, "clsgrb")==0) xf86ProcessActionEvent(ACTION_CLOSECLIENT, NULL); + else + xf86ProcessActionEvent(ACTION_MESSAGE, (void *) msgbuf); } #endif return 0; diff --git a/xkb/ddxVT.c b/xkb/ddxVT.c index 58de4b207..ec43f79db 100644 --- a/xkb/ddxVT.c +++ b/xkb/ddxVT.c @@ -24,7 +24,7 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/ddxVT.c,v 1.3 2002/11/23 19:27:50 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/xkb/ddxVT.c,v 1.4 2003/11/17 22:20:45 dawes Exp $ */ #include <stdio.h> #define NEED_EVENTS 1 @@ -42,14 +42,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #endif int -#if NeedFunctionPrototypes XkbDDXSwitchScreen(DeviceIntPtr dev,KeyCode key,XkbAction *act) -#else -XkbDDXSwitchScreen(dev,key,act) - DeviceIntPtr dev; - KeyCode key; - XkbAction *act; -#endif { #ifdef XF86DDXACTIONS { diff --git a/xkb/maprules.c b/xkb/maprules.c index 8c5ce1a42..c588ae399 100644 --- a/xkb/maprules.c +++ b/xkb/maprules.c @@ -24,7 +24,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/xkbfile/maprules.c,v 3.17 2002/11/26 01:43:25 dawes Exp $ */ +/* $XFree86: xc/lib/xkbfile/maprules.c,v 3.18 2003/11/17 22:20:23 dawes Exp $ */ #include <stdio.h> #include <ctype.h> @@ -89,12 +89,7 @@ typedef struct { } InputLine; static void -#if NeedFunctionPrototypes InitInputLine(InputLine *line) -#else -InitInputLine(line) - InputLine * line; -#endif { line->line_num= 1; line->num_line= 0; @@ -104,12 +99,7 @@ InitInputLine(line) } static void -#if NeedFunctionPrototypes FreeInputLine(InputLine *line) -#else -FreeInputLine(line) - InputLine *line; -#endif { if (line->line!=line->buf) _XkbFree(line->line); @@ -121,13 +111,7 @@ FreeInputLine(line) } static int -#if NeedFunctionPrototypes InputLineAddChar(InputLine *line,int ch) -#else -InputLineAddChar(line,ch) - InputLine * line; - int ch; -#endif { if (line->num_line>=line->sz_line) { if (line->line==line->buf) { @@ -148,14 +132,7 @@ InputLineAddChar(line,ch) InputLineAddChar(l,c)) static Bool -#if NeedFunctionPrototypes GetInputLine(FILE *file,InputLine *line,Bool checkbang) -#else -GetInputLine(file,line,checkbang) - FILE * file; - InputLine * line; - Bool checkbang; -#endif { int ch; Bool endOfFile,spacePending,slashPending,inComment; @@ -279,13 +256,7 @@ typedef struct { /***====================================================================***/ static char* -#if NeedFunctionPrototypes get_index(char *str, int *ndx) -#else -get_index(str, ndx) - char *str; - int *ndx; -#endif { char ndx_buf[NDX_BUFF_SIZE]; char *end; @@ -311,13 +282,7 @@ get_index(str, ndx) } static void -#if NeedFunctionPrototypes SetUpRemap(InputLine *line,RemapSpec *remap) -#else -SetUpRemap(line,remap) - InputLine * line; - RemapSpec * remap; -#endif { char * tok,*str; unsigned present, l_ndx_present, v_ndx_present; @@ -426,13 +391,7 @@ Bool found; } static Bool -#if NeedFunctionPrototypes MatchOneOf(char *wanted,char *vals_defined) -#else -MatchOneOf(wanted,vals_defined) - char * wanted; - char * vals_defined; -#endif { char *str,*next; int want_len= strlen(wanted); @@ -456,18 +415,10 @@ int want_len= strlen(wanted); /***====================================================================***/ static Bool -#if NeedFunctionPrototypes CheckLine( InputLine * line, RemapSpec * remap, XkbRF_RulePtr rule, XkbRF_GroupPtr group) -#else -CheckLine(line,remap,rule,group) - InputLine * line; - RemapSpec * remap; - XkbRF_RulePtr rule; - XkbRF_GroupsPtr group; -#endif { char * str,*tok; register int nread, i; @@ -566,13 +517,7 @@ Bool append = False; } static char * -#if NeedFunctionPrototypes _Concat(char *str1,char *str2) -#else -_Concat(str1,str2) - char * str1; - char * str2; -#endif { int len; @@ -586,12 +531,7 @@ int len; } static void -#if NeedFunctionPrototypes squeeze_spaces(char *p1) -#else -squeeze_spaces(p1) - char *p1; -#endif { char *p2; for (p2 = p1; *p2; p2++) { @@ -602,13 +542,7 @@ squeeze_spaces(p1) } static Bool -#if NeedFunctionPrototypes MakeMultiDefs(XkbRF_MultiDefsPtr mdefs, XkbRF_VarDefsPtr defs) -#else -MakeMultiDefs(mdefs, defs) - XkbRF_MultiDefsPtr mdefs - XkbRF_VarDefsPtr defs; -#endif { bzero((char *)mdefs,sizeof(XkbRF_MultiDefsRec)); @@ -667,12 +601,7 @@ MakeMultiDefs(mdefs, defs) } static void -#if NeedFunctionPrototypes FreeMultiDefs(XkbRF_MultiDefsPtr defs) -#else -FreeMultiDefs(defs) - XkbRF_MultiDefsPtr defs; -#endif { if (defs->options) _XkbFree(defs->options); if (defs->layout[1]) _XkbFree(defs->layout[1]); @@ -680,13 +609,7 @@ FreeMultiDefs(defs) } static void -#if NeedFunctionPrototypes Apply(char *src, char **dst) -#else -Apply(src, dst) - char *src; - char *dst; -#endif { if (src) { if (*src == '+' || *src == '!') { @@ -699,14 +622,8 @@ Apply(src, dst) } static void -#if NeedFunctionPrototypes XkbRF_ApplyRule( XkbRF_RulePtr rule, XkbComponentNamesPtr names) -#else -XkbRF_ApplyRule(rule,names) - XkbRF_RulePtr rule; - XkbComponentNamesPtr names; -#endif { rule->flags&= ~XkbRF_PendingMatch; /* clear the flag because it's applied */ @@ -719,16 +636,9 @@ XkbRF_ApplyRule(rule,names) } static Bool -#if NeedFunctionPrototypes CheckGroup( XkbRF_RulesPtr rules, char * group_name, char * name) -#else -XkbRF_CheckApplyRule(rules,group,name) - XkbRF_RulesPtr rules; - char * group_name; - char * name; -#endif { int i; char *p; @@ -750,18 +660,10 @@ XkbRF_CheckApplyRule(rules,group,name) } static int -#if NeedFunctionPrototypes XkbRF_CheckApplyRule( XkbRF_RulePtr rule, XkbRF_MultiDefsPtr mdefs, XkbComponentNamesPtr names, XkbRF_RulesPtr rules) -#else -XkbRF_CheckApplyRule(rule,mdefs,names) - XkbRF_RulePtr rule; - XkbRF_MultiDefsPtr mdefs; - XkbComponentNamesPtr names; - XkbRF_RulesPtr rules; -#endif { Bool pending = False; @@ -832,12 +734,7 @@ XkbRF_CheckApplyRule(rule,mdefs,names) } static void -#if NeedFunctionPrototypes XkbRF_ClearPartialMatches(XkbRF_RulesPtr rules) -#else -XkbRF_ClearPartialMatches(rules) - XkbRF_RulesPtr rules; -#endif { register int i; XkbRF_RulePtr rule; @@ -848,13 +745,7 @@ XkbRF_RulePtr rule; } static void -#if NeedFunctionPrototypes XkbRF_ApplyPartialMatches(XkbRF_RulesPtr rules,XkbComponentNamesPtr names) -#else -XkbRF_ApplyPartialMatches(rules,names) - XkbRF_RulesPtr rules; - XkbComponentNamesPtr names; -#endif { int i; XkbRF_RulePtr rule; @@ -867,18 +758,10 @@ XkbRF_RulePtr rule; } static void -#if NeedFunctionPrototypes XkbRF_CheckApplyRules( XkbRF_RulesPtr rules, XkbRF_MultiDefsPtr mdefs, XkbComponentNamesPtr names, int flags) -#else -XkbRF_CheckApplyRules(rules, mdefs, names, flags) - XkbRF_RulesPtr rules; - XkbRF_MultiDefsPtr mdefs; - XkbComponentNamesPtr names; - int flags; -#endif { int i; XkbRF_RulePtr rule; @@ -899,13 +782,7 @@ int skip; /***====================================================================***/ static char * -#if NeedFunctionPrototypes XkbRF_SubstituteVars(char *name, XkbRF_MultiDefsPtr mdefs) -#else -XkbRF_SubstituteVars(name, mdefs) - char * name; - XkbRF_MultiDefsPtr mdefs; -#endif { char *str, *outstr, *orig, *var; int len, ndx; @@ -1000,16 +877,9 @@ int len, ndx; /***====================================================================***/ Bool -#if NeedFunctionPrototypes XkbRF_GetComponents( XkbRF_RulesPtr rules, XkbRF_VarDefsPtr defs, XkbComponentNamesPtr names) -#else -XkbRF_GetComponents(rules,defs,names) - XkbRF_RulesPtr rules; - XkbRF_VarDefsPtr defs; - XkbComponentNamesPtr names; -#endif { XkbRF_MultiDefsRec mdefs; @@ -1042,12 +912,7 @@ XkbRF_GetComponents(rules,defs,names) } XkbRF_RulePtr -#if NeedFunctionPrototypes XkbRF_AddRule(XkbRF_RulesPtr rules) -#else -XkbRF_AddRule(rules) - XkbRF_RulesPtr rules; -#endif { if (rules->sz_rules<1) { rules->sz_rules= 16; @@ -1071,12 +936,7 @@ XkbRF_AddRule(rules) } XkbRF_GroupPtr -#if NeedFunctionPrototypes XkbRF_AddGroup(XkbRF_RulesPtr rules) -#else -XkbRF_AddGroup(rules) - XkbRF_RulesPtr rules; -#endif { if (rules->sz_groups<1) { rules->sz_groups= 16; @@ -1098,13 +958,7 @@ XkbRF_AddGroup(rules) } Bool -#if NeedFunctionPrototypes XkbRF_LoadRules(FILE *file, XkbRF_RulesPtr rules) -#else -XkbRF_LoadRules(file,rules) - FILE * file; - XkbRF_RulesPtr rules; -#endif { InputLine line; RemapSpec remap; @@ -1137,14 +991,7 @@ XkbRF_GroupRec tgroup,*group; } Bool -#if NeedFunctionPrototypes XkbRF_LoadRulesByName(char *base,char *locale,XkbRF_RulesPtr rules) -#else -XkbRF_LoadRulesByName(base,locale,rules) - char * base; - char * locale; - XkbRF_RulesPtr rules; -#endif { FILE * file; char buf[PATH_MAX]; @@ -1185,12 +1032,7 @@ Bool ok; #define HEAD_EXTRA 5 XkbRF_VarDescPtr -#if NeedFunctionPrototypes XkbRF_AddVarDesc(XkbRF_DescribeVarsPtr vars) -#else -XkbRF_AddVarDesc(vars) - XkbRF_DescribeVarsPtr vars; -#endif { if (vars->sz_desc<1) { vars->sz_desc= 16; @@ -1212,13 +1054,7 @@ XkbRF_AddVarDesc(vars) } XkbRF_VarDescPtr -#if NeedFunctionPrototypes XkbRF_AddVarDescCopy(XkbRF_DescribeVarsPtr vars,XkbRF_VarDescPtr from) -#else -XkbRF_AddVarDescCopy(vars,from) - XkbRF_DescribeVarsPtr vars; - XkbRF_VarDescPtr from; -#endif { XkbRF_VarDescPtr nd; @@ -1230,13 +1066,7 @@ XkbRF_VarDescPtr nd; } XkbRF_DescribeVarsPtr -#if NeedFunctionPrototypes XkbRF_AddVarToDescribe(XkbRF_RulesPtr rules,char *name) -#else -XkbRF_AddVarToDescribe(rules,name) - XkbRF_RulesPtr rules; - char * name; -#endif { if (rules->sz_extra<1) { rules->num_extra= 0; @@ -1264,13 +1094,7 @@ XkbRF_AddVarToDescribe(rules,name) } Bool -#if NeedFunctionPrototypes XkbRF_LoadDescriptions(FILE *file,XkbRF_RulesPtr rules) -#else -XkbRF_LoadDescriptions(file,rules) - FILE * file; - XkbRF_RulesPtr rules; -#endif { InputLine line; XkbRF_VarDescRec tmp; @@ -1366,14 +1190,7 @@ int len,headingtype,extra_ndx = 0; } Bool -#if NeedFunctionPrototypes XkbRF_LoadDescriptionsByName(char *base,char *locale,XkbRF_RulesPtr rules) -#else -XkbRF_LoadDescriptionsByName(base,locale,rules) - char * base; - char * locale; - XkbRF_RulesPtr rules; -#endif { FILE * file; char buf[PATH_MAX]; @@ -1408,15 +1225,7 @@ Bool ok; /***====================================================================***/ XkbRF_RulesPtr -#if NeedFunctionPrototypes XkbRF_Load(char *base,char *locale,Bool wantDesc,Bool wantRules) -#else -XkbRF_Load(base,locale,wantDesc,wantRules) - char *base; - char *locale; - Bool wantDesc; - Bool wantRules; -#endif { XkbRF_RulesPtr rules; @@ -1466,12 +1275,7 @@ XkbRF_RulesPtr rules; /***====================================================================***/ static void -#if NeedFunctionPrototypes XkbRF_ClearVarDescriptions(XkbRF_DescribeVarsPtr var) -#else -XkbRF_ClearVarDescriptions(var) - XkbRF_DescribeVarsPtr var; -#endif { register int i; @@ -1489,13 +1293,7 @@ register int i; } void -#if NeedFunctionPrototypes XkbRF_Free(XkbRF_RulesPtr rules,Bool freeRules) -#else -XkbRF_Free(rules,freeRules) - XkbRF_RulesPtr rules; - Bool freeRules; -#endif { int i; XkbRF_RulePtr rule; @@ -1551,14 +1349,7 @@ XkbRF_GroupPtr group; #ifndef XKB_IN_SERVER Bool -#if NeedFunctionPrototypes XkbRF_GetNamesProp(Display *dpy,char **rf_rtrn,XkbRF_VarDefsPtr vd_rtrn) -#else -XkbRF_GetNamesProp(dpy,rf_rtrn,vd_rtrn) - Display * dpy; - char ** rf_rtrn; - XkbRF_VarDefsPtr vd_rtrn; -#endif { Atom rules_atom,actual_type; int fmt; @@ -1618,14 +1409,7 @@ Status rtrn; } Bool -#if NeedFunctionPrototypes XkbRF_SetNamesProp(Display *dpy,char *rules_file,XkbRF_VarDefsPtr var_defs) -#else -XkbRF_SetNamesProp(dpy,rules_file,var_defs) - Display * dpy; - char * rules_file; - XkbRF_VarDefsPtr var_defs; -#endif { int len,out; Atom name; @@ -24,7 +24,7 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/xkb.c,v 3.18 2002/12/20 20:18:35 paulo Exp $ */ +/* $XFree86: xc/programs/Xserver/xkb/xkb.c,v 3.22 2003/11/17 22:20:45 dawes Exp $ */ #include <stdio.h> #include "X.h" @@ -36,6 +36,8 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #define XKBSRV_NEED_FILE_FUNCS #include "XKBsrv.h" #include "extnsionst.h" +#include "modinit.h" +#include "xkb.h" #include "XI.h" @@ -155,12 +157,7 @@ RESTYPE RT_XKBCLIENT; /***====================================================================***/ int -#if NeedFunctionPrototypes ProcXkbUseExtension(ClientPtr client) -#else -ProcXkbUseExtension(client) - ClientPtr client; -#endif { REQUEST(xkbUseExtensionReq); xkbUseExtensionReply rep; @@ -186,8 +183,9 @@ ProcXkbUseExtension(client) client->vMinor= stuff->wantedMinor; } else if (xkbDebugFlags&0x1) { - ErrorF("Rejecting client %d (0x%x) (wants %d.%02d, have %d.%02d)\n", - client->index, client->clientAsMask, + ErrorF("Rejecting client %d (0x%lx) (wants %d.%02d, have %d.%02d)\n", + client->index, + (long)client->clientAsMask, stuff->wantedMajor,stuff->wantedMinor, XkbMajorVersion,XkbMinorVersion); } @@ -209,12 +207,7 @@ ProcXkbUseExtension(client) /***====================================================================***/ int -#if NeedFunctionPrototypes ProcXkbSelectEvents(ClientPtr client) -#else -ProcXkbSelectEvents(client) - ClientPtr client; -#endif { unsigned legal; DeviceIntPtr dev; @@ -365,12 +358,7 @@ ProcXkbSelectEvents(client) /***====================================================================***/ int -#if NeedFunctionPrototypes ProcXkbBell(ClientPtr client) -#else -ProcXkbBell(client) - ClientPtr client; -#endif { REQUEST(xkbBellReq); DeviceIntPtr dev; @@ -511,12 +499,7 @@ ProcXkbBell(client) /***====================================================================***/ int -#if NeedFunctionPrototypes ProcXkbGetState(ClientPtr client) -#else -ProcXkbGetState(client) - ClientPtr client; -#endif { REQUEST(xkbGetStateReq); DeviceIntPtr dev; @@ -558,12 +541,7 @@ ProcXkbGetState(client) /***====================================================================***/ int -#if NeedFunctionPrototypes ProcXkbLatchLockState(ClientPtr client) -#else -ProcXkbLatchLockState(client) - ClientPtr client; -#endif { int status; DeviceIntPtr dev; @@ -622,12 +600,7 @@ ProcXkbLatchLockState(client) /***====================================================================***/ int -#if NeedFunctionPrototypes ProcXkbGetControls(ClientPtr client) -#else -ProcXkbGetControls(client) - ClientPtr client; -#endif { xkbGetControlsReply rep; XkbControlsPtr xkb; @@ -701,12 +674,7 @@ ProcXkbGetControls(client) } int -#if NeedFunctionPrototypes ProcXkbSetControls(ClientPtr client) -#else -ProcXkbSetControls(client) - ClientPtr client; -#endif { DeviceIntPtr dev; XkbSrvInfoPtr xkbi; @@ -875,16 +843,7 @@ ProcXkbSetControls(client) } int -#if NeedFunctionPrototypes XkbSetRepeatRate(DeviceIntPtr dev,int timeout,int interval,int major,int minor) -#else -XkbSetRepeatRate(dev,timeout,interval,major,minor) - DeviceIntPtr dev; - int timeout; - int interval; - int major; - int minor; -#endif { int changed= 0; XkbControlsRec old,*xkb; @@ -916,14 +875,7 @@ XkbControlsRec old,*xkb; } int -#if NeedFunctionPrototypes XkbGetRepeatRate(DeviceIntPtr dev,int *timeout,int *interval) -#else -XkbGetRepeatRate(dev,timeout,interval) - DeviceIntPtr dev; - int * timeout; - int * interval; -#endif { XkbControlsPtr xkb; @@ -938,13 +890,7 @@ XkbControlsPtr xkb; /***====================================================================***/ static int -#if NeedFunctionPrototypes XkbSizeKeyTypes(XkbDescPtr xkb,xkbGetMapReply *rep) -#else -XkbSizeKeyTypes(xkb,rep) - XkbDescPtr xkb; - xkbGetMapReply * rep; -#endif { XkbKeyTypeRec *type; unsigned i,len; @@ -969,18 +915,10 @@ XkbSizeKeyTypes(xkb,rep) } static char * -#if NeedFunctionPrototypes XkbWriteKeyTypes( XkbDescPtr xkb, xkbGetMapReply * rep, char * buf, ClientPtr client) -#else -XkbWriteKeyTypes(xkb,rep,buf,client) - XkbDescPtr xkb; - xkbGetMapReply * rep; - char * buf; - ClientPtr client; -#endif { XkbKeyTypePtr type; unsigned i; @@ -1041,13 +979,7 @@ XkbWriteKeyTypes(xkb,rep,buf,client) } static int -#if NeedFunctionPrototypes XkbSizeKeySyms(XkbDescPtr xkb,xkbGetMapReply *rep) -#else -XkbSizeKeySyms(xkb,rep) - XkbDescPtr xkb; - xkbGetMapReply * rep; -#endif { XkbSymMapPtr symMap; unsigned i,len; @@ -1074,13 +1006,7 @@ XkbSizeKeySyms(xkb,rep) } static int -#if NeedFunctionPrototypes XkbSizeVirtualMods(XkbDescPtr xkb,xkbGetMapReply *rep) -#else -XkbSizeVirtualMods(xkb,rep) - XkbDescPtr xkb; - xkbGetMapReply * rep; -#endif { register unsigned i,nMods,bit; @@ -1098,15 +1024,7 @@ register unsigned i,nMods,bit; } static char * -#if NeedFunctionPrototypes XkbWriteKeySyms(XkbDescPtr xkb,xkbGetMapReply *rep,char *buf,ClientPtr client) -#else -XkbWriteKeySyms(xkb,rep,buf,client) - XkbDescPtr xkb; - xkbGetMapReply * rep; - char * buf; - ClientPtr client; -#endif { register KeySym * pSym; XkbSymMapPtr symMap; @@ -1143,13 +1061,7 @@ register unsigned i; } static int -#if NeedFunctionPrototypes XkbSizeKeyActions(XkbDescPtr xkb,xkbGetMapReply *rep) -#else -XkbSizeKeyActions(xkb,rep) - XkbDescPtr xkb; - xkbGetMapReply * rep; -#endif { unsigned i,len,nActs; register KeyCode firstKey; @@ -1172,16 +1084,8 @@ XkbSizeKeyActions(xkb,rep) } static char * -#if NeedFunctionPrototypes XkbWriteKeyActions(XkbDescPtr xkb,xkbGetMapReply *rep,char *buf, ClientPtr client) -#else -XkbWriteKeyActions(xkb,rep,buf,client) - XkbDescPtr xkb; - xkbGetMapReply * rep; - char * buf; - ClientPtr client; -#endif { unsigned i; CARD8 * numDesc; @@ -1211,13 +1115,7 @@ XkbWriteKeyActions(xkb,rep,buf,client) } static int -#if NeedFunctionPrototypes XkbSizeKeyBehaviors(XkbDescPtr xkb,xkbGetMapReply *rep) -#else -XkbSizeKeyBehaviors(xkb,rep) - XkbDescPtr xkb; - xkbGetMapReply * rep; -#endif { unsigned i,len,nBhvr; XkbBehavior * bhv; @@ -1240,16 +1138,8 @@ XkbSizeKeyBehaviors(xkb,rep) } static char * -#if NeedFunctionPrototypes XkbWriteKeyBehaviors(XkbDescPtr xkb,xkbGetMapReply *rep,char *buf, ClientPtr client) -#else -XkbWriteKeyBehaviors(xkb,rep,buf,client) - XkbDescRec *xkb; - xkbGetMapReply *rep; - char *buf; - ClientPtr client; -#endif { unsigned i; xkbBehaviorWireDesc *wire; @@ -1270,13 +1160,7 @@ XkbWriteKeyBehaviors(xkb,rep,buf,client) } static int -#if NeedFunctionPrototypes XkbSizeExplicit(XkbDescPtr xkb,xkbGetMapReply *rep) -#else -XkbSizeExplicit(xkb,rep) - XkbDescPtr xkb; - xkbGetMapReply * rep; -#endif { unsigned i,len,nRtrn; @@ -1297,15 +1181,7 @@ XkbSizeExplicit(xkb,rep) } static char * -#if NeedFunctionPrototypes XkbWriteExplicit(XkbDescPtr xkb,xkbGetMapReply *rep,char *buf,ClientPtr client) -#else -XkbWriteExplicit(xkb,rep,buf,client) - XkbDescPtr xkb; - xkbGetMapReply *rep; - char *buf; - ClientPtr client; -#endif { unsigned i; char * start; @@ -1324,13 +1200,7 @@ unsigned char * pExp; } static int -#if NeedFunctionPrototypes XkbSizeModifierMap(XkbDescPtr xkb,xkbGetMapReply *rep) -#else -XkbSizeModifierMap(xkb,rep) - XkbDescPtr xkb; - xkbGetMapReply * rep; -#endif { unsigned i,len,nRtrn; @@ -1351,16 +1221,8 @@ XkbSizeModifierMap(xkb,rep) } static char * -#if NeedFunctionPrototypes XkbWriteModifierMap(XkbDescPtr xkb,xkbGetMapReply *rep,char *buf, ClientPtr client) -#else -XkbWriteModifierMap(xkb,rep,buf,client) - XkbDescPtr xkb; - xkbGetMapReply *rep; - char *buf; - ClientPtr client; -#endif { unsigned i; char * start; @@ -1379,13 +1241,7 @@ unsigned char * pMap; } static int -#if NeedFunctionPrototypes XkbSizeVirtualModMap(XkbDescPtr xkb,xkbGetMapReply *rep) -#else -XkbSizeVirtualModMap(xkb,rep) - XkbDescPtr xkb; - xkbGetMapReply * rep; -#endif { unsigned i,len,nRtrn; @@ -1406,16 +1262,8 @@ XkbSizeVirtualModMap(xkb,rep) } static char * -#if NeedFunctionPrototypes XkbWriteVirtualModMap(XkbDescPtr xkb,xkbGetMapReply *rep,char *buf, ClientPtr client) -#else -XkbWriteVirtualModMap(xkb,rep,buf,client) - XkbDescPtr xkb; - xkbGetMapReply *rep; - char *buf; - ClientPtr client; -#endif { unsigned i; xkbVModMapWireDesc * wire; @@ -1434,13 +1282,7 @@ unsigned short * pMap; } static Status -#if NeedFunctionPrototypes XkbComputeGetMapReplySize(XkbDescPtr xkb,xkbGetMapReply *rep) -#else -XkbComputeGetMapReplySize(xkb,rep) - XkbDescPtr xkb; - xkbGetMapReply * rep; -#endif { int len; @@ -1459,14 +1301,7 @@ int len; } static int -#if NeedFunctionPrototypes XkbSendMap(ClientPtr client,XkbDescPtr xkb,xkbGetMapReply *rep) -#else -XkbSendMap(client,xkb,rep) - ClientPtr client; - XkbDescPtr xkb; - xkbGetMapReply * rep; -#endif { unsigned i,len; char *desc,*start; @@ -1499,8 +1334,8 @@ char *desc,*start; if ( rep->totalVModMapKeys>0 ) desc= XkbWriteVirtualModMap(xkb,rep,desc,client); if ((desc-start)!=(len)) { - ErrorF("BOGUS LENGTH in write keyboard desc, expected %d, got %d\n", - len, desc-start); + ErrorF("BOGUS LENGTH in write keyboard desc, expected %d, got %ld\n", + len, (unsigned long)(desc-start)); } if (client->swapped) { register int n; @@ -1517,12 +1352,7 @@ char *desc,*start; } int -#if NeedFunctionPrototypes ProcXkbGetMap(ClientPtr client) -#else -ProcXkbGetMap(client) - ClientPtr client; -#endif { DeviceIntPtr dev; xkbGetMapReply rep; @@ -1651,22 +1481,12 @@ ProcXkbGetMap(client) /***====================================================================***/ static int -#if NeedFunctionPrototypes CheckKeyTypes( ClientPtr client, XkbDescPtr xkb, xkbSetMapReq * req, xkbKeyTypeWireDesc **wireRtrn, int * nMapsRtrn, CARD8 * mapWidthRtrn) -#else -CheckKeyTypes(client,xkb,req,wireRtrn,nMapsRtrn,mapWidthRtrn) - ClientPtr client; - XkbDescPtr xkb; - xkbSetMapReq * req; - xkbKeyTypeWireDesc **wireRtrn; - int * nMapsRtrn; - CARD8 * mapWidthRtrn; -#endif { unsigned nMaps; register unsigned i,n; @@ -1782,7 +1602,6 @@ register xkbKeyTypeWireDesc *wire = *wireRtrn; } static int -#if NeedFunctionPrototypes CheckKeySyms( ClientPtr client, XkbDescPtr xkb, xkbSetMapReq * req, @@ -1791,17 +1610,6 @@ CheckKeySyms( ClientPtr client, CARD16 * symsPerKey, xkbSymMapWireDesc ** wireRtrn, int * errorRtrn) -#else -CheckKeySyms(client,xkb,req,nTypes,mapWidths,symsPerKey,wireRtrn,errorRtrn) - ClientPtr client; - XkbDescPtr xkb; - xkbSetMapReq * req; - int nTypes; - CARD8 * mapWidths; - CARD16 * symsPerKey; - xkbSymMapWireDesc **wireRtrn; - int * errorRtrn; -#endif { register unsigned i; XkbSymMapPtr map; @@ -1884,7 +1692,6 @@ xkbSymMapWireDesc* wire = *wireRtrn; } static int -#if NeedFunctionPrototypes CheckKeyActions( XkbDescPtr xkb, xkbSetMapReq * req, int nTypes, @@ -1892,16 +1699,6 @@ CheckKeyActions( XkbDescPtr xkb, CARD16 * symsPerKey, CARD8 ** wireRtrn, int * nActsRtrn) -#else -CheckKeyActions(xkb,req,nTypes,mapWidths,symsPerKey,wireRtrn,nActsRtrn) - XkbDescRec *xkb; - xkbSetMapReq *req; - int nTypes; - CARD8 *mapWidths; - CARD16 *symsPerKey; - CARD8 **wireRtrn; - int *nActsRtrn; -#endif { int nActs; CARD8 * wire = *wireRtrn; @@ -1929,18 +1726,10 @@ register unsigned i; } static int -#if NeedFunctionPrototypes CheckKeyBehaviors( XkbDescPtr xkb, xkbSetMapReq * req, xkbBehaviorWireDesc ** wireRtrn, int * errorRtrn) -#else -CheckKeyBehaviors(xkb,req,wireRtrn,errorRtrn) - XkbDescRec *xkb; - xkbSetMapReq *req; - xkbBehaviorWireDesc **wireRtrn; - int *errorRtrn; -#endif { register xkbBehaviorWireDesc * wire = *wireRtrn; register XkbServerMapPtr server = xkb->server; @@ -1989,18 +1778,10 @@ unsigned first,last; } static int -#if NeedFunctionPrototypes CheckVirtualMods( XkbDescRec * xkb, xkbSetMapReq * req, CARD8 ** wireRtrn, int * errorRtrn) -#else -CheckVirtualMods(xkb,req,wireRtrn,errorRtrn) - XkbDescPtr xkb; - xkbSetMapReq * req; - CARD8 ** wireRtrn; - int * errorRtrn; -#endif { register CARD8 *wire = *wireRtrn; register unsigned i,nMods,bit; @@ -2016,18 +1797,10 @@ register unsigned i,nMods,bit; } static int -#if NeedFunctionPrototypes CheckKeyExplicit( XkbDescPtr xkb, xkbSetMapReq * req, CARD8 ** wireRtrn, int * errorRtrn) -#else -CheckKeyExplicit(xkb,req,wireRtrn,errorRtrn) - XkbDescPtr xkb; - xkbSetMapReq * req; - CARD8 ** wireRtrn; - int * errorRtrn; -#endif { register CARD8 * wire = *wireRtrn; CARD8 * start; @@ -2066,15 +1839,7 @@ int first,last; } static int -#if NeedFunctionPrototypes CheckModifierMap(XkbDescPtr xkb,xkbSetMapReq *req,CARD8 **wireRtrn,int *errRtrn) -#else -CheckModifierMap(xkb,req,wireRtrn,errRtrn) - XkbDescPtr xkb; - xkbSetMapReq * req; - CARD8 ** wireRtrn; - int * errRtrn; -#endif { register CARD8 * wire = *wireRtrn; CARD8 * start; @@ -2109,18 +1874,10 @@ int first,last; } static int -#if NeedFunctionPrototypes CheckVirtualModMap( XkbDescPtr xkb, xkbSetMapReq *req, xkbVModMapWireDesc **wireRtrn, int *errRtrn) -#else -CheckVirtualModMap(xkb,req,wireRtrn,errRtrn) - XkbDescPtr xkb; - xkbSetMapReq * req; - xkbVModMapWireDesc ** wireRtrn; - int * errRtrn; -#endif { register xkbVModMapWireDesc * wire = *wireRtrn; register unsigned i; @@ -2152,18 +1909,10 @@ int first,last; } static char * -#if NeedFunctionPrototypes SetKeyTypes( XkbDescPtr xkb, xkbSetMapReq * req, xkbKeyTypeWireDesc * wire, XkbChangesPtr changes) -#else -SetKeyTypes(xkb,req,wire,changes) - XkbDescPtr xkb; - xkbSetMapReq * req; - xkbKeyTypeWireDesc *wire; - XkbChangesPtr changes; -#endif { register unsigned i; unsigned first,last; @@ -2245,22 +1994,12 @@ CARD8 *map; } static char * -#if NeedFunctionPrototypes SetKeySyms( ClientPtr client, XkbDescPtr xkb, xkbSetMapReq * req, xkbSymMapWireDesc * wire, XkbChangesPtr changes, DeviceIntPtr dev) -#else -SetKeySyms(client,xkb,req,wire,changes,dev) - ClientPtr client; - XkbDescPtr xkb; - xkbSetMapReq * req; - xkbSymMapWireDesc * wire; - XkbChangesPtr changes; - DeviceIntPtr dev; -#endif { register unsigned i,s; XkbSymMapPtr oldMap; @@ -2325,18 +2064,10 @@ unsigned first,last; } static char * -#if NeedFunctionPrototypes SetKeyActions( XkbDescPtr xkb, xkbSetMapReq * req, CARD8 * wire, XkbChangesPtr changes) -#else -SetKeyActions(xkb,req,wire,changes) - XkbDescPtr xkb; - xkbSetMapReq * req; - CARD8 * wire; - XkbChangesPtr changes; -#endif { register unsigned i,first,last; CARD8 * nActs = wire; @@ -2370,18 +2101,10 @@ XkbAction * newActs; } static char * -#if NeedFunctionPrototypes SetKeyBehaviors( XkbSrvInfoPtr xkbi, xkbSetMapReq *req, xkbBehaviorWireDesc *wire, XkbChangesPtr changes) -#else -SetKeyBehaviors(xkbi,req,wire,changes) - XkbSrvInfoPtr xkbi; - xkbSetMapReq * req; - xkbBehaviorWireDesc*wire; - XkbChangesPtr changes; -#endif { register unsigned i; int maxRG = -1; @@ -2432,16 +2155,8 @@ unsigned first,last; } static char * -#if NeedFunctionPrototypes SetVirtualMods(XkbSrvInfoPtr xkbi,xkbSetMapReq *req,CARD8 *wire, XkbChangesPtr changes) -#else -SetVirtualMods(xkbi,req,wire,changes) - XkbSrvInfoPtr xkbi; - xkbSetMapReq * req; - CARD8 * wire; - XkbChangesPtr changes; -#endif { register int i,bit,nMods; XkbServerMapPtr srv = xkbi->desc->server; @@ -2462,16 +2177,8 @@ XkbServerMapPtr srv = xkbi->desc->server; } static char * -#if NeedFunctionPrototypes SetKeyExplicit(XkbSrvInfoPtr xkbi,xkbSetMapReq *req,CARD8 *wire, XkbChangesPtr changes) -#else -SetKeyExplicit(xkbi,req,wire,changes) - XkbSrvInfoPtr xkbi; - xkbSetMapReq * req; - CARD8 * wire; - XkbChangesPtr changes; -#endif { register unsigned i,first,last; XkbServerMapPtr xkb = xkbi->desc->server; @@ -2502,18 +2209,10 @@ CARD8 * start; } static char * -#if NeedFunctionPrototypes SetModifierMap( XkbSrvInfoPtr xkbi, xkbSetMapReq * req, CARD8 * wire, XkbChangesPtr changes) -#else -SetModifierMap(xkbi,req,wire,changes) - XkbSrvInfoPtr xkbi; - xkbSetMapReq * req; - CARD8 * wire; - XkbChangesPtr changes; -#endif { register unsigned i,first,last; XkbClientMapPtr xkb = xkbi->desc->map; @@ -2544,18 +2243,10 @@ CARD8 * start; } static char * -#if NeedFunctionPrototypes SetVirtualModMap( XkbSrvInfoPtr xkbi, xkbSetMapReq * req, xkbVModMapWireDesc * wire, XkbChangesPtr changes) -#else -SetVirtualModMap(xkbi,req,wire,changes) - XkbSrvInfoPtr xkbi; - xkbSetMapReq * req; - xkbVModMapWireDesc *wire; - XkbChangesPtr changes; -#endif { register unsigned i,first,last; XkbServerMapPtr srv = xkbi->desc->server; @@ -2583,12 +2274,7 @@ XkbServerMapPtr srv = xkbi->desc->server; } int -#if NeedFunctionPrototypes ProcXkbSetMap(ClientPtr client) -#else -ProcXkbSetMap(client) - ClientPtr client; -#endif { DeviceIntPtr dev; XkbSrvInfoPtr xkbi; @@ -2779,14 +2465,8 @@ allocFailure: /***====================================================================***/ static Status -#if NeedFunctionPrototypes XkbComputeGetCompatMapReplySize( XkbCompatMapPtr compat, xkbGetCompatMapReply * rep) -#else -XkbComputeGetCompatMapReplySize(compat,rep) - XkbCompatMapPtr compat; - xkbGetCompatMapReply * rep; -#endif { unsigned size,nGroups; @@ -2805,16 +2485,9 @@ unsigned size,nGroups; } static int -#if NeedFunctionPrototypes XkbSendCompatMap( ClientPtr client, XkbCompatMapPtr compat, xkbGetCompatMapReply * rep) -#else -XkbSendCompatMap(client,compat,rep) - ClientPtr client; - XkbCompatMapPtr compat; - xkbGetCompatMapReply * rep; -#endif { char * data; int size; @@ -2878,12 +2551,7 @@ int size; } int -#if NeedFunctionPrototypes ProcXkbGetCompatMap(ClientPtr client) -#else -ProcXkbGetCompatMap(client) - ClientPtr client; -#endif { xkbGetCompatMapReply rep; DeviceIntPtr dev; @@ -2923,12 +2591,7 @@ ProcXkbGetCompatMap(client) } int -#if NeedFunctionPrototypes ProcXkbSetCompatMap(ClientPtr client) -#else -ProcXkbSetCompatMap(client) - ClientPtr client; -#endif { DeviceIntPtr dev; XkbSrvInfoPtr xkbi; @@ -3066,12 +2729,7 @@ ProcXkbSetCompatMap(client) /***====================================================================***/ int -#if NeedFunctionPrototypes ProcXkbGetIndicatorState(ClientPtr client) -#else -ProcXkbGetIndicatorState(client) - ClientPtr client; -#endif { xkbGetIndicatorStateReply rep; XkbSrvLedInfoPtr sli; @@ -3108,15 +2766,9 @@ ProcXkbGetIndicatorState(client) /***====================================================================***/ Status -#if NeedFunctionPrototypes XkbComputeGetIndicatorMapReplySize( XkbIndicatorPtr indicators, xkbGetIndicatorMapReply *rep) -#else -XkbComputeGetIndicatorMapReplySize(indicators,rep) - XkbIndicatorPtr indicators; - xkbGetIndicatorMapReply *rep; -#endif { register int i,bit; int nIndicators; @@ -3131,16 +2783,9 @@ int nIndicators; } int -#if NeedFunctionPrototypes XkbSendIndicatorMap( ClientPtr client, XkbIndicatorPtr indicators, xkbGetIndicatorMapReply * rep) -#else -XkbSendIndicatorMap(client,indicators,rep) - ClientPtr client; - XkbIndicatorPtr indicators; - xkbGetIndicatorMapReply * rep; -#endif { int length; CARD8 * map; @@ -3195,12 +2840,7 @@ register unsigned bit; } int -#if NeedFunctionPrototypes ProcXkbGetIndicatorMap(ClientPtr client) -#else -ProcXkbGetIndicatorMap(client) - ClientPtr client; -#endif { xkbGetIndicatorMapReply rep; DeviceIntPtr dev; @@ -3228,12 +2868,7 @@ XkbIndicatorPtr leds; } int -#if NeedFunctionPrototypes ProcXkbSetIndicatorMap(ClientPtr client) -#else -ProcXkbSetIndicatorMap(client) - ClientPtr client; -#endif { register int i,bit; int nIndicators,why; @@ -3315,12 +2950,7 @@ ProcXkbSetIndicatorMap(client) /***====================================================================***/ int -#if NeedFunctionPrototypes ProcXkbGetNamedIndicator(ClientPtr client) -#else -ProcXkbGetNamedIndicator(client) - ClientPtr client; -#endif { DeviceIntPtr dev; xkbGetNamedIndicatorReply rep; @@ -3427,12 +3057,7 @@ ProcXkbGetNamedIndicator(client) } int -#if NeedFunctionPrototypes ProcXkbSetNamedIndicator(ClientPtr client) -#else -ProcXkbSetNamedIndicator(client) - ClientPtr client; -#endif { DeviceIntPtr dev,kbd; XkbIndicatorMapPtr map; @@ -3543,14 +3168,7 @@ ProcXkbSetNamedIndicator(client) /***====================================================================***/ static CARD32 -#if NeedFunctionPrototypes _XkbCountAtoms(Atom *atoms,int maxAtoms,int *count) -#else -_XkbCountAtoms(atoms,maxAtoms,count) - Atom *atoms; - int maxAtoms; - int *count; -#endif { register unsigned int i,bit,nAtoms; register CARD32 atomsPresent; @@ -3567,15 +3185,7 @@ register CARD32 atomsPresent; } static char * -#if NeedFunctionPrototypes _XkbWriteAtoms(char *wire,Atom *atoms,int maxAtoms,int swap) -#else -_XkbWriteAtoms(wire,atoms,maxAtoms,swap) - char *wire; - Atom *atoms; - int maxAtoms; - int swap; -#endif { register unsigned int i; Atom *atm; @@ -3595,13 +3205,7 @@ Atom *atm; } static Status -#if NeedFunctionPrototypes XkbComputeGetNamesReplySize(XkbDescPtr xkb,xkbGetNamesReply *rep) -#else -XkbComputeGetNamesReplySize(xkb,rep) - XkbDescPtr xkb; - xkbGetNamesReply * rep; -#endif { register unsigned which,length; register int i; @@ -3706,14 +3310,7 @@ register int i; } static int -#if NeedFunctionPrototypes XkbSendNames(ClientPtr client,XkbDescPtr xkb,xkbGetNamesReply *rep) -#else -XkbSendNames(client,xkb,rep) - ClientPtr client; - XkbDescPtr xkb; - xkbGetNamesReply * rep; -#endif { register unsigned i,length,which; char * start; @@ -3855,8 +3452,8 @@ char * desc; desc+= rep->nRadioGroups*4; } if ((desc-start)!=(length)) { - ErrorF("BOGUS LENGTH in write names, expected %d, got %d\n", - length, desc-start); + ErrorF("BOGUS LENGTH in write names, expected %d, got %ld\n", + length, (unsigned long)(desc-start)); } WriteToClient(client, SIZEOF(xkbGetNamesReply), (char *)rep); WriteToClient(client, length, start); @@ -3865,12 +3462,7 @@ char * desc; } int -#if NeedFunctionPrototypes ProcXkbGetNames(ClientPtr client) -#else -ProcXkbGetNames(client) - ClientPtr client; -#endif { DeviceIntPtr dev; XkbDescPtr xkb; @@ -3908,15 +3500,7 @@ ProcXkbGetNames(client) /***====================================================================***/ static CARD32 * -#if NeedFunctionPrototypes _XkbCheckAtoms(CARD32 *wire,int nAtoms,int swapped,Atom *pError) -#else -_XkbCheckAtoms(wire,nAtoms,swapped,pError) - CARD32 *wire; - int nAtoms; - int swapped; - Atom *pError; -#endif { register int i; @@ -3934,17 +3518,8 @@ register int i; } static CARD32 * -#if NeedFunctionPrototypes _XkbCheckMaskedAtoms(CARD32 *wire,int nAtoms,CARD32 present,int swapped, Atom *pError) -#else -_XkbCheckMaskedAtoms(wire,nAtoms,present,swapped,pError) - CARD32 *wire; - int nAtoms; - CARD32 present; - int swapped; - Atom *pError; -#endif { register unsigned i,bit; @@ -3965,18 +3540,10 @@ register unsigned i,bit; } static Atom * -#if NeedFunctionPrototypes _XkbCopyMaskedAtoms( Atom *wire, Atom *dest, int nAtoms, CARD32 present) -#else -_XkbCopyMaskedAtoms(wire,dest,nAtoms,present) - Atom *wire; - Atom *dest; - int nAtoms; - CARD32 present; -#endif { register int i,bit; @@ -3989,13 +3556,7 @@ register int i,bit; } static Bool -#if NeedFunctionPrototypes _XkbCheckTypeName(Atom name,int typeNdx) -#else -_XkbCheckTypeName(name,typeNdx) - Atom name; - int typeNdx; -#endif { char * str; @@ -4007,12 +3568,7 @@ char * str; } int -#if NeedFunctionPrototypes ProcXkbSetNames(ClientPtr client) -#else -ProcXkbSetNames(client) - ClientPtr client; -#endif { DeviceIntPtr dev; XkbDescRec *xkb; @@ -4357,14 +3913,7 @@ ProcXkbSetNames(client) #define XkbSizeCountedString(s) ((s)?((((2+strlen(s))+3)/4)*4):4) static char * -#if NeedFunctionPrototypes XkbWriteCountedString(char *wire,char *str,Bool swap) -#else -XkbWriteCountedString(wire,str,swap) - char * wire; - char * str; - Bool swap; -#endif { CARD16 len,*pLen; @@ -4381,12 +3930,7 @@ CARD16 len,*pLen; } static int -#if NeedFunctionPrototypes XkbSizeGeomProperties(XkbGeometryPtr geom) -#else -XkbSizeGeomProperties(geom) - XkbGeometryPtr geom; -#endif { register int i,size; XkbPropertyPtr prop; @@ -4399,14 +3943,7 @@ XkbPropertyPtr prop; } static char * -#if NeedFunctionPrototypes XkbWriteGeomProperties(char *wire,XkbGeometryPtr geom,Bool swap) -#else -XkbWriteGeomProperties(wire,geom,swap) - char * wire; - XkbGeometryPtr geom; - Bool swap; -#endif { register int i; register XkbPropertyPtr prop; @@ -4419,25 +3956,13 @@ register XkbPropertyPtr prop; } static int -#if NeedFunctionPrototypes XkbSizeGeomKeyAliases(XkbGeometryPtr geom) -#else -XkbSizeGeomKeyAliases(geom) - XkbGeometryPtr geom; -#endif { return geom->num_key_aliases*(2*XkbKeyNameLength); } static char * -#if NeedFunctionPrototypes XkbWriteGeomKeyAliases(char *wire,XkbGeometryPtr geom,Bool swap) -#else -XkbWriteGeomKeyAliases(wire,geom,swap) - char * wire; - XkbGeometryPtr geom; - Bool swap; -#endif { register int sz; @@ -4450,12 +3975,7 @@ register int sz; } static int -#if NeedFunctionPrototypes XkbSizeGeomColors(XkbGeometryPtr geom) -#else -XkbSizeGeomColors(geom) - XkbGeometryPtr geom; -#endif { register int i,size; register XkbColorPtr color; @@ -4467,14 +3987,7 @@ register XkbColorPtr color; } static char * -#if NeedFunctionPrototypes XkbWriteGeomColors(char *wire,XkbGeometryPtr geom,Bool swap) -#else -XkbWriteGeomColors(wire,geom,swap) - char * wire; - XkbGeometryPtr geom; - Bool swap; -#endif { register int i; register XkbColorPtr color; @@ -4486,12 +3999,7 @@ register XkbColorPtr color; } static int -#if NeedFunctionPrototypes XkbSizeGeomShapes(XkbGeometryPtr geom) -#else -XkbSizeGeomShapes(geom) - XkbGeometryPtr geom; -#endif { register int i,size; register XkbShapePtr shape; @@ -4509,14 +4017,7 @@ register XkbShapePtr shape; } static char * -#if NeedFunctionPrototypes XkbWriteGeomShapes(char *wire,XkbGeometryPtr geom,Bool swap) -#else -XkbWriteGeomShapes(wire,geom,swap) - char * wire; - XkbGeometryPtr geom; - Bool swap; -#endif { int i; XkbShapePtr shape; @@ -4565,13 +4066,7 @@ xkbShapeWireDesc * shapeWire; } static int -#if NeedFunctionPrototypes XkbSizeGeomDoodads(int num_doodads,XkbDoodadPtr doodad) -#else -XkbSizeGeomDoodads(num_doodads,doodad) - int num_doodads; - XkbDoodadPtr doodad; -#endif { register int i,size; @@ -4589,15 +4084,7 @@ register int i,size; } static char * -#if NeedFunctionPrototypes XkbWriteGeomDoodads(char *wire,int num_doodads,XkbDoodadPtr doodad,Bool swap) -#else -XkbWriteGeomDoodads(wire,num_doodads,doodad,swap) - char * wire; - int num_doodads; - XkbDoodadPtr doodad; - Bool swap; -#endif { register int i; xkbDoodadWireDesc * doodadWire; @@ -4655,7 +4142,8 @@ xkbDoodadWireDesc * doodadWire; wire= XkbWriteCountedString(wire,doodad->logo.logo_name,swap); break; default: - ErrorF("Unknown doodad type %d in XkbWriteGeomDoodads\n"); + ErrorF("Unknown doodad type %d in XkbWriteGeomDoodads\n", + doodad->any.type); ErrorF("Ignored\n"); break; } @@ -4664,14 +4152,7 @@ xkbDoodadWireDesc * doodadWire; } static char * -#if NeedFunctionPrototypes XkbWriteGeomOverlay(char *wire,XkbOverlayPtr ol,Bool swap) -#else -XkbWriteGeomOverlay(wire,ol,swap) - char * wire; - XkbOverlayPtr ol; - Bool swap; -#endif { register int r; XkbOverlayRowPtr row; @@ -4705,12 +4186,7 @@ xkbOverlayWireDesc * olWire; } static int -#if NeedFunctionPrototypes XkbSizeGeomSections(XkbGeometryPtr geom) -#else -XkbSizeGeomSections(geom) - XkbGeometryPtr geom; -#endif { register int i,size; XkbSectionPtr section; @@ -4745,14 +4221,7 @@ XkbSectionPtr section; } static char * -#if NeedFunctionPrototypes XkbWriteGeomSections(char *wire,XkbGeometryPtr geom,Bool swap) -#else -XkbWriteGeomSections(wire,geom,swap) - char * wire; - XkbGeometryPtr geom; - Bool swap; -#endif { register int i; XkbSectionPtr section; @@ -4833,16 +4302,9 @@ xkbSectionWireDesc * sectionWire; } static Status -#if NeedFunctionPrototypes XkbComputeGetGeometryReplySize( XkbGeometryPtr geom, xkbGetGeometryReply * rep, Atom name) -#else -XkbComputeGetGeometryReplySize(geom,rep,name) - XkbGeometryPtr geom; - xkbGetGeometryReply * rep; - Atom name; -#endif { int len; @@ -4882,18 +4344,10 @@ int len; } static int -#if NeedFunctionPrototypes XkbSendGeometry( ClientPtr client, XkbGeometryPtr geom, xkbGetGeometryReply * rep, Bool freeGeom) -#else -XkbSendGeometry(client,geom,rep,freeGeom) - ClientPtr client; - XkbGeometryPtr geom; - xkbGetGeometryReply *rep; - Bool freeGeom; -#endif { char *desc,*start; int len; @@ -4918,8 +4372,8 @@ XkbSendGeometry(client,geom,rep,freeGeom) if ( rep->nKeyAliases>0 ) desc = XkbWriteGeomKeyAliases(desc,geom,client->swapped); if ((desc-start)!=(len)) { - ErrorF("BOGUS LENGTH in XkbSendGeometry, expected %d, got %d\n", - len, desc-start); + ErrorF("BOGUS LENGTH in XkbSendGeometry, expected %d, got %ld\n", + len, (unsigned long)(desc-start)); } } else { @@ -4951,12 +4405,7 @@ XkbSendGeometry(client,geom,rep,freeGeom) } int -#if NeedFunctionPrototypes ProcXkbGetGeometry(ClientPtr client) -#else -ProcXkbGetGeometry(client) - ClientPtr client; -#endif { DeviceIntPtr dev; xkbGetGeometryReply rep; @@ -4987,13 +4436,7 @@ ProcXkbGetGeometry(client) /***====================================================================***/ static char * -#if NeedFunctionPrototypes _GetCountedString(char **wire_inout,Bool swap) -#else -_GetCountedString(wire_inout,swap) - char ** wire_inout; - Bool swap; -#endif { char * wire,*str; CARD16 len,*plen; @@ -5016,18 +4459,10 @@ CARD16 len,*plen; } static Status -#if NeedFunctionPrototypes _CheckSetDoodad( char ** wire_inout, XkbGeometryPtr geom, XkbSectionPtr section, ClientPtr client) -#else -_CheckSetDoodad(wire_inout,geom,section,client) - char ** wire_inout; - XkbGeometryPtr geom; - XkbSectionPtr section; - ClientPtr client; -#endif { char * wire; xkbDoodadWireDesc * dWire; @@ -5128,18 +4563,10 @@ XkbDoodadPtr doodad; } static Status -#if NeedFunctionPrototypes _CheckSetOverlay( char ** wire_inout, XkbGeometryPtr geom, XkbSectionPtr section, ClientPtr client) -#else -_CheckSetOverlay(wire_inout,geom,section,client) - char ** wire_inout; - XkbGeometryPtr geom; - XkbSectionPtr section; - ClientPtr client; -#endif { register int r; char * wire; @@ -5184,18 +4611,10 @@ xkbOverlayRowWireDesc * rWire; } static Status -#if NeedFunctionPrototypes _CheckSetSections( XkbGeometryPtr geom, xkbSetGeometryReq * req, char ** wire_inout, ClientPtr client) -#else -_CheckSetSections(geom,req,wire_inout,client) - XkbGeometryPtr geom; - xkbSetGeometryReq * req; - char ** wire_inout; - ClientPtr client; -#endif { Status status; register int s; @@ -5294,18 +4713,10 @@ XkbSectionPtr section; } static Status -#if NeedFunctionPrototypes _CheckSetShapes( XkbGeometryPtr geom, xkbSetGeometryReq * req, char ** wire_inout, ClientPtr client) -#else -_CheckSetShapes(geom,req,wire_inout,client) - XkbGeometryPtr geom; - xkbSetGeometryReq * req; - char ** wire_inout; - ClientPtr client; -#endif { register int i; char * wire; @@ -5367,16 +4778,9 @@ char * wire; } static Status -#if NeedFunctionPrototypes _CheckSetGeom( XkbGeometryPtr geom, xkbSetGeometryReq * req, ClientPtr client) -#else -_CheckSetGeom(geom,req,client) - XkbGeometryPtr geom; - xkbSetGeometryReq * req; - ClientPtr client; -#endif { register int i; Status status; @@ -5445,12 +4849,7 @@ char * wire; } int -#if NeedFunctionPrototypes ProcXkbSetGeometry(ClientPtr client) -#else -ProcXkbSetGeometry(client) - ClientPtr client; -#endif { DeviceIntPtr dev; XkbGeometryPtr geom,old; @@ -5516,12 +4915,7 @@ ProcXkbSetGeometry(client) /***====================================================================***/ int -#if NeedFunctionPrototypes ProcXkbPerClientFlags(ClientPtr client) -#else -ProcXkbPerClientFlags(client) - ClientPtr client; -#endif { DeviceIntPtr dev; xkbPerClientFlagsReply rep; @@ -5613,14 +5007,7 @@ static unsigned char componentExprLegal[] = { }; static char * -#if NeedFunctionPrototypes GetComponentSpec(unsigned char **pWire,Bool allowExpr,int *errRtrn) -#else -GetComponentSpec(pWire,allowExpr,errRtrn) - unsigned char ** pWire; - Bool allowExpr; - int * errRtrn; -#endif { int len; register int i; @@ -5661,12 +5048,7 @@ unsigned char *wire,*str,*tmp,*legal; /***====================================================================***/ int -#if NeedFunctionPrototypes ProcXkbListComponents(ClientPtr client) -#else -ProcXkbListComponents(client) - ClientPtr client; -#endif { DeviceIntPtr dev; xkbListComponentsReply rep; @@ -5743,12 +5125,7 @@ ProcXkbListComponents(client) /***====================================================================***/ int -#if NeedFunctionPrototypes ProcXkbGetKbdByName(ClientPtr client) -#else -ProcXkbGetKbdByName(client) - ClientPtr client; -#endif { DeviceIntPtr dev; XkbFileInfo finfo; @@ -6077,16 +5454,9 @@ ProcXkbGetKbdByName(client) /***====================================================================***/ static int -#if NeedFunctionPrototypes ComputeDeviceLedInfoSize( DeviceIntPtr dev, unsigned int what, XkbSrvLedInfoPtr sli) -#else -ComputeDeviceLedInfoSize(dev,what,sli) - DeviceIntPtr dev; - unsigned int what; - XkbSrvLedInfoPtr sli; -#endif { int nNames,nMaps; register unsigned n,bit; @@ -6113,20 +5483,11 @@ register unsigned n,bit; } static int -#if NeedFunctionPrototypes CheckDeviceLedFBs( DeviceIntPtr dev, int class, int id, xkbGetDeviceInfoReply * rep, ClientPtr client) -#else -CheckDeviceLedFBs(dev,class,id,rep,client) - DeviceIntPtr dev; - int class; - int id; - xkbGetDeviceInfoReply * rep; - ClientPtr client; -#endif { int nFBs= 0; int length= 0; @@ -6184,14 +5545,8 @@ Bool classOk; } static int -#if NeedFunctionPrototypes SendDeviceLedInfo( XkbSrvLedInfoPtr sli, ClientPtr client) -#else -SendDeviceLedInfo(sli,client) - XkbSrvLedInfoPtr sli; - ClientPtr client; -#endif { xkbDeviceLedsWireDesc wire; int length; @@ -6258,20 +5613,11 @@ int length; } static int -#if NeedFunctionPrototypes SendDeviceLedFBs( DeviceIntPtr dev, int class, int id, unsigned wantLength, ClientPtr client) -#else -SendDeviceLedFBs(dev,class,id,wantLength,client) - DeviceIntPtr dev; - int class; - int id; - unsigned wantLength; - ClientPtr client; -#endif { int length= 0; @@ -6307,12 +5653,7 @@ int length= 0; } int -#if NeedFunctionPrototypes ProcXkbGetDeviceInfo(ClientPtr client) -#else -ProcXkbGetDeviceInfo(client) - ClientPtr client; -#endif { DeviceIntPtr dev; xkbGetDeviceInfoReply rep; @@ -6470,20 +5811,11 @@ char * str; } static char * -#if NeedFunctionPrototypes CheckSetDeviceIndicators( char * wire, DeviceIntPtr dev, int num, int * status_rtrn, ClientPtr client) -#else -CheckSetDeviceIndicators(wire,dev,num,status_rtrn,client) - char * wire; - DeviceIntPtr dev; - int num; - int * status_rtrn; - ClientPtr client; -#endif { xkbDeviceLedsWireDesc * ledWire; int i; @@ -6557,7 +5889,6 @@ XkbSrvLedInfoPtr sli; } static char * -#if NeedFunctionPrototypes SetDeviceIndicators( char * wire, DeviceIntPtr dev, unsigned changed, @@ -6565,16 +5896,6 @@ SetDeviceIndicators( char * wire, int * status_rtrn, ClientPtr client, xkbExtensionDeviceNotify *ev) -#else -SetDeviceIndicators(wire,dev,changed,num,status_rtrn,client,ev) - char * wire; - DeviceIntPtr dev; - unsigned changed; - int num; - ClientPtr client; - int * status_rtrn; - xkbExtensionDeviceNotify *ev; -#endif { xkbDeviceLedsWireDesc * ledWire; int i; @@ -6664,12 +5985,7 @@ DeviceIntPtr kbd; } int -#if NeedFunctionPrototypes ProcXkbSetDeviceInfo(ClientPtr client) -#else -ProcXkbSetDeviceInfo(client) - ClientPtr client; -#endif { DeviceIntPtr dev; unsigned change; @@ -6756,12 +6072,7 @@ xkbExtensionDeviceNotify ed; /***====================================================================***/ int -#if NeedFunctionPrototypes ProcXkbSetDebuggingFlags(ClientPtr client) -#else -ProcXkbSetDebuggingFlags(client) - ClientPtr client; -#endif { CARD32 newFlags,newCtrls,extraLength; xkbSetDebuggingFlagsReply rep; @@ -6774,16 +6085,16 @@ xkbSetDebuggingFlagsReply rep; newCtrls= xkbDebugCtrls&(~stuff->affectCtrls); newCtrls|= (stuff->ctrls&stuff->affectCtrls); if (xkbDebugFlags || newFlags || stuff->msgLength) { - ErrorF("XkbDebug: Setting debug flags to 0x%x\n",newFlags); + ErrorF("XkbDebug: Setting debug flags to 0x%lx\n",(long)newFlags); if (newCtrls!=xkbDebugCtrls) - ErrorF("XkbDebug: Setting debug controls to 0x%x\n",newCtrls); + ErrorF("XkbDebug: Setting debug controls to 0x%lx\n",(long)newCtrls); } extraLength= (stuff->length<<2)-sz_xkbSetDebuggingFlagsReq; if (stuff->msgLength>0) { char *msg; if (extraLength<XkbPaddedSize(stuff->msgLength)) { - ErrorF("XkbDebug: msgLength= %d, length= %d (should be %d)\n", - stuff->msgLength,extraLength, + ErrorF("XkbDebug: msgLength= %d, length= %ld (should be %d)\n", + stuff->msgLength,(long)extraLength, XkbPaddedSize(stuff->msgLength)); return BadLength; } @@ -6821,12 +6132,7 @@ xkbSetDebuggingFlagsReply rep; /***====================================================================***/ static int -#if NeedFunctionPrototypes ProcXkbDispatch (ClientPtr client) -#else -ProcXkbDispatch (client) - ClientPtr client; -#endif { REQUEST(xReq); switch (stuff->data) @@ -6889,13 +6195,7 @@ ProcXkbDispatch (client) } static int -#if NeedFunctionPrototypes XkbClientGone(pointer data,XID id) -#else -XkbClientGone(data,id) - pointer data; - XID id; -#endif { DevicePtr pXDev = (DevicePtr)data; @@ -6907,21 +6207,12 @@ XkbClientGone(data,id) /*ARGSUSED*/ static void -#if NeedFunctionPrototypes XkbResetProc(ExtensionEntry *extEntry) -#else -XkbResetProc(extEntry) - ExtensionEntry *extEntry; -#endif { } void -#if NeedFunctionPrototypes -XkbExtensionInit(void) -#else -XkbExtensionInit() -#endif +XkbExtensionInit(INITARGS) { ExtensionEntry *extEntry; diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c index b83f8b626..096ebe2e4 100644 --- a/xkb/xkbAccessX.c +++ b/xkb/xkbAccessX.c @@ -24,7 +24,7 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/xkbAccessX.c,v 1.9 2001/08/23 14:33:25 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/xkb/xkbAccessX.c,v 1.10 2003/11/17 22:20:46 dawes Exp $ */ #include <stdio.h> #include <math.h> @@ -57,13 +57,7 @@ unsigned int XkbDfltAccessXFeedback= XkbAccessXFeedbackMask; unsigned short XkbDfltAccessXOptions= XkbAX_AllOptionsMask & ~(XkbAX_IndicatorFBMask|XkbAX_SKReleaseFBMask|XkbAX_SKRejectFBMask); void -#if NeedFunctionPrototypes AccessXComputeCurveFactor(XkbSrvInfoPtr xkbi,XkbControlsPtr ctrls) -#else -AccessXComputeCurveFactor(xkbi,ctrls) - XkbSrvInfoPtr xkbi; - XkbControlsPtr ctrls; -#endif { xkbi->mouseKeysCurve= 1.0+(((double)ctrls->mk_curve)*0.001); xkbi->mouseKeysCurveFactor= ( ((double)ctrls->mk_max_speed)/ @@ -72,12 +66,7 @@ AccessXComputeCurveFactor(xkbi,ctrls) } void -#if NeedFunctionPrototypes AccessXInit(DeviceIntPtr keybd) -#else -AccessXInit(keybd) - DeviceIntPtr keybd; -#endif { XkbSrvInfoPtr xkbi = keybd->key->xkbInfo; XkbControlsPtr ctrls = xkbi->desc->ctrls; @@ -129,18 +118,10 @@ XkbControlsPtr ctrls = xkbi->desc->ctrls; /* */ /************************************************************************/ static void -#if NeedFunctionPrototypes AccessXKeyboardEvent(DeviceIntPtr keybd, BYTE type, BYTE keyCode, Bool isRepeat) -#else -AccessXKeyboardEvent(keybd,type,keyCode,isRepeat) - DeviceIntPtr keybd; - BYTE type; - BYTE keyCode; - Bool isRepeat; -#endif { xEvent xE; @@ -171,14 +152,7 @@ xEvent xE; /* */ /************************************************************************/ static void -#if NeedFunctionPrototypes AccessXKRGTurnOn(DeviceIntPtr dev,CARD16 KRGControl,xkbControlsNotify *pCN) -#else -AccessXKRGTurnOn(dev,KRGControl,pCN) - DeviceIntPtr dev; - CARD16 KRGControl; - xkbControlsNotify *pCN; -#endif { XkbSrvInfoPtr xkbi = dev->key->xkbInfo; XkbControlsPtr ctrls = xkbi->desc->ctrls; @@ -210,13 +184,7 @@ XkbSrvLedInfoPtr sli; /* */ /************************************************************************/ static void -#if NeedFunctionPrototypes AccessXKRGTurnOff(DeviceIntPtr dev,xkbControlsNotify *pCN) -#else -AccessXKRGTurnOff(dev,pCN) - DeviceIntPtr dev; - xkbControlsNotify *pCN; -#endif { XkbSrvInfoPtr xkbi = dev->key->xkbInfo; XkbControlsPtr ctrls = xkbi->desc->ctrls; @@ -250,13 +218,7 @@ XkbSrvLedInfoPtr sli; /* */ /************************************************************************/ static void -#if NeedFunctionPrototypes AccessXStickyKeysTurnOn(DeviceIntPtr dev,xkbControlsNotify *pCN) -#else -AccessXStickyKeysTurnOn(dev,pCN) - DeviceIntPtr dev; - xkbControlsNotify *pCN; -#endif { XkbSrvInfoPtr xkbi = dev->key->xkbInfo; XkbControlsPtr ctrls = xkbi->desc->ctrls; @@ -290,13 +252,7 @@ XkbSrvLedInfoPtr sli; /* */ /************************************************************************/ static void -#if NeedFunctionPrototypes AccessXStickyKeysTurnOff(DeviceIntPtr dev,xkbControlsNotify *pCN) -#else -AccessXStickyKeysTurnOff(dev,pCN) - DeviceIntPtr dev; - xkbControlsNotify *pCN; -#endif { XkbSrvInfoPtr xkbi = dev->key->xkbInfo; XkbControlsPtr ctrls = xkbi->desc->ctrls; @@ -326,14 +282,7 @@ XkbSrvLedInfoPtr sli; } /* AccessXStickyKeysTurnOff */ static CARD32 -#if NeedFunctionPrototypes AccessXKRGExpire(OsTimerPtr timer,CARD32 now,pointer arg) -#else -AccessXKRGExpire(timer,now,arg) - OsTimerPtr timer; - CARD32 now; - pointer arg; -#endif { XkbSrvInfoPtr xkbi= ((DeviceIntPtr)arg)->key->xkbInfo; xkbControlsNotify cn; @@ -355,14 +304,7 @@ xkbControlsNotify cn; } static CARD32 -#if NeedFunctionPrototypes AccessXRepeatKeyExpire(OsTimerPtr timer,CARD32 now,pointer arg) -#else -AccessXRepeatKeyExpire(timer,now,arg) - OsTimerPtr timer; - CARD32 now; - pointer arg; -#endif { XkbSrvInfoPtr xkbi= ((DeviceIntPtr)arg)->key->xkbInfo; KeyCode key; @@ -376,13 +318,7 @@ KeyCode key; } void -#if NeedFunctionPrototypes AccessXCancelRepeatKey(XkbSrvInfoPtr xkbi,KeyCode key) -#else -AccessXCancelRepeatKey(xkbi,key) - XkbSrvInfoPtr xkbi; - KeyCode key; -#endif { if (xkbi->repeatKey==key) xkbi->repeatKey= 0; @@ -390,14 +326,7 @@ AccessXCancelRepeatKey(xkbi,key) } static CARD32 -#if NeedFunctionPrototypes AccessXSlowKeyExpire(OsTimerPtr timer,CARD32 now,pointer arg) -#else -AccessXSlowKeyExpire(timer,now,arg) - OsTimerPtr timer; - CARD32 now; - pointer arg; -#endif { DeviceIntPtr keybd; XkbSrvInfoPtr xkbi; @@ -445,14 +374,7 @@ XkbControlsPtr ctrls; } static CARD32 -#if NeedFunctionPrototypes AccessXBounceKeyExpire(OsTimerPtr timer,CARD32 now,pointer arg) -#else -AccessXBounceKeyExpire(timer,now,arg) - OsTimerPtr timer; - CARD32 now; - pointer arg; -#endif { XkbSrvInfoPtr xkbi= ((DeviceIntPtr)arg)->key->xkbInfo; @@ -461,14 +383,7 @@ XkbSrvInfoPtr xkbi= ((DeviceIntPtr)arg)->key->xkbInfo; } static CARD32 -#if NeedFunctionPrototypes AccessXTimeoutExpire(OsTimerPtr timer,CARD32 now,pointer arg) -#else -AccessXTimeoutExpire(timer,now,arg) - OsTimerPtr timer; - CARD32 now; - pointer arg; -#endif { DeviceIntPtr dev = (DeviceIntPtr)arg; XkbSrvInfoPtr xkbi= dev->key->xkbInfo; @@ -531,16 +446,9 @@ XkbSrvLedInfoPtr sli; /* */ /************************************************************************/ Bool -#if NeedFunctionPrototypes AccessXFilterPressEvent( register xEvent * xE, register DeviceIntPtr keybd, int count) -#else -AccessXFilterPressEvent(xE,keybd,count) - register xEvent *xE; - register DeviceIntPtr keybd; - int count; -#endif { XkbSrvInfoPtr xkbi = keybd->key->xkbInfo; XkbControlsPtr ctrls = xkbi->desc->ctrls; @@ -673,16 +581,9 @@ KeySym * sym = XkbKeySymsPtr(xkbi->desc,key); /* */ /************************************************************************/ Bool -#if NeedFunctionPrototypes AccessXFilterReleaseEvent( register xEvent * xE, register DeviceIntPtr keybd, int count) -#else -AccessXFilterReleaseEvent(xE,keybd,count) - register xEvent *xE; - register DeviceIntPtr keybd; - int count; -#endif { XkbSrvInfoPtr xkbi = keybd->key->xkbInfo; XkbControlsPtr ctrls = xkbi->desc->ctrls; @@ -788,16 +689,9 @@ Bool ignoreKeyEvent = FALSE; /* */ /************************************************************************/ void -#if NeedFunctionPrototypes ProcessPointerEvent( register xEvent * xE, register DeviceIntPtr mouse, int count) -#else -ProcessPointerEvent(xE,mouse,count) - register xEvent *xE; - register DeviceIntPtr mouse; - int count; -#endif { DeviceIntPtr dev = (DeviceIntPtr)LookupKeyboardDevice(); XkbSrvInfoPtr xkbi = dev->key->xkbInfo; diff --git a/xkb/xkbActions.c b/xkb/xkbActions.c index 7f3c47ebc..403c2fb89 100644 --- a/xkb/xkbActions.c +++ b/xkb/xkbActions.c @@ -24,7 +24,7 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/xkbActions.c,v 3.11 2003/02/13 15:36:48 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/xkb/xkbActions.c,v 3.14 2003/11/17 22:20:46 dawes Exp $ */ #include <stdio.h> #include <math.h> @@ -35,28 +35,21 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "misc.h" #include "inputstr.h" #include "XKBsrv.h" +#include "xkb.h" #include <ctype.h> #ifdef XINPUT extern void ProcessOtherEvent( -#if NeedFunctionPrototypes xEvent * /* xE */, DeviceIntPtr /* dev */, int /* count */ -#endif ); #endif /***====================================================================***/ static XkbAction -#if NeedFunctionPrototypes _FixUpAction(XkbDescPtr xkb,XkbAction *act) -#else -_FixUpAction(xkb,act) - XkbDescPtr xkb; - XkbAction * act; -#endif { static XkbAction fake; @@ -121,14 +114,7 @@ static XkbAction fake; } static XkbAction -#if NeedFunctionPrototypes XkbGetKeyAction(XkbSrvInfoPtr xkbi,XkbStatePtr xkbState,CARD8 key) -#else -XkbGetKeyAction(xkbi,xkbState,key) - XkbSrvInfoPtr xkbi; - XkbStatePtr xkbState; - CARD8 key; -#endif { int effectiveGroup; int col; @@ -187,14 +173,7 @@ static XkbAction fake; } XkbAction -#if NeedFunctionPrototypes XkbGetButtonAction(DeviceIntPtr kbd,DeviceIntPtr dev,int button) -#else -XkbGetButtonAction(kbd,dev,button) - DeviceIntPtr kbd; - DeviceIntPtr dev; - int button; -#endif { XkbAction fake; if ((dev->button)&&(dev->button->xkb_acts)) { @@ -221,29 +200,19 @@ typedef struct _XkbFilter { CARD32 priv; XkbAction upAction; int (*filter)( -#if NeedFunctionPrototypes XkbSrvInfoPtr /* xkbi */, struct _XkbFilter * /* filter */, unsigned /* keycode */, XkbAction * /* action */ -#endif ); struct _XkbFilter *next; } XkbFilterRec,*XkbFilterPtr; static int -#if NeedFunctionPrototypes _XkbFilterSetState( XkbSrvInfoPtr xkbi, XkbFilterPtr filter, unsigned keycode, XkbAction *pAction) -#else -_XkbFilterSetState(xkbi,filter,keycode,pAction) - XkbSrvInfoPtr xkbi; - XkbFilterPtr filter; - unsigned keycode; - XkbAction * pAction; -#endif { if (filter->keycode==0) { /* initial press */ filter->keycode = keycode; @@ -290,18 +259,10 @@ _XkbFilterSetState(xkbi,filter,keycode,pAction) #define NO_LATCH 3 static int -#if NeedFunctionPrototypes _XkbFilterLatchState( XkbSrvInfoPtr xkbi, XkbFilterPtr filter, unsigned keycode, XkbAction * pAction) -#else -_XkbFilterLatchState(xkbi,filter,keycode,pAction) - XkbSrvInfoPtr xkbi; - XkbFilterPtr filter; - unsigned keycode; - XkbAction * pAction; -#endif { if (filter->keycode==0) { /* initial press */ @@ -406,18 +367,10 @@ _XkbFilterLatchState(xkbi,filter,keycode,pAction) } static int -#if NeedFunctionPrototypes _XkbFilterLockState( XkbSrvInfoPtr xkbi, XkbFilterPtr filter, unsigned keycode, XkbAction * pAction) -#else -_XkbFilterLockState(xkbi,filter,keycode,pAction) - XkbSrvInfoPtr xkbi; - XkbFilterPtr filter; - unsigned keycode; - XkbAction * pAction; -#endif { if (pAction&&(pAction->type==XkbSA_LockGroup)) { @@ -447,18 +400,10 @@ _XkbFilterLockState(xkbi,filter,keycode,pAction) #define NO_ISO_LOCK 1 static int -#if NeedFunctionPrototypes _XkbFilterISOLock( XkbSrvInfoPtr xkbi, XkbFilterPtr filter, unsigned keycode, XkbAction * pAction) -#else -_XkbFilterISOLock(xkbi,filter,keycode,pAction) - XkbSrvInfoPtr xkbi; - XkbFilterPtr filter; - unsigned keycode; - XkbAction * pAction; -#endif { if (filter->keycode==0) { /* initial press */ @@ -541,14 +486,7 @@ _XkbFilterISOLock(xkbi,filter,keycode,pAction) static CARD32 -#if NeedFunctionPrototypes _XkbPtrAccelExpire(OsTimerPtr timer,CARD32 now,pointer arg) -#else -_XkbPtrAccelExpire(timer,now,arg) - OsTimerPtr timer; - CARD32 now; - pointer arg; -#endif { XkbSrvInfoPtr xkbi= (XkbSrvInfoPtr)arg; XkbControlsPtr ctrls= xkbi->desc->ctrls; @@ -588,18 +526,10 @@ int dx,dy; } static int -#if NeedFunctionPrototypes _XkbFilterPointerMove( XkbSrvInfoPtr xkbi, XkbFilterPtr filter, unsigned keycode, XkbAction * pAction) -#else -_XkbFilterPointerMove(xkbi,filter,keycode,pAction) - XkbSrvInfoPtr xkbi; - XkbFilterPtr filter; - unsigned keycode; - XkbAction * pAction; -#endif { int x,y; Bool accel; @@ -639,18 +569,10 @@ Bool accel; } static int -#if NeedFunctionPrototypes _XkbFilterPointerBtn( XkbSrvInfoPtr xkbi, XkbFilterPtr filter, unsigned keycode, XkbAction * pAction) -#else -_XkbFilterPointerBtn(xkbi,filter,keycode,pAction) - XkbSrvInfoPtr xkbi; - XkbFilterPtr filter; - unsigned keycode; - XkbAction * pAction; -#endif { if (filter->keycode==0) { /* initial press */ int button= pAction->btn.button; @@ -751,18 +673,10 @@ _XkbFilterPointerBtn(xkbi,filter,keycode,pAction) } static int -#if NeedFunctionPrototypes _XkbFilterControls( XkbSrvInfoPtr xkbi, XkbFilterPtr filter, unsigned keycode, XkbAction * pAction) -#else -_XkbFilterControls(xkbi,filter,keycode,pAction) - XkbSrvInfoPtr xkbi; - XkbFilterPtr filter; - unsigned keycode; - XkbAction * pAction; -#endif { XkbControlsRec old; XkbControlsPtr ctrls; @@ -846,18 +760,10 @@ XkbEventCauseRec cause; } static int -#if NeedFunctionPrototypes _XkbFilterActionMessage(XkbSrvInfoPtr xkbi, XkbFilterPtr filter, unsigned keycode, XkbAction * pAction) -#else -_XkbFilterActionMessage(xkbi,filter,keycode,pAction) - XkbSrvInfoPtr xkbi; - XkbFilterPtr filter; - unsigned keycode; - XkbAction * pAction; -#endif { XkbMessageAction * pMsg; DeviceIntPtr kbd; @@ -906,18 +812,10 @@ DeviceIntPtr kbd; } static int -#if NeedFunctionPrototypes _XkbFilterRedirectKey( XkbSrvInfoPtr xkbi, XkbFilterPtr filter, unsigned keycode, XkbAction * pAction) -#else -_XkbFilterRedirectKey(xkbi,filter,keycode,pAction) - XkbSrvInfoPtr xkbi; - XkbFilterPtr filter; - unsigned keycode; - XkbAction * pAction; -#endif { unsigned realMods; xEvent ev; @@ -933,13 +831,6 @@ unsigned mods,mask,oldCoreState = 0,oldCorePrevState = 0; ev.u.keyButtonPointer.rootX = x; ev.u.keyButtonPointer.rootY = y; - mask= XkbSARedirectVModsMask(&pAction->redirect); - mods= XkbSARedirectVMods(&pAction->redirect); - if (mask) XkbVirtualModsToReal(xkbi->desc,mask,&mask); - if (mods) XkbVirtualModsToReal(xkbi->desc,mods,&mods); - mask|= pAction->redirect.mods_mask; - mods|= pAction->redirect.mods; - if (filter->keycode==0) { /* initial press */ if ((pAction->redirect.new_key<xkbi->desc->min_key_code)|| (pAction->redirect.new_key>xkbi->desc->max_key_code)) { @@ -955,6 +846,13 @@ unsigned mods,mask,oldCoreState = 0,oldCorePrevState = 0; ev.u.u.type = KeyPress; ev.u.u.detail = pAction->redirect.new_key; + mask= XkbSARedirectVModsMask(&pAction->redirect); + mods= XkbSARedirectVMods(&pAction->redirect); + if (mask) XkbVirtualModsToReal(xkbi->desc,mask,&mask); + if (mods) XkbVirtualModsToReal(xkbi->desc,mods,&mods); + mask|= pAction->redirect.mods_mask; + mods|= pAction->redirect.mods; + if ( mask || mods ) { old= xkbi->state; oldCoreState= xkbi->device->key->state; @@ -986,6 +884,13 @@ unsigned mods,mask,oldCoreState = 0,oldCorePrevState = 0; ev.u.u.type = KeyRelease; ev.u.u.detail = filter->upAction.redirect.new_key; + mask= XkbSARedirectVModsMask(&filter->upAction.redirect); + mods= XkbSARedirectVMods(&filter->upAction.redirect); + if (mask) XkbVirtualModsToReal(xkbi->desc,mask,&mask); + if (mods) XkbVirtualModsToReal(xkbi->desc,mods,&mods); + mask|= filter->upAction.redirect.mods_mask; + mods|= filter->upAction.redirect.mods; + if ( mask || mods ) { old= xkbi->state; oldCoreState= xkbi->device->key->state; @@ -1015,22 +920,14 @@ unsigned mods,mask,oldCoreState = 0,oldCorePrevState = 0; filter->keycode= 0; filter->active= 0; } - return 1; + return 0; } static int -#if NeedFunctionPrototypes _XkbFilterSwitchScreen( XkbSrvInfoPtr xkbi, XkbFilterPtr filter, unsigned keycode, XkbAction * pAction) -#else -_XkbFilterSwitchScreen(xkbi,filter,keycode,pAction) - XkbSrvInfoPtr xkbi; - XkbFilterPtr filter; - unsigned keycode; - XkbAction * pAction; -#endif { if (filter->keycode==0) { /* initial press */ DeviceIntPtr dev = xkbi->device; @@ -1051,18 +948,10 @@ _XkbFilterSwitchScreen(xkbi,filter,keycode,pAction) #ifdef XFree86Server static int -#if NeedFunctionPrototypes _XkbFilterXF86Private( XkbSrvInfoPtr xkbi, XkbFilterPtr filter, unsigned keycode, XkbAction * pAction) -#else -_XkbFilterXF86Private(xkbi,filter,keycode,pAction) - XkbSrvInfoPtr xkbi; - XkbFilterPtr filter; - unsigned keycode; - XkbAction * pAction; -#endif { if (filter->keycode==0) { /* initial press */ DeviceIntPtr dev = xkbi->device; @@ -1084,18 +973,10 @@ _XkbFilterXF86Private(xkbi,filter,keycode,pAction) #ifdef XINPUT static int -#if NeedFunctionPrototypes _XkbFilterDeviceBtn( XkbSrvInfoPtr xkbi, XkbFilterPtr filter, unsigned keycode, XkbAction * pAction) -#else -_XkbFilterDeviceBtn(xkbi,filter,keycode,pAction) - XkbSrvInfoPtr xkbi; - XkbFilterPtr filter; - unsigned keycode; - XkbAction * pAction; -#endif { DeviceIntPtr dev; int button; @@ -1168,9 +1049,7 @@ static XkbFilterPtr filters = NULL; static XkbFilterPtr _XkbNextFreeFilter( -#if NeedFunctionPrototypes void -#endif ) { register int i; @@ -1194,14 +1073,7 @@ register int i; } static int -#if NeedFunctionPrototypes _XkbApplyFilters(XkbSrvInfoPtr xkbi,unsigned kc,XkbAction *pAction) -#else -_XkbApplyFilters(xkbi,kc,pAction) - XkbSrvInfoPtr xkbi; - unsigned kc; - XkbAction * pAction; -#endif { register int i,send; @@ -1214,15 +1086,7 @@ register int i,send; } void -#if NeedFunctionPrototypes XkbHandleActions(DeviceIntPtr dev,DeviceIntPtr kbd,xEvent *xE,int count) -#else -XkbHandleActions(dev,kbd,xE,count) - DeviceIntPtr dev; - DeviceIntPtr kbd; - xEvent * xE; - int count; -#endif { int key,bit,i; CARD8 realMods; @@ -1414,14 +1278,7 @@ Bool xiEvent; } int -#if NeedFunctionPrototypes XkbLatchModifiers(DeviceIntPtr pXDev,CARD8 mask,CARD8 latches) -#else -XkbLatchModifiers(pXDev,mask,latches) - DeviceIntPtr pXDev; - CARD8 mask; - CARD8 latches; -#endif { XkbSrvInfoPtr xkbi; XkbFilterPtr filter; @@ -1448,13 +1305,7 @@ unsigned clear; } int -#if NeedFunctionPrototypes XkbLatchGroup(DeviceIntPtr pXDev,int group) -#else -XkbLatchGroup(pXDev,group) - DeviceIntPtr pXDev; - int group; -#endif { XkbSrvInfoPtr xkbi; XkbFilterPtr filter; @@ -1476,18 +1327,10 @@ XkbAction act; /***====================================================================***/ void -#if NeedFunctionPrototypes XkbClearAllLatchesAndLocks( DeviceIntPtr dev, XkbSrvInfoPtr xkbi, Bool genEv, XkbEventCausePtr cause) -#else -XkbClearAllLatchesAndLocks(dev,xkbi,genEv,cause) - DeviceIntPtr dev; - XkbSrvInfoPtr xkbi; - Bool genEv; - XkbEventCausePtr cause; -#endif { XkbStateRec os; xkbStateNotify sn; diff --git a/xkb/xkbDflts.h b/xkb/xkbDflts.h index 417478ef4..910616e60 100644 --- a/xkb/xkbDflts.h +++ b/xkb/xkbDflts.h @@ -1,5 +1,5 @@ /* $Xorg: xkbDflts.h,v 1.3 2000/08/17 19:53:47 cpqbld Exp $ */ -/* $XFree86: xc/programs/Xserver/xkb/xkbDflts.h,v 1.2 2001/10/28 03:34:20 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/xkb/xkbDflts.h,v 1.3 2003/11/17 22:20:46 dawes Exp $ */ /* This file generated automatically by xkbcomp */ /* DO NOT EDIT */ #ifndef DEFAULT_H @@ -137,12 +137,7 @@ static XkbKeyTypeRec dflt_types[]= { static void -#if NeedFunctionPrototypes initTypeNames(DPYTYPE dpy) -#else -initTypeNames(dpy) -DPYTYPE dpy; -#endif { dflt_types[0].name= GET_ATOM(dpy,"ONE_LEVEL"); lnames_ONE_LEVEL[0]= GET_ATOM(dpy,"Any"); @@ -502,13 +497,7 @@ static XkbIndicatorRec indicators= { } }; static void -#if NeedFunctionPrototypes initIndicatorNames(DPYTYPE dpy,XkbDescPtr xkb) -#else -initIndicatorNames(dpy,xkb) - DPYTYPE dpy; - XkbDescPtr xkb; -#endif { xkb->names->indicators[ 0]= GET_ATOM(dpy,"Caps Lock"); xkb->names->indicators[ 1]= GET_ATOM(dpy,"Num Lock"); diff --git a/xkb/xkbEvents.c b/xkb/xkbEvents.c index 291674fcf..0cd1becac 100644 --- a/xkb/xkbEvents.c +++ b/xkb/xkbEvents.c @@ -24,7 +24,7 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/xkbEvents.c,v 3.10 2001/10/28 03:34:20 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/xkb/xkbEvents.c,v 3.12 2003/11/17 22:20:46 dawes Exp $ */ #include <stdio.h> #define NEED_EVENTS 1 @@ -35,17 +35,12 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "inputstr.h" #include "windowstr.h" #include "XKBsrv.h" +#include "xkb.h" /***====================================================================***/ void -#if NeedFunctionPrototypes XkbSendNewKeyboardNotify(DeviceIntPtr kbd,xkbNewKeyboardNotify *pNKN) -#else -XkbSendNewKeyboardNotify(kbd,pNKN) - DeviceIntPtr kbd; - xkbNewKeyboardNotify * pNKN; -#endif { register int i; Time time; @@ -102,13 +97,7 @@ CARD16 changed; /***====================================================================***/ void -#if NeedFunctionPrototypes XkbSendStateNotify(DeviceIntPtr kbd,xkbStateNotify *pSN) -#else -XkbSendStateNotify(kbd,pSN) - DeviceIntPtr kbd; - xkbStateNotify *pSN; -#endif { XkbSrvInfoPtr xkbi; XkbStatePtr state; @@ -169,13 +158,7 @@ register CARD16 changed,bState; /***====================================================================***/ void -#if NeedFunctionPrototypes XkbSendMapNotify(DeviceIntPtr kbd,xkbMapNotify *pMN) -#else -XkbSendMapNotify(kbd,pMN) - DeviceIntPtr kbd; - xkbMapNotify *pMN; -#endif { int i; XkbSrvInfoPtr xkbi; @@ -217,20 +200,11 @@ CARD16 changed; } int -#if NeedFunctionPrototypes XkbComputeControlsNotify( DeviceIntPtr kbd, XkbControlsPtr old, XkbControlsPtr new, xkbControlsNotify * pCN, Bool forceCtrlProc) -#else -XkbComputeControlsNotify(kbd,old,new,pCN,forceCtrlProc) - DeviceIntPtr kbd; - XkbControlsPtr old; - XkbControlsPtr new; - xkbControlsNotify *pCN; - Bool forceCtrlProc; -#endif { int i; CARD32 changedControls; @@ -301,13 +275,7 @@ CARD32 changedControls; } void -#if NeedFunctionPrototypes XkbSendControlsNotify(DeviceIntPtr kbd,xkbControlsNotify *pCN) -#else -XkbSendControlsNotify(kbd,pCN) - DeviceIntPtr kbd; - xkbControlsNotify *pCN; -#endif { int initialized; CARD32 changedControls, enabledControls, enabledChanges = 0; @@ -358,14 +326,7 @@ Time time = 0; } void -#if NeedFunctionPrototypes XkbSendIndicatorNotify(DeviceIntPtr kbd,int xkbType,xkbIndicatorNotify *pEv) -#else -XkbSendIndicatorNotify(kbd,xkbType,pEv) - DeviceIntPtr kbd; - int xkbType; - xkbIndicatorNotify *pEv; -#endif { int initialized; XkbInterestPtr interest; @@ -414,7 +375,6 @@ CARD32 state,changed; void -#if NeedFunctionPrototypes XkbHandleBell( BOOL force, BOOL eventOnly, DeviceIntPtr kbd, @@ -424,18 +384,6 @@ XkbHandleBell( BOOL force, Atom name, WindowPtr pWin, ClientPtr pClient) -#else -XkbHandleBell(force,eventOnly,kbd,percent,pCtrl,class,name,pWin,pClient) - BOOL force; - BOOL eventOnly; - DeviceIntPtr kbd; - CARD8 percent; - pointer *pCtrl; - CARD8 class; - Atom name; - WindowPtr pWin; - ClientPtr pClient; -#endif { xkbBellNotify bn; int initialized; @@ -511,13 +459,7 @@ XID winID = 0; } void -#if NeedFunctionPrototypes XkbSendAccessXNotify(DeviceIntPtr kbd,xkbAccessXNotify *pEv) -#else -XkbSendAccessXNotify(kbd,pEv) - DeviceIntPtr kbd; - xkbAccessXNotify *pEv; -#endif { int initialized; XkbInterestPtr interest; @@ -562,13 +504,7 @@ CARD16 sk_delay,db_delay; } void -#if NeedFunctionPrototypes XkbSendNamesNotify(DeviceIntPtr kbd,xkbNamesNotify *pEv) -#else -XkbSendNamesNotify(kbd,pEv) - DeviceIntPtr kbd; - xkbNamesNotify *pEv; -#endif { int initialized; XkbInterestPtr interest; @@ -617,13 +553,7 @@ CARD32 changedIndicators; } void -#if NeedFunctionPrototypes XkbSendCompatMapNotify(DeviceIntPtr kbd,xkbCompatMapNotify *pEv) -#else -XkbSendCompatMapNotify(kbd,pEv) - DeviceIntPtr kbd; - xkbCompatMapNotify *pEv; -#endif { int initialized; XkbInterestPtr interest; @@ -671,13 +601,7 @@ CARD16 firstSI = 0, nSI = 0, nTotalSI = 0; } void -#if NeedFunctionPrototypes XkbSendActionMessage(DeviceIntPtr kbd,xkbActionMessage *pEv) -#else -XkbSendActionMessage(kbd,pEv) - DeviceIntPtr kbd; - xkbActionMessage * pEv; -#endif { int initialized; XkbSrvInfoPtr xkbi; @@ -720,16 +644,9 @@ Time time = 0; } void -#if NeedFunctionPrototypes XkbSendExtensionDeviceNotify( DeviceIntPtr dev, ClientPtr client, xkbExtensionDeviceNotify * pEv) -#else -XkbSendExtensionDeviceNotify(dev,client,pEv) - DeviceIntPtr dev; - ClientPtr client; - xkbExtensionDeviceNotify * pEv; -#endif { int initialized; XkbInterestPtr interest; @@ -791,16 +708,9 @@ CARD16 reason, supported = 0; } void -#if NeedFunctionPrototypes XkbSendNotification( DeviceIntPtr kbd, XkbChangesPtr pChanges, XkbEventCausePtr cause) -#else -XkbSendNotification(kbd,pChanges,cause) - DeviceIntPtr kbd; - XkbChangesPtr pChanges; - XkbEventCausePtr cause; -#endif { XkbSrvLedInfoPtr sli; @@ -887,14 +797,7 @@ XkbSrvLedInfoPtr sli; /***====================================================================***/ Bool -#if NeedFunctionPrototypes XkbFilterEvents(ClientPtr pClient,int nEvents,xEvent *xE) -#else -XkbFilterEvents(pClient,nEvents,xE) - ClientPtr pClient; - int nEvents; - xEvent *xE; -#endif { int i, button_mask; DeviceIntPtr pXDev = (DeviceIntPtr)LookupKeyboardDevice(); @@ -1011,13 +914,7 @@ XkbSrvInfoPtr xkbi; /***====================================================================***/ XkbInterestPtr -#if NeedFunctionPrototypes XkbFindClientResource(DevicePtr inDev,ClientPtr client) -#else -XkbFindClientResource(inDev,client) - DevicePtr inDev; - ClientPtr client; -#endif { DeviceIntPtr dev = (DeviceIntPtr)inDev; XkbInterestPtr interest; @@ -1035,14 +932,7 @@ XkbInterestPtr interest; } XkbInterestPtr -#if NeedFunctionPrototypes XkbAddClientResource(DevicePtr inDev,ClientPtr client,XID id) -#else -XkbAddClientResource(inDev,client,id) - DevicePtr inDev; - ClientPtr client; - XID id; -#endif { DeviceIntPtr dev = (DeviceIntPtr)inDev; XkbInterestPtr interest; @@ -1076,13 +966,7 @@ XkbInterestPtr interest; } int -#if NeedFunctionPrototypes XkbRemoveClient(DevicePtr inDev,ClientPtr client) -#else -XkbRemoveClient(inDev,client) -DevicePtr inDev; -ClientPtr client; -#endif { XkbSrvInfoPtr xkbi; DeviceIntPtr dev = (DeviceIntPtr)inDev; @@ -1124,13 +1008,7 @@ Bool found; } int -#if NeedFunctionPrototypes XkbRemoveResourceClient(DevicePtr inDev,XID id) -#else -XkbRemoveResourceClient(inDev,id) - DevicePtr inDev; - XID id; -#endif { XkbSrvInfoPtr xkbi; DeviceIntPtr dev = (DeviceIntPtr)inDev; diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c index 5074b8bfb..064311d5e 100644 --- a/xkb/xkbInit.c +++ b/xkb/xkbInit.c @@ -24,7 +24,7 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/xkbInit.c,v 3.26.2.1 2003/03/17 23:53:14 paulo Exp $ */ +/* $XFree86: xc/programs/Xserver/xkb/xkbInit.c,v 3.32 2003/11/17 22:20:46 dawes Exp $ */ #include <stdio.h> #include <stdlib.h> @@ -45,7 +45,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "XKBgeom.h" #include <X11/extensions/XKMformat.h> #include <X11/extensions/XKBfile.h> - +#include "xkb.h" #define CREATE_ATOM(s) MakeAtom(s,sizeof(s)-1,1) @@ -141,12 +141,7 @@ Bool XkbWantRulesProp= XKB_DFLT_RULES_PROP; /***====================================================================***/ char * -#if NeedFunctionPrototypes XkbGetRulesDflts(XkbRF_VarDefsPtr defs) -#else -XkbGetRulesDflts(defs) - XkbRF_VarDefsPtr defs; -#endif { if (XkbModelDflt) defs->model= XkbModelDflt; else defs->model= XKB_DFLT_KB_MODEL; @@ -160,13 +155,7 @@ XkbGetRulesDflts(defs) } Bool -#if NeedFunctionPrototypes XkbWriteRulesProp(ClientPtr client, pointer closure) -#else -XkbWriteRulesProp(client, closure) - ClientPtr client; - pointer closure; -#endif { int len,out; Atom name; @@ -232,12 +221,7 @@ char * pval; } void -#if NeedFunctionPrototypes XkbSetRulesUsed(XkbRF_VarDefsPtr defs) -#else -XkbSetRulesUsed(defs) - XkbRF_VarDefsPtr defs; -#endif { if (XkbModelUsed) _XkbFree(XkbModelUsed); @@ -257,17 +241,8 @@ XkbSetRulesUsed(defs) } void -#if NeedFunctionPrototypes XkbSetRulesDflts(char *rulesFile,char *model,char *layout, char *variant,char *options) -#else -XkbSetRulesDflts(rulesFile,model,layout,variant,options) - char * rulesFile; - char * model; - char * layout; - char * variant; - char * options; -#endif { if (XkbRulesFile) _XkbFree(XkbRulesFile); @@ -308,13 +283,7 @@ XkbSetRulesDflts(rulesFile,model,layout,variant,options) pointer xkbBogus = &indicators; static Bool -#if NeedFunctionPrototypes XkbInitKeyTypes(XkbDescPtr xkb,SrvXkmInfo *file) -#else -XkbInitKeyTypes(xkb,file) - XkbDescPtr xkb; - SrvXkmInfo * file; -#endif { if (file->xkbinfo.defined&XkmTypesMask) return True; @@ -330,13 +299,7 @@ XkbInitKeyTypes(xkb,file) } static void -#if NeedFunctionPrototypes XkbInitRadioGroups(XkbSrvInfoPtr xkbi,SrvXkmInfo *file) -#else -XkbInitRadioGroups(xkbi,file) - XkbSrvInfoPtr xkbi; - SrvXkmInfo * file; -#endif { xkbi->nRadioGroups = 0; xkbi->radioGroups = NULL; @@ -345,13 +308,7 @@ XkbInitRadioGroups(xkbi,file) static Status -#if NeedFunctionPrototypes XkbInitCompatStructs(XkbDescPtr xkb,SrvXkmInfo *file) -#else -XkbInitCompatStructs(xkb,file) - XkbDescPtr xkb; - SrvXkmInfo * file; -#endif { register int i; XkbCompatMapPtr compat; @@ -378,13 +335,7 @@ XkbCompatMapPtr compat; } static void -#if NeedFunctionPrototypes XkbInitSemantics(XkbDescPtr xkb,SrvXkmInfo *file) -#else -XkbInitSemantics(xkb,file) - XkbDescPtr xkb; - SrvXkmInfo * file; -#endif { XkbInitKeyTypes(xkb,file); XkbInitCompatStructs(xkb,file); @@ -394,13 +345,7 @@ XkbInitSemantics(xkb,file) /***====================================================================***/ static Status -#if NeedFunctionPrototypes XkbInitNames(XkbSrvInfoPtr xkbi,SrvXkmInfo *file) -#else -XkbInitNames(xkbi,file) - XkbSrvInfoPtr xkbi; - SrvXkmInfo * file; -#endif { XkbDescPtr xkb; XkbNamesPtr names; @@ -457,13 +402,7 @@ Atom unknown; } static Status -#if NeedFunctionPrototypes XkbInitIndicatorMap(XkbSrvInfoPtr xkbi,SrvXkmInfo *file) -#else -XkbInitIndicatorMap(xkbi,file) - XkbSrvInfoPtr xkbi; - SrvXkmInfo * file; -#endif { XkbDescPtr xkb; XkbIndicatorPtr map; @@ -500,14 +439,7 @@ XkbSrvLedInfoPtr sli; } static Status -#if NeedFunctionPrototypes XkbInitControls(DeviceIntPtr pXDev,XkbSrvInfoPtr xkbi,SrvXkmInfo *file) -#else -XkbInitControls(pXDev,xkbi,file) - DeviceIntPtr pXDev; - XkbSrvInfoPtr xkbi; - SrvXkmInfo * file; -#endif { XkbDescPtr xkb; XkbControlsPtr ctrls; @@ -536,12 +468,7 @@ XkbControlsPtr ctrls; } void -#if NeedFunctionPrototypes XkbInitDevice(DeviceIntPtr pXDev) -#else -XkbInitDevice(pXDev) - DeviceIntPtr pXDev; -#endif { int i; XkbSrvInfoPtr xkbi; @@ -558,10 +485,11 @@ XkbEventCauseRec cause; if ((file.file=XkbDDXOpenConfigFile(XkbInitialMap,NULL,0))!=NULL) { XkmReadFile(file.file,0,XkmKeymapLegal,&file.xkbinfo); if (file.xkbinfo.xkb==NULL) { - ErrorF("Error loading keymap file %s (%s in %s)\n", + LogMessage(X_ERROR, + "Error loading keymap file %s (%s in %s)\n" + "\treverting to defaults\n", XkbInitialMap, _XkbErrMessages[_XkbErrCode], (_XkbErrLocation?_XkbErrLocation:"unknown")); - ErrorF(" reverting to defaults\n"); fclose(file.file); file.file= NULL; bzero(&file.xkbinfo,sizeof(XkbFileInfo)); @@ -578,8 +506,8 @@ XkbEventCauseRec cause; } } else { - ErrorF("Error opening keymap file %s, reverting to defaults\n", - XkbInitialMap); + LogMessage(X_ERROR, "Error opening keymap file %s, reverting to defaults\n", + XkbInitialMap); } } pXDev->key->xkbInfo= xkbi= _XkbTypedCalloc(1,XkbSrvInfoRec); @@ -667,22 +595,19 @@ XkbEventCauseRec cause; #endif Bool -#if NeedFunctionPrototypes -XkbInitKeyboardDeviceStruct( DeviceIntPtr dev, - XkbComponentNamesPtr names, - KeySymsPtr pSymsIn, - CARD8 pModsIn[], - void (*bellProc)(), - void (*ctrlProc)()) -#else -XkbInitKeyboardDeviceStruct( dev,names,pSymsIn,pModsIn,bellProc,ctrlProc ) - DeviceIntPtr dev; - XkbComponentNamesPtr names; - KeySymsPtr pSymsIn; - CARD8 pModsIn[]; - void (*bellProc)(); - void (*ctrlProc)(); -#endif +XkbInitKeyboardDeviceStruct( + DeviceIntPtr dev, + XkbComponentNamesPtr names, + KeySymsPtr pSymsIn, + CARD8 pModsIn[], + void (*bellProc)( + int /*percent*/, + DeviceIntPtr /*device*/, + pointer /*ctrl*/, + int), + void (*ctrlProc)( + DeviceIntPtr /*device*/, + KeybdCtrl * /*ctrl*/)) { XkbFileInfo finfo; KeySymsRec tmpSyms,*pSyms; @@ -826,7 +751,7 @@ XkbRF_VarDefsRec defs; _XkbInitFileInfo= &finfo; } else { - ErrorF("Couldn't load XKB keymap, falling back to pre-XKB keymap\n"); + LogMessage(X_ERROR, "Couldn't load XKB keymap, falling back to pre-XKB keymap\n"); } ok= InitKeyboardDeviceStruct((DevicePtr)dev,pSyms,pMods,bellProc,ctrlProc); if ((config!=NULL)&&(dev && dev->key && dev->key->xkbInfo)) @@ -873,12 +798,7 @@ XkbRF_VarDefsRec defs; * default indicator feedback. */ int -#if NeedFunctionPrototypes XkbFinishDeviceInit(DeviceIntPtr pXDev) -#else -XkbFinishDeviceInit(pXDev) - DeviceIntPtr pXDev; -#endif { XkbSrvInfoPtr xkbi; XkbDescPtr xkb; @@ -920,12 +840,7 @@ XkbSrvLedInfoPtr sli; * is part of this larger block. */ void -#if NeedFunctionPrototypes XkbFreeInfo(XkbSrvInfoPtr xkbi) -#else -XkbFreeInfo(xkbi) - XkbSrvInfoPtr xkbi; -#endif { if (xkbi->radioGroups) { _XkbFree(xkbi->radioGroups); @@ -975,14 +890,7 @@ extern unsigned int XkbDfltAccessXFeedback; extern unsigned char XkbDfltAccessXOptions; int -#if NeedFunctionPrototypes XkbProcessArguments(int argc,char *argv[],int i) -#else -XkbProcessArguments(argc,argv,i) - int argc; - char * argv[]; - int i; -#endif { if (strcmp(argv[i],"-kb")==0) { noXkbExtension= True; @@ -996,7 +904,7 @@ XkbProcessArguments(argc,argv,i) if(++i < argc) { #if !defined(WIN32) && !defined(__UNIXOS2__) && !defined(__CYGWIN__) if (getuid() != geteuid()) { - ErrorF("-xkbdir is not available for setuid X servers\n"); + LogMessage(X_WARNING, "-xkbdir is not available for setuid X servers\n"); return -1; } else #endif @@ -1005,7 +913,7 @@ XkbProcessArguments(argc,argv,i) XkbBaseDirectory= argv[i]; return 2; } else { - ErrorF("-xkbdir pathname too long\n"); + LogMessage(X_ERROR, "-xkbdir pathname too long\n"); return -1; } } @@ -1020,7 +928,7 @@ XkbProcessArguments(argc,argv,i) XkbInitialMap= argv[i]; return 2; } else { - ErrorF("-xkbmap pathname too long\n"); + LogMessage(X_ERROR, "-xkbmap pathname too long\n"); return -1; } } @@ -1034,7 +942,7 @@ XkbProcessArguments(argc,argv,i) XkbDB= argv[i]; return 2; } else { - ErrorF("-xkbdb pathname too long\n"); + LogMessage(X_ERROR, "-xkbdb pathname too long\n"); return -1; } } @@ -1098,11 +1006,7 @@ XkbProcessArguments(argc,argv,i) } void -#if NeedFunctionPrototypes XkbUseMsg(void) -#else -XkbUseMsg() -#endif { ErrorF("The X Keyboard Extension adds the following arguments:\n"); ErrorF("-kb disable the X Keyboard Extension\n"); diff --git a/xkb/xkbLEDs.c b/xkb/xkbLEDs.c index 33cf7bd9e..f75db6918 100644 --- a/xkb/xkbLEDs.c +++ b/xkb/xkbLEDs.c @@ -24,7 +24,7 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/xkbLEDs.c,v 3.6 2001/11/23 19:21:36 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/xkb/xkbLEDs.c,v 3.8 2003/11/17 22:20:46 dawes Exp $ */ #include <stdio.h> #include <ctype.h> @@ -37,6 +37,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "XI.h" #include "XKBsrv.h" +#include "xkb.h" /***====================================================================***/ @@ -51,16 +52,9 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. */ unsigned -#if NeedFunctionPrototypes XkbIndicatorsToUpdate( DeviceIntPtr dev, unsigned long state_changes, Bool enable_changes) -#else -XkbIndicatorsToUpdate(dev,state_changes,enable_changes) - DeviceIntPtr dev; - unsigned long state_changes; - Bool enable_changes; -#endif { register unsigned update= 0; XkbSrvLedInfoPtr sli; @@ -96,18 +90,10 @@ XkbSrvLedInfoPtr sli; * extent of the changes is reported in change, which must be defined. */ Bool -#if NeedFunctionPrototypes XkbApplyLEDChangeToKeyboard( XkbSrvInfoPtr xkbi, XkbIndicatorMapPtr map, Bool on, XkbChangesPtr change) -#else -XkbApplyLEDChangeToKeyboard(xkbi,map,on,change) - XkbSrvInfoPtr xkbi; - XkbIndicatorMapPtr map; - Bool on; - XkbChangesPtr change; -#endif { Bool ctrlChange,stateChange; XkbStatePtr state; @@ -204,18 +190,10 @@ XkbStatePtr state; */ void -#if NeedFunctionPrototypes XkbSetIndicators( DeviceIntPtr dev, CARD32 affect, CARD32 values, XkbEventCausePtr cause) -#else -XkbSetIndicators(dev,affect,values,cause) - DeviceIntPtr dev; - CARD32 affect; - CARD32 values; - XkbEventCausePtr cause; -#endif { XkbSrvLedInfoPtr sli; XkbChangesRec changes; @@ -258,16 +236,9 @@ unsigned side_affected; */ static Bool -#if NeedFunctionPrototypes ComputeAutoState( XkbIndicatorMapPtr map, XkbStatePtr state, XkbControlsPtr ctrls) -#else -ComputeAutoState(map,state,ctrls) - XkbIndicatorMapPtr map; - XkbStatePtr state; - XkbControlsPtr ctrls; -#endif { Bool on; CARD8 mods,group; @@ -324,20 +295,11 @@ CARD8 mods,group; */ void -#if NeedFunctionPrototypes XkbUpdateIndicators( DeviceIntPtr dev, register CARD32 update, Bool check_edevs, XkbChangesPtr changes, XkbEventCausePtr cause) -#else -XkbUpdateIndicators(dev,update,check_edevs,changes,cause) - DeviceIntPtr dev; - register CARD32 update; - Bool check_edevs; - XkbChangesPtr changes; - XkbEventCausePtr cause; -#endif { XkbSrvLedInfoPtr sli; @@ -351,13 +313,7 @@ XkbSrvLedInfoPtr sli; /***====================================================================***/ void -#if NeedFunctionPrototypes XkbUpdateAllDeviceIndicators(XkbChangesPtr changes,XkbEventCausePtr cause) -#else -XkbUpdateAllDeviceIndicators(changes,cause) - XkbChangesPtr changes; - XkbEventCausePtr cause; -#endif { DeviceIntPtr edev; XkbSrvLedInfoPtr sli; @@ -403,14 +359,7 @@ XkbSrvLedInfoPtr sli; */ void -#if NeedFunctionPrototypes XkbCheckIndicatorMaps(DeviceIntPtr dev,XkbSrvLedInfoPtr sli,unsigned which) -#else -XkbCheckIndicatorMaps(dev,sli,which) - DeviceIntPtr dev; - XkbSrvLedInfoPtr sli; - unsigned which; -#endif { register unsigned i,bit; XkbIndicatorMapPtr map; @@ -483,18 +432,10 @@ XkbDescPtr xkb; * of the parts speicified therein are allocated. */ XkbSrvLedInfoPtr -#if NeedFunctionPrototypes XkbAllocSrvLedInfo( DeviceIntPtr dev, KbdFeedbackPtr kf, LedFeedbackPtr lf, unsigned needed_parts) -#else -XkbAllocSrvLedInfo(dev,kf,lf,needed_parts) - DeviceIntPtr dev; - KbdFeedbackPtr kf; - LedFeedbackPtr lf; - unsigned needed_parts; -#endif { XkbSrvLedInfoPtr sli; Bool checkAccel; @@ -581,12 +522,7 @@ Bool checkNames; } void -#if NeedFunctionPrototypes XkbFreeSrvLedInfo(XkbSrvLedInfoPtr sli) -#else -XkbFreeSrvLedInfo(sli) - XkbSrvLedInfoPtr sli; -#endif { if ((sli->flags&XkbSLI_IsDefault)==0) { if (sli->maps) _XkbFree(sli->maps); @@ -613,18 +549,10 @@ XkbFreeSrvLedInfo(sli) */ XkbSrvLedInfoPtr -#if NeedFunctionPrototypes XkbFindSrvLedInfo( DeviceIntPtr dev, unsigned class, unsigned id, unsigned needed_parts) -#else -XkbFindSrvLedInfo(dev,class,id,needed_parts) - DeviceIntPtr dev; - unsigned class; - unsigned id; - unsigned needed_parts; -#endif { XkbSrvLedInfoPtr sli; @@ -677,22 +605,12 @@ XkbSrvLedInfoPtr sli; /***====================================================================***/ void -#if NeedFunctionPrototypes XkbFlushLedEvents( DeviceIntPtr dev, DeviceIntPtr kbd, XkbSrvLedInfoPtr sli, xkbExtensionDeviceNotify * ed, XkbChangesPtr changes, XkbEventCausePtr cause) -#else -XkbFlushLedEvents(dev,kbd,sli,ed,changes,cause) - DeviceIntPtr dev; - DeviceIntPtr kbd; - XkbSrvLedInfoPtr sli; - xkbExtensionDeviceNotify * ed; - XkbChangesPtr changes; - XkbEventCausePtr cause; -#endif { if (changes) { if (changes->indicators.state_changes) @@ -720,22 +638,12 @@ XkbFlushLedEvents(dev,kbd,sli,ed,changes,cause) /***====================================================================***/ void -#if NeedFunctionPrototypes XkbApplyLedNameChanges( DeviceIntPtr dev, XkbSrvLedInfoPtr sli, unsigned changed_names, xkbExtensionDeviceNotify * ed, XkbChangesPtr changes, XkbEventCausePtr cause) -#else -XkbApplyLedNameChanges(dev,sli,changed_names,ed,changes,cause) - DeviceIntPtr dev; - XkbSrvLedInfoPtr sli; - unsigned changed_names; - xkbExtensionDeviceNotify * ed; - XkbChangesPtr changes; - XkbEventCausePtr cause; -#endif { DeviceIntPtr kbd; XkbChangesRec my_changes; @@ -807,22 +715,12 @@ xkbExtensionDeviceNotify my_ed; */ void -#if NeedFunctionPrototypes XkbApplyLedMapChanges( DeviceIntPtr dev, XkbSrvLedInfoPtr sli, unsigned changed_maps, xkbExtensionDeviceNotify * ed, XkbChangesPtr changes, XkbEventCausePtr cause) -#else -XkbApplyLedMapChanges(dev,sli,changed_maps,ed,changes,cause) - DeviceIntPtr dev; - XkbSrvLedInfoPtr sli; - unsigned changed_maps; - xkbExtensionDeviceNotify * ed; - XkbChangesPtr changes; - XkbEventCausePtr cause; -#endif { DeviceIntPtr kbd; XkbChangesRec my_changes; @@ -873,22 +771,12 @@ xkbExtensionDeviceNotify my_ed; /***====================================================================***/ void -#if NeedFunctionPrototypes XkbApplyLedStateChanges(DeviceIntPtr dev, XkbSrvLedInfoPtr sli, unsigned changed_leds, xkbExtensionDeviceNotify * ed, XkbChangesPtr changes, XkbEventCausePtr cause) -#else -XkbApplyLedStateChanges(dev,sli,changed_leds,ed,changes,cause) - DeviceIntPtr dev; - XkbSrvLedInfoPtr sli; - unsigned changed_leds; - xkbExtensionDeviceNotify * ed; - XkbChangesPtr changes; - XkbEventCausePtr cause; -#endif { XkbSrvInfoPtr xkbi; DeviceIntPtr kbd; @@ -970,22 +858,12 @@ Bool kb_changed; /***====================================================================***/ void -#if NeedFunctionPrototypes XkbUpdateLedAutoState( DeviceIntPtr dev, XkbSrvLedInfoPtr sli, unsigned maps_to_check, xkbExtensionDeviceNotify * ed, XkbChangesPtr changes, XkbEventCausePtr cause) -#else -XkbUpdateLedAutoState(dev,sli,maps_to_check,ed,changes,cause) - DeviceIntPtr dev; - XkbSrvLedInfoPtr sli; - unsigned maps_to_check; - xkbExtensionDeviceNotify * ed; - XkbChangesPtr changes; - XkbEventCausePtr cause; -#endif { DeviceIntPtr kbd; XkbStatePtr state; @@ -1056,20 +934,11 @@ unsigned oldState; /***====================================================================***/ static void -#if NeedFunctionPrototypes _UpdateButtonVMods( XkbDescPtr xkb, unsigned num_btns, XkbAction * acts, unsigned changed, xkbExtensionDeviceNotify * ed_inout) -#else -_UpdateButtonVMods(xkb,num_btns,acts,changed,ed_inout) - XkbDescPtr xkb; - unsigned num_btns; - XkbAction * acts; - unsigned changed; - xkbExtensionDeviceNotify * ed_inout; -#endif { register int i; @@ -1090,18 +959,10 @@ register int i; } static void -#if NeedFunctionPrototypes _UpdateMapVMods( XkbDescPtr xkb, register XkbIndicatorMapPtr map, unsigned changed_vmods, unsigned * changed_maps_rtrn) -#else -_UpdateMapVMods(xkb,map,changed_vmods,changed_maps_rtrn) - XkbDescPtr xkb; - register XkbIndicatorMapPtr map; - unsigned changed_vmods; - unsigned * changed_maps_rtrn; -#endif { register int i; @@ -1117,18 +978,10 @@ register int i; } static void -#if NeedFunctionPrototypes _UpdateDeviceVMods( DeviceIntPtr dev, XkbDescPtr xkb, unsigned changed, XkbEventCausePtr cause) -#else -_UpdateDeviceVMods(dev,xkb,changed,cause) - DeviceIntPtr dev; - XkbDescPtr xkb; - unsigned changed; - XkbEventCausePtr cause; -#endif { xkbExtensionDeviceNotify ed; XkbSrvLedInfoPtr sli; @@ -1188,18 +1041,10 @@ unsigned changed_maps; } void -#if NeedFunctionPrototypes XkbApplyVModChangesToAllDevices( DeviceIntPtr dev, XkbDescPtr xkb, unsigned changed, XkbEventCausePtr cause) -#else -XkbApplyVModChangesToAllDevices(dev,xkb,changed,cause) - DeviceIntPtr dev; - XkbDescPtr xkb; - unsigned changed; - XkbEventCausePtr cause; -#endif { DeviceIntPtr edev; if (dev!=(DeviceIntPtr)LookupKeyboardDevice()) diff --git a/xkb/xkbPrKeyEv.c b/xkb/xkbPrKeyEv.c index 84af5f2f8..3a9fc11f8 100644 --- a/xkb/xkbPrKeyEv.c +++ b/xkb/xkbPrKeyEv.c @@ -24,7 +24,7 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/xkbPrKeyEv.c,v 3.8 2001/01/17 22:37:15 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/xkb/xkbPrKeyEv.c,v 3.9 2003/11/17 22:20:46 dawes Exp $ */ #include <stdio.h> #include <math.h> @@ -41,14 +41,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. /***====================================================================***/ void -#if NeedFunctionPrototypes XkbProcessKeyboardEvent(xEvent *xE,DeviceIntPtr keybd,int count) -#else -XkbProcessKeyboardEvent(xE,keybd,count) - xEvent * xE; - DeviceIntPtr keybd; - int count; -#endif { KeyClassPtr keyc = keybd->key; XkbSrvInfoPtr xkbi; @@ -167,14 +160,7 @@ unsigned ndx; } void -#if NeedFunctionPrototypes ProcessKeyboardEvent(xEvent *xE,DeviceIntPtr keybd,int count) -#else -ProcessKeyboardEvent(xE,keybd,count) - xEvent * xE; - DeviceIntPtr keybd; - int count; -#endif { KeyClassPtr keyc = keybd->key; XkbSrvInfoPtr xkbi; diff --git a/xkb/xkbPrOtherEv.c b/xkb/xkbPrOtherEv.c index fd24283f5..0a077f4c1 100644 --- a/xkb/xkbPrOtherEv.c +++ b/xkb/xkbPrOtherEv.c @@ -24,6 +24,7 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ +/* $XFree86: xc/programs/Xserver/xkb/xkbPrOtherEv.c,v 1.2 2003/11/17 22:20:46 dawes Exp $ */ #include <stdio.h> #include <math.h> @@ -39,24 +40,15 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "XIproto.h" extern void ProcessOtherEvent( -#if NeedFunctionPrototypes xEvent * /* xE */, DeviceIntPtr /* dev */, int /* count */ -#endif ); /***====================================================================***/ void -#if NeedFunctionPrototypes XkbProcessOtherEvent(xEvent *xE,DeviceIntPtr dev,int count) -#else -XkbProcessOtherEvent(xE,dev,count) - xEvent * xE; - DeviceIntPtr dev; - int count; -#endif { Bool xkbCares,isBtn; diff --git a/xkb/xkbSwap.c b/xkb/xkbSwap.c index 6a5bee3b9..6f4ffe8a9 100644 --- a/xkb/xkbSwap.c +++ b/xkb/xkbSwap.c @@ -24,7 +24,7 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/xkbSwap.c,v 3.2 2001/08/23 14:33:26 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/xkb/xkbSwap.c,v 3.5 2003/11/17 22:20:46 dawes Exp $ */ #include "stdio.h" #include "X.h" @@ -36,50 +36,13 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "XKBsrv.h" #include "XKBstr.h" #include "extnsionst.h" - -#if NeedFunctionPrototypes -#define PROC_EXTERN(pfunc) extern int pfunc(ClientPtr) -#else -#define PROC_EXTERN(pfunc) extern int pfunc() -#endif - -PROC_EXTERN(ProcXkbUseExtension); -PROC_EXTERN(ProcXkbSelectEvents); -PROC_EXTERN(ProcXkbBell); -PROC_EXTERN(ProcXkbGetState); -PROC_EXTERN(ProcXkbLatchLockState); -PROC_EXTERN(ProcXkbGetControls); -PROC_EXTERN(ProcXkbSetControls); -PROC_EXTERN(ProcXkbGetMap); -PROC_EXTERN(ProcXkbSetMap); -PROC_EXTERN(ProcXkbGetCompatMap); -PROC_EXTERN(ProcXkbSetCompatMap); -PROC_EXTERN(ProcXkbGetIndicatorState); -PROC_EXTERN(ProcXkbGetIndicatorMap); -PROC_EXTERN(ProcXkbSetIndicatorMap); -PROC_EXTERN(ProcXkbGetNamedIndicator); -PROC_EXTERN(ProcXkbSetNamedIndicator); -PROC_EXTERN(ProcXkbGetNames); -PROC_EXTERN(ProcXkbSetNames); -PROC_EXTERN(ProcXkbGetGeometry); -PROC_EXTERN(ProcXkbSetGeometry); -PROC_EXTERN(ProcXkbPerClientFlags); -PROC_EXTERN(ProcXkbListComponents); -PROC_EXTERN(ProcXkbGetKbdByName); -PROC_EXTERN(ProcXkbGetDeviceInfo); -PROC_EXTERN(ProcXkbSetDeviceInfo); -PROC_EXTERN(ProcXkbSetDebuggingFlags); +#include "xkb.h" /* * REQUEST SWAPPING */ static int -#if NeedFunctionPrototypes SProcXkbUseExtension(ClientPtr client) -#else -SProcXkbUseExtension(client) - ClientPtr client; -#endif { register int n; @@ -93,12 +56,7 @@ register int n; } static int -#if NeedFunctionPrototypes SProcXkbSelectEvents(ClientPtr client) -#else -SProcXkbSelectEvents(client) - ClientPtr client; -#endif { register int n; @@ -177,12 +135,7 @@ register int n; } static int -#if NeedFunctionPrototypes SProcXkbBell(ClientPtr client) -#else -SProcXkbBell(client) - ClientPtr client; -#endif { register int n; @@ -201,12 +154,7 @@ register int n; } static int -#if NeedFunctionPrototypes SProcXkbGetState(ClientPtr client) -#else -SProcXkbGetState(client) - ClientPtr client; -#endif { register int n; @@ -219,12 +167,7 @@ register int n; } static int -#if NeedFunctionPrototypes SProcXkbLatchLockState(ClientPtr client) -#else -SProcXkbLatchLockState(client) - ClientPtr client; -#endif { register int n; @@ -238,12 +181,7 @@ register int n; } static int -#if NeedFunctionPrototypes SProcXkbGetControls(ClientPtr client) -#else -SProcXkbGetControls(client) - ClientPtr client; -#endif { register int n; @@ -256,12 +194,7 @@ register int n; } static int -#if NeedFunctionPrototypes SProcXkbSetControls(ClientPtr client) -#else -SProcXkbSetControls(client) - ClientPtr client; -#endif { register int n; @@ -296,12 +229,7 @@ register int n; } static int -#if NeedFunctionPrototypes SProcXkbGetMap(ClientPtr client) -#else -SProcXkbGetMap(client) - ClientPtr client; -#endif { register int n; @@ -317,12 +245,7 @@ register int n; } static int -#if NeedFunctionPrototypes SProcXkbSetMap(ClientPtr client) -#else -SProcXkbSetMap(client) - ClientPtr client; -#endif { register int n; @@ -341,12 +264,7 @@ register int n; static int -#if NeedFunctionPrototypes SProcXkbGetCompatMap(ClientPtr client) -#else -SProcXkbGetCompatMap(client) - ClientPtr client; -#endif { register int n; @@ -361,12 +279,7 @@ register int n; } static int -#if NeedFunctionPrototypes SProcXkbSetCompatMap(ClientPtr client) -#else -SProcXkbSetCompatMap(client) - ClientPtr client; -#endif { register int n; @@ -381,12 +294,7 @@ register int n; } static int -#if NeedFunctionPrototypes SProcXkbGetIndicatorState(ClientPtr client) -#else -SProcXkbGetIndicatorState(client) - ClientPtr client; -#endif { register int n; @@ -399,12 +307,7 @@ register int n; } static int -#if NeedFunctionPrototypes SProcXkbGetIndicatorMap(ClientPtr client) -#else -SProcXkbGetIndicatorMap(client) - ClientPtr client; -#endif { register int n; @@ -418,12 +321,7 @@ register int n; } static int -#if NeedFunctionPrototypes SProcXkbSetIndicatorMap(ClientPtr client) -#else -SProcXkbSetIndicatorMap(client) - ClientPtr client; -#endif { register int n; @@ -437,12 +335,7 @@ register int n; } static int -#if NeedFunctionPrototypes SProcXkbGetNamedIndicator(ClientPtr client) -#else -SProcXkbGetNamedIndicator(client) - ClientPtr client; -#endif { register int n; @@ -458,12 +351,7 @@ register int n; } static int -#if NeedFunctionPrototypes SProcXkbSetNamedIndicator(ClientPtr client) -#else -SProcXkbSetNamedIndicator(client) - ClientPtr client; -#endif { register int n; @@ -482,12 +370,7 @@ register int n; static int -#if NeedFunctionPrototypes SProcXkbGetNames(ClientPtr client) -#else -SProcXkbGetNames(client) - ClientPtr client; -#endif { register int n; @@ -501,12 +384,7 @@ register int n; } static int -#if NeedFunctionPrototypes SProcXkbSetNames(ClientPtr client) -#else -SProcXkbSetNames(client) - ClientPtr client; -#endif { register int n; @@ -523,12 +401,7 @@ register int n; } static int -#if NeedFunctionPrototypes SProcXkbGetGeometry(ClientPtr client) -#else -SProcXkbGetGeometry(client) - ClientPtr client; -#endif { register int n; @@ -542,12 +415,7 @@ register int n; } static int -#if NeedFunctionPrototypes SProcXkbSetGeometry(ClientPtr client) -#else -SProcXkbSetGeometry(client) - ClientPtr client; -#endif { register int n; @@ -567,12 +435,7 @@ register int n; } static int -#if NeedFunctionPrototypes SProcXkbPerClientFlags(ClientPtr client) -#else -SProcXkbPerClientFlags(client) - ClientPtr client; -#endif { register int n; @@ -590,12 +453,7 @@ register int n; } static int -#if NeedFunctionPrototypes SProcXkbListComponents(ClientPtr client) -#else -SProcXkbListComponents(client) - ClientPtr client; -#endif { register int n; @@ -609,12 +467,7 @@ register int n; } static int -#if NeedFunctionPrototypes SProcXkbGetKbdByName(ClientPtr client) -#else -SProcXkbGetKbdByName(client) - ClientPtr client; -#endif { register int n; @@ -629,12 +482,7 @@ register int n; } static int -#if NeedFunctionPrototypes SProcXkbGetDeviceInfo(ClientPtr client) -#else -SProcXkbGetDeviceInfo(client) - ClientPtr client; -#endif { register int n; @@ -650,12 +498,7 @@ register int n; } static int -#if NeedFunctionPrototypes SProcXkbSetDeviceInfo(ClientPtr client) -#else -SProcXkbSetDeviceInfo(client) - ClientPtr client; -#endif { register int n; @@ -670,12 +513,7 @@ register int n; } static int -#if NeedFunctionPrototypes SProcXkbSetDebuggingFlags(ClientPtr client) -#else -SProcXkbSetDebuggingFlags(client) - ClientPtr client; -#endif { register int n; @@ -692,12 +530,7 @@ register int n; } int -#if NeedFunctionPrototypes SProcXkbDispatch (ClientPtr client) -#else -SProcXkbDispatch (client) - ClientPtr client; -#endif { REQUEST(xReq); switch (stuff->data) diff --git a/xkb/xkbUtils.c b/xkb/xkbUtils.c index 7d81d0169..f3ba6bc17 100644 --- a/xkb/xkbUtils.c +++ b/xkb/xkbUtils.c @@ -24,7 +24,7 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/xkb/xkbUtils.c,v 3.13 2001/08/23 14:33:26 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/xkb/xkbUtils.c,v 3.17 2003/11/17 22:20:46 dawes Exp $ */ #include <stdio.h> #include <ctype.h> @@ -40,12 +40,13 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #define XKBSRV_NEED_FILE_FUNCS #include "XKBsrv.h" #include "extensions/XKBgeom.h" +#include "xkb.h" #ifdef MODE_SWITCH extern Bool noKME; /* defined in os/utils.c */ #endif - int XkbDisableLockActions = 0; +int XkbDisableLockActions = 0; /***====================================================================***/ @@ -60,13 +61,7 @@ extern Bool noKME; /* defined in os/utils.c */ /***====================================================================***/ DeviceIntPtr -#if NeedFunctionPrototypes _XkbLookupAnyDevice(int id,int *why_rtrn) -#else -_XkbLookupAnyDevice(id,why_rtrn) - int id; - int *why_rtrn; -#endif { DeviceIntPtr dev = NULL; @@ -90,13 +85,7 @@ DeviceIntPtr dev = NULL; } DeviceIntPtr -#if NeedFunctionPrototypes _XkbLookupKeyboard(int id,int *why_rtrn) -#else -_XkbLookupKeyboard(id,why_rtrn) - int id; - int *why_rtrn; -#endif { DeviceIntPtr dev = NULL; @@ -111,13 +100,7 @@ DeviceIntPtr dev = NULL; } DeviceIntPtr -#if NeedFunctionPrototypes _XkbLookupBellDevice(int id,int *why_rtrn) -#else -_XkbLookupBellDevice(id,why_rtrn) - int id; - int *why_rtrn; -#endif { DeviceIntPtr dev = NULL; @@ -132,13 +115,7 @@ DeviceIntPtr dev = NULL; } DeviceIntPtr -#if NeedFunctionPrototypes _XkbLookupLedDevice(int id,int *why_rtrn) -#else -_XkbLookupLedDevice(id,why_rtrn) - int id; - int *why_rtrn; -#endif { DeviceIntPtr dev = NULL; @@ -153,13 +130,7 @@ DeviceIntPtr dev = NULL; } DeviceIntPtr -#if NeedFunctionPrototypes _XkbLookupButtonDevice(int id,int *why_rtrn) -#else -_XkbLookupButtonDevice(id,why_rtrn) - int id; - int *why_rtrn; -#endif { DeviceIntPtr dev = NULL; @@ -174,14 +145,7 @@ DeviceIntPtr dev = NULL; } void -#if NeedFunctionPrototypes XkbSetActionKeyMods(XkbDescPtr xkb,XkbAction *act,unsigned mods) -#else -XkbSetActionKeyMods(xkb,act,mods) - XkbDescPtr xkb; - XkbAction * act; - unsigned mods; -#endif { register unsigned tmp; @@ -203,13 +167,7 @@ register unsigned tmp; } unsigned -#if NeedFunctionPrototypes XkbMaskForVMask(XkbDescPtr xkb,unsigned vmask) -#else -XkbMaskForVMask(xkb,vmask) - XkbDescPtr xkb; - unsigned vmask; -#endif { register int i,bit; register unsigned mask; @@ -223,20 +181,11 @@ register unsigned mask; Bool -#if NeedFunctionPrototypes XkbApplyVModChanges( XkbSrvInfoPtr xkbi, unsigned changed, XkbChangesPtr changes, unsigned * needChecksRtrn, XkbEventCausePtr cause) -#else -XkbApplyVModChanges(xkbi,changed,changes,needChecksRtrn,cause) - XkbSrvInfoPtr xkbi; - unsigned changed; - XkbChangesPtr changes; - unsigned * needChecksRtrn; - XkbEventCausePtr cause; -#endif { XkbDescPtr xkb; Bool check; @@ -270,20 +219,11 @@ register unsigned i,bit; /***====================================================================***/ -#if NeedFunctionPrototypes void XkbUpdateKeyTypesFromCore( DeviceIntPtr pXDev, KeyCode first, CARD8 num, XkbChangesPtr changes) -#else -void -XkbUpdateKeyTypesFromCore(pXDev,first,num,changes) - DeviceIntPtr pXDev; - KeyCode first; - CARD8 num; - XkbChangesPtr changes; -#endif { XkbDescPtr xkb; unsigned key,nG,explicit; @@ -344,18 +284,10 @@ generate a NewKeyboard notify here? } void -#if NeedFunctionPrototypes XkbUpdateDescActions( XkbDescPtr xkb, KeyCode first, CARD8 num, XkbChangesPtr changes) -#else -XkbUpdateDescActions(xkb,first,num,changes) - XkbDescPtr xkb; - KeyCode first; - CARD8 num; - XkbChangesPtr changes; -#endif { register unsigned key; @@ -410,7 +342,6 @@ register unsigned key; return; } -#if NeedFunctionPrototypes void XkbUpdateActions( DeviceIntPtr pXDev, KeyCode first, @@ -418,16 +349,6 @@ XkbUpdateActions( DeviceIntPtr pXDev, XkbChangesPtr changes, unsigned * needChecksRtrn, XkbEventCausePtr cause) -#else -void -XkbUpdateActions(pXDev,first,num,changes,needChecksRtrn,cause) - DeviceIntPtr pXDev; - KeyCode first; - CARD8 num; - XkbChangesPtr changes; - unsigned * needChecksRtrn; - XkbEventCausePtr cause; -#endif { XkbSrvInfoPtr xkbi; XkbDescPtr xkb; @@ -453,13 +374,7 @@ CARD8 * repeat; } void -#if NeedFunctionPrototypes XkbUpdateCoreDescription(DeviceIntPtr keybd,Bool resize) -#else -XkbUpdateCoreDescription(keybd,resize) - DeviceIntPtr keybd; - Bool resize; -#endif { register int key,tmp; int maxSymsPerKey,maxKeysPerMod; @@ -517,14 +432,19 @@ CARD8 keysPerMod[XkbNumModifiers]; nGroups= XkbKeyNumGroups(xkb,key); tmp= 0; if (nGroups>0) { - if ((w=XkbKeyGroupWidth(xkb,key,XkbGroup1Index))<2) + if ((w=XkbKeyGroupWidth(xkb,key,XkbGroup1Index))<=2) tmp+= 2; - else tmp+= w; + else tmp+= w + 2; } if (nGroups>1) { - if ((w=XkbKeyGroupWidth(xkb,key,XkbGroup2Index))<2) - tmp+= 2; - else tmp+= w; + if (tmp <= 2) { + if ((w=XkbKeyGroupWidth(xkb,key,XkbGroup2Index))<2) + tmp+= 2; + else tmp+= w; + } else { + if ((w=XkbKeyGroupWidth(xkb,key,XkbGroup2Index))>2) + tmp+= w - 2; + } } if (nGroups>2) tmp+= XkbKeyGroupWidth(xkb,key,XkbGroup3Index); @@ -613,12 +533,17 @@ CARD8 keysPerMod[XkbNumModifiers]; pXKB+= XkbKeyGroupsWidth(xkb,key); for (n=XkbGroup3Index;n<nGroups;n++) { register int s; - groupWidth= XkbKeyGroupWidth(xkb,key,XkbGroup2Index); + groupWidth= XkbKeyGroupWidth(xkb,key,n); for (s=0;s<groupWidth;s++) { pCore[nOut++]= pXKB[s]; } pXKB+= XkbKeyGroupsWidth(xkb,key); } + if (!pCore[2] && !pCore[3] && maxSymsPerKey >= 6 && + (pCore[4] || pCore[5])) { + pCore[2] = pCore[4]; + pCore[3] = pCore[5]; + } } if (keyc->modifierMap[key]!=0) { register unsigned bit,i,mask; @@ -642,14 +567,7 @@ CARD8 keysPerMod[XkbNumModifiers]; } void -#if NeedFunctionPrototypes XkbSetRepeatKeys(DeviceIntPtr pXDev,int key,int onoff) -#else -XkbSetRepeatKeys(pXDev,key,onoff) - DeviceIntPtr pXDev; - int key; - int onoff; -#endif { if (pXDev && pXDev->key && pXDev->key->xkbInfo) { xkbControlsNotify cn; @@ -672,22 +590,12 @@ XkbSetRepeatKeys(pXDev,key,onoff) return; } -#if NeedFunctionPrototypes void XkbApplyMappingChange( DeviceIntPtr kbd, CARD8 request, KeyCode firstKey, CARD8 num, ClientPtr client) -#else -void -XkbApplyMappingChange(kbd,request,firstKey,num,client) - DeviceIntPtr kbd; - CARD8 request; - KeyCode firstKey; - CARD8 num; - ClientPtr client; -#endif { XkbEventCauseRec cause; XkbChangesRec changes; @@ -725,13 +633,7 @@ unsigned check; } void -#if NeedFunctionPrototypes XkbDisableComputedAutoRepeats(DeviceIntPtr dev,unsigned key) -#else -XkbDisableComputedAutoRepeats(dev,key) - DeviceIntPtr dev; - unsigned key; -#endif { XkbSrvInfoPtr xkbi = dev->key->xkbInfo; xkbMapNotify mn; @@ -746,13 +648,7 @@ xkbMapNotify mn; } unsigned -#if NeedFunctionPrototypes XkbStateChangedFlags(XkbStatePtr old,XkbStatePtr new) -#else -XkbStateChangedFlags(old,new) - XkbStatePtr old; - XkbStatePtr new; -#endif { int changed; @@ -776,12 +672,7 @@ int changed; } void -#if NeedFunctionPrototypes XkbComputeCompatState(XkbSrvInfoPtr xkbi) -#else -XkbComputeCompatState(xkbi) - XkbSrvInfoPtr xkbi; -#endif { CARD16 grp_mask; XkbStatePtr state= &xkbi->state; @@ -799,13 +690,7 @@ XkbCompatMapPtr map; } unsigned -#if NeedFunctionPrototypes XkbAdjustGroup(int group,XkbControlsPtr ctrls) -#else -XkbAdjustGroup(group,ctrls) - int group; - XkbControlsPtr ctrls; -#endif { unsigned act; @@ -846,16 +731,11 @@ unsigned act; } void -#if NeedFunctionPrototypes XkbComputeDerivedState(XkbSrvInfoPtr xkbi) -#else -XkbComputeDerivedState(xkbi) - XkbSrvInfoPtr xkbi; -#endif { XkbStatePtr state= &xkbi->state; XkbControlsPtr ctrls= xkbi->desc->ctrls; -char grp; +unsigned char grp; state->mods= (state->base_mods|state->latched_mods); state->mods|= state->locked_mods; @@ -866,11 +746,11 @@ char grp; grp= state->locked_group; - if ((grp>=ctrls->num_groups) || (grp<0)) + if (grp>=ctrls->num_groups) state->locked_group= XkbAdjustGroup(grp,ctrls); grp= state->locked_group+state->base_group+state->latched_group; - if ((grp>=ctrls->num_groups) || (grp<0)) + if (grp>=ctrls->num_groups) state->group= XkbAdjustGroup(grp,ctrls); else state->group= grp; XkbComputeCompatState(xkbi); @@ -880,18 +760,10 @@ char grp; /***====================================================================***/ void -#if NeedFunctionPrototypes XkbCheckSecondaryEffects( XkbSrvInfoPtr xkbi, unsigned which, XkbChangesPtr changes, XkbEventCausePtr cause) -#else -XkbCheckSecondaryEffects(xkbi,which,changes,cause) - XkbSrvInfoPtr xkbi; - unsigned which; - XkbChangesPtr changes; - XkbEventCausePtr cause; -#endif { if (which&XkbStateNotifyMask) { XkbStateRec old; @@ -908,13 +780,7 @@ XkbCheckSecondaryEffects(xkbi,which,changes,cause) /***====================================================================***/ void -#if NeedFunctionPrototypes XkbSetPhysicalLockingKey(DeviceIntPtr dev,unsigned key) -#else -XkbSetPhysicalLockingKey(dev,key) - DeviceIntPtr dev; - unsigned key; -#endif { XkbDescPtr xkb; @@ -929,20 +795,11 @@ XkbDescPtr xkb; /***====================================================================***/ Bool -#if NeedFunctionPrototypes XkbEnableDisableControls( XkbSrvInfoPtr xkbi, unsigned long change, unsigned long newValues, XkbChangesPtr changes, XkbEventCausePtr cause) -#else -XkbEnableDisableControls(xkbi,change,newValues,changes,cause) - XkbSrvInfoPtr xkbi; - unsigned long change; - unsigned long newValues; - XkbChangesPtr changes; - XkbEventCausePtr cause; -#endif { XkbControlsPtr ctrls; unsigned old; @@ -987,14 +844,7 @@ XkbSrvLedInfoPtr sli; #define MAX_TOC 16 XkbGeometryPtr -#if NeedFunctionPrototypes XkbLookupNamedGeometry(DeviceIntPtr dev,Atom name,Bool *shouldFree) -#else -XkbLookupNamedGeometry(dev,name,shouldFree) - DeviceIntPtr dev; - Atom name; - Bool * shouldFree; -#endif { XkbSrvInfoPtr xkbi= dev->key->xkbInfo; XkbDescPtr xkb= xkbi->desc; @@ -1032,14 +882,7 @@ XkbDescPtr xkb= xkbi->desc; } void -#if NeedFunctionPrototypes XkbConvertCase(register KeySym sym, KeySym *lower, KeySym *upper) -#else -XkbConvertCase(sym, lower, upper) - register KeySym sym; - KeySym *lower; - KeySym *upper; -#endif { *lower = sym; *upper = sym; diff --git a/xkb/xkbconfig.c b/xkb/xkbconfig.c index c94b06feb..0e480b4df 100644 --- a/xkb/xkbconfig.c +++ b/xkb/xkbconfig.c @@ -24,7 +24,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/xkbfile/xkbconfig.c,v 3.7 2001/11/30 12:11:51 eich Exp $ */ +/* $XFree86: xc/lib/xkbfile/xkbconfig.c,v 3.8 2003/11/17 22:20:23 dawes Exp $ */ #include <stdio.h> #include <ctype.h> @@ -63,14 +63,7 @@ static char _XkbCF_rtrn[XKBCF_MAX_STR_LEN+1]; static int -#if NeedFunctionPrototypes ScanIdent(FILE *file,int ch,XkbCFScanResultPtr val_rtrn) -#else -ScanIdent(file,ch,val_rtrn) - FILE * file; - int ch; - XkbCFScanResultPtr val_rtrn; -#endif { register int i; char * str; @@ -87,14 +80,7 @@ char * str; } static int -#if NeedFunctionPrototypes ScanString(FILE *file,int quote,XkbCFScanResultPtr val_rtrn) -#else -ScanString(file,quote,val_rtrn) - FILE * file; - int quote; - XkbCFScanResultPtr val_rtrn; -#endif { int ch,nInBuf; @@ -153,14 +139,7 @@ int ch,nInBuf; } static int -#if NeedFunctionPrototypes ScanInteger(FILE *file,int ch,XkbCFScanResultPtr val_rtrn) -#else -ScanInteger(file,ch,val_rtrn) - FILE * file; - int ch; - XkbCFScanResultPtr val_rtrn; -#endif { int i; @@ -174,14 +153,7 @@ int i; } int -#if NeedFunctionPrototypes XkbCFScan(FILE *file,XkbCFScanResultPtr val_rtrn,XkbConfigRtrnPtr rtrn) -#else -XkbCFScan(file,val_rtrn,rtrn) - FILE * file; - XkbCFScanResultPtr val_rtrn; - XkbConfigRtrnPtr rtrn; -#endif { int ch; @@ -276,14 +248,7 @@ int ch; #define _XkbCF_InitialFeedback 37 static Bool -#if NeedFunctionPrototypes AddCtrlByName(XkbConfigRtrnPtr rtrn,char *name,unsigned long *ctrls_rtrn) -#else -AddCtrlByName(rtrn,name,ctrls_rtrn) - XkbConfigRtrnPtr rtrn; - char * name; - unsigned long * ctrls_rtrn; -#endif { if ((_XkbStrCaseCmp(name,"repeat")==0)|| (_XkbStrCaseCmp(name,"repeatkeys")==0)) @@ -320,16 +285,9 @@ AddCtrlByName(rtrn,name,ctrls_rtrn) } static Bool -#if NeedFunctionPrototypes AddAXTimeoutOptByName( XkbConfigRtrnPtr rtrn, char * name, unsigned short * opts_rtrn) -#else -AddAXTimeoutOptByName(rtrn,name,opts_rtrn) - XkbConfigRtrnPtr rtrn; - char * name; - unsigned short * opts_rtrn; -#endif { if (_XkbStrCaseCmp(name,"slowkeyspress")==0) *opts_rtrn= XkbAX_SKPressFBMask; @@ -363,20 +321,11 @@ AddAXTimeoutOptByName(rtrn,name,opts_rtrn) } XkbConfigUnboundModPtr -#if NeedFunctionPrototypes XkbCFAddModByName( XkbConfigRtrnPtr rtrn, int what, char * name, Bool merge, XkbConfigUnboundModPtr last) -#else -XkbCFAddModByName(rtrn,what,name,merge,last) - XkbConfigRtrnPtr rtrn; - int what; - char * name; - Bool merge; - XkbConfigUnboundModPtr last; -#endif { if (rtrn->num_unbound_mods>=rtrn->sz_unbound_mods) { rtrn->sz_unbound_mods+= 5; @@ -428,13 +377,7 @@ XkbCFAddModByName(rtrn,what,name,merge,last) } int -#if NeedFunctionPrototypes XkbCFBindMods(XkbConfigRtrnPtr rtrn,XkbDescPtr xkb) -#else -XkbCFBindMods(rtrn,xkb) - XkbConfigRtrnPtr rtrn; - XkbDescPtr xkb; -#endif { register int n,v; Atom name; @@ -468,14 +411,7 @@ int missing; } Bool -#if NeedFunctionPrototypes XkbCFApplyMods(XkbConfigRtrnPtr rtrn,int what,XkbConfigModInfoPtr info) -#else -XkbCFApplyMods(rtrn,what,info) - XkbConfigRtrnPtr rtrn; - int what; - XkbConfigModInfoPtr info; -#endif { register int n; XkbConfigUnboundModPtr mod; @@ -509,20 +445,11 @@ XkbConfigUnboundModPtr mod; /*ARGSUSED*/ static Bool -#if NeedFunctionPrototypes DefaultParser( FILE * file, XkbConfigFieldsPtr fields, XkbConfigFieldPtr field, XkbDescPtr xkb, XkbConfigRtrnPtr rtrn) -#else -DefaultParser(file,fields,field,xkb,rtrn) - FILE * file; - XkbConfigFieldsPtr fields; - XkbConfigFieldPtr field; - XkbDescPtr xkb; - XkbConfigRtrnPtr rtrn; -#endif { int tok; XkbCFScanResultRec val; @@ -930,12 +857,7 @@ BAILOUT: } static Bool -#if NeedFunctionPrototypes DefaultCleanUp(XkbConfigRtrnPtr rtrn) -#else -DefaultCleanUp(rtrn) - XkbConfigRtrnPtr rtrn; -#endif { if (rtrn->keymap) _XkbFree(rtrn->keymap); if (rtrn->keycodes) _XkbFree(rtrn->keycodes); @@ -964,13 +886,7 @@ DefaultCleanUp(rtrn) } static Bool -#if NeedFunctionPrototypes DefaultApplyNames(XkbConfigRtrnPtr rtrn,XkbDescPtr xkb) -#else -DefaultApplyNames(rtrn,xkb) - XkbConfigRtrnPtr rtrn; - XkbDescPtr xkb; -#endif { char *str; @@ -1010,13 +926,7 @@ char *str; } static Bool -#if NeedFunctionPrototypes DefaultApplyControls(XkbConfigRtrnPtr rtrn,XkbDescPtr xkb) -#else -DefaultApplyControls(rtrn,xkb) - XkbConfigRtrnPtr rtrn; - XkbDescPtr xkb; -#endif { unsigned on,off; XkbControlsPtr ctrls; @@ -1135,18 +1045,10 @@ unsigned int mask; /*ARGSUSED*/ static Bool -#if NeedFunctionPrototypes DefaultFinish( XkbConfigFieldsPtr fields, XkbDescPtr xkb, XkbConfigRtrnPtr rtrn, int what) -#else -DefaultFinish(fields,xkb,rtrn,what) - XkbConfigFieldsPtr fields; - XkbDescPtr xkb; - XkbConfigRtrnPtr rtrn; - int what; -#endif { if ((what==XkbCF_Destroy)||(what==XkbCF_CleanUp)) return DefaultCleanUp(rtrn); @@ -1239,12 +1141,7 @@ XkbConfigFieldsPtr XkbCFDflts= &_XkbCFDflts; /***====================================================================***/ XkbConfigFieldsPtr -#if NeedFunctionPrototypes XkbCFDup(XkbConfigFieldsPtr fields) -#else -XkbCFDup(fields) - XkbConfigFieldsPtr fields; -#endif { XkbConfigFieldsPtr pNew; @@ -1272,13 +1169,7 @@ XkbConfigFieldsPtr pNew; } XkbConfigFieldsPtr -#if NeedFunctionPrototypes XkbCFFree(XkbConfigFieldsPtr fields,Bool all) -#else -XkbCFFree(fields,all) - XkbConfigFieldsPtr fields; - Bool all; -#endif { XkbConfigFieldsPtr next; @@ -1299,16 +1190,9 @@ XkbConfigFieldsPtr next; } Bool -#if NeedFunctionPrototypes XkbCFApplyRtrnValues( XkbConfigRtrnPtr rtrn, XkbConfigFieldsPtr fields, XkbDescPtr xkb) -#else -XkbCFApplyRtrnValues(rtrn,fields,xkb) - XkbConfigRtrnPtr rtrn; - XkbConfigFieldsPtr fields; - XkbDescPtr xkb; -#endif { Bool ok; @@ -1322,16 +1206,9 @@ Bool ok; } XkbConfigRtrnPrivPtr -#if NeedFunctionPrototypes XkbCFAddPrivate( XkbConfigRtrnPtr rtrn, XkbConfigFieldsPtr fields, XPointer ptr) -#else -XkbCFAddPrivate(rtrn,fields,ptr) - XkbConfigRtrnPtr rtrn; - XkbConfigFieldsPtr fields; - XPointer ptr; -#endif { XkbConfigRtrnPrivPtr priv; @@ -1348,16 +1225,9 @@ XkbConfigRtrnPrivPtr priv; } void -#if NeedFunctionPrototypes XkbCFFreeRtrn( XkbConfigRtrnPtr rtrn, XkbConfigFieldsPtr fields, XkbDescPtr xkb) -#else -XkbCFFreeRtrn(rtrn,fields,xkb) - XkbConfigRtrnPtr rtrn; - XkbConfigFieldsPtr fields; - XkbDescPtr xkb; -#endif { XkbConfigRtrnPrivPtr tmp,next; @@ -1378,18 +1248,10 @@ XkbConfigRtrnPrivPtr tmp,next; } Bool -#if NeedFunctionPrototypes XkbCFParse( FILE * file, XkbConfigFieldsPtr fields, XkbDescPtr xkb, XkbConfigRtrnPtr rtrn) -#else -XkbCFParse(file,fields,xkb,rtrn) - FILE * file; - XkbConfigFieldsPtr fields; - XkbDescPtr xkb; - XkbConfigRtrnPtr rtrn; -#endif { int tok; XkbCFScanResultRec val; @@ -1440,15 +1302,7 @@ BAILOUT: /*ARGSUSED*/ void -#if NeedFunctionPrototypes XkbCFReportError(FILE *file,char *name,int error,int line) -#else -XkbCFReportError(file,name,error,line) - FILE * file; - char * name; - int error; - int line; -#endif { char * msg; diff --git a/xkb/xkbfmisc.c b/xkb/xkbfmisc.c index 8246390be..2a6d836aa 100644 --- a/xkb/xkbfmisc.c +++ b/xkb/xkbfmisc.c @@ -24,7 +24,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/xkbfile/xkbmisc.c,v 1.4 2002/12/20 20:18:35 paulo Exp $ */ +/* $XFree86: xc/lib/xkbfile/xkbmisc.c,v 1.8 2003/11/17 22:20:24 dawes Exp $ */ #include <stdio.h> #include <ctype.h> @@ -55,16 +55,12 @@ #define XKBSRV_NEED_FILE_FUNCS 1 #include "XKBsrv.h" #include <X11/extensions/XKBgeom.h> +#include "xkb.h" #endif unsigned -#if NeedFunctionPrototypes _XkbKSCheckCase(KeySym ks) -#else -_XkbKSCheckCase(ks) - KeySym ks; -#endif { unsigned set,rtrn; @@ -149,13 +145,7 @@ unsigned set,rtrn; /***===================================================================***/ int -#if NeedFunctionPrototypes _XkbStrCaseCmp(char *str1,char *str2) -#else -_XkbStrCaseCmp(str1,str2) - char * str1; - char * str2; -#endif { char buf1[512],buf2[512]; char c, *s; @@ -183,20 +173,11 @@ _XkbStrCaseCmp(str1,str2) /***===================================================================***/ Bool -#if NeedFunctionPrototypes XkbLookupGroupAndLevel( XkbDescPtr xkb, int key, int * mods_inout, int * grp_inout, int * lvl_rtrn) -#else -XkbLookupGroupAndLevel(xkb,key,mods_inout,grp_inout,lvl_rtrn) - XkbDescPtr xkb; - int key; - int * mods_inout; - int * grp_inout; - int * lvl_rtrn; -#endif { int nG,eG; @@ -262,14 +243,7 @@ int nG,eG; /***===================================================================***/ static Bool -#if NeedFunctionPrototypes XkbWriteSectionFromName(FILE *file,char *sectionName,char *name) -#else -XkbWriteSectionFromName(file,sectionName,name) - FILE * file; - char * sectionName; - char * name; -#endif { fprintf(file," xkb_%-20s { include \"%s\" };\n",sectionName,name); return True; @@ -280,45 +254,25 @@ XkbWriteSectionFromName(file,sectionName,name) /* ARGSUSED */ static void -#if NeedFunctionPrototypes _AddIncl( FILE * file, XkbFileInfo * result, Bool topLevel, Bool showImplicit, int index, void * priv) -#else -_AddIncl(file,result,topLevel,showImplicit,index,priv) - FILE * file; - XkbFileInfo * result; - Bool topLevel; - Bool showImplicit; - int index; - void * priv; -#endif { - if ((priv)&&(strcmp(priv,"%")!=0)) + if ((priv)&&(strcmp((char *)priv,"%")!=0)) fprintf(file," include \"%s\"\n",(char *)priv); return; } Bool -#if NeedFunctionPrototypes XkbWriteXKBKeymapForNames( FILE * file, XkbComponentNamesPtr names, Display * dpy, XkbDescPtr xkb, unsigned want, unsigned need) -#else -XkbWriteXKBKeymapForNames(file,names,dpy,xkb,want,need) - FILE * file; - XkbComponentNamesPtr names; - Display * dpy; - XkbDescPtr xkb; - unsigned want; - unsigned need; -#endif { char * name,*tmp; unsigned complete; @@ -503,13 +457,7 @@ XkbFileInfo finfo; /*ARGSUSED*/ Status -#if NeedFunctionPrototypes XkbMergeFile(XkbDescPtr xkb,XkbFileInfo finfo) -#else -XkbMergeFile(xkb,finfo) - XkbDescPtr xkb; - XkbFileInfo *finfo; -#endif { return BadImplementation; } @@ -517,14 +465,7 @@ XkbMergeFile(xkb,finfo) /***====================================================================***/ int -#if NeedFunctionPrototypes XkbFindKeycodeByName(XkbDescPtr xkb,char *name,Bool use_aliases) -#else -XkbFindKeycodeByName(xkb,name,use_aliases) - XkbDescPtr xkb; - char * name; - Bool use_aliases; -#endif { register int i; @@ -557,13 +498,7 @@ register int i; unsigned -#if NeedFunctionPrototypes XkbConvertGetByNameComponents(Bool toXkm,unsigned orig) -#else -XkbConvertGetByNameComponents(toXkm,orig) - Bool toXkm; - unsigned orig; -#endif { unsigned rtrn; @@ -589,13 +524,7 @@ unsigned rtrn; } unsigned -#if NeedFunctionPrototypes XkbConvertXkbComponents(Bool toXkm,unsigned orig) -#else -XkbConvertXkbComponents(toXkm,orig) - Bool toXkm; - unsigned orig; -#endif { unsigned rtrn; @@ -623,14 +552,7 @@ unsigned rtrn; } Bool -#if NeedFunctionPrototypes XkbDetermineFileType(XkbFileInfoPtr finfo,int format,int *opts_missing) -#else -XkbDetermineFileType(finfo,format,opts_missing) - XkbFileInfoPtr finfo; - int format; - int * opts_missing; -#endif { unsigned present; XkbDescPtr xkb; @@ -715,12 +637,7 @@ static unsigned char componentSpecLegal[] = { }; void -#if NeedFunctionPrototypes XkbEnsureSafeMapName(char *name) -#else -XkbEnsureSafeMapName(name) - char *name; -#endif { if (name==NULL) return; @@ -737,13 +654,7 @@ XkbEnsureSafeMapName(name) #define UNMATCHABLE(c) (((c)=='(')||((c)==')')||((c)=='/')) Bool -#if NeedFunctionPrototypes XkbNameMatchesPattern(char *name,char *ptrn) -#else -XkbNameMatchesPattern(name,ptrn) - char * name; - char * ptrn; -#endif { while (ptrn[0]!='\0') { if (name[0]=='\0') { diff --git a/xkb/xkbout.c b/xkb/xkbout.c index fd7603b03..d688aca01 100644 --- a/xkb/xkbout.c +++ b/xkb/xkbout.c @@ -24,7 +24,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/xkbfile/xkbout.c,v 3.9 2001/10/28 03:32:47 tsi Exp $ */ +/* $XFree86: xc/lib/xkbfile/xkbout.c,v 3.10 2003/11/17 22:20:24 dawes Exp $ */ #include <stdio.h> #include <ctype.h> @@ -63,15 +63,7 @@ #define VMOD_COMMENT_VALUE 2 static Bool -#if NeedFunctionPrototypes WriteXKBVModDecl(FILE *file,Display *dpy,XkbDescPtr xkb,int showValue) -#else -WriteXKBVModDecl(file,dpy,xkb,showValue) - FILE * file; - Display * dpy; - XkbDescPtr xkb; - int showValue; -#endif { register int i,nMods; Atom * vmodNames; @@ -109,14 +101,7 @@ Atom * vmodNames; /***====================================================================***/ static Bool -#if NeedFunctionPrototypes WriteXKBAction(FILE *file,XkbFileInfo *result,XkbAnyAction *action) -#else -WriteXKBAction(file,result,action) - FILE * file; - XkbFileInfo * result; - XkbAnyAction * action; -#endif { XkbDescPtr xkb; Display * dpy; @@ -130,22 +115,12 @@ Display * dpy; /***====================================================================***/ Bool -#if NeedFunctionPrototypes XkbWriteXKBKeycodes( FILE * file, XkbFileInfo * result, Bool topLevel, Bool showImplicit, XkbFileAddOnFunc addOn, void * priv) -#else -XkbWriteXKBKeycodes(file,result,topLevel,showImplicit,addOn,priv) - FILE * file; - XkbFileInfo * result; - Bool topLevel; - Bool showImplicit; - XkbFileAddOnFunc addOn; - void * priv; -#endif { Atom kcName; register unsigned i; @@ -204,22 +179,12 @@ char * alternate; } Bool -#if NeedFunctionPrototypes XkbWriteXKBKeyTypes( FILE * file, XkbFileInfo * result, Bool topLevel, Bool showImplicit, XkbFileAddOnFunc addOn, void * priv) -#else -XkbWriteXKBKeyTypes(file,result,topLevel,showImplicit,addOn,priv) - FILE * file; - XkbFileInfo * result; - Bool topLevel; - Bool showImplicit; - XkbFileAddOnFunc addOn; - void * priv; -#endif { Display * dpy; register unsigned i,n; @@ -284,22 +249,12 @@ XkbDescPtr xkb; } static Bool -#if NeedFunctionPrototypes WriteXKBIndicatorMap( FILE * file, XkbFileInfo * result, Atom name, XkbIndicatorMapPtr led, XkbFileAddOnFunc addOn, void * priv) -#else -WriteXKBIndicatorMap(file,result,name,led,addOn,priv) - FILE * file; - XkbFileInfo * result; - Atom name; - XkbIndicatorMapPtr led; - XkbFileAddOnFunc addOn; - void * priv; -#endif { XkbDescPtr xkb; @@ -337,22 +292,12 @@ XkbDescPtr xkb; } Bool -#if NeedFunctionPrototypes XkbWriteXKBCompatMap( FILE * file, XkbFileInfo * result, Bool topLevel, Bool showImplicit, XkbFileAddOnFunc addOn, void * priv) -#else -XkbWriteXKBCompatMap(file,result,topLevel,showImplicit,addOn,priv) - FILE * file; - XkbFileInfo * result; - Bool topLevel; - Bool showImplicit; - XkbFileAddOnFunc addOn; - void * priv; -#endif { Display * dpy; register unsigned i; @@ -426,22 +371,12 @@ XkbDescPtr xkb; } Bool -#if NeedFunctionPrototypes XkbWriteXKBSymbols( FILE * file, XkbFileInfo * result, Bool topLevel, Bool showImplicit, XkbFileAddOnFunc addOn, void * priv) -#else -XkbWriteXKBSymbols(file,result,topLevel,showImplicit,addOn,priv) - FILE * file; - XkbFileInfo * result; - Bool topLevel; - Bool showImplicit; - XkbFileAddOnFunc addOn; - void * priv; -#endif { Display * dpy; register unsigned i,tmp; @@ -638,22 +573,12 @@ Bool showActions; } static Bool -#if NeedFunctionPrototypes WriteXKBOutline( FILE * file, XkbShapePtr shape, XkbOutlinePtr outline, int lastRadius, int first, int indent) -#else -WriteXKBOutline(file,shape,outline,lastRadius,first,indent) - FILE * file; - XkbShapePtr shape; - XkbOutlinePtr outline; - int lastRadius; - int first; - int indent; -#endif { register int i; XkbPointPtr pt; @@ -688,20 +613,11 @@ char * iStr; } static Bool -#if NeedFunctionPrototypes WriteXKBDoodad( FILE * file, Display * dpy, unsigned indent, XkbGeometryPtr geom, XkbDoodadPtr doodad) -#else -WriteXKBDoodad(file,dpy,indent,geom,doodad) - FILE * file; - Display * dpy; - unsigned indent; - XkbGeometryPtr geom; - XkbDoodadPtr doodad; -#endif { register char * i_str; XkbShapePtr shape; @@ -789,20 +705,11 @@ XkbColorPtr color; /*ARGSUSED*/ static Bool -#if NeedFunctionPrototypes WriteXKBOverlay( FILE * file, Display * dpy, unsigned indent, XkbGeometryPtr geom, XkbOverlayPtr ol) -#else -WriteXKBOverlay(file,dpy,indent,geom,ol) - FILE * file; - Display * dpy; - unsigned indent; - XkbGeometryPtr geom; - XkbOverlayPtr ol; -#endif { register char * i_str; int r,k,nOut; @@ -833,18 +740,10 @@ XkbOverlayKeyPtr key; } static Bool -#if NeedFunctionPrototypes WriteXKBSection( FILE * file, Display * dpy, XkbSectionPtr s, XkbGeometryPtr geom) -#else -WriteXKBSection(file,dpy,s,geom) - FILE * file; - Display * dpy; - XkbSectionPtr s; - XkbGeometryPtr geom; -#endif { register int i; XkbRowPtr row; @@ -930,22 +829,12 @@ int dfltKeyColor = 0; } Bool -#if NeedFunctionPrototypes XkbWriteXKBGeometry( FILE * file, XkbFileInfo * result, Bool topLevel, Bool showImplicit, XkbFileAddOnFunc addOn, void * priv) -#else -XkbWriteXKBGeometry(file,result,topLevel,showImplicit,addOn,priv) - FILE * file; - XkbFileInfo * result; - Bool topLevel; - Bool showImplicit; - XkbFileAddOnFunc addOn; - void * priv; -#endif { Display * dpy; register unsigned i,n; @@ -1048,22 +937,12 @@ XkbGeometryPtr geom; /*ARGSUSED*/ Bool -#if NeedFunctionPrototypes XkbWriteXKBSemantics( FILE * file, XkbFileInfo * result, Bool topLevel, Bool showImplicit, XkbFileAddOnFunc addOn, void * priv) -#else -XkbWriteXKBSemantics(file,result,topLevel,showImplicit,addOn,priv) - FILE * file; - XkbFileInfo * result; - Bool topLevel; - Bool showImplicit; - XkbFileAddOnFunc addOn; - void * priv; -#endif { Bool ok; @@ -1076,22 +955,12 @@ Bool ok; /*ARGSUSED*/ Bool -#if NeedFunctionPrototypes XkbWriteXKBLayout( FILE * file, XkbFileInfo * result, Bool topLevel, Bool showImplicit, XkbFileAddOnFunc addOn, void * priv) -#else -XkbWriteXKBLayout(file,result,topLevel,showImplicit,addOn,priv) - FILE * file; - XkbFileInfo * result; - Bool topLevel; - Bool showImplicit; - XkbFileAddOnFunc addOn; - void * priv; -#endif { Bool ok; XkbDescPtr xkb; @@ -1109,22 +978,12 @@ XkbDescPtr xkb; /*ARGSUSED*/ Bool -#if NeedFunctionPrototypes XkbWriteXKBKeymap( FILE * file, XkbFileInfo * result, Bool topLevel, Bool showImplicit, XkbFileAddOnFunc addOn, void * priv) -#else -XkbWriteXKBKeymap(file,result,topLevel,showImplicit,addOn,priv) - FILE * file; - XkbFileInfo * result; - Bool topLevel; - Bool showImplicit; - XkbFileAddOnFunc addOn; - void * priv; -#endif { Bool ok; XkbDescPtr xkb; @@ -1142,31 +1001,20 @@ XkbDescPtr xkb; } Bool -#if NeedFunctionPrototypes XkbWriteXKBFile( FILE * out, XkbFileInfo * result, Bool showImplicit, XkbFileAddOnFunc addOn, void * priv) -#else -XkbWriteXKBFile(out,result,showImplicit,addOn,priv) - FILE * out; - XkbFileInfo * result; - Bool showImplicit; - XkbFileAddOnFunc addOn; - void * priv; -#endif { Bool ok = False; Bool (*func)( -#if NeedFunctionPrototypes FILE * /* file */, XkbFileInfo * /* result */, Bool /* topLevel */, Bool /* showImplicit */, XkbFileAddOnFunc /* addOn */, void * /* priv */ -#endif ) = NULL; switch (result->type) { diff --git a/xkb/xkbtext.c b/xkb/xkbtext.c index d233af0b4..fc593e796 100644 --- a/xkb/xkbtext.c +++ b/xkb/xkbtext.c @@ -24,7 +24,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/xkbfile/xkbtext.c,v 3.11 2002/12/21 18:49:02 paulo Exp $ */ +/* $XFree86: xc/lib/xkbfile/xkbtext.c,v 3.12 2003/11/17 22:20:24 dawes Exp $ */ #include <stdio.h> #include <ctype.h> @@ -64,12 +64,7 @@ static char textBuffer[BUFFER_SIZE]; static int tbNext= 0; static char * -#if NeedFunctionPrototypes tbGetBuffer(unsigned size) -#else -tbGetBuffer(size) - unsigned size; -#endif { char *rtrn; @@ -85,14 +80,7 @@ char *rtrn; /***====================================================================***/ char * -#if NeedFunctionPrototypes XkbAtomText(Display *dpy,Atom atm,unsigned format) -#else -XkbAtomText(dpy,atm,format) - Display * dpy; - Atom atm; - unsigned format; -#endif { char *rtrn,*tmp; @@ -124,15 +112,7 @@ char *rtrn,*tmp; /***====================================================================***/ char * -#if NeedFunctionPrototypes XkbVModIndexText(Display *dpy,XkbDescPtr xkb,unsigned ndx,unsigned format) -#else -XkbVModIndexText(dpy,xkb,ndx,format) - Display * dpy; - XkbDescPtr xkb; - unsigned ndx; - unsigned format; -#endif { register int len; register Atom *vmodNames; @@ -166,20 +146,11 @@ char numBuf[20]; } char * -#if NeedFunctionPrototypes XkbVModMaskText( Display * dpy, XkbDescPtr xkb, unsigned modMask, unsigned mask, unsigned format) -#else -XkbVModMaskText(dpy,xkb,modMask,mask,format) - Display * dpy; - XkbDescPtr xkb; - unsigned modMask; - unsigned mask; - unsigned format; -#endif { register int i,bit; int len; @@ -258,13 +229,7 @@ static char *modNames[XkbNumModifiers] = { }; char * -#if NeedFunctionPrototypes XkbModIndexText(unsigned ndx,unsigned format) -#else -XkbModIndexText(ndx,format) - unsigned ndx; - unsigned format; -#endif { char * rtrn; char buf[100]; @@ -289,13 +254,7 @@ char buf[100]; } char * -#if NeedFunctionPrototypes XkbModMaskText(unsigned mask,unsigned format) -#else -XkbModMaskText(mask,format) - unsigned mask; - unsigned format; -#endif { register int i,bit; char buf[64],*rtrn; @@ -335,13 +294,7 @@ char buf[64],*rtrn; /*ARGSUSED*/ char * -#if NeedFunctionPrototypes XkbConfigText(unsigned config,unsigned format) -#else -XkbConfigText(config,format) - unsigned config; - unsigned format; -#endif { static char *buf; @@ -388,13 +341,7 @@ static char *buf; /***====================================================================***/ char * -#if NeedFunctionPrototypes XkbKeysymText(KeySym sym,unsigned format) -#else -XkbKeysymText(sym,format) - KeySym sym; - unsigned format; -#endif { static char buf[32],*rtrn; @@ -417,13 +364,7 @@ static char buf[32],*rtrn; } char * -#if NeedFunctionPrototypes XkbKeyNameText(char *name,unsigned format) -#else -XkbKeyNameText(name,format) - char * name; - unsigned format; -#endif { char *buf; @@ -452,13 +393,7 @@ static char *siMatchText[5] = { }; char * -#if NeedFunctionPrototypes XkbSIMatchText(unsigned type,unsigned format) -#else -XkbSIMatchText(type,format) - unsigned type; - unsigned format; -#endif { static char buf[40]; char *rtrn; @@ -492,13 +427,7 @@ static char *imWhichNames[]= { }; char * -#if NeedFunctionPrototypes XkbIMWhichStateMaskText(unsigned use_which,unsigned format) -#else -XkbIMWhichStateMaskText(use_which,format) - unsigned use_which; - unsigned format; -#endif { int len; unsigned i,bit,tmp; @@ -541,13 +470,7 @@ char * buf; } char * -#if NeedFunctionPrototypes XkbAccessXDetailText(unsigned state,unsigned format) -#else -XkbAccessXDetailText(state,format) - unsigned state; - unsigned format; -#endif { char *buf,*prefix; @@ -573,13 +496,7 @@ static char *nknNames[] = { #define NUM_NKN (sizeof(nknNames)/sizeof(char *)) char * -#if NeedFunctionPrototypes XkbNKNDetailMaskText(unsigned detail,unsigned format) -#else -XkbNKNDetailMaskText(detail,format) - unsigned detail; - unsigned format; -#endif { char *buf,*prefix,*suffix; register int i; @@ -663,13 +580,7 @@ static char *ctrlNames[] = { }; char * -#if NeedFunctionPrototypes XkbControlsMaskText(unsigned ctrls,unsigned format) -#else -XkbControlsMaskText(ctrls,format) - unsigned ctrls; - unsigned format; -#endif { int len; unsigned i,bit,tmp; @@ -716,13 +627,7 @@ char * buf; /***====================================================================***/ char * -#if NeedFunctionPrototypes XkbStringText(char *str,unsigned format) -#else -XkbStringText(str,format) - char * str; - unsigned format; -#endif { char * buf; register char *in,*out; @@ -782,13 +687,7 @@ Bool ok; /***====================================================================***/ char * -#if NeedFunctionPrototypes XkbGeomFPText(int val,unsigned format) -#else -XkbGeomFPText(val,format) - int val; - unsigned format; -#endif { int whole,frac; char * buf; @@ -808,13 +707,7 @@ char * buf; } char * -#if NeedFunctionPrototypes XkbDoodadTypeText(unsigned type,unsigned format) -#else -XkbDoodadTypeText(type,format) - unsigned type; - unsigned format; -#endif { char * buf; if (format==XkbCFile) { @@ -854,13 +747,7 @@ static char *actionTypeNames[XkbSA_NumActions]= { }; char * -#if NeedFunctionPrototypes XkbActionTypeText(unsigned type,unsigned format) -#else -XkbActionTypeText(type,format) - unsigned type; - unsigned format; -#endif { static char buf[32]; char *rtrn; @@ -880,14 +767,7 @@ char *rtrn; /***====================================================================***/ static int -#if NeedFunctionPrototypes TryCopyStr(char *to,char *from,int *pLeft) -#else -TryCopyStr(to,from,pLeft) - char * to; - char * from; - int * pLeft; -#endif { register int len; if (*pLeft>0) { @@ -904,32 +784,14 @@ register int len; /*ARGSUSED*/ static Bool -#if NeedFunctionPrototypes CopyNoActionArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf,int*sz) -#else -CopyNoActionArgs(dpy,xkb,action,buf,sz) - Display * dpy; - XkbDescPtr xkb; - XkbAction * action; - char * buf; - int * sz; -#endif { return True; } static Bool -#if NeedFunctionPrototypes CopyModActionArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf, int* sz) -#else -CopyModActionArgs(dpy,xkb,action,buf,sz) - Display * dpy; - XkbDescPtr xkb; - XkbAction * action; - char * buf; - int * sz; -#endif { XkbModAction * act; unsigned tmp; @@ -956,17 +818,8 @@ unsigned tmp; /*ARGSUSED*/ static Bool -#if NeedFunctionPrototypes CopyGroupActionArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf, int *sz) -#else -CopyGroupActionArgs(dpy,xkb,action,buf,sz) - Display * dpy; - XkbDescPtr xkb; - XkbAction * action; - char * buf; - int * sz; -#endif { XkbGroupAction * act; char tbuf[32]; @@ -990,16 +843,7 @@ char tbuf[32]; /*ARGSUSED*/ static Bool -#if NeedFunctionPrototypes CopyMovePtrArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf,int *sz) -#else -CopyMovePtrArgs(dpy,xkb,action,buf,sz) - Display * dpy; - XkbDescPtr xkb; - XkbAction * action; - char * buf; - int * sz; -#endif { XkbPtrAction * act; int x,y; @@ -1024,16 +868,7 @@ char tbuf[32]; /*ARGSUSED*/ static Bool -#if NeedFunctionPrototypes CopyPtrBtnArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf,int *sz) -#else -CopyPtrBtnArgs(dpy,xkb,action,buf,sz) - Display * dpy; - XkbDescPtr xkb; - XkbAction * action; - char * buf; - int * sz; -#endif { XkbPtrBtnAction * act; char tbuf[32]; @@ -1067,17 +902,8 @@ char tbuf[32]; /*ARGSUSED*/ static Bool -#if NeedFunctionPrototypes CopySetPtrDfltArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf, int *sz) -#else -CopySetPtrDfltArgs(dpy,xkb,action,buf,sz) - Display * dpy; - XkbDescPtr xkb; - XkbAction * action; - char * buf; - int * sz; -#endif { XkbPtrDfltAction * act; char tbuf[32]; @@ -1094,16 +920,7 @@ char tbuf[32]; } static Bool -#if NeedFunctionPrototypes CopyISOLockArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf,int *sz) -#else -CopyISOLockArgs(dpy,xkb,action,buf,sz) - Display * dpy; - XkbDescPtr xkb; - XkbAction * action; - char * buf; - int * sz; -#endif { XkbISOAction * act; char tbuf[64]; @@ -1165,17 +982,8 @@ char tbuf[64]; /*ARGSUSED*/ static Bool -#if NeedFunctionPrototypes CopySwitchScreenArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf, int *sz) -#else -CopySwitchScreenArgs(dpy,xkb,action,buf,sz) - Display * dpy; - XkbDescPtr xkb; - XkbAction * action; - char * buf; - int * sz; -#endif { XkbSwitchScreenAction * act; char tbuf[32]; @@ -1193,17 +1001,8 @@ char tbuf[32]; /*ARGSUSED*/ static Bool -#if NeedFunctionPrototypes CopySetLockControlsArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action, char *buf,int *sz) -#else -CopySetLockControlsArgs(dpy,xkb,action,buf,sz) - Display * dpy; - XkbDescPtr xkb; - XkbAction * action; - char * buf; - int * sz; -#endif { XkbCtrlsAction * act; unsigned tmp; @@ -1289,17 +1088,8 @@ char tbuf[32]; /*ARGSUSED*/ static Bool -#if NeedFunctionPrototypes CopyActionMessageArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf, int *sz) -#else -CopyActionMessageArgs(dpy,xkb,action,buf,sz) - Display * dpy; - XkbDescPtr xkb; - XkbAction * action; - char * buf; - int * sz; -#endif { XkbMessageAction * act; unsigned all; @@ -1325,17 +1115,8 @@ char tbuf[32]; } static Bool -#if NeedFunctionPrototypes CopyRedirectKeyArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf, int *sz) -#else -CopyRedirectKeyArgs(dpy,xkb,action,buf,sz) - Display * dpy; - XkbDescPtr xkb; - XkbAction * action; - char * buf; - int * sz; -#endif { XkbRedirectKeyAction * act; char tbuf[32],*tmp; @@ -1381,17 +1162,8 @@ unsigned vmods,vmods_mask; /*ARGSUSED*/ static Bool -#if NeedFunctionPrototypes CopyDeviceBtnArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf, int *sz) -#else -CopyDeviceBtnArgs(dpy,xkb,action,buf,sz) - Display * dpy; - XkbDescPtr xkb; - XkbAction * action; - char * buf; - int * sz; -#endif { XkbDeviceBtnAction * act; char tbuf[32]; @@ -1423,16 +1195,7 @@ char tbuf[32]; /*ARGSUSED*/ static Bool -#if NeedFunctionPrototypes CopyOtherArgs(Display *dpy,XkbDescPtr xkb,XkbAction *action,char *buf,int *sz) -#else -CopyOtherArgs(dpy,xkb,action,buf,sz) - Display * dpy; - XkbDescPtr xkb; - XkbAction * action; - char * buf; - int * sz; -#endif { XkbAnyAction * act; char tbuf[32]; @@ -1450,13 +1213,11 @@ char tbuf[32]; } typedef Bool (*actionCopy)( -#if NeedFunctionPrototypes Display * /* dpy */, XkbDescPtr /* xkb */, XkbAction * /* action */, char * /* buf */, int* /* sz */ -#endif ); static actionCopy copyActionArgs[XkbSA_NumActions] = { CopyNoActionArgs /* NoAction */, @@ -1484,15 +1245,7 @@ static actionCopy copyActionArgs[XkbSA_NumActions] = { #define ACTION_SZ 256 char * -#if NeedFunctionPrototypes XkbActionText(Display *dpy,XkbDescPtr xkb,XkbAction *action,unsigned format) -#else -XkbActionText(dpy,xkb,action,format) - Display * dpy; - XkbDescPtr xkb; - XkbAction * action; - unsigned format; -#endif { char buf[ACTION_SZ],*tmp; int sz; @@ -1520,14 +1273,7 @@ int sz; } char * -#if NeedFunctionPrototypes XkbBehaviorText(XkbDescPtr xkb,XkbBehavior *behavior,unsigned format) -#else -XkbBehaviorText(xkb,behavior,format) - XkbDescPtr xkb; - XkbBehavior * behavior; - unsigned format; -#endif { char buf[256],*tmp; @@ -1584,12 +1330,7 @@ char buf[256],*tmp; /***====================================================================***/ char * -#if NeedFunctionPrototypes XkbIndentText(unsigned size) -#else -XkbIndentText(size) - unsigned size; -#endif { static char buf[32]; register int i; @@ -1611,13 +1352,7 @@ register int i; #define PIXEL_MAX 65535 Bool -#if NeedFunctionPrototypes XkbLookupCanonicalRGBColor(char *def,XColor *color) -#else -XkbLookupCanonicalRGBColor(def,color) - char * def; - XColor * color; -#endif { int tmp; diff --git a/xkb/xkmread.c b/xkb/xkmread.c index af6cc3eba..b7a08e267 100644 --- a/xkb/xkmread.c +++ b/xkb/xkmread.c @@ -24,7 +24,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/lib/xkbfile/xkmread.c,v 1.6 2002/02/13 22:09:42 herrb Exp $ */ +/* $XFree86: xc/lib/xkbfile/xkmread.c,v 1.7 2003/11/17 22:20:24 dawes Exp $ */ #include <stdio.h> @@ -57,14 +57,7 @@ #include "XKBgeom.h" Atom -#if NeedFunctionPrototypes XkbInternAtom(Display *dpy,char *str,Bool only_if_exists) -#else -XkbInternAtom(dpy,str,only_if_exists) - Display * dpy; - char * str; - Bool only_if_exists; -#endif { if (str==NULL) return None; @@ -78,12 +71,7 @@ XkbInternAtom(dpy,str,only_if_exists) #endif char * -#if NeedFunctionPrototypes _XkbDupString(char *str) -#else -_XkbDupString(str) - char *str; -#endif { char *new; @@ -98,15 +86,7 @@ char *new; /***====================================================================***/ static XPointer -#if NeedFunctionPrototypes XkmInsureSize(XPointer oldPtr,int oldCount,int *newCountRtrn,int elemSize) -#else -XkmInsureSize(oldPtr,oldCount,newCountRtrn,elemSize) - XPointer oldPtr; - int oldCount; - int * newCountRtrn; - int elemSize; -#endif { int newCount= *newCountRtrn; @@ -131,13 +111,7 @@ int newCount= *newCountRtrn; #define XkmInsureTypedSize(p,o,n,t) ((p)=((t *)XkmInsureSize((char *)(p),(o),(n),sizeof(t)))) static CARD8 -#if NeedFunctionPrototypes XkmGetCARD8(FILE *file,int *pNRead) -#else -XkmGetCARD8(file,pNRead) - FILE * file; - int * pNRead; -#endif { int tmp; tmp= getc(file); @@ -147,13 +121,7 @@ int tmp; } static CARD16 -#if NeedFunctionPrototypes XkmGetCARD16(FILE *file,int *pNRead) -#else -XkmGetCARD16(file,pNRead) - FILE * file; - int * pNRead; -#endif { CARD16 val; @@ -163,13 +131,7 @@ CARD16 val; } static CARD32 -#if NeedFunctionPrototypes XkmGetCARD32(FILE *file,int *pNRead) -#else -XkmGetCARD32(file,pNRead) - FILE * file; - int * pNRead; -#endif { CARD32 val; @@ -179,13 +141,7 @@ CARD32 val; } static int -#if NeedFunctionPrototypes XkmSkipPadding(FILE *file,unsigned pad) -#else -XkmSkipPadding(file,pad) - FILE * file; - unsigned pad; -#endif { register int i,nRead=0; @@ -197,14 +153,7 @@ register int i,nRead=0; } static int -#if NeedFunctionPrototypes XkmGetCountedString(FILE *file,char *str,int max_len) -#else -XkmGetCountedString(file,str,max_len) - FILE * file; - char * str; - int max_len; -#endif { int count,nRead=0; @@ -235,14 +184,7 @@ int count,nRead=0; /***====================================================================***/ static int -#if NeedFunctionPrototypes ReadXkmVirtualMods(FILE *file,XkbFileInfo *result,XkbChangesPtr changes) -#else -ReadXkmVirtualMods(file,result,changes) - FILE * file; - XkbFileInfo * result; - XkbChangesPtr changes; -#endif { register unsigned int i,bit; unsigned int bound,named,tmp; @@ -286,14 +228,7 @@ XkbDescPtr xkb; /***====================================================================***/ static int -#if NeedFunctionPrototypes ReadXkmKeycodes(FILE *file,XkbFileInfo *result,XkbChangesPtr changes) -#else -ReadXkmKeycodes(file,result,changes) - FILE * file; - XkbFileInfo * result; - XkbChangesPtr changes; -#endif { register int i; unsigned minKC,maxKC,nAl; @@ -360,14 +295,7 @@ XkbDescPtr xkb; /***====================================================================***/ static int -#if NeedFunctionPrototypes ReadXkmKeyTypes(FILE *file,XkbFileInfo *result,XkbChangesPtr changes) -#else -ReadXkmKeyTypes(file,result,changes) - FILE * file; - XkbFileInfo * result; - XkbChangesPtr changes; -#endif { register unsigned i,n; unsigned num_types; @@ -505,14 +433,7 @@ XkbDescPtr xkb; /***====================================================================***/ static int -#if NeedFunctionPrototypes ReadXkmCompatMap(FILE *file,XkbFileInfo *result,XkbChangesPtr changes) -#else -ReadXkmCompatMap(file,result,changes) - FILE * file; - XkbFileInfo * result; - XkbChangesPtr changes; -#endif { register int i; unsigned num_si,groups; @@ -590,14 +511,7 @@ XkbCompatMapPtr compat; } static int -#if NeedFunctionPrototypes ReadXkmIndicators(FILE *file,XkbFileInfo *result,XkbChangesPtr changes) -#else -ReadXkmIndicators(file,result,changes) - FILE * file; - XkbFileInfo * result; - XkbChangesPtr changes; -#endif { register unsigned nLEDs; xkmIndicatorMapDesc wire; @@ -654,15 +568,7 @@ XkbDescPtr xkb; } static XkbKeyTypePtr -#if NeedFunctionPrototypes FindTypeForKey(XkbDescPtr xkb,Atom name,unsigned width,KeySym *syms) -#else -FindTypeForKey(xkb,name,width,syms) - XkbDescPtr xkb; - Atom name; - unsigned width; - KeySym * syms; -#endif { if ((!xkb)||(!xkb->map)) return NULL; @@ -690,13 +596,7 @@ FindTypeForKey(xkb,name,width,syms) } static int -#if NeedFunctionPrototypes ReadXkmSymbols(FILE *file,XkbFileInfo *result) -#else -ReadXkmSymbols(file,result) - FILE * file; - XkbFileInfo * result; -#endif { register int i,g,s,totalVModMaps; xkmKeySymMapDesc wireMap; @@ -851,19 +751,11 @@ XkbDescPtr xkb; } static int -#if NeedFunctionPrototypes ReadXkmGeomDoodad( FILE * file, Display * dpy, XkbGeometryPtr geom, XkbSectionPtr section) -#else -ReadXkmGeomDoodad(file,dpy,geom,section) - FILE * file; - Display * dpy; - XkbGeometryPtr geom; - XkbSectionPtr section; -#endif { XkbDoodadPtr doodad; xkmDoodadDesc doodadWire; @@ -918,18 +810,10 @@ int nRead=0; } static int -#if NeedFunctionPrototypes ReadXkmGeomOverlay( FILE * file, Display * dpy, XkbGeometryPtr geom, XkbSectionPtr section) -#else -ReadXkmGeomOverlay(file,dpy,geom,section) - FILE * file; - Display * dpy; - XkbGeometryPtr geom; - XkbSectionPtr section; -#endif { char buf[100]; unsigned tmp; @@ -969,16 +853,9 @@ register int r; } static int -#if NeedFunctionPrototypes ReadXkmGeomSection( FILE * file, Display * dpy, XkbGeometryPtr geom) -#else -ReadXkmGeomSection(file,dpy,geom) - FILE * file; - Display * dpy; - XkbGeometryPtr geom; -#endif { register int i; XkbSectionPtr section; @@ -1058,13 +935,7 @@ Atom nameAtom; } static int -#if NeedFunctionPrototypes ReadXkmGeometry(FILE *file,XkbFileInfo *result) -#else -ReadXkmGeometry(file,result) - FILE * file; - XkbFileInfo * result; -#endif { register int i; char buf[100]; @@ -1192,12 +1063,7 @@ XkbGeometrySizesRec sizes; } Bool -#if NeedFunctionPrototypes XkmProbe(FILE *file) -#else -XkmProbe(file) - FILE * file; -#endif { unsigned hdr,tmp; int nRead=0; @@ -1214,15 +1080,7 @@ int nRead=0; } Bool -#if NeedFunctionPrototypes XkmReadTOC(FILE *file,xkmFileInfo* file_info,int max_toc,xkmSectionInfo *toc) -#else -XkmReadTOC(file,file_info,max_toc,toc) - FILE * file; - xkmFileInfo * file_info; - int max_toc; - xkmSectionInfo * toc; -#endif { unsigned hdr,tmp; int nRead=0; @@ -1255,14 +1113,7 @@ unsigned i,size_toc; } xkmSectionInfo * -#if NeedFunctionPrototypes XkmFindTOCEntry(xkmFileInfo *finfo,xkmSectionInfo *toc,unsigned type) -#else -XkmFindTOCEntry(finfo,toc,type) - xkmFileInfo * finfo; - xkmSectionInfo * toc; - unsigned type; -#endif { register int i; @@ -1274,18 +1125,10 @@ register int i; } Bool -#if NeedFunctionPrototypes XkmReadFileSection( FILE * file, xkmSectionInfo * toc, XkbFileInfo * result, unsigned * loaded_rtrn) -#else -XkmReadFileSection(file,toc,result,loaded_rtrn) - FILE * file; - xkmSectionInfo * toc; - XkbFileInfo * result; - unsigned * loaded_rtrn; -#endif { xkmSectionInfo tmpTOC; int nRead; @@ -1353,13 +1196,7 @@ int nRead; } char * -#if NeedFunctionPrototypes XkmReadFileSectionName(FILE *file,xkmSectionInfo *toc) -#else -XkmReadFileSectionName(file,toc) - FILE * file; - xkmSectionInfo * toc; -#endif { xkmSectionInfo tmpTOC; char name[100]; @@ -1397,15 +1234,7 @@ char name[100]; #define MAX_TOC 16 unsigned -#if NeedFunctionPrototypes XkmReadFile(FILE *file,unsigned need,unsigned want,XkbFileInfo *result) -#else -XkmReadFile(file,need,want,result) - FILE * file; - unsigned need; - unsigned want; - XkbFileInfo * result; -#endif { register unsigned i; xkmSectionInfo toc[MAX_TOC],tmpTOC; |