Branch :
| Author | Commit | Date | CI | Message |
|---|---|---|---|---|
| e5401b07 | 2025-03-26 16:02:58 | symbols: Improve Modmap parsing Parse, dont’t validate: ensure *at parsing* that `modifier_map` definitions use a list of keys and keysyms. This enables to remove the redundant `ExprResolveKeySym` and have keysym parsing exclusively in handled in `parser.y`. | ||
| 70d11abd | 2025-03-26 07:38:05 | messages: Add file encoding and invalid syntax entries Added: - `XKB_ERROR_INVALID_FILE_ENCODING` - `XKB_ERROR_INVALID_RULES_SYNTAX` - `XKB_ERROR_INVALID_COMPOSE_SYNTAX` Changed: - `XKB_ERROR_INVALID_SYNTAX` renamed to `XKB_ERROR_INVALID_XKB_SYNTAX`. | ||
| 14a816e5 | 2025-02-11 18:41:08 | xkbcomp: Fix int cast | ||
| 6c9806ae | 2025-02-12 07:46:07 | xkbcomp: Fix ExprResolveMaskLookup error message | ||
| 558447d8 | 2025-02-11 17:34:27 | xkbcomp: Explicit vars initialization The `Resolve*` functions do not always initialize the parameters that they can modify, so it is safer to always initialize them at the call site. | ||
| 97698fca | 2025-02-11 17:34:23 | xkbcomp: Use explicit int sizes for Expr resolution | ||
| bb5e464e | 2025-02-07 14:30:51 | xkbcomp/expr: remove comment on ExprResolveIntegerLookup What it says mostly no longer holds, I think it's more confusing than helpful now. Signed-off-by: Ran Benita <ran@unusedvar.com> | ||
| aa3e4c71 | 2025-02-07 14:10:16 | xkbcomp/expr: remove unused ExprResolveKeyCode This function was added in commit 4e22851141d89436c0659e68da57e91bbf971461. But that commit also changed the grammar: -KeyNameDecl : KeyName EQUALS Expr SEMI +KeyNameDecl : KeyName EQUALS KeyCode SEMI i.e. while before you could write <AE01> = 9+1; now this is a syntax error, an integer literal is expected. I'm not sure if it was intended to remove this ability. In any case, this rendered `ExprResolveKeyCode` useless since there's no longer an expression to evaluate, and after some refactoring it went unused. Even if we choose to restore Expr here, I don't see a reason for the specialized function over `ExprResolveInteger` except the type (which we should probably widen from int to int64_t...). So remove it. Signed-off-by: Ran Benita <ran@unusedvar.com> | ||
| 9d7eb849 | 2025-02-06 15:25:03 | xkbcomp/ast: combine expr_value_type into stmt_type This field is a funky attempt at type inference, or perhaps some optimization? Anyway, after careful examination I conclude it serves no purpose except specifying the type of a literal (string/integer/float/boolean/keyname) when `STMT_EXPR_VALUE` (i.e. literal). Remove it and replace `STMT_EXPR_VALUE` with specific statement types for each literal type. Signed-off-by: Ran Benita <ran@unusedvar.com> | ||
| d9fc01b3 | 2025-02-06 15:12:53 | xkbcomp/ast: combine expr_op_type into stmt_type It's better to have a single AST type enum. Signed-off-by: Ran Benita <ran@unusedvar.com> | ||
| e120807b | 2025-01-29 15:35:22 | Update license notices to SDPX short identifiers + update LICENSE Fix #628. Signed-off-by: Ran Benita <ran@unusedvar.com> | ||
| 502e9e5b | 2025-01-29 12:19:10 | xkbcomp: Add stricter bounds for keycodes and levels Our current implementation uses continuous arrays indexed by keycodes and levels. This is simple and good enough for realistic keymaps. However, they are allowed to have big values that will lead to either memory exhaustion or a waste of memory (sparse arrays). Added the much stricter upper bounds `0xfff` for keycodes[^1] and 2048 for levels[^2], which should still be plenty enough and provides stronger memory security. [^1]: Current max keycode is 0x2ff in Linux. [^2]: Should be big enough to satisfy automatically generated keymaps. | ||
| ec2915fe | 2025-01-22 17:18:21 | symbols: Fix a possible null pointer deference Introduce a new Expression type, `EXPR_EMPTY_LIST`, to avoid the ambiguity between action and keysym empty lists. Two alternatives were rejected to keep the semantics clear: - Using `EXPR_KEYSYM_LIST`: because we would end up accepting an empty keysym list while processing actions. - Using NULL: convey no info and is hazardous. | ||
| c7fdf506 | 2025-01-16 20:23:28 | Use portable integer literal suffixes | ||
| fdcd458c | 2024-09-24 21:20:29 | nit: Format files | ||
| 44df6eee | 2024-09-23 07:27:48 | Add new warnings for deprecated keysyms Add 2 new warnings: - Deprecated keysym name (typo, historical alias, etc.); - Deprecated keysym (all names and forms). Guard deprecated keysym tests with verbosity level ≥2, so they are run only when actually needed. | ||
| c0065c95 | 2023-09-21 20:06:27 | Messages: merge macros with and without message code 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`. | ||
| a83d745b | 2023-09-21 20:06:27 | Messages: add new messages to registry This commit is another step to identify and document the maximum number of logging messages. Bulk changes: - Rename `conflicting-key-type` to `conflicting-key-type-merging-groups`. Giving more context in the name allow us to introduce `conflicting-key-type-definitions` later. - Add conflicting-key-type-definitions - Add conflicting-key-type-map-entry - Add undeclared-modifiers-in-key-type Also improve the log messages. - Add conflicting-key-type-preserve-entries - Use XKB_ERROR_UNSUPPORTED_MODIFIER_MASK - Add illegal-key-type-preserve-result - Add conflicting-key-type-level-names - Add duplicate-entry - Add unsupported-symbols-field - Add missing-symbols-group-name-index - Use XKB_ERROR_WRONG_FIELD_TYPE - Add conflicting-key-name - Use XKB_WARNING_UNDEFINED_KEYCODE - Add illegal-keycode-alias - Add unsupported-geometry-section - Add missing-default-section - Add XKB_LOG_MESSAGE_NO_ID - Rename log_vrb_with_code to log_vrb - Use ERROR_WRONG_FIELD_TYPE & ERROR_INVALID_SYNTAX - Add unknown-identifier - Add invalid-expression-type - Add invalid-operation + fixes - Add unknown-operator - Rename ERROR_UNKNOWN_IDENTIFIER to ERROR_INVALID_IDENTIFIER - Add undeclared-virtual-modifier - Add expected-array-entry - Add invalid-include-statement - Add included-file-not-found - Add allocation-error - Add invalid-included-file - Process symbols.c - Add invalid-value - Add invalid-real-modifier - Add unknown-field - Add wrong-scope - Add invalid-modmap-entry - Add wrong-statement-type - Add conflicting-key-symbols-entry - Add invalid-set-default-statement | ||
| eafd3ace | 2023-09-18 18:17:39 | Add a new warning for numeric keysyms Usually it is better to use the corresponding human-friendly keysym names. If there is none, then the keysym is most probably not supported in the ecosystem. The only use case I see is similar to the PUA in Unicode (see: https://en.wikipedia.org/wiki/Private_Use_Areas). I am not aware of examples of this kind of use. | ||
| ef81d04e | 2023-09-18 18:17:34 | Structured log messages with a message registry Currently there is little structure in the log messages, making difficult to use them for the following use cases: - A user looking for help about a log message: the user probably uses a search engine, thus the results will depend on the proper indexing of our documentation and the various forums. It relies only on the wording of the message, which may change with time. - A user wants to filter the logs resulting of the use of one of the components of xkbcommon. A typical example would be testing xkeyboard-config against libxkbcommon. It requires the use of a pattern (simple words detection or regex). The issue is that the pattern may become silently out-of-sync with xkbcommon. A common practice (e.g. in compilers) is to assign unique error codes to reference theses messages, along with an error index for documentation. Thus this commit implements the following features: - Create a message registry (message-registry.yaml) that defines the log messages produced by xkbcommon. This is a simple YAML file that provides, for each message: - A unique numeric code as a short identifier. It is used in the output message and thus can be easily be filtered to spot errors or searched in the internet. It must not change: if the semantics of message changes, it is better to introduce a new message for clarity. - A unique text identifier, meant for two uses: 1. Generate constants dealing with log information in our code base. 2. Generate human-friendly names for the documentation. - A type: currently warning or error. Used to prefix the constants (see hereinabove) and for basic classification in documentation. - A short description, used as concise and mandatory documentation. - An optionnal detailed description. - Optional examples, intended to help the user to fix issues themself. - Version of xkbcommon it was added. For old entries this often unknown, so they will default to 1.0.0. - Version of xkbcommon it was removed (optional) No entry should ever be deleted from this index, even if the message is not used anymore: it ensures we have unique identifiers along the history of xkbcommon, and that users can refer to the documentation even for older versions. - Add the script update-message-registry.py to generate the following files: - messages.h: message code enumeration for the messages currently used in the code base. Currently a private API. - message.registry.md: the error index documentation page. - Modify the logging functions to use structured messages. This is a work in progress. | ||
| 7a815ad3 | 2023-07-04 09:23:24 | Fix parsing of numeric keysyms in ExprResolveKeySym `ExprResolveKeySym` in `expr.c` does not parse non-digit numeric keysyms. Fixed by checking upper bound; also add warning messages. | ||
| 40aab05e | 2019-12-27 13:03:20 | build: include config.h manually 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> | ||
| 7d44c7a9 | 2019-11-12 22:09:19 | expr: fix log message on some unexpected expression types Signed-off-by: Ran Benita <ran@unusedvar.com> | ||
| 406beeca | 2019-11-12 22:06:02 | Replace some tabs that sneaked in with spaces Signed-off-by: Ran Benita <ran@unusedvar.com> | ||
| bb4909d2 | 2017-10-30 11:21:55 | Fail expression lookup on invalid atoms If we fail atom lookup, then we should not claim that we successfully looked up the expression. Signed-off-by: Daniel Stone <daniels@collabora.com> | ||
| 38e1766b | 2017-06-26 17:21:45 | xkbcomp: Don't falsely promise from ExprResolveLhs Every user of ExprReturnLhs goes on to unconditionally dereference the field return, which can be NULL if xkb_intern_atom fails. Return false if this is the case, so we fail safely. testcase: splice geometry data into interp Signed-off-by: Daniel Stone <daniels@collabora.com> | ||
| 4e2ee9c3 | 2017-06-26 17:18:16 | xkbcomp: Don't explode on invalid virtual modifiers testcase: 'virtualModifiers=LevelThreC' Signed-off-by: Daniel Stone <daniels@collabora.com> | ||
| 1f9d1248 | 2018-03-10 23:10:47 | xkbcomp: fix stack overflow when evaluating boolean negation The expression evaluator would go into an infinite recursion when evaluating something like this as a boolean: `!True`. Instead of recursing to just `True` and negating, it recursed to `!True` itself again. Bug inherited from xkbcomp. Caught with the afl fuzzer. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 41f10188 | 2017-09-08 12:16:13 | expr: paper over a maybe-uninitialized warning Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| ce38f96e | 2017-04-11 15:09:23 | Add explicit fallthrough case statements When we fall through to another label in a case, add an explicit comment noting so, to quiet GCC 7's warnings. Signed-off-by: Daniel Stone <daniels@collabora.com> | ||
| 9fbcf6bb | 2013-02-08 13:56:41 | expr: take xkb_mod_set instead of the entire keymap The modifier-resolving functions only need the modifier information. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| edc0aef5 | 2013-02-08 13:21:27 | text: take xkb_mod_set instead of the entire keymap The modifier printing functions only need the modifier information, they don't care about keys or leds, etc. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 51a1df2f | 2014-04-19 15:56:27 | keymap: move ModNameToIndex from text.c and use it in keymap.c Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 9c8fcee1 | 2014-04-16 21:25:40 | expr: fix handling of unknown integer binary operator We can't reach the default branch but at least make it do something sensible. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| b95df2a6 | 2014-02-15 22:59:12 | expr: simplify ExprResolveButton Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 769b91c5 | 2014-02-08 15:30:05 | Use (1u << idx) instead of (1 << idx) where appropriate It doesn't matter (I think), since the implicit conversion doesn't have any effect (e.g. sign-extension). But it's better to be aware of the type. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 972395b8 | 2013-12-01 12:08:47 | expr: split expression types and allocate them separately Currently, we have one ExprDef type, which contains a tagged union with the value of all expression types. Turns out, this union is quite wasteful memory-wise. Instead, create separate types for all expressions (e.g ExprBinary, ExprInteger) which embed the common fields (ExprCommon), and malloc them per their size; ExprDef then becomes a union of all these types, but is just used as a generic pointer. [Instead of making ExprDef a union, another option is to use ExprCommon as the generic pointer type and then do up-castings, like we do with ParseCommon. But this makes the code much uglier.] The diff is mostly straightforward mechanical adaptations. It could have been much smaller with the help of C11 anonymous structs (which were previously a gnu extension). This will have saved all of the 'op' -> 'expr->op', etc changes. But if we can be a bit more portable for a little effort, we should. Before (./test/rulescomp, x86 32 bit, -O2): ==12974== total heap usage: 145,217 allocs, 145,217 frees, 10,476,238 bytes allocated After: ==11145== total heap usage: 145,217 allocs, 145,217 frees, 8,270,358 bytes allocated Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| c24b6420 | 2013-11-30 23:24:18 | expr: add constructor for boolean expressions Also add a 'bool set' to the ExprDef union, instead of using 'ival' as a bool. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| dbd8b1ef | 2013-11-30 22:25:39 | expr: add 'ident' value to ExprDef union This distinguishes between an identifier expression and a string expression in the union. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 7b3bd11f | 2012-10-16 16:05:34 | Add xkb_keysym_from_name() flags argument for case-insensitive search This adds a flags argument to xkb_keysym_from_name() so we can perform a case-insensitive search. This should really be supported as many keysyms have really weird capitalization-rules. However, as this may produce conflicts, users must be warned to only use this for fallback paths or error-recovery. This is also the reason why the internal XKB parsers still use the case-sensitive search. This also adds some test-cases so the expected results are really produced. The binary-size does _not_ change with this patch. However, case-sensitive search may be slightly slower with this patch. But this is barely measurable. [ran: use bool instead of int for icase, add a recommendation to the doc, and test a couple "thorny" cases.] Signed-off-by: David Herrmann <dh.herrmann@googlemail.com> | ||
| bdea377c | 2012-10-10 17:30:15 | Rename XKB_NUM_GROUPS to XKB_MAX_GROUPS This is a more appropriate name now. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| a1124b59 | 2012-10-06 17:42:21 | expr: unify the real and virtual modifier functions This again pushes the mod type annotation to the original call site, to make it easier to grep to see where the real/virtual distinction matters. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 6d74e66e | 2012-10-06 17:53:53 | Replace 0xff with MOD_REAL_MASK_ALL To make it easier to see where it's used. The name is just to match MOD_REAL. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| e6e3bda3 | 2012-10-06 17:00:26 | expr: share code for modifier functions We can make more use of the functions in text.c now and remove some cruft. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 9ebd2f67 | 2012-10-06 14:34:17 | text: explicitly take mod_type in mod functions This essentially "tags" each invocation of the functions with the modifier type of the argument, which allows for easy grepping for them (with the aim being, to remove anything but MOD_BOTH). Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 424de613 | 2012-10-05 22:46:21 | Keep real and virtual mods in the same table in the keymap We change the keymap->vmods array into keymap->mods, and change it's member type from struct xkb_vmod to struct xkb_mod. This table now includes the real modifiers in the first 8 places. To distinguish between them, we add an enum mod_type to struct xkb_mod. Besides being a more reasonable approach, this enables us to share some code later, remove XKB_NUM_CORE_MODS (though the 0xff mask still appears in a few places), and prepares us to flat out remove the distinction in the future. This commit just does the conversion. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 1005b320 | 2012-10-05 22:07:04 | Don't use shifted virtual modifier masks Modifier masks can be confusing in some places. For example, key->vmodmap only contains virtual modifiers, where the first is in position 0, the second in 1 etc., while normally in a xkb_mod_mask_t the virtual modifiers start from the 8th (XKB_NUM_CORE_MODS) position. This happens in some other places as well. Change all of the masks to be in the usual real+virtual format, and when we need to access e.g. keymap->vmods we just adjust by XKB_NUM_CORE_MODS. (This also goes for indexes, e.g. interpret->virtual_modifier). This makes this stuff easier to reason about. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 6974e1f9 | 2012-10-05 21:40:49 | expr: don't expose LookupModIndex The Lookup* functions should remain a private implementation detail of the expr.c file. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| aed3140e | 2012-10-05 21:06:34 | Remove VModInfo for now VModInfo currently is only used to track which virtual modifiers were declared in the file which owns the VModInfo. This, in turn, is only used in ResolveVirtualModifier, which in turn is only used to resolve the virtualModifier field in an interpret statement (compat.c). In other words, it is used to ensure that interprets can only use a vmod which was declared in the same map. We remove this now, because it doesn't do much and distracts from other changes; we will later re-add it properly. Specificly, we will make it so that virtual modifiers are not the exception in that they modify the keymap directly, instead of keeping the changes in some *Info struct and commiting them to the keymap at the end of the compilation. (This is bad because if a vmod is added to the keymap, and then the compilation of this specific file fails, the change sticks around nonetheless). Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 1401b0fb | 2012-10-04 12:27:06 | expr: don't allow "none" in LookupModIndex LookupModMask handles this before calling LookupModIndex, and the only other user in symbols.c doesn't handle this return value at all. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| fcd20290 | 2012-09-21 14:44:17 | Don't use xkbcommon-compat names in internal code Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 82de180e | 2012-09-11 15:09:37 | Remove unused ExprResolveKeyName The only user was removed in 314965b1. Signed-off-by: Daniel Stone <daniel@fooishbar.org> | ||
| 6573aca0 | 2012-09-10 21:05:04 | kbproto unentanglement: XkbMaxShiftLevel ... by removing its only use. Signed-off-by: Daniel Stone <daniel@fooishbar.org> | ||
| 4b8ceae9 | 2012-08-21 12:45:03 | kbproto untanglement: XkbKbdNumGroups Signed-off-by: Daniel Stone <daniel@fooishbar.org> | ||
| f5dffd2b | 2012-08-21 11:21:19 | kbproto untanglement: XkbKeyNameLength Define it ourselves as XKB_KEY_NAME_LENGTH and use that, instead of the one from XKB.h. Signed-off-by: Daniel Stone <daniel@fooishbar.org> | ||
| af2a8b3a | 2012-09-02 21:45:42 | Unify some string tables from xkbcomp, text and keymap-dump We move the LookupEntry struct from expr.h to text.h, along with most of the lookup tables. This makes them available everywhere. Looking up a value in the LookupEntry format is slower than direct index mapping, but it allows multiple names per value (with the canonical one being first) and "all"- and "none"-type masks. These functions are not used anywhere efficiency matters. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 1a996883 | 2012-08-31 19:05:49 | expr: make ResolveString return an atom Almost all callers do xkb_atom_intern on the currently returned string, while ResolveString converts the atom to the string to begin with... uselss double work. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 41472822 | 2012-08-29 15:17:00 | Use XKB_MOD_INVALID instead of XkbNoModifier Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| d3ddcf70 | 2012-08-15 21:45:02 | expr: move op_type/value_type_to_string functions to ast Generally the enum-to-string function should appear where the enum is defined. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| cdc228ea | 2012-08-13 11:00:43 | Organize xkbcomp/ header files Various non-functional changes: - Re-add keycodes.h and move some stuff there. - Add parser-priv.h for internal bison/flex stuff. - Don't include headers from other headers, such that file dependencies are immediate in each file. - Rename xkbcomp.h -> ast.h, parseutils.{c,h} -> ast-build.{c,h} - Rename path.{c,h} -> include.{c,h} - Rename keytypes.c -> types.c - Make the naming of XkbFile-related functions more consistent. - Move xkb_map_{new,ref,unref} to map.c. - Remove most extern keyword from function declarations, it's just noise (XKB_EXPORT is what's important here). - Append XKBCOMP_ to include guards. - Shuffle some code around to make all of this work. Splitting this would be a headache.. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 59d947c9 | 2012-08-05 19:24:44 | Add and use xkb_level_index_t Several types are used over the code for shift levels; better to use just one. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 6f08a2cf | 2012-08-03 00:33:40 | expr: constify function arguments We need this for later. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| b2c4331a | 2012-07-28 22:15:59 | Handle key names consistently We treat the key names as fixed length, non NUL terminated strings of length XkbKeyNameLength, and use the appropriate *Text functions to print them. We also use strncpy everywhere instead of memcpy to copy the names, because it does some NUL padding and we might as well. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 15541766 | 2012-08-05 14:10:45 | expr: make ResolveLevel return zero-based level Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 7c7e4341 | 2012-08-01 11: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> | ||
| 41d9afc5 | 2012-07-27 15: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> | ||
| 6917901f | 2012-07-27 14: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> | ||
| bd927abf | 2012-07-24 19:39:59 | expr: drop ExprResult from ResolveEnum Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 38614c88 | 2012-07-24 17:21:29 | expr: drop ExprResult from ResolveMask Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| d5682289 | 2012-07-24 01:22:26 | expr: drop ExprResult from ResolveButton Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 6ec13570 | 2012-07-24 00:51:19 | expr: drop ExprResult from ResolveLevel Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 0d262fa1 | 2012-07-23 19:52:17 | expr: drop ExprResult from ResolveBoolean Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 2e4933cd | 2012-07-24 10:39:15 | expr: drop ExprResult from ResolveInteger Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 025ca579 | 2012-07-23 12:20:05 | expr: drop ExprResult from ResolveLhs Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 000528dd | 2012-07-24 00:23:34 | expr: drop ExprResult from ResolveKeyCode Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| e258f9ee | 2012-07-24 00:10:07 | expr: drop ExprResult from ResolveGroup Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 70262292 | 2012-07-23 23:56:28 | expr: drop ExprResult from ResolveKeysym Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 27f94929 | 2012-07-23 15:46:50 | expr: drop ExprResult from ResolveString Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 761b675c | 2012-07-23 11: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> | ||
| 724f62c8 | 2012-07-25 17:29:08 | Convert defines to enums in xkbcomp.h For statement / expression types. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 89723b7c | 2012-07-24 19: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> | ||
| 112cccb1 | 2012-07-23 16: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> | ||
| c6279b8b | 2012-07-23 21:21:03 | expr: don't divide by zero Calculator parser 101. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 2e245a9a | 2012-07-23 11:42:22 | expr: Remove ExprResolveFloat Remnant from geometry. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| d659f2b4 | 2012-07-21 15:12:31 | expr: use new log functions Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 50b25a12 | 2012-07-17 11:03:43 | Use xkb_group_index_t for group variables throughout Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 7d9f0313 | 2012-07-15 13:00:04 | Get rid of struct xkb_key_name Just embed it directly. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| 9308a460 | 2012-07-17 10:20:15 | Run source tree through uncrustify .uncrustify.cfg committed for future reference also, but had to manually fix up a few things: it really likes justifying struct initialisers. Signed-off-by: Daniel Stone <daniel@fooishbar.org> | ||
| 7b00485a | 2012-05-11 15: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> | ||
| 6433d72e | 2012-05-09 20:12:12 | Merge remote-tracking branch 'krh/keysyms' Conflicts: src/keysym.c src/misc.c src/text.h src/xkbcomp/expr.c src/xkbcomp/parser.y src/xkbcomp/parseutils.c src/xkbcomp/symbols.c Signed-off-by: Daniel Stone <daniel@fooishbar.org> | ||
| ace1e5df | 2012-05-09 09:05:00 | Use our own keysyms | ||
| e7bb1e5f | 2012-05-09 15: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.] | ||
| cdd2906d | 2012-05-09 13:50:05 | Make the context available for XkbcAtomText And rename the function to xkb_atom_text. Signed-off-by: Ran Benita <ran234@gmail.com> [daniels: Updated for xkb -> keymap.] | ||
| 8d680e80 | 2012-05-09 12:01:03 | Make the context available for XkbcAtomGetString In preparation of contextualizing atom handling. Since we touch every function call, we also rename the function to xkb_atom_strdup to match xkb_atom_intern, and be more descriptive. Signed-off-by: Ran Benita <ran234@gmail.com> [daniels: Updated for xkb -> keymap.] | ||
| 38cb6390 | 2012-05-09 15:15:30 | Change all 'xkb' xkb_keymap names to 'keymap' To make it a bit more clear what it actually is. Signed-off-by: Daniel Stone <daniel@fooishbar.org> | ||
| e1af48bc | 2012-05-09 13:22:34 | Rename keysym <-> string API Change them to refer to the string representation of the keysym's name as a name rather than a string, since we want to add API to get the Unicode printable representation as well. Signed-off-by: Daniel Stone <daniel@fooishbar.org> | ||
| 33273304 | 2012-05-08 13:57:07 | Rename xkbcomp/misc.h to xkbcomp-priv.h and use it The include dependencies were quite convoluted, where you change the order and get a ton of errors. Instead, change one file to act as the internal interface for the xkbcomp files, and make every file use it. Also drop the pointless "xkb" prefix to file names. Signed-off-by: Ran Benita <ran234@gmail.com> | ||
| a641a185 | 2012-04-06 03:38:55 | Use stdbool.h 'Cause defining your own True and False is so 1990's. Signed-off-by: Ran Benita <ran234@gmail.com> [daniels: Fixed for xkb_desc -> xkb_keymap changes.] | ||
| a39ed85f | 2012-04-05 11:24:39 | Fix formatting in xkbcomp headers Signed-off-by: Ran Benita <ran234@gmail.com> [daniels: Fixed for xkb_desc -> xkb_keymap change.] | ||
| ef88c7ef | 2012-04-03 15:14:16 | Rename xkb_desc to xkb_keymap struct xkb_desc was just a hangover from the old XkbDescRec, which isn't a very descriptive name. Signed-off-by: Daniel Stone <daniel@fooishbar.org> |