src/context.c


Log

Author Commit Date CI Message
Ran Benita d0288bb2 2012-05-22T00:37:53 context: use darray for include paths Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 75ff2cef 2012-05-13T18:45:43 Various static analyzer fixes Signed-off-by: Ran Benita <ran234@gmail.com>
Pekka Paalanen 8bdef139 2012-05-15T15:23:41 Use eaccess() only if available Fixes build on Android. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Daniel Stone 7b00485a 2012-05-11T15:03:43 Rename 'ctx' back to 'context' in external API Still keep things as 'ctx' internally so we don't have to worry about typing it too often, but rename the user-visible API back as it was kinda ugly. This partially reverts e7bb1e5f. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Ran Benita e7bb1e5f 2012-05-09T15:03:11 Shorten context to ctx (This breaks the API.) "context" is really annoying to type all the time (and we're going to type it a lot more :). "ctx" is clear, concise and common in many other libraries. Use it! Signed-off-by: Ran Benita <ran234@gmail.com> [daniels: Fix for xkb -> keymap change.]
Ran Benita 699a0b84 2012-05-09T14:02:26 Contextualize the atom table Each context gets its own table, i.e. interning a string in one context does not affect any other context. The existing xkb_atom_* functions are turned into wrappers around a new standalone atom_table object. Signed-off-by: Ran Benita <ran234@gmail.com> [daniels: Updated for xkb -> keymap.]
Ran Benita 4aef083e 2012-05-09T11:29:04 Contextualize XkbFile IDs Currently the IDs are assigned from a static variable inside CreateXKBFile. This can lead to some unpleasantness with threads, so maintain the counter in the context instead. Signed-off-by: Ran Benita <ran234@gmail.com>
Daniel Stone 2a0f1780 2012-05-08T17:52:45 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 <daniel@fooishbar.org>
Daniel Stone c3584280 2012-05-08T17:51:16 Add flags to context creation None defined as yet, but why not. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Ran Benita b610b2b9 2012-05-08T14:52:23 Rename XKBcommonint.h to xkb-priv.h and use it Make the files in the src/* directory use their own header or a consilidated private header. This makes the file dependencies clearer. Also drop the pointless "xkb" file name prefix, add split a few declarations to their own files (atom.h and text.h). Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 5eb0a70e 2012-05-07T14:44:30 Don't use typeof clang complains with the xorg-macros warning flags: src/context.c:58:36: error: extension used [-Werror,-pedantic,-Wlanguage-extension-token] typeof(new_paths)); This was not entirely correct, too. So bring back the casts to the results of the allocation macros; might as well make them a bit more type safe. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 8fbd44fd 2012-04-06T03:12:50 Implicitly include config.h in all files The definitions in config.h should be available in all files an implementation detail; it can be included through the build system instead of having each file pull it every time. This is especially helpful with AC_USE_SYSTEM_EXTENSIONS, as _GNU_SOURCE and friends can have an effect by merely being defined, which can lead to some confusion if its effective for only half the files. And we don't really support a build _without_ config.h; so, one less thing to worry about. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 18e6a6a4 2012-04-05T10:47:43 Remove Xfuncproto.h and XKB.h from xkbcommon/xkbcommon.h The kbproto header is already not needed here anymore. Move the _X_EXPORT's to the corresponding function definitions, and use straight extern "C" clauses instead of _XFUNCPROTOBEGIN/END. It also makes more sense to have the EXPORT's in the source files, as it provides some documentation to the reader, whereas in the header it's obvious. Signed-off-by: Ran Benita <ran234@gmail.com> [daniels: Updated for xkb_keymap changes.]
Ran Benita 467d7bb6 2012-04-05T10:13:24 Implement missing xkb_state_ref and add return value xkb_state_ref was missing. Also modify the _ref functions to return the object instead of being void. This is a useful idiom: struct my_object my_object_new(struct xkb_state *state) { [...] my_object->state = xkb_state_ref(state); [...] } Essentially "taking" a reference, such that you don't forget to increment it and it's one line less (see example in our own code). A case could also be made for _unref to return the object or NULL, but this is quite uncommon. Signed-off-by: Ran Benita <ran234@gmail.com> [daniels: Updated for xkb_keymap changes.]
Daniel Stone 632d9f03 2012-04-03T14:26:04 Eliminate remaining gcc warnings Various one-liners (mostly removing unused variables) to make the code safe for the full set of warnings used by the xorg macros. On Debian-based systems, flex generates incorrect code resulting in two warnings about yy_getcolumn and yy_setcolumn having no previous declaration despite being non-static. Fedora carries a patch to fix this, and a bug has been filed on Debian's flex to add the patch: http://bugs.debian.org/667027 Aside from this, it's now safe for --enable-strict-compilation. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Daniel Stone aa9f2bf9 2012-03-29T01:41:40 Don't leak include_paths in context Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Daniel Stone 034ffce6 2012-03-27T17:22:35 Use xkb_contexts in keymap compilation Primarily for the include path, but also for the logging in future. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Daniel Stone 3e9dd751 2012-03-27T16:59:01 Add new context API Signed-off-by: Daniel Stone <daniel@fooishbar.org>