[PATCH 3/4] xkb: hide private symbols

Julien Cristau jcristau at debian.org
Fri Jul 31 04:49:41 PDT 2009


- Add some _X_HIDDENs
- Remove unused _XkbInternAtomFunc, _XkbGetAtomNameFunc,
  _XkbPeekAtReadBuffer
- Make _XkbReadCopyKeySyms static
---
 src/xkb/XKB.c       |    6 ------
 src/xkb/XKBBind.c   |    2 +-
 src/xkb/XKBCompat.c |    2 +-
 src/xkb/XKBCvt.c    |    6 +++---
 src/xkb/XKBGeom.c   |    2 +-
 src/xkb/XKBGetMap.c |    2 +-
 src/xkb/XKBNames.c  |    2 +-
 src/xkb/XKBRdBuf.c  |   27 +++++++++------------------
 src/xkb/XKBUse.c    |    2 +-
 src/xkb/XKBleds.c   |    2 +-
 src/xkb/XKBlibint.h |   15 ---------------
 11 files changed, 19 insertions(+), 49 deletions(-)

diff --git a/src/xkb/XKB.c b/src/xkb/XKB.c
index 202a9bd..1ca0f6f 100644
--- a/src/xkb/XKB.c
+++ b/src/xkb/XKB.c
@@ -36,9 +36,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #include <X11/extensions/XKBproto.h>
 #include "XKBlibint.h"
 
-XkbInternAtomFunc	_XkbInternAtomFunc= XInternAtom;
-XkbGetAtomNameFunc	_XkbGetAtomNameFunc= XGetAtomName;
-
 Bool
 XkbQueryExtension(	Display *dpy,
 			int *	opcodeReturn,
@@ -765,7 +762,4 @@ XkbOpenDisplay(	char *	name,
 void
 XkbSetAtomFuncs(XkbInternAtomFunc getAtom,XkbGetAtomNameFunc getName)
 {
-    _XkbInternAtomFunc= (getAtom?getAtom:XInternAtom);
-    _XkbGetAtomNameFunc= (getName?getName:XGetAtomName);
-    return;
 }
diff --git a/src/xkb/XKBBind.c b/src/xkb/XKBBind.c
index 556917b..d4096a0 100644
--- a/src/xkb/XKBBind.c
+++ b/src/xkb/XKBBind.c
@@ -529,7 +529,7 @@ _XkbLoadDpy(Display *dpy)
     return 1;
 }
 
-void
+_X_HIDDEN void
 _XkbReloadDpy(Display *dpy)
 {
     XkbInfoPtr xkbi;
diff --git a/src/xkb/XKBCompat.c b/src/xkb/XKBCompat.c
index d52fd13..9e0e536 100644
--- a/src/xkb/XKBCompat.c
+++ b/src/xkb/XKBCompat.c
@@ -37,7 +37,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #include <X11/extensions/XKBproto.h>
 #include "XKBlibint.h"
 
-Status
+_X_HIDDEN Status
 _XkbReadGetCompatMapReply(	Display *		dpy,
 				xkbGetCompatMapReply *	rep,
 				XkbDescPtr		xkb,
diff --git a/src/xkb/XKBCvt.c b/src/xkb/XKBCvt.c
index 2f7f1a1..bafe193 100644
--- a/src/xkb/XKBCvt.c
+++ b/src/xkb/XKBCvt.c
@@ -188,7 +188,7 @@ Strcmp(char *str1, char *str2)
 }
 #endif
 
-int
+_X_HIDDEN int
 _XkbGetConverters(const char *encoding_name, XkbConverters *cvt_rtrn)
 {
     if ( !cvt_rtrn ) return 0;
@@ -219,7 +219,7 @@ _XkbGetConverters(const char *encoding_name, XkbConverters *cvt_rtrn)
 #define	CHARSET_FILE	"/usr/lib/X11/input/charsets"
 static char *_XkbKnownLanguages = "c=ascii:da,de,en,es,fr,is,it,nl,no,pt,sv=iso8859-1:hu,pl,cs=iso8859-2:eo=iso8859-3:sp=iso8859-5:ar,ara=iso8859-6:el=iso8859-7:he=iso8859-8:tr=iso8859-9:lt,lv=iso8859-13:et,fi=iso8859-15:ru=koi8-r:uk=koi8-u:th,th_TH,th_TH.iso8859-11=iso8859-11:th_TH.TIS620=tis620:hy=armscii-8:vi=tcvn-5712:ka=georgian-academy:be,bg=microsoft-cp1251";
 
-char	*
+_X_HIDDEN char	*
 _XkbGetCharset(void)
 {
     /*
@@ -320,7 +320,7 @@ _XkbGetCharset(void)
     return NULL;
 }
 #else
-char	*
+_X_HIDDEN char	*
 _XkbGetCharset(void)
 {
     char *tmp;
diff --git a/src/xkb/XKBGeom.c b/src/xkb/XKBGeom.c
index d0590da..b4c7b5b 100644
--- a/src/xkb/XKBGeom.c
+++ b/src/xkb/XKBGeom.c
@@ -579,7 +579,7 @@ Status	rtrn;
     return Success;
 }
 
-Status
+_X_HIDDEN Status
 _XkbReadGetGeometryReply(	Display * dpy,
 				xkbGetGeometryReply * rep,
 				XkbDescPtr xkb,
diff --git a/src/xkb/XKBGetMap.c b/src/xkb/XKBGetMap.c
index 54d9f33..35068bc 100644
--- a/src/xkb/XKBGetMap.c
+++ b/src/xkb/XKBGetMap.c
@@ -455,7 +455,7 @@ xkbGetMapReq *req;
     return req;
 }
 
-Status
+_X_HIDDEN Status
 _XkbReadGetMapReply(	Display *	dpy,
 			xkbGetMapReply *rep,
 			XkbDescPtr	xkb,
diff --git a/src/xkb/XKBNames.c b/src/xkb/XKBNames.c
index aad72c1..e8de6d0 100644
--- a/src/xkb/XKBNames.c
+++ b/src/xkb/XKBNames.c
@@ -55,7 +55,7 @@ register int i,bit;
     return Success;
 }
 
-Status
+_X_HIDDEN Status
 _XkbReadGetNamesReply(	Display *		dpy,
 			xkbGetNamesReply *	rep,
 			XkbDescPtr 		xkb,
diff --git a/src/xkb/XKBRdBuf.c b/src/xkb/XKBRdBuf.c
index 7fe8452..3ddf205 100644
--- a/src/xkb/XKBRdBuf.c
+++ b/src/xkb/XKBRdBuf.c
@@ -38,7 +38,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
 /***====================================================================***/
 
-int
+_X_HIDDEN int
 _XkbInitReadBuffer(Display *dpy,XkbReadBufferPtr buf,int size)
 {
     if ((dpy!=NULL) && (buf!=NULL) && (size>0)) {
@@ -55,7 +55,7 @@ _XkbInitReadBuffer(Display *dpy,XkbReadBufferPtr buf,int size)
 
 #define	_XkbReadBufferDataLeft(b)	(((b)->size)-((b)->data-(b)->start))
 
-int
+_X_HIDDEN int
 _XkbSkipReadBufferData(XkbReadBufferPtr	from,int size)
 {
     if (size==0)
@@ -67,7 +67,7 @@ _XkbSkipReadBufferData(XkbReadBufferPtr	from,int size)
     return 1;
 }
 
-int
+_X_HIDDEN int
 _XkbCopyFromReadBuffer(XkbReadBufferPtr	from,char *to,int size)
 {
     if (size==0)
@@ -81,7 +81,7 @@ _XkbCopyFromReadBuffer(XkbReadBufferPtr	from,char *to,int size)
 }
 
 #ifdef XKB_FORCE_INT_KEYSYM
-int
+static int
 _XkbReadCopyKeySyms(int *wire,KeySym *to,int num_words)
 {
     while (num_words-->0) {
@@ -90,7 +90,7 @@ _XkbReadCopyKeySyms(int *wire,KeySym *to,int num_words)
     return 1;
 }
 
-int
+_X_HIDDEN int
 _XkbReadBufferCopyKeySyms(XkbReadBufferPtr from,KeySym *to,int num_words)
 {
     if ((unsigned)(num_words*4)>_XkbReadBufferDataLeft(from))
@@ -100,7 +100,7 @@ _XkbReadBufferCopyKeySyms(XkbReadBufferPtr from,KeySym *to,int num_words)
     return True;
 }
 
-int
+_X_HIDDEN int
 _XkbWriteCopyKeySyms (register KeySym *from,CARD32 *to,int len)
 {
 
@@ -171,16 +171,7 @@ _XkbWriteCopyData32 (register unsigned long *from,CARD32 *to,int len)
 _XkbWriteCopyData32 Not Implemented Yet for sizeof(int)==8
 #endif
 
-char *
-_XkbPeekAtReadBuffer(XkbReadBufferPtr from,int size)
-{
-    if ((from==NULL)||(from->error)||(size<1)||
-					(_XkbReadBufferDataLeft(from)<size))
-	return NULL;
-    return from->data;
-}
-
-char *
+_X_HIDDEN char *
 _XkbGetReadBufferPtr(XkbReadBufferPtr from,int size)
 {
 char	*ptr;
@@ -193,7 +184,7 @@ char	*ptr;
 }
 
 
-int
+_X_HIDDEN int
 _XkbFreeReadBuffer(XkbReadBufferPtr buf)
 {
     if ((buf!=NULL) && (buf->start!=NULL)) {
@@ -208,7 +199,7 @@ _XkbFreeReadBuffer(XkbReadBufferPtr buf)
     return 0;
 }
 
-Bool
+_X_HIDDEN Bool
 _XkbGetReadBufferCountedString(XkbReadBufferPtr buf,char **rtrn)
 {
 CARD16	len,*pLen;
diff --git a/src/xkb/XKBUse.c b/src/xkb/XKBUse.c
index 5bc3c4b..185bcf1 100644
--- a/src/xkb/XKBUse.c
+++ b/src/xkb/XKBUse.c
@@ -178,7 +178,7 @@ XkbNoteMapChanges(XkbMapChangesPtr old,XkbMapNotifyEvent *new,unsigned wanted)
     return;
 }
 
-void
+_X_HIDDEN void
 _XkbNoteCoreMapChanges(	XkbMapChangesPtr	 old,
 			XMappingEvent * 	new,
 			unsigned int 		wanted)
diff --git a/src/xkb/XKBleds.c b/src/xkb/XKBleds.c
index e0cc14b..74af984 100644
--- a/src/xkb/XKBleds.c
+++ b/src/xkb/XKBleds.c
@@ -61,7 +61,7 @@ XkbGetIndicatorState(Display *dpy,unsigned deviceSpec,unsigned *pStateRtrn)
     return (ok?Success:BadImplementation);
 }
 
-Status
+_X_HIDDEN Status
 _XkbReadGetIndicatorMapReply(	Display *			dpy,
 				xkbGetIndicatorMapReply *	rep,
 				XkbDescPtr			xkb,
diff --git a/src/xkb/XKBlibint.h b/src/xkb/XKBlibint.h
index 158288e..0818b6a 100644
--- a/src/xkb/XKBlibint.h
+++ b/src/xkb/XKBlibint.h
@@ -62,9 +62,6 @@ typedef struct _XkbConverters {
 	XkbToUpperFunc	 KSToUpper;
 } XkbConverters;
 
-extern	XkbInternAtomFunc	_XkbInternAtomFunc;
-extern	XkbGetAtomNameFunc	_XkbGetAtomNameFunc;
-
 typedef struct _XkbInfoRec {
 	unsigned	 flags;
 	unsigned	 xlib_ctrls;
@@ -244,12 +241,6 @@ extern int _XkbReadBufferCopy32(
 #endif
 
 #ifdef XKB_FORCE_INT_KEYSYM
-extern int _XkbReadCopyKeySyms(
-    int *		/* from */,
-    KeySym *		/* to */,
-    int			/* num_words */
-);
-
 extern	int _XkbWriteCopyKeySyms(
     KeySym *		/* from */,
     CARD32 *		/* to */,
@@ -266,16 +257,10 @@ extern int _XkbReadBufferCopyKeySyms(
     int			/* size */
 );
 #else
-#define	_XkbReadCopyKeySyms(f,t,n)		_XkbReadCopyData32(f,t,n)
 #define	_XkbWriteCopyKeySyms(f,t,n)		_XkbWriteCopyData32(f,t,n)
 #define	_XkbReadBufferCopyKeySyms(f,t,s)	_XkbReadBufferCopy32(f,t,s)
 #endif
 
-extern char *_XkbPeekAtReadBuffer(
-    XkbReadBufferPtr	/* from */,
-    int			/*  size */
-);
-
 extern char *_XkbGetReadBufferPtr(
     XkbReadBufferPtr	/* from */,
     int			/* size */
-- 
1.6.3.3



More information about the xorg-devel mailing list