summaryrefslogtreecommitdiff
path: root/src/compose
Commit message (Collapse)AuthorAgeFilesLines
* Make path retrieval consistent in xkb_compose_table_new_from_locale()Emmanuel Gil Peyrot2020-07-233-15/+13
|
* compose: add xdg base directory supportEmmanuel Gil Peyrot2020-07-233-0/+29
| | | | | | | Before reading ~/.XCompose, try to read $XDG_CONFIG_HOME/XCompose (falling back to ~/.config/XCompose). This helps unclutter the home directory of users who want that.
* Add asprintf_safe helper functionPeter Hutterer2020-07-131-10/+3
| | | | | | | We only ever care about whether we error out or not, so let's wrap this into something more sane. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Open files in binary modeRan Benita2019-12-283-5/+5
| | | | | | This turns off some misfeatures on Windows, and does nothing on POSIX. Signed-off-by: Ran Benita <ran@unusedvar.com>
* build: include config.h manuallyRan Benita2019-12-274-0/+8
| | | | | | | | | 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>
* Replace some tabs that sneaked in with spacesRan Benita2019-11-121-1/+1
| | | | Signed-off-by: Ran Benita <ran@unusedvar.com>
* compose: fix infinite loop in parser on some inputsRan Benita2018-07-301-1/+1
| | | | | | | | | The parser would enter an infinite loop if an unterminated keysym literal occurs at EOF. Found with the afl fuzzer. Signed-off-by: Ran Benita <ran234@gmail.com>
* compose/parser: be more careful when checking if sequence overrides or ↵Ran Benita2017-12-121-3/+15
| | | | | | duplicates another Signed-off-by: Ran Benita <ran234@gmail.com>
* Add explicit fallthrough case statementsDaniel Stone2017-04-111-0/+1
| | | | | | | 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>
* compose: remove the keysym_from_name cacheRan Benita2016-12-031-45/+3
| | | | | | | | | | The hit rate is high, but either the cache is slow or the function is not fast enough -- the cache no longer holds its weight, leading only to very modest improvements. If it's the former, it can definitely be improved, the code is very dumb (though it worked just as well as any other I tried back then). But instead, let's just kill it. Signed-off-by: Ran Benita <ran234@gmail.com>
* src/utils: change map_file to not take const string argumentRan Benita2015-11-192-3/+4
| | | | | | | | | map_file() uses PROT_READ, so const seems fitting; however unmap_file calls munmap/free, which do not take const, so an UNCONSTIFY is needed. To avoid the UNCONSTIFY hack, which is likely undefined behavior or some such, just remove the const. Signed-off-by: Ran Benita <ran234@gmail.com>
* compose: correctly parse modifier syntaxRan Benita2015-03-241-17/+24
| | | | | | | As described in: http://cgit.freedesktop.org/xorg/lib/libX11/commit/?id=ddf3b09bb262d01b56fbaade421ac85b0e60a69f Signed-off-by: Ran Benita <ran234@gmail.com>
* Reduce variable scopesRan Benita2014-10-231-4/+2
| | | | Signed-off-by: Ran Benita <ran234@gmail.com>
* Replace some strncmp's with memcmpRan Benita2014-10-181-2/+2
| | | | Signed-off-by: Ran Benita <ran234@gmail.com>
* compose/parser: save len in keysym_from_name cacheRan Benita2014-10-181-1/+4
| | | | | | This reduces a lot of strcmp's, and allows to use a faster memcmp. Signed-off-by: Ran Benita <ran234@gmail.com>
* compose/parser: fix parsing of multiple modifiersRan Benita2014-10-141-13/+20
| | | | Signed-off-by: Ran Benita <ran234@gmail.com>
* compose/parser: parse (! mods) properlyRan Benita2014-10-131-15/+91
| | | | | | | We don't actually do anything with them. But if someone uses them we can at least not choke. Signed-off-by: Ran Benita <ran234@gmail.com>
* compose/parser: resolve keysyms in parser instead of scannerRan Benita2014-10-131-28/+38
| | | | | | It will become context-sensitive. Signed-off-by: Ran Benita <ran234@gmail.com>
* compose/parser: use parameter as intendedRan Benita2014-10-131-1/+1
| | | | Signed-off-by: Ran Benita <ran234@gmail.com>
* compose/parser: one more skip_to_eol()Ran Benita2014-10-131-3/+2
| | | | Signed-off-by: Ran Benita <ran234@gmail.com>
* compose/parser: fix segfault when includingRan Benita2014-10-131-3/+2
| | | | | | | | The keysym cache for the new scanner was not initialized. To avoid such errors also in the future, require passing the priv argument in scanner_init(), instead of initializing it separately. Signed-off-by: Ran Benita <ran234@gmail.com>
* COPYING: add copyright notice from libX11:modules/im/ximcp/imLcPrs.cRan Benita2014-10-131-0/+31
| | | | | | We have used some portions of it, so add the notice. Signed-off-by: Ran Benita <ran234@gmail.com>
* scanner-utils: optimize one-line commentsRan Benita2014-10-081-1/+1
| | | | | | Compose files have a lot of those. Signed-off-by: Ran Benita <ran234@gmail.com>
* compose: add xkbcommon-compose - implementationRan Benita2014-10-057-0/+1431
Signed-off-by: Ran Benita <ran234@gmail.com>