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

Branch :


Log

Author Commit Date CI Message
28733c54 2012-08-03 05:34:58 IncludeStmt: Remove useless 'path' member Signed-off-by: Daniel Stone <daniel@fooishbar.org>
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>
3bea189b 2012-08-01 18:46:01 Make top level Handle*File functions nicer 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>
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>
71c2f2e0 2012-07-20 17: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>
8b0e9f92 2012-07-20 13:07:30 utils: remove uTypedAlloc/Calloc Signed-off-by: Ran Benita <ran234@gmail.com>
861e6a17 2012-07-18 16: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>
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>
bc50cdd4 2012-06-05 18:46:24 darray: some changes for convenience - Make darray_free also initialize the array back to an empty state, and stop worrying about it everywhere. - Add darray_mem, to access the underlying memory, which we do manually now using &darray_item(arr, 0). This makes a bit more clear when we actually mean to take the address of a specific item. - Add darray_copy, to make a deep copy of a darray. - Add darray_same, to test whether two darrays have the same underlying memory (e.g. if the struct itself was value copied). This should used where previously two arrays were compared for pointer equality. Signed-off-by: Ran Benita <ran234@gmail.com>
dcdbd149 2012-05-22 12:24:54 parser: use darray for keysym list Signed-off-by: Ran Benita <ran234@gmail.com>
db3e8f2c 2012-05-13 10:14:10 Create path.h for the path.c functions No need to stash them in xkbcomp-priv.h; files which need the functions should explicitly include them. 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>
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
5e59ef3f 2012-05-09 17:54:37 Remove support for xkb_layout and xkb_semantics file types These are two aggregate file types which are not used anywhere. We maintain useful-enough backward compatibility in the parser, by treating them as xkb_keymap. The keymap type allows for all types of components, so they will still compile fine if they ever come up. Signed-off-by: Ran Benita <ran234@gmail.com>
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.]
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>
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>
b610b2b9 2012-05-08 14: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>
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>
62a75dc1 2012-04-10 23:08:49 Remove unused stuff from XKBcommonint.h Signed-off-by: Ran Benita <ran234@gmail.com>
793908a0 2012-04-11 19:58:03 Remove unused 'compiled' field in XkbFile Signed-off-by: Ran Benita <ran234@gmail.com>
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.]
913e0740 2012-03-31 01:18:55 Constify a global table and function arguments 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>
6628cf0b 2012-03-28 19:50:45 Remove unused rtrnValue declaration 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.]
602e8780 2012-03-24 13:27:48 Define our own NoSymbol value and use it Since we have our own xkb_keysym_t type, it makes sense to have our own NoSymbol value instead of the one from X11/X.h. Signed-off-by: Ran Benita <ran234@gmail.com>
f08ce9b7 2012-03-24 00:26:12 Use strcasecmp consistently instead of uStrCaseCmp There's no use calling the same thing by a different name. Signed-off-by: Ran Benita <ran234@gmail.com>
3104a8ef 2012-03-24 00:12:08 Move utility macro from XKBcommonint.h to utils.h And merge all the similar ones into the same name. The u* prefix is chosen over the _Xkb prefix because it has more uses throughout the codebase. But It should now be simple to choose a nice prefix and stay consistent. Signed-off-by: Ran Benita <ran234@gmail.com> [daniels: fixed for the case where we have strcasecmp]
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>
a0e756fd 2012-03-09 19:09:25 Introduce xkb_atom_t type 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>
0bb24c2d 2012-03-09 19:03:59 Introduce xkb_keysym_t type Signed-off-by: Daniel Stone <daniel@fooishbar.org>
ed5c6c17 2012-03-09 16:26:34 Remove geometry support, again It still parses geometry, but happily throws it away. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
889a299e 2012-03-02 14:49:36 Free XkbFile's when no longer needed Signed-off-by: Ran Benita <ran234@gmail.com>
c357a11a 2012-03-01 21:20:45 Add function to free XkbFile's Signed-off-by: Ran Benita <ran234@gmail.com>
4bc839ab 2012-02-29 20:50:17 Use memset instead of bzero Signed-off-by: Ran Benita <ran234@gmail.com>
a3e40917 2012-03-01 23:43:51 Remove return's at the end of void functions Signed-off-by: Ran Benita <ran234@gmail.com>
6a34e4e1 2012-02-29 19:56:39 Don't check for NULL before free() Signed-off-by: Ran Benita <ran234@gmail.com>
c45cdb0c 2012-02-16 00:22:11 Still more memory leak fixes Signed-off-by: Daniel Stone <daniel@fooishbar.org>
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>
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>
3f0034a9 2010-07-02 11:50:01 Rename public entry points to lowercase and underscore
399d4bd6 2010-06-28 06:58:01 Drop malloc wrappers
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>
6a84a34d 2009-04-08 07:46:25 Remove all non-public API from XKBcommon.h header The noble intention was to expose all the new API and new generic types in the split out kbproto headers through XKBcommon.h. It turns out that would be a massive amount of work in the server. Someday, but first just wedging in XkbCompileKeymap* would be good. Most of the API is in new internal xkb*.h headers. In order to allow the XKBcommon.h header to be used from the server, we can't pull in other headers from kbproto since the server has its own copies. However, types that are different (XkbDescRec, XkbAction) still have Xkbc equivalents here, and I think they should be used in the server.
5889cef8 2009-04-05 20:27:35 Require strdup and remove utils wrapper This kills a couple warnings from using the uStringDup wrapper. If you don't have strdup on your platform, you have bigger issues.
5c910623 2009-04-04 09:19:51 Remove trailing spaces in source files
a27e56b6 2009-03-31 07:21:20 xkbcomp: Remove duplicated macros
eff1c538 2009-03-28 19:00:13 Copy XkbEnsureSafeMapName from xkbfile
b0acc97a 2009-03-28 12:03:35 xkbcomp: s/XStringToKeysym/XkbcStringToKeysym/
30e01032 2009-03-27 19:25:14 libxkbcomp: Remove usage of client-side headers This will surely break things. Let's see just what we need to replace.
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.