diff options
Diffstat (limited to 'xkbcomp')
-rwxr-xr-x | xkbcomp/bison.bat | 14 | ||||
-rwxr-xr-x[-rw-r--r--] | xkbcomp/compat.c | 9 | ||||
-rw-r--r-- | xkbcomp/expr.c | 2 | ||||
-rw-r--r-- | xkbcomp/keycodes.c | 2 | ||||
-rw-r--r-- | xkbcomp/listing.c | 10 | ||||
-rw-r--r-- | xkbcomp/makefile | 43 | ||||
-rw-r--r-- | xkbcomp/misc.h | 2 | ||||
-rw-r--r-- | xkbcomp/parseutils.c | 5 | ||||
-rw-r--r-- | xkbcomp/utils.c | 2 | ||||
-rw-r--r-- | xkbcomp/utils.h | 6 | ||||
-rw-r--r-- | xkbcomp/xkbcomp.c | 8 | ||||
-rw-r--r-- | xkbcomp/xkbcomp.h | 1 | ||||
-rw-r--r-- | xkbcomp/xkbparse.y | 4 | ||||
-rw-r--r-- | xkbcomp/xkbpath.c | 3 | ||||
-rw-r--r-- | xkbcomp/xkbscan.c | 6 |
15 files changed, 104 insertions, 13 deletions
diff --git a/xkbcomp/bison.bat b/xkbcomp/bison.bat new file mode 100755 index 000000000..9a0e5aa07 --- /dev/null +++ b/xkbcomp/bison.bat @@ -0,0 +1,14 @@ +@echo off
+setlocal
+
+cd "%~dp0"
+
+set M4=..\tools\mhmake\m4.exe
+set BISON_PKGDATADIR=../tools/mhmake/src/bisondata
+
+set path=..\tools\mhmake;%path%
+
+..\tools\mhmake\bison.exe %1 %2 %3
+
+endlocal
+
diff --git a/xkbcomp/compat.c b/xkbcomp/compat.c index 82fd4e666..f9402f129 100644..100755 --- a/xkbcomp/compat.c +++ b/xkbcomp/compat.c @@ -114,7 +114,11 @@ InitCompatInfo(CompatInfo * info, XkbDescPtr xkb) info->dflt.defs.fileID = info->fileID; info->dflt.defs.defined = 0; info->dflt.defs.merge = MergeOverride; + info->dflt.defs.next = NULL; info->dflt.interp.flags = 0; + info->dflt.interp.match = 0; + info->dflt.interp.mods = 0; + info->dflt.interp.sym = 0; info->dflt.interp.virtual_mod = XkbNoModifier; info->dflt.interp.act.type = XkbSA_NoAction; for (i = 0; i < XkbAnyActionDataSize; i++) @@ -655,14 +659,13 @@ HandleInterpDef(InterpDef * def, XkbDescPtr xkb, unsigned merge, if (!ResolveStateAndPredicate(def->match, &pred, &mods, info)) { - ERROR("Couldn't determine matching modifiers\n"); + if (warningLevel > 0) + WARN1("Couldn't determine matching modifiers\n"); ACTION("Symbol interpretation ignored\n"); return True; } if (def->ignore) { - ERROR("Couldn't lookup keysym\n"); - ACTION("Symbol interpretation ignored\n"); return True; } diff --git a/xkbcomp/expr.c b/xkbcomp/expr.c index e0f957c15..09ffca1d8 100644 --- a/xkbcomp/expr.c +++ b/xkbcomp/expr.c @@ -729,7 +729,7 @@ ExprResolveString(ExprDef * expr, val_rtrn->str = XkbAtomGetString(NULL, expr->value.str); if (val_rtrn->str == NULL) { - static const char *empty = ""; + static char *empty = ""; val_rtrn->str = empty; } return True; diff --git a/xkbcomp/keycodes.c b/xkbcomp/keycodes.c index 22d9eae85..57c8bc892 100644 --- a/xkbcomp/keycodes.c +++ b/xkbcomp/keycodes.c @@ -297,6 +297,8 @@ InitKeyNamesInfo(KeyNamesInfo * info) info->name = NULL; info->leds = NULL; info->aliases = NULL; + info->fileID=-1; + info->merge=0; ClearKeyNamesInfo(info); info->errorCount = 0; return; diff --git a/xkbcomp/listing.c b/xkbcomp/listing.c index 945f7f6ca..2860ec728 100644 --- a/xkbcomp/listing.c +++ b/xkbcomp/listing.c @@ -75,6 +75,7 @@ SOFTWARE. #include <sys/types.h> #include <sys/stat.h> #include <X11/keysym.h> +#include <X11/Xwindows.h> #if defined(sgi) #include <malloc.h> @@ -123,6 +124,14 @@ SOFTWARE. #include "tokens.h" #include <X11/extensions/XKBgeom.h> +#ifndef S_ISDIR +# if defined(_S_IFMT) && defined(_S_IFDIR) +# define S_ISDIR(a) (((a) & _S_IFMT) == _S_IFDIR) +# else +# define S_ISDIR(a) (((a) & S_IFMT) == S_IFDIR) +# endif +#endif + #define lowbit(x) ((x) & (-(x))) unsigned int listingDebug; @@ -289,6 +298,7 @@ AddDirectory(char *head, char *ptrn, char *rest, char *map) #ifdef WIN32 if ((dirh = FindFirstFile("*.*", &file)) == INVALID_HANDLE_VALUE) return 0; + nMatch = 0; #else if ((dirp = opendir((head ? head : "."))) == NULL) return 0; diff --git a/xkbcomp/makefile b/xkbcomp/makefile new file mode 100644 index 000000000..a7d731352 --- /dev/null +++ b/xkbcomp/makefile @@ -0,0 +1,43 @@ +INCLUDELIBFILES = $(MHMAKECONF)\libX11\$(OBJDIR)\libX11.lib \ + $(MHMAKECONF)\libxcb\src\$(OBJDIR)\libxcb.lib \ + $(MHMAKECONF)\libXau\$(OBJDIR)\libXau.lib \ + $(MHMAKECONF)\libxkbfile\src\$(OBJDIR)\libxkbfile.lib + +LIBDIRS=$(dir $(INCLUDELIBFILES)) + +load_makefile $(LIBDIRS:%$(OBJDIR)\=%makefile MAKESERVER=0 DEBUG=$(DEBUG);) + +ifeq $(DEBUG),1 +TTYAPP = xkbcomp +else +WINAPP = xkbcomp +endif + +DEFINES += DFLT_XKB_CONFIG_ROOT="\".\"" PACKAGE_VERSION="\"1.2.3\"" + +INCLUDES += $(OBJDIR) + +CSRCS = action.c \ + alias.c \ + compat.c \ + expr.c \ + geometry.c \ + indicators.c \ + keycodes.c \ + keymap.c \ + keytypes.c \ + listing.c \ + misc.c \ + parseutils.c \ + symbols.c \ + utils.c \ + vmod.c \ + xkbcomp.c \ + xkbparse.c \ + xkbpath.c \ + xkbscan.c + +LINKLIBS += $(PTHREADLIB) $(FREETYPELIB) $(OPENSSLLIB) + +$(OBJDIR)\xkbparse.c $(OBJDIR)\xkbparse.h: xkbparse.y + bison.bat -d -o$(OBJDIR)\xkbparse.c $< diff --git a/xkbcomp/misc.h b/xkbcomp/misc.h index 4fa4b6dde..015ad5c87 100644 --- a/xkbcomp/misc.h +++ b/xkbcomp/misc.h @@ -30,7 +30,7 @@ typedef struct _CommonInfo { unsigned short defined; - unsigned char fileID; + int fileID; unsigned char merge; struct _CommonInfo *next; } CommonInfo; diff --git a/xkbcomp/parseutils.c b/xkbcomp/parseutils.c index c08353dd4..ab50c5710 100644 --- a/xkbcomp/parseutils.c +++ b/xkbcomp/parseutils.c @@ -230,7 +230,12 @@ InterpCreate(const char *sym_str, ExprDef * match) def->common.stmtType = StmtInterpDef; def->common.next = NULL; if (LookupKeysym(sym_str, &def->sym) == 0) + { def->ignore = True; + if (warningLevel > 0) + WARN1("Couldn't lookup keysym %s\n", sym_str); + ACTION("Symbol interpretation ignored\n"); + } else def->ignore = False; def->match = match; diff --git a/xkbcomp/utils.c b/xkbcomp/utils.c index 541c33e14..53dc99472 100644 --- a/xkbcomp/utils.c +++ b/xkbcomp/utils.c @@ -352,7 +352,7 @@ uStrCaseCmp(const char *str1, const char *str2) } int -uStrCasePrefix(const char *my_prefix, char *str) +uStrCasePrefix(const char *my_prefix, const char *str) { char c1; char c2; diff --git a/xkbcomp/utils.h b/xkbcomp/utils.h index 81f5893b6..e51d1a091 100644 --- a/xkbcomp/utils.h +++ b/xkbcomp/utils.h @@ -141,6 +141,10 @@ uInformation(const char * /* s */ , ... extern void uWarning(const char * /* s */ , ... ) _X_ATTRIBUTE_PRINTF(1, 2); +#ifdef ERROR +#undef ERROR +#endif + #define ERROR6 uError #define ERROR5 uError #define ERROR4 uError @@ -206,7 +210,7 @@ uInformation(const char * /* s */ , ... const char * /* s2 */ ); extern int uStrCasePrefix(const char * /* p */ , - char * /* str */ + const char * /* str */ ); #endif #ifdef HAVE_STRDUP diff --git a/xkbcomp/xkbcomp.c b/xkbcomp/xkbcomp.c index adfa89a74..bafef438f 100644 --- a/xkbcomp/xkbcomp.c +++ b/xkbcomp/xkbcomp.c @@ -549,8 +549,8 @@ parseArgs(int argc, char *argv[]) { WARN1("Changing root directory to \"%s\"\n", rootDir); } - if ((chdir(rootDir) < 0) && (warningLevel > 0)) - { + XkbAddDirectoryToPath(rootDir); + if (!XkbAddDirectoryToPath(rootDir) && (warningLevel>0)) { WARN1("Couldn't change directory to \"%s\"\n", rootDir); ACTION("Root directory (-R) option ignored\n"); rootDir = NULL; @@ -1160,10 +1160,14 @@ main(int argc, char *argv[]) break; } #endif +#ifdef _MSC_VER + outputFileFd= open(outputFile, O_WRONLY|O_CREAT|O_EXCL|binMode,_S_IREAD | _S_IWRITE); +#else outputFileFd = open(outputFile, O_WRONLY | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH | binMode); +#endif if (outputFileFd < 0) { ERROR1 diff --git a/xkbcomp/xkbcomp.h b/xkbcomp/xkbcomp.h index fb4006165..c224a2e06 100644 --- a/xkbcomp/xkbcomp.h +++ b/xkbcomp/xkbcomp.h @@ -31,6 +31,7 @@ #define DEBUG_VAR debugFlags #endif +#include <unistd.h> #include <X11/Xlib.h> #include <X11/XKBlib.h> diff --git a/xkbcomp/xkbparse.y b/xkbcomp/xkbparse.y index d816bee6e..87dd07f20 100644 --- a/xkbcomp/xkbparse.y +++ b/xkbcomp/xkbparse.y @@ -92,6 +92,10 @@ #ifdef DEBUG #define YYDEBUG 1 #endif + +#define YYMALLOC malloc +#define YYFREE free + #define DEBUG_VAR parseDebug #include "parseutils.h" #include <X11/keysym.h> diff --git a/xkbcomp/xkbpath.c b/xkbcomp/xkbpath.c index 6f18b860f..59f5645a5 100644 --- a/xkbcomp/xkbpath.c +++ b/xkbcomp/xkbpath.c @@ -30,11 +30,12 @@ #define DEBUG_VAR debugFlags #include "utils.h" #include <stdlib.h> +#include <unistd.h> #include <X11/extensions/XKM.h> #include "xkbpath.h" #ifndef DFLT_XKB_CONFIG_ROOT -#define DFLT_XKB_CONFIG_ROOT "/usr/lib/X11/xkb" +#define DFLT_XKB_CONFIG_ROOT "xkbdata" #endif #ifndef PATH_MAX diff --git a/xkbcomp/xkbscan.c b/xkbcomp/xkbscan.c index 237f52084..9a265d35b 100644 --- a/xkbcomp/xkbscan.c +++ b/xkbcomp/xkbscan.c @@ -32,7 +32,7 @@ #include <X11/XKBlib.h> #include "tokens.h" -#define DEBUG_VAR scanDebug + #include "utils.h" #include "parseutils.h" @@ -55,7 +55,7 @@ static int readBufPos = 0; static int readBufLen = 0; #ifdef DEBUG -extern int debugFlags; +extern unsigned int debugFlags; static char * tokText(int tok) @@ -614,7 +614,7 @@ yyGetIdent(int first) static int yyGetNumber(int ch) { - const int nMaxBuffSize = 1024; + #define nMaxBuffSize 1024 int isFloat = 0; char buf[nMaxBuffSize]; int nInBuf = 0; |