summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChGC.c7
-rw-r--r--src/ChProp.c13
-rw-r--r--src/ChWAttrs.c4
-rw-r--r--src/ChkIfEv.c3
-rw-r--r--src/ClDisplay.c14
-rw-r--r--src/Cmap.h11
-rw-r--r--src/ConnDis.c106
-rw-r--r--src/Context.c10
-rw-r--r--src/Cr.h28
-rw-r--r--src/CrBFData.c9
-rw-r--r--src/CrCmap.c5
-rw-r--r--src/CrGC.c17
-rw-r--r--src/CrGlCur.c5
-rw-r--r--src/DisName.c11
-rw-r--r--src/ErrDes.c30
-rw-r--r--src/ErrHndlr.c24
-rw-r--r--src/FSWrap.c30
-rw-r--r--src/Font.c36
-rw-r--r--src/FontInfo.c13
-rw-r--r--src/FontNames.c13
-rw-r--r--src/FreeCmap.c12
-rw-r--r--src/Geom.c16
-rw-r--r--src/GetColor.c26
-rw-r--r--src/GetDflt.c24
-rw-r--r--src/GetImage.c11
-rw-r--r--src/GetPntMap.c13
-rw-r--r--src/GetWAttrs.c13
-rw-r--r--src/IfEvent.c4
-rw-r--r--src/ImText.c12
-rw-r--r--src/ImText16.c12
-rw-r--r--src/ImUtil.c57
-rw-r--r--src/InitExt.c14
-rw-r--r--src/IntAtom.c12
-rw-r--r--src/Key.h18
-rw-r--r--src/KeyBind.c537
-rw-r--r--src/KeysymStr.c19
-rw-r--r--src/LoadFont.c11
-rw-r--r--src/LockDis.c17
-rw-r--r--src/LookupCol.c17
-rw-r--r--src/Macros.c37
-rw-r--r--src/ModMap.c18
-rw-r--r--src/OMWrap.c10
-rw-r--r--src/OpenDis.c124
-rw-r--r--src/ParseCmd.c15
-rw-r--r--src/ParseCol.c15
-rw-r--r--src/ParseGeom.c12
-rw-r--r--src/PeekIfEv.c4
-rw-r--r--src/PolyReg.c54
-rw-r--r--src/PutImage.c219
-rw-r--r--src/QuExt.c13
-rw-r--r--src/QuTextE16.c14
-rw-r--r--src/QuTextExt.c14
-rw-r--r--src/Quarks.c33
-rw-r--r--src/RdBitF.c32
-rw-r--r--src/Region.c318
-rw-r--r--src/RegstFlt.c49
-rw-r--r--src/SendEvent.c7
-rw-r--r--src/SetCRects.c17
-rw-r--r--src/SetDashes.c11
-rw-r--r--src/SetHints.c14
-rw-r--r--src/SetLocale.c18
-rw-r--r--src/SetPntMap.c12
-rw-r--r--src/StBytes.c17
-rw-r--r--src/StNColor.c15
-rw-r--r--src/StName.c16
-rw-r--r--src/StrKeysym.c19
-rw-r--r--src/Synchro.c32
-rw-r--r--src/Text.c12
-rw-r--r--src/Text16.c12
-rw-r--r--src/TextExt.c31
-rw-r--r--src/TextExt16.c31
-rw-r--r--src/WMGeom.c27
-rw-r--r--src/Window.c12
-rw-r--r--src/WrBitF.c20
-rw-r--r--src/Xintconn.h11
-rw-r--r--src/XlibInt.c497
-rw-r--r--src/XomGeneric.h148
-rw-r--r--src/Xresinternal.h15
-rw-r--r--src/Xrm.c471
-rw-r--r--src/imConv.c33
-rw-r--r--src/locking.c105
-rw-r--r--src/locking.h24
-rw-r--r--src/xcms/AddDIC.c11
-rw-r--r--src/xcms/AddSF.c14
-rw-r--r--src/xcms/CCC.c11
-rw-r--r--src/xcms/Cv.h190
-rw-r--r--src/xcms/CvColW.c24
-rw-r--r--src/xcms/CvCols.c113
-rw-r--r--src/xcms/HVC.c41
-rw-r--r--src/xcms/HVCGcC.c12
-rw-r--r--src/xcms/HVCGcV.c19
-rw-r--r--src/xcms/HVCGcVC.c17
-rw-r--r--src/xcms/HVCMnV.c9
-rw-r--r--src/xcms/HVCMxC.c15
-rw-r--r--src/xcms/HVCMxV.c14
-rw-r--r--src/xcms/HVCMxVC.c24
-rw-r--r--src/xcms/HVCMxVs.c13
-rw-r--r--src/xcms/HVCWpAj.c8
-rw-r--r--src/xcms/IdOfPr.c9
-rw-r--r--src/xcms/LRGB.c201
-rw-r--r--src/xcms/Lab.c28
-rw-r--r--src/xcms/LabGcC.c5
-rw-r--r--src/xcms/LabGcL.c11
-rw-r--r--src/xcms/LabGcLC.c14
-rw-r--r--src/xcms/LabMnL.c11
-rw-r--r--src/xcms/LabMxC.c11
-rw-r--r--src/xcms/LabMxL.c11
-rw-r--r--src/xcms/LabMxLC.c23
-rw-r--r--src/xcms/LabWpAj.c4
-rw-r--r--src/xcms/Luv.c29
-rw-r--r--src/xcms/LuvGcC.c8
-rw-r--r--src/xcms/LuvGcL.c11
-rw-r--r--src/xcms/LuvGcLC.c14
-rw-r--r--src/xcms/LuvMnL.c11
-rw-r--r--src/xcms/LuvMxC.c10
-rw-r--r--src/xcms/LuvMxL.c11
-rw-r--r--src/xcms/LuvMxLC.c23
-rw-r--r--src/xcms/LuvWpAj.c8
-rw-r--r--src/xcms/PrOfId.c8
-rw-r--r--src/xcms/QuCol.c12
-rw-r--r--src/xcms/QuCols.c10
-rw-r--r--src/xcms/SetCCC.c15
-rw-r--r--src/xcms/SetGetCols.c181
-rw-r--r--src/xcms/StCol.c12
-rw-r--r--src/xcms/StCols.c8
-rw-r--r--src/xcms/UNDEFINED.c42
-rw-r--r--src/xcms/XRGB.c39
-rw-r--r--src/xcms/XYZ.c26
-rw-r--r--src/xcms/Xcmsint.h26
-rw-r--r--src/xcms/cmsAllCol.c10
-rw-r--r--src/xcms/cmsAllNCol.c24
-rw-r--r--src/xcms/cmsCmap.c30
-rw-r--r--src/xcms/cmsColNm.c96
-rw-r--r--src/xcms/cmsGlobls.c40
-rw-r--r--src/xcms/cmsInt.c60
-rw-r--r--src/xcms/cmsLkCol.c26
-rw-r--r--src/xcms/cmsProp.c26
-rw-r--r--src/xcms/cmsTrig.c48
-rw-r--r--src/xcms/uvY.c29
-rw-r--r--src/xcms/xyY.c29
-rw-r--r--src/xkb/XKB.c165
-rw-r--r--src/xkb/XKBAlloc.c92
-rw-r--r--src/xkb/XKBBell.c54
-rw-r--r--src/xkb/XKBBind.c186
-rw-r--r--src/xkb/XKBCompat.c31
-rw-r--r--src/xkb/XKBCtrls.c76
-rw-r--r--src/xkb/XKBCvt.c43
-rw-r--r--src/xkb/XKBExtDev.c138
-rw-r--r--src/xkb/XKBGAlloc.c365
-rw-r--r--src/xkb/XKBGeom.c119
-rw-r--r--src/xkb/XKBGetByName.c18
-rw-r--r--src/xkb/XKBGetMap.c162
-rw-r--r--src/xkb/XKBList.c27
-rw-r--r--src/xkb/XKBMAlloc.c92
-rw-r--r--src/xkb/XKBMisc.c98
-rw-r--r--src/xkb/XKBNames.c70
-rw-r--r--src/xkb/XKBRdBuf.c94
-rw-r--r--src/xkb/XKBSetGeom.c97
-rw-r--r--src/xkb/XKBSetMap.c127
-rw-r--r--src/xkb/XKBUse.c42
-rw-r--r--src/xkb/XKBleds.c80
-rw-r--r--src/xkb/XKBlibint.h72
-rw-r--r--src/xlibi18n/ICWrap.c22
-rw-r--r--src/xlibi18n/IMWrap.c24
-rw-r--r--src/xlibi18n/XDefaultIMIF.c106
-rw-r--r--src/xlibi18n/XDefaultOMIF.c239
-rw-r--r--src/xlibi18n/XimImSw.h7
-rw-r--r--src/xlibi18n/XimThai.h94
-rw-r--r--src/xlibi18n/XimTrInt.h9
-rw-r--r--src/xlibi18n/XimTrX.h3
-rw-r--r--src/xlibi18n/XimTrans.h36
-rw-r--r--src/xlibi18n/Ximint.h278
-rw-r--r--src/xlibi18n/XimintP.h18
-rw-r--r--src/xlibi18n/XlcDL.c150
-rw-r--r--src/xlibi18n/XlcGeneric.h20
-rw-r--r--src/xlibi18n/XlcPubI.h74
-rw-r--r--src/xlibi18n/XlcPublic.h37
-rw-r--r--src/xlibi18n/XlcSL.c5
-rw-r--r--src/xlibi18n/Xlcint.h131
-rw-r--r--src/xlibi18n/imKStoUCS.c14
-rw-r--r--src/xlibi18n/lcCT.c14
-rw-r--r--src/xlibi18n/lcDB.c5
-rw-r--r--src/xlibi18n/lcFile.c49
-rw-r--r--src/xlibi18n/lcGeneric.c12
-rw-r--r--src/xlibi18n/lcPrTxt.c6
-rw-r--r--src/xlibi18n/lcPublic.c3
-rw-r--r--src/xlibi18n/lcStd.c128
-rw-r--r--src/xlibi18n/lcUTF8.c10
-rw-r--r--src/xlibi18n/lcUniConv/README4
-rw-r--r--src/xlibi18n/lcUniConv/armscii_8.h44
-rw-r--r--src/xlibi18n/lcUniConv/big5.h4
-rw-r--r--src/xlibi18n/lcUniConv/gb2312.h4
-rw-r--r--src/xlibi18n/lcUniConv/iso8859_16.h10
-rw-r--r--src/xlibi18n/lcUniConv/jisx0208.h4
-rw-r--r--src/xlibi18n/lcUniConv/jisx0212.h4
-rw-r--r--src/xlibi18n/lcUniConv/ksc5601.h4
-rw-r--r--src/xlibi18n/lcWrap.c6
-rw-r--r--src/xlibi18n/mbWMProps.c19
-rw-r--r--src/xlibi18n/mbWrap.c73
-rw-r--r--src/xlibi18n/utf8WMProps.c19
-rw-r--r--src/xlibi18n/utf8Wrap.c73
-rw-r--r--src/xlibi18n/wcWrap.c73
202 files changed, 3461 insertions, 6249 deletions
diff --git a/src/ChGC.c b/src/ChGC.c
index f426145..eb2385a 100644
--- a/src/ChGC.c
+++ b/src/ChGC.c
@@ -24,13 +24,10 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/ChGC.c,v 1.4 2001/12/14 19:53:57 dawes Exp $ */
+/* $XFree86: xc/lib/X11/ChGC.c,v 1.5 2003/04/13 19:22:14 dawes Exp $ */
#include "Xlibint.h"
-
-/* in ChGC.c */
-extern int _XUpdateGCCache(register GC gc, register unsigned long mask,
- register XGCValues *attr);
+#include "Cr.h"
int
XChangeGC (dpy, gc, valuemask, values)
diff --git a/src/ChProp.c b/src/ChProp.c
index 603dd8a..23bea2c 100644
--- a/src/ChProp.c
+++ b/src/ChProp.c
@@ -24,12 +24,11 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/ChProp.c,v 1.4 2001/12/14 19:53:57 dawes Exp $ */
+/* $XFree86: xc/lib/X11/ChProp.c,v 1.5 2003/11/17 22:20:06 dawes Exp $ */
#include "Xlibint.h"
int
-#if NeedFunctionPrototypes
XChangeProperty (
register Display *dpy,
Window w,
@@ -39,16 +38,6 @@ XChangeProperty (
int mode, /* PropModeReplace, PropModePrepend, PropModeAppend */
_Xconst unsigned char *data,
int nelements)
-#else
-XChangeProperty (dpy, w, property, type, format, mode, data, nelements)
- register Display *dpy;
- Window w;
- Atom property, type;
- int format; /* 8, 16, or 32 */
- int mode; /* PropModeReplace, PropModePrepend, PropModeAppend */
- unsigned char *data;
- int nelements;
-#endif
{
register xChangePropertyReq *req;
register long len;
diff --git a/src/ChWAttrs.c b/src/ChWAttrs.c
index ed88815..f2c498c 100644
--- a/src/ChWAttrs.c
+++ b/src/ChWAttrs.c
@@ -24,12 +24,10 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/ChWAttrs.c,v 1.4 2001/12/14 19:53:57 dawes Exp $ */
+/* $XFree86: xc/lib/X11/ChWAttrs.c,v 1.5 2003/04/13 19:22:14 dawes Exp $ */
#include "Xlibint.h"
-extern void _XProcessWindowAttributes();
-
#define AllMaskBits (CWBackPixmap|CWBackPixel|CWBorderPixmap|\
CWBorderPixel|CWBitGravity|CWWinGravity|\
CWBackingStore|CWBackingPlanes|CWBackingPixel|\
diff --git a/src/ChkIfEv.c b/src/ChkIfEv.c
index 24539e8..48d098a 100644
--- a/src/ChkIfEv.c
+++ b/src/ChkIfEv.c
@@ -24,6 +24,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/X11/ChkIfEv.c,v 1.3 2003/11/17 22:20:06 dawes Exp $ */
#define NEED_EVENTS
#include "Xlibint.h"
@@ -37,11 +38,9 @@ in this Software without prior written authorization from The Open Group.
Bool XCheckIfEvent (dpy, event, predicate, arg)
register Display *dpy;
Bool (*predicate)(
-#if NeedNestedPrototypes
Display* /* display */,
XEvent* /* event */,
char* /* arg */
-#endif
); /* function to call */
register XEvent *event; /* XEvent to be filled in. */
char *arg;
diff --git a/src/ClDisplay.c b/src/ClDisplay.c
index 223a4c2..e2a379a 100644
--- a/src/ClDisplay.c
+++ b/src/ClDisplay.c
@@ -27,14 +27,12 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/lib/X11/ClDisplay.c,v 1.4 2001/12/14 19:53:58 dawes Exp $ */
+/* $XFree86: xc/lib/X11/ClDisplay.c,v 1.5 2003/04/13 19:22:14 dawes Exp $ */
+#include <X11/Xtrans.h>
+#include "Xlib.h"
#include "Xlibint.h"
-
-extern void _XFreeDisplayStructure();
-
-/* ConnDis.c */
-extern int _XDisconnectDisplay();
+#include "Xintconn.h"
/*
* XCloseDisplay - XSync the connection to the X Server, close the connection,
@@ -43,8 +41,8 @@ extern int _XDisconnectDisplay();
*/
int
-XCloseDisplay (dpy)
- register Display *dpy;
+XCloseDisplay (
+ register Display *dpy)
{
register _XExtension *ext;
register int i;
diff --git a/src/Cmap.h b/src/Cmap.h
new file mode 100644
index 0000000..709f25c
--- /dev/null
+++ b/src/Cmap.h
@@ -0,0 +1,11 @@
+/* $XFree86: xc/lib/X11/Cmap.h,v 1.1 2003/04/13 19:22:14 dawes Exp $ */
+
+#ifndef _CMAP_H_
+#define _CMAP_H_
+
+extern void
+_XcmsDeleteCmapRec(
+ Display *dpy,
+ Colormap cmap);
+
+#endif /* _CMAP_H_ */
diff --git a/src/ConnDis.c b/src/ConnDis.c
index 548ace9..667214c 100644
--- a/src/ConnDis.c
+++ b/src/ConnDis.c
@@ -24,7 +24,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/ConnDis.c,v 3.24 2001/12/14 19:53:58 dawes Exp $ */
+/* $XFree86: xc/lib/X11/ConnDis.c,v 3.27 2003/07/20 16:12:14 tsi Exp $ */
/*
* This file contains operating system dependencies.
@@ -54,11 +54,22 @@ in this Software without prior written authorization from The Open Group.
#include <sys/utsname.h>
#endif
-static void GetAuthorization();
-
-static char *copystring (src, len)
- char *src;
- int len;
+#include "Xintconn.h"
+
+/* prototyes */
+static void GetAuthorization(
+ XtransConnInfo trans_conn,
+ int family,
+ char *saddr,
+ int saddrlen,
+ int idisplay,
+ char **auth_namep,
+ int *auth_namelenp,
+ char **auth_datap,
+ int *auth_datalenp);
+
+/* functions */
+static char *copystring (char *src, int len)
{
char *dst = Xmalloc (len + 1);
@@ -78,7 +89,16 @@ static char *copystring (src, len)
*
* [protocol/] [hostname] : [:] displaynumber [.screennumber]
*
- * The second colon indicates a DECnet style name. No hostname is interpretted
+ * A string with exactly two colons seperating hostname from the display
+ * indicates a DECnet style name. Colons in the hostname may occur if an
+ * IPv6 numeric address is used as the hostname. An IPv6 numeric address
+ * may also end in a double colon, so three colons in a row indicates an
+ * IPv6 address ending in :: followed by :display. To make it easier for
+ * people to read, an IPv6 numeric address hostname may be surrounded by
+ * [ ] in a similar fashion to the IPv6 numeric address URL syntax defined
+ * by IETF RFC 2732.
+ *
+ * If no hostname and no protocol is specified, the string is interpreted
* as the most efficient local connection to a server on the same machine.
* This is usually:
*
@@ -94,16 +114,15 @@ static char *copystring (src, len)
*
*/
XtransConnInfo
-_X11TransConnectDisplay (display_name, fullnamep, dpynump, screenp,
- auth_namep, auth_namelenp, auth_datap, auth_datalenp)
- char *display_name;
- char **fullnamep; /* RETURN */
- int *dpynump; /* RETURN */
- int *screenp; /* RETURN */
- char **auth_namep; /* RETURN */
- int *auth_namelenp; /* RETURN */
- char **auth_datap; /* RETURN */
- int *auth_datalenp; /* RETURN */
+_X11TransConnectDisplay (
+ char *display_name,
+ char **fullnamep, /* RETURN */
+ int *dpynump, /* RETURN */
+ int *screenp, /* RETURN */
+ char **auth_namep, /* RETURN */
+ int *auth_namelenp, /* RETURN */
+ char **auth_datap, /* RETURN */
+ int *auth_datalenp) /* RETURN */
{
int family;
int saddrlen;
@@ -154,7 +173,8 @@ _X11TransConnectDisplay (display_name, fullnamep, dpynump, screenp,
/*
* Step 1, find the hostname. This is delimited by either one colon,
* or two colons in the case of DECnet (DECnet Phase V allows a single
- * colon in the hostname).
+ * colon in the hostname). (See note above regarding IPv6 numeric
+ * addresses with triple colons or [] brackets.)
*/
lastp = p;
@@ -165,7 +185,11 @@ _X11TransConnectDisplay (display_name, fullnamep, dpynump, screenp,
if (!lastc) return NULL; /* must have a colon */
- if ((lastp != lastc) && (*(lastc - 1) == ':')) {
+ if ((lastp != lastc) && (*(lastc - 1) == ':')
+#if defined(IPv6) && defined(AF_INET6)
+ && ( ((lastc - 1) == lastp) || (*(lastc - 2) != ':'))
+#endif
+ ) {
/* DECnet display specified */
#ifndef DNETCONN
@@ -438,16 +462,15 @@ _X11TransConnectDisplay (display_name, fullnamep, dpynump, screenp,
*
*/
-int _XConnectDisplay (display_name, fullnamep, dpynump, screenp,
- auth_namep, auth_namelenp, auth_datap, auth_datalenp)
- char *display_name;
- char **fullnamep; /* RETURN */
- int *dpynump; /* RETURN */
- int *screenp; /* RETURN */
- char **auth_namep; /* RETURN */
- int *auth_namelenp; /* RETURN */
- char **auth_datap; /* RETURN */
- int *auth_datalenp; /* RETURN */
+int _XConnectDisplay (
+ char *display_name,
+ char **fullnamep, /* RETURN */
+ int *dpynump, /* RETURN */
+ int *screenp, /* RETURN */
+ char **auth_namep, /* RETURN */
+ int *auth_namelenp, /* RETURN */
+ char **auth_datap, /* RETURN */
+ int *auth_datalenp) /* RETURN */
{
XtransConnInfo trans_conn;
@@ -692,7 +715,11 @@ auth_ezencode(servername, window, cred_out, len)
AUTH *a;
XDR xdr;
+#if defined(SVR4) && defined(sun)
+ a = authdes_seccreate(servername, window, NULL, NULL);
+#else
a = (AUTH *)authdes_create(servername, window, NULL, NULL);
+#endif
if (a == (AUTH *)NULL) {
perror("auth_create");
return 0;
@@ -966,17 +993,16 @@ static int k5_clientauth(dpy, sprefix)
#endif /* K5AUTH */
static void
-GetAuthorization(trans_conn, family, saddr, saddrlen, idisplay,
- auth_namep, auth_namelenp, auth_datap, auth_datalenp)
- XtransConnInfo trans_conn;
- int family;
- int saddrlen;
- int idisplay;
- char *saddr;
- char **auth_namep; /* RETURN */
- int *auth_namelenp; /* RETURN */
- char **auth_datap; /* RETURN */
- int *auth_datalenp; /* RETURN */
+GetAuthorization(
+ XtransConnInfo trans_conn,
+ int family,
+ char *saddr,
+ int saddrlen,
+ int idisplay,
+ char **auth_namep, /* RETURN */
+ int *auth_namelenp, /* RETURN */
+ char **auth_datap, /* RETURN */
+ int *auth_datalenp) /* RETURN */
{
#ifdef SECURE_RPC
char rpc_cred[MAX_AUTH_BYTES];
diff --git a/src/Context.c b/src/Context.c
index ddccbe9..8526b7a 100644
--- a/src/Context.c
+++ b/src/Context.c
@@ -50,7 +50,7 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/lib/X11/Context.c,v 1.5 2001/12/14 19:53:58 dawes Exp $ */
+/* $XFree86: xc/lib/X11/Context.c,v 1.6 2003/11/17 22:20:06 dawes Exp $ */
/* This module implements a simple sparse array.
@@ -155,19 +155,11 @@ static void _XFreeContextDB(Display *display)
Possible errors are Out-of-memory.
*/
-#if NeedFunctionPrototypes
int XSaveContext(
Display *display,
register XID rid,
register XContext context,
_Xconst char* data)
-#else
-int XSaveContext(display, rid, context, data)
- Display *display;
- register XID rid;
- register XContext context;
- XPointer data;
-#endif
{
DB *pdb;
register DB db;
diff --git a/src/Cr.h b/src/Cr.h
new file mode 100644
index 0000000..5ef13bf
--- /dev/null
+++ b/src/Cr.h
@@ -0,0 +1,28 @@
+/* $XFree86: xc/lib/X11/Cr.h,v 1.1 2003/04/13 19:22:14 dawes Exp $ */
+
+#ifndef _CR_H_
+#define _CR_H_
+
+extern int _XUpdateGCCache(
+ register GC gc,
+ register unsigned long mask,
+ register XGCValues *attr);
+extern void _XNoticeCreateBitmap(
+ Display *dpy,
+ Pixmap pid,
+ unsigned int width,
+ unsigned int height);
+extern void _XNoticePutBitmap(
+ Display *dpy,
+ Drawable draw,
+ XImage *image);
+extern Cursor _XTryShapeBitmapCursor(
+ Display *dpy,
+ Pixmap source,
+ Pixmap mask,
+ XColor *foreground,
+ XColor *background,
+ unsigned int x,
+ unsigned int y);
+
+#endif /* _CR_H_ */
diff --git a/src/CrBFData.c b/src/CrBFData.c
index 70060a9..025f33e 100644
--- a/src/CrBFData.c
+++ b/src/CrBFData.c
@@ -24,6 +24,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/X11/CrBFData.c,v 1.3 2003/11/17 22:20:06 dawes Exp $ */
#include "Xlib.h"
@@ -44,20 +45,12 @@ in this Software without prior written authorization from The Open Group.
* xoffset=0
* no extra bytes per line
*/
-#if NeedFunctionPrototypes
Pixmap XCreateBitmapFromData(
Display *display,
Drawable d,
_Xconst char *data,
unsigned int width,
unsigned int height)
-#else
-Pixmap XCreateBitmapFromData(display, d, data, width, height)
- Display *display;
- Drawable d;
- char *data;
- unsigned int width, height;
-#endif
{
XImage ximage;
GC gc;
diff --git a/src/CrCmap.c b/src/CrCmap.c
index b5d28d6..e956aa4 100644
--- a/src/CrCmap.c
+++ b/src/CrCmap.c
@@ -24,14 +24,11 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/CrCmap.c,v 1.4 2001/12/14 19:53:59 dawes Exp $ */
+/* $XFree86: xc/lib/X11/CrCmap.c,v 1.5 2003/04/13 19:22:14 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
-/* EXTERNS */
-/* cmsCmap.c */
-extern XcmsCmapRec * _XcmsAddCmapRec();
Colormap XCreateColormap(dpy, w, visual, alloc)
register Display *dpy;
diff --git a/src/CrGC.c b/src/CrGC.c
index 789538c..955f432 100644
--- a/src/CrGC.c
+++ b/src/CrGC.c
@@ -24,9 +24,10 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/CrGC.c,v 3.6 2001/12/14 19:53:59 dawes Exp $ */
+/* $XFree86: xc/lib/X11/CrGC.c,v 3.7 2003/04/13 19:22:15 dawes Exp $ */
#include "Xlibint.h"
+#include "Cr.h"
static XGCValues const initial_GC = {
GXcopy, /* function */
@@ -54,8 +55,10 @@ static XGCValues const initial_GC = {
4 /* dashes (list [4,4]) */
};
-static void _XGenerateGCList();
-int _XUpdateGCCache();
+static void _XGenerateGCList(
+ register Display *dpy,
+ GC gc,
+ xReq *req);
GC XCreateGC (dpy, d, valuemask, values)
register Display *dpy;
@@ -103,10 +106,10 @@ GC XCreateGC (dpy, d, valuemask, values)
*/
static void
-_XGenerateGCList (dpy, gc, req)
- register Display *dpy;
- xReq *req;
- GC gc;
+_XGenerateGCList (
+ register Display *dpy,
+ GC gc,
+ xReq *req)
{
unsigned long values[32];
register unsigned long *value = values;
diff --git a/src/CrGlCur.c b/src/CrGlCur.c
index a0535f2..05e46a2 100644
--- a/src/CrGlCur.c
+++ b/src/CrGlCur.c
@@ -24,7 +24,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/CrGlCur.c,v 1.6 2002/09/05 18:17:31 keithp Exp $ */
+/* $XFree86: xc/lib/X11/CrGlCur.c,v 1.7 2003/04/13 19:22:15 dawes Exp $ */
#include "Xlibint.h"
@@ -37,6 +37,7 @@ in this Software without prior written authorization from The Open Group.
#else
#include <dlfcn.h>
#endif
+#include "Cr.h"
#if defined(hpux)
typedef shl_dt XModuleType;
@@ -151,7 +152,7 @@ static Bool _XcursorModuleTried;
_XUnlockMutex (_Xglobal_lock); \
}
-Cursor
+static Cursor
_XTryShapeCursor (Display *dpy,
Font source_font,
Font mask_font,
diff --git a/src/DisName.c b/src/DisName.c
index 17ebf35..1456f65 100644
--- a/src/DisName.c
+++ b/src/DisName.c
@@ -27,6 +27,7 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
+/* $XFree86: xc/lib/X11/DisName.c,v 1.3 2003/04/13 19:22:15 dawes Exp $ */
/* XDisplayName.c */
/*
@@ -46,16 +47,16 @@ from The Open Group.
/* Written at Waterloo - JMSellens */
#include <stdio.h>
-
-extern char *getenv();
+#include <stdlib.h>
+#include "Xlib.h"
char *
-XDisplayName( display )
- char *display;
+XDisplayName(
+ _Xconst char *display)
{
char *d;
if ( display != (char *)NULL && *display != '\0' )
- return( display );
+ return( (char *)display );
if ( (d = getenv( "DISPLAY" )) != (char *)NULL )
return( d );
return( "" );
diff --git a/src/ErrDes.c b/src/ErrDes.c
index 9ea3f88..911a31b 100644
--- a/src/ErrDes.c
+++ b/src/ErrDes.c
@@ -48,7 +48,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
-/* $XFree86: xc/lib/X11/ErrDes.c,v 3.10 2001/12/14 19:53:59 dawes Exp $ */
+/* $XFree86: xc/lib/X11/ErrDes.c,v 3.12 2003/11/17 22:20:06 dawes Exp $ */
#include "Xlibint.h"
#include <X11/Xos.h>
@@ -122,7 +122,6 @@ XGetErrorText(dpy, code, buffer, nbytes)
}
int
-#if NeedFunctionPrototypes
/*ARGSUSED*/
XGetErrorDatabaseText(
Display *dpy,
@@ -131,15 +130,6 @@ XGetErrorDatabaseText(
_Xconst char *defaultp,
char *buffer,
int nbytes)
-#else
-/*ARGSUSED*/
-XGetErrorDatabaseText(dpy, name, type, defaultp, buffer, nbytes)
- Display *dpy;
- register char *name, *type;
- char *defaultp;
- char *buffer;
- int nbytes;
-#endif
{
static XrmDatabase db = NULL;
@@ -175,11 +165,19 @@ XGetErrorDatabaseText(dpy, name, type, defaultp, buffer, nbytes)
if (db)
{
tlen = strlen (name) + strlen (type) + 2;
- if (tlen <= BUFSIZE) tptr = temp;
- else tptr = Xmalloc (tlen);
- sprintf(tptr, "%s.%s", name, type);
- XrmGetResource(db, tptr, "ErrorType.ErrorNumber", &type_str, &result);
- if (tptr != temp) Xfree (tptr);
+ if (tlen <= BUFSIZE)
+ tptr = temp;
+ else
+ tptr = Xmalloc (tlen);
+ if (tptr) {
+ sprintf(tptr, "%s.%s", name, type);
+ XrmGetResource(db, tptr, "ErrorType.ErrorNumber",
+ &type_str, &result);
+ if (tptr != temp)
+ Xfree (tptr);
+ } else {
+ result.addr = (XPointer) NULL;
+ }
}
else
result.addr = (XPointer)NULL;
diff --git a/src/ErrHndlr.c b/src/ErrHndlr.c
index 9ad0ba7..9db99e8 100644
--- a/src/ErrHndlr.c
+++ b/src/ErrHndlr.c
@@ -24,26 +24,20 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/ErrHndlr.c,v 1.5 2001/12/14 19:53:59 dawes Exp $ */
+/* $XFree86: xc/lib/X11/ErrHndlr.c,v 1.7 2003/11/17 22:20:06 dawes Exp $ */
#include "Xlibint.h"
-extern int _XDefaultError();
-extern int _XDefaultIOError();
/*
* XErrorHandler - This procedure sets the X non-fatal error handler
* (_XErrorFunction) to be the specified routine. If NULL is passed in
* the original error handler is restored.
*/
-#if NeedFunctionPrototypes
-XErrorHandler XSetErrorHandler(XErrorHandler handler)
-#else
-XErrorHandler XSetErrorHandler(handler)
- register XErrorHandler handler;
-#endif
+XErrorHandler
+XSetErrorHandler(XErrorHandler handler)
{
- int (*oldhandler)();
+ int (*oldhandler)(Display *dpy, XErrorEvent *event);
_XLockMutex(_Xglobal_lock);
oldhandler = _XErrorFunction;
@@ -68,14 +62,10 @@ XErrorHandler XSetErrorHandler(handler)
* the original error handler is restored.
*/
-#if NeedFunctionPrototypes
-XIOErrorHandler XSetIOErrorHandler(XIOErrorHandler handler)
-#else
-XIOErrorHandler XSetIOErrorHandler(handler)
- register XIOErrorHandler handler;
-#endif
+XIOErrorHandler
+XSetIOErrorHandler(XIOErrorHandler handler)
{
- int (*oldhandler)();
+ int (*oldhandler)(Display *dpy);
_XLockMutex(_Xglobal_lock);
oldhandler = _XIOErrorFunction;
diff --git a/src/FSWrap.c b/src/FSWrap.c
index 98e02de..d16068e 100644
--- a/src/FSWrap.c
+++ b/src/FSWrap.c
@@ -56,7 +56,7 @@ from The Open Group.
*/
-/* $XFree86: xc/lib/X11/FSWrap.c,v 1.6 2001/12/14 19:54:00 dawes Exp $ */
+/* $XFree86: xc/lib/X11/FSWrap.c,v 1.9 2003/11/17 22:20:06 dawes Exp $ */
#include "Xlibint.h"
#include "Xlcint.h"
@@ -67,13 +67,13 @@ from The Open Group.
#define XMAXLIST 256
char **
-_XParseBaseFontNameList(str, num)
- char *str;
- int *num;
+_XParseBaseFontNameList(
+ char *str,
+ int *num)
{
char *plist[XMAXLIST];
char **list;
- char *ptr;
+ char *ptr, *psave;
*num = 0;
if (!str || !*str) {
@@ -89,6 +89,7 @@ _XParseBaseFontNameList(str, num)
}
strcpy(ptr, str);
+ psave = ptr;
/* somebody who specifies more than XMAXLIST basefontnames will lose */
while (*num < (sizeof plist / sizeof plist[0])) {
char *back;
@@ -112,7 +113,7 @@ _XParseBaseFontNameList(str, num)
break;
}
if (!(list = (char **) Xmalloc((unsigned)sizeof(char *) * (*num + 1)))) {
- Xfree(ptr);
+ Xfree(psave);
return (char **)NULL;
}
memcpy((char *)list, (char *)plist, sizeof(char *) * (*num));
@@ -122,9 +123,9 @@ _XParseBaseFontNameList(str, num)
}
static char **
-copy_string_list(string_list, list_count)
- char **string_list;
- int list_count;
+copy_string_list(
+ char **string_list,
+ int list_count)
{
char **string_list_ret, **list_src, **list_dst, *dst;
int length, count;
@@ -159,7 +160,6 @@ copy_string_list(string_list, list_count)
return string_list_ret;
}
-#if NeedFunctionPrototypes
XFontSet
XCreateFontSet (
Display *dpy,
@@ -167,16 +167,6 @@ XCreateFontSet (
char ***missing_charset_list,
int *missing_charset_count,
char **def_string)
-#else
-XFontSet
-XCreateFontSet (dpy, base_font_name_list, missing_charset_list,
- missing_charset_count, def_string)
- Display *dpy;
- char *base_font_name_list;
- char ***missing_charset_list;
- int *missing_charset_count;
- char **def_string;
-#endif
{
XOM om;
XOC oc;
diff --git a/src/Font.c b/src/Font.c
index e572450..bba515b 100644
--- a/src/Font.c
+++ b/src/Font.c
@@ -27,7 +27,7 @@ sale, use or other dealings in this Software without prior written
authorization from the X Consortium and the XFree86 Project.
*/
-/* $XFree86: xc/lib/X11/Font.c,v 1.16 2002/12/14 01:55:57 dawes Exp $ */
+/* $XFree86: xc/lib/X11/Font.c,v 1.18 2003/11/17 22:20:06 dawes Exp $ */
#define NEED_REPLIES
#include "Xlibint.h"
@@ -52,11 +52,9 @@ authorization from the X Consortium and the XFree86 Project.
static XFontStruct *_XQueryFont(
-#if NeedFunctionPrototypes
Display* /* dpy */,
Font /* fid */,
unsigned long /* seq */
-#endif
);
#ifdef USE_XF86BIGFONT
@@ -72,38 +70,26 @@ typedef struct {
#define CAP_VerifiedLocal 256
static XF86BigfontCodes *_XF86BigfontCodes(
-#if NeedFunctionPrototypes
Display* /* dpy */
-#endif
);
static XFontStruct *_XF86BigfontQueryFont(
-#if NeedFunctionPrototypes
Display* /* dpy */,
XF86BigfontCodes* /* extcodes */,
Font /* fid */,
unsigned long /* seq */
-#endif
);
void _XF86BigfontFreeFontMetrics(
-#if NeedFunctionPrototypes
XFontStruct* /* fs */
-#endif
);
#endif /* USE_XF86BIGFONT */
-#if NeedFunctionPrototypes
XFontStruct *XLoadQueryFont(
register Display *dpy,
_Xconst char *name)
-#else
-XFontStruct *XLoadQueryFont(dpy, name)
- register Display *dpy;
- char *name;
-#endif
{
XFontStruct *font_result;
register long nbytes;
@@ -338,8 +324,8 @@ _XQueryFont (dpy, fid, seq)
static int XF86BigfontNumber = 1040697125;
static int
-_XF86BigfontFreeCodes (extension)
- XExtData *extension;
+_XF86BigfontFreeCodes (
+ XExtData *extension)
{
/* Don't Xfree(extension->private_data) because it is on the same malloc
chunk as extension. */
@@ -349,8 +335,8 @@ _XF86BigfontFreeCodes (extension)
}
static XF86BigfontCodes *
-_XF86BigfontCodes (dpy)
- register Display *dpy;
+_XF86BigfontCodes (
+ register Display *dpy)
{
XEDataObject dpy_union;
XExtData *pData;
@@ -434,8 +420,8 @@ _XF86BigfontCodes (dpy)
}
static int
-_XF86BigfontFreeNop (extension)
- XExtData *extension;
+_XF86BigfontFreeNop (
+ XExtData *extension)
{
return 0;
}
@@ -683,19 +669,11 @@ _XF86BigfontFreeFontMetrics (fs)
#endif /* USE_XF86BIGFONT */
-#if NeedFunctionPrototypes
int _XF86LoadQueryLocaleFont(
Display *dpy,
_Xconst char *name,
XFontStruct **xfp,
Font *fidp)
-#else
-int _XF86LoadQueryLocaleFont(dpy, name)
- Display *dpy;
- char *name;
- XFontStruct **xfp;
- Font *fidp;
-#endif
{
int l;
char *charset, *p;
diff --git a/src/FontInfo.c b/src/FontInfo.c
index bba8051..8437d8c 100644
--- a/src/FontInfo.c
+++ b/src/FontInfo.c
@@ -24,7 +24,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/FontInfo.c,v 1.6 2001/12/14 19:54:00 dawes Exp $ */
+/* $XFree86: xc/lib/X11/FontInfo.c,v 1.7 2003/11/17 22:20:06 dawes Exp $ */
#define NEED_REPLIES
#include "Xlibint.h"
@@ -34,27 +34,16 @@ in this Software without prior written authorization from The Open Group.
#endif
#ifdef USE_XF86BIGFONT
extern void _XF86BigfontFreeFontMetrics(
-#if NeedFunctionPrototypes
XFontStruct* /* fs */
-#endif
);
#endif
-#if NeedFunctionPrototypes
char **XListFontsWithInfo(
register Display *dpy,
_Xconst char *pattern, /* null-terminated */
int maxNames,
int *actualCount, /* RETURN */
XFontStruct **info) /* RETURN */
-#else
-char **XListFontsWithInfo(dpy, pattern, maxNames, actualCount, info)
-register Display *dpy;
-char *pattern; /* null-terminated */
-int maxNames;
-int *actualCount; /* RETURN */
-XFontStruct **info; /* RETURN */
-#endif
{
register long nbytes;
register int i;
diff --git a/src/FontNames.c b/src/FontNames.c
index ec4c309..adfd91e 100644
--- a/src/FontNames.c
+++ b/src/FontNames.c
@@ -25,24 +25,17 @@ in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/FontNames.c,v 1.6 2001/12/14 19:54:00 dawes Exp $ */
+/* $XFree86: xc/lib/X11/FontNames.c,v 1.7 2003/11/17 22:20:06 dawes Exp $ */
#define NEED_REPLIES
#include "Xlibint.h"
-#if NeedFunctionPrototypes
-char **XListFonts(
+char **
+XListFonts(
register Display *dpy,
_Xconst char *pattern, /* null-terminated */
int maxNames,
int *actualCount) /* RETURN */
-#else
-char **XListFonts(dpy, pattern, maxNames, actualCount)
-register Display *dpy;
-char *pattern; /* null-terminated */
-int maxNames;
-int *actualCount; /* RETURN */
-#endif
{
register long nbytes;
register unsigned i;
diff --git a/src/FreeCmap.c b/src/FreeCmap.c
index 4b83ba1..493c088 100644
--- a/src/FreeCmap.c
+++ b/src/FreeCmap.c
@@ -24,16 +24,16 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/FreeCmap.c,v 1.4 2001/12/14 19:54:00 dawes Exp $ */
+/* $XFree86: xc/lib/X11/FreeCmap.c,v 1.5 2003/04/13 19:22:16 dawes Exp $ */
+#include "Xlib.h"
#include "Xlibint.h"
-
-extern void _XcmsDeleteCmapRec();
+#include "Cmap.h"
int
-XFreeColormap(dpy, cmap)
-register Display *dpy;
-Colormap cmap;
+XFreeColormap(
+ register Display *dpy,
+ Colormap cmap)
{
register xResourceReq *req;
diff --git a/src/Geom.c b/src/Geom.c
index 2699231..1c45673 100644
--- a/src/Geom.c
+++ b/src/Geom.c
@@ -27,6 +27,7 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
+/* $XFree86: xc/lib/X11/Geom.c,v 1.3 2003/11/17 22:20:06 dawes Exp $ */
#include "Xlibint.h"
#include "Xutil.h"
@@ -37,8 +38,8 @@ from The Open Group.
* returns 0 if there was some problem, else the position bitmask.
*/
-#if NeedFunctionPrototypes
-int XGeometry (
+int
+XGeometry (
Display *dpy, /* user's display connection */
int screen, /* screen on which to do computation */
_Xconst char *pos, /* user provided geometry spec */
@@ -52,17 +53,6 @@ int XGeometry (
register int *y, /* always set on successful RETURN */
register int *width, /* always set on successful RETURN */
register int *height) /* always set on successful RETURN */
-#else
-int XGeometry (dpy, screen, pos, def, bwidth, fwidth, fheight, xadd, yadd, x, y, width, height)
- Display *dpy; /* user's display connection */
- int screen; /* screen on which to do computation */
- char *pos; /* user provided geometry spec */
- char *def; /* default geometry spec for window */
- unsigned int bwidth; /* border width */
- unsigned int fwidth, fheight; /* size of position units */
- int xadd, yadd; /* any additional interior space */
- register int *x, *y, *width, *height;/* always set on successful RETURN */
-#endif
{
int px, py; /* returned values from parse */
unsigned int pwidth, pheight; /* returned values from parse */
diff --git a/src/GetColor.c b/src/GetColor.c
index 090f241..f374995 100644
--- a/src/GetColor.c
+++ b/src/GetColor.c
@@ -24,40 +24,20 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/GetColor.c,v 1.5 2002/12/04 23:18:32 paulo Exp $ */
+/* $XFree86: xc/lib/X11/GetColor.c,v 1.7 2003/11/17 22:20:06 dawes Exp $ */
#define NEED_REPLIES
#include <stdio.h>
#include "Xlibint.h"
#include "Xcmsint.h"
-extern void _XcmsRGB_to_XColor();
-
-/* cmsColNm.c */
-extern Status _XcmsResolveColorString(
-#if NeedFunctionPrototypes
- XcmsCCC ccc,
- _Xconst char **color_string,
- XcmsColor *pColor_exact_return,
- XcmsColorFormat result_format
-#endif
-);
-
-#if NeedFunctionPrototypes
-Status XAllocNamedColor(
+Status
+XAllocNamedColor(
register Display *dpy,
Colormap cmap,
_Xconst char *colorname, /* STRING8 */
XColor *hard_def, /* RETURN */
XColor *exact_def) /* RETURN */
-#else
-Status XAllocNamedColor(dpy, cmap, colorname, hard_def, exact_def)
-register Display *dpy;
-Colormap cmap;
-char *colorname; /* STRING8 */
-XColor *hard_def; /* RETURN */
-XColor *exact_def; /* RETURN */
-#endif
{
long nbytes;
diff --git a/src/GetDflt.c b/src/GetDflt.c
index 317ee4a..22ea3cc 100644
--- a/src/GetDflt.c
+++ b/src/GetDflt.c
@@ -46,7 +46,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
-/* $XFree86: xc/lib/X11/GetDflt.c,v 3.21 2002/05/31 18:45:41 dawes Exp $ */
+/* $XFree86: xc/lib/X11/GetDflt.c,v 3.23 2003/11/17 22:20:07 dawes Exp $ */
#include "Xlibint.h"
#include <X11/Xos.h>
@@ -89,9 +89,10 @@ SOFTWARE.
/*ARGSUSED*/
-static char *GetHomeDir (dest, len)
- char *dest;
- int len;
+static char *
+GetHomeDir(
+ char *dest,
+ int len)
{
#ifdef WIN32
register char *ptr1;
@@ -140,8 +141,9 @@ static char *GetHomeDir (dest, len)
}
-static XrmDatabase InitDefaults (dpy)
- Display *dpy; /* display for defaults.... */
+static XrmDatabase
+InitDefaults(
+ Display *dpy) /* display for defaults.... */
{
XrmDatabase userdb;
XrmDatabase xdb;
@@ -190,17 +192,11 @@ static XrmDatabase InitDefaults (dpy)
#endif
}
-#if NeedFunctionPrototypes
-char *XGetDefault(
+char *
+XGetDefault(
Display *dpy, /* display for defaults.... */
char _Xconst *prog, /* name of program for option */
register _Xconst char *name) /* name of option program wants */
-#else
-char *XGetDefault(dpy, prog, name)
- Display *dpy; /* display for defaults.... */
- char *prog; /* name of program for option */
- register char *name; /* name of option program wants */
-#endif
{ /* to get, for example, "font" */
XrmName names[3];
XrmClass classes[3];
diff --git a/src/GetImage.c b/src/GetImage.c
index 9ffef9e..8b1224a 100644
--- a/src/GetImage.c
+++ b/src/GetImage.c
@@ -24,20 +24,17 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/GetImage.c,v 1.4 2001/12/14 19:54:00 dawes Exp $ */
+/* $XFree86: xc/lib/X11/GetImage.c,v 1.5 2003/04/13 19:22:16 dawes Exp $ */
#define NEED_REPLIES
#include "Xlibint.h"
#include <X11/Xutil.h> /* for XDestroyImage */
-
-/* ImUtil.c */
-extern int _XGetScanlinePad();
-extern int _XSetImage();
+#include "ImUtil.h"
#define ROUNDUP(nbytes, pad) (((((nbytes) - 1) + (pad)) / (pad)) * (pad))
-static unsigned int Ones(mask) /* HACKMEM 169 */
- unsigned long mask;
+static unsigned int Ones( /* HACKMEM 169 */
+ unsigned long mask)
{
register unsigned long y;
diff --git a/src/GetPntMap.c b/src/GetPntMap.c
index 1f99314..28e5f4d 100644
--- a/src/GetPntMap.c
+++ b/src/GetPntMap.c
@@ -25,7 +25,7 @@ in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/GetPntMap.c,v 1.6 2001/12/14 19:54:01 dawes Exp $ */
+/* $XFree86: xc/lib/X11/GetPntMap.c,v 1.7 2003/11/17 22:20:07 dawes Exp $ */
#define NEED_REPLIES
#include "Xlibint.h"
@@ -76,8 +76,8 @@ int XGetPointerMapping (dpy, map, nmaps)
return ((int) rep.nElts);
}
-#if NeedFunctionPrototypes
-KeySym *XGetKeyboardMapping (Display *dpy,
+KeySym *
+XGetKeyboardMapping (Display *dpy,
#if NeedWidePrototypes
unsigned int first_keycode,
#else
@@ -85,13 +85,6 @@ KeySym *XGetKeyboardMapping (Display *dpy,
#endif
int count,
int *keysyms_per_keycode)
-#else
-KeySym *XGetKeyboardMapping (dpy, first_keycode, count, keysyms_per_keycode)
- register Display *dpy;
- KeyCode first_keycode;
- int count;
- int *keysyms_per_keycode; /* RETURN */
-#endif
{
long nbytes;
unsigned long nkeysyms;
diff --git a/src/GetWAttrs.c b/src/GetWAttrs.c
index 7856b6f..e518925 100644
--- a/src/GetWAttrs.c
+++ b/src/GetWAttrs.c
@@ -24,6 +24,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/X11/GetWAttrs.c,v 1.3 2003/04/13 19:22:16 dawes Exp $ */
#define NEED_REPLIES
#include "Xlibint.h"
@@ -35,12 +36,12 @@ typedef struct _WAttrsState {
} _XWAttrsState;
static Bool
-_XWAttrsHandler(dpy, rep, buf, len, data)
- register Display *dpy;
- register xReply *rep;
- char *buf;
- int len;
- XPointer data;
+_XWAttrsHandler(
+ register Display *dpy,
+ register xReply *rep,
+ char *buf,
+ int len,
+ XPointer data)
{
register _XWAttrsState *state;
xGetWindowAttributesReply replbuf;
diff --git a/src/IfEvent.c b/src/IfEvent.c
index 34b9e39..45d04ac 100644
--- a/src/IfEvent.c
+++ b/src/IfEvent.c
@@ -24,7 +24,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/IfEvent.c,v 1.4 2001/12/14 19:54:01 dawes Exp $ */
+/* $XFree86: xc/lib/X11/IfEvent.c,v 1.5 2003/11/17 22:20:07 dawes Exp $ */
#define NEED_EVENTS
#include "Xlibint.h"
@@ -38,11 +38,9 @@ int
XIfEvent (dpy, event, predicate, arg)
register Display *dpy;
Bool (*predicate)(
-#if NeedNestedPrototypes
Display* /* display */,
XEvent* /* event */,
char* /* arg */
-#endif
); /* function to call */
register XEvent *event;
char *arg;
diff --git a/src/ImText.c b/src/ImText.c
index c68f2c2..32ec8c8 100644
--- a/src/ImText.c
+++ b/src/ImText.c
@@ -24,13 +24,12 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/ImText.c,v 1.4 2001/12/14 19:54:02 dawes Exp $ */
+/* $XFree86: xc/lib/X11/ImText.c,v 1.5 2003/11/17 22:20:07 dawes Exp $ */
#define NEED_REPLIES
#include "Xlibint.h"
int
-#if NeedFunctionPrototypes
XDrawImageString(
register Display *dpy,
Drawable d,
@@ -39,15 +38,6 @@ XDrawImageString(
int y,
_Xconst char *string,
int length)
-#else
-XDrawImageString(dpy, d, gc, x, y, string, length)
- register Display *dpy;
- Drawable d;
- GC gc;
- int x, y;
- char *string;
- int length;
-#endif
{
register xImageText8Req *req;
char *CharacterOffset = (char *)string;
diff --git a/src/ImText16.c b/src/ImText16.c
index 4d9338a..f3fbdbe 100644
--- a/src/ImText16.c
+++ b/src/ImText16.c
@@ -24,13 +24,12 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/ImText16.c,v 1.4 2001/12/14 19:54:02 dawes Exp $ */
+/* $XFree86: xc/lib/X11/ImText16.c,v 1.5 2003/11/17 22:20:07 dawes Exp $ */
#define NEED_REPLIES
#include "Xlibint.h"
int
-#if NeedFunctionPrototypes
XDrawImageString16(
register Display *dpy,
Drawable d,
@@ -39,15 +38,6 @@ XDrawImageString16(
int y,
_Xconst XChar2b *string,
int length)
-#else
-XDrawImageString16(dpy, d, gc, x, y, string, length)
- register Display *dpy;
- Drawable d;
- GC gc;
- int x, y;
- XChar2b *string;
- int length;
-#endif
{
register xImageText16Req *req;
XChar2b *CharacterOffset = (XChar2b *)string;
diff --git a/src/ImUtil.c b/src/ImUtil.c
index 6cab3e2..92e031d 100644
--- a/src/ImUtil.c
+++ b/src/ImUtil.c
@@ -24,16 +24,13 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/ImUtil.c,v 3.10 2001/12/14 19:54:02 dawes Exp $ */
+/* $XFree86: xc/lib/X11/ImUtil.c,v 3.13 2003/11/17 22:20:07 dawes Exp $ */
#include <X11/Xlibint.h>
#include <X11/Xutil.h>
#include <stdio.h>
+#include "ImUtil.h"
-/* PutImage.c */
-extern int _XReverse_Bytes();
-
-#if NeedFunctionPrototypes
static int _XDestroyImage(XImage *);
static unsigned long _XGetPixel(XImage *, int, int);
static unsigned long _XGetPixel1(XImage *, int, int);
@@ -47,7 +44,6 @@ static int _XPutPixel16(XImage *, int, int, unsigned long);
static int _XPutPixel32(XImage *, int, int, unsigned long);
static XImage *_XSubImage(XImage *, int, int, unsigned int, unsigned int);
static int _XAddPixel(XImage *, long);
-#endif
static unsigned char const _lomask[0x09] = { 0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff };
static unsigned char const _himask[0x09] = { 0xff, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0x80, 0x00 };
@@ -57,9 +53,9 @@ static unsigned char const _himask[0x09] = { 0xff, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0,
display. */
int
-_XGetScanlinePad(dpy, depth)
- Display *dpy;
- int depth;
+_XGetScanlinePad(
+ Display *dpy,
+ int depth)
{
register ScreenFormat *fmt = dpy->pixmap_format;
register int i;
@@ -72,9 +68,9 @@ _XGetScanlinePad(dpy, depth)
}
int
-_XGetBitsPerPixel(dpy, depth)
- Display *dpy;
- int depth;
+_XGetBitsPerPixel(
+ Display *dpy,
+ int depth)
{
register ScreenFormat *fmt = dpy->pixmap_format;
register int i;
@@ -121,9 +117,9 @@ _XGetBitsPerPixel(dpy, depth)
* For XY formats, bitmap_unit is 8, 16, or 32 bits.
* For Z format, bits_per_pixel is 1, 4, 8, 16, 24, or 32 bits.
*/
-static void _xynormalizeimagebits (bp, img)
- register unsigned char *bp;
- register XImage *img;
+static void _xynormalizeimagebits (
+ register unsigned char *bp,
+ register XImage *img)
{
register unsigned char c;
@@ -150,9 +146,9 @@ static void _xynormalizeimagebits (bp, img)
_XReverse_Bytes (bp, img->bitmap_unit >> 3);
}
-static void _znormalizeimagebits (bp, img)
- register unsigned char *bp;
- register XImage *img;
+static void _znormalizeimagebits (
+ register unsigned char *bp,
+ register XImage *img)
{
register unsigned char c;
switch (img->bits_per_pixel) {
@@ -184,11 +180,11 @@ static void _znormalizeimagebits (bp, img)
}
}
-static void _putbits (src, dstoffset, numbits, dst)
- register char *src; /* address of source bit string */
- int dstoffset; /* bit offset into destination; range is 0-31 */
- register int numbits;/* number of bits to copy to destination */
- register char *dst; /* address of destination bit string */
+static void _putbits(
+ register char *src, /* address of source bit string */
+ int dstoffset, /* bit offset into destination; range is 0-31 */
+ register int numbits,/* number of bits to copy to destination */
+ register char *dst) /* address of destination bit string */
{
register unsigned char chlo, chhi;
int hibits;
@@ -271,8 +267,8 @@ static void _putbits (src, dstoffset, numbits, dst)
* routines always have to check to make sure the optimization is still
* valid, and reinit the functions if not.
*/
-void _XInitImageFuncPtrs (image)
- register XImage *image;
+void _XInitImageFuncPtrs (
+ register XImage *image)
{
image->f.create_image = XCreateImage;
image->f.destroy_image = _XDestroyImage;
@@ -917,12 +913,11 @@ static XImage *_XSubImage (ximage, x, y, width, height)
*
*/
-int _XSetImage (srcimg, dstimg, x, y)
- XImage *srcimg;
- register XImage *dstimg;
- register int x;
- register int y;
-
+int _XSetImage(
+ XImage *srcimg,
+ register XImage *dstimg,
+ register int x,
+ register int y)
{
register unsigned long pixel;
register int row, col;
diff --git a/src/InitExt.c b/src/InitExt.c
index 00b2c52..8031d21 100644
--- a/src/InitExt.c
+++ b/src/InitExt.c
@@ -26,7 +26,7 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/lib/X11/InitExt.c,v 1.7 2001/12/14 19:54:02 dawes Exp $ */
+/* $XFree86: xc/lib/X11/InitExt.c,v 1.8 2003/11/17 22:20:07 dawes Exp $ */
#include <X11/Xlibint.h>
#include <X11/Xos.h>
@@ -37,15 +37,9 @@ from The Open Group.
* at appropriate times.
*/
-#if NeedFunctionPrototypes
XExtCodes *XInitExtension (
Display *dpy,
_Xconst char *name)
-#else
-XExtCodes *XInitExtension (dpy, name)
- Display *dpy;
- char *name;
-#endif
{
XExtCodes codes; /* temp. place for extension information. */
register _XExtension *ext;/* need a place to build it all */
@@ -239,11 +233,9 @@ CloseDisplayType XESetCloseDisplay(dpy, extension, proc)
}
typedef Bool (*WireToEventType) (
-#if NeedFunctionPrototypes
Display* /* display */,
XEvent* /* re */,
xEvent* /* event */
-#endif
);
WireToEventType XESetWireToEvent(dpy, event_number, proc)
@@ -261,11 +253,9 @@ WireToEventType XESetWireToEvent(dpy, event_number, proc)
}
typedef Status (*EventToWireType) (
-#if NeedFunctionPrototypes
Display* /* display */,
XEvent* /* re */,
xEvent* /* event */
-#endif
);
EventToWireType XESetEventToWire(dpy, event_number, proc)
@@ -283,11 +273,9 @@ EventToWireType XESetEventToWire(dpy, event_number, proc)
}
typedef Bool (*WireToErrorType) (
-#if NeedFunctionPrototypes
Display* /* display */,
XErrorEvent* /* he */,
xError* /* we */
-#endif
);
WireToErrorType XESetWireToError(dpy, error_number, proc)
diff --git a/src/IntAtom.c b/src/IntAtom.c
index 237b670..106ce69 100644
--- a/src/IntAtom.c
+++ b/src/IntAtom.c
@@ -26,7 +26,7 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/lib/X11/IntAtom.c,v 1.6 2001/12/14 19:54:02 dawes Exp $ */
+/* $XFree86: xc/lib/X11/IntAtom.c,v 1.7 2003/11/17 22:20:07 dawes Exp $ */
#define NEED_REPLIES
#include "Xlibint.h"
@@ -159,17 +159,11 @@ _XUpdateAtomCache(dpy, name, atom, sig, idx, n)
}
}
-#if NeedFunctionPrototypes
-Atom XInternAtom (
+Atom
+XInternAtom (
Display *dpy,
const char *name,
Bool onlyIfExists)
-#else
-Atom XInternAtom (dpy, name, onlyIfExists)
- Display *dpy;
- char *name;
- Bool onlyIfExists;
-#endif
{
Atom atom;
unsigned long sig;
diff --git a/src/Key.h b/src/Key.h
new file mode 100644
index 0000000..2cfb82a
--- /dev/null
+++ b/src/Key.h
@@ -0,0 +1,18 @@
+/* $XFree86: xc/lib/X11/Key.h,v 1.1 2003/04/13 19:22:16 dawes Exp $ */
+
+#ifndef _KEY_H_
+#define _KEY_H_
+
+#ifndef NEEDKTABLE
+extern const unsigned char _XkeyTable[];
+#endif
+
+extern int
+_XKeyInitialize(
+ Display *dpy);
+
+extern XrmDatabase
+_XInitKeysymDB(
+ void);
+
+#endif /* _KEY_H_ */
diff --git a/src/KeyBind.c b/src/KeyBind.c
index e3b4094..6f44f6b 100644
--- a/src/KeyBind.c
+++ b/src/KeyBind.c
@@ -24,7 +24,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/KeyBind.c,v 1.5 2001/12/14 19:54:02 dawes Exp $ */
+/* $XFree86: xc/lib/X11/KeyBind.c,v 1.9 2003/11/17 22:20:07 dawes Exp $ */
/* Beware, here be monsters (still under construction... - JG */
@@ -36,9 +36,13 @@ in this Software without prior written authorization from The Open Group.
#define XK_LATIN2
#define XK_LATIN3
#define XK_LATIN4
+#define XK_LATIN8
+#define XK_LATIN9
#define XK_CYRILLIC
#define XK_GREEK
#define XK_ARMENIAN
+#define XK_CAUCASUS
+#define XK_VIETNAMESE
#define XK_XKB_KEYS
#include <X11/keysymdef.h>
#include <stdio.h>
@@ -47,9 +51,12 @@ in this Software without prior written authorization from The Open Group.
#ifdef USE_OWN_COMPOSE
#include "imComp.h"
-
#endif
+#include "Xresource.h"
+#include "XKBlibint.h"
+#include "Key.h"
+
#ifdef XKB
#define XKeycodeToKeysym _XKeycodeToKeysym
#define XKeysymToKeycode _XKeysymToKeycode
@@ -64,8 +71,10 @@ in this Software without prior written authorization from The Open Group.
#define AllMods (ShiftMask|LockMask|ControlMask| \
Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask)
-static void ComputeMaskFromKeytrans();
-int _XKeyInitialize();
+static void
+ComputeMaskFromKeytrans(
+ Display *dpy,
+ register struct _XKeytrans *p);
struct _XKeytrans {
struct _XKeytrans *next;/* next on list */
@@ -78,14 +87,7 @@ struct _XKeytrans {
};
static KeySym
-#if NeedFunctionPrototypes
KeyCodetoKeySym(register Display *dpy, KeyCode keycode, int col)
-#else
-KeyCodetoKeySym(dpy, keycode, col)
- register Display *dpy;
- KeyCode keycode;
- int col;
-#endif
{
register int per = dpy->keysyms_per_keycode;
register KeySym *syms;
@@ -116,7 +118,6 @@ KeyCodetoKeySym(dpy, keycode, col)
return syms[col];
}
-#if NeedFunctionPrototypes
KeySym
XKeycodeToKeysym(Display *dpy,
#if NeedWidePrototypes
@@ -125,13 +126,6 @@ XKeycodeToKeysym(Display *dpy,
KeyCode kc,
#endif
int col)
-#else
-KeySym
-XKeycodeToKeysym(dpy, kc, col)
- Display *dpy;
- KeyCode kc;
- int col;
-#endif
{
if ((! dpy->keysyms) && (! _XKeyInitialize(dpy)))
return NoSymbol;
@@ -167,8 +161,8 @@ XLookupKeysym(event, col)
}
static void
-ResetModMap(dpy)
- Display *dpy;
+ResetModMap(
+ Display *dpy)
{
register XModifierKeymap *map;
register int i, j, n;
@@ -216,8 +210,8 @@ ResetModMap(dpy)
}
static int
-InitModMap(dpy)
- Display *dpy;
+InitModMap(
+ Display *dpy)
{
register XModifierKeymap *map;
@@ -265,8 +259,8 @@ XRefreshKeyboardMapping(event)
}
int
-_XKeyInitialize(dpy)
- Display *dpy;
+_XKeyInitialize(
+ Display *dpy)
{
int per, n;
KeySym *keysyms;
@@ -295,14 +289,372 @@ _XKeyInitialize(dpy)
return 1;
}
+static void
+UCSConvertCase( register unsigned code,
+ KeySym *lower,
+ KeySym *upper )
+{
+ /* Case conversion for UCS, as in Unicode Data version 4.0.0 */
+ /* NB: Only converts simple one-to-one mappings. */
+
+ /* Tables are used where they take less space than */
+ /* the code to work out the mappings. Zero values mean */
+ /* undefined code points. */
+
+ static unsigned short const IPAExt_upper_mapping[] = { /* part only */
+ 0x0181, 0x0186, 0x0255, 0x0189, 0x018A,
+ 0x0258, 0x018F, 0x025A, 0x0190, 0x025C, 0x025D, 0x025E, 0x025F,
+ 0x0193, 0x0261, 0x0262, 0x0194, 0x0264, 0x0265, 0x0266, 0x0267,
+ 0x0197, 0x0196, 0x026A, 0x026B, 0x026C, 0x026D, 0x026E, 0x019C,
+ 0x0270, 0x0271, 0x019D, 0x0273, 0x0274, 0x019F, 0x0276, 0x0277,
+ 0x0278, 0x0279, 0x027A, 0x027B, 0x027C, 0x027D, 0x027E, 0x027F,
+ 0x01A6, 0x0281, 0x0282, 0x01A9, 0x0284, 0x0285, 0x0286, 0x0287,
+ 0x01AE, 0x0289, 0x01B1, 0x01B2, 0x028C, 0x028D, 0x028E, 0x028F,
+ 0x0290, 0x0291, 0x01B7
+ };
+
+ static unsigned short const LatinExtB_upper_mapping[] = { /* first part only */
+ 0x0180, 0x0181, 0x0182, 0x0182, 0x0184, 0x0184, 0x0186, 0x0187,
+ 0x0187, 0x0189, 0x018A, 0x018B, 0x018B, 0x018D, 0x018E, 0x018F,
+ 0x0190, 0x0191, 0x0191, 0x0193, 0x0194, 0x01F6, 0x0196, 0x0197,
+ 0x0198, 0x0198, 0x019A, 0x019B, 0x019C, 0x019D, 0x0220, 0x019F,
+ 0x01A0, 0x01A0, 0x01A2, 0x01A2, 0x01A4, 0x01A4, 0x01A6, 0x01A7,
+ 0x01A7, 0x01A9, 0x01AA, 0x01AB, 0x01AC, 0x01AC, 0x01AE, 0x01AF,
+ 0x01AF, 0x01B1, 0x01B2, 0x01B3, 0x01B3, 0x01B5, 0x01B5, 0x01B7,
+ 0x01B8, 0x01B8, 0x01BA, 0x01BB, 0x01BC, 0x01BC, 0x01BE, 0x01F7,
+ 0x01C0, 0x01C1, 0x01C2, 0x01C3, 0x01C4, 0x01C4, 0x01C4, 0x01C7,
+ 0x01C7, 0x01C7, 0x01CA, 0x01CA, 0x01CA
+ };
+
+ static unsigned short const LatinExtB_lower_mapping[] = { /* first part only */
+ 0x0180, 0x0253, 0x0183, 0x0183, 0x0185, 0x0185, 0x0254, 0x0188,
+ 0x0188, 0x0256, 0x0257, 0x018C, 0x018C, 0x018D, 0x01DD, 0x0259,
+ 0x025B, 0x0192, 0x0192, 0x0260, 0x0263, 0x0195, 0x0269, 0x0268,
+ 0x0199, 0x0199, 0x019A, 0x019B, 0x026F, 0x0272, 0x019E, 0x0275,
+ 0x01A1, 0x01A1, 0x01A3, 0x01A3, 0x01A5, 0x01A5, 0x0280, 0x01A8,
+ 0x01A8, 0x0283, 0x01AA, 0x01AB, 0x01AD, 0x01AD, 0x0288, 0x01B0,
+ 0x01B0, 0x028A, 0x028B, 0x01B4, 0x01B4, 0x01B6, 0x01B6, 0x0292,
+ 0x01B9, 0x01B9, 0x01BA, 0x01BB, 0x01BD, 0x01BD, 0x01BE, 0x01BF,
+ 0x01C0, 0x01C1, 0x01C2, 0x01C3, 0x01C6, 0x01C6, 0x01C6, 0x01C9,
+ 0x01C9, 0x01C9, 0x01CC, 0x01CC, 0x01CC
+ };
+
+ static unsigned short const Greek_upper_mapping[] = {
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0374, 0x0375, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x037A, 0x0000, 0x0000, 0x0000, 0x037E, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0384, 0x0385, 0x0386, 0x0387,
+ 0x0388, 0x0389, 0x038A, 0x0000, 0x038C, 0x0000, 0x038E, 0x038F,
+ 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397,
+ 0x0398, 0x0399, 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F,
+ 0x03A0, 0x03A1, 0x0000, 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7,
+ 0x03A8, 0x03A9, 0x03AA, 0x03AB, 0x0386, 0x0388, 0x0389, 0x038A,
+ 0x03B0, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397,
+ 0x0398, 0x0399, 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F,
+ 0x03A0, 0x03A1, 0x03A3, 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7,
+ 0x03A8, 0x03A9, 0x03AA, 0x03AB, 0x038C, 0x038E, 0x038F, 0x0000,
+ 0x0392, 0x0398, 0x03D2, 0x03D3, 0x03D4, 0x03A6, 0x03A0, 0x03D7,
+ 0x03D8, 0x03D8, 0x03DA, 0x03DA, 0x03DC, 0x03DC, 0x03DE, 0x03DE,
+ 0x03E0, 0x03E0, 0x03E2, 0x03E2, 0x03E4, 0x03E4, 0x03E6, 0x03E6,
+ 0x03E8, 0x03E8, 0x03EA, 0x03EA, 0x03EC, 0x03EC, 0x03EE, 0x03EE,
+ 0x039A, 0x03A1, 0x03F9, 0x03F3, 0x03F4, 0x0395, 0x03F6, 0x03F7,
+ 0x03F7, 0x03F9, 0x03FA, 0x03FA, 0x0000, 0x0000, 0x0000, 0x0000
+ };
+
+ static unsigned short const Greek_lower_mapping[] = {
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0374, 0x0375, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x037A, 0x0000, 0x0000, 0x0000, 0x037E, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0384, 0x0385, 0x03AC, 0x0387,
+ 0x03AD, 0x03AE, 0x03AF, 0x0000, 0x03CC, 0x0000, 0x03CD, 0x03CE,
+ 0x0390, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7,
+ 0x03B8, 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF,
+ 0x03C0, 0x03C1, 0x0000, 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7,
+ 0x03C8, 0x03C9, 0x03CA, 0x03CB, 0x03AC, 0x03AD, 0x03AE, 0x03AF,
+ 0x03B0, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7,
+ 0x03B8, 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF,
+ 0x03C0, 0x03C1, 0x03C2, 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7,
+ 0x03C8, 0x03C9, 0x03CA, 0x03CB, 0x03CC, 0x03CD, 0x03CE, 0x0000,
+ 0x03D0, 0x03D1, 0x03D2, 0x03D3, 0x03D4, 0x03D5, 0x03D6, 0x03D7,
+ 0x03D9, 0x03D9, 0x03DB, 0x03DB, 0x03DD, 0x03DD, 0x03DF, 0x03DF,
+ 0x03E1, 0x03E1, 0x03E3, 0x03E3, 0x03E5, 0x03E5, 0x03E7, 0x03E7,
+ 0x03E9, 0x03E9, 0x03EB, 0x03EB, 0x03ED, 0x03ED, 0x03EF, 0x03EF,
+ 0x03F0, 0x03F1, 0x03F2, 0x03F3, 0x03B8, 0x03F5, 0x03F6, 0x03F8,
+ 0x03F8, 0x03F2, 0x03FB, 0x03FB, 0x0000, 0x0000, 0x0000, 0x0000
+ };
+
+ static unsigned short const GreekExt_lower_mapping[] = {
+ 0x1F00, 0x1F01, 0x1F02, 0x1F03, 0x1F04, 0x1F05, 0x1F06, 0x1F07,
+ 0x1F00, 0x1F01, 0x1F02, 0x1F03, 0x1F04, 0x1F05, 0x1F06, 0x1F07,
+ 0x1F10, 0x1F11, 0x1F12, 0x1F13, 0x1F14, 0x1F15, 0x0000, 0x0000,
+ 0x1F10, 0x1F11, 0x1F12, 0x1F13, 0x1F14, 0x1F15, 0x0000, 0x0000,
+ 0x1F20, 0x1F21, 0x1F22, 0x1F23, 0x1F24, 0x1F25, 0x1F26, 0x1F27,
+ 0x1F20, 0x1F21, 0x1F22, 0x1F23, 0x1F24, 0x1F25, 0x1F26, 0x1F27,
+ 0x1F30, 0x1F31, 0x1F32, 0x1F33, 0x1F34, 0x1F35, 0x1F36, 0x1F37,
+ 0x1F30, 0x1F31, 0x1F32, 0x1F33, 0x1F34, 0x1F35, 0x1F36, 0x1F37,
+ 0x1F40, 0x1F41, 0x1F42, 0x1F43, 0x1F44, 0x1F45, 0x0000, 0x0000,
+ 0x1F40, 0x1F41, 0x1F42, 0x1F43, 0x1F44, 0x1F45, 0x0000, 0x0000,
+ 0x1F50, 0x1F51, 0x1F52, 0x1F53, 0x1F54, 0x1F55, 0x1F56, 0x1F57,
+ 0x0000, 0x1F51, 0x0000, 0x1F53, 0x0000, 0x1F55, 0x0000, 0x1F57,
+ 0x1F60, 0x1F61, 0x1F62, 0x1F63, 0x1F64, 0x1F65, 0x1F66, 0x1F67,
+ 0x1F60, 0x1F61, 0x1F62, 0x1F63, 0x1F64, 0x1F65, 0x1F66, 0x1F67,
+ 0x1F70, 0x1F71, 0x1F72, 0x1F73, 0x1F74, 0x1F75, 0x1F76, 0x1F77,
+ 0x1F78, 0x1F79, 0x1F7A, 0x1F7B, 0x1F7C, 0x1F7D, 0x0000, 0x0000,
+ 0x1F80, 0x1F81, 0x1F82, 0x1F83, 0x1F84, 0x1F85, 0x1F86, 0x1F87,
+ 0x1F80, 0x1F81, 0x1F82, 0x1F83, 0x1F84, 0x1F85, 0x1F86, 0x1F87,
+ 0x1F90, 0x1F91, 0x1F92, 0x1F93, 0x1F94, 0x1F95, 0x1F96, 0x1F97,
+ 0x1F90, 0x1F91, 0x1F92, 0x1F93, 0x1F94, 0x1F95, 0x1F96, 0x1F97,
+ 0x1FA0, 0x1FA1, 0x1FA2, 0x1FA3, 0x1FA4, 0x1FA5, 0x1FA6, 0x1FA7,
+ 0x1FA0, 0x1FA1, 0x1FA2, 0x1FA3, 0x1FA4, 0x1FA5, 0x1FA6, 0x1FA7,
+ 0x1FB0, 0x1FB1, 0x1FB2, 0x1FB3, 0x1FB4, 0x0000, 0x1FB6, 0x1FB7,
+ 0x1FB0, 0x1FB1, 0x1F70, 0x1F71, 0x1FB3, 0x1FBD, 0x1FBE, 0x1FBF,
+ 0x1FC0, 0x1FC1, 0x1FC2, 0x1FC3, 0x1FC4, 0x0000, 0x1FC6, 0x1FC7,
+ 0x1F72, 0x1F73, 0x1F74, 0x1F75, 0x1FC3, 0x1FCD, 0x1FCE, 0x1FCF,
+ 0x1FD0, 0x1FD1, 0x1FD2, 0x1FD3, 0x0000, 0x0000, 0x1FD6, 0x1FD7,
+ 0x1FD0, 0x1FD1, 0x1F76, 0x1F77, 0x0000, 0x1FDD, 0x1FDE, 0x1FDF,
+ 0x1FE0, 0x1FE1, 0x1FE2, 0x1FE3, 0x1FE4, 0x1FE5, 0x1FE6, 0x1FE7,
+ 0x1FE0, 0x1FE1, 0x1F7A, 0x1F7B, 0x1FE5, 0x1FED, 0x1FEE, 0x1FEF,
+ 0x0000, 0x0000, 0x1FF2, 0x1FF3, 0x1FF4, 0x0000, 0x1FF6, 0x1FF7,
+ 0x1F78, 0x1F79, 0x1F7C, 0x1F7D, 0x1FF3, 0x1FFD, 0x1FFE, 0x0000
+ };
+
+ static unsigned short const GreekExt_upper_mapping[] = {
+ 0x1F08, 0x1F09, 0x1F0A, 0x1F0B, 0x1F0C, 0x1F0D, 0x1F0E, 0x1F0F,
+ 0x1F08, 0x1F09, 0x1F0A, 0x1F0B, 0x1F0C, 0x1F0D, 0x1F0E, 0x1F0F,
+ 0x1F18, 0x1F19, 0x1F1A, 0x1F1B, 0x1F1C, 0x1F1D, 0x0000, 0x0000,
+ 0x1F18, 0x1F19, 0x1F1A, 0x1F1B, 0x1F1C, 0x1F1D, 0x0000, 0x0000,
+ 0x1F28, 0x1F29, 0x1F2A, 0x1F2B, 0x1F2C, 0x1F2D, 0x1F2E, 0x1F2F,
+ 0x1F28, 0x1F29, 0x1F2A, 0x1F2B, 0x1F2C, 0x1F2D, 0x1F2E, 0x1F2F,
+ 0x1F38, 0x1F39, 0x1F3A, 0x1F3B, 0x1F3C, 0x1F3D, 0x1F3E, 0x1F3F,
+ 0x1F38, 0x1F39, 0x1F3A, 0x1F3B, 0x1F3C, 0x1F3D, 0x1F3E, 0x1F3F,
+ 0x1F48, 0x1F49, 0x1F4A, 0x1F4B, 0x1F4C, 0x1F4D, 0x0000, 0x0000,
+ 0x1F48, 0x1F49, 0x1F4A, 0x1F4B, 0x1F4C, 0x1F4D, 0x0000, 0x0000,
+ 0x1F50, 0x1F59, 0x1F52, 0x1F5B, 0x1F54, 0x1F5D, 0x1F56, 0x1F5F,
+ 0x0000, 0x1F59, 0x0000, 0x1F5B, 0x0000, 0x1F5D, 0x0000, 0x1F5F,
+ 0x1F68, 0x1F69, 0x1F6A, 0x1F6B, 0x1F6C, 0x1F6D, 0x1F6E, 0x1F6F,
+ 0x1F68, 0x1F69, 0x1F6A, 0x1F6B, 0x1F6C, 0x1F6D, 0x1F6E, 0x1F6F,
+ 0x1FBA, 0x1FBB, 0x1FC8, 0x1FC9, 0x1FCA, 0x1FCB, 0x1FDA, 0x1FDB,
+ 0x1FF8, 0x1FF9, 0x1FEA, 0x1FEB, 0x1FFA, 0x1FFB, 0x0000, 0x0000,
+ 0x1F88, 0x1F89, 0x1F8A, 0x1F8B, 0x1F8C, 0x1F8D, 0x1F8E, 0x1F8F,
+ 0x1F88, 0x1F89, 0x1F8A, 0x1F8B, 0x1F8C, 0x1F8D, 0x1F8E, 0x1F8F,
+ 0x1F98, 0x1F99, 0x1F9A, 0x1F9B, 0x1F9C, 0x1F9D, 0x1F9E, 0x1F9F,
+ 0x1F98, 0x1F99, 0x1F9A, 0x1F9B, 0x1F9C, 0x1F9D, 0x1F9E, 0x1F9F,
+ 0x1FA8, 0x1FA9, 0x1FAA, 0x1FAB, 0x1FAC, 0x1FAD, 0x1FAE, 0x1FAF,
+ 0x1FA8, 0x1FA9, 0x1FAA, 0x1FAB, 0x1FAC, 0x1FAD, 0x1FAE, 0x1FAF,
+ 0x1FB8, 0x1FB9, 0x1FB2, 0x1FBC, 0x1FB4, 0x0000, 0x1FB6, 0x1FB7,
+ 0x1FB8, 0x1FB9, 0x1FBA, 0x1FBB, 0x1FBC, 0x1FBD, 0x0399, 0x1FBF,
+ 0x1FC0, 0x1FC1, 0x1FC2, 0x1FCC, 0x1FC4, 0x0000, 0x1FC6, 0x1FC7,
+ 0x1FC8, 0x1FC9, 0x1FCA, 0x1FCB, 0x1FCC, 0x1FCD, 0x1FCE, 0x1FCF,
+ 0x1FD8, 0x1FD9, 0x1FD2, 0x1FD3, 0x0000, 0x0000, 0x1FD6, 0x1FD7,
+ 0x1FD8, 0x1FD9, 0x1FDA, 0x1FDB, 0x0000, 0x1FDD, 0x1FDE, 0x1FDF,
+ 0x1FE8, 0x1FE9, 0x1FE2, 0x1FE3, 0x1FE4, 0x1FEC, 0x1FE6, 0x1FE7,
+ 0x1FE8, 0x1FE9, 0x1FEA, 0x1FEB, 0x1FEC, 0x1FED, 0x1FEE, 0x1FEF,
+ 0x0000, 0x0000, 0x1FF2, 0x1FFC, 0x1FF4, 0x0000, 0x1FF6, 0x1FF7,
+ 0x1FF8, 0x1FF9, 0x1FFA, 0x1FFB, 0x1FFC, 0x1FFD, 0x1FFE, 0x0000
+ };
+
+ *lower = code;
+ *upper = code;
+
+ /* Basic Latin and Latin-1 Supplement, U+0000 to U+00FF */
+ if (code <= 0x00ff) {
+ if (code >= 0x0041 && code <= 0x005a)
+ *lower += 0x20;
+ else if (code >= 0x0061 && code <= 0x007a)
+ *upper -= 0x20;
+ else if ( (code >= 0x00c0 && code <= 0x00d6) ||
+ (code >= 0x00d8 && code <= 0x00de) )
+ *lower += 0x20;
+ else if ( (code >= 0x00e0 && code <= 0x00f6) ||
+ (code >= 0x00f8 && code <= 0x00fe) )
+ *upper -= 0x20;
+ else if (code == 0x00ff)
+ *upper = 0x0178;
+ else if (code == 0x00b5)
+ *upper = 0x039c;
+ }
+
+ /* Latin Extended-A, U+0100 to U+017F */
+ if (code >= 0x0100 && code <= 0x017f) {
+ if ( (code >= 0x0100 && code <= 0x012f) ||
+ (code >= 0x0132 && code <= 0x0137) ||
+ (code >= 0x014a && code <= 0x0177) ) {
+ *upper = code & ~1;
+ *lower = code | 1;
+ }
+ else if ( (code >= 0x0139 && code <= 0x0148) ||
+ (code >= 0x0179 && code <= 0x017e) ) {
+ if (code & 1)
+ *lower += 1;
+ else
+ *upper -= 1;
+ }
+ else if (code == 0x0130)
+ *lower = 0x0069;
+ else if (code == 0x0131)
+ *upper = 0x0049;
+ else if (code == 0x0178)
+ *lower = 0x00ff;
+ else if (code == 0x017f)
+ *upper = 0x0053;
+ }
+
+ /* Latin Extended-B, U+0180 to U+024F */
+ if (code >= 0x0180 && code <= 0x024f) {
+ if (code >= 0x01cd && code <= 0x01dc) {
+ if (code & 1)
+ *lower += 1;
+ else
+ *upper -= 1;
+ }
+ else if ( (code >= 0x01de && code <= 0x01ef) ||
+ (code >= 0x01f4 && code <= 0x01f5) ||
+ (code >= 0x01f8 && code <= 0x021f) ||
+ (code >= 0x0222 && code <= 0x0233) ) {
+ *lower |= 1;
+ *upper &= ~1;
+ }
+ else if (code >= 0x0180 && code <= 0x01cc) {
+ *lower = LatinExtB_lower_mapping[code - 0x0180];
+ *upper = LatinExtB_upper_mapping[code - 0x0180];
+ }
+ else if (code == 0x01dd)
+ *upper = 0x018e;
+ else if (code == 0x01f1 || code == 0x01f2) {
+ *lower = 0x01f3;
+ *upper = 0x01f1;
+ }
+ else if (code == 0x01f3)
+ *upper = 0x01f1;
+ else if (code == 0x01f6)
+ *lower = 0x0195;
+ else if (code == 0x01f7)
+ *lower = 0x01bf;
+ else if (code == 0x0220)
+ *lower = 0x019e;
+ }
+
+ /* IPA Extensions, U+0250 to U+02AF */
+ if (code >= 0x0253 && code <= 0x0292) {
+ *upper = IPAExt_upper_mapping[code - 0x0253];
+ }
+
+ /* Combining Diacritical Marks, U+0300 to U+036F */
+ if (code == 0x0345) {
+ *upper = 0x0399;
+ }
+
+ /* Greek and Coptic, U+0370 to U+03FF */
+ if (code >= 0x0370 && code <= 0x03ff) {
+ *lower = Greek_lower_mapping[code - 0x0370];
+ *upper = Greek_upper_mapping[code - 0x0370];
+ if (*upper == 0)
+ *upper = code;
+ if (*lower == 0)
+ *lower = code;
+ }
+
+ /* Cyrillic and Cyrillic Supplementary, U+0400 to U+052F */
+ if ( (code >= 0x0400 && code <= 0x04ff) ||
+ (code >= 0x0500 && code <= 0x052f) ) {
+ if (code >= 0x0400 && code <= 0x040f)
+ *lower += 0x50;
+ else if (code >= 0x0410 && code <= 0x042f)
+ *lower += 0x20;
+ else if (code >= 0x0430 && code <= 0x044f)
+ *upper -= 0x20;
+ else if (code >= 0x0450 && code <= 0x045f)
+ *upper -= 0x50;
+ else if ( (code >= 0x0460 && code <= 0x0481) ||
+ (code >= 0x048a && code <= 0x04bf) ||
+ (code >= 0x04d0 && code <= 0x04f5) ||
+ (code >= 0x04f8 && code <= 0x04f9) ||
+ (code >= 0x0500 && code <= 0x050f) ) {
+ *upper &= ~1;
+ *lower |= 1;
+ }
+ else if (code >= 0x04c1 && code <= 0x04ce) {
+ if (code & 1)
+ *lower += 1;
+ else
+ *upper -= 1;
+ }
+ }
+
+ /* Armenian, U+0530 to U+058F */
+ if (code >= 0x0530 && code <= 0x058f) {
+ if (code >= 0x0531 && code <= 0x0556)
+ *lower += 0x30;
+ else if (code >=0x0561 && code <= 0x0586)
+ *upper -= 0x30;
+ }
+
+ /* Latin Extended Additional, U+1E00 to U+1EFF */
+ if (code >= 0x1e00 && code <= 0x1eff) {
+ if ( (code >= 0x1e00 && code <= 0x1e95) ||
+ (code >= 0x1ea0 && code <= 0x1ef9) ) {
+ *upper &= ~1;
+ *lower |= 1;
+ }
+ else if (code == 0x1e9b)
+ *upper = 0x1e60;
+ }
+
+ /* Greek Extended, U+1F00 to U+1FFF */
+ if (code >= 0x1f00 && code <= 0x1fff) {
+ *lower = GreekExt_lower_mapping[code - 0x1f00];
+ *upper = GreekExt_upper_mapping[code - 0x1f00];
+ if (*upper == 0)
+ *upper = code;
+ if (*lower == 0)
+ *lower = code;
+ }
+
+ /* Letterlike Symbols, U+2100 to U+214F */
+ if (code >= 0x2100 && code <= 0x214f) {
+ switch (code) {
+ case 0x2126: *lower = 0x03c9; break;
+ case 0x212a: *lower = 0x006b; break;
+ case 0x212b: *lower = 0x00e5; break;
+ }
+ }
+ /* Number Forms, U+2150 to U+218F */
+ else if (code >= 0x2160 && code <= 0x216f)
+ *lower += 0x10;
+ else if (code >= 0x2170 && code <= 0x217f)
+ *upper -= 0x10;
+ /* Enclosed Alphanumerics, U+2460 to U+24FF */
+ else if (code >= 0x24b6 && code <= 0x24cf)
+ *lower += 0x1a;
+ else if (code >= 0x24d0 && code <= 0x24e9)
+ *upper -= 0x1a;
+ /* Halfwidth and Fullwidth Forms, U+FF00 to U+FFEF */
+ else if (code >= 0xff21 && code <= 0xff3a)
+ *lower += 0x20;
+ else if (code >= 0xff41 && code <= 0xff5a)
+ *upper -= 0x20;
+ /* Deseret, U+10400 to U+104FF */
+ else if (code >= 0x10400 && code <= 0x10427)
+ *lower += 0x28;
+ else if (code >= 0x10428 && code <= 0x1044f)
+ *upper -= 0x28;
+}
+
void
XConvertCase(sym, lower, upper)
register KeySym sym;
KeySym *lower;
KeySym *upper;
{
+ /* Unicode keysym */
+ if ((sym & 0xff000000) == 0x01000000) {
+ UCSConvertCase((sym & 0x00ffffff), lower, upper);
+ *upper |= 0x01000000;
+ *lower |= 0x01000000;
+ return;
+ }
+
*lower = sym;
*upper = sym;
+
switch(sym >> 8) {
case 0: /* Latin 1 */
if ((sym >= XK_A) && (sym <= XK_Z))
@@ -317,6 +669,8 @@ XConvertCase(sym, lower, upper)
*lower += (XK_oslash - XK_Ooblique);
else if ((sym >= XK_oslash) && (sym <= XK_thorn))
*upper -= (XK_oslash - XK_Ooblique);
+ else if (sym == XK_ydiaeresis)
+ *upper = XK_Ydiaeresis; /* actually a Latin 9 character */
break;
case 1: /* Latin 2 */
/* Assume the KeySym is a legal value (ignore discontinuities) */
@@ -396,30 +750,119 @@ XConvertCase(sym, lower, upper)
sym != XK_Greek_finalsmallsigma)
*upper -= (XK_Greek_alpha - XK_Greek_ALPHA);
break;
+ case 0x12: /* Latin 8 */
+ /* No neat pattern to the values */
+ switch (sym) {
+ case XK_Babovedot:
+ *lower = XK_babovedot; break;
+ case XK_babovedot:
+ *upper = XK_Babovedot; break;
+ case XK_Dabovedot:
+ *lower = XK_dabovedot; break;
+ case XK_Wgrave:
+ *lower = XK_wgrave; break;
+ case XK_Wacute:
+ *lower = XK_wacute; break;
+ case XK_dabovedot:
+ *upper = XK_Dabovedot; break;
+ case XK_Ygrave:
+ *lower = XK_ygrave; break;
+ case XK_Fabovedot:
+ *lower = XK_fabovedot; break;
+ case XK_fabovedot:
+ *upper = XK_Fabovedot; break;
+ case XK_Mabovedot:
+ *lower = XK_mabovedot; break;
+ case XK_mabovedot:
+ *upper = XK_Mabovedot; break;
+ case XK_Pabovedot:
+ *lower = XK_pabovedot; break;
+ case XK_wgrave:
+ *upper = XK_Wgrave; break;
+ case XK_pabovedot:
+ *upper = XK_Pabovedot; break;
+ case XK_wacute:
+ *upper = XK_Wacute; break;
+ case XK_Sabovedot:
+ *lower = XK_sabovedot; break;
+ case XK_ygrave:
+ *upper = XK_Ygrave; break;
+ case XK_Wdiaeresis:
+ *lower = XK_wdiaeresis; break;
+ case XK_wdiaeresis:
+ *upper = XK_Wdiaeresis; break;
+ case XK_sabovedot:
+ *upper = XK_Sabovedot; break;
+ case XK_Wcircumflex:
+ *lower = XK_wcircumflex; break;
+ case XK_Tabovedot:
+ *lower = XK_tabovedot; break;
+ case XK_Ycircumflex:
+ *lower = XK_ycircumflex; break;
+ case XK_wcircumflex:
+ *upper = XK_Wcircumflex; break;
+ case XK_tabovedot:
+ *upper = XK_Tabovedot; break;
+ case XK_ycircumflex:
+ *upper = XK_Ycircumflex; break;
+ }
+ break;
+ case 0x13: /* Latin 9 */
+ if (sym == XK_OE)
+ *lower = XK_oe;
+ else if (sym == XK_oe)
+ *upper = XK_OE;
+ else if (sym == XK_Ydiaeresis)
+ *lower = XK_ydiaeresis;
+ break;
case 0x14: /* Armenian */
if (sym >= XK_Armenian_AYB && sym <= XK_Armenian_fe) {
*lower = sym | 1;
*upper = sym & ~1;
}
break;
+ case 0x16: /* Caucasus, Inupiak, Guarani */
+ if (sym == XK_ocaron || sym == XK_Ocaron) {
+ *upper = XK_Ocaron;
+ *lower = XK_ocaron;
+ }
+ else if (sym >= XK_Ccedillaabovedot && sym <= XK_Obarred)
+ *lower += (XK_ccedillaabovedot - XK_Ccedillaabovedot);
+ else if (sym >= XK_ccedillaabovedot && sym <= XK_obarred)
+ *upper -= (XK_ccedillaabovedot - XK_Ccedillaabovedot);
+ else if (sym == XK_schwa || sym == XK_SCHWA) {
+ *lower = XK_schwa;
+ *upper = XK_SCHWA;
+ }
+ else if (sym == XK_lbelowdot || sym == XK_Lbelowdot) {
+ *lower = XK_lbelowdot;
+ *upper = XK_Lbelowdot;
+ }
+ else if (sym == XK_lstrokebelowdot || sym == XK_Lstrokebelowdot) {
+ *lower = XK_lstrokebelowdot;
+ *upper = XK_Lstrokebelowdot;
+ }
+ else if (sym == XK_gtilde || sym == XK_Gtilde) {
+ *lower = XK_gtilde;
+ *upper = XK_Gtilde;
+ }
+ break;
+ case 0x1e: /* Vietnamese */
+ if ((sym >= XK_Abelowdot && sym <= XK_uhornbelowdot) ||
+ (sym >= XK_Ybelowdot && sym <= XK_uhorn)) {
+ *lower = sym | 1;
+ *upper = sym & ~1;
+ }
+ break;
}
}
int
-#if NeedFunctionPrototypes
_XTranslateKey( register Display *dpy,
KeyCode keycode,
register unsigned int modifiers,
unsigned int *modifiers_return,
KeySym *keysym_return)
-#else
-_XTranslateKey(dpy, keycode, modifiers, modifiers_return, keysym_return)
- register Display *dpy;
- KeyCode keycode;
- register unsigned int modifiers;
- unsigned int *modifiers_return;
- KeySym *keysym_return;
-#endif
{
int per;
register KeySym *syms;
@@ -624,8 +1067,8 @@ XLookupString (event, buffer, nbytes, keysym, status)
}
static void
-_XFreeKeyBindings (dpy)
- Display *dpy;
+_XFreeKeyBindings(
+ Display *dpy)
{
register struct _XKeytrans *p, *np;
@@ -638,7 +1081,6 @@ _XFreeKeyBindings (dpy)
}
int
-#if NeedFunctionPrototypes
XRebindKeysym (
Display *dpy,
KeySym keysym,
@@ -646,15 +1088,6 @@ XRebindKeysym (
int nm, /* number of modifiers in mlist */
_Xconst unsigned char *str,
int nbytes)
-#else
-XRebindKeysym (dpy, keysym, mlist, nm, str, nbytes)
- Display *dpy;
- KeySym keysym;
- KeySym *mlist;
- int nm; /* number of modifiers in mlist */
- unsigned char *str;
- int nbytes;
-#endif
{
register struct _XKeytrans *tmp, *p;
int nb;
@@ -693,9 +1126,9 @@ XRebindKeysym (dpy, keysym, mlist, nm, str, nbytes)
}
unsigned
-_XKeysymToModifiers(dpy,ks)
- Display *dpy;
- KeySym ks;
+_XKeysymToModifiers(
+ Display *dpy,
+ KeySym ks)
{
CARD8 code,mods;
register KeySym *kmax;
@@ -732,9 +1165,9 @@ _XKeysymToModifiers(dpy,ks)
* can't map some keysym to a modifier.
*/
static void
-ComputeMaskFromKeytrans(dpy, p)
- Display *dpy;
- register struct _XKeytrans *p;
+ComputeMaskFromKeytrans(
+ Display *dpy,
+ register struct _XKeytrans *p)
{
register int i;
diff --git a/src/KeysymStr.c b/src/KeysymStr.c
index 5a2faf5..0a6a3f2 100644
--- a/src/KeysymStr.c
+++ b/src/KeysymStr.c
@@ -25,7 +25,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/KeysymStr.c,v 3.8 2001/12/14 19:54:02 dawes Exp $ */
+/* $XFree86: xc/lib/X11/KeysymStr.c,v 3.10 2003/11/17 22:20:07 dawes Exp $ */
#include "Xlibint.h"
#include <X11/Xresource.h>
@@ -37,9 +37,7 @@ typedef unsigned long Signature;
#define NEEDVTABLE
#include "ks_tables.h"
-
-extern XrmDatabase _XInitKeysymDB();
-extern const unsigned char _XkeyTable[];
+#include "Key.h"
typedef struct _GRNData {
@@ -48,9 +46,9 @@ typedef struct _GRNData {
XrmValuePtr value;
} GRNData;
-#if NeedFunctionPrototypes
/*ARGSUSED*/
-static Bool SameValue(
+static Bool
+SameValue(
XrmDatabase* db,
XrmBindingList bindings,
XrmQuarkList quarks,
@@ -58,15 +56,6 @@ static Bool SameValue(
XrmValuePtr value,
XPointer data
)
-#else
-static Bool SameValue(db, bindings, quarks, type, value, data)
- XrmDatabase *db;
- XrmBindingList bindings;
- XrmQuarkList quarks;
- XrmRepresentation *type;
- XrmValuePtr value;
- XPointer data;
-#endif
{
GRNData *gd = (GRNData *)data;
diff --git a/src/LoadFont.c b/src/LoadFont.c
index 270ba32..0e6dba2 100644
--- a/src/LoadFont.c
+++ b/src/LoadFont.c
@@ -24,19 +24,14 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/LoadFont.c,v 1.4 2001/12/14 19:54:02 dawes Exp $ */
+/* $XFree86: xc/lib/X11/LoadFont.c,v 1.5 2003/11/17 22:20:07 dawes Exp $ */
#include "Xlibint.h"
-#if NeedFunctionPrototypes
-Font XLoadFont (
+Font
+XLoadFont (
register Display *dpy,
_Xconst char *name)
-#else
-Font XLoadFont (dpy, name)
- register Display *dpy;
- char *name;
-#endif
{
register long nbytes;
Font fid;
diff --git a/src/LockDis.c b/src/LockDis.c
index 9176679..7912a94 100644
--- a/src/LockDis.c
+++ b/src/LockDis.c
@@ -25,6 +25,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/X11/LockDis.c,v 1.3 2003/11/17 22:20:08 dawes Exp $ */
/*
* Author: Stephen Gildea, MIT X Consortium
@@ -37,13 +38,9 @@ in this Software without prior written authorization from The Open Group.
#include "locking.h"
#endif
-#if NeedFunctionPrototypes
-void XLockDisplay(
+void
+XLockDisplay(
register Display* dpy)
-#else
-void XLockDisplay(dpy)
- register Display* dpy;
-#endif
{
#ifdef XTHREADS
LockDisplay(dpy);
@@ -73,13 +70,9 @@ void XLockDisplay(dpy)
#endif
}
-#if NeedFunctionPrototypes
-void XUnlockDisplay(
+void
+XUnlockDisplay(
register Display* dpy)
-#else
-void XUnlockDisplay(dpy)
- register Display* dpy;
-#endif
{
#ifdef XTHREADS
LockDisplay(dpy);
diff --git a/src/LookupCol.c b/src/LookupCol.c
index 495ed7b..14ad14d 100644
--- a/src/LookupCol.c
+++ b/src/LookupCol.c
@@ -24,32 +24,21 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/LookupCol.c,v 1.5 2002/12/04 23:18:32 paulo Exp $ */
+/* $XFree86: xc/lib/X11/LookupCol.c,v 1.7 2003/11/17 22:20:08 dawes Exp $ */
#define NEED_REPLIES
#include <stdio.h>
#include "Xlibint.h"
#include "Xcmsint.h"
-extern Status _XcmsResolveColorString();
-extern void _XcmsRGB_to_XColor();
-extern void _XUnresolveColor();
-
-#if NeedFunctionPrototypes
-Status XLookupColor (
+Status
+XLookupColor (
register Display *dpy,
Colormap cmap,
_Xconst char *spec,
XColor *def,
XColor *scr)
-#else
-Status XLookupColor (dpy, cmap, spec, def, scr)
- register Display *dpy;
- Colormap cmap;
- char *spec;
- XColor *def, *scr;
-#endif
{
register int n;
xLookupColorReply reply;
diff --git a/src/Macros.c b/src/Macros.c
index 779431f..0350963 100644
--- a/src/Macros.c
+++ b/src/Macros.c
@@ -24,9 +24,12 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/Macros.c,v 1.4 2001/12/14 19:54:02 dawes Exp $ */
+/* $XFree86: xc/lib/X11/Macros.c,v 1.5 2003/04/13 19:22:17 dawes Exp $ */
#include "Xlibint.h"
+#define XUTIL_DEFINE_FUNCTIONS
+#include "Xutil.h"
+
/*
* This file makes full definitions of routines for each macro.
* We do not expect C programs to use these, but other languages may
@@ -200,39 +203,39 @@ int XScreenNumberOfScreen (scr)
*/
#undef XDestroyImage
int
-XDestroyImage(ximage)
- XImage *ximage;
+XDestroyImage(
+ XImage *ximage)
{
return((*((ximage)->f.destroy_image))((ximage)));
}
#undef XGetPixel
-unsigned long XGetPixel(ximage, x, y)
- XImage *ximage;
- int x, y;
+unsigned long XGetPixel(
+ XImage *ximage,
+ int x, int y)
{
return ((*((ximage)->f.get_pixel))((ximage), (x), (y)));
}
#undef XPutPixel
-int XPutPixel(ximage, x, y, pixel)
- XImage *ximage;
- int x, y;
- unsigned long pixel;
+int XPutPixel(
+ XImage *ximage,
+ int x, int y,
+ unsigned long pixel)
{
return((*((ximage)->f.put_pixel))((ximage), (x), (y), (pixel)));
}
#undef XSubImage
-XImage *XSubImage(ximage, x, y, width, height)
- XImage *ximage;
- int x, y;
- unsigned int width, height;
+XImage *XSubImage(
+ XImage *ximage,
+ int x, int y,
+ unsigned int width, unsigned int height)
{
return((*((ximage)->f.sub_image))((ximage), (x),
(y), (width), (height)));
}
#undef XAddPixel
-int XAddPixel(ximage, value)
- XImage *ximage;
- long value;
+int XAddPixel(
+ XImage *ximage,
+ long value)
{
return((*((ximage)->f.add_pixel))((ximage), (value)));
}
diff --git a/src/ModMap.c b/src/ModMap.c
index c355ef3..49e599d 100644
--- a/src/ModMap.c
+++ b/src/ModMap.c
@@ -24,7 +24,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/ModMap.c,v 1.4 2001/12/14 19:54:03 dawes Exp $ */
+/* $XFree86: xc/lib/X11/ModMap.c,v 1.5 2003/11/17 22:20:08 dawes Exp $ */
#define NEED_REPLIES
#include "Xlibint.h"
@@ -121,7 +121,6 @@ XFreeModifiermap(map)
return 1;
}
-#if NeedFunctionPrototypes
XModifierKeymap *
XInsertModifiermapEntry(XModifierKeymap *map,
#if NeedWidePrototypes
@@ -130,13 +129,6 @@ XInsertModifiermapEntry(XModifierKeymap *map,
KeyCode keycode,
#endif
int modifier)
-#else
-XModifierKeymap *
-XInsertModifiermapEntry(map, keycode, modifier)
- XModifierKeymap *map;
- KeyCode keycode;
- int modifier;
-#endif
{
XModifierKeymap *newmap;
int i,
@@ -171,7 +163,6 @@ XInsertModifiermapEntry(map, keycode, modifier)
return(newmap);
}
-#if NeedFunctionPrototypes
XModifierKeymap *
XDeleteModifiermapEntry(XModifierKeymap *map,
#if NeedWidePrototypes
@@ -180,13 +171,6 @@ XDeleteModifiermapEntry(XModifierKeymap *map,
KeyCode keycode,
#endif
int modifier)
-#else
-XModifierKeymap *
-XDeleteModifiermapEntry(map, keycode, modifier)
- XModifierKeymap *map;
- KeyCode keycode;
- int modifier;
-#endif
{
int i,
row = modifier * map->max_keypermod;
diff --git a/src/OMWrap.c b/src/OMWrap.c
index 7a5de02..dcb09b9 100644
--- a/src/OMWrap.c
+++ b/src/OMWrap.c
@@ -23,22 +23,14 @@
* Author: Katsuhisa Yano TOSHIBA Corp.
* mopi@osa.ilab.toshiba.co.jp
*/
-/* $XFree86: xc/lib/X11/OMWrap.c,v 1.4 2001/07/25 15:04:44 dawes Exp $ */
+/* $XFree86: xc/lib/X11/OMWrap.c,v 1.5 2003/11/17 22:20:08 dawes Exp $ */
#include "Xlibint.h"
#include "Xlcint.h"
XOM
-#if NeedFunctionPrototypes
XOpenOM(Display *dpy, XrmDatabase rdb, _Xconst char *res_name,
_Xconst char *res_class)
-#else
-XOpenOM(dpy, rdb, res_name, res_class)
- Display *dpy;
- XrmDatabase rdb;
- char *res_name;
- char *res_class;
-#endif
{
XLCd lcd = _XOpenLC((char *) NULL);
diff --git a/src/OpenDis.c b/src/OpenDis.c
index 9e9bd86..dc98f23 100644
--- a/src/OpenDis.c
+++ b/src/OpenDis.c
@@ -24,13 +24,14 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/OpenDis.c,v 3.12 2001/12/14 19:54:03 dawes Exp $ */
+/* $XFree86: xc/lib/X11/OpenDis.c,v 3.17 2003/11/17 22:20:08 dawes Exp $ */
#define NEED_REPLIES
#define NEED_EVENTS
#include "Xlibint.h"
#include <X11/Xtrans.h>
#include <X11/Xatom.h>
+#include <X11/Xresource.h>
#include "bigreqstr.h"
#include <stdio.h>
#include "Xintconn.h"
@@ -80,13 +81,9 @@ static Bool _XBigReqHandler(Display *dpy, xReply *rep, char *buf, int len,
* Connects to a server, creates a Display object and returns a pointer to
* the newly created Display back to the caller.
*/
-#if NeedFunctionPrototypes
-Display *XOpenDisplay (
+Display *
+XOpenDisplay (
register _Xconst char *display)
-#else
-Display *XOpenDisplay (display)
- register char *display;
-#endif
{
register Display *dpy; /* New Display object being created. */
register int i;
@@ -111,9 +108,12 @@ Display *XOpenDisplay (display)
xVisualType *vp;
} u; /* proto data returned from server */
long setuplength; /* number of bytes in setup message */
+ long usedbytes = 0; /* number of bytes we have processed */
char *conn_auth_name, *conn_auth_data;
int conn_auth_namelen, conn_auth_datalen;
unsigned long mask;
+ long int conn_buf_size;
+ char *xlib_buffer_size;
bzero((char *) &client, sizeof(client));
bzero((char *) &prefix, sizeof(prefix));
@@ -247,11 +247,24 @@ Display *XOpenDisplay (display)
}
/* Set up the output buffers. */
- if ((dpy->bufptr = dpy->buffer = Xcalloc(1, BUFSIZE)) == NULL) {
- OutOfMemory (dpy, setup);
- return(NULL);
- }
- dpy->bufmax = dpy->buffer + BUFSIZE;
+#ifndef XLIBDEFAULTBUFSIZE
+#define XLIBDEFAULTBUFSIZE 16384 /* 16k */
+#endif
+#ifndef XLIBMINBUFSIZE
+#define XLIBMINBUFSIZE BUFSIZE /* old default buffer size */
+#endif
+ if ((xlib_buffer_size = getenv("XLIBBUFFERSIZE")) == NULL)
+ conn_buf_size = XLIBDEFAULTBUFSIZE;
+ else
+ conn_buf_size = 1024 * strtol(xlib_buffer_size, NULL, 10);
+ if (conn_buf_size < XLIBMINBUFSIZE)
+ conn_buf_size = XLIBMINBUFSIZE;
+
+ if ((dpy->bufptr = dpy->buffer = Xcalloc(1, conn_buf_size)) == NULL) {
+ OutOfMemory (dpy, setup);
+ return(NULL);
+ }
+ dpy->bufmax = dpy->buffer + conn_buf_size;
/* Set up the input event queue and input event queue parameters. */
dpy->head = dpy->tail = NULL;
@@ -328,6 +341,7 @@ Display *XOpenDisplay (display)
return(NULL);
}
_XRead (dpy, (char *)u.setup, setuplength);
+
/*
* If the connection was not accepted by the server due to problems,
* give error message to the user....
@@ -337,14 +351,30 @@ Display *XOpenDisplay (display)
fprintf (stderr,
"Xlib: connection to \"%s\" refused by server\r\nXlib: ",
fullname);
- (void) fwrite (u.failure, (Size_t)sizeof(char),
+
+ if (prefix.lengthReason > setuplength) {
+ fprintf (stderr, "Xlib: Broken initial reply: length of reason > length of packet\r\n");
+ }else{
+ (void) fwrite (u.failure, (Size_t)sizeof(char),
(Size_t)prefix.lengthReason, stderr);
- (void) fwrite ("\r\n", sizeof(char), 2, stderr);
+ (void) fwrite ("\r\n", sizeof(char), 2, stderr);
+ }
+
OutOfMemory(dpy, setup);
return (NULL);
}
/*
+ * Check if the reply was long enough to get any information out of it.
+ */
+ usedbytes = sz_xConnSetup;
+ if (setuplength < usedbytes ) {
+ fprintf (stderr, "Xlib: Broken initial reply: Too short (%ld)\n", setuplength);
+ OutOfMemory(dpy, setup);
+ return (NULL);
+ }
+
+/*
* We succeeded at authorization, so let us move the data into
* the display structure.
*/
@@ -387,23 +417,30 @@ Display *XOpenDisplay (display)
OutOfMemory(dpy, setup);
return (NULL);
}
+
dpy->vendor = (char *) Xmalloc((unsigned) (u.setup->nbytesVendor + 1));
if (dpy->vendor == NULL) {
OutOfMemory(dpy, setup);
return (NULL);
}
vendorlen = u.setup->nbytesVendor;
- u.setup = (xConnSetup *) (((char *) u.setup) + sz_xConnSetup);
- (void) strncpy(dpy->vendor, u.vendor, vendorlen);
- dpy->vendor[vendorlen] = '\0';
- vendorlen = (vendorlen + 3) & ~3; /* round up */
+
/*
* validate setup length
*/
- if ((int) setuplength - sz_xConnSetup - vendorlen < 0) {
+ usedbytes += (vendorlen + 3) & ~3;
+ if (setuplength < usedbytes) {
+ fprintf (stderr, "Xlib: Broken initial reply: Too short (%ld)\n", setuplength);
OutOfMemory(dpy, setup);
return (NULL);
}
+
+ u.setup = (xConnSetup *) (((char *) u.setup) + sz_xConnSetup);
+ (void) strncpy(dpy->vendor, u.vendor, vendorlen);
+ dpy->vendor[vendorlen] = '\0';
+ vendorlen = (vendorlen + 3) & ~3; /* round up */
+
+
memmove (setup, u.vendor + vendorlen,
(int) setuplength - sz_xConnSetup - vendorlen);
u.vendor = setup;
@@ -420,6 +457,14 @@ Display *XOpenDisplay (display)
/*
* First decode the Z axis Screen format information.
*/
+ usedbytes += dpy->nformats * sz_xPixmapFormat;
+
+ if (setuplength < usedbytes) {
+ fprintf (stderr, "Xlib: Broken initial reply: Too short (%ld)\n", setuplength);
+ OutOfMemory (dpy, setup);
+ return(NULL);
+ }
+
for (i = 0; i < dpy->nformats; i++) {
register ScreenFormat *fmt = &dpy->pixmap_format[i];
fmt->depth = u.sf->depth;
@@ -438,12 +483,22 @@ Display *XOpenDisplay (display)
OutOfMemory (dpy, setup);
return(NULL);
}
+
/*
* Now go deal with each screen structure.
*/
for (i = 0; i < dpy->nscreens; i++) {
register Screen *sp = &dpy->screens[i];
- VisualID root_visualID = u.rp->rootVisualID;
+ VisualID root_visualID;
+
+ usedbytes += sz_xWindowRoot;
+ if (setuplength < usedbytes) {
+ fprintf (stderr, "Xlib: Broken initial reply: Too short (%ld)\n", setuplength);
+ OutOfMemory (dpy, setup);
+ return(NULL);
+ }
+
+ root_visualID = u.rp->rootVisualID;
sp->display = dpy;
sp->root = u.rp->windowId;
sp->cmap = u.rp->defaultColormap;
@@ -476,6 +531,14 @@ Display *XOpenDisplay (display)
*/
for (j = 0; j < sp->ndepths; j++) {
Depth *dp = &sp->depths[j];
+
+ usedbytes += sz_xDepth;
+ if (setuplength < usedbytes) {
+ fprintf (stderr, "Xlib: Broken initial reply: Too short (%ld)\n", setuplength);
+ OutOfMemory (dpy, setup);
+ return(NULL);
+ }
+
dp->depth = u.dp->depth;
dp->nvisuals = u.dp->nVisuals;
u.dp = (xDepth *) (((char *) u.dp) + sz_xDepth);
@@ -488,6 +551,14 @@ Display *XOpenDisplay (display)
}
for (k = 0; k < dp->nvisuals; k++) {
register Visual *vp = &dp->visuals[k];
+
+ usedbytes += sz_xVisualType;
+ if (setuplength < usedbytes) {
+ fprintf (stderr, "Xlib: Broken initial reply: Too short (%ld)\n", setuplength);
+ OutOfMemory (dpy, setup);
+ return(NULL);
+ }
+
vp->visualid = u.vp->visualID;
vp->class = u.vp->class;
vp->bits_per_rgb= u.vp->bitsPerRGB;
@@ -505,7 +576,15 @@ Display *XOpenDisplay (display)
}
sp->root_visual = _XVIDtoVisual(dpy, root_visualID);
}
-
+
+ if(usedbytes != setuplength){
+ /* Sanity check, shouldn't happen. */
+ fprintf(stderr, "Xlib: Did not parse entire setup message: "
+ "parsed: %ld, message: %ld\n",
+ usedbytes, setuplength);
+ OutOfMemory(dpy, setup);
+ return(NULL);
+ }
/*
* Now start talking to the server to setup all other information...
@@ -682,6 +761,9 @@ void _XFreeDisplayStructure(dpy)
if (dpy->xkb_info)
(*dpy->free_funcs->xkb)(dpy);
+ if (dpy->db)
+ XrmDestroyDatabase(dpy->db);
+
if (dpy->screens) {
register int i;
diff --git a/src/ParseCmd.c b/src/ParseCmd.c
index 61e702d..121b8d0 100644
--- a/src/ParseCmd.c
+++ b/src/ParseCmd.c
@@ -46,7 +46,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
-/* $XFree86: xc/lib/X11/ParseCmd.c,v 1.5 2001/12/14 19:54:03 dawes Exp $ */
+/* $XFree86: xc/lib/X11/ParseCmd.c,v 1.6 2003/11/17 22:20:08 dawes Exp $ */
/* XrmParseCommand()
@@ -69,23 +69,14 @@ static void _XReportParseError(XrmOptionDescRec *arg, char *msg)
exit(1);
}
-#if NeedFunctionPrototypes
-void XrmParseCommand(
+void
+XrmParseCommand(
XrmDatabase *pdb, /* data base */
register XrmOptionDescList options, /* pointer to table of valid options */
int num_options, /* number of options */
_Xconst char *prefix, /* name to prefix resources with */
int *argc, /* address of argument count */
char **argv) /* argument list (command line) */
-#else
-void XrmParseCommand(pdb, options, num_options, prefix, argc, argv)
- XrmDatabase *pdb; /* data base */
- register XrmOptionDescList options; /* pointer to table of valid options */
- int num_options; /* number of options */
- char *prefix; /* name to prefix resources with */
- int *argc; /* address of argument count */
- char **argv; /* argument list (command line) */
-#endif
{
int foundOption;
char **argsave;
diff --git a/src/ParseCol.c b/src/ParseCol.c
index f66ebb8..af699ec 100644
--- a/src/ParseCol.c
+++ b/src/ParseCol.c
@@ -24,29 +24,20 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/ParseCol.c,v 1.5 2002/12/04 23:18:32 paulo Exp $ */
+/* $XFree86: xc/lib/X11/ParseCol.c,v 1.7 2003/11/17 22:20:08 dawes Exp $ */
#define NEED_REPLIES
#include <stdio.h>
#include "Xlibint.h"
#include "Xcmsint.h"
-extern void _XcmsRGB_to_XColor();
-extern Status _XcmsResolveColorString();
-#if NeedFunctionPrototypes
-Status XParseColor (
+Status
+XParseColor (
register Display *dpy,
Colormap cmap,
_Xconst char *spec,
XColor *def)
-#else
-Status XParseColor (dpy, cmap, spec, def)
- register Display *dpy;
- Colormap cmap;
- char *spec;
- XColor *def;
-#endif
{
register int n, i;
int r, g, b;
diff --git a/src/ParseGeom.c b/src/ParseGeom.c
index 5913c8a..a08a15d 100644
--- a/src/ParseGeom.c
+++ b/src/ParseGeom.c
@@ -27,7 +27,7 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/lib/X11/ParseGeom.c,v 1.3 2001/12/14 19:54:03 dawes Exp $ */
+/* $XFree86: xc/lib/X11/ParseGeom.c,v 1.4 2003/11/17 22:20:08 dawes Exp $ */
#include "Xlibint.h"
#include "Xutil.h"
@@ -86,19 +86,13 @@ ReadInteger(char *string, char **NextString)
return (-Result);
}
-#if NeedFunctionPrototypes
-int XParseGeometry (
+int
+XParseGeometry (
_Xconst char *string,
int *x,
int *y,
unsigned int *width, /* RETURN */
unsigned int *height) /* RETURN */
-#else
-int XParseGeometry (string, x, y, width, height)
-char *string;
-int *x, *y;
-unsigned int *width, *height; /* RETURN */
-#endif
{
int mask = NoValue;
register char *strind;
diff --git a/src/PeekIfEv.c b/src/PeekIfEv.c
index cb57c93..48a1f89 100644
--- a/src/PeekIfEv.c
+++ b/src/PeekIfEv.c
@@ -24,7 +24,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/PeekIfEv.c,v 1.4 2001/12/14 19:54:03 dawes Exp $ */
+/* $XFree86: xc/lib/X11/PeekIfEv.c,v 1.5 2003/11/17 22:20:08 dawes Exp $ */
#define NEED_EVENTS
#include "Xlibint.h"
@@ -40,11 +40,9 @@ XPeekIfEvent (dpy, event, predicate, arg)
register Display *dpy;
register XEvent *event;
Bool (*predicate)(
-#if NeedNestedPrototypes
Display* /* display */,
XEvent* /* event */,
char* /* arg */
-#endif
);
char *arg;
{
diff --git a/src/PolyReg.c b/src/PolyReg.c
index 17fced5..3e196cc 100644
--- a/src/PolyReg.c
+++ b/src/PolyReg.c
@@ -45,7 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
************************************************************************/
-/* $XFree86: xc/lib/X11/PolyReg.c,v 1.6 2001/12/14 19:54:03 dawes Exp $ */
+/* $XFree86: xc/lib/X11/PolyReg.c,v 1.7 2003/04/13 19:22:17 dawes Exp $ */
#define LARGE_COORDINATE 1000000
#define SMALL_COORDINATE -LARGE_COORDINATE
@@ -65,12 +65,12 @@ SOFTWARE.
*
*/
static void
-InsertEdgeInET(ET, ETE, scanline, SLLBlock, iSLLBlock)
- EdgeTable *ET;
- EdgeTableEntry *ETE;
- int scanline;
- ScanLineListBlock **SLLBlock;
- int *iSLLBlock;
+InsertEdgeInET(
+ EdgeTable *ET,
+ EdgeTableEntry *ETE,
+ int scanline,
+ ScanLineListBlock **SLLBlock,
+ int *iSLLBlock)
{
register EdgeTableEntry *start, *prev;
register ScanLineList *pSLL, *pPrevSLL;
@@ -153,13 +153,13 @@ InsertEdgeInET(ET, ETE, scanline, SLLBlock, iSLLBlock)
*/
static void
-CreateETandAET(count, pts, ET, AET, pETEs, pSLLBlock)
- register int count;
- register XPoint *pts;
- EdgeTable *ET;
- EdgeTableEntry *AET;
- register EdgeTableEntry *pETEs;
- ScanLineListBlock *pSLLBlock;
+CreateETandAET(
+ register int count,
+ register XPoint *pts,
+ EdgeTable *ET,
+ EdgeTableEntry *AET,
+ register EdgeTableEntry *pETEs,
+ ScanLineListBlock *pSLLBlock)
{
register XPoint *top, *bottom;
register XPoint *PrevPt, *CurrPt;
@@ -245,8 +245,9 @@ CreateETandAET(count, pts, ET, AET, pETEs, pSLLBlock)
*/
static void
-loadAET(AET, ETEs)
- register EdgeTableEntry *AET, *ETEs;
+loadAET(
+ register EdgeTableEntry *AET,
+ register EdgeTableEntry *ETEs)
{
register EdgeTableEntry *pPrevAET;
register EdgeTableEntry *tmp;
@@ -293,8 +294,8 @@ loadAET(AET, ETEs)
*
*/
static void
-computeWAET(AET)
- register EdgeTableEntry *AET;
+computeWAET(
+ register EdgeTableEntry *AET)
{
register EdgeTableEntry *pWETE;
register int inside = 1;
@@ -332,8 +333,8 @@ computeWAET(AET)
*/
static int
-InsertionSort(AET)
- register EdgeTableEntry *AET;
+InsertionSort(
+ register EdgeTableEntry *AET)
{
register EdgeTableEntry *pETEchase;
register EdgeTableEntry *pETEinsert;
@@ -369,8 +370,8 @@ InsertionSort(AET)
* Clean up our act.
*/
static void
-FreeStorage(pSLLBlock)
- register ScanLineListBlock *pSLLBlock;
+FreeStorage(
+ register ScanLineListBlock *pSLLBlock)
{
register ScanLineListBlock *tmpSLLBlock;
@@ -390,10 +391,11 @@ FreeStorage(pSLLBlock)
* stack by the calling procedure.
*
*/
-static int PtsToRegion(numFullPtBlocks, iCurPtBlock, FirstPtBlock, reg)
- register int numFullPtBlocks, iCurPtBlock;
- POINTBLOCK *FirstPtBlock;
- REGION *reg;
+static int PtsToRegion(
+ register int numFullPtBlocks,
+ register int iCurPtBlock,
+ POINTBLOCK *FirstPtBlock,
+ REGION *reg)
{
register BOX *rects;
register XPoint *pts;
diff --git a/src/PutImage.c b/src/PutImage.c
index 3ae375d..660501f 100644
--- a/src/PutImage.c
+++ b/src/PutImage.c
@@ -24,11 +24,13 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/PutImage.c,v 3.11 2002/12/09 04:10:56 tsi Exp $ */
+/* $XFree86: xc/lib/X11/PutImage.c,v 3.12 2003/04/13 19:22:17 dawes Exp $ */
#include "Xlibint.h"
#include "Xutil.h"
#include <stdio.h>
+#include "Cr.h"
+#include "ImUtil.h"
#if defined(__STDC__) && ((defined(sun) && defined(SVR4)) || defined(WIN32))
#define RConst /**/
@@ -114,9 +116,9 @@ static unsigned char const _reverse_nibs[0x100] = {
};
int
-_XReverse_Bytes (bpt, nb)
- register unsigned char *bpt;
- register int nb;
+_XReverse_Bytes(
+ register unsigned char *bpt,
+ register int nb)
{
do {
*bpt = _reverse_byte[*bpt];
@@ -133,11 +135,14 @@ _XReverse_Bytes (bpt, nb)
/*ARGSUSED*/
static void
-NoSwap (src, dest, srclen, srcinc, destinc, height, half_order)
- register unsigned char *src, *dest;
- long srclen, srcinc, destinc;
- unsigned int height;
- int half_order;
+NoSwap (
+ register unsigned char *src,
+ register unsigned char *dest,
+ long srclen,
+ long srcinc,
+ long destinc,
+ unsigned int height,
+ int half_order)
{
long h = height;
@@ -149,11 +154,12 @@ NoSwap (src, dest, srclen, srcinc, destinc, height, half_order)
}
static void
-SwapTwoBytes (src, dest, srclen, srcinc, destinc, height, half_order)
- register unsigned char *src, *dest;
- long srclen, srcinc, destinc;
- unsigned int height;
- int half_order;
+SwapTwoBytes (
+ register unsigned char *src,
+ register unsigned char *dest,
+ long srclen, long srcinc, long destinc,
+ unsigned int height,
+ int half_order)
{
long length = ROUNDUP(srclen, 2);
register long h, n;
@@ -176,11 +182,12 @@ SwapTwoBytes (src, dest, srclen, srcinc, destinc, height, half_order)
}
static void
-SwapThreeBytes (src, dest, srclen, srcinc, destinc, height, byte_order)
- register unsigned char *src, *dest;
- long srclen, srcinc, destinc;
- unsigned int height;
- int byte_order;
+SwapThreeBytes (
+ register unsigned char *src,
+ register unsigned char *dest,
+ long srclen, long srcinc, long destinc,
+ unsigned int height,
+ int byte_order)
{
long length = ((srclen + 2) / 3) * 3;
register long h, n;
@@ -206,11 +213,12 @@ SwapThreeBytes (src, dest, srclen, srcinc, destinc, height, byte_order)
}
static void
-SwapFourBytes (src, dest, srclen, srcinc, destinc, height, half_order)
- register unsigned char *src, *dest;
- long srclen, srcinc, destinc;
- unsigned int height;
- int half_order;
+SwapFourBytes (
+ register unsigned char *src,
+ register unsigned char *dest,
+ long srclen, long srcinc, long destinc,
+ unsigned int height,
+ int half_order)
{
long length = ROUNDUP(srclen, 4);
register long h, n;
@@ -241,11 +249,12 @@ SwapFourBytes (src, dest, srclen, srcinc, destinc, height, half_order)
}
static void
-SwapWords (src, dest, srclen, srcinc, destinc, height, half_order)
- register unsigned char *src, *dest;
- long srclen, srcinc, destinc;
- unsigned int height;
- int half_order;
+SwapWords (
+ register unsigned char *src,
+ register unsigned char *dest,
+ long srclen, long srcinc, long destinc,
+ unsigned int height,
+ int half_order)
{
long length = ROUNDUP(srclen, 4);
register long h, n;
@@ -276,10 +285,11 @@ SwapWords (src, dest, srclen, srcinc, destinc, height, half_order)
}
static void
-SwapNibbles (src, dest, srclen, srcinc, destinc, height)
- register unsigned char *src, *dest;
- long srclen, srcinc, destinc;
- unsigned int height;
+SwapNibbles(
+ register unsigned char *src,
+ register unsigned char *dest,
+ long srclen, long srcinc, long destinc,
+ unsigned int height)
{
register long h, n;
register const unsigned char *rev = _reverse_nibs;
@@ -292,11 +302,12 @@ SwapNibbles (src, dest, srclen, srcinc, destinc, height)
}
static void
-ShiftNibblesLeft (src, dest, srclen, srcinc, destinc, height, nibble_order)
- register unsigned char *src, *dest;
- long srclen, srcinc, destinc;
- unsigned int height;
- int nibble_order;
+ShiftNibblesLeft (
+ register unsigned char *src,
+ register unsigned char *dest,
+ long srclen, long srcinc, long destinc,
+ unsigned int height,
+ int nibble_order)
{
register long h, n;
register unsigned char c1, c2;
@@ -322,11 +333,12 @@ ShiftNibblesLeft (src, dest, srclen, srcinc, destinc, height, nibble_order)
/*ARGSUSED*/
static void
-SwapBits (src, dest, srclen, srcinc, destinc, height, half_order)
- register unsigned char *src, *dest;
- long srclen, srcinc, destinc;
- unsigned int height;
- int half_order;
+SwapBits(
+ register unsigned char *src,
+ register unsigned char *dest,
+ long srclen, long srcinc, long destinc,
+ unsigned int height,
+ int half_order)
{
register long h, n;
register const unsigned char *rev = _reverse_byte;
@@ -339,11 +351,12 @@ SwapBits (src, dest, srclen, srcinc, destinc, height, half_order)
}
static void
-SwapBitsAndTwoBytes (src, dest, srclen, srcinc, destinc, height, half_order)
- register unsigned char *src, *dest;
- long srclen, srcinc, destinc;
- unsigned int height;
- int half_order;
+SwapBitsAndTwoBytes(
+ register unsigned char *src,
+ register unsigned char *dest,
+ long srclen, long srcinc, long destinc,
+ unsigned int height,
+ int half_order)
{
long length = ROUNDUP(srclen, 2);
register long h, n;
@@ -367,11 +380,12 @@ SwapBitsAndTwoBytes (src, dest, srclen, srcinc, destinc, height, half_order)
}
static void
-SwapBitsAndFourBytes (src, dest, srclen, srcinc, destinc, height, half_order)
- register unsigned char *src, *dest;
- long srclen, srcinc, destinc;
- unsigned int height;
- int half_order;
+SwapBitsAndFourBytes(
+ register unsigned char *src,
+ register unsigned char *dest,
+ long srclen, long srcinc, long destinc,
+ unsigned int height,
+ int half_order)
{
long length = ROUNDUP(srclen, 4);
register long h, n;
@@ -403,11 +417,12 @@ SwapBitsAndFourBytes (src, dest, srclen, srcinc, destinc, height, half_order)
}
static void
-SwapBitsAndWords (src, dest, srclen, srcinc, destinc, height, half_order)
- register unsigned char *src, *dest;
- long srclen, srcinc, destinc;
- unsigned int height;
- int half_order;
+SwapBitsAndWords(
+ register unsigned char *src,
+ register unsigned char *dest,
+ long srclen, long srcinc, long destinc,
+ unsigned int height,
+ int half_order)
{
long length = ROUNDUP(srclen, 4);
register long h, n;
@@ -488,7 +503,14 @@ legend:
*/
-static void (* RConst (SwapFunction[12][12]))() = {
+static void (* RConst (SwapFunction[12][12]))(
+ register unsigned char *src,
+ register unsigned char *dest,
+ long srclen,
+ long srcinc,
+ long destinc,
+ unsigned int height,
+ int half_order) = {
#define n NoSwap,
#define s SwapTwoBytes,
#define l SwapFourBytes,
@@ -588,18 +610,25 @@ static int const HalfOrderWord[12] = {
#endif
static void
-SendXYImage(dpy, req, image, req_xoffset, req_yoffset)
- register Display *dpy;
- register xPutImageReq *req;
- register XImage *image;
- int req_xoffset, req_yoffset;
+SendXYImage(
+ register Display *dpy,
+ register xPutImageReq *req,
+ register XImage *image,
+ int req_xoffset, int req_yoffset)
{
register int j;
long total_xoffset, bytes_per_src, bytes_per_dest, length;
long bytes_per_line, bytes_per_src_plane, bytes_per_dest_plane;
char *src, *dest, *buf;
char *extra = (char *)NULL;
- register void (*swapfunc)();
+ register void (*swapfunc)(
+ register unsigned char *src,
+ register unsigned char *dest,
+ long srclen,
+ long srcinc,
+ long destinc,
+ unsigned int height,
+ int half_order);
int half_order;
total_xoffset = image->xoffset + req_xoffset;
@@ -726,12 +755,12 @@ SendXYImage(dpy, req, image, req_xoffset, req_yoffset)
}
static void
-SendZImage(dpy, req, image, req_xoffset, req_yoffset,
- dest_bits_per_pixel, dest_scanline_pad)
- register Display *dpy;
- register xPutImageReq *req;
- register XImage *image;
- int req_xoffset, req_yoffset, dest_bits_per_pixel, dest_scanline_pad;
+SendZImage(
+ register Display *dpy,
+ register xPutImageReq *req,
+ register XImage *image,
+ int req_xoffset, int req_yoffset,
+ int dest_bits_per_pixel, int dest_scanline_pad)
{
long bytes_per_src, bytes_per_dest, length;
unsigned char *src, *dest;
@@ -813,15 +842,15 @@ SendZImage(dpy, req, image, req_xoffset, req_yoffset,
}
static void
-PutImageRequest(dpy, d, gc, image, req_xoffset, req_yoffset, x, y,
- req_width, req_height, dest_bits_per_pixel, dest_scanline_pad)
- register Display *dpy;
- Drawable d;
- GC gc;
- register XImage *image;
- int x, y;
- unsigned int req_width, req_height;
- int req_xoffset, req_yoffset, dest_bits_per_pixel, dest_scanline_pad;
+PutImageRequest(
+ register Display *dpy,
+ Drawable d,
+ GC gc,
+ register XImage *image,
+ int req_xoffset, int req_yoffset,
+ int x, int y,
+ unsigned int req_width, unsigned int req_height,
+ int dest_bits_per_pixel, int dest_scanline_pad)
{
register xPutImageReq *req;
@@ -842,16 +871,18 @@ PutImageRequest(dpy, d, gc, image, req_xoffset, req_yoffset, x, y,
}
static void
-PutSubImage (dpy, d, gc, image, req_xoffset, req_yoffset, x, y,
- req_width, req_height, dest_bits_per_pixel, dest_scanline_pad)
- register Display *dpy;
- Drawable d;
- GC gc;
- register XImage *image;
- int x, y;
- unsigned int req_width, req_height;
- int req_xoffset, req_yoffset, dest_bits_per_pixel, dest_scanline_pad;
-
+PutSubImage (
+ register Display *dpy,
+ Drawable d,
+ GC gc,
+ register XImage *image,
+ int req_xoffset,
+ int req_yoffset,
+ int x, int y,
+ unsigned int req_width,
+ unsigned int req_height,
+ int dest_bits_per_pixel,
+ int dest_scanline_pad)
{
int left_pad, BytesPerRow, Available;
@@ -905,15 +936,7 @@ PutSubImage (dpy, d, gc, image, req_xoffset, req_yoffset, x, y,
}
}
-extern void _XInitImageFuncPtrs();
-#ifdef USE_DYNAMIC_XCURSOR
-void
-_XNoticePutBitmap (Display *dpy,
- Drawable draw,
- XImage *image);
-#endif
-
int
XPutImage (dpy, d, gc, image, req_xoffset, req_yoffset, x, y, req_width,
req_height)
diff --git a/src/QuExt.c b/src/QuExt.c
index 5d49da0..dd70053 100644
--- a/src/QuExt.c
+++ b/src/QuExt.c
@@ -24,25 +24,18 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/X11/QuExt.c,v 1.3 2003/11/17 22:20:08 dawes Exp $ */
#define NEED_REPLIES
#include "Xlibint.h"
-#if NeedFunctionPrototypes
-Bool XQueryExtension(
+Bool
+XQueryExtension(
register Display *dpy,
_Xconst char *name,
int *major_opcode, /* RETURN */
int *first_event, /* RETURN */
int *first_error) /* RETURN */
-#else
-Bool XQueryExtension(dpy, name, major_opcode, first_event, first_error)
- register Display *dpy;
- char *name;
- int *major_opcode; /* RETURN */
- int *first_event; /* RETURN */
- int *first_error; /* RETURN */
-#endif
{
xQueryExtensionReply rep;
register xQueryExtensionReq *req;
diff --git a/src/QuTextE16.c b/src/QuTextE16.c
index e78ae36..8f2f82b 100644
--- a/src/QuTextE16.c
+++ b/src/QuTextE16.c
@@ -24,13 +24,12 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/QuTextE16.c,v 1.4 2001/12/14 19:54:04 dawes Exp $ */
+/* $XFree86: xc/lib/X11/QuTextE16.c,v 1.5 2003/11/17 22:20:08 dawes Exp $ */
#define NEED_REPLIES
#include "Xlibint.h"
int
-#if NeedFunctionPrototypes
XQueryTextExtents16 (
register Display *dpy,
Font fid,
@@ -40,17 +39,6 @@ XQueryTextExtents16 (
int *font_ascent,
int *font_descent,
register XCharStruct *overall)
-#else
-XQueryTextExtents16 (dpy, fid, string, nchars, dir, font_ascent, font_descent,
- overall)
- register Display *dpy;
- Font fid;
- XChar2b *string;
- register int nchars;
- int *dir;
- int *font_ascent, *font_descent;
- register XCharStruct *overall;
-#endif
{
register long i;
register unsigned char *ptr;
diff --git a/src/QuTextExt.c b/src/QuTextExt.c
index 34da05e..ef757a4 100644
--- a/src/QuTextExt.c
+++ b/src/QuTextExt.c
@@ -24,13 +24,12 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/QuTextExt.c,v 1.4 2001/12/14 19:54:04 dawes Exp $ */
+/* $XFree86: xc/lib/X11/QuTextExt.c,v 1.5 2003/11/17 22:20:08 dawes Exp $ */
#define NEED_REPLIES
#include "Xlibint.h"
int
-#if NeedFunctionPrototypes
XQueryTextExtents (
register Display *dpy,
Font fid,
@@ -40,17 +39,6 @@ XQueryTextExtents (
int *font_ascent,
int *font_descent,
register XCharStruct *overall)
-#else
-XQueryTextExtents (dpy, fid, string, nchars, dir, font_ascent, font_descent,
- overall)
- register Display *dpy;
- Font fid;
- register char *string;
- register int nchars;
- int *dir;
- int *font_ascent, *font_descent;
- register XCharStruct *overall;
-#endif
{
register int i;
register char *ptr;
diff --git a/src/Quarks.c b/src/Quarks.c
index 03f43bc..56005ce 100644
--- a/src/Quarks.c
+++ b/src/Quarks.c
@@ -49,19 +49,19 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/lib/X11/Quarks.c,v 1.5 2001/12/14 19:54:04 dawes Exp $ */
+/* $XFree86: xc/lib/X11/Quarks.c,v 1.7 2003/11/17 22:20:08 dawes Exp $ */
#include "Xlibint.h"
#include <X11/Xresource.h>
+#include "Xresinternal.h"
/* Not cost effective, at least for vanilla MIT clients */
/* #define PERMQ */
-typedef unsigned long Signature;
-typedef unsigned long Entry;
#ifdef PERMQ
typedef unsigned char Bits;
#endif
+typedef unsigned long Entry; /* dont confuse with EntryRec from Xintatom.h */
static XrmQuark nextQuark = 1; /* next available quark number */
static unsigned long quarkMask = 0;
@@ -239,17 +239,10 @@ ExpandQuarkTable(void)
return True;
}
-#if NeedFunctionPrototypes
-XrmQuark _XrmInternalStringToQuark(
+XrmQuark
+_XrmInternalStringToQuark(
register _Xconst char *name, register int len, register Signature sig,
Bool permstring)
-#else
-XrmQuark _XrmInternalStringToQuark(name, len, sig, permstring)
- register XrmString name;
- register int len;
- register Signature sig;
- Bool permstring;
-#endif
{
register XrmQuark q;
register Entry entry;
@@ -354,13 +347,9 @@ nomatch: if (!rehash)
return NULLQUARK;
}
-#if NeedFunctionPrototypes
-XrmQuark XrmStringToQuark(
+XrmQuark
+XrmStringToQuark(
_Xconst char *name)
-#else
-XrmQuark XrmStringToQuark(name)
- XrmString name;
-#endif
{
register char c, *tname;
register Signature sig = 0;
@@ -374,13 +363,9 @@ XrmQuark XrmStringToQuark(name)
return _XrmInternalStringToQuark(name, tname-(char *)name-1, sig, False);
}
-#if NeedFunctionPrototypes
-XrmQuark XrmPermStringToQuark(
+XrmQuark
+XrmPermStringToQuark(
_Xconst char *name)
-#else
-XrmQuark XrmPermStringToQuark(name)
- XrmString name;
-#endif
{
register char c, *tname;
register Signature sig = 0;
diff --git a/src/RdBitF.c b/src/RdBitF.c
index c879298..085f0e2 100644
--- a/src/RdBitF.c
+++ b/src/RdBitF.c
@@ -26,7 +26,7 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/lib/X11/RdBitF.c,v 3.5 2002/05/31 18:45:41 dawes Exp $ */
+/* $XFree86: xc/lib/X11/RdBitF.c,v 3.7 2003/11/17 22:20:08 dawes Exp $ */
/*
* Code to read bitmaps from disk files. Interprets
@@ -61,7 +61,7 @@ static Bool initialized = False; /* easier to fill in at run time */
* Table index for the hex values. Initialized once, first time.
* Used for translation value or delimiter significance lookup.
*/
-static void initHexTable()
+static void initHexTable(void)
{
/*
* We build the table at run time for several reasons:
@@ -95,8 +95,8 @@ static void initHexTable()
* read next hex value in the input stream, return -1 if EOF
*/
static int
-NextInt (fstream)
- FILE *fstream;
+NextInt (
+ FILE *fstream)
{
int ch;
int value = 0;
@@ -124,21 +124,14 @@ NextInt (fstream)
return value;
}
-#if NeedFunctionPrototypes
-int XReadBitmapFileData (
+int
+XReadBitmapFileData (
_Xconst char *filename,
unsigned int *width, /* RETURNED */
unsigned int *height, /* RETURNED */
unsigned char **data, /* RETURNED */
int *x_hot, /* RETURNED */
int *y_hot) /* RETURNED */
-#else
-int XReadBitmapFileData (filename, width, height, data, x_hot, y_hot)
- char *filename;
- unsigned int *width, *height; /* RETURNED */
- unsigned char **data; /* RETURNED */
- int *x_hot, *y_hot; /* RETURNED */
-#endif
{
FILE *fstream; /* handle on file */
unsigned char *bits = NULL; /* working variable */
@@ -260,8 +253,8 @@ int XReadBitmapFileData (filename, width, height, data, x_hot, y_hot)
return (BitmapSuccess);
}
-#if NeedFunctionPrototypes
-int XReadBitmapFile (
+int
+XReadBitmapFile (
Display *display,
Drawable d,
_Xconst char *filename,
@@ -270,15 +263,6 @@ int XReadBitmapFile (
Pixmap *pixmap, /* RETURNED */
int *x_hot, /* RETURNED */
int *y_hot) /* RETURNED */
-#else
-int XReadBitmapFile (display, d, filename, width, height, pixmap, x_hot, y_hot)
- Display *display;
- Drawable d;
- char *filename;
- unsigned int *width, *height; /* RETURNED */
- Pixmap *pixmap; /* RETURNED */
- int *x_hot, *y_hot; /* RETURNED */
-#endif
{
unsigned char *data;
int res;
diff --git a/src/Region.c b/src/Region.c
index bf6a58c..af1f0f2 100644
--- a/src/Region.c
+++ b/src/Region.c
@@ -45,7 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
************************************************************************/
-/* $XFree86: xc/lib/X11/Region.c,v 1.9 2002/06/04 22:19:57 dawes Exp $ */
+/* $XFree86: xc/lib/X11/Region.c,v 1.10 2003/04/13 19:22:17 dawes Exp $ */
/*
* The functions in this file implement the Region abstraction, similar to one
* used in the X11 sample server. A Region is simply an area, as the name
@@ -85,12 +85,56 @@ SOFTWARE.
#define assert(expr)
#endif
-typedef void (*voidProcp)();
+typedef int (*overlapProcp)(
+ register Region pReg,
+ register BoxPtr r1,
+ BoxPtr r1End,
+ register BoxPtr r2,
+ BoxPtr r2End,
+ short y1,
+ short y2);
+
+typedef int (*nonOverlapProcp)(
+ register Region pReg,
+ register BoxPtr r,
+ BoxPtr rEnd,
+ register short y1,
+ register short y2);
+
+static void miRegionOp(
+ register Region newReg, /* Place to store result */
+ Region reg1, /* First region in operation */
+ Region reg2, /* 2d region in operation */
+ int (*overlapFunc)(
+ register Region pReg,
+ register BoxPtr r1,
+ BoxPtr r1End,
+ register BoxPtr r2,
+ BoxPtr r2End,
+ short y1,
+ short y2), /* Function to call for over-
+ * lapping bands */
+ int (*nonOverlap1Func)(
+ register Region pReg,
+ register BoxPtr r,
+ BoxPtr rEnd,
+ register short y1,
+ register short y2), /* Function to call for non-
+ * overlapping bands in region
+ * 1 */
+ int (*nonOverlap2Func)(
+ register Region pReg,
+ register BoxPtr r,
+ BoxPtr rEnd,
+ register short y1,
+ register short y2)); /* Function to call for non-
+ * overlapping bands in region
+ * 2 */
+
-static void miRegionOp();
/* Create a new empty region */
Region
-XCreateRegion()
+XCreateRegion(void)
{
Region temp;
@@ -110,9 +154,9 @@ XCreateRegion()
}
int
-XClipBox( r, rect )
- Region r;
- XRectangle *rect;
+XClipBox(
+ Region r,
+ XRectangle *rect)
{
rect->x = r->extents.x1;
rect->y = r->extents.y1;
@@ -122,9 +166,9 @@ XClipBox( r, rect )
}
int
-XUnionRectWithRegion(rect, source, dest)
- register XRectangle *rect;
- Region source, dest;
+XUnionRectWithRegion(
+ register XRectangle *rect,
+ Region source, Region dest)
{
REGION region;
@@ -157,8 +201,8 @@ XUnionRectWithRegion(rect, source, dest)
*-----------------------------------------------------------------------
*/
static void
-miSetExtents (pReg)
- Region pReg;
+miSetExtents (
+ Region pReg)
{
register BoxPtr pBox,
pBoxEnd,
@@ -205,13 +249,11 @@ miSetExtents (pReg)
assert(pExtents->x1 < pExtents->x2);
}
-extern void _XSetClipRectangles();
-
int
-XSetRegion( dpy, gc, r )
- Display *dpy;
- GC gc;
- register Region r;
+XSetRegion(
+ Display *dpy,
+ GC gc,
+ register Region r)
{
register int i;
register XRectangle *xr, *pr;
@@ -238,8 +280,8 @@ XSetRegion( dpy, gc, r )
}
int
-XDestroyRegion( r )
- Region r;
+XDestroyRegion(
+ Region r)
{
Xfree( (char *) r->rects );
Xfree( (char *) r );
@@ -253,10 +295,10 @@ XDestroyRegion( r )
*/
int
-XOffsetRegion(pRegion, x, y)
- register Region pRegion;
- register int x;
- register int y;
+XOffsetRegion(
+ register Region pRegion,
+ register int x,
+ register int y)
{
register int nbox;
register BOX *pbox;
@@ -306,10 +348,10 @@ XOffsetRegion(pRegion, x, y)
#define ZCopyRegion(a,b) XUnionRegion(a,a,b)
static void
-Compress(r, s, t, dx, xdir, grow)
- Region r, s, t;
- register unsigned dx;
- register int xdir, grow;
+Compress(
+ Region r, Region s, Region t,
+ register unsigned dx,
+ register int xdir, register int grow)
{
register unsigned shift = 1;
@@ -333,9 +375,9 @@ Compress(r, s, t, dx, xdir, grow)
#undef ZCopyRegion
int
-XShrinkRegion(r, dx, dy)
- Region r;
- int dx, dy;
+XShrinkRegion(
+ Region r,
+ int dx, int dy)
{
Region s, t;
int grow;
@@ -359,10 +401,10 @@ XShrinkRegion(r, dx, dy)
***********************************************************/
static BOX
-*IndexRects(rects, numRects, y)
- register BOX *rects;
- register int numRects;
- register int y;
+*IndexRects(
+ register BOX *rects,
+ register int numRects,
+ register int y)
{
while ((numRects--) && (rects->y2 <= y))
rects++;
@@ -388,14 +430,14 @@ static BOX
*/
/* static void*/
static int
-miIntersectO (pReg, r1, r1End, r2, r2End, y1, y2)
- register Region pReg;
- register BoxPtr r1;
- BoxPtr r1End;
- register BoxPtr r2;
- BoxPtr r2End;
- short y1;
- short y2;
+miIntersectO (
+ register Region pReg,
+ register BoxPtr r1,
+ BoxPtr r1End,
+ register BoxPtr r2,
+ BoxPtr r2End,
+ short y1,
+ short y2)
{
register short x1;
register short x2;
@@ -452,10 +494,10 @@ miIntersectO (pReg, r1, r1End, r2, r2End, y1, y2)
}
int
-XIntersectRegion(reg1, reg2, newReg)
- Region reg1;
- Region reg2; /* source regions */
- register Region newReg; /* destination Region */
+XIntersectRegion(
+ Region reg1,
+ Region reg2, /* source regions */
+ register Region newReg) /* destination Region */
{
/* check for trivial reject */
if ( (!(reg1->numRects)) || (!(reg2->numRects)) ||
@@ -463,7 +505,7 @@ XIntersectRegion(reg1, reg2, newReg)
newReg->numRects = 0;
else
miRegionOp (newReg, reg1, reg2,
- (voidProcp) miIntersectO, (voidProcp) NULL, (voidProcp) NULL);
+ miIntersectO, NULL, NULL);
/*
* Can't alter newReg's extents before we call miRegionOp because
@@ -477,9 +519,9 @@ XIntersectRegion(reg1, reg2, newReg)
}
static void
-miRegionCopy(dstrgn, rgn)
- register Region dstrgn;
- register Region rgn;
+miRegionCopy(
+ register Region dstrgn,
+ register Region rgn)
{
if (dstrgn != rgn) /* don't want to copy to itself */
@@ -518,10 +560,10 @@ miRegionCopy(dstrgn, rgn)
*/
static void
-combineRegs(newReg, reg1, reg2)
- register Region newReg;
- Region reg1;
- Region reg2;
+combineRegs(
+ register Region newReg,
+ Region reg1,
+ Region reg2)
{
register Region tempReg;
register BOX *rects;
@@ -567,8 +609,7 @@ combineRegs(newReg, reg1, reg2)
*/
static int
-QuickCheck(newReg, reg1, reg2)
- Region newReg, reg1, reg2;
+QuickCheck(Region newReg, Region reg1, Region reg2)
{
/* if unioning with itself or no rects to union with */
@@ -603,12 +644,12 @@ QuickCheck(newReg, reg1, reg2)
*/
static int
-TopRects(newReg, rects, reg1, reg2, FirstRect)
- register Region newReg;
- register BOX *rects;
- register Region reg1;
- register Region reg2;
- BOX *FirstRect;
+TopRects(
+ register Region newReg,
+ register BOX *rects,
+ register Region reg1,
+ register Region reg2,
+ BOX *FirstRect)
{
register BOX *tempRects;
@@ -663,10 +704,10 @@ TopRects(newReg, rects, reg1, reg2, FirstRect)
*/
/* static int*/
static int
-miCoalesce (pReg, prevStart, curStart)
- register Region pReg; /* Region to coalesce */
- int prevStart; /* Index of start of previous band */
- int curStart; /* Index of start of current band */
+miCoalesce(
+ register Region pReg, /* Region to coalesce */
+ int prevStart, /* Index of start of previous band */
+ int curStart) /* Index of start of current band */
{
register BoxPtr pPrevBox; /* Current box in previous band */
register BoxPtr pCurBox; /* Current box in current band */
@@ -814,16 +855,33 @@ miCoalesce (pReg, prevStart, curStart)
*/
/* static void*/
static void
-miRegionOp(newReg, reg1, reg2, overlapFunc, nonOverlap1Func, nonOverlap2Func)
- register Region newReg; /* Place to store result */
- Region reg1; /* First region in operation */
- Region reg2; /* 2d region in operation */
- void (*overlapFunc)(); /* Function to call for over-
+miRegionOp(
+ register Region newReg, /* Place to store result */
+ Region reg1, /* First region in operation */
+ Region reg2, /* 2d region in operation */
+ int (*overlapFunc)(
+ register Region pReg,
+ register BoxPtr r1,
+ BoxPtr r1End,
+ register BoxPtr r2,
+ BoxPtr r2End,
+ short y1,
+ short y2), /* Function to call for over-
* lapping bands */
- void (*nonOverlap1Func)(); /* Function to call for non-
+ int (*nonOverlap1Func)(
+ register Region pReg,
+ register BoxPtr r,
+ BoxPtr rEnd,
+ register short y1,
+ register short y2), /* Function to call for non-
* overlapping bands in region
* 1 */
- void (*nonOverlap2Func)(); /* Function to call for non-
+ int (*nonOverlap2Func)(
+ register Region pReg,
+ register BoxPtr r,
+ BoxPtr rEnd,
+ register short y1,
+ register short y2)) /* Function to call for non-
* overlapping bands in region
* 2 */
{
@@ -941,7 +999,7 @@ miRegionOp(newReg, reg1, reg2, overlapFunc, nonOverlap1Func, nonOverlap2Func)
top = max(r1->y1,ybot);
bot = min(r1->y2,r2->y1);
- if ((top != bot) && (nonOverlap1Func != (void (*)())NULL))
+ if ((top != bot) && (nonOverlap1Func != NULL))
{
(* nonOverlap1Func) (newReg, r1, r1BandEnd, top, bot);
}
@@ -953,7 +1011,7 @@ miRegionOp(newReg, reg1, reg2, overlapFunc, nonOverlap1Func, nonOverlap2Func)
top = max(r2->y1,ybot);
bot = min(r2->y2,r1->y1);
- if ((top != bot) && (nonOverlap2Func != (void (*)())NULL))
+ if ((top != bot) && (nonOverlap2Func != NULL))
{
(* nonOverlap2Func) (newReg, r2, r2BandEnd, top, bot);
}
@@ -1013,7 +1071,7 @@ miRegionOp(newReg, reg1, reg2, overlapFunc, nonOverlap1Func, nonOverlap2Func)
curBand = newReg->numRects;
if (r1 != r1End)
{
- if (nonOverlap1Func != (void (*)())NULL)
+ if (nonOverlap1Func != NULL)
{
do
{
@@ -1028,7 +1086,7 @@ miRegionOp(newReg, reg1, reg2, overlapFunc, nonOverlap1Func, nonOverlap2Func)
} while (r1 != r1End);
}
}
- else if ((r2 != r2End) && (nonOverlap2Func != (void (*)())NULL))
+ else if ((r2 != r2End) && (nonOverlap2Func != NULL))
{
do
{
@@ -1105,12 +1163,12 @@ miRegionOp(newReg, reg1, reg2, overlapFunc, nonOverlap1Func, nonOverlap2Func)
*/
/* static void*/
static int
-miUnionNonO (pReg, r, rEnd, y1, y2)
- register Region pReg;
- register BoxPtr r;
- BoxPtr rEnd;
- register short y1;
- register short y2;
+miUnionNonO (
+ register Region pReg,
+ register BoxPtr r,
+ BoxPtr rEnd,
+ register short y1,
+ register short y2)
{
register BoxPtr pNextRect;
@@ -1154,14 +1212,14 @@ miUnionNonO (pReg, r, rEnd, y1, y2)
/* static void*/
static int
-miUnionO (pReg, r1, r1End, r2, r2End, y1, y2)
- register Region pReg;
- register BoxPtr r1;
- BoxPtr r1End;
- register BoxPtr r2;
- BoxPtr r2End;
- register short y1;
- register short y2;
+miUnionO (
+ register Region pReg,
+ register BoxPtr r1,
+ BoxPtr r1End,
+ register BoxPtr r2,
+ BoxPtr r2End,
+ register short y1,
+ register short y2)
{
register BoxPtr pNextRect;
@@ -1220,10 +1278,10 @@ miUnionO (pReg, r1, r1End, r2, r2End, y1, y2)
}
int
-XUnionRegion(reg1, reg2, newReg)
- Region reg1;
- Region reg2; /* source regions */
- Region newReg; /* destination Region */
+XUnionRegion(
+ Region reg1,
+ Region reg2, /* source regions */
+ Region newReg) /* destination Region */
{
/* checks all the simple cases */
@@ -1275,8 +1333,8 @@ XUnionRegion(reg1, reg2, newReg)
return 1;
}
- miRegionOp (newReg, reg1, reg2, (voidProcp) miUnionO,
- (voidProcp) miUnionNonO, (voidProcp) miUnionNonO);
+ miRegionOp (newReg, reg1, reg2, miUnionO,
+ miUnionNonO, miUnionNonO);
newReg->extents.x1 = min(reg1->extents.x1, reg2->extents.x1);
newReg->extents.y1 = min(reg1->extents.y1, reg2->extents.y1);
@@ -1307,12 +1365,12 @@ XUnionRegion(reg1, reg2, newReg)
*/
/* static void*/
static int
-miSubtractNonO1 (pReg, r, rEnd, y1, y2)
- register Region pReg;
- register BoxPtr r;
- BoxPtr rEnd;
- register short y1;
- register short y2;
+miSubtractNonO1 (
+ register Region pReg,
+ register BoxPtr r,
+ BoxPtr rEnd,
+ register short y1,
+ register short y2)
{
register BoxPtr pNextRect;
@@ -1354,14 +1412,14 @@ miSubtractNonO1 (pReg, r, rEnd, y1, y2)
*/
/* static void*/
static int
-miSubtractO (pReg, r1, r1End, r2, r2End, y1, y2)
- register Region pReg;
- register BoxPtr r1;
- BoxPtr r1End;
- register BoxPtr r2;
- BoxPtr r2End;
- register short y1;
- register short y2;
+miSubtractO (
+ register Region pReg,
+ register BoxPtr r1,
+ BoxPtr r1End,
+ register BoxPtr r2,
+ BoxPtr r2End,
+ register short y1,
+ register short y2)
{
register BoxPtr pNextRect;
register int x1;
@@ -1503,10 +1561,10 @@ miSubtractO (pReg, r1, r1End, r2, r2End, y1, y2)
*/
int
-XSubtractRegion(regM, regS, regD)
- Region regM;
- Region regS;
- register Region regD;
+XSubtractRegion(
+ Region regM,
+ Region regS,
+ register Region regD)
{
/* check for trivial reject */
if ( (!(regM->numRects)) || (!(regS->numRects)) ||
@@ -1516,8 +1574,8 @@ XSubtractRegion(regM, regS, regD)
return 1;
}
- miRegionOp (regD, regM, regS, (voidProcp) miSubtractO,
- (voidProcp) miSubtractNonO1, (voidProcp) NULL);
+ miRegionOp (regD, regM, regS, miSubtractO,
+ miSubtractNonO1, NULL);
/*
* Can't alter newReg's extents before we call miRegionOp because
@@ -1531,8 +1589,7 @@ XSubtractRegion(regM, regS, regD)
}
int
-XXorRegion( sra, srb, dr )
- Region sra, srb, dr;
+XXorRegion(Region sra, Region srb, Region dr)
{
Region tra, trb;
@@ -1551,8 +1608,8 @@ XXorRegion( sra, srb, dr )
* as a parameter
*/
int
-XEmptyRegion( r )
- Region r;
+XEmptyRegion(
+ Region r)
{
if( r->numRects == 0 ) return TRUE;
else return FALSE;
@@ -1562,8 +1619,7 @@ XEmptyRegion( r )
* Check to see if two regions are equal
*/
int
-XEqualRegion( r1, r2 )
- Region r1, r2;
+XEqualRegion(Region r1, Region r2)
{
int i;
@@ -1583,9 +1639,9 @@ XEqualRegion( r1, r2 )
}
int
-XPointInRegion( pRegion, x, y )
- Region pRegion;
- int x, y;
+XPointInRegion(
+ Region pRegion,
+ int x, int y)
{
int i;
@@ -1602,10 +1658,10 @@ XPointInRegion( pRegion, x, y )
}
int
-XRectInRegion(region, rx, ry, rwidth, rheight)
- register Region region;
- int rx, ry;
- unsigned int rwidth, rheight;
+XRectInRegion(
+ register Region region,
+ int rx, int ry,
+ unsigned int rwidth, unsigned int rheight)
{
register BoxPtr pbox;
register BoxPtr pboxEnd;
diff --git a/src/RegstFlt.c b/src/RegstFlt.c
index ccc0eb7..1f97312 100644
--- a/src/RegstFlt.c
+++ b/src/RegstFlt.c
@@ -52,14 +52,14 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/lib/X11/RegstFlt.c,v 1.4 2001/12/14 19:54:05 dawes Exp $ */
+/* $XFree86: xc/lib/X11/RegstFlt.c,v 1.6 2003/11/17 22:20:08 dawes Exp $ */
#include "Xlibint.h"
#include "Xlcint.h"
static void
-_XFreeIMFilters(display)
- Display *display;
+_XFreeIMFilters(
+ Display *display)
{
register XFilterEventList fl;
@@ -73,16 +73,14 @@ _XFreeIMFilters(display)
* Register a filter with the filter machinery by event mask.
*/
void
-_XRegisterFilterByMask(display, window, event_mask, filter, client_data)
- Display *display;
- Window window;
- unsigned long event_mask;
+_XRegisterFilterByMask(
+ Display *display,
+ Window window,
+ unsigned long event_mask,
Bool (*filter)(
-#if NeedNestedPrototypes
Display*, Window, XEvent*, XPointer
-#endif
- );
- XPointer client_data;
+ ),
+ XPointer client_data)
{
XFilterEventRec *rec;
@@ -106,18 +104,15 @@ _XRegisterFilterByMask(display, window, event_mask, filter, client_data)
* Register a filter with the filter machinery by type code.
*/
void
-_XRegisterFilterByType(display, window, start_type, end_type,
- filter, client_data)
- Display *display;
- Window window;
- int start_type;
- int end_type;
+_XRegisterFilterByType(
+ Display *display,
+ Window window,
+ int start_type,
+ int end_type,
Bool (*filter)(
-#if NeedNestedPrototypes
Display*, Window, XEvent*, XPointer
-#endif
- );
- XPointer client_data;
+ ),
+ XPointer client_data)
{
XFilterEventRec *rec;
@@ -138,15 +133,13 @@ _XRegisterFilterByType(display, window, start_type, end_type,
}
void
-_XUnregisterFilter(display, window, filter, client_data)
- Display *display;
- Window window;
+_XUnregisterFilter(
+ Display *display,
+ Window window,
Bool (*filter)(
-#if NeedNestedPrototypes
Display*, Window, XEvent*, XPointer
-#endif
- );
- XPointer client_data;
+ ),
+ XPointer client_data)
{
register XFilterEventList *prev, fl;
diff --git a/src/SendEvent.c b/src/SendEvent.c
index e6db9d3..6d30763 100644
--- a/src/SendEvent.c
+++ b/src/SendEvent.c
@@ -24,7 +24,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/SendEvent.c,v 1.4 2001/12/14 19:54:05 dawes Exp $ */
+/* $XFree86: xc/lib/X11/SendEvent.c,v 1.5 2003/04/13 19:22:17 dawes Exp $ */
#define NEED_EVENTS
#include "Xlibint.h"
@@ -43,7 +43,10 @@ XSendEvent(dpy, w, propagate, event_mask, event)
{
register xSendEventReq *req;
xEvent ev;
- register Status (**fp)();
+ register Status (**fp)(
+ Display * /* dpy */,
+ XEvent * /* re */,
+ xEvent * /* event */);
Status status;
LockDisplay (dpy);
diff --git a/src/SetCRects.c b/src/SetCRects.c
index 3b9da0d..e9a6323 100644
--- a/src/SetCRects.c
+++ b/src/SetCRects.c
@@ -24,19 +24,18 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/SetCRects.c,v 1.4 2001/12/14 19:54:06 dawes Exp $ */
+/* $XFree86: xc/lib/X11/SetCRects.c,v 1.5 2003/04/13 19:22:17 dawes Exp $ */
#include "Xlibint.h"
/* can only call when display is locked. */
-void _XSetClipRectangles (dpy, gc, clip_x_origin, clip_y_origin, rectangles, n,
- ordering)
- register Display *dpy;
- GC gc;
- int clip_x_origin, clip_y_origin;
- XRectangle *rectangles;
- int n;
- int ordering;
+void _XSetClipRectangles (
+ register Display *dpy,
+ GC gc,
+ int clip_x_origin, int clip_y_origin,
+ XRectangle *rectangles,
+ int n,
+ int ordering)
{
register xSetClipRectanglesReq *req;
register long len;
diff --git a/src/SetDashes.c b/src/SetDashes.c
index 4f59531..63e9b80 100644
--- a/src/SetDashes.c
+++ b/src/SetDashes.c
@@ -24,26 +24,17 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/SetDashes.c,v 1.4 2001/12/14 19:54:06 dawes Exp $ */
+/* $XFree86: xc/lib/X11/SetDashes.c,v 1.5 2003/11/17 22:20:08 dawes Exp $ */
#include "Xlibint.h"
int
-#if NeedFunctionPrototypes
XSetDashes (
register Display *dpy,
GC gc,
int dash_offset,
_Xconst char *list,
int n)
-#else
-XSetDashes (dpy, gc, dash_offset, list, n)
- register Display *dpy;
- GC gc;
- int dash_offset;
- char *list;
- int n;
-#endif
{
register xSetDashesReq *req;
diff --git a/src/SetHints.c b/src/SetHints.c
index 68fe5b6..f6f25a7 100644
--- a/src/SetHints.c
+++ b/src/SetHints.c
@@ -46,7 +46,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
-/* $XFree86: xc/lib/X11/SetHints.c,v 1.4 2001/12/14 19:54:06 dawes Exp $ */
+/* $XFree86: xc/lib/X11/SetHints.c,v 1.5 2003/11/17 22:20:08 dawes Exp $ */
#include <X11/Xlibint.h>
#include <X11/Xutil.h>
@@ -219,7 +219,6 @@ XSetCommand (dpy, w, argv, argc)
*/
int
-#if NeedFunctionPrototypes
XSetStandardProperties (
Display *dpy,
Window w, /* window to decorate */
@@ -229,17 +228,6 @@ XSetStandardProperties (
char **argv, /* command to be used to restart application */
int argc, /* count of arguments */
XSizeHints *hints) /* size hints for window in its normal state */
-#else
-XSetStandardProperties (dpy, w, name, icon_string, icon_pixmap, argv, argc, hints)
- Display *dpy;
- Window w; /* window to decorate */
- char *name; /* name of application */
- char *icon_string; /* name string for icon */
- Pixmap icon_pixmap; /* pixmap to use as icon, or None */
- char **argv; /* command to be used to restart application */
- int argc; /* count of arguments */
- XSizeHints *hints; /* size hints for window in its normal state */
-#endif
{
XWMHints phints;
phints.flags = 0;
diff --git a/src/SetLocale.c b/src/SetLocale.c
index ac33f02..07996df 100644
--- a/src/SetLocale.c
+++ b/src/SetLocale.c
@@ -55,12 +55,13 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/lib/X11/SetLocale.c,v 3.17 2002/05/31 18:45:41 dawes Exp $ */
+/* $XFree86: xc/lib/X11/SetLocale.c,v 3.20 2003/11/17 22:20:08 dawes Exp $ */
#include "Xlibint.h"
#include "Xlcint.h"
#include <X11/Xlocale.h>
#include <X11/Xos.h>
+#include "XlcPubI.h"
#define MAXLOCALE 64 /* buffer size of locale name */
@@ -68,18 +69,11 @@ from The Open Group.
/* alternative setlocale() for when the OS does not provide one */
-#if NeedFunctionPrototypes
char *
_Xsetlocale(
int category,
_Xconst char *name
)
-#else
-char *
-_Xsetlocale(category, name)
- int category;
- char *name;
-#endif
{
static char *xsl_name;
char *old_name;
@@ -99,7 +93,7 @@ _Xsetlocale(category, name)
name = getenv("LANG");
if (name && strlen(name) >= MAXLOCALE)
name = NULL;
- if (!name || !*name || !_XOpenLC(name))
+ if (!name || !*name || !_XOpenLC((char *) name))
name = "C";
old_name = xsl_name;
xsl_name = (char *)name;
@@ -140,9 +134,9 @@ _Xsetlocale(category, name)
*/
char *
-_XlcMapOSLocaleName(osname, siname)
- char *osname;
- char *siname;
+_XlcMapOSLocaleName(
+ char *osname,
+ char *siname)
{
#if defined(hpux) || defined(CSRG_BASED) || defined(sun) || defined(SVR4) || defined(sgi) || defined(__osf__) || defined(AIXV3) || defined(ultrix) || defined(WIN32) || defined(__UNIXOS2__) || defined(linux)
# ifdef hpux
diff --git a/src/SetPntMap.c b/src/SetPntMap.c
index 80dd63a..b4ea39f 100644
--- a/src/SetPntMap.c
+++ b/src/SetPntMap.c
@@ -24,24 +24,18 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/SetPntMap.c,v 1.4 2001/12/14 19:54:06 dawes Exp $ */
+/* $XFree86: xc/lib/X11/SetPntMap.c,v 1.5 2003/11/17 22:20:08 dawes Exp $ */
#define NEED_REPLIES
#include "Xlibint.h"
/* returns either DeviceMappingSuccess or DeviceMappingBusy */
-#if NeedFunctionPrototypes
-int XSetPointerMapping (
+int
+XSetPointerMapping (
register Display *dpy,
_Xconst unsigned char *map,
int nmaps)
-#else
-int XSetPointerMapping (dpy, map, nmaps)
- register Display *dpy;
- unsigned char *map;
- int nmaps;
-#endif
{
register xSetPointerMappingReq *req;
xSetPointerMappingReply rep;
diff --git a/src/StBytes.c b/src/StBytes.c
index f1d8cf0..ec4c567 100644
--- a/src/StBytes.c
+++ b/src/StBytes.c
@@ -24,7 +24,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/StBytes.c,v 1.4 2001/12/14 19:54:07 dawes Exp $ */
+/* $XFree86: xc/lib/X11/StBytes.c,v 1.5 2003/11/17 22:20:08 dawes Exp $ */
#include <X11/Xlibint.h>
#include <X11/Xatom.h>
@@ -82,19 +82,11 @@ char *XFetchBytes (dpy, nbytes)
}
int
-#if NeedFunctionPrototypes
XStoreBuffer (
register Display *dpy,
_Xconst char *bytes,
int nbytes,
register int buffer)
-#else
-XStoreBuffer (dpy, bytes, nbytes, buffer)
- register Display *dpy;
- char *bytes;
- int nbytes;
- register int buffer;
-#endif
{
if ((buffer < 0) || (buffer > 7)) return 0;
return XChangeProperty(dpy, RootWindow(dpy, 0), n_to_atom[buffer],
@@ -102,17 +94,10 @@ XStoreBuffer (dpy, bytes, nbytes, buffer)
}
int
-#if NeedFunctionPrototypes
XStoreBytes (
register Display *dpy,
_Xconst char *bytes,
int nbytes)
-#else
-XStoreBytes (dpy, bytes, nbytes)
- register Display *dpy;
- char *bytes;
- int nbytes;
-#endif
{
return XStoreBuffer (dpy, bytes, nbytes, 0);
}
diff --git a/src/StNColor.c b/src/StNColor.c
index 5b039ad..8385287 100644
--- a/src/StNColor.c
+++ b/src/StNColor.c
@@ -24,33 +24,20 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/StNColor.c,v 1.4 2001/12/14 19:54:07 dawes Exp $ */
+/* $XFree86: xc/lib/X11/StNColor.c,v 1.6 2003/11/17 22:20:08 dawes Exp $ */
#include <stdio.h>
#include "Xlibint.h"
#include "Xcmsint.h"
-extern void _XcmsRGB_to_XColor();
-
-/* cmsColNm.c */
-Status _XcmsResolveColorString();
int
-#if NeedFunctionPrototypes
XStoreNamedColor(
register Display *dpy,
Colormap cmap,
_Xconst char *name, /* STRING8 */
unsigned long pixel, /* CARD32 */
int flags) /* DoRed, DoGreen, DoBlue */
-#else
-XStoreNamedColor(dpy, cmap, name, pixel, flags)
-register Display *dpy;
-Colormap cmap;
-char *name; /* STRING8 */
-unsigned long pixel; /* CARD32 */
-int flags; /* DoRed, DoGreen, DoBlue */
-#endif
{
unsigned int nbytes;
register xStoreNamedColorReq *req;
diff --git a/src/StName.c b/src/StName.c
index d8ecbe1..7d1963b 100644
--- a/src/StName.c
+++ b/src/StName.c
@@ -24,23 +24,16 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/StName.c,v 1.4 2001/12/14 19:54:07 dawes Exp $ */
+/* $XFree86: xc/lib/X11/StName.c,v 1.5 2003/11/17 22:20:08 dawes Exp $ */
#include <X11/Xlibint.h>
#include <X11/Xatom.h>
int
-#if NeedFunctionPrototypes
XStoreName (
register Display *dpy,
Window w,
_Xconst char *name)
-#else
-XStoreName (dpy, w, name)
- register Display *dpy;
- Window w;
- char *name;
-#endif
{
return XChangeProperty(dpy, w, XA_WM_NAME, XA_STRING,
8, PropModeReplace, (unsigned char *)name,
@@ -48,17 +41,10 @@ XStoreName (dpy, w, name)
}
int
-#if NeedFunctionPrototypes
XSetIconName (
register Display *dpy,
Window w,
_Xconst char *icon_name)
-#else
-XSetIconName (dpy, w, icon_name)
- register Display *dpy;
- Window w;
- char *icon_name;
-#endif
{
return XChangeProperty(dpy, w, XA_WM_ICON_NAME, XA_STRING,
8, PropModeReplace, (unsigned char *)icon_name,
diff --git a/src/StrKeysym.c b/src/StrKeysym.c
index 21949b1..e13ee78 100644
--- a/src/StrKeysym.c
+++ b/src/StrKeysym.c
@@ -24,18 +24,16 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/StrKeysym.c,v 3.6 2001/12/14 19:54:07 dawes Exp $ */
+/* $XFree86: xc/lib/X11/StrKeysym.c,v 3.8 2003/11/17 22:20:08 dawes Exp $ */
#include "Xlibint.h"
#include <X11/Xresource.h>
#include <X11/keysymdef.h>
-
-extern XrmQuark _XrmInternalStringToQuark();
-
-typedef unsigned long Signature;
+#include "Xresinternal.h"
#define NEEDKTABLE
#include "ks_tables.h"
+#include "Key.h"
#ifndef KEYSYMDB
#define KEYSYMDB "/usr/lib/X11/XKeysymDB"
@@ -46,7 +44,7 @@ static XrmDatabase keysymdb;
static XrmQuark Qkeysym[2];
XrmDatabase
-_XInitKeysymDB()
+_XInitKeysymDB(void)
{
if (!initialized)
{
@@ -66,13 +64,8 @@ _XInitKeysymDB()
return keysymdb;
}
-#if NeedFunctionPrototypes
-KeySym XStringToKeysym(s)
- _Xconst char *s;
-#else
-KeySym XStringToKeysym(s)
- char *s;
-#endif
+KeySym
+XStringToKeysym(_Xconst char *s)
{
register int i, n;
int h;
diff --git a/src/Synchro.c b/src/Synchro.c
index 9e9d50a..713bc23 100644
--- a/src/Synchro.c
+++ b/src/Synchro.c
@@ -24,27 +24,21 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/X11/Synchro.c,v 1.4 2003/11/17 22:20:08 dawes Exp $ */
#include "Xlibint.h"
-int _XSyncFunction(dpy)
-register Display *dpy;
+static int _XSyncFunction(register Display *dpy)
{
XSync(dpy,0);
return 0;
}
-#if NeedFunctionPrototypes
-int (*XSynchronize(Display *dpy, int onoff))()
-#else
-int (*XSynchronize(dpy,onoff))()
- register Display *dpy;
- int onoff;
-#endif
+int (*XSynchronize(Display *dpy, int onoff))(Display *)
{
- int (*temp)();
- int (*func)() = NULL;
+ int (*temp)(Display *);
+ int (*func)(Display *) = NULL;
if (onoff)
func = _XSyncFunction;
@@ -61,26 +55,14 @@ int (*XSynchronize(dpy,onoff))()
return (temp);
}
-#if NeedFunctionPrototypes
int (*XSetAfterFunction(
Display *dpy,
int (*func)(
-#if NeedNestedPrototypes
Display*
-#endif
)
-))()
-#else
-int (*XSetAfterFunction(dpy,func))()
- register Display *dpy;
- int (*func)(
-#if NeedNestedPrototypes
- Display*
-#endif
- );
-#endif
+ ))(Display *)
{
- int (*temp)();
+ int (*temp)(Display *);
LockDisplay(dpy);
if (dpy->flags & XlibDisplayPrivSync) {
diff --git a/src/Text.c b/src/Text.c
index 1a07159..7dddfa9 100644
--- a/src/Text.c
+++ b/src/Text.c
@@ -24,12 +24,11 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/Text.c,v 1.4 2001/12/14 19:54:07 dawes Exp $ */
+/* $XFree86: xc/lib/X11/Text.c,v 1.5 2003/11/17 22:20:08 dawes Exp $ */
#include "Xlibint.h"
int
-#if NeedFunctionPrototypes
XDrawString(
register Display *dpy,
Drawable d,
@@ -38,15 +37,6 @@ XDrawString(
int y,
_Xconst char *string,
int length)
-#else
-XDrawString(dpy, d, gc, x, y, string, length)
- register Display *dpy;
- Drawable d;
- GC gc;
- int x, y;
- char *string;
- int length;
-#endif
{
int Datalength = 0;
register xPolyText8Req *req;
diff --git a/src/Text16.c b/src/Text16.c
index a20f3a3..89d05ab 100644
--- a/src/Text16.c
+++ b/src/Text16.c
@@ -24,12 +24,11 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/Text16.c,v 1.5 2001/12/14 19:54:07 dawes Exp $ */
+/* $XFree86: xc/lib/X11/Text16.c,v 1.6 2003/11/17 22:20:08 dawes Exp $ */
#include "Xlibint.h"
int
-#if NeedFunctionPrototypes
XDrawString16(
register Display *dpy,
Drawable d,
@@ -38,15 +37,6 @@ XDrawString16(
int y,
_Xconst XChar2b *string,
int length)
-#else
-XDrawString16(dpy, d, gc, x, y, string, length)
- register Display *dpy;
- Drawable d;
- GC gc;
- int x, y;
- XChar2b *string;
- int length;
-#endif
{
int Datalength = 0;
register xPolyText16Req *req;
diff --git a/src/TextExt.c b/src/TextExt.c
index 9c68ee8..6b39091 100644
--- a/src/TextExt.c
+++ b/src/TextExt.c
@@ -26,7 +26,7 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/lib/X11/TextExt.c,v 1.4 2001/12/14 19:54:07 dawes Exp $ */
+/* $XFree86: xc/lib/X11/TextExt.c,v 1.5 2003/11/17 22:20:08 dawes Exp $ */
/*
* Copyright 1995 by FUJITSU LIMITED
* This is source code modified by FUJITSU LIMITED under the Joint
@@ -70,7 +70,6 @@ from The Open Group.
* what is done in XTextExtents16.
*/
int
-#if NeedFunctionPrototypes
XTextExtents (
XFontStruct *fs,
_Xconst char *string,
@@ -79,14 +78,6 @@ XTextExtents (
int *font_ascent, /* RETURN font information */
int *font_descent, /* RETURN font information */
register XCharStruct *overall) /* RETURN character information */
-#else
-XTextExtents (fs, string, nchars, dir, font_ascent, font_descent, overall)
- XFontStruct *fs;
- char *string;
- int nchars;
- int *dir, *font_ascent, *font_descent; /* RETURN font information */
- register XCharStruct *overall; /* RETURN character information */
-#endif
{
int i; /* iterator */
Bool singlerow = (fs->max_byte1 == 0); /* optimization */
@@ -152,17 +143,11 @@ XTextExtents (fs, string, nchars, dir, font_ascent, font_descent, overall)
* XTextWidth - compute the width of a string of eightbit bytes. This is a
* subset of XTextExtents.
*/
-#if NeedFunctionPrototypes
-int XTextWidth (
+int
+XTextWidth (
XFontStruct *fs,
_Xconst char *string,
int count)
-#else
-int XTextWidth (fs, string, count)
- XFontStruct *fs;
- char *string;
- int count;
-#endif
{
int i; /* iterator */
Bool singlerow = (fs->max_byte1 == 0); /* optimization */
@@ -204,17 +189,11 @@ int XTextWidth (fs, string, count)
/*
* _XTextHeight - compute the height of a string of eightbit bytes.
*/
-#if NeedFunctionPrototypes
-int _XTextHeight (
+int
+_XTextHeight (
XFontStruct *fs,
_Xconst char *string,
int count)
-#else
-int _XTextHeight (fs, string, count)
- XFontStruct *fs;
- char *string;
- int count;
-#endif
{
int i; /* iterator */
Bool singlerow = (fs->max_byte1 == 0); /* optimization */
diff --git a/src/TextExt16.c b/src/TextExt16.c
index 14064f6..5707faa 100644
--- a/src/TextExt16.c
+++ b/src/TextExt16.c
@@ -26,7 +26,7 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/lib/X11/TextExt16.c,v 1.4 2001/12/14 19:54:07 dawes Exp $ */
+/* $XFree86: xc/lib/X11/TextExt16.c,v 1.5 2003/11/17 22:20:08 dawes Exp $ */
/*
* Copyright 1995 by FUJITSU LIMITED
* This is source code modified by FUJITSU LIMITED under the Joint
@@ -44,7 +44,6 @@ from The Open Group.
* XChar2bs.
*/
int
-#if NeedFunctionPrototypes
XTextExtents16 (
XFontStruct *fs,
_Xconst XChar2b *string,
@@ -53,14 +52,6 @@ XTextExtents16 (
int *font_ascent, /* RETURN font information */
int *font_descent, /* RETURN font information */
register XCharStruct *overall) /* RETURN character information */
-#else
-XTextExtents16 (fs, string, nchars, dir, font_ascent, font_descent, overall)
- XFontStruct *fs;
- XChar2b *string;
- int nchars;
- int *dir, *font_ascent, *font_descent; /* RETURN font information */
- register XCharStruct *overall; /* RETURN character information */
-#endif
{
int i; /* iterator */
Bool singlerow = (fs->max_byte1 == 0); /* optimization */
@@ -127,17 +118,11 @@ XTextExtents16 (fs, string, nchars, dir, font_ascent, font_descent, overall)
* XTextWidth16 - compute the width of sequence of XChar2bs. This is a
* subset of XTextExtents16.
*/
-#if NeedFunctionPrototypes
-int XTextWidth16 (
+int
+XTextWidth16 (
XFontStruct *fs,
_Xconst XChar2b *string,
int count)
-#else
-int XTextWidth16 (fs, string, count)
- XFontStruct *fs;
- XChar2b *string;
- int count;
-#endif
{
int i; /* iterator */
Bool singlerow = (fs->max_byte1 == 0); /* optimization */
@@ -179,17 +164,11 @@ int XTextWidth16 (fs, string, count)
/*
* _XTextHeight16 - compute the height of sequence of XChar2bs.
*/
-#if NeedFunctionPrototypes
-int _XTextHeight16 (
+int
+_XTextHeight16 (
XFontStruct *fs,
_Xconst XChar2b *string,
int count)
-#else
-int _XTextHeight16 (fs, string, count)
- XFontStruct *fs;
- XChar2b *string;
- int count;
-#endif
{
int i; /* iterator */
Bool singlerow = (fs->max_byte1 == 0); /* optimization */
diff --git a/src/WMGeom.c b/src/WMGeom.c
index 96b9b53..05ce8e4 100644
--- a/src/WMGeom.c
+++ b/src/WMGeom.c
@@ -24,12 +24,13 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/X11/WMGeom.c,v 1.4 2003/11/17 22:20:08 dawes Exp $ */
#include "Xlibint.h"
#include "Xutil.h"
-static int _GeometryMaskToGravity();
-
+static int _GeometryMaskToGravity(
+ int mask);
/*
* This routine given a user supplied positional argument and a default
@@ -40,8 +41,8 @@ static int _GeometryMaskToGravity();
* be considered "negative".
*/
-#if NeedFunctionPrototypes
-int XWMGeometry (
+int
+XWMGeometry (
Display *dpy, /* user's display connection */
int screen, /* screen on which to do computation */
_Xconst char *user_geom, /* user provided geometry spec */
@@ -53,20 +54,6 @@ int XWMGeometry (
int *width_return, /* size of window */
int *height_return, /* size of window */
int *gravity_return) /* gravity of window */
-#else
-int XWMGeometry (dpy, screen, user_geom, def_geom, bwidth, hints,
- x_return, y_return, width_return, height_return,
- gravity_return)
- Display *dpy; /* user's display connection */
- int screen; /* screen on which to do computation */
- char *user_geom; /* user provided geometry spec */
- char *def_geom; /* default geometry spec for window */
- unsigned int bwidth; /* border width */
- XSizeHints *hints; /* usually WM_NORMAL_HINTS */
- int *x_return, *y_return; /* location of window */
- int *width_return, *height_return; /* size of window */
- int *gravity_return; /* gravity of window */
-#endif
{
int ux, uy; /* returned values from parse */
unsigned int uwidth, uheight; /* returned values from parse */
@@ -179,8 +166,8 @@ int XWMGeometry (dpy, screen, user_geom, def_geom, bwidth, hints,
}
-static int _GeometryMaskToGravity (mask)
- int mask;
+static int _GeometryMaskToGravity(
+ int mask)
{
switch (mask & (XNegative|YNegative)) {
case 0:
diff --git a/src/Window.c b/src/Window.c
index b48b191..470c1c2 100644
--- a/src/Window.c
+++ b/src/Window.c
@@ -24,15 +24,15 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/Window.c,v 1.4 2001/12/14 19:54:08 dawes Exp $ */
+/* $XFree86: xc/lib/X11/Window.c,v 1.5 2003/04/13 19:22:18 dawes Exp $ */
#include "Xlibint.h"
-void _XProcessWindowAttributes (dpy, req, valuemask, attributes)
- register Display *dpy;
- xChangeWindowAttributesReq *req;
- register unsigned long valuemask;
- register XSetWindowAttributes *attributes;
+void _XProcessWindowAttributes (
+ register Display *dpy,
+ xChangeWindowAttributesReq *req,
+ register unsigned long valuemask,
+ register XSetWindowAttributes *attributes)
{
unsigned long values[32];
register unsigned long *value = values;
diff --git a/src/WrBitF.c b/src/WrBitF.c
index 5f155a2..e45e294 100644
--- a/src/WrBitF.c
+++ b/src/WrBitF.c
@@ -26,7 +26,7 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/lib/X11/WrBitF.c,v 3.5 2002/05/31 18:45:41 dawes Exp $ */
+/* $XFree86: xc/lib/X11/WrBitF.c,v 3.7 2003/11/17 22:20:08 dawes Exp $ */
#include "Xlibint.h"
#include <X11/Xos.h>
@@ -35,9 +35,9 @@ from The Open Group.
#define ERR_RETURN 0
-static char *Format_Image(image, resultsize)
-XImage *image;
-int *resultsize;
+static char *Format_Image(
+ XImage *image,
+ int *resultsize)
{
register int x, c, b;
register char *ptr;
@@ -82,8 +82,8 @@ int *resultsize;
#define BYTES_PER_OUTPUT_LINE 12
-#if NeedFunctionPrototypes
-int XWriteBitmapFile(
+int
+XWriteBitmapFile(
Display *display,
_Xconst char *filename,
Pixmap bitmap,
@@ -91,14 +91,6 @@ int XWriteBitmapFile(
unsigned int height,
int x_hot,
int y_hot)
-#else
-int XWriteBitmapFile(display, filename, bitmap, width, height, x_hot, y_hot)
- Display *display;
- char *filename;
- Pixmap bitmap;
- unsigned int width, height;
- int x_hot, y_hot;
-#endif
{
char *data, *ptr;
int size, byte;
diff --git a/src/Xintconn.h b/src/Xintconn.h
index 3010da4..f210d4e 100644
--- a/src/Xintconn.h
+++ b/src/Xintconn.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/X11/Xintconn.h,v 1.1 2001/08/18 02:41:28 dawes Exp $ */
+/* $XFree86: xc/lib/X11/Xintconn.h,v 1.2 2003/04/13 19:22:19 dawes Exp $ */
#ifndef _XINTCONN_H_
#define _XINTCONN_H_ 1
@@ -9,6 +9,15 @@ _XFUNCPROTOBEGIN
/* ConnDis.c */
+int _XConnectDisplay (
+ char *display_name,
+ char **fullnamep, /* RETURN */
+ int *dpynump, /* RETURN */
+ int *screenp, /* RETURN */
+ char **auth_namep, /* RETURN */
+ int *auth_namelenp, /* RETURN */
+ char **auth_datap, /* RETURN */
+ int *auth_datalenp); /* RETURN */
extern int _XDisconnectDisplay(XtransConnInfo trans_conn);
extern Bool _XSendClientPrefix(Display *dpy, xConnClientPrefix *client,
char *auth_proto, char *auth_string,
diff --git a/src/XlibInt.c b/src/XlibInt.c
index 689112c..6bb2d18 100644
--- a/src/XlibInt.c
+++ b/src/XlibInt.c
@@ -26,7 +26,7 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/lib/X11/XlibInt.c,v 3.34 2003/02/18 05:15:27 dawes Exp $ */
+/* $XFree86: xc/lib/X11/XlibInt.c,v 3.39 2003/11/17 22:20:10 dawes Exp $ */
/*
* XlibInt.c - Internal support routines for the C subroutine
@@ -46,12 +46,24 @@ from The Open Group.
/* these pointers get initialized by XInitThreads */
LockInfoPtr _Xglobal_lock = NULL;
-void (*_XCreateMutex_fn)() = NULL;
-struct _XCVList *(*_XCreateCVL_fn)() = NULL;
-void (*_XFreeMutex_fn)() = NULL;
-void (*_XLockMutex_fn)() = NULL;
-void (*_XUnlockMutex_fn)() = NULL;
-xthread_t (*_Xthread_self_fn)() = NULL;
+void (*_XCreateMutex_fn)(LockInfoPtr) = NULL;
+/* struct _XCVList *(*_XCreateCVL_fn)() = NULL; */
+void (*_XFreeMutex_fn)(LockInfoPtr) = NULL;
+void (*_XLockMutex_fn)(
+ LockInfoPtr /* lock */
+#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
+ , char * /* file */
+ , int /* line */
+#endif
+ ) = NULL;
+void (*_XUnlockMutex_fn)(
+ LockInfoPtr /* lock */
+#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
+ , char * /* file */
+ , int /* line */
+#endif
+ ) = NULL;
+xthread_t (*_Xthread_self_fn)(void) = NULL;
#define XThread_Self() ((*_Xthread_self_fn)())
@@ -163,8 +175,17 @@ typedef union {
char buf[BUFSIZE];
} _XAlignedBuffer;
-static char *_XAsyncReply();
-static void _XProcessInternalConnection();
+static char *_XAsyncReply(
+ Display *dpy,
+ register xReply *rep,
+ char *buf,
+ register int *lenp,
+ Bool discard);
+
+static void _XProcessInternalConnection(
+ Display *dpy,
+ struct _XConnectionInfo *conn_info);
+
#define SEQLIMIT (65535 - (BUFSIZE / SIZEOF(xReq)) - 10)
/*
@@ -196,15 +217,13 @@ static xReq _dummy_request = {
* until the connection is writable.
*/
static void
-_XWaitForWritable(dpy
-#ifdef XTHREADS
- , cv
-#endif
- )
- Display *dpy;
+_XWaitForWritable(
+ Display *dpy
#ifdef XTHREADS
- xcondition_t cv; /* our reading condition variable */
+ ,
+ xcondition_t cv /* our reading condition variable */
#endif
+ )
{
#ifdef USE_POLL
struct pollfd filedes;
@@ -278,7 +297,7 @@ _XWaitForWritable(dpy
{
_XAlignedBuffer buf;
BytesReadable_t pend;
- register BytesReadable_t len;
+ register int len;
register xReply *rep;
/* find out how much data can be read */
@@ -305,11 +324,12 @@ _XWaitForWritable(dpy
STARTITERATE(rep,xReply,buf.buf,len > 0) {
if (rep->generic.type == X_Reply) {
- pend = len;
+ int tmp = len;
RESETITERPTR(rep,xReply,
_XAsyncReply (dpy, rep,
- ITERPTR(rep), &pend, True));
- len = pend;
+ ITERPTR(rep), &tmp, True));
+ len = tmp;
+ pend = len;
} else {
if (rep->generic.type == X_Error)
_XError (dpy, (xError *)rep);
@@ -344,8 +364,8 @@ _XWaitForWritable(dpy
#define POLLFD_CACHE_SIZE 5
/* initialize the struct array passed to poll() below */
-Bool _XPollfdCacheInit(dpy)
- Display *dpy;
+Bool _XPollfdCacheInit(
+ Display *dpy)
{
#ifdef USE_POLL
struct pollfd *pfp;
@@ -361,9 +381,9 @@ Bool _XPollfdCacheInit(dpy)
return True;
}
-void _XPollfdCacheAdd(dpy, fd)
- Display *dpy;
- int fd;
+void _XPollfdCacheAdd(
+ Display *dpy,
+ int fd)
{
#ifdef USE_POLL
struct pollfd *pfp = (struct pollfd *)dpy->filedes;
@@ -376,9 +396,9 @@ void _XPollfdCacheAdd(dpy, fd)
}
/* ARGSUSED */
-void _XPollfdCacheDel(dpy, fd)
- Display *dpy;
- int fd; /* not used */
+void _XPollfdCacheDel(
+ Display *dpy,
+ int fd) /* not used */
{
#ifdef USE_POLL
struct pollfd *pfp = (struct pollfd *)dpy->filedes;
@@ -399,9 +419,9 @@ void _XPollfdCacheDel(dpy, fd)
/* returns True iff there is an event in the queue newer than serial_num */
static Bool
-_XNewerQueuedEvent(dpy, serial_num)
- Display *dpy;
- int serial_num;
+_XNewerQueuedEvent(
+ Display *dpy,
+ int serial_num)
{
_XQEvent *qev;
@@ -419,8 +439,8 @@ _XNewerQueuedEvent(dpy, serial_num)
}
static int
-_XWaitForReadable(dpy)
- Display *dpy;
+_XWaitForReadable(
+ Display *dpy)
{
int result;
int fd = dpy->fd;
@@ -527,8 +547,8 @@ _XWaitForReadable(dpy)
}
static
-int _XSeqSyncFunction(dpy)
- register Display *dpy;
+int _XSeqSyncFunction(
+ register Display *dpy)
{
xGetInputFocusReply rep;
register xReq *req;
@@ -549,7 +569,9 @@ int _XSeqSyncFunction(dpy)
}
#ifdef XTHREADS
-static void _XFlushInt();
+static void _XFlushInt(
+ register Display *dpy,
+ register xcondition_t cv);
#endif
/*
@@ -557,8 +579,8 @@ static void _XFlushInt();
* action is taken. This routine correctly handles incremental writes.
* This routine may have to be reworked if int < long.
*/
-void _XFlush (dpy)
- register Display *dpy;
+void _XFlush(
+ register Display *dpy)
{
#ifdef XTHREADS
/* With multi-threading we introduce an internal routine to which
@@ -571,9 +593,9 @@ void _XFlush (dpy)
* locking correctly.
*/
-static void _XFlushInt (dpy, cv)
- register Display *dpy;
- register xcondition_t cv;
+static void _XFlushInt(
+ register Display *dpy,
+ register xcondition_t cv)
{
#endif /* XTHREADS*/
register long size, todo;
@@ -671,11 +693,11 @@ static void _XFlushInt (dpy, cv)
}
int
-_XEventsQueued (dpy, mode)
- register Display *dpy;
- int mode;
+_XEventsQueued(
+ register Display *dpy,
+ int mode)
{
- register BytesReadable_t len;
+ register int len;
BytesReadable_t pend;
_XAlignedBuffer buf;
register xReply *rep;
@@ -838,11 +860,12 @@ _XEventsQueued (dpy, mode)
STARTITERATE(rep,xReply,buf.buf,len > 0) {
if (rep->generic.type == X_Reply) {
- pend = len;
+ int tmp = len;
RESETITERPTR(rep,xReply,
_XAsyncReply (dpy, rep,
- ITERPTR(rep), &pend, True));
- len = pend;
+ ITERPTR(rep), &tmp, True));
+ len = tmp;
+ pend = len;
} else {
if (rep->generic.type == X_Error)
_XError (dpy, (xError *)rep);
@@ -865,12 +888,12 @@ _XEventsQueued (dpy, mode)
/* _XReadEvents - Flush the output queue,
* then read as many events as possible (but at least 1) and enqueue them
*/
-void _XReadEvents(dpy)
- register Display *dpy;
+void _XReadEvents(
+ register Display *dpy)
{
_XAlignedBuffer buf;
BytesReadable_t pend;
- register BytesReadable_t len;
+ int len;
register xReply *rep;
Bool not_yet_flushed = True;
char *read_buf;
@@ -1002,11 +1025,10 @@ void _XReadEvents(dpy)
STARTITERATE(rep,xReply,buf.buf,len > 0) {
if (rep->generic.type == X_Reply) {
- pend = len;
RESETITERPTR(rep,xReply,
_XAsyncReply (dpy, rep,
- ITERPTR(rep), &pend, True));
- len = pend;
+ ITERPTR(rep), &len, True));
+ pend = len;
} else {
if (rep->generic.type == X_Error)
_XError (dpy, (xError *) rep);
@@ -1025,10 +1047,10 @@ void _XReadEvents(dpy)
* _XRead - Read bytes from the socket taking into account incomplete
* reads. This routine may have to be reworked if int < long.
*/
-int _XRead (dpy, data, size)
- register Display *dpy;
- register char *data;
- register long size;
+int _XRead(
+ register Display *dpy,
+ register char *data,
+ register long size)
{
register long bytes_read;
#ifdef XTHREADS
@@ -1082,10 +1104,10 @@ int _XRead (dpy, data, size)
}
#ifdef LONG64
-void _XRead32 (dpy, data, len)
- Display *dpy;
- register long *data;
- long len;
+void _XRead32(
+ Display *dpy,
+ register long *data,
+ long len)
{
register int *buf;
register long i;
@@ -1116,11 +1138,11 @@ void _XRead32 (dpy, data, len)
* into a long (64 bits on a CRAY computer).
*
*/
-static void _doXRead32 (dpy, data, size, packbuffer)
- register Display *dpy;
- register long *data;
- register long size;
- register char *packbuffer;
+static void _doXRead32(
+ register Display *dpy,
+ register long *data
+ register long size,
+ register char *packbuffer)
{
long *lpack,*lp;
long mask32 = 0x00000000ffffffff;
@@ -1143,10 +1165,10 @@ static void _doXRead32 (dpy, data, size, packbuffer)
}
}
-void _XRead32 (dpy, data, len)
- Display *dpy;
- long *data;
- long len;
+void _XRead32(
+ Display *dpy,
+ long *data,
+ long len)
{
char packbuffer[PACKBUFFERSIZE];
unsigned nunits = PACKBUFFERSIZE >> 2;
@@ -1164,11 +1186,11 @@ void _XRead32 (dpy, data, len)
* into a long (64 bits on a CRAY computer).
*
*/
-static _doXRead16 (dpy, data, size, packbuffer)
- register Display *dpy;
- register short *data;
- register long size;
- char *packbuffer;
+static _doXRead16(
+ register Display *dpy,
+ register short *data,
+ register long size,
+ char *packbuffer)
{
long *lpack,*lp;
long mask16 = 0x000000000000ffff;
@@ -1191,10 +1213,10 @@ static _doXRead16 (dpy, data, size, packbuffer)
}
}
-void _XRead16 (dpy, data, len)
- Display *dpy;
- short *data;
- long len;
+void _XRead16(
+ Display *dpy,
+ short *data,
+ long len)
{
char packbuffer[PACKBUFFERSIZE];
unsigned nunits = PACKBUFFERSIZE >> 1;
@@ -1205,10 +1227,10 @@ void _XRead16 (dpy, data, len)
if (len) _doXRead16 (dpy, data, len, packbuffer);
}
-void _XRead16Pad (dpy, data, size)
- Display *dpy;
- short *data;
- long size;
+void _XRead16Pad(
+ Display *dpy,
+ short *data,
+ long size)
{
int slop = (size & 3);
short slopbuf[3];
@@ -1226,10 +1248,10 @@ void _XRead16Pad (dpy, data, size)
* reads. If the number of bytes is not 0 mod 4, read additional pad
* bytes. This routine may have to be reworked if int < long.
*/
-void _XReadPad (dpy, data, size)
- register Display *dpy;
- register char *data;
- register long size;
+void _XReadPad(
+ register Display *dpy,
+ register char *data,
+ register long size)
{
register long bytes_read;
struct iovec iov[2];
@@ -1258,14 +1280,17 @@ void _XReadPad (dpy, data, size)
if (bytes_read > 0) {
size -= bytes_read;
- if ((iov[0].iov_len -= bytes_read) < 0) {
- iov[1].iov_len += iov[0].iov_len;
- iov[1].iov_base = (char *)iov[1].iov_base - iov[0].iov_len;
+ if (iov[0].iov_len < bytes_read) {
+ iov[1].iov_len += iov[0].iov_len - bytes_read;
+ iov[1].iov_base =
+ (char *)iov[1].iov_base + bytes_read - iov[0].iov_len;
iov[0].iov_len = 0;
}
- else
+ else {
+ iov[0].iov_len -= bytes_read;
iov[0].iov_base = (char *)iov[0].iov_base + bytes_read;
}
+ }
else if (ETEST()) {
_XWaitForReadable(dpy);
ESET(0);
@@ -1305,17 +1330,10 @@ void _XReadPad (dpy, data, size)
* This routine may have to be reworked if int < long;
*/
void
-#if NeedFunctionPrototypes
_XSend (
register Display *dpy,
_Xconst char *data,
register long size)
-#else
-_XSend (dpy, data, size)
- register Display *dpy;
- char *data;
- register long size;
-#endif
{
struct iovec iov[3];
static char const pad[3] = {0, 0, 0};
@@ -1438,8 +1456,8 @@ _XSend (dpy, data, size)
}
static void
-_XGetMiscCode(dpy)
- register Display *dpy;
+_XGetMiscCode(
+ register Display *dpy)
{
xQueryExtensionReply qrep;
register xQueryExtensionReq *qreq;
@@ -1468,8 +1486,8 @@ _XGetMiscCode(dpy)
}
static int
-_XIDHandler(dpy)
- register Display *dpy;
+_XIDHandler(
+ register Display *dpy)
{
xXCMiscGetXIDRangeReply grep;
register xXCMiscGetXIDRangeReq *greq;
@@ -1501,8 +1519,8 @@ _XIDHandler(dpy)
/*
* _XAllocID - resource ID allocation routine.
*/
-XID _XAllocID(dpy)
- register Display *dpy;
+XID _XAllocID(
+ register Display *dpy)
{
XID id;
@@ -1531,10 +1549,10 @@ XID _XAllocID(dpy)
/*
* _XAllocIDs - multiple resource ID allocation routine.
*/
-void _XAllocIDs(dpy, ids, count)
- register Display *dpy;
- XID *ids;
- int count;
+void _XAllocIDs(
+ register Display *dpy,
+ XID *ids,
+ int count)
{
XID id;
int i;
@@ -1592,9 +1610,9 @@ void _XAllocIDs(dpy, ids, count)
*/
unsigned long
-_XSetLastRequestRead(dpy, rep)
- register Display *dpy;
- register xGenericReply *rep;
+_XSetLastRequestRead(
+ register Display *dpy,
+ register xGenericReply *rep)
{
register unsigned long newseq, lastseq;
@@ -1630,11 +1648,11 @@ _XSetLastRequestRead(dpy, rep)
* we may encounter.
*/
Status
-_XReply (dpy, rep, extra, discard)
- register Display *dpy;
- register xReply *rep;
- int extra; /* number of 32-bit words expected after the reply */
- Bool discard; /* should I discard data following "extra" words? */
+_XReply (
+ register Display *dpy,
+ register xReply *rep,
+ int extra, /* number of 32-bit words expected after the reply */
+ Bool discard) /* should I discard data following "extra" words? */
{
/* Pull out the serial number now, so that (currently illegal) requests
* generated by an error handler don't confuse us.
@@ -1806,12 +1824,12 @@ _XReply (dpy, rep, extra, discard)
}
static char *
-_XAsyncReply(dpy, rep, buf, lenp, discard)
- Display *dpy;
- register xReply *rep;
- char *buf;
- register int *lenp;
- Bool discard;
+_XAsyncReply(
+ Display *dpy,
+ register xReply *rep,
+ char *buf,
+ register int *lenp,
+ Bool discard)
{
register _XAsyncHandler *async, *next;
register int len;
@@ -1904,21 +1922,13 @@ _XAsyncReply(dpy, rep, buf, lenp, discard)
* because could not allocate memory.
* Assumes Display locked when called.
*/
-#if NeedFunctionPrototypes
-Status _XRegisterInternalConnection(
+Status
+_XRegisterInternalConnection(
Display* dpy,
int fd,
_XInternalConnectionProc callback,
XPointer call_data
)
-#else
-Status
-_XRegisterInternalConnection(dpy, fd, callback, call_data)
- Display *dpy;
- int fd;
- _XInternalConnectionProc callback;
- XPointer call_data;
-#endif
{
struct _XConnectionInfo *new_conni, **iptr;
struct _XConnWatchInfo *watchers;
@@ -1961,17 +1971,11 @@ _XRegisterInternalConnection(dpy, fd, callback, call_data)
*
* Assumes Display locked when called.
*/
-#if NeedFunctionPrototypes
-void _XUnregisterInternalConnection(
+void
+_XUnregisterInternalConnection(
Display* dpy,
int fd
)
-#else
-void
-_XUnregisterInternalConnection(dpy, fd)
- Display *dpy;
- int fd;
-#endif
{
struct _XConnectionInfo *info_list, **prev;
struct _XConnWatchInfo *watch;
@@ -2005,19 +2009,12 @@ _XUnregisterInternalConnection(dpy, fd)
* The list is allocated with Xmalloc and should be freed by the caller
* with Xfree;
*/
-#if NeedFunctionPrototypes
-Status XInternalConnectionNumbers(
+Status
+XInternalConnectionNumbers(
Display *dpy,
int **fd_return,
int *count_return
)
-#else
-Status
-XInternalConnectionNumbers(dpy, fd_return, count_return)
- Display *dpy;
- int **fd_return;
- int *count_return;
-#endif
{
int count;
struct _XConnectionInfo *info_list;
@@ -2044,9 +2041,9 @@ XInternalConnectionNumbers(dpy, fd_return, count_return)
return 1;
}
-static void _XProcessInternalConnection(dpy, conn_info)
- Display *dpy;
- struct _XConnectionInfo *conn_info;
+static void _XProcessInternalConnection(
+ Display *dpy,
+ struct _XConnectionInfo *conn_info)
{
dpy->flags |= XlibDisplayProcConni;
#ifdef XTHREADS
@@ -2073,17 +2070,11 @@ static void _XProcessInternalConnection(dpy, conn_info)
* for this fd.
* The Display is NOT locked during the call.
*/
-#if NeedFunctionPrototypes
-void XProcessInternalConnection(
+void
+XProcessInternalConnection(
Display* dpy,
int fd
)
-#else
-void
-XProcessInternalConnection(dpy, fd)
- Display *dpy;
- int fd;
-#endif
{
struct _XConnectionInfo *info_list;
@@ -2104,19 +2095,12 @@ XProcessInternalConnection(dpy, fd)
* If any connections are already registered, the callback is immediately
* called for each of them.
*/
-#if NeedFunctionPrototypes
-Status XAddConnectionWatch(
+Status
+XAddConnectionWatch(
Display* dpy,
XConnectionWatchProc callback,
XPointer client_data
)
-#else
-Status
-XAddConnectionWatch(dpy, callback, client_data)
- Display *dpy;
- XConnectionWatchProc callback;
- XPointer client_data;
-#endif
{
struct _XConnWatchInfo *new_watcher, **wptr;
struct _XConnectionInfo *info_list;
@@ -2166,19 +2150,12 @@ XAddConnectionWatch(dpy, callback, client_data)
* Both callback and client_data must match what was passed to
* XAddConnectionWatch.
*/
-#if NeedFunctionPrototypes
-void XRemoveConnectionWatch(
+void
+XRemoveConnectionWatch(
Display* dpy,
XConnectionWatchProc callback,
XPointer client_data
)
-#else
-void
-XRemoveConnectionWatch(dpy, callback, client_data)
- Display *dpy;
- XConnectionWatchProc callback;
- XPointer client_data;
-#endif
{
struct _XConnWatchInfo *watch;
struct _XConnWatchInfo *previous = NULL;
@@ -2215,9 +2192,9 @@ XRemoveConnectionWatch(dpy, callback, client_data)
/* Read and discard "n" 8-bit bytes of data */
-void _XEatData (dpy, n)
- Display *dpy;
- register unsigned long n;
+void _XEatData(
+ Display *dpy,
+ register unsigned long n)
{
#define SCRATCHSIZE 2048
char buf[SCRATCHSIZE];
@@ -2236,9 +2213,9 @@ void _XEatData (dpy, n)
* note that no squishing of move events in V11, since there
* is pointer motion hints....
*/
-void _XEnq (dpy, event)
- register Display *dpy;
- register xEvent *event;
+void _XEnq(
+ register Display *dpy,
+ register xEvent *event)
{
register _XQEvent *qelt;
@@ -2271,10 +2248,10 @@ void _XEnq (dpy, event)
/*
* _XDeq - Remove event packet from the display's queue.
*/
-void _XDeq (dpy, prev, qelt)
- register Display *dpy;
- register _XQEvent *prev; /* element before qelt */
- register _XQEvent *qelt; /* element to be unlinked */
+void _XDeq(
+ register Display *dpy,
+ register _XQEvent *prev, /* element before qelt */
+ register _XQEvent *qelt) /* element to be unlinked */
{
if (prev) {
if ((prev->next = qelt->next) == NULL)
@@ -2296,10 +2273,10 @@ void _XDeq (dpy, prev, qelt)
/*ARGSUSED*/
Bool
-_XUnknownWireEvent(dpy, re, event)
-register Display *dpy; /* pointer to display structure */
-register XEvent *re; /* pointer to where event should be reformatted */
-register xEvent *event; /* wire protocol event */
+_XUnknownWireEvent(
+ register Display *dpy, /* pointer to display structure */
+ register XEvent *re, /* pointer to where event should be reformatted */
+ register xEvent *event) /* wire protocol event */
{
#ifdef notdef
(void) fprintf(stderr,
@@ -2311,10 +2288,10 @@ register xEvent *event; /* wire protocol event */
/*ARGSUSED*/
Status
-_XUnknownNativeEvent(dpy, re, event)
-register Display *dpy; /* pointer to display structure */
-register XEvent *re; /* pointer to where event should be reformatted */
-register xEvent *event; /* wire protocol event */
+_XUnknownNativeEvent(
+ register Display *dpy, /* pointer to display structure */
+ register XEvent *re, /* pointer to where event should be reformatted */
+ register xEvent *event) /* wire protocol event */
{
#ifdef notdef
(void) fprintf(stderr,
@@ -2327,10 +2304,10 @@ register xEvent *event; /* wire protocol event */
* reformat a wire event into an XEvent structure of the right type.
*/
Bool
-_XWireToEvent(dpy, re, event)
-register Display *dpy; /* pointer to display structure */
-register XEvent *re; /* pointer to where event should be reformatted */
-register xEvent *event; /* wire protocol event */
+_XWireToEvent(
+ register Display *dpy, /* pointer to display structure */
+ register XEvent *re, /* pointer to where event should be reformatted */
+ register xEvent *event) /* wire protocol event */
{
re->type = event->u.u.type & 0x7f;
@@ -2701,8 +2678,8 @@ register xEvent *event; /* wire protocol event */
* _XDefaultIOError - Default fatal system error reporting routine. Called
* when an X internal system error is encountered.
*/
-void _XDefaultIOError (dpy)
- Display *dpy;
+int _XDefaultIOError(
+ Display *dpy)
{
if (ECHECK(EPIPE)) {
(void) fprintf (stderr,
@@ -2724,13 +2701,14 @@ void _XDefaultIOError (dpy)
}
exit(1);
+ return(0); /* dummy - function should never return */
}
-static int _XPrintDefaultError (dpy, event, fp)
- Display *dpy;
- XErrorEvent *event;
- FILE *fp;
+static int _XPrintDefaultError(
+ Display *dpy,
+ XErrorEvent *event,
+ FILE *fp)
{
char buffer[BUFSIZ];
char mesg[BUFSIZ];
@@ -2838,9 +2816,9 @@ static int _XPrintDefaultError (dpy, event, fp)
return 1;
}
-int _XDefaultError(dpy, event)
- Display *dpy;
- XErrorEvent *event;
+int _XDefaultError(
+ Display *dpy,
+ XErrorEvent *event)
{
if (_XPrintDefaultError (dpy, event, stderr) == 0) return 0;
exit(1);
@@ -2859,9 +2837,9 @@ Bool _XDefaultWireError(display, he, we)
/*
* _XError - upcall internal or user protocol error handler
*/
-int _XError (dpy, rep)
- Display *dpy;
- register xError *rep;
+int _XError (
+ Display *dpy,
+ register xError *rep)
{
/*
* X_Error packet encountered! We need to unpack the error before
@@ -2911,8 +2889,8 @@ int _XError (dpy, rep)
* _XIOError - call user connection error handler and exit
*/
int
-_XIOError (dpy)
- Display *dpy;
+_XIOError (
+ Display *dpy)
{
dpy->flags |= XlibDisplayIOError;
#ifdef WIN32
@@ -2935,9 +2913,9 @@ _XIOError (dpy)
* GetReq* and a call to Data* or _XSend*, or in a context when the thread
* is guaranteed to not unlock the display.
*/
-char *_XAllocScratch (dpy, nbytes)
- register Display *dpy;
- unsigned long nbytes;
+char *_XAllocScratch(
+ register Display *dpy,
+ unsigned long nbytes)
{
if (nbytes > dpy->scratch_length) {
if (dpy->scratch_buffer) Xfree (dpy->scratch_buffer);
@@ -2952,9 +2930,9 @@ char *_XAllocScratch (dpy, nbytes)
* Scratch space allocator you can call any time, multiple times, and be
* MT safe, but you must hand the buffer back with _XFreeTemp.
*/
-char *_XAllocTemp (dpy, nbytes)
- register Display *dpy;
- unsigned long nbytes;
+char *_XAllocTemp(
+ register Display *dpy,
+ unsigned long nbytes)
{
char *buf;
@@ -2964,10 +2942,10 @@ char *_XAllocTemp (dpy, nbytes)
return buf;
}
-void _XFreeTemp (dpy, buf, nbytes)
- register Display *dpy;
- char *buf;
- unsigned long nbytes;
+void _XFreeTemp(
+ register Display *dpy,
+ char *buf,
+ unsigned long nbytes)
{
if (dpy->scratch_buffer)
Xfree(dpy->scratch_buffer);
@@ -2978,9 +2956,9 @@ void _XFreeTemp (dpy, buf, nbytes)
/*
* Given a visual id, find the visual structure for this id on this display.
*/
-Visual *_XVIDtoVisual (dpy, id)
- Display *dpy;
- VisualID id;
+Visual *_XVIDtoVisual(
+ Display *dpy,
+ VisualID id)
{
register int i, j, k;
register Screen *sp;
@@ -3001,12 +2979,7 @@ Visual *_XVIDtoVisual (dpy, id)
}
int
-#if NeedFunctionPrototypes
XFree (void *data)
-#else
-XFree (data)
- char *data;
-#endif
{
Xfree (data);
return 1;
@@ -3030,10 +3003,10 @@ void _Xbcopy(b1, b2, length)
#endif
#ifdef DataRoutineIsProcedure
-void Data (dpy, data, len)
- Display *dpy;
- char *data;
- long len;
+void Data(
+ Display *dpy,
+ char *data,
+ long len)
{
if (dpy->bufptr + (len) <= dpy->bufmax) {
memcpy(dpy->bufptr, data, (int)len);
@@ -3047,10 +3020,10 @@ void Data (dpy, data, len)
#ifdef LONG64
int
-_XData32 (dpy, data, len)
- Display *dpy;
- register long *data;
- unsigned len;
+_XData32(
+ Display *dpy,
+ register long *data,
+ unsigned len)
{
register int *buf;
register long i;
@@ -3089,11 +3062,11 @@ _XData32 (dpy, data, len)
* "len" is the length in bytes of the data.
*/
-static doData16(dpy, data, len, packbuffer)
- register Display *dpy;
- short *data;
- unsigned len;
- char *packbuffer;
+static doData16(
+ register Display *dpy,
+ short *data,
+ unsigned len,
+ char *packbuffer)
{
long *lp,*lpack;
long i, nwords,bits;
@@ -3122,10 +3095,10 @@ static doData16(dpy, data, len, packbuffer)
Data(dpy, packbuffer, len);
}
-_XData16 (dpy, data, len)
- Display *dpy;
- short *data;
- unsigned len;
+_XData16 (
+ Display *dpy,
+ short *data,
+ unsigned len)
{
char packbuffer[PACKBUFFERSIZE];
unsigned nunits = PACKBUFFERSIZE >> 1;
@@ -3144,11 +3117,11 @@ _XData16 (dpy, data, len)
* "len" is the length in bytes of the data.
*/
-static doData32 (dpy, data, len, packbuffer)
- register Display *dpy;
- long *data;
- unsigned len;
- char *packbuffer;
+static doData32(
+ register Display *dpy
+ long *data,
+ unsigned len,
+ char *packbuffer)
{
long *lp,*lpack;
long i,bits,nwords;
@@ -3175,10 +3148,10 @@ static doData32 (dpy, data, len, packbuffer)
Data(dpy, packbuffer, len);
}
-_XData32 (dpy, data, len)
- Display *dpy;
- long *data;
- unsigned len;
+void _XData32(
+ Display *dpy,
+ long *data,
+ unsigned len,
{
char packbuffer[PACKBUFFERSIZE];
unsigned nunits = PACKBUFFERSIZE >> 2;
@@ -3208,9 +3181,9 @@ _XData32 (dpy, data, len)
/*
* _XGetHostname - similar to gethostname but allows special processing.
*/
-int _XGetHostname (buf, maxlen)
- char *buf;
- int maxlen;
+int _XGetHostname (
+ char *buf,
+ int maxlen)
{
int len;
diff --git a/src/XomGeneric.h b/src/XomGeneric.h
index 019d011..9b54749 100644
--- a/src/XomGeneric.h
+++ b/src/XomGeneric.h
@@ -31,7 +31,7 @@
* Modifier: Takanori Tateno FUJITSU LIMITED
*
*/
-/* $XFree86: xc/lib/X11/XomGeneric.h,v 1.4 2001/01/17 19:41:50 dawes Exp $ */
+/* $XFree86: xc/lib/X11/XomGeneric.h,v 1.6 2003/11/17 22:20:11 dawes Exp $ */
#ifndef _XOMGENERIC_H_
#define _XOMGENERIC_H_
@@ -150,24 +150,19 @@ typedef struct _XOCGenericRec {
_XFUNCPROTOBEGIN
extern XOM _XomGenericOpenOM(
-#if NeedFunctionPrototypes
XLCd /* lcd */,
Display* /* dpy */,
XrmDatabase /* rdb */,
_Xconst char* /* res_name */,
_Xconst char* /* res_class */
-#endif
);
extern XlcConv _XomInitConverter(
-#if NeedFunctionPrototypes
XOC /* oc */,
XOMTextType /* type */
-#endif
);
extern int _XomConvert(
-#if NeedFunctionPrototypes
XOC /* oc */,
XlcConv /* conv */,
XPointer* /* from */,
@@ -176,9 +171,148 @@ extern int _XomConvert(
int* /* to_left */,
XPointer* /* args */,
int /* num_args */
-#endif
);
+extern int
+_XmbDefaultTextEscapement(XOC oc, _Xconst char *text, int length);
+extern int
+_XwcDefaultTextEscapement(XOC oc, _Xconst wchar_t *text, int length);
+extern int
+_Xutf8DefaultTextEscapement(XOC oc, _Xconst char *text, int length);
+extern int
+_XmbDefaultTextExtents(XOC oc, _Xconst char *text, int length,
+ XRectangle *overall_ink, XRectangle *overall_logical);
+extern int
+_XwcDefaultTextExtents(XOC oc, _Xconst wchar_t *text, int length,
+ XRectangle *overall_ink, XRectangle *overall_logical);
+extern int
+_Xutf8DefaultTextExtents(XOC oc, _Xconst char *text, int length,
+ XRectangle *overall_ink, XRectangle *overall_logical);
+extern Status
+_XmbDefaultTextPerCharExtents(
+ XOC oc, _Xconst char *text, int length,
+ XRectangle *ink_buf, XRectangle *logical_buf,
+ int buf_size, int *num_chars,
+ XRectangle *overall_ink,
+ XRectangle *overall_logical);
+extern Status
+_XwcDefaultTextPerCharExtents(
+ XOC oc, _Xconst wchar_t *text, int length,
+ XRectangle *ink_buf, XRectangle *logical_buf,
+ int buf_size, int *num_chars,
+ XRectangle *overall_ink,
+ XRectangle *overall_logical);
+extern Status
+_Xutf8DefaultTextPerCharExtents(
+ XOC oc, _Xconst char *text, int length,
+ XRectangle *ink_buf, XRectangle *logical_buf,
+ int buf_size, int *num_chars,
+ XRectangle *overall_ink,
+ XRectangle *overall_logical);
+extern int
+_XmbDefaultDrawString(Display *dpy, Drawable d, XOC oc, GC gc, int x, int y,
+ _Xconst char *text, int length);
+extern int
+_XwcDefaultDrawString(Display *dpy, Drawable d, XOC oc, GC gc, int x, int y,
+ _Xconst wchar_t *text, int length);
+extern int
+_Xutf8DefaultDrawString(Display *dpy, Drawable d, XOC oc, GC gc, int x, int y,
+ _Xconst char *text, int length);
+extern void
+_XmbDefaultDrawImageString(Display *dpy, Drawable d, XOC oc, GC gc, int x,
+ int y, _Xconst char *text, int length);
+extern void
+_XwcDefaultDrawImageString(Display *dpy, Drawable d, XOC oc, GC gc, int x,
+ int y, _Xconst wchar_t *text, int length);
+extern void
+_Xutf8DefaultDrawImageString(Display *dpy, Drawable d, XOC oc, GC gc, int x,
+ int y, _Xconst char *text, int length);
+
+extern int
+_XmbGenericTextEscapement(XOC oc, _Xconst char *text, int length);
+extern int
+_XmbGenericTextExtents(XOC oc, _Xconst char *text, int length,
+ XRectangle *overall_ink, XRectangle *overall_logical);
+extern int
+_Xutf8GenericDrawString(Display *dpy, Drawable d, XOC oc, GC gc, int x, int y,
+ _Xconst char *text, int length);
+extern void
+_Xutf8GenericDrawImageString(Display *dpy, Drawable d, XOC oc, GC gc, int x,
+ int y, _Xconst char *text, int length);
+extern Status
+_Xutf8GenericTextPerCharExtents(
+ XOC oc, _Xconst char *text, int length,
+ XRectangle *ink_buf, XRectangle *logical_buf,
+ int buf_size, int *num_chars,
+ XRectangle *overall_ink,
+ XRectangle *overall_logical);
+extern int
+_Xutf8GenericTextExtents(XOC oc, _Xconst char *text, int length,
+ XRectangle *overall_ink, XRectangle *overall_logical);
+extern int
+_Xutf8GenericTextEscapement(XOC oc, _Xconst char *text, int length);
+extern void
+_XwcGenericDrawImageString(Display *dpy, Drawable d, XOC oc, GC gc, int x,
+ int y, _Xconst wchar_t *text, int length);
+extern int
+_XwcGenericDrawString(Display *dpy, Drawable d, XOC oc, GC gc, int x, int y,
+ _Xconst wchar_t *text, int length);
+extern Status
+_XwcGenericTextPerCharExtents(XOC oc, _Xconst wchar_t *text, int length,
+ XRectangle *ink_buf, XRectangle *logical_buf,
+ int buf_size, int *num_chars,
+ XRectangle *overall_ink,
+ XRectangle *overall_logical);
+extern int
+_XwcGenericTextExtents(XOC oc, _Xconst wchar_t *text, int length,
+ XRectangle *overall_ink, XRectangle *overall_logical);
+extern int
+_XwcGenericTextEscapement(XOC oc, _Xconst wchar_t *text, int length);
+extern void
+_XmbGenericDrawImageString(Display *dpy, Drawable d, XOC oc, GC gc, int x,
+ int y, _Xconst char *text, int length);
+extern int
+_XmbGenericDrawString(Display *dpy, Drawable d, XOC oc, GC gc, int x, int y,
+ _Xconst char *text, int length);
+extern Status
+_XmbGenericTextPerCharExtents(XOC oc, _Xconst char *text, int length,
+ XRectangle *ink_buf, XRectangle *logical_buf,
+ int buf_size, int *num_chars,
+ XRectangle *overall_ink,
+ XRectangle *overall_logical);
+
+extern FontData
+read_EncodingInfo(
+ int count,
+ char **value);
+
+extern int
+_XomGenericDrawString(
+ Display *dpy,
+ Drawable d,
+ XOC oc,
+ GC gc,
+ int x, int y,
+ XOMTextType type,
+ XPointer text,
+ int length);
+extern int
+_XomGenericTextExtents(
+ XOC oc,
+ XOMTextType type,
+ XPointer text,
+ int length,
+ XRectangle *overall_ink,
+ XRectangle *overall_logical);
+extern FontData
+_XomGetFontDataFromFontSet(
+ FontSet fs,
+ unsigned char *str,
+ int len,
+ int *len_ret,
+ int is2b,
+ int type);
+
_XFUNCPROTOEND
#endif /* _XOMGENERIC_H_ */
diff --git a/src/Xresinternal.h b/src/Xresinternal.h
new file mode 100644
index 0000000..b0a7897
--- /dev/null
+++ b/src/Xresinternal.h
@@ -0,0 +1,15 @@
+/* $XFree86: xc/lib/X11/Xresinternal.h,v 1.1 2003/04/13 19:22:19 dawes Exp $ */
+
+#ifndef _XRESINTERNAL_H_
+#define _XRESINTERNAL_H_
+
+/* type defines */
+typedef unsigned long Signature;
+
+/* prototypes */
+extern XrmQuark _XrmInternalStringToQuark(
+ register _Xconst char *name, register int len, register Signature sig,
+ Bool permstring);
+
+#endif /* _XRESOURCEINTERNAL_H_ */
+/* DON'T ADD STUFF AFTER THIS #endif */
diff --git a/src/Xrm.c b/src/Xrm.c
index c716624..47c50fe 100644
--- a/src/Xrm.c
+++ b/src/Xrm.c
@@ -49,7 +49,7 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/lib/X11/Xrm.c,v 3.20 2002/05/31 18:45:42 dawes Exp $ */
+/* $XFree86: xc/lib/X11/Xrm.c,v 3.23 2003/11/17 22:20:11 dawes Exp $ */
#include <stdio.h>
#include <ctype.h>
@@ -61,8 +61,8 @@ from The Open Group.
#endif
#include "XrmI.h"
#include <X11/Xos.h>
-
-extern XrmQuark _XrmInternalStringToQuark();
+#include "Xresinternal.h"
+#include "Xresource.h"
/*
@@ -112,19 +112,15 @@ Bob Scheifler
*/
-typedef unsigned long Signature;
-
static XrmQuark XrmQString, XrmQANY;
typedef Bool (*DBEnumProc)(
-#if NeedNestedPrototypes /* this is Nested on purpose, to match Xlib.h */
XrmDatabase* /* db */,
XrmBindingList /* bindings */,
XrmQuarkList /* quarks */,
XrmRepresentation* /* type */,
XrmValue* /* value */,
XPointer /* closure */
-#endif
);
typedef struct _VEntry {
@@ -218,6 +214,24 @@ typedef struct _EClosure {
int mode; /* XrmEnum<kind> */
} EClosureRec, *EClosure;
+/* types for typecasting ETable based functions to NTable based functions */
+typedef Bool (*getNTableSProcp)(
+ NTable table,
+ XrmNameList names,
+ XrmClassList classes,
+ SClosure closure);
+typedef Bool (*getNTableVProcp)(
+ NTable table,
+ XrmNameList names,
+ XrmClassList classes,
+ VClosure closure);
+typedef Bool (*getNTableEProcp)(
+ NTable table,
+ XrmNameList names,
+ XrmClassList classes,
+ register int level,
+ EClosure closure);
+
/* predicate to determine when to resize a hash table */
#define GrowthPred(n,m) ((unsigned)(n) > (((m) + 1) << 2))
@@ -312,14 +326,15 @@ static XrmBits const xrmtypes[256] = {
/* The rest will be automatically initialized to zero. */
};
-void XrmInitialize()
+void XrmInitialize(void)
{
XrmQString = XrmPermStringToQuark("String");
XrmQANY = XrmPermStringToQuark("?");
}
-XrmDatabase XrmGetDatabase(display)
- Display *display;
+#ifndef _XP_PRINT_SERVER_
+XrmDatabase XrmGetDatabase(
+ Display *display)
{
XrmDatabase retval;
LockDisplay(display);
@@ -328,24 +343,20 @@ XrmDatabase XrmGetDatabase(display)
return retval;
}
-void XrmSetDatabase(display, database)
- Display *display;
- XrmDatabase database;
+void XrmSetDatabase(
+ Display *display,
+ XrmDatabase database)
{
LockDisplay(display);
display->db = database;
UnlockDisplay(display);
}
+#endif /* !_XP_PRINT_SERVER_ */
-#if NeedFunctionPrototypes
-void XrmStringToQuarkList(
+void
+XrmStringToQuarkList(
register _Xconst char *name,
register XrmQuarkList quarks) /* RETURN */
-#else
-void XrmStringToQuarkList(name, quarks)
- register char *name;
- register XrmQuarkList quarks; /* RETURN */
-#endif
{
register XrmBits bits;
register Signature sig = 0;
@@ -375,17 +386,11 @@ void XrmStringToQuarkList(name, quarks)
*quarks = NULLQUARK;
}
-#if NeedFunctionPrototypes
-void XrmStringToBindingQuarkList(
+void
+XrmStringToBindingQuarkList(
register _Xconst char *name,
register XrmBindingList bindings, /* RETURN */
register XrmQuarkList quarks) /* RETURN */
-#else
-void XrmStringToBindingQuarkList(name, bindings, quarks)
- register char *name;
- register XrmBindingList bindings; /* RETURN */
- register XrmQuarkList quarks; /* RETURN */
-#endif
{
register XrmBits bits;
register Signature sig = 0;
@@ -426,9 +431,9 @@ void XrmStringToBindingQuarkList(name, bindings, quarks)
#ifdef DEBUG
-static void PrintQuarkList(quarks, stream)
- XrmQuarkList quarks;
- FILE *stream;
+static void PrintQuarkList(
+ XrmQuarkList quarks,
+ FILE *stream)
{
Bool firstNameSeen;
@@ -481,7 +486,7 @@ static const XrmMethodsRec mb_methods = {
};
-static XrmDatabase NewDatabase()
+static XrmDatabase NewDatabase(void)
{
register XrmDatabase db;
@@ -504,9 +509,9 @@ static XrmDatabase NewDatabase()
/* move all values from ftable to ttable, and free ftable's buckets.
* ttable is quaranteed empty to start with.
*/
-static void MoveValues(ftable, ttable)
- LTable ftable;
- register LTable ttable;
+static void MoveValues(
+ LTable ftable,
+ register LTable ttable)
{
register VEntry fentry, nfentry;
register VEntry *prev;
@@ -531,9 +536,9 @@ static void MoveValues(ftable, ttable)
/* move all tables from ftable to ttable, and free ftable.
* ttable is quaranteed empty to start with.
*/
-static void MoveTables(ftable, ttable)
- NTable ftable;
- register NTable ttable;
+static void MoveTables(
+ NTable ftable,
+ register NTable ttable)
{
register NTable fentry, nfentry;
register NTable *prev;
@@ -556,8 +561,8 @@ static void MoveTables(ftable, ttable)
}
/* grow the table, based on current number of entries */
-static void GrowTable(prev)
- NTable *prev;
+static void GrowTable(
+ NTable *prev)
{
register NTable table;
register int i;
@@ -599,10 +604,10 @@ static void GrowTable(prev)
}
/* merge values from ftable into *pprev, destroy ftable in the process */
-static void MergeValues(ftable, pprev, override)
- LTable ftable;
- NTable *pprev;
- Bool override;
+static void MergeValues(
+ LTable ftable,
+ NTable *pprev,
+ Bool override)
{
register VEntry fentry, tentry;
register VEntry *prev;
@@ -679,10 +684,10 @@ static void MergeValues(ftable, pprev, override)
}
/* merge tables from ftable into *pprev, destroy ftable in the process */
-static void MergeTables(ftable, pprev, override)
- NTable ftable;
- NTable *pprev;
- Bool override;
+static void MergeTables(
+ NTable ftable,
+ NTable *pprev,
+ Bool override)
{
register NTable fentry, tentry;
NTable nfentry;
@@ -752,9 +757,9 @@ static void MergeTables(ftable, pprev, override)
GROW(pprev);
}
-void XrmCombineDatabase(from, into, override)
- XrmDatabase from, *into;
- Bool override;
+void XrmCombineDatabase(
+ XrmDatabase from, XrmDatabase *into,
+ Bool override)
{
register NTable *prev;
register NTable ftable, ttable, nftable;
@@ -801,19 +806,19 @@ void XrmCombineDatabase(from, into, override)
}
}
-void XrmMergeDatabases(from, into)
- XrmDatabase from, *into;
+void XrmMergeDatabases(
+ XrmDatabase from, XrmDatabase *into)
{
XrmCombineDatabase(from, into, True);
}
/* store a value in the database, overriding any existing entry */
-static void PutEntry(db, bindings, quarks, type, value)
- XrmDatabase db;
- XrmBindingList bindings;
- XrmQuarkList quarks;
- XrmRepresentation type;
- XrmValuePtr value;
+static void PutEntry(
+ XrmDatabase db,
+ XrmBindingList bindings,
+ XrmQuarkList quarks,
+ XrmRepresentation type,
+ XrmValuePtr value)
{
register NTable *pprev, *prev;
register NTable table;
@@ -1001,12 +1006,12 @@ static void PutEntry(db, bindings, quarks, type, value)
#undef NEWTABLE
}
-void XrmQPutResource(pdb, bindings, quarks, type, value)
- XrmDatabase *pdb;
- XrmBindingList bindings;
- XrmQuarkList quarks;
- XrmRepresentation type;
- XrmValuePtr value;
+void XrmQPutResource(
+ XrmDatabase *pdb,
+ XrmBindingList bindings,
+ XrmQuarkList quarks,
+ XrmRepresentation type,
+ XrmValuePtr value)
{
if (!*pdb) *pdb = NewDatabase();
_XLockMutex(&(*pdb)->linfo);
@@ -1014,19 +1019,12 @@ void XrmQPutResource(pdb, bindings, quarks, type, value)
_XUnlockMutex(&(*pdb)->linfo);
}
-#if NeedFunctionPrototypes
-void XrmPutResource(
+void
+XrmPutResource(
XrmDatabase *pdb,
_Xconst char *specifier,
_Xconst char *type,
XrmValuePtr value)
-#else
-void XrmPutResource(pdb, specifier, type, value)
- XrmDatabase *pdb;
- char *specifier;
- char *type;
- XrmValuePtr value;
-#endif
{
XrmBinding bindings[MAXDBDEPTH+1];
XrmQuark quarks[MAXDBDEPTH+1];
@@ -1038,19 +1036,12 @@ void XrmPutResource(pdb, specifier, type, value)
_XUnlockMutex(&(*pdb)->linfo);
}
-#if NeedFunctionPrototypes
-void XrmQPutStringResource(
+void
+XrmQPutStringResource(
XrmDatabase *pdb,
XrmBindingList bindings,
XrmQuarkList quarks,
_Xconst char *str)
-#else
-void XrmQPutStringResource(pdb, bindings, quarks, str)
- XrmDatabase *pdb;
- XrmBindingList bindings;
- XrmQuarkList quarks;
- char *str;
-#endif
{
XrmValue value;
@@ -1091,13 +1082,17 @@ void XrmQPutStringResource(pdb, bindings, quarks, str)
*/
#define DEF_BUFF_SIZE 8192
-static void GetIncludeFile();
+static void GetIncludeFile(
+ XrmDatabase db,
+ _Xconst char *base,
+ _Xconst char *fname,
+ int fnamelen);
-static void GetDatabase(db, str, filename, doall)
- XrmDatabase db;
- register char *str;
- char *filename;
- Bool doall;
+static void GetDatabase(
+ XrmDatabase db,
+ _Xconst register char *str,
+ _Xconst char *filename,
+ Bool doall)
{
char *rhs;
char *lhs, lhs_s[DEF_BUFF_SIZE];
@@ -1194,7 +1189,7 @@ static void GetDatabase(db, str, filename, doall)
while (is_space(bits = next_char(c, str))) {};
/* must have a starting " */
if (c == '"') {
- char *fname = str+1;
+ _Xconst char *fname = str+1;
len = 0;
do {
if (only_pcs) {
@@ -1521,17 +1516,11 @@ static void GetDatabase(db, str, filename, doall)
(*db->methods->mbfinish)(db->mbstate);
}
-#if NeedFunctionPrototypes
-void XrmPutStringResource(
+void
+XrmPutStringResource(
XrmDatabase *pdb,
_Xconst char*specifier,
_Xconst char*str)
-#else
-void XrmPutStringResource(pdb, specifier, str)
- XrmDatabase *pdb;
- char *specifier;
- char *str;
-#endif
{
XrmValue value;
XrmBinding bindings[MAXDBDEPTH+1];
@@ -1547,15 +1536,10 @@ void XrmPutStringResource(pdb, specifier, str)
}
-#if NeedFunctionPrototypes
-void XrmPutLineResource(
+void
+XrmPutLineResource(
XrmDatabase *pdb,
_Xconst char*line)
-#else
-void XrmPutLineResource(pdb, line)
- XrmDatabase *pdb;
- char *line;
-#endif
{
if (!*pdb) *pdb = NewDatabase();
_XLockMutex(&(*pdb)->linfo);
@@ -1563,13 +1547,9 @@ void XrmPutLineResource(pdb, line)
_XUnlockMutex(&(*pdb)->linfo);
}
-#if NeedFunctionPrototypes
-XrmDatabase XrmGetStringDatabase(
+XrmDatabase
+XrmGetStringDatabase(
_Xconst char *data)
-#else
-XrmDatabase XrmGetStringDatabase(data)
- char *data;
-#endif
{
XrmDatabase db;
@@ -1587,8 +1567,7 @@ XrmDatabase XrmGetStringDatabase(data)
*/
static char *
-ReadInFile(filename)
-char * filename;
+ReadInFile(_Xconst char *filename)
{
register int fd, size;
char * filebuf;
@@ -1643,11 +1622,11 @@ char * filename;
}
static void
-GetIncludeFile(db, base, fname, fnamelen)
- XrmDatabase db;
- char *base;
- char *fname;
- int fnamelen;
+GetIncludeFile(
+ XrmDatabase db,
+ _Xconst char *base,
+ _Xconst char *fname,
+ int fnamelen)
{
int len;
char *str;
@@ -1672,13 +1651,9 @@ GetIncludeFile(db, base, fname, fnamelen)
Xfree(str);
}
-#if NeedFunctionPrototypes
-XrmDatabase XrmGetFileDatabase(
+XrmDatabase
+XrmGetFileDatabase(
_Xconst char *filename)
-#else
-XrmDatabase XrmGetFileDatabase(filename)
- char *filename;
-#endif
{
XrmDatabase db;
char *str;
@@ -1694,17 +1669,11 @@ XrmDatabase XrmGetFileDatabase(filename)
return db;
}
-#if NeedFunctionPrototypes
-Status XrmCombineFileDatabase(
+Status
+XrmCombineFileDatabase(
_Xconst char *filename,
XrmDatabase *target,
Bool override)
-#else
-Status XrmCombineFileDatabase(filename, target, override)
- char *filename;
- XrmDatabase *target;
- Bool override;
-#endif
{
XrmDatabase db;
char *str;
@@ -1730,12 +1699,12 @@ Status XrmCombineFileDatabase(filename, target, override)
* stop if user proc returns True. level is current depth in database.
*/
/*ARGSUSED*/
-static Bool EnumLTable(table, names, classes, level, closure)
- LTable table;
- XrmNameList names;
- XrmClassList classes;
- register int level;
- register EClosure closure;
+static Bool EnumLTable(
+ LTable table,
+ XrmNameList names,
+ XrmClassList classes,
+ register int level,
+ register EClosure closure)
{
register VEntry *bucket;
register int i;
@@ -1776,10 +1745,10 @@ static Bool EnumLTable(table, names, classes, level, closure)
return False;
}
-static Bool EnumAllNTable(table, level, closure)
- NTable table;
- register int level;
- register EClosure closure;
+static Bool EnumAllNTable(
+ NTable table,
+ register int level,
+ register EClosure closure)
{
register NTable *bucket;
register int i;
@@ -1810,17 +1779,22 @@ static Bool EnumAllNTable(table, level, closure)
/* recurse on every table in the table, arbitrary order.
* stop if user proc returns True. level is current depth in database.
*/
-static Bool EnumNTable(table, names, classes, level, closure)
- NTable table;
- XrmNameList names;
- XrmClassList classes;
- register int level;
- register EClosure closure;
+static Bool EnumNTable(
+ NTable table,
+ XrmNameList names,
+ XrmClassList classes,
+ register int level,
+ register EClosure closure)
{
register NTable entry;
register XrmQuark q;
register unsigned int leaf;
- Bool (*get)();
+ Bool (*get)(
+ NTable table,
+ XrmNameList names,
+ XrmClassList classes,
+ register int level,
+ EClosure closure);
Bool bilevel;
/* find entries named ename, leafness leaf, tight or loose, and call get */
@@ -1881,7 +1855,7 @@ static Bool EnumNTable(table, names, classes, level, closure)
leaf = 0;
bilevel = !names[1];
} else {
- get = EnumLTable; /* bottom of recursion */
+ get = (getNTableEProcp)EnumLTable; /* bottom of recursion */
leaf = 1;
bilevel = False;
}
@@ -1924,7 +1898,7 @@ static Bool EnumNTable(table, names, classes, level, closure)
if (!*names)
break;
if (!names[1] && closure->mode != XrmEnumAllLevels) {
- get = EnumLTable; /* bottom of recursion */
+ get = (getNTableEProcp)EnumLTable; /* bottom of recursion */
leaf = 1;
}
ILOOSE(*names); /* loose names */
@@ -1968,13 +1942,13 @@ static Bool EnumNTable(table, names, classes, level, closure)
/* call the proc for every value in the database, arbitrary order.
* stop if the proc returns True.
*/
-Bool XrmEnumerateDatabase(db, names, classes, mode, proc, closure)
- XrmDatabase db;
- XrmNameList names;
- XrmClassList classes;
- int mode;
- DBEnumProc proc;
- XPointer closure;
+Bool XrmEnumerateDatabase(
+ XrmDatabase db,
+ XrmNameList names,
+ XrmClassList classes,
+ int mode,
+ DBEnumProc proc,
+ XPointer closure)
{
XrmBinding bindings[MAXDBDEPTH+2];
XrmQuark quarks[MAXDBDEPTH+2];
@@ -2004,10 +1978,10 @@ Bool XrmEnumerateDatabase(db, names, classes, mode, proc, closure)
return retval;
}
-static void PrintBindingQuarkList(bindings, quarks, stream)
- XrmBindingList bindings;
- XrmQuarkList quarks;
- FILE *stream;
+static void PrintBindingQuarkList(
+ XrmBindingList bindings,
+ XrmQuarkList quarks,
+ FILE *stream)
{
Bool firstNameSeen;
@@ -2024,13 +1998,13 @@ static void PrintBindingQuarkList(bindings, quarks, stream)
/* output out the entry in correct file syntax */
/*ARGSUSED*/
-static Bool DumpEntry(db, bindings, quarks, type, value, data)
- XrmDatabase *db;
- XrmBindingList bindings;
- XrmQuarkList quarks;
- XrmRepresentation *type;
- XrmValuePtr value;
- XPointer data;
+static Bool DumpEntry(
+ XrmDatabase *db,
+ XrmBindingList bindings,
+ XrmQuarkList quarks,
+ XrmRepresentation *type,
+ XrmValuePtr value,
+ XPointer data)
{
FILE *stream = (FILE *)data;
register unsigned int i;
@@ -2072,9 +2046,9 @@ static Bool DumpEntry(db, bindings, quarks, type, value, data)
#ifdef DEBUG
-void PrintTable(table, file)
- NTable table;
- FILE *file;
+void PrintTable(
+ NTable table,
+ FILE *file)
{
XrmBinding bindings[MAXDBDEPTH+1];
XrmQuark quarks[MAXDBDEPTH+1];
@@ -2095,15 +2069,10 @@ void PrintTable(table, file)
#endif /* DEBUG */
-#if NeedFunctionPrototypes
-void XrmPutFileDatabase(
+void
+XrmPutFileDatabase(
XrmDatabase db,
_Xconst char *fileName)
-#else
-void XrmPutFileDatabase(db, fileName)
- XrmDatabase db;
- char *fileName;
-#endif
{
FILE *file;
XrmQuark empty = NULLQUARK;
@@ -2162,11 +2131,11 @@ void XrmPutFileDatabase(db, fileName)
/* add tight/loose entry to the search list, return True if list is full */
/*ARGSUSED*/
-static Bool AppendLEntry(table, names, classes, closure)
- LTable table;
- XrmNameList names;
- XrmClassList classes;
- register SClosure closure;
+static Bool AppendLEntry(
+ LTable table,
+ XrmNameList names,
+ XrmClassList classes,
+ register SClosure closure)
{
/* check for duplicate */
if (closure->idx >= 0 && closure->list[closure->idx] == table)
@@ -2181,11 +2150,11 @@ static Bool AppendLEntry(table, names, classes, closure)
/* add loose entry to the search list, return True if list is full */
/*ARGSUSED*/
-static Bool AppendLooseLEntry(table, names, classes, closure)
- LTable table;
- XrmNameList names;
- XrmClassList classes;
- register SClosure closure;
+static Bool AppendLooseLEntry(
+ LTable table,
+ XrmNameList names,
+ XrmClassList classes,
+ register SClosure closure)
{
/* check for duplicate */
if (closure->idx >= 0 && closure->list[closure->idx] == table)
@@ -2201,22 +2170,26 @@ static Bool AppendLooseLEntry(table, names, classes, closure)
}
/* search for a leaf table */
-static Bool SearchNEntry(table, names, classes, closure)
- NTable table;
- XrmNameList names;
- XrmClassList classes;
- SClosure closure;
+static Bool SearchNEntry(
+ NTable table,
+ XrmNameList names,
+ XrmClassList classes,
+ SClosure closure)
{
register NTable entry;
register XrmQuark q;
register unsigned int leaf;
- Bool (*get)();
+ Bool (*get)(
+ NTable table,
+ XrmNameList names,
+ XrmClassList classes,
+ SClosure closure);
if (names[1]) {
get = SearchNEntry; /* recurse */
leaf = 0;
} else {
- get = AppendLEntry; /* bottom of recursion */
+ get = (getNTableSProcp)AppendLEntry; /* bottom of recursion */
leaf = 1;
}
GTIGHTLOOSE(*names, AppendLooseLEntry); /* do name, tight and loose */
@@ -2231,7 +2204,7 @@ static Bool SearchNEntry(table, names, classes, closure)
if (!*names)
break;
if (!names[1]) {
- get = AppendLEntry; /* bottom of recursion */
+ get = (getNTableSProcp)AppendLEntry; /* bottom of recursion */
leaf = 1;
}
GLOOSE(*names, AppendLooseLEntry); /* loose names */
@@ -2265,12 +2238,12 @@ static Bool SearchNEntry(table, names, classes, closure)
return False;
}
-Bool XrmQGetSearchList(db, names, classes, searchList, listLength)
- XrmDatabase db;
- XrmNameList names;
- XrmClassList classes;
- XrmSearchList searchList; /* RETURN */
- int listLength;
+Bool XrmQGetSearchList(
+ XrmDatabase db,
+ XrmNameList names,
+ XrmClassList classes,
+ XrmSearchList searchList, /* RETURN */
+ int listLength)
{
register NTable table;
SClosureRec closure;
@@ -2310,12 +2283,12 @@ Bool XrmQGetSearchList(db, names, classes, searchList, listLength)
return True;
}
-Bool XrmQGetSearchResource(searchList, name, class, pType, pValue)
- XrmSearchList searchList;
- register XrmName name;
- register XrmClass class;
- XrmRepresentation *pType; /* RETURN */
- XrmValue *pValue; /* RETURN */
+Bool XrmQGetSearchResource(
+ XrmSearchList searchList,
+ register XrmName name,
+ register XrmClass class,
+ XrmRepresentation *pType, /* RETURN */
+ XrmValue *pValue) /* RETURN */
{
register LTable *list;
register LTable table;
@@ -2399,11 +2372,11 @@ Bool XrmQGetSearchResource(searchList, name, class, pType, pValue)
}
/* look for a tight/loose value */
-static Bool GetVEntry(table, names, classes, closure)
- LTable table;
- XrmNameList names;
- XrmClassList classes;
- VClosure closure;
+static Bool GetVEntry(
+ LTable table,
+ XrmNameList names,
+ XrmClassList classes,
+ VClosure closure)
{
register VEntry entry;
register XrmQuark q;
@@ -2434,11 +2407,11 @@ static Bool GetVEntry(table, names, classes, closure)
}
/* look for a loose value */
-static Bool GetLooseVEntry(table, names, classes, closure)
- LTable table;
- XrmNameList names;
- XrmClassList classes;
- VClosure closure;
+static Bool GetLooseVEntry(
+ LTable table,
+ XrmNameList names,
+ XrmClassList classes,
+ VClosure closure)
{
register VEntry entry;
register XrmQuark q;
@@ -2476,23 +2449,27 @@ static Bool GetLooseVEntry(table, names, classes, closure)
}
/* recursive search for a value */
-static Bool GetNEntry(table, names, classes, closure)
- NTable table;
- XrmNameList names;
- XrmClassList classes;
- VClosure closure;
+static Bool GetNEntry(
+ NTable table,
+ XrmNameList names,
+ XrmClassList classes,
+ VClosure closure)
{
register NTable entry;
register XrmQuark q;
register unsigned int leaf;
- Bool (*get)();
+ Bool (*get)(
+ NTable table,
+ XrmNameList names,
+ XrmClassList classes,
+ VClosure closure);
NTable otable;
if (names[2]) {
get = GetNEntry; /* recurse */
leaf = 0;
} else {
- get = GetVEntry; /* bottom of recursion */
+ get = (getNTableVProcp)GetVEntry; /* bottom of recursion */
leaf = 1;
}
GTIGHTLOOSE(*names, GetLooseVEntry); /* do name, tight and loose */
@@ -2507,7 +2484,7 @@ static Bool GetNEntry(table, names, classes, closure)
if (!names[1])
break;
if (!names[2]) {
- get = GetVEntry; /* bottom of recursion */
+ get = (getNTableVProcp)GetVEntry; /* bottom of recursion */
leaf = 1;
}
GLOOSE(*names, GetLooseVEntry); /* do name, loose only */
@@ -2544,12 +2521,12 @@ static Bool GetNEntry(table, names, classes, closure)
return False;
}
-Bool XrmQGetResource(db, names, classes, pType, pValue)
- XrmDatabase db;
- XrmNameList names;
- XrmClassList classes;
- XrmRepresentation *pType; /* RETURN */
- XrmValuePtr pValue; /* RETURN */
+Bool XrmQGetResource(
+ XrmDatabase db,
+ XrmNameList names,
+ XrmClassList classes,
+ XrmRepresentation *pType, /* RETURN */
+ XrmValuePtr pValue) /* RETURN */
{
register NTable table;
VClosureRec closure;
@@ -2586,21 +2563,13 @@ Bool XrmQGetResource(db, names, classes, pType, pValue)
return False;
}
-#if NeedFunctionPrototypes
-Bool XrmGetResource(db, name_str, class_str, pType_str, pValue)
+Bool
+XrmGetResource(db, name_str, class_str, pType_str, pValue)
XrmDatabase db;
_Xconst char *name_str;
_Xconst char *class_str;
XrmString *pType_str; /* RETURN */
XrmValuePtr pValue; /* RETURN */
-#else
-Bool XrmGetResource(db, name_str, class_str, pType_str, pValue)
- XrmDatabase db;
- XrmString name_str;
- XrmString class_str;
- XrmString *pType_str; /* RETURN */
- XrmValuePtr pValue; /* RETURN */
-#endif
{
XrmName names[MAXDBDEPTH+1];
XrmClass classes[MAXDBDEPTH+1];
@@ -2615,8 +2584,8 @@ Bool XrmGetResource(db, name_str, class_str, pType_str, pValue)
}
/* destroy all values, plus table itself */
-static void DestroyLTable(table)
- LTable table;
+static void DestroyLTable(
+ LTable table)
{
register int i;
register VEntry *buckets;
@@ -2634,8 +2603,8 @@ static void DestroyLTable(table)
}
/* destroy all contained tables, plus table itself */
-static void DestroyNTable(table)
- NTable table;
+static void DestroyNTable(
+ NTable table)
{
register int i;
register NTable *buckets;
@@ -2655,8 +2624,8 @@ static void DestroyNTable(table)
}
const char *
-XrmLocaleOfDatabase(db)
- XrmDatabase db;
+XrmLocaleOfDatabase(
+ XrmDatabase db)
{
const char* retval;
_XLockMutex(&db->linfo);
@@ -2665,8 +2634,8 @@ XrmLocaleOfDatabase(db)
return retval;
}
-void XrmDestroyDatabase(db)
- XrmDatabase db;
+void XrmDestroyDatabase(
+ XrmDatabase db)
{
register NTable table, next;
diff --git a/src/imConv.c b/src/imConv.c
index 339ba13..b77eaae 100644
--- a/src/imConv.c
+++ b/src/imConv.c
@@ -33,7 +33,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
******************************************************************/
/* 2000 Modifier: Ivan Pascal The XFree86 Project.
*/
-/* $XFree86: xc/lib/X11/imConv.c,v 1.31 2001/02/09 00:02:53 dawes Exp $ */
+/* $XFree86: xc/lib/X11/imConv.c,v 1.33 2003/11/17 22:20:11 dawes Exp $ */
#define NEED_EVENTS
#include <stdio.h>
@@ -57,16 +57,10 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
typedef unsigned int ucs4_t;
typedef int (*ucstocsConvProc)(
-#if NeedFunctionPrototypes
XPointer,
unsigned char *,
ucs4_t,
int
-#endif
-);
-
-XPointer _Utf8GetConvByName(
- const char * name
);
struct SubstRec {
@@ -87,13 +81,8 @@ static struct SubstRec SubstTable[] = {
* This converter is needed for _XimGetCharCode subroutine.
*/
XPointer
-#if NeedFunctionPrototypes
_XimGetLocaleCode (
_Xconst char* encoding_name)
-#else
-_XimGetLocaleCode (encoding_name)
- _Xconst char* encoding_name;
-#endif
{
XPointer cvt = _Utf8GetConvByName(encoding_name);
if (!cvt && encoding_name) {
@@ -116,19 +105,11 @@ _XimGetLocaleCode (encoding_name)
*/
/*ARGSUSED*/
int
-#if NeedFunctionPrototypes
_XimGetCharCode (
XPointer ucs_conv,
KeySym keysym,
unsigned char* buf,
int nbytes)
-#else
-_XimGetCharCode (ucs_conv, keysym, buf, nbytes)
- XPointer ucs_conv;
- KeySym keysym;
- unsigned char *buf;
- int nbytes;
-#endif
{
int count = 0;
ucstocsConvProc cvt = (ucstocsConvProc) ucs_conv;
@@ -153,12 +134,12 @@ _XimGetCharCode (ucs_conv, keysym, buf, nbytes)
}
#ifdef XKB
-static int lookup_string (event, buffer, nbytes, keysym, status)
- XKeyEvent* event;
- char* buffer;
- int nbytes;
- KeySym* keysym;
- XComposeStatus* status;
+static int lookup_string(
+ XKeyEvent* event,
+ char* buffer,
+ int nbytes,
+ KeySym* keysym,
+ XComposeStatus* status)
{
int ret;
unsigned ctrls = XkbGetXlibControls (event->display);
diff --git a/src/locking.c b/src/locking.c
index 20b6d66..c13cdc1 100644
--- a/src/locking.c
+++ b/src/locking.c
@@ -24,7 +24,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/locking.c,v 1.4 2001/12/14 19:54:10 dawes Exp $ */
+/* $XFree86: xc/lib/X11/locking.c,v 1.6 2003/11/17 22:20:12 dawes Exp $ */
/*
* Author: Stephen Gildea, MIT X Consortium
@@ -74,7 +74,7 @@ _Xthread_waiter()
}
#endif /* WIN32 */
-static xthread_t _Xthread_self()
+static xthread_t _Xthread_self(void)
{
return xthread_self();
}
@@ -88,28 +88,28 @@ static void _XLockMutex(lip,file,line)
char* file;
int line;
#else
-static void _XLockMutex(lip)
- LockInfoPtr lip;
+static void _XLockMutex(
+ LockInfoPtr lip)
#endif
{
xmutex_lock(lip->lock);
}
#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
-static void _XUnlockMutex(lip,file,line)
- LockInfoPtr lip;
- char* file;
- int line;
+static void _XUnlockMutex(
+ LockInfoPtr lip,
+ char* file,
+ int line)
#else
-static void _XUnlockMutex(lip)
- LockInfoPtr lip;
+static void _XUnlockMutex(
+ LockInfoPtr lip)
#endif
{
xmutex_unlock(lip->lock);
}
-static void _XCreateMutex(lip)
- LockInfoPtr lip;
+static void _XCreateMutex(
+ LockInfoPtr lip)
{
lip->lock = xmutex_malloc();
if (lip->lock) {
@@ -118,8 +118,8 @@ static void _XCreateMutex(lip)
}
}
-static void _XFreeMutex(lip)
- LockInfoPtr lip;
+static void _XFreeMutex(
+ LockInfoPtr lip)
{
xmutex_clear(lip->lock);
xmutex_free(lip->lock);
@@ -143,10 +143,10 @@ static struct {
int lock_hist_loc = 0; /* next slot to fill */
-static void _XLockDisplayWarn(dpy,file,line)
- Display *dpy;
- char *file; /* source file, from macro */
- int line;
+static void _XLockDisplayWarn(
+ Display *dpy,
+ char *file, /* source file, from macro */
+ int line)
{
xthread_t self;
xthread_t old_locker;
@@ -201,8 +201,8 @@ static void _XUnlockDisplay(dpy,file,line)
char *file;
int line;
#else
-static void _XUnlockDisplay(dpy)
- Display *dpy;
+static void _XUnlockDisplay(
+ Display *dpy)
#endif
{
#ifdef XTHREADS_WARN
@@ -238,8 +238,8 @@ static void _XUnlockDisplay(dpy)
}
-static struct _XCVList *_XCreateCVL(dpy)
- Display *dpy;
+static struct _XCVList *_XCreateCVL(
+ Display *dpy)
{
struct _XCVList *cvl;
@@ -266,9 +266,9 @@ static struct _XCVList *_XCreateCVL(dpy)
Allocates and returns a queue element. */
static struct _XCVList *
-_XPushReader(dpy, tail)
- Display *dpy;
- struct _XCVList ***tail;
+_XPushReader(
+ Display *dpy,
+ struct _XCVList ***tail)
{
struct _XCVList *cvl;
@@ -284,10 +284,10 @@ _XPushReader(dpy, tail)
/* signal the next thread waiting to read the connection */
-static void _XPopReader(dpy, list, tail)
- Display *dpy;
- struct _XCVList **list;
- struct _XCVList ***tail;
+static void _XPopReader(
+ Display *dpy,
+ struct _XCVList **list,
+ struct _XCVList ***tail)
{
register struct _XCVList *front = *list;
@@ -330,9 +330,9 @@ static void _XConditionWait(cv, mutex,file,line)
char *file;
int line;
#else
-static void _XConditionWait(cv, mutex)
- xcondition_t cv;
- xmutex_t mutex;
+static void _XConditionWait(
+ xcondition_t cv,
+ xmutex_t mutex)
#endif
{
#ifdef XTHREADS_WARN
@@ -380,8 +380,8 @@ static void _XConditionSignal(cv,file,line)
char *file;
int line;
#else
-static void _XConditionSignal(cv)
- xcondition_t cv;
+static void _XConditionSignal(
+ xcondition_t cv)
#endif
{
#ifdef XTHREADS_WARN
@@ -399,8 +399,8 @@ static void _XConditionBroadcast(cv,file,line)
char *file;
int line;
#else
-static void _XConditionBroadcast(cv)
- xcondition_t cv;
+static void _XConditionBroadcast(
+ xcondition_t cv)
#endif
{
#ifdef XTHREADS_WARN
@@ -412,8 +412,8 @@ static void _XConditionBroadcast(cv)
}
-static void _XFreeDisplayLock(dpy)
- Display *dpy;
+static void _XFreeDisplayLock(
+ Display *dpy)
{
struct _XCVList *cvl;
@@ -449,8 +449,8 @@ static void _XFreeDisplayLock(dpy)
* wait for thread with user-level display lock to release it.
*/
-static void _XDisplayLockWait(dpy)
- Display *dpy;
+static void _XDisplayLockWait(
+ Display *dpy)
{
xthread_t self;
@@ -468,8 +468,8 @@ static void _XLockDisplay(dpy, file, line)
char *file; /* source file, from macro */
int line;
#else
-static void _XLockDisplay(dpy)
- Display *dpy;
+static void _XLockDisplay(
+ Display *dpy)
#endif
{
#ifdef XTHREADS_WARN
@@ -492,9 +492,9 @@ static void _XInternalLockDisplay(dpy, wskip, file, line)
char *file; /* source file, from macro */
int line;
#else
-static void _XInternalLockDisplay(dpy, wskip)
- Display *dpy;
- Bool wskip;
+static void _XInternalLockDisplay(
+ Display *dpy,
+ Bool wskip)
#endif
{
#ifdef XTHREADS_WARN
@@ -506,13 +506,8 @@ static void _XInternalLockDisplay(dpy, wskip)
_XDisplayLockWait(dpy);
}
-#if NeedFunctionPrototypes
static void _XUserLockDisplay(
register Display* dpy)
-#else
-static void _XUserLockDisplay(dpy)
- register Display* dpy;
-#endif
{
if (++dpy->lock->locking_level == 1) {
dpy->lock->lock_wait = _XDisplayLockWait;
@@ -520,13 +515,9 @@ static void _XUserLockDisplay(dpy)
}
}
-#if NeedFunctionPrototypes
+static
void _XUserUnlockDisplay(
register Display* dpy)
-#else
-void _XUserUnlockDisplay(dpy)
- register Display* dpy;
-#endif
{
if (dpy->lock->locking_level > 0 && --dpy->lock->locking_level == 0) {
/* signal other threads that might be waiting in XLockDisplay */
@@ -539,8 +530,8 @@ void _XUserUnlockDisplay(dpy)
/* returns 0 if initialized ok, -1 if unable to allocate
a mutex or other memory */
-static int _XInitDisplayLock(dpy)
- Display *dpy;
+static int _XInitDisplayLock(
+ Display *dpy)
{
dpy->lock_fns = (struct _XLockPtrs*)Xmalloc(sizeof(struct _XLockPtrs));
if (dpy->lock_fns == NULL)
diff --git a/src/locking.h b/src/locking.h
index 499e616..7139d5a 100644
--- a/src/locking.h
+++ b/src/locking.h
@@ -24,7 +24,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/lib/X11/locking.h,v 1.4 2001/12/14 19:54:10 dawes Exp $ */
+/* $XFree86: xc/lib/X11/locking.h,v 1.5 2003/11/17 22:20:12 dawes Exp $ */
/*
* Author: Stephen Gildea, MIT X Consortium
@@ -47,9 +47,7 @@ struct _XCVList {
};
extern xthread_t (*_Xthread_self_fn)( /* in XlibInt.c */
-#if NeedFunctionPrototypes
void
-#endif
);
/* Display->lock is a pointer to one of these */
@@ -74,77 +72,57 @@ struct _XLockInfo {
struct _XCVList *free_cvls;
/* used only in XlibInt.c */
void (*pop_reader)(
-#if NeedNestedPrototypes
Display* /* dpy */,
struct _XCVList** /* list */,
struct _XCVList*** /* tail */
-#endif
);
struct _XCVList *(*push_reader)(
-#if NeedNestedPrototypes
Display * /* dpy */,
struct _XCVList*** /* tail */
-#endif
);
void (*condition_wait)(
-#if NeedNestedPrototypes
xcondition_t /* cv */,
xmutex_t /* mutex */
#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
, char* /* file */,
int /* line */
#endif
-#endif
);
void (*internal_lock_display)(
-#if NeedNestedPrototypes
Display* /* dpy */,
Bool /* wskip */
#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
, char* /* file */,
int /* line */
#endif
-#endif
);
/* used in XlibInt.c and locking.c */
void (*condition_signal)(
-#if NeedNestedPrototypes
xcondition_t /* cv */
#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
, char* /* file */,
int /* line */
#endif
-#endif
);
void (*condition_broadcast)(
-#if NeedNestedPrototypes
xcondition_t /* cv */
#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
, char* /* file */,
int /* line */
#endif
-#endif
);
/* used in XlibInt.c and XLockDis.c */
void (*lock_wait)(
-#if NeedNestedPrototypes
Display* /* dpy */
-#endif
);
void (*user_lock_display)(
-#if NeedNestedPrototypes
Display* /* dpy */
-#endif
);
void (*user_unlock_display)(
-#if NeedNestedPrototypes
Display* /* dpy */
-#endif
);
struct _XCVList *(*create_cvl)(
-#if NeedNestedPrototypes
Display * /* dpy */
-#endif
);
};
diff --git a/src/xcms/AddDIC.c b/src/xcms/AddDIC.c
index aefae0f..02b3194 100644
--- a/src/xcms/AddDIC.c
+++ b/src/xcms/AddDIC.c
@@ -32,9 +32,11 @@
*
*
*/
+/* $XFree86: xc/lib/X11/AddDIC.c,v 1.2 2003/04/13 19:22:14 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
+#include "Cv.h"
/*
@@ -44,15 +46,6 @@
(XCMS_UNREG_ID(lastid) ? ++lastid : XCMS_FIRST_UNREG_DI_ID)
#define MAX(x,y) ((x) < (y) ? (y) : (x))
-
-/*
- * EXTERNS
- */
-extern XcmsPerDpyInfo *_XcmsFindDpyInfo();
-extern XPointer *_XcmsPushPointerArray();
-extern XcmsColorFormat _XcmsRegFormatOfPrefix();
-extern XcmsColorSpace **_XcmsDIColorSpaces;
-extern XcmsColorSpace *_XcmsDIColorSpacesInit[];
/*
* NAME
diff --git a/src/xcms/AddSF.c b/src/xcms/AddSF.c
index 5c2ae54..9fab20f 100644
--- a/src/xcms/AddSF.c
+++ b/src/xcms/AddSF.c
@@ -32,9 +32,11 @@
*
*
*/
+/* $XFree86: xc/lib/X11/AddSF.c,v 1.2 2003/04/13 19:22:14 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
+#include "Cv.h"
/*
* DEFINES
@@ -43,18 +45,6 @@
(XCMS_UNREG_ID(lastid) ? ++lastid : XCMS_FIRST_UNREG_DD_ID)
#define MIN(x,y) ((x) > (y) ? (y) : (x))
-
-/*
- * EXTERNS
- */
-extern XPointer *_XcmsPushPointerArray();
-extern XcmsColorFormat _XcmsRegFormatOfPrefix();
-extern XcmsFunctionSet **_XcmsSCCFuncSets;
-extern XcmsFunctionSet **_XcmsSCCFuncSetsInit;
-extern XcmsColorSpace **_XcmsDDColorSpaces;
-extern XcmsColorSpace **_XcmsDDColorSpacesInit;
-
-
/*
* NAME
diff --git a/src/xcms/CCC.c b/src/xcms/CCC.c
index a9b8272..c4e8282 100644
--- a/src/xcms/CCC.c
+++ b/src/xcms/CCC.c
@@ -33,7 +33,7 @@
*
*
*/
-/* $XFree86: xc/lib/X11/CCC.c,v 1.4 2001/12/14 19:53:56 dawes Exp $ */
+/* $XFree86: xc/lib/X11/CCC.c,v 1.5 2003/04/13 19:22:14 dawes Exp $ */
/*
@@ -66,14 +66,7 @@ from The Open Group.
#include <stdio.h>
#include "Xlibint.h"
#include "Xcmsint.h"
-
-extern XcmsIntensityMap *_XcmsGetIntensityMap();
-
-/* cmsInt.c */
-extern int _XcmsInitDefaultCCCs();
-extern int _XcmsInitScrnInfo();
-
-
+#include "Cv.h"
diff --git a/src/xcms/Cv.h b/src/xcms/Cv.h
new file mode 100644
index 0000000..08969e0
--- /dev/null
+++ b/src/xcms/Cv.h
@@ -0,0 +1,190 @@
+/* $XFree86: xc/lib/X11/Cv.h,v 1.2 2003/04/17 02:06:31 dawes Exp $ */
+
+#ifndef _CV_H_
+#define _CV_H_
+
+/* variables */
+extern const char _XcmsCIEXYZ_prefix[];
+extern const char _XcmsCIEuvY_prefix[];
+extern const char _XcmsCIExyY_prefix[];
+extern const char _XcmsCIELab_prefix[];
+extern const char _XcmsCIELuv_prefix[];
+extern const char _XcmsTekHVC_prefix[];
+extern const char _XcmsRGBi_prefix[];
+extern const char _XcmsRGB_prefix[];
+
+extern XcmsColorSpace XcmsUNDEFINEDColorSpace;
+extern XcmsColorSpace XcmsTekHVCColorSpace;
+extern XcmsColorSpace XcmsCIEXYZColorSpace;
+extern XcmsColorSpace XcmsCIEuvYColorSpace;
+extern XcmsColorSpace XcmsCIExyYColorSpace;
+extern XcmsColorSpace XcmsCIELabColorSpace;
+extern XcmsColorSpace XcmsCIELuvColorSpace;
+extern XcmsColorSpace XcmsRGBColorSpace;
+extern XcmsColorSpace XcmsRGBiColorSpace;
+
+extern XcmsColorSpace *_XcmsDIColorSpacesInit[];
+extern XcmsColorSpace **_XcmsDIColorSpaces;
+
+extern XcmsColorSpace *_XcmsDDColorSpacesInit[];
+extern XcmsColorSpace **_XcmsDDColorSpaces;
+
+extern XcmsFunctionSet XcmsLinearRGBFunctionSet;
+
+extern XcmsFunctionSet *_XcmsSCCFuncSetsInit[];
+extern XcmsFunctionSet **_XcmsSCCFuncSets;
+
+extern XcmsRegColorSpaceEntry _XcmsRegColorSpaces[];
+
+/* functions */
+extern XPointer *
+_XcmsCopyPointerArray(
+ XPointer *pap);
+extern void
+_XcmsFreePointerArray(
+ XPointer *pap);
+extern XPointer *
+_XcmsPushPointerArray(
+ XPointer *pap,
+ XPointer p,
+ XPointer *papNoFree);
+extern Status
+_XcmsCIEXYZ_ValidSpec(
+ XcmsColor *pColor);
+extern Status
+_XcmsCIEuvY_ValidSpec(
+ XcmsColor *pColor);
+extern int
+_XcmsTekHVC_CheckModify(
+ XcmsColor *pColor);
+
+extern Status
+_XcmsTekHVCQueryMaxVCRGB(
+ XcmsCCC ccc,
+ XcmsFloat hue,
+ XcmsColor *pColor_return,
+ XcmsRGBi *pRGB_return);
+extern Status
+_XcmsCIELabQueryMaxLCRGB(
+ XcmsCCC ccc,
+ XcmsFloat hue, /* hue in radians */
+ XcmsColor *pColor_return,
+ XcmsRGBi *pRGB_return);
+extern Status
+_XcmsConvertColorsWithWhitePt(
+ XcmsCCC ccc,
+ XcmsColor *pColors_in_out,
+ XcmsColor *pWhitePt,
+ unsigned int nColors,
+ XcmsColorFormat newFormat,
+ Bool *pCompressed);
+
+extern Status
+_XcmsDIConvertColors(
+ XcmsCCC ccc,
+ XcmsColor *pColors_in_out,
+ XcmsColor *pWhitePt,
+ unsigned int nColors,
+ XcmsColorFormat newFormat);
+extern Status
+_XcmsDDConvertColors(
+ XcmsCCC ccc,
+ XcmsColor *pColors_in_out,
+ unsigned int nColors,
+ XcmsColorFormat newFormat,
+ Bool *pCompressed);
+extern XcmsColorFormat
+_XcmsRegFormatOfPrefix(
+ _Xconst char *prefix);
+extern void
+_XColor_to_XcmsRGB(
+ XcmsCCC ccc,
+ XColor *pXColors,
+ XcmsColor *pColors,
+ unsigned int nColors);
+extern Status
+_XcmsSetGetColor(
+ Status (*xColorProc)(
+ Display* /* display */,
+ Colormap /* colormap */,
+ XColor* /* screen_in_out */),
+ Display *dpy,
+ Colormap cmap,
+ XcmsColor *pColors_in_out,
+ XcmsColorFormat result_format,
+ Bool *pCompressed);
+extern Status
+_XcmsSetGetColors(
+ Status (*xColorProc)(
+ Display* /* display */,
+ Colormap /* colormap */,
+ XColor* /* screen_in_out */,
+ int /* nColors */),
+ Display *dpy,
+ Colormap cmap,
+ XcmsColor *pColors_in_out,
+ int nColors,
+ XcmsColorFormat result_format,
+ Bool *pCompressed);
+extern Status
+_XcmsCIELuvQueryMaxLCRGB(
+ XcmsCCC ccc,
+ XcmsFloat hue, /* hue in radians */
+ XcmsColor *pColor_return,
+ XcmsRGBi *pRGB_return);
+
+extern XcmsIntensityMap *
+_XcmsGetIntensityMap(
+ Display *dpy,
+ Visual *visual);
+extern int
+_XcmsInitDefaultCCCs(
+ Display *dpy);
+extern int
+_XcmsInitScrnInfo(
+ register Display *dpy,
+ int screenNumber);
+extern XcmsCmapRec *
+_XcmsCopyCmapRecAndFree(
+ Display *dpy,
+ Colormap src_cmap,
+ Colormap copy_cmap);
+extern void
+_XcmsCopyISOLatin1Lowered(
+ char *dst,
+ const char *src);
+extern int
+_XcmsEqualWhitePts(
+ XcmsCCC ccc, XcmsColor *pWhitePt1, XcmsColor *pWhitePt2);
+extern int
+_XcmsLRGB_InitScrnDefault(
+ Display *dpy,
+ int screenNumber,
+ XcmsPerScrnInfo *pPerScrnInfo);
+extern void
+_XcmsFreeIntensityMaps(
+ Display *dpy);
+extern int
+_XcmsGetProperty(
+ Display *pDpy,
+ Window w,
+ Atom property,
+ int *pFormat,
+ unsigned long *pNItems,
+ unsigned long *pNBytes,
+ char **pValue);
+extern unsigned long
+_XcmsGetElement(
+ int format,
+ char **pValue,
+ unsigned long *pCount);
+extern void
+_XcmsUnresolveColor(
+ XcmsCCC ccc,
+ XcmsColor *pColor);
+extern void
+_XcmsResolveColor(
+ XcmsCCC ccc,
+ XcmsColor *pXcmsColor);
+
+#endif /* _CV_H_ */
diff --git a/src/xcms/CvColW.c b/src/xcms/CvColW.c
index 34be833..2ba67f0 100644
--- a/src/xcms/CvColW.c
+++ b/src/xcms/CvColW.c
@@ -33,16 +33,11 @@
*
*
*/
-/* $XFree86: xc/lib/X11/CvColW.c,v 1.3 2001/01/17 19:41:34 dawes Exp $ */
+/* $XFree86: xc/lib/X11/CvColW.c,v 1.4 2003/04/13 19:22:15 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
-
-/* EXTERNS */
-/* CvCols.c */
-extern Status _XcmsDDConvertColors();
-extern Status _XcmsDIConvertColors();
-
+#include "Cv.h"
/************************************************************************
@@ -59,14 +54,13 @@ extern Status _XcmsDIConvertColors();
* SYNOPSIS
*/
Status
-_XcmsConvertColorsWithWhitePt(ccc, pColors_in_out, pWhitePt, nColors,
- newFormat, pCompressed)
- XcmsCCC ccc;
- XcmsColor *pColors_in_out;
- XcmsColor *pWhitePt;
- unsigned int nColors;
- XcmsColorFormat newFormat;
- Bool *pCompressed;
+_XcmsConvertColorsWithWhitePt(
+ XcmsCCC ccc,
+ XcmsColor *pColors_in_out,
+ XcmsColor *pWhitePt,
+ unsigned int nColors,
+ XcmsColorFormat newFormat,
+ Bool *pCompressed)
/*
* DESCRIPTION
* Convert XcmsColor structures between device-independent
diff --git a/src/xcms/CvCols.c b/src/xcms/CvCols.c
index 1c16de1..0062da0 100644
--- a/src/xcms/CvCols.c
+++ b/src/xcms/CvCols.c
@@ -33,20 +33,11 @@
*
*
*/
-/* $XFree86: xc/lib/X11/CvCols.c,v 1.3 2001/01/17 19:41:34 dawes Exp $ */
+/* $XFree86: xc/lib/X11/CvCols.c,v 1.5 2003/11/03 03:46:26 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
-
-/*
- * EXTERNS
- * External declarations required locally to this package
- * that are not already declared in any of the included header
- * files (external includes or internal includes).
- */
-extern XcmsRegColorSpaceEntry _XcmsRegColorSpaces[];
-extern XcmsColorSpace **_XcmsDIColorSpaces;
-extern XcmsColorSpace **_XcmsDDColorSpaces;
+#include "Cv.h"
/*
* LOCAL DEFINES
@@ -58,13 +49,6 @@ extern XcmsColorSpace **_XcmsDDColorSpaces;
# define MAX(x,y) ((x) > (y) ? (x) : (y))
#endif
-/*
- * FORWARD DECLARATIONS
- */
-Status _XcmsDIConvertColors();
-Status _XcmsDDConvertColors();
-int _XcmsEqualWhitePts();
-
/************************************************************************
* *
@@ -79,8 +63,8 @@ int _XcmsEqualWhitePts();
* SYNOPSIS
*/
static int
-EqualCIEXYZ(p1, p2)
- XcmsColor *p1, *p2;
+EqualCIEXYZ(
+ XcmsColor *p1, XcmsColor *p2)
/*
* DESCRIPTION
* Compares two XcmsColor structures that are in XcmsCIEXYZFormat
@@ -109,9 +93,9 @@ EqualCIEXYZ(p1, p2)
* SYNOPSIS
*/
static XcmsColorSpace *
-ColorSpaceOfID(ccc, id)
- XcmsCCC ccc;
- XcmsColorFormat id;
+ColorSpaceOfID(
+ XcmsCCC ccc,
+ XcmsColorFormat id)
/*
* DESCRIPTION
* Returns a pointer to the color space structure
@@ -166,8 +150,8 @@ ColorSpaceOfID(ccc, id)
* SYNOPSIS
*/
static int
-ValidDIColorSpaceID(id)
- XcmsColorFormat id;
+ValidDIColorSpaceID(
+ XcmsColorFormat id)
/*
* DESCRIPTION
* Determines if the specified color space ID is a valid
@@ -199,9 +183,9 @@ ValidDIColorSpaceID(id)
* SYNOPSIS
*/
static int
-ValidDDColorSpaceID(ccc, id)
- XcmsCCC ccc;
- XcmsColorFormat id;
+ValidDDColorSpaceID(
+ XcmsCCC ccc,
+ XcmsColorFormat id)
/*
* DESCRIPTION
* Determines if the specified color space ID is a valid
@@ -234,14 +218,13 @@ ValidDDColorSpaceID(ccc, id)
* SYNOPSIS
*/
static Status
-ConvertMixedColors(ccc, pColors_in_out, pWhitePt, nColors,
- targetFormat, format_flag)
- XcmsCCC ccc;
- XcmsColor *pColors_in_out;
- XcmsColor *pWhitePt;
- unsigned int nColors;
- XcmsColorFormat targetFormat;
- unsigned char format_flag;
+ConvertMixedColors(
+ XcmsCCC ccc,
+ XcmsColor *pColors_in_out,
+ XcmsColor *pWhitePt,
+ unsigned int nColors,
+ XcmsColorFormat targetFormat,
+ unsigned char format_flag)
/*
* DESCRIPTION
* This routine will only convert the following types of
@@ -376,9 +359,7 @@ ConvertMixedColors(ccc, pColors_in_out, pWhitePt, nColors,
* SYNOPSIS
*/
int
-_XcmsEqualWhitePts(ccc, pWhitePt1, pWhitePt2)
- XcmsCCC ccc;
- XcmsColor *pWhitePt1, *pWhitePt2;
+_XcmsEqualWhitePts(XcmsCCC ccc, XcmsColor *pWhitePt1, XcmsColor *pWhitePt2)
/*
* DESCRIPTION
*
@@ -417,13 +398,12 @@ _XcmsEqualWhitePts(ccc, pWhitePt1, pWhitePt2)
* SYNOPSIS
*/
Status
-_XcmsDIConvertColors(ccc, pColors_in_out, pWhitePt, nColors,
- newFormat)
- XcmsCCC ccc;
- XcmsColor *pColors_in_out;
- XcmsColor *pWhitePt;
- unsigned int nColors;
- XcmsColorFormat newFormat;
+_XcmsDIConvertColors(
+ XcmsCCC ccc,
+ XcmsColor *pColors_in_out,
+ XcmsColor *pWhitePt,
+ unsigned int nColors,
+ XcmsColorFormat newFormat)
/*
* DESCRIPTION
* Convert XcmsColor structures to another Device-Independent
@@ -447,10 +427,10 @@ _XcmsDIConvertColors(ccc, pColors_in_out, pWhitePt, nColors,
*/
{
XcmsColorSpace *pFrom, *pTo;
- XcmsConversionProc *src_to_CIEXYZ, *src_from_CIEXYZ;
- XcmsConversionProc *dest_to_CIEXYZ, *dest_from_CIEXYZ;
- XcmsConversionProc *to_CIEXYZ_stop, *from_CIEXYZ_start;
- XcmsConversionProc *tmp;
+ XcmsDIConversionProc *src_to_CIEXYZ, *src_from_CIEXYZ;
+ XcmsDIConversionProc *dest_to_CIEXYZ, *dest_from_CIEXYZ;
+ XcmsDIConversionProc *to_CIEXYZ_stop, *from_CIEXYZ_start;
+ XcmsDIConversionProc *tmp;
/*
* Allow pWhitePt to equal NULL. This appropriate when converting
@@ -562,13 +542,12 @@ Continue:
* SYNOPSIS
*/
Status
-_XcmsDDConvertColors(ccc, pColors_in_out, nColors, newFormat,
- pCompressed)
- XcmsCCC ccc;
- XcmsColor *pColors_in_out;
- unsigned int nColors;
- XcmsColorFormat newFormat;
- Bool *pCompressed;
+_XcmsDDConvertColors(
+ XcmsCCC ccc,
+ XcmsColor *pColors_in_out,
+ unsigned int nColors,
+ XcmsColorFormat newFormat,
+ Bool *pCompressed)
/*
* DESCRIPTION
* Convert XcmsColor structures:
@@ -599,10 +578,10 @@ _XcmsDDConvertColors(ccc, pColors_in_out, nColors, newFormat,
*/
{
XcmsColorSpace *pFrom, *pTo;
- XcmsConversionProc *src_to_CIEXYZ, *src_from_CIEXYZ;
- XcmsConversionProc *dest_to_CIEXYZ, *dest_from_CIEXYZ;
- XcmsConversionProc *from_CIEXYZ_start, *to_CIEXYZ_stop;
- XcmsConversionProc *tmp;
+ XcmsDDConversionProc *src_to_CIEXYZ, *src_from_CIEXYZ;
+ XcmsDDConversionProc *dest_to_CIEXYZ, *dest_from_CIEXYZ;
+ XcmsDDConversionProc *from_CIEXYZ_start, *to_CIEXYZ_stop;
+ XcmsDDConversionProc *tmp;
int retval;
int hasCompressed = 0;
@@ -642,10 +621,10 @@ _XcmsDDConvertColors(ccc, pColors_in_out, nColors, newFormat,
return(XcmsFailure);
}
- src_to_CIEXYZ = pFrom->to_CIEXYZ;
- src_from_CIEXYZ = pFrom->from_CIEXYZ;
- dest_to_CIEXYZ = pTo->to_CIEXYZ;
- dest_from_CIEXYZ = pTo->from_CIEXYZ;
+ src_to_CIEXYZ = (XcmsDDConversionProc *)pFrom->to_CIEXYZ;
+ src_from_CIEXYZ = (XcmsDDConversionProc *)pFrom->from_CIEXYZ;
+ dest_to_CIEXYZ = (XcmsDDConversionProc *)pTo->to_CIEXYZ;
+ dest_from_CIEXYZ = (XcmsDDConversionProc *)pTo->from_CIEXYZ;
if (pTo->inverse_flag && pFrom->inverse_flag) {
/*
@@ -1026,8 +1005,8 @@ Failure:
* SYNOPSIS
*/
XcmsColorFormat
-_XcmsRegFormatOfPrefix(prefix)
- char *prefix;
+_XcmsRegFormatOfPrefix(
+ _Xconst char *prefix)
/*
* DESCRIPTION
* Returns a color space ID associated with the specified
diff --git a/src/xcms/HVC.c b/src/xcms/HVC.c
index 894e8dd..22f7a64 100644
--- a/src/xcms/HVC.c
+++ b/src/xcms/HVC.c
@@ -47,12 +47,13 @@
* DOCUMENTATION
* "TekColor Color Management System, System Implementor's Manual"
*/
-/* $XFree86: xc/lib/X11/HVC.c,v 1.3 2001/01/17 19:41:37 dawes Exp $ */
+/* $XFree86: xc/lib/X11/HVC.c,v 1.4 2003/04/13 19:22:16 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
#include <X11/Xos.h>
#include <math.h>
+#include "Cv.h"
#include <stdio.h>
@@ -93,24 +94,10 @@
#endif
/*
- * EXTERNS
- */
-
-extern char _XcmsTekHVC_prefix[];
-
-/* CvCols.c */
-extern Status _XcmsDIConvertColors();
-
-/* uvY.c */
-extern Status _XcmsCIEuvY_ValidSpec();
-
-/*
* FORWARD DECLARATIONS
*/
-
-static int TekHVC_ParseString();
-static Status XcmsTekHVC_ValidSpec();
-
+static int TekHVC_ParseString(register char *spec, XcmsColor *pColor);
+static Status XcmsTekHVC_ValidSpec(XcmsColor *pColor);
/*
* LOCAL VARIABLES
@@ -167,9 +154,9 @@ XcmsColorSpace XcmsTekHVCColorSpace =
* SYNOPSIS
*/
static int
-TekHVC_ParseString(spec, pColor)
- register char *spec;
- XcmsColor *pColor;
+TekHVC_ParseString(
+ register char *spec,
+ XcmsColor *pColor)
/*
* DESCRIPTION
* This routines takes a string and attempts to convert
@@ -225,9 +212,9 @@ TekHVC_ParseString(spec, pColor)
* SYNOPSIS
*/
static int
-ThetaOffset(pWhitePt, pThetaOffset)
- XcmsColor *pWhitePt;
- XcmsFloat *pThetaOffset;
+ThetaOffset(
+ XcmsColor *pWhitePt,
+ XcmsFloat *pThetaOffset)
/*
* DESCRIPTION
* This routine computes the theta offset of a given
@@ -274,8 +261,8 @@ ThetaOffset(pWhitePt, pThetaOffset)
* SYNOPSIS
*/
static int
-XcmsTekHVC_ValidSpec(pColor)
- XcmsColor *pColor;
+XcmsTekHVC_ValidSpec(
+ XcmsColor *pColor)
/*
* DESCRIPTION
* Checks if values in the color specification are valid.
@@ -576,8 +563,8 @@ XcmsCIEuvYToTekHVC(ccc, pHVC_WhitePt, pColors_in_out, nColors)
* SYNOPSIS
*/
int
-_XcmsTekHVC_CheckModify(pColor)
- XcmsColor *pColor;
+_XcmsTekHVC_CheckModify(
+ XcmsColor *pColor)
/*
* DESCRIPTION
* Checks if values in the color specification are valid.
diff --git a/src/xcms/HVCGcC.c b/src/xcms/HVCGcC.c
index 9260c39..356bcc1 100644
--- a/src/xcms/HVCGcC.c
+++ b/src/xcms/HVCGcC.c
@@ -43,19 +43,11 @@
* Source for XcmsTekHVCClipC() gamut compression routine.
*
*/
-/* $XFree86: xc/lib/X11/HVCGcC.c,v 1.3 2001/01/17 19:41:37 dawes Exp $ */
+/* $XFree86: xc/lib/X11/HVCGcC.c,v 1.4 2003/04/13 19:22:16 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
-
-/*
- * EXTERNS
- */
-extern XcmsColorSpace XcmsTekHVCColorSpace;
-extern XcmsFunctionSet XcmsLinearRGBFunctionSet;
-
-/* CvCols.c */
-extern Status _XcmsDIConvertColors();
+#include "Cv.h"
/************************************************************************
diff --git a/src/xcms/HVCGcV.c b/src/xcms/HVCGcV.c
index eeb6262..5f3a2e8 100644
--- a/src/xcms/HVCGcV.c
+++ b/src/xcms/HVCGcV.c
@@ -43,26 +43,11 @@
* Source for XcmsTekHVCClipV() gamut compression routine.
*
*/
-/* $XFree86: xc/lib/X11/HVCGcV.c,v 1.3 2001/01/17 19:41:37 dawes Exp $ */
+/* $XFree86: xc/lib/X11/HVCGcV.c,v 1.4 2003/04/13 19:22:16 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
-
-/*
- * EXTERNS
- */
-extern Status _XcmsTekHVC_CheckModify();
-extern XcmsColorSpace XcmsTekHVCColorSpace;
-extern XcmsFunctionSet XcmsLinearRGBFunctionSet;
-
-/* CvCols.c */
-extern Status _XcmsDIConvertColors();
-
-/* HVCMxVC.c */
-extern Status _XcmsTekHVCQueryMaxVCRGB();
-
-
-
+#include "Cv.h"
/************************************************************************
diff --git a/src/xcms/HVCGcVC.c b/src/xcms/HVCGcVC.c
index d1cebc8..905161c 100644
--- a/src/xcms/HVCGcVC.c
+++ b/src/xcms/HVCGcVC.c
@@ -43,11 +43,12 @@
* Source for XcmsTekHVCClipVC() gamut
* compression function.
*/
-/* $XFree86: xc/lib/X11/HVCGcVC.c,v 1.3 2001/01/17 19:41:37 dawes Exp $ */
+/* $XFree86: xc/lib/X11/HVCGcVC.c,v 1.4 2003/04/13 19:22:16 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
#include <math.h>
+#include "Cv.h"
/*
* INTERNALS
@@ -56,20 +57,6 @@
*/
#define MAXBISECTCOUNT 100
-/*
- * EXTERNS
- */
-extern int _XcmsTekHVC_CheckModify();
-extern Status _XcmsTekHVCQueryMaxVCRGB();
-extern XcmsColorSpace XcmsTekHVCColorSpace;
-extern XcmsFunctionSet XcmsLinearRGBFunctionSet;
-
-/* CvCols.c */
-extern Status _XcmsDIConvertColors();
-
-/* CvColW.c */
-extern Status _XcmsConvertColorsWithWhitePt();
-
/************************************************************************
* *
diff --git a/src/xcms/HVCMnV.c b/src/xcms/HVCMnV.c
index f66e0e1..055d47b 100644
--- a/src/xcms/HVCMnV.c
+++ b/src/xcms/HVCMnV.c
@@ -43,22 +43,17 @@
* Source for XcmsTekHVCQueryMinV gamut boundary querying routine.
*
*/
+/* $XFree86: xc/lib/X11/HVCMnV.c,v 1.2 2003/04/13 19:22:16 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
+#include "Cv.h"
/*
* DEFINES
*/
#define EPS 0.001
-/*
- * EXTERNS
- */
-extern Status _XcmsTekHVCQueryMaxVCRGB();
-extern Status _XcmsTekHVC_CheckModify();
-extern XcmsColorSpace XcmsTekHVCColorSpace;
-
/************************************************************************
* *
diff --git a/src/xcms/HVCMxC.c b/src/xcms/HVCMxC.c
index 20aa9ef..daa9bf6 100644
--- a/src/xcms/HVCMxC.c
+++ b/src/xcms/HVCMxC.c
@@ -44,11 +44,12 @@
* querying routine.
*
*/
-/* $XFree86: xc/lib/X11/HVCMxC.c,v 1.3 2001/01/17 19:41:37 dawes Exp $ */
+/* $XFree86: xc/lib/X11/HVCMxC.c,v 1.5 2003/07/16 01:38:26 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
#include <math.h>
+#include "Cv.h"
/*
* DEFINES
@@ -56,17 +57,6 @@
#define MAXBISECTCOUNT 100
#define EPS 0.001
-/*
- * EXTERNS
- */
-extern Status _XcmsTekHVCQueryMaxVCRGB();
-extern int _XcmsTekHVC_CheckModify();
-extern XcmsColorSpace XcmsTekHVCColorSpace;
-
-/* CvColW.c */
-extern Status _XcmsConvertColorsWithWhitePt();
-
-
/************************************************************************
* *
@@ -167,6 +157,7 @@ XcmsTekHVCQueryMaxC(ccc, hue, value, pColor_return)
/* save the structure input so that any elements that */
/* are not touched are recopied later in the routine. */
nValue = savedValue = value;
+ lastChroma = -1.0;
lastValue = -1.0;
nMaxCount = MAXBISECTCOUNT;
maxDist = 100.0 - max_vc.spec.TekHVC.V;
diff --git a/src/xcms/HVCMxV.c b/src/xcms/HVCMxV.c
index fec1c3b..1e0d5d3 100644
--- a/src/xcms/HVCMxV.c
+++ b/src/xcms/HVCMxV.c
@@ -44,11 +44,12 @@
* querying routine.
*
*/
-/* $XFree86: xc/lib/X11/HVCMxV.c,v 1.3 2001/01/17 19:41:37 dawes Exp $ */
+/* $XFree86: xc/lib/X11/HVCMxV.c,v 1.5 2003/07/16 01:38:26 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
#include <math.h>
+#include "Cv.h"
/*
* DEFINES
@@ -56,16 +57,6 @@
#define MAXBISECTCOUNT 100
#define EPS 0.001
-/*
- * EXTERNS
- */
-extern Status _XcmsTekHVCQueryMaxVCRGB();
-extern int _XcmsTekHVC_CheckModify();
-extern XcmsColorSpace XcmsTekHVCColorSpace;
-
-/* CvColW.c */
-extern Status _XcmsConvertColorsWithWhitePt();
-
/************************************************************************
* *
@@ -177,6 +168,7 @@ XcmsTekHVCQueryMaxV(ccc, hue, chroma, pColor_return)
tmp.spec.TekHVC.C = max_vc.spec.TekHVC.C;
tmp.spec.TekHVC.V = max_vc.spec.TekHVC.V;
lastChroma = -1.0;
+ lastValue = -1.0;
nMaxCount = MAXBISECTCOUNT;
rFactor = 1.0;
diff --git a/src/xcms/HVCMxVC.c b/src/xcms/HVCMxVC.c
index 7c8ec7d..d00f6d8 100644
--- a/src/xcms/HVCMxVC.c
+++ b/src/xcms/HVCMxVC.c
@@ -44,9 +44,11 @@
* querying routine.
*
*/
+/* $XFree86: xc/lib/X11/HVCMxVC.c,v 1.2 2003/04/13 19:22:16 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
+#include "Cv.h"
/*
* DEFINES
@@ -58,18 +60,6 @@
#define START_V 40.0
#define START_C 120.0
-/*
- * EXTERNS
- */
-extern Status _XcmsTekHVC_CheckModify();
-extern Status _XcmsConvertColorsWithWhitePt();
-extern XcmsColorSpace XcmsTekHVCColorSpace;
-
-/*
- * FORWARD DECLARATIONS
- */
-Status _XcmsTekHVCQueryMaxVCRGB();
-
/************************************************************************
* *
@@ -84,11 +74,11 @@ Status _XcmsTekHVCQueryMaxVCRGB();
* SYNOPSIS
*/
Status
-_XcmsTekHVCQueryMaxVCRGB(ccc, hue, pColor_return, pRGB_return)
- XcmsCCC ccc;
- XcmsFloat hue;
- XcmsColor *pColor_return;
- XcmsRGBi *pRGB_return;
+_XcmsTekHVCQueryMaxVCRGB(
+ XcmsCCC ccc,
+ XcmsFloat hue,
+ XcmsColor *pColor_return,
+ XcmsRGBi *pRGB_return)
/*
* DESCRIPTION
diff --git a/src/xcms/HVCMxVs.c b/src/xcms/HVCMxVs.c
index 6f98d0d..bc21d94 100644
--- a/src/xcms/HVCMxVs.c
+++ b/src/xcms/HVCMxVs.c
@@ -43,20 +43,11 @@
* Source for the XcmsTekHVCQueryMaxVSamples() gamut boundary
* querying routine.
*/
-/* $XFree86: xc/lib/X11/HVCMxVs.c,v 1.3 2001/01/17 19:41:37 dawes Exp $ */
+/* $XFree86: xc/lib/X11/HVCMxVs.c,v 1.4 2003/04/13 19:22:16 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
-
-/*
- * EXTERNS
- */
-extern Status _XcmsTekHVCQueryMaxVCRGB();
-extern Status _XcmsTekHVC_CheckModify();
-extern XcmsColorSpace XcmsTekHVCColorSpace;
-
-/* CvColW.c */
-extern Status _XcmsConvertColorsWithWhitePt();
+#include "Cv.h"
/************************************************************************
diff --git a/src/xcms/HVCWpAj.c b/src/xcms/HVCWpAj.c
index 76e64c0..b1b6f0f 100644
--- a/src/xcms/HVCWpAj.c
+++ b/src/xcms/HVCWpAj.c
@@ -44,15 +44,11 @@
* adjustment of color specifications in the TekHVC color
* space.
*/
+/* $XFree86: xc/lib/X11/HVCWpAj.c,v 1.2 2003/04/13 19:22:16 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
-
-/*
- * EXTERNS
- */
-extern Status _XcmsConvertColorsWithWhitePt();
-extern XcmsColorSpace XcmsTekHVCColorSpace;
+#include "Cv.h"
/************************************************************************
diff --git a/src/xcms/IdOfPr.c b/src/xcms/IdOfPr.c
index d84986e..b6b4591 100644
--- a/src/xcms/IdOfPr.c
+++ b/src/xcms/IdOfPr.c
@@ -32,16 +32,11 @@
*
*
*/
+/* $XFree86: xc/lib/X11/IdOfPr.c,v 1.2 2003/04/13 19:22:16 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
-
-/*
- * EXTERNS
- */
-extern XcmsColorSpace **_XcmsDIColorSpaces;
-extern XcmsColorSpace **_XcmsDDColorSpaces;
-void _XcmsCopyISOLatin1Lowered();
+#include "Cv.h"
/*
diff --git a/src/xcms/LRGB.c b/src/xcms/LRGB.c
index 4113b8a..7c252b6 100644
--- a/src/xcms/LRGB.c
+++ b/src/xcms/LRGB.c
@@ -35,28 +35,14 @@
* 4. RGB intensity to CIE XYZ
*
*/
-/* $XFree86: xc/lib/X11/LRGB.c,v 3.5 2001/07/25 15:04:44 dawes Exp $ */
+/* $XFree86: xc/lib/X11/LRGB.c,v 3.7 2003/11/03 03:46:26 dawes Exp $ */
#include <stdio.h>
#include <X11/Xos.h>
#include <X11/Xatom.h>
#include "Xlibint.h"
#include "Xcmsint.h"
-
-/*
- * EXTERNS
- * External declarations required locally to this package
- * that are not already declared in any of the included header
- * files (external includes or internal includes).
- */
-extern char _XcmsRGB_prefix[];
-extern char _XcmsRGBi_prefix[];
-extern unsigned long _XcmsGetElement();
-extern void _XcmsFreeIntensityMaps();
-
-/* cmsProp.c */
-extern int _XcmsGetProperty();
-
+#include "Cv.h"
/*
* LOCAL DEFINES
@@ -85,12 +71,23 @@ extern int _XcmsGetProperty();
/*
* FORWARD DECLARATIONS
*/
-static void LINEAR_RGB_FreeSCCData();
-static int LINEAR_RGB_InitSCCData();
-static int XcmsLRGB_RGB_ParseString();
-static int XcmsLRGB_RGBi_ParseString();
-Status _XcmsGetTableType0();
-Status _XcmsGetTableType1();
+static void LINEAR_RGB_FreeSCCData(XPointer pScreenDataTemp);
+static int LINEAR_RGB_InitSCCData(Display *dpy,
+ int screenNumber, XcmsPerScrnInfo *pPerScrnInfo);
+static int XcmsLRGB_RGB_ParseString(register char *spec, XcmsColor *pColor);
+static int XcmsLRGB_RGBi_ParseString(register char *spec, XcmsColor *pColor);
+static Status
+_XcmsGetTableType0(
+ IntensityTbl *pTbl,
+ int format,
+ char **pChar,
+ unsigned long *pCount);
+static Status
+_XcmsGetTableType1(
+ IntensityTbl *pTbl,
+ int format,
+ char **pChar,
+ unsigned long *pCount);
/*
* LOCALS VARIABLES
@@ -126,8 +123,8 @@ static unsigned short const MASK[17] = {
* to XcmsCIEXYZFormat.
*/
static XcmsConversionProc Fl_RGB_to_CIEXYZ[] = {
- XcmsRGBToRGBi,
- XcmsRGBiToCIEXYZ,
+ (XcmsConversionProc)XcmsRGBToRGBi,
+ (XcmsConversionProc)XcmsRGBiToCIEXYZ,
NULL
};
@@ -137,8 +134,8 @@ static XcmsConversionProc Fl_RGB_to_CIEXYZ[] = {
* to XcmsRGBFormat.
*/
static XcmsConversionProc Fl_CIEXYZ_to_RGB[] = {
- XcmsCIEXYZToRGBi,
- XcmsRGBiToRGB,
+ (XcmsConversionProc)XcmsCIEXYZToRGBi,
+ (XcmsConversionProc)XcmsRGBiToRGB,
NULL
};
@@ -148,7 +145,7 @@ static XcmsConversionProc Fl_CIEXYZ_to_RGB[] = {
* to XcmsCIEXYZFormat.
*/
static XcmsConversionProc Fl_RGBi_to_CIEXYZ[] = {
- XcmsRGBiToCIEXYZ,
+ (XcmsConversionProc)XcmsRGBiToCIEXYZ,
NULL
};
@@ -158,7 +155,7 @@ static XcmsConversionProc Fl_RGBi_to_CIEXYZ[] = {
* to XcmsRGBiFormat.
*/
static XcmsConversionProc Fl_CIEXYZ_to_RGBi[] = {
- XcmsCIEXYZToRGBi,
+ (XcmsConversionProc)XcmsCIEXYZToRGBi,
NULL
};
@@ -453,10 +450,10 @@ static LINEAR_RGB_SCCData Default_RGB_SCCData = {
* SYNOPSIS
*/
static Status
-LINEAR_RGB_InitSCCData(dpy, screenNumber, pPerScrnInfo)
- Display *dpy;
- int screenNumber;
- XcmsPerScrnInfo *pPerScrnInfo;
+LINEAR_RGB_InitSCCData(
+ Display *dpy,
+ int screenNumber,
+ XcmsPerScrnInfo *pPerScrnInfo)
/*
* DESCRIPTION
*
@@ -835,8 +832,8 @@ FreeSCCData:
* SYNOPSIS
*/
static void
-LINEAR_RGB_FreeSCCData(pScreenDataTemp)
- XPointer pScreenDataTemp;
+LINEAR_RGB_FreeSCCData(
+ XPointer pScreenDataTemp)
/*
* DESCRIPTION
*
@@ -895,12 +892,12 @@ LINEAR_RGB_FreeSCCData(pScreenDataTemp)
*
* SYNOPSIS
*/
-Status
-_XcmsGetTableType0(pTbl, format, pChar, pCount)
- IntensityTbl *pTbl;
- int format;
- char **pChar;
- unsigned long *pCount;
+static Status
+_XcmsGetTableType0(
+ IntensityTbl *pTbl,
+ int format,
+ char **pChar,
+ unsigned long *pCount)
/*
* DESCRIPTION
*
@@ -956,12 +953,12 @@ _XcmsGetTableType0(pTbl, format, pChar, pCount)
*
* SYNOPSIS
*/
-Status
-_XcmsGetTableType1(pTbl, format, pChar, pCount)
- IntensityTbl *pTbl;
- int format;
- char **pChar;
- unsigned long *pCount;
+static Status
+_XcmsGetTableType1(
+ IntensityTbl *pTbl,
+ int format,
+ char **pChar,
+ unsigned long *pCount)
/*
* DESCRIPTION
*
@@ -1018,9 +1015,9 @@ _XcmsGetTableType1(pTbl, format, pChar, pCount)
*
* SYNOPSIS
*/
-int
-_XcmsValueCmp (p1, p2)
- IntensityRec *p1, *p2;
+static int
+_XcmsValueCmp(
+ IntensityRec *p1, IntensityRec *p2)
/*
* DESCRIPTION
* Compares the value component of two IntensityRec
@@ -1043,9 +1040,9 @@ _XcmsValueCmp (p1, p2)
*
* SYNOPSIS
*/
-int
-_XcmsIntensityCmp (p1, p2)
- IntensityRec *p1, *p2;
+static int
+_XcmsIntensityCmp(
+ IntensityRec *p1, IntensityRec *p2)
/*
* DESCRIPTION
* Compares the intensity component of two IntensityRec
@@ -1074,10 +1071,10 @@ _XcmsIntensityCmp (p1, p2)
* SYNOPSIS
*/
/* ARGSUSED */
-int
-_XcmsValueInterpolation (key, lo, hi, answer, bitsPerRGB)
- IntensityRec *key, *lo, *hi, *answer;
- int bitsPerRGB;
+static int
+_XcmsValueInterpolation(
+ IntensityRec *key, IntensityRec *lo, IntensityRec *hi, IntensityRec *answer,
+ int bitsPerRGB)
/*
* DESCRIPTION
* Based on a given value, performs a linear interpolation
@@ -1104,10 +1101,10 @@ _XcmsValueInterpolation (key, lo, hi, answer, bitsPerRGB)
*
* SYNOPSIS
*/
-int
-_XcmsIntensityInterpolation (key, lo, hi, answer, bitsPerRGB)
- IntensityRec *key, *lo, *hi, *answer;
- int bitsPerRGB;
+static int
+_XcmsIntensityInterpolation(
+ IntensityRec *key, IntensityRec *lo, IntensityRec *hi, IntensityRec *answer,
+ int bitsPerRGB)
/*
* DESCRIPTION
* Based on a given intensity, performs a linear interpolation
@@ -1146,22 +1143,40 @@ _XcmsIntensityInterpolation (key, lo, hi, answer, bitsPerRGB)
}
+
+typedef int (*comparProcp)(
+ char *p1,
+ char *p2);
+typedef int (*interpolProcp)(
+ char *key,
+ char *lo,
+ char *hi,
+ char *answer,
+ int bitsPerRGB);
+
/*
* NAME
* _XcmsTableSearch
*
* SYNOPSIS
*/
-int
-_XcmsTableSearch (key, bitsPerRGB, base, nel, nKeyPtrSize, compar, interpol, answer)
- char *key;
- int bitsPerRGB;
- char *base;
- unsigned nel;
- unsigned nKeyPtrSize;
- int (*compar)();
- int (*interpol)();
- char *answer;
+static int
+_XcmsTableSearch(
+ char *key,
+ int bitsPerRGB,
+ char *base,
+ unsigned nel,
+ unsigned nKeyPtrSize,
+ int (*compar)(
+ char *p1,
+ char *p2),
+ int (*interpol)(
+ char *key,
+ char *lo,
+ char *hi,
+ char *answer,
+ int bitsPerRGB),
+ char *answer)
/*
* DESCRIPTION
@@ -1219,8 +1234,8 @@ _XcmsTableSearch (key, bitsPerRGB, base, nel, nKeyPtrSize, compar, interpol, ans
*
* SYNOPSIS
*/
-void _XcmsMatVec(pMat, pIn, pOut)
- XcmsFloat *pMat, *pIn, *pOut;
+static void _XcmsMatVec(
+ XcmsFloat *pMat, XcmsFloat *pIn, XcmsFloat *pOut)
/*
* DESCRIPTION
* Multiply the passed vector by the passed matrix to return a
@@ -1254,9 +1269,9 @@ void _XcmsMatVec(pMat, pIn, pOut)
* SYNOPSIS
*/
static int
-XcmsLRGB_RGB_ParseString(spec, pColor)
- register char *spec;
- XcmsColor *pColor;
+XcmsLRGB_RGB_ParseString(
+ register char *spec,
+ XcmsColor *pColor)
/*
* DESCRIPTION
* This routines takes a string and attempts to convert
@@ -1372,9 +1387,9 @@ XcmsLRGB_RGB_ParseString(spec, pColor)
* SYNOPSIS
*/
static int
-XcmsLRGB_RGBi_ParseString(spec, pColor)
- register char *spec;
- XcmsColor *pColor;
+XcmsLRGB_RGBi_ParseString(
+ register char *spec,
+ XcmsColor *pColor)
/*
* DESCRIPTION
* This routines takes a string and attempts to convert
@@ -1652,7 +1667,7 @@ XcmsRGBiToRGB(ccc, pXcmsColors_in_out, nColors, pCompressed)
(char *)pScreenData->pRedTbl->pBase,
(unsigned)pScreenData->pRedTbl->nEntries,
(unsigned)sizeof(IntensityRec),
- _XcmsIntensityCmp, _XcmsIntensityInterpolation, (char *)&answerIRec)) {
+ (comparProcp)_XcmsIntensityCmp, (interpolProcp)_XcmsIntensityInterpolation, (char *)&answerIRec)) {
return(XcmsFailure);
}
tmpRGB.red = answerIRec.value;
@@ -1662,7 +1677,7 @@ XcmsRGBiToRGB(ccc, pXcmsColors_in_out, nColors, pCompressed)
(char *)pScreenData->pGreenTbl->pBase,
(unsigned)pScreenData->pGreenTbl->nEntries,
(unsigned)sizeof(IntensityRec),
- _XcmsIntensityCmp, _XcmsIntensityInterpolation, (char *)&answerIRec)) {
+ (comparProcp)_XcmsIntensityCmp, (interpolProcp)_XcmsIntensityInterpolation, (char *)&answerIRec)) {
return(XcmsFailure);
}
tmpRGB.green = answerIRec.value;
@@ -1672,7 +1687,7 @@ XcmsRGBiToRGB(ccc, pXcmsColors_in_out, nColors, pCompressed)
(char *)pScreenData->pBlueTbl->pBase,
(unsigned)pScreenData->pBlueTbl->nEntries,
(unsigned)sizeof(IntensityRec),
- _XcmsIntensityCmp, _XcmsIntensityInterpolation, (char *)&answerIRec)) {
+ (comparProcp)_XcmsIntensityCmp, (interpolProcp)_XcmsIntensityInterpolation, (char *)&answerIRec)) {
return(XcmsFailure);
}
tmpRGB.blue = answerIRec.value;
@@ -1692,11 +1707,11 @@ XcmsRGBiToRGB(ccc, pXcmsColors_in_out, nColors, pCompressed)
*/
/* ARGSUSED */
Status
-XcmsRGBToRGBi(ccc, pXcmsColors_in_out, nColors, pCompressed)
- XcmsCCC ccc;
- XcmsColor *pXcmsColors_in_out;/* pointer to XcmsColors to convert */
- unsigned int nColors; /* Number of colors */
- Bool *pCompressed; /* pointer to a bit array */
+XcmsRGBToRGBi(
+ XcmsCCC ccc,
+ XcmsColor *pXcmsColors_in_out,/* pointer to XcmsColors to convert */
+ unsigned int nColors, /* Number of colors */
+ Bool *pCompressed) /* pointer to a bit array */
/*
* DESCRIPTION
* Converts color specifications in an array of XcmsColor
@@ -1733,7 +1748,7 @@ XcmsRGBToRGBi(ccc, pXcmsColors_in_out, nColors, pCompressed)
(char *)pScreenData->pRedTbl->pBase,
(unsigned)pScreenData->pRedTbl->nEntries,
(unsigned)sizeof(IntensityRec),
- _XcmsValueCmp, _XcmsValueInterpolation, (char *)&answerIRec)) {
+ (comparProcp)_XcmsValueCmp, (interpolProcp)_XcmsValueInterpolation, (char *)&answerIRec)) {
return(XcmsFailure);
}
tmpRGBi.red = answerIRec.intensity;
@@ -1743,7 +1758,7 @@ XcmsRGBToRGBi(ccc, pXcmsColors_in_out, nColors, pCompressed)
(char *)pScreenData->pGreenTbl->pBase,
(unsigned)pScreenData->pGreenTbl->nEntries,
(unsigned)sizeof(IntensityRec),
- _XcmsValueCmp, _XcmsValueInterpolation, (char *)&answerIRec)) {
+ (comparProcp)_XcmsValueCmp, (interpolProcp)_XcmsValueInterpolation, (char *)&answerIRec)) {
return(XcmsFailure);
}
tmpRGBi.green = answerIRec.intensity;
@@ -1753,7 +1768,7 @@ XcmsRGBToRGBi(ccc, pXcmsColors_in_out, nColors, pCompressed)
(char *)pScreenData->pBlueTbl->pBase,
(unsigned)pScreenData->pBlueTbl->nEntries,
(unsigned)sizeof(IntensityRec),
- _XcmsValueCmp, _XcmsValueInterpolation, (char *)&answerIRec)) {
+ (comparProcp)_XcmsValueCmp, (interpolProcp)_XcmsValueInterpolation, (char *)&answerIRec)) {
return(XcmsFailure);
}
tmpRGBi.blue = answerIRec.intensity;
@@ -1772,10 +1787,10 @@ XcmsRGBToRGBi(ccc, pXcmsColors_in_out, nColors, pCompressed)
*/
/* ARGSUSED */
int
-_XcmsLRGB_InitScrnDefault(dpy, screenNumber, pPerScrnInfo)
- Display *dpy;
- int screenNumber;
- XcmsPerScrnInfo *pPerScrnInfo;
+_XcmsLRGB_InitScrnDefault(
+ Display *dpy,
+ int screenNumber,
+ XcmsPerScrnInfo *pPerScrnInfo)
/*
* DESCRIPTION
* Given a display and screen number, this routine attempts
diff --git a/src/xcms/Lab.c b/src/xcms/Lab.c
index b33ba71..6395a92 100644
--- a/src/xcms/Lab.c
+++ b/src/xcms/Lab.c
@@ -36,13 +36,14 @@
*
* Note that the range for L* is 0 to 1.
*/
-/* $XFree86: xc/lib/X11/Lab.c,v 1.3 2001/01/17 19:41:38 dawes Exp $ */
+/* $XFree86: xc/lib/X11/Lab.c,v 1.4 2003/04/13 19:22:16 dawes Exp $ */
#include <X11/Xos.h>
#include <stdio.h> /* sscanf */
#include "Xlibint.h"
#include "Xcmsint.h"
+#include "Cv.h"
/*
* DEFINES
@@ -57,22 +58,11 @@
#define DIV16BY116 0.137931
/*
- * EXTERNS
- */
-extern char _XcmsCIELab_prefix[];
-
-/* CvCols.c */
-extern Status _XcmsDIConvertColors();
-
-/* XYZ.c */
-extern Status _XcmsCIEXYZ_ValidSpec();
-
-/*
* FORWARD DECLARATIONS
*/
-static int CIELab_ParseString();
-static Status XcmsCIELab_ValidSpec();
+static int CIELab_ParseString(register char *spec, XcmsColor *pColor);
+static Status XcmsCIELab_ValidSpec(XcmsColor *pColor);
/*
@@ -127,9 +117,9 @@ XcmsColorSpace XcmsCIELabColorSpace =
* SYNOPSIS
*/
static int
-CIELab_ParseString(spec, pColor)
- register char *spec;
- XcmsColor *pColor;
+CIELab_ParseString(
+ register char *spec,
+ XcmsColor *pColor)
/*
* DESCRIPTION
* This routines takes a string and attempts to convert
@@ -192,8 +182,8 @@ CIELab_ParseString(spec, pColor)
* SYNOPSIS
*/
static Status
-XcmsCIELab_ValidSpec(pColor)
- XcmsColor *pColor;
+XcmsCIELab_ValidSpec(
+ XcmsColor *pColor)
/*
* DESCRIPTION
* Checks if color specification valid for CIE L*a*b*.
diff --git a/src/xcms/LabGcC.c b/src/xcms/LabGcC.c
index a234967..c13397a 100644
--- a/src/xcms/LabGcC.c
+++ b/src/xcms/LabGcC.c
@@ -30,12 +30,11 @@
* Source for XcmsCIELabClipuv() gamut compression routine.
*
*/
-/* $XFree86: xc/lib/X11/LabGcC.c,v 1.3 2001/01/17 19:41:38 dawes Exp $ */
+/* $XFree86: xc/lib/X11/LabGcC.c,v 1.4 2003/04/13 19:22:16 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
-
-extern Status _XcmsDIConvertColors();
+#include "Cv.h"
/************************************************************************
diff --git a/src/xcms/LabGcL.c b/src/xcms/LabGcL.c
index 4dc64a9..aac8d23 100644
--- a/src/xcms/LabGcL.c
+++ b/src/xcms/LabGcL.c
@@ -30,18 +30,11 @@
* Source for XcmsCIELabClipL() gamut compression routine.
*
*/
-/* $XFree86: xc/lib/X11/LabGcL.c,v 1.3 2001/01/17 19:41:38 dawes Exp $ */
+/* $XFree86: xc/lib/X11/LabGcL.c,v 1.4 2003/04/13 19:22:16 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
-
-/*
- * EXTERNS
- */
-extern Status _XcmsCIELabQueryMaxLCRGB();
-
-/* CvCols.c */
-extern Status _XcmsDIConvertColors();
+#include "Cv.h"
/************************************************************************
diff --git a/src/xcms/LabGcLC.c b/src/xcms/LabGcLC.c
index d48972d..cf2cfca 100644
--- a/src/xcms/LabGcLC.c
+++ b/src/xcms/LabGcLC.c
@@ -30,11 +30,12 @@
* Source for XcmsCIELabClipLab() gamut
* compression function.
*/
-/* $XFree86: xc/lib/X11/LabGcLC.c,v 1.3 2001/01/17 19:41:39 dawes Exp $ */
+/* $XFree86: xc/lib/X11/LabGcLC.c,v 1.4 2003/04/13 19:22:16 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
#include <math.h>
+#include "Cv.h"
/*
* INTERNALS
@@ -43,17 +44,6 @@
*/
#define MAXBISECTCOUNT 100
-/*
- * EXTERNS
- */
-extern Status _XcmsCIELabQueryMaxLCRGB();
-
-/* CvCols.c */
-extern Status _XcmsDIConvertColors();
-
-/* CvColW.c */
-extern Status _XcmsConvertColorsWithWhitePt();
-
/************************************************************************
* *
diff --git a/src/xcms/LabMnL.c b/src/xcms/LabMnL.c
index b616384..6c76ac9 100644
--- a/src/xcms/LabMnL.c
+++ b/src/xcms/LabMnL.c
@@ -31,11 +31,12 @@
* querying routine.
*
*/
-/* $XFree86: xc/lib/X11/LabMnL.c,v 1.3 2001/01/17 19:41:39 dawes Exp $ */
+/* $XFree86: xc/lib/X11/LabMnL.c,v 1.4 2003/04/13 19:22:16 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
#include <math.h>
+#include "Cv.h"
/*
* DEFINES
@@ -44,14 +45,6 @@
#define EPS (XcmsFloat)0.001
#define START_L_STAR (XcmsFloat)40.0
-/*
- * EXTERNS
- */
-extern Status _XcmsCIELabQueryMaxLCRGB();
-
-/* CvColW.c */
-extern Status _XcmsConvertColorsWithWhitePt();
-
/************************************************************************
* *
diff --git a/src/xcms/LabMxC.c b/src/xcms/LabMxC.c
index 53e5c2e..337d5a8 100644
--- a/src/xcms/LabMxC.c
+++ b/src/xcms/LabMxC.c
@@ -33,11 +33,12 @@
* querying routine.
*
*/
-/* $XFree86: xc/lib/X11/LabMxC.c,v 1.3 2001/01/17 19:41:39 dawes Exp $ */
+/* $XFree86: xc/lib/X11/LabMxC.c,v 1.4 2003/04/13 19:22:16 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
#include <math.h>
+#include "Cv.h"
/*
* DEFINES
@@ -47,14 +48,6 @@
#define START_CHROMA (XcmsFloat)3.6
#define TOPL (XcmsFloat)100.0
-/*
- * EXTERNS
- */
-extern Status _XcmsCIELabQueryMaxLCRGB();
-
-/* CvColW.c */
-extern Status _XcmsConvertColorsWithWhitePt();
-
/************************************************************************
* *
diff --git a/src/xcms/LabMxL.c b/src/xcms/LabMxL.c
index 8022a7d..7002a82 100644
--- a/src/xcms/LabMxL.c
+++ b/src/xcms/LabMxL.c
@@ -31,11 +31,12 @@
* querying routine.
*
*/
-/* $XFree86: xc/lib/X11/LabMxL.c,v 1.3 2001/01/17 19:41:39 dawes Exp $ */
+/* $XFree86: xc/lib/X11/LabMxL.c,v 1.4 2003/04/13 19:22:16 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
#include <math.h>
+#include "Cv.h"
/*
* DEFINES
@@ -44,14 +45,6 @@
#define EPS (XcmsFloat)0.001
#define START_L_STAR (XcmsFloat)40
-/*
- * EXTERNS
- */
-extern Status _XcmsCIELabQueryMaxLCRGB();
-
-/* CvColW.c */
-extern Status _XcmsConvertColorsWithWhitePt();
-
/************************************************************************
* *
diff --git a/src/xcms/LabMxLC.c b/src/xcms/LabMxLC.c
index 6fdeeb1..81f2fa2 100644
--- a/src/xcms/LabMxLC.c
+++ b/src/xcms/LabMxLC.c
@@ -38,9 +38,11 @@
* Fred W. Billmeyer & Max Saltzman, "Principles of Color
* Technology", John Wily & Sons, Inc, 1981.
*/
+/* $XFree86: xc/lib/X11/LabMxLC.c,v 1.2 2003/04/13 19:22:16 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
+#include "Cv.h"
/*
* DEFINES
@@ -52,16 +54,6 @@
#define START_LSTAR (XcmsFloat)40.0
#define START_CHROMA (XcmsFloat)3.6
-/*
- * EXTERNS
- */
-extern Status _XcmsConvertColorsWithWhitePt();
-
-/*
- * FORWARD DECLARATIONS
- */
-Status _XcmsCIELabQueryMaxLCRGB();
-
/************************************************************************
* *
@@ -76,12 +68,11 @@ Status _XcmsCIELabQueryMaxLCRGB();
* SYNOPSIS
*/
Status
-_XcmsCIELabQueryMaxLCRGB(ccc, hue, pColor_return, pRGB_return)
- XcmsCCC ccc;
- XcmsFloat hue; /* hue in radians */
- XcmsColor *pColor_return;
- XcmsRGBi *pRGB_return;
-
+_XcmsCIELabQueryMaxLCRGB(
+ XcmsCCC ccc,
+ XcmsFloat hue, /* hue in radians */
+ XcmsColor *pColor_return,
+ XcmsRGBi *pRGB_return)
/*
* DESCRIPTION
* Return the maximum psychometric chroma for a specified
diff --git a/src/xcms/LabWpAj.c b/src/xcms/LabWpAj.c
index b4fc4a3..89f576a 100644
--- a/src/xcms/LabWpAj.c
+++ b/src/xcms/LabWpAj.c
@@ -32,16 +32,16 @@
* adjustment of color specifications in the CIE L*a*b* color
* space.
*/
+/* $XFree86: xc/lib/X11/LabWpAj.c,v 1.2 2003/04/13 19:22:16 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
+#include "Cv.h"
/*
* EXTERNS
*/
-extern Status _XcmsConvertColorsWithWhitePt();
-
/************************************************************************
* *
diff --git a/src/xcms/Luv.c b/src/xcms/Luv.c
index 9569db0..8d14947 100644
--- a/src/xcms/Luv.c
+++ b/src/xcms/Luv.c
@@ -38,33 +38,22 @@
* Fred W. Billmeyer & Max Saltzman, "Principles of Color
* Technology", John Wily & Sons, Inc, 1981.
*/
-/* $XFree86: xc/lib/X11/Luv.c,v 1.3 2001/01/17 19:41:39 dawes Exp $ */
+/* $XFree86: xc/lib/X11/Luv.c,v 1.4 2003/04/13 19:22:16 dawes Exp $ */
#include <X11/Xos.h>
#include "Xlibint.h"
#include "Xcmsint.h"
+#include "Cv.h"
#include <stdio.h> /* sscanf */
-/*
- * EXTERNS
- */
-
-extern char _XcmsCIELuv_prefix[];
-
-/* CvCols.c */
-extern Status _XcmsDIConvertColors();
-
-/* uvY.c */
-Status _XcmsCIEuvY_ValidSpec();
-
/*
* FORWARD DECLARATIONS
*/
-static int CIELuv_ParseString();
-static Status XcmsCIELuv_ValidSpec();
+static int CIELuv_ParseString(register char *spec, XcmsColor *pColor);
+static Status XcmsCIELuv_ValidSpec(XcmsColor *pColor);
/*
* DEFINES
@@ -131,9 +120,9 @@ XcmsColorSpace XcmsCIELuvColorSpace =
* SYNOPSIS
*/
static int
-CIELuv_ParseString(spec, pColor)
- register char *spec;
- XcmsColor *pColor;
+CIELuv_ParseString(
+ register char *spec,
+ XcmsColor *pColor)
/*
* DESCRIPTION
* This routines takes a string and attempts to convert
@@ -194,8 +183,8 @@ CIELuv_ParseString(spec, pColor)
* SYNOPSIS
*/
static Status
-XcmsCIELuv_ValidSpec(pColor)
- XcmsColor *pColor;
+XcmsCIELuv_ValidSpec(
+ XcmsColor *pColor)
/*
* DESCRIPTION
* Checks if color specification valid for CIE L*u*v*.
diff --git a/src/xcms/LuvGcC.c b/src/xcms/LuvGcC.c
index 67da68a..fdb5dcd 100644
--- a/src/xcms/LuvGcC.c
+++ b/src/xcms/LuvGcC.c
@@ -30,15 +30,11 @@
* Source for XcmsCIELuvClipuv() gamut compression routine.
*
*/
-/* $XFree86: xc/lib/X11/LuvGcC.c,v 1.3 2001/01/17 19:41:39 dawes Exp $ */
+/* $XFree86: xc/lib/X11/LuvGcC.c,v 1.4 2003/04/13 19:22:16 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
-
-/* EXTERNS */
-
-/* CvCols.c */
-extern Status _XcmsDIConvertColors();
+#include "Cv.h"
/************************************************************************
diff --git a/src/xcms/LuvGcL.c b/src/xcms/LuvGcL.c
index 1ae8513..1c9d4f5 100644
--- a/src/xcms/LuvGcL.c
+++ b/src/xcms/LuvGcL.c
@@ -30,18 +30,11 @@
* Source for XcmsCIELuvClipL() gamut compression routine.
*
*/
-/* $XFree86: xc/lib/X11/LuvGcL.c,v 1.3 2001/01/17 19:41:39 dawes Exp $ */
+/* $XFree86: xc/lib/X11/LuvGcL.c,v 1.4 2003/04/13 19:22:16 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
-
-/*
- * EXTERNS
- */
-extern Status _XcmsCIELuvQueryMaxLCRGB();
-
-/* CvCols.c */
-extern Status _XcmsDIConvertColors();
+#include "Cv.h"
/************************************************************************
diff --git a/src/xcms/LuvGcLC.c b/src/xcms/LuvGcLC.c
index 7db28f7..157a3de 100644
--- a/src/xcms/LuvGcLC.c
+++ b/src/xcms/LuvGcLC.c
@@ -30,11 +30,12 @@
* Source for XcmsCIELuvClipLuv() gamut
* compression function.
*/
-/* $XFree86: xc/lib/X11/LuvGcLC.c,v 1.3 2001/01/17 19:41:39 dawes Exp $ */
+/* $XFree86: xc/lib/X11/LuvGcLC.c,v 1.4 2003/04/13 19:22:17 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
#include <math.h>
+#include "Cv.h"
/*
* INTERNALS
@@ -43,17 +44,6 @@
*/
#define MAXBISECTCOUNT 100
-/*
- * EXTERNS
- */
-extern Status _XcmsCIELuvQueryMaxLCRGB();
-
-/* CvCols.c */
-extern Status _XcmsDIConvertColors();
-
-/* CvColW.c */
-extern Status _XcmsConvertColorsWithWhitePt();
-
/************************************************************************
* *
diff --git a/src/xcms/LuvMnL.c b/src/xcms/LuvMnL.c
index c9e27eb..3f82402 100644
--- a/src/xcms/LuvMnL.c
+++ b/src/xcms/LuvMnL.c
@@ -31,11 +31,12 @@
* querying routine.
*
*/
-/* $XFree86: xc/lib/X11/LuvMnL.c,v 1.3 2001/01/17 19:41:39 dawes Exp $ */
+/* $XFree86: xc/lib/X11/LuvMnL.c,v 1.4 2003/04/13 19:22:17 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
#include <math.h>
+#include "Cv.h"
/*
* DEFINES
@@ -44,14 +45,6 @@
#define EPS (XcmsFloat)0.001
#define START_L_STAR (XcmsFloat)40.0
-/*
- * EXTERNS
- */
-extern Status _XcmsCIELuvQueryMaxLCRGB();
-
-/* CvColW.c */
-extern Status _XcmsConvertColorsWithWhitePt();
-
/************************************************************************
* *
diff --git a/src/xcms/LuvMxC.c b/src/xcms/LuvMxC.c
index b3ede84..10088bb 100644
--- a/src/xcms/LuvMxC.c
+++ b/src/xcms/LuvMxC.c
@@ -33,11 +33,12 @@
* querying routine.
*
*/
-/* $XFree86: xc/lib/X11/LuvMxC.c,v 1.3 2001/01/17 19:41:39 dawes Exp $ */
+/* $XFree86: xc/lib/X11/LuvMxC.c,v 1.4 2003/04/13 19:22:17 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
#include <math.h>
+#include "Cv.h"
/*
* DEFINES
@@ -46,13 +47,6 @@
#define EPS (XcmsFloat)0.001
#define START_CHROMA (XcmsFloat)2.2
#define TOPL (XcmsFloat)100.0
-/*
- * EXTERNS
- */
-extern Status _XcmsCIELuvQueryMaxLCRGB();
-
-/* CvColW.c */
-extern Status _XcmsConvertColorsWithWhitePt();
/************************************************************************
diff --git a/src/xcms/LuvMxL.c b/src/xcms/LuvMxL.c
index 932bc01..327227d 100644
--- a/src/xcms/LuvMxL.c
+++ b/src/xcms/LuvMxL.c
@@ -31,11 +31,12 @@
* querying routine.
*
*/
-/* $XFree86: xc/lib/X11/LuvMxL.c,v 1.3 2001/01/17 19:41:40 dawes Exp $ */
+/* $XFree86: xc/lib/X11/LuvMxL.c,v 1.4 2003/04/13 19:22:17 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
#include <math.h>
+#include "Cv.h"
/*
* DEFINES
@@ -44,14 +45,6 @@
#define EPS (XcmsFloat)0.001
#define START_L_STAR (XcmsFloat)40.0
-/*
- * EXTERNS
- */
-extern Status _XcmsCIELuvQueryMaxLCRGB();
-
-/* CvColW.c */
-extern Status _XcmsConvertColorsWithWhitePt();
-
/************************************************************************
* *
diff --git a/src/xcms/LuvMxLC.c b/src/xcms/LuvMxLC.c
index 337bbbf..3a241a7 100644
--- a/src/xcms/LuvMxLC.c
+++ b/src/xcms/LuvMxLC.c
@@ -38,9 +38,11 @@
* Fred W. Billmeyer & Max Saltzman, "Principles of Color
* Technology", John Wily & Sons, Inc, 1981.
*/
+/* $XFree86: xc/lib/X11/LuvMxLC.c,v 1.2 2003/04/13 19:22:17 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
+#include "Cv.h"
/*
* DEFINES
@@ -52,16 +54,6 @@
#define START_LSTAR (XcmsFloat)40.0
#define START_CHROMA (XcmsFloat)2.2
-/*
- * EXTERNS
- */
-extern Status _XcmsConvertColorsWithWhitePt();
-
-/*
- * FORWARD DECLARATIONS
- */
-Status _XcmsCIELuvQueryMaxLCRGB();
-
/************************************************************************
* *
@@ -76,12 +68,11 @@ Status _XcmsCIELuvQueryMaxLCRGB();
* SYNOPSIS
*/
Status
-_XcmsCIELuvQueryMaxLCRGB(ccc, hue, pColor_return, pRGB_return)
- XcmsCCC ccc;
- XcmsFloat hue; /* hue in radians */
- XcmsColor *pColor_return;
- XcmsRGBi *pRGB_return;
-
+_XcmsCIELuvQueryMaxLCRGB(
+ XcmsCCC ccc,
+ XcmsFloat hue, /* hue in radians */
+ XcmsColor *pColor_return,
+ XcmsRGBi *pRGB_return)
/*
* DESCRIPTION
* Return the maximum psychometric chroma for a specified
diff --git a/src/xcms/LuvWpAj.c b/src/xcms/LuvWpAj.c
index 5083ccb..5df6d8b 100644
--- a/src/xcms/LuvWpAj.c
+++ b/src/xcms/LuvWpAj.c
@@ -32,15 +32,11 @@
* adjustment of color specifications in the CIE CIELuv.color
* space.
*/
+/* $XFree86: xc/lib/X11/LuvWpAj.c,v 1.2 2003/04/13 19:22:17 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
-
-/*
- * EXTERNS
- */
-
-extern Status _XcmsConvertColorsWithWhitePt();
+#include "Cv.h"
diff --git a/src/xcms/PrOfId.c b/src/xcms/PrOfId.c
index 7b301e4..8b5e43a 100644
--- a/src/xcms/PrOfId.c
+++ b/src/xcms/PrOfId.c
@@ -32,15 +32,11 @@
*
*
*/
+/* $XFree86: xc/lib/X11/PrOfId.c,v 1.2 2003/04/13 19:22:17 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
-
-/*
- * EXTERNS
- */
-extern XcmsColorSpace **_XcmsDIColorSpaces;
-extern XcmsColorSpace **_XcmsDDColorSpaces;
+#include "Cv.h"
/*
diff --git a/src/xcms/QuCol.c b/src/xcms/QuCol.c
index 0df0e66..3f19a67 100644
--- a/src/xcms/QuCol.c
+++ b/src/xcms/QuCol.c
@@ -32,15 +32,11 @@
*
*
*/
-/* $XFree86: xc/lib/X11/QuCol.c,v 1.3 2001/01/17 19:41:42 dawes Exp $ */
+/* $XFree86: xc/lib/X11/QuCol.c,v 1.4 2003/04/13 19:22:17 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
-
-/* EXTERN */
-
-/* SetGetCols.c */
-extern Status _XcmsSetGetColors();
+#include "Cv.h"
/************************************************************************
@@ -76,6 +72,6 @@ XcmsQueryColor(dpy, colormap, pXcmsColor_in_out, result_format)
* specified pixel.
*/
{
- return(_XcmsSetGetColors (XQueryColor, dpy, colormap,
- pXcmsColor_in_out, 1, result_format, (Bool *) NULL));
+ return(_XcmsSetGetColor(XQueryColor, dpy, colormap,
+ pXcmsColor_in_out, result_format, (Bool *) NULL));
}
diff --git a/src/xcms/QuCols.c b/src/xcms/QuCols.c
index c857e46..f2ca1a2 100644
--- a/src/xcms/QuCols.c
+++ b/src/xcms/QuCols.c
@@ -32,15 +32,11 @@
*
*
*/
-/* $XFree86: xc/lib/X11/QuCols.c,v 1.3 2001/01/17 19:41:42 dawes Exp $ */
+/* $XFree86: xc/lib/X11/QuCols.c,v 1.4 2003/04/13 19:22:17 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
-
-/* EXTERNS */
-
-/* SetGetCols.c */
-extern Status _XcmsSetGetColors();
+#include "Cv.h"
/************************************************************************
@@ -76,6 +72,6 @@ XcmsQueryColors(dpy, colormap, pXcmsColors_in_out, nColors, result_format)
* specified pixels.
*/
{
- return(_XcmsSetGetColors (XQueryColors, dpy, colormap,
+ return(_XcmsSetGetColors(XQueryColors, dpy, colormap,
pXcmsColors_in_out, nColors, result_format, (Bool *) NULL));
}
diff --git a/src/xcms/SetCCC.c b/src/xcms/SetCCC.c
index d58daf8..34d09ab 100644
--- a/src/xcms/SetCCC.c
+++ b/src/xcms/SetCCC.c
@@ -33,6 +33,7 @@
*
*
*/
+/* $XFree86: xc/lib/X11/SetCCC.c,v 1.2 2003/11/17 22:20:08 dawes Exp $ */
#include "Xlibint.h"
#include "Xcms.h"
@@ -86,17 +87,10 @@ XcmsSetWhitePoint(ccc, pColor)
*/
XcmsCompressionProc
-#if NeedFunctionPrototypes
XcmsSetCompressionProc(
XcmsCCC ccc,
XcmsCompressionProc compression_proc,
XPointer client_data)
-#else
-XcmsSetCompressionProc(ccc, compression_proc, client_data)
- XcmsCCC ccc;
- XcmsCompressionProc compression_proc;
- XPointer client_data;
-#endif
/*
* DESCRIPTION
* Set the specified CCC's compression function and client data.
@@ -122,17 +116,10 @@ XcmsSetCompressionProc(ccc, compression_proc, client_data)
*/
XcmsWhiteAdjustProc
-#if NeedFunctionPrototypes
XcmsSetWhiteAdjustProc(
XcmsCCC ccc,
XcmsWhiteAdjustProc white_adjust_proc,
XPointer client_data )
-#else
-XcmsSetWhiteAdjustProc(ccc, white_adjust_proc, client_data)
- XcmsCCC ccc;
- XcmsWhiteAdjustProc white_adjust_proc;
- XPointer client_data;
-#endif
/*
* DESCRIPTION
* Set the specified CCC's white_adjust function and client data.
diff --git a/src/xcms/SetGetCols.c b/src/xcms/SetGetCols.c
index 5ee6898..4b425af 100644
--- a/src/xcms/SetGetCols.c
+++ b/src/xcms/SetGetCols.c
@@ -32,6 +32,7 @@
*
*
*/
+/* $XFree86: xc/lib/X11/SetGetCols.c,v 1.2 2003/04/13 19:22:17 dawes Exp $ */
/*
* EXTERNAL INCLUDES
@@ -40,15 +41,7 @@
*/
#include "Xlibint.h"
#include "Xcmsint.h"
-
-
-/*
- * EXTERNS
- */
-
-extern void _XcmsRGB_to_XColor();
-extern void _XColor_to_XcmsRGB();
-
+#include "Cv.h"
/************************************************************************
@@ -59,27 +52,144 @@ extern void _XColor_to_XcmsRGB();
/*
* NAME
- * XcmsSetColors -
+ * XcmsSetColor -
*
* SYNOPSIS
*/
Status
-_XcmsSetGetColors(xColorProc, dpy, cmap, pColors_in_out, nColors,
- result_format, pCompressed)
- Status (*xColorProc)();
- Display *dpy;
- Colormap cmap;
- XcmsColor *pColors_in_out;
- unsigned int nColors;
- XcmsColorFormat result_format;
- Bool *pCompressed;
+_XcmsSetGetColor(
+ Status (*xColorProc)(
+ Display* /* display */,
+ Colormap /* colormap */,
+ XColor* /* screen_in_out */),
+ Display *dpy,
+ Colormap cmap,
+ XcmsColor *pColors_in_out,
+ XcmsColorFormat result_format,
+ Bool *pCompressed)
/*
* DESCRIPTION
* Routine containing code common to:
* XcmsAllocColor
* XcmsQueryColor
- * XcmsQueryColors
* XcmsStoreColor
+ *
+ * RETURNS
+ * XcmsFailure if failed;
+ * XcmsSuccess if it succeeded without gamut compression;
+ * XcmsSuccessWithCompression if it succeeded with gamut
+ * compression;
+ */
+{
+ XcmsCCC ccc;
+ XColor XColors_in_out;
+ Status retval = XcmsSuccess;
+
+ /*
+ * Argument Checking
+ * 1. Assume xColorProc is correct
+ * 2. Insure ccc not NULL
+ * 3. Assume cmap correct (should be checked by Server)
+ * 4. Insure pColors_in_out valid
+ * 5. Assume method_in is valid (should be checked by Server)
+ */
+
+ if (dpy == NULL) {
+ return(XcmsFailure);
+ }
+
+ if (result_format == XcmsUndefinedFormat) {
+ return(XcmsFailure);
+ }
+
+ if ( !((*xColorProc == XAllocColor) || (*xColorProc == XStoreColor)
+ || (*xColorProc == XQueryColor)) ) {
+ return(XcmsFailure);
+ }
+
+ if ((ccc = XcmsCCCOfColormap(dpy, cmap)) == (XcmsCCC)NULL) {
+ return(XcmsFailure);
+ }
+
+ if (*xColorProc == XQueryColor) {
+ goto Query;
+ }
+
+ /*
+ * Convert to RGB, adjusting for white point differences if necessary.
+ */
+ if ((retval = XcmsConvertColors(ccc, pColors_in_out, 1, XcmsRGBFormat,
+ pCompressed)) == XcmsFailure) {
+ return(XcmsFailure);
+ }
+
+Query:
+ /*
+ * Convert XcmsColor to XColor structures
+ */
+ _XcmsRGB_to_XColor(pColors_in_out, &XColors_in_out, 1);
+
+ /*
+ * Now make appropriate X Call
+ */
+ if (*xColorProc == XAllocColor) {
+ if ((*xColorProc)(ccc->dpy, cmap, &XColors_in_out) == 0) {
+ return(XcmsFailure);
+ }
+ } else if ((*xColorProc == XQueryColor) || (*xColorProc == XStoreColor)) {
+ /* Note: XQueryColor and XStoreColor do not return any Status */
+ (*xColorProc)(ccc->dpy, cmap, &XColors_in_out);
+ } else {
+ return(XcmsFailure);
+ }
+
+ if ((*xColorProc == XStoreColor)) {
+ return(retval);
+ }
+
+ /*
+ * Now, convert the returned XColor (i.e., rgb) to XcmsColor structures
+ */
+ _XColor_to_XcmsRGB(ccc, &XColors_in_out, pColors_in_out, 1);
+
+ /*
+ * Then, convert XcmsColor structures to the original specification
+ * format. Note that we must use NULL instead of passing
+ * pCompressed.
+ */
+
+ if (result_format != XcmsRGBFormat) {
+ if (XcmsConvertColors(ccc, pColors_in_out, 1, result_format,
+ (Bool *) NULL) == XcmsFailure) {
+ return(XcmsFailure);
+ }
+ }
+ return(retval);
+}
+
+/*
+ * NAME
+ * XcmsSetColors -
+ *
+ * SYNOPSIS
+ */
+Status
+_XcmsSetGetColors(
+ Status (*xColorProc)(
+ Display* /* display */,
+ Colormap /* colormap */,
+ XColor* /* screen_in_out */,
+ int /* nColors */),
+ Display *dpy,
+ Colormap cmap,
+ XcmsColor *pColors_in_out,
+ int nColors,
+ XcmsColorFormat result_format,
+ Bool *pCompressed)
+/*
+ * DESCRIPTION
+ * Routine containing code common to:
+ * XcmsQueryColors
* XcmsStoreColors
*
* RETURNS
@@ -115,9 +225,7 @@ _XcmsSetGetColors(xColorProc, dpy, cmap, pColors_in_out, nColors,
return(XcmsFailure);
}
- if (!((*xColorProc == XAllocColor) || (*xColorProc == XStoreColor)
- || (*xColorProc == XStoreColors) || (*xColorProc == XQueryColor)
- || (*xColorProc == XQueryColors))) {
+ if ( !((*xColorProc == XStoreColors) || (*xColorProc == XQueryColors)) ) {
return(XcmsFailure);
}
@@ -125,11 +233,6 @@ _XcmsSetGetColors(xColorProc, dpy, cmap, pColors_in_out, nColors,
return(XcmsFailure);
}
- if ((*xColorProc == XAllocColor) || (*xColorProc == XStoreColor)
- || (*xColorProc == XQueryColor)) {
- nColors = 1;
- }
-
/*
* Allocate space for XColors
*/
@@ -138,14 +241,16 @@ _XcmsSetGetColors(xColorProc, dpy, cmap, pColors_in_out, nColors,
return(XcmsFailure);
}
- if ((*xColorProc == XQueryColor) || (*xColorProc == XQueryColors)) {
+ if (*xColorProc == XQueryColors) {
goto Query;
}
+
/*
* Convert to RGB, adjusting for white point differences if necessary.
*/
if ((retval = XcmsConvertColors(ccc, pColors_in_out, nColors, XcmsRGBFormat,
pCompressed)) == XcmsFailure) {
+ Xfree((char *)pXColors_in_out);
return(XcmsFailure);
}
@@ -158,15 +263,7 @@ Query:
/*
* Now make appropriate X Call
*/
- if (*xColorProc == XAllocColor) {
- if ((*xColorProc)(ccc->dpy, cmap, pXColors_in_out) == 0) {
- Xfree((char *)pXColors_in_out);
- return(XcmsFailure);
- }
- } else if ((*xColorProc == XQueryColor) || (*xColorProc == XStoreColor)) {
- /* Note: XQueryColor and XStoreColor do not return any Status */
- (*xColorProc)(ccc->dpy, cmap, pXColors_in_out);
- } else if ((*xColorProc == XQueryColors) || (*xColorProc == XStoreColors)){
+ if ((*xColorProc == XQueryColors) || (*xColorProc == XStoreColors)){
/* Note: XQueryColors and XStoreColors do not return any Status */
(*xColorProc)(ccc->dpy, cmap, pXColors_in_out, nColors);
} else {
@@ -174,13 +271,13 @@ Query:
return(XcmsFailure);
}
- if ((*xColorProc == XStoreColor) || (*xColorProc == XStoreColors)) {
+ if (*xColorProc == XStoreColors) {
Xfree((char *)pXColors_in_out);
return(retval);
}
/*
- * Now, convert returned XColor(i.e., rgb) to XcmsColor structures
+ * Now, convert the returned XColor (i.e., rgb) to XcmsColor structures
*/
_XColor_to_XcmsRGB(ccc, pXColors_in_out, pColors_in_out, nColors);
Xfree((char *)pXColors_in_out);
@@ -190,12 +287,14 @@ Query:
* format. Note that we must use NULL instead of passing
* pCompressed.
*/
-
if (result_format != XcmsRGBFormat) {
if (XcmsConvertColors(ccc, pColors_in_out, nColors, result_format,
(Bool *) NULL) == XcmsFailure) {
return(XcmsFailure);
}
}
+
return(retval);
}
+
+/* ### EOF ### */
diff --git a/src/xcms/StCol.c b/src/xcms/StCol.c
index 5467686..0d845b9 100644
--- a/src/xcms/StCol.c
+++ b/src/xcms/StCol.c
@@ -32,15 +32,11 @@
*
*
*/
-/* $XFree86: xc/lib/X11/StCol.c,v 1.3 2001/01/17 19:41:44 dawes Exp $ */
+/* $XFree86: xc/lib/X11/StCol.c,v 1.4 2003/04/13 19:22:17 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
-
-/* EXTERN */
-
-/* SetGetCols.c */
-extern Status _XcmsSetGetColors();
+#include "Cv.h"
/************************************************************************
@@ -80,6 +76,6 @@ XcmsStoreColor(dpy, colormap, pColor_in)
XcmsColor tmpColor;
tmpColor = *pColor_in;
- return(_XcmsSetGetColors (XStoreColor, dpy, colormap,
- &tmpColor, 1, XcmsRGBFormat, (Bool *) NULL));
+ return(_XcmsSetGetColor(XStoreColor, dpy, colormap,
+ &tmpColor, XcmsRGBFormat, (Bool *) NULL));
}
diff --git a/src/xcms/StCols.c b/src/xcms/StCols.c
index d35bd33..3d6b900 100644
--- a/src/xcms/StCols.c
+++ b/src/xcms/StCols.c
@@ -32,15 +32,11 @@
*
*
*/
-/* $XFree86: xc/lib/X11/StCols.c,v 1.3 2001/01/17 19:41:44 dawes Exp $ */
+/* $XFree86: xc/lib/X11/StCols.c,v 1.4 2003/04/13 19:22:18 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
-
-/* EXTERN */
-
-/* SetGetCols.c */
-extern Status _XcmsSetGetColors();
+#include "Cv.h"
/************************************************************************
diff --git a/src/xcms/UNDEFINED.c b/src/xcms/UNDEFINED.c
index a4e0555..6c0656a 100644
--- a/src/xcms/UNDEFINED.c
+++ b/src/xcms/UNDEFINED.c
@@ -33,6 +33,7 @@
*
*
*/
+/* $XFree86: xc/lib/X11/UNDEFINED.c,v 1.2 2003/04/13 19:22:18 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
@@ -40,21 +41,33 @@
/*
* FORWARD DECLARATIONS
*/
-static int ReturnZero();
+static int DummyParseStringProc(
+ char* /* color_string */,
+ XcmsColor* /* color_return */
+ );
+static Status ReturnZero(
+ XcmsCCC /* ccc */,
+ XcmsColor* /* white_point */,
+ XcmsColor* /* colors */,
+ unsigned int /* ncolors */
+ );
/*
* LOCALS VARIABLES
*/
-static Status (*(Fl_ReturnZero[]))() = {
+static Status (*(Fl_ReturnZero[]))(
+ XcmsCCC /* ccc */,
+ XcmsColor* /* white_point */,
+ XcmsColor* /* colors */,
+ unsigned int /* ncolors */
+ ) = {
ReturnZero,
NULL
};
-
-
/*
* GLOBALS
* Variables declared in this package that are allowed
@@ -67,7 +80,7 @@ XcmsColorSpace XcmsUNDEFINEDColorSpace =
{
"undefined", /* prefix */
XcmsUndefinedFormat, /* id */
- ReturnZero, /* parseString */
+ &DummyParseStringProc, /* parseString */
Fl_ReturnZero, /* to_CIEXYZ */
Fl_ReturnZero /* from_CIEXYZ */
};
@@ -87,8 +100,13 @@ XcmsColorSpace XcmsUNDEFINEDColorSpace =
* SYNOPSIS
*/
/* ARGSUSED */
-static int
-ReturnZero()
+static Status
+ReturnZero(
+ XcmsCCC ccc /* ccc */,
+ XcmsColor* white /* white_point */,
+ XcmsColor* colors /* colors */,
+ unsigned int ncolors /* ncolors */
+ )
/*
* DESCRIPTION
* Does nothing.
@@ -100,3 +118,13 @@ ReturnZero()
{
return(0);
}
+
+static int DummyParseStringProc(
+ char* color_string /* color_string */,
+ XcmsColor* color_return /* color_return */
+ )
+{
+ return(0);
+}
+
+/* ### EOF ### */
diff --git a/src/xcms/XRGB.c b/src/xcms/XRGB.c
index c4985a3..26d0ef9 100644
--- a/src/xcms/XRGB.c
+++ b/src/xcms/XRGB.c
@@ -33,10 +33,11 @@
*
*
*/
-/* $XFree86: xc/lib/X11/XRGB.c,v 3.3 2001/07/29 05:01:11 tsi Exp $ */
+/* $XFree86: xc/lib/X11/XRGB.c,v 3.4 2003/04/13 19:22:19 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
+#include "Cv.h"
/*
* LOCAL VARIABLES
@@ -77,10 +78,10 @@ static unsigned short const MASK[17] = {
* SYNOPSIS
*/
void
-_XcmsRGB_to_XColor(pColors, pXColors, nColors)
- XcmsColor *pColors;
- XColor *pXColors;
- unsigned int nColors;
+_XcmsRGB_to_XColor(
+ XcmsColor *pColors,
+ XColor *pXColors,
+ unsigned int nColors)
/*
* DESCRIPTION
* Translates a color specification in XcmsRGBFormat in a XcmsColor
@@ -107,11 +108,11 @@ _XcmsRGB_to_XColor(pColors, pXColors, nColors)
* SYNOPSIS
*/
void
-_XColor_to_XcmsRGB(ccc, pXColors, pColors, nColors)
- XcmsCCC ccc;
- XColor *pXColors;
- XcmsColor *pColors;
- unsigned int nColors;
+_XColor_to_XcmsRGB(
+ XcmsCCC ccc,
+ XColor *pXColors,
+ XcmsColor *pColors,
+ unsigned int nColors)
/*
* DESCRIPTION
* Translates an RGB color specification in an XColor
@@ -145,9 +146,9 @@ _XColor_to_XcmsRGB(ccc, pXColors, pColors, nColors)
* SYNOPSIS
*/
void
-_XcmsResolveColor(ccc, pXcmsColor)
- XcmsCCC ccc;
- XcmsColor *pXcmsColor;
+_XcmsResolveColor(
+ XcmsCCC ccc,
+ XcmsColor *pXcmsColor)
/*
* DESCRIPTION
* Uses the X Server ResolveColor() algorithm to
@@ -191,9 +192,9 @@ _XcmsResolveColor(ccc, pXcmsColor)
* SYNOPSIS
*/
void
-_XcmsUnresolveColor(ccc, pColor)
- XcmsCCC ccc;
- XcmsColor *pColor;
+_XcmsUnresolveColor(
+ XcmsCCC ccc,
+ XcmsColor *pColor)
/*
* DESCRIPTION
* Masks out insignificant bits.
@@ -220,9 +221,9 @@ _XcmsUnresolveColor(ccc, pColor)
* SYNOPSIS
*/
void
-_XUnresolveColor(ccc, pXColor)
- XcmsCCC ccc;
- XColor *pXColor;
+_XUnresolveColor(
+ XcmsCCC ccc,
+ XColor *pXColor)
/*
* DESCRIPTION
* Masks out insignificant bits.
diff --git a/src/xcms/XYZ.c b/src/xcms/XYZ.c
index 55040cb..7a9c98e 100644
--- a/src/xcms/XYZ.c
+++ b/src/xcms/XYZ.c
@@ -33,23 +33,15 @@
*
*
*/
-/* $XFree86: xc/lib/X11/XYZ.c,v 1.3 2001/01/17 19:41:49 dawes Exp $ */
+/* $XFree86: xc/lib/X11/XYZ.c,v 1.4 2003/04/13 19:22:19 dawes Exp $ */
#include <X11/Xos.h>
#include "Xlibint.h"
#include "Xcmsint.h"
+#include "Cv.h"
#include <stdio.h> /* sscanf */
-
-/*
- * EXTERNS
- * External declarations required locally to this package
- * that are not already declared in any of the included header
- * files (external includes or internal includes).
- */
-extern char _XcmsCIEXYZ_prefix[];
-
/*
* DEFINES
* Internal definitions that need NOT be exported to any package
@@ -64,9 +56,7 @@ extern char _XcmsCIEXYZ_prefix[];
/*
* FORWARD DECLARATIONS
*/
-static int CIEXYZ_ParseString();
-Status _XcmsCIEXYZ_ValidSpec();
-
+static int CIEXYZ_ParseString(register char *spec, XcmsColor *pColor);
/*
* LOCALS VARIABLES
@@ -110,9 +100,9 @@ XcmsColorSpace XcmsCIEXYZColorSpace =
* SYNOPSIS
*/
static int
-CIEXYZ_ParseString(spec, pColor)
- register char *spec;
- XcmsColor *pColor;
+CIEXYZ_ParseString(
+ register char *spec,
+ XcmsColor *pColor)
/*
* DESCRIPTION
* This routines takes a string and attempts to convert
@@ -172,8 +162,8 @@ CIEXYZ_ParseString(spec, pColor)
* SYNOPSIS
*/
Status
-_XcmsCIEXYZ_ValidSpec(pColor)
- XcmsColor *pColor;
+_XcmsCIEXYZ_ValidSpec(
+ XcmsColor *pColor)
/*
* DESCRIPTION
* Checks if color specification valid for CIE XYZ
diff --git a/src/xcms/Xcmsint.h b/src/xcms/Xcmsint.h
index 5e14195..ca8e057 100644
--- a/src/xcms/Xcmsint.h
+++ b/src/xcms/Xcmsint.h
@@ -29,7 +29,7 @@
* (i.e., for API internal use only)
*
*/
-/* $XFree86: xc/lib/X11/Xcmsint.h,v 3.3 2001/07/25 15:04:44 dawes Exp $ */
+/* $XFree86: xc/lib/X11/Xcmsint.h,v 3.4 2003/04/13 19:22:19 dawes Exp $ */
#ifndef _XCMSINT_H_
#define _XCMSINT_H_
@@ -109,7 +109,7 @@ typedef struct _XcmsIntensityMap {
VisualID visualID;
XPointer screenData; /* pointer to corresponding Screen Color*/
/* Characterization Data */
- void (*pFreeScreenData)(); /* Function that frees a Screen */
+ void (*pFreeScreenData)(XPointer pScreenDataTemp); /* Function that frees a Screen */
/* structure. */
struct _XcmsIntensityMap *pNext;
} XcmsIntensityMap;
@@ -176,6 +176,28 @@ typedef struct {
IntensityTbl *pBlueTbl;
} LINEAR_RGB_SCCData;
+/* function prototypes */
+extern XcmsCmapRec *
+_XcmsAddCmapRec(
+ Display *dpy,
+ Colormap cmap,
+ Window windowID,
+ Visual *visual);
+extern void
+_XcmsRGB_to_XColor(
+ XcmsColor *pColors,
+ XColor *pXColors,
+ unsigned int nColors);
+extern Status
+_XcmsResolveColorString (
+ XcmsCCC ccc,
+ const char **color_string,
+ XcmsColor *pColor_exact_return,
+ XcmsColorFormat result_format);
+extern void
+_XUnresolveColor(
+ XcmsCCC ccc,
+ XColor *pXColor);
/*
* DESCRIPTION
* Include file for defining the math macros used in the
diff --git a/src/xcms/cmsAllCol.c b/src/xcms/cmsAllCol.c
index 3cfce49..0bdeeeb 100644
--- a/src/xcms/cmsAllCol.c
+++ b/src/xcms/cmsAllCol.c
@@ -32,15 +32,11 @@
*
*
*/
-/* $XFree86: xc/lib/X11/cmsAllCol.c,v 1.3 2001/01/17 19:41:50 dawes Exp $ */
+/* $XFree86: xc/lib/X11/cmsAllCol.c,v 1.4 2003/04/13 19:22:20 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
-
-/* EXTERNS */
-
-/* SetGetCols.c */
-extern Status _XcmsSetGetColors();
+#include "Cv.h"
/*
@@ -72,6 +68,6 @@ XcmsAllocColor(dpy, colormap, pXcmsColor_in_out, result_format)
*
*/
{
- return(_XcmsSetGetColors (XAllocColor, dpy, colormap, pXcmsColor_in_out, 1,
+ return(_XcmsSetGetColor(XAllocColor, dpy, colormap, pXcmsColor_in_out,
result_format, (Bool *)NULL));
}
diff --git a/src/xcms/cmsAllNCol.c b/src/xcms/cmsAllNCol.c
index 2d5e46e..ffcb9df 100644
--- a/src/xcms/cmsAllNCol.c
+++ b/src/xcms/cmsAllNCol.c
@@ -32,21 +32,13 @@
*
*
*/
-/* $XFree86: xc/lib/X11/cmsAllNCol.c,v 1.3 2001/01/17 19:41:50 dawes Exp $ */
+/* $XFree86: xc/lib/X11/cmsAllNCol.c,v 1.5 2003/11/17 22:20:11 dawes Exp $ */
#define NEED_REPLIES
#include <stdio.h>
#include "Xlibint.h"
#include "Xcmsint.h"
-
-/*
- * EXTERNS
- */
-extern void _XColor_to_XcmsRGB();
-extern void _XcmsRGB_to_XColor();
-
-/* cmsColNm.c */
-extern Status _XcmsResolveColorString();
+#include "Cv.h"
/*
@@ -55,7 +47,6 @@ extern Status _XcmsResolveColorString();
*
* SYNOPSIS
*/
-#if NeedFunctionPrototypes
Status
XcmsAllocNamedColor (
Display *dpy,
@@ -64,17 +55,6 @@ XcmsAllocNamedColor (
XcmsColor *pColor_scrn_return,
XcmsColor *pColor_exact_return,
XcmsColorFormat result_format)
-#else
-Status
-XcmsAllocNamedColor(dpy, cmap, colorname, pColor_scrn_return,
- pColor_exact_return, result_format)
- Display *dpy;
- Colormap cmap;
- char *colorname;
- XcmsColor *pColor_scrn_return;
- XcmsColor *pColor_exact_return;
- XcmsColorFormat result_format;
-#endif
/*
* DESCRIPTION
* Finds the color specification associated with the color
diff --git a/src/xcms/cmsCmap.c b/src/xcms/cmsCmap.c
index 84d60a4..0713497 100644
--- a/src/xcms/cmsCmap.c
+++ b/src/xcms/cmsCmap.c
@@ -33,18 +33,20 @@
*
*
*/
+/* $XFree86: xc/lib/X11/cmsCmap.c,v 3.2 2003/04/13 19:22:20 dawes Exp $ */
#define NEED_EVENTS
#define NEED_REPLIES
#include "Xlibint.h"
#include "Xcmsint.h"
#include "Xutil.h"
+#include "Cmap.h"
+#include "Cv.h"
/*
* FORWARD DECLARATIONS
*/
-XcmsCmapRec *_XcmsAddCmapRec();
-static void _XcmsFreeClientCmaps();
+static void _XcmsFreeClientCmaps(Display *dpy);
/************************************************************************
@@ -60,9 +62,9 @@ static void _XcmsFreeClientCmaps();
* SYNOPSIS
*/
static XcmsCmapRec *
-CmapRecForColormap(dpy, cmap)
- Display *dpy;
- Colormap cmap;
+CmapRecForColormap(
+ Display *dpy,
+ Colormap cmap)
/*
* DESCRIPTION
* Find the corresponding XcmsCmapRec for cmap. In not found
@@ -278,10 +280,10 @@ _XcmsAddCmapRec(dpy, cmap, windowID, visual)
* SYNOPSIS
*/
XcmsCmapRec *
-_XcmsCopyCmapRecAndFree(dpy, src_cmap, copy_cmap)
- Display *dpy;
- Colormap src_cmap;
- Colormap copy_cmap;
+_XcmsCopyCmapRecAndFree(
+ Display *dpy,
+ Colormap src_cmap,
+ Colormap copy_cmap)
/*
* DESCRIPTION
* Augments Xlib's XCopyColormapAndFree() to copy
@@ -317,9 +319,9 @@ _XcmsCopyCmapRecAndFree(dpy, src_cmap, copy_cmap)
* SYNOPSIS
*/
void
-_XcmsDeleteCmapRec(dpy, cmap)
- Display *dpy;
- Colormap cmap;
+_XcmsDeleteCmapRec(
+ Display *dpy,
+ Colormap cmap)
/*
* DESCRIPTION
* Removes and frees the specified XcmsCmapRec structure
@@ -364,8 +366,8 @@ _XcmsDeleteCmapRec(dpy, cmap)
* SYNOPSIS
*/
static void
-_XcmsFreeClientCmaps(dpy)
- Display *dpy;
+_XcmsFreeClientCmaps(
+ Display *dpy)
/*
* DESCRIPTION
* Frees all XcmsCmapRec structures in the linked list
diff --git a/src/xcms/cmsColNm.c b/src/xcms/cmsColNm.c
index e65faf9..67594c9 100644
--- a/src/xcms/cmsColNm.c
+++ b/src/xcms/cmsColNm.c
@@ -31,7 +31,7 @@
*
*
*/
-/* $XFree86: xc/lib/X11/cmsColNm.c,v 3.10 2002/05/31 18:45:42 dawes Exp $ */
+/* $XFree86: xc/lib/X11/cmsColNm.c,v 3.12 2003/11/17 22:20:11 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
@@ -41,24 +41,10 @@
#include <ctype.h>
#define XK_LATIN1
#include <X11/keysymdef.h>
+#include "Cv.h"
-
-/*
- * EXTERNS
- * External declarations required locally to this package
- * that are not already declared in any of the included header
- * files (external includes or internal includes).
- */
-extern XcmsColorSpace **_XcmsDIColorSpaces;
-
-/* CvCols.c */
-extern Status _XcmsDDConvertColors();
-extern int _XcmsEqualWhitePts();
-extern Status _XcmsDIConvertColors();
-
-
-static Status LoadColornameDB();
-void _XcmsCopyISOLatin1Lowered();
+/* forwards/locals */
+static Status LoadColornameDB(void);
/*
@@ -121,9 +107,9 @@ static const char whitePtStr[] = "WhitePoint";
* SYNOPSIS
*/
static XcmsColorSpace *
-_XcmsColorSpaceOfString(ccc, color_string)
- XcmsCCC ccc;
- const char *color_string;
+_XcmsColorSpaceOfString(
+ XcmsCCC ccc,
+ const char *color_string)
/*
* DESCRIPTION
* Returns a pointer to the color space structure
@@ -189,10 +175,10 @@ _XcmsColorSpaceOfString(ccc, color_string)
* SYNOPSIS
*/
static int
-_XcmsParseColorString(ccc, color_string, pColor)
- XcmsCCC ccc;
- const char *color_string;
- XcmsColor *pColor;
+_XcmsParseColorString(
+ XcmsCCC ccc,
+ const char *color_string,
+ XcmsColor *pColor)
/*
* DESCRIPTION
* Assuming color_string contains a numerical string color
@@ -254,8 +240,7 @@ _XcmsParseColorString(ccc, color_string, pColor)
* SYNOPSIS
*/
static int
-FirstCmp(p1, p2)
- const void *p1, *p2;
+FirstCmp(const void *p1, const void *p2)
/*
* DESCRIPTION
* Compares the color names of XcmsColorTuples.
@@ -280,7 +265,7 @@ FirstCmp(p1, p2)
* SYNOPSIS
*/
static void
-SetNoVisit()
+SetNoVisit(void)
/*
* DESCRIPTION
*
@@ -309,11 +294,11 @@ SetNoVisit()
* SYNOPSIS
*/
static int
-field2(pBuf, delim, p1, p2)
- char *pBuf;
- char delim; /* in: field delimiter */
- char **p1; /* in/out: pointer to pointer to field 1 */
- char **p2; /* in/out: pointer to pointer to field 2 */
+field2(
+ char *pBuf,
+ char delim, /* in: field delimiter */
+ char **p1, /* in/out: pointer to pointer to field 1 */
+ char **p2) /* in/out: pointer to pointer to field 2 */
/*
* DESCRIPTION
* Extracts two fields from a "record".
@@ -379,10 +364,10 @@ field2(pBuf, delim, p1, p2)
* SYNOPSIS
*/
static Status
-_XcmsLookupColorName(ccc, name, pColor)
- XcmsCCC ccc;
- const char **name;
- XcmsColor *pColor;
+_XcmsLookupColorName(
+ XcmsCCC ccc,
+ const char **name,
+ XcmsColor *pColor)
/*
* DESCRIPTION
* Searches for an entry in the Device-Independent Color Name
@@ -502,8 +487,8 @@ Retry:
* SYNOPSIS
*/
static int
-RemoveSpaces(pString)
- char *pString;
+RemoveSpaces(
+ char *pString)
/*
* DESCRIPTION
* Removes spaces from string.
@@ -536,10 +521,10 @@ RemoveSpaces(pString)
* SYNOPSIS
*/
static int
-stringSectionSize(stream, pNumEntries, pSectionSize)
- FILE *stream;
- int *pNumEntries;
- int *pSectionSize;
+stringSectionSize(
+ FILE *stream,
+ int *pNumEntries,
+ int *pSectionSize)
/*
* DESCRIPTION
* Determines the amount of memory required to store the
@@ -621,10 +606,10 @@ stringSectionSize(stream, pNumEntries, pSectionSize)
* SYNOPSIS
*/
static Status
-ReadColornameDB(stream, pRec, pString)
- FILE *stream;
- XcmsPair *pRec;
- char *pString;
+ReadColornameDB(
+ FILE *stream,
+ XcmsPair *pRec,
+ char *pString)
/*
* DESCRIPTION
* Loads the Color Name Database from a text file.
@@ -708,7 +693,7 @@ ReadColornameDB(stream, pRec, pString)
* SYNOPSIS
*/
static Status
-LoadColornameDB()
+LoadColornameDB(void)
/*
* DESCRIPTION
* Loads the Color Name Database from a text file.
@@ -781,9 +766,9 @@ LoadColornameDB()
* SYNOPSIS
*/
void
-_XcmsCopyISOLatin1Lowered(dst, src)
- char *dst;
- const char *src;
+_XcmsCopyISOLatin1Lowered(
+ char *dst,
+ const char *src)
/*
* DESCRIPTION
* ISO Latin-1 case conversion routine
@@ -824,21 +809,12 @@ _XcmsCopyISOLatin1Lowered(dst, src)
*
* SYNOPSIS
*/
-#if NeedFunctionPrototypes
Status
_XcmsResolveColorString (
XcmsCCC ccc,
const char **color_string,
XcmsColor *pColor_exact_return,
XcmsColorFormat result_format)
-#else
-Status
-_XcmsResolveColorString(ccc, color_string, pColor_exact_return, result_format)
- XcmsCCC ccc;
- const char **color_string;
- XcmsColor *pColor_exact_return;
- XcmsColorFormat result_format;
-#endif
/*
* DESCRIPTION
* The XcmsLookupColor function finds the color specification
diff --git a/src/xcms/cmsGlobls.c b/src/xcms/cmsGlobls.c
index accb6d8..ad4e45f 100644
--- a/src/xcms/cmsGlobls.c
+++ b/src/xcms/cmsGlobls.c
@@ -32,47 +32,11 @@
*
*
*/
-/* $XFree86: xc/lib/X11/cmsGlobls.c,v 1.4 2001/01/17 19:41:51 dawes Exp $ */
+/* $XFree86: xc/lib/X11/cmsGlobls.c,v 1.5 2003/04/13 19:22:20 dawes Exp $ */
#include "Xlibint.h"
#include "Xcmsint.h"
-
-/*
- * EXTERNS
- * External declarations required locally to this package
- * that are not already declared in any of the included header
- * files (external includes or internal includes).
- */
-extern XcmsFunctionSet XcmsLinearRGBFunctionSet;
-#ifdef GRAY
-extern XcmsFunctionSet XcmsGrayFunctionSet;
-#endif /* GRAY */
-
-/* UNDEFINED Color Space */
-extern XcmsColorSpace XcmsUNDEFINEDColorSpace;
-
-/* CIE XYZ Color Space */
-extern XcmsColorSpace XcmsCIEXYZColorSpace;
-
-/* CIE uvY Color Space */
-extern XcmsColorSpace XcmsCIEuvYColorSpace;
-
-/* CIE xyY Color Space */
-extern XcmsColorSpace XcmsCIExyYColorSpace;
-
-/* CIE Lab Color Space */
-extern XcmsColorSpace XcmsCIELabColorSpace;
-
-/* CIE Luv Color Space */
-extern XcmsColorSpace XcmsCIELuvColorSpace;
-
-/* TekHVC Color Space */
-extern XcmsColorSpace XcmsTekHVCColorSpace;
-
-/* Device Dependent Color Space Structures */
-extern XcmsColorSpace XcmsRGBiColorSpace;
-extern XcmsColorSpace XcmsRGBColorSpace;
-
+#include "Cv.h"
/*
* GLOBALS
diff --git a/src/xcms/cmsInt.c b/src/xcms/cmsInt.c
index cf492a5..4881a69 100644
--- a/src/xcms/cmsInt.c
+++ b/src/xcms/cmsInt.c
@@ -34,32 +34,20 @@
*
*
*/
-/* $XFree86: xc/lib/X11/cmsInt.c,v 1.3 2001/01/17 19:41:51 dawes Exp $ */
+/* $XFree86: xc/lib/X11/cmsInt.c,v 1.5 2003/04/17 02:06:31 dawes Exp $ */
/* #define NEED_EVENTS */
#include <stdio.h>
#include "Xlibint.h"
#include "Xcmsint.h"
+#include "Cv.h"
#ifndef XCMSCOMPPROC
# define XCMSCOMPPROC XcmsTekHVCClipC
#endif
-/*
- * EXTERNS
- */
-extern XcmsColorSpace **_XcmsDIColorSpaces;
-extern XcmsFunctionSet **_XcmsSCCFuncSets;
-
-/* LRGB.c */
-extern int _XcmsLRGB_InitScrnDefault();
-
-static void _XcmsFreeDefaultCCCs();
-
-/*
- * GLOBALS
- */
-
+/* forward/static */
+static void _XcmsFreeDefaultCCCs(Display *dpy);
/************************************************************************
@@ -75,8 +63,8 @@ static void _XcmsFreeDefaultCCCs();
* SYNOPSIS
*/
XPointer *
-_XcmsCopyPointerArray(pap)
- XPointer *pap;
+_XcmsCopyPointerArray(
+ XPointer *pap)
/*
* DESCRIPTION
* Copies an array of NULL terminated pointers.
@@ -108,8 +96,8 @@ _XcmsCopyPointerArray(pap)
* SYNOPSIS
*/
void
-_XcmsFreePointerArray(pap)
- XPointer *pap;
+_XcmsFreePointerArray(
+ XPointer *pap)
/*
* DESCRIPTION
* Frees an array of NULL terminated pointers.
@@ -129,10 +117,10 @@ _XcmsFreePointerArray(pap)
* SYNOPSIS
*/
XPointer *
-_XcmsPushPointerArray(pap, p, papNoFree)
- XPointer *pap;
- XPointer p;
- XPointer *papNoFree;
+_XcmsPushPointerArray(
+ XPointer *pap,
+ XPointer p,
+ XPointer *papNoFree)
/*
* DESCRIPTION
* Places the specified pointer at the head of an array of NULL
@@ -171,8 +159,8 @@ _XcmsPushPointerArray(pap, p, papNoFree)
* SYNOPSIS
*/
int
-_XcmsInitDefaultCCCs(dpy)
- Display *dpy;
+_XcmsInitDefaultCCCs(
+ Display *dpy)
/*
* DESCRIPTION
* Initializes the Xcms per Display Info structure
@@ -232,8 +220,8 @@ _XcmsInitDefaultCCCs(dpy)
* SYNOPSIS
*/
static void
-_XcmsFreeDefaultCCCs(dpy)
- Display *dpy;
+_XcmsFreeDefaultCCCs(
+ Display *dpy)
/*
* DESCRIPTION
* This routine frees the default XcmsCCC's associated with
@@ -291,9 +279,9 @@ _XcmsFreeDefaultCCCs(dpy)
* SYNOPSIS
*/
int
-_XcmsInitScrnInfo(dpy, screenNumber)
- register Display *dpy;
- int screenNumber;
+_XcmsInitScrnInfo(
+ register Display *dpy,
+ int screenNumber)
/*
* DESCRIPTION
* Given a display and screen number, this routine attempts
@@ -364,8 +352,8 @@ _XcmsInitScrnInfo(dpy, screenNumber)
* SYNOPSIS
*/
void
-_XcmsFreeIntensityMaps(dpy)
- Display *dpy;
+_XcmsFreeIntensityMaps(
+ Display *dpy)
/*
* DESCRIPTION
* Frees all XcmsIntensityMap structures in the linked list
@@ -397,9 +385,9 @@ _XcmsFreeIntensityMaps(dpy)
* SYNOPSIS
*/
XcmsIntensityMap *
-_XcmsGetIntensityMap(dpy, visual)
- Display *dpy;
- Visual *visual;
+_XcmsGetIntensityMap(
+ Display *dpy,
+ Visual *visual)
/*
* DESCRIPTION
* Attempts to return a per-Visual intensity map.
diff --git a/src/xcms/cmsLkCol.c b/src/xcms/cmsLkCol.c
index 16704e4..ff5e69e 100644
--- a/src/xcms/cmsLkCol.c
+++ b/src/xcms/cmsLkCol.c
@@ -32,23 +32,13 @@
*
*
*/
-/* $XFree86: xc/lib/X11/cmsLkCol.c,v 1.4 2001/07/25 15:04:44 dawes Exp $ */
+/* $XFree86: xc/lib/X11/cmsLkCol.c,v 1.6 2003/11/17 22:20:11 dawes Exp $ */
#define NEED_REPLIES
#include <stdio.h>
#include "Xlibint.h"
#include "Xcmsint.h"
-
-/*
- * EXTERNS
- */
-extern void _XColor_to_XcmsRGB();
-extern void _XcmsRGB_to_XColor();
-extern void _XcmsResolveColor();
-extern void _XcmsUnresolveColor();
-
-/* cmsColNm.c */
-extern Status _XcmsResolveColorString();
+#include "Cv.h"
/*
@@ -57,7 +47,6 @@ extern Status _XcmsResolveColorString();
*
* SYNOPSIS
*/
-#if NeedFunctionPrototypes
Status
XcmsLookupColor (
Display *dpy,
@@ -66,17 +55,6 @@ XcmsLookupColor (
XcmsColor *pColor_exact_return,
XcmsColor *pColor_scrn_return,
XcmsColorFormat result_format)
-#else
-Status
-XcmsLookupColor(dpy, cmap, colorname, pColor_exact_return, pColor_scrn_return,
- result_format)
- Display *dpy;
- Colormap cmap;
- char *colorname;
- XcmsColor *pColor_exact_return;
- XcmsColor *pColor_scrn_return;
- XcmsColorFormat result_format;
-#endif
/*
* DESCRIPTION
* The XcmsLookupColor function finds the color specification
diff --git a/src/xcms/cmsProp.c b/src/xcms/cmsProp.c
index 28d7a88..dfa0307 100644
--- a/src/xcms/cmsProp.c
+++ b/src/xcms/cmsProp.c
@@ -31,10 +31,12 @@
* This utility routines for manipulating properties.
*
*/
+/* $XFree86: xc/lib/X11/cmsProp.c,v 1.2 2003/04/13 19:22:20 dawes Exp $ */
#include <X11/Xatom.h>
#include "Xlibint.h"
#include "Xcmsint.h"
+#include "Cv.h"
/************************************************************************
@@ -51,10 +53,10 @@
* SYNOPSIS
*/
unsigned long
-_XcmsGetElement (format, pValue, pCount)
- int format;
- char **pValue;
- unsigned long *pCount;
+_XcmsGetElement(
+ int format,
+ char **pValue,
+ unsigned long *pCount)
/*
* DESCRIPTION
* Get the next element from the property and return it.
@@ -97,14 +99,14 @@ _XcmsGetElement (format, pValue, pCount)
* SYNOPSIS
*/
int
-_XcmsGetProperty (pDpy, w, property, pFormat, pNItems, pNBytes, pValue)
- Display *pDpy;
- Window w;
- Atom property;
- int *pFormat;
- unsigned long *pNItems;
- unsigned long *pNBytes;
- char **pValue;
+_XcmsGetProperty(
+ Display *pDpy,
+ Window w,
+ Atom property,
+ int *pFormat,
+ unsigned long *pNItems,
+ unsigned long *pNBytes,
+ char **pValue)
/*
* DESCRIPTION
*
diff --git a/src/xcms/cmsTrig.c b/src/xcms/cmsTrig.c
index 4db4456..f56c5e7 100644
--- a/src/xcms/cmsTrig.c
+++ b/src/xcms/cmsTrig.c
@@ -24,7 +24,7 @@
* CONNECTION WITH THE USE OR THE PERFORMANCE OF THIS SOFTWARE.
*/
-/* $XFree86: xc/lib/X11/cmsTrig.c,v 3.8 2001/10/28 03:32:34 tsi Exp $ */
+/* $XFree86: xc/lib/X11/cmsTrig.c,v 3.9 2003/04/13 19:22:20 dawes Exp $ */
/*
* It should be pointed out that for simplicity's sake, the
* environment parameters are defined as floating point constants,
@@ -45,25 +45,22 @@
*
*/
-/*
- * EXTERNS
- */
-extern double _XcmsSquareRoot();
+#include "Xcmsint.h"
-/*
- * FORWARD DECLARATIONS
- */
-double _XcmsCosine();
-static double _XcmsModulo();
-static double _XcmsModuloF();
-static double _XcmsPolynomial();
-double _XcmsSine();
-double _XcmsArcTangent();
+/* forward/static */
+static double _XcmsModulo(double value, double base);
+static double _XcmsPolynomial(
+ register int order,
+ double const *coeffs,
+ double x);
+static double
+_XcmsModuloF(
+ double val,
+ register double *dp);
/*
* DEFINES
*/
-
#define XCMS_MAXERROR 0.000001
#define XCMS_MAXITER 10000
#define XCMS_PI 3.14159265358979323846264338327950
@@ -228,8 +225,7 @@ static double const sin_qcoeffs[] = {
*
*/
-double _XcmsCosine (x)
-double x;
+double _XcmsCosine(double x)
{
auto double y;
auto double yt2;
@@ -289,9 +285,7 @@ double x;
* Fred Fish
*
*/
-static double _XcmsModulo (value, base)
-double value;
-double base;
+static double _XcmsModulo(double value, double base)
{
auto double intpart;
@@ -312,9 +306,9 @@ double base;
* defined in "math.h".
*/
static double
-_XcmsModuloF(val, dp)
-double val;
-register double *dp;
+_XcmsModuloF(
+ double val,
+ register double *dp)
{
register double abs;
/*
@@ -377,10 +371,10 @@ register double *dp;
*
*/
-static double _XcmsPolynomial (order, coeffs, x)
-register int order;
-double const *coeffs;
-double x;
+static double _XcmsPolynomial(
+ register int order,
+ double const *coeffs,
+ double x)
{
auto double rtn_value;
diff --git a/src/xcms/uvY.c b/src/xcms/uvY.c
index a0509f3..b90ff68 100644
--- a/src/xcms/uvY.c
+++ b/src/xcms/uvY.c
@@ -35,33 +35,20 @@
* DOCUMENTATION
* "TekColor Color Management System, System Implementor's Manual"
*/
-/* $XFree86: xc/lib/X11/uvY.c,v 1.3 2001/01/17 19:41:57 dawes Exp $ */
+/* $XFree86: xc/lib/X11/uvY.c,v 1.4 2003/04/13 19:22:22 dawes Exp $ */
#include <X11/Xos.h>
#include "Xlibint.h"
#include "Xcmsint.h"
+#include "Cv.h"
#include <stdio.h>
-
-/*
- * EXTERNS
- */
-extern char _XcmsCIEuvY_prefix[];
-
-/* CvCols.c */
-extern Status _XcmsDIConvertColors();
-
-/* XYZ.c */
-extern Status _XcmsCIEXYZ_ValidSpec();
-
-
/*
* FORWARD DECLARATIONS
*/
+static int CIEuvY_ParseString(register char *spec, XcmsColor *pColor);
-static int CIEuvY_ParseString();
-Status _XcmsCIEuvY_ValidSpec();
/*
* DEFINES
* Internal definitions that need NOT be exported to any package
@@ -127,9 +114,9 @@ XcmsColorSpace XcmsCIEuvYColorSpace =
* SYNOPSIS
*/
static int
-CIEuvY_ParseString(spec, pColor)
- register char *spec;
- XcmsColor *pColor;
+CIEuvY_ParseString(
+ register char *spec,
+ XcmsColor *pColor)
/*
* DESCRIPTION
* This routines takes a string and attempts to convert
@@ -190,8 +177,8 @@ CIEuvY_ParseString(spec, pColor)
* SYNOPSIS
*/
Status
-_XcmsCIEuvY_ValidSpec(pColor)
- XcmsColor *pColor;
+_XcmsCIEuvY_ValidSpec(
+ XcmsColor *pColor)
/*
* DESCRIPTION
* Checks if color specification valid for CIE u'v'Y.
diff --git a/src/xcms/xyY.c b/src/xcms/xyY.c
index 7b1b773..8619c27 100644
--- a/src/xcms/xyY.c
+++ b/src/xcms/xyY.c
@@ -34,12 +34,13 @@
* DOCUMENTATION
* "TekColor Color Management System, System Implementor's Manual"
*/
-/* $XFree86: xc/lib/X11/xyY.c,v 1.3 2001/01/17 19:41:57 dawes Exp $ */
+/* $XFree86: xc/lib/X11/xyY.c,v 1.4 2003/04/13 19:22:22 dawes Exp $ */
#include <stdio.h>
#include <X11/Xos.h>
#include "Xlibint.h"
#include "Xcmsint.h"
+#include "Cv.h"
/*
* DEFINES
@@ -52,23 +53,11 @@
#endif
/*
- * EXTERNS
- */
-
-extern char _XcmsCIExyY_prefix[];
-
-/* CvCols.c */
-extern Status _XcmsDIConvertColors();
-
-/* XYZ.c */
-extern Status _XcmsCIEXYZ_ValidSpec();
-
-/*
* FORWARD DECLARATIONS
*/
-static int CIExyY_ParseString();
-static Status XcmsCIExyY_ValidSpec();
+static int CIExyY_ParseString(register char *spec, XcmsColor *pColor);
+static Status XcmsCIExyY_ValidSpec(XcmsColor *pColor);
/*
@@ -124,9 +113,9 @@ XcmsColorSpace XcmsCIExyYColorSpace =
* SYNOPSIS
*/
static int
-CIExyY_ParseString(spec, pColor)
- register char *spec;
- XcmsColor *pColor;
+CIExyY_ParseString(
+ register char *spec,
+ XcmsColor *pColor)
/*
* DESCRIPTION
* This routines takes a string and attempts to convert
@@ -188,8 +177,8 @@ CIExyY_ParseString(spec, pColor)
* SYNOPSIS
*/
static Status
-XcmsCIExyY_ValidSpec(pColor)
- XcmsColor *pColor;
+XcmsCIExyY_ValidSpec(
+ XcmsColor *pColor)
/*
* DESCRIPTION
* Checks a valid CIExyY color specification.
diff --git a/src/xkb/XKB.c b/src/xkb/XKB.c
index b407bcc..8f81695 100644
--- a/src/xkb/XKB.c
+++ b/src/xkb/XKB.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/XKB.c,v 1.7 2002/12/10 04:30:39 dawes Exp $ */
+/* $XFree86: xc/lib/X11/XKB.c,v 1.10 2003/11/17 22:20:09 dawes Exp $ */
#include <stdio.h>
#define NEED_REPLIES
@@ -37,23 +37,12 @@ XkbInternAtomFunc _XkbInternAtomFunc= XInternAtom;
XkbGetAtomNameFunc _XkbGetAtomNameFunc= XGetAtomName;
Bool
-#if NeedFunctionPrototypes
XkbQueryExtension( Display *dpy,
int * opcodeReturn,
int * eventBaseReturn,
int * errorBaseReturn,
int * majorReturn,
int * minorReturn)
-#else
-XkbQueryExtension(dpy,opcodeReturn,eventBaseReturn,errorBaseReturn,
- majorReturn,minorReturn)
- Display *dpy;
- int *opcodeReturn;
- int *eventBaseReturn;
- int *errorBaseReturn;
- int *majorReturn;
- int *minorReturn;
-#endif
{
if (!XkbUseExtension(dpy,majorReturn,minorReturn))
return False;
@@ -71,13 +60,7 @@ XkbQueryExtension(dpy,opcodeReturn,eventBaseReturn,errorBaseReturn,
}
Bool
-#if NeedFunctionPrototypes
XkbLibraryVersion(int *libMajorRtrn,int *libMinorRtrn)
-#else
-XkbLibraryVersion(libMajorRtrn,libMinorRtrn)
- int *libMajorRtrn;
- int *libMinorRtrn;
-#endif
{
int supported;
@@ -97,18 +80,10 @@ int supported;
}
Bool
-#if NeedFunctionPrototypes
XkbSelectEvents( Display * dpy,
unsigned int deviceSpec,
unsigned int affect,
unsigned int selectAll)
-#else
-XkbSelectEvents(dpy,deviceSpec,affect,selectAll)
- Display *dpy;
- unsigned int deviceSpec;
- unsigned int affect;
- unsigned int selectAll;
-#endif
{
register xkbSelectEventsReq *req;
XkbInfoPtr xkbi;
@@ -155,20 +130,11 @@ XkbSelectEvents(dpy,deviceSpec,affect,selectAll)
}
Bool
-#if NeedFunctionPrototypes
XkbSelectEventDetails( Display * dpy,
unsigned deviceSpec,
unsigned eventType,
unsigned long int affect,
unsigned long int details)
-#else
-XkbSelectEventDetails(dpy,deviceSpec,eventType,affect,details)
- Display *dpy;
- unsigned deviceSpec;
- unsigned eventType;
- unsigned long int affect;
- unsigned long int details;
-#endif
{
register xkbSelectEventsReq *req;
XkbInfoPtr xkbi;
@@ -256,18 +222,10 @@ XkbSelectEventDetails(dpy,deviceSpec,eventType,affect,details)
}
Bool
-#if NeedFunctionPrototypes
XkbLockModifiers( Display * dpy,
unsigned int deviceSpec,
unsigned int affect,
unsigned int values)
-#else
-XkbLockModifiers(dpy,deviceSpec,affect,values)
- Display *dpy;
- unsigned int deviceSpec;
- unsigned int affect;
- unsigned int values;
-#endif
{
register xkbLatchLockStateReq *req;
XkbInfoPtr xkbi;
@@ -295,18 +253,10 @@ XkbLockModifiers(dpy,deviceSpec,affect,values)
}
Bool
-#if NeedFunctionPrototypes
XkbLatchModifiers( Display * dpy,
unsigned int deviceSpec,
unsigned int affect,
unsigned int values)
-#else
-XkbLatchModifiers(dpy,deviceSpec,affect,values)
- Display *dpy;
- unsigned int deviceSpec;
- unsigned int affect;
- unsigned int values;
-#endif
{
register xkbLatchLockStateReq *req;
XkbInfoPtr xkbi;
@@ -336,14 +286,7 @@ XkbLatchModifiers(dpy,deviceSpec,affect,values)
}
Bool
-#if NeedFunctionPrototypes
XkbLockGroup(Display *dpy,unsigned int deviceSpec,unsigned int group)
-#else
-XkbLockGroup(dpy,deviceSpec,group)
- Display *dpy;
- unsigned int deviceSpec;
- unsigned int group;
-#endif
{
register xkbLatchLockStateReq *req;
XkbInfoPtr xkbi;
@@ -371,14 +314,7 @@ XkbLockGroup(dpy,deviceSpec,group)
}
Bool
-#if NeedFunctionPrototypes
XkbLatchGroup(Display *dpy,unsigned int deviceSpec,unsigned int group)
-#else
-XkbLatchGroup(dpy,deviceSpec,group)
- Display *dpy;
- unsigned int deviceSpec;
- unsigned int group;
-#endif
{
register xkbLatchLockStateReq *req;
XkbInfoPtr xkbi;
@@ -408,14 +344,7 @@ XkbLatchGroup(dpy,deviceSpec,group)
}
unsigned
-#if NeedFunctionPrototypes
XkbSetXlibControls(Display *dpy,unsigned affect,unsigned values)
-#else
-XkbSetXlibControls(dpy,affect,values)
- Display * dpy;
- unsigned affect;
- unsigned values;
-#endif
{
if (!dpy->xkb_info)
XkbUseExtension(dpy,NULL,NULL);
@@ -428,12 +357,7 @@ XkbSetXlibControls(dpy,affect,values)
}
unsigned
-#if NeedFunctionPrototypes
XkbGetXlibControls(Display *dpy)
-#else
-XkbGetXlibControls(dpy)
- Display * dpy;
-#endif
{
if (!dpy->xkb_info)
XkbUseExtension(dpy,NULL,NULL);
@@ -443,11 +367,7 @@ XkbGetXlibControls(dpy)
}
unsigned int
-#if NeedFunctionPrototypes
XkbXlibControlsImplemented(void)
-#else
-XkbXlibControlsImplemented()
-#endif
{
#ifdef __sgi
return XkbLC_AllControls;
@@ -457,7 +377,6 @@ XkbXlibControlsImplemented()
}
Bool
-#if NeedFunctionPrototypes
XkbSetDebuggingFlags( Display * dpy,
unsigned int mask,
unsigned int flags,
@@ -466,17 +385,6 @@ XkbSetDebuggingFlags( Display * dpy,
unsigned int ctrls,
unsigned int * rtrn_flags,
unsigned int * rtrn_ctrls)
-#else
-XkbSetDebuggingFlags(dpy,mask,flags,msg,ctrls_mask,ctrls,rtrn_flags,rtrn_ctrls)
- Display * dpy;
- unsigned int mask;
- unsigned int flags;
- char * msg;
- unsigned int ctrls_mask;
- unsigned int ctrls;
- unsigned int * rtrn_flags;
- unsigned int * rtrn_ctrls;
-#endif
{
register xkbSetDebuggingFlagsReq *req;
xkbSetDebuggingFlagsReply rep;
@@ -518,16 +426,9 @@ XkbSetDebuggingFlags(dpy,mask,flags,msg,ctrls_mask,ctrls,rtrn_flags,rtrn_ctrls)
}
Bool
-#if NeedFunctionPrototypes
XkbComputeEffectiveMap( XkbDescPtr xkb,
XkbKeyTypePtr type,
unsigned char * map_rtrn)
-#else
-XkbComputeEffectiveMap(xkb,type,map_rtrn)
- XkbDescPtr xkb;
- XkbKeyTypePtr type;
- unsigned char * map_rtrn;
-#endif
{
register int i;
unsigned tmp;
@@ -571,14 +472,7 @@ XkbKTMapEntryPtr entry = NULL;
}
Status
-#if NeedFunctionPrototypes
XkbGetState(Display *dpy,unsigned deviceSpec,XkbStatePtr rtrn)
-#else
-XkbGetState(dpy,deviceSpec,rtrn)
- Display * dpy;
- unsigned deviceSpec;
- XkbStatePtr rtrn;
-#endif
{
register xkbGetStateReq *req;
xkbGetStateReply rep;
@@ -618,14 +512,7 @@ XkbGetState(dpy,deviceSpec,rtrn)
}
Bool
-#if NeedFunctionPrototypes
XkbSetDetectableAutoRepeat(Display *dpy,Bool detectable,Bool *supported)
-#else
-XkbSetDetectableAutoRepeat(dpy,detectable,supported)
- Display * dpy;
- Bool detectable;
- Bool * supported;
-#endif
{
register xkbPerClientFlagsReq * req;
xkbPerClientFlagsReply rep;
@@ -658,13 +545,7 @@ XkbInfoPtr xkbi;
}
Bool
-#if NeedFunctionPrototypes
XkbGetDetectableAutoRepeat(Display *dpy,Bool *supported)
-#else
-XkbGetDetectableAutoRepeat(dpy,supported)
- Display * dpy;
- Bool * supported;
-#endif
{
register xkbPerClientFlagsReq * req;
xkbPerClientFlagsReply rep;
@@ -695,18 +576,10 @@ XkbInfoPtr xkbi;
}
Bool
-#if NeedFunctionPrototypes
XkbSetAutoResetControls( Display * dpy,
unsigned changes,
unsigned * auto_ctrls,
unsigned * auto_values)
-#else
-XkbSetAutoResetControls(dpy,changes,auto_ctrls,auto_values)
- Display * dpy;
- unsigned changes;
- unsigned * auto_ctrls;
- unsigned * auto_values;
-#endif
{
register xkbPerClientFlagsReq * req;
xkbPerClientFlagsReply rep;
@@ -739,16 +612,9 @@ XkbInfoPtr xkbi;
}
Bool
-#if NeedFunctionPrototypes
XkbGetAutoResetControls( Display * dpy,
unsigned * auto_ctrls,
unsigned * auto_ctrl_values)
-#else
-XkbGetAutoResetControls(dpy,auto_ctrls,auto_ctrl_values)
- Display * dpy;
- unsigned * auto_ctrls;
- unsigned * auto_ctrl_values;
-#endif
{
register xkbPerClientFlagsReq * req;
xkbPerClientFlagsReply rep;
@@ -781,16 +647,9 @@ XkbInfoPtr xkbi;
}
Bool
-#if NeedFunctionPrototypes
XkbSetPerClientControls( Display * dpy,
unsigned change,
unsigned * values)
-#else
-XkbSetPerClientControls(dpy,change,values)
- Display * dpy;
- unsigned change;
- unsigned * values;
-#endif
{
register xkbPerClientFlagsReq * req;
xkbPerClientFlagsReply rep;
@@ -822,14 +681,8 @@ unsigned value_hold = *values;
}
Bool
-#if NeedFunctionPrototypes
XkbGetPerClientControls( Display * dpy,
unsigned * ctrls)
-#else
-XkbGetPerClientControls(dpy,ctrls)
- Display * dpy;
- unsigned * ctrls;
-#endif
{
register xkbPerClientFlagsReq * req;
xkbPerClientFlagsReply rep;
@@ -863,22 +716,12 @@ XkbInfoPtr xkbi;
}
Display *
-#if NeedFunctionPrototypes
XkbOpenDisplay( char * name,
int * ev_rtrn,
int * err_rtrn,
int * major_rtrn,
int * minor_rtrn,
int * reason)
-#else
-XkbOpenDisplay(name,ev_rtrn,err_rtrn,major_rtrn,minor_rtrn,reason)
- char * name;
- int * ev_rtrn;
- int * err_rtrn;
- int * major_rtrn;
- int * minor_rtrn;
- int * reason;
-#endif
{
Display* dpy;
int major_num,minor_num;
@@ -917,13 +760,7 @@ XkbOpenDisplay(name,ev_rtrn,err_rtrn,major_rtrn,minor_rtrn,reason)
}
void
-#if NeedFunctionPrototypes
XkbSetAtomFuncs(XkbInternAtomFunc getAtom,XkbGetAtomNameFunc getName)
-#else
-XkbSetAtomFuncs(getAtom,getName)
- XkbInternAtomFunc getAtom;
- XkbGetAtomNameFunc getName;
-#endif
{
_XkbInternAtomFunc= (getAtom?getAtom:XInternAtom);
_XkbGetAtomNameFunc= (getName?getName:XGetAtomName);
diff --git a/src/xkb/XKBAlloc.c b/src/xkb/XKBAlloc.c
index c6fd855..5bc7f65 100644
--- a/src/xkb/XKBAlloc.c
+++ b/src/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/src/xkb/XKBBell.c b/src/xkb/XKBBell.c
index 3b6bb85..a1d4d5f 100644
--- a/src/xkb/XKBBell.c
+++ b/src/xkb/XKBBell.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/lib/X11/XKBBell.c,v 1.2 2003/11/17 22:20:09 dawes Exp $ */
#include <stdio.h>
#define NEED_REPLIES
@@ -34,7 +35,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
Bool
-#if NeedFunctionPrototypes
XkbDeviceBell( Display * dpy,
Window window,
int deviceID,
@@ -42,16 +42,6 @@ XkbDeviceBell( Display * dpy,
int bellID,
int percent,
Atom name)
-#else
-XkbDeviceBell(dpy,window,deviceID,bellClass,bellID,percent,name)
- Display *dpy;
- Window window;
- int deviceID;
- int bellClass;
- int bellID;
- int percent;
- Atom name;
-#endif
{
register xkbBellReq *req;
XkbInfoPtr xkbi;
@@ -81,20 +71,11 @@ XkbDeviceBell(dpy,window,deviceID,bellClass,bellID,percent,name)
}
Bool
-#if NeedFunctionPrototypes
XkbForceDeviceBell( Display * dpy,
int deviceID,
int bellClass,
int bellID,
int percent)
-#else
-XkbForceDeviceBell(dpy,deviceID,bellClass,bellID,percent)
- Display *dpy;
- int deviceID;
- int bellClass;
- int bellID;
- int percent;
-#endif
{
register xkbBellReq *req;
XkbInfoPtr xkbi;
@@ -124,7 +105,6 @@ XkbForceDeviceBell(dpy,deviceID,bellClass,bellID,percent)
}
Bool
-#if NeedFunctionPrototypes
XkbDeviceBellEvent( Display * dpy,
Window window,
int deviceID,
@@ -132,16 +112,6 @@ XkbDeviceBellEvent( Display * dpy,
int bellID,
int percent,
Atom name)
-#else
-XkbDeviceBellEvent(dpy,window,deviceID,bellClass,bellID,percent,name)
- Display *dpy;
- Window window;
- int deviceID;
- int bellClass;
- int bellID;
- int percent;
- Atom name;
-#endif
{
register xkbBellReq *req;
XkbInfoPtr xkbi;
@@ -171,15 +141,7 @@ XkbDeviceBellEvent(dpy,window,deviceID,bellClass,bellID,percent,name)
}
Bool
-#if NeedFunctionPrototypes
XkbBell(Display *dpy,Window window,int percent,Atom name)
-#else
-XkbBell(dpy,window,percent,name)
- Display *dpy;
- Window window;
- int percent;
- Atom name;
-#endif
{
if ((dpy->flags & XlibDisplayNoXkb) ||
(!dpy->xkb_info && !XkbUseExtension(dpy,NULL,NULL))) {
@@ -191,13 +153,7 @@ XkbBell(dpy,window,percent,name)
}
Bool
-#if NeedFunctionPrototypes
XkbForceBell(Display *dpy,int percent)
-#else
-XkbForceBell(dpy,percent)
- Display * dpy;
- int percent;
-#endif
{
if ((dpy->flags & XlibDisplayNoXkb) ||
(!dpy->xkb_info && !XkbUseExtension(dpy,NULL,NULL))) {
@@ -209,15 +165,7 @@ XkbForceBell(dpy,percent)
}
Bool
-#if NeedFunctionPrototypes
XkbBellEvent(Display *dpy,Window window,int percent,Atom name)
-#else
-XkbBellEvent(dpy,window,percent,name)
- Display *dpy;
- Window window;
- int percent;
- Atom name;
-#endif
{
if ((dpy->flags & XlibDisplayNoXkb) ||
(!dpy->xkb_info && !XkbUseExtension(dpy,NULL,NULL))) {
diff --git a/src/xkb/XKBBind.c b/src/xkb/XKBBind.c
index 138331d..7ab1f2d 100644
--- a/src/xkb/XKBBind.c
+++ b/src/xkb/XKBBind.c
@@ -26,11 +26,12 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/lib/X11/XKBBind.c,v 3.15 2003/02/15 17:49:01 dawes Exp $ */
+/* $XFree86: xc/lib/X11/XKBBind.c,v 3.20 2003/11/17 22:20:09 dawes Exp $ */
/* the new monsters ate the old ones */
#define NEED_EVENTS
+#include "XKBlib.h"
#include <X11/Xlibint.h>
#include <X11/Xutil.h>
#include <X11/keysym.h>
@@ -49,9 +50,7 @@ from The Open Group.
Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask)
static int _XkbLoadDpy(
-#if NeedFunctionPrototypes
Display *dpy
-#endif
);
struct _XKeytrans {
@@ -65,7 +64,6 @@ struct _XKeytrans {
};
KeySym
-#if NeedFunctionPrototypes
XkbKeycodeToKeysym(Display *dpy,
#if NeedWidePrototypes
unsigned int kc,
@@ -74,13 +72,6 @@ XkbKeycodeToKeysym(Display *dpy,
#endif
int group,
int level)
-#else
-XkbKeycodeToKeysym(dpy, kc, group, level)
- Display *dpy;
- KeyCode kc;
- int group;
- int level;
-#endif
{
XkbDescRec *xkb;
@@ -109,7 +100,6 @@ XkbKeycodeToKeysym(dpy, kc, group, level)
}
KeySym
-#if NeedFunctionPrototypes
XKeycodeToKeysym(Display *dpy,
#if NeedWidePrototypes
unsigned int kc,
@@ -117,12 +107,6 @@ XKeycodeToKeysym(Display *dpy,
KeyCode kc,
#endif
int col)
-#else
-XKeycodeToKeysym(dpy, kc, col)
- Display *dpy;
- KeyCode kc;
- int col;
-#endif
{
XkbDescRec *xkb;
@@ -167,13 +151,7 @@ XKeycodeToKeysym(dpy, kc, col)
}
KeyCode
-#if NeedFunctionPrototypes
XKeysymToKeycode(Display *dpy, KeySym ks)
-#else
-XKeysymToKeycode(dpy, ks)
- Display *dpy;
- KeySym ks;
-#endif
{
register int i, j, gotOne;
@@ -198,12 +176,7 @@ XKeysymToKeycode(dpy, ks)
}
static int
-#if NeedFunctionPrototypes
_XkbComputeModmap(Display *dpy)
-#else
-_XkbComputeModmap(dpy)
- Display *dpy;
-#endif
{
register XkbDescPtr xkb;
@@ -214,13 +187,7 @@ register XkbDescPtr xkb;
}
unsigned
-#if NeedFunctionPrototypes
XkbKeysymToModifiers(Display *dpy,KeySym ks)
-#else
-XkbKeysymToModifiers(dpy,ks)
- Display *dpy;
- KeySym ks;
-#endif
{
XkbDescRec *xkb;
register int i,j;
@@ -249,13 +216,7 @@ XkbKeysymToModifiers(dpy,ks)
}
KeySym
-#if NeedFunctionPrototypes
XLookupKeysym(register XKeyEvent *event, int col)
-#else
-XLookupKeysym(event, col)
- register XKeyEvent *event;
- int col;
-#endif
{
Display *dpy = event->display;
if (_XkbUnavailable(dpy))
@@ -270,39 +231,27 @@ XLookupKeysym(event, col)
* version will continue to work in a shared library environment.
*/
int
-#if NeedFunctionPrototypes
+XkbTranslateKey( register Display * dpy,
+ KeyCode key,
+ register unsigned int mods,
+ unsigned int * mods_rtrn,
+ KeySym * keysym_rtrn);
+int
XkbTranslateKey( register Display * dpy,
KeyCode key,
register unsigned int mods,
unsigned int * mods_rtrn,
KeySym * keysym_rtrn)
-#else
-XkbTranslateKey(dpy, key, mods, mods_rtrn, keysym_rtrn)
- register Display *dpy;
- KeyCode key;
- register unsigned int mods;
- unsigned int *mods_rtrn;
- KeySym *keysym_rtrn;
-#endif
{
return XkbLookupKeySym(dpy,key,mods,mods_rtrn,keysym_rtrn);
}
Bool
-#if NeedFunctionPrototypes
XkbLookupKeySym( register Display * dpy,
KeyCode key,
register unsigned int mods,
unsigned int * mods_rtrn,
KeySym * keysym_rtrn)
-#else
-XkbLookupKeySym(dpy, key, mods, mods_rtrn, keysym_rtrn)
- register Display *dpy;
- KeyCode key;
- register unsigned int mods;
- unsigned int *mods_rtrn;
- KeySym *keysym_rtrn;
-#endif
{
if (_XkbUnavailable(dpy))
return _XTranslateKey(dpy, key, mods, mods_rtrn, keysym_rtrn);
@@ -312,20 +261,11 @@ XkbLookupKeySym(dpy, key, mods, mods_rtrn, keysym_rtrn)
}
Bool
-#if NeedFunctionPrototypes
XkbTranslateKeyCode( register XkbDescPtr xkb,
KeyCode key,
register unsigned int mods,
unsigned int * mods_rtrn,
KeySym * keysym_rtrn)
-#else
-XkbTranslateKeyCode(xkb, key, mods, mods_rtrn, keysym_rtrn)
- register XkbDescPtr xkb;
- KeyCode key;
- register unsigned int mods;
- unsigned int *mods_rtrn;
- KeySym *keysym_rtrn;
-#endif
{
XkbKeyTypeRec *type;
int col,nKeyGroups;
@@ -400,12 +340,7 @@ XkbTranslateKeyCode(xkb, key, mods, mods_rtrn, keysym_rtrn)
}
Status
-#if NeedFunctionPrototypes
XkbRefreshKeyboardMapping(register XkbMapNotifyEvent *event)
-#else
-XkbRefreshKeyboardMapping(event)
- register XkbMapNotifyEvent *event;
-#endif
{
Display *dpy = event->display;
XkbInfoPtr xkbi;
@@ -448,12 +383,7 @@ XkbRefreshKeyboardMapping(event)
}
int
-#if NeedFunctionPrototypes
XRefreshKeyboardMapping(register XMappingEvent *event)
-#else
-XRefreshKeyboardMapping(event)
- register XMappingEvent *event;
-#endif
{
XkbEvent *xkbevent = (XkbEvent *)event;
Display *dpy = event->display;
@@ -537,6 +467,7 @@ XRefreshKeyboardMapping(event)
UnlockDisplay(dpy);
}
if (event->request==MappingModifier) {
+ LockDisplay(dpy);
if (xkbi->desc->map->modmap) {
_XkbFree(xkbi->desc->map->modmap);
xkbi->desc->map->modmap= NULL;
@@ -561,12 +492,7 @@ XRefreshKeyboardMapping(event)
}
static int
-#if NeedFunctionPrototypes
_XkbLoadDpy(Display *dpy)
-#else
-_XkbLoadDpy(dpy)
- Display *dpy;
-#endif
{
XkbInfoPtr xkbi;
unsigned query,oldEvents;
@@ -603,12 +529,7 @@ _XkbLoadDpy(dpy)
}
void
-#if NeedFunctionPrototypes
_XkbReloadDpy(Display *dpy)
-#else
-_XkbReloadDpy(dpy)
- Display *dpy;
-#endif
{
XkbInfoPtr xkbi;
XkbDescRec *desc;
@@ -651,22 +572,12 @@ _XkbReloadDpy(dpy)
}
int
-#if NeedFunctionPrototypes
XkbTranslateKeySym( register Display * dpy,
register KeySym * sym_rtrn,
unsigned int mods,
char * buffer,
int nbytes,
int * extra_rtrn)
-#else
-XkbTranslateKeySym(dpy, sym_rtrn, mods, buffer, nbytes, extra_rtrn)
- register Display *dpy;
- register KeySym *sym_rtrn;
- unsigned int mods;
- char *buffer;
- int nbytes;
- int *extra_rtrn;
-#endif
{
register XkbInfoPtr xkb;
XkbKSToMBFunc cvtr;
@@ -740,34 +651,54 @@ XkbTranslateKeySym(dpy, sym_rtrn, mods, buffer, nbytes, extra_rtrn)
}
int
-#if NeedFunctionPrototypes
XLookupString ( register XKeyEvent * event,
char * buffer,
int nbytes,
KeySym * keysym,
XComposeStatus * status)
-#else
-XLookupString (event, buffer, nbytes, keysym, status)
- register XKeyEvent *event;
- char *buffer; /* buffer */
- int nbytes; /* space in buffer for characters */
- KeySym *keysym;
- XComposeStatus *status;
-#endif
{
KeySym dummy;
int rtrnLen;
unsigned int new_mods;
Display *dpy = event->display;
- XkbDescPtr xkb;
if (keysym==NULL)
keysym= &dummy;
- xkb= dpy->xkb_info->desc;
if (!XkbLookupKeySym(dpy,event->keycode,event->state, &new_mods,keysym))
return 0;
new_mods= (event->state&(~new_mods));
+ /* find the group where a symbol can be converted to control one */
+ if (new_mods&ControlMask && *keysym > 0x7F &&
+ (dpy->xkb_info->xlib_ctrls & XkbLC_ControlFallback)) {
+ XKeyEvent tmp_ev = *event;
+ KeySym tmp_keysym;
+ unsigned int tmp_new_mods;
+ if (_XkbUnavailable(dpy)) {
+ tmp_ev.state= event->state ^ dpy->mode_switch;
+ if (XkbLookupKeySym(dpy, tmp_ev.keycode, tmp_ev.state,
+ &tmp_new_mods, &tmp_keysym) &&
+ tmp_keysym != NoSymbol && tmp_keysym < 0x80 ) {
+ *keysym = tmp_keysym;
+ }
+ } else {
+ int n = XkbKeyNumGroups(dpy->xkb_info->desc, tmp_ev.keycode);
+ int i;
+ for (i = 0; i < n; i++) {
+ if (XkbGroupForCoreState(event->state) == i)
+ continue;
+ tmp_ev.state= XkbBuildCoreState(tmp_ev.state, i);
+ if (XkbLookupKeySym(dpy, tmp_ev.keycode, tmp_ev.state,
+ &tmp_new_mods, &tmp_keysym) &&
+ tmp_keysym != NoSymbol && tmp_keysym < 0x80 ) {
+ *keysym = tmp_keysym;
+ new_mods= (event->state&(~tmp_new_mods));
+ break;
+ }
+ }
+ }
+ }
+
#ifdef USE_OWN_COMPOSE
if ( status ) {
static int been_here= 0;
@@ -873,47 +804,17 @@ XLookupString (event, buffer, nbytes, keysym, status)
if (rtrnLen>0)
return rtrnLen;
- rtrnLen = XkbTranslateKeySym(dpy,keysym,new_mods,buffer,nbytes,NULL);
-
- if ((event->state&ControlMask)&&(nbytes>0)&&
- ((rtrnLen==0)||
- ((rtrnLen==1)&&((unsigned char) buffer[0]>=' ')))&&
- (dpy->xkb_info->xlib_ctrls&XkbLC_ControlFallback)) {
- XKeyEvent tmp_ev;
- tmp_ev= *event;
- if (_XkbUnavailable(dpy)) {
- if (event->state & dpy->mode_switch) {
- tmp_ev.state= event->state & ~dpy->mode_switch;
- return XLookupString (&tmp_ev, buffer, nbytes, keysym, status);
- }
- } else {
- if (XkbGroupForCoreState(event->state) != XkbGroup1Index) {
- tmp_ev.state= XkbBuildCoreState(event->state,XkbGroup1Index);
- return XLookupString (&tmp_ev, buffer, nbytes, keysym, status);
- }
- }
- }
- return rtrnLen;
+ return XkbTranslateKeySym(dpy,keysym,new_mods,buffer,nbytes,NULL);
}
int
-#if NeedFunctionPrototypes
XkbLookupKeyBinding( Display * dpy,
register KeySym sym,
unsigned int mods,
char * buffer,
int nbytes,
int * extra_rtrn)
-#else
-XkbLookupKeyBinding(dpy, sym, mods, buffer, nbytes, extra_rtrn)
- Display *dpy;
- register KeySym sym;
- unsigned int mods;
- char *buffer;
- int nbytes;
- int * extra_rtrn;
-#endif
{
register struct _XKeytrans *p;
@@ -936,12 +837,7 @@ XkbLookupKeyBinding(dpy, sym, mods, buffer, nbytes, extra_rtrn)
}
char
-#if NeedFunctionPrototypes
XkbToControl( char ch )
-#else
-XkbToControl( ch )
- char ch;
-#endif
{
register char c = ch;
diff --git a/src/xkb/XKBCompat.c b/src/xkb/XKBCompat.c
index 73c7d76..9a0b8ec 100644
--- a/src/xkb/XKBCompat.c
+++ b/src/xkb/XKBCompat.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/lib/X11/XKBCompat.c,v 3.2 2003/11/17 22:20:09 dawes Exp $ */
#include <stdio.h>
#define NEED_REPLIES
@@ -34,18 +35,10 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "XKBlibint.h"
Status
-#if NeedFunctionPrototypes
_XkbReadGetCompatMapReply( Display * dpy,
xkbGetCompatMapReply * rep,
XkbDescPtr xkb,
int * nread_rtrn)
-#else
-_XkbReadGetCompatMapReply(dpy,rep,xkb,nread_rtrn)
- Display * dpy;
- xkbGetCompatMapReply * rep;
- XkbDescPtr xkb;
- int * nread_rtrn;
-#endif
{
register int i;
XkbReadBufferRec buf;
@@ -114,14 +107,7 @@ BAILOUT:
}
Status
-#if NeedFunctionPrototypes
XkbGetCompatMap(Display *dpy,unsigned which,XkbDescPtr xkb)
-#else
-XkbGetCompatMap(dpy,which,xkb)
- Display * dpy;
- unsigned which;
- XkbDescPtr xkb;
-#endif
{
register xkbGetCompatMapReq *req;
xkbGetCompatMapReply rep;
@@ -164,14 +150,7 @@ XkbGetCompatMap(dpy,which,xkb)
}
static Bool
-#if NeedFunctionPrototypes
_XkbWriteSetCompatMap(Display *dpy,xkbSetCompatMapReq *req,XkbDescPtr xkb)
-#else
-_XkbWriteSetCompatMap(dpy,req,xkb)
- Display * dpy;
- xkbSetCompatMapReq *req;
- XkbDescPtr xkb;
-#endif
{
CARD16 firstSI;
CARD16 nSI;
@@ -229,15 +208,7 @@ char * buf;
}
Bool
-#if NeedFunctionPrototypes
XkbSetCompatMap(Display *dpy,unsigned which,XkbDescPtr xkb,Bool updateActions)
-#else
-XkbSetCompatMap(dpy,which,xkb,updateActions)
- Display * dpy;
- unsigned which;
- XkbDescPtr xkb;
- Bool updateActions;
-#endif
{
register xkbSetCompatMapReq *req;
Status ok;
diff --git a/src/xkb/XKBCtrls.c b/src/xkb/XKBCtrls.c
index de5ce36..485adc3 100644
--- a/src/xkb/XKBCtrls.c
+++ b/src/xkb/XKBCtrls.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/XKBCtrls.c,v 1.4 2002/12/10 04:33:48 dawes Exp $ */
+/* $XFree86: xc/lib/X11/XKBCtrls.c,v 1.5 2003/11/17 22:20:09 dawes Exp $ */
#include <stdio.h>
#define NEED_REPLIES
@@ -35,14 +35,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
static xkbSetControlsReq *
-#if NeedFunctionPrototypes
_XkbGetSetControlsReq(Display *dpy,XkbInfoPtr xkbi,unsigned int deviceSpec)
-#else
-_XkbGetSetControlsReq(dpy,xkbi,deviceSpec)
- Display * dpy;
- XkbInfoPtr xkbi;
- unsigned int deviceSpec;
-#endif
{
xkbSetControlsReq *req;
@@ -56,18 +49,10 @@ xkbSetControlsReq *req;
}
Bool
-#if NeedFunctionPrototypes
XkbSetAutoRepeatRate( Display *dpy,
unsigned int deviceSpec,
unsigned int timeout,
unsigned int interval)
-#else
-XkbSetAutoRepeatRate(dpy, deviceSpec, timeout, interval)
- Display *dpy;
- unsigned int deviceSpec;
- unsigned int timeout;
- unsigned int interval;
-#endif
{
register xkbSetControlsReq *req;
@@ -85,18 +70,10 @@ XkbSetAutoRepeatRate(dpy, deviceSpec, timeout, interval)
}
Bool
-#if NeedFunctionPrototypes
XkbGetAutoRepeatRate( Display * dpy,
unsigned int deviceSpec,
unsigned int * timeoutp,
unsigned int * intervalp)
-#else
-XkbGetAutoRepeatRate(dpy, deviceSpec, timeoutp, intervalp)
- Display *dpy;
- unsigned int deviceSpec;
- unsigned int *timeoutp;
- unsigned int *intervalp;
-#endif
{
register xkbGetControlsReq *req;
xkbGetControlsReply rep;
@@ -125,23 +102,12 @@ XkbGetAutoRepeatRate(dpy, deviceSpec, timeoutp, intervalp)
}
Bool
-#if NeedFunctionPrototypes
XkbSetServerInternalMods( Display * dpy,
unsigned deviceSpec,
unsigned affectReal,
unsigned realValues,
unsigned affectVirtual,
unsigned virtualValues)
-#else
-XkbSetServerInternalMods(dpy,deviceSpec,
- affectReal,realValues,affectVirtual,virtualValues)
- Display *dpy;
- unsigned deviceSpec;
- unsigned affectReal;
- unsigned realValues;
- unsigned affectVirtual;
- unsigned virtualValues;
-#endif
{
register xkbSetControlsReq *req;
@@ -161,23 +127,12 @@ XkbSetServerInternalMods(dpy,deviceSpec,
}
Bool
-#if NeedFunctionPrototypes
XkbSetIgnoreLockMods( Display * dpy,
unsigned int deviceSpec,
unsigned affectReal,
unsigned realValues,
unsigned affectVirtual,
unsigned virtualValues)
-#else
-XkbSetIgnoreLockMods(dpy,deviceSpec,
- affectReal,realValues,affectVirtual,virtualValues)
- Display *dpy;
- unsigned int deviceSpec;
- unsigned affectReal;
- unsigned realValues;
- unsigned affectVirtual;
- unsigned virtualValues;
-#endif
{
register xkbSetControlsReq *req;
@@ -197,18 +152,10 @@ XkbSetIgnoreLockMods(dpy,deviceSpec,
}
Bool
-#if NeedFunctionPrototypes
XkbChangeEnabledControls( Display * dpy,
unsigned deviceSpec,
unsigned affect,
unsigned values)
-#else
-XkbChangeEnabledControls(dpy,deviceSpec,affect,values)
- Display * dpy;
- unsigned deviceSpec;
- unsigned affect;
- unsigned values;
-#endif
{
register xkbSetControlsReq *req;
@@ -226,14 +173,7 @@ XkbChangeEnabledControls(dpy,deviceSpec,affect,values)
}
Status
-#if NeedFunctionPrototypes
XkbGetControls(Display *dpy, unsigned long which, XkbDescPtr xkb)
-#else
-XkbGetControls(dpy, which, xkb)
- Display *dpy;
- unsigned long which;
- XkbDescPtr xkb;
-#endif
{
register xkbGetControlsReq *req;
xkbGetControlsReply rep;
@@ -329,14 +269,7 @@ XkbGetControls(dpy, which, xkb)
}
Bool
-#if NeedFunctionPrototypes
XkbSetControls(Display *dpy, unsigned long which, XkbDescPtr xkb)
-#else
-XkbSetControls(dpy, which, xkb)
- Display * dpy;
- unsigned long which;
- XkbDescPtr xkb;
-#endif
{
register xkbSetControlsReq *req;
XkbControlsPtr ctrls;
@@ -408,16 +341,9 @@ XkbSetControls(dpy, which, xkb)
/***====================================================================***/
void
-#if NeedFunctionPrototypes
XkbNoteControlsChanges( XkbControlsChangesPtr old,
XkbControlsNotifyEvent * new,
unsigned int wanted)
-#else
-XkbNoteControlsChanges(old,new,wanted)
- XkbControlsChangesPtr old;
- XkbControlsNotifyEvent * new;
- unsigned int wanted;
-#endif
{
old->changed_ctrls|= (new->changed_ctrls&wanted);
if (new->changed_ctrls&XkbControlsEnabledMask&wanted)
diff --git a/src/xkb/XKBCvt.c b/src/xkb/XKBCvt.c
index c1a64dc..aa2af39 100644
--- a/src/xkb/XKBCvt.c
+++ b/src/xkb/XKBCvt.c
@@ -26,7 +26,7 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/lib/X11/XKBCvt.c,v 3.34 2002/10/08 23:31:35 dawes Exp $ */
+/* $XFree86: xc/lib/X11/XKBCvt.c,v 3.35 2003/11/17 22:20:09 dawes Exp $ */
#include <stdio.h>
#include <sys/types.h>
@@ -55,15 +55,7 @@ from The Open Group.
#endif
static int
-#if NeedFunctionPrototypes
_XkbHandleSpecialSym(KeySym keysym, char *buffer, int nbytes, int *extra_rtrn)
-#else
-_XkbHandleSpecialSym(keysym, buffer, nbytes, extra_rtrn)
- KeySym keysym;
- char *buffer;
- int nbytes;
- int * extra_rtrn;
-#endif
{
/* try to convert to Latin-1, handling ctrl */
@@ -92,20 +84,11 @@ _XkbHandleSpecialSym(keysym, buffer, nbytes, extra_rtrn)
/*ARGSUSED*/
static int
-#if NeedFunctionPrototypes
_XkbKSToKnownSet ( XPointer priv,
KeySym keysym,
char * buffer,
int nbytes,
int * extra_rtrn)
-#else
-_XkbKSToKnownSet (priv, keysym, buffer, nbytes, extra_rtrn)
- XPointer priv;
- KeySym keysym;
- char *buffer;
- int nbytes;
- int *extra_rtrn;
-#endif
{
char tbuf[8],*buf;
@@ -152,15 +135,7 @@ typedef struct _XkbToKS {
/*ARGSUSED*/
static KeySym
-#if NeedFunctionPrototypes
_XkbKnownSetToKS(XPointer priv,char *buffer,int nbytes,Status *status)
-#else
-_XkbKnownSetToKS(priv,buffer,nbytes,status)
- XPointer priv;
- char *buffer;
- int nbytes;
- Status *status;
-#endif
{
if (nbytes!=1)
return NoSymbol;
@@ -178,12 +153,7 @@ _XkbKnownSetToKS(priv,buffer,nbytes,status)
}
static KeySym
-#if NeedFunctionPrototypes
__XkbDefaultToUpper(KeySym sym)
-#else
-__XkbDefaultToUpper(sym)
- KeySym sym;
-#endif
{
KeySym lower,upper;
@@ -193,12 +163,7 @@ __XkbDefaultToUpper(sym)
#ifdef XKB_EXTEND_LOOKUP_STRING
static int
-#if NeedFunctionPrototypes
Strcmp(char *str1, char *str2)
-#else
-Strcmp(str1, str2)
- char *str1, *str2;
-#endif
{
char str[256];
char c, *s;
@@ -221,13 +186,7 @@ Strcmp(str1, str2)
#endif
int
-#if NeedFunctionPrototypes
_XkbGetConverters(char *encoding_name, XkbConverters *cvt_rtrn)
-#else
-_XkbGetConverters(encoding_name, cvt_rtrn)
- char *encoding_name;
- XkbConverters *cvt_rtrn;
-#endif
{
if ( !cvt_rtrn ) return 0;
diff --git a/src/xkb/XKBExtDev.c b/src/xkb/XKBExtDev.c
index b208199..9562c50 100644
--- a/src/xkb/XKBExtDev.c
+++ b/src/xkb/XKBExtDev.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/XKBExtDev.c,v 3.4 2001/10/28 03:32:33 tsi Exp $ */
+/* $XFree86: xc/lib/X11/XKBExtDev.c,v 3.5 2003/11/17 22:20:09 dawes Exp $ */
#include <stdio.h>
#define NEED_REPLIES
@@ -38,16 +38,9 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
/***====================================================================***/
extern void
-#if NeedFunctionPrototypes
XkbNoteDeviceChanges( XkbDeviceChangesPtr old,
XkbExtensionDeviceNotifyEvent * new,
unsigned int wanted)
-#else
-XkbNoteDeviceChanges(old,new,wanted)
- XkbDeviceChangesPtr old;
- XkbExtensionDeviceNotifyEvent * new;
- unsigned int wanted;
-#endif
{
if ((!old)||(!new)||(!wanted)||((new->reason&wanted)==0))
return;
@@ -114,16 +107,9 @@ XkbNoteDeviceChanges(old,new,wanted)
/***====================================================================***/
static Status
-#if NeedFunctionPrototypes
_XkbReadDeviceLedInfo( XkbReadBufferPtr buf,
unsigned present,
XkbDeviceInfoPtr devi)
-#else
-_XkbReadDeviceLedInfo(buf,present,devi)
- XkbReadBufferPtr buf;
- unsigned present;
- XkbDeviceInfoPtr devi;
-#endif
{
register unsigned i,bit;
XkbDeviceLedInfoPtr devli;
@@ -179,16 +165,9 @@ xkbDeviceLedsWireDesc * wireli;
}
static Status
-#if NeedFunctionPrototypes
_XkbReadGetDeviceInfoReply( Display * dpy,
xkbGetDeviceInfoReply * rep,
XkbDeviceInfoPtr devi)
-#else
-_XkbReadGetDeviceInfoReply(dpy,rep,devi)
- Display * dpy;
- xkbGetDeviceInfoReply * rep;
- XkbDeviceInfoPtr devi;
-#endif
{
XkbReadBufferRec buf;
XkbAction * act;
@@ -236,20 +215,11 @@ BAILOUT:
}
XkbDeviceInfoPtr
-#if NeedFunctionPrototypes
XkbGetDeviceInfo( Display * dpy,
unsigned which,
unsigned deviceSpec,
unsigned class,
unsigned id)
-#else
-XkbGetDeviceInfo(dpy,which,deviceSpec,class,id)
- Display * dpy;
- unsigned which;
- unsigned deviceSpec;
- unsigned class;
- unsigned id;
-#endif
{
register xkbGetDeviceInfoReq * req;
xkbGetDeviceInfoReply rep;
@@ -294,16 +264,9 @@ XkbGetDeviceInfo(dpy,which,deviceSpec,class,id)
}
Status
-#if NeedFunctionPrototypes
XkbGetDeviceInfoChanges( Display * dpy,
XkbDeviceInfoPtr devi,
XkbDeviceChangesPtr changes)
-#else
-XkbGetDeviceInfoChanges(dpy,devi,changes)
- Display * dpy;
- XkbDeviceInfoPtr devi;
- XkbDeviceChangesPtr changes;
-#endif
{
register xkbGetDeviceInfoReq * req;
xkbGetDeviceInfoReply rep;
@@ -361,20 +324,11 @@ XkbGetDeviceInfoChanges(dpy,devi,changes)
}
Status
-#if NeedFunctionPrototypes
XkbGetDeviceButtonActions( Display * dpy,
XkbDeviceInfoPtr devi,
Bool all,
unsigned int first,
unsigned int num)
-#else
-XkbGetDeviceButtonActions(dpy,devi,all,first,num)
- Display * dpy;
- XkbDeviceInfoPtr devi;
- Bool all;
- unsigned int first;
- unsigned int num;
-#endif
{
register xkbGetDeviceInfoReq * req;
xkbGetDeviceInfoReply rep;
@@ -411,20 +365,11 @@ XkbGetDeviceButtonActions(dpy,devi,all,first,num)
}
Status
-#if NeedFunctionPrototypes
XkbGetDeviceLedInfo( Display * dpy,
XkbDeviceInfoPtr devi,
unsigned int ledClass,
unsigned int ledId,
unsigned int which)
-#else
-XkbGetDeviceLedInfo(dpy,devi,ledClass,ledId,which)
- Display * dpy;
- XkbDeviceInfoPtr devi;
- unsigned int ledClass;
- unsigned int ledId;
- unsigned int which;
-#endif
{
register xkbGetDeviceInfoReq * req;
xkbGetDeviceInfoReply rep;
@@ -478,14 +423,7 @@ typedef struct _SetLedStuff {
} SetLedStuff;
static void
-#if NeedFunctionPrototypes
_InitLedStuff(SetLedStuff *stuff,unsigned wanted,XkbDeviceInfoPtr devi)
-#else
-_InitLedStuff(stuff,wanted,devi)
- SetLedStuff * stuff;
- unsigned wanted;
- XkbDeviceInfoPtr devi;
-#endif
{
int i;
register XkbDeviceLedInfoPtr devli;
@@ -517,12 +455,7 @@ register XkbDeviceLedInfoPtr devli;
}
static void
-#if NeedFunctionPrototypes
_FreeLedStuff(SetLedStuff *stuff)
-#else
-_FreeLedStuff(stuff)
- SetLedStuff *stuff;
-#endif
{
if ((stuff->num_info>0)&&(stuff->info!=NULL))
_XkbFree(stuff->info);
@@ -531,13 +464,7 @@ _FreeLedStuff(stuff)
}
static int
-#if NeedFunctionPrototypes
_XkbSizeLedInfo(unsigned changed,XkbDeviceLedInfoPtr devli)
-#else
-_XkbSizeLedInfo(changed,devli)
- unsigned changed;
- XkbDeviceLedInfoPtr devli;
-#endif
{
register int i,size;
register unsigned bit,namesNeeded,mapsNeeded;
@@ -560,18 +487,10 @@ register unsigned bit,namesNeeded,mapsNeeded;
}
static Bool
-#if NeedFunctionPrototypes
_SizeMatches( SetLedStuff * stuff,
XkbDeviceLedChangesPtr changes,
int * sz_rtrn,
int * nleds_rtrn)
-#else
-_SizeMatches(stuff,changes,sz_rtrn,nleds_rtrn)
- SetLedStuff * stuff;
- XkbDeviceLedChangesPtr changes;
- int * sz_rtrn;
- int * nleds_rtrn;
-#endif
{
int i,nMatch,class,id;
LedInfoStuff * linfo;
@@ -613,20 +532,11 @@ Bool match;
static Status
-#if NeedFunctionPrototypes
_XkbSetDeviceInfoSize( XkbDeviceInfoPtr devi,
XkbDeviceChangesPtr changes,
SetLedStuff * stuff,
int * sz_rtrn,
int * num_leds_rtrn)
-#else
-_XkbSetDeviceInfoSize(devi,changes,stuff,sz_rtrn,num_leds_rtrn)
- XkbDeviceInfoPtr devi;
- XkbDeviceChangesPtr changes;
- SetLedStuff * stuff;
- int * sz_rtrn;
- int * num_leds_rtrn;
-#endif
{
*sz_rtrn= 0;
if ((changes->changed&XkbXI_ButtonActionsMask)&&(changes->num_btns>0)) {
@@ -655,14 +565,7 @@ _XkbSetDeviceInfoSize(devi,changes,stuff,sz_rtrn,num_leds_rtrn)
}
static char *
-#if NeedFunctionPrototypes
_XkbWriteLedInfo(char *wire,unsigned changed,XkbDeviceLedInfoPtr devli)
-#else
-_XkbWriteLedInfo(wire,changed,devli)
- char * wire;
- unsigned changed;
- XkbDeviceLedInfoPtr devli;
-#endif
{
register int i;
register unsigned bit,namesNeeded,mapsNeeded;
@@ -719,18 +622,10 @@ xkbDeviceLedsWireDesc * lwire;
static int
-#if NeedFunctionPrototypes
_XkbWriteSetDeviceInfo( char * wire,
XkbDeviceChangesPtr changes,
SetLedStuff * stuff,
XkbDeviceInfoPtr devi)
-#else
-_XkbWriteSetDeviceInfo(wire,changes,stuff,devi)
- char * wire;
- XkbDeviceChangesPtr changes;
- SetLedStuff * stuff;
- XkbDeviceInfoPtr devi;
-#endif
{
char *start;
@@ -759,16 +654,9 @@ char *start;
}
Bool
-#if NeedFunctionPrototypes
XkbSetDeviceInfo( Display * dpy,
unsigned which,
XkbDeviceInfoPtr devi)
-#else
-XkbSetDeviceInfo(dpy,which,devi)
- Display * dpy;
- unsigned which;
- XkbDeviceInfoPtr devi;
-#endif
{
register xkbSetDeviceInfoReq *req;
Status ok = 0;
@@ -821,16 +709,9 @@ XkbSetDeviceInfo(dpy,which,devi)
}
Bool
-#if NeedFunctionPrototypes
XkbChangeDeviceInfo( Display * dpy,
XkbDeviceInfoPtr devi,
XkbDeviceChangesPtr changes)
-#else
-XkbChangeDeviceInfo(dpy,devi,changes)
- Display * dpy;
- XkbDeviceInfoPtr devi;
- XkbDeviceChangesPtr changes;
-#endif
{
register xkbSetDeviceInfoReq *req;
Status ok = 0;
@@ -876,37 +757,20 @@ XkbChangeDeviceInfo(dpy,devi,changes)
}
Bool
-#if NeedFunctionPrototypes
XkbSetDeviceLedInfo( Display * dpy,
XkbDeviceInfoPtr devi,
unsigned ledClass,
unsigned ledID,
unsigned which)
-#else
-XkbSetDeviceLedInfo(dpy,devi,ledClass,ledID,which)
- Display * dpy;
- XkbDeviceInfoPtr devi;
- unsigned ledClass;
- unsigned ledID;
- unsigned which;
-#endif
{
return False;
}
Bool
-#if NeedFunctionPrototypes
XkbSetDeviceButtonActions( Display * dpy,
XkbDeviceInfoPtr devi,
unsigned int first,
unsigned int nBtns)
-#else
-XkbSetDeviceButtonActions(dpy,devi,first,nBtns)
- Display * dpy;
- XkbDeviceInfoPtr devi;
- unsigned int first;
- unsigned int nBtns;
-#endif
{
register xkbSetDeviceInfoReq *req;
Status ok = 0;
diff --git a/src/xkb/XKBGAlloc.c b/src/xkb/XKBGAlloc.c
index 44a74c6..209631e 100644
--- a/src/xkb/XKBGAlloc.c
+++ b/src/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,
&section->num_overlays,&section->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,
&section->num_rows,&section->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/src/xkb/XKBGeom.c b/src/xkb/XKBGeom.c
index 9afc0c0..65109d7 100644
--- a/src/xkb/XKBGeom.c
+++ b/src/xkb/XKBGeom.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/XKBGeom.c,v 1.4 2001/10/28 03:32:33 tsi Exp $ */
+/* $XFree86: xc/lib/X11/XKBGeom.c,v 1.6 2003/11/17 22:20:09 dawes Exp $ */
#ifdef DEBUG
#include <stdio.h>
@@ -32,10 +32,11 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#define NEED_EVENTS
#define NEED_REPLIES
+#define NEED_MAP_READERS
#include "Xlibint.h"
-#include "XKBlibint.h"
#include <X11/extensions/XKBgeom.h>
#include <X11/extensions/XKBproto.h>
+#include "XKBlibint.h"
#ifndef MINSHORT
#define MINSHORT -32768
@@ -47,13 +48,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
/***====================================================================***/
static void
-#if NeedFunctionPrototypes
_XkbCheckBounds(XkbBoundsPtr bounds,int x,int y)
-#else
-_XkbCheckBounds(bounds,x,y)
- XkbBoundsPtr bounds;
- int x,y;
-#endif
{
if (x<bounds->x1) bounds->x1= x;
if (x>bounds->x2) bounds->x2= x;
@@ -63,12 +58,7 @@ _XkbCheckBounds(bounds,x,y)
}
Bool
-#if NeedFunctionPrototypes
XkbComputeShapeBounds(XkbShapePtr shape)
-#else
-XkbComputeShapeBounds(shape)
- XkbShapePtr shape;
-#endif
{
register int o,p;
XkbOutlinePtr outline;
@@ -87,13 +77,7 @@ XkbPointPtr pt;
}
Bool
-#if NeedFunctionPrototypes
XkbComputeShapeTop(XkbShapePtr shape,XkbBoundsPtr bounds)
-#else
-XkbComputeShapeTop(shape,bounds)
- XkbShapePtr shape;
- XkbBoundsPtr bounds;
-#endif
{
register int p;
XkbOutlinePtr outline;
@@ -118,14 +102,7 @@ XkbPointPtr pt;
}
Bool
-#if NeedFunctionPrototypes
XkbComputeRowBounds(XkbGeometryPtr geom,XkbSectionPtr section,XkbRowPtr row)
-#else
-XkbComputeRowBounds(geom,section,row)
- XkbGeometryPtr geom;
- XkbSectionPtr section;
- XkbRowPtr row;
-#endif
{
register int k,pos;
XkbKeyPtr key;
@@ -162,13 +139,7 @@ XkbBoundsPtr bounds,sbounds;
}
Bool
-#if NeedFunctionPrototypes
XkbComputeSectionBounds(XkbGeometryPtr geom,XkbSectionPtr section)
-#else
-XkbComputeSectionBounds(geom,section)
- XkbGeometryPtr geom;
- XkbSectionPtr section;
-#endif
{
register int i;
XkbShapePtr shape;
@@ -224,14 +195,7 @@ XkbBoundsPtr bounds,rbounds=NULL;
/***====================================================================***/
char *
-#if NeedFunctionPrototypes
XkbFindOverlayForKey(XkbGeometryPtr geom,XkbSectionPtr wanted,char *under)
-#else
-XkbFindOverlayForKey(geom,wanted,under)
- XkbGeometryPtr geom;
- XkbSectionPtr wanted;
- char * under;
-#endif
{
int s;
XkbSectionPtr section;
@@ -271,16 +235,9 @@ XkbSectionPtr section;
/***====================================================================***/
static Status
-#if NeedFunctionPrototypes
_XkbReadGeomProperties( XkbReadBufferPtr buf,
XkbGeometryPtr geom,
xkbGetGeometryReply * rep)
-#else
-_XkbReadGeomProperties(buf,geom,rep)
- XkbReadBufferPtr buf;
- XkbGeometryPtr geom;
- xkbGetGeometryReply * rep;
-#endif
{
Status rtrn;
@@ -303,16 +260,9 @@ Status rtrn;
}
static Status
-#if NeedFunctionPrototypes
_XkbReadGeomKeyAliases( XkbReadBufferPtr buf,
XkbGeometryPtr geom,
xkbGetGeometryReply * rep)
-#else
-_XkbReadGeomKeyAliases(buf,geom,rep)
- XkbReadBufferPtr buf;
- XkbGeometryPtr geom;
- xkbGetGeometryReply * rep;
-#endif
{
Status rtrn;
@@ -332,16 +282,9 @@ Status rtrn;
}
static Status
-#if NeedFunctionPrototypes
_XkbReadGeomColors( XkbReadBufferPtr buf,
XkbGeometryPtr geom,
xkbGetGeometryReply * rep)
-#else
-_XkbReadGeomColors(buf,geom,rep)
- XkbReadBufferPtr buf;
- XkbGeometryPtr geom;
- xkbGetGeometryReply * rep;
-#endif
{
Status rtrn;
@@ -362,16 +305,9 @@ Status rtrn;
}
static Status
-#if NeedFunctionPrototypes
_XkbReadGeomShapes( XkbReadBufferPtr buf,
XkbGeometryPtr geom,
xkbGetGeometryReply * rep)
-#else
-_XkbReadGeomShapes(buf,geom,rep)
- XkbReadBufferPtr buf;
- XkbGeometryPtr geom;
- xkbGetGeometryReply * rep;
-#endif
{
register int i;
Status rtrn;
@@ -427,16 +363,9 @@ Status rtrn;
}
static Status
-#if NeedFunctionPrototypes
_XkbReadGeomDoodad( XkbReadBufferPtr buf,
XkbGeometryPtr geom,
XkbSectionPtr section)
-#else
-_XkbReadGeomDoodad(buf,geom,section)
- XkbReadBufferPtr buf;
- XkbGeometryPtr geom;
- XkbSectionPtr section;
-#endif
{
XkbDoodadPtr doodad;
xkbDoodadWireDesc * doodadWire;
@@ -486,16 +415,9 @@ xkbDoodadWireDesc * doodadWire;
}
static Status
-#if NeedFunctionPrototypes
_XkbReadGeomOverlay( XkbReadBufferPtr buf,
XkbGeometryPtr geom,
XkbSectionPtr section)
-#else
-_XkbReadGeomOverlay(buf,geom,section)
- XkbReadBufferPtr buf;
- XkbGeometryPtr geom;
- XkbSectionPtr section;
-#endif
{
XkbOverlayPtr ol;
xkbOverlayWireDesc * olWire;
@@ -539,16 +461,9 @@ register int r;
}
static Status
-#if NeedFunctionPrototypes
_XkbReadGeomSections( XkbReadBufferPtr buf,
XkbGeometryPtr geom,
xkbGetGeometryReply * rep)
-#else
-_XkbReadGeomSections(buf,geom,rep)
- XkbReadBufferPtr buf;
- XkbGeometryPtr geom;
- xkbGetGeometryReply * rep;
-#endif
{
register int s;
XkbSectionPtr section;
@@ -629,16 +544,9 @@ Status rtrn;
}
static Status
-#if NeedFunctionPrototypes
_XkbReadGeomDoodads( XkbReadBufferPtr buf,
XkbGeometryPtr geom,
xkbGetGeometryReply * rep)
-#else
-_XkbReadGeomDoodads(buf,geom,rep)
- XkbReadBufferPtr buf;
- XkbGeometryPtr geom;
- xkbGetGeometryReply * rep;
-#endif
{
register int d;
Status rtrn;
@@ -655,18 +563,10 @@ Status rtrn;
}
Status
-#if NeedFunctionPrototypes
_XkbReadGetGeometryReply( Display * dpy,
xkbGetGeometryReply * rep,
XkbDescPtr xkb,
int * nread_rtrn)
-#else
-_XkbReadGetGeometryReply(dpy,rep,xkb,nread_rtrn)
- Display * dpy;
- xkbGetGeometryReply * rep;
- XkbDescPtr xkb;
- int * nread_rtrn;
-#endif
{
XkbGeometryPtr geom;
@@ -722,13 +622,7 @@ XkbGeometryPtr geom;
}
Status
-#if NeedFunctionPrototypes
XkbGetGeometry(Display *dpy,XkbDescPtr xkb)
-#else
-XkbGetGeometry(dpy,xkb)
- Display * dpy;
- XkbDescPtr xkb;
-#endif
{
xkbGetGeometryReq *req;
xkbGetGeometryReply rep;
@@ -750,14 +644,7 @@ xkbGetGeometryReply rep;
}
Status
-#if NeedFunctionPrototypes
XkbGetNamedGeometry(Display *dpy,XkbDescPtr xkb,Atom name)
-#else
-XkbGetNamedGeometry(dpy,xkb,name)
- Display * dpy;
- XkbDescPtr xkb;
- Atom name;
-#endif
{
xkbGetGeometryReq *req;
xkbGetGeometryReply rep;
diff --git a/src/xkb/XKBGetByName.c b/src/xkb/XKBGetByName.c
index 411be96..b5785b5 100644
--- a/src/xkb/XKBGetByName.c
+++ b/src/xkb/XKBGetByName.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/lib/X11/XKBGetByName.c,v 1.2 2003/11/17 22:20:09 dawes Exp $ */
#define NEED_REPLIES
#define NEED_EVENTS
@@ -35,22 +36,12 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
/***====================================================================***/
XkbDescPtr
-#if NeedFunctionPrototypes
XkbGetKeyboardByName( Display * dpy,
unsigned deviceSpec,
XkbComponentNamesPtr names,
unsigned want,
unsigned need,
Bool load)
-#else
-XkbGetKeyboardByName(dpy,deviceSpec,names,want,need,load)
- Display * dpy;
- unsigned deviceSpec;
- XkbComponentNamesPtr names;
- unsigned want;
- unsigned need;
- Bool load;
-#endif
{
register xkbGetKbdByNameReq * req;
xkbGetKbdByNameReply rep;
@@ -218,14 +209,7 @@ BAILOUT:
}
XkbDescPtr
-#if NeedFunctionPrototypes
XkbGetKeyboard(Display *dpy,unsigned which,unsigned deviceSpec)
-#else
-XkbGetKeyboard(dpy,which,deviceSpec)
- Display * dpy;
- unsigned which;
- unsigned deviceSpec;
-#endif
{
return XkbGetKeyboardByName(dpy,deviceSpec,NULL,which,which,False);
}
diff --git a/src/xkb/XKBGetMap.c b/src/xkb/XKBGetMap.c
index e0fe10e..4442fe6 100644
--- a/src/xkb/XKBGetMap.c
+++ b/src/xkb/XKBGetMap.c
@@ -25,7 +25,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
-/* $XFree86: xc/lib/X11/XKBGetMap.c,v 1.7 2003/02/04 03:49:33 dawes Exp $ */
+/* $XFree86: xc/lib/X11/XKBGetMap.c,v 1.10 2003/11/17 22:20:09 dawes Exp $ */
#define NEED_REPLIES
#define NEED_EVENTS
@@ -35,14 +35,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "XKBlibint.h"
static Status
-#if NeedFunctionPrototypes
_XkbReadKeyTypes(XkbReadBufferPtr buf,XkbDescPtr xkb,xkbGetMapReply *rep)
-#else
-_XkbReadKeyTypes(buf,xkb,rep)
- XkbReadBufferPtr buf;
- XkbDescPtr xkb;
- xkbGetMapReply * rep;
-#endif
{
int i,n,lastMapCount;
XkbKeyTypePtr type;
@@ -152,14 +145,7 @@ XkbKeyTypePtr type;
}
static Status
-#if NeedFunctionPrototypes
_XkbReadKeySyms(XkbReadBufferPtr buf,XkbDescPtr xkb,xkbGetMapReply *rep)
-#else
-_XkbReadKeySyms(buf,xkb,rep)
- XkbReadBufferPtr buf;
- XkbDescPtr xkb;
- xkbGetMapReply * rep;
-#endif
{
register int i;
XkbClientMapPtr map;
@@ -254,14 +240,7 @@ XkbClientMapPtr map;
}
static Status
-#if NeedFunctionPrototypes
_XkbReadKeyActions(XkbReadBufferPtr buf,XkbDescPtr info,xkbGetMapReply *rep)
-#else
-_XkbReadKeyActions(buf,info,rep)
- XkbReadBufferPtr buf;
- XkbDescPtr info;
- xkbGetMapReply * rep;
-#endif
{
int i;
CARD8 numDescBuf[248];
@@ -313,14 +292,7 @@ done:
}
static Status
-#if NeedFunctionPrototypes
_XkbReadKeyBehaviors(XkbReadBufferPtr buf,XkbDescPtr xkb,xkbGetMapReply *rep)
-#else
-_XkbReadKeyBehaviors(buf,xkb,rep)
- XkbReadBufferPtr buf;
- XkbDescPtr xkb;
- xkbGetMapReply * rep;
-#endif
{
register int i;
xkbBehaviorWireDesc *wire;
@@ -349,14 +321,7 @@ xkbBehaviorWireDesc *wire;
}
static Status
-#if NeedFunctionPrototypes
_XkbReadVirtualMods(XkbReadBufferPtr buf,XkbDescPtr xkb,xkbGetMapReply *rep)
-#else
-_XkbReadVirtualMods(buf,xkb,rep)
- XkbReadBufferPtr buf;
- XkbDescPtr xkb;
- xkbGetMapReply * rep;
-#endif
{
if ( rep->virtualMods ) {
register int i,bit,nVMods;
@@ -380,16 +345,9 @@ _XkbReadVirtualMods(buf,xkb,rep)
}
static Status
-#if NeedFunctionPrototypes
_XkbReadExplicitComponents( XkbReadBufferPtr buf,
XkbDescPtr xkb,
xkbGetMapReply * rep)
-#else
-_XkbReadExplicitComponents(buf,xkb,rep)
- XkbReadBufferPtr buf;
- XkbDescPtr xkb;
- xkbGetMapReply * rep;
-#endif
{
register int i;
unsigned char *wire;
@@ -417,14 +375,7 @@ unsigned char *wire;
}
static Status
-#if NeedFunctionPrototypes
_XkbReadModifierMap(XkbReadBufferPtr buf,XkbDescPtr xkb,xkbGetMapReply *rep)
-#else
-_XkbReadModifierMap(buf,xkb,rep)
- XkbReadBufferPtr buf;
- XkbDescPtr xkb;
- xkbGetMapReply * rep;
-#endif
{
register int i;
unsigned char *wire;
@@ -449,14 +400,7 @@ unsigned char *wire;
}
static Status
-#if NeedFunctionPrototypes
_XkbReadVirtualModMap(XkbReadBufferPtr buf,XkbDescPtr xkb,xkbGetMapReply *rep)
-#else
-_XkbReadVirtualModMap(buf,xkb,rep)
- XkbReadBufferPtr buf;
- XkbDescPtr xkb;
- xkbGetMapReply * rep;
-#endif
{
register int i;
xkbVModMapWireDesc * wire;
@@ -488,13 +432,7 @@ XkbServerMapPtr srv;
}
static xkbGetMapReq *
-#if NeedFunctionPrototypes
_XkbGetGetMapReq(Display *dpy,XkbDescPtr xkb)
-#else
-_XkbGetGetMapReq(dpy,xkb)
- Display * dpy;
- XkbDescPtr xkb;
-#endif
{
xkbGetMapReq *req;
@@ -515,18 +453,10 @@ xkbGetMapReq *req;
}
Status
-#if NeedFunctionPrototypes
_XkbReadGetMapReply( Display * dpy,
xkbGetMapReply *rep,
XkbDescPtr xkb,
int * nread_rtrn)
-#else
-_XkbReadGetMapReply(dpy,rep,xkb,nread_rtrn)
- Display * dpy;
- xkbGetMapReply * rep;
- XkbDescPtr xkb;
- int * nread_rtrn;
-#endif
{
int extraData;
unsigned mask;
@@ -581,13 +511,7 @@ unsigned mask;
}
static Status
-#if NeedFunctionPrototypes
_XkbHandleGetMapReply(Display *dpy,XkbDescPtr xkb)
-#else
-_XkbHandleGetMapReply(dpy,xkb)
- Display * dpy;
- XkbDescPtr xkb;
-#endif
{
xkbGetMapReply rep;
@@ -600,14 +524,7 @@ xkbGetMapReply rep;
}
Status
-#if NeedFunctionPrototypes
XkbGetUpdatedMap(Display *dpy,unsigned which,XkbDescPtr xkb)
-#else
-XkbGetUpdatedMap(dpy,which,xkb)
- Display * dpy;
- unsigned which;
- XkbDescPtr xkb;
-#endif
{
if ((dpy->flags & XlibDisplayNoXkb) ||
(!dpy->xkb_info && !XkbUseExtension(dpy,NULL,NULL)))
@@ -630,14 +547,7 @@ XkbGetUpdatedMap(dpy,which,xkb)
}
XkbDescPtr
-#if NeedFunctionPrototypes
XkbGetMap(Display *dpy,unsigned which,unsigned deviceSpec)
-#else
-XkbGetMap(dpy,which,deviceSpec)
- Display *dpy;
- unsigned which;
- unsigned deviceSpec;
-#endif
{
XkbDescPtr xkb;
@@ -660,15 +570,7 @@ XkbDescPtr xkb;
}
Status
-#if NeedFunctionPrototypes
XkbGetKeyTypes(Display *dpy,unsigned first,unsigned num,XkbDescPtr xkb)
-#else
-XkbGetKeyTypes(dpy,first,num,xkb)
- Display *dpy;
- unsigned first;
- unsigned num;
- XkbDescPtr xkb;
-#endif
{
register xkbGetMapReq *req;
Status status;
@@ -692,15 +594,7 @@ XkbGetKeyTypes(dpy,first,num,xkb)
}
Status
-#if NeedFunctionPrototypes
XkbGetKeyActions(Display *dpy,unsigned first,unsigned num,XkbDescPtr xkb)
-#else
-XkbGetKeyActions(dpy,first,num,xkb)
- Display *dpy;
- unsigned first;
- unsigned num;
- XkbDescPtr xkb;
-#endif
{
register xkbGetMapReq *req;
Status status;
@@ -725,15 +619,7 @@ XkbGetKeyActions(dpy,first,num,xkb)
}
Status
-#if NeedFunctionPrototypes
XkbGetKeySyms(Display *dpy,unsigned first,unsigned num,XkbDescPtr xkb)
-#else
-XkbGetKeySyms(dpy,first,num,xkb)
- Display *dpy;
- unsigned first;
- unsigned num;
- XkbDescPtr xkb;
-#endif
{
register xkbGetMapReq *req;
Status status;
@@ -759,15 +645,7 @@ XkbGetKeySyms(dpy,first,num,xkb)
}
Status
-#if NeedFunctionPrototypes
XkbGetKeyBehaviors(Display *dpy,unsigned first,unsigned num,XkbDescPtr xkb)
-#else
-XkbGetKeyBehaviors(dpy,first,num,xkb)
- Display * dpy;
- unsigned first;
- unsigned num;
- XkbDescPtr xkb;
-#endif
{
register xkbGetMapReq *req;
Status status;
@@ -792,14 +670,7 @@ XkbGetKeyBehaviors(dpy,first,num,xkb)
}
Status
-#if NeedFunctionPrototypes
XkbGetVirtualMods(Display *dpy,unsigned which,XkbDescPtr xkb)
-#else
-XkbGetVirtualMods(dpy,which,xkb)
- Display * dpy;
- unsigned which;
- XkbDescPtr xkb;
-#endif
{
register xkbGetMapReq *req;
Status status;
@@ -820,18 +691,10 @@ XkbGetVirtualMods(dpy,which,xkb)
}
Status
-#if NeedFunctionPrototypes
XkbGetKeyExplicitComponents( Display * dpy,
unsigned first,
unsigned num,
XkbDescPtr xkb)
-#else
-XkbGetKeyExplicitComponents(dpy,first,num,xkb)
- Display *dpy;
- unsigned first;
- unsigned num;
- XkbDescPtr xkb;
-#endif
{
register xkbGetMapReq *req;
Status status;
@@ -860,15 +723,7 @@ XkbGetKeyExplicitComponents(dpy,first,num,xkb)
}
Status
-#if NeedFunctionPrototypes
XkbGetKeyModifierMap(Display *dpy,unsigned first,unsigned num,XkbDescPtr xkb)
-#else
-XkbGetKeyModifierMap(dpy,first,num,xkb)
- Display * dpy;
- unsigned first;
- unsigned num;
- XkbDescPtr xkb;
-#endif
{
register xkbGetMapReq *req;
Status status;
@@ -897,15 +752,7 @@ XkbGetKeyModifierMap(dpy,first,num,xkb)
}
Status
-#if NeedFunctionPrototypes
XkbGetKeyVirtualModMap(Display *dpy,unsigned first,unsigned num,XkbDescPtr xkb)
-#else
-XkbGetKeyVirtualModMap(dpy,first,num,xkb)
- Display *dpy;
- unsigned first;
- unsigned num;
- XkbDescPtr xkb;
-#endif
{
register xkbGetMapReq *req;
Status status;
@@ -934,14 +781,7 @@ XkbGetKeyVirtualModMap(dpy,first,num,xkb)
}
Status
-#if NeedFunctionPrototypes
XkbGetMapChanges(Display *dpy,XkbDescPtr xkb,XkbMapChangesPtr changes)
-#else
-XkbGetMapChanges(dpy,xkb,changes)
- Display * dpy;
- XkbDescPtr xkb;
- XkbMapChangesPtr changes;
-#endif
{
xkbGetMapReq *req;
diff --git a/src/xkb/XKBList.c b/src/xkb/XKBList.c
index 9f521a6..1f2b6e9 100644
--- a/src/xkb/XKBList.c
+++ b/src/xkb/XKBList.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/lib/X11/XKBList.c,v 1.2 2003/11/17 22:20:09 dawes Exp $ */
#define NEED_REPLIES
#define NEED_EVENTS
@@ -35,13 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
/***====================================================================***/
static void
-#if NeedFunctionPrototypes
_FreeComponentNames(int num,XkbComponentNamePtr names)
-#else
-_FreeComponentNames(num,names)
- int num;
- XkbComponentNamePtr names;
-#endif
{
int i;
XkbComponentNamePtr tmp;
@@ -61,14 +56,7 @@ XkbComponentNamePtr tmp;
/***====================================================================***/
static XkbComponentNamePtr
-#if NeedFunctionPrototypes
_ReadListing(XkbReadBufferPtr buf,int count,Status *status_rtrn)
-#else
-_ReadListing(buf,count,status_rtrn)
- XkbReadBufferPtr buf;
- int count;
- Status * status_rtrn;
-#endif
{
XkbComponentNamePtr first,this;
register int i;
@@ -104,18 +92,10 @@ BAILOUT:
/***====================================================================***/
XkbComponentListPtr
-#if NeedFunctionPrototypes
XkbListComponents( Display * dpy,
unsigned deviceSpec,
XkbComponentNamesPtr ptrns,
int * max_inout)
-#else
-XkbListComponents(dpy,deviceSpec,ptrns,max_inout)
- Display * dpy;
- unsigned deviceSpec;
- XkbComponentNamesPtr ptrns;
- int * max_inout;
-#endif
{
register xkbListComponentsReq* req;
xkbListComponentsReply rep;
@@ -246,12 +226,7 @@ BAILOUT:
}
void
-#if NeedFunctionPrototypes
XkbFreeComponentList(XkbComponentListPtr list)
-#else
-XkbFreeComponentList(list)
- XkbComponentListPtr list;
-#endif
{
if (list) {
if (list->keymaps)
diff --git a/src/xkb/XKBMAlloc.c b/src/xkb/XKBMAlloc.c
index 29cdc3c..20def46 100644
--- a/src/xkb/XKBMAlloc.c
+++ b/src/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/src/xkb/XKBMisc.c b/src/xkb/XKBMisc.c
index f3de929..06660ff 100644
--- a/src/xkb/XKBMisc.c
+++ b/src/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/src/xkb/XKBNames.c b/src/xkb/XKBNames.c
index a072bf8..9e8326d 100644
--- a/src/xkb/XKBNames.c
+++ b/src/xkb/XKBNames.c
@@ -24,28 +24,21 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
-/* $XFree86: xc/lib/X11/XKBNames.c,v 1.4 2001/10/28 03:32:33 tsi Exp $ */
+/* $XFree86: xc/lib/X11/XKBNames.c,v 1.6 2003/11/17 22:20:09 dawes Exp $ */
#define NEED_REPLIES
#define NEED_EVENTS
+#define NEED_MAP_READERS
#include "Xlibint.h"
#include <X11/extensions/XKBproto.h>
#include "XKBlibint.h"
static Status
-#if NeedFunctionPrototypes
_XkbReadAtoms( XkbReadBufferPtr buf,
Atom * atoms,
int maxAtoms,
CARD32 present)
-#else
-_XkbReadAtoms(buf,atoms,maxAtoms,present)
- XkbReadBufferPtr buf;
- Atom *atoms;
- int maxAtoms;
- CARD32 present;
-#endif
{
register int i,bit;
@@ -60,18 +53,10 @@ register int i,bit;
}
Status
-#if NeedFunctionPrototypes
_XkbReadGetNamesReply( Display * dpy,
xkbGetNamesReply * rep,
XkbDescPtr xkb,
int * nread_rtrn)
-#else
-_XkbReadGetNamesReply(dpy,rep,xkb,nread_rtrn)
- Display * dpy;
- xkbGetNamesReply * rep;
- XkbDescPtr xkb;
- int * nread_rtrn;
-#endif
{
int i,len;
XkbReadBufferRec buf;
@@ -244,14 +229,7 @@ BAILOUT:
}
Status
-#if NeedFunctionPrototypes
XkbGetNames(Display *dpy,unsigned which,XkbDescPtr xkb)
-#else
-XkbGetNames(dpy,which,xkb)
- Display * dpy;
- unsigned which;
- XkbDescPtr xkb;
-#endif
{
register xkbGetNamesReq *req;
xkbGetNamesReply rep;
@@ -291,13 +269,7 @@ XkbGetNames(dpy,which,xkb)
/***====================================================================***/
static int
-#if NeedFunctionPrototypes
_XkbCountBits(int nBitsMax,unsigned long mask)
-#else
-_XkbCountBits(nBitsMax,mask)
- int nBitsMax;
- unsigned long mask;
-#endif
{
register unsigned long y, nBits;
@@ -310,14 +282,7 @@ register unsigned long y, nBits;
}
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;
@@ -334,15 +299,7 @@ register CARD32 atomsPresent;
}
static void
-#if NeedFunctionPrototypes
_XkbCopyAtoms(Display *dpy,Atom *atoms,CARD32 mask,int maxAtoms)
-#else
-_XkbCopyAtoms(dpy,atoms,mask,maxAtoms)
- Display * dpy;
- Atom * atoms;
- CARD32 mask;
- int maxAtoms;
-#endif
{
register unsigned int i,bit;
@@ -354,20 +311,11 @@ register unsigned int i,bit;
}
Bool
-#if NeedFunctionPrototypes
XkbSetNames( Display * dpy,
unsigned int which,
unsigned int firstType,
unsigned int nTypes,
XkbDescPtr xkb)
-#else
-XkbSetNames(dpy,which,firstType,nTypes,xkb)
- Display * dpy;
- unsigned int which;
- unsigned int firstType;
- unsigned int nTypes;
- XkbDescPtr xkb;
-#endif
{
register xkbSetNamesReq *req;
int nLvlNames = 0;
@@ -589,14 +537,7 @@ XkbSetNames(dpy,which,firstType,nTypes,xkb)
}
Bool
-#if NeedFunctionPrototypes
XkbChangeNames(Display *dpy,XkbDescPtr xkb,XkbNameChangesPtr changes)
-#else
-XkbChangeNames(dpy,xkb,changes)
- Display * dpy;
- XkbDescPtr xkb;
- XkbNameChangesPtr changes;
-#endif
{
register xkbSetNamesReq *req;
int nLvlNames = 0;
@@ -852,16 +793,9 @@ XkbChangeNames(dpy,xkb,changes)
}
void
-#if NeedFunctionPrototypes
XkbNoteNameChanges( XkbNameChangesPtr old,
XkbNamesNotifyEvent * new,
unsigned int wanted)
-#else
-XkbNoteNameChanges(old,new,wanted)
- XkbNameChangesPtr old;
- XkbNamesNotifyEvent * new;
- unsigned int wanted;
-#endif
{
int first,last,old_last,new_last;
diff --git a/src/xkb/XKBRdBuf.c b/src/xkb/XKBRdBuf.c
index 5e962b1..8f688c0 100644
--- a/src/xkb/XKBRdBuf.c
+++ b/src/xkb/XKBRdBuf.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/XKBRdBuf.c,v 1.2 2001/10/28 03:32:33 tsi Exp $ */
+/* $XFree86: xc/lib/X11/XKBRdBuf.c,v 1.3 2003/11/17 22:20:10 dawes Exp $ */
#include <stdio.h>
#define NEED_REPLIES
@@ -36,14 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
/***====================================================================***/
int
-#if NeedFunctionPrototypes
_XkbInitReadBuffer(Display *dpy,XkbReadBufferPtr buf,int size)
-#else
-_XkbInitReadBuffer(dpy,buf,size)
- Display *dpy;
- XkbReadBufferPtr buf;
- int size;
-#endif
{
if ((dpy!=NULL) && (buf!=NULL) && (size>0)) {
buf->error= 0;
@@ -60,13 +53,7 @@ _XkbInitReadBuffer(dpy,buf,size)
#define _XkbReadBufferDataLeft(b) (((b)->size)-((b)->data-(b)->start))
int
-#if NeedFunctionPrototypes
_XkbSkipReadBufferData(XkbReadBufferPtr from,int size)
-#else
-_XkbSkipReadBufferData(from,size)
- XkbReadBufferPtr from;
- int size;
-#endif
{
if (size==0)
return 1;
@@ -78,14 +65,7 @@ _XkbSkipReadBufferData(from,size)
}
int
-#if NeedFunctionPrototypes
_XkbCopyFromReadBuffer(XkbReadBufferPtr from,char *to,int size)
-#else
-_XkbCopyFromReadBuffer(from,to,size)
- XkbReadBufferPtr from;
- char *to;
- int size;
-#endif
{
if (size==0)
return 1;
@@ -99,14 +79,7 @@ _XkbCopyFromReadBuffer(from,to,size)
#ifdef XKB_FORCE_INT_KEYSYM
int
-#if NeedFunctionPrototypes
_XkbReadCopyKeySyms(int *wire,KeySym *to,int num_words)
-#else
-_XkbReadCopyKeySyms(wire,to,num_words)
- int * wire;
- KeySym * to;
- int num_words;
-#endif
{
while (num_words-->0) {
*to++= *wire++;
@@ -115,14 +88,7 @@ _XkbReadCopyKeySyms(wire,to,num_words)
}
int
-#if NeedFunctionPrototypes
_XkbReadBufferCopyKeySyms(XkbReadBufferPtr from,KeySym *to,int num_words)
-#else
-_XkbReadBufferCopyKeySyms(from,to,num_words)
- XkbReadBufferPtr from;
- KeySym * to;
- int num_words;
-#endif
{
if ((unsigned)(num_words*4)>_XkbReadBufferDataLeft(from))
return 0;
@@ -132,14 +98,7 @@ _XkbReadBufferCopyKeySyms(from,to,num_words)
}
int
-#if NeedFunctionPrototypes
_XkbWriteCopyKeySyms (register KeySym *from,CARD32 *to,int len)
-#else
-_XkbWriteCopyKeySyms (from,to,len)
- register KeySym * from;
- CARD32 * to;
- int len;
-#endif
{
while (len-->0) {
@@ -151,14 +110,7 @@ _XkbWriteCopyKeySyms (from,to,len)
#ifdef LONG64
int
-#if NeedFunctionPrototypes
_XkbReadCopyData32(int *wire,long *to,int num_words)
-#else
-_XkbReadCopyData32(wire,to,num_words)
- int * wire;
- long * to;
- int num_words;
-#endif
{
while (num_words-->0) {
*to++= *wire++;
@@ -168,14 +120,7 @@ _XkbReadCopyData32(wire,to,num_words)
#endif
#ifdef WORD64
int
-#if NeedFunctionPrototypes
_XkbReadCopyData32(int *from,long *lp,int num_words)
-#else
-_XkbReadCopyData32(from,lp,num_words)
- int * from;
- long * lp;
- int num_words;
-#endif
{
long *lpack;
long mask32 = 0x00000000ffffffff;
@@ -197,14 +142,7 @@ long maskw, i, bits;
#if defined(LONG64) || defined(WORD64)
int
-#if NeedFunctionPrototypes
_XkbReadBufferCopy32(XkbReadBufferPtr from,long *to,int num_words)
-#else
-_XkbReadBufferCopy32(from,to,num_words)
- XkbReadBufferPtr from;
- long * to;
- int num_words;
-#endif
{
if ((unsigned)(num_words*4)>_XkbReadBufferDataLeft(from))
return 0;
@@ -216,14 +154,7 @@ _XkbReadBufferCopy32(from,to,num_words)
#ifdef LONG64
int
-#if NeedFunctionPrototypes
_XkbWriteCopyData32 (register unsigned long *from,CARD32 *to,int len)
-#else
-_XkbWriteCopyData32 (from,to,len)
- register unsigned long * from;
- CARD32 * to;
- int len;
-#endif
{
while (len-->0) {
@@ -238,13 +169,7 @@ _XkbWriteCopyData32 Not Implemented Yet for sizeof(int)==8
#endif
char *
-#if NeedFunctionPrototypes
_XkbPeekAtReadBuffer(XkbReadBufferPtr from,int size)
-#else
-_XkbPeekAtReadBuffer(from,size)
- XkbReadBufferPtr from;
- int size;
-#endif
{
if ((from==NULL)||(from->error)||(size<1)||
(_XkbReadBufferDataLeft(from)<size))
@@ -253,13 +178,7 @@ _XkbPeekAtReadBuffer(from,size)
}
char *
-#if NeedFunctionPrototypes
_XkbGetReadBufferPtr(XkbReadBufferPtr from,int size)
-#else
-_XkbGetReadBufferPtr(from,size)
- XkbReadBufferPtr from;
- int size;
-#endif
{
char *ptr;
if ((from==NULL)||(from->error)||(size<1)||
@@ -272,12 +191,7 @@ char *ptr;
int
-#if NeedFunctionPrototypes
_XkbFreeReadBuffer(XkbReadBufferPtr buf)
-#else
-_XkbFreeReadBuffer(buf)
- XkbReadBufferPtr buf;
-#endif
{
if ((buf!=NULL) && (buf->start!=NULL)) {
int left;
@@ -292,13 +206,7 @@ _XkbFreeReadBuffer(buf)
}
Bool
-#if NeedFunctionPrototypes
_XkbGetReadBufferCountedString(XkbReadBufferPtr buf,char **rtrn)
-#else
-_XkbGetReadBufferCountedString(buf,rtrn)
- XkbReadBufferPtr buf;
- char ** rtrn;
-#endif
{
CARD16 len,*pLen;
int left;
diff --git a/src/xkb/XKBSetGeom.c b/src/xkb/XKBSetGeom.c
index 72d7f3d..d792b5e 100644
--- a/src/xkb/XKBSetGeom.c
+++ b/src/xkb/XKBSetGeom.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/lib/X11/XKBSetGeom.c,v 3.6 2003/11/17 22:20:10 dawes Exp $ */
#ifdef DEBUG
#include <stdio.h>
@@ -48,13 +49,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#define _SizeCountedString(s) ((s)?XkbPaddedSize(2+strlen(s)):4)
static char *
-#if NeedFunctionPrototypes
_WriteCountedString(char *wire,char *str)
-#else
-_WriteCountedString(wire,str)
- char * wire;
- char * str;
-#endif
{
CARD16 len,*pLen;
@@ -68,12 +63,7 @@ CARD16 len,*pLen;
}
static int
-#if NeedFunctionPrototypes
_SizeGeomProperties(XkbGeometryPtr geom)
-#else
-_SizeGeomProperties(geom)
- XkbGeometryPtr geom;
-#endif
{
register int i,size;
XkbPropertyPtr prop;
@@ -86,12 +76,7 @@ XkbPropertyPtr prop;
}
static int
-#if NeedFunctionPrototypes
_SizeGeomColors(XkbGeometryPtr geom)
-#else
-_SizeGeomColors(geom)
- XkbGeometryPtr geom;
-#endif
{
register int i,size;
register XkbColorPtr color;
@@ -103,12 +88,7 @@ register XkbColorPtr color;
}
static int
-#if NeedFunctionPrototypes
_SizeGeomShapes(XkbGeometryPtr geom)
-#else
-_SizeGeomShapes(geom)
- XkbGeometryPtr geom;
-#endif
{
register int i,size;
register XkbShapePtr shape;
@@ -126,13 +106,7 @@ register XkbShapePtr shape;
}
static int
-#if NeedFunctionPrototypes
_SizeGeomDoodads(int num_doodads,XkbDoodadPtr doodad)
-#else
-_SizeGeomDoodads(num_doodads,doodad)
- int num_doodads;
- XkbDoodadPtr doodad;
-#endif
{
register int i,size;
@@ -150,12 +124,7 @@ register int i,size;
}
static int
-#if NeedFunctionPrototypes
_SizeGeomSections(XkbGeometryPtr geom)
-#else
-_SizeGeomSections(geom)
- XkbGeometryPtr geom;
-#endif
{
register int i,size;
XkbSectionPtr section;
@@ -190,12 +159,7 @@ XkbSectionPtr section;
}
static int
-#if NeedFunctionPrototypes
_SizeGeomKeyAliases(XkbGeometryPtr geom)
-#else
-_SizeGeomKeyAliases(geom)
- XkbGeometryPtr geom;
-#endif
{
return geom->num_key_aliases*(2*XkbKeyNameLength);
}
@@ -203,13 +167,7 @@ _SizeGeomKeyAliases(geom)
/***====================================================================***/
static char *
-#if NeedFunctionPrototypes
_WriteGeomProperties(char *wire,XkbGeometryPtr geom)
-#else
-_WriteGeomProperties(wire,geom)
- char * wire;
- XkbGeometryPtr geom;
-#endif
{
register int i;
register XkbPropertyPtr prop;
@@ -222,13 +180,7 @@ register XkbPropertyPtr prop;
}
static char *
-#if NeedFunctionPrototypes
_WriteGeomColors(char *wire,XkbGeometryPtr geom)
-#else
-_WriteGeomColors(wire,geom)
- char * wire;
- XkbGeometryPtr geom;
-#endif
{
register int i;
register XkbColorPtr color;
@@ -240,13 +192,7 @@ register XkbColorPtr color;
}
static char *
-#if NeedFunctionPrototypes
_WriteGeomShapes(char *wire,XkbGeometryPtr geom)
-#else
-_WriteGeomShapes(wire,geom)
- char * wire;
- XkbGeometryPtr geom;
-#endif
{
int i;
XkbShapePtr shape;
@@ -286,14 +232,7 @@ xkbShapeWireDesc * shapeWire;
}
static char *
-#if NeedFunctionPrototypes
_WriteGeomDoodads(char *wire,int num_doodads,XkbDoodadPtr doodad)
-#else
-_WriteGeomDoodads(wire,num_doodads,doodad)
- char * wire;
- int num_doodads;
- XkbDoodadPtr doodad;
-#endif
{
register int i;
xkbDoodadWireDesc * doodadWire;
@@ -340,13 +279,7 @@ xkbDoodadWireDesc * doodadWire;
}
static char *
-#if NeedFunctionPrototypes
_WriteGeomOverlay(char *wire,XkbOverlayPtr ol)
-#else
-_WriteGeomOverlay(wire,ol)
- char * wire;
- XkbOverlayPtr ol;
-#endif
{
register int r;
XkbOverlayRowPtr row;
@@ -376,13 +309,7 @@ xkbOverlayWireDesc * olWire;
}
static char *
-#if NeedFunctionPrototypes
_WriteGeomSections(char *wire,XkbGeometryPtr geom)
-#else
-_WriteGeomSections(wire,geom)
- char * wire;
- XkbGeometryPtr geom;
-#endif
{
register int i;
XkbSectionPtr section;
@@ -444,13 +371,7 @@ xkbSectionWireDesc * sectionWire;
}
static char *
-#if NeedFunctionPrototypes
_WriteGeomKeyAliases(char *wire,XkbGeometryPtr geom)
-#else
-_WriteGeomKeyAliases(wire,geom)
- char * wire;
- XkbGeometryPtr geom;
-#endif
{
register int sz;
@@ -465,16 +386,8 @@ register int sz;
/***====================================================================***/
static Status
-#if NeedFunctionPrototypes
_SendSetGeometry(Display *dpy,XkbGeometryPtr geom,xkbSetGeometryReq *req)
-#else
-_SendSetGeometry(dpy,geom,req)
- Display * dpy;
- XkbGeometryPtr geom;
- xkbSetGeometryReq * req;
-#endif
{
-xkbSetGeometryReq tmp;
int sz;
char * wire,*tbuf;
@@ -487,7 +400,6 @@ char * wire,*tbuf;
sz+= _SizeGeomDoodads(geom->num_doodads,geom->doodads);
sz+= _SizeGeomKeyAliases(geom);
req->length+= (sz/4);
- tmp= *req;
if (sz<BUFSIZE) {
BufAlloc(char *,wire,sz);
tbuf= NULL;
@@ -521,14 +433,7 @@ char * wire,*tbuf;
/***====================================================================***/
Status
-#if NeedFunctionPrototypes
XkbSetGeometry(Display *dpy,unsigned deviceSpec,XkbGeometryPtr geom)
-#else
-XkbSetGeometry(dpy,deviceSpec,geom)
- Display * dpy;
- unsigned deviceSpec;
- XkbGeometryPtr geom;
-#endif
{
xkbSetGeometryReq *req;
Status ret;
diff --git a/src/xkb/XKBSetMap.c b/src/xkb/XKBSetMap.c
index 331ad40..53bb566 100644
--- a/src/xkb/XKBSetMap.c
+++ b/src/xkb/XKBSetMap.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/XKBSetMap.c,v 3.2 2001/01/17 19:41:49 dawes Exp $ */
+/* $XFree86: xc/lib/X11/XKBSetMap.c,v 3.3 2003/11/17 22:20:10 dawes Exp $ */
#include <stdio.h>
#define NEED_REPLIES
@@ -34,13 +34,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "XKBlibint.h"
static int
-#if NeedFunctionPrototypes
_XkbSizeKeyTypes(XkbDescPtr xkb,xkbSetMapReq *req)
-#else
-_XkbSizeKeyTypes(xkb,req)
- XkbDescPtr xkb;
- xkbSetMapReq * req;
-#endif
{
XkbKeyTypePtr map;
int i,len;
@@ -62,14 +56,7 @@ _XkbSizeKeyTypes(xkb,req)
}
static void
-#if NeedFunctionPrototypes
_XkbWriteKeyTypes(Display *dpy,XkbDescPtr xkb,xkbSetMapReq *req)
-#else
-_XkbWriteKeyTypes(dpy,xkb,req)
- Display * dpy;
- XkbDescPtr xkb;
- xkbSetMapReq * req;
-#endif
{
char * buf;
XkbKeyTypePtr type;
@@ -115,13 +102,7 @@ _XkbWriteKeyTypes(dpy,xkb,req)
}
static int
-#if NeedFunctionPrototypes
_XkbSizeKeySyms(XkbDescPtr xkb,xkbSetMapReq *req)
-#else
-_XkbSizeKeySyms(xkb,req)
- XkbDescPtr xkb;
- xkbSetMapReq * req;
-#endif
{
int i,len;
unsigned nSyms;
@@ -142,14 +123,7 @@ _XkbSizeKeySyms(xkb,req)
}
static void
-#if NeedFunctionPrototypes
_XkbWriteKeySyms(Display *dpy,XkbDescPtr xkb,xkbSetMapReq *req)
-#else
-_XkbWriteKeySyms(dpy,xkb,req)
- Display * dpy;
- XkbDescPtr xkb;
- xkbSetMapReq * req;
-#endif
{
register KeySym * pSym;
CARD32 * outSym;
@@ -181,13 +155,7 @@ register int i;
}
static int
-#if NeedFunctionPrototypes
_XkbSizeKeyActions(XkbDescPtr xkb,xkbSetMapReq *req)
-#else
-_XkbSizeKeyActions(xkb,req)
- XkbDescPtr xkb;
- xkbSetMapReq * req;
-#endif
{
int i,len,nActs;
@@ -207,14 +175,7 @@ _XkbSizeKeyActions(xkb,req)
}
static void
-#if NeedFunctionPrototypes
_XkbWriteKeyActions(Display *dpy,XkbDescPtr xkb,xkbSetMapReq *req)
-#else
-_XkbWriteKeyActions(dpy,xkb,req)
- Display * dpy;
- XkbDescPtr xkb;
- xkbSetMapReq * req;
-#endif
{
register int i;
int n;
@@ -245,13 +206,7 @@ _XkbWriteKeyActions(dpy,xkb,req)
}
static int
-#if NeedFunctionPrototypes
_XkbSizeKeyBehaviors(XkbDescPtr xkb,xkbSetMapReq *req)
-#else
-_XkbSizeKeyBehaviors(xkb,req)
- XkbDescPtr xkb;
- xkbSetMapReq * req;
-#endif
{
register int i,first,last,nFound;
@@ -272,14 +227,7 @@ register int i,first,last,nFound;
}
static void
-#if NeedFunctionPrototypes
_XkbWriteKeyBehaviors(Display *dpy,XkbDescPtr xkb,xkbSetMapReq *req)
-#else
-_XkbWriteKeyBehaviors(dpy,xkb,req)
- Display * dpy;
- XkbDescPtr xkb;
- xkbSetMapReq * req;
-#endif
{
register int i,first,last;
xkbBehaviorWireDesc * wire;
@@ -306,12 +254,7 @@ char * buf;
}
static unsigned
-#if NeedFunctionPrototypes
_XkbSizeVirtualMods(xkbSetMapReq *req)
-#else
-_XkbSizeVirtualMods(req)
- xkbSetMapReq * req;
-#endif
{
register int i,bit,nMods;
@@ -328,18 +271,10 @@ register int i,bit,nMods;
}
static void
-#if NeedFunctionPrototypes
_XkbWriteVirtualMods( Display * dpy,
XkbDescPtr xkb,
xkbSetMapReq * req,
unsigned size)
-#else
-_XkbWriteVirtualMods(dpy,xkb,req,size)
- Display * dpy;
- XkbDescPtr xkb;
- xkbSetMapReq * req;
- unsigned size;
-#endif
{
register int i,bit;
CARD8 *vmods;
@@ -356,13 +291,7 @@ _XkbWriteVirtualMods(dpy,xkb,req,size)
}
static int
-#if NeedFunctionPrototypes
_XkbSizeKeyExplicit(XkbDescPtr xkb,xkbSetMapReq *req)
-#else
-_XkbSizeKeyExplicit(xkb,req)
- XkbDescPtr xkb;
- xkbSetMapReq * req;
-#endif
{
register int i,first,last,nFound;
@@ -384,14 +313,7 @@ register int i,first,last,nFound;
}
static void
-#if NeedFunctionPrototypes
_XkbWriteKeyExplicit(Display *dpy,XkbDescPtr xkb,xkbSetMapReq *req)
-#else
-_XkbWriteKeyExplicit(dpy,xkb,req)
- Display * dpy;
- XkbDescPtr xkb;
- xkbSetMapReq * req;
-#endif
{
register int i,first,last;
CARD8 * wire;
@@ -413,13 +335,7 @@ CARD8 * wire;
}
static int
-#if NeedFunctionPrototypes
_XkbSizeModifierMap(XkbDescPtr xkb,xkbSetMapReq *req)
-#else
-_XkbSizeModifierMap(xkb,req)
- XkbDescPtr xkb;
- xkbSetMapReq * req;
-#endif
{
register int i,first,last,nFound;
@@ -441,14 +357,7 @@ register int i,first,last,nFound;
}
static void
-#if NeedFunctionPrototypes
_XkbWriteModifierMap(Display *dpy,XkbDescPtr xkb,xkbSetMapReq *req)
-#else
-_XkbWriteModifierMap(dpy,xkb,req)
- Display * dpy;
- XkbDescPtr xkb;
- xkbSetMapReq * req;
-#endif
{
register int i,first,last;
CARD8 * wire;
@@ -472,13 +381,7 @@ CARD8 * wire;
}
static int
-#if NeedFunctionPrototypes
_XkbSizeVirtualModMap(XkbDescPtr xkb,xkbSetMapReq *req)
-#else
-_XkbSizeVirtualModMap(xkb,req)
- XkbDescPtr xkb;
- xkbSetMapReq * req;
-#endif
{
register int i,first,last,nFound;
@@ -500,14 +403,7 @@ register int i,first,last,nFound;
}
static void
-#if NeedFunctionPrototypes
_XkbWriteVirtualModMap(Display *dpy,XkbDescPtr xkb,xkbSetMapReq *req)
-#else
-_XkbWriteVirtualModMap(dpy,xkb,req)
- Display * dpy;
- XkbDescPtr xkb;
- xkbSetMapReq * req;
-#endif
{
register int i,first,last;
xkbVModMapWireDesc * wire;
@@ -531,14 +427,7 @@ xkbVModMapWireDesc * wire;
}
static void
-#if NeedFunctionPrototypes
SendSetMap(Display *dpy,XkbDescPtr xkb,xkbSetMapReq *req)
-#else
-SendSetMap(dpy,xkb,req)
- Display * dpy;
- XkbDescPtr xkb;
- xkbSetMapReq * req;
-#endif
{
xkbSetMapReq tmp;
unsigned szMods;
@@ -574,14 +463,7 @@ unsigned szMods;
}
Bool
-#if NeedFunctionPrototypes
XkbSetMap(Display *dpy,unsigned which,XkbDescPtr xkb)
-#else
-XkbSetMap(dpy,which,xkb)
- Display * dpy;
- unsigned which;
- XkbDescPtr xkb;
-#endif
{
register xkbSetMapReq * req;
XkbInfoPtr xkbi;
@@ -651,14 +533,7 @@ XkbClientMapPtr map;
}
Bool
-#if NeedFunctionPrototypes
XkbChangeMap(Display *dpy,XkbDescPtr xkb,XkbMapChangesPtr changes)
-#else
-XkbChangeMap(dpy,xkb,changes)
- Display * dpy;
- XkbDescPtr xkb;
- XkbMapChangesPtr changes;
-#endif
{
register xkbSetMapReq * req;
XkbInfoPtr xkbi;
diff --git a/src/xkb/XKBUse.c b/src/xkb/XKBUse.c
index 9e7966b..bfbb9ff 100644
--- a/src/xkb/XKBUse.c
+++ b/src/xkb/XKBUse.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/XKBUse.c,v 3.6 2001/08/13 17:46:02 dawes Exp $ */
+/* $XFree86: xc/lib/X11/XKBUse.c,v 3.8 2003/11/17 22:20:10 dawes Exp $ */
#include <stdio.h>
#include <ctype.h>
@@ -37,14 +37,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
static Bool _XkbIgnoreExtension = False;
void
-#if NeedFunctionPrototypes
XkbNoteMapChanges(XkbMapChangesPtr old,XkbMapNotifyEvent *new,unsigned wanted)
-#else
-XkbNoteMapChanges(old,new,wanted)
- XkbMapChangesPtr old;
- XkbMapNotifyEvent * new;
- unsigned int wanted;
-#endif
{
int first,oldLast,newLast;
wanted&= new->changed;
@@ -183,16 +176,9 @@ XkbNoteMapChanges(old,new,wanted)
}
void
-#if NeedFunctionPrototypes
_XkbNoteCoreMapChanges( XkbMapChangesPtr old,
XMappingEvent * new,
unsigned int wanted)
-#else
-_XkbNoteCoreMapChanges(old,new,wanted)
- XkbMapChangesPtr old;
- XMappingEvent * new;
- unsigned int wanted;
-#endif
{
int first,oldLast,newLast;
@@ -219,14 +205,7 @@ _XkbNoteCoreMapChanges(old,new,wanted)
}
static Bool
-#if NeedFunctionPrototypes
wire_to_event(Display *dpy,XEvent *re,xEvent *event)
-#else
-wire_to_event(dpy,re,event)
- Display *dpy;
- XEvent *re;
- xEvent *event;
-#endif
{
xkbEvent *xkbevent= (xkbEvent *)event;
XkbInfoPtr xkbi;
@@ -612,12 +591,7 @@ wire_to_event(dpy,re,event)
}
Bool
-#if NeedFunctionPrototypes
XkbIgnoreExtension(Bool ignore)
-#else
-XkbIgnoreExtension(ignore)
- Bool ignore;
-#endif
{
if (getenv("XKB_FORCE")!=NULL) {
#ifdef DEBUG
@@ -635,12 +609,7 @@ XkbIgnoreExtension(ignore)
}
static void
-#if NeedFunctionPrototypes
_XkbFreeInfo(Display *dpy)
-#else
-_XkbFreeInfo(dpy)
- Display *dpy;
-#endif
{
XkbInfoPtr xkbi = dpy->xkb_info;
if (xkbi) {
@@ -651,14 +620,7 @@ _XkbFreeInfo(dpy)
}
Bool
-#if NeedFunctionPrototypes
XkbUseExtension(Display *dpy,int *major_rtrn,int *minor_rtrn)
-#else
-XkbUseExtension(dpy,major_rtrn,minor_rtrn)
- Display * dpy;
- int * major_rtrn;
- int * minor_rtrn;
-#endif
{
xkbUseExtensionReply rep;
register xkbUseExtensionReq *req;
@@ -669,7 +631,7 @@ XkbUseExtension(dpy,major_rtrn,minor_rtrn)
static int debugMsg;
static int been_here= 0;
- if ( dpy->xkb_info && (!dpy->flags&XlibDisplayNoXkb)) {
+ if ( dpy->xkb_info && !(dpy->flags & XlibDisplayNoXkb)) {
if (major_rtrn) *major_rtrn= dpy->xkb_info->srv_major;
if (minor_rtrn) *minor_rtrn= dpy->xkb_info->srv_minor;
return True;
diff --git a/src/xkb/XKBleds.c b/src/xkb/XKBleds.c
index aa6ba3d..41b4f41 100644
--- a/src/xkb/XKBleds.c
+++ b/src/xkb/XKBleds.c
@@ -24,23 +24,17 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
-/* $XFree86: xc/lib/X11/XKBleds.c,v 1.3 2001/02/21 15:18:03 tsi Exp $ */
+/* $XFree86: xc/lib/X11/XKBleds.c,v 1.5 2003/11/17 22:20:10 dawes Exp $ */
#define NEED_REPLIES
#define NEED_EVENTS
+#define NEED_MAP_READERS
#include "Xlibint.h"
#include <X11/extensions/XKBproto.h>
#include "XKBlibint.h"
Status
-#if NeedFunctionPrototypes
XkbGetIndicatorState(Display *dpy,unsigned deviceSpec,unsigned *pStateRtrn)
-#else
-XkbGetIndicatorState(dpy,deviceSpec,pStateRtrn)
- Display * dpy;
- unsigned int deviceSpec;
- unsigned int * pStateRtrn;
-#endif
{
register xkbGetIndicatorStateReq *req;
xkbGetIndicatorStateReply rep;
@@ -65,18 +59,10 @@ XkbGetIndicatorState(dpy,deviceSpec,pStateRtrn)
}
Status
-#if NeedFunctionPrototypes
_XkbReadGetIndicatorMapReply( Display * dpy,
xkbGetIndicatorMapReply * rep,
XkbDescPtr xkb,
int * nread_rtrn)
-#else
-_XkbReadGetIndicatorMapReply(dpy,rep,xkb,nread_rtrn)
- Display * dpy;
- xkbGetIndicatorMapReply * rep;
- XkbDescPtr xkb;
- int * nread_rtrn;
-#endif
{
XkbIndicatorPtr leds;
XkbReadBufferRec buf;
@@ -123,14 +109,7 @@ XkbReadBufferRec buf;
}
Bool
-#if NeedFunctionPrototypes
XkbGetIndicatorMap(Display *dpy,unsigned long which,XkbDescPtr xkb)
-#else
-XkbGetIndicatorMap(dpy,which,xkb)
- Display * dpy;
- unsigned long which;
- XkbDescPtr xkb;
-#endif
{
register xkbGetIndicatorMapReq * req;
xkbGetIndicatorMapReply rep;
@@ -170,14 +149,7 @@ XkbGetIndicatorMap(dpy,which,xkb)
}
Bool
-#if NeedFunctionPrototypes
XkbSetIndicatorMap(Display *dpy,unsigned long which,XkbDescPtr xkb)
-#else
-XkbSetIndicatorMap(dpy,which,xkb)
- Display * dpy;
- unsigned long which;
- XkbDescPtr xkb;
-#endif
{
register xkbSetIndicatorMapReq *req;
register int i,bit;
@@ -222,7 +194,6 @@ XkbSetIndicatorMap(dpy,which,xkb)
}
Bool
-#if NeedFunctionPrototypes
XkbGetNamedDeviceIndicator( Display * dpy,
unsigned device,
unsigned class,
@@ -232,19 +203,6 @@ XkbGetNamedDeviceIndicator( Display * dpy,
Bool * pStateRtrn,
XkbIndicatorMapPtr pMapRtrn,
Bool * pRealRtrn)
-#else
-XkbGetNamedDeviceIndicator(dpy,device,class,id,name,pNdxRtrn,pStateRtrn,
- pMapRtrn,pRealRtrn)
- Display * dpy;
- unsigned device;
- unsigned class;
- unsigned id;
- Atom name;
- int * pNdxRtrn;
- Bool * pStateRtrn;
- XkbIndicatorMapPtr pMapRtrn;
- Bool * pRealRtrn;
-#endif
{
register xkbGetNamedIndicatorReq *req;
xkbGetNamedIndicatorReply rep;
@@ -289,22 +247,12 @@ XkbGetNamedDeviceIndicator(dpy,device,class,id,name,pNdxRtrn,pStateRtrn,
}
Bool
-#if NeedFunctionPrototypes
XkbGetNamedIndicator( Display * dpy,
Atom name,
int * pNdxRtrn,
Bool * pStateRtrn,
XkbIndicatorMapPtr pMapRtrn,
Bool * pRealRtrn)
-#else
-XkbGetNamedIndicator(dpy,name,pNdxRtrn,pStateRtrn,pMapRtrn,pRealRtrn)
- Display * dpy;
- Atom name;
- int * pNdxRtrn;
- Bool * pStateRtrn;
- XkbIndicatorMapPtr pMapRtrn;
- Bool * pRealRtrn;
-#endif
{
return XkbGetNamedDeviceIndicator(dpy,XkbUseCoreKbd,
XkbDfltXIClass,XkbDfltXIId,
@@ -313,7 +261,6 @@ XkbGetNamedIndicator(dpy,name,pNdxRtrn,pStateRtrn,pMapRtrn,pRealRtrn)
}
Bool
-#if NeedFunctionPrototypes
XkbSetNamedDeviceIndicator( Display * dpy,
unsigned device,
unsigned class,
@@ -323,19 +270,6 @@ XkbSetNamedDeviceIndicator( Display * dpy,
Bool state,
Bool createNewMap,
XkbIndicatorMapPtr pMap)
-#else
-XkbSetNamedDeviceIndicator(dpy,device,class,id,name,changeState,
- state,createNewMap,pMap)
- Display * dpy;
- unsigned device;
- unsigned class;
- unsigned id;
- Atom name;
- Bool changeState;
- Bool state;
- Bool createNewMap;
- XkbIndicatorMapPtr pMap;
-#endif
{
register xkbSetNamedIndicatorReq *req;
XkbInfoPtr xkbi;
@@ -384,22 +318,12 @@ XkbSetNamedDeviceIndicator(dpy,device,class,id,name,changeState,
}
Bool
-#if NeedFunctionPrototypes
XkbSetNamedIndicator( Display * dpy,
Atom name,
Bool changeState,
Bool state,
Bool createNewMap,
XkbIndicatorMapPtr pMap)
-#else
-XkbSetNamedIndicator(dpy,name,changeState,state,createNewMap,pMap)
- Display * dpy;
- Atom name;
- Bool changeState;
- Bool state;
- Bool createNewMap;
- XkbIndicatorMapPtr pMap;
-#endif
{
return XkbSetNamedDeviceIndicator(dpy,XkbUseCoreKbd,
XkbDfltXIClass,XkbDfltXIId,
diff --git a/src/xkb/XKBlibint.h b/src/xkb/XKBlibint.h
index b287cf6..06d8d48 100644
--- a/src/xkb/XKBlibint.h
+++ b/src/xkb/XKBlibint.h
@@ -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/XKBlibint.h,v 3.4 2001/01/17 19:41:49 dawes Exp $ */
+/* $XFree86: xc/lib/X11/XKBlibint.h,v 3.6 2003/11/17 22:20:10 dawes Exp $ */
#ifndef _XKBLIBINT_H_
#define _XKBLIBINT_H_
@@ -36,28 +36,22 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#define XkbXlibNewKeyboard (1<<1)
typedef int (*XkbKSToMBFunc)(
-#if NeedFunctionPrototypes
XPointer /* priv */,
KeySym /* sym */,
char * /* buf */,
int /* len */,
int * /* extra_rtrn */
-#endif
);
typedef KeySym (*XkbMBToKSFunc)(
-#if NeedFunctionPrototypes
XPointer /* priv */,
char * /* buf */,
int /* len */,
Status * /* status */
-#endif
);
typedef KeySym (*XkbToUpperFunc)(
-#if NeedFunctionPrototypes
KeySym /* sym */
-#endif
);
typedef struct _XkbConverters {
@@ -141,131 +135,103 @@ typedef struct _XkbReadBuffer {
_XFUNCPROTOBEGIN
extern void _XkbReloadDpy(
-#if NeedFunctionPrototypes
Display * /* dpy */
-#endif
);
extern KeySym _XKeycodeToKeysym(
-#if NeedFunctionPrototypes
Display* /* display */,
+#if NeedWidePrototypes
+ unsigned int /* keycode */,
+#else
KeyCode /* keycode */,
- int /* index */
#endif
+ int /* index */
);
extern KeyCode _XKeysymToKeycode(
-#if NeedFunctionPrototypes
Display* /* display */,
KeySym /* keysym */
-#endif
);
extern KeySym _XLookupKeysym(
-#if NeedFunctionPrototypes
XKeyEvent* /* key_event */,
int /* index */
-#endif
);
extern int _XRefreshKeyboardMapping(
-#if NeedFunctionPrototypes
XMappingEvent* /* event_map */
-#endif
);
extern unsigned _XKeysymToModifiers(
-#if NeedFunctionPrototypes
Display * /* dpy */,
KeySym /* ks */
-#endif
);
extern int _XTranslateKey(
-#if NeedFunctionPrototypes
register Display * /* dpy */,
KeyCode /* keycode */,
register unsigned int /* modifiers */,
unsigned int * /* modifiers_return */,
KeySym * /* keysym_return */
-#endif
);
extern int _XTranslateKeySym(
-#if NeedFunctionPrototypes
Display * /* dpy */,
register KeySym /* symbol */,
unsigned int /* modifiers */,
char * /* buffer */,
int /* nbytes */
-#endif
);
extern int _XLookupString(
-#if NeedFunctionPrototypes
register XKeyEvent * /* event */,
char * /* buffer */,
int /* nbytes */,
KeySym * /* keysym */,
XComposeStatus * /* status */
-#endif
);
extern void _XkbNoteCoreMapChanges(
-#if NeedFunctionPrototypes
XkbMapChangesRec * /* old */,
XMappingEvent * /* new */,
unsigned int /* wanted */
-#endif
);
extern int _XkbInitReadBuffer(
-#if NeedFunctionPrototypes
Display * /* dpy */,
XkbReadBufferPtr /* buf */,
int /* size */
-#endif
);
extern int _XkbSkipReadBufferData(
-#if NeedFunctionPrototypes
XkbReadBufferPtr /* from */,
int /* size */
-#endif
);
extern int _XkbCopyFromReadBuffer(
-#if NeedFunctionPrototypes
XkbReadBufferPtr /* from */,
char * /* to */,
int /* size */
-#endif
);
#if defined(WORD64) || defined(LONG64)
extern int _XkbReadCopyData32(
-#if NeedFunctionPrototypes
int * /* from */,
long * /* to */,
int /* num_words */
-#endif
);
extern int _XkbWriteCopyData32(
-#if NeedFunctionPrototypes
unsigned long * /* from */,
CARD32 * /* to */,
int /* num_words */
-#endif
);
extern int _XkbReadBufferCopy32(
-#if NeedFunctionPrototypes
XkbReadBufferPtr /* from */,
long * /* to */,
int /* size */
-#endif
);
#else
#define _XkbReadCopyData32(f,t,s) memcpy((char *)(t),(char *)(f),(s)*4)
@@ -279,23 +245,18 @@ extern int _XkbReadBufferCopy32(
#ifdef XKB_FORCE_INT_KEYSYM
extern int _XkbReadCopyKeySyms(
-#if NeedFunctionPrototypes
int * /* from */,
KeySym * /* to */,
int /* num_words */
-#endif
);
extern int _XkbWriteCopyKeySyms(
-#if NeedFunctionPrototypes
KeySym * /* from */,
CARD32 * /* to */,
int /* num_words */
-#endif
);
extern int _XkbReadBufferCopyKeySyms(
-#if NeedFunctionPrototypes
XkbReadBufferPtr /* from */,
#ifndef NO_DEC_BUG_FIX
KeySym * /* to */,
@@ -303,7 +264,6 @@ extern int _XkbReadBufferCopyKeySyms(
long * /* to */,
#endif
int /* size */
-#endif
);
#else
#define _XkbReadCopyKeySyms(f,t,n) _XkbReadCopyData32(f,t,n)
@@ -312,92 +272,70 @@ extern int _XkbReadBufferCopyKeySyms(
#endif
extern char *_XkbPeekAtReadBuffer(
-#if NeedFunctionPrototypes
XkbReadBufferPtr /* from */,
int /* size */
-#endif
);
extern char *_XkbGetReadBufferPtr(
-#if NeedFunctionPrototypes
XkbReadBufferPtr /* from */,
int /* size */
-#endif
);
#define _XkbGetTypedRdBufPtr(b,n,t) ((t *)_XkbGetReadBufferPtr(b,(n)*SIZEOF(t)))
extern int _XkbFreeReadBuffer(
-#if NeedFunctionPrototypes
XkbReadBufferPtr /* buf */
-#endif
);
extern Bool
_XkbGetReadBufferCountedString(
-#if NeedFunctionPrototypes
XkbReadBufferPtr /* buf */,
char ** /* rtrn */
-#endif
);
extern char *_XkbGetCharset(
-#if NeedFunctionPrototypes
void
-#endif
);
extern int _XkbGetConverters(
-#if NeedFunctionPrototypes
char * /* encoding_name */,
XkbConverters * /* cvt_rtrn */
-#endif
);
#ifdef NEED_MAP_READERS
extern Status _XkbReadGetMapReply(
-#if NeedFunctionPrototypes
Display * /* dpy */,
xkbGetMapReply * /* rep */,
XkbDescRec * /* xkb */,
int * /* nread_rtrn */
-#endif
);
extern Status _XkbReadGetCompatMapReply(
-#if NeedFunctionPrototypes
Display * /* dpy */,
xkbGetCompatMapReply * /* rep */,
XkbDescPtr /* xkb */,
int * /* nread_rtrn */
-#endif
);
extern Status _XkbReadGetIndicatorMapReply(
-#if NeedFunctionPrototypes
Display * /* dpy */,
xkbGetIndicatorMapReply * /* rep */,
XkbDescPtr /* xkb */,
int * /* nread_rtrn */
-#endif
);
extern Status _XkbReadGetNamesReply(
-#if NeedFunctionPrototypes
Display * /* dpy */,
xkbGetNamesReply * /* rep */,
XkbDescPtr /* xkb */,
int * /* nread_rtrn */
-#endif
);
extern Status _XkbReadGetGeometryReply(
-#if NeedFunctionPrototypes
Display * /* dpy */,
xkbGetGeometryReply * /* rep */,
XkbDescPtr /* xkb */,
int * /* nread_rtrn */
-#endif
);
#endif
diff --git a/src/xlibi18n/ICWrap.c b/src/xlibi18n/ICWrap.c
index fcd2563..9b63519 100644
--- a/src/xlibi18n/ICWrap.c
+++ b/src/xlibi18n/ICWrap.c
@@ -64,16 +64,16 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/lib/X11/ICWrap.c,v 1.8 2002/11/25 14:04:53 eich Exp $ */
+/* $XFree86: xc/lib/X11/ICWrap.c,v 1.10 2003/04/25 14:12:38 tsi Exp $ */
#define NEED_EVENTS
#include "Xlibint.h"
#include "Xlcint.h"
static int
-_XIMNestedListToNestedList(nlist, list)
- XIMArg *nlist; /* This is the new list */
- XIMArg *list; /* The original list */
+_XIMNestedListToNestedList(
+ XIMArg *nlist, /* This is the new list */
+ XIMArg *list) /* The original list */
{
register XIMArg *ptr = list;
@@ -91,9 +91,9 @@ _XIMNestedListToNestedList(nlist, list)
}
static void
-_XIMCountNestedList(args, total_count)
- XIMArg *args;
- int *total_count;
+_XIMCountNestedList(
+ XIMArg *args,
+ int *total_count)
{
for (; args->name; args++) {
if (!strcmp(args->name, XNVaNestedList))
@@ -395,9 +395,9 @@ Xutf8ResetIC(ic)
XIC ic;
{
if (ic->core.im) {
- if (*ic->methods->utf8_reset)
+ if (ic->methods->utf8_reset)
return (*ic->methods->utf8_reset)(ic);
- else if (*ic->methods->mb_reset)
+ else if (ic->methods->mb_reset)
return (*ic->methods->mb_reset)(ic);
}
return (char *)NULL;
@@ -443,10 +443,10 @@ Xutf8LookupString(ic, ev, buffer, nbytes, keysym, status)
Status *status;
{
if (ic->core.im) {
- if (*ic->methods->utf8_lookup_string)
+ if (ic->methods->utf8_lookup_string)
return (*ic->methods->utf8_lookup_string) (ic, ev, buffer, nbytes,
keysym, status);
- else if (*ic->methods->mb_lookup_string)
+ else if (ic->methods->mb_lookup_string)
return (*ic->methods->mb_lookup_string) (ic, ev, buffer, nbytes,
keysym, status);
}
diff --git a/src/xlibi18n/IMWrap.c b/src/xlibi18n/IMWrap.c
index b9f8f60..59524a4 100644
--- a/src/xlibi18n/IMWrap.c
+++ b/src/xlibi18n/IMWrap.c
@@ -57,7 +57,7 @@ from The Open Group.
*/
-/* $XFree86: xc/lib/X11/IMWrap.c,v 3.8 2001/12/14 19:54:01 dawes Exp $ */
+/* $XFree86: xc/lib/X11/IMWrap.c,v 3.9 2003/11/17 22:20:07 dawes Exp $ */
#include "Xlibint.h"
#include "Xlcint.h"
@@ -176,7 +176,6 @@ XLocaleOfIM(im)
* on-demand input method instantiation.
*/
Bool
-#if NeedFunctionPrototypes
XRegisterIMInstantiateCallback(
Display *display,
XrmDatabase rdb,
@@ -184,16 +183,6 @@ XRegisterIMInstantiateCallback(
char *res_class,
XIDProc callback,
XPointer client_data)
-#else
-XRegisterIMInstantiateCallback( display, rdb, res_name, res_class, callback,
- client_data)
- Display *display;
- XrmDatabase rdb;
- char *res_name;
- char *res_class;
- XIDProc callback;
- XPointer client_data;
-#endif
{
XLCd lcd = _XOpenLC( (char *)NULL );
@@ -208,7 +197,6 @@ XRegisterIMInstantiateCallback( display, rdb, res_name, res_class, callback,
* Unregister to a input method instantiation callback.
*/
Bool
-#if NeedFunctionPrototypes
XUnregisterIMInstantiateCallback(
Display *display,
XrmDatabase rdb,
@@ -216,16 +204,6 @@ XUnregisterIMInstantiateCallback(
char *res_class,
XIDProc callback,
XPointer client_data)
-#else
-XUnregisterIMInstantiateCallback( display, rdb, res_name, res_class, callback,
- client_data )
- Display *display;
- XrmDatabase rdb;
- char *res_name;
- char *res_class;
- XIDProc callback;
- XPointer client_data;
-#endif
{
XLCd lcd = _XlcCurrentLC();
diff --git a/src/xlibi18n/XDefaultIMIF.c b/src/xlibi18n/XDefaultIMIF.c
index bf2e701..5295abe 100644
--- a/src/xlibi18n/XDefaultIMIF.c
+++ b/src/xlibi18n/XDefaultIMIF.c
@@ -41,7 +41,7 @@ interest in or to any trademark, service mark, logo or trade name of
Sun Microsystems, Inc. or its licensors is granted.
*/
-/* $XFree86: xc/lib/X11/XDefaultIMIF.c,v 1.2 2001/11/19 15:33:38 tsi Exp $ */
+/* $XFree86: xc/lib/X11/XDefaultIMIF.c,v 1.4 2003/11/17 22:20:08 dawes Exp $ */
#include <stdio.h>
#define NEED_EVENTS
@@ -74,27 +74,19 @@ typedef struct _StaticXIM {
} StaticXIMRec;
static Status _CloseIM(
-#if NeedFunctionPrototypes
XIM
-#endif
);
static char *_SetIMValues(
-#if NeedFunctionPrototypes
XIM, XIMArg *
-#endif
);
static char *_GetIMValues(
-#if NeedFunctionPrototypes
XIM, XIMArg*
-#endif
);
static XIC _CreateIC(
-#if NeedFunctionPrototypes
XIM, XIMArg*
-#endif
);
static _Xconst XIMMethodsRec local_im_methods = {
@@ -107,49 +99,31 @@ static _Xconst XIMMethodsRec local_im_methods = {
};
static void _DestroyIC(
-#if NeedFunctionPrototypes
XIC
-#endif
);
static void _SetFocus(
-#if NeedFunctionPrototypes
XIC
-#endif
);
static void _UnsetFocus(
-#if NeedFunctionPrototypes
XIC
-#endif
);
static char* _SetICValues(
-#if NeedFunctionPrototypes
XIC, XIMArg *
-#endif
);
static char* _GetICValues(
-#if NeedFunctionPrototypes
XIC, XIMArg *
-#endif
);
static char *_MbReset(
-#if NeedFunctionPrototypes
XIC
-#endif
);
static wchar_t *_WcReset(
-#if NeedFunctionPrototypes
XIC
-#endif
);
static int _MbLookupString(
-#if NeedFunctionPrototypes
XIC, XKeyEvent *, char *, int, KeySym *, Status *
-#endif
);
static int _WcLookupString(
-#if NeedFunctionPrototypes
XIC, XKeyEvent *, wchar_t *, int, KeySym *, Status *
-#endif
);
static _Xconst XICMethodsRec local_ic_methods = {
@@ -167,11 +141,12 @@ static _Xconst XICMethodsRec local_ic_methods = {
};
XIM
-_XDefaultOpenIM(lcd, dpy, rdb, res_name, res_class)
-XLCd lcd;
-Display *dpy;
-XrmDatabase rdb;
-char *res_name, *res_class;
+_XDefaultOpenIM(
+ XLCd lcd,
+ Display *dpy,
+ XrmDatabase rdb,
+ char *res_name,
+ char *res_class)
{
StaticXIM im;
XIMStaticXIMRec *local_impart;
@@ -251,8 +226,7 @@ Error2 :
}
static Status
-_CloseIM(xim)
-XIM xim;
+_CloseIM(XIM xim)
{
StaticXIM im = (StaticXIM)xim;
_XlcCloseConverter(im->private->ctom_conv);
@@ -296,10 +270,7 @@ XIMArg *values;
}
static char*
-_SetICValueData(ic, values, mode)
-XIC ic;
-XIMArg *values;
-XICOp_t mode;
+_SetICValueData(XIC ic, XIMArg *values, XICOp_t mode)
{
XIMArg *p;
char *return_name = NULL;
@@ -325,10 +296,7 @@ XICOp_t mode;
}
static char*
-_GetICValueData(ic, values, mode)
-XIC ic;
-XIMArg *values;
-XICOp_t mode;
+_GetICValueData(XIC ic, XIMArg *values, XICOp_t mode)
{
XIMArg *p;
char *return_name = NULL;
@@ -355,9 +323,7 @@ XICOp_t mode;
}
static XIC
-_CreateIC(im, arg)
-XIM im;
-XIMArg *arg;
+_CreateIC(XIM im, XIMArg *arg)
{
XIC ic;
@@ -381,9 +347,8 @@ err_return:
return ((XIC)NULL);
}
-static void
-_DestroyIC(ic)
-XIC ic;
+static void
+_DestroyIC(XIC ic)
{
/*BugId4255571. This Xfree() should be removed because XDestroyIC() still need ic after invoking _DestroyIC() and there is a XFree(ic) at the end of XDestroyIC() already.
if(ic)
@@ -397,15 +362,12 @@ XIC ic;
}
static void
-_UnsetFocus(ic)
-XIC ic;
+_UnsetFocus(XIC ic)
{
}
static char*
-_SetICValues(ic, args)
-XIC ic;
-XIMArg *args;
+_SetICValues(XIC ic, XIMArg *args)
{
char *ret = NULL;
if (!ic) {
@@ -416,9 +378,7 @@ XIMArg *args;
}
static char*
-_GetICValues(ic, args)
-XIC ic;
-XIMArg *args;
+_GetICValues(XIC ic, XIMArg *args)
{
char *ret = NULL;
if (!ic) {
@@ -429,27 +389,25 @@ XIMArg *args;
}
static char *
-_MbReset(xic)
-XIC xic;
+_MbReset(XIC xic)
{
return(NULL);
}
static wchar_t *
-_WcReset(xic)
-XIC xic;
+_WcReset(XIC xic)
{
return(NULL);
}
static int
-_MbLookupString(xic, ev, buffer, bytes, keysym, status)
-XIC xic;
-XKeyEvent *ev;
-char * buffer;
-int bytes;
-KeySym *keysym;
-Status *status;
+_MbLookupString(
+ XIC xic,
+ XKeyEvent *ev,
+ char * buffer,
+ int bytes,
+ KeySym *keysym,
+ Status *status)
{
XComposeStatus NotSupportedYet ;
int length;
@@ -467,13 +425,13 @@ Status *status;
}
static int
-_WcLookupString(xic, ev, buffer, wlen, keysym, status)
-XIC xic;
-XKeyEvent *ev;
-wchar_t * buffer;
-int wlen;
-KeySym *keysym;
-Status *status;
+_WcLookupString(
+ XIC xic,
+ XKeyEvent *ev,
+ wchar_t * buffer,
+ int wlen,
+ KeySym *keysym,
+ Status *status)
{
XComposeStatus NotSupportedYet ;
int length;
diff --git a/src/xlibi18n/XDefaultOMIF.c b/src/xlibi18n/XDefaultOMIF.c
index 15e6b82..ce5e474 100644
--- a/src/xlibi18n/XDefaultOMIF.c
+++ b/src/xlibi18n/XDefaultOMIF.c
@@ -41,7 +41,7 @@ interest in or to any trademark, service mark, logo or trade name of
Sun Microsystems, Inc. or its licensors is granted.
*/
-/* $XFree86: xc/lib/X11/XDefaultOMIF.c,v 1.3 2002/09/18 17:11:42 tsi Exp $ */
+/* $XFree86: xc/lib/X11/XDefaultOMIF.c,v 1.6 2003/11/17 22:20:09 dawes Exp $ */
#include "Xlibint.h"
#include "Xlcint.h"
@@ -99,8 +99,8 @@ typedef struct _XOCGenericRec {
} XOCGenericRec, *XOCGeneric;
static Bool
-init_fontset(oc)
- XOC oc;
+init_fontset(
+ XOC oc)
{
XOCGenericPart *gen;
FontSet font_set;
@@ -123,9 +123,9 @@ init_fontset(oc)
}
static char *
-get_prop_name(dpy, fs)
- Display *dpy;
- XFontStruct *fs;
+get_prop_name(
+ Display *dpy,
+ XFontStruct *fs)
{
unsigned long fp;
@@ -136,9 +136,9 @@ get_prop_name(dpy, fs)
}
static FontData
-check_charset(font_set, font_name)
- FontSet font_set;
- char *font_name;
+check_charset(
+ FontSet font_set,
+ char *font_name)
{
FontData font_data;
char *last;
@@ -165,9 +165,9 @@ check_charset(font_set, font_name)
#if 0 /* Unused */
static int
-check_fontname(oc, name)
-XOC oc;
-char *name;
+check_fontname(
+ XOC oc,
+ char *name)
{
Display *dpy = oc->core.om->core.display;
XOCGenericPart *gen = XOC_GENERIC(oc);
@@ -220,8 +220,8 @@ char *name;
#endif
static Bool
-load_font(oc)
- XOC oc;
+load_font(
+ XOC oc)
{
Display *dpy = oc->core.om->core.display;
XOCGenericPart *gen = XOC_GENERIC(oc);
@@ -238,9 +238,10 @@ load_font(oc)
return True;
}
+#if 0
static Bool
-load_font_info(oc)
- XOC oc;
+load_font_info(
+ XOC oc)
{
Display *dpy = oc->core.om->core.display;
XOCGenericPart *gen = XOC_GENERIC(oc);
@@ -263,10 +264,11 @@ load_font_info(oc)
}
return True;
}
+#endif
static void
-set_fontset_extents(oc)
- XOC oc;
+set_fontset_extents(
+ XOC oc)
{
XRectangle *ink = &oc->core.font_set_extents.max_ink_extent;
XRectangle *logical = &oc->core.font_set_extents.max_logical_extent;
@@ -293,8 +295,8 @@ set_fontset_extents(oc)
}
static Bool
-init_core_part(oc)
- XOC oc;
+init_core_part(
+ XOC oc)
{
XOCGenericPart *gen = XOC_GENERIC(oc);
FontSet font_set;
@@ -355,9 +357,9 @@ err:
}
static char *
-get_font_name(oc, pattern)
- XOC oc;
- char *pattern;
+get_font_name(
+ XOC oc,
+ char *pattern)
{
char **list, *name, *prop_name;
int count;
@@ -388,8 +390,8 @@ get_font_name(oc, pattern)
}
static int
-parse_fontname(oc)
- XOC oc;
+parse_fontname(
+ XOC oc)
{
XOCGenericPart *gen = XOC_GENERIC(oc);
FontSet font_set;
@@ -550,8 +552,8 @@ err:
}
static Bool
-set_missing_list(oc)
- XOC oc;
+set_missing_list(
+ XOC oc)
{
XOCGenericPart *gen = XOC_GENERIC(oc);
FontSet font_set;
@@ -592,8 +594,8 @@ set_missing_list(oc)
}
static Bool
-create_fontset(oc)
- XOC oc;
+create_fontset(
+ XOC oc)
{
int found_num;
@@ -620,8 +622,8 @@ create_fontset(oc)
}
static void
-destroy_oc(oc)
- XOC oc;
+destroy_oc(
+ XOC oc)
{
Display *dpy = oc->core.om->core.display;
XOCGenericPart *gen = XOC_GENERIC(oc);
@@ -660,10 +662,10 @@ destroy_oc(oc)
}
static char *
-set_oc_values(oc, args, num_args)
- XOC oc;
- XlcArgList args;
- int num_args;
+set_oc_values(
+ XOC oc,
+ XlcArgList args,
+ int num_args)
{
if (oc->core.resources == NULL)
return NULL;
@@ -673,10 +675,10 @@ set_oc_values(oc, args, num_args)
}
static char *
-get_oc_values(oc, args, num_args)
- XOC oc;
- XlcArgList args;
- int num_args;
+get_oc_values(
+ XOC oc,
+ XlcArgList args,
+ int num_args)
{
if (oc->core.resources == NULL)
return NULL;
@@ -686,11 +688,11 @@ get_oc_values(oc, args, num_args)
}
static Bool
-wcs_to_mbs(oc, to, from, length)
- XOC oc;
- char *to;
- _Xconst wchar_t *from;
- int length;
+wcs_to_mbs(
+ XOC oc,
+ char *to,
+ _Xconst wchar_t *from,
+ int length)
{
XlcConv conv = XOC_GENERIC(oc)->wcs_to_cs;
XLCd lcd;
@@ -714,27 +716,13 @@ wcs_to_mbs(oc, to, from, length)
}
static int
-#if NeedFunctionPrototypes
_XmbDefaultTextEscapement(XOC oc, _Xconst char *text, int length)
-#else
-_XmbDefaultTextEscapement(oc, text, length)
- XOC oc;
- char *text;
- int length;
-#endif
{
return XTextWidth(*oc->core.font_info.font_struct_list, text, length);
}
static int
-#if NeedFunctionPrototypes
_XwcDefaultTextEscapement(XOC oc, _Xconst wchar_t *text, int length)
-#else
-_XwcDefaultTextEscapement(oc, text, length)
- XOC oc;
- wchar_t *text;
- int length;
-#endif
{
DefineLocalBuf;
char *buf = AllocLocalBuf(length);
@@ -755,17 +743,8 @@ err:
}
static int
-#if NeedFunctionPrototypes
_XmbDefaultTextExtents(XOC oc, _Xconst char *text, int length,
XRectangle *overall_ink, XRectangle *overall_logical)
-#else
-_XmbDefaultTextExtents(oc, text, length, overall_ink, overall_logical)
- XOC oc;
- char *text;
- int length;
- XRectangle *overall_ink;
- XRectangle *overall_logical;
-#endif
{
int direction, logical_ascent, logical_descent;
XCharStruct overall;
@@ -791,17 +770,8 @@ _XmbDefaultTextExtents(oc, text, length, overall_ink, overall_logical)
}
static int
-#if NeedFunctionPrototypes
_XwcDefaultTextExtents(XOC oc, _Xconst wchar_t *text, int length,
XRectangle *overall_ink, XRectangle *overall_logical)
-#else
-_XwcDefaultTextExtents(oc, text, length, overall_ink, overall_logical)
- XOC oc;
- wchar_t *text;
- int length;
- XRectangle *overall_ink;
- XRectangle *overall_logical;
-#endif
{
DefineLocalBuf;
char *buf = AllocLocalBuf(length);
@@ -822,25 +792,11 @@ err:
}
static Status
-#if NeedFunctionPrototypes
_XmbDefaultTextPerCharExtents(XOC oc, _Xconst char *text, int length,
XRectangle *ink_buf, XRectangle *logical_buf,
int buf_size, int *num_chars,
XRectangle *overall_ink,
XRectangle *overall_logical)
-#else
-_XmbDefaultTextPerCharExtents(oc, text, length, ink_buf, logical_buf, buf_size,
- num_chars, overall_ink, overall_logical)
- XOC oc;
- char *text;
- int length;
- XRectangle *ink_buf;
- XRectangle *logical_buf;
- int buf_size;
- int *num_chars;
- XRectangle *overall_ink;
- XRectangle *overall_logical;
-#endif
{
XFontStruct *font = *oc->core.font_info.font_struct_list;
XCharStruct *def, *cs, overall;
@@ -905,25 +861,11 @@ _XmbDefaultTextPerCharExtents(oc, text, length, ink_buf, logical_buf, buf_size,
}
static Status
-#if NeedFunctionPrototypes
_XwcDefaultTextPerCharExtents(XOC oc, _Xconst wchar_t *text, int length,
XRectangle *ink_buf, XRectangle *logical_buf,
int buf_size, int *num_chars,
XRectangle *overall_ink,
XRectangle *overall_logical)
-#else
-_XwcDefaultTextPerCharExtents(oc, text, length, ink_buf, logical_buf, buf_size,
- num_chars, overall_ink, overall_logical)
- XOC oc;
- wchar_t *text;
- int length;
- XRectangle *ink_buf;
- XRectangle *logical_buf;
- int buf_size;
- int *num_chars;
- XRectangle *overall_ink;
- XRectangle *overall_logical;
-#endif
{
DefineLocalBuf;
char *buf = AllocLocalBuf(length);
@@ -946,19 +888,8 @@ err:
}
static int
-#if NeedFunctionPrototypes
_XmbDefaultDrawString(Display *dpy, Drawable d, XOC oc, GC gc, int x, int y,
_Xconst char *text, int length)
-#else
-_XmbDefaultDrawString(dpy, d, oc, gc, x, y, text, length)
- Display *dpy;
- Drawable d;
- XOC oc;
- GC gc;
- int x, y;
- char *text;
- int length;
-#endif
{
XFontStruct *font = *oc->core.font_info.font_struct_list;
@@ -969,19 +900,8 @@ _XmbDefaultDrawString(dpy, d, oc, gc, x, y, text, length)
}
static int
-#if NeedFunctionPrototypes
_XwcDefaultDrawString(Display *dpy, Drawable d, XOC oc, GC gc, int x, int y,
_Xconst wchar_t *text, int length)
-#else
-_XwcDefaultDrawString(dpy, d, oc, gc, x, y, text, length)
- Display *dpy;
- Drawable d;
- XOC oc;
- GC gc;
- int x, y;
- wchar_t *text;
- int length;
-#endif
{
DefineLocalBuf;
char *buf = AllocLocalBuf(length);
@@ -1002,38 +922,16 @@ err:
}
static void
-#if NeedFunctionPrototypes
_XmbDefaultDrawImageString(Display *dpy, Drawable d, XOC oc, GC gc, int x,
int y, _Xconst char *text, int length)
-#else
-_XmbDefaultDrawImageString(dpy, d, oc, gc, x, y, text, length)
- Display *dpy;
- Drawable d;
- XOC oc;
- GC gc;
- int x, y;
- char *text;
- int length;
-#endif
{
XSetFont(dpy, gc, (*oc->core.font_info.font_struct_list)->fid);
XDrawImageString(dpy, d, gc, x, y, text, length);
}
static void
-#if NeedFunctionPrototypes
_XwcDefaultDrawImageString(Display *dpy, Drawable d, XOC oc, GC gc, int x,
int y, _Xconst wchar_t *text, int length)
-#else
-_XwcDefaultDrawImageString(dpy, d, oc, gc, x, y, text, length)
- Display *dpy;
- Drawable d;
- XOC oc;
- GC gc;
- int x, y;
- wchar_t *text;
- int length;
-#endif
{
DefineLocalBuf;
char *buf = AllocLocalBuf(length);
@@ -1086,10 +984,10 @@ static XlcResource oc_resources[] = {
};
static XOC
-create_oc(om, args, num_args)
- XOM om;
- XlcArgList args;
- int num_args;
+create_oc(
+ XOM om,
+ XlcArgList args,
+ int num_args)
{
XOC oc;
@@ -1127,8 +1025,8 @@ err:
}
static Status
-close_om(om)
- XOM om;
+close_om(
+ XOM om)
{
XOMGenericPart *gen = XOM_GENERIC(om);
OMData data;
@@ -1164,10 +1062,10 @@ close_om(om)
}
static char *
-set_om_values(om, args, num_args)
- XOM om;
- XlcArgList args;
- int num_args;
+set_om_values(
+ XOM om,
+ XlcArgList args,
+ int num_args)
{
if (om->core.resources == NULL)
return NULL;
@@ -1177,10 +1075,10 @@ set_om_values(om, args, num_args)
}
static char *
-get_om_values(om, args, num_args)
- XOM om;
- XlcArgList args;
- int num_args;
+get_om_values(
+ XOM om,
+ XlcArgList args,
+ int num_args)
{
if (om->core.resources == NULL)
return NULL;
@@ -1208,8 +1106,8 @@ static XlcResource om_resources[] = {
};
static OMData
-add_data(om)
- XOM om;
+add_data(
+ XOM om)
{
XOMGenericPart *gen = XOM_GENERIC(om);
OMData new;
@@ -1238,8 +1136,8 @@ static _Xconst char *supported_charset_list[] = {
};
static Bool
-init_om(om)
- XOM om;
+init_om(
+ XOM om)
{
XOMGenericPart *gen = XOM_GENERIC(om);
OMData data;
@@ -1320,17 +1218,8 @@ supported_charset_list[].
}
XOM
-#if NeedFunctionPrototypes
_XDefaultOpenOM(XLCd lcd, Display *dpy, XrmDatabase rdb,
_Xconst char *res_name, _Xconst char *res_class)
-#else
-_XDefaultOpenOM(lcd, dpy, rdb, res_name, res_class)
-XLCd lcd;
-Display *dpy;
-XrmDatabase rdb;
-char *res_name;
-char *res_class;
-#endif
{
XOM om;
diff --git a/src/xlibi18n/XimImSw.h b/src/xlibi18n/XimImSw.h
index eac2784..00e5ef3 100644
--- a/src/xlibi18n/XimImSw.h
+++ b/src/xlibi18n/XimImSw.h
@@ -26,25 +26,20 @@ PERFORMANCE OF THIS SOFTWARE.
fujiwara@a80.tech.yk.fujitsu.co.jp
******************************************************************/
+/* $XFree86: xc/lib/X11/XimImSw.h,v 1.2 2003/11/17 22:20:10 dawes Exp $ */
#ifndef _XIMIMSW_H
#define _XIMIMSW_H
typedef struct {
Bool (*checkprocessing)(
-#if NeedNestedPrototypes
Xim im
-#endif
);
Bool (*im_open)(
-#if NeedNestedPrototypes
Xim im
-#endif
);
void (*im_free)(
-#if NeedNestedPrototypes
Xim im
-#endif
);
} XimImsportSW;
diff --git a/src/xlibi18n/XimThai.h b/src/xlibi18n/XimThai.h
index a53ce62..0e75e82 100644
--- a/src/xlibi18n/XimThai.h
+++ b/src/xlibi18n/XimThai.h
@@ -45,7 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
-/* $XFree86: xc/lib/X11/XimThai.h,v 1.5 2001/12/14 19:54:08 dawes Exp $ */
+/* $XFree86: xc/lib/X11/XimThai.h,v 1.6 2003/04/17 02:39:56 dawes Exp $ */
/*
**++
@@ -109,96 +109,4 @@ SOFTWARE.
#define NOISC 255 /* No ISC */
-/* Function prototypes (thaisub.c) */
-
-Private
-int THAI_chtype ( /* returns classification of a char */
-#if NeedFunctionPrototypes
- unsigned char ch
-#endif
-);
-
-Private
-int THAI_chlevel ( /* returns the display level */
-#if NeedFunctionPrototypes
- unsigned char ch
-#endif
-);
-
-Private
-Bool THAI_isdead ( /* return True if char is non-spacing */
-#if NeedFunctionPrototypes
- unsigned char ch
-#endif
-);
-
-Private
-Bool THAI_iscons ( /* return True if char is consonant */
-#if NeedFunctionPrototypes
- unsigned char ch
-#endif
-);
-
-Private
-Bool THAI_isvowel ( /* return True if char is vowel */
-#if NeedFunctionPrototypes
- unsigned char ch
-#endif
-);
-
-Private
-Bool THAI_istone ( /* return True if char is tonemark */
-#if NeedFunctionPrototypes
- unsigned char ch
-#endif
-);
-
-Private
-Bool THAI_iscomposible (
-#if NeedFunctionPrototypes
- unsigned char follow_ch,
- unsigned char lead_ch
-#endif
-);
-
-Private
-Bool THAI_isaccepted (
-#if NeedFunctionPrototypes
- unsigned char follow_ch,
- unsigned char lead_ch,
- unsigned char isc_mode
-#endif
-);
-
-#if 0
-Private
-void THAI_apply_write_rules (
-#if NeedFunctionPrototypes
- unsigned char *instr,
- unsigned char *outstr,
- unsigned char insert_ch,
- int *num_insert_ch
-#endif
-);
-
-Private
-int THAI_find_chtype (
-#if NeedFunctionPrototypes
- unsigned char *instr,
- int chtype
-#endif
-);
-#endif
-
-Private
-int THAI_apply_scm (
-#if NeedFunctionPrototypes
- unsigned char *instr,
- unsigned char *outstr,
- unsigned char spec_ch,
- int num_sp,
- unsigned char insert_ch
-#endif
-);
-
#endif /* _XIMTHAI_H_ */
diff --git a/src/xlibi18n/XimTrInt.h b/src/xlibi18n/XimTrInt.h
index b10898b..9bdcba7 100644
--- a/src/xlibi18n/XimTrInt.h
+++ b/src/xlibi18n/XimTrInt.h
@@ -28,21 +28,18 @@ OR PERFORMANCE OF THIS SOFTWARE.
fujiwara@a80.tech.yk.fujitsu.co.jp
******************************************************************/
+/* $XFree86: xc/lib/X11/XimTrInt.h,v 1.2 2003/11/17 22:20:10 dawes Exp $ */
#ifndef _XIMTRINT_H
#define _XIMTRINT_H
-#if NeedFunctionPrototypes
#include "Ximint.h"
-#endif
typedef struct {
char *transportname;
Bool (*config)(
-#if NeedFunctionPrototypes
Xim,
char *
-#endif
);
} TransportSW;
@@ -53,19 +50,15 @@ extern TransportSW _XimTransportRec[];
*/
extern Bool _XimXConf(
-#if NeedFunctionPrototypes
Xim im,
char *address
-#endif
);
#if defined(TCPCONN) || defined(UNIXCONN) || defined(DNETCONN) || defined(STREAMSCONN)
extern Bool _XimTransConf(
-#if NeedFunctionPrototypes
Xim im,
char *address
-#endif
);
#endif
diff --git a/src/xlibi18n/XimTrX.h b/src/xlibi18n/XimTrX.h
index 489a0e3..b269766 100644
--- a/src/xlibi18n/XimTrX.h
+++ b/src/xlibi18n/XimTrX.h
@@ -28,6 +28,7 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
fujiwara@a80.tech.yk.fujitsu.co.jp
******************************************************************/
+/* $XFree86: xc/lib/X11/XimTrX.h,v 1.2 2003/11/17 22:20:10 dawes Exp $ */
#ifndef _XIMTRX_H
#define _XIMTRX_H
@@ -36,9 +37,7 @@ typedef struct _XIntrCallbackRec *XIntrCallbackPtr;
typedef struct _XIntrCallbackRec {
Bool (*func)(
-#if NeedNestedPrototypes
Xim, INT16, XPointer, XPointer
-#endif
);
XPointer call_data;
XIntrCallbackPtr next;
diff --git a/src/xlibi18n/XimTrans.h b/src/xlibi18n/XimTrans.h
index 6914190..03119cd 100644
--- a/src/xlibi18n/XimTrans.h
+++ b/src/xlibi18n/XimTrans.h
@@ -28,6 +28,7 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
fujiwara@a80.tech.yk.fujitsu.co.jp
******************************************************************/
+/* $XFree86: xc/lib/X11/XimTrans.h,v 1.4 2003/11/17 22:20:10 dawes Exp $ */
#ifndef _XIMTRANS_H
#define _XIMTRANS_H
@@ -36,9 +37,7 @@ typedef struct _TransIntrCallbackRec *TransIntrCallbackPtr;
typedef struct _TransIntrCallbackRec {
Bool (*func)(
-#if NeedNestedPrototypes
Xim, INT16, XPointer, XPointer
-#endif
);
XPointer call_data;
TransIntrCallbackPtr next;
@@ -58,70 +57,67 @@ typedef struct {
* Prototypes
*/
+extern Bool _XimTransRegisterDispatcher(
+ Xim im,
+ Bool (*callback)(
+ Xim, INT16, XPointer, XPointer
+ ),
+ XPointer call_data
+);
+
+
extern Bool _XimTransIntrCallback(
-#if NeedFunctionPrototypes
Xim im,
Bool (*callback)(
-#if NeedNestedPrototypes
Xim, INT16, XPointer, XPointer
-#endif
),
XPointer call_data
-#endif
+);
+
+extern Bool _XimTransCallDispatcher(
+ Xim im,
+ INT16 len,
+ XPointer data
);
extern void _XimFreeTransIntrCallback(
-#if NeedFunctionPrototypes
Xim im
-#endif
);
extern Bool _XimTransIntrCallbackCheck(
-#if NeedFunctionPrototypes
Xim im,
INT16 len,
XPointer data
-#endif
);
extern Bool _XimTransFilterWaitEvent(
-#if NeedFunctionPrototypes
Display *d,
Window w,
XEvent *ev,
XPointer arg
-#endif
);
extern void _XimTransInternalConnection(
-#if NeedFunctionPrototypes
Display *d,
int fd,
XPointer arg
-#endif
);
extern Bool _XimTransWrite(
-#if NeedFunctionPrototypes
Xim im,
INT16 len,
XPointer data
-#endif
);
extern Bool _XimTransRead(
-#if NeedFunctionPrototypes
Xim im,
XPointer recv_buf,
int buf_len,
int *ret_len
-#endif
);
extern void _XimTransFlush(
-#if NeedFunctionPrototypes
Xim im
-#endif
);
#endif /* _XIMTRANS__H */
diff --git a/src/xlibi18n/Ximint.h b/src/xlibi18n/Ximint.h
index c7f917c..3809c65 100644
--- a/src/xlibi18n/Ximint.h
+++ b/src/xlibi18n/Ximint.h
@@ -30,7 +30,7 @@ PERFORMANCE OF THIS SOFTWARE.
makoto@sm.sony.co.jp
******************************************************************/
-/* $XFree86: xc/lib/X11/Ximint.h,v 3.10 2001/07/25 15:04:44 dawes Exp $ */
+/* $XFree86: xc/lib/X11/Ximint.h,v 3.14 2003/11/17 22:20:10 dawes Exp $ */
#ifndef _XIMINT_H
#define _XIMINT_H
@@ -185,274 +185,201 @@ typedef struct _XimDefICValues {
*/
XPointer _XimGetLocaleCode (
-#if NeedFunctionPrototypes
const char *encoding_name
-#endif
);
int _XimGetCharCode (
-#if NeedFunctionPrototypes
XPointer conv,
KeySym keysym,
unsigned char *buf,
int nbytes
-#endif
);
unsigned int KeySymToUcs4 (
-#if NeedFunctionPrototypes
KeySym keysym
-#endif
);
extern Bool _XimSetIMResourceList(
-#if NeedFunctionPrototypes
XIMResourceList *res_list,
unsigned int *list_num
-#endif
);
extern Bool _XimSetICResourceList(
-#if NeedFunctionPrototypes
XIMResourceList *res_list,
unsigned int *list_num
-#endif
);
extern Bool _XimSetInnerIMResourceList(
-#if NeedFunctionPrototypes
XIMResourceList *res_list,
unsigned int *list_num
-#endif
);
extern Bool _XimSetInnerICResourceList(
-#if NeedFunctionPrototypes
XIMResourceList *res_list,
unsigned int *list_num
-#endif
);
-extern Bool cw_XimCheckCreateICValues(
-#if NeedFunctionPrototypes
+extern Bool _XimCheckCreateICValues(
XIMResourceList res_list,
unsigned int list_num
-#endif
);
extern XIMResourceList _XimGetResourceListRec(
-#if NeedFunctionPrototypes
XIMResourceList res_list,
unsigned int list_num,
char *name
-#endif
);
extern void _XimSetIMMode(
-#if NeedFunctionPrototypes
XIMResourceList res_list,
unsigned int list_num
-#endif
);
extern void _XimSetICMode(
-#if NeedFunctionPrototypes
XIMResourceList res_list,
unsigned int list_num,
XIMStyle style
-#endif
);
extern int _XimCheckIMMode(
-#if NeedFunctionPrototypes
XIMResourceList res_list,
unsigned long mode
-#endif
);
extern int _XimCheckICMode(
-#if NeedFunctionPrototypes
XIMResourceList res_list,
unsigned long mode
-#endif
);
extern Bool _XimSetLocalIMDefaults(
-#if NeedFunctionPrototypes
Xim im,
XPointer top,
XIMResourceList res_list,
unsigned int list_num
-#endif
);
extern Bool _XimSetICDefaults(
-#if NeedFunctionPrototypes
Xic ic,
XPointer top,
unsigned long mode,
XIMResourceList res_list,
unsigned int list_num
-#endif
);
extern Bool _XimEncodeLocalIMAttr(
-#if NeedFunctionPrototypes
XIMResourceList res,
XPointer top,
XPointer val
-#endif
);
extern Bool _XimEncodeLocalICAttr(
-#if NeedFunctionPrototypes
Xic ic,
XIMResourceList res,
XPointer top,
XIMArg *arg,
unsigned long mode
-#endif
);
extern Bool _XimCheckLocalInputStyle(
-#if NeedFunctionPrototypes
Xic ic,
XPointer top,
XIMArg *values,
XIMStyles *styles,
XIMResourceList res_list,
unsigned int list_num
-#endif
);
extern Bool _XimDecodeLocalIMAttr(
-#if NeedFunctionPrototypes
XIMResourceList res,
XPointer top,
XPointer val
-#endif
);
extern Bool _XimDecodeLocalICAttr(
-#if NeedFunctionPrototypes
XIMResourceList res,
XPointer top,
XPointer val,
unsigned long mode
-#endif
);
extern void _XimGetCurrentIMValues(
-#if NeedFunctionPrototypes
Xim im,
XimDefIMValues *im_values
-#endif
);
extern void _XimSetCurrentIMValues(
-#if NeedFunctionPrototypes
Xim im,
XimDefIMValues *im_values
-#endif
);
extern void _XimGetCurrentICValues(
-#if NeedFunctionPrototypes
Xic ic,
XimDefICValues *ic_values
-#endif
);
extern void _XimSetCurrentICValues(
-#if NeedFunctionPrototypes
Xic ic,
XimDefICValues *ic_values
-#endif
);
extern void _XimInitialResourceInfo(
-#if NeedFunctionPrototypes
void
-#endif
);
extern void _XimParseStringFile(
-#if NeedFunctionPrototypes
FILE *fp,
- DefTree **ptop
-#endif
+ Xim im
);
extern Bool _XimCheckIfLocalProcessing(
-#if NeedFunctionPrototypes
Xim im
-#endif
);
extern Bool _XimCheckIfThaiProcessing(
-#if NeedFunctionPrototypes
Xim im
-#endif
);
extern Bool _XimLocalOpenIM(
-#if NeedFunctionPrototypes
Xim im
-#endif
);
extern Bool _XimThaiOpenIM(
-#if NeedFunctionPrototypes
Xim im
-#endif
);
extern Bool _XimProtoOpenIM(
-#if NeedFunctionPrototypes
Xim im
-#endif
);
extern void _XimLocalIMFree(
-#if NeedFunctionPrototypes
Xim im
-#endif
);
extern void _XimThaiIMFree(
-#if NeedFunctionPrototypes
Xim im
-#endif
);
extern void _XimProtoIMFree(
-#if NeedFunctionPrototypes
Xim im
-#endif
);
extern char * _XimSetIMValueData(
-#if NeedFunctionPrototypes
Xim im,
XPointer top,
XIMArg *arg,
XIMResourceList res_list,
unsigned int list_num
-#endif
);
extern char * _XimGetIMValueData(
-#if NeedFunctionPrototypes
Xim im,
XPointer top,
XIMArg *arg,
XIMResourceList res_list,
unsigned int list_num
-#endif
);
extern char * _XimSetICValueData(
-#if NeedFunctionPrototypes
Xic ic,
XPointer top,
XIMResourceList res_list,
@@ -460,68 +387,50 @@ extern char * _XimSetICValueData(
XIMArg *arg,
unsigned long mode,
Bool flag
-#endif
);
extern char * _XimGetICValueData(
-#if NeedFunctionPrototypes
Xic ic,
XPointer top,
XIMResourceList res_list,
unsigned int list_num,
XIMArg *arg,
unsigned long mode
-#endif
);
extern char * _XimLocalSetIMValues(
-#if NeedFunctionPrototypes
XIM im,
XIMArg *arg
-#endif
);
extern char * _XimLocalGetIMValues(
-#if NeedFunctionPrototypes
XIM im,
XIMArg *arg
-#endif
);
extern XIC _XimLocalCreateIC(
-#if NeedFunctionPrototypes
XIM im,
XIMArg *arg
-#endif
);
extern Bool _XimDispatchInit(
-#if NeedFunctionPrototypes
Xim im
-#endif
);
extern Bool _XimGetAttributeID(
-#if NeedFunctionPrototypes
Xim im,
CARD16 *buf
-#endif
);
extern Bool _XimExtension(
-#if NeedFunctionPrototypes
Xim im
-#endif
);
extern void _XimDestroyIMStructureList(
-#if NeedFunctionPrototypes
Xim im
-#endif
);
extern char * _XimMakeIMAttrIDList(
-#if NeedFunctionPrototypes
Xim im,
XIMResourceList res_list,
unsigned int res_num,
@@ -529,11 +438,9 @@ extern char * _XimMakeIMAttrIDList(
CARD16 *buf,
INT16 *len,
unsigned long mode
-#endif
);
extern char * _XimMakeICAttrIDList(
-#if NeedFunctionPrototypes
Xic ic,
XIMResourceList res_list,
unsigned int res_num,
@@ -541,11 +448,9 @@ extern char * _XimMakeICAttrIDList(
CARD16 *idList,
INT16 *num,
unsigned long mode
-#endif
);
extern char * _XimDecodeIMATTRIBUTE(
-#if NeedFunctionPrototypes
Xim im,
XIMResourceList res_list,
unsigned int res_num,
@@ -553,11 +458,9 @@ extern char * _XimDecodeIMATTRIBUTE(
INT16 buf_len,
XIMArg *arg,
BITMASK32 mode
-#endif
);
extern char * _XimDecodeICATTRIBUTE(
-#if NeedFunctionPrototypes
Xic ic,
XIMResourceList res_list,
unsigned int res_num,
@@ -565,158 +468,118 @@ extern char * _XimDecodeICATTRIBUTE(
INT16 buf_len,
XIMArg *arg,
BITMASK32 mode
-#endif
);
extern Bool _XimRegProtoIntrCallback(
-#if NeedFunctionPrototypes
Xim im,
CARD16 major_code,
CARD16 minor_code,
Bool (*proc)(
-#if NeedNestedPrototypes
Xim, INT16, XPointer, XPointer
-#endif
),
XPointer call_data
-#endif
);
extern Bool _XimErrorCallback(
-#if NeedFunctionPrototypes
Xim im,
INT16 len,
XPointer data,
XPointer call_data
-#endif
);
extern Bool _XimError(
-#if NeedFunctionPrototypes
Xim im,
Xic ic,
CARD16 error_code,
INT16 detail_length,
CARD16 type,
char *detail
-#endif
);
extern Bool _XimRegisterTriggerKeysCallback(
-#if NeedFunctionPrototypes
Xim im,
INT16 len,
XPointer data,
XPointer call_data
-#endif
);
extern Bool _XimSetEventMaskCallback(
-#if NeedFunctionPrototypes
Xim im,
INT16 len,
XPointer data,
XPointer call_data
-#endif
);
extern Bool _XimForwardEventCallback(
-#if NeedFunctionPrototypes
Xim im,
INT16 len,
XPointer data,
XPointer call_data
-#endif
);
extern Bool _XimCommitCallback(
-#if NeedFunctionPrototypes
Xim im,
INT16 len,
XPointer data,
XPointer call_data
-#endif
);
extern Bool _XimSyncCallback(
-#if NeedFunctionPrototypes
Xim im,
INT16 len,
XPointer data,
XPointer call_data
-#endif
);
extern void _XimFreeProtoIntrCallback(
-#if NeedFunctionPrototypes
Xim im
-#endif
);
extern XIC _XimProtoCreateIC(
-#if NeedFunctionPrototypes
XIM im,
XIMArg *arg
-#endif
);
extern void _XimRegisterServerFilter(
-#if NeedFunctionPrototypes
Xim im
-#endif
);
extern void _XimUnregisterServerFilter(
-#if NeedFunctionPrototypes
Xim im
-#endif
);
extern Bool _XimTriggerNotify(
-#if NeedFunctionPrototypes
Xim im,
Xic ic,
int mode,
CARD32 idx
-#endif
);
extern Bool _XimProcSyncReply(
-#if NeedFunctionPrototypes
Xim im,
Xic ic
-#endif
);
extern void _XimSendSetFocus(
-#if NeedFunctionPrototypes
Xim im,
Xic ic
-#endif
);
extern Bool _XimForwardEvent(
-#if NeedFunctionPrototypes
Xic ic,
XEvent *ev,
Bool sync
-#endif
);
extern void _XimFreeRemakeArg(
-#if NeedFunctionPrototypes
XIMArg *arg
-#endif
);
extern void _XimServerDestroy(
-#if NeedFunctionPrototypes
Xim im
-#endif
);
extern char * _XimEncodeIMATTRIBUTE(
-#if NeedFunctionPrototypes
Xim im,
XIMResourceList res_list,
unsigned int res_num,
@@ -727,11 +590,9 @@ extern char * _XimEncodeIMATTRIBUTE(
int *ret_len,
XPointer top,
unsigned long mode
-#endif
);
extern char * _XimEncodeICATTRIBUTE(
-#if NeedFunctionPrototypes
Xic ic,
XIMResourceList res_list,
unsigned int res_num,
@@ -743,234 +604,189 @@ extern char * _XimEncodeICATTRIBUTE(
XPointer top,
BITMASK32 *flag,
unsigned long mode
-#endif
);
#ifdef EXT_MOVE
extern Bool _XimExtenMove(
-#if NeedFunctionPrototypes
Xim im,
Xic ic,
CARD32 flag,
CARD16 *buf,
INT16 length
-#endif
);
#endif
extern int _Ximctstombs(
-#if NeedFunctionPrototypes
XIM im,
char *from,
int from_len,
char *to,
int to_len,
Status *state
-#endif
);
extern int _Ximctstowcs(
-#if NeedFunctionPrototypes
XIM im,
char *from,
int from_len,
wchar_t *to,
int to_len,
Status *state
-#endif
);
extern int _Ximctstoutf8(
-#if NeedFunctionPrototypes
XIM im,
char *from,
int from_len,
char *to,
int to_len,
Status *state
-#endif
);
extern int _XimLcctstombs(
-#if NeedFunctionPrototypes
XIM im,
char *from,
int from_len,
char *to,
int to_len,
Status *state
-#endif
);
extern int _XimLcctstowcs(
-#if NeedFunctionPrototypes
XIM im,
char *from,
int from_len,
wchar_t *to,
int to_len,
Status *state
-#endif
);
extern int _XimLcctstoutf8(
-#if NeedFunctionPrototypes
XIM im,
char *from,
int from_len,
char *to,
int to_len,
Status *state
-#endif
+);
+
+extern int _XimCheckDataSize(
+ XPointer buf,
+ int len
);
extern void _XimSetHeader(
-#if NeedFunctionPrototypes
XPointer buf,
CARD8 major_opcode,
CARD8 minor_opcode,
INT16 *len
-#endif
);
extern Bool _XimSync(
-#if NeedFunctionPrototypes
Xim im,
Xic ic
-#endif
);
extern int _XimProtoMbLookupString(
-#if NeedFunctionPrototypes
XIC xic,
XKeyEvent *ev,
char *buffer,
int bytes,
KeySym *keysym,
Status *state
-#endif
);
extern int _XimProtoWcLookupString(
-#if NeedFunctionPrototypes
XIC xic,
XKeyEvent *ev,
wchar_t *buffer,
int bytes,
KeySym *keysym,
Status *state
-#endif
);
extern int _XimProtoUtf8LookupString(
-#if NeedFunctionPrototypes
XIC xic,
XKeyEvent *ev,
char *buffer,
int bytes,
KeySym *keysym,
Status *state
-#endif
);
extern void _XimRegisterFilter(
-#if NeedFunctionPrototypes
Xic ic
-#endif
);
extern void _XimUnregisterFilter(
-#if NeedFunctionPrototypes
Xic ic
-#endif
);
extern void _XimReregisterFilter(
-#if NeedFunctionPrototypes
Xic ic
-#endif
);
extern Status _XimProtoEventToWire(
-#if NeedFunctionPrototypes
XEvent *re,
xEvent *event,
Bool sw
-#endif
);
extern Bool _XimProtoWireToEvent(
-#if NeedFunctionPrototypes
XEvent *re,
xEvent *event,
Bool sw
-#endif
);
#ifdef EXT_FORWARD
extern Bool _XimExtForwardKeyEvent(
-#if NeedFunctionPrototypes
Xic ic,
XKeyEvent *ev,
Bool sync
-#endif
);
#endif
extern int _XimLookupMBText(
-#if NeedFunctionPrototypes
Xic ic,
XKeyEvent *event,
char *buffer,
int nbytes,
KeySym *keysym,
XComposeStatus *status
-#endif
);
extern int _XimLookupWCText(
-#if NeedFunctionPrototypes
Xic ic,
XKeyEvent *event,
wchar_t *buffer,
int nbytes,
KeySym *keysym,
XComposeStatus *status
-#endif
);
extern int _XimLookupUTF8Text(
-#if NeedFunctionPrototypes
Xic ic,
XKeyEvent *event,
char *buffer,
int nbytes,
KeySym *keysym,
XComposeStatus *status
-#endif
);
extern EVENTMASK _XimGetWindowEventmask(
-#if NeedFunctionPrototypes
Xic ic
-#endif
);
extern Xic _XimICOfXICID(
-#if NeedFunctionPrototypes
Xim im,
XICID icid
-#endif
);
extern void _XimResetIMInstantiateCallback(
-#if NeedFunctionPrototypes
Xim xim
-#endif
);
extern Bool _XimRegisterIMInstantiateCallback(
-#if NeedFunctionPrototypes
XLCd lcd,
Display *display,
XrmDatabase rdb,
@@ -978,11 +794,9 @@ extern Bool _XimRegisterIMInstantiateCallback(
char *res_class,
XIDProc callback,
XPointer client_data
-#endif
);
extern Bool _XimUnRegisterIMInstantiateCallback(
-#if NeedFunctionPrototypes
XLCd lcd,
Display *display,
XrmDatabase rdb,
@@ -990,224 +804,164 @@ extern Bool _XimUnRegisterIMInstantiateCallback(
char *res_class,
XIDProc callback,
XPointer client_data
-#endif
);
extern void _XimFreeCommitInfo(
-#if NeedFunctionPrototypes
Xic ic
-#endif
);
extern Bool _XimConnect(
-#if NeedFunctionPrototypes
Xim im
-#endif
);
extern Bool _XimShutdown(
-#if NeedFunctionPrototypes
Xim im
-#endif
);
extern Bool _XimWrite(
-#if NeedFunctionPrototypes
Xim im,
INT16 len,
XPointer data
-#endif
);
extern Bool _XimRead(
-#if NeedFunctionPrototypes
Xim im,
INT16 *len,
XPointer data,
int data_len,
Bool (*predicate)(
-#if NeedNestedPrototypes
Xim, INT16, XPointer, XPointer
-#endif
),
XPointer arg
-#endif
);
extern Bool _XimIntrCallback(
-#if NeedFunctionPrototypes
Xim im,
Bool (*callback)(
-#if NeedNestedPrototypes
Xim, INT16, XPointer, XPointer
-#endif
),
XPointer call_data
-#endif
);
extern void _XimFlush(
-#if NeedFunctionPrototypes
Xim im
-#endif
);
extern Bool _XimFilterWaitEvent(
-#if NeedFunctionPrototypes
Xim im
-#endif
);
extern void _XimProcError(
-#if NeedFunctionPrototypes
Xim im,
Xic ic,
XPointer data
-#endif
);
#ifdef EXT_MOVE
extern CARD32 _XimExtenArgCheck(
-#if NeedFunctionProtoTypes
XIMArg *arg
-#endif
);
#endif
extern Bool _XimCbDispatch(
-#if NeedFunctionPrototypes
Xim im,
INT16 len,
XPointer data,
XPointer call_data
-#endif
);
extern Bool _XimLocalFilter(
-#if NeedFunctionPrototypes
Display *d,
Window w,
XEvent *ev,
XPointer client_data
-#endif
);
extern XIMResourceList _XimGetResourceListRecByQuark(
-#if NeedFunctionPrototypes
XIMResourceList res_list,
unsigned int list_num,
XrmQuark quark
-#endif
);
extern Bool _XimReconnectModeCreateIC(
-#if NeedFunctionPrototypes
Xic ic
-#endif
);
extern char *_XimLocalSetICValues(
-#if NeedFunctionPrototypes
XIC ic,
XIMArg *values
-#endif
);
extern char * _XimLocalGetICValues(
-#if NeedFunctionPrototypes
XIC ic,
XIMArg *values
-#endif
);
extern int _XimLocalMbLookupString(
-#if NeedFunctionPrototypes
XIC ic,
XKeyEvent *ev,
char *buffer,
int bytes,
KeySym *keysym,
Status *status
-#endif
);
extern int _XimLocalWcLookupString(
-#if NeedFunctionPrototypes
XIC ic,
XKeyEvent *ev,
wchar_t *buffer,
int bytes,
KeySym *keysym,
Status *status
-#endif
);
extern int _XimLocalUtf8LookupString(
-#if NeedFunctionPrototypes
XIC ic,
XKeyEvent *ev,
char *buffer,
int bytes,
KeySym *keysym,
Status *status
-#endif
);
extern Bool _XimThaiFilter(
-#if NeedFunctionPrototypes
Display *d,
Window w,
XEvent *ev,
XPointer client_data
-#endif
);
extern XIC _XimThaiCreateIC(
-#if NeedFunctionPrototypes
XIM im,
XIMArg *values
-#endif
);
extern Status _XimThaiCloseIM(
-#if NeedFunctionPrototypes
XIM xim
-#endif
);
#ifdef XIM_CONNECTABLE
extern void _XimSetProtoResource(
-#if NeedFunctionPrototypes
Xim im
-#endif
);
extern Bool _XimConnectServer(
-#if NeedFunctionPrototypes
Xim im
-#endif
);
extern Bool _XimDelayModeSetAttr(
-#if NeedFunctionPrototypes
Xim im
-#endif
);
extern void _XimServerReconectableDestroy(
-#if NeedFunctionPrototypes
void
-#endif
);
extern Bool _XimReCreateIC(
-#if NeedFunctionPrototypes
Xic ic
-#endif
);
extern Bool _XimEncodeSavedIMATTRIBUTE(
-#if NeedFunctionPrototypes
Xim im,
XIMResourceList res_list,
unsigned int res_num,
@@ -1217,11 +971,9 @@ extern Bool _XimEncodeSavedIMATTRIBUTE(
int *ret_len,
XPointer top,
unsigned long mode
-#endif
);
extern Bool _XimEncodeSavedICATTRIBUTE(
-#if NeedFunctionPrototypes
Xic ic,
XIMResourceList res_list,
unsigned int res_num,
@@ -1231,8 +983,20 @@ extern Bool _XimEncodeSavedICATTRIBUTE(
int *ret_len,
XPointer top,
unsigned long mode
-#endif
);
#endif
+extern Public Bool
+_XimRegisterDispatcher(
+ Xim im,
+ Bool (*callback)(
+ Xim, INT16, XPointer, XPointer
+ ),
+ XPointer call_data);
+
+extern Public Bool
+_XimRespSyncReply(
+ Xic ic,
+ BITMASK16 mode);
+
#endif /* _XIMINT_H */
diff --git a/src/xlibi18n/XimintP.h b/src/xlibi18n/XimintP.h
index b56fe17..38c4ed6 100644
--- a/src/xlibi18n/XimintP.h
+++ b/src/xlibi18n/XimintP.h
@@ -35,7 +35,7 @@ PERFORMANCE OF THIS SOFTWARE.
miyamoto@jrd.dec.com
******************************************************************/
-/* $XFree86: xc/lib/X11/XimintP.h,v 1.7 2001/01/17 19:41:49 dawes Exp $ */
+/* $XFree86: xc/lib/X11/XimintP.h,v 1.8 2003/11/17 22:20:10 dawes Exp $ */
#ifndef _XIMINTP_H
#define _XIMINTP_H
@@ -47,9 +47,7 @@ PERFORMANCE OF THIS SOFTWARE.
* for protocol layer callback function
*/
typedef Bool (*XimProtoIntrProc)(
-#if NeedFunctionPrototypes
Xim, INT16, XPointer, XPointer
-#endif
);
typedef struct _XimProtoIntrRec {
XimProtoIntrProc func;
@@ -63,39 +61,25 @@ typedef struct _XimProtoIntrRec {
* for transport layer methods
*/
typedef Bool (*XimTransConnectProc)(
-#if NeedFunctionPrototypes
Xim
-#endif
);
typedef Bool (*XimTransShutdownProc)(
-#if NeedFunctionPrototypes
Xim
-#endif
);
typedef Bool (*XimTransWriteProc)(
-#if NeedFunctionPrototypes
Xim, INT16, XPointer
-#endif
);
typedef Bool (*XimTransReadProc)(
-#if NeedFunctionPrototypes
Xim, XPointer, int, int *
-#endif
);
typedef void (*XimTransFlushProc)(
-#if NeedFunctionPrototypes
Xim
-#endif
);
typedef Bool (*XimTransRegDispatcher)(
-#if NeedNestedPrototypes
Xim, Bool (*)(Xim, INT16, XPointer, XPointer), XPointer
-#endif
);
typedef Bool (*XimTransCallDispatcher)(
-#if NeedFunctionPrototypes
Xim, INT16, XPointer
-#endif
);
/*
diff --git a/src/xlibi18n/XlcDL.c b/src/xlibi18n/XlcDL.c
index 126cbff..24200f5 100644
--- a/src/xlibi18n/XlcDL.c
+++ b/src/xlibi18n/XlcDL.c
@@ -41,7 +41,7 @@ interest in or to any trademark, service mark, logo or trade name of
Sun Microsystems, Inc. or its licensors is granted.
*/
-/* $XFree86: xc/lib/X11/XlcDL.c,v 1.9.2.1 2003/03/11 23:18:49 herrb Exp $ */
+/* $XFree86: xc/lib/X11/XlcDL.c,v 1.13 2003/11/17 22:20:10 dawes Exp $ */
#include <stdio.h>
#if defined(hpux)
@@ -55,18 +55,15 @@ Sun Microsystems, Inc. or its licensors is granted.
#include "XlcPublic.h"
#include "XlcPubI.h"
-#ifdef _LP64
-# if defined(__sparcv9)
-# define _MACH64_NAME "sparcv9"
-# elif defined(__ia64__)
-# undef MACH64_NAME
-# else
-# error "Unknown architecture"
-# endif /* defined(__sparcv9) */
-# ifdef _MACH64_NAME
+#if defined(_LP64) && defined(__sparcv9)
+# define _MACH64_NAME "sparcv9"
+#else
+# undef _MACH64_NAME
+#endif /* defined(_LP64) && defined(__sparcv9) */
+
+#ifdef _MACH64_NAME
# define _MACH64_NAME_LEN (sizeof (_MACH64_NAME) - 1)
-# endif
-#endif /* _LP64 */
+#endif
#define XI18N_DLREL 2
@@ -102,10 +99,7 @@ static XI18NObjectsListRec *xi18n_objects_list = NULL;
static int lc_count = 0;
static int
-parse_line(line, argv, argsize)
-char *line;
-char **argv;
-int argsize;
+parse_line(char *line, char **argv, int argsize)
{
int argc = 0;
char *p = line;
@@ -162,9 +156,7 @@ try_both_dlsym (void *handle, char *name)
#endif
static void
-resolve_object(path, lc_name)
-char *path;
-char *lc_name;
+resolve_object(char *path, const char *lc_name)
{
char filename[BUFSIZ];
FILE *fp;
@@ -235,9 +227,7 @@ Limit the length of path to prevent stack buffer corruption.
}
static char*
-__lc_path(dl_name, lc_dir)
-const char *dl_name;
-const char *lc_dir;
+__lc_path(const char *dl_name, const char *lc_dir)
{
char *path;
size_t len;
@@ -313,9 +303,9 @@ const char *lc_dir;
* in XLCd
*/
static Bool
-open_object (object, lc_dir)
- XI18NObjectsList object;
- char *lc_dir;
+open_object(
+ XI18NObjectsList object,
+ char *lc_dir)
{
char *path;
@@ -339,9 +329,9 @@ open_object (object, lc_dir)
}
static void *
-fetch_symbol (object, symbol)
- XI18NObjectsList object;
- char *symbol;
+fetch_symbol(
+ XI18NObjectsList object,
+ char *symbol)
{
void *result = NULL;
#if defined(hpux)
@@ -374,8 +364,7 @@ fetch_symbol (object, symbol)
}
static void
-close_object (object)
- XI18NObjectsList object;
+close_object(XI18NObjectsList object)
{
object->refcount--;
if (object->refcount == 0)
@@ -390,16 +379,13 @@ close_object (object)
}
+typedef XLCd (*dynamicLoadProc)(const char *);
+
XLCd
-#if NeedFunctionPrototypes
_XlcDynamicLoad(const char *lc_name)
-#else
-_XlcDynamicLoad(lc_name)
- const char *lc_name;
-#endif
{
XLCd lcd = (XLCd)NULL;
- XLCd (*lc_loader)() = (XLCd(*)())NULL;
+ dynamicLoadProc lc_loader = (dynamicLoadProc)NULL;
int count;
XI18NObjectsList objects_list;
char lc_dir[BUFSIZE];
@@ -419,7 +405,7 @@ _XlcDynamicLoad(lc_name)
if (!open_object (objects_list, lc_dir))
continue;
- lc_loader = (XLCd(*)())fetch_symbol (objects_list, objects_list->open);
+ lc_loader = (dynamicLoadProc)fetch_symbol (objects_list, objects_list->open);
if (!lc_loader) continue;
lcd = (*lc_loader)(lc_name);
if (lcd != (XLCd)NULL) {
@@ -431,22 +417,17 @@ _XlcDynamicLoad(lc_name)
return (XLCd)lcd;
}
+
+typedef XIM (*dynamicOpenProcp)(XLCd, Display *, XrmDatabase, char *, char *);
+
static XIM
-#if NeedFunctionPrototypes
_XDynamicOpenIM(XLCd lcd, Display *display, XrmDatabase rdb,
char *res_name, char *res_class)
-#else
-_XDynamicOpenIM(lcd, display, rdb, res_name, res_class)
-XLCd lcd;
-Display *display;
-XrmDatabase rdb;
-char *res_name, *res_class;
-#endif
{
XIM im = (XIM)NULL;
char lc_dir[BUFSIZE];
char *lc_name;
- XIM (*im_openIM)() = (XIM(*)())NULL;
+ dynamicOpenProcp im_openIM = (dynamicOpenProcp)NULL;
int count;
XI18NObjectsList objects_list = xi18n_objects_list;
@@ -462,7 +443,7 @@ char *res_name, *res_class;
if (!open_object (objects_list, lc_dir))
continue;
- im_openIM = (XIM(*)())fetch_symbol(objects_list, objects_list->open);
+ im_openIM = (dynamicOpenProcp)fetch_symbol(objects_list, objects_list->open);
if (!im_openIM) continue;
im = (*im_openIM)(lcd, display, rdb, res_name, res_class);
if (im != (XIM)NULL) {
@@ -474,20 +455,22 @@ char *res_name, *res_class;
return (XIM)im;
}
+typedef Bool (*dynamicRegisterCBProcp)(
+ XLCd, Display *, XrmDatabase, char *, char *, XIDProc, XPointer);
+
static Bool
-_XDynamicRegisterIMInstantiateCallback(lcd, display, rdb,
- res_name, res_class,
- callback, client_data)
-XLCd lcd;
-Display *display;
-XrmDatabase rdb;
-char *res_name, *res_class;
-XIMProc callback;
-XPointer *client_data;
+_XDynamicRegisterIMInstantiateCallback(
+ XLCd lcd,
+ Display *display,
+ XrmDatabase rdb,
+ char *res_name,
+ char *res_class,
+ XIDProc callback,
+ XPointer client_data)
{
char lc_dir[BUFSIZE];
char *lc_name;
- Bool (*im_registerIM)() = (Bool(*)())NULL;
+ dynamicRegisterCBProcp im_registerIM = (dynamicRegisterCBProcp)NULL;
Bool ret_flag = False;
int count;
XI18NObjectsList objects_list = xi18n_objects_list;
@@ -507,7 +490,7 @@ XPointer *client_data;
if (!open_object (objects_list, lc_dir))
continue;
- im_registerIM = (Bool(*)())fetch_symbol(objects_list,
+ im_registerIM = (dynamicRegisterCBProcp)fetch_symbol(objects_list,
objects_list->im_register);
if (!im_registerIM) continue;
ret_flag = (*im_registerIM)(lcd, display, rdb,
@@ -520,20 +503,22 @@ XPointer *client_data;
return (Bool)ret_flag;
}
+typedef Bool (*dynamicUnregisterProcp)(
+ XLCd, Display *, XrmDatabase, char *, char *, XIDProc, XPointer);
+
static Bool
-_XDynamicUnRegisterIMInstantiateCallback(lcd, display, rdb,
- res_name, res_class,
- callback, client_data)
-XLCd lcd;
-Display *display;
-XrmDatabase rdb;
-char *res_name, *res_class;
-XIMProc callback;
-XPointer *client_data;
+_XDynamicUnRegisterIMInstantiateCallback(
+ XLCd lcd,
+ Display *display,
+ XrmDatabase rdb,
+ char *res_name,
+ char *res_class,
+ XIDProc callback,
+ XPointer client_data)
{
char lc_dir[BUFSIZE];
char *lc_name;
- Bool (*im_unregisterIM)() = (Bool(*)())NULL;
+ dynamicUnregisterProcp im_unregisterIM = (dynamicUnregisterProcp)NULL;
Bool ret_flag = False;
int count;
XI18NObjectsList objects_list = xi18n_objects_list;
@@ -553,7 +538,7 @@ XPointer *client_data;
if (!objects_list->refcount) /* Must already be opened */
continue;
- im_unregisterIM = (Bool(*)())fetch_symbol(objects_list,
+ im_unregisterIM = (dynamicUnregisterProcp)fetch_symbol(objects_list,
objects_list->im_unregister);
if (!im_unregisterIM) continue;
@@ -569,12 +554,7 @@ XPointer *client_data;
}
Bool
-#if NeedFunctionPrototypes
_XInitDynamicIM(XLCd lcd)
-#else
-_XInitDynamicIM(lcd)
-XLCd lcd;
-#endif
{
if(lcd == (XLCd)NULL)
return False;
@@ -584,24 +564,19 @@ XLCd lcd;
return True;
}
+
+typedef XOM (*dynamicIOpenProcp)(
+ XLCd, Display *, XrmDatabase, _Xconst char *, _Xconst char *);
+
static XOM
-#if NeedFunctionPrototypes
_XDynamicOpenOM(XLCd lcd, Display *display, XrmDatabase rdb,
_Xconst char *res_name, _Xconst char *res_class)
-#else
-_XDynamicOpenOM(lcd, display, rdb, res_name, res_class)
-XLCd lcd;
-Display *display;
-XrmDatabase rdb;
-char *res_name;
-char *res_class;
-#endif
{
XOM om = (XOM)NULL;
int count;
char lc_dir[BUFSIZE];
char *lc_name;
- XOM (*om_openOM)() = (XOM(*)())NULL;
+ dynamicIOpenProcp om_openOM = (dynamicIOpenProcp)NULL;
XI18NObjectsList objects_list = xi18n_objects_list;
#if defined(hpux)
int getsyms_cnt, i;
@@ -619,7 +594,7 @@ char *res_class;
if (!open_object (objects_list, lc_dir))
continue;
- om_openOM = (XOM(*)())fetch_symbol(objects_list, objects_list->open);
+ om_openOM = (dynamicIOpenProcp)fetch_symbol(objects_list, objects_list->open);
if (!om_openOM) continue;
om = (*om_openOM)(lcd, display, rdb, res_name, res_class);
if (om != (XOM)NULL) {
@@ -631,12 +606,7 @@ char *res_class;
}
Bool
-#if NeedFunctionPrototypes
_XInitDynamicOM(XLCd lcd)
-#else
-_XInitDynamicOM(lcd)
- XLCd lcd;
-#endif
{
if(lcd == (XLCd)NULL)
return False;
diff --git a/src/xlibi18n/XlcGeneric.h b/src/xlibi18n/XlcGeneric.h
index a762917..45dd66f 100644
--- a/src/xlibi18n/XlcGeneric.h
+++ b/src/xlibi18n/XlcGeneric.h
@@ -31,7 +31,7 @@
* Modifier: Takanori Tateno FUJITSU LIMITED
*
*/
-/* $XFree86: xc/lib/X11/XlcGeneric.h,v 1.4 2001/07/25 15:04:44 dawes Exp $ */
+/* $XFree86: xc/lib/X11/XlcGeneric.h,v 1.5 2003/04/13 19:22:19 dawes Exp $ */
#ifndef _XLCGENERIC_H_
#define _XLCGENERIC_H_
@@ -143,4 +143,22 @@ typedef struct _XLCdGenericRec {
extern XLCdMethods _XlcGenericMethods;
+extern FontScope
+_XlcParse_scopemaps(
+ const char *str,
+ int *size);
+extern void
+_XlcDbg_printValue(
+ const char *str,
+ char **value,
+ int num);
+
+extern XIM
+_XDefaultOpenIM(
+ XLCd lcd,
+ Display *dpy,
+ XrmDatabase rdb,
+ char *res_name,
+ char *res_class);
+
#endif /* _XLCGENERIC_H_ */
diff --git a/src/xlibi18n/XlcPubI.h b/src/xlibi18n/XlcPubI.h
index 0fbe337..64504ea 100644
--- a/src/xlibi18n/XlcPubI.h
+++ b/src/xlibi18n/XlcPubI.h
@@ -23,7 +23,7 @@
* Author: Katsuhisa Yano TOSHIBA Corp.
* mopi@osa.ilab.toshiba.co.jp
*/
-/* $XFree86: xc/lib/X11/XlcPubI.h,v 3.9.6.1 2003/03/11 23:18:49 herrb Exp $ */
+/* $XFree86: xc/lib/X11/XlcPubI.h,v 3.14 2003/11/17 22:20:10 dawes Exp $ */
#ifndef _XLCPUBLICI_H_
#define _XLCPUBLICI_H_
@@ -165,43 +165,35 @@ extern int _Xutf8TextPropertyToTextList(
);
extern int _XmbTextListToTextProperty(
-#if NeedFunctionPrototypes
XLCd /* lcd */,
Display* /* dpy */,
char** /* list */,
int /* count */,
XICCEncodingStyle /* style */,
XTextProperty* /* text_prop */
-#endif
);
extern int _XwcTextListToTextProperty(
-#if NeedFunctionPrototypes
XLCd /* lcd */,
Display* /* dpy */,
wchar_t** /* list */,
int /* count */,
XICCEncodingStyle /* style */,
XTextProperty* /* text_prop */
-#endif
);
extern int _Xutf8TextListToTextProperty(
-#if NeedFunctionPrototypes
XLCd /* lcd */,
Display* /* dpy */,
char** /* list */,
int /* count */,
XICCEncodingStyle /* style */,
XTextProperty* /* text_prop */
-#endif
);
extern void _XwcFreeStringList(
-#if NeedFunctionPrototypes
XLCd /* lcd */,
wchar_t** /* list */
-#endif
);
extern int _XlcResolveLocaleName(
@@ -215,11 +207,9 @@ extern int _XlcResolveI18NPath(
);
extern char *_XlcLocaleDirName(
-#if NeedFunctionPrototypes
char* /* dir_name */,
size_t, /* dir_len */
char* /* lc_name */
-#endif
);
extern XPointer _XlcCreateLocaleDataBase(
@@ -238,6 +228,68 @@ extern void _XlcGetLocaleDataBase(
int* /* count */
);
+#ifdef X_LOCALE
+extern char *
+_Xsetlocale(
+ int category,
+ _Xconst char *name);
+#else
+extern char *_XlcMapOSLocaleName(
+ char *osname,
+ char *siname);
+#endif
+
+extern int
+_Xmbstoutf8(
+ char *ustr,
+ const char *str,
+ int len);
+extern int
+_Xlcmbstoutf8(
+ XLCd lcd,
+ char *ustr,
+ const char *str,
+ int len);
+extern int
+_Xmbstowcs(
+ wchar_t *wstr,
+ char *str,
+ int len);
+extern int
+_Xlcwcstombs(
+ XLCd lcd,
+ char *str,
+ wchar_t *wstr,
+ int len);
+extern int
+_Xlcmbstowcs(
+ XLCd lcd,
+ wchar_t *wstr,
+ char *str,
+ int len);
+extern int
+_Xwcstombs(
+ char *str,
+ wchar_t *wstr,
+ int len);
+extern int
+_Xlcmbtowc(
+ XLCd lcd,
+ wchar_t *wstr,
+ char *str,
+ int len);
+extern int
+_Xlcwctomb(
+ XLCd lcd,
+ char *str,
+ wchar_t wc);
+
+
+
+extern XPointer
+_Utf8GetConvByName(
+ const char *name);
+
_XFUNCPROTOEND
#endif /* _XLCPUBLICI_H_ */
diff --git a/src/xlibi18n/XlcPublic.h b/src/xlibi18n/XlcPublic.h
index dc86670..72df4c8 100644
--- a/src/xlibi18n/XlcPublic.h
+++ b/src/xlibi18n/XlcPublic.h
@@ -31,7 +31,7 @@
* Modifier: Takanori Tateno FUJITSU LIMITED
*
*/
-/* $XFree86: xc/lib/X11/XlcPublic.h,v 1.9 2001/01/17 19:41:49 dawes Exp $ */
+/* $XFree86: xc/lib/X11/XlcPublic.h,v 1.12 2003/11/17 22:20:10 dawes Exp $ */
/*
* Most of this API is documented in i18n/Framework.PS
*/
@@ -140,10 +140,8 @@ extern Bool _XlcAddCharSet(
Return NULL if successful, otherwise the name of the first argument
specifiying a nonexistent attribute. */
extern char *_XlcGetCSValues(
-#if NeedVarargsPrototypes
XlcCharSet charset,
...
-#endif
);
_XFUNCPROTOEND
@@ -177,13 +175,10 @@ typedef XlcConv (*XlcOpenConverterProc)(
);
typedef void (*XlcCloseConverterProc)(
-#if NeedFunctionPrototypes
XlcConv /* conv */
-#endif
);
typedef int (*XlcConvertProc)(
-#if NeedFunctionPrototypes
XlcConv /* conv */,
XPointer* /* from */,
int* /* from_left */,
@@ -191,13 +186,10 @@ typedef int (*XlcConvertProc)(
int* /* to_left */,
XPointer* /* args */,
int /* num_args */
-#endif
);
typedef void (*XlcResetConverterProc)(
-#if NeedFunctionPrototypes
XlcConv /* conv */
-#endif
);
typedef struct _XlcConvMethodsRec{
@@ -230,22 +222,24 @@ typedef struct _XlcConvRec {
_XFUNCPROTOBEGIN
extern Bool _XInitOM(
-#if NeedFunctionPrototypes
XLCd /* lcd */
-#endif
);
extern Bool _XInitIM(
-#if NeedFunctionPrototypes
XLCd /* lcd */
-#endif
+);
+
+extern XIM _XimOpenIM(
+ XLCd /* lcd */,
+ Display * /* dpy */,
+ XrmDatabase /* rdb */,
+ char * /* res_name */,
+ char * /* res_class */
);
extern char *_XGetLCValues(
-#if NeedVarargsPrototypes
XLCd /* lcd */,
...
-#endif
);
extern XlcConv _XlcOpenConverter(
@@ -295,18 +289,18 @@ extern char *_XlcFileName(
);
extern int _Xwcslen(
-#if NeedFunctionPrototypes
wchar_t* /* wstr */
-#endif
);
extern wchar_t *_Xwcscpy(
-#if NeedFunctionPrototypes
wchar_t* /* wstr1 */,
wchar_t* /* wstr2 */
-#endif
);
+extern wchar_t *_Xwcsncpy(wchar_t *wstr1, wchar_t *wstr2, int len);
+extern int _Xwcscmp(wchar_t *wstr1, wchar_t *wstr2);
+extern int _Xwcsncmp(wchar_t *wstr1, wchar_t *wstr2, int len);
+
/* Compares two ISO 8859-1 strings, ignoring case of ASCII letters.
Like strcasecmp in an ASCII locale. */
extern int _XlcCompareISOLatin1(
@@ -322,6 +316,11 @@ extern int _XlcNCompareISOLatin1(
int len
);
+extern XOM
+_XDefaultOpenOM(
+ XLCd lcd, Display *dpy, XrmDatabase rdb,
+ _Xconst char *res_name, _Xconst char *res_class);
+
_XFUNCPROTOEND
#endif /* _XLCPUBLIC_H_ */
diff --git a/src/xlibi18n/XlcSL.c b/src/xlibi18n/XlcSL.c
index 12391b1..c3f0005 100644
--- a/src/xlibi18n/XlcSL.c
+++ b/src/xlibi18n/XlcSL.c
@@ -41,14 +41,13 @@ interest in or to any trademark, service mark, logo or trade name of
Sun Microsystems, Inc. or its licensors is granted.
*/
+/* $XFree86: xc/lib/X11/XlcSL.c,v 1.2 2003/11/17 22:20:10 dawes Exp $ */
#include "Xlibint.h"
#include "Xlcint.h"
extern XIM _XDefaultOpenIM(
-#if NeedNestedPrototypes
XLCd, Display *, XrmDatabase, char *, char *
-#endif
);
Bool
@@ -65,9 +64,7 @@ XLCd lcd;
}
extern XOM _XDefaultOpenOM(
-#if NeedFunctionPrototypes
XLCd, Display*, XrmDatabase, _Xconst char*, _Xconst char*
-#endif
);
Bool
diff --git a/src/xlibi18n/Xlcint.h b/src/xlibi18n/Xlcint.h
index a216dba..fe3b8c9 100644
--- a/src/xlibi18n/Xlcint.h
+++ b/src/xlibi18n/Xlcint.h
@@ -26,7 +26,7 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/lib/X11/Xlcint.h,v 3.14 2002/11/01 13:43:31 alanh Exp $ */
+/* $XFree86: xc/lib/X11/Xlcint.h,v 3.17 2003/11/17 22:20:10 dawes Exp $ */
/*
* Copyright 1990, 1991 by OMRON Corporation, NTT Software Corporation,
@@ -79,12 +79,10 @@ from The Open Group.
#include <stdarg.h>
typedef Bool (*XFilterEventProc)(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* window */,
XEvent* /* event */,
XPointer /* client_data */
-#endif
);
typedef struct _XIMFilter {
@@ -221,41 +219,32 @@ typedef struct _XLCd *XLCd; /* need forward reference */
*/
typedef void (*XCloseLCProc)(
-#if NeedFunctionPrototypes
XLCd /* lcd */
-#endif
);
typedef char* (*XlcMapModifiersProc)(
-#if NeedFunctionPrototypes
XLCd /* lcd */,
_Xconst char* /* user_mods */,
_Xconst char* /* prog_mods */
-#endif
);
typedef XOM (*XOpenOMProc)(
-#if NeedFunctionPrototypes
XLCd /* lcd */,
Display* /* display */,
XrmDatabase /* rdb */,
_Xconst char* /* res_name */,
_Xconst char* /* res_class */
-#endif
);
typedef XIM (*XOpenIMProc)(
-#if NeedFunctionPrototypes
XLCd /* lcd */,
Display* /* display */,
XrmDatabase /* rdb */,
char* /* res_name */,
char* /* res_class */
-#endif
);
typedef Bool (*XRegisterIMInstantiateCBProc)(
-#if NeedFunctionPrototypes
XLCd /* lcd */,
Display* /* display */,
XrmDatabase /* rdb */,
@@ -263,11 +252,9 @@ typedef Bool (*XRegisterIMInstantiateCBProc)(
char* /* res_class */,
XIDProc /* callback */,
XPointer /* client_data */
-#endif
);
typedef Bool (*XUnregisterIMInstantiateCBProc)(
-#if NeedFunctionPrototypes
XLCd /* lcd */,
Display* /* display */,
XrmDatabase /* rdb */,
@@ -275,14 +262,11 @@ typedef Bool (*XUnregisterIMInstantiateCBProc)(
char* /* res_class */,
XIDProc /* callback */,
XPointer /* client_data */
-#endif
);
typedef XrmMethods (*XrmInitParseInfoProc)(
-#if NeedFunctionPrototypes
XLCd /* lcd */,
XPointer* /* state */
-#endif
);
typedef int (*XmbTextPropertyToTextListProc)(
@@ -386,33 +370,25 @@ typedef struct _XlcResource {
#define XlcNumber(arr) (sizeof(arr) / sizeof(arr[0]))
typedef Status (*XCloseOMProc)(
-#if NeedFunctionPrototypes
XOM /* om */
-#endif
);
typedef char* (*XSetOMValuesProc)(
-#if NeedFunctionPrototypes
XOM /* om */,
XlcArgList /* args */,
int /* num_args */
-#endif
);
typedef char* (*XGetOMValuesProc)(
-#if NeedFunctionPrototypes
XOM /* om */,
XlcArgList /* args */,
int /* num_args */
-#endif
);
typedef XOC (*XCreateOCProc)(
-#if NeedFunctionPrototypes
XOM /* om */,
XlcArgList /* args */,
int /* num_args */
-#endif
);
typedef struct _XOMMethodsRec {
@@ -444,25 +420,19 @@ typedef struct _XOM {
} XOMRec;
typedef void (*XDestroyOCProc)(
-#if NeedFunctionPrototypes
XOC /* oc */
-#endif
);
typedef char* (*XSetOCValuesProc)(
-#if NeedFunctionPrototypes
XOC /* oc */,
XlcArgList /* args */,
int /* num_args */
-#endif
);
typedef char* (*XGetOCValuesProc)(
-#if NeedFunctionPrototypes
XOC /* oc */,
XlcArgList /* args */,
int /* num_args */
-#endif
);
/*
@@ -475,25 +445,20 @@ typedef char* (*XGetOCValuesProc)(
*/
typedef int (*XmbTextEscapementProc)(
-#if NeedFunctionPrototypes
XFontSet /* font_set */,
_Xconst char* /* text */,
int /* text_len */
-#endif
);
typedef int (*XmbTextExtentsProc)(
-#if NeedFunctionPrototypes
XFontSet /* font_set */,
_Xconst char* /* text */,
int /* text_len */,
XRectangle* /* overall_ink_extents */,
XRectangle* /* overall_logical_extents */
-#endif
);
typedef Status (*XmbTextPerCharExtentsProc)(
-#if NeedFunctionPrototypes
XFontSet /* font_set */,
_Xconst char* /* text */,
int /* text_len */,
@@ -503,11 +468,9 @@ typedef Status (*XmbTextPerCharExtentsProc)(
int* /* num_chars */,
XRectangle* /* max_ink_extents */,
XRectangle* /* max_logical_extents */
-#endif
);
typedef int (*XmbDrawStringProc)(
-#if NeedFunctionPrototypes
Display* /* display */,
Drawable /* drawable */,
XFontSet /* font_set */,
@@ -516,11 +479,9 @@ typedef int (*XmbDrawStringProc)(
int /* y */,
_Xconst char* /* text */,
int /* text_len */
-#endif
);
typedef void (*XmbDrawImageStringProc)(
-#if NeedFunctionPrototypes
Display* /* display */,
Drawable /* drawable */,
XFontSet /* font_set */,
@@ -529,29 +490,23 @@ typedef void (*XmbDrawImageStringProc)(
int /* y */,
_Xconst char* /* text */,
int /* text_len */
-#endif
);
typedef int (*XwcTextEscapementProc)(
-#if NeedFunctionPrototypes
XFontSet /* font_set */,
_Xconst wchar_t* /* text */,
int /* text_len */
-#endif
);
typedef int (*XwcTextExtentsProc)(
-#if NeedFunctionPrototypes
XFontSet /* font_set */,
_Xconst wchar_t* /* text */,
int /* text_len */,
XRectangle* /* overall_ink_extents */,
XRectangle* /* overall_logical_extents */
-#endif
);
typedef Status (*XwcTextPerCharExtentsProc)(
-#if NeedFunctionPrototypes
XFontSet /* font_set */,
_Xconst wchar_t* /* text */,
int /* text_len */,
@@ -561,11 +516,9 @@ typedef Status (*XwcTextPerCharExtentsProc)(
int* /* num_chars */,
XRectangle* /* max_ink_extents */,
XRectangle* /* max_logical_extents */
-#endif
);
typedef int (*XwcDrawStringProc)(
-#if NeedFunctionPrototypes
Display* /* display */,
Drawable /* drawable */,
XFontSet /* font_set */,
@@ -574,11 +527,9 @@ typedef int (*XwcDrawStringProc)(
int /* y */,
_Xconst wchar_t* /* text */,
int /* text_len */
-#endif
);
typedef void (*XwcDrawImageStringProc)(
-#if NeedFunctionPrototypes
Display* /* display */,
Drawable /* drawable */,
XFontSet /* font_set */,
@@ -587,7 +538,6 @@ typedef void (*XwcDrawImageStringProc)(
int /* y */,
_Xconst wchar_t* /* text */,
int /* text_len */
-#endif
);
typedef struct {
@@ -647,12 +597,6 @@ typedef struct _XOC {
} XOCRec;
-/* current Ultrix compiler gets horribly confused */
-#if defined(FUNCPROTO) && defined(ultrix)
-#undef NeedFunctionPrototypes
-#endif
-
-
/*
* X Input Managers are an instantiable object, so we define it, the
* object itself, a method list and data.
@@ -663,39 +607,25 @@ typedef struct _XOC {
*/
typedef struct {
Status (*close)(
-#if NeedFunctionPrototypes
XIM
-#endif
);
char* (*set_values)(
-#if NeedFunctionPrototypes
XIM, XIMArg*
-#endif
);
char* (*get_values)(
-#if NeedFunctionPrototypes
XIM, XIMArg*
-#endif
);
XIC (*create_ic)(
-#if NeedFunctionPrototypes
XIM, XIMArg*
-#endif
);
int (*ctstombs)(
-#if NeedFunctionPrototypes
XIM, char*, int, char*, int, Status *
-#endif
);
int (*ctstowcs)(
-#if NeedFunctionPrototypes
XIM, char*, int, wchar_t*, int, Status *
-#endif
);
int (*ctstoutf8)(
-#if NeedFunctionPrototypes
XIM, char*, int, char*, int, Status *
-#endif
);
} XIMMethodsRec, *XIMMethods;
@@ -746,59 +676,37 @@ typedef struct _XIM {
*/
typedef struct {
void (*destroy)(
-#if NeedFunctionPrototypes
XIC
-#endif
);
void (*set_focus)(
-#if NeedFunctionPrototypes
XIC
-#endif
);
void (*unset_focus)(
-#if NeedFunctionPrototypes
XIC
-#endif
);
char* (*set_values)(
-#if NeedFunctionPrototypes
XIC, XIMArg*
-#endif
);
char* (*get_values)(
-#if NeedFunctionPrototypes
XIC, XIMArg*
-#endif
);
char* (*mb_reset)(
-#if NeedFunctionPrototypes
XIC
-#endif
);
wchar_t* (*wc_reset)(
-#if NeedFunctionPrototypes
XIC
-#endif
);
char* (*utf8_reset)(
-#if NeedFunctionPrototypes
XIC
-#endif
);
int (*mb_lookup_string)(
-#if NeedFunctionPrototypes
XIC, XKeyEvent*, char*, int, KeySym*, Status*
-#endif
);
int (*wc_lookup_string)(
-#if NeedFunctionPrototypes
XIC, XKeyEvent*, wchar_t*, int, KeySym*, Status*
-#endif
);
int (*utf8_lookup_string)(
-#if NeedFunctionPrototypes
XIC, XKeyEvent*, char*, int, KeySym*, Status*
-#endif
);
} XICMethodsRec, *XICMethods;
@@ -840,10 +748,6 @@ typedef struct _XIC {
XICCoreRec core; /* data of this IC */
} XICRec;
-/* current Ultrix compiler gets horribly confused */
-#if !defined(NeedFunctionPrototypes) && defined(FUNCPROTO)
-#define NeedFunctionPrototypes 1
-#endif
/* If the argument 'name' is appropriate for this loader, it instantiates an
XLCd object with appropriate locale methods and returns it. May return
@@ -855,7 +759,7 @@ typedef XLCd (*XLCdLoadProc)(
_XFUNCPROTOBEGIN
extern XLCd _XOpenLC(
- const char* name
+ char* name
);
extern void _XCloseLC(
@@ -876,25 +780,19 @@ extern char *_XlcDefaultMapModifiers(
);
extern void _XIMCompileResourceList(
-#if NeedFunctionPrototypes
XIMResourceList /* res */,
unsigned int /* num_res */
-#endif
);
extern void _XCopyToArg(
-#if NeedFunctionPrototypes
XPointer /* src */,
XPointer* /* dst */,
unsigned int /* size */
-#endif
);
extern char ** _XParseBaseFontNameList(
-#if NeedFunctionPrototypes
char* /* str */,
int* /* num */
-#endif
);
extern XrmMethods _XrmInitParseInfo(
@@ -902,54 +800,42 @@ extern XrmMethods _XrmInitParseInfo(
);
extern void _XRegisterFilterByMask(
-#if NeedFunctionPrototypes
Display* /* dpy */,
Window /* window */,
unsigned long /* event_mask */,
Bool (*)(
-#if NeedNestedPrototypes
Display* /* display */,
Window /* window */,
XEvent* /* event */,
XPointer /* client_data */
-#endif
) /* filter */,
XPointer /* client_data */
-#endif
);
extern void _XRegisterFilterByType(
-#if NeedFunctionPrototypes
Display* /* dpy */,
Window /* window */,
int /* start_type */,
int /* end_type */,
Bool (*)(
-#if NeedNestedPrototypes
Display* /* display */,
Window /* window */,
XEvent* /* event */,
XPointer /* client_data */
-#endif
) /* filter */,
XPointer /* client_data */
-#endif
);
extern void _XUnregisterFilter(
-#if NeedFunctionPrototypes
Display* /* dpy */,
Window /* window */,
Bool (*)(
-#if NeedNestedPrototypes
Display* /* display */,
Window /* window */,
XEvent* /* event */,
XPointer /* client_data */
-#endif
) /* filter */,
XPointer /* client_data */
-#endif
);
extern void _XlcCountVaList(
@@ -963,6 +849,19 @@ extern void _XlcVaToArgList(
XlcArgList* args_return
);
+
+extern void _XlcCopyFromArg(
+ char * src,
+ char * dst,
+ int size
+);
+
+extern void _XlcCopyToArg(
+ char * src,
+ char ** dst,
+ int size
+);
+
extern void _XlcCompileResourceList(
XlcResourceList resources,
int num_resources
diff --git a/src/xlibi18n/imKStoUCS.c b/src/xlibi18n/imKStoUCS.c
index 693db4a..56ec7e2 100644
--- a/src/xlibi18n/imKStoUCS.c
+++ b/src/xlibi18n/imKStoUCS.c
@@ -1,6 +1,7 @@
-/* $XFree86: xc/lib/X11/imKStoUCS.c,v 1.2 2001/07/25 15:04:45 dawes Exp $ */
+/* $XFree86: xc/lib/X11/imKStoUCS.c,v 1.5 2003/11/17 22:20:11 dawes Exp $ */
#include "Xlibint.h"
+#include "Ximint.h"
static unsigned short const keysym_to_unicode_1a1_1ff[] = {
0x0104, 0x02d8, 0x0141, 0x0000, 0x013d, 0x015a, 0x0000, /* 0x01a0-0x01a7 */
@@ -233,8 +234,8 @@ static unsigned short keysym_to_unicode_15d0_15f6[] = {
static unsigned short keysym_to_unicode_16a0_16f6[] = {
0x0000, 0x0000, 0xf0a2, 0x1e8a, 0x0000, 0xf0a5, 0x012c, 0xf0a7, /* 0x16a0-0x16a7 */
0xf0a8, 0x01b5, 0x01e6, 0x0000, 0x0000, 0x0000, 0x0000, 0x019f, /* 0x16a8-0x16af */
- 0x0000, 0x017e, 0xf0b2, 0x1e8b, 0x01d1, 0xf0b5, 0x012d, 0xf0b7, /* 0x16b0-0x16b7 */
- 0xf0b8, 0x01b6, 0x01e7, 0x01d2, 0x0000, 0x0000, 0x0000, 0x0275, /* 0x16b8-0x16bf */
+ 0x0000, 0x0000, 0xf0b2, 0x1e8b, 0x01d1, 0xf0b5, 0x012d, 0xf0b7, /* 0x16b0-0x16b7 */
+ 0xf0b8, 0x01b6, 0x01e7, 0x0000, 0x0000, 0x01d2, 0x0000, 0x0275, /* 0x16b8-0x16bf */
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x018f, 0x0000, /* 0x16c0-0x16c7 */
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x16c8-0x16cf */
0x0000, 0x1e36, 0xf0d2, 0xf0d3, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x16d0-0x16d7 */
@@ -266,12 +267,7 @@ static unsigned short const keysym_to_unicode_20a0_20ac[] = {
};
unsigned int
-#if NeedFunctionPrototypes
KeySymToUcs4(KeySym keysym)
-#else
-KeySymToUcs4(keysym)
- KeySym keysym;
-#endif
{
/* 'Unicode keysym' */
if ((keysym & 0xff000000) == 0x01000000)
@@ -316,7 +312,7 @@ KeySymToUcs4(keysym)
else if (keysym > 0x169f && keysym < 0x16f7)
return keysym_to_unicode_16a0_16f6[keysym - 0x16a0];
else if (keysym > 0x1e9e && keysym < 0x1f00)
- return keysym_to_unicode_1e9f_1eff[keysym - 0x1ea0];
+ return keysym_to_unicode_1e9f_1eff[keysym - 0x1e9f];
else if (keysym > 0x209f && keysym < 0x20ad)
return keysym_to_unicode_20a0_20ac[keysym - 0x20a0];
else
diff --git a/src/xlibi18n/lcCT.c b/src/xlibi18n/lcCT.c
index fcaca22..cae3f6f 100644
--- a/src/xlibi18n/lcCT.c
+++ b/src/xlibi18n/lcCT.c
@@ -36,7 +36,7 @@
* Modifier: Ivan Pascal The XFree86 Project
* Modifier: Bruno Haible The XFree86 Project
*/
-/* $XFree86: xc/lib/X11/lcCT.c,v 3.27 2002/10/08 23:31:35 dawes Exp $ */
+/* $XFree86: xc/lib/X11/lcCT.c,v 3.28 2003/08/04 10:32:20 eich Exp $ */
#include "Xlibint.h"
#include "XlcPubI.h"
@@ -116,8 +116,10 @@ static CTDataRec default_ct_data[] =
defined in XLC_LOCALE files, using "\033%/1" or "\033%/2". */
/* Backward compatibility with XFree86 3.x */
+#if 1
{ "ISO8859-14:GR", "\033%/1" },
{ "ISO8859-15:GR", "\033%/1" },
+#endif
/* For use by utf8 -> ctext */
{ "BIG5-0:GLGR", "\033%/2"},
/* used by Emacs, but not backed by ISO-IR */
@@ -400,7 +402,7 @@ typedef struct _CTInfoRec {
* at runtime through _XlcAddCT.
*/
static CTInfo ct_list = NULL;
-static CTInfo *ct_list_end = &ct_list;
+static CTInfo ct_list_end = NULL;
/*
* Returns a Compound Text info record for an ESC sequence.
@@ -534,8 +536,12 @@ _XlcAddCT(
/* Insert it at the end. If there are duplicates CTinfo entries
for the same XlcCharSet, we want the first (standard) one to
override the second (user defined) one. */
- ct_info->next = *ct_list_end;
- *ct_list_end = ct_info;
+ ct_info->next = NULL;
+ if (ct_list_end)
+ ct_list_end->next = ct_info;
+ else
+ ct_list = ct_info;
+ ct_list_end = ct_info;
} else {
if (existing_info->charset != charset
/* We have a conflict, with one exception: JISX0208.1983-0 and
diff --git a/src/xlibi18n/lcDB.c b/src/xlibi18n/lcDB.c
index 8e12a69..4a88ea3 100644
--- a/src/xlibi18n/lcDB.c
+++ b/src/xlibi18n/lcDB.c
@@ -28,7 +28,7 @@
* This is source code modified by FUJITSU LIMITED under the Joint
* Development Agreement for the CDE/Motif PST.
*/
-/* $XFree86: xc/lib/X11/lcDB.c,v 3.15 2002/05/31 18:45:42 dawes Exp $ */
+/* $XFree86: xc/lib/X11/lcDB.c,v 3.16 2003/05/27 22:26:26 tsi Exp $ */
@@ -126,8 +126,7 @@ static TokenTable token_tbl[] = {
{ T_NUMERIC_HEX, "\\x", 2, f_numeric },
{ T_NUMERIC_DEC, "\\d", 2, f_numeric },
{ T_NUMERIC_OCT, "\\o", 2, f_numeric },
- { T_DEFAULT, " ", 1, f_default }, /* any character */
- {0}
+ { T_DEFAULT, " ", 1, f_default } /* any character */
};
#define SYM_CR '\r'
diff --git a/src/xlibi18n/lcFile.c b/src/xlibi18n/lcFile.c
index d94045d..5ef493b 100644
--- a/src/xlibi18n/lcFile.c
+++ b/src/xlibi18n/lcFile.c
@@ -23,7 +23,7 @@
* SOFTWARE.
*
*/
-/* $XFree86: xc/lib/X11/lcFile.c,v 3.30.2.1 2003/03/11 23:18:49 herrb Exp $ */
+/* $XFree86: xc/lib/X11/lcFile.c,v 3.33 2003/07/16 01:38:26 dawes Exp $ */
#include <stdlib.h>
#include <stdio.h>
@@ -31,9 +31,17 @@
#include "Xlibint.h"
#include "XlcPubI.h"
#include <X11/Xos.h>
+#if 0
+#include <unistd.h> /* in theory delivers getresuid/gid prototypes,
+ * in practice only the Linux syscall wrapper is there. */
+#endif
+
/************************************************************************/
+#ifdef __UNIXOS2__
+# define seteuid setuid
+#endif
#define iscomment(ch) ((ch) == '#' || (ch) == '\0')
#if defined(WIN32)
#define isreadable(f) (_XAccessFile(f))
@@ -109,6 +117,41 @@ parse_line(
return argc;
}
+#ifdef __UNIXOS2__
+
+/* fg021216: entries in locale files are separated by colons while under
+ OS/2, path entries are separated by semicolon, so we need two functions */
+
+static int
+parse_line1(
+ char *line,
+ char **argv,
+ int argsize)
+{
+ int argc = 0;
+ char *p = line;
+
+ while (argc < argsize) {
+ while (isspace(*p)) {
+ ++p;
+ }
+ if (*p == '\0') {
+ break;
+ }
+ argv[argc++] = p;
+ while (*p != ';' && *p != '\n' && *p != '\0') {
+ ++p;
+ }
+ if (*p == '\0') {
+ break;
+ }
+ *p++ = '\0';
+ }
+
+ return argc;
+}
+#endif /* __UNIXOS2__ */
+
/* Splits a colon separated list of directories, and returns the constituent
paths (without trailing slash). At most argsize constituents are stored
at argv[0..argsize-1]. The number of stored constituents is returned. */
@@ -121,7 +164,11 @@ _XlcParsePath(
char *p = path;
int n, i;
+#ifndef __UNIXOS2__
n = parse_line(path, argv, argsize);
+#else
+ n = parse_line1(path, argv, argsize);
+#endif
for (i = 0; i < n; ++i) {
int len;
p = argv[i];
diff --git a/src/xlibi18n/lcGeneric.c b/src/xlibi18n/lcGeneric.c
index 06d370d..8eaf498 100644
--- a/src/xlibi18n/lcGeneric.c
+++ b/src/xlibi18n/lcGeneric.c
@@ -28,7 +28,7 @@
* This is source code modified by FUJITSU LIMITED under the Joint
* Development Agreement for the CDE/Motif PST.
*/
-/* $XFree86: xc/lib/X11/lcGeneric.c,v 3.17 2003/02/03 22:11:58 paulo Exp $ */
+/* $XFree86: xc/lib/X11/lcGeneric.c,v 3.20 2003/09/24 02:43:12 dawes Exp $ */
#include <stdio.h>
#include "Xlibint.h"
@@ -787,7 +787,7 @@ load_generic(
if (num > 0) {
static struct {
const char *str;
- int type;
+ EncodingType type;
} shifts[] = {
{"<SS>", E_SS},
{"<LSL>", E_LSL},
@@ -801,7 +801,7 @@ load_generic(
for ( ; num-- > 0; value++) {
char encoding[256];
char *tmp = *value;
- int type = E_SS; /* for BC */
+ EncodingType type = E_SS; /* for BC */
for (j = 0; shifts[j].str; j++) {
if (!_XlcNCompareISOLatin1(tmp, shifts[j].str,
strlen(shifts[j].str))) {
@@ -868,7 +868,7 @@ load_generic(
/* For VW/UDC */
/***** 3.4.2 byteM (1 <= M <= length)*****/
for (M=1; M-1 < codeset->length; M++) {
- long start,end;
+ unsigned long start,end;
ByteInfo tmpb;
sprintf(name,"%s.%s%d",cs,"byte",M);
@@ -992,8 +992,8 @@ err:
super_class's initialize method() */
static Bool
-initialize_core(lcd)
- XLCd lcd;
+initialize_core(
+ XLCd lcd)
{
_XInitDynamicOM(lcd);
diff --git a/src/xlibi18n/lcPrTxt.c b/src/xlibi18n/lcPrTxt.c
index 8998ff2..9078b9b 100644
--- a/src/xlibi18n/lcPrTxt.c
+++ b/src/xlibi18n/lcPrTxt.c
@@ -23,7 +23,7 @@
* Author: Katsuhisa Yano TOSHIBA Corp.
* mopi@osa.ilab.toshiba.co.jp
*/
-/* $XFree86: xc/lib/X11/lcPrTxt.c,v 1.8 2002/06/03 22:36:00 dawes Exp $ */
+/* $XFree86: xc/lib/X11/lcPrTxt.c,v 1.10 2003/05/29 13:22:51 pascal Exp $ */
#include "Xlibint.h"
#include "XlcPubI.h"
@@ -154,7 +154,6 @@ _XTextPropertyToTextList(
buf_len = text_prop->nitems * 6 + 1;
else
buf_len = text_prop->nitems * XLC_PUBLIC(lcd, mb_cur_max) + 1;
- buf = (XPointer) Xmalloc(buf_len);
}
buf = (XPointer) Xmalloc(buf_len);
if (buf == NULL)
@@ -213,7 +212,8 @@ _XTextPropertyToTextList(
to++;
to_left--;
}
- _XlcResetConverter(conv);
+ if (! do_strcpy)
+ _XlcResetConverter(conv);
} else
str_ptr++;
diff --git a/src/xlibi18n/lcPublic.c b/src/xlibi18n/lcPublic.c
index 853ed8f..80459d6 100644
--- a/src/xlibi18n/lcPublic.c
+++ b/src/xlibi18n/lcPublic.c
@@ -23,7 +23,7 @@
* Author: Katsuhisa Yano TOSHIBA Corp.
* mopi@osa.ilab.toshiba.co.jp
*/
-/* $XFree86: xc/lib/X11/lcPublic.c,v 1.11 2001/11/16 00:52:28 dawes Exp $ */
+/* $XFree86: xc/lib/X11/lcPublic.c,v 1.12 2003/04/13 19:22:21 dawes Exp $ */
#include <stdio.h>
#include "Xlibint.h"
@@ -206,7 +206,6 @@ initialize(
int len;
char sinamebuf[256];
char* siname;
- char *_XlcMapOSLocaleName();
#endif
_XlcInitCTInfo();
diff --git a/src/xlibi18n/lcStd.c b/src/xlibi18n/lcStd.c
index 9a07bbb..b8e5ae4 100644
--- a/src/xlibi18n/lcStd.c
+++ b/src/xlibi18n/lcStd.c
@@ -23,17 +23,17 @@
* Author: Katsuhisa Yano TOSHIBA Corp.
* mopi@osa.ilab.toshiba.co.jp
*/
-/* $XFree86: xc/lib/X11/lcStd.c,v 1.5 2001/01/17 19:41:55 dawes Exp $ */
+/* $XFree86: xc/lib/X11/lcStd.c,v 1.7 2003/04/17 02:06:32 dawes Exp $ */
#include "Xlibint.h"
#include "XlcPubI.h"
int
-_Xlcmbtowc(lcd, wstr, str, len)
- XLCd lcd;
- wchar_t *wstr;
- char *str;
- int len;
+_Xlcmbtowc(
+ XLCd lcd,
+ wchar_t *wstr,
+ char *str,
+ int len)
{
static XLCd last_lcd = NULL;
static XlcConv conv = NULL;
@@ -74,10 +74,10 @@ _Xlcmbtowc(lcd, wstr, str, len)
}
int
-_Xlcwctomb(lcd, str, wc)
- XLCd lcd;
- char *str;
- wchar_t wc;
+_Xlcwctomb(
+ XLCd lcd,
+ char *str,
+ wchar_t wc)
{
static XLCd last_lcd = NULL;
static XlcConv conv = NULL;
@@ -117,11 +117,11 @@ _Xlcwctomb(lcd, str, wc)
}
int
-_Xlcmbstowcs(lcd, wstr, str, len)
- XLCd lcd;
- wchar_t *wstr;
- char *str;
- int len;
+_Xlcmbstowcs(
+ XLCd lcd,
+ wchar_t *wstr,
+ char *str,
+ int len)
{
XlcConv conv;
XPointer from, to;
@@ -156,11 +156,11 @@ _Xlcmbstowcs(lcd, wstr, str, len)
}
int
-_Xlcwcstombs(lcd, str, wstr, len)
- XLCd lcd;
- char *str;
- wchar_t *wstr;
- int len;
+_Xlcwcstombs(
+ XLCd lcd,
+ char *str,
+ wchar_t *wstr,
+ int len)
{
XlcConv conv;
XPointer from, to;
@@ -196,61 +196,63 @@ _Xlcwcstombs(lcd, str, wstr, len)
int
-_Xmbtowc(wstr, str, len)
- wchar_t *wstr;
+_Xmbtowc(
+ wchar_t *wstr,
#ifdef ISC
- char const *str;
- size_t len;
+ char const *str,
+ size_t len
#else
- char *str;
- int len;
+ char *str,
+ int len
#endif
+ )
{
return _Xlcmbtowc((XLCd) NULL, wstr, str, len);
}
int
-_Xmblen(str, len)
+_Xmblen(
#ifdef ISC
- char const *str;
- size_t len;
+ char const *str,
+ size_t len
#else
- char *str;
- int len;
+ char *str,
+ int len
#endif
+ )
{
return _Xmbtowc((wchar_t *) NULL, str, len);
}
int
-_Xwctomb(str, wc)
- char *str;
- wchar_t wc;
+_Xwctomb(
+ char *str,
+ wchar_t wc)
{
return _Xlcwctomb((XLCd) NULL, str, wc);
}
int
-_Xmbstowcs(wstr, str, len)
- wchar_t *wstr;
- char *str;
- int len;
+_Xmbstowcs(
+ wchar_t *wstr,
+ char *str,
+ int len)
{
return _Xlcmbstowcs((XLCd) NULL, wstr, str, len);
}
int
-_Xwcstombs(str, wstr, len)
- char *str;
- wchar_t *wstr;
- int len;
+_Xwcstombs(
+ char *str,
+ wchar_t *wstr,
+ int len)
{
return _Xlcwcstombs((XLCd) NULL, str, wstr, len);
}
wchar_t *
-_Xwcscpy(wstr1, wstr2)
- register wchar_t *wstr1, *wstr2;
+_Xwcscpy(
+ register wchar_t *wstr1, register wchar_t *wstr2)
{
wchar_t *wstr_tmp = wstr1;
@@ -261,9 +263,9 @@ _Xwcscpy(wstr1, wstr2)
}
wchar_t *
-_Xwcsncpy(wstr1, wstr2, len)
- register wchar_t *wstr1, *wstr2;
- register int len;
+_Xwcsncpy(
+ register wchar_t *wstr1, register wchar_t *wstr2,
+ register int len)
{
wchar_t *wstr_tmp = wstr1;
@@ -278,8 +280,8 @@ _Xwcsncpy(wstr1, wstr2, len)
}
int
-_Xwcslen(wstr)
- register wchar_t *wstr;
+_Xwcslen(
+ register wchar_t *wstr)
{
register wchar_t *wstr_ptr = wstr;
@@ -290,8 +292,8 @@ _Xwcslen(wstr)
}
int
-_Xwcscmp(wstr1, wstr2)
- register wchar_t *wstr1, *wstr2;
+_Xwcscmp(
+ register wchar_t *wstr1, register wchar_t *wstr2)
{
for ( ; *wstr1 && *wstr2; wstr1++, wstr2++)
if (*wstr1 != *wstr2)
@@ -301,9 +303,9 @@ _Xwcscmp(wstr1, wstr2)
}
int
-_Xwcsncmp(wstr1, wstr2, len)
- register wchar_t *wstr1, *wstr2;
- register int len;
+_Xwcsncmp(
+ register wchar_t *wstr1, register wchar_t *wstr2,
+ register int len)
{
for ( ; *wstr1 && *wstr2 && len > 0; wstr1++, wstr2++, len--)
if (*wstr1 != *wstr2)
@@ -317,11 +319,11 @@ _Xwcsncmp(wstr1, wstr2, len)
int
-_Xlcmbstoutf8(lcd, ustr, str, len)
- XLCd lcd;
- char *ustr;
- const char *str;
- int len;
+_Xlcmbstoutf8(
+ XLCd lcd,
+ char *ustr,
+ const char *str,
+ int len)
{
XlcConv conv;
XPointer from, to;
@@ -356,10 +358,10 @@ _Xlcmbstoutf8(lcd, ustr, str, len)
}
int
-_Xmbstoutf8(ustr, str, len)
- char *ustr;
- const char *str;
- int len;
+_Xmbstoutf8(
+ char *ustr,
+ const char *str,
+ int len)
{
return _Xlcmbstoutf8((XLCd) NULL, ustr, str, len);
}
diff --git a/src/xlibi18n/lcUTF8.c b/src/xlibi18n/lcUTF8.c
index 1f40704..cc51c30 100644
--- a/src/xlibi18n/lcUTF8.c
+++ b/src/xlibi18n/lcUTF8.c
@@ -24,7 +24,7 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
******************************************************************/
-/* $XFree86: xc/lib/X11/lcUTF8.c,v 1.15 2002/10/08 23:31:36 dawes Exp $ */
+/* $XFree86: xc/lib/X11/lcUTF8.c,v 1.16 2003/11/17 22:20:12 dawes Exp $ */
/*
* This file contains:
@@ -129,16 +129,8 @@ typedef unsigned int ucs4_t;
typedef struct _Utf8ConvRec {
const char *name;
XrmQuark xrm_name;
-#if NeedFunctionPrototypes
int (* cstowc) (XlcConv, ucs4_t *, unsigned char const *, int);
-#else
- int (* cstowc) ();
-#endif
-#if NeedFunctionPrototypes
int (* wctocs) (XlcConv, unsigned char *, ucs4_t, int);
-#else
- int (* wctocs) ();
-#endif
} Utf8ConvRec, *Utf8Conv;
/*
diff --git a/src/xlibi18n/lcUniConv/README b/src/xlibi18n/lcUniConv/README
index 844f090..6ce59c7 100644
--- a/src/xlibi18n/lcUniConv/README
+++ b/src/xlibi18n/lcUniConv/README
@@ -1,3 +1,5 @@
+$XFree86: xc/lib/X11/lcUniConv/README,v 1.3 2003/10/24 15:34:01 tsi Exp $
+
The files in this directory are taken from the libiconv-1.1 package.
The *.h files were generated from tables (mostly from ftp.unicode.org) using
@@ -6,5 +8,5 @@ optimizations were applied by hand.
If you find a bug in these files, instead of modifying them in XFree86
and let it diverge from libiconv, please notify the libiconv maintainer
-(currently <haible@clisp.cons.org>) so he can fix both in synch.
+(currently <bruno@clisp.org>) so he can fix both in synch.
diff --git a/src/xlibi18n/lcUniConv/armscii_8.h b/src/xlibi18n/lcUniConv/armscii_8.h
index 32b4e9c..6f8c10c 100644
--- a/src/xlibi18n/lcUniConv/armscii_8.h
+++ b/src/xlibi18n/lcUniConv/armscii_8.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/X11/lcUniConv/armscii_8.h,v 1.3 2000/11/29 17:40:28 dawes Exp $ */
+/* $XFree86: xc/lib/X11/lcUniConv/armscii_8.h,v 1.4 2003/07/15 17:33:45 pascal Exp $ */
/*
* ARMSCII-8
@@ -6,8 +6,8 @@
static const unsigned short armscii_8_2uni[96] = {
/* 0xa0 */
- 0x00a0, 0x2741, 0x00a7, 0x0589, 0x0029, 0x0028, 0x00bb, 0x00ab,
- 0x2014, 0x002e, 0x055d, 0x002c, 0x002d, 0x055f, 0x2026, 0x055c,
+ 0x00a0, 0xfffd, 0x0587, 0x0589, 0x0029, 0x0028, 0x00bb, 0x00ab,
+ 0x2014, 0x002e, 0x055d, 0x002c, 0x002d, 0x058a, 0x2026, 0x055c,
/* 0xb0 */
0x055b, 0x055e, 0x0531, 0x0561, 0x0532, 0x0562, 0x0533, 0x0563,
0x0534, 0x0564, 0x0535, 0x0565, 0x0536, 0x0566, 0x0537, 0x0567,
@@ -22,26 +22,32 @@ static const unsigned short armscii_8_2uni[96] = {
0x054c, 0x057c, 0x054d, 0x057d, 0x054e, 0x057e, 0x054f, 0x057f,
/* 0xf0 */
0x0550, 0x0580, 0x0551, 0x0581, 0x0552, 0x0582, 0x0553, 0x0583,
- 0x0554, 0x0584, 0x0555, 0x0585, 0x0556, 0x0586, 0x2019, 0x0027,
+ 0x0554, 0x0584, 0x0555, 0x0585, 0x0556, 0x0586, 0x055a, 0xfffd,
};
static int
armscii_8_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, int n)
{
unsigned char c = *s;
- if (c < 0xa0)
+ if (c < 0xa0) {
*pwc = (ucs4_t) c;
- else
- *pwc = (ucs4_t) armscii_8_2uni[c-0xa0];
- return 1;
+ return 1;
+ }
+ else {
+ unsigned short wc = armscii_8_2uni[c-0xa0];
+ if (wc != 0xfffd) {
+ *pwc = (ucs4_t) wc;
+ return 1;
+ }
+ }
+ return RET_ILSEQ;
}
-static const unsigned char armscii_8_page00[16] = {
- 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0xff, /* 0x20-0x27 */
+static const unsigned char armscii_8_page00[8] = {
0xa5, 0xa4, 0x2a, 0x2b, 0xab, 0xac, 0xa9, 0x2f, /* 0x28-0x2f */
};
static const unsigned char armscii_8_page00_1[32] = {
- 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa2, /* 0xa0-0xa7 */
+ 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
0x00, 0x00, 0x00, 0xa7, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
0x00, 0x00, 0x00, 0xa6, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
@@ -52,17 +58,17 @@ static const unsigned char armscii_8_page05[96] = {
0xd0, 0xd2, 0xd4, 0xd6, 0xd8, 0xda, 0xdc, 0xde, /* 0x40-0x47 */
0xe0, 0xe2, 0xe4, 0xe6, 0xe8, 0xea, 0xec, 0xee, /* 0x48-0x4f */
0xf0, 0xf2, 0xf4, 0xf6, 0xf8, 0xfa, 0xfc, 0x00, /* 0x50-0x57 */
- 0x00, 0x00, 0x00, 0xb0, 0xaf, 0xaa, 0xb1, 0xad, /* 0x58-0x5f */
+ 0x00, 0x00, 0xfe, 0xb0, 0xaf, 0xaa, 0xb1, 0x00, /* 0x58-0x5f */
0x00, 0xb3, 0xb5, 0xb7, 0xb9, 0xbb, 0xbd, 0xbf, /* 0x60-0x67 */
0xc1, 0xc3, 0xc5, 0xc7, 0xc9, 0xcb, 0xcd, 0xcf, /* 0x68-0x6f */
0xd1, 0xd3, 0xd5, 0xd7, 0xd9, 0xdb, 0xdd, 0xdf, /* 0x70-0x77 */
0xe1, 0xe3, 0xe5, 0xe7, 0xe9, 0xeb, 0xed, 0xef, /* 0x78-0x7f */
- 0xf1, 0xf3, 0xf5, 0xf7, 0xf9, 0xfb, 0xfd, 0x00, /* 0x80-0x87 */
- 0x00, 0xa3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+ 0xf1, 0xf3, 0xf5, 0xf7, 0xf9, 0xfb, 0xfd, 0xa2, /* 0x80-0x87 */
+ 0x00, 0xa3, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
};
static const unsigned char armscii_8_page20[24] = {
0x00, 0x00, 0x00, 0x00, 0xa8, 0x00, 0x00, 0x00, /* 0x10-0x17 */
- 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xae, 0x00, /* 0x20-0x27 */
};
@@ -70,12 +76,12 @@ static int
armscii_8_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n)
{
unsigned char c = 0;
- if (wc < 0x0020) {
+ if (wc < 0x0028) {
*r = wc;
return 1;
}
- else if (wc >= 0x0020 && wc < 0x0030)
- c = armscii_8_page00[wc-0x0020];
+ else if (wc >= 0x0028 && wc < 0x0030)
+ c = armscii_8_page00[wc-0x0028];
else if (wc >= 0x0030 && wc < 0x00a0)
c = wc;
else if (wc >= 0x00a0 && wc < 0x00c0)
@@ -84,8 +90,6 @@ armscii_8_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n)
c = armscii_8_page05[wc-0x0530];
else if (wc >= 0x2010 && wc < 0x2028)
c = armscii_8_page20[wc-0x2010];
- else if (wc == 0x2741)
- c = 0xa1;
if (c != 0) {
*r = c;
return 1;
diff --git a/src/xlibi18n/lcUniConv/big5.h b/src/xlibi18n/lcUniConv/big5.h
index 83e5f40..deff866 100644
--- a/src/xlibi18n/lcUniConv/big5.h
+++ b/src/xlibi18n/lcUniConv/big5.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/X11/lcUniConv/big5.h,v 1.1 2000/11/28 18:50:03 dawes Exp $ */
+/* $XFree86: xc/lib/X11/lcUniConv/big5.h,v 1.2 2003/05/27 22:26:28 tsi Exp $ */
/*
* BIG5
@@ -4103,7 +4103,7 @@ big5_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n)
{
if (n >= 2) {
const Summary16 *summary = NULL;
- if (wc >= 0x0000 && wc < 0x0100)
+ if (wc < 0x0100)
summary = &big5_uni2indx_page00[(wc>>4)];
else if (wc >= 0x0200 && wc < 0x0460)
summary = &big5_uni2indx_page02[(wc>>4)-0x020];
diff --git a/src/xlibi18n/lcUniConv/gb2312.h b/src/xlibi18n/lcUniConv/gb2312.h
index 7337e0b..3c0c359 100644
--- a/src/xlibi18n/lcUniConv/gb2312.h
+++ b/src/xlibi18n/lcUniConv/gb2312.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/X11/lcUniConv/gb2312.h,v 1.4 2001/08/09 19:14:07 dawes Exp $ */
+/* $XFree86: xc/lib/X11/lcUniConv/gb2312.h,v 1.5 2003/05/27 22:26:29 tsi Exp $ */
/*
* GB2312.1980-0
@@ -2518,7 +2518,7 @@ gb2312_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n)
{
if (n >= 2) {
const Summary16 *summary = NULL;
- if (wc >= 0x0000 && wc < 0x0460)
+ if (wc < 0x0460)
summary = &gb2312_uni2indx_page00[(wc>>4)];
else if (wc >= 0x2000 && wc < 0x2650)
summary = &gb2312_uni2indx_page20[(wc>>4)-0x200];
diff --git a/src/xlibi18n/lcUniConv/iso8859_16.h b/src/xlibi18n/lcUniConv/iso8859_16.h
index 3efe2ff..5b3f870 100644
--- a/src/xlibi18n/lcUniConv/iso8859_16.h
+++ b/src/xlibi18n/lcUniConv/iso8859_16.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/X11/lcUniConv/iso8859_16.h,v 1.3 2000/11/29 17:40:31 dawes Exp $ */
+/* $XFree86: xc/lib/X11/lcUniConv/iso8859_16.h,v 1.4 2003/07/15 17:33:45 pascal Exp $ */
/*
* ISO-8859-16
@@ -6,8 +6,8 @@
static const unsigned short iso8859_16_2uni[96] = {
/* 0xa0 */
- 0x00a0, 0x0104, 0x0105, 0x0141, 0x20ac, 0x00ab, 0x0160, 0x00a7,
- 0x0161, 0x00a9, 0x0218, 0x201e, 0x0179, 0x00ad, 0x017a, 0x017b,
+ 0x00a0, 0x0104, 0x0105, 0x0141, 0x20ac, 0x201e, 0x0160, 0x00a7,
+ 0x0161, 0x00a9, 0x0218, 0x00ab, 0x0179, 0x00ad, 0x017a, 0x017b,
/* 0xb0 */
0x00b0, 0x00b1, 0x010c, 0x0142, 0x017d, 0x201d, 0x00b6, 0x00b7,
0x017e, 0x010d, 0x0219, 0x00bb, 0x0152, 0x0153, 0x0178, 0x017c,
@@ -38,7 +38,7 @@ iso8859_16_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, int n)
static const unsigned char iso8859_16_page00[224] = {
0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa7, /* 0xa0-0xa7 */
- 0x00, 0xa9, 0x00, 0xa5, 0x00, 0xad, 0x00, 0x00, /* 0xa8-0xaf */
+ 0x00, 0xa9, 0x00, 0xab, 0x00, 0xad, 0x00, 0x00, /* 0xa8-0xaf */
0xb0, 0xb1, 0x00, 0x00, 0x00, 0x00, 0xb6, 0xb7, /* 0xb0-0xb7 */
0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
0xc0, 0xc1, 0xc2, 0x00, 0xc4, 0x00, 0xc6, 0xc7, /* 0xc0-0xc7 */
@@ -71,7 +71,7 @@ static const unsigned char iso8859_16_page02[8] = {
0xaa, 0xba, 0xde, 0xfe, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
};
static const unsigned char iso8859_16_page20[8] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xb5, 0xab, 0x00, /* 0x18-0x1f */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xb5, 0xa5, 0x00, /* 0x18-0x1f */
};
static int
diff --git a/src/xlibi18n/lcUniConv/jisx0208.h b/src/xlibi18n/lcUniConv/jisx0208.h
index ea07547..9c08052 100644
--- a/src/xlibi18n/lcUniConv/jisx0208.h
+++ b/src/xlibi18n/lcUniConv/jisx0208.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/X11/lcUniConv/jisx0208.h,v 1.5 2001/11/21 21:20:56 dawes Exp $ */
+/* $XFree86: xc/lib/X11/lcUniConv/jisx0208.h,v 1.6 2003/05/27 22:26:31 tsi Exp $ */
/*
* JISX0208.1990-0
@@ -2360,7 +2360,7 @@ jisx0208_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n)
{
if (n >= 2) {
const Summary16 *summary = NULL;
- if (wc >= 0x0000 && wc < 0x0100)
+ if (wc < 0x0100)
summary = &jisx0208_uni2indx_page00[(wc>>4)];
else if (wc >= 0x0300 && wc < 0x0460)
summary = &jisx0208_uni2indx_page03[(wc>>4)-0x030];
diff --git a/src/xlibi18n/lcUniConv/jisx0212.h b/src/xlibi18n/lcUniConv/jisx0212.h
index 3b7e6dc..a4857b9 100644
--- a/src/xlibi18n/lcUniConv/jisx0212.h
+++ b/src/xlibi18n/lcUniConv/jisx0212.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/X11/lcUniConv/jisx0212.h,v 1.4 2001/08/09 19:14:08 dawes Exp $ */
+/* $XFree86: xc/lib/X11/lcUniConv/jisx0212.h,v 1.5 2003/05/27 22:26:31 tsi Exp $ */
/*
* JISX0212.1990-0
@@ -2135,7 +2135,7 @@ jisx0212_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n)
{
if (n >= 2) {
const Summary16 *summary = NULL;
- if (wc >= 0x0000 && wc < 0x0460)
+ if (wc < 0x0460)
summary = &jisx0212_uni2indx_page00[(wc>>4)];
else if (wc >= 0x2100 && wc < 0x2130)
summary = &jisx0212_uni2indx_page21[(wc>>4)-0x210];
diff --git a/src/xlibi18n/lcUniConv/ksc5601.h b/src/xlibi18n/lcUniConv/ksc5601.h
index c7dab1e..62ac66d 100644
--- a/src/xlibi18n/lcUniConv/ksc5601.h
+++ b/src/xlibi18n/lcUniConv/ksc5601.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/X11/lcUniConv/ksc5601.h,v 1.4 2001/08/09 19:14:09 dawes Exp $ */
+/* $XFree86: xc/lib/X11/lcUniConv/ksc5601.h,v 1.5 2003/05/27 22:26:34 tsi Exp $ */
/*
* KSC5601.1987-0
@@ -2966,7 +2966,7 @@ ksc5601_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n)
{
if (n >= 2) {
const Summary16 *summary = NULL;
- if (wc >= 0x0000 && wc < 0x0460)
+ if (wc < 0x0460)
summary = &ksc5601_uni2indx_page00[(wc>>4)];
else if (wc >= 0x2000 && wc < 0x2670)
summary = &ksc5601_uni2indx_page20[(wc>>4)-0x200];
diff --git a/src/xlibi18n/lcWrap.c b/src/xlibi18n/lcWrap.c
index 373c436..ef20342 100644
--- a/src/xlibi18n/lcWrap.c
+++ b/src/xlibi18n/lcWrap.c
@@ -53,7 +53,7 @@ from The Open Group.
*
* Katsuhisa Yano TOSHIBA Corp.
*/
-/* $XFree86: xc/lib/X11/lcWrap.c,v 3.14 2002/11/01 13:43:31 alanh Exp $ */
+/* $XFree86: xc/lib/X11/lcWrap.c,v 3.16 2003/04/17 02:06:32 dawes Exp $ */
#include <stdlib.h>
#include "Xlibint.h"
@@ -64,6 +64,7 @@ from The Open Group.
#undef close
#endif
#include <X11/Xutil.h>
+#include "XlcPubI.h"
#ifdef XTHREADS
LockInfoPtr _Xi18n_lock;
@@ -242,7 +243,7 @@ _XlcAddLoader(
XLCd
_XOpenLC(
- const char *name)
+ char *name)
{
XLCd lcd;
XlcLoaderList loader;
@@ -251,7 +252,6 @@ _XOpenLC(
int len;
char sinamebuf[256];
char* siname = sinamebuf;
- char *_XlcMapOSLocaleName();
#endif
if (name == NULL) {
diff --git a/src/xlibi18n/mbWMProps.c b/src/xlibi18n/mbWMProps.c
index 642f393..637ffee 100644
--- a/src/xlibi18n/mbWMProps.c
+++ b/src/xlibi18n/mbWMProps.c
@@ -26,15 +26,15 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/lib/X11/mbWMProps.c,v 1.5 2001/12/14 19:54:10 dawes Exp $ */
+/* $XFree86: xc/lib/X11/mbWMProps.c,v 1.6 2003/11/17 22:20:12 dawes Exp $ */
#include <X11/Xlibint.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <X11/Xlocale.h>
-#if NeedFunctionPrototypes
-void XmbSetWMProperties (
+void
+XmbSetWMProperties (
Display *dpy,
Window w,
_Xconst char *windowName,
@@ -44,19 +44,6 @@ void XmbSetWMProperties (
XSizeHints *sizeHints,
XWMHints *wmHints,
XClassHint *classHints)
-#else
-void XmbSetWMProperties (dpy, w, windowName, iconName, argv, argc, sizeHints,
- wmHints, classHints)
- Display *dpy;
- Window w; /* window to decorate */
- _Xconst char *windowName; /* name of application */
- _Xconst char *iconName; /* name string for icon */
- char **argv; /* command line */
- int argc; /* size of command line */
- XSizeHints *sizeHints; /* size hints for window in its normal state */
- XWMHints *wmHints; /* miscelaneous window manager hints */
- XClassHint *classHints; /* resource name and class */
-#endif
{
XTextProperty wname, iname;
XTextProperty *wprop = NULL;
diff --git a/src/xlibi18n/mbWrap.c b/src/xlibi18n/mbWrap.c
index 97181fd..07099f7 100644
--- a/src/xlibi18n/mbWrap.c
+++ b/src/xlibi18n/mbWrap.c
@@ -50,12 +50,11 @@ from The Open Group.
*
* M. Collins OSF
*/
-/* $XFree86: xc/lib/X11/mbWrap.c,v 1.6 2001/12/14 19:54:10 dawes Exp $ */
+/* $XFree86: xc/lib/X11/mbWrap.c,v 1.7 2003/11/17 22:20:12 dawes Exp $ */
#include "Xlibint.h"
#include "Xlcint.h"
-#if NeedFunctionPrototypes
void
XmbDrawText(
Display *dpy,
@@ -65,16 +64,6 @@ XmbDrawText(
int y,
XmbTextItem *text_items,
int nitems)
-#else
-void
-XmbDrawText(dpy, d, gc, x, y, text_items, nitems)
- Display *dpy;
- Drawable d;
- GC gc;
- int x, y;
- XmbTextItem *text_items;
- int nitems;
-#endif
{
register XFontSet fs = NULL;
register XmbTextItem *p = text_items;
@@ -99,7 +88,6 @@ XmbDrawText(dpy, d, gc, x, y, text_items, nitems)
}
}
-#if NeedFunctionPrototypes
void
XmbDrawString(
Display *dpy,
@@ -110,24 +98,12 @@ XmbDrawString(
int y,
_Xconst char *text,
int text_len)
-#else
-void
-XmbDrawString(dpy, d, font_set, gc, x, y, text, text_len)
- Display *dpy;
- Drawable d;
- XFontSet font_set;
- GC gc;
- int x, y;
- _Xconst char *text;
- int text_len;
-#endif
{
(void)(*font_set->methods->mb_draw_string) (dpy, d, font_set, gc, x, y,
(char *)text, text_len);
}
-#if NeedFunctionPrototypes
void
XmbDrawImageString(
Display *dpy,
@@ -138,41 +114,21 @@ XmbDrawImageString(
int y,
_Xconst char *text,
int text_len)
-#else
-void
-XmbDrawImageString(dpy, d, font_set, gc, x, y, text, text_len)
- Display *dpy;
- Drawable d;
- XFontSet font_set;
- GC gc;
- int x, y;
- _Xconst char *text;
- int text_len;
-#endif
{
(*font_set->methods->mb_draw_image_string) (dpy, d, font_set, gc, x, y,
(char *)text, text_len);
}
-#if NeedFunctionPrototypes
int
XmbTextEscapement(
XFontSet font_set,
_Xconst char *text,
int text_len)
-#else
-int
-XmbTextEscapement(font_set, text, text_len)
- XFontSet font_set;
- _Xconst char *text;
- int text_len;
-#endif
{
return (*font_set->methods->mb_escapement) (font_set,
(char *)text, text_len);
}
-#if NeedFunctionPrototypes
int
XmbTextExtents(
XFontSet font_set,
@@ -180,16 +136,6 @@ XmbTextExtents(
int text_len,
XRectangle *overall_ink_extents,
XRectangle *overall_logical_extents)
-#else
-int
-XmbTextExtents(font_set, text, text_len,
- overall_ink_extents, overall_logical_extents)
- XFontSet font_set;
- _Xconst char *text;
- int text_len;
- XRectangle *overall_ink_extents;
- XRectangle *overall_logical_extents;
-#endif
{
return (*font_set->methods->mb_extents) (font_set,
(char *)text, text_len,
@@ -197,7 +143,6 @@ XmbTextExtents(font_set, text, text_len,
overall_logical_extents);
}
-#if NeedFunctionPrototypes
Status
XmbTextPerCharExtents(
XFontSet font_set,
@@ -209,22 +154,6 @@ XmbTextPerCharExtents(
int *num_chars,
XRectangle *max_ink_extents,
XRectangle *max_logical_extents)
-#else
-Status
-XmbTextPerCharExtents(font_set, text, text_len,
- ink_extents_buffer, logical_extents_buffer,
- buffer_size, num_chars,
- max_ink_extents, max_logical_extents)
- XFontSet font_set;
- _Xconst char *text;
- int text_len;
- XRectangle *ink_extents_buffer;
- XRectangle *logical_extents_buffer;
- int buffer_size;
- int *num_chars;
- XRectangle *max_ink_extents;
- XRectangle *max_logical_extents;
-#endif
{
return (*font_set->methods->mb_extents_per_char)
(font_set, (char *)text, text_len,
diff --git a/src/xlibi18n/utf8WMProps.c b/src/xlibi18n/utf8WMProps.c
index bed3858..11a224d 100644
--- a/src/xlibi18n/utf8WMProps.c
+++ b/src/xlibi18n/utf8WMProps.c
@@ -48,15 +48,15 @@ from The Open Group.
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
* OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $XFree86: xc/lib/X11/utf8WMProps.c,v 1.2 2001/12/14 19:54:11 dawes Exp $ */
+/* $XFree86: xc/lib/X11/utf8WMProps.c,v 1.3 2003/11/17 22:20:12 dawes Exp $ */
#include <X11/Xlibint.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <X11/Xlocale.h>
-#if NeedFunctionPrototypes
-void Xutf8SetWMProperties (
+void
+Xutf8SetWMProperties (
Display *dpy,
Window w,
_Xconst char *windowName,
@@ -66,19 +66,6 @@ void Xutf8SetWMProperties (
XSizeHints *sizeHints,
XWMHints *wmHints,
XClassHint *classHints)
-#else
-void Xutf8SetWMProperties (dpy, w, windowName, iconName, argv, argc, sizeHints,
- wmHints, classHints)
- Display *dpy;
- Window w; /* window to decorate */
- _Xconst char *windowName; /* name of application */
- _Xconst char *iconName; /* name string for icon */
- char **argv; /* command line */
- int argc; /* size of command line */
- XSizeHints *sizeHints; /* size hints for window in its normal state */
- XWMHints *wmHints; /* miscelaneous window manager hints */
- XClassHint *classHints; /* resource name and class */
-#endif
{
XTextProperty wname, iname;
XTextProperty *wprop = NULL;
diff --git a/src/xlibi18n/utf8Wrap.c b/src/xlibi18n/utf8Wrap.c
index bde4647..70cc8a6 100644
--- a/src/xlibi18n/utf8Wrap.c
+++ b/src/xlibi18n/utf8Wrap.c
@@ -72,12 +72,11 @@ from The Open Group.
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
* OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $XFree86: xc/lib/X11/utf8Wrap.c,v 1.3 2001/12/14 19:54:11 dawes Exp $ */
+/* $XFree86: xc/lib/X11/utf8Wrap.c,v 1.4 2003/11/17 22:20:12 dawes Exp $ */
#include "Xlibint.h"
#include "Xlcint.h"
-#if NeedFunctionPrototypes
void
Xutf8DrawText(
Display *dpy,
@@ -87,16 +86,6 @@ Xutf8DrawText(
int y,
XmbTextItem *text_items,
int nitems)
-#else
-void
-Xutf8DrawText(dpy, d, gc, x, y, text_items, nitems)
- Display *dpy;
- Drawable d;
- GC gc;
- int x, y;
- XmbTextItem *text_items;
- int nitems;
-#endif
{
register XFontSet fs = NULL;
register XmbTextItem *p = text_items;
@@ -121,7 +110,6 @@ Xutf8DrawText(dpy, d, gc, x, y, text_items, nitems)
}
}
-#if NeedFunctionPrototypes
void
Xutf8DrawString(
Display *dpy,
@@ -132,24 +120,12 @@ Xutf8DrawString(
int y,
_Xconst char *text,
int text_len)
-#else
-void
-Xutf8DrawString(dpy, d, font_set, gc, x, y, text, text_len)
- Display *dpy;
- Drawable d;
- XFontSet font_set;
- GC gc;
- int x, y;
- _Xconst char *text;
- int text_len;
-#endif
{
(void)(*font_set->methods->utf8_draw_string) (dpy, d, font_set, gc, x, y,
(char *)text, text_len);
}
-#if NeedFunctionPrototypes
void
Xutf8DrawImageString(
Display *dpy,
@@ -160,41 +136,21 @@ Xutf8DrawImageString(
int y,
_Xconst char *text,
int text_len)
-#else
-void
-Xutf8DrawImageString(dpy, d, font_set, gc, x, y, text, text_len)
- Display *dpy;
- Drawable d;
- XFontSet font_set;
- GC gc;
- int x, y;
- _Xconst char *text;
- int text_len;
-#endif
{
(*font_set->methods->utf8_draw_image_string) (dpy, d, font_set, gc, x, y,
(char *)text, text_len);
}
-#if NeedFunctionPrototypes
int
Xutf8TextEscapement(
XFontSet font_set,
_Xconst char *text,
int text_len)
-#else
-int
-Xutf8TextEscapement(font_set, text, text_len)
- XFontSet font_set;
- _Xconst char *text;
- int text_len;
-#endif
{
return (*font_set->methods->utf8_escapement) (font_set,
(char *)text, text_len);
}
-#if NeedFunctionPrototypes
int
Xutf8TextExtents(
XFontSet font_set,
@@ -202,16 +158,6 @@ Xutf8TextExtents(
int text_len,
XRectangle *overall_ink_extents,
XRectangle *overall_logical_extents)
-#else
-int
-Xutf8TextExtents(font_set, text, text_len,
- overall_ink_extents, overall_logical_extents)
- XFontSet font_set;
- _Xconst char *text;
- int text_len;
- XRectangle *overall_ink_extents;
- XRectangle *overall_logical_extents;
-#endif
{
return (*font_set->methods->utf8_extents) (font_set,
(char *)text, text_len,
@@ -219,7 +165,6 @@ Xutf8TextExtents(font_set, text, text_len,
overall_logical_extents);
}
-#if NeedFunctionPrototypes
Status
Xutf8TextPerCharExtents(
XFontSet font_set,
@@ -231,22 +176,6 @@ Xutf8TextPerCharExtents(
int *num_chars,
XRectangle *max_ink_extents,
XRectangle *max_logical_extents)
-#else
-Status
-Xutf8TextPerCharExtents(font_set, text, text_len,
- ink_extents_buffer, logical_extents_buffer,
- buffer_size, num_chars,
- max_ink_extents, max_logical_extents)
- XFontSet font_set;
- _Xconst char *text;
- int text_len;
- XRectangle *ink_extents_buffer;
- XRectangle *logical_extents_buffer;
- int buffer_size;
- int *num_chars;
- XRectangle *max_ink_extents;
- XRectangle *max_logical_extents;
-#endif
{
return (*font_set->methods->utf8_extents_per_char)
(font_set, (char *)text, text_len,
diff --git a/src/xlibi18n/wcWrap.c b/src/xlibi18n/wcWrap.c
index 0f1a5ee..6d8f1aa 100644
--- a/src/xlibi18n/wcWrap.c
+++ b/src/xlibi18n/wcWrap.c
@@ -51,12 +51,11 @@ from The Open Group.
*
* M. Collins OSF
*/
-/* $XFree86: xc/lib/X11/wcWrap.c,v 1.6 2001/12/14 19:54:11 dawes Exp $ */
+/* $XFree86: xc/lib/X11/wcWrap.c,v 1.7 2003/11/17 22:20:12 dawes Exp $ */
#include "Xlibint.h"
#include "Xlcint.h"
-#if NeedFunctionPrototypes
void
XwcDrawText(
Display *dpy,
@@ -66,16 +65,6 @@ XwcDrawText(
int y,
XwcTextItem *text_items,
int nitems)
-#else
-void
-XwcDrawText(dpy, d, gc, x, y, text_items, nitems)
- Display *dpy;
- Drawable d;
- GC gc;
- int x, y;
- XwcTextItem *text_items;
- int nitems;
-#endif
{
register XFontSet fs = NULL;
register XwcTextItem *p = text_items;
@@ -100,7 +89,6 @@ XwcDrawText(dpy, d, gc, x, y, text_items, nitems)
}
}
-#if NeedFunctionPrototypes
void
XwcDrawString(
Display *dpy,
@@ -111,23 +99,11 @@ XwcDrawString(
int y,
_Xconst wchar_t *text,
int text_len)
-#else
-void
-XwcDrawString(dpy, d, font_set, gc, x, y, text, text_len)
- Display *dpy;
- Drawable d;
- XFontSet font_set;
- GC gc;
- int x, y;
- _Xconst wchar_t *text;
- int text_len;
-#endif
{
(void)(*font_set->methods->wc_draw_string) (dpy, d, font_set, gc, x, y,
text, text_len);
}
-#if NeedFunctionPrototypes
void
XwcDrawImageString(
Display *dpy,
@@ -138,40 +114,20 @@ XwcDrawImageString(
int y,
_Xconst wchar_t *text,
int text_len)
-#else
-void
-XwcDrawImageString(dpy, d, font_set, gc, x, y, text, text_len)
- Display *dpy;
- Drawable d;
- XFontSet font_set;
- GC gc;
- int x, y;
- _Xconst wchar_t *text;
- int text_len;
-#endif
{
(*font_set->methods->wc_draw_image_string) (dpy, d, font_set, gc, x, y,
text, text_len);
}
-#if NeedFunctionPrototypes
int
XwcTextEscapement(
XFontSet font_set,
_Xconst wchar_t *text,
int text_len)
-#else
-int
-XwcTextEscapement(font_set, text, text_len)
- XFontSet font_set;
- _Xconst wchar_t *text;
- int text_len;
-#endif
{
return (*font_set->methods->wc_escapement) (font_set, text, text_len);
}
-#if NeedFunctionPrototypes
int
XwcTextExtents(
XFontSet font_set,
@@ -179,23 +135,12 @@ XwcTextExtents(
int text_len,
XRectangle *overall_ink_extents,
XRectangle *overall_logical_extents)
-#else
-int
-XwcTextExtents(font_set, text, text_len,
- overall_ink_extents, overall_logical_extents)
- XFontSet font_set;
- _Xconst wchar_t *text;
- int text_len;
- XRectangle *overall_ink_extents;
- XRectangle *overall_logical_extents;
-#endif
{
return (*font_set->methods->wc_extents) (font_set, text, text_len,
overall_ink_extents,
overall_logical_extents);
}
-#if NeedFunctionPrototypes
Status
XwcTextPerCharExtents(
XFontSet font_set,
@@ -207,22 +152,6 @@ XwcTextPerCharExtents(
int *num_chars,
XRectangle *max_ink_extents,
XRectangle *max_logical_extents)
-#else
-Status
-XwcTextPerCharExtents(font_set, text, text_len,
- ink_extents_buffer, logical_extents_buffer,
- buffer_size, num_chars,
- max_ink_extents, max_logical_extents)
- XFontSet font_set;
- _Xconst wchar_t *text;
- int text_len;
- XRectangle *ink_extents_buffer;
- XRectangle *logical_extents_buffer;
- int buffer_size;
- int *num_chars;
- XRectangle *max_ink_extents;
- XRectangle *max_logical_extents;
-#endif
{
return (*font_set->methods->wc_extents_per_char)
(font_set, text, text_len,