[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

libxkbcommon: Changes to 'debian-unstable'



 .travis.yml                   |    7 
 Makefile.am                   |   46 -
 NEWS                          |   35 
 PACKAGING                     |    2 
 bench/bench.c                 |  151 +++
 bench/bench.h                 |   58 -
 bench/compose.c               |   23 
 bench/key-proc.c              |   23 
 bench/rules.c                 |   23 
 bench/rulescomp.c             |   23 
 configure.ac                  |    8 
 debian/changelog              |    7 
 debian/control                |    4 
 debian/libxkbcommon0.symbols  |    3 
 doc/Doxyfile.in               | 1855 ------------------------------------------
 doc/compat.md                 |    1 
 doc/keymap-format-text-v1.md  |  368 ++++++++
 doc/keymap-format-text-v1.txt |  359 --------
 doc/quick-guide.md            |   24 
 src/compose/parser.c          |   45 -
 src/compose/paths.c           |    9 
 src/context.c                 |    8 
 src/keymap-priv.c             |   10 
 src/keymap.c                  |   34 
 src/keymap.h                  |    5 
 src/state.c                   |   50 -
 src/utils.c                   |   17 
 src/utils.h                   |    4 
 src/xkbcomp/ast-build.c       |   10 
 src/xkbcomp/ast.h             |    1 
 src/xkbcomp/compat.c          |    5 
 src/xkbcomp/keycodes.c        |    4 
 src/xkbcomp/keymap.c          |   10 
 src/xkbcomp/rules.c           |    2 
 src/xkbcomp/scanner.c         |    2 
 src/xkbcomp/symbols.c         |   29 
 src/xkbcomp/types.c           |    5 
 test/.gitignore               |    1 
 test/common.c                 |    2 
 test/compose.c                |   12 
 test/data/keymaps/host.xkb    |   19 
 test/interactive-evdev.c      |    4 
 test/interactive-x11.c        |    4 
 test/keymap.c                 |   58 -
 test/symbols-leak-test.bash   |   24 
 test/x11comp.c                |   74 -
 xkbcommon.map                 |    6 
 xkbcommon/xkbcommon-compose.h |   55 -
 xkbcommon/xkbcommon.h         |   60 +
 49 files changed, 1042 insertions(+), 2547 deletions(-)

New commits:
commit 725fa25c137cbb169f0d9073d8db7528676a9e7b
Author: Michael Stapelberg <michael@stapelberg.de>
Date:   Mon Aug 22 09:14:47 2016 +0200

    New upstream release.

diff --git a/debian/changelog b/debian/changelog
index c5bb46b..1f2ae91 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+libxkbcommon (0.6.1-1) unstable; urgency=medium
+
+  * New upstream release. (Closes: #815867)
+  * Use secure URIs in Vcs-* tags
+
+ -- Michael Stapelberg <stapelberg@debian.org>  Mon, 22 Aug 2016 09:14:43 +0200
+
 libxkbcommon (0.5.0-1) unstable; urgency=medium
 
   * New upstream release.
diff --git a/debian/control b/debian/control
index 5212dd8..b21acdd 100644
--- a/debian/control
+++ b/debian/control
@@ -21,8 +21,8 @@ Build-Depends:
  doxygen,
 Standards-Version: 3.9.5
 Homepage: http://www.xkbcommon.org/
-Vcs-Git: git://anonscm.debian.org/pkg-xorg/lib/libxkbcommon
-Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-xorg/lib/libxkbcommon.git
+Vcs-Git: https://alioth.debian.org/anonscm/git/pkg-xorg/lib/libxkbcommon.git
+Vcs-Browser: https://anonscm.debian.org/gitweb/?p=pkg-xorg/lib/libxkbcommon.git
 
 Package: libxkbcommon0
 Section: libs
diff --git a/debian/libxkbcommon0.symbols b/debian/libxkbcommon0.symbols
index eada08b..9798d21 100644
--- a/debian/libxkbcommon0.symbols
+++ b/debian/libxkbcommon0.symbols
@@ -1,6 +1,7 @@
 libxkbcommon.so.0 libxkbcommon0 #MINVER#
 * Build-Depends-Package: libxkbcommon-dev
  V_0.5.0@V_0.5.0 0.5.0
+ V_0.6.0@V_0.6.0 0.6.1
  xkb_compose_state_feed@V_0.5.0 0.5.0
  xkb_compose_state_get_compose_table@V_0.5.0 0.5.0
  xkb_compose_state_get_one_sym@V_0.5.0 0.5.0
@@ -32,7 +33,9 @@ libxkbcommon.so.0 libxkbcommon0 #MINVER#
  xkb_context_set_user_data@V_0.5.0 0.5.0
  xkb_context_unref@V_0.5.0 0.5.0
  xkb_keymap_get_as_string@V_0.5.0 0.5.0
+ xkb_keymap_key_by_name@V_0.6.0 0.6.1
  xkb_keymap_key_for_each@V_0.5.0 0.5.0
+ xkb_keymap_key_get_name@V_0.6.0 0.6.1
  xkb_keymap_key_get_syms_by_level@V_0.5.0 0.5.0
  xkb_keymap_key_repeats@V_0.5.0 0.5.0
  xkb_keymap_layout_get_index@V_0.5.0 0.5.0

commit 03f5d36b44b7c4cc5cc3bb94658cd6607672e6d3
Author: Daniel Stone <daniels@collabora.com>
Date:   Fri Apr 8 10:28:36 2016 +0100

    Bump version to 0.6.1
    
    Our most minor release yet.
    
    Signed-off-by: Daniel Stone <daniels@collabora.com>

diff --git a/NEWS b/NEWS
index 2f17754..94506e5 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,11 @@
+libxkbcommon 0.6.1 - 2016-04-08
+==================
+
+- Add LICENSE to distributed files in tarball releases.
+
+- Minor typo fix in xkb_keymap_get_as_string() documentation.
+
+
 libxkbcommon 0.6.0 - 2016-03-16
 ==================
 
diff --git a/configure.ac b/configure.ac
index 0dcaebc..cbaf51f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@ dnl Process this file with autoconf to create configure.
 
 # Initialize Autoconf
 AC_PREREQ([2.62])
-AC_INIT([libxkbcommon], [0.6.0],
+AC_INIT([libxkbcommon], [0.6.1],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=libxkbcommon],
         [libxkbcommon], [http://xkbcommon.org])
 AC_CONFIG_SRCDIR([Makefile.am])

commit bea54b1f7db7a171b93cdfb272abc70a694df465
Author: Daniel Stone <daniels@collabora.com>
Date:   Thu Mar 31 16:42:41 2016 +0100

    Add LICENSE to distributed files
    
    Signed-off-by: Daniel Stone <daniels@collabora.com>

diff --git a/Makefile.am b/Makefile.am
index 4115670..e91c484 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -16,6 +16,7 @@ EXTRA_DIST = \
 	xkbcommon.map \
 	xkbcommon-x11.map \
 	PACKAGING \
+	LICENSE \
 	test/symbols-leak-test.bash
 
 AM_CPPFLAGS = \

commit b91584a8f3644d7f8ed41d65e59d4bcc016c5fb1
Author: Ran Benita <ran234@gmail.com>
Date:   Sat Mar 26 01:53:18 2016 +0300

    doc: update reference to compat symbol to its new name
    
    Signed-off-by: Ran Benita <ran234@gmail.com>

diff --git a/xkbcommon/xkbcommon.h b/xkbcommon/xkbcommon.h
index e46ce44..6f96e4f 100644
--- a/xkbcommon/xkbcommon.h
+++ b/xkbcommon/xkbcommon.h
@@ -892,7 +892,7 @@ xkb_keymap_unref(struct xkb_keymap *keymap);
  *
  * @returns The keymap as a NUL-terminated string, or NULL if unsuccessful.
  *
- * The returned string may be fed back into xkb_map_new_from_string() to get
+ * The returned string may be fed back into xkb_keymap_new_from_string() to get
  * the exact same keymap (possibly in another process, etc.).
  *
  * The returned string is dynamically allocated and should be freed by the

commit 3fee46a2186d597c52bc1e06ee14e32ac548b764
Author: Ran Benita <ran234@gmail.com>
Date:   Wed Mar 16 10:18:15 2016 +0200

    Bump version to 0.6.0
    
    Signed-off-by: Ran Benita <ran234@gmail.com>

diff --git a/NEWS b/NEWS
index 02d91d1..2f17754 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-libxkbcommon 0.6.0 - TBD
+libxkbcommon 0.6.0 - 2016-03-16
 ==================
 
 - If the XKB_CONFIG_ROOT environment variable is set, it is used as the XKB
diff --git a/configure.ac b/configure.ac
index 671dca0..0dcaebc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@ dnl Process this file with autoconf to create configure.
 
 # Initialize Autoconf
 AC_PREREQ([2.62])
-AC_INIT([libxkbcommon], [0.5.0],
+AC_INIT([libxkbcommon], [0.6.0],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=libxkbcommon],
         [libxkbcommon], [http://xkbcommon.org])
 AC_CONFIG_SRCDIR([Makefile.am])

commit 4c24f7faa8bc71589538e8b07ea8b64c84c11b5c
Author: Ran Benita <ran234@gmail.com>
Date:   Tue Mar 15 20:42:21 2016 +0200

    test: assert/ignore some warn_unused_result's
    
    Signed-off-by: Ran Benita <ran234@gmail.com>

diff --git a/bench/bench.c b/bench/bench.c
index 9bb535c..37e41f5 100644
--- a/bench/bench.c
+++ b/bench/bench.c
@@ -33,6 +33,7 @@
 #include <sys/time.h>
 #endif
 
+#include <assert.h>
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
@@ -77,7 +78,7 @@ bench_timer_start(struct bench_timer *self)
 #if defined(USE_CLOCK_GETTIME)
     struct timespec val;
 
-    (void)clock_gettime(CLOCK_MONOTONIC, &val);
+    (void) clock_gettime(CLOCK_MONOTONIC, &val);
 
     /* With conversion from nanosecond to millisecond */
     set_bench_time(&self->start, val.tv_sec, val.tv_nsec / 1000);
@@ -93,7 +94,7 @@ bench_timer_start(struct bench_timer *self)
 #else
     struct timeval val;
 
-    (void)gettimeofday(&val, NULL);
+    (void) gettimeofday(&val, NULL);
 
     set_bench_time(&self->start, val.tv_sec, val.tv_usec);
 #endif
@@ -105,7 +106,7 @@ bench_timer_stop(struct bench_timer *self)
 #if defined(USE_CLOCK_GETTIME)
     struct timespec val;
 
-    (void)clock_gettime(CLOCK_MONOTONIC, &val);
+    (void) clock_gettime(CLOCK_MONOTONIC, &val);
 
     /* With conversion from nanosecond to millisecond */
     set_bench_time(&self->stop, val.tv_sec, val.tv_nsec / 1000);
@@ -121,7 +122,7 @@ bench_timer_stop(struct bench_timer *self)
 #else
     struct timeval val;
 
-    (void)gettimeofday(&val, NULL);
+    (void) gettimeofday(&val, NULL);
 
     set_bench_time(&self->stop, val.tv_sec, val.tv_usec);
 #endif
@@ -139,10 +140,12 @@ bench_timer_get_elapsed_time_str(struct bench_timer *self)
 {
     struct bench_time elapsed;
     char *buf;
+    int ret;
 
     bench_timer_get_elapsed_time(self, &elapsed);
     normalize_bench_time(&elapsed);
-    asprintf(&buf, "%ld.%06ld", elapsed.seconds, elapsed.milliseconds);
+    ret = asprintf(&buf, "%ld.%06ld", elapsed.seconds, elapsed.milliseconds);
+    assert(ret >= 0);
 
     return buf;
 }
diff --git a/test/interactive-evdev.c b/test/interactive-evdev.c
index 04a347f..7fdc069 100644
--- a/test/interactive-evdev.c
+++ b/test/interactive-evdev.c
@@ -483,14 +483,14 @@ main(int argc, char *argv[])
     sigaction(SIGTERM, &act, NULL);
 
     /* Instead of fiddling with termios.. */
-    system("stty -echo");
+    (void) system("stty -echo");
 
     ret = loop(kbds);
     if (ret)
         goto err_stty;
 
 err_stty:
-    system("stty echo");
+    (void) system("stty echo");
     free_keyboards(kbds);
 err_compose:
     xkb_compose_table_unref(compose_table);
diff --git a/test/interactive-x11.c b/test/interactive-x11.c
index d720004..34ad654 100644
--- a/test/interactive-x11.c
+++ b/test/interactive-x11.c
@@ -372,9 +372,9 @@ main(int argc, char *argv[])
         goto err_core_kbd;
     }
 
-    system("stty -echo");
+    (void) system("stty -echo");
     ret = loop(conn, &core_kbd);
-    system("stty echo");
+    (void) system("stty echo");
 
 err_core_kbd:
     deinit_kbd(&core_kbd);

commit ba3e6ce7f258c017e44b85cb14bbdaea872a67b9
Author: Ran Benita <ran234@gmail.com>
Date:   Tue Mar 15 19:44:48 2016 +0200

    travis: remove --disable-x11
    
    Looks like the CI machines can use Ubuntu 14.04, which has libxcb 1.10,
    which is new enough. Lets see if it works.
    
    Signed-off-by: Ran Benita <ran234@gmail.com>

diff --git a/.travis.yml b/.travis.yml
index 4b2a66a..10cc6ab 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,12 +1,13 @@
+sudo: required
+dist: trusty
 language: c
 
 before_install:
     - sudo apt-get update -qq
-    - sudo apt-get install xutils-dev doxygen
+    - sudo apt-get -y install xutils-dev doxygen libxcb-xkb-dev
 
 compiler:
     - gcc
     - clang
 
-# libxcb too old -- should enable when possible.
-script: ./autogen.sh --disable-x11 && make && make check
+script: ./autogen.sh && make && make check

commit b04344ff631d5c0564b7cd23b8ec346620d1c2ca
Author: Daniel Stone <daniels@collabora.com>
Date:   Tue Mar 15 11:30:57 2016 +0000

    travis: Enable documentation build
    
    Make sure Doxygen is installed before we build.
    
    Signed-off-by: Daniel Stone <daniels@collabora.com>

diff --git a/.travis.yml b/.travis.yml
index 88dd261..4b2a66a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -2,7 +2,7 @@ language: c
 
 before_install:
     - sudo apt-get update -qq
-    - sudo apt-get install xutils-dev
+    - sudo apt-get install xutils-dev doxygen
 
 compiler:
     - gcc

commit a2974d5f8a9740f37cfab4d309c64ab0cd6818ad
Author: Daniel Stone <daniels@collabora.com>
Date:   Tue Mar 15 11:20:35 2016 +0000

    doc: Fix Doxygen include for srcdir != builddir
    
    Instead of giving Doxygen a series of absolute paths to the source
    files and a relative path to the output directory, run it from the
    source directory with purely relative paths to the source files, and
    give it an absolute path to the build directory.
    
    This fixes the parsing of README.md with a separate build directory,
    since the relative includes for doc/quick-guide.md and doc/compat.md
    don't resolve otherwise. Doxygen's INCLUDE_PATH turns out not to fix
    this either, since that's just a set of paths to open and parse, rather
    than an analogue to cpp's -I.
    
    Signed-off-by: Daniel Stone <daniels@collabora.com>

diff --git a/Makefile.am b/Makefile.am
index 232d8e5..4115670 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -151,7 +151,7 @@ all-local:: doc
 clean-local:: clean-doc
 
 doc/stamp-doxygen: $(top_srcdir)/xkbcommon/*.h
-	$(AM_V_GEN)$(DOXYGEN) doc/Doxyfile
+	$(AM_V_GEN)(cd $(top_srcdir) && $(DOXYGEN) $(abs_top_builddir)/doc/Doxyfile)
 	touch $@
 
 clean-doxygen:
diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in
index c71d3a9..36d517d 100644
--- a/doc/Doxyfile.in
+++ b/doc/Doxyfile.in
@@ -2,7 +2,7 @@ PROJECT_NAME           = @PACKAGE_NAME@
 
 PROJECT_NUMBER         = @PACKAGE_VERSION@
 
-OUTPUT_DIRECTORY       = doc
+OUTPUT_DIRECTORY       = @abs_top_builddir@/doc
 
 BRIEF_MEMBER_DESC      = NO
 
@@ -18,13 +18,13 @@ QUIET                  = YES
 
 WARN_IF_UNDOCUMENTED   = NO
 
-INPUT                  = @abs_top_srcdir@/README.md \
-                         @abs_top_srcdir@/doc/quick-guide.md \
-                         @abs_top_srcdir@/doc/compat.md \
-                         @abs_top_srcdir@/xkbcommon/xkbcommon.h \
-                         @abs_top_srcdir@/xkbcommon/xkbcommon-names.h \
-                         @abs_top_srcdir@/xkbcommon/xkbcommon-x11.h \
-                         @abs_top_srcdir@/xkbcommon/xkbcommon-compose.h \
+INPUT                  = README.md \
+                         doc/quick-guide.md \
+                         doc/compat.md \
+                         xkbcommon/xkbcommon.h \
+                         xkbcommon/xkbcommon-names.h \
+                         xkbcommon/xkbcommon-x11.h \
+                         xkbcommon/xkbcommon-compose.h \
 
 FILE_PATTERNS          = *.c \
                          *.h
@@ -40,7 +40,7 @@ ALPHABETICAL_INDEX     = NO
 IGNORE_PREFIX          = xkb_ \
                          XKB_
 
-HTML_EXTRA_STYLESHEET  = @abs_top_srcdir@/doc/doxygen-extra.css
+HTML_EXTRA_STYLESHEET  = doc/doxygen-extra.css
 
 HTML_TIMESTAMP         = NO
 

commit d627549c61cd27da881f8287a4a29f75aad19578
Author: Ran Benita <ran234@gmail.com>
Date:   Sun Mar 13 23:38:40 2016 +0200

    Update NEWS
    
    Signed-off-by: Ran Benita <ran234@gmail.com>

diff --git a/NEWS b/NEWS
index 39e6b93..02d91d1 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,26 @@
+libxkbcommon 0.6.0 - TBD
+==================
+
+- If the XKB_CONFIG_ROOT environment variable is set, it is used as the XKB
+  configuration root instead of the path determined at build time.
+
+- Tests and benchmarks now build correctly on OSX.
+
+- An XKB keymap provides a name for each key it defines.  Traditionally,
+  these names are limited to at most 4 characters, and are thus somewhat
+  obscure, but might still be useful (xkbcommon lifts the 4 character limit).
+
+  The new functions xkb_keymap_key_get_name() and xkb_keymap_key_by_name()
+  can be used to get the name of a key or find a key by name.  Note that
+  a key may have aliases.
+
+- Documentation improvements.
+
+- New API:
+  xkb_keymap_key_by_name()
+  xkb_keymap_key_get_name()
+
+
 libxkbcommon 0.5.0 - 2014-10-18
 ==================
 

commit 919b97a83739bd9b810670cb0bbcf7651d82b964
Author: Ran Benita <ran234@gmail.com>
Date:   Sun Mar 13 23:33:18 2016 +0200

    NEWS: add some spacing
    
    Signed-off-by: Ran Benita <ran234@gmail.com>

diff --git a/NEWS b/NEWS
index bec2bd9..39e6b93 100644
--- a/NEWS
+++ b/NEWS
@@ -42,6 +42,7 @@ libxkbcommon 0.5.0 - 2014-10-18
   XKB_COMPOSE_*
   xkb_compose_*
 
+
 libxkbcommon 0.4.3 - 2014-08-19
 ==================
 
@@ -65,6 +66,7 @@ libxkbcommon 0.4.3 - 2014-08-19
 - Fixed memory leaks after parse errors in the XKB yacc parser.
   The fix required changes which are currently incompatible with byacc.
 
+
 libxkbcommon 0.4.2 - 2014-05-15
 ==================
 
@@ -87,6 +89,7 @@ libxkbcommon 0.4.2 - 2014-05-15
   Note: it seems impossible to trigger in the current code since the input
   size cannot exceed the required size.
 
+
 libxkbcommon 0.4.1 - 2014-03-27
 ==================
 
@@ -130,6 +133,7 @@ libxkbcommon 0.4.1 - 2014-03-27
 
 - Bug fixes.
 
+
 libxkbcommon 0.4.0 - 2014-02-02
 ==================
 

commit 914e84e0188b5fbd67855f38f4499bb1412f4516
Author: Ran Benita <ran234@gmail.com>
Date:   Sun Mar 13 23:09:21 2016 +0200

    build: don't run test/x11comp in make check for now
    
    For some reason, the dumped keymap started repeating the two key types
    FOUR_LEVEL_PLUS_LOCK and FOUR_LEVEL_KEYPAD. I need to investigate, but
    let's disable it for now until I do (the problem would likely not be in
    the xkbcommon - at most in the test itself).
    
    Signed-off-by: Ran Benita <ran234@gmail.com>

diff --git a/Makefile.am b/Makefile.am
index b77d0d9..232d8e5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -235,9 +235,11 @@ endif BUILD_LINUX_TESTS
 
 if ENABLE_X11
 build_run_tests += \
-	test/x11 \
-	test/x11comp
+	test/x11
+# test/x11comp is meant to be run, but it is (temporarily?) disabled.
+# See: https://github.com/xkbcommon/libxkbcommon/issues/30
 build_only_tests += \
+	test/x11comp \
 	test/interactive-x11
 
 TESTS_X11_LDADD = $(XCB_XKB_LIBS) $(TESTS_LDADD) libxkbcommon-x11.la

commit 37ee8e652b04f1a6e47891aa83a6eb0588b63c19
Author: Ran Benita <ran234@gmail.com>
Date:   Sun Mar 13 22:56:48 2016 +0200

    test/x11comp: fix memory leak
    
    Signed-off-by: Ran Benita <ran234@gmail.com>

diff --git a/test/x11comp.c b/test/x11comp.c
index bf5bbe7..6df861a 100644
--- a/test/x11comp.c
+++ b/test/x11comp.c
@@ -50,7 +50,7 @@ main(void)
                              NULL };
     pid_t xkbcomp_pid;
 
-    char *xhost;
+    char *xhost = NULL;
     int xdpy_current;
     int xdpy_candidate;
 
@@ -88,6 +88,7 @@ main(void)
             break;
         }
     }
+    free(xhost);
     if (ret != 0) {
         ret = SKIP_TEST;
         goto err_ctx;

commit fa1b4543282413598e6f33f58903bfd55f0703e9
Author: Ran Benita <ran234@gmail.com>
Date:   Sun Mar 13 20:56:58 2016 +0200

    test: add a test that all symbol version file is updated
    
    It is easy to forget to update these files when adding new symbols.
    
    Stolen with slight changes from libinput (commit by Marek Chalupa):
    https://cgit.freedesktop.org/wayland/libinput/commit/?id=a9f216ab47ea2f643f20ed741b741a2b5766eba3
    
    Signed-off-by: Ran Benita <ran234@gmail.com>

diff --git a/Makefile.am b/Makefile.am
index 3e3a0c1..b77d0d9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -15,7 +15,8 @@ EXTRA_DIST = \
 	doc/doxygen-extra.css \
 	xkbcommon.map \
 	xkbcommon-x11.map \
-	PACKAGING
+	PACKAGING \
+	test/symbols-leak-test.bash
 
 AM_CPPFLAGS = \
 	-DDFLT_XKB_CONFIG_ROOT='"$(XKBCONFIGROOT)"' \
@@ -181,7 +182,8 @@ libtest_la_SOURCES = \
 AM_TESTS_ENVIRONMENT = \
 	XKB_LOG_LEVEL=debug; export XKB_LOG_LEVEL; \
 	XKB_LOG_VERBOSITY=10; export XKB_LOG_VERBOSITY; \
-	$(XORG_MALLOC_DEBUG_ENV)
+	$(XORG_MALLOC_DEBUG_ENV) \
+	top_srcdir=$(top_srcdir)
 
 build_run_tests = \
 	test/keysym \
@@ -201,6 +203,8 @@ build_run_tests = \
 build_only_tests = \
 	test/rmlvo-to-kccgst \
 	test/print-compiled-keymap
+run_only_tests = \
+	test/symbols-leak-test.bash
 
 TESTS_LDADD = libtest.la
 
@@ -248,7 +252,7 @@ test_interactive_x11_CFLAGS = $(TESTS_X11_CFLAGS)
 endif ENABLE_X11
 
 check_PROGRAMS = $(build_run_tests) $(build_only_tests)
-TESTS = $(build_run_tests)
+TESTS = $(build_run_tests) $(run_only_tests)
 
 ##
 # Benchmarks
diff --git a/test/symbols-leak-test.bash b/test/symbols-leak-test.bash
new file mode 100755
index 0000000..eac0da5
--- /dev/null
+++ b/test/symbols-leak-test.bash
@@ -0,0 +1,24 @@
+#!/bin/bash
+set -e
+
+# Check that all exported symbols are specified in the symbol
+# version scripts.  If this fails, please update the appropriate
+# (adding new version nodes when needed).
+
+# xkbcommon symbols
+diff -a -u \
+    <(cat "$top_srcdir"/xkbcommon.map | \
+        grep '^\s\+xkb_.*' | \
+        sed -e 's/^\s\+\(.*\);/\1/' | sort) \
+    <(cat "$top_srcdir"/src/{,xkbcomp,compose}/*.c | \
+        grep XKB_EXPORT -A 1 | grep '^xkb_.*' | \
+        sed -e 's/(.*//' | sort)
+
+# xkbcommon-x11 symbols
+diff -a -u \
+    <(cat "$top_srcdir"/xkbcommon-x11.map | \
+        grep '^\s\+xkb_.*' | \
+        sed -e 's/^\s\+\(.*\);/\1/' | sort) \
+    <(cat "$top_srcdir"/src/x11/*.c | \
+        grep XKB_EXPORT -A 1 | grep '^xkb_.*' | \
+        sed -e 's/(.*//' | sort)

commit 1c6d21b45fc98b3bc9ba6e2e0c6c73a6f000ff42
Author: Ran Benita <ran234@gmail.com>
Date:   Sun Mar 13 20:42:39 2016 +0200

    Add symbol versions forgotten in 0ce17ef3ea3722c1cfe7af3
    
    Signed-off-by: Ran Benita <ran234@gmail.com>

diff --git a/xkbcommon.map b/xkbcommon.map
index 29fd7ac..ac01fcb 100644
--- a/xkbcommon.map
+++ b/xkbcommon.map
@@ -85,3 +85,9 @@ global:
 local:
 	*;
 };
+
+V_0.6.0 {
+global:
+	xkb_keymap_key_get_name;
+	xkb_keymap_key_by_name;
+} V_0.5.0;

commit 712b39ac7d9d718ee4940b7e3d0d56c4f4d549e8
Author: Ran Benita <ran234@gmail.com>
Date:   Sun Mar 13 21:32:28 2016 +0200

    build: make it easier to add non-built (e.g. script) tests
    
    Signed-off-by: Ran Benita <ran234@gmail.com>

diff --git a/Makefile.am b/Makefile.am
index 460cff3..3e3a0c1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -183,7 +183,7 @@ AM_TESTS_ENVIRONMENT = \
 	XKB_LOG_VERBOSITY=10; export XKB_LOG_VERBOSITY; \
 	$(XORG_MALLOC_DEBUG_ENV)
 
-TESTS = \
+build_run_tests = \
 	test/keysym \
 	test/keymap \
 	test/filecomp \
@@ -198,7 +198,7 @@ TESTS = \
 	test/keyseq \
 	test/rulescomp \
 	test/compose
-check_PROGRAMS = \
+build_only_tests = \
 	test/rmlvo-to-kccgst \
 	test/print-compiled-keymap
 
@@ -223,17 +223,17 @@ test_print_compiled_keymap_LDADD = $(TESTS_LDADD)
 test_compose_LDADD = $(TESTS_LDADD) $(RT_LIBS)
 
 if BUILD_LINUX_TESTS
-check_PROGRAMS += \
+build_only_tests += \
 	test/interactive-evdev
 
 test_interactive_evdev_LDADD = $(TESTS_LDADD)
 endif BUILD_LINUX_TESTS
 
 if ENABLE_X11
-TESTS += \
+build_run_tests += \
 	test/x11 \
 	test/x11comp
-check_PROGRAMS += \
+build_only_tests += \
 	test/interactive-x11
 
 TESTS_X11_LDADD = $(XCB_XKB_LIBS) $(TESTS_LDADD) libxkbcommon-x11.la
@@ -247,7 +247,8 @@ test_interactive_x11_LDADD = $(TESTS_X11_LDADD)
 test_interactive_x11_CFLAGS = $(TESTS_X11_CFLAGS)
 endif ENABLE_X11
 
-check_PROGRAMS += $(TESTS)
+check_PROGRAMS = $(build_run_tests) $(build_only_tests)
+TESTS = $(build_run_tests)
 
 ##
 # Benchmarks

commit 763e2b7e535b501b2fdd4a0c207ca424d0390d48
Author: Ran Benita <ran234@gmail.com>
Date:   Sun Mar 13 20:24:44 2016 +0200

    src/utils: check if fileno() failed in map_file
    
    fileno() can fail, if called on e.g. fmemopen() FILEs which are not
    backed by a file descriptor. This functions uses mmap to map the entire
    file to memory, so using such FILEs will not work.
    
    (There is actually no change of behavior here, since the following fstat
    would have already failed with EBADF. But lets make it clear.)
    
    Another possibility is to fall back to the !HAVE_MMAP case; but it
    sounds like a better idea to leave it to the programmer to use the
    new_from_string/new_from_buffer functions instead, instead of doing
    double allocation behind their back.
    
    Signed-off-by: Ran Benita <ran234@gmail.com>

diff --git a/src/utils.c b/src/utils.c
index c417106..d725bbd 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -35,10 +35,13 @@ bool
 map_file(FILE *file, char **string_out, size_t *size_out)
 {
     struct stat stat_buf;
-    const int fd = fileno(file);
+    int fd;
     char *string;
 
     /* Make sure to keep the errno on failure! */
+    fd = fileno(file);
+    if (fd < 0)
+        return false;
 
     if (fstat(fd, &stat_buf) != 0)
         return false;

commit 39082082f6716e7ffca78566db506edbd6822b53
Author: Ran Benita <ran234@gmail.com>
Date:   Sun Feb 28 00:33:19 2016 +0200

    keymap: share LevelsSameSyms()
    
    The function is generic enough.
    
    Signed-off-by: Ran Benita <ran234@gmail.com>

diff --git a/src/keymap-priv.c b/src/keymap-priv.c
index d21dda7..08945ca 100644
--- a/src/keymap-priv.c
+++ b/src/keymap-priv.c
@@ -137,3 +137,13 @@ XkbModNameToIndex(const struct xkb_mod_set *mods, xkb_atom_t name,
 
     return XKB_MOD_INVALID;
 }
+
+bool
+XkbLevelsSameSyms(const struct xkb_level *a, const struct xkb_level *b)
+{
+    if (a->num_syms != b->num_syms)
+        return false;
+    if (a->num_syms <= 1)
+        return a->u.sym == b->u.sym;
+    return memcmp(a->u.syms, b->u.syms, sizeof(*a->u.syms) * a->num_syms) == 0;
+}
diff --git a/src/keymap.h b/src/keymap.h
index d20442f..1093e47 100644
--- a/src/keymap.h
+++ b/src/keymap.h
@@ -455,6 +455,9 @@ xkb_mod_index_t
 XkbModNameToIndex(const struct xkb_mod_set *mods, xkb_atom_t name,
                   enum mod_type type);
 
+bool
+XkbLevelsSameSyms(const struct xkb_level *a, const struct xkb_level *b);
+
 xkb_layout_index_t
 XkbWrapGroupIntoRange(int32_t group,
                       xkb_layout_index_t num_groups,
diff --git a/src/xkbcomp/symbols.c b/src/xkbcomp/symbols.c
index cda93b0..9b05ec9 100644
--- a/src/xkbcomp/symbols.c
+++ b/src/xkbcomp/symbols.c
@@ -218,19 +218,6 @@ KeyInfoText(SymbolsInfo *info, KeyInfo *keyi)
 }
 
 static bool
-LevelsSameSyms(const struct xkb_level *a, const struct xkb_level *b)
-{
-    if (a->num_syms != b->num_syms)
-        return false;
-    if (a->num_syms <= 1)
-        return a->u.sym == b->u.sym;
-    else
-        return memcmp(a->u.syms, b->u.syms,
-                      sizeof(*a->u.syms) * a->num_syms) == 0;
-
-}
-
-static bool
 MergeGroups(SymbolsInfo *info, GroupInfo *into, GroupInfo *from, bool clobber,
             bool report, xkb_layout_index_t group, xkb_atom_t key_name)
 {
@@ -312,7 +299,7 @@ MergeGroups(SymbolsInfo *info, GroupInfo *into, GroupInfo *from, bool clobber,
                 intoLevel->u.sym = fromLevel->u.sym;
             fromLevel->num_syms = 0;
         }
-        else if (!LevelsSameSyms(fromLevel, intoLevel)) {
+        else if (!XkbLevelsSameSyms(fromLevel, intoLevel)) {
             if (report)
                 log_warn(info->ctx,
                          "Multiple symbols for level %d/group %u on key %s; "

commit c8a25645885517e258935c23e7bd57e5c357ef94
Author: Ran Benita <ran234@gmail.com>
Date:   Sun Feb 28 00:02:05 2016 +0200

    state: factor out get_entry_for_mods()
    
    Will be useful later.
    
    Signed-off-by: Ran Benita <ran234@gmail.com>

diff --git a/src/state.c b/src/state.c
index 67fceb4..a45315d 100644
--- a/src/state.c
+++ b/src/state.c
@@ -128,20 +128,24 @@ entry_is_active(const struct xkb_key_type_entry *entry)
 }
 
 static const struct xkb_key_type_entry *
-get_entry_for_key_state(struct xkb_state *state, const struct xkb_key *key,
-                        xkb_layout_index_t group)
+get_entry_for_mods(const struct xkb_key_type *type, xkb_mod_mask_t mods)
 {
-    const struct xkb_key_type *type = key->groups[group].type;
-    xkb_mod_mask_t active_mods = state->components.mods & type->mods.mask;
-
     for (unsigned i = 0; i < type->num_entries; i++)
         if (entry_is_active(&type->entries[i]) &&
-            type->entries[i].mods.mask == active_mods)
+            type->entries[i].mods.mask == mods)
             return &type->entries[i];
-
     return NULL;
 }
 
+static const struct xkb_key_type_entry *
+get_entry_for_key_state(struct xkb_state *state, const struct xkb_key *key,
+                        xkb_layout_index_t group)
+{
+    const struct xkb_key_type *type = key->groups[group].type;
+    xkb_mod_mask_t active_mods = state->components.mods & type->mods.mask;
+    return get_entry_for_mods(type, active_mods);
+}
+
 /**
  * Returns the level to use for the given key and state, or
  * XKB_LEVEL_INVALID.

commit 9f5139b5eaf5e29c28161b8e0df1adf2d247036b
Author: Ran Benita <ran234@gmail.com>
Date:   Sat Feb 27 19:43:07 2016 +0200

    state: factor out entry_is_active() check
    
    Makes the code slightly cleaner and I plan to use the function in
    another place.
    
    Signed-off-by: Ran Benita <ran234@gmail.com>

diff --git a/src/state.c b/src/state.c
index 83ff872..67fceb4 100644
--- a/src/state.c
+++ b/src/state.c
@@ -116,6 +116,17 @@ struct xkb_state {
     struct xkb_keymap *keymap;
 };
 
+/*
+ * If the virtual modifiers are not bound to anything, the entry
+ * is not active and should be skipped. xserver does this with
+ * cached entry->active field.
+ */
+static bool
+entry_is_active(const struct xkb_key_type_entry *entry)
+{
+    return entry->mods.mods == 0 || entry->mods.mask != 0;
+}
+
 static const struct xkb_key_type_entry *
 get_entry_for_key_state(struct xkb_state *state, const struct xkb_key *key,
                         xkb_layout_index_t group)
@@ -123,18 +134,10 @@ get_entry_for_key_state(struct xkb_state *state, const struct xkb_key *key,
     const struct xkb_key_type *type = key->groups[group].type;
     xkb_mod_mask_t active_mods = state->components.mods & type->mods.mask;
 
-    for (unsigned i = 0; i < type->num_entries; i++) {
-        /*
-         * If the virtual modifiers are not bound to anything, we're
-         * supposed to skip the entry (xserver does this with cached
-         * entry->active field).
-         */
-        if (type->entries[i].mods.mods != 0 && type->entries[i].mods.mask == 0)
-            continue;
-
-        if (type->entries[i].mods.mask == active_mods)
+    for (unsigned i = 0; i < type->num_entries; i++)
+        if (entry_is_active(&type->entries[i]) &&
+            type->entries[i].mods.mask == active_mods)
             return &type->entries[i];
-    }


Reply to: