kc3-lang/libxkbcommon/src/xkbcomp/parseutils.h

Branch :


Log

Author Commit Date CI Message
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>
13eb9c35 2012-07-23 17: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>
f48ee2d2 2012-07-21 15:44:48 parse: use new log functions Signed-off-by: Ran Benita <ran234@gmail.com>
2fc0ad50 2012-07-20 12:48:13 Fix bison 2.6 and clang warnings 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>
0765064b 2012-07-13 18:34:11 Remove MERGE_ALT_FORM merge mode The mode comes from the "alternate" keyword, which is unused in xkeyboard-config and mostly undocumented. Its purpose is to allow to assign the same key name to multiple key codes, which is not allowed otherwise (and doesn't make much sense). The xkblib specification implies that this was part of the overlay functionality, which we also no longer support. If we do encounter this keyword, we just treat it as MERGE_DEFAULT. The keycodes.c code will detect a collision and will ignore all but the first key code (and the error count is not incremented). Some peripheral code is also removed as a result. Signed-off-by: Ran Benita <ran234@gmail.com>
213dcf68 2012-06-29 17:31:10 Use enum for merge mode The merge mode shows up in a lot of functions, so it's useful to give it a distinct type. Signed-off-by: Ran Benita <ran234@gmail.com>
48b4d30a 2012-06-29 17:05:33 Use enum for file types enums are nice for some type safety and readability. This one also removes the distinction between file type mask / file type index and some naming consistency. Signed-off-by: Ran Benita <ran234@gmail.com>
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>
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.]
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.]
4aef083e 2012-05-09 11: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>
64aa5c95 2012-05-09 11:12:30 Make the context available to the parser We will need the context to remove some global state. Also make the Parse* function just return bool while wer'e at it. Signed-off-by: Ran Benita <ran234@gmail.com>
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>
70dfe166 2012-05-07 14:23:46 Rename YYLTYPE to struct YYLTYPE Signed-off-by: Daniel Stone <daniel@fooishbar.org>
5fb494ec 2012-04-11 14:13:24 Remove unused debugging function 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.]
913e0740 2012-03-31 01:18:55 Constify a global table and function arguments Signed-off-by: Ran Benita <ran234@gmail.com>
e9537d50 2012-04-08 20:58:39 Fix possible overflow in scanner Also reduce the size of scanBuf given that it's allocated on the stack, and 1024 is enough. Signed-off-by: Ran Benita <ran234@gmail.com>
93ce9c7d 2012-03-29 16:31:09 Full support for multiple keysyms per level Which also involved moving the global symbol map to be per-key instead; this should probably be split out into a separate commit. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
bb6ca768 2012-03-27 22:41:22 Make parser and scanner reentrant All global state is removed from the parser and scanner. This makes use of the standard facilities in Bison and Flex for reentrant/pure scanner/lexer and location tracking. Signed-off-by: Ran Benita <ran234@gmail.com> [daniels: Updated to current sources.]
94521658 2012-03-15 09:34:20 Plug leaks in geometry parsing When parsing a geometry file, don't leak the elements we've created. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
17bcc4c1 2012-03-09 19:29:29 Remove geometry even harder Not the most elegant fix, but will do for now. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
a0e756fd 2012-03-09 19:09:25 Introduce xkb_atom_t type Signed-off-by: Daniel Stone <daniel@fooishbar.org>
0bb24c2d 2012-03-09 19:03:59 Introduce xkb_keysym_t type Signed-off-by: Daniel Stone <daniel@fooishbar.org>
c357a11a 2012-03-01 21:20:45 Add function to free XkbFile's Signed-off-by: Ran Benita <ran234@gmail.com>
eff72fab 2012-02-25 11:53:01 Fix warnings in scanner and parser Signed-off-by: Ran Benita <ran234@gmail.com>
f3e4335f 2012-02-24 16:07:17 Fix all constness warnings These are all trivial/obvious fixes which clear a bunch of warnings. Signed-off-by: Ran Benita <ran234@gmail.com>
9ad0be33 2012-02-24 10:04:16 Remove unused debug #defines Signed-off-by: Ran Benita <ran234@gmail.com>
83f18b1c 2012-02-15 19:39:33 Fix xkbparse.y compilation Thanks to autotools happily building stale generated sources, I hadn't actually ever built my xkbparse.y changes. Fix that so it not only compiles, but works. This seems to parse long keycodes correctly, although I very much would not recommend testing this by declaring 0x1fffffff as your highest keycode. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
f91afe4f 2011-06-03 17:19:09 Add prototype for CheckDefaultMap(). Those warnings disappear accordingly: | CC parseutils.lo | parseutils.c:742: warning: no previous prototype for ‘CheckDefaultMap’ | CC xkbscan.lo | xkbscan.l: In function ‘XKBParseString’: | xkbscan.l:220: warning: implicit declaration of function ‘CheckDefaultMap’ | xkbscan.l:220: warning: nested extern declaration of ‘CheckDefaultMap’ Reviewed-by: Dirk Wallenstein <halsmit@t-online.de> Signed-off-by: Cyril Brulebois <kibi@debian.org>
f8301ebc 2010-11-11 23:27:21 xkbscan: resolve build warning/rpmlint error xkbscan.l: In function 'setScanState': xkbscan.l:201:1: warning: control reaches end of non-void function I: Program returns random data in a function E: libxkbcommon no-return-in-nonvoid-function xkbscan.l:201 Change return type of setScanState to void, since a return value is never used by its callers. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
a84c0879 2010-10-19 21:57:59 Use flex for generating the scanner, add support for parsing from strings Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
73ca959d 2010-09-27 16:05:52 Dead code removal and static markup Signed-off-by: Adam Jackson <ajax@redhat.com>
47d3b396 2010-06-28 06:50:12 Drop CARD32 and Opaque types
7257d4c8 2010-06-21 14:28:34 Use CARD32 instead of Atom, move geom headers in Use CARD32 instead of Atom/KeySym/et al to avoid type size confusion between server and non-server code; relatedly, move the geometry headers in from kbproto, so every non-simple type (i.e. structs containing nothing more than basic types) is now copied into xkbcommon. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
b3852542 2010-06-21 14:27:58 Interp: More lazy keysym resolution Resolve the keysyms when we create an InterpDef, rather than directly in the parser. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
60e7eeeb 2010-06-17 03:16:09 Use CARD32 instead of Atom, drag in XkbClientMapRec On 64-bit architectures, XID varies in size between the server (always 32 bits), and non-server (always unsigned long) for some inexplicable reason. Use CARD32 instead to avoid this horrible trap. This involves dragging in XkbClientMapRec so we don't get stuck in the KeySym trap. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
240a0c34 2010-06-15 19:38:16 xkbcomp: Lazy keysym parsing (avoid XStringToKeysym) Instead of calling XStringToKeysym on every keysym we parse, store it as a string until we need to store it in an actual keymap. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
e564235b 2010-06-15 19:43:14 xkbcomp: Don't malloc() and free() most scanned tokens Use a constant buffer instead. Sigh. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
5c910623 2009-04-04 09:19:51 Remove trailing spaces in source files
0c1bbb05 2009-03-27 06:55:32 Import xkbcomp sources for CompileKeymap A copy of the xkbcomp sources (except the frontend) have been copied in to provide a means to compile a XkbDescPtr. This definitely doesn't build or do the right thing yet.