diff options
-rw-r--r-- | Makefile.am | 6 | ||||
-rw-r--r-- | src/atom.c | 1 | ||||
-rw-r--r-- | src/atom.h | 4 | ||||
-rw-r--r-- | src/context.c | 26 | ||||
-rw-r--r-- | src/context.h | 99 | ||||
-rw-r--r-- | src/keymap-dump.c | 7 | ||||
-rw-r--r-- | src/keysym-utf.c | 2 | ||||
-rw-r--r-- | src/keysym.c | 8 | ||||
-rw-r--r-- | src/keysym.h | 62 | ||||
-rw-r--r-- | src/map.c | 2 | ||||
-rw-r--r-- | src/map.h (renamed from src/xkb-priv.h) | 122 | ||||
-rw-r--r-- | src/state.c | 5 | ||||
-rw-r--r-- | src/text.c | 1 | ||||
-rw-r--r-- | src/text.h | 2 | ||||
-rw-r--r-- | src/utils.h | 4 | ||||
-rw-r--r-- | src/xkbcomp/rules.c | 2 | ||||
-rw-r--r-- | src/xkbcomp/symbols.c | 1 | ||||
-rw-r--r-- | src/xkbcomp/xkbcomp-priv.h | 9 | ||||
-rw-r--r-- | test/common.c | 5 | ||||
-rw-r--r-- | test/context.c | 4 | ||||
-rw-r--r-- | test/filecomp.c | 5 | ||||
-rw-r--r-- | test/interactive.c | 4 | ||||
-rw-r--r-- | test/keyseq.c | 5 | ||||
-rw-r--r-- | test/keysym.c | 4 | ||||
-rw-r--r-- | test/log.c | 7 | ||||
-rw-r--r-- | test/rmlvo-to-kccgst.c | 2 | ||||
-rw-r--r-- | test/rules-file.c | 6 | ||||
-rw-r--r-- | test/rulescomp.c | 3 | ||||
-rw-r--r-- | test/test.h | 2 | ||||
-rw-r--r-- | xkbcommon/xkbcommon.h | 1 |
30 files changed, 223 insertions, 188 deletions
diff --git a/Makefile.am b/Makefile.am index b83d992..b3452e2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -66,17 +66,19 @@ libxkbcommon_la_SOURCES = \ src/atom.c \ src/atom.h \ src/context.c \ + src/context.h \ src/darray.h \ src/keymap-dump.c \ src/keysym.c \ + src/keysym.h \ src/keysym-utf.c \ src/list.h \ src/map.c \ + src/map.h \ src/state.c \ src/text.c \ src/text.h \ - src/utils.h \ - src/xkb-priv.h + src/utils.h BUILT_SOURCES = \ src/xkbcomp/parser.c \ @@ -70,6 +70,7 @@ * ********************************************************/ +#include "utils.h" #include "atom.h" struct atom_node { @@ -24,7 +24,9 @@ #ifndef ATOM_H #define ATOM_H -#include "xkb-priv.h" +typedef uint32_t xkb_atom_t; + +#define XKB_ATOM_NONE 0 struct atom_table; diff --git a/src/context.c b/src/context.c index b116884..6710fe2 100644 --- a/src/context.c +++ b/src/context.c @@ -28,12 +28,30 @@ #include <sys/stat.h> #include <ctype.h> #include <errno.h> -#include <stdarg.h> -#include <stdio.h> #include <unistd.h> -#include "xkb-priv.h" -#include "atom.h" +#include "xkbcommon/xkbcommon.h" +#include "utils.h" +#include "context.h" + +struct xkb_context { + int refcnt; + + ATTR_PRINTF(3, 0) void (*log_fn)(struct xkb_context *ctx, + enum xkb_log_level level, + const char *fmt, va_list args); + enum xkb_log_level log_level; + int log_verbosity; + void *user_data; + + darray(char *) includes; + darray(char *) failed_includes; + + /* xkbcomp needs to assign sequential IDs to XkbFile's it creates. */ + unsigned file_id; + + struct atom_table *atom_table; +}; /** * Append one directory to the context's include path. diff --git a/src/context.h b/src/context.h new file mode 100644 index 0000000..1a87815 --- /dev/null +++ b/src/context.h @@ -0,0 +1,99 @@ +/* + * Copyright © 2012 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Author: Daniel Stone <daniel@fooishbar.org> + */ + +#ifndef CONTEXT_H +#define CONTEXT_H + +#include "atom.h" + +unsigned +xkb_context_take_file_id(struct xkb_context *ctx); + +unsigned int +xkb_context_num_failed_include_paths(struct xkb_context *ctx); + +const char * +xkb_context_failed_include_path_get(struct xkb_context *ctx, + unsigned int idx); + +/* + * Returns XKB_ATOM_NONE if @string was not previously interned, + * otherwise returns the atom. + */ +xkb_atom_t +xkb_atom_lookup(struct xkb_context *ctx, const char *string); + +xkb_atom_t +xkb_atom_intern(struct xkb_context *ctx, const char *string); + +/** + * If @string is dynamically allocated, free'd immediately after + * being interned, and not used afterwards, use this function + * instead of xkb_atom_intern to avoid some unnecessary allocations. + * The caller should not use or free the passed in string afterwards. + */ +xkb_atom_t +xkb_atom_steal(struct xkb_context *ctx, char *string); + +char * +xkb_atom_strdup(struct xkb_context *ctx, xkb_atom_t atom); + +const char * +xkb_atom_text(struct xkb_context *ctx, xkb_atom_t atom); + +ATTR_PRINTF(3, 4) void +xkb_log(struct xkb_context *ctx, enum xkb_log_level level, + const char *fmt, ...); + +#define xkb_log_cond_level(ctx, level, ...) do { \ + if (xkb_get_log_level(ctx) >= (level)) \ + xkb_log((ctx), (level), __VA_ARGS__); \ +} while (0) + +#define xkb_log_cond_verbosity(ctx, level, vrb, ...) do { \ + if (xkb_get_log_verbosity(ctx) >= (vrb)) \ + xkb_log_cond_level((ctx), (level), __VA_ARGS__); \ +} while (0) + +/* + * The format is not part of the argument list in order to avoid the + * "ISO C99 requires rest arguments to be used" warning when only the + * format is supplied without arguments. Not supplying it would still + * result in an error, though. + */ +#define log_dbg(ctx, ...) \ + xkb_log_cond_level((ctx), XKB_LOG_LEVEL_DEBUG, __VA_ARGS__) +#define log_info(ctx, ...) \ + xkb_log_cond_level((ctx), XKB_LOG_LEVEL_INFO, __VA_ARGS__) +#define log_warn(ctx, ...) \ + xkb_log_cond_level((ctx), XKB_LOG_LEVEL_WARNING, __VA_ARGS__) +#define log_err(ctx, ...) \ + xkb_log_cond_level((ctx), XKB_LOG_LEVEL_ERROR, __VA_ARGS__) +#define log_wsgo(ctx, ...) \ + xkb_log_cond_level((ctx), XKB_LOG_LEVEL_CRITICAL, __VA_ARGS__) +#define log_vrb(ctx, vrb, ...) \ + xkb_log_cond_verbosity((ctx), XKB_LOG_LEVEL_WARNING, (vrb), __VA_ARGS__) + +#endif diff --git a/src/keymap-dump.c b/src/keymap-dump.c index e913f60..f3ff1ed 100644 --- a/src/keymap-dump.c +++ b/src/keymap-dump.c @@ -49,12 +49,7 @@ * Author: Daniel Stone <daniel@fooishbar.org> */ -#include <stdarg.h> -#include <stdio.h> -#include <ctype.h> -#include <stdlib.h> - -#include "xkb-priv.h" +#include "map.h" #include "text.h" #define VMOD_HIDE_VALUE 0 diff --git a/src/keysym-utf.c b/src/keysym-utf.c index 66de078..ed18035 100644 --- a/src/keysym-utf.c +++ b/src/keysym-utf.c @@ -34,7 +34,7 @@ * This software is in the public domain. Share and enjoy! * */ -#include <stdint.h> + #include "xkbcommon/xkbcommon.h" #include "utils.h" diff --git a/src/keysym.c b/src/keysym.c index 1c95194..da1d219 100644 --- a/src/keysym.c +++ b/src/keysym.c @@ -47,12 +47,10 @@ * DEALINGS IN THE SOFTWARE. */ -#include <stdlib.h> -#include <stdio.h> -#include <string.h> - -#include "xkb-priv.h" +#include "xkbcommon/xkbcommon.h" +#include "utils.h" #include "ks_tables.h" +#include "keysym.h" XKB_EXPORT void xkb_keysym_get_name(xkb_keysym_t ks, char *buffer, size_t size) diff --git a/src/keysym.h b/src/keysym.h new file mode 100644 index 0000000..6f2280b --- /dev/null +++ b/src/keysym.h @@ -0,0 +1,62 @@ +/* + * Copyright 1985, 1987, 1990, 1998 The Open Group + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the names of the authors or their + * institutions shall not be used in advertising or otherwise to promote the + * sale, use or other dealings in this Software without prior written + * authorization from the authors. + */ + +/* + * Copyright © 2009 Dan Nicholson + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifndef KEYSYM_H +#define KEYSYM_H + +bool +xkb_keysym_is_lower(xkb_keysym_t keysym); + +bool +xkb_keysym_is_upper(xkb_keysym_t keysym); + +bool +xkb_keysym_is_keypad(xkb_keysym_t keysym); + +#endif @@ -50,7 +50,7 @@ * * ********************************************************/ -#include "xkb-priv.h" +#include "map.h" #include "text.h" struct xkb_keymap * diff --git a/src/xkb-priv.h b/src/map.h index dfb2645..b770504 100644 --- a/src/xkb-priv.h +++ b/src/map.h @@ -78,21 +78,15 @@ * Dan Nicholson <dbn.lists@gmail.com> */ -#ifndef XKB_PRIV_H -#define XKB_PRIV_H - -#include <stdbool.h> -#include <string.h> -#include <strings.h> +#ifndef MAP_H +#define MAP_H #include "xkbcommon/xkbcommon.h" #include "utils.h" -#include "darray.h" +#include "context.h" typedef uint32_t xkb_level_index_t; -typedef uint32_t xkb_atom_t; -#define XKB_ATOM_NONE 0 #define XKB_LEVEL_INVALID 0xffffffff #define XKB_KEY_NAME_LENGTH 4 @@ -103,35 +97,6 @@ typedef uint32_t xkb_atom_t; #define XKB_NUM_VIRTUAL_MODS 16 #define XKB_NUM_CORE_MODS 8 -struct xkb_context { - int refcnt; - - ATTR_PRINTF(3, 0) void (*log_fn)(struct xkb_context *ctx, - enum xkb_log_level level, - const char *fmt, va_list args); - enum xkb_log_level log_level; - int log_verbosity; - void *user_data; - - darray(char *) includes; - darray(char *) failed_includes; - - /* xkbcomp needs to assign sequential IDs to XkbFile's it creates. */ - unsigned file_id; - - struct atom_table *atom_table; -}; - -/** - * Legacy names for the components of an XKB keymap, also known as KcCGST. - */ -struct xkb_component_names { - char *keycodes; - char *types; - char *compat; - char *symbols; -}; - enum xkb_action_type { ACTION_TYPE_NONE = 0, ACTION_TYPE_MOD_SET, @@ -465,31 +430,6 @@ XkbKeyActionEntry(const struct xkb_key *key, xkb_group_index_t group, struct xkb_keymap * xkb_map_new(struct xkb_context *ctx); -/* - * Returns XKB_ATOM_NONE if @string was not previously interned, - * otherwise returns the atom. - */ -xkb_atom_t -xkb_atom_lookup(struct xkb_context *ctx, const char *string); - -xkb_atom_t -xkb_atom_intern(struct xkb_context *ctx, const char *string); - -/** - * If @string is dynamically allocated, free'd immediately after - * being interned, and not used afterwards, use this function - * instead of xkb_atom_intern to avoid some unnecessary allocations. - * The caller should not use or free the passed in string afterwards. - */ -xkb_atom_t -xkb_atom_steal(struct xkb_context *ctx, char *string); - -char * -xkb_atom_strdup(struct xkb_context *ctx, xkb_atom_t atom); - -const char * -xkb_atom_text(struct xkb_context *ctx, xkb_atom_t atom); - xkb_group_index_t xkb_key_get_group(struct xkb_state *state, const struct xkb_key *key); @@ -497,62 +437,10 @@ xkb_level_index_t xkb_key_get_level(struct xkb_state *state, const struct xkb_key *key, xkb_group_index_t group); -extern int +int xkb_key_get_syms_by_level(struct xkb_keymap *keymap, const struct xkb_key *key, xkb_group_index_t group, xkb_level_index_t level, const xkb_keysym_t **syms_out); -extern unsigned -xkb_context_take_file_id(struct xkb_context *ctx); - -unsigned int -xkb_context_num_failed_include_paths(struct xkb_context *ctx); - -const char * -xkb_context_failed_include_path_get(struct xkb_context *ctx, - unsigned int idx); - -bool -xkb_keysym_is_lower(xkb_keysym_t keysym); - -bool -xkb_keysym_is_upper(xkb_keysym_t keysym); - -bool -xkb_keysym_is_keypad(xkb_keysym_t keysym); - -ATTR_PRINTF(3, 4) void -xkb_log(struct xkb_context *ctx, enum xkb_log_level level, - const char *fmt, ...); - -#define xkb_log_cond_level(ctx, level, ...) do { \ - if (xkb_get_log_level(ctx) >= (level)) \ - xkb_log((ctx), (level), __VA_ARGS__); \ -} while (0) - -#define xkb_log_cond_verbosity(ctx, level, vrb, ...) do { \ - if (xkb_get_log_verbosity(ctx) >= (vrb)) \ - xkb_log_cond_level((ctx), (level), __VA_ARGS__); \ -} while (0) - -/* - * The format is not part of the argument list in order to avoid the - * "ISO C99 requires rest arguments to be used" warning when only the - * format is supplied without arguments. Not supplying it would still - * result in an error, though. - */ -#define log_dbg(ctx, ...) \ - xkb_log_cond_level((ctx), XKB_LOG_LEVEL_DEBUG, __VA_ARGS__) -#define log_info(ctx, ...) \ - xkb_log_cond_level((ctx), XKB_LOG_LEVEL_INFO, __VA_ARGS__) -#define log_warn(ctx, ...) \ - xkb_log_cond_level((ctx), XKB_LOG_LEVEL_WARNING, __VA_ARGS__) -#define log_err(ctx, ...) \ - xkb_log_cond_level((ctx), XKB_LOG_LEVEL_ERROR, __VA_ARGS__) -#define log_wsgo(ctx, ...) \ - xkb_log_cond_level((ctx), XKB_LOG_LEVEL_CRITICAL, __VA_ARGS__) -#define log_vrb(ctx, vrb, ...) \ - xkb_log_cond_verbosity((ctx), XKB_LOG_LEVEL_WARNING, (vrb), __VA_ARGS__) - -#endif /* XKB_PRIV_H */ +#endif diff --git a/src/state.c b/src/state.c index 2776506..14a95af 100644 --- a/src/state.c +++ b/src/state.c @@ -59,10 +59,7 @@ * - messages (very unlikely) */ -#include <assert.h> -#include <stdarg.h> - -#include "xkb-priv.h" +#include "map.h" struct xkb_filter { union xkb_action action; @@ -24,6 +24,7 @@ * ********************************************************/ +#include "map.h" #include "text.h" bool @@ -24,8 +24,6 @@ #ifndef TEXT_H #define TEXT_H -#include "xkb-priv.h" - typedef struct { const char *name; unsigned int value; diff --git a/src/utils.h b/src/utils.h index 6f5233b..9f0505c 100644 --- a/src/utils.h +++ b/src/utils.h @@ -24,8 +24,12 @@ #ifndef UTILS_H #define UTILS_H 1 +#include <inttypes.h> #include <stdbool.h> #include <string.h> +#include <strings.h> + +#include "darray.h" /* * We sometimes malloc strings and then expose them as const char*'s. This diff --git a/src/xkbcomp/rules.c b/src/xkbcomp/rules.c index cd4c1a3..badbbf2 100644 --- a/src/xkbcomp/rules.c +++ b/src/xkbcomp/rules.c @@ -47,8 +47,6 @@ * DEALINGS IN THE SOFTWARE. */ -#include <stdarg.h> -#include <stdio.h> #include <ctype.h> #include <fcntl.h> #include <unistd.h> diff --git a/src/xkbcomp/symbols.c b/src/xkbcomp/symbols.c index fce0dd3..9c4fb1c 100644 --- a/src/xkbcomp/symbols.c +++ b/src/xkbcomp/symbols.c @@ -58,6 +58,7 @@ #include "vmod.h" #include "keycodes.h" #include "include.h" +#include "keysym.h" enum key_repeat { KEY_REPEAT_UNDEFINED = 0, diff --git a/src/xkbcomp/xkbcomp-priv.h b/src/xkbcomp/xkbcomp-priv.h index 6175f69..a06b4d4 100644 --- a/src/xkbcomp/xkbcomp-priv.h +++ b/src/xkbcomp/xkbcomp-priv.h @@ -27,9 +27,16 @@ #ifndef XKBCOMP_PRIV_H #define XKBCOMP_PRIV_H -#include "xkb-priv.h" +#include "map.h" #include "ast.h" +struct xkb_component_names { + char *keycodes; + char *types; + char *compat; + char *symbols; +}; + bool XkbParseFile(struct xkb_context *ctx, FILE *file, const char *file_name, XkbFile **out); diff --git a/test/common.c b/test/common.c index 3049555..372c642 100644 --- a/test/common.c +++ b/test/common.c @@ -30,17 +30,12 @@ * Ran Benita <ran234@gmail.com> */ -#include <assert.h> -#include <stdlib.h> -#include <stdio.h> -#include <string.h> #include <limits.h> #include <fcntl.h> #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> -#include "xkbcommon/xkbcommon.h" #include "test.h" const char * diff --git a/test/context.c b/test/context.c index d6acd05..e151dd0 100644 --- a/test/context.c +++ b/test/context.c @@ -23,10 +23,8 @@ * Author: Daniel Stone <daniel@fooishbar.org> */ -#include <assert.h> - -#include "xkbcommon/xkbcommon.h" #include "test.h" +#include "context.h" int main(void) diff --git a/test/filecomp.c b/test/filecomp.c index c3a425c..dca4fe5 100644 --- a/test/filecomp.c +++ b/test/filecomp.c @@ -21,11 +21,6 @@ * DEALINGS IN THE SOFTWARE. */ -#include <assert.h> -#include <stdio.h> -#include <stdlib.h> - -#include "xkbcommon/xkbcommon.h" #include "test.h" static int diff --git a/test/interactive.c b/test/interactive.c index d132d15..332f57c 100644 --- a/test/interactive.c +++ b/test/interactive.c @@ -28,9 +28,6 @@ #include <limits.h> #include <locale.h> #include <signal.h> -#include <stdbool.h> -#include <stdio.h> -#include <stdlib.h> #include <string.h> #include <sysexits.h> #include <unistd.h> @@ -38,7 +35,6 @@ #include <sys/epoll.h> #include <linux/input.h> -#include "xkbcommon/xkbcommon.h" #include "test.h" struct keyboard { diff --git a/test/keyseq.c b/test/keyseq.c index c7d0918..33510c3 100644 --- a/test/keyseq.c +++ b/test/keyseq.c @@ -21,13 +21,8 @@ * DEALINGS IN THE SOFTWARE. */ -#include <assert.h> -#include <stdarg.h> -#include <stdio.h> - #include <linux/input.h> -#include "xkbcommon/xkbcommon.h" #include "test.h" enum { diff --git a/test/keysym.c b/test/keysym.c index ba22d55..1bf704b 100644 --- a/test/keysym.c +++ b/test/keysym.c @@ -21,10 +21,6 @@ * DEALINGS IN THE SOFTWARE. */ -#include <assert.h> -#include <stdio.h> -#include <stdlib.h> - #include "test.h" static int @@ -21,13 +21,8 @@ * DEALINGS IN THE SOFTWARE. */ -#include <assert.h> -#include <stdarg.h> -#include <stdio.h> -#include <stdlib.h> - #include "test.h" -#include "xkb-priv.h" +#include "context.h" #pragma GCC diagnostic ignored "-Wmissing-format-attribute" diff --git a/test/rmlvo-to-kccgst.c b/test/rmlvo-to-kccgst.c index ec2c0c4..338cbb8 100644 --- a/test/rmlvo-to-kccgst.c +++ b/test/rmlvo-to-kccgst.c @@ -24,7 +24,7 @@ #include <unistd.h> #include "test.h" -#include "xkb-priv.h" +#include "xkbcomp-priv.h" #include "rules.h" int diff --git a/test/rules-file.c b/test/rules-file.c index 5ddd074..b2091de 100644 --- a/test/rules-file.c +++ b/test/rules-file.c @@ -21,14 +21,10 @@ * DEALINGS IN THE SOFTWARE. */ -#include <assert.h> -#include <stdbool.h> -#include <stdio.h> -#include <string.h> #include <time.h> #include "test.h" -#include "xkb-priv.h" +#include "xkbcomp-priv.h" #include "rules.h" #define BENCHMARK_ITERATIONS 20000 diff --git a/test/rulescomp.c b/test/rulescomp.c index 3b4de26..5457d00 100644 --- a/test/rulescomp.c +++ b/test/rulescomp.c @@ -21,11 +21,8 @@ * DEALINGS IN THE SOFTWARE. */ -#include <assert.h> -#include <stdio.h> #include <time.h> -#include "xkbcommon/xkbcommon.h" #include "test.h" #define BENCHMARK_ITERATIONS 1000 diff --git a/test/test.h b/test/test.h index a3fdee0..2a9b0fa 100644 --- a/test/test.h +++ b/test/test.h @@ -23,6 +23,8 @@ * Author: Daniel Stone <daniel@fooishbar.org> */ +#include <assert.h> + #include "xkbcommon/xkbcommon.h" #include "utils.h" diff --git a/xkbcommon/xkbcommon.h b/xkbcommon/xkbcommon.h index 8c6ab72..f741837 100644 --- a/xkbcommon/xkbcommon.h +++ b/xkbcommon/xkbcommon.h @@ -80,7 +80,6 @@ #ifndef _XKBCOMMON_H_ #define _XKBCOMMON_H_ -#include <stddef.h> #include <stdint.h> #include <stdio.h> #include <stdarg.h> |