summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-04-22Assume target platforms have strcasecmp nowHEADmasterAlan Coopersmith4-24/+2
It has been required since Unix98/SUSv2 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Part-of: <https://gitlab.freedesktop.org/xorg/lib/libxkbfile/-/merge_requests/18>
2024-03-18Document XkbRF_VarDefsRec and some related functionsAlexander Golubev1-15/+62
Document next symbols: - XkbRF_VarDefsRec - XkbRF_GetNamesProp() - XkbRF_SetNamesProp() - _XKB_RF_NAMES_PROP_ATOM Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
2024-03-18Add XkbRF_FreeVarDefs() a destructor for XkbRF_VarDefsRec.Alexander Golubev2-1/+39
The function properly frees memory allocated for XkbRF_VarDefsRec by XkbRF_GetNamesProp(). Based on original contribution by Martin Weber <martin.weber@secunet.com> Closes: https://gitlab.freedesktop.org/xorg/lib/libxkbfile/-/issues/6 Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
2024-02-21CI: add workflow rulesPeter Hutterer1-0/+4
Required for pipelines to run after some infrastructure changes, see https://gitlab.freedesktop.org/freedesktop/freedesktop/-/issues/540
2024-02-04libxkbfile 1.1.3libxkbfile-1.1.3Alan Coopersmith2-2/+2
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-11-08Add a meson build systemAlan Coopersmith5-13/+159
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-10-08Fix -Wsign-compare warnings in xkbtext.c & xkmread.cAlan Coopersmith2-9/+8
xkbtext.c: In function ‘XkbNKNDetailMaskText’: xkbtext.c:588:37: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare] 588 | for (len = 0, i = 0, bit = 1; i < NUM_NKN; i++, bit <<= 1) { | ^ xkbtext.c:597:37: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare] 597 | for (len = 0, i = 0, bit = 1; i < NUM_NKN; i++, bit <<= 1) { | ^ xkmread.c: In function ‘XkmSkipPadding’: xkmread.c:118:19: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare] 118 | for (i = 0; i < pad; i++) { | ^ xkmread.c: In function ‘ReadXkmKeycodes’: xkmread.c:254:54: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare] 254 | for (pAl = xkb->names->key_aliases, i = 0; i < nAl; i++, pAl++) { | ^ xkmread.c: In function ‘ReadXkmCompatMap’: xkmread.c:452:19: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare] 452 | for (i = 0; i < num_si; i++, interp++) { | ^ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-10-08XkbIndentText: Fix -Wsign-compare warningAlan Coopersmith1-1/+1
xkbtext.c: In function ‘XkbIndentText’: xkbtext.c:1529:19: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare] 1529 | for (i = 0; i < size; i++) { | ^ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-10-08xkbtext.c: Add tbGetBufferString helper functionAlan Coopersmith1-20/+21
Handles common case of allocating & copying string to temporary buffer As a side effect, clears up gcc warning: xkbtext.c: In function ‘XkbBehaviorText’: xkbtext.c:1476:19: warning: declaration of ‘tmp’ shadows a previous local [-Wshadow] 1476 | char *tmp; | ^~~ xkbtext.c:1457:21: note: shadowed declaration is here 1457 | char buf[256], *tmp; | ^~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-10-08DefaultParser: avoid -Wimplicit-fallthrough warningsAlan Coopersmith1-32/+34
Clears up 24 warnings from gcc 12 of the form: xkbconfig.c: In function ‘DefaultParser’: xkbconfig.c:469:36: warning: this statement may fall through [-Wimplicit-fallthrough=] 469 | case _XkbCF_RulesFile: if (!str) str = &rtrn->rules_file; | ^ xkbconfig.c:470:5: note: here 470 | case _XkbCF_Model: if (!str) str = &rtrn->model; | ^~~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-10-08XkbWriteCFile: stop leaking header file ifdef nameAlan Coopersmith1-3/+4
Found by gcc 12 analyzer: cout.c:1106:8: warning: leak of ‘hdrdef’ [CWE-401] [-Wanalyzer-malloc-leak] 1106 | if (!ok) { | ^ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-10-08XkbCFReportError: avoid -Wformat-nonliteral warningAlan Coopersmith1-15/+15
xkbconfig.c: In function ‘XkbCFReportError’: xkbconfig.c:1344:5: warning: format not a string literal, argument types not checked [-Wformat-nonliteral] 1344 | fprintf(file, msg, line); | ^~~~~~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-10-08XkbChangeAtomDisplay: stop leaking atom nameAlan Coopersmith1-5/+6
Found by gcc 12 analyzer: xkbatom.c: In function ‘XkbChangeAtomDisplay’: xkbatom.c:218:16: warning: leak of ‘tmp’ [CWE-401] [-Wanalyzer-malloc-leak] xkbatom.c:220:12: warning: leak of ‘tmp’ [CWE-401] [-Wanalyzer-malloc-leak] 220 | return XInternAtom(dpy, name, onlyIfExists); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fixes: 5e5bd09 ("Fix offline operation.") Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-10-08_XkbInitAtoms: check for malloc() failureAlan Coopersmith1-6/+4
Handles gcc 12 analyzer warning: xkbatom.c: In function ‘_XkbInitAtoms’: xkbatom.c:194:21: warning: dereference of possibly-NULL ‘nodeTable’ [CWE-690] [-Wanalyzer-possible-null-dereference] 194 | nodeTable[None] = (NodePtr) NULL; | ^ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-10-08_XkbMakeAtom: remove check for impossible caseAlan Coopersmith1-2/+1
nd->string is always the result of a new allocation, so can never be equal to string. This resolves a warning from the gcc 12 analyzer, which reported a memory leak if the impossible condition was ever true: In file included from xkbatom.c:85: xkbatom.c: In function ‘_XkbMakeAtom’: XKBfileInt.h:51:33: warning: leak of ‘<unknown>’ [CWE-401] [-Wanalyzer-malloc-leak] [...] | 158 | if (!table) { | | ^ | | | | | (15) following ‘true’ branch (when ‘table’ is NULL)... | 159 | if (nd->string != string) | | ~~ ~ | | | | | | | (17) following ‘false’ branch... | | (16) ...to here | 161 | _XkbFree(nd); | | ^~~~~~~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-03-25Set close-on-exec when opening filesAlan Coopersmith1-4/+9
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-03-06configure: Use LT_INIT from libtool 2 instead of deprecated AC_PROG_LIBTOOLAlan Coopersmith1-1/+2
AC_PROG_LIBTOOL was replaced by LT_INIT in libtool 2 in 2008, so it's time to rely on it. Clears autoconf warnings: configure.ac:35: warning: The macro `AC_PROG_LIBTOOL' is obsolete. configure.ac:35: You should run autoupdate. aclocal.m4:3465: AC_PROG_LIBTOOL is expanded from... configure.ac:35: the top level libtoolize: Consider adding 'AC_CONFIG_MACRO_DIRS([m4])' to configure.ac, libtoolize: and rerunning libtoolize and aclocal. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-08libxkbfile 1.1.2libxkbfile-1.1.2Matt Turner1-1/+1
Signed-off-by: Matt Turner <mattst88@gmail.com>
2022-11-29configure: Use AC_SYS_LARGEFILE to enable large file supportMatt Turner1-0/+3
Signed-off-by: Matt Turner <mattst88@gmail.com>
2022-10-17libxkbfile 1.1.1libxkbfile-1.1.1Alan Coopersmith1-2/+3
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-08-20Fix check for appending '|' character when applying rulesRan Benita1-1/+1
There are two ways to separate multiple files in XKB include statements: '+' will cause the later file to override the first in case of conflict, while '|' will cause it augment it (this is done by xkbcomp). '!' is unrelated here. Currently, if someone tries to use '|' in a rule instead of '+', it won't have any effect. Since '|' is practically never used, this wasn't noticed. Signed-off-by: Ran Benita <ran234@gmail.com>
2022-07-17gitlab CI: add a basic build testAlan Coopersmith1-0/+98
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-07-17Fix spelling/wording issuesAlan Coopersmith2-2/+2
Found by using: codespell --builtin clear,rare,usage,informal,code,names Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-07-17Build xz tarballs instead of bzip2Alan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-06-05fix an off-by-one error in copying the name of a virtual modifierBenno Schulenberg1-1/+1
This fixes issue #9. Bug existed since commit 816a8db326 from sixteen years ago. Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2020-09-02unifdef NOTYETPeter Hutterer2-25/+0
This has been ifdef'd out since at least 2003, time to accept that it won't be handled. One part was unreachable code anyway, the second part affects GeomDoodads which are unnecessary and barely used anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-06-19Escape non-printable characters correctlyPeter Hutterer1-1/+1
This is the equivalent patch to xserver commit eaf1f72ed8994b708d94ec2de7b1a99f5c4a39b8: XkbStringText escapes non-printable characters using octal numbers. Such escape sequence would be at most 5 characters long ("\0123"), so it reserves 5 bytes in the buffer. Due to char->unsigned int conversion, it would print much longer string for negative numbers. Fixes https://gitlab.freedesktop.org/xorg/lib/libxkbfile/-/issues/8 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-03-29Convert check for strcasecmp to normal autoconf styleAlan Coopersmith3-5/+3
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-03-29Use strndup if available to avoid -Wstringop-overflow warning from gcc 9Alan Coopersmith2-3/+10
Reported in https://gitlab.freedesktop.org/xorg/lib/libxkbfile/issues/5 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-03-16libxkbfile 1.1.0libxkbfile-1.1.0Alan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-03-16Add description of libxkbfile to README.mdAlan Coopersmith1-0/+3
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-12-07Update configure.ac bug URL for gitlab migrationAlan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-11-19Update README for gitlab migrationAlan Coopersmith3-24/+20
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-11-10Remove obsolete B16 & B32 tags in struct definitionsAlan Coopersmith1-63/+63
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-03-24correcting mathematical nonsenseMartin Burggraf1-3/+11
V2: Fixing the issue with numbers between 0 -1 Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2017-01-26autogen: add default patch prefixMihail Konev1-0/+3
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
2017-01-26autogen.sh: use quoted string variablesEmil Velikov1-4/+4
Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent fall-outs, when they contain space. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-26autogen.sh: use exec instead of waiting for configure to finishPeter Hutterer1-1/+1
Syncs the invocation of configure with the one from the server. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-01-01Fix mistyped argument of sizeofAndreas Wettstein1-3/+3
A pointer rather than the buffer was given to sizeof. As the data to be written is only one or two bytes, a pointer size is at least four bytes, and the buffer has 32 bytes, this error did not have negative effects. Signed-off-by: Andreas Wettstein <wettstein509@solnet.ch> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2016-01-01Add support for genKeyEvent flagAndreas Wettstein1-0/+2
ActionMessage has an optional flag genKeyEvent. This change makes sure this flag is printed when it is set. Signed-off-by: Andreas Wettstein <wettstein509@solnet.ch> Reviewed-By: Ran Benita <ran234@gmail.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2016-01-01Add missing support for NoLock and NoUnlock flagsAndreas Wettstein1-2/+46
The LockMods, ISOLock and LockControls support an "affect" flag to selectively enable and disable locking and unlocking for these actions. This change adds output of these flags. Signed-off-by: Andreas Wettstein <wettstein509@solnet.ch> Reviewed-By: Ran Benita <ran234@gmail.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2015-04-30libxkbfile 1.0.9libxkbfile-1.0.9Alan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-11-27Remove unnecessary check.Jörg Sonnenberger1-1/+1
The vmods member of XkbNamesPtr is an array and thus never NULL. Signed-off-by: Thomas Klausner <wiz@NetBSD.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-11-08Remove check to see if SEEK_SET is defined before using itAlan Coopersmith1-4/+0
Other references to SEEK_SET in this file are made without checking, since they assume everyone has either reached C89 by now or will use the fallback #define at the top of the file, so we can stop checking here as well. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-10-28Constify atom name argument to XkbInternAtomAlan Coopersmith2-3/+3
Matches XInternAtom, which it wraps, and quiets a bunch of const warnings in xkbcomp. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Ran Benita <ran234@gmail.com>
2013-10-28Convert sprintf calls to snprintfAlan Coopersmith3-114/+128
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Ran Benita <ran234@gmail.com>
2013-10-28Don't dereference xkb pointer until after checking it for NULLAlan Coopersmith1-8/+8
Some compilers can perform mind-twistingly evil optimizations if you check for NULL after using it, others just let you segv. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Ran Benita <ran234@gmail.com>
2013-10-28unifdef -UXKB_IN_SERVERAlan Coopersmith9-124/+0
Xserver has its own copy of this code now, so we don't need to keep an unused copy in libxkbfile too. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Ran Benita <ran234@gmail.com>
2013-10-20Convert to X.Org standard indentation styleAlan Coopersmith14-7630/+8130
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-01-18Replace deprecated Automake INCLUDES variable with AM_CPPFLAGSAlan Coopersmith1-4/+2
Excerpt https://lists.gnu.org/archive/html/automake/2012-12/msg00038.html - Support for the long-deprecated INCLUDES variable will be removed altogether in Automake 1.14. The AM_CPPFLAGS variable should be used instead. This variable was deprecated in Automake releases prior to 1.10, which is the current minimum level required to build X. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>