From 2a0f1780f97077ffd2cff7683cb31b352b041944 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Tue, 8 May 2012 17:52:45 +0100 Subject: [PATCH] Add context flag to inhibit default include paths Which will make the context start with no include paths at all. Signed-off-by: Daniel Stone --- include/xkbcommon/xkbcommon.h | 4 ++-- src/context.c | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/xkbcommon/xkbcommon.h b/include/xkbcommon/xkbcommon.h index 31570f2..0527143 100644 --- a/include/xkbcommon/xkbcommon.h +++ b/include/xkbcommon/xkbcommon.h @@ -194,8 +194,8 @@ xkb_string_to_keysym(const char *s); */ enum xkb_context_flags { - /** Apparently you can't have empty enums. What a drag. */ - XKB_CONTEXT_PLACEHOLDER = 0, + /** Create this context with an empty include path. */ + XKB_CONTEXT_NO_DEFAULT_INCLUDES = 1, }; /** diff --git a/src/context.c b/src/context.c index 39c1326..2aaee35 100644 --- a/src/context.c +++ b/src/context.c @@ -186,7 +186,8 @@ xkb_context_new(enum xkb_context_flags flags) context->refcnt = 1; - if (!xkb_context_include_path_append_default(context)) { + if (!(flags & XKB_CONTEXT_NO_DEFAULT_INCLUDES) && + !xkb_context_include_path_append_default(context)) { xkb_context_unref(context); return NULL; }