aboutsummaryrefslogtreecommitdiff
path: root/xkbcomp
diff options
context:
space:
mode:
Diffstat (limited to 'xkbcomp')
-rwxr-xr-xxkbcomp/bison.bat14
-rw-r--r--xkbcomp/compat.c5
-rw-r--r--xkbcomp/keycodes.c2
-rw-r--r--xkbcomp/listing.c10
-rw-r--r--xkbcomp/makefile43
-rw-r--r--xkbcomp/parseutils.c5
-rw-r--r--xkbcomp/utils.h4
-rw-r--r--xkbcomp/xkbcomp.c8
-rw-r--r--xkbcomp/xkbcomp.h1
-rw-r--r--xkbcomp/xkbparse.y4
-rw-r--r--xkbcomp/xkbpath.c3
-rw-r--r--xkbcomp/xkbscan.c4
12 files changed, 95 insertions, 8 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 2b0014244..526224da1 100644
--- a/xkbcomp/compat.c
+++ b/xkbcomp/compat.c
@@ -655,14 +655,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/keycodes.c b/xkbcomp/keycodes.c
index 13579ec1a..4081ea1b5 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 11de88a83..c05c3c65c 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/parseutils.c b/xkbcomp/parseutils.c
index a1b6e9e2f..4b2a3e605 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.h b/xkbcomp/utils.h
index b00067d6e..ea9d1deaa 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
diff --git a/xkbcomp/xkbcomp.c b/xkbcomp/xkbcomp.c
index fb5dec2fc..4e00c2ad6 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;
@@ -1141,10 +1141,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..221f269b9 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"
@@ -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;