summaryrefslogtreecommitdiff
path: root/src/context-priv.c
AgeCommit message (Collapse)AuthorFilesLines
2023-09-24Messages: merge macros with and without message codePierre Le Marre1-0/+1
Previously we had two types of macros for logging: with and without message code. They were intended to be merged afterwards. The idea is to use a special code – `XKB_LOG_MESSAGE_NO_ID = 0` – that should *not* be displayed. But we would like to avoid checking this special code at run time. This is achieved using macro tricks; they are detailed in the code (see: `PREPEND_MESSAGE_ID`). Now it is also easier to spot the remaining undocumented log entries: just search `XKB_LOG_MESSAGE_NO_ID`.
2023-05-13Add warning when RMLVO with no layout but variant setPierre Le Marre1-0/+10
There is no feedback that they are both replaced with default values. Fix it by adding a warning informing about missing layout and show the defaults for both.
2022-12-16context: add XKB_CONTEXT_NO_SECURE_GETENV flag (#312)Ronan Pigott1-6/+16
This flag is useful for clients that may have relatively benign capabilities set, like CAP_SYS_NICE, that also want to use the xkb configuration from the environment and user configs in XDG_CONFIG_HOME. Fixes: https://github.com/xkbcommon/libxkbcommon/issues/308 Fixes: https://github.com/xkbcommon/libxkbcommon/issues/129 Signed-off-by: Ran Benita <ran@unusedvar.com>
2020-07-08meson.build: always set the default variants/optionsPeter Hutterer1-8/+0
Make this more balanced with the rules/layouts so we can rely on that #define to exist. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-12-28MSVC: Use <io.h> as an alternative for <unistd.h>Adrian Perez de Castro1-1/+0
Only the input/output functions from <unistd.h> options are used, so using <io.h> when building with MSVC should be enough. The inclusion of the header in context-priv.c does not seem to be needed (tested on GNU/Linux) and so it is removed. Signed-off-by: Ran Benita <ran@unusedvar.com>
2019-12-27build: include config.h manuallyRan Benita1-0/+2
Previously we included it with an `-include` compiler directive. But that's not portable. And it's better to be explicit anyway. Every .c file should have `include "config.h"` first thing. Signed-off-by: Ran Benita <ran@unusedvar.com>
2019-11-09atom: combine atom_intern() and atom_lookup()Ran Benita1-2/+2
Use an "add" bool parameter instead. This simplifies the code a bit. Signed-off-by: Ran Benita <ran@unusedvar.com>
2019-11-08parser: get rid of "stealing" atomsRan Benita1-7/+1
This requires (well, at least implemented by) casting away `const` which is undefined behavior, and clang started to warn about it. The micro optimization didn't save too many allocations, anyway. Signed-off-by: Ran Benita <ran@unusedvar.com>
2014-02-10context: add xkb_context_sanitize_rule_names()Ran Benita1-5/+24
We want all the default logic in a test, so encapsulate it in this function, and make all the get_default_* functions static. Signed-off-by: Ran Benita <ran234@gmail.com>
2014-02-10context: fix wrong VARIANT instead of LAYOUT getenvRan Benita1-1/+1
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-02-04Use secure_getenv when availableRan Benita1-6/+6
We probably don't want to get a privileged process to compile arbitrary keymaps. So we should be careful about the envvars which control include paths or default RMLVOs. But then secure_getenv is more sensible for everything we do. Signed-off-by: Ran Benita <ran234@gmail.com>
2014-01-13context: split private functions to context-priv.cRan Benita1-0/+171
(Same as keymap-priv.c). Signed-off-by: Ran Benita <ran234@gmail.com>