Log

Author Commit Date CI Message
Ran Benita 82ee45b3 2012-07-28T23:21:46 Use xkb_led_index_t throughout And use XKB_LED_INVALID instead of _LED_Unbound, which served the same purpose here. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 09dac54b 2012-08-01T21:31:36 vmod: remove unused fields Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 7c7e4341 2012-08-01T11:25:34 Use only one set of core mod name-to-index functions These were repeated 5 times. Note that this changes the ABI slightly: XKB_MOD_NAME_CAPS is changed from "Caps Lock" to "Lock", which is the ordinary legacy mod name for it. Since its hidden behind a #define, it's best to stay compatible with the old names (as I think was intended, given that "Mod1", etc. are the same). Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 6eb5929d 2012-07-28T23:31:08 README: s/xkb_desc/xkb_keymap Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita c6dee464 2012-08-01T11:12:18 map: fix incorrect return value Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita ae968f85 2012-08-01T11:01:21 map: fix virtual mod index calculation The current code made us miss vmod index 0. Also look at the code in vmod.c:LookupVModMask. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita d53fcf53 2012-08-02T21:36:30 keymap-dump: use SITextMatch text.c has the exact same function. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 80ab9f12 2012-08-02T23:40:31 keymap-dump: use ActionTypeText Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 20bef734 2012-08-02T20:55:12 keymap-dump: clean up write_buf function It would have been nice to use open_memstream here if it was portable enough (maybe someday it will?). Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 4c212753 2012-04-08T02:20:39 Add an interactive evdev test The program reads key events from evdev input devices, puts them through the library and prints some information about them. It's nice for experimenting, quick testing and trying to break it with random stuff (already found some!). It is called "interactive" for lack of a better name. It's a bit hackish, but can easily be extended, made more portable etc, in the future. Signed-off-by: Ran Benita <ran234@gmail.com> Conflicts: Makefile.am test/.gitignore
Ran Benita 41d9afc5 2012-07-27T15:31:03 Remove ExprResult Convert the IdentLookup typedef away from ExprResult, which drags along everything else. This should also make all of the conversions explicit. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 6917901f 2012-07-27T14:15:39 expr: remove support for evaluating string as integer As the comment nicely puts it, this is a bit weird. When you try to evaluate an expression of type string into an integer, what it does is: "" -> 0 "c" -> (ascii value, i.e. like a char literal) more than one char -> error The first one is obviously not very useful; why not just write 0? The second one might be useful (though I don't see where in a keymap it would be), but I don't think anyone would consider trying "X" for that anyway. A look through xkeyboard-config shows "" only used once as a string, and "X" also only used as strings (and mostly in geometry which we don't evaluate anyway). And I seriously doubt it's used (purposely) anywhere else. So remove it. Signed-off-by: Ran Benita <ran234@gmail.com>
Daniel Stone dd0f3c6d 2012-07-25T10:53:36 Don't create contexts with no include paths Clean up the return code handling from xkb_context_add_include_paths_default, and thus fail context creation if we can't add any of the default include paths, but were asked to. If this happens, dump the DFLT_XKB_CONFIG_ROOT out in the log message, so at least we know what we aren't looking at. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Daniel Stone ca7927ae 2012-07-25T10:55:06 context test: Use test_get_context() So we don't die if we haven't got a valid global include path. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Ran Benita 38614c88 2012-07-24T17:21:29 expr: drop ExprResult from ResolveMask Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita bd927abf 2012-07-24T19:39:59 expr: drop ExprResult from ResolveEnum Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 2e4933cd 2012-07-24T10:39:15 expr: drop ExprResult from ResolveInteger Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita d5682289 2012-07-24T01:22:26 expr: drop ExprResult from ResolveButton Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 6ec13570 2012-07-24T00:51:19 expr: drop ExprResult from ResolveLevel Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 000528dd 2012-07-24T00:23:34 expr: drop ExprResult from ResolveKeyCode Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita e258f9ee 2012-07-24T00:10:07 expr: drop ExprResult from ResolveGroup Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 70262292 2012-07-23T23:56:28 expr: drop ExprResult from ResolveKeysym Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 0d262fa1 2012-07-23T19:52:17 expr: drop ExprResult from ResolveBoolean Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 27f94929 2012-07-23T15:46:50 expr: drop ExprResult from ResolveString Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 025ca579 2012-07-23T12:20:05 expr: drop ExprResult from ResolveLhs Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 761b675c 2012-07-23T11:56:13 expr: drop ExprResult from ResolveKeyName Explicit is better than implicit, and this union makes it hard to follow what's what, particularly the confusion with ival/uval. The other Resolve functions will follow. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 01c81fa6 2012-07-25T21:37:20 parser: untabify Run vim's :%retab and some resulting indention fixes. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 724f62c8 2012-07-25T17:29:08 Convert defines to enums in xkbcomp.h For statement / expression types. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 35fb8b94 2012-07-27T01:47:32 Fix incorrect comparison ExprFieldRef goes into the ExprDef op field, not the type field. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 89723b7c 2012-07-24T19:54:14 utils: add/replace string equality macros It's more tidy and less error prone, since we use strcasecmp == 0 a lot. We replace strcmp == 0 by streq, strcasecmp == 0 by istreq, uStrCasePrefix by istreq_prefix and uDupString by strdup_safe. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 4f843c81 2012-07-24T13:24:59 Drop Xkbc prefix of text functions Not really needed and inconsistent. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 6cb98200 2012-07-24T13:15:40 Use xkb_mod_mask_t and xkb_mask_index_t throughout Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 74be1762 2012-07-23T21:30:28 Remove alloc.{c,h} These functions are more appropriate elsewhere now. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 13eb9c35 2012-07-23T17:41:55 scanner: don't strdup key names The key name is always XkbKeyNameLength (= 4) bytes, so we can maintain it directly in YYSTYPE union and copy when needed, instead of treating it like a full blown string and then copy. This means the scanner checks the length itself. rulescomp under valgrind, before: ==1038== total heap usage: 168,403 allocs, 168,403 frees, 9,732,648 bytes allocated after: ==9377== total heap usage: 155,643 allocs, 155,643 frees, 9,672,788 bytes allocated Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 112cccb1 2012-07-23T16:03:34 Some atom related optimizations We often get a strdup'd string, just to pass it over the atom_intern and then immediately free it. But atom_intern then strdup's it again (if it's not interned already); so instead we can have the interning "steal" the memory instead of allocing a new one and freeing the old one. This is done by a new xkb_atom_steal function. It also turns out, that every time we strdup an atom, we don't actually modify it afterwards. Since we are guaranteed that the atom table will live as long as the context, we can just use xkb_atom_text instead. This removes a some more dynamic allocations. For this change we had to remove the ability to append two strings, e.g. "foo" + "bar" -> "foobar" which is only possible with string literals. This is unused and quite useless for our purposes. xkb_atom_strdup is left unused, as it may still be useful. Running rulescomp in valgrind, Before: ==7907== total heap usage: 173,698 allocs, 173,698 frees, 9,775,973 bytes allocated After: ==6348== total heap usage: 168,403 allocs, 168,403 frees, 9,732,648 bytes allocated Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita c6279b8b 2012-07-23T21:21:03 expr: don't divide by zero Calculator parser 101. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 7662397f 2012-07-23T21:18:18 types: fix canonical types copying Without the re-initialization, the copying fails. This wasn't noticed because this code practically never gets executed with ordinary keymaps. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 3c580721 2012-07-23T16:22:20 keycodes: fix valgrind warnings ==7071== Conditional jump or move depends on uninitialised value(s) ==7071== at 0x40B6CB: AddIndicatorName (keycodes.c:148) ==7071== by 0x40C34F: MergeIncludedKeycodes (keycodes.c:420) ==7071== by 0x40C613: HandleIncludeKeycodes (keycodes.c:480) ==7071== by 0x40D022: HandleKeycodesFile (keycodes.c:733) ==7071== by 0x40D79F: CompileKeycodes (keycodes.c:881) ==7071== by 0x401E22: compile_keymap (xkbcomp.c:157) ==7071== by 0x402091: xkb_map_new_from_kccgst (xkbcomp.c:229) ==7071== by 0x40216A: xkb_map_new_from_names (xkbcomp.c:254) ==7071== by 0x4046F5: test_compile_rules (common.c:164) ==7071== by 0x4015C1: test_rmlvo (rulescomp.c:44) ==7071== by 0x40180D: main (rulescomp.c:98) Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita d4eee861 2012-07-23T11:25:32 parse: remove unused #define Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 2e245a9a 2012-07-23T11:42:22 expr: Remove ExprResolveFloat Remnant from geometry. Signed-off-by: Ran Benita <ran234@gmail.com>
Daniel Stone 9bd55b55 2012-07-23T23:10:07 makekeys: Add top_srcdir to include path Fixes distcheck with no /usr/include/xkbcommon. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Ran Benita 3dc1252d 2012-07-22T19:38:14 Add test for logging functionality Just to make sure everything works properly. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 2c30fa7a 2012-07-21T16:10:17 Remove old logging leftovers Everything has been converted. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 70e3e7e5 2012-07-21T15:39:18 xkbcomp: use new log functions Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita f48ee2d2 2012-07-21T15:44:48 parse: use new log functions Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 8e395803 2012-07-21T15:37:33 path: use new log functions Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 885f6c8c 2012-07-21T15:35:17 misc: use new log functions Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 544a83e6 2012-07-21T15:27:09 vmod: use new log functions Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 3bb3e9c3 2012-07-21T15:19:27 rules: use new log functions Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita d659f2b4 2012-07-21T15:12:31 expr: use new log functions Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita e037f518 2012-07-21T14:53:49 action: use new log functions Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 87444fb9 2012-07-21T02:08:14 types: use new log functions Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 5e164ff1 2012-07-23T00:41:27 build: drop the include/ directory The include/ dir is somewhat redundant and makes it just a bit harder to handle the -I directives from out side of automake; without it the default $(top_buildir) just works. Here's also some further justifications I found: http://smcv.pseudorandom.co.uk/2008/09/pc-uninstalled/ Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 36df40c3 2012-07-21T02:03:25 types: add keymap to KeyTypesInfo Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 8e62b368 2012-07-21T01:35:46 compat: use new log functions Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 270ff8ad 2012-07-21T01:31:10 compat: add keymap to CompatInfo Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 7dc51ea8 2012-07-21T00:58:25 symbols: use new log functions Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 7ef64813 2012-07-21T00:50:18 symbols: add keymap to SymbolsInfo and use it. Also make sure info is the first argument to the functions in this file. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 0ae1199a 2012-07-20T19:38:36 keycodes: use new log functions Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 37579ce9 2012-07-20T18:27:37 keycodes: add keymap to KeyNamesInfo and let the info always be the first argument to the various functions, just for consistency (and it acting as the contex for this file). Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 70f35cfb 2012-07-20T13:10:13 Add logging API Add new public API to provide the library users with some options to control and customize the logging output from the library. It is based upon the skeleton from the libabc demo libray: https://git.kernel.org/?p=linux/kernel/git/kay/libabc.git which is public domain and works pretty well. This requires passing in the context object in every logging call, and thus the conversion is done file by file. We also remove the global warningLevel variable in favor of a verbosity level in the context, which can be set by the user and is silent by default. One issue is the ACTION calls, which, while nice, do not play very well with line- and priority-based logging, and would require some line continuation handling or keeping state or some other compromise. So instead remove these and just inline them with their respective warning/error. So instead of: ERROR("Memory allocation failed\n") ACTION("Removing all files on hardisk\n") its something like that: log_err("Memory allocation failed; Removing all files on harddisk\n") Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 71c2f2e0 2012-07-20T17:20:35 utils: replace FATAL by malloc_or_die "Out of memory" is enough in this case. If we want to be OOM-safe this makes it clear where to begin. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 58f8d2c1 2012-07-20T17:09:49 utils: remove Xfuncproto.h and use our own macros Add XKB_EXPORT to replace _X_EXPORT, and copy the definitions of _X_ATTRIBUTE_FOO as ATTR_FOO. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 8b0e9f92 2012-07-20T13:07:30 utils: remove uTypedAlloc/Calloc Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 2fc0ad50 2012-07-20T12:48:13 Fix bison 2.6 and clang warnings Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita db98696d 2012-07-17T17:08:14 Remove CommonInfo Not used by anything anymore. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 250c925c 2012-07-17T17:05:28 types: use list instead of CommonInfo for KeyTypeInfo Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 85826c3c 2012-07-18T17:53:27 Simplify HandleInclude functions Instead of special casing the first include, process it inside the loop as well. It works perfectly fine. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 861e6a17 2012-07-18T16:30:55 Remove haveSelf include feature When including a file from another file, its possible to do something like this: include "+some(other)+files" with the "+" or "|" in the beginning. What will happen then is that instead of processing the include files separately and then merging into the existing info, we instead start with the existing info and merge into it as we go, as if it was written explicitly before the first "+". It's not particulary clear what this may be useful for. Since it's not used by xkeyboard-config, not documented anywhere (and google doesn't bring up anything), completely untested and kind of ugly, remove this "feature". It most likely never been used. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 730c2bc3 2012-07-17T15:50:24 types: use list instead of CommonInfo in PreserveInfo Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 85abd36b 2012-07-17T15:39:27 types: move global static tok_ atoms into KeyTypesInfo The atoms are context-dependent. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 119c952b 2012-07-17T00:53:07 compat: use list instead of CommonInfo in LEDInfo Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 50b25a12 2012-07-17T11:03:43 Use xkb_group_index_t for group variables throughout Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 8237e9c7 2012-07-17T11:56:00 Remove _X_EXPORT from xkb_key_get_group/level We should add them to xkbcommon.h if they need to. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita e21fc886 2012-07-17T00:43:59 compat: use list instead of CommonInfo in SymInterpInfo Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita ba4320f7 2012-07-16T22:45:16 Move indicators.c code into compat.c It is only used there. Allows some refactoring. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita dfa0929c 2012-07-16T22:15:43 Convert macros to inline functions Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 3fbf4ce3 2012-07-16T21:28:25 keycodes: use list instead of CommonInfo in IndicatorNameInfo Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 4bf987e5 2012-07-16T21:25:00 keycodes: use list instead of CommonInfo in AliasInfo Always pass around the KeyNamesInfo which contains the list head. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita cc8b0682 2012-07-16T17:53:46 Move alias.c functions into keycodes.c They are only used in this file. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita cf4f170b 2012-07-16T11:24:48 symbols: don't use CommonInfo in KeyInfo Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita ebb4d59c 2012-07-16T11:09:03 symbols: use list for ModMapEntry's Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita b6e2a56d 2012-07-16T11:06:33 Add common linked list implementation Taken from xserver/include/list.h. The changes made are: * Drop the xorg_ prefix and some typedef from the end. * Rename _for_each_entry macros to just _foreach (like darray). * Rename list_is_empty to list_empty (like darray). * Add a list_replace function which we use later. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 0a6f9ccd 2012-07-16T10:15:53 symbols: remove alias info It's never used - all of the aliases are added in the keycodes section. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita d0097f4e 2012-07-15T15:55:34 Pass around xkb_key's instead of keycodes This way we don't need to look up the key every time. We now only deal with keycodes in the public API and in keycodes.c. Also adds an xkb_foreach_key macro, which is used a lot. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 35a93b8e 2012-07-15T14:35:57 map: verifiy that the keycode is legal In case someone passes in a bad keycode. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 091a0542 2012-07-15T14:24:54 Remove redundant keymap->keys resizes The size (i.e. max_keycode) is determined in the keycodes section, which gets compiled first. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita ad8875c5 2012-07-15T14:02:36 Remove GroupsWidth macro Use key->width directly instead. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita c705a82d 2012-07-17T11:51:32 Remove unused 'groupInfo' in KeyTypeInfo Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 4ccb0ef5 2012-07-15T13:51:34 Get rid of group_info This is 8 bits which hold how many groups the key has, what to do the key group is out of bound and the group to redirect to if want to. This may save a few bytes, but is really annoying. So instead, just lay out the fields separately. We can optimize later in a sane way, with pahole, bitfields, etc. if we want. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 4066fcc9 2012-07-15T13:15:33 Get rid of struct xkb_sym_map Past its usefulness; put the stuff directly in xkb_key. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 7d9f0313 2012-07-15T13:00:04 Get rid of struct xkb_key_name Just embed it directly. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita e8a6a5f0 2012-07-15T10:38:05 Add common xkb_key struct Instead of having a million arrays from the keycode to various key-specific info in the keymap, add a single struct xkb_key to hold all of the data for the key in one object. This way we can pass it around, do some refactoring and make the code simpler. It's also nice to see everything in one place. The keys array is still indexed by keycode, which is suboptimal because there may be a lot of holes (i.e. unused keycodes between min_key_code and max_key_code). By the end of this series it would be abstracted enough to replace it by a hash table or similar if there's ever a need. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita e668d009 2012-07-15T12:48:11 Replace KeyInfo 'key' variable name by 'keyi' We want to reserve the name 'key' for something else. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 81d029f5 2012-07-15T11:52:54 Replace xkb_keycode_t 'key' variable name by 'kc' We want to reserve the name 'key' for something else. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita a52fb7e2 2012-07-15T11:37:54 Convert indecipherable macros to inline functions This was fun. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita c064b95c 2012-07-15T01:59:01 symbols: split initialization code from CompileSymbols Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita caca60f3 2012-07-15T01:45:34 Move per_key_repeats and enabled_ctrls to keymap All of the per-key data and global flags are now visible directly in the keymap. Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 1313af8f 2012-07-15T01:31:34 Get rid of xkb_key_names Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita 50fef8eb 2012-07-15T00:46:31 Get rid of xkb_indicator Signed-off-by: Ran Benita <ran234@gmail.com>