Rename xkbcomp/misc.h to xkbcomp-priv.h and use it
The include dependencies were quite convoluted, where you change the order and get a ton of errors. Instead, change one file to act as the internal interface for the xkbcomp files, and make every file use it. Also drop the pointless "xkb" prefix to file names. Signed-off-by: Ran Benita <ran234@gmail.com>master
parent
dccdf32cc4
commit
33273304f2
15
Makefile.am
15
Makefile.am
|
@ -49,18 +49,17 @@ libxkbcommon_la_SOURCES = \
|
|||
src/xkbcomp/keymap.c \
|
||||
src/xkbcomp/keytypes.c \
|
||||
src/xkbcomp/misc.c \
|
||||
src/xkbcomp/misc.h \
|
||||
src/xkbcomp/parser.y \
|
||||
src/xkbcomp/parseutils.c \
|
||||
src/xkbcomp/parseutils.h \
|
||||
src/xkbcomp/path.c \
|
||||
src/xkbcomp/scanner.l \
|
||||
src/xkbcomp/symbols.c \
|
||||
src/xkbcomp/vmod.c \
|
||||
src/xkbcomp/vmod.h \
|
||||
src/xkbcomp/xkbcomp.c \
|
||||
src/xkbcomp/xkbcomp.h \
|
||||
src/xkbcomp/xkbparse.y \
|
||||
src/xkbcomp/xkbpath.c \
|
||||
src/xkbcomp/xkbpath.h \
|
||||
src/xkbcomp/xkbscan.l \
|
||||
src/xkbcomp/xkbcomp-priv.h \
|
||||
src/alloc.c \
|
||||
src/atom.c \
|
||||
src/context.c \
|
||||
|
@ -79,9 +78,9 @@ libxkbcommon_la_SOURCES = \
|
|||
src/XKBcommonint.h
|
||||
|
||||
BUILT_SOURCES = \
|
||||
src/xkbcomp/xkbparse.c \
|
||||
src/xkbcomp/xkbparse.h \
|
||||
src/xkbcomp/xkbscan.c \
|
||||
src/xkbcomp/parser.c \
|
||||
src/xkbcomp/parser.h \
|
||||
src/xkbcomp/scanner.c \
|
||||
src/ks_tables.h
|
||||
CLEANFILES = $(BUILT_SOURCES)
|
||||
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
xkbparse.c
|
||||
xkbparse.h
|
||||
xkbscan.c
|
||||
parser.c
|
||||
parser.h
|
||||
scanner.c
|
||||
|
|
|
@ -24,17 +24,8 @@
|
|||
|
||||
********************************************************/
|
||||
|
||||
#include <X11/X.h>
|
||||
|
||||
#include "xkbcomp.h"
|
||||
#include "xkbmisc.h"
|
||||
#include "expr.h"
|
||||
|
||||
#include "keycodes.h"
|
||||
#include "vmod.h"
|
||||
#include "misc.h"
|
||||
#include "action.h"
|
||||
#include "misc.h"
|
||||
#include "keycodes.h"
|
||||
|
||||
static bool actionsInitialized;
|
||||
static ExprDef constTrue;
|
||||
|
|
|
@ -27,6 +27,9 @@
|
|||
#ifndef ACTION_H
|
||||
#define ACTION_H 1
|
||||
|
||||
#include "xkbcomp-priv.h"
|
||||
#include "expr.h"
|
||||
|
||||
#define F_ClearLocks 0
|
||||
#define F_LatchToLock 1
|
||||
#define F_GenKeyEvent 2
|
||||
|
|
|
@ -24,10 +24,6 @@
|
|||
|
||||
********************************************************/
|
||||
|
||||
#include "xkbcomp.h"
|
||||
#include "xkballoc.h"
|
||||
#include "xkbmisc.h"
|
||||
#include "misc.h"
|
||||
#include "alias.h"
|
||||
#include "keycodes.h"
|
||||
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
#ifndef ALIAS_H
|
||||
#define ALIAS_H 1
|
||||
|
||||
#include "xkbcomp-priv.h"
|
||||
|
||||
typedef struct _AliasInfo
|
||||
{
|
||||
CommonInfo def;
|
||||
|
|
|
@ -24,15 +24,11 @@
|
|||
|
||||
********************************************************/
|
||||
|
||||
#include "xkbcomp.h"
|
||||
#include "xkballoc.h"
|
||||
#include "xkbmisc.h"
|
||||
#include "expr.h"
|
||||
#include "vmod.h"
|
||||
#include "misc.h"
|
||||
#include "indicators.h"
|
||||
#include "action.h"
|
||||
#include "xkbcomp-priv.h"
|
||||
#include "parseutils.h"
|
||||
#include "action.h"
|
||||
#include "indicators.h"
|
||||
#include "vmod.h"
|
||||
|
||||
typedef struct _SymInterpInfo
|
||||
{
|
||||
|
|
|
@ -24,14 +24,7 @@
|
|||
|
||||
********************************************************/
|
||||
|
||||
#include <X11/X.h>
|
||||
|
||||
#include "xkbcomp.h"
|
||||
#include "xkbmisc.h"
|
||||
#include "expr.h"
|
||||
#include "vmod.h"
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
/***====================================================================***/
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#ifndef EXPR_H
|
||||
#define EXPR_H 1
|
||||
|
||||
#include <stdbool.h>
|
||||
#include "xkbcomp-priv.h"
|
||||
|
||||
typedef union _ExprResult
|
||||
{
|
||||
|
|
|
@ -24,15 +24,9 @@
|
|||
|
||||
********************************************************/
|
||||
|
||||
#include "xkbcomp.h"
|
||||
#include "xkballoc.h"
|
||||
#include "xkbmisc.h"
|
||||
#include "misc.h"
|
||||
#include "expr.h"
|
||||
#include "vmod.h"
|
||||
#include "indicators.h"
|
||||
#include "expr.h"
|
||||
#include "action.h"
|
||||
#include "utils.h"
|
||||
|
||||
/***====================================================================***/
|
||||
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
#ifndef INDICATORS_H
|
||||
#define INDICATORS_H 1
|
||||
|
||||
#include "xkbcomp-priv.h"
|
||||
|
||||
#define _LED_Index (1<<0)
|
||||
#define _LED_Mods (1<<1)
|
||||
#define _LED_Groups (1<<2)
|
||||
|
|
|
@ -24,14 +24,10 @@
|
|||
|
||||
********************************************************/
|
||||
|
||||
#include "xkbcomp.h"
|
||||
#include "xkballoc.h"
|
||||
#include "xkbmisc.h"
|
||||
#include "expr.h"
|
||||
#include "keycodes.h"
|
||||
#include "misc.h"
|
||||
#include "alias.h"
|
||||
#include "expr.h"
|
||||
#include "parseutils.h"
|
||||
#include "alias.h"
|
||||
|
||||
const char *
|
||||
longText(unsigned long val)
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
#ifndef KEYCODES_H
|
||||
#define KEYCODES_H 1
|
||||
|
||||
#include "xkbcomp-priv.h"
|
||||
|
||||
#define KeyNameToLong(n) ( \
|
||||
(((unsigned long)n[0]) << 24) | \
|
||||
(((unsigned long)n[1]) << 16) | \
|
||||
|
|
|
@ -24,14 +24,8 @@
|
|||
|
||||
********************************************************/
|
||||
|
||||
#include "xkbcomp.h"
|
||||
#include "xkbmisc.h"
|
||||
#include "expr.h"
|
||||
#include "vmod.h"
|
||||
#include "action.h"
|
||||
#include "misc.h"
|
||||
#include "xkbcomp-priv.h"
|
||||
#include "indicators.h"
|
||||
#include "xkballoc.h"
|
||||
|
||||
/**
|
||||
* Compile the given file and store the output in xkb.
|
||||
|
|
|
@ -24,14 +24,9 @@
|
|||
|
||||
********************************************************/
|
||||
|
||||
#include "xkbcomp.h"
|
||||
#include "xkballoc.h"
|
||||
#include "xkbmisc.h"
|
||||
#include "expr.h"
|
||||
#include "vmod.h"
|
||||
#include "action.h"
|
||||
#include "misc.h"
|
||||
#include "xkbcomp-priv.h"
|
||||
#include "parseutils.h"
|
||||
#include "vmod.h"
|
||||
|
||||
typedef struct _PreserveInfo
|
||||
{
|
||||
|
|
|
@ -24,13 +24,9 @@
|
|||
|
||||
********************************************************/
|
||||
|
||||
#include "xkbcomp.h"
|
||||
#include "xkballoc.h"
|
||||
#include "xkbmisc.h"
|
||||
#include "xkbpath.h"
|
||||
#include "keycodes.h"
|
||||
#include "misc.h"
|
||||
#include "xkbcomp-priv.h"
|
||||
#include "parseutils.h"
|
||||
#include "keycodes.h"
|
||||
|
||||
/***====================================================================***/
|
||||
|
||||
|
|
|
@ -25,14 +25,8 @@
|
|||
********************************************************/
|
||||
|
||||
%{
|
||||
#ifdef DEBUG
|
||||
#define YYDEBUG 1
|
||||
#endif
|
||||
|
||||
#include "xkbcomp-priv.h"
|
||||
#include "parseutils.h"
|
||||
#include "xkbmisc.h"
|
||||
#include <X11/keysym.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
extern int yylex(union YYSTYPE *val, struct YYLTYPE *loc, void *scanner);
|
||||
|
|
@ -25,9 +25,6 @@
|
|||
********************************************************/
|
||||
|
||||
#include "parseutils.h"
|
||||
#include "xkbmisc.h"
|
||||
#include "xkbpath.h"
|
||||
#include "xkbparse.h"
|
||||
|
||||
#include <X11/keysym.h>
|
||||
|
||||
|
|
|
@ -27,8 +27,10 @@
|
|||
#ifndef XKBPARSE_H
|
||||
#define XKBPARSE_H 1
|
||||
|
||||
#include "xkbcomp.h"
|
||||
#include "xkbparse.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#include "xkbcomp-priv.h"
|
||||
#include "parser.h"
|
||||
|
||||
struct parser_param {
|
||||
void *scanner;
|
||||
|
|
|
@ -26,11 +26,8 @@
|
|||
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
#include "xkbcommon/xkbcommon.h"
|
||||
#include "XKBcommonint.h"
|
||||
#include "utils.h"
|
||||
#include "xkbpath.h"
|
||||
|
||||
#include "xkbcomp-priv.h"
|
||||
|
||||
/**
|
||||
* Extract the first token from an include statement.
|
|
@ -25,14 +25,11 @@
|
|||
********************************************************/
|
||||
|
||||
%{
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "xkbcomp-priv.h"
|
||||
#include "parseutils.h"
|
||||
|
||||
|
||||
extern int yyparse(struct parser_param *param);
|
||||
|
||||
#define YY_USER_ACTION { \
|
||||
|
@ -45,7 +42,6 @@ extern int yyparse(struct parser_param *param);
|
|||
return ERROR_TOK; \
|
||||
*yyextra->s++ = ch; \
|
||||
} while (0)
|
||||
|
||||
%}
|
||||
|
||||
%option reentrant
|
|
@ -24,21 +24,14 @@
|
|||
|
||||
********************************************************/
|
||||
|
||||
#include "xkbcomp.h"
|
||||
#include "xkballoc.h"
|
||||
#include "xkbmisc.h"
|
||||
#include "expr.h"
|
||||
#include "parseutils.h"
|
||||
|
||||
#include <X11/keysym.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "expr.h"
|
||||
#include "vmod.h"
|
||||
#include "xkbcomp-priv.h"
|
||||
#include "parseutils.h"
|
||||
#include "action.h"
|
||||
#include "keycodes.h"
|
||||
#include "misc.h"
|
||||
#include "alias.h"
|
||||
#include "keycodes.h"
|
||||
#include "vmod.h"
|
||||
|
||||
/***====================================================================***/
|
||||
|
||||
|
|
|
@ -24,15 +24,6 @@
|
|||
|
||||
********************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "xkbcomp.h"
|
||||
#include "xkballoc.h"
|
||||
#include "xkbmisc.h"
|
||||
#include "expr.h"
|
||||
#include "misc.h"
|
||||
|
||||
#include <X11/extensions/XKB.h>
|
||||
|
||||
#include "vmod.h"
|
||||
|
||||
void
|
||||
|
|
|
@ -27,6 +27,9 @@
|
|||
#ifndef VMOD_H
|
||||
#define VMOD_H 1
|
||||
|
||||
#include "xkbcomp-priv.h"
|
||||
#include "expr.h"
|
||||
|
||||
typedef struct _VModInfo
|
||||
{
|
||||
struct xkb_keymap *xkb;
|
||||
|
|
|
@ -24,8 +24,12 @@
|
|||
|
||||
********************************************************/
|
||||
|
||||
#ifndef MISC_H
|
||||
#define MISC_H 1
|
||||
#ifndef XKBCOMP_PRIV_H
|
||||
#define XKBCOMP_PRIV_H
|
||||
|
||||
#include "xkbcomp.h"
|
||||
#include "xkballoc.h"
|
||||
#include "utils.h"
|
||||
|
||||
typedef struct _CommonInfo
|
||||
{
|
||||
|
@ -71,4 +75,18 @@ extern bool
|
|||
FindKeyNameForAlias(struct xkb_keymap *xkb, unsigned long lname,
|
||||
unsigned long *real_name);
|
||||
|
||||
#endif /* MISC_H */
|
||||
extern bool
|
||||
UpdateModifiersFromCompat(struct xkb_keymap *xkb);
|
||||
|
||||
extern const char *
|
||||
XkbDirectoryForInclude(unsigned type);
|
||||
|
||||
extern FILE *
|
||||
XkbFindFileInPath(struct xkb_context *context, const char *name,
|
||||
unsigned type, char **pathRtrn);
|
||||
|
||||
extern bool
|
||||
XkbParseIncludeMap(char **str_inout, char **file_rtrn, char **map_rtrn,
|
||||
char *nextop_rtrn, char **extra_data);
|
||||
|
||||
#endif /* XKBCOMP_PRIV_H */
|
|
@ -24,14 +24,9 @@ sale, use or other dealings in this Software without prior written
|
|||
authorization from the authors.
|
||||
*/
|
||||
|
||||
#include <limits.h>
|
||||
#include "xkbcomp.h"
|
||||
#include "xkballoc.h"
|
||||
#include "xkbcomp-priv.h"
|
||||
#include "xkbrules.h"
|
||||
#include "xkbpath.h"
|
||||
#include "xkbmisc.h"
|
||||
#include "parseutils.h"
|
||||
#include "utils.h"
|
||||
|
||||
/* Global warning level */
|
||||
unsigned int warningLevel = 0;
|
||||
|
|
|
@ -27,9 +27,6 @@
|
|||
#ifndef XKBCOMP_H
|
||||
#define XKBCOMP_H 1
|
||||
|
||||
#include "utils.h"
|
||||
|
||||
#include "xkbcommon/xkbcommon.h"
|
||||
#include "XKBcommonint.h"
|
||||
#include "xkbmisc.h"
|
||||
|
||||
|
@ -271,7 +268,4 @@ CompileCompatMap(XkbFile *file, struct xkb_keymap * xkb, unsigned merge,
|
|||
extern bool
|
||||
CompileSymbols(XkbFile *file, struct xkb_keymap * xkb, unsigned merge);
|
||||
|
||||
extern bool
|
||||
UpdateModifiersFromCompat(struct xkb_keymap *xkb);
|
||||
|
||||
#endif /* XKBCOMP_H */
|
||||
|
|
|
@ -1,46 +0,0 @@
|
|||
/************************************************************
|
||||
Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc.
|
||||
|
||||
Permission to use, copy, modify, and distribute this
|
||||
software and its documentation for any purpose and without
|
||||
fee is hereby granted, provided that the above copyright
|
||||
notice appear in all copies and that both that copyright
|
||||
notice and this permission notice appear in supporting
|
||||
documentation, and that the name of Silicon Graphics not be
|
||||
used in advertising or publicity pertaining to distribution
|
||||
of the software without specific prior written permission.
|
||||
Silicon Graphics makes no representation about the suitability
|
||||
of this software for any purpose. It is provided "as is"
|
||||
without any express or implied warranty.
|
||||
|
||||
SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
|
||||
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
|
||||
GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
|
||||
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
||||
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
|
||||
THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
|
||||
#ifndef _XKBPATH_H_
|
||||
#define _XKBPATH_H_ 1
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "XKBcommonint.h"
|
||||
|
||||
extern const char *
|
||||
XkbDirectoryForInclude(unsigned type);
|
||||
|
||||
extern FILE *
|
||||
XkbFindFileInPath(struct xkb_context *context, const char *name,
|
||||
unsigned type, char **pathRtrn);
|
||||
|
||||
extern bool
|
||||
XkbParseIncludeMap(char **str_inout, char **file_rtrn, char **map_rtrn,
|
||||
char *nextop_rtrn, char **extra_data);
|
||||
|
||||
#endif /* _XKBPATH_H_ */
|
|
@ -30,7 +30,6 @@ authorization from the authors.
|
|||
#include <stdbool.h>
|
||||
#include <X11/Xfuncproto.h>
|
||||
|
||||
#include "xkbcommon/xkbcommon.h"
|
||||
#include "XKBcommonint.h"
|
||||
|
||||
typedef uint32_t xkb_atom_t;
|
||||
|
|
|
@ -28,6 +28,7 @@ authorization from the authors.
|
|||
#define _XKBRULES_H_
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "xkbcommon/xkbcommon.h"
|
||||
|
||||
|
|
Loading…
Reference in New Issue