summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaleb Keithley <kaleb@freedesktop.org>2003-11-14 16:49:23 +0000
committerKaleb Keithley <kaleb@freedesktop.org>2003-11-14 16:49:23 +0000
commit3a593fed409e418cc6c599838f8af626d31a4487 (patch)
treeece6de8170a58841d6f3c718257913ff6611ad77
parent9f1e6d353042f462da0a3a2264a115eca2c859a5 (diff)
-rw-r--r--cfgparse.y12
-rw-r--r--cfgscan.c40
-rw-r--r--evargs.c32
-rw-r--r--printev.c146
-rw-r--r--utils.c108
-rw-r--r--utils.h36
-rw-r--r--xkbevd.c47
-rw-r--r--xkbevd.h11
-rw-r--r--xkbevd.man9
9 files changed, 205 insertions, 236 deletions
diff --git a/cfgparse.y b/cfgparse.y
index 16a02ca..ca995f0 100644
--- a/cfgparse.y
+++ b/cfgparse.y
@@ -24,6 +24,8 @@
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
+/* $XFree86: xc/programs/xkbevd/cfgparse.y,v 1.5 2002/10/16 04:53:17 tsi Exp $ */
+
%token
END_OF_FILE 0
ERROR 255
@@ -171,6 +173,7 @@ ActionType : NONE { $$ = NoAction; }
| SHELL { $$ = ShellAction; }
| SOUND { $$ = SoundAction; }
| { $$ = UnknownAction; }
+ ;
OptNameSpec : NameSpec { $$= $1; }
| { $$= NULL; }
@@ -191,8 +194,7 @@ String : STRING { $$= scanStr; scanStr= NULL; }
;
%%
int
-yyerror(s)
-char *s;
+yyerror(char *s)
{
(void)fprintf(stderr,"%s: line %d of %s\n",s,lineNum,
(scanFile?scanFile:"(unknown)"));
@@ -203,17 +205,15 @@ char *s;
int
-yywrap()
+yywrap(void)
{
return 1;
}
int
-CFGParseFile(file)
-FILE *file;
+CFGParseFile(FILE *file)
{
if (file) {
- extern FILE *yyin;
yyin= file;
if (yyparse()==0) {
return 1;
diff --git a/cfgscan.c b/cfgscan.c
index c99c53d..d826548 100644
--- a/cfgscan.c
+++ b/cfgscan.c
@@ -24,16 +24,19 @@
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
+/* $XFree86: xc/programs/xkbevd/cfgscan.c,v 3.7 2001/08/01 00:45:05 tsi Exp $ */
#include <stdio.h>
+#include <stdlib.h>
#include <ctype.h>
#include <X11/Xos.h>
#include <X11/X.h>
#include <X11/extensions/XKB.h>
#include "tokens.h"
+#include "xkbevd.h"
-FILE *yyin = stdin;
+FILE *yyin = NULL;
static char scanFileBuf[1024];
char * scanFile= scanFileBuf;
@@ -55,8 +58,7 @@ static char buf[BUFSIZE];
extern unsigned debugFlags;
static char *
-tokText(tok)
- int tok;
+tokText(int tok)
{
static char buf[32];
@@ -106,9 +108,7 @@ static char buf[32];
#endif
int
-setScanState(file,line)
- char * file;
- int line;
+setScanState(char *file, int line)
{
if (file!=NULL)
strncpy(scanFile,file,1024);
@@ -117,8 +117,8 @@ setScanState(file,line)
return 1;
}
-int
-yyGetString()
+static int
+yyGetString(void)
{
int ch;
@@ -172,15 +172,15 @@ int ch;
buf[nInBuf++] = '\0';
if ( scanStr )
free( scanStr );
- scanStr = (char *)uStringDup(buf);
+ scanStr = uStringDup(buf);
scanStrLine = lineNum;
return STRING;
}
return ERROR;
}
-int
-yyGetKeyName()
+static int
+yyGetKeyName(void)
{
int ch;
@@ -234,7 +234,7 @@ int ch;
buf[nInBuf++] = '\0';
if ( scanStr )
free( scanStr );
- scanStr = (char *)uStringDup(buf);
+ scanStr = uStringDup(buf);
scanStrLine = lineNum;
return KEYNAME;
}
@@ -257,12 +257,11 @@ struct _Keyword {
};
int numKeywords = sizeof(keywords)/sizeof(struct _Keyword);
-int
-yyGetIdent(first)
- int first;
+static int
+yyGetIdent(int first)
{
int ch,i,found;
-int rtrn;
+int rtrn = -1;
buf[0] = first; nInBuf = 1;
while ( ((ch=getc(yyin))!=EOF) && (isalnum(ch)||(ch=='_')) ) {
@@ -281,7 +280,7 @@ int rtrn;
if (!found) {
if ( scanStr )
free( scanStr );
- scanStr = (char *)uStringDup(buf);
+ scanStr = uStringDup(buf);
scanStrLine = lineNum;
rtrn = IDENT;
}
@@ -294,9 +293,8 @@ int rtrn;
return rtrn;
}
-int
-yyGetNumber(ch)
- int ch;
+static int
+yyGetNumber(int ch)
{
int isFloat= 0;
@@ -330,7 +328,7 @@ int isFloat= 0;
}
int
-yylex()
+yylex(void)
{
int ch;
int rtrn;
diff --git a/evargs.c b/evargs.c
index 94876db..0cdb9f9 100644
--- a/evargs.c
+++ b/evargs.c
@@ -24,6 +24,7 @@
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
+/* $XFree86: xc/programs/xkbevd/evargs.c,v 1.4 2001/01/17 23:46:08 dawes Exp $ */
#define DEBUG_VAR evargsDebug
#include "xkbevd.h"
@@ -31,10 +32,7 @@
/***====================================================================***/
static char *
-AppendBellNotifyArg(sink,arg,ev)
- char * sink;
- char * arg;
- XkbEvent * ev;
+AppendBellNotifyArg(char *sink, char *arg, XkbEvent *ev)
{
if (uStringEqual(arg,"device")||uStringEqual(arg,"D"))
sprintf(sink,"%d",ev->bell.device);
@@ -49,17 +47,14 @@ AppendBellNotifyArg(sink,arg,ev)
else if (uStringEqual(arg,"id")||uStringEqual(arg,"i"))
sprintf(sink,"%d",ev->bell.bell_id);
else if (uStringEqual(arg,"window")||uStringEqual(arg,"w"))
- sprintf(sink,"0x%x",ev->bell.window);
+ sprintf(sink,"0x%x",(unsigned int)ev->bell.window);
else if (uStringEqual(arg,"name")||uStringEqual(arg,"n"))
sprintf(sink,"%s",XkbAtomText(dpy,ev->bell.name,XkbMessage));
return sink;
}
static char *
-AppendAccessXNotifyArg(sink,arg,ev)
- char * sink;
- char * arg;
- XkbEvent * ev;
+AppendAccessXNotifyArg(char *sink, char *arg, XkbEvent *ev)
{
if (uStringEqual(arg,"device")||uStringEqual(arg,"D"))
sprintf(sink,"%d",ev->accessx.device);
@@ -77,10 +72,7 @@ AppendAccessXNotifyArg(sink,arg,ev)
}
static char *
-AppendActionMessageArg(sink,arg,ev)
- char * sink;
- char * arg;
- XkbEvent * ev;
+AppendActionMessageArg(char *sink, char *arg, XkbEvent *ev)
{
if (uStringEqual(arg,"device")||uStringEqual(arg,"D"))
sprintf(sink,"%d",ev->message.device);
@@ -97,10 +89,7 @@ AppendActionMessageArg(sink,arg,ev)
}
static char *
-AppendEventArg(sink,arg,ev)
- char * sink;
- char * arg;
- XkbEvent * ev;
+AppendEventArg(char *sink, char *arg, XkbEvent *ev)
{
switch (ev->any.xkb_type) {
case XkbBellNotify:
@@ -120,10 +109,7 @@ AppendEventArg(sink,arg,ev)
}
static void
-CopyEventArg(sink_inout,source_inout,ev)
- char ** sink_inout;
- char ** source_inout;
- XkbEvent * ev;
+CopyEventArg(char **sink_inout, char **source_inout, XkbEvent *ev)
{
char buf[1024];
char *source,*sink;
@@ -166,9 +152,7 @@ char *arg;
}
char *
-SubstituteEventArgs(cmd,ev)
- char * cmd;
- XkbEvent * ev;
+SubstituteEventArgs(char *cmd, XkbEvent *ev)
{
static char buf[1024];
char *source,*sink;
diff --git a/printev.c b/printev.c
index c889af0..0b6b27a 100644
--- a/printev.c
+++ b/printev.c
@@ -24,6 +24,7 @@
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
+/* $XFree86: xc/programs/xkbevd/printev.c,v 3.4 2001/01/17 23:46:08 dawes Exp $ */
#define DEBUG_VAR printevDebug
#include "xkbevd.h"
@@ -35,8 +36,7 @@
#define ynText(v) ((v)?Yes:No)
static char *
-eventTypeToString(evType)
- int evType;
+eventTypeToString(int evType)
{
static char name[20];
switch (evType) {
@@ -48,10 +48,7 @@ static char name[20];
}
static void
-xkb_prologue (file, ev, name)
- FILE * file;
- XkbEvent * ev;
- char * name;
+xkb_prologue (FILE *file, XkbEvent *ev, char *name)
{
XkbAnyEvent *e = &ev->any;
@@ -61,9 +58,7 @@ xkb_prologue (file, ev, name)
}
static void
-do_XkbStateNotify(file,xkbev)
- FILE * file;
- XkbEvent * xkbev;
+do_XkbStateNotify(FILE *file, XkbEvent *xkbev)
{
XkbStateNotifyEvent *state= &xkbev->state;
@@ -98,21 +93,15 @@ do_XkbStateNotify(file,xkbev)
}
static void
-do_map_message(what,first,num,eol)
- char * what;
- int first;
- int num;
- int eol;
+do_map_message(char *what, int first, int num, int eol)
{
if (num>1)
printf("%ss %d..%d changed%s",what,first,first+num-1,(eol?"\n":""));
else printf("%s %d changed%s",what,first,(eol?"\n":""));
}
-void
-do_XkbMapNotify(file,xkbev)
- FILE * file;
- XkbEvent * xkbev;
+static void
+do_XkbMapNotify(FILE *file,XkbEvent *xkbev)
{
XkbMapNotifyEvent *map = &xkbev->map;
if (map->changed&XkbKeyTypesMask) {
@@ -144,10 +133,8 @@ do_XkbMapNotify(file,xkbev)
return;
}
-void
-do_XkbControlsNotify(file,xkbev)
- FILE * file;
- XkbEvent * xkbev;
+static void
+do_XkbControlsNotify(FILE *file, XkbEvent *xkbev)
{
XkbControlsNotifyEvent *ctrls = &xkbev->ctrls;
fprintf(file," changed= 0x%x, enabled= 0x%x, enabledChanges= 0x%x\n",
@@ -162,10 +149,8 @@ do_XkbControlsNotify(file,xkbev)
return;
}
-void
-do_XkbIndicatorNotify(file,xkbev)
- FILE * file;
- XkbEvent *xkbev;
+static void
+do_XkbIndicatorNotify(FILE *file, XkbEvent *xkbev)
{
XkbIndicatorNotifyEvent *leds = &xkbev->indicators;
if (leds->xkb_type==XkbIndicatorStateNotify)
@@ -176,10 +161,8 @@ do_XkbIndicatorNotify(file,xkbev)
return;
}
-void
-do_XkbBellNotify(file,xkbev)
- FILE * file;
- XkbEvent *xkbev;
+static void
+do_XkbBellNotify(FILE *file, XkbEvent *xkbev)
{
XkbBellNotifyEvent *bell = &xkbev->bell;
fprintf(file," bell class= %d, id= %d\n",bell->bell_class,bell->bell_id);
@@ -192,15 +175,13 @@ do_XkbBellNotify(file,xkbev)
XFree(name);
}
else fprintf(file,", no name\n");
- fprintf(file," window= 0x%x, %sevent_only\n",bell->window,
+ fprintf(file," window= 0x%x, %sevent_only\n",(unsigned int)bell->window,
(bell->event_only?"":"!"));
return;
}
-void
-do_XkbAccessXNotify(file,xkbev)
- FILE * file;
- XkbEvent *xkbev;
+static void
+do_XkbAccessXNotify(FILE *file, XkbEvent *xkbev)
{
XkbAccessXNotifyEvent *sk = &xkbev->accessx;
char *detail;
@@ -225,9 +206,8 @@ do_XkbAccessXNotify(file,xkbev)
return;
}
-do_XkbNamesNotify(file,xkbev)
- FILE * file;
- XkbEvent *xkbev;
+static void
+do_XkbNamesNotify(FILE *file, XkbEvent *xkbev)
{
XkbNamesNotifyEvent *names = &xkbev->names;
@@ -286,10 +266,8 @@ do_XkbNamesNotify(file,xkbev)
return;
}
-void
-do_XkbCompatMapNotify(file,xkbev)
- FILE * file;
- XkbEvent *xkbev;
+static void
+do_XkbCompatMapNotify(FILE *file, XkbEvent *xkbev)
{
XkbCompatMapNotifyEvent *map = &xkbev->compat;
@@ -306,10 +284,8 @@ do_XkbCompatMapNotify(file,xkbev)
return;
}
-void
-do_XkbActionMessage(file,xkbev)
- FILE * file;
- XkbEvent *xkbev;
+static void
+do_XkbActionMessage(FILE *file, XkbEvent *xkbev)
{
XkbActionMessageEvent *msg= &xkbev->message;
fprintf(file," message: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
@@ -322,10 +298,8 @@ do_XkbActionMessage(file,xkbev)
return;
}
-void
-do_XkbNewKeyboardNotify(file,xkbev)
- FILE * file;
- XkbEvent *xkbev;
+static void
+do_XkbNewKeyboardNotify(FILE *file, XkbEvent *xkbev)
{
XkbNewKeyboardNotifyEvent *nk= &xkbev->new_kbd;
fprintf(file," new device: %d min_keycode: %d, max_keycode %d\n",
@@ -336,10 +310,8 @@ do_XkbNewKeyboardNotify(file,xkbev)
return;
}
-void
-do_XkbExtensionDeviceNotify(file,xkbev)
- FILE * file;
- XkbEvent *xkbev;
+static void
+do_XkbExtensionDeviceNotify(FILE *file, XkbEvent *xkbev)
{
XkbExtensionDeviceNotifyEvent *edn= &xkbev->device;
fprintf(file," device= %d, class= %d, id= %d\n",edn->device,
@@ -354,10 +326,11 @@ do_XkbExtensionDeviceNotify(file,xkbev)
return;
}
+#ifdef notyet
static char keyState[XkbMaxLegalKeyCode];
-do_KeyEvent (eventp,compose,repeat)
- XkbEvent *eventp;
+static void
+do_KeyEvent(XkbEvent *eventp, int compose, int repeat)
{
XKeyEvent *e = &eventp->core.xkey;
KeySym ks;
@@ -376,11 +349,11 @@ do_KeyEvent (eventp,compose,repeat)
if (xkb && xkb->names && xkb->names->keys)
kname= XkbKeyNameText(xkb->names->keys[e->keycode].name,XkbMessage);
- else kname= "<????>";
+ else kname= "<???""?>"; /* XXX break trigraph */
printf (" state 0x%x, group= %d, key %s (keycode %u, keysym 0x%x, %s)\n",
e->state&0x1FFF, (e->state>>13)&0x7, kname,
- e->keycode, ks, ksname);
+ e->keycode, (unsigned int)ks, ksname);
printf (" same_screen %s, autorepeat %s,\n",ynText(e->same_screen),
(detectableRepeat ? ynText(repeat) : "UNKNOWN"));
if (nbytes < 0) nbytes = 0;
@@ -391,9 +364,8 @@ do_KeyEvent (eventp,compose,repeat)
return;
}
-
-do_KeyPress (eventp)
- XkbEvent *eventp;
+static void
+do_KeyPress(XkbEvent *eventp)
{
int repeat;
@@ -403,16 +375,16 @@ int repeat;
return;
}
-do_KeyRelease (eventp)
- XkbEvent *eventp;
+static void
+do_KeyRelease(XkbEvent *eventp)
{
keyState[eventp->core.xkey.keycode]= 0;
do_KeyEvent (eventp,0,False);
return;
}
-do_ButtonPress (eventp)
- XkbEvent *eventp;
+static void
+do_ButtonPress(XkbEvent *eventp)
{
XButtonEvent *e = &eventp->core.xbutton;
@@ -425,15 +397,15 @@ do_ButtonPress (eventp)
return;
}
-do_ButtonRelease (eventp)
- XkbEvent *eventp;
+static void
+do_ButtonRelease(XkbEvent *eventp)
{
do_ButtonPress (eventp); /* since it has the same info */
return;
}
-do_MotionNotify (eventp)
- XkbEvent *eventp;
+static void
+do_MotionNotify(XkbEvent *eventp)
{
XMotionEvent *e = &eventp->core.xmotion;
@@ -446,8 +418,8 @@ do_MotionNotify (eventp)
return;
}
-do_EnterNotify (eventp)
- XkbEvent *eventp;
+static void
+do_EnterNotify(XkbEvent *eventp)
{
XCrossingEvent *e = &eventp->core.xcrossing;
char *mode, *detail;
@@ -483,15 +455,15 @@ do_EnterNotify (eventp)
return;
}
-do_LeaveNotify (eventp)
- XkbEvent *eventp;
+static void
+do_LeaveNotify(XkbEvent *eventp)
{
do_EnterNotify (eventp); /* since it has same information */
return;
}
-do_KeymapNotify (eventp)
- XkbEvent *eventp;
+static void
+do_KeymapNotify(XkbEvent *eventp)
{
XKeymapEvent *e = &eventp->core.xkeymap;
int i;
@@ -505,8 +477,8 @@ do_KeymapNotify (eventp)
return;
}
-do_ClientMessage (eventp)
- XkbEvent *eventp;
+static void
+do_ClientMessage(XkbEvent *eventp)
{
XClientMessageEvent *e = &eventp->core.xclient;
char *mname = XGetAtomName (dpy, e->message_type);
@@ -518,8 +490,8 @@ do_ClientMessage (eventp)
return;
}
-do_MappingNotify (eventp)
- XkbEvent *eventp;
+static void
+do_MappingNotify(XkbEvent *eventp)
{
XMappingEvent *e = &eventp->core.xmapping;
char *r;
@@ -539,12 +511,9 @@ do_MappingNotify (eventp)
}
-
-set_sizehints (hintp, min_width, min_height,
- defwidth, defheight, defx, defy, geom)
- XSizeHints *hintp;
- int min_width, min_height, defwidth, defheight, defx, defy;
- char *geom;
+static void
+set_sizehints(XSizeHints *hintp, int min_width, int min_height,
+ int defwidth, int defheight, int defx, int defy, char *geom)
{
int geom_result;
@@ -591,11 +560,10 @@ set_sizehints (hintp, min_width, min_height,
}
return;
}
+#endif
-Bool
-PrintXkbEvent(file,ev)
- FILE * file;
- XkbEvent * ev;
+void
+PrintXkbEvent(FILE *file, XkbEvent *ev)
{
if (ev->type==xkbEventCode) {
switch (ev->any.xkb_type) {
diff --git a/utils.c b/utils.c
index 8d331df..bdb15ae 100644
--- a/utils.c
+++ b/utils.c
@@ -1,6 +1,6 @@
/*\
- * $Xorg: utils.c,v 1.5 2000/08/17 19:54:49 cpqbld Exp $
+ * $XFree86: xc/programs/xkbevd/utils.c,v 3.6 2002/01/14 18:30:11 dawes Exp $
*
* COPYRIGHT 1990
* DIGITAL EQUIPMENT CORPORATION
@@ -25,14 +25,12 @@
* used in advertising or publicity pertaining to distribution of the
* software without specific, written prior permission.
\*/
+/* $Xorg: utils.c,v 1.5 2000/08/17 19:54:49 cpqbld Exp $ */
+#define DEBUG_VAR_LOCAL
#include "utils.h"
#include <ctype.h>
-#ifndef X_NOT_STDC_ENV
-#include <stdlib.h>
-#else
-char *malloc();
-#endif
+#include <stdlib.h>
/***====================================================================***/
@@ -102,7 +100,7 @@ uFree(ptr)
/*** FUNCTION ENTRY TRACKING ***/
/***====================================================================***/
-static FILE *entryFile= stderr;
+static FILE *entryFile= NULL;
int uEntryLevel;
Boolean
@@ -123,18 +121,18 @@ uSetEntryFile(name)
}
void
-uEntry(l,s,a1,a2,a3,a4,a5,a6,a7,a8)
-int l;
-char *s;
-Opaque a1,a2,a3,a4,a5,a6,a7,a8;
+uEntry(int l, char *s,...)
{
int i;
+va_list ap;
+ va_start(ap, s);
for (i=0;i<uEntryLevel;i++) {
putc(' ',entryFile);
}
- fprintf(entryFile,s,a1,a2,a3,a4,a5,a6,a7,a8);
+ vfprintf(entryFile,s,ap);
uEntryLevel+= l;
+ va_end(ap);
return;
}
@@ -158,7 +156,7 @@ int i;
/*** PRINT FUNCTIONS ***/
/***====================================================================***/
- FILE *uDebugFile= stderr;
+ FILE *uDebugFile= NULL;
int uDebugIndentLevel= 0;
int uDebugIndentSize= 4;
@@ -180,37 +178,39 @@ uSetDebugFile(name)
}
void
-uDebug(s,a1,a2,a3,a4,a5,a6,a7,a8)
-char *s;
-Opaque a1,a2,a3,a4,a5,a6,a7,a8;
+uDebug(char *s,...)
{
int i;
+va_list ap;
+ va_start(ap, s);
for (i=(uDebugIndentLevel*uDebugIndentSize);i>0;i--) {
putc(' ',uDebugFile);
}
- fprintf(uDebugFile,s,a1,a2,a3,a4,a5,a6,a7,a8);
+ vfprintf(uDebugFile,s,ap);
fflush(uDebugFile);
+ va_end(ap);
return;
}
void
-uDebugNOI(s,a1,a2,a3,a4,a5,a6,a7,a8)
-char *s;
-Opaque a1,a2,a3,a4,a5,a6,a7,a8;
+uDebugNOI(char *s,...)
{
- fprintf(uDebugFile,s,a1,a2,a3,a4,a5,a6,a7,a8);
+va_list ap;
+
+ va_start(ap, s);
+ vfprintf(uDebugFile,s,ap);
fflush(uDebugFile);
+ va_end(ap);
return;
}
/***====================================================================***/
-static FILE *errorFile= stderr;
+static FILE *errorFile= NULL;
Boolean
-uSetErrorFile(name)
- char *name;
+uSetErrorFile(char *name)
{
if ((errorFile!=NULL)&&(errorFile!=stderr)) {
fprintf(errorFile,"switching to %s\n",name?name:"stderr");
@@ -226,65 +226,75 @@ uSetErrorFile(name)
}
void
-uInformation(s,a1,a2,a3,a4,a5,a6,a7,a8)
-char *s;
-Opaque a1,a2,a3,a4,a5,a6,a7,a8;
+uInformation(char *s,...)
{
- fprintf(errorFile,s,a1,a2,a3,a4,a5,a6,a7,a8);
+ va_list ap;
+
+ va_start(ap, s);
+ vfprintf(errorFile,s,ap);
fflush(errorFile);
+ va_end(ap);
return;
}
/***====================================================================***/
void
-uAction(s,a1,a2,a3,a4,a5,a6,a7,a8)
-char *s;
-Opaque a1,a2,a3,a4,a5,a6,a7,a8;
+uAction(char *s,...)
{
+ va_list ap;
+
+ va_start(ap, s);
fprintf(errorFile," ");
- fprintf(errorFile,s,a1,a2,a3,a4,a5,a6,a7,a8);
+ vfprintf(errorFile,s,ap);
fflush(errorFile);
+ va_end(ap);
return;
}
/***====================================================================***/
void
-uWarning(s,a1,a2,a3,a4,a5,a6,a7,a8)
-char *s;
-Opaque a1,a2,a3,a4,a5,a6,a7,a8;
+uWarning(char *s,...)
{
+ va_list ap;
+
+ va_start(ap, s);
fprintf(errorFile,"Warning: ");
- fprintf(errorFile,s,a1,a2,a3,a4,a5,a6,a7,a8);
+ vfprintf(errorFile,s,ap);
fflush(errorFile);
+ va_end(ap);
return;
}
/***====================================================================***/
void
-uError(s,a1,a2,a3,a4,a5,a6,a7,a8)
-char *s;
-Opaque a1,a2,a3,a4,a5,a6,a7,a8;
+uError(char *s,...)
{
+ va_list ap;
+
+ va_start(ap, s);
fprintf(errorFile,"Error: ");
- fprintf(errorFile,s,a1,a2,a3,a4,a5,a6,a7,a8);
+ vfprintf(errorFile,s,ap);
fflush(errorFile);
+ va_end(ap);
return;
}
/***====================================================================***/
void
-uFatalError(s,a1,a2,a3,a4,a5,a6,a7,a8)
-char *s;
-Opaque a1,a2,a3,a4,a5,a6,a7,a8;
+uFatalError(char *s,...)
{
+ va_list ap;
+
+ va_start(ap, s);
fprintf(errorFile,"Fatal Error: ");
- fprintf(errorFile,s,a1,a2,a3,a4,a5,a6,a7,a8);
+ vfprintf(errorFile,s,ap);
fprintf(errorFile," Exiting\n");
fflush(errorFile);
+ va_end(ap);
exit(1);
/* NOTREACHED */
}
@@ -292,13 +302,15 @@ Opaque a1,a2,a3,a4,a5,a6,a7,a8;
/***====================================================================***/
void
-uInternalError(s,a1,a2,a3,a4,a5,a6,a7,a8)
-char *s;
-Opaque a1,a2,a3,a4,a5,a6,a7,a8;
+uInternalError(char *s,...)
{
+ va_list ap;
+
+ va_start(ap, s);
fprintf(errorFile,"Internal error: ");
- fprintf(errorFile,s,a1,a2,a3,a4,a5,a6,a7,a8);
+ vfprintf(errorFile,s,ap);
fflush(errorFile);
+ va_end(ap);
return;
}
diff --git a/utils.h b/utils.h
index 448099f..7aaf3fe 100644
--- a/utils.h
+++ b/utils.h
@@ -27,6 +27,7 @@
* used in advertising or publicity pertaining to distribution of the
* software without specific, written prior permission.
\*/
+/* $XFree86: xc/programs/xkbevd/utils.h,v 1.6 2002/01/14 18:30:11 dawes Exp $ */
/***====================================================================***/
@@ -34,12 +35,11 @@
#include <X11/Xos.h>
#include <X11/Xfuncproto.h>
#include <X11/Xfuncs.h>
+#include <stdarg.h>
+#include <stddef.h>
_XFUNCPROTOBEGIN
-#ifndef NULL
-#define NULL 0
-#endif
#ifndef NUL
#define NUL '\0'
@@ -74,12 +74,14 @@ typedef int Comparison;
#define comparisonText(c) ((c)?((c)<0?"Less":"Greater"):"Equal")
#endif
+#ifdef notyet
typedef union {
int i;
unsigned u;
void *p;
- void *(*fp)();
+ void *(*fp)();
} Union;
+#endif
/***====================================================================***/
@@ -128,17 +130,13 @@ extern void uFree(
/***====================================================================***/
-extern Boolean uSetErrorFile(
-#if NeedFunctionPrototypes
- char * /* name */
-#endif
-);
-extern void uInformation();
-extern void uAction();
-extern void uWarning();
-extern void uError();
-extern void uFatalError();
-extern void uInternalError();
+extern Boolean uSetErrorFile ( char *name );
+extern void uInformation ( char *s, ...);
+extern void uAction ( char *s, ... );
+extern void uWarning ( char *s, ... );
+extern void uError ( char *s, ... );
+extern void uFatalError(char *s,...);
+extern void uInternalError ( char *s, ... );
/***====================================================================***/
@@ -191,13 +189,13 @@ extern char *uStringDup(
#define DEBUG_VAR debugFlags
#endif
-#ifdef DEBUG_VAR_NOT_LOCAL
+#ifndef DEBUG_VAR_LOCAL
extern
#endif
unsigned int DEBUG_VAR;
-extern void uDebug();
-extern void uDebugNOI(); /* no indent */
+extern void uDebug( char *s, ... );
+extern void uDebugNOI( char *s, ... ); /* no indent */
extern Boolean uSetDebugFile(
#if NeedFunctionPrototypes
char *name
@@ -241,7 +239,7 @@ extern Boolean uSetEntryFile(
char *name
#endif
);
-extern void uEntry();
+extern void uEntry(int l, char *s, ... );
extern void uExit(
#if NeedFunctionPrototypes
int l,char *rtVal
diff --git a/xkbevd.c b/xkbevd.c
index 6f9787f..30149ea 100644
--- a/xkbevd.c
+++ b/xkbevd.c
@@ -24,10 +24,14 @@
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
+/* $XFree86: xc/programs/xkbevd/xkbevd.c,v 3.9 2001/07/25 15:05:25 dawes Exp $ */
#define DEBUG_VAR xkbevdDebug
+#include <X11/Xosdefs.h>
+#include <stdlib.h>
#include "xkbevd.h"
+
#define lowbit(x) ((x) & (-(x)))
/***====================================================================***/
@@ -78,10 +82,8 @@ XkbDescPtr xkb= NULL;
#define M(m) fprintf(stderr,(m))
#define M1(m,a) fprintf(stderr,(m),(a))
-void
-Usage(argc,argv)
- int argc;
- char * argv[];
+static void
+Usage(int argc, char *argv[])
{
M1("Usage: %s [options]...\n",argv[0]);
M("Legal options:\n");
@@ -98,10 +100,8 @@ Usage(argc,argv)
/***====================================================================***/
-Bool
-parseArgs(argc,argv)
- int argc;
- char * argv[];
+static Bool
+parseArgs(int argc, char *argv[])
{
register int i;
@@ -204,12 +204,8 @@ register int i;
return True;
}
-Display *
-GetDisplay(program,dpyName,opcodeRtrn,evBaseRtrn)
- char * program;
- char * dpyName;
- int * opcodeRtrn;
- int * evBaseRtrn;
+static Display *
+GetDisplay(char *program, char *dpyName, int *opcodeRtrn, int *evBaseRtrn)
{
int mjr,mnr,error;
Display *dpy;
@@ -251,8 +247,7 @@ Display *dpy;
/***====================================================================***/
void
-InterpretConfigs(cfg)
- CfgEntryPtr cfg;
+InterpretConfigs(CfgEntryPtr cfg)
{
char * name;
unsigned priv= 0;
@@ -344,9 +339,8 @@ unsigned priv= 0;
return;
}
-CfgEntryPtr
-FindMatchingConfig(ev)
- XkbEvent * ev;
+static CfgEntryPtr
+FindMatchingConfig(XkbEvent *ev)
{
CfgEntryPtr cfg,dflt;
@@ -380,9 +374,8 @@ CfgEntryPtr cfg,dflt;
return dflt;
}
-Bool
-ProcessMatchingConfig(ev)
- XkbEvent * ev;
+static Bool
+ProcessMatchingConfig(XkbEvent *ev)
{
CfgEntryPtr cfg;
char buf[1024],*cmd;
@@ -447,15 +440,19 @@ int ok;
/***====================================================================***/
int
-main(argc,argv)
- int argc;
- char * argv[];
+main(int argc, char *argv[])
{
FILE * file;
static char buf[1024];
XkbEvent ev;
Bool ok;
+
+ yyin = stdin;
+ uSetEntryFile(NullString);
+ uSetDebugFile(NullString);
+ uSetErrorFile(NullString);
+
if (!parseArgs(argc,argv))
exit(1);
file= NULL;
diff --git a/xkbevd.h b/xkbevd.h
index d415389..01d8c47 100644
--- a/xkbevd.h
+++ b/xkbevd.h
@@ -24,6 +24,8 @@
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
+/* $XFree86: xc/programs/xkbevd/xkbevd.h,v 3.4 2001/01/17 23:46:09 dawes Exp $ */
+
#ifndef XKBEVD_H
#define XKBEVD_H 1
@@ -92,11 +94,18 @@ extern char *SubstituteEventArgs(
#endif
);
-extern Bool PrintXkbEvent(
+extern void PrintXkbEvent(
#if NeedFunctionPrototypes
FILE * /* file */,
XkbEvent * /* ev */
#endif
);
+extern int setScanState ( char * file, int line );
+extern int CFGParseFile ( FILE *file );
+
+extern int yylex(void);
+extern int yyparse(void);
+extern int yyerror(char *s);
+extern int yywrap(void);
#endif /* XKBEVD_H */
diff --git a/xkbevd.man b/xkbevd.man
index f66277d..d00d2ef 100644
--- a/xkbevd.man
+++ b/xkbevd.man
@@ -1,5 +1,8 @@
.\" $Xorg: xkbevd.man,v 1.3 2000/08/17 19:54:49 cpqbld Exp $
-.TH XKBCOMP 1 "Release 6.4" "X Version 11"
+.\"
+.\" $XFree86: xc/programs/xkbevd/xkbevd.man,v 1.7 2001/01/27 18:21:16 dawes Exp $
+.\"
+.TH XKBCOMP 1 __xorgversion__
.SH NAME
xkbevd \- XKB event daemon
.SH SYNOPSIS
@@ -86,11 +89,11 @@ Forces synchronization of all X requests. Slow.
Print more information, including debugging messages. Multiple
specifications of \fI-v\fP cause more output, to a point.
.SH "SEE ALSO"
-X(1)
+X(__miscmansuffix__)
.SH COPYRIGHT
Copyright 1995, Silicon Graphics Computer Systems
Copyright 1995, 1998 The Open Group
.br
-See \fIX(1)\fP for a full statement of rights and permissions.
+See \fIX(__miscmansuffix__)\fP for a full statement of rights and permissions.
.SH AUTHOR
Erik Fortune, Silicon Graphics