[-]
[+]
|
Added |
libxkbcommon.changes
|
|
[-]
[+]
|
Changed |
libxkbcommon.spec
^
|
|
[-]
[+]
|
Deleted |
libxkbcommon-0.3.2.tar.xz/Makefile.in
^
|
@@ -1,2144 +0,0 @@
-# Makefile.in generated by automake 1.14 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
- case $${target_option-} in \
- ?) ;; \
- *) echo "am__make_running_with_option: internal error: invalid" \
- "target option '$${target_option-}' specified" >&2; \
- exit 1;; \
- esac; \
- has_opt=no; \
- sane_makeflags=$$MAKEFLAGS; \
- if $(am__is_gnu_make); then \
- sane_makeflags=$$MFLAGS; \
- else \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- bs=\\; \
- sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
- | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
- esac; \
- fi; \
- skip_next=no; \
- strip_trailopt () \
- { \
- flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
- }; \
- for flg in $$sane_makeflags; do \
- test $$skip_next = yes && { skip_next=no; continue; }; \
- case $$flg in \
- *=*|--*) continue;; \
- -*I) strip_trailopt 'I'; skip_next=yes;; \
- -*I?*) strip_trailopt 'I';; \
- -*O) strip_trailopt 'O'; skip_next=yes;; \
- -*O?*) strip_trailopt 'O';; \
- -*l) strip_trailopt 'l'; skip_next=yes;; \
- -*l?*) strip_trailopt 'l';; \
- -[dEDm]) skip_next=yes;; \
- -[JT]) skip_next=yes;; \
- esac; \
- case $$flg in \
- *$$target_option*) has_opt=yes; break;; \
- esac; \
- done; \
- test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-TESTS = test/keysym$(EXEEXT) test/filecomp$(EXEEXT) \
- test/context$(EXEEXT) test/rules-file$(EXEEXT) \
- test/stringcomp$(EXEEXT) test/buffercomp$(EXEEXT) \
- test/log$(EXEEXT) $(am__EXEEXT_1)
-check_PROGRAMS = $(am__EXEEXT_2) test/rmlvo-to-kccgst$(EXEEXT) \
- test/print-compiled-keymap$(EXEEXT) \
- test/bench-key-proc$(EXEEXT) $(am__EXEEXT_3)
-@BUILD_LINUX_TESTS_TRUE@am__append_1 = \
-@BUILD_LINUX_TESTS_TRUE@ test/state \
-@BUILD_LINUX_TESTS_TRUE@ test/keyseq \
-@BUILD_LINUX_TESTS_TRUE@ test/rulescomp
-
-@BUILD_LINUX_TESTS_TRUE@am__append_2 = \
-@BUILD_LINUX_TESTS_TRUE@ test/interactive
-
-subdir = .
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/configure $(am__configure_deps) \
- $(top_srcdir)/src/config.h.in \
- $(srcdir)/xkbcommon-uninstalled.pc.in \
- $(srcdir)/xkbcommon.pc.in $(top_srcdir)/doc/Doxyfile.in \
- src/xkbcomp/parser.h src/xkbcomp/parser.c \
- $(top_srcdir)/build-aux/depcomp $(top_srcdir)/build-aux/ylwrap \
- $(xkbcommoninclude_HEADERS) \
- $(top_srcdir)/build-aux/test-driver COPYING NEWS README \
- build-aux/compile build-aux/config.guess build-aux/config.sub \
- build-aux/depcomp build-aux/install-sh build-aux/missing \
- build-aux/ylwrap build-aux/ltmain.sh \
- $(top_srcdir)/build-aux/compile \
- $(top_srcdir)/build-aux/config.guess \
- $(top_srcdir)/build-aux/config.sub \
- $(top_srcdir)/build-aux/install-sh \
- $(top_srcdir)/build-aux/ltmain.sh \
- $(top_srcdir)/build-aux/missing
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
- $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
- $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
- configure.lineno config.status.lineno
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/src/config.h
-CONFIG_CLEAN_FILES = xkbcommon-uninstalled.pc xkbcommon.pc \
- doc/Doxyfile
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
- $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
- *) f=$$p;; \
- esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
- srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
- for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
- for p in $$list; do echo "$$p $$p"; done | \
- sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
- $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
- if (++n[$$2] == $(am__install_max)) \
- { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
- END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
- sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
- sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
- test -z "$$files" \
- || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
- || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
- $(am__cd) "$$dir" && rm -f $$files; }; \
- }
-am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" \
- "$(DESTDIR)$(xkbcommonincludedir)"
-LTLIBRARIES = $(lib_LTLIBRARIES)
-libtest_la_LIBADD =
-am__dirstamp = $(am__leading_dot)dirstamp
-am__objects_1 = src/xkbcomp/libtest_la-action.lo \
- src/xkbcomp/libtest_la-ast-build.lo \
- src/xkbcomp/libtest_la-compat.lo \
- src/xkbcomp/libtest_la-expr.lo \
- src/xkbcomp/libtest_la-include.lo \
- src/xkbcomp/libtest_la-keycodes.lo \
- src/xkbcomp/libtest_la-keymap.lo \
- src/xkbcomp/libtest_la-keymap-dump.lo \
- src/xkbcomp/libtest_la-keywords.lo \
- src/xkbcomp/libtest_la-parser.lo \
- src/xkbcomp/libtest_la-rules.lo \
- src/xkbcomp/libtest_la-scanner.lo \
- src/xkbcomp/libtest_la-symbols.lo \
- src/xkbcomp/libtest_la-types.lo src/xkbcomp/libtest_la-vmod.lo \
- src/xkbcomp/libtest_la-xkbcomp.lo src/libtest_la-atom.lo \
- src/libtest_la-context.lo src/libtest_la-compat.lo \
- src/libtest_la-keysym.lo src/libtest_la-keysym-utf.lo \
- src/libtest_la-keymap.lo src/libtest_la-state.lo \
- src/libtest_la-text.lo src/libtest_la-utils.lo
-am_libtest_la_OBJECTS = $(am__objects_1) test/libtest_la-common.lo
-libtest_la_OBJECTS = $(am_libtest_la_OBJECTS)
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 =
-libtest_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libtest_la_CFLAGS) \
- $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-libxkbcommon_la_LIBADD =
-am_libxkbcommon_la_OBJECTS = src/xkbcomp/action.lo \
- src/xkbcomp/ast-build.lo src/xkbcomp/compat.lo \
- src/xkbcomp/expr.lo src/xkbcomp/include.lo \
- src/xkbcomp/keycodes.lo src/xkbcomp/keymap.lo \
- src/xkbcomp/keymap-dump.lo src/xkbcomp/keywords.lo \
- src/xkbcomp/parser.lo src/xkbcomp/rules.lo \
- src/xkbcomp/scanner.lo src/xkbcomp/symbols.lo \
- src/xkbcomp/types.lo src/xkbcomp/vmod.lo \
|
[-]
[+]
|
Deleted |
libxkbcommon-0.3.2.tar.xz/aclocal.m4
^
|
@@ -1,3258 +0,0 @@
-# generated automatically by aclocal 1.14 -*- Autoconf -*-
-
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
-
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
-m4_ifndef([AC_AUTOCONF_VERSION],
- [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
-[m4_warning([this file was generated for autoconf 2.69.
-You have another version of autoconf. It may work, but is not guaranteed to.
-If you have problems, you may need to regenerate the build system entirely.
-To do so, use the procedure documented by the package, typically 'autoreconf'.])])
-
-# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
-# serial 1 (pkg-config-0.24)
-#
-# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# PKG_PROG_PKG_CONFIG([MIN-VERSION])
-# ----------------------------------
-AC_DEFUN([PKG_PROG_PKG_CONFIG],
-[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
-m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
-m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
-AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
-AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
-AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
-
-if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
- AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
-fi
-if test -n "$PKG_CONFIG"; then
- _pkg_min_version=m4_default([$1], [0.9.0])
- AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
- if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
- PKG_CONFIG=""
- fi
-fi[]dnl
-])# PKG_PROG_PKG_CONFIG
-
-# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-#
-# Check to see whether a particular set of modules exists. Similar
-# to PKG_CHECK_MODULES(), but does not set variables or print errors.
-#
-# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
-# only at the first occurence in configure.ac, so if the first place
-# it's called might be skipped (such as if it is within an "if", you
-# have to call PKG_CHECK_EXISTS manually
-# --------------------------------------------------------------
-AC_DEFUN([PKG_CHECK_EXISTS],
-[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
-if test -n "$PKG_CONFIG" && \
- AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
- m4_default([$2], [:])
-m4_ifvaln([$3], [else
- $3])dnl
-fi])
-
-# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
-# ---------------------------------------------
-m4_define([_PKG_CONFIG],
-[if test -n "$$1"; then
- pkg_cv_[]$1="$$1"
- elif test -n "$PKG_CONFIG"; then
- PKG_CHECK_EXISTS([$3],
- [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
- test "x$?" != "x0" && pkg_failed=yes ],
- [pkg_failed=yes])
- else
- pkg_failed=untried
-fi[]dnl
-])# _PKG_CONFIG
-
-# _PKG_SHORT_ERRORS_SUPPORTED
-# -----------------------------
-AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
-[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
- _pkg_short_errors_supported=yes
-else
- _pkg_short_errors_supported=no
-fi[]dnl
-])# _PKG_SHORT_ERRORS_SUPPORTED
-
-
-# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
-# [ACTION-IF-NOT-FOUND])
-#
-#
-# Note that if there is a possibility the first call to
-# PKG_CHECK_MODULES might not happen, you should be sure to include an
-# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
-#
-#
-# --------------------------------------------------------------
-AC_DEFUN([PKG_CHECK_MODULES],
-[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
-AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
-AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
-
-pkg_failed=no
-AC_MSG_CHECKING([for $1])
-
-_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
-_PKG_CONFIG([$1][_LIBS], [libs], [$2])
-
-m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
-and $1[]_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details.])
-
-if test $pkg_failed = yes; then
- AC_MSG_RESULT([no])
- _PKG_SHORT_ERRORS_SUPPORTED
- if test $_pkg_short_errors_supported = yes; then
- $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
- else
- $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
- fi
- # Put the nasty error message in config.log where it belongs
- echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
-
- m4_default([$4], [AC_MSG_ERROR(
-[Package requirements ($2) were not met:
-
-$$1_PKG_ERRORS
-
-Consider adjusting the PKG_CONFIG_PATH environment variable if you
-installed software in a non-standard prefix.
-
-_PKG_TEXT])[]dnl
- ])
-elif test $pkg_failed = untried; then
- AC_MSG_RESULT([no])
- m4_default([$4], [AC_MSG_FAILURE(
-[The pkg-config script could not be found or is too old. Make sure it
-is in your PATH or set the PKG_CONFIG environment variable to the full
-path to pkg-config.
-
-_PKG_TEXT
-
-To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
- ])
-else
- $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
- $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
- AC_MSG_RESULT([yes])
- $3
-fi[]dnl
-])# PKG_CHECK_MODULES
-
-
-# PKG_INSTALLDIR(DIRECTORY)
-# -------------------------
-# Substitutes the variable pkgconfigdir as the location where a module
-# should install pkg-config .pc files. By default the directory is
-# $libdir/pkgconfig, but the default can be changed by passing
-# DIRECTORY. The user can override through the --with-pkgconfigdir
-# parameter.
-AC_DEFUN([PKG_INSTALLDIR],
-[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
-m4_pushdef([pkg_description],
- [pkg-config installation directory @<:@]pkg_default[@:>@])
-AC_ARG_WITH([pkgconfigdir],
- [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
- [with_pkgconfigdir=]pkg_default)
-AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
-m4_popdef([pkg_default])
|
[-]
[+]
|
Deleted |
libxkbcommon-0.3.2.tar.xz/build-aux
^
|
-(directory)
|
[-]
[+]
|
Deleted |
libxkbcommon-0.3.2.tar.xz/build-aux/compile
^
|
@@ -1,347 +0,0 @@
-#! /bin/sh
-# Wrapper for compilers which do not understand '-c -o'.
-
-scriptversion=2012-10-14.11; # UTC
-
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
-# Written by Tom Tromey <tromey@cygnus.com>.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# This file is maintained in Automake, please report
-# bugs to <bug-automake@gnu.org> or send patches to
-# <automake-patches@gnu.org>.
-
-nl='
-'
-
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent tools from complaining about whitespace usage.
-IFS=" "" $nl"
-
-file_conv=
-
-# func_file_conv build_file lazy
-# Convert a $build file to $host form and store it in $file
-# Currently only supports Windows hosts. If the determined conversion
-# type is listed in (the comma separated) LAZY, no conversion will
-# take place.
-func_file_conv ()
-{
- file=$1
- case $file in
- / | /[!/]*) # absolute file, and not a UNC file
- if test -z "$file_conv"; then
- # lazily determine how to convert abs files
- case `uname -s` in
- MINGW*)
- file_conv=mingw
- ;;
- CYGWIN*)
- file_conv=cygwin
- ;;
- *)
- file_conv=wine
- ;;
- esac
- fi
- case $file_conv/,$2, in
- *,$file_conv,*)
- ;;
- mingw/*)
- file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
- ;;
- cygwin/*)
- file=`cygpath -m "$file" || echo "$file"`
- ;;
- wine/*)
- file=`winepath -w "$file" || echo "$file"`
- ;;
- esac
- ;;
- esac
-}
-
-# func_cl_dashL linkdir
-# Make cl look for libraries in LINKDIR
-func_cl_dashL ()
-{
- func_file_conv "$1"
- if test -z "$lib_path"; then
- lib_path=$file
- else
- lib_path="$lib_path;$file"
- fi
- linker_opts="$linker_opts -LIBPATH:$file"
-}
-
-# func_cl_dashl library
-# Do a library search-path lookup for cl
-func_cl_dashl ()
-{
- lib=$1
- found=no
- save_IFS=$IFS
- IFS=';'
- for dir in $lib_path $LIB
- do
- IFS=$save_IFS
- if $shared && test -f "$dir/$lib.dll.lib"; then
- found=yes
- lib=$dir/$lib.dll.lib
- break
- fi
- if test -f "$dir/$lib.lib"; then
- found=yes
- lib=$dir/$lib.lib
- break
- fi
- if test -f "$dir/lib$lib.a"; then
- found=yes
- lib=$dir/lib$lib.a
- break
- fi
- done
- IFS=$save_IFS
-
- if test "$found" != yes; then
- lib=$lib.lib
- fi
-}
-
-# func_cl_wrapper cl arg...
-# Adjust compile command to suit cl
-func_cl_wrapper ()
-{
- # Assume a capable shell
- lib_path=
- shared=:
- linker_opts=
- for arg
- do
- if test -n "$eat"; then
- eat=
- else
- case $1 in
- -o)
- # configure might choose to run compile as 'compile cc -o foo foo.c'.
- eat=1
- case $2 in
- *.o | *.[oO][bB][jJ])
- func_file_conv "$2"
- set x "$@" -Fo"$file"
- shift
- ;;
- *)
- func_file_conv "$2"
- set x "$@" -Fe"$file"
- shift
- ;;
- esac
- ;;
- -I)
- eat=1
- func_file_conv "$2" mingw
- set x "$@" -I"$file"
- shift
- ;;
- -I*)
- func_file_conv "${1#-I}" mingw
- set x "$@" -I"$file"
- shift
- ;;
- -l)
- eat=1
- func_cl_dashl "$2"
- set x "$@" "$lib"
- shift
- ;;
- -l*)
- func_cl_dashl "${1#-l}"
- set x "$@" "$lib"
- shift
- ;;
- -L)
- eat=1
- func_cl_dashL "$2"
- ;;
- -L*)
- func_cl_dashL "${1#-L}"
- ;;
- -static)
- shared=false
- ;;
- -Wl,*)
- arg=${1#-Wl,}
- save_ifs="$IFS"; IFS=','
- for flag in $arg; do
- IFS="$save_ifs"
- linker_opts="$linker_opts $flag"
- done
- IFS="$save_ifs"
- ;;
- -Xlinker)
|
[-]
[+]
|
Deleted |
libxkbcommon-0.3.2.tar.xz/build-aux/config.guess
^
|
@@ -1,1558 +0,0 @@
-#! /bin/sh
-# Attempt to guess a canonical system name.
-# Copyright 1992-2013 Free Software Foundation, Inc.
-
-timestamp='2013-06-10'
-
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that
-# program. This Exception is an additional permission under section 7
-# of the GNU General Public License, version 3 ("GPLv3").
-#
-# Originally written by Per Bothner.
-#
-# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
-#
-# Please send patches with a ChangeLog entry to config-patches@gnu.org.
-
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION]
-
-Output the configuration name of the system \`$me' is run on.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.guess ($timestamp)
-
-Originally written by Per Bothner.
-Copyright 1992-2013 Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit ;;
- --version | -v )
- echo "$version" ; exit ;;
- --help | --h* | -h )
- echo "$usage"; exit ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help" >&2
- exit 1 ;;
- * )
- break ;;
- esac
-done
-
-if test $# != 0; then
- echo "$me: too many arguments$help" >&2
- exit 1
-fi
-
-trap 'exit 1' 1 2 15
-
-# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
-# compiler to aid in system detection is discouraged as it requires
-# temporary files to be created and, as you can see below, it is a
-# headache to deal with in a portable fashion.
-
-# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
-# use `HOST_CC' if defined, but it is deprecated.
-
-# Portable tmp directory creation inspired by the Autoconf team.
-
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,) echo "int x;" > $dummy.c ;
- for c in cc gcc c89 c99 ; do
- if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
- CC_FOR_BUILD="$c"; break ;
- fi ;
- done ;
- if test x"$CC_FOR_BUILD" = x ; then
- CC_FOR_BUILD=no_compiler_found ;
- fi
- ;;
- ,,*) CC_FOR_BUILD=$CC ;;
- ,*,*) CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
-
-# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
-# (ghazi@noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
- PATH=$PATH:/.attbin ; export PATH
-fi
-
-UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
-UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
-UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-
-case "${UNAME_SYSTEM}" in
-Linux|GNU|GNU/*)
- # If the system lacks a compiler, then just pick glibc.
- # We could probably try harder.
- LIBC=gnu
-
- eval $set_cc_for_build
- cat <<-EOF > $dummy.c
- #include <features.h>
- #if defined(__UCLIBC__)
- LIBC=uclibc
- #elif defined(__dietlibc__)
- LIBC=dietlibc
- #else
- LIBC=gnu
- #endif
- EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
- ;;
-esac
-
-# Note: order is significant - the case branches are not exclusive.
-
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
- *:NetBSD:*:*)
- # NetBSD (nbsd) targets should (where applicable) match one or
- # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
- # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
- # switched to ELF, *-*-netbsd* would select the old
- # object file format. This provides both forward
- # compatibility and a consistent mechanism for selecting the
- # object file format.
- #
- # Note: NetBSD doesn't particularly care about the vendor
- # portion of the name. We always set it to "unknown".
- sysctl="sysctl -n hw.machine_arch"
- UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
- /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
- case "${UNAME_MACHINE_ARCH}" in
- armeb) machine=armeb-unknown ;;
- arm*) machine=arm-unknown ;;
- sh3el) machine=shl-unknown ;;
- sh3eb) machine=sh-unknown ;;
- sh5el) machine=sh5le-unknown ;;
- *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
- esac
- # The Operating System including object format, if it has switched
- # to ELF recently, or will in the future.
- case "${UNAME_MACHINE_ARCH}" in
- arm*|i386|m68k|ns32k|sh3*|sparc|vax)
- eval $set_cc_for_build
- if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep -q __ELF__
- then
- # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
- # Return netbsd for either. FIX?
- os=netbsd
- else
- os=netbsdelf
- fi
- ;;
- *)
- os=netbsd
- ;;
- esac
|
[-]
[+]
|
Deleted |
libxkbcommon-0.3.2.tar.xz/build-aux/config.sub
^
|
@@ -1,1788 +0,0 @@
-#! /bin/sh
-# Configuration validation subroutine script.
-# Copyright 1992-2013 Free Software Foundation, Inc.
-
-timestamp='2013-04-24'
-
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that
-# program. This Exception is an additional permission under section 7
-# of the GNU General Public License, version 3 ("GPLv3").
-
-
-# Please send patches with a ChangeLog entry to config-patches@gnu.org.
-#
-# Configuration subroutine to validate and canonicalize a configuration type.
-# Supply the specified configuration type as an argument.
-# If it is invalid, we print an error message on stderr and exit with code 1.
-# Otherwise, we print the canonical config type on stdout and succeed.
-
-# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
-
-# This file is supposed to be the same for all GNU packages
-# and recognize all the CPU types, system types and aliases
-# that are meaningful with *any* GNU software.
-# Each package is responsible for reporting which valid configurations
-# it does not support. The user should be able to distinguish
-# a failure to support a valid configuration from a meaningless
-# configuration.
-
-# The goal of this file is to map all the various variations of a given
-# machine specification into a single specification in the form:
-# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# or in some cases, the newer four-part form:
-# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
-# It is wrong to echo any other type of specification.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS
- $0 [OPTION] ALIAS
-
-Canonicalize a configuration name.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.sub ($timestamp)
-
-Copyright 1992-2013 Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit ;;
- --version | -v )
- echo "$version" ; exit ;;
- --help | --h* | -h )
- echo "$usage"; exit ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help"
- exit 1 ;;
-
- *local*)
- # First pass through any local machine types.
- echo $1
- exit ;;
-
- * )
- break ;;
- esac
-done
-
-case $# in
- 0) echo "$me: missing argument$help" >&2
- exit 1;;
- 1) ;;
- *) echo "$me: too many arguments$help" >&2
- exit 1;;
-esac
-
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
- nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
- linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
- knetbsd*-gnu* | netbsd*-gnu* | \
- kopensolaris*-gnu* | \
- storm-chaos* | os2-emx* | rtmk-nova*)
- os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
- android-linux)
- os=-linux-android
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
- ;;
- *)
- basic_machine=`echo $1 | sed 's/-[^-]*$//'`
- if [ $basic_machine != $1 ]
- then os=`echo $1 | sed 's/.*-/-/'`
- else os=; fi
- ;;
-esac
-
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work. We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
- -sun*os*)
- # Prevent following clause from handling this invalid input.
- ;;
- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis | -knuth | -cray | -microblaze*)
- os=
- basic_machine=$1
- ;;
- -bluegene*)
- os=-cnk
- ;;
- -sim | -cisco | -oki | -wec | -winbond)
- os=
- basic_machine=$1
- ;;
- -scout)
- ;;
- -wrs)
- os=-vxworks
- basic_machine=$1
- ;;
- -chorusos*)
- os=-chorusos
- basic_machine=$1
- ;;
- -chorusrdb)
- os=-chorusrdb
- basic_machine=$1
- ;;
- -hiux*)
- os=-hiuxwe2
- ;;
- -sco6)
- os=-sco5v6
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5)
- os=-sco3.2v5
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco4)
- os=-sco3.2v4
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2.[4-9]*)
- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2v[4-9]*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
|
[-]
[+]
|
Deleted |
libxkbcommon-0.3.2.tar.xz/build-aux/depcomp
^
|
@@ -1,791 +0,0 @@
-#! /bin/sh
-# depcomp - compile a program generating dependencies as side-effects
-
-scriptversion=2013-05-30.07; # UTC
-
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
-
-case $1 in
- '')
- echo "$0: No command. Try '$0 --help' for more information." 1>&2
- exit 1;
- ;;
- -h | --h*)
- cat <<\EOF
-Usage: depcomp [--help] [--version] PROGRAM [ARGS]
-
-Run PROGRAMS ARGS to compile a file, generating dependencies
-as side-effects.
-
-Environment variables:
- depmode Dependency tracking mode.
- source Source file read by 'PROGRAMS ARGS'.
- object Object file output by 'PROGRAMS ARGS'.
- DEPDIR directory where to store dependencies.
- depfile Dependency file to output.
- tmpdepfile Temporary file to use when outputting dependencies.
- libtool Whether libtool is used (yes/no).
-
-Report bugs to <bug-automake@gnu.org>.
-EOF
- exit $?
- ;;
- -v | --v*)
- echo "depcomp $scriptversion"
- exit $?
- ;;
-esac
-
-# Get the directory component of the given path, and save it in the
-# global variables '$dir'. Note that this directory component will
-# be either empty or ending with a '/' character. This is deliberate.
-set_dir_from ()
-{
- case $1 in
- */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
- *) dir=;;
- esac
-}
-
-# Get the suffix-stripped basename of the given path, and save it the
-# global variable '$base'.
-set_base_from ()
-{
- base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
-}
-
-# If no dependency file was actually created by the compiler invocation,
-# we still have to create a dummy depfile, to avoid errors with the
-# Makefile "include basename.Plo" scheme.
-make_dummy_depfile ()
-{
- echo "#dummy" > "$depfile"
-}
-
-# Factor out some common post-processing of the generated depfile.
-# Requires the auxiliary global variable '$tmpdepfile' to be set.
-aix_post_process_depfile ()
-{
- # If the compiler actually managed to produce a dependency file,
- # post-process it.
- if test -f "$tmpdepfile"; then
- # Each line is of the form 'foo.o: dependency.h'.
- # Do two passes, one to just change these to
- # $object: dependency.h
- # and one to simply output
- # dependency.h:
- # which is needed to avoid the deleted-header problem.
- { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
- sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
- } > "$depfile"
- rm -f "$tmpdepfile"
- else
- make_dummy_depfile
- fi
-}
-
-# A tabulation character.
-tab=' '
-# A newline character.
-nl='
-'
-# Character ranges might be problematic outside the C locale.
-# These definitions help.
-upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
-lower=abcdefghijklmnopqrstuvwxyz
-digits=0123456789
-alpha=${upper}${lower}
-
-if test -z "$depmode" || test -z "$source" || test -z "$object"; then
- echo "depcomp: Variables source, object and depmode must be set" 1>&2
- exit 1
-fi
-
-# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
-depfile=${depfile-`echo "$object" |
- sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
-tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
-
-rm -f "$tmpdepfile"
-
-# Avoid interferences from the environment.
-gccflag= dashmflag=
-
-# Some modes work just like other modes, but use different flags. We
-# parameterize here, but still list the modes in the big case below,
-# to make depend.m4 easier to write. Note that we *cannot* use a case
-# here, because this file can only contain one case statement.
-if test "$depmode" = hp; then
- # HP compiler uses -M and no extra arg.
- gccflag=-M
- depmode=gcc
-fi
-
-if test "$depmode" = dashXmstdout; then
- # This is just like dashmstdout with a different argument.
- dashmflag=-xM
- depmode=dashmstdout
-fi
-
-cygpath_u="cygpath -u -f -"
-if test "$depmode" = msvcmsys; then
- # This is just like msvisualcpp but w/o cygpath translation.
- # Just convert the backslash-escaped backslashes to single forward
- # slashes to satisfy depend.m4
- cygpath_u='sed s,\\\\,/,g'
- depmode=msvisualcpp
-fi
-
-if test "$depmode" = msvc7msys; then
- # This is just like msvc7 but w/o cygpath translation.
- # Just convert the backslash-escaped backslashes to single forward
- # slashes to satisfy depend.m4
- cygpath_u='sed s,\\\\,/,g'
- depmode=msvc7
-fi
-
-if test "$depmode" = xlc; then
- # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
- gccflag=-qmakedep=gcc,-MF
- depmode=gcc
-fi
-
-case "$depmode" in
-gcc3)
-## gcc 3 implements dependency tracking that does exactly what
-## we want. Yay! Note: for some reason libtool 1.4 doesn't like
-## it if -MD -MP comes after the -MF stuff. Hmm.
-## Unfortunately, FreeBSD c89 acceptance of flags depends upon
-## the command line argument order; so add the flags where they
-## appear in depend2.am. Note that the slowdown incurred here
-## affects only configure: in makefiles, %FASTDEP% shortcuts this.
- for arg
- do
- case $arg in
- -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
- *) set fnord "$@" "$arg" ;;
- esac
- shift # fnord
- shift # $arg
- done
- "$@"
- stat=$?
- if test $stat -ne 0; then
- rm -f "$tmpdepfile"
- exit $stat
- fi
- mv "$tmpdepfile" "$depfile"
- ;;
-
|
[-]
[+]
|
Deleted |
libxkbcommon-0.3.2.tar.xz/build-aux/install-sh
^
|
@@ -1,527 +0,0 @@
-#!/bin/sh
-# install - install a program, script, or datafile
-
-scriptversion=2011-11-20.07; # UTC
-
-# This originates from X11R5 (mit/util/scripts/install.sh), which was
-# later released in X11R6 (xc/config/util/install.sh) with the
-# following copyright and license.
-#
-# Copyright (C) 1994 X Consortium
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to
-# deal in the Software without restriction, including without limitation the
-# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-# sell copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
-# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-# Except as contained in this notice, the name of the X Consortium shall not
-# be used in advertising or otherwise to promote the sale, use or other deal-
-# ings in this Software without prior written authorization from the X Consor-
-# tium.
-#
-#
-# FSF changes to this file are in the public domain.
-#
-# Calling this script install-sh is preferred over install.sh, to prevent
-# 'make' implicit rules from creating a file called install from it
-# when there is no Makefile.
-#
-# This script is compatible with the BSD install script, but was written
-# from scratch.
-
-nl='
-'
-IFS=" "" $nl"
-
-# set DOITPROG to echo to test this script
-
-# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit=${DOITPROG-}
-if test -z "$doit"; then
- doit_exec=exec
-else
- doit_exec=$doit
-fi
-
-# Put in absolute file names if you don't have them in your path;
-# or use environment vars.
-
-chgrpprog=${CHGRPPROG-chgrp}
-chmodprog=${CHMODPROG-chmod}
-chownprog=${CHOWNPROG-chown}
-cmpprog=${CMPPROG-cmp}
-cpprog=${CPPROG-cp}
-mkdirprog=${MKDIRPROG-mkdir}
-mvprog=${MVPROG-mv}
-rmprog=${RMPROG-rm}
-stripprog=${STRIPPROG-strip}
-
-posix_glob='?'
-initialize_posix_glob='
- test "$posix_glob" != "?" || {
- if (set -f) 2>/dev/null; then
- posix_glob=
- else
- posix_glob=:
- fi
- }
-'
-
-posix_mkdir=
-
-# Desired mode of installed file.
-mode=0755
-
-chgrpcmd=
-chmodcmd=$chmodprog
-chowncmd=
-mvcmd=$mvprog
-rmcmd="$rmprog -f"
-stripcmd=
-
-src=
-dst=
-dir_arg=
-dst_arg=
-
-copy_on_change=false
-no_target_directory=
-
-usage="\
-Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
- or: $0 [OPTION]... SRCFILES... DIRECTORY
- or: $0 [OPTION]... -t DIRECTORY SRCFILES...
- or: $0 [OPTION]... -d DIRECTORIES...
-
-In the 1st form, copy SRCFILE to DSTFILE.
-In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
-In the 4th, create DIRECTORIES.
-
-Options:
- --help display this help and exit.
- --version display version info and exit.
-
- -c (ignored)
- -C install only if different (preserve the last data modification time)
- -d create directories instead of installing files.
- -g GROUP $chgrpprog installed files to GROUP.
- -m MODE $chmodprog installed files to MODE.
- -o USER $chownprog installed files to USER.
- -s $stripprog installed files.
- -t DIRECTORY install into DIRECTORY.
- -T report an error if DSTFILE is a directory.
-
-Environment variables override the default commands:
- CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
- RMPROG STRIPPROG
-"
-
-while test $# -ne 0; do
- case $1 in
- -c) ;;
-
- -C) copy_on_change=true;;
-
- -d) dir_arg=true;;
-
- -g) chgrpcmd="$chgrpprog $2"
- shift;;
-
- --help) echo "$usage"; exit $?;;
-
- -m) mode=$2
- case $mode in
- *' '* | *' '* | *'
-'* | *'*'* | *'?'* | *'['*)
- echo "$0: invalid mode: $mode" >&2
- exit 1;;
- esac
- shift;;
-
- -o) chowncmd="$chownprog $2"
- shift;;
-
- -s) stripcmd=$stripprog;;
-
- -t) dst_arg=$2
- # Protect names problematic for 'test' and other utilities.
- case $dst_arg in
- -* | [=\(\)!]) dst_arg=./$dst_arg;;
- esac
- shift;;
-
- -T) no_target_directory=true;;
-
- --version) echo "$0 $scriptversion"; exit $?;;
-
- --) shift
- break;;
-
- -*) echo "$0: invalid option: $1" >&2
- exit 1;;
-
- *) break;;
- esac
- shift
-done
-
-if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
- # When -d is used, all remaining arguments are directories to create.
- # When -t is used, the destination is already specified.
- # Otherwise, the last argument is the destination. Remove it from $@.
- for arg
- do
- if test -n "$dst_arg"; then
- # $@ is not empty: it contains at least $arg.
- set fnord "$@" "$dst_arg"
- shift # fnord
- fi
- shift # arg
- dst_arg=$arg
- # Protect names problematic for 'test' and other utilities.
- case $dst_arg in
- -* | [=\(\)!]) dst_arg=./$dst_arg;;
- esac
- done
-fi
-
|
[-]
[+]
|
Deleted |
libxkbcommon-0.3.2.tar.xz/build-aux/ltmain.sh
^
|
@@ -1,9655 +0,0 @@
-
-# libtool (GNU libtool) 2.4.2
-# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
-# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
-# This is free software; see the source for copying conditions. There is NO
-# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-# GNU Libtool is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
-#
-# GNU Libtool is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING. If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html,
-# or obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-# Usage: $progname [OPTION]... [MODE-ARG]...
-#
-# Provide generalized library-building support services.
-#
-# --config show all configuration variables
-# --debug enable verbose shell tracing
-# -n, --dry-run display commands without modifying any files
-# --features display basic configuration information and exit
-# --mode=MODE use operation mode MODE
-# --preserve-dup-deps don't remove duplicate dependency libraries
-# --quiet, --silent don't print informational messages
-# --no-quiet, --no-silent
-# print informational messages (default)
-# --no-warn don't display warning messages
-# --tag=TAG use configuration variables from tag TAG
-# -v, --verbose print more informational messages than default
-# --no-verbose don't print the extra informational messages
-# --version print version information
-# -h, --help, --help-all print short, long, or detailed help message
-#
-# MODE must be one of the following:
-#
-# clean remove files from the build directory
-# compile compile a source file into a libtool object
-# execute automatically set library path, then run a program
-# finish complete the installation of libtool libraries
-# install install libraries or executables
-# link create a library or an executable
-# uninstall remove libraries from an installed directory
-#
-# MODE-ARGS vary depending on the MODE. When passed as first option,
-# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
-# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
-#
-# When reporting a bug, please describe a test case to reproduce it and
-# include the following information:
-#
-# host-triplet: $host
-# shell: $SHELL
-# compiler: $LTCC
-# compiler flags: $LTCFLAGS
-# linker: $LD (gnu? $with_gnu_ld)
-# $progname: (GNU libtool) 2.4.2
-# automake: $automake_version
-# autoconf: $autoconf_version
-#
-# Report bugs to <bug-libtool@gnu.org>.
-# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
-# General help using GNU software: <http://www.gnu.org/gethelp/>.
-
-PROGRAM=libtool
-PACKAGE=libtool
-VERSION=2.4.2
-TIMESTAMP=""
-package_revision=1.3337
-
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
-fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
- eval 'cat <<_LTECHO_EOF
-$1
-_LTECHO_EOF'
-}
-
-# NLS nuisances: We save the old values to restore during execute mode.
-lt_user_locale=
-lt_safe_locale=
-for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
-do
- eval "if test \"\${$lt_var+set}\" = set; then
- save_$lt_var=\$$lt_var
- $lt_var=C
- export $lt_var
- lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
- lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
- fi"
-done
-LC_ALL=C
-LANGUAGE=C
-export LANGUAGE LC_ALL
-
-$lt_unset CDPATH
-
-
-# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
-# is ksh but when the shell is invoked as "sh" and the current value of
-# the _XPG environment variable is not equal to 1 (one), the special
-# positional parameter $0, within a function call, is the name of the
-# function.
-progpath="$0"
-
-
-
-: ${CP="cp -f"}
-test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
-: ${MAKE="make"}
-: ${MKDIR="mkdir"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
-: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
-: ${Xsed="$SED -e 1s/^X//"}
-
-# Global variables:
-EXIT_SUCCESS=0
-EXIT_FAILURE=1
-EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
-EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
-
-exit_status=$EXIT_SUCCESS
-
-# Make sure IFS has a sensible default
-lt_nl='
-'
-IFS=" $lt_nl"
-
-dirname="s,/[^/]*$,,"
-basename="s,^.*/,,"
-
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
- func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
- if test "X$func_dirname_result" = "X${1}"; then
- func_dirname_result="${3}"
- else
- func_dirname_result="$func_dirname_result${2}"
- fi
-} # func_dirname may be replaced by extended shell implementation
-
-
-# func_basename file
-func_basename ()
-{
- func_basename_result=`$ECHO "${1}" | $SED "$basename"`
-} # func_basename may be replaced by extended shell implementation
-
-
-# func_dirname_and_basename file append nondir_replacement
-# perform func_basename and func_dirname in a single function
-# call:
-# dirname: Compute the dirname of FILE. If nonempty,
-# add APPEND to the result, otherwise set result
-# to NONDIR_REPLACEMENT.
-# value returned in "$func_dirname_result"
-# basename: Compute filename of FILE.
-# value retuned in "$func_basename_result"
-# Implementation must be kept synchronized with func_dirname
-# and func_basename. For efficiency, we do not delegate to
-# those functions but instead duplicate the functionality here.
-func_dirname_and_basename ()
-{
- # Extract subdirectory from the argument.
- func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
|
[-]
[+]
|
Deleted |
libxkbcommon-0.3.2.tar.xz/build-aux/missing
^
|
@@ -1,215 +0,0 @@
-#! /bin/sh
-# Common wrapper for a few potentially missing GNU programs.
-
-scriptversion=2012-06-26.16; # UTC
-
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
-# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-if test $# -eq 0; then
- echo 1>&2 "Try '$0 --help' for more information"
- exit 1
-fi
-
-case $1 in
-
- --is-lightweight)
- # Used by our autoconf macros to check whether the available missing
- # script is modern enough.
- exit 0
- ;;
-
- --run)
- # Back-compat with the calling convention used by older automake.
- shift
- ;;
-
- -h|--h|--he|--hel|--help)
- echo "\
-$0 [OPTION]... PROGRAM [ARGUMENT]...
-
-Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
-to PROGRAM being missing or too old.
-
-Options:
- -h, --help display this help and exit
- -v, --version output version information and exit
-
-Supported PROGRAM values:
- aclocal autoconf autoheader autom4te automake makeinfo
- bison yacc flex lex help2man
-
-Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
-'g' are ignored when checking the name.
-
-Send bug reports to <bug-automake@gnu.org>."
- exit $?
- ;;
-
- -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
- echo "missing $scriptversion (GNU Automake)"
- exit $?
- ;;
-
- -*)
- echo 1>&2 "$0: unknown '$1' option"
- echo 1>&2 "Try '$0 --help' for more information"
- exit 1
- ;;
-
-esac
-
-# Run the given program, remember its exit status.
-"$@"; st=$?
-
-# If it succeeded, we are done.
-test $st -eq 0 && exit 0
-
-# Also exit now if we it failed (or wasn't found), and '--version' was
-# passed; such an option is passed most likely to detect whether the
-# program is present and works.
-case $2 in --version|--help) exit $st;; esac
-
-# Exit code 63 means version mismatch. This often happens when the user
-# tries to use an ancient version of a tool on a file that requires a
-# minimum version.
-if test $st -eq 63; then
- msg="probably too old"
-elif test $st -eq 127; then
- # Program was missing.
- msg="missing on your system"
-else
- # Program was found and executed, but failed. Give up.
- exit $st
-fi
-
-perl_URL=http://www.perl.org/
-flex_URL=http://flex.sourceforge.net/
-gnu_software_URL=http://www.gnu.org/software
-
-program_details ()
-{
- case $1 in
- aclocal|automake)
- echo "The '$1' program is part of the GNU Automake package:"
- echo "<$gnu_software_URL/automake>"
- echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
- echo "<$gnu_software_URL/autoconf>"
- echo "<$gnu_software_URL/m4/>"
- echo "<$perl_URL>"
- ;;
- autoconf|autom4te|autoheader)
- echo "The '$1' program is part of the GNU Autoconf package:"
- echo "<$gnu_software_URL/autoconf/>"
- echo "It also requires GNU m4 and Perl in order to run:"
- echo "<$gnu_software_URL/m4/>"
- echo "<$perl_URL>"
- ;;
- esac
-}
-
-give_advice ()
-{
- # Normalize program name to check for.
- normalized_program=`echo "$1" | sed '
- s/^gnu-//; t
- s/^gnu//; t
- s/^g//; t'`
-
- printf '%s\n' "'$1' is $msg."
-
- configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
- case $normalized_program in
- autoconf*)
- echo "You should only need it if you modified 'configure.ac',"
- echo "or m4 files included by it."
- program_details 'autoconf'
- ;;
- autoheader*)
- echo "You should only need it if you modified 'acconfig.h' or"
- echo "$configure_deps."
- program_details 'autoheader'
- ;;
- automake*)
- echo "You should only need it if you modified 'Makefile.am' or"
- echo "$configure_deps."
- program_details 'automake'
- ;;
- aclocal*)
- echo "You should only need it if you modified 'acinclude.m4' or"
- echo "$configure_deps."
- program_details 'aclocal'
- ;;
- autom4te*)
- echo "You might have modified some maintainer files that require"
- echo "the 'automa4te' program to be rebuilt."
- program_details 'autom4te'
- ;;
- bison*|yacc*)
- echo "You should only need it if you modified a '.y' file."
- echo "You may want to install the GNU Bison package:"
- echo "<$gnu_software_URL/bison/>"
- ;;
- lex*|flex*)
- echo "You should only need it if you modified a '.l' file."
- echo "You may want to install the Fast Lexical Analyzer package:"
- echo "<$flex_URL>"
- ;;
- help2man*)
- echo "You should only need it if you modified a dependency" \
- "of a man page."
- echo "You may want to install the GNU Help2man package:"
- echo "<$gnu_software_URL/help2man/>"
- ;;
- makeinfo*)
- echo "You should only need it if you modified a '.texi' file, or"
- echo "any other file indirectly affecting the aspect of the manual."
- echo "You might want to install the Texinfo package:"
- echo "<$gnu_software_URL/texinfo/>"
- echo "The spurious makeinfo call might also be the consequence of"
- echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
- echo "want to install GNU make:"
- echo "<$gnu_software_URL/make/>"
- ;;
- *)
- echo "You might have modified some files without having the proper"
- echo "tools for further handling them. Check the 'README' file, it"
- echo "often tells you about the needed prerequisites for installing"
- echo "this package. You may also peek at any GNU archive site, in"
- echo "case some other package contains this missing '$1' program."
- ;;
- esac
|
[-]
[+]
|
Deleted |
libxkbcommon-0.3.2.tar.xz/build-aux/test-driver
^
|
@@ -1,127 +0,0 @@
-#! /bin/sh
-# test-driver - basic testsuite driver script.
-
-scriptversion=2012-06-27.10; # UTC
-
-# Copyright (C) 2011-2013 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# This file is maintained in Automake, please report
-# bugs to <bug-automake@gnu.org> or send patches to
-# <automake-patches@gnu.org>.
-
-# Make unconditional expansion of undefined variables an error. This
-# helps a lot in preventing typo-related bugs.
-set -u
-
-usage_error ()
-{
- echo "$0: $*" >&2
- print_usage >&2
- exit 2
-}
-
-print_usage ()
-{
- cat <<END
-Usage:
- test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
- [--expect-failure={yes|no}] [--color-tests={yes|no}]
- [--enable-hard-errors={yes|no}] [--] TEST-SCRIPT
-The '--test-name', '--log-file' and '--trs-file' options are mandatory.
-END
-}
-
-# TODO: better error handling in option parsing (in particular, ensure
-# TODO: $log_file, $trs_file and $test_name are defined).
-test_name= # Used for reporting.
-log_file= # Where to save the output of the test script.
-trs_file= # Where to save the metadata of the test run.
-expect_failure=no
-color_tests=no
-enable_hard_errors=yes
-while test $# -gt 0; do
- case $1 in
- --help) print_usage; exit $?;;
- --version) echo "test-driver $scriptversion"; exit $?;;
- --test-name) test_name=$2; shift;;
- --log-file) log_file=$2; shift;;
- --trs-file) trs_file=$2; shift;;
- --color-tests) color_tests=$2; shift;;
- --expect-failure) expect_failure=$2; shift;;
- --enable-hard-errors) enable_hard_errors=$2; shift;;
- --) shift; break;;
- -*) usage_error "invalid option: '$1'";;
- esac
- shift
-done
-
-if test $color_tests = yes; then
- # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
- red='[0;31m' # Red.
- grn='[0;32m' # Green.
- lgn='[1;32m' # Light green.
- blu='[1;34m' # Blue.
- mgn='[0;35m' # Magenta.
- std='[m' # No color.
-else
- red= grn= lgn= blu= mgn= std=
-fi
-
-do_exit='rm -f $log_file $trs_file; (exit $st); exit $st'
-trap "st=129; $do_exit" 1
-trap "st=130; $do_exit" 2
-trap "st=141; $do_exit" 13
-trap "st=143; $do_exit" 15
-
-# Test script is run here.
-"$@" >$log_file 2>&1
-estatus=$?
-if test $enable_hard_errors = no && test $estatus -eq 99; then
- estatus=1
-fi
-
-case $estatus:$expect_failure in
- 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
- 0:*) col=$grn res=PASS recheck=no gcopy=no;;
- 77:*) col=$blu res=SKIP recheck=no gcopy=yes;;
- 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;;
- *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;;
- *:*) col=$red res=FAIL recheck=yes gcopy=yes;;
-esac
-
-# Report outcome to console.
-echo "${col}${res}${std}: $test_name"
-
-# Register the test result, and other relevant metadata.
-echo ":test-result: $res" > $trs_file
-echo ":global-test-result: $res" >> $trs_file
-echo ":recheck: $recheck" >> $trs_file
-echo ":copy-in-global-log: $gcopy" >> $trs_file
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
|
[-]
[+]
|
Deleted |
libxkbcommon-0.3.2.tar.xz/build-aux/ylwrap
^
|
@@ -1,247 +0,0 @@
-#! /bin/sh
-# ylwrap - wrapper for lex/yacc invocations.
-
-scriptversion=2013-01-12.17; # UTC
-
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
-#
-# Written by Tom Tromey <tromey@cygnus.com>.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# This file is maintained in Automake, please report
-# bugs to <bug-automake@gnu.org> or send patches to
-# <automake-patches@gnu.org>.
-
-get_dirname ()
-{
- case $1 in
- */*|*\\*) printf '%s\n' "$1" | sed -e 's|\([\\/]\)[^\\/]*$|\1|';;
- # Otherwise, we want the empty string (not ".").
- esac
-}
-
-# guard FILE
-# ----------
-# The CPP macro used to guard inclusion of FILE.
-guard ()
-{
- printf '%s\n' "$1" \
- | sed \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \
- -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g' \
- -e 's/__*/_/g'
-}
-
-# quote_for_sed [STRING]
-# ----------------------
-# Return STRING (or stdin) quoted to be used as a sed pattern.
-quote_for_sed ()
-{
- case $# in
- 0) cat;;
- 1) printf '%s\n' "$1";;
- esac \
- | sed -e 's|[][\\.*]|\\&|g'
-}
-
-case "$1" in
- '')
- echo "$0: No files given. Try '$0 --help' for more information." 1>&2
- exit 1
- ;;
- --basedir)
- basedir=$2
- shift 2
- ;;
- -h|--h*)
- cat <<\EOF
-Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]...
-
-Wrapper for lex/yacc invocations, renaming files as desired.
-
- INPUT is the input file
- OUTPUT is one file PROG generates
- DESIRED is the file we actually want instead of OUTPUT
- PROGRAM is program to run
- ARGS are passed to PROG
-
-Any number of OUTPUT,DESIRED pairs may be used.
-
-Report bugs to <bug-automake@gnu.org>.
-EOF
- exit $?
- ;;
- -v|--v*)
- echo "ylwrap $scriptversion"
- exit $?
- ;;
-esac
-
-
-# The input.
-input=$1
-shift
-# We'll later need for a correct munging of "#line" directives.
-input_sub_rx=`get_dirname "$input" | quote_for_sed`
-case $input in
- [\\/]* | ?:[\\/]*)
- # Absolute path; do nothing.
- ;;
- *)
- # Relative path. Make it absolute.
- input=`pwd`/$input
- ;;
-esac
-input_rx=`get_dirname "$input" | quote_for_sed`
-
-# Since DOS filename conventions don't allow two dots,
-# the DOS version of Bison writes out y_tab.c instead of y.tab.c
-# and y_tab.h instead of y.tab.h. Test to see if this is the case.
-y_tab_nodot=false
-if test -f y_tab.c || test -f y_tab.h; then
- y_tab_nodot=true
-fi
-
-# The parser itself, the first file, is the destination of the .y.c
-# rule in the Makefile.
-parser=$1
-
-# A sed program to s/FROM/TO/g for all the FROM/TO so that, for
-# instance, we rename #include "y.tab.h" into #include "parse.h"
-# during the conversion from y.tab.c to parse.c.
-sed_fix_filenames=
-
-# Also rename header guards, as Bison 2.7 for instance uses its header
-# guard in its implementation file.
-sed_fix_header_guards=
-
-while test $# -ne 0; do
- if test x"$1" = x"--"; then
- shift
- break
- fi
- from=$1
- # Handle y_tab.c and y_tab.h output by DOS
- if $y_tab_nodot; then
- case $from in
- "y.tab.c") from=y_tab.c;;
- "y.tab.h") from=y_tab.h;;
- esac
- fi
- shift
- to=$1
- shift
- sed_fix_filenames="${sed_fix_filenames}s|"`quote_for_sed "$from"`"|$to|g;"
- sed_fix_header_guards="${sed_fix_header_guards}s|"`guard "$from"`"|"`guard "$to"`"|g;"
-done
-
-# The program to run.
-prog=$1
-shift
-# Make any relative path in $prog absolute.
-case $prog in
- [\\/]* | ?:[\\/]*) ;;
- *[\\/]*) prog=`pwd`/$prog ;;
-esac
-
-dirname=ylwrap$$
-do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret'
-trap "ret=129; $do_exit" 1
-trap "ret=130; $do_exit" 2
-trap "ret=141; $do_exit" 13
-trap "ret=143; $do_exit" 15
-mkdir $dirname || exit 1
-
-cd $dirname
-
-case $# in
- 0) "$prog" "$input" ;;
- *) "$prog" "$@" "$input" ;;
-esac
-ret=$?
-
-if test $ret -eq 0; then
- for from in *
- do
- to=`printf '%s\n' "$from" | sed "$sed_fix_filenames"`
- if test -f "$from"; then
- # If $2 is an absolute path name, then just use that,
- # otherwise prepend '../'.
- case $to in
- [\\/]* | ?:[\\/]*) target=$to;;
- *) target=../$to;;
- esac
-
- # Do not overwrite unchanged header files to avoid useless
- # recompilations. Always update the parser itself: it is the
- # destination of the .y.c rule in the Makefile. Divert the
- # output of all other files to a temporary file so we can
- # compare them to existing versions.
- if test $from != $parser; then
- realtarget=$target
- target=tmp-`printf '%s\n' "$target" | sed 's|.*[\\/]||g'`
|
[-]
[+]
|
Deleted |
libxkbcommon-0.3.2.tar.xz/configure
^
|
@@ -1,21056 +0,0 @@
-#! /bin/sh
-# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for libxkbcommon 0.3.2.
-#
-# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=libxkbcommon>.
-#
-#
-# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
-#
-#
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac
-fi
-
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='printf %s\n'
- as_echo_n='printf %s'
-else
- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- as_echo_n='/usr/ucb/echo -n'
- else
- as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- as_echo_n_body='eval
- arg=$1;
- case $arg in #(
- *"$as_nl"*)
- expr "X$arg" : "X\\(.*\\)$as_nl";
- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- '
- export as_echo_n_body
- as_echo_n='sh -c $as_echo_n_body as_echo'
- fi
- export as_echo_body
- as_echo='sh -c $as_echo_body as_echo'
-fi
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- PATH_SEPARATOR=:
- (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
- (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
- PATH_SEPARATOR=';'
- }
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-as_myself=
-case $0 in #((
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-# Use a proper internal environment variable to ensure we don't fall
- # into an infinite loop, continuously re-executing ourselves.
- if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
- _as_can_reexec=no; export _as_can_reexec;
- # We cannot yet assume a decent shell, so we have to provide a
-# neutralization value for shells without unset; and this also
-# works around shells that cannot unset nonexistent variables.
-# Preserve -v and -x to the replacement shell.
-BASH_ENV=/dev/null
-ENV=/dev/null
-(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-case $- in # ((((
- *v*x* | *x*v* ) as_opts=-vx ;;
- *v* ) as_opts=-v ;;
- *x* ) as_opts=-x ;;
- * ) as_opts= ;;
-esac
-exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
-# Admittedly, this is quite paranoid, since all the known shells bail
-# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
-as_fn_exit 255
- fi
- # We don't want this to propagate to other subprocesses.
- { _as_can_reexec=; unset _as_can_reexec;}
-if test "x$CONFIG_SHELL" = x; then
- as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '\${1+\"\$@\"}'='\"\$@\"'
- setopt NO_GLOB_SUBST
-else
- case \`(set -o) 2>/dev/null\` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac
-fi
-"
- as_required="as_fn_return () { (exit \$1); }
-as_fn_success () { as_fn_return 0; }
-as_fn_failure () { as_fn_return 1; }
-as_fn_ret_success () { return 0; }
-as_fn_ret_failure () { return 1; }
-
-exitcode=0
-as_fn_success || { exitcode=1; echo as_fn_success failed.; }
-as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
-as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
-as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
-if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
-
-else
- exitcode=1; echo positional parameters were not saved.
-fi
-test x\$exitcode = x0 || exit 1
-test -x / || exit 1"
- as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
- as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
- eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
|
[-]
[+]
|
Deleted |
libxkbcommon-0.3.2.tar.xz/m4/libtool.m4
^
|
@@ -1,7982 +0,0 @@
-# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
-# Written by Gordon Matzigkeit, 1996
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-m4_define([_LT_COPYING], [dnl
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
-# Written by Gordon Matzigkeit, 1996
-#
-# This file is part of GNU Libtool.
-#
-# GNU Libtool is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
-#
-# GNU Libtool is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING. If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
-# obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-])
-
-# serial 57 LT_INIT
-
-
-# LT_PREREQ(VERSION)
-# ------------------
-# Complain and exit if this libtool version is less that VERSION.
-m4_defun([LT_PREREQ],
-[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
- [m4_default([$3],
- [m4_fatal([Libtool version $1 or higher is required],
- 63)])],
- [$2])])
-
-
-# _LT_CHECK_BUILDDIR
-# ------------------
-# Complain if the absolute build directory name contains unusual characters
-m4_defun([_LT_CHECK_BUILDDIR],
-[case `pwd` in
- *\ * | *\ *)
- AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
-esac
-])
-
-
-# LT_INIT([OPTIONS])
-# ------------------
-AC_DEFUN([LT_INIT],
-[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
-AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
-AC_BEFORE([$0], [LT_LANG])dnl
-AC_BEFORE([$0], [LT_OUTPUT])dnl
-AC_BEFORE([$0], [LTDL_INIT])dnl
-m4_require([_LT_CHECK_BUILDDIR])dnl
-
-dnl Autoconf doesn't catch unexpanded LT_ macros by default:
-m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
-m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
-dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
-dnl unless we require an AC_DEFUNed macro:
-AC_REQUIRE([LTOPTIONS_VERSION])dnl
-AC_REQUIRE([LTSUGAR_VERSION])dnl
-AC_REQUIRE([LTVERSION_VERSION])dnl
-AC_REQUIRE([LTOBSOLETE_VERSION])dnl
-m4_require([_LT_PROG_LTMAIN])dnl
-
-_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
-
-dnl Parse OPTIONS
-_LT_SET_OPTIONS([$0], [$1])
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ltmain"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-AC_SUBST(LIBTOOL)dnl
-
-_LT_SETUP
-
-# Only expand once:
-m4_define([LT_INIT])
-])# LT_INIT
-
-# Old names:
-AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
-AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
-dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
-
-
-# _LT_CC_BASENAME(CC)
-# -------------------
-# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
-m4_defun([_LT_CC_BASENAME],
-[for cc_temp in $1""; do
- case $cc_temp in
- compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
- distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
-])
-
-
-# _LT_FILEUTILS_DEFAULTS
-# ----------------------
-# It is okay to use these file commands and assume they have been set
-# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
-m4_defun([_LT_FILEUTILS_DEFAULTS],
-[: ${CP="cp -f"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
-])# _LT_FILEUTILS_DEFAULTS
-
-
-# _LT_SETUP
-# ---------
-m4_defun([_LT_SETUP],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
-AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
-
-_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
-dnl
-_LT_DECL([], [host_alias], [0], [The host system])dnl
-_LT_DECL([], [host], [0])dnl
-_LT_DECL([], [host_os], [0])dnl
-dnl
-_LT_DECL([], [build_alias], [0], [The build system])dnl
-_LT_DECL([], [build], [0])dnl
-_LT_DECL([], [build_os], [0])dnl
-dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([LT_PATH_LD])dnl
-AC_REQUIRE([LT_PATH_NM])dnl
-dnl
-AC_REQUIRE([AC_PROG_LN_S])dnl
-test -z "$LN_S" && LN_S="ln -s"
-_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
-dnl
-AC_REQUIRE([LT_CMD_MAX_LEN])dnl
-_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
-_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
-dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_CHECK_SHELL_FEATURES])dnl
-m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
-m4_require([_LT_CMD_RELOAD])dnl
-m4_require([_LT_CHECK_MAGIC_METHOD])dnl
-m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
-m4_require([_LT_CMD_OLD_ARCHIVE])dnl
-m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
-m4_require([_LT_WITH_SYSROOT])dnl
-
-_LT_CONFIG_LIBTOOL_INIT([
-# See if we are running on zsh, and set the options which allow our
-# commands through without removal of \ escapes INIT.
-if test -n "\${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
-fi
-])
-if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
-fi
-
-_LT_CHECK_OBJDIR
-
-m4_require([_LT_TAG_COMPILER])dnl
-
-case $host_os in
-aix3*)
- # AIX sometimes has problems with the GCC collect2 program. For some
- # reason, if we set the COLLECT_NAMES environment variable, the problems
|
[-]
[+]
|
Deleted |
libxkbcommon-0.3.2.tar.xz/m4/ltoptions.m4
^
|
@@ -1,384 +0,0 @@
-# Helper functions for option handling. -*- Autoconf -*-
-#
-# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
-# Inc.
-# Written by Gary V. Vaughan, 2004
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# serial 7 ltoptions.m4
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
-
-
-# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
-# ------------------------------------------
-m4_define([_LT_MANGLE_OPTION],
-[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
-
-
-# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
-# ---------------------------------------
-# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
-# matching handler defined, dispatch to it. Other OPTION-NAMEs are
-# saved as a flag.
-m4_define([_LT_SET_OPTION],
-[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
-m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
- _LT_MANGLE_DEFUN([$1], [$2]),
- [m4_warning([Unknown $1 option `$2'])])[]dnl
-])
-
-
-# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
-# ------------------------------------------------------------
-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
-m4_define([_LT_IF_OPTION],
-[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
-
-
-# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
-# -------------------------------------------------------
-# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
-# are set.
-m4_define([_LT_UNLESS_OPTIONS],
-[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
- [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
- [m4_define([$0_found])])])[]dnl
-m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
-])[]dnl
-])
-
-
-# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
-# ----------------------------------------
-# OPTION-LIST is a space-separated list of Libtool options associated
-# with MACRO-NAME. If any OPTION has a matching handler declared with
-# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
-# the unknown option and exit.
-m4_defun([_LT_SET_OPTIONS],
-[# Set options
-m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
- [_LT_SET_OPTION([$1], _LT_Option)])
-
-m4_if([$1],[LT_INIT],[
- dnl
- dnl Simply set some default values (i.e off) if boolean options were not
- dnl specified:
- _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
- ])
- _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
- ])
- dnl
- dnl If no reference was made to various pairs of opposing options, then
- dnl we run the default mode handler for the pair. For example, if neither
- dnl `shared' nor `disable-shared' was passed, we enable building of shared
- dnl archives by default:
- _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
- _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
- _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
- _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
- [_LT_ENABLE_FAST_INSTALL])
- ])
-])# _LT_SET_OPTIONS
-
-
-## --------------------------------- ##
-## Macros to handle LT_INIT options. ##
-## --------------------------------- ##
-
-# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
-# -----------------------------------------
-m4_define([_LT_MANGLE_DEFUN],
-[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
-
-
-# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
-# -----------------------------------------------
-m4_define([LT_OPTION_DEFINE],
-[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
-])# LT_OPTION_DEFINE
-
-
-# dlopen
-# ------
-LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
-])
-
-AU_DEFUN([AC_LIBTOOL_DLOPEN],
-[_LT_SET_OPTION([LT_INIT], [dlopen])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `dlopen' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
-
-
-# win32-dll
-# ---------
-# Declare package support for building win32 dll's.
-LT_OPTION_DEFINE([LT_INIT], [win32-dll],
-[enable_win32_dll=yes
-
-case $host in
-*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
- AC_CHECK_TOOL(AS, as, false)
- AC_CHECK_TOOL(DLLTOOL, dlltool, false)
- AC_CHECK_TOOL(OBJDUMP, objdump, false)
- ;;
-esac
-
-test -z "$AS" && AS=as
-_LT_DECL([], [AS], [1], [Assembler program])dnl
-
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
-
-test -z "$OBJDUMP" && OBJDUMP=objdump
-_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
-])# win32-dll
-
-AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-_LT_SET_OPTION([LT_INIT], [win32-dll])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `win32-dll' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
-
-
-# _LT_ENABLE_SHARED([DEFAULT])
-# ----------------------------
-# implement the --enable-shared flag, and supports the `shared' and
-# `disable-shared' LT_INIT options.
-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
-m4_define([_LT_ENABLE_SHARED],
-[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
-AC_ARG_ENABLE([shared],
- [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
- [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
- [p=${PACKAGE-default}
- case $enableval in
- yes) enable_shared=yes ;;
- no) enable_shared=no ;;
- *)
- enable_shared=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_shared=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac],
- [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
-
- _LT_DECL([build_libtool_libs], [enable_shared], [0],
- [Whether or not to build shared libraries])
-])# _LT_ENABLE_SHARED
-
-LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
-LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
-
-# Old names:
-AC_DEFUN([AC_ENABLE_SHARED],
-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
-])
-
-AC_DEFUN([AC_DISABLE_SHARED],
|
[-]
[+]
|
Deleted |
libxkbcommon-0.3.2.tar.xz/m4/ltsugar.m4
^
|
@@ -1,123 +0,0 @@
-# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
-#
-# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
-# Written by Gary V. Vaughan, 2004
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# serial 6 ltsugar.m4
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
-
-
-# lt_join(SEP, ARG1, [ARG2...])
-# -----------------------------
-# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
-# associated separator.
-# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
-# versions in m4sugar had bugs.
-m4_define([lt_join],
-[m4_if([$#], [1], [],
- [$#], [2], [[$2]],
- [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
-m4_define([_lt_join],
-[m4_if([$#$2], [2], [],
- [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
-
-
-# lt_car(LIST)
-# lt_cdr(LIST)
-# ------------
-# Manipulate m4 lists.
-# These macros are necessary as long as will still need to support
-# Autoconf-2.59 which quotes differently.
-m4_define([lt_car], [[$1]])
-m4_define([lt_cdr],
-[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
- [$#], 1, [],
- [m4_dquote(m4_shift($@))])])
-m4_define([lt_unquote], $1)
-
-
-# lt_append(MACRO-NAME, STRING, [SEPARATOR])
-# ------------------------------------------
-# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
-# Note that neither SEPARATOR nor STRING are expanded; they are appended
-# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
-# No SEPARATOR is output if MACRO-NAME was previously undefined (different
-# than defined and empty).
-#
-# This macro is needed until we can rely on Autoconf 2.62, since earlier
-# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
-m4_define([lt_append],
-[m4_define([$1],
- m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
-
-
-
-# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
-# ----------------------------------------------------------
-# Produce a SEP delimited list of all paired combinations of elements of
-# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
-# has the form PREFIXmINFIXSUFFIXn.
-# Needed until we can rely on m4_combine added in Autoconf 2.62.
-m4_define([lt_combine],
-[m4_if(m4_eval([$# > 3]), [1],
- [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
-[[m4_foreach([_Lt_prefix], [$2],
- [m4_foreach([_Lt_suffix],
- ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
- [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
-
-
-# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
-# -----------------------------------------------------------------------
-# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
-# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
-m4_define([lt_if_append_uniq],
-[m4_ifdef([$1],
- [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
- [lt_append([$1], [$2], [$3])$4],
- [$5])],
- [lt_append([$1], [$2], [$3])$4])])
-
-
-# lt_dict_add(DICT, KEY, VALUE)
-# -----------------------------
-m4_define([lt_dict_add],
-[m4_define([$1($2)], [$3])])
-
-
-# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
-# --------------------------------------------
-m4_define([lt_dict_add_subkey],
-[m4_define([$1($2:$3)], [$4])])
-
-
-# lt_dict_fetch(DICT, KEY, [SUBKEY])
-# ----------------------------------
-m4_define([lt_dict_fetch],
-[m4_ifval([$3],
- m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
- m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
-
-
-# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
-# -----------------------------------------------------------------
-m4_define([lt_if_dict_fetch],
-[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
- [$5],
- [$6])])
-
-
-# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
-# --------------------------------------------------------------
-m4_define([lt_dict_filter],
-[m4_if([$5], [], [],
- [lt_join(m4_quote(m4_default([$4], [[, ]])),
- lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
- [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
-])
|
[-]
[+]
|
Deleted |
libxkbcommon-0.3.2.tar.xz/m4/ltversion.m4
^
|
@@ -1,23 +0,0 @@
-# ltversion.m4 -- version numbers -*- Autoconf -*-
-#
-# Copyright (C) 2004 Free Software Foundation, Inc.
-# Written by Scott James Remnant, 2004
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# @configure_input@
-
-# serial 3337 ltversion.m4
-# This file is part of GNU Libtool
-
-m4_define([LT_PACKAGE_VERSION], [2.4.2])
-m4_define([LT_PACKAGE_REVISION], [1.3337])
-
-AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.4.2'
-macro_revision='1.3337'
-_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
-_LT_DECL(, macro_revision, 0)
-])
|
[-]
[+]
|
Deleted |
libxkbcommon-0.3.2.tar.xz/m4/lt~obsolete.m4
^
|
@@ -1,98 +0,0 @@
-# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
-#
-# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
-# Written by Scott James Remnant, 2004.
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# serial 5 lt~obsolete.m4
-
-# These exist entirely to fool aclocal when bootstrapping libtool.
-#
-# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
-# which have later been changed to m4_define as they aren't part of the
-# exported API, or moved to Autoconf or Automake where they belong.
-#
-# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
-# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
-# using a macro with the same name in our local m4/libtool.m4 it'll
-# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
-# and doesn't know about Autoconf macros at all.)
-#
-# So we provide this file, which has a silly filename so it's always
-# included after everything else. This provides aclocal with the
-# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
-# because those macros already exist, or will be overwritten later.
-# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
-#
-# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
-# Yes, that means every name once taken will need to remain here until
-# we give up compatibility with versions before 1.7, at which point
-# we need to keep only those names which we still refer to.
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
-
-m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
-m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
-m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
-m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
-m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
-m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
-m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
-m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
-m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
-m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
-m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
-m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
-m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
-m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
-m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
-m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
-m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
-m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
-m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
-m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
-m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
-m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
-m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
-m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
-m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
-m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
-m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
-m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
-m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
-m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
-m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
-m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
-m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
-m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
-m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
-m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
-m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
-m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
-m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
-m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
-m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
-m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
-m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
-m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
-m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
-m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
-m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
-m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
-m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
-m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
-m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
-m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
-m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
-m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
-m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
-m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
-m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
|
[-]
[+]
|
Deleted |
libxkbcommon-0.3.2.tar.xz/src/config.h.in
^
|
@@ -1,139 +0,0 @@
-/* src/config.h.in. Generated from configure.ac by autoheader. */
-
-/* Default XKB layout */
-#undef DEFAULT_XKB_LAYOUT
-
-/* Default XKB model */
-#undef DEFAULT_XKB_MODEL
-
-/* Default XKB options */
-#undef DEFAULT_XKB_OPTIONS
-
-/* Default XKB ruleset */
-#undef DEFAULT_XKB_RULES
-
-/* Default XKB variant */
-#undef DEFAULT_XKB_VARIANT
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#undef HAVE_DLFCN_H
-
-/* Define to 1 if you have the `eaccess' function. */
-#undef HAVE_EACCESS
-
-/* Define to 1 if you have the `euidaccess' function. */
-#undef HAVE_EUIDACCESS
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
-
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
-/* Define to 1 if you have the `mmap' function. */
-#undef HAVE_MMAP
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Define to 1 if you have the `strcasecmp' function. */
-#undef HAVE_STRCASECMP
-
-/* Define to 1 if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define to 1 if you have the `strncasecmp' function. */
-#undef HAVE_STRNCASECMP
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
-
-/* Define to the sub-directory in which libtool stores uninstalled libraries.
- */
-#undef LT_OBJDIR
-
-/* Name of package */
-#undef PACKAGE
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
-#undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
-#undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
-#undef PACKAGE_TARNAME
-
-/* Define to the home page for this package. */
-#undef PACKAGE_URL
-
-/* Define to the version of this package. */
-#undef PACKAGE_VERSION
-
-/* Major version of this package */
-#undef PACKAGE_VERSION_MAJOR
-
-/* Minor version of this package */
-#undef PACKAGE_VERSION_MINOR
-
-/* Patch version of this package */
-#undef PACKAGE_VERSION_PATCHLEVEL
-
-/* Define to 1 if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Enable extensions on AIX 3, Interix. */
-#ifndef _ALL_SOURCE
-# undef _ALL_SOURCE
-#endif
-/* Enable GNU extensions on systems that have them. */
-#ifndef _GNU_SOURCE
-# undef _GNU_SOURCE
-#endif
-/* Enable threading extensions on Solaris. */
-#ifndef _POSIX_PTHREAD_SEMANTICS
-# undef _POSIX_PTHREAD_SEMANTICS
-#endif
-/* Enable extensions on HP NonStop. */
-#ifndef _TANDEM_SOURCE
-# undef _TANDEM_SOURCE
-#endif
-/* Enable general extensions on Solaris. */
-#ifndef __EXTENSIONS__
-# undef __EXTENSIONS__
-#endif
-
-
-/* Version number of package */
-#undef VERSION
-
-/* Define to 1 if on MINIX. */
-#undef _MINIX
-
-/* Define to 2 if the system does not provide POSIX.1 features except with
- this defined. */
-#undef _POSIX_1_SOURCE
-
-/* Define to 1 if you need to in order for `stat' and other things to work. */
-#undef _POSIX_SOURCE
-
-/* Define to `__inline__' or `__inline' if that's what the C compiler
- calls it, or to nothing if 'inline' is not supported under any name. */
-#ifndef __cplusplus
-#undef inline
-#endif
|
[-]
[+]
|
Deleted |
libxkbcommon-0.3.2.tar.xz/src/xkbcomp/parser.c
^
|
@@ -1,3181 +0,0 @@
-/* A Bison parser, made by GNU Bison 3.0. */
-
-/* Bison implementation for Yacc-like parsers in C
-
- Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-/* As a special exception, you may create a larger work that contains
- part or all of the Bison parser skeleton and distribute that work
- under terms of your choice, so long as that work isn't itself a
- parser generator using the skeleton or a modified version thereof
- as a parser skeleton. Alternatively, if you modify or redistribute
- the parser skeleton itself, you may (at your option) remove this
- special exception, which will cause the skeleton and the resulting
- Bison output files to be licensed under the GNU General Public
- License without this special exception.
-
- This special exception was added by the Free Software Foundation in
- version 2.2 of Bison. */
-
-/* C LALR(1) parser skeleton written by Richard Stallman, by
- simplifying the original so-called "semantic" parser. */
-
-/* All symbols defined below should begin with yy or YY, to avoid
- infringing on user name space. This should be done even for local
- variables, as they might otherwise be expanded by user macros.
- There are some unavoidable exceptions within include files to
- define necessary library symbols; they are noted "INFRINGES ON
- USER NAME SPACE" below. */
-
-/* Identify Bison output. */
-#define YYBISON 1
-
-/* Bison version. */
-#define YYBISON_VERSION "3.0"
-
-/* Skeleton name. */
-#define YYSKELETON_NAME "yacc.c"
-
-/* Pure parsers. */
-#define YYPURE 1
-
-/* Push parsers. */
-#define YYPUSH 0
-
-/* Pull parsers. */
-#define YYPULL 1
-
-
-/* Substitute the variable and function names. */
-#define yyparse _xkbcommon_parse
-#define yylex _xkbcommon_lex
-#define yyerror _xkbcommon_error
-#define yydebug _xkbcommon_debug
-#define yynerrs _xkbcommon_nerrs
-
-
-/* Copy the first part of user declarations. */
-#line 33 "src/xkbcomp/parser.y" /* yacc.c:339 */
-
-#include "xkbcomp-priv.h"
-#include "ast-build.h"
-#include "parser-priv.h"
-
-struct parser_param {
- struct xkb_context *ctx;
- void *scanner;
- XkbFile *rtrn;
- bool more_maps;
-};
-
-static void
-_xkbcommon_error(struct parser_param *param, const char *msg)
-{
- scanner_error(param->scanner, msg);
-}
-
-#define scanner param->scanner
-
-#line 93 "src/xkbcomp/parser.c" /* yacc.c:339 */
-
-# ifndef YY_NULL
-# if defined __cplusplus && 201103L <= __cplusplus
-# define YY_NULL nullptr
-# else
-# define YY_NULL 0
-# endif
-# endif
-
-/* Enabling verbose error messages. */
-#ifdef YYERROR_VERBOSE
-# undef YYERROR_VERBOSE
-# define YYERROR_VERBOSE 1
-#else
-# define YYERROR_VERBOSE 0
-#endif
-
-/* In a future release of Bison, this section will be replaced
- by #include "y.tab.h". */
-#ifndef YY__XKBCOMMON_SRC_XKBCOMP_PARSER_H_INCLUDED
-# define YY__XKBCOMMON_SRC_XKBCOMP_PARSER_H_INCLUDED
-/* Debug traces. */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
-#if YYDEBUG
-extern int _xkbcommon_debug;
-#endif
-
-/* Token type. */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
- enum yytokentype
- {
- END_OF_FILE = 0,
- ERROR_TOK = 255,
- XKB_KEYMAP = 1,
- XKB_KEYCODES = 2,
- XKB_TYPES = 3,
- XKB_SYMBOLS = 4,
- XKB_COMPATMAP = 5,
- XKB_GEOMETRY = 6,
- XKB_SEMANTICS = 7,
- XKB_LAYOUT = 8,
- INCLUDE = 10,
- OVERRIDE = 11,
- AUGMENT = 12,
- REPLACE = 13,
- ALTERNATE = 14,
- VIRTUAL_MODS = 20,
- TYPE = 21,
- INTERPRET = 22,
- ACTION_TOK = 23,
- KEY = 24,
- ALIAS = 25,
- GROUP = 26,
- MODIFIER_MAP = 27,
- INDICATOR = 28,
- SHAPE = 29,
- KEYS = 30,
- ROW = 31,
- SECTION = 32,
- OVERLAY = 33,
- TEXT = 34,
- OUTLINE = 35,
- SOLID = 36,
- LOGO = 37,
- VIRTUAL = 38,
- EQUALS = 40,
- PLUS = 41,
- MINUS = 42,
- DIVIDE = 43,
- TIMES = 44,
- OBRACE = 45,
- CBRACE = 46,
- OPAREN = 47,
- CPAREN = 48,
- OBRACKET = 49,
- CBRACKET = 50,
- DOT = 51,
- COMMA = 52,
- SEMI = 53,
- EXCLAM = 54,
- INVERT = 55,
- STRING = 60,
- INTEGER = 61,
- FLOAT = 62,
- IDENT = 63,
- KEYNAME = 64,
- PARTIAL = 70,
- DEFAULT = 71,
- HIDDEN = 72,
- ALPHANUMERIC_KEYS = 73,
- MODIFIER_KEYS = 74,
- KEYPAD_KEYS = 75,
- FUNCTION_KEYS = 76,
- ALTERNATE_GROUP = 77
- };
-#endif
-/* Tokens. */
-#define END_OF_FILE 0
-#define ERROR_TOK 255
-#define XKB_KEYMAP 1
-#define XKB_KEYCODES 2
-#define XKB_TYPES 3
-#define XKB_SYMBOLS 4
-#define XKB_COMPATMAP 5
|
[-]
[+]
|
Deleted |
libxkbcommon-0.3.2.tar.xz/src/xkbcomp/parser.h
^
|
@@ -1,219 +0,0 @@
-/* A Bison parser, made by GNU Bison 3.0. */
-
-/* Bison interface for Yacc-like parsers in C
-
- Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-/* As a special exception, you may create a larger work that contains
- part or all of the Bison parser skeleton and distribute that work
- under terms of your choice, so long as that work isn't itself a
- parser generator using the skeleton or a modified version thereof
- as a parser skeleton. Alternatively, if you modify or redistribute
- the parser skeleton itself, you may (at your option) remove this
- special exception, which will cause the skeleton and the resulting
- Bison output files to be licensed under the GNU General Public
- License without this special exception.
-
- This special exception was added by the Free Software Foundation in
- version 2.2 of Bison. */
-
-#ifndef YY__XKBCOMMON_SRC_XKBCOMP_PARSER_H_INCLUDED
-# define YY__XKBCOMMON_SRC_XKBCOMP_PARSER_H_INCLUDED
-/* Debug traces. */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
-#if YYDEBUG
-extern int _xkbcommon_debug;
-#endif
-
-/* Token type. */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
- enum yytokentype
- {
- END_OF_FILE = 0,
- ERROR_TOK = 255,
- XKB_KEYMAP = 1,
- XKB_KEYCODES = 2,
- XKB_TYPES = 3,
- XKB_SYMBOLS = 4,
- XKB_COMPATMAP = 5,
- XKB_GEOMETRY = 6,
- XKB_SEMANTICS = 7,
- XKB_LAYOUT = 8,
- INCLUDE = 10,
- OVERRIDE = 11,
- AUGMENT = 12,
- REPLACE = 13,
- ALTERNATE = 14,
- VIRTUAL_MODS = 20,
- TYPE = 21,
- INTERPRET = 22,
- ACTION_TOK = 23,
- KEY = 24,
- ALIAS = 25,
- GROUP = 26,
- MODIFIER_MAP = 27,
- INDICATOR = 28,
- SHAPE = 29,
- KEYS = 30,
- ROW = 31,
- SECTION = 32,
- OVERLAY = 33,
- TEXT = 34,
- OUTLINE = 35,
- SOLID = 36,
- LOGO = 37,
- VIRTUAL = 38,
- EQUALS = 40,
- PLUS = 41,
- MINUS = 42,
- DIVIDE = 43,
- TIMES = 44,
- OBRACE = 45,
- CBRACE = 46,
- OPAREN = 47,
- CPAREN = 48,
- OBRACKET = 49,
- CBRACKET = 50,
- DOT = 51,
- COMMA = 52,
- SEMI = 53,
- EXCLAM = 54,
- INVERT = 55,
- STRING = 60,
- INTEGER = 61,
- FLOAT = 62,
- IDENT = 63,
- KEYNAME = 64,
- PARTIAL = 70,
- DEFAULT = 71,
- HIDDEN = 72,
- ALPHANUMERIC_KEYS = 73,
- MODIFIER_KEYS = 74,
- KEYPAD_KEYS = 75,
- FUNCTION_KEYS = 76,
- ALTERNATE_GROUP = 77
- };
-#endif
-/* Tokens. */
-#define END_OF_FILE 0
-#define ERROR_TOK 255
-#define XKB_KEYMAP 1
-#define XKB_KEYCODES 2
-#define XKB_TYPES 3
-#define XKB_SYMBOLS 4
-#define XKB_COMPATMAP 5
-#define XKB_GEOMETRY 6
-#define XKB_SEMANTICS 7
-#define XKB_LAYOUT 8
-#define INCLUDE 10
-#define OVERRIDE 11
-#define AUGMENT 12
-#define REPLACE 13
-#define ALTERNATE 14
-#define VIRTUAL_MODS 20
-#define TYPE 21
-#define INTERPRET 22
-#define ACTION_TOK 23
-#define KEY 24
-#define ALIAS 25
-#define GROUP 26
-#define MODIFIER_MAP 27
-#define INDICATOR 28
-#define SHAPE 29
-#define KEYS 30
-#define ROW 31
-#define SECTION 32
-#define OVERLAY 33
-#define TEXT 34
-#define OUTLINE 35
-#define SOLID 36
-#define LOGO 37
-#define VIRTUAL 38
-#define EQUALS 40
-#define PLUS 41
-#define MINUS 42
-#define DIVIDE 43
-#define TIMES 44
-#define OBRACE 45
-#define CBRACE 46
-#define OPAREN 47
-#define CPAREN 48
-#define OBRACKET 49
-#define CBRACKET 50
-#define DOT 51
-#define COMMA 52
-#define SEMI 53
-#define EXCLAM 54
-#define INVERT 55
-#define STRING 60
-#define INTEGER 61
-#define FLOAT 62
-#define IDENT 63
-#define KEYNAME 64
-#define PARTIAL 70
-#define DEFAULT 71
-#define HIDDEN 72
-#define ALPHANUMERIC_KEYS 73
-#define MODIFIER_KEYS 74
-#define KEYPAD_KEYS 75
-#define FUNCTION_KEYS 76
-#define ALTERNATE_GROUP 77
-
-/* Value type. */
-#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE YYSTYPE;
-union YYSTYPE
-{
-#line 131 "src/xkbcomp/parser.y" /* yacc.c:1909 */
-
- int ival;
- unsigned uval;
- int64_t num;
- enum xkb_file_type file_type;
- char *str;
- xkb_atom_t sval;
- enum merge_mode merge;
- enum xkb_map_flags mapFlags;
- ParseCommon *any;
- ExprDef *expr;
- VarDef *var;
- VModDef *vmod;
- InterpDef *interp;
- KeyTypeDef *keyType;
- SymbolsDef *syms;
|
[-]
[+]
|
Deleted |
libxkbcommon-0.3.2.tar.xz/test/interactive.c
^
|
@@ -1,565 +0,0 @@
-/*
- * Copyright © 2012 Ran Benita <ran234@gmail.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#include <dirent.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <fnmatch.h>
-#include <limits.h>
-#include <locale.h>
-#include <signal.h>
-#include <string.h>
-#include <sysexits.h>
-#include <unistd.h>
-
-#include <sys/epoll.h>
-#include <linux/input.h>
-
-#include "test.h"
-
-struct keyboard {
- char *path;
- int fd;
- struct xkb_state *state;
- struct keyboard *next;
-};
-
-static bool terminate;
-static int evdev_offset = 8;
-static bool report_state_changes;
-
-#define NLONGS(n) (((n) + LONG_BIT - 1) / LONG_BIT)
-
-static bool
-evdev_bit_is_set(const unsigned long *array, int bit)
-{
- return !!(array[bit / LONG_BIT] & (1LL << (bit % LONG_BIT)));
-}
-
-/* Some heuristics to see if the device is a keyboard. */
-static bool
-is_keyboard(int fd)
-{
- int i;
- unsigned long evbits[NLONGS(EV_CNT)] = { 0 };
- unsigned long keybits[NLONGS(KEY_CNT)] = { 0 };
-
- errno = 0;
- ioctl(fd, EVIOCGBIT(0, sizeof(evbits)), evbits);
- if (errno)
- return false;
-
- if (!evdev_bit_is_set(evbits, EV_KEY))
- return false;
-
- errno = 0;
- ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(keybits)), keybits);
- if (errno)
- return false;
-
- for (i = KEY_RESERVED; i <= KEY_MIN_INTERESTING; i++)
- if (evdev_bit_is_set(keybits, i))
- return true;
-
- return false;
-}
-
-static int
-keyboard_new(struct dirent *ent, struct xkb_keymap *keymap,
- struct keyboard **out)
-{
- int ret;
- char *path;
- int fd;
- struct xkb_state *state;
- struct keyboard *kbd;
-
- ret = asprintf(&path, "/dev/input/%s", ent->d_name);
- if (ret < 0)
- return -ENOMEM;
-
- fd = open(path, O_NONBLOCK | O_CLOEXEC | O_RDONLY);
- if (fd < 0) {
- ret = -errno;
- goto err_path;
- }
-
- if (!is_keyboard(fd)) {
- /* Dummy "skip this device" value. */
- ret = -ENOTSUP;
- goto err_fd;
- }
-
- state = xkb_state_new(keymap);
- if (!state) {
- fprintf(stderr, "Couldn't create xkb state for %s\n", path);
- ret = -EFAULT;
- goto err_fd;
- }
-
- kbd = calloc(1, sizeof(*kbd));
- if (!kbd) {
- ret = -ENOMEM;
- goto err_state;
- }
-
- kbd->path = path;
- kbd->fd = fd;
- kbd->state = state;
- *out = kbd;
- return 0;
-
-err_state:
- xkb_state_unref(state);
-err_fd:
- close(fd);
-err_path:
- free(path);
- return ret;
-}
-
-static void
-keyboard_free(struct keyboard *kbd)
-{
- if (!kbd)
- return;
- if (kbd->fd >= 0)
- close(kbd->fd);
- free(kbd->path);
- xkb_state_unref(kbd->state);
- free(kbd);
-}
-
-static int
-filter_device_name(const struct dirent *ent)
-{
- return !fnmatch("event*", ent->d_name, 0);
-}
-
-static struct keyboard *
-get_keyboards(struct xkb_keymap *keymap)
-{
- int ret, i, nents;
- struct dirent **ents;
- struct keyboard *kbds = NULL, *kbd = NULL;
-
- nents = scandir("/dev/input", &ents, filter_device_name, alphasort);
- if (nents < 0) {
- fprintf(stderr, "Couldn't scan /dev/input: %s\n", strerror(errno));
- return NULL;
- }
-
- for (i = 0; i < nents; i++) {
- ret = keyboard_new(ents[i], keymap, &kbd);
- if (ret) {
- if (ret == -EACCES) {
- fprintf(stderr, "Couldn't open /dev/input/%s: %s. "
- "You probably need root to run this.\n",
- ents[i]->d_name, strerror(-ret));
- break;
- }
- if (ret != -ENOTSUP) {
- fprintf(stderr, "Couldn't open /dev/input/%s: %s. Skipping.\n",
- ents[i]->d_name, strerror(-ret));
- }
- continue;
- }
-
- kbd->next = kbds;
- kbds = kbd;
- }
-
- if (!kbds) {
- fprintf(stderr, "Couldn't find any keyboards I can use! Quitting.\n");
- goto err;
- }
-
-err:
- for (i = 0; i < nents; i++)
- free(ents[i]);
|
[-]
[+]
|
Added |
libxkbcommon-0.4.0.tar.xz/.autom4te.cfg
^
|
@@ -0,0 +1,3 @@
+begin-language: "Autoconf-without-aclocal-m4"
+args: --cache=build-aux
+end-language: "Autoconf-without-aclocal-m4"
|
[-]
[+]
|
Added |
libxkbcommon-0.4.0.tar.xz/.gitignore
^
|
@@ -0,0 +1,84 @@
+#
+# X.Org module default exclusion patterns
+# The next section if for module specific patterns
+#
+# Do not edit the following section
+# GNU Build System (Autotools)
+aclocal.m4
+autom4te.cache/
+autoscan.log
+ChangeLog
+compile
+config.guess
+config.h
+config.h.in
+config.log
+config-ml.in
+config.py
+config.status
+config.status.lineno
+config.sub
+configure
+configure.scan
+depcomp
+.deps/
+INSTALL
+install-sh
+.libs/
+libtool
+libtool.m4
+ltmain.sh
+lt~obsolete.m4
+ltoptions.m4
+ltsugar.m4
+ltversion.m4
+Makefile
+Makefile.in
+mdate-sh
+missing
+mkinstalldirs
+*.pc
+py-compile
+stamp-h?
+symlink-tree
+texinfo.tex
+ylwrap
+
+# Do not edit the following section
+# Edit Compile Debug Document Distribute
+*~
+*.[0-9]
+*.[0-9]x
+*.bak
+*.bin
+core
+*.dll
+*.exe
+*-ISO*.bdf
+*-JIS*.bdf
+*-KOI8*.bdf
+*.kld
+*.ko
+*.ko.cmd
+*.lai
+*.l[oa]
+*.[oa]
+*.obj
+*.patch
+*.so
+*.pcf.gz
+*.pdb
+*.tar.bz2
+*.tar.gz
+#
+# Add & Override patterns for libxkbcommon
+#
+# Edit the following section as needed
+# For example, !report.pc overrides *.pc. See 'man gitignore'
+#
+
+.dirstamp
+cscope.out
+test-suite.log
+test-driver
+build-aux/
|
[-]
[+]
|
Added |
libxkbcommon-0.4.0.tar.xz/.uncrustify.cfg
^
|
@@ -0,0 +1,228 @@
+tok_split_gte=false
+utf8_byte=true
+utf8_force=true
+indent_cmt_with_tabs=false
+indent_align_string=false
+indent_braces=false
+indent_braces_no_func=false
+indent_braces_no_class=false
+indent_braces_no_struct=false
+indent_brace_parent=false
+indent_namespace=false
+indent_extern=false
+indent_class=false
+indent_class_colon=false
+indent_else_if=false
+indent_var_def_cont=false
+indent_func_call_param=false
+indent_func_def_param=false
+indent_func_proto_param=false
+indent_func_class_param=false
+indent_func_ctor_var_param=false
+indent_template_param=false
+indent_func_param_double=false
+indent_relative_single_line_comments=false
+indent_col1_comment=false
+indent_access_spec_body=false
+indent_paren_nl=false
+indent_comma_paren=false
+indent_bool_paren=false
+indent_first_bool_expr=false
+indent_square_nl=false
+indent_preserve_sql=false
+indent_align_assign=true
+sp_balance_nested_parens=false
+align_keep_tabs=false
+align_with_tabs=false
+align_on_tabstop=false
+align_number_left=false
+align_func_params=false
+align_same_func_call_params=false
+align_var_def_colon=true
+align_var_def_attribute=true
+align_var_def_inline=true
+align_right_cmt_mix=false
+align_on_operator=false
+align_mix_var_proto=false
+align_single_line_func=false
+align_single_line_brace=false
+align_nl_cont=false
+align_left_shift=true
+align_oc_decl_colon=true
+nl_collapse_empty_body=true
+nl_assign_leave_one_liners=true
+nl_class_leave_one_liners=true
+nl_enum_leave_one_liners=true
+nl_getset_leave_one_liners=true
+nl_func_leave_one_liners=true
+nl_if_leave_one_liners=true
+nl_multi_line_cond=false
+nl_multi_line_define=false
+nl_before_case=true
+nl_after_case=true
+nl_after_return=false
+nl_after_semicolon=true
+nl_after_brace_open=true
+nl_after_brace_open_cmt=false
+nl_after_vbrace_open=false
+nl_after_vbrace_open_empty=false
+nl_after_brace_close=false
+nl_after_vbrace_close=false
+nl_define_macro=false
+nl_squeeze_ifdef=false
+nl_ds_struct_enum_cmt=false
+nl_ds_struct_enum_close_brace=false
+nl_create_if_one_liner=false
+nl_create_for_one_liner=false
+nl_create_while_one_liner=false
+ls_for_split_full=false
+ls_func_split_full=false
+nl_after_multiline_comment=false
+eat_blanks_after_open_brace=false
+eat_blanks_before_close_brace=false
+mod_full_brace_if_chain=false
+mod_pawn_semicolon=false
+mod_full_paren_if_bool=false
+mod_remove_extra_semicolon=false
+mod_sort_import=false
+mod_sort_using=false
+mod_sort_include=false
+mod_move_case_break=false
+mod_remove_empty_return=false
+cmt_indent_multi=true
+cmt_c_group=false
+cmt_c_nl_start=false
+cmt_c_nl_end=false
+cmt_cpp_group=false
+cmt_cpp_nl_start=false
+cmt_cpp_nl_end=false
+cmt_cpp_to_c=true
+cmt_star_cont=true
+cmt_multi_check_last=true
+cmt_insert_before_preproc=false
+pp_indent_at_level=false
+pp_region_indent_code=false
+pp_if_indent_code=false
+pp_define_at_level=false
+indent_columns=4
+indent_brace=0
+indent_switch_case=0
+align_struct_init_span=2
+align_pp_define_gap=0
+align_pp_define_span=2
+align_oc_msg_colon_span=16
+nl_end_of_file_min=1
+nl_func_var_def_blk=0
+code_width=78
+nl_max=2
+newlines=auto
+indent_with_tabs=0
+sp_arith=force
+sp_assign=force
+sp_assign_default=force
+sp_before_assign=force
+sp_after_assign=force
+sp_enum_assign=force
+sp_enum_before_assign=force
+sp_enum_after_assign=force
+sp_pp_stringify=add
+sp_bool=force
+sp_compare=force
+sp_inside_paren=remove
+sp_paren_paren=remove
+sp_paren_brace=force
+sp_before_ptr_star=ignore
+sp_before_unnamed_ptr_star=force
+sp_before_byref=force
+sp_before_unnamed_byref=force
+sp_after_byref=remove
+sp_after_type=force
+sp_before_sparen=force
+sp_inside_sparen=remove
+sp_inside_sparen_close=remove
+sp_after_sparen=force
+sp_sparen_brace=force
+sp_special_semi=force
+sp_before_semi=remove
+sp_after_semi=force
+sp_after_semi_for=force
+sp_after_semi_for_empty=force
+sp_before_square=remove
+sp_inside_square=remove
+sp_after_comma=force
+sp_before_comma=remove
+sp_paren_comma=force
+sp_before_ellipsis=force
+sp_after_class_colon=force
+sp_before_class_colon=force
+sp_before_case_colon=remove
+sp_after_cast=force
+sp_inside_paren_cast=remove
+sp_sizeof_paren=remove
+sp_inside_braces_enum=force
+sp_inside_braces_struct=force
+sp_inside_braces=force
+sp_inside_braces_empty=force
+sp_func_proto_paren=remove
+sp_func_def_paren=remove
+sp_inside_fparens=remove
+sp_inside_fparen=remove
+sp_square_fparen=remove
+sp_fparen_brace=force
+sp_func_call_paren=remove
+sp_func_call_paren_empty=remove
+sp_return_paren=force
+sp_attribute_paren=remove
+sp_defined_paren=remove
+sp_macro=force
+sp_macro_func=force
+sp_else_brace=force
+sp_brace_else=force
+sp_brace_typedef=force
+sp_not=remove
+sp_inv=remove
+nl_start_of_file=remove
+nl_end_of_file=force
+nl_assign_square=remove
+nl_after_square_assign=remove
+nl_fcall_brace=remove
+nl_enum_brace=remove
+nl_struct_brace=remove
+nl_union_brace=remove
+nl_if_brace=remove
+nl_brace_else=force
+nl_elseif_brace=remove
+nl_else_brace=remove
+nl_else_if=remove
+nl_for_brace=remove
+nl_do_brace=remove
+nl_brace_while=remove
|
[-]
[+]
|
Added |
libxkbcommon-0.4.0.tar.xz/Android.mk
^
|
@@ -0,0 +1,44 @@
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LIBXKBCOMMON_TOP := $(LOCAL_PATH)
+
+LIBXKBCOMMON_BUILT_MAKEFILES := \
+ $(LIBXKBCOMMON_TOP)/Android_build.mk
+
+LIBXKBCOMMON_CONFIGURE_TARGET := $(LIBXKBCOMMON_TOP)/Makefile
+
+$(LIBXKBCOMMON_CONFIGURE_TARGET): $(CONFIGURE_DEPENDENCIES)
+ cd $(LIBXKBCOMMON_TOP) && autoreconf -fiv
+ cd $(LIBXKBCOMMON_TOP) && \
+ CC="$(CONFIGURE_CC)" \
+ CFLAGS="$(CONFIGURE_CFLAGS)" \
+ LD=$(TARGET_LD) \
+ LDFLAGS="$(CONFIGURE_LDFLAGS)" \
+ CPP=$(CONFIGURE_CPP) \
+ CPPFLAGS="$(CONFIGURE_CPPFLAGS)" \
+ PKG_CONFIG_LIBDIR=$(CONFIGURE_PKG_CONFIG_LIBDIR) \
+ PKG_CONFIG_TOP_BUILD_DIR=$(PKG_CONFIG_TOP_BUILD_DIR) \
+ ./configure --host=arm-linux-androideabi \
+ --prefix /system \
+ --with-xkb-config-root=/system/usr/share/xkb
+
+$(LIBXKBCOMMON_BUILT_MAKEFILES): $(LIBXKBCOMMON_CONFIGURE_TARGET)
+ make -C $(dir $@) $(notdir $@)
+
+.PHONY: libxkbcommon-reset libxkbcommon-clean
+
+libxkbcommon-reset:
+ cd $(LIBXKBCOMMON_TOP) && \
+ git clean -qdxf && \
+ git reset --hard HEAD
+
+libxkbcommon-clean:
+
+contrib-reset: libxkbcommon-reset
+contrib-clean: libxkbcommon-clean
+
+CONFIGURE_PKG_CONFIG_LIBDIR := $(CONFIGURE_PKG_CONFIG_LIBDIR):$(abspath $(LIBXKBCOMMON_TOP))
+
+include $(LIBXKBCOMMON_BUILT_MAKEFILES)
+
|
[-]
[+]
|
Changed |
libxkbcommon-0.4.0.tar.xz/Makefile.am
^
|
@@ -17,6 +17,9 @@
AM_CFLAGS = $(BASE_CFLAGS)
AM_LDFLAGS = -no-undefined
+if HAVE_NO_UNDEFINED
+AM_LDFLAGS += -Wl,--no-undefined
+endif
AM_YFLAGS = -d -p _xkbcommon_
@@ -59,6 +62,7 @@
src/atom.h \
src/context.c \
src/context.h \
+ src/context-priv.c \
src/compat.c \
src/darray.h \
src/keysym.c \
@@ -67,12 +71,40 @@
src/ks_tables.h \
src/keymap.c \
src/keymap.h \
+ src/keymap-priv.c \
src/state.c \
src/text.c \
src/text.h \
src/utils.c \
src/utils.h
+if ENABLE_X11
+pkgconfig_DATA += xkbcommon-x11.pc
+
+xkbcommon_x11includedir = $(xkbcommonincludedir)
+xkbcommon_x11include_HEADERS = \
+ xkbcommon/xkbcommon-x11.h
+
+lib_LTLIBRARIES += libxkbcommon-x11.la
+
+libxkbcommon_x11_la_CFLAGS = $(AM_CFLAGS) $(XCB_XKB_CFLAGS)
+libxkbcommon_x11_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/src/x11
+libxkbcommon_x11_la_LIBADD = libxkbcommon.la $(XCB_XKB_LIBS)
+
+libxkbcommon_x11_la_SOURCES = \
+ src/x11/keymap.c \
+ src/x11/state.c \
+ src/x11/util.c \
+ src/x11/x11-priv.h \
+ src/context.h \
+ src/context-priv.c \
+ src/keymap.h \
+ src/keymap-priv.c \
+ src/atom.h \
+ src/atom.c
+
+endif ENABLE_X11
+
BUILT_SOURCES = \
src/xkbcomp/parser.c \
src/xkbcomp/parser.h
@@ -130,7 +162,8 @@
test/rules-file \
test/stringcomp \
test/buffercomp \
- test/log
+ test/log \
+ test/atom
TESTS_LDADD = libtest.la
test_keysym_LDADD = $(TESTS_LDADD)
@@ -142,6 +175,7 @@
test_stringcomp_LDADD = $(TESTS_LDADD)
test_buffercomp_LDADD = $(TESTS_LDADD)
test_log_LDADD = $(TESTS_LDADD)
+test_atom_LDADD = $(TESTS_LDADD)
test_rmlvo_to_kccgst_LDADD = $(TESTS_LDADD)
test_print_compiled_keymap_LDADD = $(TESTS_LDADD)
test_bench_key_proc_LDADD = $(TESTS_LDADD) -lrt
@@ -160,13 +194,28 @@
test_keyseq_LDADD = $(TESTS_LDADD)
test_state_LDADD = $(TESTS_LDADD)
-test_interactive_LDADD = $(TESTS_LDADD)
+test_interactive_evdev_LDADD = $(TESTS_LDADD)
check_PROGRAMS += \
- test/interactive
+ test/interactive-evdev
endif BUILD_LINUX_TESTS
+if ENABLE_X11
+TESTS += \
+ test/x11
+TESTS_X11_LDADD = $(TESTS_LDADD) $(XCB_XKB_LIBS) libxkbcommon-x11.la
+TESTS_X11_CFLAGS = $(XCB_XKB_CFLAGS)
+
+test_x11_LDADD = $(TESTS_X11_LDADD)
+test_x11_CFLAGS = $(TESTS_X11_CFLAGS)
+test_interactive_x11_LDADD = $(TESTS_X11_LDADD)
+test_interactive_x11_CFLAGS = $(TESTS_X11_CFLAGS)
+
+check_PROGRAMS += \
+ test/interactive-x11
+endif ENABLE_X11
+
EXTRA_DIST += \
test/data
@@ -190,8 +239,7 @@
-e 's/#define\s*\(\w*\)XK_/#define XKB_KEY_\1/' \
-e '/\(#ifdef\|#ifndef\|#endif\)/d' $(KEYSYMDEFS) >> $(top_srcdir)/xkbcommon/xkbcommon-keysyms.h
echo -en '\n\n#endif\n' >> $(top_srcdir)/xkbcommon/xkbcommon-keysyms.h
- echo -en '/* This file is autogenerated from Makefile.am; please do not commit directly. */\n\n' > $(top_srcdir)/src/ks_tables.h
- LC_CTYPE=C python $(top_srcdir)/makekeys.py $(top_srcdir)/xkbcommon/xkbcommon-keysyms.h >> $(top_srcdir)/src/ks_tables.h
+ LC_CTYPE=C python $(top_srcdir)/makekeys.py $(top_srcdir)/xkbcommon/xkbcommon-keysyms.h > $(top_srcdir)/src/ks_tables.h
# Run this if you add/remove a new keyword to the xkbcomp scanner,
# or just want to regenerate the gperf file.
|
[-]
[+]
|
Changed |
libxkbcommon-0.4.0.tar.xz/NEWS
^
|
@@ -1,7 +1,32 @@
-libxkbcommon 0.3.2
+libxkbcommon 0.4.0
==================
-- Added XKB_KEY_XF86AudioMicMute keysym, to match xproto 7.0.24.
+- Add a new add-on library, xkbcommon-x11, to support creating keymaps
+ with the XKB X11 protocol, by querying the X server directly.
+ See the xkbcommon/xkbcommon-x11.h header file for more details.
+ This library requires libxcb-xkb >= 1.10, and is enabled by default.
+ It can be disabled with the --disable-x11 configure switch.
+ Distributions are encouraged to split the necessary files for this
+ library (libxkbcommon-x11.so, xkbcommon-x11.pc, xkbcommon/xkbcommon-x11.h)
+ to a separate package, such that the main package does not depend on
+ X11 libraries.
+
+- Fix the keysym <-> name lookup table to not require huge amounts of
+ relocations.
+
+- Fix a bug in the keysym <-> name lookup, whereby lookup might fail in
+ some rare cases.
+
+- Reduce memory usage during keymap compilation.
+
+- New API:
+ New keysyms from xproto 7.0.25 (German T3 layout keysyms).
+ XKB_MOD_NAME_NUM for the usual NumLock modifier.
+ xkb_x11_* types and functions, XKB_X11_* constants.
+
+
+libxkbcommon 0.3.2
+==================
- Log messages from the library now look like "xkbcommon: ERROR" by
default, instead of xkbcomp-like "Error: ".
@@ -13,6 +38,12 @@
- Support byacc for generating the parser, in addition to Bison.
+- New API:
+ XKB_KEY_XF86AudioMicMute keysym from xproto 7.0.24.
+ XKB_KEYSYM_NO_FLAGS
+ XKB_CONTEXT_NO_FLAGS
+ XKB_MAP_COMPILE_NO_FLAGS
+
- Bug fixes.
|
[-]
[+]
|
Changed |
libxkbcommon-0.4.0.tar.xz/README
^
|
@@ -25,27 +25,17 @@
While xkbcommon's API is somewhat derived from the classic XKB API as found
in <X11/extensions/XKB.h> and friends, it has been substantially reworked to
-expose fewer internal details to clients. The only supported API is available
-in <xkbcommon/xkbcommon.h>. Any definition not in this header (including
-accessing internal structures through the old macros previously available)
-should be regarded as an implementation detail and is liable to change at any
-time.
-
-During its early development, xkbcommon does not promise API or ABI stability.
-Regardless, we will attempt to not break ABI during a minor release series,
-so applications written against 0.1.0 should be completely compatible with
-0.1.3, but not necessarily with 0.2.0. However, new symbols may be introduced
-in any release. Thus, anyone packaging xkbcommon should make sure any package
-depending on it depends on a release greater than or equal to the version it
-was built against (or earlier, if it doesn't use any newly-introduced
-symbols), but less than the next major release.
-
-xkbcommon 1.x will offer full API and ABI stability for its lifetime, with a
-soname of libxkbcommon.so.1. Any ABI breaks will wait until xkbcommon 2.0,
-which will be libxkbcommon.so.2.
-
-The xkbcomp command-line tool has also been removed, although this will
-likely reappear in a later release.
+expose fewer internal details to clients. The supported API is available
+in the <xkbcommon/xkbcommon-*.h> files. Additional support is provided for
+X11 (XCB) clients, in the xkbcommon-x11 library, <xkbcommon/xkbcommon-x11.h>.
+
+The xkbcommon API and ABI are stable. We will attempt to not break ABI during
+a minor release series, so applications written against 0.1.0 should be
+completely compatible with 0.5.3, but not necessarily with 1.0.0. However, new
+symbols may be introduced in any release. Thus, anyone packaging xkbcommon
+should make sure any package depending on it depends on a release greater than
+or equal to the version it was built against (or earlier, if it doesn't use
+any newly-introduced symbols), but less than the next major release.
Relation to X11
@@ -101,19 +91,24 @@
An extremely rudimentary homepage can be found at:
http://xkbcommon.org
-xkbcommon is maintained in git at freedesktop.org:
- git://anongit.freedesktop.org/git/libxkbcommon
+xkbcommon is maintained in git at github.com:
+ https://github.com/xkbcommon/libxkbcommon
Patches are always welcome, and may be sent to either xorg-devel@lists.x.org,
-or wayland-devel@lists.freedesktop.org. Bugs are tracked in Bugzilla at:
- http://bugs.freedesktop.org
+or wayland-devel@lists.freedesktop.org.
+
+Bugs are tracked in Bugzilla at:
+ https://bugs.freedesktop.org/describecomponents.cgi?product=libxkbcommon
+Or in github at:
+ https://github.com/xkbcommon/libxkbcommon/issues
-The maintainer is Daniel Stone, who can be reached at:
+The maintainers are Daniel Stone and Ran Benita, who can be reached at:
<daniel@fooishbar.org>
+ <ran234@gmail.com>
Credits
=======
Many thanks are due to Dan Nicholson for his heroic work in getting xkbcommon
-off the ground initially, as well as to Ran Benita for subsequent development.
+off the ground initially.
|
[-]
[+]
|
Added |
libxkbcommon-0.4.0.tar.xz/autogen.sh
^
|
@@ -0,0 +1,14 @@
+#!/bin/sh -e
+
+srcdir=`dirname "$0"`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd "$srcdir"
+
+autoreconf --verbose --install --force --warnings=all
+cd "$ORIGDIR"
+
+if test -z "$NOCONFIGURE"; then
+ exec "$srcdir/configure" "$@"
+fi
|
[-]
[+]
|
Changed |
libxkbcommon-0.4.0.tar.xz/configure.ac
^
|
@@ -22,7 +22,7 @@
# Initialize Autoconf
AC_PREREQ([2.62])
-AC_INIT([libxkbcommon], [0.3.2],
+AC_INIT([libxkbcommon], [0.4.0],
[https://bugs.freedesktop.org/enter_bug.cgi?product=libxkbcommon],
[libxkbcommon], [http://xkbcommon.org])
AC_CONFIG_SRCDIR([Makefile.am])
@@ -84,6 +84,9 @@
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-fvisibility=hidden])
+XORG_CHECK_LINKER_FLAGS([-Wl,--no-undefined], [have_no_undefined=yes])
+AM_CONDITIONAL([HAVE_NO_UNDEFINED], [test "x$have_no_undefined" = xyes])
+
# Define a configuration option for the XKB config root
xkb_base=`$PKG_CONFIG --variable=xkb_base xkeyboard-config`
if test "x$xkb_base" = x; then
@@ -140,10 +143,42 @@
[Default XKB options])
fi
+AC_ARG_ENABLE([x11],
+ [AS_HELP_STRING([--disable-x11],
+ [Disable support for creating keymaps with the X11 protocol (default: enabled)])],
+ [], [enable_x11=yes])
+if test "x$enable_x11" == xyes; then
+ PKG_CHECK_MODULES([XCB_XKB], [xcb xcb-xkb >= 1.10], [],
+ [AC_MSG_ERROR([xkbcommon-x11 requires xcb-xkb >= 1.10 which was not found. \
+You can disable X11 support with --disable-x11.])])
+fi
+AM_CONDITIONAL([ENABLE_X11], [test "x$enable_x11" == xyes])
+
AC_CONFIG_FILES([
Makefile
xkbcommon-uninstalled.pc
xkbcommon.pc
+ xkbcommon-x11.pc
+ xkbcommon-x11-uninstalled.pc
doc/Doxyfile
])
AC_OUTPUT
+
+AC_MSG_RESULT([
+ $PACKAGE_NAME $VERSION
+
+ libxkbcommon: yes
+ libxkbcommon-x11: ${enable_x11}
+ documentation: ${build_docs}
+
+ default XKB rules: ${DEFAULT_XKB_RULES}
+ default XKB model: ${DEFAULT_XKB_MODEL}
+ default XKB layout: ${DEFAULT_XKB_LAYOUT}
+ default XKB variant: ${DEFAULT_XKB_VARIANT}
+ default XKB options: ${DEFAULT_XKB_OPTIONS}
+
+ prefix: ${prefix}
+ includedir: ${includedir}
+ lib dir: ${libdir}
+ XKB config root: ${XKBCONFIGROOT}
+])
|
[-]
[+]
|
Added |
libxkbcommon-0.4.0.tar.xz/doc/.gitignore
^
|
@@ -0,0 +1,3 @@
+Doxyfile
+html/
+stamp-doxygen
|
|
Changed |
libxkbcommon-0.4.0.tar.xz/m4/.gitkeep
^
|
[-]
[+]
|
Changed |
libxkbcommon-0.4.0.tar.xz/makekeys.py
^
|
@@ -6,18 +6,46 @@
matches = [pattern.match(line) for line in open(sys.argv[1])]
entries = [(m.group("name"), int(m.group("value"), 16)) for m in matches if m]
-print('''struct name_keysym {
- const char *name;
+print('''
+/**
+ * This file comes from libxkbcommon and was generated by makekeys.py
+ * You can always fetch the latest version from:
+ * https://raw.github.com/xkbcommon/libxkbcommon/master/src/ks_tables.h
+ */
+''')
+
+entry_offsets = {}
+
+print('''
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Woverlength-strings"
+static const char *keysym_names =
+'''.strip())
+offs = 0
+for (name, _) in sorted(entries, key=lambda e: e[0].lower()):
+ entry_offsets[name] = offs
+ print(' "{name}\\0"'.format(name=name))
+ offs += len(name) + 1
+print('''
+;
+#pragma GCC diagnostic pop
+'''.strip())
+
+print('''
+struct name_keysym {
xkb_keysym_t keysym;
+ uint32_t offset;
};\n''')
-print('static const struct name_keysym name_to_keysym[] = {');
-for (name, _) in sorted(entries, key=lambda e: e[0].lower()):
- print(' {{ "{name}", XKB_KEY_{name} }},'.format(name=name))
+def print_entries(x):
+ for (name, value) in x:
+ print(' {{ 0x{value:08x}, {offs} }}, /* {name} */'.format(offs=entry_offsets[name], value=value, name=name))
+
+print('static const struct name_keysym name_to_keysym[] = {')
+print_entries(sorted(entries, key=lambda e: e[0].lower()))
print('};\n')
# *.sort() is stable so we always get the first keysym for duplicate
-print('static const struct name_keysym keysym_to_name[] = {');
-for (name, _) in (next(g[1]) for g in itertools.groupby(sorted(entries, key=lambda e: e[1]), key=lambda e: e[1])):
- print(' {{ "{name}", XKB_KEY_{name} }},'.format(name=name))
+print('static const struct name_keysym keysym_to_name[] = {')
+print_entries(next(g[1]) for g in itertools.groupby(sorted(entries, key=lambda e: e[1]), key=lambda e: e[1]))
print('};')
|
[-]
[+]
|
Changed |
libxkbcommon-0.4.0.tar.xz/src/atom.c
^
|
@@ -74,15 +74,15 @@
#include "atom.h"
struct atom_node {
- struct atom_node *left, *right;
+ xkb_atom_t left, right;
xkb_atom_t atom;
unsigned int fingerprint;
char *string;
};
struct atom_table {
- struct atom_node *root;
- darray(struct atom_node *) table;
+ xkb_atom_t root;
+ darray(struct atom_node) table;
};
struct atom_table *
@@ -95,31 +95,22 @@
return NULL;
darray_init(table->table);
- darray_growalloc(table->table, 100);
- darray_append(table->table, NULL);
+ /* The original throw-away root is here, at the illegal atom 0. */
+ darray_resize0(table->table, 1);
return table;
}
-static void
-free_atom(struct atom_node *patom)
-{
- if (!patom)
- return;
-
- free_atom(patom->left);
- free_atom(patom->right);
- free(patom->string);
- free(patom);
-}
-
void
atom_table_free(struct atom_table *table)
{
+ struct atom_node *node;
+
if (!table)
return;
- free_atom(table->root);
+ darray_foreach(node, table->table)
+ free(node->string);
darray_free(table->table);
free(table);
}
@@ -127,48 +118,42 @@
const char *
atom_text(struct atom_table *table, xkb_atom_t atom)
{
- if (atom >= darray_size(table->table) ||
- darray_item(table->table, atom) == NULL)
+ if (atom == XKB_ATOM_NONE || atom >= darray_size(table->table))
return NULL;
- return darray_item(table->table, atom)->string;
-}
-
-char *
-atom_strdup(struct atom_table *table, xkb_atom_t atom)
-{
- return strdup_safe(atom_text(table, atom));
+ return darray_item(table->table, atom).string;
}
static bool
-find_node_pointer(struct atom_table *table, const char *string, size_t len,
- struct atom_node ***nodep_out, unsigned int *fingerprint_out)
+find_atom_pointer(struct atom_table *table, const char *string, size_t len,
+ xkb_atom_t **atomp_out, unsigned int *fingerprint_out)
{
- struct atom_node **nodep;
+ xkb_atom_t *atomp = &table->root;
unsigned int fingerprint = 0;
bool found = false;
- nodep = &table->root;
for (size_t i = 0; i < (len + 1) / 2; i++) {
fingerprint = fingerprint * 27 + string[i];
fingerprint = fingerprint * 27 + string[len - 1 - i];
}
- while (*nodep) {
- if (fingerprint < (*nodep)->fingerprint) {
- nodep = &((*nodep)->left);
+ while (*atomp != XKB_ATOM_NONE) {
+ struct atom_node *node = &darray_item(table->table, *atomp);
+
+ if (fingerprint < node->fingerprint) {
+ atomp = &node->left;
}
- else if (fingerprint > (*nodep)->fingerprint) {
- nodep = &((*nodep)->right);
+ else if (fingerprint > node->fingerprint) {
+ atomp = &node->right;
}
else {
/* Now start testing the strings. */
- const int cmp = strncmp(string, (*nodep)->string, len);
- if (cmp < 0 || (cmp == 0 && len < strlen((*nodep)->string))) {
- nodep = &((*nodep)->left);
+ const int cmp = strncmp(string, node->string, len);
+ if (cmp < 0 || (cmp == 0 && len < strlen(node->string))) {
+ atomp = &node->left;
}
else if (cmp > 0) {
- nodep = &((*nodep)->right);
+ atomp = &node->right;
}
else {
found = true;
@@ -177,24 +162,25 @@
}
}
- *fingerprint_out = fingerprint;
- *nodep_out = nodep;
+ if (fingerprint_out)
+ *fingerprint_out = fingerprint;
+ if (atomp_out)
+ *atomp_out = atomp;
return found;
}
xkb_atom_t
atom_lookup(struct atom_table *table, const char *string, size_t len)
{
- struct atom_node **nodep;
- unsigned int fingerprint;
+ xkb_atom_t *atomp;
if (!string)
return XKB_ATOM_NONE;
- if (!find_node_pointer(table, string, len, &nodep, &fingerprint))
+ if (!find_atom_pointer(table, string, len, &atomp, NULL))
return XKB_ATOM_NONE;
- return (*nodep)->atom;
+ return *atomp;
}
/*
@@ -206,39 +192,34 @@
atom_intern(struct atom_table *table, const char *string, size_t len,
bool steal)
{
- struct atom_node **nodep;
- struct atom_node *node;
+ xkb_atom_t *atomp;
+ struct atom_node node;
unsigned int fingerprint;
- if (!string || len == 0)
+ if (!string)
return XKB_ATOM_NONE;
- if (find_node_pointer(table, string, len, &nodep, &fingerprint)) {
+ if (find_atom_pointer(table, string, len, &atomp, &fingerprint)) {
if (steal)
free(UNCONSTIFY(string));
- return (*nodep)->atom;
+ return *atomp;
}
- node = malloc(sizeof(*node));
- if (!node)
- return XKB_ATOM_NONE;
-
if (steal) {
- node->string = UNCONSTIFY(string);
+ node.string = UNCONSTIFY(string);
}
else {
- node->string = strndup(string, len);
- if (!node->string) {
- free(node);
+ node.string = strndup(string, len);
+ if (!node.string)
return XKB_ATOM_NONE;
- }
}
- *nodep = node;
- node->left = node->right = NULL;
- node->fingerprint = fingerprint;
- node->atom = darray_size(table->table);
+ node.left = node.right = XKB_ATOM_NONE;
+ node.fingerprint = fingerprint;
|
[-]
[+]
|
Changed |
libxkbcommon-0.4.0.tar.xz/src/atom.h
^
|
@@ -43,9 +43,6 @@
atom_intern(struct atom_table *table, const char *string, size_t len,
bool steal);
-char *
-atom_strdup(struct atom_table *table, xkb_atom_t atom);
-
const char *
atom_text(struct atom_table *table, xkb_atom_t atom);
|
[-]
[+]
|
Added |
libxkbcommon-0.4.0.tar.xz/src/context-priv.c
^
|
@@ -0,0 +1,171 @@
+/*
+ * Copyright © 2012 Intel Corporation
+ * Copyright © 2012 Ran Benita
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Author: Daniel Stone <daniel@fooishbar.org>
+ */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <errno.h>
+#include <unistd.h>
+
+#include "xkbcommon/xkbcommon.h"
+#include "utils.h"
+#include "context.h"
+
+unsigned int
+xkb_context_num_failed_include_paths(struct xkb_context *ctx)
+{
+ return darray_size(ctx->failed_includes);
+}
+
+const char *
+xkb_context_failed_include_path_get(struct xkb_context *ctx,
+ unsigned int idx)
+{
+ if (idx >= xkb_context_num_failed_include_paths(ctx))
+ return NULL;
+
+ return darray_item(ctx->failed_includes, idx);
+}
+
+xkb_atom_t
+xkb_atom_lookup(struct xkb_context *ctx, const char *string)
+{
+ return atom_lookup(ctx->atom_table, string, strlen(string));
+}
+
+xkb_atom_t
+xkb_atom_intern(struct xkb_context *ctx, const char *string, size_t len)
+{
+ return atom_intern(ctx->atom_table, string, len, false);
+}
+
+xkb_atom_t
+xkb_atom_steal(struct xkb_context *ctx, char *string)
+{
+ return atom_intern(ctx->atom_table, string, strlen(string), true);
+}
+
+const char *
+xkb_atom_text(struct xkb_context *ctx, xkb_atom_t atom)
+{
+ return atom_text(ctx->atom_table, atom);
+}
+
+void
+xkb_log(struct xkb_context *ctx, enum xkb_log_level level, int verbosity,
+ const char *fmt, ...)
+{
+ va_list args;
+
+ if (ctx->log_level < level || ctx->log_verbosity < verbosity)
+ return;
+
+ va_start(args, fmt);
+ ctx->log_fn(ctx, level, fmt, args);
+ va_end(args);
+}
+
+char *
+xkb_context_get_buffer(struct xkb_context *ctx, size_t size)
+{
+ char *rtrn;
+
+ if (size >= sizeof(ctx->text_buffer))
+ return NULL;
+
+ if (sizeof(ctx->text_buffer) - ctx->text_next <= size)
+ ctx->text_next = 0;
+
+ rtrn = &ctx->text_buffer[ctx->text_next];
+ ctx->text_next += size;
+
+ return rtrn;
+}
+
+#ifndef DEFAULT_XKB_VARIANT
+#define DEFAULT_XKB_VARIANT NULL
+#endif
+
+#ifndef DEFAULT_XKB_OPTIONS
+#define DEFAULT_XKB_OPTIONS NULL
+#endif
+
+const char *
+xkb_context_get_default_rules(struct xkb_context *ctx)
+{
+ const char *env = NULL;
+
+ if (ctx->use_environment_names)
+ env = getenv("XKB_DEFAULT_RULES");
+
+ return env ? env : DEFAULT_XKB_RULES;
+}
+
+const char *
+xkb_context_get_default_model(struct xkb_context *ctx)
+{
+ const char *env = NULL;
+
+ if (ctx->use_environment_names)
+ env = getenv("XKB_DEFAULT_MODEL");
+
+ return env ? env : DEFAULT_XKB_MODEL;
+}
+
+const char *
+xkb_context_get_default_layout(struct xkb_context *ctx)
+{
+ const char *env = NULL;
+
+ if (ctx->use_environment_names)
+ env = getenv("XKB_DEFAULT_LAYOUT");
+
+ return env ? env : DEFAULT_XKB_LAYOUT;
+}
+
+const char *
+xkb_context_get_default_variant(struct xkb_context *ctx)
+{
+ const char *env = NULL;
+ const char *layout = getenv("XKB_DEFAULT_VARIANT");
+
+ /* We don't want to inherit the variant if they haven't also set a
+ * layout, since they're so closely paired. */
+ if (layout && ctx->use_environment_names)
+ env = getenv("XKB_DEFAULT_VARIANT");
+
+ return env ? env : DEFAULT_XKB_VARIANT;
+}
+
+const char *
+xkb_context_get_default_options(struct xkb_context *ctx)
+{
+ const char *env = NULL;
+
+ if (ctx->use_environment_names)
+ env = getenv("XKB_DEFAULT_OPTIONS");
+
+ return env ? env : DEFAULT_XKB_OPTIONS;
+}
|
[-]
[+]
|
Changed |
libxkbcommon-0.4.0.tar.xz/src/context.c
^
|
@@ -33,30 +33,6 @@
#include "utils.h"
#include "context.h"
-struct xkb_context {
- int refcnt;
-
- ATTR_PRINTF(3, 0) void (*log_fn)(struct xkb_context *ctx,
- enum xkb_log_level level,
- const char *fmt, va_list args);
- enum xkb_log_level log_level;
- int log_verbosity;
- void *user_data;
-
- struct xkb_rule_names names_dflt;
-
- darray(char *) includes;
- darray(char *) failed_includes;
-
- struct atom_table *atom_table;
-
- /* Buffer for the *Text() functions. */
- char text_buffer[2048];
- size_t text_next;
-
- unsigned int use_environment_names : 1;
-};
-
/**
* Append one directory to the context's include path.
*/
@@ -154,12 +130,6 @@
return darray_size(ctx->includes);
}
-unsigned int
-xkb_context_num_failed_include_paths(struct xkb_context *ctx)
-{
- return darray_size(ctx->failed_includes);
-}
-
/**
* Returns the given entry in the context's include path, or NULL if an
* invalid index is passed.
@@ -173,16 +143,6 @@
return darray_item(ctx->includes, idx);
}
-const char *
-xkb_context_failed_include_path_get(struct xkb_context *ctx,
- unsigned int idx)
-{
- if (idx >= xkb_context_num_failed_include_paths(ctx))
- return NULL;
-
- return darray_item(ctx->failed_includes, idx);
-}
-
/**
* Take a new reference on the context.
*/
@@ -274,14 +234,6 @@
return 0;
}
-#ifndef DEFAULT_XKB_VARIANT
-#define DEFAULT_XKB_VARIANT NULL
-#endif
-
-#ifndef DEFAULT_XKB_OPTIONS
-#define DEFAULT_XKB_OPTIONS NULL
-#endif
-
/**
* Create a new context.
*/
@@ -327,47 +279,6 @@
return ctx;
}
-xkb_atom_t
-xkb_atom_lookup(struct xkb_context *ctx, const char *string)
-{
- return atom_lookup(ctx->atom_table, string, strlen(string));
-}
-
-xkb_atom_t
-xkb_atom_intern(struct xkb_context *ctx, const char *string, size_t len)
-{
- return atom_intern(ctx->atom_table, string, len, false);
-}
-
-xkb_atom_t
-xkb_atom_steal(struct xkb_context *ctx, char *string)
-{
- return atom_intern(ctx->atom_table, string, strlen(string), true);
-}
-
-char *
-xkb_atom_strdup(struct xkb_context *ctx, xkb_atom_t atom)
-{
- return atom_strdup(ctx->atom_table, atom);
-}
-
-const char *
-xkb_atom_text(struct xkb_context *ctx, xkb_atom_t atom)
-{
- return atom_text(ctx->atom_table, atom);
-}
-
-void
-xkb_log(struct xkb_context *ctx, enum xkb_log_level level,
- const char *fmt, ...)
-{
- va_list args;
-
- va_start(args, fmt);
- ctx->log_fn(ctx, level, fmt, args);
- va_end(args);
-}
-
XKB_EXPORT void
xkb_context_set_log_fn(struct xkb_context *ctx,
void (*log_fn)(struct xkb_context *ctx,
@@ -414,78 +325,3 @@
{
ctx->user_data = user_data;
}
-
-char *
-xkb_context_get_buffer(struct xkb_context *ctx, size_t size)
-{
- char *rtrn;
-
- if (size >= sizeof(ctx->text_buffer))
- return NULL;
-
- if (sizeof(ctx->text_buffer) - ctx->text_next <= size)
- ctx->text_next = 0;
-
- rtrn = &ctx->text_buffer[ctx->text_next];
- ctx->text_next += size;
-
- return rtrn;
-}
-
-const char *
-xkb_context_get_default_rules(struct xkb_context *ctx)
-{
- const char *env = NULL;
-
- if (ctx->use_environment_names)
- env = getenv("XKB_DEFAULT_RULES");
-
- return env ? env : DEFAULT_XKB_RULES;
-}
-
-const char *
-xkb_context_get_default_model(struct xkb_context *ctx)
-{
- const char *env = NULL;
-
- if (ctx->use_environment_names)
- env = getenv("XKB_DEFAULT_MODEL");
-
- return env ? env : DEFAULT_XKB_MODEL;
-}
-
-const char *
-xkb_context_get_default_layout(struct xkb_context *ctx)
-{
- const char *env = NULL;
-
- if (ctx->use_environment_names)
- env = getenv("XKB_DEFAULT_LAYOUT");
-
- return env ? env : DEFAULT_XKB_LAYOUT;
-}
-
-const char *
-xkb_context_get_default_variant(struct xkb_context *ctx)
-{
- const char *env = NULL;
- const char *layout = getenv("XKB_DEFAULT_VARIANT");
-
- /* We don't want to inherit the variant if they haven't also set a
- * layout, since they're so closely paired. */
- if (layout && ctx->use_environment_names)
- env = getenv("XKB_DEFAULT_VARIANT");
-
- return env ? env : DEFAULT_XKB_VARIANT;
-}
-
-const char *
-xkb_context_get_default_options(struct xkb_context *ctx)
-{
- const char *env = NULL;
-
- if (ctx->use_environment_names)
- env = getenv("XKB_DEFAULT_OPTIONS");
|
[-]
[+]
|
Changed |
libxkbcommon-0.4.0.tar.xz/src/context.h
^
|
@@ -28,6 +28,30 @@
#include "atom.h"
+struct xkb_context {
+ int refcnt;
+
+ ATTR_PRINTF(3, 0) void (*log_fn)(struct xkb_context *ctx,
+ enum xkb_log_level level,
+ const char *fmt, va_list args);
+ enum xkb_log_level log_level;
+ int log_verbosity;
+ void *user_data;
+
+ struct xkb_rule_names names_dflt;
+
+ darray(char *) includes;
+ darray(char *) failed_includes;
+
+ struct atom_table *atom_table;
+
+ /* Buffer for the *Text() functions. */
+ char text_buffer[2048];
+ size_t text_next;
+
+ unsigned int use_environment_names : 1;
+};
+
unsigned int
xkb_context_num_failed_include_paths(struct xkb_context *ctx);
@@ -57,29 +81,16 @@
xkb_atom_t
xkb_atom_steal(struct xkb_context *ctx, char *string);
-char *
-xkb_atom_strdup(struct xkb_context *ctx, xkb_atom_t atom);
-
const char *
xkb_atom_text(struct xkb_context *ctx, xkb_atom_t atom);
char *
xkb_context_get_buffer(struct xkb_context *ctx, size_t size);
-ATTR_PRINTF(3, 4) void
-xkb_log(struct xkb_context *ctx, enum xkb_log_level level,
+ATTR_PRINTF(4, 5) void
+xkb_log(struct xkb_context *ctx, enum xkb_log_level level, int verbosity,
const char *fmt, ...);
-#define xkb_log_cond_level(ctx, level, ...) do { \
- if (xkb_context_get_log_level(ctx) >= (level)) \
- xkb_log((ctx), (level), __VA_ARGS__); \
-} while (0)
-
-#define xkb_log_cond_verbosity(ctx, level, vrb, ...) do { \
- if (xkb_context_get_log_verbosity(ctx) >= (vrb)) \
- xkb_log_cond_level((ctx), (level), __VA_ARGS__); \
-} while (0)
-
const char *
xkb_context_get_default_rules(struct xkb_context *ctx);
@@ -102,17 +113,17 @@
* result in an error, though.
*/
#define log_dbg(ctx, ...) \
- xkb_log_cond_level((ctx), XKB_LOG_LEVEL_DEBUG, __VA_ARGS__)
+ xkb_log((ctx), XKB_LOG_LEVEL_DEBUG, 0, __VA_ARGS__)
#define log_info(ctx, ...) \
- xkb_log_cond_level((ctx), XKB_LOG_LEVEL_INFO, __VA_ARGS__)
+ xkb_log((ctx), XKB_LOG_LEVEL_INFO, 0, __VA_ARGS__)
#define log_warn(ctx, ...) \
- xkb_log_cond_level((ctx), XKB_LOG_LEVEL_WARNING, __VA_ARGS__)
+ xkb_log((ctx), XKB_LOG_LEVEL_WARNING, 0, __VA_ARGS__)
#define log_err(ctx, ...) \
- xkb_log_cond_level((ctx), XKB_LOG_LEVEL_ERROR, __VA_ARGS__)
+ xkb_log((ctx), XKB_LOG_LEVEL_ERROR, 0, __VA_ARGS__)
#define log_wsgo(ctx, ...) \
- xkb_log_cond_level((ctx), XKB_LOG_LEVEL_CRITICAL, __VA_ARGS__)
+ xkb_log((ctx), XKB_LOG_LEVEL_CRITICAL, 0, __VA_ARGS__)
#define log_vrb(ctx, vrb, ...) \
- xkb_log_cond_verbosity((ctx), XKB_LOG_LEVEL_WARNING, (vrb), __VA_ARGS__)
+ xkb_log((ctx), XKB_LOG_LEVEL_WARNING, (vrb), __VA_ARGS__)
/*
* Variants which are prefixed by the name of the function they're
|
[-]
[+]
|
Added |
libxkbcommon-0.4.0.tar.xz/src/keymap-priv.c
^
|
@@ -0,0 +1,121 @@
+/**
+ * Copyright © 2012 Intel Corporation
+ * Copyright © 2012 Ran Benita <ran234@gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Author: Daniel Stone <daniel@fooishbar.org>
+ */
+
+#include "keymap.h"
+
+static void
+update_builtin_keymap_fields(struct xkb_keymap *keymap)
+{
+ struct xkb_context *ctx = keymap->ctx;
+
+ /*
+ * Add predefined (AKA real, core, X11) modifiers.
+ * The order is important!
+ */
+ darray_appends_t(keymap->mods, struct xkb_mod,
+ { .name = xkb_atom_intern_literal(ctx, "Shift"), .type = MOD_REAL },
+ { .name = xkb_atom_intern_literal(ctx, "Lock"), .type = MOD_REAL },
+ { .name = xkb_atom_intern_literal(ctx, "Control"), .type = MOD_REAL },
+ { .name = xkb_atom_intern_literal(ctx, "Mod1"), .type = MOD_REAL },
+ { .name = xkb_atom_intern_literal(ctx, "Mod2"), .type = MOD_REAL },
+ { .name = xkb_atom_intern_literal(ctx, "Mod3"), .type = MOD_REAL },
+ { .name = xkb_atom_intern_literal(ctx, "Mod4"), .type = MOD_REAL },
+ { .name = xkb_atom_intern_literal(ctx, "Mod5"), .type = MOD_REAL });
+}
+
+struct xkb_keymap *
+xkb_keymap_new(struct xkb_context *ctx,
+ enum xkb_keymap_format format,
+ enum xkb_keymap_compile_flags flags)
+{
+ struct xkb_keymap *keymap;
+
+ keymap = calloc(1, sizeof(*keymap));
+ if (!keymap)
+ return NULL;
+
+ keymap->refcnt = 1;
+ keymap->ctx = xkb_context_ref(ctx);
+
+ keymap->format = format;
+ keymap->flags = flags;
+
+ update_builtin_keymap_fields(keymap);
+
+ return keymap;
+}
+
+struct xkb_key *
+XkbKeyByName(struct xkb_keymap *keymap, xkb_atom_t name, bool use_aliases)
+{
+ struct xkb_key *key;
+
+ xkb_foreach_key(key, keymap)
+ if (key->name == name)
+ return key;
+
+ if (use_aliases) {
+ xkb_atom_t new_name = XkbResolveKeyAlias(keymap, name);
+ if (new_name != XKB_ATOM_NONE)
+ return XkbKeyByName(keymap, new_name, false);
+ }
+
+ return NULL;
+}
+
+xkb_atom_t
+XkbResolveKeyAlias(struct xkb_keymap *keymap, xkb_atom_t name)
+{
+ for (unsigned i = 0; i < keymap->num_key_aliases; i++)
+ if (keymap->key_aliases[i].alias == name)
+ return keymap->key_aliases[i].real;
+
+ return XKB_ATOM_NONE;
+}
+
+void
+XkbEscapeMapName(char *name)
+{
+ /*
+ * All latin-1 alphanumerics, plus parens, slash, minus, underscore and
+ * wildcards.
+ */
+ static const unsigned char legal[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xa7, 0xff, 0x83,
+ 0xfe, 0xff, 0xff, 0x87, 0xfe, 0xff, 0xff, 0x07,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0x7f, 0xff
+ };
+
+ if (!name)
+ return;
+
+ while (*name) {
+ if (!(legal[*name / 8] & (1 << (*name % 8))))
+ *name = '_';
+ name++;
+ }
+}
|
[-]
[+]
|
Changed |
libxkbcommon-0.4.0.tar.xz/src/keymap.c
^
|
@@ -53,48 +53,6 @@
#include "keymap.h"
#include "text.h"
-static void
-update_builtin_keymap_fields(struct xkb_keymap *keymap)
-{
- struct xkb_context *ctx = keymap->ctx;
-
- /*
- * Add predefined (AKA real, core, X11) modifiers.
- * The order is important!
- */
- darray_appends_t(keymap->mods, struct xkb_mod,
- { .name = xkb_atom_intern_literal(ctx, "Shift"), .type = MOD_REAL },
- { .name = xkb_atom_intern_literal(ctx, "Lock"), .type = MOD_REAL },
- { .name = xkb_atom_intern_literal(ctx, "Control"), .type = MOD_REAL },
- { .name = xkb_atom_intern_literal(ctx, "Mod1"), .type = MOD_REAL },
- { .name = xkb_atom_intern_literal(ctx, "Mod2"), .type = MOD_REAL },
- { .name = xkb_atom_intern_literal(ctx, "Mod3"), .type = MOD_REAL },
- { .name = xkb_atom_intern_literal(ctx, "Mod4"), .type = MOD_REAL },
- { .name = xkb_atom_intern_literal(ctx, "Mod5"), .type = MOD_REAL });
-}
-
-static struct xkb_keymap *
-xkb_keymap_new(struct xkb_context *ctx,
- enum xkb_keymap_format format,
- enum xkb_keymap_compile_flags flags)
-{
- struct xkb_keymap *keymap;
-
- keymap = calloc(1, sizeof(*keymap));
- if (!keymap)
- return NULL;
-
- keymap->refcnt = 1;
- keymap->ctx = xkb_context_ref(ctx);
-
- keymap->format = format;
- keymap->flags = flags;
-
- update_builtin_keymap_fields(keymap);
-
- return keymap;
-}
-
XKB_EXPORT struct xkb_keymap *
xkb_keymap_ref(struct xkb_keymap *keymap)
{
@@ -105,18 +63,16 @@
XKB_EXPORT void
xkb_keymap_unref(struct xkb_keymap *keymap)
{
- unsigned int i, j;
- struct xkb_key *key;
-
if (!keymap || --keymap->refcnt > 0)
return;
if (keymap->keys) {
+ struct xkb_key *key;
xkb_foreach_key(key, keymap) {
if (key->groups) {
- for (i = 0; i < key->num_groups; i++) {
+ for (unsigned i = 0; i < key->num_groups; i++) {
if (key->groups[i].levels) {
- for (j = 0; j < XkbKeyGroupWidth(key, i); j++)
+ for (unsigned j = 0; j < XkbKeyGroupWidth(key, i); j++)
if (key->groups[i].levels[j].num_syms > 1)
free(key->groups[i].levels[j].u.syms);
free(key->groups[i].levels);
@@ -128,7 +84,7 @@
free(keymap->keys);
}
if (keymap->types) {
- for (i = 0; i < keymap->num_types; i++) {
+ for (unsigned i = 0; i < keymap->num_types; i++) {
free(keymap->types[i].entries);
free(keymap->types[i].level_names);
}
@@ -548,31 +504,3 @@
return key->repeats;
}
-
-struct xkb_key *
-XkbKeyByName(struct xkb_keymap *keymap, xkb_atom_t name, bool use_aliases)
-{
- struct xkb_key *key;
-
- xkb_foreach_key(key, keymap)
- if (key->name == name)
- return key;
-
- if (use_aliases) {
- xkb_atom_t new_name = XkbResolveKeyAlias(keymap, name);
- if (new_name != XKB_ATOM_NONE)
- return XkbKeyByName(keymap, new_name, false);
- }
-
- return NULL;
-}
-
-xkb_atom_t
-XkbResolveKeyAlias(struct xkb_keymap *keymap, xkb_atom_t name)
-{
- for (unsigned i = 0; i < keymap->num_key_aliases; i++)
- if (keymap->key_aliases[i].alias == name)
- return keymap->key_aliases[i].real;
-
- return XKB_ATOM_NONE;
-}
|
[-]
[+]
|
Changed |
libxkbcommon-0.4.0.tar.xz/src/keymap.h
^
|
@@ -412,12 +412,20 @@
return key->groups[layout].type->num_levels;
}
+struct xkb_keymap *
+xkb_keymap_new(struct xkb_context *ctx,
+ enum xkb_keymap_format format,
+ enum xkb_keymap_compile_flags flags);
+
struct xkb_key *
XkbKeyByName(struct xkb_keymap *keymap, xkb_atom_t name, bool use_aliases);
xkb_atom_t
XkbResolveKeyAlias(struct xkb_keymap *keymap, xkb_atom_t name);
+void
+XkbEscapeMapName(char *name);
+
xkb_layout_index_t
wrap_group_into_range(int32_t group,
xkb_layout_index_t num_groups,
|
[-]
[+]
|
Changed |
libxkbcommon-0.4.0.tar.xz/src/keysym-utf.c
^
|
@@ -840,14 +840,13 @@
{
int first = 0;
int last = length;
- int mid;
if (keysym < table[0].keysym || keysym > table[length].keysym)
return 0;
/* binary search in table */
while (last >= first) {
- mid = (first + last) / 2;
+ int mid = (first + last) / 2;
if (table[mid].keysym < keysym)
first = mid + 1;
else if (table[mid].keysym > keysym)
|
[-]
[+]
|
Changed |
libxkbcommon-0.4.0.tar.xz/src/keysym.c
^
|
@@ -53,24 +53,31 @@
#include "keysym.h"
#include "ks_tables.h"
+static inline const char *
+get_name(const struct name_keysym *entry)
+{
+ return keysym_names + entry->offset;
+}
+
static int
compare_by_keysym(const void *a, const void *b)
{
- const struct name_keysym *key = a, *entry = b;
- return key->keysym - (int32_t)entry->keysym;
+ const xkb_keysym_t *key = a;
+ const struct name_keysym *entry = b;
+ return *key - (int32_t) entry->keysym;
}
static int
compare_by_name(const void *a, const void *b)
{
- const struct name_keysym *key = a, *entry = b;
- return strcasecmp(key->name, entry->name);
+ const char *key = a;
+ const struct name_keysym *entry = b;
+ return strcasecmp(key, get_name(entry));
}
XKB_EXPORT int
xkb_keysym_get_name(xkb_keysym_t ks, char *buffer, size_t size)
{
- const struct name_keysym search = { .name = NULL, .keysym = ks };
const struct name_keysym *entry;
if ((ks & ((unsigned long) ~0x1fffffff)) != 0) {
@@ -78,12 +85,12 @@
return -1;
}
- entry = bsearch(&search, keysym_to_name,
+ entry = bsearch(&ks, keysym_to_name,
ARRAY_SIZE(keysym_to_name),
sizeof(*keysym_to_name),
compare_by_keysym);
if (entry)
- return snprintf(buffer, size, "%s", entry->name);
+ return snprintf(buffer, size, "%s", get_name(entry));
/* Unnamed Unicode codepoint. */
if (ks >= 0x01000100 && ks <= 0x0110ffff) {
@@ -119,25 +126,25 @@
if (!entry)
return NULL;
- if (!icase && strcmp(entry->name, name) == 0)
+ if (!icase && strcmp(get_name(entry), name) == 0)
return entry;
if (icase && xkb_keysym_is_lower(entry->keysym))
return entry;
for (iter = entry - 1; iter >= name_to_keysym; --iter) {
- if (!icase && strcmp(iter->name, name) == 0)
+ if (!icase && strcmp(get_name(iter), name) == 0)
return iter;
- if (strcasecmp(iter->name, entry->name) != 0)
+ if (strcasecmp(get_name(iter), get_name(entry)) != 0)
break;
if (icase && xkb_keysym_is_lower(iter->keysym))
return iter;
}
last = name_to_keysym + len;
- for (iter = entry + 1; iter < last; --iter) {
- if (!icase && strcmp(iter->name, name) == 0)
+ for (iter = entry + 1; iter < last; ++iter) {
+ if (!icase && strcmp(get_name(iter), name) == 0)
return iter;
- if (strcasecmp(iter->name, entry->name) != 0)
+ if (strcasecmp(get_name(iter), get_name(entry)) != 0)
break;
if (icase && xkb_keysym_is_lower(iter->keysym))
return iter;
@@ -151,7 +158,6 @@
XKB_EXPORT xkb_keysym_t
xkb_keysym_from_name(const char *s, enum xkb_keysym_flags flags)
{
- const struct name_keysym search = { .name = s, .keysym = 0 };
const struct name_keysym *entry;
char *tmp;
xkb_keysym_t val;
@@ -160,7 +166,7 @@
if (flags & ~XKB_KEYSYM_CASE_INSENSITIVE)
return XKB_KEY_NoSymbol;
- entry = bsearch(&search, name_to_keysym,
+ entry = bsearch(s, name_to_keysym,
ARRAY_SIZE(name_to_keysym),
sizeof(*name_to_keysym),
compare_by_name);
|
[-]
[+]
|
Changed |
libxkbcommon-0.4.0.tar.xz/src/ks_tables.h
^
|
@@ -1,4683 +1,7104 @@
-/* This file is autogenerated from Makefile.am; please do not commit directly. */
+
+/**
+ * This file comes from libxkbcommon and was generated by makekeys.py
+ * You can always fetch the latest version from:
+ * https://raw.github.com/xkbcommon/libxkbcommon/master/src/ks_tables.h
+ */
+
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Woverlength-strings"
+static const char *keysym_names =
+ "0\0"
+ "1\0"
+ "2\0"
+ "3\0"
+ "3270_AltCursor\0"
+ "3270_Attn\0"
+ "3270_BackTab\0"
+ "3270_ChangeScreen\0"
+ "3270_Copy\0"
+ "3270_CursorBlink\0"
+ "3270_CursorSelect\0"
+ "3270_DeleteWord\0"
+ "3270_Duplicate\0"
+ "3270_Enter\0"
+ "3270_EraseEOF\0"
+ "3270_EraseInput\0"
+ "3270_ExSelect\0"
+ "3270_FieldMark\0"
+ "3270_Ident\0"
+ "3270_Jump\0"
+ "3270_KeyClick\0"
+ "3270_Left2\0"
+ "3270_PA1\0"
+ "3270_PA2\0"
+ "3270_PA3\0"
+ "3270_Play\0"
+ "3270_PrintScreen\0"
+ "3270_Quit\0"
+ "3270_Record\0"
+ "3270_Reset\0"
+ "3270_Right2\0"
+ "3270_Rule\0"
+ "3270_Setup\0"
+ "3270_Test\0"
+ "4\0"
+ "5\0"
+ "6\0"
+ "7\0"
+ "8\0"
+ "9\0"
+ "A\0"
+ "a\0"
+ "Aacute\0"
+ "aacute\0"
+ "Abelowdot\0"
+ "abelowdot\0"
+ "abovedot\0"
+ "Abreve\0"
+ "abreve\0"
+ "Abreveacute\0"
+ "abreveacute\0"
+ "Abrevebelowdot\0"
+ "abrevebelowdot\0"
+ "Abrevegrave\0"
+ "abrevegrave\0"
+ "Abrevehook\0"
+ "abrevehook\0"
+ "Abrevetilde\0"
+ "abrevetilde\0"
+ "AccessX_Enable\0"
+ "AccessX_Feedback_Enable\0"
+ "Acircumflex\0"
+ "acircumflex\0"
+ "Acircumflexacute\0"
+ "acircumflexacute\0"
+ "Acircumflexbelowdot\0"
+ "acircumflexbelowdot\0"
+ "Acircumflexgrave\0"
+ "acircumflexgrave\0"
+ "Acircumflexhook\0"
+ "acircumflexhook\0"
+ "Acircumflextilde\0"
+ "acircumflextilde\0"
+ "acute\0"
+ "Adiaeresis\0"
+ "adiaeresis\0"
+ "AE\0"
+ "ae\0"
+ "Agrave\0"
+ "agrave\0"
+ "Ahook\0"
+ "ahook\0"
+ "Alt_L\0"
+ "Alt_R\0"
+ "Amacron\0"
+ "amacron\0"
+ "ampersand\0"
+ "Aogonek\0"
+ "aogonek\0"
+ "apostrophe\0"
+ "approxeq\0"
+ "approximate\0"
+ "Arabic_0\0"
+ "Arabic_1\0"
+ "Arabic_2\0"
+ "Arabic_3\0"
+ "Arabic_4\0"
+ "Arabic_5\0"
+ "Arabic_6\0"
+ "Arabic_7\0"
+ "Arabic_8\0"
+ "Arabic_9\0"
+ "Arabic_ain\0"
+ "Arabic_alef\0"
+ "Arabic_alefmaksura\0"
+ "Arabic_beh\0"
+ "Arabic_comma\0"
+ "Arabic_dad\0"
+ "Arabic_dal\0"
+ "Arabic_damma\0"
+ "Arabic_dammatan\0"
+ "Arabic_ddal\0"
+ "Arabic_farsi_yeh\0"
+ "Arabic_fatha\0"
+ "Arabic_fathatan\0"
+ "Arabic_feh\0"
+ "Arabic_fullstop\0"
+ "Arabic_gaf\0"
+ "Arabic_ghain\0"
+ "Arabic_ha\0"
+ "Arabic_hah\0"
+ "Arabic_hamza\0"
+ "Arabic_hamza_above\0"
+ "Arabic_hamza_below\0"
+ "Arabic_hamzaonalef\0"
+ "Arabic_hamzaonwaw\0"
+ "Arabic_hamzaonyeh\0"
+ "Arabic_hamzaunderalef\0"
+ "Arabic_heh\0"
+ "Arabic_heh_doachashmee\0"
+ "Arabic_heh_goal\0"
+ "Arabic_jeem\0"
+ "Arabic_jeh\0"
+ "Arabic_kaf\0"
+ "Arabic_kasra\0"
+ "Arabic_kasratan\0"
+ "Arabic_keheh\0"
+ "Arabic_khah\0"
+ "Arabic_lam\0"
+ "Arabic_madda_above\0"
+ "Arabic_maddaonalef\0"
+ "Arabic_meem\0"
+ "Arabic_noon\0"
+ "Arabic_noon_ghunna\0"
+ "Arabic_peh\0"
+ "Arabic_percent\0"
+ "Arabic_qaf\0"
+ "Arabic_question_mark\0"
+ "Arabic_ra\0"
+ "Arabic_rreh\0"
+ "Arabic_sad\0"
+ "Arabic_seen\0"
+ "Arabic_semicolon\0"
+ "Arabic_shadda\0"
+ "Arabic_sheen\0"
+ "Arabic_sukun\0"
+ "Arabic_superscript_alef\0"
+ "Arabic_switch\0"
+ "Arabic_tah\0"
+ "Arabic_tatweel\0"
+ "Arabic_tcheh\0"
+ "Arabic_teh\0"
+ "Arabic_tehmarbuta\0"
+ "Arabic_thal\0"
+ "Arabic_theh\0"
+ "Arabic_tteh\0"
+ "Arabic_veh\0"
+ "Arabic_waw\0"
+ "Arabic_yeh\0"
+ "Arabic_yeh_baree\0"
+ "Arabic_zah\0"
+ "Arabic_zain\0"
+ "Aring\0"
+ "aring\0"
+ "Armenian_accent\0"
+ "Armenian_amanak\0"
+ "Armenian_apostrophe\0"
+ "Armenian_AT\0"
+ "Armenian_at\0"
+ "Armenian_AYB\0"
+ "Armenian_ayb\0"
+ "Armenian_BEN\0"
+ "Armenian_ben\0"
+ "Armenian_but\0"
+ "Armenian_CHA\0"
+ "Armenian_cha\0"
+ "Armenian_DA\0"
+ "Armenian_da\0"
|
[-]
[+]
|
Changed |
libxkbcommon-0.4.0.tar.xz/src/state.c
^
|
@@ -1002,13 +1002,12 @@
{
va_list ap;
xkb_mod_index_t idx = 0;
- const char *str;
xkb_mod_mask_t wanted = 0;
int ret = 0;
va_start(ap, match);
while (1) {
- str = va_arg(ap, const char *);
+ const char *str = va_arg(ap, const char *);
if (str == NULL)
break;
idx = xkb_keymap_mod_get_index(state->keymap, str);
|
[-]
[+]
|
Changed |
libxkbcommon-0.4.0.tar.xz/src/utils.h
^
|
@@ -158,6 +158,22 @@
return ch >= '!' && ch <= '~';
}
+/*
+ * Return the bit position of the most significant bit.
+ * Note: this is 1-based! It's more useful this way, and returns 0 when
+ * mask is all 0s.
+ */
+static inline int
+msb_pos(uint32_t mask)
+{
+ int pos = 0;
+ while (mask) {
+ pos++;
+ mask >>= 1;
+ }
+ return pos;
+}
+
bool
map_file(FILE *file, const char **string_out, size_t *size_out);
@@ -206,4 +222,10 @@
# define ATTR_NULL_SENTINEL
#endif /* GNUC >= 4 */
+#if (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 295)
+#define ATTR_PACKED __attribute__((__packed__))
+#else
+#define ATTR_PACKED
+#endif
+
#endif /* UTILS_H */
|
[-]
[+]
|
Added |
libxkbcommon-0.4.0.tar.xz/src/x11
^
|
+(directory)
|
[-]
[+]
|
Added |
libxkbcommon-0.4.0.tar.xz/src/x11/keymap.c
^
|
@@ -0,0 +1,1146 @@
+/*
+ * Copyright © 2013 Ran Benita
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include "x11-priv.h"
+
+/*
+ * References for the lonesome traveler:
+ * Xkb protocol specification:
+ * http://www.x.org/releases/current/doc/kbproto/xkbproto.html
+ * The XCB xkb XML protocol file:
+ * /user/share/xcb/xkb.xml
+ * The XCB xkb header file:
+ * /usr/include/xcb/xkb.h
+ * The old kbproto header files:
+ * /usr/include/X11/extensions/XKB{,proto,str}.h
+ * Xlib XKB source code:
+ * <libX11>/src/xkb/XKBGetMap.c (and friends)
+ * X server XKB protocol handling:
+ * <xserver>/xkb/xkb.c
+ * Man pages:
+ * XkbGetMap(3), XkbGetCompatMap(3), etc.
+ */
+
+/* Constants from /usr/include/X11/extensions/XKB.h */
+/* XkbNumModifiers. */
+#define NUM_REAL_MODS 8
+/* XkbNumVirtualMods. */
+#define NUM_VMODS 16
+/* XkbNoModifier. */
+#define NO_MODIFIER 0xff
+/* XkbNumIndicators. */
+#define NUM_INDICATORS 32
+/* XkbAllIndicatorsMask. */
+#define ALL_INDICATORS_MASK 0xffffffff
+
+/* Some macros. Not very nice but it'd be worse without them. */
+
+/*
+ * We try not to trust the server too much and be paranoid. If we get
+ * something which we definitely shouldn't, we fail.
+ */
+#define STRINGIFY(expr) #expr
+#define FAIL_UNLESS(expr) do { \
+ if (!(expr)) { \
+ log_err(keymap->ctx, \
+ "x11: failed to get keymap from X server: unmet condition in %s(): %s\n", \
+ __func__, STRINGIFY(expr)); \
+ goto fail; \
+ } \
+} while (0)
+
+#define FAIL_IF_BAD_REPLY(reply, request_name) do { \
+ if (!reply) { \
+ log_err(keymap->ctx, \
+ "x11: failed to get keymap from X server: %s request failed\n", \
+ (request_name)); \
+ goto fail; \
+ } \
+} while (0)
+
+#define ALLOC_OR_FAIL(arr, nmemb) do { \
+ if ((nmemb) > 0) { \
+ (arr) = calloc((nmemb), sizeof(*(arr))); \
+ if (!(arr)) \
+ goto fail; \
+ } \
+} while (0)
+
+
+static xkb_mod_mask_t
+translate_mods(uint8_t rmods, uint16_t vmods_low, uint16_t vmods_high)
+{
+ /* We represent mod masks in a single uint32_t value, with real mods
+ * first and vmods after (though we don't make these distinctions). */
+ return rmods | (vmods_low << 8) | (vmods_high << 16);
+}
+
+static enum xkb_action_controls
+translate_controls_mask(uint16_t wire)
+{
+ enum xkb_action_controls ret = 0;
+ if (wire & XCB_XKB_BOOL_CTRL_REPEAT_KEYS)
+ ret |= CONTROL_REPEAT;
+ if (wire & XCB_XKB_BOOL_CTRL_SLOW_KEYS)
+ ret |= CONTROL_SLOW;
+ if (wire & XCB_XKB_BOOL_CTRL_BOUNCE_KEYS)
+ ret |= CONTROL_DEBOUNCE;
+ if (wire & XCB_XKB_BOOL_CTRL_STICKY_KEYS)
+ ret |= CONTROL_STICKY;
+ if (wire & XCB_XKB_BOOL_CTRL_MOUSE_KEYS)
+ ret |= CONTROL_MOUSEKEYS;
+ if (wire & XCB_XKB_BOOL_CTRL_MOUSE_KEYS_ACCEL)
+ ret |= CONTROL_MOUSEKEYS_ACCEL;
+ if (wire & XCB_XKB_BOOL_CTRL_ACCESS_X_KEYS)
+ ret |= CONTROL_AX;
+ if (wire & XCB_XKB_BOOL_CTRL_ACCESS_X_TIMEOUT_MASK)
+ ret |= CONTROL_AX_TIMEOUT;
+ if (wire & XCB_XKB_BOOL_CTRL_ACCESS_X_FEEDBACK_MASK)
+ ret |= CONTROL_AX_FEEDBACK;
+ if (wire & XCB_XKB_BOOL_CTRL_AUDIBLE_BELL_MASK)
+ ret |= CONTROL_BELL;
+ if (wire & XCB_XKB_BOOL_CTRL_IGNORE_GROUP_LOCK_MASK)
+ ret |= CONTROL_IGNORE_GROUP_LOCK;
+ /* Some controls are not supported and don't appear here. */
+ return ret;
+}
+
+static void
+translate_action(union xkb_action *action, const xcb_xkb_action_t *wire)
+{
+ switch (wire->type) {
+ case XCB_XKB_SA_TYPE_SET_MODS:
+ action->type = ACTION_TYPE_MOD_SET;
+
+ action->mods.mods.mods = translate_mods(wire->setmods.realMods,
+ wire->setmods.vmodsLow,
+ wire->setmods.vmodsHigh);
+ action->mods.mods.mask = translate_mods(wire->setmods.mask, 0, 0);
+
+ if (wire->setmods.flags & XCB_XKB_SA_CLEAR_LOCKS)
+ action->mods.flags |= ACTION_LOCK_CLEAR;
+ if (wire->setmods.flags & XCB_XKB_SA_LATCH_TO_LOCK)
+ action->mods.flags |= ACTION_LATCH_TO_LOCK;
+ if (wire->setmods.flags & XCB_XKB_SA_USE_MOD_MAP_MODS)
+ action->mods.flags |= ACTION_MODS_LOOKUP_MODMAP;
+
+ break;
+ case XCB_XKB_SA_TYPE_LATCH_MODS:
+ action->type = ACTION_TYPE_MOD_LATCH;
+
+ action->mods.mods.mods = translate_mods(wire->latchmods.realMods,
+ wire->latchmods.vmodsLow,
+ wire->latchmods.vmodsHigh);
+ action->mods.mods.mask = translate_mods(wire->latchmods.mask, 0, 0);
+
+ if (wire->latchmods.flags & XCB_XKB_SA_CLEAR_LOCKS)
+ action->mods.flags |= ACTION_LOCK_CLEAR;
+ if (wire->latchmods.flags & XCB_XKB_SA_LATCH_TO_LOCK)
+ action->mods.flags |= ACTION_LATCH_TO_LOCK;
+ if (wire->latchmods.flags & XCB_XKB_SA_USE_MOD_MAP_MODS)
+ action->mods.flags |= ACTION_MODS_LOOKUP_MODMAP;
+
+ break;
+ case XCB_XKB_SA_TYPE_LOCK_MODS:
+ action->type = ACTION_TYPE_MOD_LOCK;
+
+ action->mods.mods.mods = translate_mods(wire->lockmods.realMods,
+ wire->lockmods.vmodsLow,
+ wire->lockmods.vmodsHigh);
+ action->mods.mods.mask = translate_mods(wire->lockmods.mask, 0, 0);
+
+ if (wire->lockmods.flags & XCB_XKB_SA_ISO_LOCK_FLAG_NO_LOCK)
+ action->mods.flags |= ACTION_LOCK_NO_LOCK;
+ if (wire->lockmods.flags & XCB_XKB_SA_ISO_LOCK_FLAG_NO_UNLOCK)
+ action->mods.flags |= ACTION_LOCK_NO_UNLOCK;
+ if (wire->lockmods.flags & XCB_XKB_SA_USE_MOD_MAP_MODS)
+ action->mods.flags |= ACTION_MODS_LOOKUP_MODMAP;
+
+ break;
+ case XCB_XKB_SA_TYPE_SET_GROUP:
+ action->type = ACTION_TYPE_GROUP_SET;
+
+ action->group.group = wire->setgroup.group;
+
+ if (wire->setmods.flags & XCB_XKB_SA_CLEAR_LOCKS)
+ action->group.flags |= ACTION_LOCK_CLEAR;
+ if (wire->setmods.flags & XCB_XKB_SA_LATCH_TO_LOCK)
+ action->group.flags |= ACTION_LATCH_TO_LOCK;
+ if (wire->setmods.flags & XCB_XKB_SA_ISO_LOCK_FLAG_GROUP_ABSOLUTE)
+ action->group.flags |= ACTION_ABSOLUTE_SWITCH;
+
+ break;
+ case XCB_XKB_SA_TYPE_LATCH_GROUP:
+ action->type = ACTION_TYPE_GROUP_LATCH;
+
+ action->group.group = wire->latchgroup.group;
+
+ if (wire->latchmods.flags & XCB_XKB_SA_CLEAR_LOCKS)
+ action->group.flags |= ACTION_LOCK_CLEAR;
|
[-]
[+]
|
Added |
libxkbcommon-0.4.0.tar.xz/src/x11/state.c
^
|
@@ -0,0 +1,71 @@
+/*
+ * Copyright © 2013 Ran Benita
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include "x11-priv.h"
+
+static bool
+update_initial_state(struct xkb_state *state, xcb_connection_t *conn,
+ uint16_t device_id)
+{
+ xcb_xkb_get_state_cookie_t cookie =
+ xcb_xkb_get_state(conn, device_id);
+ xcb_xkb_get_state_reply_t *reply =
+ xcb_xkb_get_state_reply(conn, cookie, NULL);
+
+ if (!reply)
+ return false;
+
+ xkb_state_update_mask(state,
+ reply->baseMods,
+ reply->latchedMods,
+ reply->lockedMods,
+ reply->baseGroup,
+ reply->latchedGroup,
+ reply->lockedGroup);
+
+ free(reply);
+ return true;
+}
+
+XKB_EXPORT struct xkb_state *
+xkb_x11_state_new_from_device(struct xkb_keymap *keymap,
+ xcb_connection_t *conn, int32_t device_id)
+{
+ struct xkb_state *state;
+
+ if (device_id < 0 || device_id > 255) {
+ log_err_func(keymap->ctx, "illegal device ID: %d", device_id);
+ return NULL;
+ }
+
+ state = xkb_state_new(keymap);
+ if (!state)
+ return NULL;
+
+ if (!update_initial_state(state, conn, device_id)) {
+ xkb_state_unref(state);
+ return NULL;
+ }
+
+ return state;
+}
|
[-]
[+]
|
Added |
libxkbcommon-0.4.0.tar.xz/src/x11/util.c
^
|
@@ -0,0 +1,215 @@
+/*
+ * Copyright © 2013 Ran Benita
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include "x11-priv.h"
+
+XKB_EXPORT int
+xkb_x11_setup_xkb_extension(xcb_connection_t *conn,
+ uint16_t major_xkb_version,
+ uint16_t minor_xkb_version,
+ enum xkb_x11_setup_xkb_extension_flags flags,
+ uint16_t *major_xkb_version_out,
+ uint16_t *minor_xkb_version_out,
+ uint8_t *base_event_out,
+ uint8_t *base_error_out)
+{
+ uint8_t base_event, base_error;
+ uint16_t server_major, server_minor;
+
+ if (flags & ~(XKB_X11_SETUP_XKB_EXTENSION_NO_FLAGS)) {
+ /* log_err_func(ctx, "unrecognized flags: %#x\n", flags); */
+ return 0;
+ }
+
+ {
+ const xcb_query_extension_reply_t *reply =
+ xcb_get_extension_data(conn, &xcb_xkb_id);
+ if (!reply) {
+ /* log_err_func(ctx, "failed to query for XKB extension\n"); */
+ return 0;
+ }
+
+ if (!reply->present) {
+ /* log_err_func(ctx, "failed to start using XKB extension: not available in server\n"); */
+ return 0;
+ }
+
+ base_event = reply->first_event;
+ base_error = reply->first_error;
+ }
+
+ {
+ xcb_generic_error_t *error = NULL;
+ xcb_xkb_use_extension_cookie_t cookie =
+ xcb_xkb_use_extension(conn, major_xkb_version, minor_xkb_version);
+ xcb_xkb_use_extension_reply_t *reply =
+ xcb_xkb_use_extension_reply(conn, cookie, &error);
+
+ if (!reply) {
+ /* log_err_func(ctx, */
+ /* "failed to start using XKB extension: error code %d\n", */
+ /* error ? error->error_code : -1); */
+ free(error);
+ return 0;
+ }
+
+ if (!reply->supported) {
+ /* log_err_func(ctx, */
+ /* "failed to start using XKB extension: server doesn't support version %d.%d\n", */
+ /* major_xkb_version, minor_xkb_version); */
+ free(reply);
+ return 0;
+ }
+
+ server_major = reply->serverMajor;
+ server_minor = reply->serverMinor;
+
+ free(reply);
+ }
+
+ /*
+ * The XkbUseExtension() in libX11 has a *bunch* of legacy stuff, but
+ * it doesn't seem like any of it is useful to us.
+ */
+
+ if (major_xkb_version_out)
+ *major_xkb_version_out = server_major;
+ if (minor_xkb_version_out)
+ *minor_xkb_version_out = server_minor;
+ if (base_event_out)
+ *base_event_out = base_event;
+ if (base_error_out)
+ *base_error_out = base_error;
+
+ return 1;
+}
+
+XKB_EXPORT int32_t
+xkb_x11_get_core_keyboard_device_id(xcb_connection_t *conn)
+{
+ int32_t device_id;
+ xcb_xkb_get_device_info_cookie_t cookie =
+ xcb_xkb_get_device_info(conn, XCB_XKB_ID_USE_CORE_KBD,
+ 0, 0, 0, 0, 0, 0);
+ xcb_xkb_get_device_info_reply_t *reply =
+ xcb_xkb_get_device_info_reply(conn, cookie, NULL);
+
+ if (!reply)
+ return -1;
+
+ device_id = reply->deviceID;
+ free(reply);
+ return device_id;
+}
+
+bool
+get_atom_name(xcb_connection_t *conn, xcb_atom_t atom, char **out)
+{
+ xcb_get_atom_name_cookie_t cookie;
+ xcb_get_atom_name_reply_t *reply;
+ int length;
+ char *name;
+
+ if (atom == 0) {
+ *out = NULL;
+ return true;
+ }
+
+ cookie = xcb_get_atom_name(conn, atom);
+ reply = xcb_get_atom_name_reply(conn, cookie, NULL);
+ if (!reply)
+ return false;
+
+ length = xcb_get_atom_name_name_length(reply);
+ name = xcb_get_atom_name_name(reply);
+
+ *out = strndup(name, length);
+ if (!*out) {
+ free(reply);
+ return false;
+ }
+
+ free(reply);
+ return true;
+}
+
+bool
+adopt_atoms(struct xkb_context *ctx, xcb_connection_t *conn,
+ const xcb_atom_t *from, xkb_atom_t *to, const size_t count)
+{
+ enum { SIZE = 128 };
+ xcb_get_atom_name_cookie_t cookies[SIZE];
+
+ /* Send and collect the atoms in batches of reasonable SIZE. */
+ for (size_t batch = 0; batch <= count / SIZE; batch++) {
+ const size_t start = batch * SIZE;
+ const size_t stop = min((batch + 1) * SIZE, count);
+
+ /* Send. */
+ for (size_t i = start; i < stop; i++)
+ if (from[i] != XCB_ATOM_NONE)
+ cookies[i % SIZE] = xcb_get_atom_name(conn, from[i]);
+
+ /* Collect. */
+ for (size_t i = start; i < stop; i++) {
+ xcb_get_atom_name_reply_t *reply;
+
+ if (from[i] == XCB_ATOM_NONE) {
+ to[i] = XKB_ATOM_NONE;
+ continue;
+ }
+
+ reply = xcb_get_atom_name_reply(conn, cookies[i % SIZE], NULL);
+ if (!reply)
+ goto err_discard;
+
+ to[i] = xkb_atom_intern(ctx,
+ xcb_get_atom_name_name(reply),
+ xcb_get_atom_name_name_length(reply));
+ free(reply);
+
+ if (to[i] == XKB_ATOM_NONE)
+ goto err_discard;
+
+ continue;
+
+ /*
+ * If we don't discard the uncollected replies, they just
+ * sit there waiting. Sad.
+ */
|
[-]
[+]
|
Added |
libxkbcommon-0.4.0.tar.xz/src/x11/x11-priv.h
^
|
@@ -0,0 +1,54 @@
+/*
+ * Copyright © 2013 Ran Benita
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef _XKBCOMMON_X11_PRIV_H
+#define _XKBCOMMON_X11_PRIV_H
+
+#include <xcb/xkb.h>
+
+#include "xkbcommon/xkbcommon-x11.h"
+#include "keymap.h"
+
+/* Get a strdup'd name of an X atom. */
+bool
+get_atom_name(xcb_connection_t *conn, xcb_atom_t atom, char **out);
+
+/*
+ * Make a xkb_atom_t's from X atoms (prefer to send as many as possible
+ * at once, to avoid many roundtrips).
+ *
+ * TODO: We can make this more flexible, such that @to doesn't have to
+ * be sequential. Then we can convert most adopt_atom() calls to
+ * adopt_atoms().
+ * Atom caching would also likely be useful for avoiding quite a
+ * few requests.
+ */
+bool
+adopt_atoms(struct xkb_context *ctx, xcb_connection_t *conn,
+ const xcb_atom_t *from, xkb_atom_t *to, size_t count);
+
+bool
+adopt_atom(struct xkb_context *ctx, xcb_connection_t *conn, xcb_atom_t atom,
+ xkb_atom_t *out);
+
+#endif
|
[-]
[+]
|
Added |
libxkbcommon-0.4.0.tar.xz/src/xkbcomp/.gitignore
^
|
@@ -0,0 +1,2 @@
+parser.c
+parser.h
|
[-]
[+]
|
Changed |
libxkbcommon-0.4.0.tar.xz/src/xkbcomp/action.c
^
|
@@ -56,18 +56,22 @@
#include "expr.h"
#include "action.h"
-static const ExprDef constTrue = {
- .common = { .type = STMT_EXPR, .next = NULL },
- .op = EXPR_VALUE,
- .value_type = EXPR_TYPE_BOOLEAN,
- .value = { .ival = 1 },
+static const ExprBoolean constTrue = {
+ .expr = {
+ .common = { .type = STMT_EXPR, .next = NULL },
+ .op = EXPR_VALUE,
+ .value_type = EXPR_TYPE_BOOLEAN,
+ },
+ .set = true,
};
-static const ExprDef constFalse = {
- .common = { .type = STMT_EXPR, .next = NULL },
- .op = EXPR_VALUE,
- .value_type = EXPR_TYPE_BOOLEAN,
- .value = { .ival = 0 },
+static const ExprBoolean constFalse = {
+ .expr = {
+ .common = { .type = STMT_EXPR, .next = NULL },
+ .op = EXPR_VALUE,
+ .value_type = EXPR_TYPE_BOOLEAN,
+ },
+ .set = false,
};
enum action_field {
@@ -214,17 +218,6 @@
return false;
}
-static inline bool
-ReportNotFound(struct xkb_keymap *keymap, enum xkb_action_type action,
- enum action_field field, const char *what, const char *bad)
-{
- log_err(keymap->ctx,
- "%s named %s not found; "
- "Ignoring the %s field of an %s action\n",
- what, bad, fieldText(field), ActionTypeText(action));
- return false;
-}
-
static bool
HandleNoAction(struct xkb_keymap *keymap, union xkb_action *action,
enum action_field field, const ExprDef *array_ndx,
@@ -265,9 +258,9 @@
const ExprDef *value, enum xkb_action_flags *flags_inout,
xkb_mod_mask_t *mods_rtrn)
{
- if (value->op == EXPR_IDENT) {
+ if (value->expr.op == EXPR_IDENT) {
const char *valStr;
- valStr = xkb_atom_text(keymap->ctx, value->value.str);
+ valStr = xkb_atom_text(keymap->ctx, value->ident.ident);
if (valStr && (istreq(valStr, "usemodmapmods") ||
istreq(valStr, "modmapmods"))) {
@@ -367,9 +360,9 @@
{
const ExprDef *spec;
- if (value->op == EXPR_NEGATE || value->op == EXPR_UNARY_PLUS) {
+ if (value->expr.op == EXPR_NEGATE || value->expr.op == EXPR_UNARY_PLUS) {
*flags_inout &= ~ACTION_ABSOLUTE_SWITCH;
- spec = value->value.child;
+ spec = value->unary.child;
}
else {
*flags_inout |= ACTION_ABSOLUTE_SWITCH;
@@ -380,9 +373,9 @@
return ReportMismatch(keymap, action, ACTION_FIELD_GROUP,
"integer (range 1..8)");
- if (value->op == EXPR_NEGATE)
+ if (value->expr.op == EXPR_NEGATE)
*grp_rtrn = -*grp_rtrn;
- else if (value->op != EXPR_UNARY_PLUS)
+ else if (value->expr.op != EXPR_UNARY_PLUS)
(*grp_rtrn)--;
return true;
@@ -464,18 +457,14 @@
const ExprDef *value)
{
struct xkb_pointer_action *act = &action->ptr;
- bool absolute;
if (array_ndx && (field == ACTION_FIELD_X || field == ACTION_FIELD_Y))
return ReportActionNotArray(keymap, action->type, field);
if (field == ACTION_FIELD_X || field == ACTION_FIELD_Y) {
int val;
-
- if (value->op == EXPR_NEGATE || value->op == EXPR_UNARY_PLUS)
- absolute = false;
- else
- absolute = true;
+ const bool absolute = (value->expr.op != EXPR_NEGATE &&
+ value->expr.op != EXPR_UNARY_PLUS);
if (!ExprResolveInteger(keymap->ctx, value, &val))
return ReportMismatch(keymap, action->type, field, "integer");
@@ -613,9 +602,10 @@
if (array_ndx)
return ReportActionNotArray(keymap, action->type, field);
- if (value->op == EXPR_NEGATE || value->op == EXPR_UNARY_PLUS) {
+ if (value->expr.op == EXPR_NEGATE ||
+ value->expr.op == EXPR_UNARY_PLUS) {
act->flags &= ~ACTION_ABSOLUTE_SWITCH;
- button = value->value.child;
+ button = value->unary.child;
}
else {
act->flags |= ACTION_ABSOLUTE_SWITCH;
@@ -639,7 +629,7 @@
return false;
}
- act->value = (value->op == EXPR_NEGATE ? -btn: btn);
+ act->value = (value->expr.op == EXPR_NEGATE ? -btn: btn);
return true;
}
@@ -660,9 +650,10 @@
if (array_ndx)
return ReportActionNotArray(keymap, action->type, field);
- if (value->op == EXPR_NEGATE || value->op == EXPR_UNARY_PLUS) {
+ if (value->expr.op == EXPR_NEGATE ||
+ value->expr.op == EXPR_UNARY_PLUS) {
act->flags &= ~ACTION_ABSOLUTE_SWITCH;
- scrn = value->value.child;
+ scrn = value->unary.child;
}
else {
act->flags |= ACTION_ABSOLUTE_SWITCH;
@@ -680,7 +671,7 @@
return false;
}
- act->screen = (value->op == EXPR_NEGATE ? -val : val);
+ act->screen = (value->expr.op == EXPR_NEGATE ? -val : val);
return true;
}
else if (field == ACTION_FIELD_SAME) {
@@ -861,13 +852,13 @@
const char *str;
unsigned handler_type;
- if (def->op != EXPR_ACTION_DECL) {
+ if (def->expr.op != EXPR_ACTION_DECL) {
log_err(keymap->ctx, "Expected an action definition, found %s\n",
- expr_op_type_to_string(def->op));
+ expr_op_type_to_string(def->expr.op));
return false;
}
- str = xkb_atom_text(keymap->ctx, def->value.action.name);
+ str = xkb_atom_text(keymap->ctx, def->action.name);
if (!stringToAction(str, &handler_type)) {
log_err(keymap->ctx, "Unknown action %s\n", str);
return false;
@@ -885,24 +876,24 @@
* particular instance, e.g. "modifiers" and "clearLocks" in:
* SetMods(modifiers=Alt,clearLocks);
*/
- for (arg = def->value.action.args; arg != NULL;
+ for (arg = def->action.args; arg != NULL;
arg = (ExprDef *) arg->common.next) {
const ExprDef *value;
ExprDef *field, *arrayRtrn;
const char *elemRtrn, *fieldRtrn;
enum action_field fieldNdx;
- if (arg->op == EXPR_ASSIGN) {
- field = arg->value.binary.left;
- value = arg->value.binary.right;
- }
- else if (arg->op == EXPR_NOT || arg->op == EXPR_INVERT) {
- field = arg->value.child;
- value = &constFalse;
+ if (arg->expr.op == EXPR_ASSIGN) {
+ field = arg->binary.left;
+ value = arg->binary.right;
+ }
+ else if (arg->expr.op == EXPR_NOT || arg->expr.op == EXPR_INVERT) {
+ field = arg->unary.child;
+ value = (const ExprDef *) &constFalse;
}
else {
field = arg;
- value = &constTrue;
+ value = (const ExprDef *) &constTrue;
|
[-]
[+]
|
Changed |
libxkbcommon-0.4.0.tar.xz/src/xkbcomp/ast-build.c
^
|
@@ -70,57 +70,173 @@
return to;
}
-ExprDef *
-ExprCreate(enum expr_op_type op, enum expr_value_type type)
+static ExprDef *
+ExprCreate(enum expr_op_type op, enum expr_value_type type, size_t size)
{
- ExprDef *expr = malloc(sizeof(*expr));
+ ExprDef *expr = malloc(size);
if (!expr)
return NULL;
expr->common.type = STMT_EXPR;
expr->common.next = NULL;
- expr->op = op;
- expr->value_type = type;
+ expr->expr.op = op;
+ expr->expr.value_type = type;
return expr;
}
+#define EXPR_CREATE(type_, name_, op_, value_type_) \
+ ExprDef *name_ = ExprCreate(op_, value_type_, sizeof(type_)); \
+ if (!name_) \
+ return NULL;
+
+ExprDef *
+ExprCreateString(xkb_atom_t str)
+{
+ EXPR_CREATE(ExprString, expr, EXPR_VALUE, EXPR_TYPE_STRING);
+ expr->string.str = str;
+ return expr;
+}
+
+ExprDef *
+ExprCreateInteger(int ival)
+{
+ EXPR_CREATE(ExprInteger, expr, EXPR_VALUE, EXPR_TYPE_INT);
+ expr->integer.ival = ival;
+ return expr;
+}
+
+ExprDef *
+ExprCreateBoolean(bool set)
+{
+ EXPR_CREATE(ExprBoolean, expr, EXPR_VALUE, EXPR_TYPE_BOOLEAN);
+ expr->boolean.set = set;
+ return expr;
+}
+
+ExprDef *
+ExprCreateKeyName(xkb_atom_t key_name)
+{
+ EXPR_CREATE(ExprKeyName, expr, EXPR_VALUE, EXPR_TYPE_KEYNAME);
+ expr->key_name.key_name = key_name;
+ return expr;
+}
+
+ExprDef *
+ExprCreateIdent(xkb_atom_t ident)
+{
+ EXPR_CREATE(ExprIdent, expr, EXPR_IDENT, EXPR_TYPE_UNKNOWN);
+ expr->ident.ident = ident;
+ return expr;
+}
+
ExprDef *
ExprCreateUnary(enum expr_op_type op, enum expr_value_type type,
ExprDef *child)
{
- ExprDef *expr = malloc(sizeof(*expr));
- if (!expr)
- return NULL;
+ EXPR_CREATE(ExprUnary, expr, op, type);
+ expr->unary.child = child;
+ return expr;
+}
- expr->common.type = STMT_EXPR;
- expr->common.next = NULL;
- expr->op = op;
- expr->value_type = type;
- expr->value.child = child;
+ExprDef *
+ExprCreateBinary(enum expr_op_type op, ExprDef *left, ExprDef *right)
+{
+ EXPR_CREATE(ExprBinary, expr, op, EXPR_TYPE_UNKNOWN);
+
+ if (op == EXPR_ASSIGN || left->expr.value_type == EXPR_TYPE_UNKNOWN)
+ expr->expr.value_type = right->expr.value_type;
+ else if (left->expr.value_type == right->expr.value_type ||
+ right->expr.value_type == EXPR_TYPE_UNKNOWN)
+ expr->expr.value_type = left->expr.value_type;
+ expr->binary.left = left;
+ expr->binary.right = right;
return expr;
}
ExprDef *
-ExprCreateBinary(enum expr_op_type op, ExprDef *left, ExprDef *right)
+ExprCreateFieldRef(xkb_atom_t element, xkb_atom_t field)
{
- ExprDef *expr = malloc(sizeof(*expr));
- if (!expr)
- return NULL;
+ EXPR_CREATE(ExprFieldRef, expr, EXPR_FIELD_REF, EXPR_TYPE_UNKNOWN);
+ expr->field_ref.element = element;
+ expr->field_ref.field = field;
+ return expr;
+}
- expr->common.type = STMT_EXPR;
- expr->common.next = NULL;
- expr->op = op;
- if (op == EXPR_ASSIGN || left->value_type == EXPR_TYPE_UNKNOWN)
- expr->value_type = right->value_type;
- else if (left->value_type == right->value_type ||
- right->value_type == EXPR_TYPE_UNKNOWN)
- expr->value_type = left->value_type;
- else
- expr->value_type = EXPR_TYPE_UNKNOWN;
- expr->value.binary.left = left;
- expr->value.binary.right = right;
+ExprDef *
+ExprCreateArrayRef(xkb_atom_t element, xkb_atom_t field, ExprDef *entry)
+{
+ EXPR_CREATE(ExprArrayRef, expr, EXPR_ARRAY_REF, EXPR_TYPE_UNKNOWN);
+ expr->array_ref.element = element;
+ expr->array_ref.field = field;
+ expr->array_ref.entry = entry;
+ return expr;
+}
+
+ExprDef *
+ExprCreateAction(xkb_atom_t name, ExprDef *args)
+{
+ EXPR_CREATE(ExprAction, expr, EXPR_ACTION_DECL, EXPR_TYPE_UNKNOWN);
+ expr->action.name = name;
+ expr->action.args = args;
+ return expr;
+}
+
+ExprDef *
+ExprCreateKeysymList(xkb_keysym_t sym)
+{
+ EXPR_CREATE(ExprKeysymList, expr, EXPR_KEYSYM_LIST, EXPR_TYPE_SYMBOLS);
+
+ darray_init(expr->keysym_list.syms);
+ darray_init(expr->keysym_list.symsMapIndex);
+ darray_init(expr->keysym_list.symsNumEntries);
+
+ darray_append(expr->keysym_list.syms, sym);
+ darray_append(expr->keysym_list.symsMapIndex, 0);
+ darray_append(expr->keysym_list.symsNumEntries, 1);
+
+ return expr;
+}
+
+ExprDef *
+ExprCreateMultiKeysymList(ExprDef *expr)
+{
+ size_t nLevels = darray_size(expr->keysym_list.symsMapIndex);
+
+ darray_resize(expr->keysym_list.symsMapIndex, 1);
+ darray_resize(expr->keysym_list.symsNumEntries, 1);
+ darray_item(expr->keysym_list.symsMapIndex, 0) = 0;
+ darray_item(expr->keysym_list.symsNumEntries, 0) = nLevels;
+
+ return expr;
+}
+
+ExprDef *
+ExprAppendKeysymList(ExprDef *expr, xkb_keysym_t sym)
+{
+ size_t nSyms = darray_size(expr->keysym_list.syms);
+
+ darray_append(expr->keysym_list.symsMapIndex, nSyms);
+ darray_append(expr->keysym_list.symsNumEntries, 1);
+ darray_append(expr->keysym_list.syms, sym);
+
+ return expr;
+}
+
+ExprDef *
+ExprAppendMultiKeysymList(ExprDef *expr, ExprDef *append)
+{
+ size_t nSyms = darray_size(expr->keysym_list.syms);
+ size_t numEntries = darray_size(append->keysym_list.syms);
+
+ darray_append(expr->keysym_list.symsMapIndex, nSyms);
+ darray_append(expr->keysym_list.symsNumEntries, numEntries);
+ darray_append_items(expr->keysym_list.syms,
+ darray_mem(append->keysym_list.syms, 0), numEntries);
+
+ darray_resize(append->keysym_list.syms, 0);
+ FreeStmt(&append->common);
|
[-]
[+]
|
Changed |
libxkbcommon-0.4.0.tar.xz/src/xkbcomp/ast-build.h
^
|
@@ -31,7 +31,19 @@
AppendStmt(ParseCommon *to, ParseCommon *append);
ExprDef *
-ExprCreate(enum expr_op_type op, enum expr_value_type type);
+ExprCreateString(xkb_atom_t str);
+
+ExprDef *
+ExprCreateInteger(int ival);
+
+ExprDef *
+ExprCreateBoolean(bool set);
+
+ExprDef *
+ExprCreateKeyName(xkb_atom_t key_name);
+
+ExprDef *
+ExprCreateIdent(xkb_atom_t ident);
ExprDef *
ExprCreateUnary(enum expr_op_type op, enum expr_value_type type,
@@ -40,6 +52,27 @@
ExprDef *
ExprCreateBinary(enum expr_op_type op, ExprDef *left, ExprDef *right);
+ExprDef *
+ExprCreateFieldRef(xkb_atom_t element, xkb_atom_t field);
+
+ExprDef *
+ExprCreateArrayRef(xkb_atom_t element, xkb_atom_t field, ExprDef *entry);
+
+ExprDef *
+ExprCreateAction(xkb_atom_t name, ExprDef *args);
+
+ExprDef *
+ExprCreateMultiKeysymList(ExprDef *list);
+
+ExprDef *
+ExprCreateKeysymList(xkb_keysym_t sym);
+
+ExprDef *
+ExprAppendMultiKeysymList(ExprDef *list, ExprDef *append);
+
+ExprDef *
+ExprAppendKeysymList(ExprDef *list, xkb_keysym_t sym);
+
KeycodeDef *
KeycodeCreate(xkb_atom_t name, int64_t value);
@@ -53,16 +86,16 @@
VarCreate(ExprDef *name, ExprDef *value);
VarDef *
-BoolVarCreate(xkb_atom_t nameToken, unsigned set);
+BoolVarCreate(xkb_atom_t ident, bool set);
InterpDef *
-InterpCreate(char *sym, ExprDef *match);
+InterpCreate(xkb_keysym_t sym, ExprDef *match);
KeyTypeDef *
KeyTypeCreate(xkb_atom_t name, VarDef *body);
SymbolsDef *
-SymbolsCreate(xkb_atom_t keyName, ExprDef *symbols);
+SymbolsCreate(xkb_atom_t keyName, VarDef *symbols);
GroupCompatDef *
GroupCompatCreate(int group, ExprDef *def);
@@ -76,21 +109,6 @@
LedNameDef *
LedNameCreate(int ndx, ExprDef *name, bool virtual);
-ExprDef *
-ActionCreate(xkb_atom_t name, ExprDef *args);
-
-ExprDef *
-CreateMultiKeysymList(ExprDef *list);
-
-ExprDef *
-CreateKeysymList(char *sym);
-
-ExprDef *
-AppendMultiKeysymList(ExprDef *list, ExprDef *append);
-
-ExprDef *
-AppendKeysymList(ExprDef *list, char *sym);
-
IncludeStmt *
IncludeCreate(struct xkb_context *ctx, char *str, enum merge_mode merge);
|
[-]
[+]
|
Changed |
libxkbcommon-0.4.0.tar.xz/src/xkbcomp/ast.h
^
|
@@ -143,9 +143,11 @@
const char *
expr_value_type_to_string(enum expr_value_type type);
-typedef struct _ParseCommon {
- enum stmt_type type;
+/* This struct contains fields common to all other AST nodes. It is only
+ * ever embedded in other structs, so save some memory by packing it. */
+typedef struct ATTR_PACKED _ParseCommon {
struct _ParseCommon *next;
+ enum stmt_type type;
} ParseCommon;
typedef struct _IncludeStmt {
@@ -158,40 +160,92 @@
struct _IncludeStmt *next_incl;
} IncludeStmt;
-typedef struct _Expr {
+typedef struct {
ParseCommon common;
enum expr_op_type op;
enum expr_value_type value_type;
- union {
- struct {
- struct _Expr *left;
- struct _Expr *right;
- } binary;
- struct {
- xkb_atom_t element;
- xkb_atom_t field;
- } field;
- struct {
- xkb_atom_t element;
- xkb_atom_t field;
- struct _Expr *entry;
- } array;
- struct {
- xkb_atom_t name;
- struct _Expr *args;
- } action;
- struct {
- darray(char *) syms;
- darray(int) symsMapIndex;
- darray(unsigned int) symsNumEntries;
- } list;
- struct _Expr *child;
- xkb_atom_t str;
- unsigned uval;
- int ival;
- xkb_atom_t keyName;
- } value;
-} ExprDef;
+} ExprCommon;
+
+typedef union ExprDef ExprDef;
+
+typedef struct {
+ ExprCommon expr;
+ xkb_atom_t ident;
+} ExprIdent;
+
+typedef struct {
+ ExprCommon expr;
+ xkb_atom_t str;
+} ExprString;
+
+typedef struct {
+ ExprCommon expr;
+ bool set;
+} ExprBoolean;
+
+typedef struct {
+ ExprCommon expr;
+ int ival;
+} ExprInteger;
+
+typedef struct {
+ ExprCommon expr;
+ xkb_atom_t key_name;
+} ExprKeyName;
+
+typedef struct {
+ ExprCommon expr;
+ ExprDef *left;
+ ExprDef *right;
+} ExprBinary;
+
+typedef struct {
+ ExprCommon expr;
+ ExprDef *child;
+} ExprUnary;
+
+typedef struct {
+ ExprCommon expr;
+ xkb_atom_t element;
+ xkb_atom_t field;
+} ExprFieldRef;
+
+typedef struct {
+ ExprCommon expr;
+ xkb_atom_t element;
+ xkb_atom_t field;
+ ExprDef *entry;
+} ExprArrayRef;
+
+typedef struct {
+ ExprCommon expr;
+ xkb_atom_t name;
+ ExprDef *args;
+} ExprAction;
+
+typedef struct {
+ ExprCommon expr;
+ darray(xkb_keysym_t) syms;
+ darray(int) symsMapIndex;
+ darray(unsigned int) symsNumEntries;
+} ExprKeysymList;
+
+union ExprDef {
+ ParseCommon common;
+ /* Maybe someday we can use C11 anonymous struct for ExprCommon here. */
+ ExprCommon expr;
+ ExprIdent ident;
+ ExprString string;
+ ExprBoolean boolean;
+ ExprInteger integer;
+ ExprKeyName key_name;
+ ExprBinary binary;
+ ExprUnary unary;
+ ExprFieldRef field_ref;
+ ExprArrayRef array_ref;
+ ExprAction action;
+ ExprKeysymList keysym_list;
+};
typedef struct {
ParseCommon common;
@@ -232,7 +286,7 @@
ParseCommon common;
enum merge_mode merge;
xkb_atom_t keyName;
- ExprDef *symbols;
+ VarDef *symbols;
} SymbolsDef;
typedef struct {
@@ -252,7 +306,7 @@
typedef struct {
ParseCommon common;
enum merge_mode merge;
- char *sym;
+ xkb_keysym_t sym;
ExprDef *match;
VarDef *def;
} InterpDef;
|
[-]
[+]
|
Changed |
libxkbcommon-0.4.0.tar.xz/src/xkbcomp/compat.c
^
|
@@ -432,19 +432,19 @@
}
*pred_rtrn = MATCH_EXACTLY;
- if (expr->op == EXPR_ACTION_DECL) {
+ if (expr->expr.op == EXPR_ACTION_DECL) {
const char *pred_txt = xkb_atom_text(info->keymap->ctx,
- expr->value.action.name);
+ expr->action.name);
if (!LookupString(symInterpretMatchMaskNames, pred_txt, pred_rtrn)) {
log_err(info->keymap->ctx,
"Illegal modifier predicate \"%s\"; Ignored\n", pred_txt);
return false;
}
- expr = expr->value.action.args;
+ expr = expr->action.args;
}
- else if (expr->op == EXPR_IDENT) {
+ else if (expr->expr.op == EXPR_IDENT) {
const char *pred_txt = xkb_atom_text(info->keymap->ctx,
- expr->value.str);
+ expr->ident.ident);
if (pred_txt && istreq(pred_txt, "any")) {
*pred_rtrn = MATCH_ANY;
*mods_rtrn = MOD_REAL_MASK_ALL;
@@ -805,7 +805,7 @@
ExprDef *arrayNdx;
for (; def; def = (VarDef *) def->common.next) {
- if (def->name && def->name->op == EXPR_FIELD_REF) {
+ if (def->name && def->name->expr.op == EXPR_FIELD_REF) {
log_err(info->keymap->ctx,
"Cannot set a global default value from within an interpret statement; "
"Move statements to the global file scope\n");
@@ -840,15 +840,7 @@
si = info->default_interp;
si.merge = merge = (def->merge == MERGE_DEFAULT ? merge : def->merge);
-
- if (!LookupKeysym(def->sym, &si.interp.sym)) {
- log_err(info->keymap->ctx,
- "Could not resolve keysym %s; "
- "Symbol interpretation ignored\n",
- def->sym);
- return false;
- }
-
+ si.interp.sym = def->sym;
si.interp.match = pred;
si.interp.mods = mods;
|
[-]
[+]
|
Changed |
libxkbcommon-0.4.0.tar.xz/src/xkbcomp/expr.c
^
|
@@ -37,26 +37,26 @@
const char **elem_rtrn, const char **field_rtrn,
ExprDef **index_rtrn)
{
- switch (expr->op) {
+ switch (expr->expr.op) {
case EXPR_IDENT:
*elem_rtrn = NULL;
- *field_rtrn = xkb_atom_text(ctx, expr->value.str);
+ *field_rtrn = xkb_atom_text(ctx, expr->ident.ident);
*index_rtrn = NULL;
return true;
case EXPR_FIELD_REF:
- *elem_rtrn = xkb_atom_text(ctx, expr->value.field.element);
- *field_rtrn = xkb_atom_text(ctx, expr->value.field.field);
+ *elem_rtrn = xkb_atom_text(ctx, expr->field_ref.element);
+ *field_rtrn = xkb_atom_text(ctx, expr->field_ref.field);
*index_rtrn = NULL;
return true;
case EXPR_ARRAY_REF:
- *elem_rtrn = xkb_atom_text(ctx, expr->value.array.element);
- *field_rtrn = xkb_atom_text(ctx, expr->value.array.field);
- *index_rtrn = expr->value.array.entry;
+ *elem_rtrn = xkb_atom_text(ctx, expr->array_ref.element);
+ *field_rtrn = xkb_atom_text(ctx, expr->array_ref.field);
+ *index_rtrn = expr->array_ref.entry;
return true;
default:
break;
}
- log_wsgo(ctx, "Unexpected operator %d in ResolveLhs\n", expr->op);
+ log_wsgo(ctx, "Unexpected operator %d in ResolveLhs\n", expr->expr.op);
return false;
}
@@ -127,19 +127,19 @@
bool ok = false;
const char *ident;
- switch (expr->op) {
+ switch (expr->expr.op) {
case EXPR_VALUE:
- if (expr->value_type != EXPR_TYPE_BOOLEAN) {
+ if (expr->expr.value_type != EXPR_TYPE_BOOLEAN) {
log_err(ctx,
"Found constant of type %s where boolean was expected\n",
- expr_value_type_to_string(expr->value_type));
+ expr_value_type_to_string(expr->expr.value_type));
return false;
}
- *set_rtrn = !!expr->value.ival;
+ *set_rtrn = expr->boolean.set;
return true;
case EXPR_IDENT:
- ident = xkb_atom_text(ctx, expr->value.str);
+ ident = xkb_atom_text(ctx, expr->ident.ident);
if (ident) {
if (istreq(ident, "true") ||
istreq(ident, "yes") ||
@@ -154,14 +154,13 @@
return true;
}
}
- log_err(ctx, "Identifier \"%s\" of type boolean is unknown\n",
- xkb_atom_text(ctx, expr->value.str));
+ log_err(ctx, "Identifier \"%s\" of type boolean is unknown\n", ident);
return false;
case EXPR_FIELD_REF:
log_err(ctx, "Default \"%s.%s\" of type boolean is unknown\n",
- xkb_atom_text(ctx, expr->value.field.element),
- xkb_atom_text(ctx, expr->value.field.field));
+ xkb_atom_text(ctx, expr->field_ref.element),
+ xkb_atom_text(ctx, expr->field_ref.field));
return false;
case EXPR_INVERT:
@@ -178,11 +177,12 @@
case EXPR_NEGATE:
case EXPR_UNARY_PLUS:
log_err(ctx, "%s of boolean values not permitted\n",
- expr_op_type_to_string(expr->op));
+ expr_op_type_to_string(expr->expr.op));
break;
default:
- log_wsgo(ctx, "Unknown operator %d in ResolveBoolean\n", expr->op);
+ log_wsgo(ctx, "Unknown operator %d in ResolveBoolean\n",
+ expr->expr.op);
break;
}
@@ -194,32 +194,28 @@
xkb_keycode_t *kc)
{
xkb_keycode_t leftRtrn, rightRtrn;
- ExprDef *left, *right;
- switch (expr->op) {
+ switch (expr->expr.op) {
case EXPR_VALUE:
- if (expr->value_type != EXPR_TYPE_INT) {
+ if (expr->expr.value_type != EXPR_TYPE_INT) {
log_err(ctx,
"Found constant of type %s where an int was expected\n",
- expr_value_type_to_string(expr->value_type));
+ expr_value_type_to_string(expr->expr.value_type));
return false;
}
- *kc = expr->value.uval;
+ *kc = (xkb_keycode_t) expr->integer.ival;
return true;
case EXPR_ADD:
case EXPR_SUBTRACT:
case EXPR_MULTIPLY:
case EXPR_DIVIDE:
- left = expr->value.binary.left;
- right = expr->value.binary.right;
-
- if (!ExprResolveKeyCode(ctx, left, &leftRtrn) ||
- !ExprResolveKeyCode(ctx, right, &rightRtrn))
+ if (!ExprResolveKeyCode(ctx, expr->binary.left, &leftRtrn) ||
+ !ExprResolveKeyCode(ctx, expr->binary.right, &rightRtrn))
return false;
- switch (expr->op) {
+ switch (expr->expr.op) {
case EXPR_ADD:
*kc = leftRtrn + rightRtrn;
break;
@@ -245,19 +241,18 @@
return true;
case EXPR_NEGATE:
- left = expr->value.child;
- if (!ExprResolveKeyCode(ctx, left, &leftRtrn))
+ if (!ExprResolveKeyCode(ctx, expr->unary.child, &leftRtrn))
return false;
*kc = ~leftRtrn;
return true;
case EXPR_UNARY_PLUS:
- left = expr->value.child;
- return ExprResolveKeyCode(ctx, left, kc);
+ return ExprResolveKeyCode(ctx, expr->unary.child, kc);
default:
- log_wsgo(ctx, "Unknown operator %d in ResolveKeyCode\n", expr->op);
+ log_wsgo(ctx, "Unknown operator %d in ResolveKeyCode\n",
+ expr->expr.op);
break;
}
@@ -284,25 +279,25 @@
unsigned u;
ExprDef *left, *right;
- switch (expr->op) {
+ switch (expr->expr.op) {
case EXPR_VALUE:
- if (expr->value_type != EXPR_TYPE_INT) {
+ if (expr->expr.value_type != EXPR_TYPE_INT) {
log_err(ctx,
"Found constant of type %s where an int was expected\n",
- expr_value_type_to_string(expr->value_type));
+ expr_value_type_to_string(expr->expr.value_type));
return false;
}
- *val_rtrn = expr->value.ival;
+ *val_rtrn = expr->integer.ival;
return true;
case EXPR_IDENT:
if (lookup)
- ok = lookup(ctx, lookupPriv, expr->value.str, EXPR_TYPE_INT, &u);
+ ok = lookup(ctx, lookupPriv, expr->ident.ident, EXPR_TYPE_INT, &u);
if (!ok)
log_err(ctx, "Identifier \"%s\" of type int is unknown\n",
- xkb_atom_text(ctx, expr->value.str));
+ xkb_atom_text(ctx, expr->ident.ident));
else
*val_rtrn = (int) u;
@@ -310,21 +305,21 @@
case EXPR_FIELD_REF:
log_err(ctx, "Default \"%s.%s\" of type int is unknown\n",
- xkb_atom_text(ctx, expr->value.field.element),
- xkb_atom_text(ctx, expr->value.field.field));
+ xkb_atom_text(ctx, expr->field_ref.element),
+ xkb_atom_text(ctx, expr->field_ref.field));
return false;
case EXPR_ADD:
|
[-]
[+]
|
Changed |
libxkbcommon-0.4.0.tar.xz/src/xkbcomp/parser.y
^
|
@@ -43,11 +43,47 @@
};
static void
-_xkbcommon_error(struct parser_param *param, const char *msg)
+parser_error(struct parser_param *param, const char *msg)
{
scanner_error(param->scanner, msg);
}
+static void
+parser_warn(struct parser_param *param, const char *msg)
+{
+ scanner_warn(param->scanner, msg);
+}
+
+static void
+_xkbcommon_error(struct parser_param *param, const char *msg)
+{
+ parser_error(param, msg);
+}
+
+static bool
+resolve_keysym(const char *str, xkb_keysym_t *sym_rtrn)
+{
+ xkb_keysym_t sym;
+
+ if (!str || istreq(str, "any") || istreq(str, "nosymbol")) {
+ *sym_rtrn = XKB_KEY_NoSymbol;
+ return true;
+ }
+
+ if (istreq(str, "none") || istreq(str, "voidsymbol")) {
+ *sym_rtrn = XKB_KEY_VoidSymbol;
+ return true;
+ }
+
+ sym = xkb_keysym_from_name(str, XKB_KEYSYM_NO_FLAGS);
+ if (sym != XKB_KEY_NoSymbol) {
+ *sym_rtrn = sym;
+ return true;
+ }
+
+ return false;
+}
+
#define scanner param->scanner
%}
@@ -130,13 +166,13 @@
%union {
int ival;
- unsigned uval;
int64_t num;
enum xkb_file_type file_type;
char *str;
xkb_atom_t sval;
enum merge_mode merge;
enum xkb_map_flags mapFlags;
+ xkb_keysym_t keysym;
ParseCommon *any;
ExprDef *expr;
VarDef *var;
@@ -158,13 +194,13 @@
%type <str> IDENT STRING
%type <sval> KEYNAME
%type <num> KeyCode
-%type <ival> Number Integer Float SignedNumber
+%type <ival> Number Integer Float SignedNumber DoodadType
%type <merge> MergeMode OptMergeMode
%type <file_type> XkbCompositeType FileType
-%type <uval> DoodadType
%type <mapFlags> Flag Flags OptFlags
-%type <str> MapName OptMapName KeySym
+%type <str> MapName OptMapName
%type <sval> FieldSpec Ident Element String
+%type <keysym> KeySym
%type <any> DeclList Decl
%type <expr> OptExprList ExprList Expr Term Lhs Terminal ArrayInit KeySyms
%type <expr> OptKeySymList KeySymList Action ActionList Coord CoordList
@@ -342,9 +378,9 @@
VarDecl : Lhs EQUALS Expr SEMI
{ $$ = VarCreate($1, $3); }
| Ident SEMI
- { $$ = BoolVarCreate($1, 1); }
+ { $$ = BoolVarCreate($1, true); }
| EXCLAM Ident SEMI
- { $$ = BoolVarCreate($2, 0); }
+ { $$ = BoolVarCreate($2, false); }
;
KeyNameDecl : KEYNAME EQUALS KeyCode SEMI
@@ -398,7 +434,7 @@
SymbolsDecl : KEY KEYNAME OBRACE
SymbolsBody
CBRACE SEMI
- { $$ = SymbolsCreate($2, (ExprDef *)$4); }
+ { $$ = SymbolsCreate($2, $4); }
;
SymbolsBody : SymbolsBody COMMA SymbolsVarDecl
@@ -410,8 +446,8 @@
SymbolsVarDecl : Lhs EQUALS Expr { $$ = VarCreate($1, $3); }
| Lhs EQUALS ArrayInit { $$ = VarCreate($1, $3); }
- | Ident { $$ = BoolVarCreate($1, 1); }
- | EXCLAM Ident { $$ = BoolVarCreate($2, 0); }
+ | Ident { $$ = BoolVarCreate($1, true); }
+ | EXCLAM Ident { $$ = BoolVarCreate($2, false); }
| ArrayInit { $$ = VarCreate(NULL, $1); }
;
@@ -600,17 +636,17 @@
;
Term : MINUS Term
- { $$ = ExprCreateUnary(EXPR_NEGATE, $2->value_type, $2); }
+ { $$ = ExprCreateUnary(EXPR_NEGATE, $2->expr.value_type, $2); }
| PLUS Term
- { $$ = ExprCreateUnary(EXPR_UNARY_PLUS, $2->value_type, $2); }
+ { $$ = ExprCreateUnary(EXPR_UNARY_PLUS, $2->expr.value_type, $2); }
| EXCLAM Term
{ $$ = ExprCreateUnary(EXPR_NOT, EXPR_TYPE_BOOLEAN, $2); }
| INVERT Term
- { $$ = ExprCreateUnary(EXPR_INVERT, $2->value_type, $2); }
+ { $$ = ExprCreateUnary(EXPR_INVERT, $2->expr.value_type, $2); }
| Lhs
{ $$ = $1; }
| FieldSpec OPAREN OptExprList CPAREN %prec OPAREN
- { $$ = ActionCreate($1, $3); }
+ { $$ = ExprCreateAction($1, $3); }
| Terminal
{ $$ = $1; }
| OPAREN Expr CPAREN
@@ -624,69 +660,27 @@
;
Action : FieldSpec OPAREN OptExprList CPAREN
- { $$ = ActionCreate($1, $3); }
+ { $$ = ExprCreateAction($1, $3); }
;
Lhs : FieldSpec
- {
- ExprDef *expr;
- expr = ExprCreate(EXPR_IDENT, EXPR_TYPE_UNKNOWN);
- expr->value.str = $1;
- $$ = expr;
- }
+ { $$ = ExprCreateIdent($1); }
| FieldSpec DOT FieldSpec
- {
- ExprDef *expr;
- expr = ExprCreate(EXPR_FIELD_REF, EXPR_TYPE_UNKNOWN);
- expr->value.field.element = $1;
- expr->value.field.field = $3;
- $$ = expr;
- }
+ { $$ = ExprCreateFieldRef($1, $3); }
| FieldSpec OBRACKET Expr CBRACKET
- {
- ExprDef *expr;
- expr = ExprCreate(EXPR_ARRAY_REF, EXPR_TYPE_UNKNOWN);
- expr->value.array.element = XKB_ATOM_NONE;
- expr->value.array.field = $1;
- expr->value.array.entry = $3;
- $$ = expr;
- }
+ { $$ = ExprCreateArrayRef(XKB_ATOM_NONE, $1, $3); }
| FieldSpec DOT FieldSpec OBRACKET Expr CBRACKET
- {
- ExprDef *expr;
- expr = ExprCreate(EXPR_ARRAY_REF, EXPR_TYPE_UNKNOWN);
- expr->value.array.element = $1;
- expr->value.array.field = $3;
- expr->value.array.entry = $5;
- $$ = expr;
- }
+ { $$ = ExprCreateArrayRef($1, $3, $5); }
;
Terminal : String
- {
- ExprDef *expr;
- expr = ExprCreate(EXPR_VALUE, EXPR_TYPE_STRING);
- expr->value.str = $1;
- $$ = expr;
- }
+ { $$ = ExprCreateString($1); }
| Integer
- {
- ExprDef *expr;
- expr = ExprCreate(EXPR_VALUE, EXPR_TYPE_INT);
- expr->value.ival = $1;
- $$ = expr;
- }
+ { $$ = ExprCreateInteger($1); }
| Float
- {
|
[-]
[+]
|
Changed |
libxkbcommon-0.4.0.tar.xz/src/xkbcomp/scanner.c
^
|
@@ -28,8 +28,8 @@
static void
scanner_log(enum xkb_log_level level, struct scanner *s, const char *msg)
{
- xkb_log_cond_level(s->ctx, level, "%s:%d:%d: %s\n", s->file_name,
- s->token_line, s->token_column, msg);
+ xkb_log(s->ctx, level, 0, "%s:%d:%d: %s\n", s->file_name,
+ s->token_line, s->token_column, msg);
}
int
@@ -156,6 +156,7 @@
if (chr(s, '+')) return PLUS;
if (chr(s, '-')) return MINUS;
if (chr(s, '*')) return TIMES;
+ if (chr(s, '/')) return DIVIDE;
if (chr(s, '!')) return EXCLAM;
if (chr(s, '~')) return INVERT;
|
[-]
[+]
|
Changed |
libxkbcommon-0.4.0.tar.xz/src/xkbcomp/symbols.c
^
|
@@ -177,7 +177,7 @@
KeyInfo default_key;
ActionsInfo *actions;
darray(xkb_atom_t) group_names;
- darray(ModMapEntry) modMaps;
+ darray(ModMapEntry) modmaps;
struct xkb_keymap *keymap;
} SymbolsInfo;
@@ -203,7 +203,7 @@
ClearKeyInfo(keyi);
darray_free(info->keys);
darray_free(info->group_names);
- darray_free(info->modMaps);
+ darray_free(info->modmaps);
ClearKeyInfo(&info->default_key);
}
@@ -437,7 +437,7 @@
ModMapEntry *old;
bool clobber = (new->merge != MERGE_AUGMENT);
- darray_foreach(old, info->modMaps) {
+ darray_foreach(old, info->modmaps) {
xkb_mod_index_t use, ignore;
if ((new->haveSymbol != old->haveSymbol) ||
@@ -470,7 +470,7 @@
return true;
}
- darray_append(info->modMaps, *new);
+ darray_append(info->modmaps, *new);
return true;
}
@@ -517,7 +517,7 @@
into->errorCount++;
}
- darray_foreach(mm, from->modMaps) {
+ darray_foreach(mm, from->modmaps) {
mm->merge = (merge == MERGE_DEFAULT ? mm->merge : merge);
if (!AddModMapEntry(into, mm))
into->errorCount++;
@@ -626,30 +626,6 @@
return true;
}
-bool
-LookupKeysym(const char *str, xkb_keysym_t *sym_rtrn)
-{
- xkb_keysym_t sym;
-
- if (!str || istreq(str, "any") || istreq(str, "nosymbol")) {
- *sym_rtrn = XKB_KEY_NoSymbol;
- return 1;
- }
-
- if (istreq(str, "none") || istreq(str, "voidsymbol")) {
- *sym_rtrn = XKB_KEY_VoidSymbol;
- return 1;
- }
-
- sym = xkb_keysym_from_name(str, 0);
- if (sym != XKB_KEY_NoSymbol) {
- *sym_rtrn = sym;
- return 1;
- }
-
- return 0;
-}
-
static bool
AddSymbolsToKey(SymbolsInfo *info, KeyInfo *keyi, ExprDef *arrayNdx,
ExprDef *value)
@@ -670,11 +646,11 @@
return true;
}
- if (value->op != EXPR_KEYSYM_LIST) {
+ if (value->expr.op != EXPR_KEYSYM_LIST) {
log_err(info->keymap->ctx,
"Expected a list of symbols, found %s; "
"Ignoring symbols for group %u of %s\n",
- expr_op_type_to_string(value->op), ndx + 1,
+ expr_op_type_to_string(value->expr.op), ndx + 1,
KeyInfoText(info, keyi));
return false;
}
@@ -687,7 +663,7 @@
return false;
}
- nLevels = darray_size(value->value.list.symsMapIndex);
+ nLevels = darray_size(value->keysym_list.symsMapIndex);
if (darray_size(groupi->levels) < nLevels)
darray_resize0(groupi->levels, nLevels);
@@ -697,34 +673,14 @@
unsigned int sym_index;
struct xkb_level *leveli = &darray_item(groupi->levels, i);
- sym_index = darray_item(value->value.list.symsMapIndex, i);
- leveli->num_syms = darray_item(value->value.list.symsNumEntries, i);
+ sym_index = darray_item(value->keysym_list.symsMapIndex, i);
+ leveli->num_syms = darray_item(value->keysym_list.symsNumEntries, i);
if (leveli->num_syms > 1)
leveli->u.syms = calloc(leveli->num_syms, sizeof(*leveli->u.syms));
for (j = 0; j < leveli->num_syms; j++) {
- char *sym_name = darray_item(value->value.list.syms,
- sym_index + j);
- xkb_keysym_t keysym;
-
- if (!LookupKeysym(sym_name, &keysym)) {
- const char *group_name = "unnamed";
-
- if (ndx < darray_size(info->group_names) &&
- darray_item(info->group_names, ndx))
- group_name = xkb_atom_text(info->keymap->ctx,
- darray_item(info->group_names,
- ndx));
-
- log_warn(info->keymap->ctx,
- "Could not resolve keysym %s for key %s, group %u (%s), level %u\n",
- sym_name, KeyInfoText(info, keyi), ndx + 1,
- group_name, i);
-
- ClearLevelInfo(leveli);
- leveli->num_syms = 0;
- break;
- }
+ xkb_keysym_t keysym = darray_item(value->keysym_list.syms,
+ sym_index + j);
if (leveli->num_syms == 1) {
if (keysym == XKB_KEY_NoSymbol)
@@ -750,7 +706,6 @@
GroupInfo *groupi;
unsigned int nActs;
ExprDef *act;
- union xkb_action *toAct;
if (!GetGroupIndex(info, keyi, arrayNdx, ACTIONS, &ndx))
return false;
@@ -762,11 +717,11 @@
return true;
}
- if (value->op != EXPR_ACTION_LIST) {
+ if (value->expr.op != EXPR_ACTION_LIST) {
log_wsgo(info->keymap->ctx,
"Bad expression type (%d) for action list value; "
"Ignoring actions for group %u of %s\n",
- value->op, ndx, KeyInfoText(info, keyi));
+ value->expr.op, ndx, KeyInfoText(info, keyi));
return false;
}
@@ -778,7 +733,7 @@
}
nActs = 0;
- for (act = value->value.child; act; act = (ExprDef *) act->common.next)
+ for (act = value->unary.child; act; act = (ExprDef *) act->common.next)
nActs++;
if (darray_size(groupi->levels) < nActs)
@@ -786,9 +741,9 @@
groupi->defined |= GROUP_FIELD_ACTS;
- act = value->value.child;
+ act = value->unary.child;
for (i = 0; i < nActs; i++) {
- toAct = &darray_item(groupi->levels, i).action;
+ union xkb_action *toAct = &darray_item(groupi->levels, i).action;
if (!HandleActionDef(act, info->keymap, toAct, info->actions))
log_err(info->keymap->ctx,
@@ -866,7 +821,7 @@
log_err(info->keymap->ctx,
"Expected a virtual modifier mask, found %s; "
"Ignoring virtual modifiers definition for key %s\n",
- expr_op_type_to_string(value->op),
+ expr_op_type_to_string(value->expr.op),
KeyInfoText(info, keyi));
}
}
@@ -1082,7 +1037,7 @@
ExprDef *arrayNdx;
for (; def; def = (VarDef *) def->common.next) {
- if (def->name && def->name->op == EXPR_FIELD_REF) {
+ if (def->name && def->name->expr.op == EXPR_FIELD_REF) {
log_err(info->keymap->ctx,
"Cannot set a global default value from within a key statement; "
"Move statements to the global file scope\n");
@@ -1090,7 +1045,7 @@
|
[-]
[+]
|
Changed |
libxkbcommon-0.4.0.tar.xz/src/xkbcomp/types.c
^
|
@@ -197,16 +197,6 @@
TypeTxt(info, type), wanted);
}
-static inline bool
-ReportTypeBadWidth(KeyTypesInfo *info, const char *type, int has, int needs)
-{
- log_err(info->keymap->ctx,
- "Key type \"%s\" has %d levels, must have %d; "
- "Illegal type definition ignored\n",
- type, has, needs);
- return false;
-}
-
/***====================================================================***/
static void
|
[-]
[+]
|
Changed |
libxkbcommon-0.4.0.tar.xz/src/xkbcomp/xkbcomp-priv.h
^
|
@@ -56,9 +56,6 @@
XkbFileFromComponents(struct xkb_context *ctx,
const struct xkb_component_names *kkctgs);
-void
-XkbEscapeMapName(char *name);
-
bool
CompileKeycodes(XkbFile *file, struct xkb_keymap *keymap,
enum merge_mode merge);
@@ -79,9 +76,6 @@
CompileKeymap(XkbFile *file, struct xkb_keymap *keymap,
enum merge_mode merge);
-bool
-LookupKeysym(const char *str, xkb_keysym_t *sym_rtrn);
-
/***====================================================================***/
static inline bool
|
[-]
[+]
|
Added |
libxkbcommon-0.4.0.tar.xz/test/.gitignore
^
|
@@ -0,0 +1,19 @@
+*.log
+*.trs
+filecomp
+rulescomp
+keysym
+state
+context
+rules-file
+stringcomp
+buffercomp
+keyseq
+log
+interactive-evdev
+rmlvo-to-kccgst
+print-compiled-keymap
+bench-key-proc
+atom
+x11
+interactive-x11
|
[-]
[+]
|
Added |
libxkbcommon-0.4.0.tar.xz/test/atom.c
^
|
@@ -0,0 +1,181 @@
+/*
+ * Copyright © 2012 Ran Benita <ran234@gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include <time.h>
+
+#include "test.h"
+#include "atom.h"
+
+#define INTERN_LITERAL(table, literal) \
+ atom_intern(table, literal, sizeof(literal) - 1, false)
+
+#define LOOKUP_LITERAL(table, literal) \
+ atom_lookup(table, literal, sizeof(literal) - 1)
+
+static void
+random_string(char **str_out, size_t *len_out)
+{
+ /* Keep this small, so collisions might happen. */
+ static const char random_chars[] = {
+ 'a', 'b', 'c', 'd', 'e', 'f', 'g'
+ };
+
+ size_t len;
+ char *str;
+
+ len = rand() % 15;
+ str = malloc(len + 1);
+ assert(str);
+
+ for (int i = 0; i < len; i++)
+ str[i] = random_chars[rand() % ARRAY_SIZE(random_chars)];
+ /* Don't always terminate it; should work without. */
+ if (rand() % 2 == 0)
+ str[len] = '\0';
+
+ *str_out = str;
+ *len_out = len;
+}
+
+static void
+test_random_strings(void)
+{
+ struct atom_string {
+ xkb_atom_t atom;
+ char *string;
+ size_t len;
+ };
+
+ struct atom_table *table;
+ struct atom_string *arr;
+ int N;
+ xkb_atom_t atom;
+ const char *string;
+
+ table = atom_table_new();
+ assert(table);
+
+ srand(clock());
+
+ N = 1 + rand() % 1500;
+ arr = calloc(N, sizeof(*arr));
+ assert(arr);
+
+ for (int i = 0; i < N; i++) {
+ random_string(&arr[i].string, &arr[i].len);
+
+ atom = atom_lookup(table, arr[i].string, arr[i].len);
+ if (atom != XKB_ATOM_NONE) {
+ string = atom_text(table, atom);
+ assert(string);
+
+ if (arr[i].len != strlen(string) ||
+ strncmp(string, arr[i].string, arr[i].len) != 0) {
+ fprintf(stderr, "got a collision, but strings don't match!\n");
+ fprintf(stderr, "existing length %lu, string %s\n",
+ strlen(string), string);
+ fprintf(stderr, "new length %lu, string %.*s\n",
+ arr[i].len, (int) arr[i].len, arr[i].string);
+ assert(false);
+ }
+
+ /* OK, got a real collision. */
+ free(arr[i].string);
+ i--;
+ continue;
+ }
+
+ arr[i].atom = atom_intern(table, arr[i].string, arr[i].len, false);
+ if (arr[i].atom == XKB_ATOM_NONE) {
+ fprintf(stderr, "failed to intern! len: %lu, string: %.*s\n",
+ arr[i].len, (int) arr[i].len, arr[i].string);
+ assert(false);
+ }
+ }
+
+ for (int i = 0; i < N; i++) {
+ string = atom_text(table, arr[i].atom);
+ assert(string);
+
+ if (arr[i].len != strlen(string) ||
+ strncmp(string, arr[i].string, arr[i].len) != 0) {
+ fprintf(stderr, "looked-up string doesn't match!\n");
+ fprintf(stderr, "found length %lu, string %s\n",
+ strlen(string), string);
+ fprintf(stderr, "expected length %lu, string %.*s\n",
+ arr[i].len, (int) arr[i].len, arr[i].string);
+
+ /* Since this is random, we need to dump the failing data,
+ * so we might have some chance to reproduce. */
+ fprintf(stderr, "START dump of arr, N=%d\n", N);
+ for (int j = 0; j < N; j++) {
+ fprintf(stderr, "%u\t\t%lu\t\t%.*s\n", arr[i].atom,
+ arr[i].len, (int) arr[i].len, arr[i].string);
+ }
+ fprintf(stderr, "END\n");
+
+ assert(false);
+ }
+ }
+
+ for (int i = 0; i < N; i++)
+ free(arr[i].string);
+ free(arr);
+ atom_table_free(table);
+}
+
+int
+main(void)
+{
+ struct atom_table *table;
+ xkb_atom_t atom1, atom2, atom3;
+
+ table = atom_table_new();
+ assert(table);
+
+ assert(atom_text(table, XKB_ATOM_NONE) == NULL);
+ assert(atom_lookup(table, NULL, 0) == XKB_ATOM_NONE);
+
+ atom1 = INTERN_LITERAL(table, "hello");
+ assert(atom1 != XKB_ATOM_NONE);
+ assert(atom1 == LOOKUP_LITERAL(table, "hello"));
+ assert(streq(atom_text(table, atom1), "hello"));
+
+ atom2 = atom_intern(table, "hello", 3, false);
+ assert(atom2 != XKB_ATOM_NONE);
+ assert(atom1 != atom2);
+ assert(streq(atom_text(table, atom2), "hel"));
+ assert(LOOKUP_LITERAL(table, "hel") == atom2);
+ assert(LOOKUP_LITERAL(table, "hell") == XKB_ATOM_NONE);
+ assert(LOOKUP_LITERAL(table, "hello") == atom1);
+
+ atom3 = atom_intern(table, "", 0, false);
+ assert(atom3 != XKB_ATOM_NONE);
+ assert(LOOKUP_LITERAL(table, "") == atom3);
+
+ atom_table_free(table);
+
+ test_random_strings();
+
+ return 0;
+}
|
[-]
[+]
|
Changed |
libxkbcommon-0.4.0.tar.xz/test/common.c
^
|
@@ -77,7 +77,7 @@
op = va_arg(ap, int);
nsyms = xkb_state_key_get_syms(state, kc, &syms);
- fprintf(stderr, "got %d syms for key 0x%x: [", nsyms, kc);
+ fprintf(stderr, "got %u syms for key 0x%x: [", nsyms, kc);
if (op == DOWN || op == BOTH)
xkb_state_update_key(state, kc, XKB_KEY_DOWN);
@@ -339,3 +339,105 @@
return keymap;
}
+
+void
+test_print_keycode_state(struct xkb_state *state, xkb_keycode_t keycode)
+{
+ struct xkb_keymap *keymap;
+
+ const xkb_keysym_t *syms;
+ int nsyms;
+ char s[16];
+ xkb_layout_index_t layout;
+
+ keymap = xkb_state_get_keymap(state);
+
+ nsyms = xkb_state_key_get_syms(state, keycode, &syms);
+
+ if (nsyms <= 0)
+ return;
+
+ if (nsyms == 1) {
+ xkb_keysym_t sym = xkb_state_key_get_one_sym(state, keycode);
+ xkb_keysym_get_name(sym, s, sizeof(s));
+ printf("keysym [ %-*s ] ", (int) sizeof(s), s);
+ }
+ else {
+ printf("keysyms [ ");
+ for (int i = 0; i < nsyms; i++) {
+ xkb_keysym_get_name(syms[i], s, sizeof(s));
+ printf("%-*s ", (int) sizeof(s), s);
+ }
+ printf("] ");
+ }
+
+ /*
+ * Only do this if wchar_t is UCS-4, so we can be lazy and print
+ * with %lc.
+ */
+#ifdef __STDC_ISO_10646__
+ printf("unicode [ ");
+ for (int i = 0; i < nsyms; i++) {
+ uint32_t unicode = xkb_keysym_to_utf32(syms[i]);
+ printf("%lc ", (int)(unicode ? unicode : L' '));
+ }
+ printf("] ");
+#endif
+
+ layout = xkb_state_key_get_layout(state, keycode);
+ printf("layout [ %s (%d) ] ",
+ xkb_keymap_layout_get_name(keymap, layout), layout);
+
+ printf("level [ %d ] ",
+ xkb_state_key_get_level(state, keycode, layout));
+
+ printf("mods [ ");
+ for (xkb_mod_index_t mod = 0; mod < xkb_keymap_num_mods(keymap); mod++) {
+ if (xkb_state_mod_index_is_active(state, mod,
+ XKB_STATE_MODS_EFFECTIVE) <= 0)
+ continue;
+ if (xkb_state_mod_index_is_consumed(state, keycode, mod))
+ printf("-%s ", xkb_keymap_mod_get_name(keymap, mod));
+ else
+ printf("%s ", xkb_keymap_mod_get_name(keymap, mod));
+ }
+ printf("] ");
+
+ printf("leds [ ");
+ for (xkb_led_index_t led = 0; led < xkb_keymap_num_leds(keymap); led++) {
+ if (xkb_state_led_index_is_active(state, led) <= 0)
+ continue;
+ printf("%s ", xkb_keymap_led_get_name(keymap, led));
+ }
+ printf("] ");
+
+ printf("\n");
+}
+
+void
+test_print_state_changes(enum xkb_state_component changed)
+{
+ if (changed == 0)
+ return;
+
+ printf("changed [ ");
+ if (changed & XKB_STATE_LAYOUT_EFFECTIVE)
+ printf("effective-layout ");
+ if (changed & XKB_STATE_LAYOUT_DEPRESSED)
+ printf("depressed-layout ");
+ if (changed & XKB_STATE_LAYOUT_LATCHED)
+ printf("latched-layout ");
+ if (changed & XKB_STATE_LAYOUT_LOCKED)
+ printf("locked-layout ");
+ if (changed & XKB_STATE_MODS_EFFECTIVE)
+ printf("effective-mods ");
+ if (changed & XKB_STATE_MODS_DEPRESSED)
+ printf("depressed-mods ");
+ if (changed & XKB_STATE_MODS_LATCHED)
+ printf("latched-mods ");
+ if (changed & XKB_STATE_MODS_LOCKED)
+ printf("locked-mods ");
+ if (changed & XKB_STATE_LEDS)
+ printf("leds ");
+ printf("]\n");
+}
|
[-]
[+]
|
Changed |
libxkbcommon-0.4.0.tar.xz/test/data/keymaps/divide-by-zero.xkb
^
|
@@ -1,6 +1,6 @@
xkb_keymap {
xkb_keycodes {
- <ESC> = 1 / 0;
+ <ESC> = 1;
};
xkb_types {
@@ -9,6 +9,10 @@
xkb_compatibility {
virtual_modifiers NumLock;
+ interpret KP_1+AnyOfOrNone(all) {
+ repeat= True;
+ action= MovePtr(x=(1/0),y=+1);
+ };
};
xkb_symbols {
|
[-]
[+]
|
Added |
libxkbcommon-0.4.0.tar.xz/test/interactive-evdev.c
^
|
@@ -0,0 +1,454 @@
+/*
+ * Copyright © 2012 Ran Benita <ran234@gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include <dirent.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <fnmatch.h>
+#include <limits.h>
+#include <locale.h>
+#include <signal.h>
+#include <string.h>
+#include <sysexits.h>
+#include <unistd.h>
+
+#include <sys/epoll.h>
+#include <linux/input.h>
+
+#include "test.h"
+
+struct keyboard {
+ char *path;
+ int fd;
+ struct xkb_state *state;
+ struct keyboard *next;
+};
+
+static bool terminate;
+static int evdev_offset = 8;
+static bool report_state_changes;
+
+#define NLONGS(n) (((n) + LONG_BIT - 1) / LONG_BIT)
+
+static bool
+evdev_bit_is_set(const unsigned long *array, int bit)
+{
+ return !!(array[bit / LONG_BIT] & (1LL << (bit % LONG_BIT)));
+}
+
+/* Some heuristics to see if the device is a keyboard. */
+static bool
+is_keyboard(int fd)
+{
+ int i;
+ unsigned long evbits[NLONGS(EV_CNT)] = { 0 };
+ unsigned long keybits[NLONGS(KEY_CNT)] = { 0 };
+
+ errno = 0;
+ ioctl(fd, EVIOCGBIT(0, sizeof(evbits)), evbits);
+ if (errno)
+ return false;
+
+ if (!evdev_bit_is_set(evbits, EV_KEY))
+ return false;
+
+ errno = 0;
+ ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(keybits)), keybits);
+ if (errno)
+ return false;
+
+ for (i = KEY_RESERVED; i <= KEY_MIN_INTERESTING; i++)
+ if (evdev_bit_is_set(keybits, i))
+ return true;
+
+ return false;
+}
+
+static int
+keyboard_new(struct dirent *ent, struct xkb_keymap *keymap,
+ struct keyboard **out)
+{
+ int ret;
+ char *path;
+ int fd;
+ struct xkb_state *state;
+ struct keyboard *kbd;
+
+ ret = asprintf(&path, "/dev/input/%s", ent->d_name);
+ if (ret < 0)
+ return -ENOMEM;
+
+ fd = open(path, O_NONBLOCK | O_CLOEXEC | O_RDONLY);
+ if (fd < 0) {
+ ret = -errno;
+ goto err_path;
+ }
+
+ if (!is_keyboard(fd)) {
+ /* Dummy "skip this device" value. */
+ ret = -ENOTSUP;
+ goto err_fd;
+ }
+
+ state = xkb_state_new(keymap);
+ if (!state) {
+ fprintf(stderr, "Couldn't create xkb state for %s\n", path);
+ ret = -EFAULT;
+ goto err_fd;
+ }
+
+ kbd = calloc(1, sizeof(*kbd));
+ if (!kbd) {
+ ret = -ENOMEM;
+ goto err_state;
+ }
+
+ kbd->path = path;
+ kbd->fd = fd;
+ kbd->state = state;
+ *out = kbd;
+ return 0;
+
+err_state:
+ xkb_state_unref(state);
+err_fd:
+ close(fd);
+err_path:
+ free(path);
+ return ret;
+}
+
+static void
+keyboard_free(struct keyboard *kbd)
+{
+ if (!kbd)
+ return;
+ if (kbd->fd >= 0)
+ close(kbd->fd);
+ free(kbd->path);
+ xkb_state_unref(kbd->state);
+ free(kbd);
+}
+
+static int
+filter_device_name(const struct dirent *ent)
+{
+ return !fnmatch("event*", ent->d_name, 0);
+}
+
+static struct keyboard *
+get_keyboards(struct xkb_keymap *keymap)
+{
+ int ret, i, nents;
+ struct dirent **ents;
+ struct keyboard *kbds = NULL, *kbd = NULL;
+
+ nents = scandir("/dev/input", &ents, filter_device_name, alphasort);
+ if (nents < 0) {
+ fprintf(stderr, "Couldn't scan /dev/input: %s\n", strerror(errno));
+ return NULL;
+ }
+
+ for (i = 0; i < nents; i++) {
+ ret = keyboard_new(ents[i], keymap, &kbd);
+ if (ret) {
+ if (ret == -EACCES) {
+ fprintf(stderr, "Couldn't open /dev/input/%s: %s. "
+ "You probably need root to run this.\n",
+ ents[i]->d_name, strerror(-ret));
+ break;
+ }
+ if (ret != -ENOTSUP) {
+ fprintf(stderr, "Couldn't open /dev/input/%s: %s. Skipping.\n",
+ ents[i]->d_name, strerror(-ret));
+ }
+ continue;
+ }
+
+ kbd->next = kbds;
+ kbds = kbd;
+ }
+
+ if (!kbds) {
+ fprintf(stderr, "Couldn't find any keyboards I can use! Quitting.\n");
+ goto err;
+ }
+
+err:
+ for (i = 0; i < nents; i++)
+ free(ents[i]);
|
[-]
[+]
|
Added |
libxkbcommon-0.4.0.tar.xz/test/interactive-x11.c
^
|
@@ -0,0 +1,367 @@
+/*
+ * Copyright © 2013 Ran Benita <ran234@gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include <locale.h>
+
+#include "xkbcommon/xkbcommon-x11.h"
+#include "test.h"
+
+#include <xcb/xkb.h>
+
+/*
+ * Note: This program only handles the core keyboard device for now.
+ * It should be straigtforward to change struct keyboard to a list of
+ * keyboards with device IDs, as in test/interactive-evdev.c. This would
+ * require:
+ *
+ * - Initially listing the keyboard devices.
+ * - Listening to device changes.
+ * - Matching events to their devices.
+ *
+ * XKB itself knows about xinput1 devices, and most requests and events are
+ * device-specific.
+ *
+ * In order to list the devices and react to changes, you need xinput1/2.
+ * You also need xinput for the key press/release event, since the core
+ * protocol key press event does not carry a device ID to match on.
+ */
+
+struct keyboard {
+ xcb_connection_t *conn;
+ uint8_t first_xkb_event;
+ struct xkb_context *ctx;
+
+ struct xkb_keymap *keymap;
+ struct xkb_state *state;
+ int32_t device_id;
+};
+
+static bool terminate;
+
+static int
+select_xkb_events_for_device(xcb_connection_t *conn, int32_t device_id)
+{
+ static const xcb_xkb_map_part_t required_map_parts =
+ (XCB_XKB_MAP_PART_KEY_TYPES |
+ XCB_XKB_MAP_PART_KEY_SYMS |
+ XCB_XKB_MAP_PART_MODIFIER_MAP |
+ XCB_XKB_MAP_PART_EXPLICIT_COMPONENTS |
+ XCB_XKB_MAP_PART_KEY_ACTIONS |
+ XCB_XKB_MAP_PART_VIRTUAL_MODS |
+ XCB_XKB_MAP_PART_VIRTUAL_MOD_MAP);
+
+ static const xcb_xkb_event_type_t required_events =
+ (XCB_XKB_EVENT_TYPE_NEW_KEYBOARD_NOTIFY |
+ XCB_XKB_EVENT_TYPE_MAP_NOTIFY |
+ XCB_XKB_EVENT_TYPE_STATE_NOTIFY);
+
+ xcb_void_cookie_t cookie =
+ xcb_xkb_select_events_checked(conn,
+ device_id,
+ required_events,
+ 0,
+ required_events,
+ required_map_parts,
+ required_map_parts,
+ 0);
+
+ xcb_generic_error_t *error = xcb_request_check(conn, cookie);
+ if (error) {
+ free(error);
+ return -1;
+ }
+
+ return 0;
+}
+
+static int
+update_keymap(struct keyboard *kbd)
+{
+ struct xkb_keymap *new_keymap;
+ struct xkb_state *new_state;
+
+ new_keymap = xkb_x11_keymap_new_from_device(kbd->ctx, kbd->conn,
+ kbd->device_id, 0);
+ if (!new_keymap)
+ goto err_out;
+
+ new_state = xkb_x11_state_new_from_device(new_keymap, kbd->conn,
+ kbd->device_id);
+ if (!new_state)
+ goto err_keymap;
+
+ if (kbd->keymap)
+ printf("Keymap updated!\n");
+
+ xkb_state_unref(kbd->state);
+ xkb_keymap_unref(kbd->keymap);
+ kbd->keymap = new_keymap;
+ kbd->state = new_state;
+ return 0;
+
+err_keymap:
+ xkb_keymap_unref(new_keymap);
+err_out:
+ return -1;
+}
+
+static int
+init_kbd(struct keyboard *kbd, xcb_connection_t *conn, uint8_t first_xkb_event,
+ int32_t device_id, struct xkb_context *ctx)
+{
+ int ret;
+
+ kbd->conn = conn;
+ kbd->first_xkb_event = first_xkb_event;
+ kbd->ctx = ctx;
+ kbd->keymap = NULL;
+ kbd->state = NULL;
+ kbd->device_id = device_id;
+
+ ret = update_keymap(kbd);
+ if (ret)
+ goto err_out;
+
+ ret = select_xkb_events_for_device(conn, device_id);
+ if (ret)
+ goto err_state;
+
+ return 0;
+
+err_state:
+ xkb_state_unref(kbd->state);
+ xkb_keymap_unref(kbd->keymap);
+err_out:
+ return -1;
+}
+
+static void
+deinit_kbd(struct keyboard *kbd)
+{
+ xkb_state_unref(kbd->state);
+ xkb_keymap_unref(kbd->keymap);
+}
+
+static void
+process_xkb_event(xcb_generic_event_t *gevent, struct keyboard *kbd)
+{
+ union xkb_event {
+ struct {
+ uint8_t response_type;
+ uint8_t xkbType;
+ uint16_t sequence;
+ xcb_timestamp_t time;
+ uint8_t deviceID;
+ } any;
+ xcb_xkb_new_keyboard_notify_event_t new_keyboard_notify;
+ xcb_xkb_map_notify_event_t map_notify;
+ xcb_xkb_state_notify_event_t state_notify;
+ } *event = (union xkb_event *) gevent;
+
+ if (event->any.deviceID != kbd->device_id)
+ return;
+
+ /*
+ * XkbNewKkdNotify and XkbMapNotify together capture all sorts of keymap
+ * updates (e.g. xmodmap, xkbcomp, setxkbmap), with minimal redundent
+ * recompilations.
+ */
+ switch (event->any.xkbType) {
+ case XCB_XKB_NEW_KEYBOARD_NOTIFY:
+ if (event->new_keyboard_notify.changed & XCB_XKB_NKN_DETAIL_KEYCODES)
+ update_keymap(kbd);
+ break;
+
+ case XCB_XKB_MAP_NOTIFY:
+ update_keymap(kbd);
+ break;
+
+ case XCB_XKB_STATE_NOTIFY:
|
[-]
[+]
|
Changed |
libxkbcommon-0.4.0.tar.xz/test/state.c
^
|
@@ -132,26 +132,31 @@
XKB_MOD_NAME_ALT,
NULL) > 0);
assert(xkb_state_mod_indices_are_active(state, XKB_STATE_MODS_DEPRESSED,
+ XKB_STATE_MATCH_ALL,
+ xkb_keymap_mod_get_index(keymap, XKB_MOD_NAME_CTRL),
+ xkb_keymap_mod_get_index(keymap, XKB_MOD_NAME_ALT),
+ XKB_MOD_INVALID) > 0);
+ assert(xkb_state_mod_names_are_active(state, XKB_STATE_MODS_DEPRESSED,
XKB_STATE_MATCH_ALL,
- xkb_keymap_mod_get_index(keymap, XKB_MOD_NAME_CTRL),
- xkb_keymap_mod_get_index(keymap, XKB_MOD_NAME_ALT),
- XKB_MOD_INVALID) > 0);
- assert(!xkb_state_mod_names_are_active(state, XKB_STATE_MODS_DEPRESSED,
- XKB_STATE_MATCH_ALL,
- XKB_MOD_NAME_ALT,
- NULL) > 0);
+ XKB_MOD_NAME_ALT,
+ NULL) == 0);
+ assert(xkb_state_mod_names_are_active(state, XKB_STATE_MODS_DEPRESSED,
+ XKB_STATE_MATCH_ALL |
+ XKB_STATE_MATCH_NON_EXCLUSIVE,
+ XKB_MOD_NAME_ALT,
+ NULL) > 0);
assert(xkb_state_mod_names_are_active(state, XKB_STATE_MODS_DEPRESSED,
(XKB_STATE_MATCH_ANY |
XKB_STATE_MATCH_NON_EXCLUSIVE),
XKB_MOD_NAME_ALT,
- NULL));
+ NULL) > 0);
/* RAlt down */
xkb_state_update_key(state, KEY_LEFTCTRL + EVDEV_OFFSET, XKB_KEY_UP);
fprintf(stderr, "dumping state for RAlt down:\n");
print_state(state);
- assert(!xkb_state_mod_name_is_active(state, XKB_MOD_NAME_CTRL,
- XKB_STATE_MODS_EFFECTIVE) > 0);
+ assert(xkb_state_mod_name_is_active(state, XKB_MOD_NAME_CTRL,
+ XKB_STATE_MODS_EFFECTIVE) == 0);
assert(xkb_state_mod_name_is_active(state, XKB_MOD_NAME_ALT,
XKB_STATE_MODS_DEPRESSED) > 0);
assert(xkb_state_mod_names_are_active(state, XKB_STATE_MODS_DEPRESSED,
@@ -167,8 +172,8 @@
/* none down */
xkb_state_update_key(state, KEY_RIGHTALT + EVDEV_OFFSET, XKB_KEY_UP);
- assert(!xkb_state_mod_name_is_active(state, XKB_MOD_NAME_ALT,
- XKB_STATE_MODS_EFFECTIVE));
+ assert(xkb_state_mod_name_is_active(state, XKB_MOD_NAME_ALT,
+ XKB_STATE_MODS_EFFECTIVE) == 0);
/* Caps locked */
xkb_state_update_key(state, KEY_CAPSLOCK + EVDEV_OFFSET, XKB_KEY_DOWN);
@@ -206,7 +211,7 @@
xkb_state_update_key(state, KEY_COMPOSE + EVDEV_OFFSET, XKB_KEY_DOWN);
xkb_state_update_key(state, KEY_COMPOSE + EVDEV_OFFSET, XKB_KEY_UP);
assert(xkb_state_led_name_is_active(state, "Group 2") > 0);
- assert(xkb_state_led_name_is_active(state, XKB_LED_NAME_NUM) <= 0);
+ assert(xkb_state_led_name_is_active(state, XKB_LED_NAME_NUM) == 0);
/* Switch back to group 1. */
xkb_state_update_key(state, KEY_COMPOSE + EVDEV_OFFSET, XKB_KEY_DOWN);
@@ -215,9 +220,9 @@
/* Caps unlocked */
xkb_state_update_key(state, KEY_CAPSLOCK + EVDEV_OFFSET, XKB_KEY_DOWN);
xkb_state_update_key(state, KEY_CAPSLOCK + EVDEV_OFFSET, XKB_KEY_UP);
- assert(!xkb_state_mod_name_is_active(state, XKB_MOD_NAME_CAPS,
- XKB_STATE_MODS_EFFECTIVE) > 0);
- assert(!xkb_state_led_name_is_active(state, XKB_LED_NAME_CAPS) > 0);
+ assert(xkb_state_mod_name_is_active(state, XKB_MOD_NAME_CAPS,
+ XKB_STATE_MODS_EFFECTIVE) == 0);
+ assert(xkb_state_led_name_is_active(state, XKB_LED_NAME_CAPS) == 0);
num_syms = xkb_state_key_get_syms(state, KEY_Q + EVDEV_OFFSET, &syms);
assert(num_syms == 1 && syms[0] == XKB_KEY_q);
@@ -285,8 +290,8 @@
xkb_state_update_mask(state, base_mods, latched_mods, locked_mods,
base_group, latched_group, locked_group);
- assert(xkb_state_mod_index_is_active(state, ctrl, XKB_STATE_MODS_DEPRESSED));
- assert(xkb_state_mod_index_is_active(state, ctrl, XKB_STATE_MODS_EFFECTIVE));
+ assert(xkb_state_mod_index_is_active(state, ctrl, XKB_STATE_MODS_DEPRESSED) > 0);
+ assert(xkb_state_mod_index_is_active(state, ctrl, XKB_STATE_MODS_EFFECTIVE) > 0);
xkb_state_unref(state);
}
|
[-]
[+]
|
Changed |
libxkbcommon-0.4.0.tar.xz/test/test.h
^
|
@@ -30,6 +30,9 @@
#include "xkbcommon/xkbcommon.h"
#include "utils.h"
+/* Automake test exit code to signify SKIP (à la PASS, FAIL, etc). */
+#define SKIP_TEST 77
+
/* The offset between KEY_* numbering, and keycodes in the XKB evdev
* dataset. */
#define EVDEV_OFFSET 8
@@ -76,3 +79,9 @@
test_compile_rules(struct xkb_context *context, const char *rules,
const char *model, const char *layout, const char *variant,
const char *options);
+
+void
+test_print_keycode_state(struct xkb_state *state, xkb_keycode_t keycode);
+
+void
+test_print_state_changes(enum xkb_state_component changed);
|
[-]
[+]
|
Added |
libxkbcommon-0.4.0.tar.xz/test/x11.c
^
|
@@ -0,0 +1,78 @@
+/*
+ * Copyright © 2013 Ran Benita <ran234@gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include "test.h"
+#include "xkbcommon/xkbcommon-x11.h"
+
+int
+main(void)
+{
+ struct xkb_context *ctx = test_get_context(0);
+ xcb_connection_t *conn;
+ int ret;
+ int32_t device_id;
+ struct xkb_keymap *keymap;
+ struct xkb_state *state;
+ char *dump;
+
+ /*
+ * The next two steps depend on a running X server with XKB support.
+ * If it fails, it's not necessarily an actual problem with the code.
+ * So we don't want a FAIL here.
+ */
+ conn = xcb_connect(NULL, NULL);
+ if (!conn || xcb_connection_has_error(conn))
+ return SKIP_TEST;
+
+ ret = xkb_x11_setup_xkb_extension(conn,
+ XKB_X11_MIN_MAJOR_XKB_VERSION,
+ XKB_X11_MIN_MINOR_XKB_VERSION,
+ XKB_X11_SETUP_XKB_EXTENSION_NO_FLAGS,
+ NULL, NULL, NULL, NULL);
+ if (!ret)
+ return SKIP_TEST;
+
+ device_id = xkb_x11_get_core_keyboard_device_id(conn);
+ assert(device_id != -1);
+
+ keymap = xkb_x11_keymap_new_from_device(ctx, conn, device_id,
+ XKB_MAP_COMPILE_NO_FLAGS);
+ assert(keymap);
+
+ state = xkb_x11_state_new_from_device(keymap, conn, device_id);
+ assert(state);
+
+ dump = xkb_keymap_get_as_string(keymap, XKB_KEYMAP_USE_ORIGINAL_FORMAT);
+ assert(dump);
+ fputs(dump, stdout);
+
+ /* TODO: Write some X11-specific tests. */
+
+ free(dump);
+ xkb_state_unref(state);
+ xkb_keymap_unref(keymap);
+ xcb_disconnect(conn);
+ xkb_context_unref(ctx);
+
+ return 0;
+}
|
[-]
[+]
|
Added |
libxkbcommon-0.4.0.tar.xz/xkbcommon-x11-uninstalled.pc.in
^
|
@@ -0,0 +1,10 @@
+libdir=@abs_top_builddir@/.libs
+includedir=@abs_top_srcdir@
+
+Name: xkbcommon-x11
+Description: XKB API common to servers and clients - X11 support (uninstalled)
+Version: @PACKAGE_VERSION@
+Requires: xkbcommon
+Requires.private: xcb xcb-xkb
+Cflags: -I${includedir}
+Libs: -L${libdir} -lxkbcommon-x11
|
[-]
[+]
|
Added |
libxkbcommon-0.4.0.tar.xz/xkbcommon-x11.pc.in
^
|
@@ -0,0 +1,12 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: xkbcommon-x11
+Description: XKB API common to servers and clients - X11 support
+Version: @PACKAGE_VERSION@
+Requires: xkbcommon
+Requires.private: xcb xcb-xkb
+Cflags: -I${includedir}
+Libs: -L${libdir} -lxkbcommon-x11
|
[-]
[+]
|
Changed |
libxkbcommon-0.4.0.tar.xz/xkbcommon/xkbcommon-keysyms.h
^
|
@@ -418,6 +418,12 @@
#define XKB_KEY_dead_belowcomma 0xfe6e
#define XKB_KEY_dead_currency 0xfe6f
+/* extra dead elements for German T3 layout */
+#define XKB_KEY_dead_lowline 0xfe90
+#define XKB_KEY_dead_aboveverticalline 0xfe91
+#define XKB_KEY_dead_belowverticalline 0xfe92
+#define XKB_KEY_dead_longsolidusoverlay 0xfe93
+
/* dead vowels for universal syllable entry */
#define XKB_KEY_dead_a 0xfe80
#define XKB_KEY_dead_A 0xfe81
|
[-]
[+]
|
Changed |
libxkbcommon-0.4.0.tar.xz/xkbcommon/xkbcommon-names.h
^
|
@@ -35,6 +35,7 @@
#define XKB_MOD_NAME_CAPS "Lock"
#define XKB_MOD_NAME_CTRL "Control"
#define XKB_MOD_NAME_ALT "Mod1"
+#define XKB_MOD_NAME_NUM "Mod2"
#define XKB_MOD_NAME_LOGO "Mod4"
#define XKB_LED_NAME_CAPS "Caps Lock"
|
[-]
[+]
|
Added |
libxkbcommon-0.4.0.tar.xz/xkbcommon/xkbcommon-x11.h
^
|
@@ -0,0 +1,166 @@
+/*
+ * Copyright © 2013 Ran Benita
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef _XKBCOMMON_X11_H
+#define _XKBCOMMON_X11_H
+
+#include <xcb/xcb.h>
+#include <xkbcommon/xkbcommon.h>
+
+/**
+ * @file
+ * libxkbcommon-x11 API - Additional X11 support for xkbcommon.
+ */
+
+/**
+ * @defgroup x11 X11 support
+ * Additional X11 support for xkbcommon.
+ *
+ * @{
+ */
+
+/**
+ * The minimal compatible major version of the XKB X11 extension which
+ * this library can use.
+ */
+#define XKB_X11_MIN_MAJOR_XKB_VERSION 1
+/**
+ * The minimal compatible minor version of the XKB X11 extension which
+ * this library can use (for the minimal major version).
+ */
+#define XKB_X11_MIN_MINOR_XKB_VERSION 0
+
+/** Flags for the xkb_x11_setup_xkb_extension() function. */
+enum xkb_x11_setup_xkb_extension_flags {
+ /** Do not apply any flags. */
+ XKB_X11_SETUP_XKB_EXTENSION_NO_FLAGS = 0
+};
+
+/**
+ * Setup the XKB X11 extension for this X client.
+ *
+ * The xkbcommon-x11 library uses various XKB requests. Before doing so,
+ * an X client must notify the server that it will be using the extension.
+ * This function (or an XCB equivalent) must be called before any other
+ * function in this library is used.
+ *
+ * Some X servers may not support or disable the XKB extension. If you
+ * want to support such servers, you need to use a different fallback.
+ *
+ * You may call this function several times; it is idempotent.
+ *
+ * @param connection
+ * An XCB connection to the X server.
+ * @param major_xkb_version, minor_xkb_version
+ * The XKB extension version to request. To operate correctly, you
+ * must have (major_xkb_version, minor_xkb_version) >=
+ * (XKB_X11_MIN_MAJOR_XKB_VERSION, XKB_X11_MIN_MINOR_XKB_VERSION),
+ * though this is not enforced.
+ * @param flags
+ * Optional flags, or 0.
+ * @param[out] major_xkb_version_out, minor_xkb_version_out
+ * Backfilled with the compatible XKB extension version numbers picked
+ * by the server. Can be NULL.
+ * @param[out] base_event_out
+ * Backfilled with the XKB base (also known as first) event code, needed
+ * to distinguish XKB events. Can be NULL.
+ * @param[out] base_error_out
+ * Backfilled with the XKB base (also known as first) error code, needed
+ * to distinguish XKB errors. Can be NULL.
+ *
+ * @returns 1 on success, or 0 on failure.
+ */
+int
+xkb_x11_setup_xkb_extension(xcb_connection_t *connection,
+ uint16_t major_xkb_version,
+ uint16_t minor_xkb_version,
+ enum xkb_x11_setup_xkb_extension_flags flags,
+ uint16_t *major_xkb_version_out,
+ uint16_t *minor_xkb_version_out,
+ uint8_t *base_event_out,
+ uint8_t *base_error_out);
+
+/**
+ * Get the keyboard device ID of the core X11 keyboard.
+ *
+ * @param connection An XCB connection to the X server.
+ *
+ * @returns A device ID which may be used with other xkb_x11_* functions,
+ * or -1 on failure.
+ */
+int32_t
+xkb_x11_get_core_keyboard_device_id(xcb_connection_t *connection);
+
+/**
+ * Create a keymap from an X11 keyboard device.
+ *
+ * This function queries the X server with various requests, fetches the
+ * details of the active keymap on a keyboard device, and creates an
+ * xkb_keymap from these details.
+ *
+ * @param context
+ * The context in which to create the keymap.
+ * @param connection
+ * An XCB connection to the X server.
+ * @param device_id
+ * An XInput 1 device ID (in the range 0-255) with input class KEY.
+ * Passing values outside of this range is an error.
+ * @param flags
+ * Optional flags for the keymap, or 0.
+ *
+ * @returns A keymap retrieved from the X server, or NULL on failure.
+ *
+ * @memberof xkb_keymap
+ */
+struct xkb_keymap *
+xkb_x11_keymap_new_from_device(struct xkb_context *context,
+ xcb_connection_t *connection,
+ int32_t device_id,
+ enum xkb_keymap_compile_flags flags);
+
+/**
+ * Create a new keyboard state object from an X11 keyboard device.
+ *
+ * This function is the same as xkb_state_new(), only pre-initialized
+ * with the state of the device at the time this function is called.
+ *
+ * @param keymap
+ * The keymap for which to create the state.
+ * @param connection
+ * An XCB connection to the X server.
+ * @param device_id
+ * An XInput 1 device ID (in the range 0-255) with input class KEY.
+ * Passing values outside of this range is an error.
+ *
+ * @returns A new keyboard state object, or NULL on failure.
+ *
+ * @memberof xkb_state
+ */
+struct xkb_state *
+xkb_x11_state_new_from_device(struct xkb_keymap *keymap,
+ xcb_connection_t *connection,
+ int32_t device_id);
+
+/** @} */
+
+#endif
|
[-]
[+]
|
Added |
libxkbcommon.yaml
^
|
@@ -0,0 +1,26 @@
+Name: libxkbcommon
+Summary: Xorg X11 common xkb library
+Description: xkb Libraries file.
+Version: 0.4.0
+Release: 1
+Group: System/Libraries
+License: MIT
+URL: https://github.com/xkbcommon/libxkbcommon.git
+Sources:
+ - libxkbcommon-%{version}.tar.xz
+PkgConfigBR:
+ - xorg-macros >= 1.16
+PkgBR:
+ - libtool
+ - bison
+Configure: reconfigure
+ConfigOptions:
+ - --with-xkb-config-root=/usr/share/X11/xkb
+ - --disable-x11
+Requires:
+ - xorg-x11-filesystem
+SubPackages:
+ - Name: devel
+ Summary: Xorg X11 common xkb libray
+ Description: xkb Development Libraries file.
+ Group: Development/Libraries
|