summaryrefslogtreecommitdiff
path: root/xkbscan.c
diff options
context:
space:
mode:
Diffstat (limited to 'xkbscan.c')
-rw-r--r--xkbscan.c47
1 files changed, 8 insertions, 39 deletions
diff --git a/xkbscan.c b/xkbscan.c
index 9cda90d..45cbe0a 100644
--- a/xkbscan.c
+++ b/xkbscan.c
@@ -24,6 +24,7 @@
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
+/* $XFree86: xc/programs/xkbcomp/xkbscan.c,v 3.11 2002/06/05 00:00:38 dawes Exp $ */
#include <stdio.h>
#include <ctype.h>
@@ -34,8 +35,9 @@
#include "tokens.h"
#define DEBUG_VAR scanDebug
#include "utils.h"
+#include "parseutils.h"
-FILE *yyin = stdin;
+FILE *yyin = NULL;
static char scanFileBuf[1024];
char * scanFile= scanFileBuf;
@@ -57,12 +59,7 @@ static char buf[BUFSIZE];
extern unsigned debugFlags;
static char *
-#if NeedFunctionPrototypes
tokText(int tok)
-#else
-tokText(tok)
- int tok;
-#endif
{
static char buf[32];
@@ -147,13 +144,7 @@ static char buf[32];
#endif
int
-#if NeedFunctionPrototypes
setScanState(char *file,int line)
-#else
-setScanState(file,line)
- char * file;
- int line;
-#endif
{
if (file!=NULL)
strncpy(scanFile,file,1024);
@@ -162,12 +153,8 @@ setScanState(file,line)
return 1;
}
-int
-#if NeedFunctionPrototypes
+static int
yyGetString(void)
-#else
-yyGetString()
-#endif
{
int ch;
@@ -228,12 +215,8 @@ int ch;
return ERROR_TOK;
}
-int
-#if NeedFunctionPrototypes
+static int
yyGetKeyName(void)
-#else
-yyGetKeyName()
-#endif
{
int ch;
@@ -346,16 +329,11 @@ struct _Keyword {
};
int numKeywords = sizeof(keywords)/sizeof(struct _Keyword);
-int
-#if NeedFunctionPrototypes
+static int
yyGetIdent(int first)
-#else
-yyGetIdent(first)
- int first;
-#endif
{
int ch,i,found;
-int rtrn= IDENT;
+int rtrn = IDENT;
buf[0] = first; nInBuf = 1;
while ( ((ch=getc(yyin))!=EOF) && (isalnum(ch)||(ch=='_')) ) {
@@ -387,13 +365,8 @@ int rtrn= IDENT;
return rtrn;
}
-int
-#if NeedFunctionPrototypes
+static int
yyGetNumber(int ch)
-#else
-yyGetNumber(ch)
- int ch;
-#endif
{
int isFloat= 0;
@@ -427,11 +400,7 @@ int isFloat= 0;
}
int
-#if NeedFunctionPrototypes
yylex(void)
-#else
-yylex()
-#endif
{
int ch;
int rtrn;