mirror of
https://github.com/openharmony/third_party_libevdev.git
synced 2026-07-18 09:14:46 -04:00
-910
@@ -1,910 +0,0 @@
|
||||
# Makefile.in generated by automake 1.16.2 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2020 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 = { \
|
||||
if test -z '$(MAKELEVEL)'; then \
|
||||
false; \
|
||||
elif test -n '$(MAKE_HOST)'; then \
|
||||
true; \
|
||||
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
|
||||
true; \
|
||||
else \
|
||||
false; \
|
||||
fi; \
|
||||
}
|
||||
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@
|
||||
subdir = .
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/attributes.m4 \
|
||||
$(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)
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
|
||||
$(am__configure_deps) $(am__DIST_COMMON)
|
||||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||
configure.lineno config.status.lineno
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = config.h
|
||||
CONFIG_CLEAN_FILES = libevdev.pc
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
|
||||
ctags-recursive dvi-recursive html-recursive info-recursive \
|
||||
install-data-recursive install-dvi-recursive \
|
||||
install-exec-recursive install-html-recursive \
|
||||
install-info-recursive install-pdf-recursive \
|
||||
install-ps-recursive install-recursive installcheck-recursive \
|
||||
installdirs-recursive pdf-recursive ps-recursive \
|
||||
tags-recursive uninstall-recursive
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
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)$(pkgconfigdir)"
|
||||
DATA = $(pkgconfig_DATA)
|
||||
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
|
||||
distclean-recursive maintainer-clean-recursive
|
||||
am__recursive_targets = \
|
||||
$(RECURSIVE_TARGETS) \
|
||||
$(RECURSIVE_CLEAN_TARGETS) \
|
||||
$(am__extra_recursive_targets)
|
||||
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
|
||||
cscope distdir distdir-am dist dist-all distcheck
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \
|
||||
config.h.in
|
||||
# Read a list of newline-separated strings from the standard input,
|
||||
# and print each of them once, without duplicates. Input order is
|
||||
# *not* preserved.
|
||||
am__uniquify_input = $(AWK) '\
|
||||
BEGIN { nonempty = 0; } \
|
||||
{ items[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in items) print i; }; } \
|
||||
'
|
||||
# Make sure the list of sources is unique. This is necessary because,
|
||||
# e.g., the same source file might be shared among _SOURCES variables
|
||||
# for different programs/libraries.
|
||||
am__define_uniq_tagged_files = \
|
||||
list='$(am__tagged_files)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | $(am__uniquify_input)`
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
CSCOPE = cscope
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
|
||||
$(srcdir)/libevdev.pc.in $(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 COPYING build-aux/compile \
|
||||
build-aux/config.guess build-aux/config.sub \
|
||||
build-aux/install-sh build-aux/ltmain.sh build-aux/missing
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
top_distdir = $(distdir)
|
||||
am__remove_distdir = \
|
||||
if test -d "$(distdir)"; then \
|
||||
find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
|
||||
&& rm -rf "$(distdir)" \
|
||||
|| { sleep 5 && rm -rf "$(distdir)"; }; \
|
||||
else :; fi
|
||||
am__post_remove_distdir = $(am__remove_distdir)
|
||||
am__relativize = \
|
||||
dir0=`pwd`; \
|
||||
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
|
||||
sed_rest='s,^[^/]*/*,,'; \
|
||||
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
|
||||
sed_butlast='s,/*[^/]*$$,,'; \
|
||||
while test -n "$$dir1"; do \
|
||||
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
|
||||
if test "$$first" != "."; then \
|
||||
if test "$$first" = ".."; then \
|
||||
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
|
||||
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
|
||||
else \
|
||||
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
|
||||
if test "$$first2" = "$$first"; then \
|
||||
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
|
||||
else \
|
||||
dir2="../$$dir2"; \
|
||||
fi; \
|
||||
dir0="$$dir0"/"$$first"; \
|
||||
fi; \
|
||||
fi; \
|
||||
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
|
||||
done; \
|
||||
reldir="$$dir2"
|
||||
GZIP_ENV = --best
|
||||
DIST_ARCHIVES = $(distdir).tar.xz
|
||||
DIST_TARGETS = dist-xz
|
||||
distuninstallcheck_listfiles = find . -type f -print
|
||||
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
|
||||
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
|
||||
distcleancheck_listfiles = find . -type f -print
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CHECK_CFLAGS = @CHECK_CFLAGS@
|
||||
CHECK_LIBS = @CHECK_LIBS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DOXYGEN = @DOXYGEN@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
GCC_CFLAGS = @GCC_CFLAGS@
|
||||
GCOV_CFLAGS = @GCOV_CFLAGS@
|
||||
GCOV_LDFLAGS = @GCOV_LDFLAGS@
|
||||
GNU_LD_FLAGS = @GNU_LD_FLAGS@
|
||||
GREP = @GREP@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBEVDEV_LT_VERSION = @LIBEVDEV_LT_VERSION@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OS = @OS@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||
PYTHON = @PYTHON@
|
||||
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
|
||||
PYTHON_PLATFORM = @PYTHON_PLATFORM@
|
||||
PYTHON_PREFIX = @PYTHON_PREFIX@
|
||||
PYTHON_VERSION = @PYTHON_VERSION@
|
||||
RANLIB = @RANLIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VALGRIND = @VALGRIND@
|
||||
VERSION = @VERSION@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
pkgpyexecdir = @pkgpyexecdir@
|
||||
pkgpythondir = @pkgpythondir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
pyexecdir = @pyexecdir@
|
||||
pythondir = @pythondir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
|
||||
PRINT_DIRECTORY_FLAGS_1 =
|
||||
PRINT_DIRECTORY_FLAGS_0 = --no-print-directory
|
||||
PRINT_DIRECTORY_FLAGS_ = $(PRINT_DIRECTORY_FLAGS_$(AM_DEFAULT_VERBOSITY))
|
||||
AM_MAKEFLAGS = $(PRINT_DIRECTORY_FLAGS_$(V))
|
||||
SUBDIRS = doc libevdev tools test
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = libevdev.pc
|
||||
EXTRA_DIST = libevdev.pc.in meson.build meson_options.txt
|
||||
all: config.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-recursive
|
||||
|
||||
.SUFFIXES:
|
||||
am--refresh: Makefile
|
||||
@:
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
|
||||
$(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
echo ' $(SHELL) ./config.status'; \
|
||||
$(SHELL) ./config.status;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(SHELL) ./config.status --recheck
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
$(am__cd) $(srcdir) && $(AUTOCONF)
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
config.h: stamp-h1
|
||||
@test -f $@ || rm -f stamp-h1
|
||||
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
|
||||
|
||||
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
|
||||
@rm -f stamp-h1
|
||||
cd $(top_builddir) && $(SHELL) ./config.status config.h
|
||||
$(srcdir)/config.h.in: $(am__configure_deps)
|
||||
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
|
||||
rm -f stamp-h1
|
||||
touch $@
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f config.h stamp-h1
|
||||
libevdev.pc: $(top_builddir)/config.status $(srcdir)/libevdev.pc.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
-rm -f libtool config.lt
|
||||
install-pkgconfigDATA: $(pkgconfig_DATA)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
|
||||
if test -n "$$list"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \
|
||||
fi; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
echo "$$d$$p"; \
|
||||
done | $(am__base_list) | \
|
||||
while read files; do \
|
||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \
|
||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \
|
||||
done
|
||||
|
||||
uninstall-pkgconfigDATA:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
|
||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||
dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir)
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run 'make' without going through this Makefile.
|
||||
# To change the values of 'make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in 'config.status', edit 'config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run 'make');
|
||||
# (2) otherwise, pass the desired values on the 'make' command line.
|
||||
$(am__recursive_targets):
|
||||
@fail=; \
|
||||
if $(am__make_keepgoing); then \
|
||||
failcom='fail=yes'; \
|
||||
else \
|
||||
failcom='exit 1'; \
|
||||
fi; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
ID: $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); mkid -fID $$unique
|
||||
tags: tags-recursive
|
||||
TAGS: tags
|
||||
|
||||
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||
include_option=--etags-include; \
|
||||
empty_fix=.; \
|
||||
else \
|
||||
include_option=--include; \
|
||||
empty_fix=; \
|
||||
fi; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test ! -f $$subdir/TAGS || \
|
||||
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
$(am__define_uniq_tagged_files); \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: ctags-recursive
|
||||
|
||||
CTAGS: ctags
|
||||
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
cscope: cscope.files
|
||||
test ! -s cscope.files \
|
||||
|| $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
|
||||
clean-cscope:
|
||||
-rm -f cscope.files
|
||||
cscope.files: clean-cscope cscopelist
|
||||
cscopelist: cscopelist-recursive
|
||||
|
||||
cscopelist-am: $(am__tagged_files)
|
||||
list='$(am__tagged_files)'; \
|
||||
case "$(srcdir)" in \
|
||||
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
|
||||
*) sdir=$(subdir)/$(srcdir) ;; \
|
||||
esac; \
|
||||
for i in $$list; do \
|
||||
if test -f "$$i"; then \
|
||||
echo "$(subdir)/$$i"; \
|
||||
else \
|
||||
echo "$$sdir/$$i"; \
|
||||
fi; \
|
||||
done >> $(top_builddir)/cscope.files
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
|
||||
|
||||
distdir: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
||||
|
||||
distdir-am: $(DISTFILES)
|
||||
$(am__remove_distdir)
|
||||
test -d "$(distdir)" || mkdir "$(distdir)"
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
$(am__make_dryrun) \
|
||||
|| test -d "$(distdir)/$$subdir" \
|
||||
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|
||||
|| exit 1; \
|
||||
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
|
||||
$(am__relativize); \
|
||||
new_distdir=$$reldir; \
|
||||
dir1=$$subdir; dir2="$(top_distdir)"; \
|
||||
$(am__relativize); \
|
||||
new_top_distdir=$$reldir; \
|
||||
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
|
||||
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
|
||||
($(am__cd) $$subdir && \
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$$new_top_distdir" \
|
||||
distdir="$$new_distdir" \
|
||||
am__remove_distdir=: \
|
||||
am__skip_length_check=: \
|
||||
am__skip_mode_fix=: \
|
||||
distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
-test -n "$(am__skip_mode_fix)" \
|
||||
|| find "$(distdir)" -type d ! -perm -755 \
|
||||
-exec chmod u+rwx,go+rx {} \; -o \
|
||||
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|
||||
|| chmod -R a+r "$(distdir)"
|
||||
dist-gzip: distdir
|
||||
tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-bzip2: distdir
|
||||
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-lzip: distdir
|
||||
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
|
||||
$(am__post_remove_distdir)
|
||||
dist-xz: distdir
|
||||
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-zstd: distdir
|
||||
tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-tarZ: distdir
|
||||
@echo WARNING: "Support for distribution archives compressed with" \
|
||||
"legacy program 'compress' is deprecated." >&2
|
||||
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
|
||||
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-shar: distdir
|
||||
@echo WARNING: "Support for shar distribution archives is" \
|
||||
"deprecated." >&2
|
||||
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
|
||||
shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-zip: distdir
|
||||
-rm -f $(distdir).zip
|
||||
zip -rq $(distdir).zip $(distdir)
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist dist-all:
|
||||
$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
# This target untars the dist file and tries a VPATH configuration. Then
|
||||
# it guarantees that the distribution is self-contained by making another
|
||||
# tarfile.
|
||||
distcheck: dist
|
||||
case '$(DIST_ARCHIVES)' in \
|
||||
*.tar.gz*) \
|
||||
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
|
||||
*.tar.bz2*) \
|
||||
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
|
||||
*.tar.lz*) \
|
||||
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
|
||||
*.tar.xz*) \
|
||||
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
|
||||
*.tar.Z*) \
|
||||
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
|
||||
*.shar.gz*) \
|
||||
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
|
||||
*.zip*) \
|
||||
unzip $(distdir).zip ;;\
|
||||
*.tar.zst*) \
|
||||
zstd -dc $(distdir).tar.zst | $(am__untar) ;;\
|
||||
esac
|
||||
chmod -R a-w $(distdir)
|
||||
chmod u+w $(distdir)
|
||||
mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
|
||||
chmod a-w $(distdir)
|
||||
test -d $(distdir)/_build || exit 0; \
|
||||
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
|
||||
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
|
||||
&& am__cwd=`pwd` \
|
||||
&& $(am__cd) $(distdir)/_build/sub \
|
||||
&& ../../configure \
|
||||
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
|
||||
$(DISTCHECK_CONFIGURE_FLAGS) \
|
||||
--srcdir=../.. --prefix="$$dc_install_base" \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
|
||||
distuninstallcheck \
|
||||
&& chmod -R a-w "$$dc_install_base" \
|
||||
&& ({ \
|
||||
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
|
||||
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
|
||||
} || { rm -rf "$$dc_destdir"; exit 1; }) \
|
||||
&& rm -rf "$$dc_destdir" \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dist \
|
||||
&& rm -rf $(DIST_ARCHIVES) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
|
||||
&& cd "$$am__cwd" \
|
||||
|| exit 1
|
||||
$(am__post_remove_distdir)
|
||||
@(echo "$(distdir) archives ready for distribution: "; \
|
||||
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
|
||||
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
|
||||
distuninstallcheck:
|
||||
@test -n '$(distuninstallcheck_dir)' || { \
|
||||
echo 'ERROR: trying to run $@ with an empty' \
|
||||
'$$(distuninstallcheck_dir)' >&2; \
|
||||
exit 1; \
|
||||
}; \
|
||||
$(am__cd) '$(distuninstallcheck_dir)' || { \
|
||||
echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
|
||||
exit 1; \
|
||||
}; \
|
||||
test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
|
||||
|| { echo "ERROR: files left after uninstall:" ; \
|
||||
if test -n "$(DESTDIR)"; then \
|
||||
echo " (check DESTDIR support)"; \
|
||||
fi ; \
|
||||
$(distuninstallcheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
distcleancheck: distclean
|
||||
@if test '$(srcdir)' = . ; then \
|
||||
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
|
||||
exit 1 ; \
|
||||
fi
|
||||
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|
||||
|| { echo "ERROR: files left in build directory after distclean:" ; \
|
||||
$(distcleancheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
all-am: Makefile $(DATA) config.h
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
for dir in "$(DESTDIR)$(pkgconfigdir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-recursive
|
||||
install-exec: install-exec-recursive
|
||||
install-data: install-data-recursive
|
||||
uninstall: uninstall-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-recursive
|
||||
install-strip:
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-recursive
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic distclean-hdr \
|
||||
distclean-libtool distclean-tags
|
||||
|
||||
dvi: dvi-recursive
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-recursive
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-recursive
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-pkgconfigDATA
|
||||
|
||||
install-dvi: install-dvi-recursive
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-recursive
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-recursive
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-recursive
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-recursive
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -rf $(top_srcdir)/autom4te.cache
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-recursive
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-recursive
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-recursive
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-pkgconfigDATA
|
||||
|
||||
.MAKE: $(am__recursive_targets) all install-am install-strip
|
||||
|
||||
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
|
||||
am--refresh check check-am clean clean-cscope clean-generic \
|
||||
clean-libtool cscope cscopelist-am ctags ctags-am dist \
|
||||
dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \
|
||||
dist-xz dist-zip dist-zstd distcheck distclean \
|
||||
distclean-generic distclean-hdr distclean-libtool \
|
||||
distclean-tags distcleancheck distdir distuninstallcheck dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-data install-data-am install-dvi install-dvi-am \
|
||||
install-exec install-exec-am install-html install-html-am \
|
||||
install-info install-info-am install-man install-pdf \
|
||||
install-pdf-am install-pkgconfigDATA install-ps install-ps-am \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
installdirs-am maintainer-clean maintainer-clean-generic \
|
||||
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
|
||||
ps ps-am tags tags-am uninstall uninstall-am \
|
||||
uninstall-pkgconfigDATA
|
||||
|
||||
.PRECIOUS: Makefile
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
@@ -69,6 +69,16 @@ Note:If the text contains special characters, please escape them according to th
|
||||
<filteritem type="filename" name="README.OpenSource"/>
|
||||
<filteritem type="filename" name="README"/>
|
||||
<filteritem type="filename" name="COPYING" desc="未使用"/>
|
||||
<filteritem type="filename" name="libevdev/libevdev.c" desc="该文件使用的是MIT协议"/>
|
||||
<filteritem type="filename" name="libevdev/libevdev.h" desc="该文件使用的是MIT协议"/>
|
||||
<filteritem type="filename" name="libevdev/libevdev.sym" desc="该文件使用的是MIT协议"/>
|
||||
<filteritem type="filename" name="libevdev/libevdev-int.h" desc="该文件使用的是MIT协议"/>
|
||||
<filteritem type="filename" name="export_include/libevdev/libevdev.h" desc="该文件使用的是MIT协议"/>
|
||||
<filteritem type="filename" name="libevdev/libevdev-names.c" desc="该文件使用的是MIT协议"/>
|
||||
<filteritem type="filename" name="libevdev/libevdev-uinput-int.h" desc="该文件使用的是MIT协议"/>
|
||||
<filteritem type="filename" name="libevdev/libevdev-uinput.c" desc="该文件使用的是MIT协议"/>
|
||||
<filteritem type="filename" name="libevdev/libevdev-uinput.h" desc="该文件使用的是MIT协议"/>
|
||||
<filteritem type="filename" name="libevdev/libevdev-util.h" desc="该文件使用的是MIT协议"/>
|
||||
<filteritem type="filepath" name="build-aux/.*" desc="未使用"/>
|
||||
<filteritem type="filepath" name="doc/.*" desc="未使用"/>
|
||||
<filteritem type="filepath" name="m4/.*" desc="未使用"/>
|
||||
|
||||
-584
@@ -1,584 +0,0 @@
|
||||
# Makefile.in generated by automake 1.16.2 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2020 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 = { \
|
||||
if test -z '$(MAKELEVEL)'; then \
|
||||
false; \
|
||||
elif test -n '$(MAKE_HOST)'; then \
|
||||
true; \
|
||||
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
|
||||
true; \
|
||||
else \
|
||||
false; \
|
||||
fi; \
|
||||
}
|
||||
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@
|
||||
subdir = doc
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/attributes.m4 \
|
||||
$(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)
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES = libevdev.doxygen libevdev.man
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
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; }; \
|
||||
}
|
||||
man3dir = $(mandir)/man3
|
||||
am__installdirs = "$(DESTDIR)$(man3dir)"
|
||||
NROFF = nroff
|
||||
MANS = $(man3_MANS)
|
||||
DATA = $(noinst_DATA)
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
||||
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/libevdev.doxygen.in \
|
||||
$(srcdir)/libevdev.man.in
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CHECK_CFLAGS = @CHECK_CFLAGS@
|
||||
CHECK_LIBS = @CHECK_LIBS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DOXYGEN = @DOXYGEN@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
GCC_CFLAGS = @GCC_CFLAGS@
|
||||
GCOV_CFLAGS = @GCOV_CFLAGS@
|
||||
GCOV_LDFLAGS = @GCOV_LDFLAGS@
|
||||
GNU_LD_FLAGS = @GNU_LD_FLAGS@
|
||||
GREP = @GREP@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBEVDEV_LT_VERSION = @LIBEVDEV_LT_VERSION@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OS = @OS@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||
PYTHON = @PYTHON@
|
||||
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
|
||||
PYTHON_PLATFORM = @PYTHON_PLATFORM@
|
||||
PYTHON_PREFIX = @PYTHON_PREFIX@
|
||||
PYTHON_VERSION = @PYTHON_VERSION@
|
||||
RANLIB = @RANLIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VALGRIND = @VALGRIND@
|
||||
VERSION = @VERSION@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
pkgpyexecdir = @pkgpyexecdir@
|
||||
pkgpythondir = @pkgpythondir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
pyexecdir = @pyexecdir@
|
||||
pythondir = @pythondir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
man3_MANS = libevdev.man
|
||||
@HAVE_DOXYGEN_TRUE@noinst_DATA = html/index.html
|
||||
@HAVE_DOXYGEN_TRUE@header_files = \
|
||||
@HAVE_DOXYGEN_TRUE@ $(top_srcdir)/libevdev/libevdev.h \
|
||||
@HAVE_DOXYGEN_TRUE@ $(top_srcdir)/libevdev/libevdev-uinput.h
|
||||
|
||||
@HAVE_DOXYGEN_TRUE@doc_src = $(shell find html -type f -printf "html/%P\n" 2>/dev/null)
|
||||
@HAVE_DOXYGEN_TRUE@style_src = \
|
||||
@HAVE_DOXYGEN_TRUE@ style/bootstrap.css \
|
||||
@HAVE_DOXYGEN_TRUE@ style/customdoxygen.css \
|
||||
@HAVE_DOXYGEN_TRUE@ style/doxy-boot.js \
|
||||
@HAVE_DOXYGEN_TRUE@ style/dynsections.js \
|
||||
@HAVE_DOXYGEN_TRUE@ style/footer.html \
|
||||
@HAVE_DOXYGEN_TRUE@ style/header.html \
|
||||
@HAVE_DOXYGEN_TRUE@ style/layout.xml \
|
||||
@HAVE_DOXYGEN_TRUE@ style/libevdevdoxygen.css \
|
||||
@HAVE_DOXYGEN_TRUE@ style/LICENSE \
|
||||
@HAVE_DOXYGEN_TRUE@ style/README.md \
|
||||
@HAVE_DOXYGEN_TRUE@ style/style.css
|
||||
|
||||
@HAVE_DOXYGEN_TRUE@EXTRA_DIST = html/index.html $(doc_src) $(style_src)
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign doc/Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
libevdev.doxygen: $(top_builddir)/config.status $(srcdir)/libevdev.doxygen.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
libevdev.man: $(top_builddir)/config.status $(srcdir)/libevdev.man.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
install-man3: $(man3_MANS)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list1='$(man3_MANS)'; \
|
||||
list2=''; \
|
||||
test -n "$(man3dir)" \
|
||||
&& test -n "`echo $$list1$$list2`" \
|
||||
|| exit 0; \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(man3dir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(man3dir)" || exit 1; \
|
||||
{ for i in $$list1; do echo "$$i"; done; \
|
||||
if test -n "$$list2"; then \
|
||||
for i in $$list2; do echo "$$i"; done \
|
||||
| sed -n '/\.3[a-z]*$$/p'; \
|
||||
fi; \
|
||||
} | while read p; do \
|
||||
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
|
||||
echo "$$d$$p"; echo "$$p"; \
|
||||
done | \
|
||||
sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \
|
||||
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
|
||||
sed 'N;N;s,\n, ,g' | { \
|
||||
list=; while read file base inst; do \
|
||||
if test "$$base" = "$$inst"; then list="$$list $$file"; else \
|
||||
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \
|
||||
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst" || exit $$?; \
|
||||
fi; \
|
||||
done; \
|
||||
for i in $$list; do echo "$$i"; done | $(am__base_list) | \
|
||||
while read files; do \
|
||||
test -z "$$files" || { \
|
||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man3dir)'"; \
|
||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(man3dir)" || exit $$?; }; \
|
||||
done; }
|
||||
|
||||
uninstall-man3:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(man3_MANS)'; test -n "$(man3dir)" || exit 0; \
|
||||
files=`{ for i in $$list; do echo "$$i"; done; \
|
||||
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \
|
||||
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
|
||||
dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir)
|
||||
tags TAGS:
|
||||
|
||||
ctags CTAGS:
|
||||
|
||||
cscope cscopelist:
|
||||
|
||||
|
||||
distdir: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
||||
|
||||
distdir-am: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$(top_distdir)" distdir="$(distdir)" \
|
||||
dist-hook
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(MANS) $(DATA)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(man3dir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
@HAVE_DOXYGEN_FALSE@clean-local:
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool clean-local mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-man
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man: install-man3
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-man
|
||||
|
||||
uninstall-man: uninstall-man3
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
|
||||
clean-local cscopelist-am ctags-am dist-hook distclean \
|
||||
distclean-generic distclean-libtool distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am install-info \
|
||||
install-info-am install-man install-man3 install-pdf \
|
||||
install-pdf-am install-ps install-ps-am install-strip \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
||||
mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
|
||||
uninstall-am uninstall-man uninstall-man3
|
||||
|
||||
.PRECIOUS: Makefile
|
||||
|
||||
|
||||
@HAVE_DOXYGEN_TRUE@html/index.html: libevdev.doxygen style/libevdevdoxygen.css $(header_files)
|
||||
@HAVE_DOXYGEN_TRUE@ $(AM_V_GEN)$(DOXYGEN) $<
|
||||
|
||||
@HAVE_DOXYGEN_TRUE@clean-local:
|
||||
@HAVE_DOXYGEN_TRUE@ $(AM_V_at)rm -rf html
|
||||
|
||||
# make sure doc was built before running dist
|
||||
dist-hook:
|
||||
@test -f $(distdir)/html/index.html || (\
|
||||
echo "******************************************************" && \
|
||||
echo "Couldn't find documentation files, refusing make dist." && \
|
||||
echo "Install doxygen to build documentation for tarball." && \
|
||||
echo "******************************************************" && \
|
||||
test )
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
@@ -1,749 +0,0 @@
|
||||
# Makefile.in generated by automake 1.16.2 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2020 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 = { \
|
||||
if test -z '$(MAKELEVEL)'; then \
|
||||
false; \
|
||||
elif test -n '$(MAKE_HOST)'; then \
|
||||
true; \
|
||||
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
|
||||
true; \
|
||||
else \
|
||||
false; \
|
||||
fi; \
|
||||
}
|
||||
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@
|
||||
@GCOV_ENABLED_TRUE@am__append_1 = *.gcno
|
||||
subdir = libevdev
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/attributes.m4 \
|
||||
$(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)
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(libevdevinclude_HEADERS) \
|
||||
$(am__DIST_COMMON)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
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)$(libevdevincludedir)"
|
||||
LTLIBRARIES = $(lib_LTLIBRARIES)
|
||||
libevdev_la_LIBADD =
|
||||
am_libevdev_la_OBJECTS = libevdev-uinput.lo libevdev.lo \
|
||||
libevdev-names.lo
|
||||
libevdev_la_OBJECTS = $(am_libevdev_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 =
|
||||
libevdev_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(libevdev_la_LDFLAGS) $(LDFLAGS) -o $@
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
|
||||
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
|
||||
am__maybe_remake_depfiles = depfiles
|
||||
am__depfiles_remade = ./$(DEPDIR)/libevdev-names.Plo \
|
||||
./$(DEPDIR)/libevdev-uinput.Plo ./$(DEPDIR)/libevdev.Plo
|
||||
am__mv = mv -f
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
|
||||
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
||||
$(AM_CFLAGS) $(CFLAGS)
|
||||
AM_V_CC = $(am__v_CC_@AM_V@)
|
||||
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
|
||||
am__v_CC_0 = @echo " CC " $@;
|
||||
am__v_CC_1 =
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
|
||||
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
|
||||
am__v_CCLD_0 = @echo " CCLD " $@;
|
||||
am__v_CCLD_1 =
|
||||
SOURCES = $(libevdev_la_SOURCES)
|
||||
DIST_SOURCES = $(libevdev_la_SOURCES)
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
HEADERS = $(libevdevinclude_HEADERS)
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
||||
# Read a list of newline-separated strings from the standard input,
|
||||
# and print each of them once, without duplicates. Input order is
|
||||
# *not* preserved.
|
||||
am__uniquify_input = $(AWK) '\
|
||||
BEGIN { nonempty = 0; } \
|
||||
{ items[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in items) print i; }; } \
|
||||
'
|
||||
# Make sure the list of sources is unique. This is necessary because,
|
||||
# e.g., the same source file might be shared among _SOURCES variables
|
||||
# for different programs/libraries.
|
||||
am__define_uniq_tagged_files = \
|
||||
list='$(am__tagged_files)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | $(am__uniquify_input)`
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
am__DIST_COMMON = $(srcdir)/Makefile.in \
|
||||
$(top_srcdir)/build-aux/depcomp
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CHECK_CFLAGS = @CHECK_CFLAGS@
|
||||
CHECK_LIBS = @CHECK_LIBS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DOXYGEN = @DOXYGEN@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
GCC_CFLAGS = @GCC_CFLAGS@
|
||||
GCOV_CFLAGS = @GCOV_CFLAGS@
|
||||
GCOV_LDFLAGS = @GCOV_LDFLAGS@
|
||||
GNU_LD_FLAGS = @GNU_LD_FLAGS@
|
||||
GREP = @GREP@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBEVDEV_LT_VERSION = @LIBEVDEV_LT_VERSION@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OS = @OS@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||
PYTHON = @PYTHON@
|
||||
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
|
||||
PYTHON_PLATFORM = @PYTHON_PLATFORM@
|
||||
PYTHON_PREFIX = @PYTHON_PREFIX@
|
||||
PYTHON_VERSION = @PYTHON_VERSION@
|
||||
RANLIB = @RANLIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VALGRIND = @VALGRIND@
|
||||
VERSION = @VERSION@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
pkgpyexecdir = @pkgpyexecdir@
|
||||
pkgpythondir = @pkgpythondir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
pyexecdir = @pyexecdir@
|
||||
pythondir = @pythondir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
lib_LTLIBRARIES = libevdev.la
|
||||
AM_CPPFLAGS = $(GCC_CFLAGS) $(GCOV_CFLAGS) -I$(top_srcdir)/include -I$(top_srcdir)
|
||||
AM_LDFLAGS = $(GCOV_LDFLAGS)
|
||||
libevdev_la_SOURCES = \
|
||||
libevdev.h \
|
||||
libevdev-int.h \
|
||||
libevdev-util.h \
|
||||
libevdev-uinput.c \
|
||||
libevdev-uinput.h \
|
||||
libevdev-uinput-int.h \
|
||||
libevdev.c \
|
||||
libevdev-names.c \
|
||||
../include/linux/input.h \
|
||||
../include/linux/uinput.h \
|
||||
../include/linux/@OS@/input-event-codes.h \
|
||||
../include/linux/@OS@/input.h \
|
||||
../include/linux/@OS@/uinput.h
|
||||
|
||||
libevdev_la_LDFLAGS = \
|
||||
$(AM_LDFLAGS) \
|
||||
-version-info $(LIBEVDEV_LT_VERSION) \
|
||||
-Wl,--version-script="$(srcdir)/libevdev.sym" \
|
||||
$(GNU_LD_FLAGS)
|
||||
|
||||
EXTRA_libevdev_la_DEPENDENCIES = $(srcdir)/libevdev.sym
|
||||
libevdevincludedir = $(includedir)/libevdev-1.0/libevdev
|
||||
libevdevinclude_HEADERS = libevdev.h libevdev-uinput.h
|
||||
EXTRA_DIST = make-event-names.py libevdev.sym
|
||||
CLEANFILES = event-names.h $(am__append_1)
|
||||
BUILT_SOURCES = event-names.h
|
||||
all: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .lo .o .obj
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libevdev/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign libevdev/Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
|
||||
list2=; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
list2="$$list2 $$p"; \
|
||||
else :; fi; \
|
||||
done; \
|
||||
test -z "$$list2" || { \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
|
||||
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
|
||||
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
|
||||
}
|
||||
|
||||
uninstall-libLTLIBRARIES:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
|
||||
for p in $$list; do \
|
||||
$(am__strip_dir) \
|
||||
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
|
||||
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
|
||||
done
|
||||
|
||||
clean-libLTLIBRARIES:
|
||||
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
|
||||
@list='$(lib_LTLIBRARIES)'; \
|
||||
locs=`for p in $$list; do echo $$p; done | \
|
||||
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
|
||||
sort -u`; \
|
||||
test -z "$$locs" || { \
|
||||
echo rm -f $${locs}; \
|
||||
rm -f $${locs}; \
|
||||
}
|
||||
|
||||
libevdev.la: $(libevdev_la_OBJECTS) $(libevdev_la_DEPENDENCIES) $(EXTRA_libevdev_la_DEPENDENCIES)
|
||||
$(AM_V_CCLD)$(libevdev_la_LINK) -rpath $(libdir) $(libevdev_la_OBJECTS) $(libevdev_la_LIBADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libevdev-names.Plo@am__quote@ # am--include-marker
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libevdev-uinput.Plo@am__quote@ # am--include-marker
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libevdev.Plo@am__quote@ # am--include-marker
|
||||
|
||||
$(am__depfiles_remade):
|
||||
@$(MKDIR_P) $(@D)
|
||||
@echo '# dummy' >$@-t && $(am__mv) $@-t $@
|
||||
|
||||
am--depfiles: $(am__depfiles_remade)
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
|
||||
|
||||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
|
||||
.c.lo:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
|
||||
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
install-libevdevincludeHEADERS: $(libevdevinclude_HEADERS)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(libevdevinclude_HEADERS)'; test -n "$(libevdevincludedir)" || list=; \
|
||||
if test -n "$$list"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(libevdevincludedir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(libevdevincludedir)" || exit 1; \
|
||||
fi; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
echo "$$d$$p"; \
|
||||
done | $(am__base_list) | \
|
||||
while read files; do \
|
||||
echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libevdevincludedir)'"; \
|
||||
$(INSTALL_HEADER) $$files "$(DESTDIR)$(libevdevincludedir)" || exit $$?; \
|
||||
done
|
||||
|
||||
uninstall-libevdevincludeHEADERS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(libevdevinclude_HEADERS)'; test -n "$(libevdevincludedir)" || list=; \
|
||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||
dir='$(DESTDIR)$(libevdevincludedir)'; $(am__uninstall_files_from_dir)
|
||||
|
||||
ID: $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); mkid -fID $$unique
|
||||
tags: tags-am
|
||||
TAGS: tags
|
||||
|
||||
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
$(am__define_uniq_tagged_files); \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: ctags-am
|
||||
|
||||
CTAGS: ctags
|
||||
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
cscopelist: cscopelist-am
|
||||
|
||||
cscopelist-am: $(am__tagged_files)
|
||||
list='$(am__tagged_files)'; \
|
||||
case "$(srcdir)" in \
|
||||
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
|
||||
*) sdir=$(subdir)/$(srcdir) ;; \
|
||||
esac; \
|
||||
for i in $$list; do \
|
||||
if test -f "$$i"; then \
|
||||
echo "$(subdir)/$$i"; \
|
||||
else \
|
||||
echo "$$sdir/$$i"; \
|
||||
fi; \
|
||||
done >> $(top_builddir)/cscope.files
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
||||
|
||||
distdir-am: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) check-am
|
||||
all-am: Makefile $(LTLIBRARIES) $(HEADERS)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libevdevincludedir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
|
||||
mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f ./$(DEPDIR)/libevdev-names.Plo
|
||||
-rm -f ./$(DEPDIR)/libevdev-uinput.Plo
|
||||
-rm -f ./$(DEPDIR)/libevdev.Plo
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-libevdevincludeHEADERS
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am: install-libLTLIBRARIES
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f ./$(DEPDIR)/libevdev-names.Plo
|
||||
-rm -f ./$(DEPDIR)/libevdev-uinput.Plo
|
||||
-rm -f ./$(DEPDIR)/libevdev.Plo
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-libLTLIBRARIES \
|
||||
uninstall-libevdevincludeHEADERS
|
||||
|
||||
.MAKE: all check install install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
|
||||
clean-generic clean-libLTLIBRARIES clean-libtool cscopelist-am \
|
||||
ctags ctags-am distclean distclean-compile distclean-generic \
|
||||
distclean-libtool distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am install-info \
|
||||
install-info-am install-libLTLIBRARIES \
|
||||
install-libevdevincludeHEADERS install-man install-pdf \
|
||||
install-pdf-am install-ps install-ps-am install-strip \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES \
|
||||
uninstall-libevdevincludeHEADERS
|
||||
|
||||
.PRECIOUS: Makefile
|
||||
|
||||
|
||||
event-names.h: Makefile make-event-names.py
|
||||
$(PYTHON) $(srcdir)/make-event-names.py $(top_srcdir)/include/linux/@OS@/input.h $(top_srcdir)/include/linux/@OS@/input-event-codes.h > $@
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
@@ -1,143 +0,0 @@
|
||||
build_tests = test-compile-pedantic test-link
|
||||
|
||||
if ENABLE_STATIC_LINK_TEST
|
||||
build_tests += test-static-link
|
||||
endif
|
||||
|
||||
noinst_PROGRAMS = $(build_tests)
|
||||
|
||||
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/include -I$(top_builddir)/libevdev
|
||||
AM_LDFLAGS =
|
||||
|
||||
test_compile_pedantic_SOURCES = test-compile-pedantic.c
|
||||
test_compile_pedantic_CFLAGS = $(AM_CPPFLAGS) -pedantic -Werror -std=c89
|
||||
|
||||
test_link_SOURCES = test-link.c
|
||||
test_link_CFLAGS = -I$(top_srcdir)
|
||||
test_link_LDADD = $(top_builddir)/libevdev/libevdev.la
|
||||
|
||||
test_static_link_SOURCES = test-link.c
|
||||
test_static_link_CFLAGS = -I$(top_srcdir)
|
||||
test_static_link_LDADD = $(top_builddir)/libevdev/libevdev.la
|
||||
test_static_link_LDFLAGS = $(AM_LDFLAGS) -static
|
||||
|
||||
check_local_deps =
|
||||
|
||||
if ENABLE_RUNTIME_TESTS
|
||||
run_tests = \
|
||||
test-libevdev \
|
||||
test-kernel \
|
||||
test-uinput \
|
||||
test-event-codes \
|
||||
test-libevdev-internals \
|
||||
$(NULL)
|
||||
|
||||
.NOTPARALLEL:
|
||||
|
||||
noinst_PROGRAMS += $(run_tests)
|
||||
|
||||
TESTS = $(run_tests)
|
||||
|
||||
common_sources = \
|
||||
test-common-uinput.c \
|
||||
test-common-uinput.h \
|
||||
test-common.c \
|
||||
test-common.h
|
||||
|
||||
# include builddir for event-names.h
|
||||
AM_CPPFLAGS += $(CHECK_CFLAGS) $(GCOV_CFLAGS)
|
||||
AM_LDFLAGS += $(GCOV_LDFLAGS)
|
||||
|
||||
test_event_codes_SOURCES = \
|
||||
test-main.c \
|
||||
test-event-codes.c \
|
||||
test-event-names.c \
|
||||
test-context.c \
|
||||
$(common_sources)
|
||||
test_event_codes_LDADD = $(CHECK_LIBS) $(top_builddir)/libevdev/libevdev.la
|
||||
test_event_codes_LDFLAGS = -no-install
|
||||
|
||||
test_libevdev_internals_SOURCES = \
|
||||
test-main.c \
|
||||
test-int-queue.c \
|
||||
$(common_sources)
|
||||
test_libevdev_internals_LDADD = $(CHECK_LIBS) $(top_builddir)/libevdev/libevdev.la
|
||||
test_libevdev_internals_LDFLAGS = -no-install
|
||||
|
||||
test_uinput_SOURCES = \
|
||||
test-main.c \
|
||||
test-uinput.c \
|
||||
$(common_sources)
|
||||
test_uinput_LDADD = $(CHECK_LIBS) $(top_builddir)/libevdev/libevdev.la
|
||||
test_uinput_LDFLAGS = -no-install
|
||||
|
||||
test_libevdev_SOURCES = \
|
||||
test-main.c \
|
||||
test-libevdev-init.c \
|
||||
test-libevdev-has-event.c \
|
||||
test-libevdev-events.c \
|
||||
$(common_sources)
|
||||
|
||||
test_libevdev_LDADD = $(CHECK_LIBS) $(top_builddir)/libevdev/libevdev.la
|
||||
test_libevdev_LDFLAGS = -no-install
|
||||
|
||||
test_kernel_SOURCES = \
|
||||
test-main.c \
|
||||
test-kernel.c \
|
||||
$(common_sources)
|
||||
|
||||
test_kernel_CFLAGS = -I$(top_srcdir)
|
||||
test_kernel_LDADD = $(CHECK_LIBS) $(top_builddir)/libevdev/libevdev.la
|
||||
|
||||
if HAVE_VALGRIND
|
||||
VALGRIND_FLAGS=--leak-check=full \
|
||||
--quiet \
|
||||
--error-exitcode=3 \
|
||||
--suppressions=$(srcdir)/valgrind.suppressions
|
||||
|
||||
valgrind:
|
||||
$(MAKE) check-TESTS CK_TIMEOUT_MULTIPLIER=10 LOG_COMPILER="$(VALGRIND)" LOG_FLAGS="$(VALGRIND_FLAGS)"
|
||||
|
||||
check_local_deps += valgrind
|
||||
|
||||
endif
|
||||
|
||||
if GCOV_ENABLED
|
||||
|
||||
CLEANFILES = gcov-reports/*.gcov gcov-reports/summary.txt *.gcno *.gcda
|
||||
|
||||
gcov-report: generate-gcov-report.sh check-TESTS
|
||||
$(AM_V_GEN)$(srcdir)/generate-gcov-report.sh gcov-reports $(top_builddir)/libevdev $(builddir)
|
||||
|
||||
gcov: gcov-report
|
||||
@cat gcov-reports/summary.txt
|
||||
|
||||
check_local_deps += gcov
|
||||
|
||||
else
|
||||
|
||||
gcov-report.txt:
|
||||
@true
|
||||
|
||||
gcov:
|
||||
@true
|
||||
|
||||
|
||||
endif # GCOV_ENABLED
|
||||
|
||||
.PHONY: gcov gcov-clean gcov-report
|
||||
|
||||
endif # ENABLE_RUNTIME_TESTS
|
||||
|
||||
if ENABLE_STATIC_SYMBOL_LEAKS_TEST
|
||||
static-symbol-leaks: test-static-link test-static-symbols-leak.sh
|
||||
$(AM_V_GEN) $(srcdir)/test-static-symbols-leak.sh $(builddir)
|
||||
|
||||
check_local_deps += static-symbol-leaks
|
||||
|
||||
endif # HAVE_NM
|
||||
|
||||
EXTRA_DIST = valgrind.suppressions generate-gcov-report.sh test-static-symbols-leak.sh
|
||||
|
||||
check-local: $(check_local_deps)
|
||||
|
||||
-1438
File diff suppressed because it is too large
Load Diff
@@ -1,40 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
if [[ $# -lt 2 ]]; then
|
||||
echo "Usage: ./generate-gcov-report.sh <rel-target-dir> <srcdir> [<srcdir> ... ]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
target_dir=$1
|
||||
shift
|
||||
source_dirs=$*
|
||||
|
||||
if [[ "${target_dir:0:1}" != '/' ]]; then
|
||||
target_dir="$PWD/$target_dir"
|
||||
fi
|
||||
summary_file="$target_dir/summary.txt"
|
||||
|
||||
mkdir -p "$target_dir"
|
||||
rm -f "$target_dir"/*.gcov
|
||||
|
||||
for dir in $source_dirs; do
|
||||
pushd "$dir" > /dev/null
|
||||
for file in *.c; do
|
||||
find ./ -name "*${file/\.c/.gcda}" -exec gcov {} \; > /dev/null
|
||||
done
|
||||
find ./ -name "*.gcov" \! -path "*/`basename "$target_dir"`/*" -exec mv {} "$target_dir" \;
|
||||
popd > /dev/null
|
||||
done
|
||||
|
||||
echo "========== coverage report ========" > "$summary_file"
|
||||
for file in "$target_dir"/*.gcov; do
|
||||
total=`grep -v " -:" "$file" | wc -l`
|
||||
missing=`grep "#####" "$file" | wc -l`
|
||||
hit=$((total - missing));
|
||||
percent=$((($hit * 100)/$total))
|
||||
fname=`basename "$file"`
|
||||
printf "%-32s total lines: %4s not tested: %4s (%3s%%)\n" "$fname" "$total" "$missing" "$percent">> "$summary_file"
|
||||
done
|
||||
echo "========== =============== ========" >> "$summary_file"
|
||||
@@ -1,299 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2013 Red Hat, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting documentation, and
|
||||
* that the name of the copyright holders not be used in advertising or
|
||||
* publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission. The copyright holders make no representations
|
||||
* about the suitability of this software for any purpose. It is provided "as
|
||||
* is" without express or implied warranty.
|
||||
*
|
||||
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
* OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <fcntl.h>
|
||||
#include <poll.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <linux/uinput.h>
|
||||
#include <dirent.h>
|
||||
|
||||
#include <libevdev/libevdev.h>
|
||||
#include <libevdev/libevdev-int.h>
|
||||
#include <libevdev/libevdev-util.h>
|
||||
#include <libevdev/libevdev-uinput.h>
|
||||
|
||||
#include "test-common-uinput.h"
|
||||
|
||||
#define SYS_INPUT_DIR "/sys/class/input"
|
||||
#define DEV_INPUT_DIR "/dev/input/"
|
||||
|
||||
struct uinput_device
|
||||
{
|
||||
struct libevdev *d; /* lazy, it has all the accessors */
|
||||
struct libevdev_uinput *uidev;
|
||||
int dev_fd; /* open fd to the devnode */
|
||||
int uinput_fd;
|
||||
};
|
||||
|
||||
struct uinput_device*
|
||||
uinput_device_new(const char *name)
|
||||
{
|
||||
struct uinput_device *dev;
|
||||
|
||||
dev = calloc(1, sizeof(*dev));
|
||||
if (!dev)
|
||||
return NULL;
|
||||
|
||||
dev->d = libevdev_new();
|
||||
dev->dev_fd = -1;
|
||||
dev->uinput_fd = -1;
|
||||
|
||||
if (name)
|
||||
libevdev_set_name(dev->d, name);
|
||||
|
||||
return dev;
|
||||
}
|
||||
|
||||
int
|
||||
uinput_device_new_with_events_v(struct uinput_device **d, const char *name, const struct input_id *id, va_list args)
|
||||
{
|
||||
int rc;
|
||||
struct uinput_device *dev;
|
||||
|
||||
dev = uinput_device_new(name);
|
||||
if (!dev)
|
||||
return -ENOMEM;
|
||||
if (id != DEFAULT_IDS)
|
||||
uinput_device_set_ids(dev, id);
|
||||
|
||||
rc = uinput_device_set_event_bits_v(dev, args);
|
||||
|
||||
if (rc == 0)
|
||||
rc = uinput_device_create(dev);
|
||||
|
||||
if (rc != 0) {
|
||||
uinput_device_free(dev);
|
||||
dev = NULL;
|
||||
} else
|
||||
*d = dev;
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
int
|
||||
uinput_device_new_with_events(struct uinput_device **d, const char *name, const struct input_id *id, ...)
|
||||
{
|
||||
int rc;
|
||||
va_list args;
|
||||
|
||||
va_start(args, id);
|
||||
rc = uinput_device_new_with_events_v(d, name, id, args);
|
||||
va_end(args);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
void
|
||||
uinput_device_free(struct uinput_device *dev)
|
||||
{
|
||||
if (!dev)
|
||||
return;
|
||||
|
||||
if (dev->uinput_fd != -1) {
|
||||
(void)ioctl(dev->uinput_fd, UI_DEV_DESTROY, NULL);
|
||||
close(dev->uinput_fd);
|
||||
}
|
||||
if (dev->dev_fd != -1)
|
||||
close(dev->dev_fd);
|
||||
libevdev_free(dev->d);
|
||||
libevdev_uinput_destroy(dev->uidev);
|
||||
free(dev);
|
||||
}
|
||||
|
||||
int
|
||||
uinput_device_get_fd(const struct uinput_device *dev)
|
||||
{
|
||||
return dev->dev_fd;
|
||||
}
|
||||
|
||||
const char*
|
||||
uinput_device_get_devnode(const struct uinput_device *dev)
|
||||
{
|
||||
return libevdev_uinput_get_devnode(dev->uidev);
|
||||
}
|
||||
|
||||
int
|
||||
uinput_device_create(struct uinput_device* d)
|
||||
{
|
||||
int rc;
|
||||
int fd;
|
||||
const char *devnode;
|
||||
|
||||
fd = open("/dev/uinput", O_RDWR);
|
||||
if (fd < 0)
|
||||
goto error;
|
||||
|
||||
d->uinput_fd = fd;
|
||||
|
||||
rc = libevdev_uinput_create_from_device(d->d, fd, &d->uidev);
|
||||
if (rc != 0)
|
||||
goto error;
|
||||
|
||||
devnode = libevdev_uinput_get_devnode(d->uidev);
|
||||
if (devnode == NULL)
|
||||
goto error;
|
||||
|
||||
d->dev_fd = open(devnode, O_RDWR);
|
||||
if (d->dev_fd == -1)
|
||||
goto error;
|
||||
|
||||
/* write abs resolution now */
|
||||
if (libevdev_has_event_type(d->d, EV_ABS)) {
|
||||
int code;
|
||||
for (code = 0; code < ABS_CNT; code++) {
|
||||
const struct input_absinfo *abs;
|
||||
|
||||
/* can't change slots */
|
||||
if (code == ABS_MT_SLOT)
|
||||
continue;
|
||||
|
||||
abs = libevdev_get_abs_info(d->d, code);
|
||||
if (!abs)
|
||||
continue;
|
||||
|
||||
rc = ioctl(d->dev_fd, EVIOCSABS(code), abs);
|
||||
if (rc < 0) {
|
||||
printf("error %s for code %d\n", strerror(-rc), code);
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
if (d->dev_fd != -1)
|
||||
close(d->dev_fd);
|
||||
if (d->uinput_fd != -1)
|
||||
close(d->uinput_fd);
|
||||
return -errno;
|
||||
|
||||
}
|
||||
|
||||
int uinput_device_set_name(struct uinput_device *dev, const char *name)
|
||||
{
|
||||
libevdev_set_name(dev->d, name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int uinput_device_set_ids(struct uinput_device *dev, const struct input_id *ids)
|
||||
{
|
||||
libevdev_set_id_product(dev->d, ids->product);
|
||||
libevdev_set_id_vendor(dev->d, ids->vendor);
|
||||
libevdev_set_id_bustype(dev->d, ids->bustype);
|
||||
libevdev_set_id_version(dev->d, ids->version);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
uinput_device_set_bit(struct uinput_device* dev, unsigned int bit)
|
||||
{
|
||||
return libevdev_enable_event_type(dev->d, bit);
|
||||
}
|
||||
|
||||
int
|
||||
uinput_device_set_prop(struct uinput_device *dev, unsigned int prop)
|
||||
{
|
||||
return libevdev_enable_property(dev->d, prop);
|
||||
}
|
||||
|
||||
int
|
||||
uinput_device_set_event_bit(struct uinput_device* dev, unsigned int type, unsigned int code)
|
||||
{
|
||||
return libevdev_enable_event_code(dev->d, type, code, NULL);
|
||||
}
|
||||
|
||||
int
|
||||
uinput_device_set_event_bits_v(struct uinput_device *dev, va_list args)
|
||||
{
|
||||
int type, code;
|
||||
int rc = 0;
|
||||
|
||||
do {
|
||||
type = va_arg(args, int);
|
||||
if (type == -1)
|
||||
break;
|
||||
code = va_arg(args, int);
|
||||
if (code == -1)
|
||||
break;
|
||||
rc = libevdev_enable_event_code(dev->d, type, code, NULL);
|
||||
} while (rc == 0);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
int
|
||||
uinput_device_set_event_bits(struct uinput_device *dev, ...)
|
||||
{
|
||||
int rc;
|
||||
va_list args;
|
||||
va_start(args, dev);
|
||||
rc = uinput_device_set_event_bits_v(dev, args);
|
||||
va_end(args);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
int
|
||||
uinput_device_set_abs_bit(struct uinput_device* dev, unsigned int code, const struct input_absinfo *absinfo)
|
||||
{
|
||||
return libevdev_enable_event_code(dev->d, EV_ABS, code, absinfo);
|
||||
}
|
||||
|
||||
int
|
||||
uinput_device_event(const struct uinput_device *dev, unsigned int type, unsigned int code, int value)
|
||||
{
|
||||
return libevdev_uinput_write_event(dev->uidev, type, code, value);
|
||||
}
|
||||
|
||||
int uinput_device_event_multiple_v(const struct uinput_device* dev, va_list args)
|
||||
{
|
||||
int type, code, value;
|
||||
int rc = 0;
|
||||
|
||||
do {
|
||||
type = va_arg(args, int);
|
||||
if (type == -1)
|
||||
break;
|
||||
code = va_arg(args, int);
|
||||
if (code == -1)
|
||||
break;
|
||||
value = va_arg(args, int);
|
||||
rc = uinput_device_event(dev, type, code, value);
|
||||
} while (rc == 0);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
int uinput_device_event_multiple(const struct uinput_device* dev, ...)
|
||||
{
|
||||
int rc;
|
||||
va_list args;
|
||||
va_start(args, dev);
|
||||
rc = uinput_device_event_multiple_v(dev, args);
|
||||
va_end(args);
|
||||
return rc;
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2013 Red Hat, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting documentation, and
|
||||
* that the name of the copyright holders not be used in advertising or
|
||||
* publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission. The copyright holders make no representations
|
||||
* about the suitability of this software for any purpose. It is provided "as
|
||||
* is" without express or implied warranty.
|
||||
*
|
||||
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
* OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <libevdev/libevdev.h>
|
||||
|
||||
#define DEFAULT_IDS NULL
|
||||
|
||||
struct uinput_device* uinput_device_new(const char *name);
|
||||
int uinput_device_new_with_events(struct uinput_device **dev, const char *name, const struct input_id *ids, ...);
|
||||
int uinput_device_new_with_events_v(struct uinput_device **dev, const char *name, const struct input_id *ids, va_list args);
|
||||
void uinput_device_free(struct uinput_device *dev);
|
||||
|
||||
int uinput_device_create(struct uinput_device* dev);
|
||||
int uinput_device_set_name(struct uinput_device* dev, const char *name);
|
||||
int uinput_device_set_ids(struct uinput_device* dev, const struct input_id *ids);
|
||||
int uinput_device_set_bit(struct uinput_device* dev, unsigned int bit);
|
||||
int uinput_device_set_prop(struct uinput_device *dev, unsigned int prop);
|
||||
int uinput_device_set_event_bit(struct uinput_device* dev, unsigned int type, unsigned int code);
|
||||
int uinput_device_set_event_bits(struct uinput_device* dev, ...);
|
||||
int uinput_device_set_event_bits_v(struct uinput_device* dev, va_list args);
|
||||
int uinput_device_set_abs_bit(struct uinput_device* dev, unsigned int code, const struct input_absinfo *absinfo);
|
||||
int uinput_device_event(const struct uinput_device* dev, unsigned int type, unsigned int code, int value);
|
||||
int uinput_device_event_multiple(const struct uinput_device* dev, ...);
|
||||
int uinput_device_event_multiple_v(const struct uinput_device* dev, va_list args);
|
||||
int uinput_device_get_fd(const struct uinput_device *dev);
|
||||
const char* uinput_device_get_devnode(const struct uinput_device *dev);
|
||||
|
||||
char *uinput_devnode_from_syspath(const char *syspath);
|
||||
@@ -1,119 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2013 Red Hat, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting documentation, and
|
||||
* that the name of the copyright holders not be used in advertising or
|
||||
* publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission. The copyright holders make no representations
|
||||
* about the suitability of this software for any purpose. It is provided "as
|
||||
* is" without express or implied warranty.
|
||||
*
|
||||
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
* OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <check.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "test-common.h"
|
||||
|
||||
void test_logfunc_abort_on_error(enum libevdev_log_priority priority,
|
||||
void *data,
|
||||
const char *file, int line,
|
||||
const char *func,
|
||||
const char *format, va_list args)
|
||||
{
|
||||
vprintf(format, args);
|
||||
ck_abort();
|
||||
}
|
||||
|
||||
void test_logfunc_ignore_error(enum libevdev_log_priority priority,
|
||||
void *data,
|
||||
const char *file, int line,
|
||||
const char *func,
|
||||
const char *format, va_list args)
|
||||
{
|
||||
}
|
||||
|
||||
void test_create_device(struct uinput_device **uidev_return,
|
||||
struct libevdev **dev_return,
|
||||
...)
|
||||
{
|
||||
int rc, fd;
|
||||
struct uinput_device *uidev;
|
||||
struct libevdev *dev;
|
||||
va_list args;
|
||||
|
||||
va_start(args, dev_return);
|
||||
|
||||
rc = uinput_device_new_with_events_v(&uidev, TEST_DEVICE_NAME, DEFAULT_IDS, args);
|
||||
va_end(args);
|
||||
|
||||
ck_assert_msg(rc == 0, "Failed to create uinput device: %s", strerror(-rc));
|
||||
|
||||
fd = uinput_device_get_fd(uidev);
|
||||
|
||||
rc = libevdev_new_from_fd(fd, &dev);
|
||||
ck_assert_msg(rc == 0, "Failed to init device device: %s", strerror(-rc));
|
||||
rc = fcntl(fd, F_SETFL, O_NONBLOCK);
|
||||
ck_assert_msg(rc == 0, "fcntl failed: %s", strerror(errno));
|
||||
|
||||
*uidev_return = uidev;
|
||||
*dev_return = dev;
|
||||
}
|
||||
|
||||
void test_create_abs_device(struct uinput_device **uidev_return,
|
||||
struct libevdev **dev_return,
|
||||
int nabs,
|
||||
const struct input_absinfo *abs,
|
||||
...)
|
||||
{
|
||||
int rc, fd;
|
||||
struct uinput_device *uidev;
|
||||
struct libevdev *dev;
|
||||
va_list args;
|
||||
|
||||
uidev = uinput_device_new(TEST_DEVICE_NAME);
|
||||
ck_assert(uidev != NULL);
|
||||
|
||||
va_start(args, abs);
|
||||
rc = uinput_device_set_event_bits_v(uidev, args);
|
||||
ck_assert_msg(rc == 0, "Failed to set uinput bits");
|
||||
va_end(args);
|
||||
|
||||
while (--nabs >= 0) {
|
||||
int code;
|
||||
struct input_absinfo a;
|
||||
|
||||
code = abs[nabs].value;
|
||||
a = abs[nabs];
|
||||
a.value = 0;
|
||||
|
||||
rc = uinput_device_set_abs_bit(uidev, code, &a);
|
||||
ck_assert_msg(rc == 0, "for abs field %d\n", nabs);
|
||||
}
|
||||
|
||||
rc = uinput_device_create(uidev);
|
||||
ck_assert_msg(rc == 0, "Failed to create uinput device: %s", strerror(-rc));
|
||||
|
||||
fd = uinput_device_get_fd(uidev);
|
||||
|
||||
rc = libevdev_new_from_fd(fd, &dev);
|
||||
ck_assert_msg(rc == 0, "Failed to init device device: %s", strerror(-rc));
|
||||
rc = fcntl(fd, F_SETFL, O_NONBLOCK);
|
||||
ck_assert_msg(rc == 0, "fcntl failed: %s", strerror(errno));
|
||||
|
||||
*uidev_return = uidev;
|
||||
*dev_return = dev;
|
||||
}
|
||||
@@ -1,110 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2013 Red Hat, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting documentation, and
|
||||
* that the name of the copyright holders not be used in advertising or
|
||||
* publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission. The copyright holders make no representations
|
||||
* about the suitability of this software for any purpose. It is provided "as
|
||||
* is" without express or implied warranty.
|
||||
*
|
||||
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
* OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <libevdev/libevdev.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <check.h>
|
||||
|
||||
#ifndef _TEST_COMMON_H_
|
||||
#define _TEST_COMMON_H_
|
||||
|
||||
struct libevdev_test {
|
||||
const char *name;
|
||||
Suite* (*setup)(void);
|
||||
bool needs_root_privileges;
|
||||
} __attribute__((aligned(16)));
|
||||
|
||||
#define _TEST_SUITE(name, root_privs) \
|
||||
static Suite* (name##_setup)(void); \
|
||||
static const struct libevdev_test _test \
|
||||
__attribute__((used)) \
|
||||
__attribute__((section ("test_section"))) = { \
|
||||
#name, name##_setup, root_privs \
|
||||
}; \
|
||||
static Suite* (name##_setup)(void)
|
||||
|
||||
#define TEST_SUITE(name) \
|
||||
_TEST_SUITE(name, false)
|
||||
|
||||
#define TEST_SUITE_ROOT_PRIVILEGES(name) \
|
||||
_TEST_SUITE(name, true)
|
||||
|
||||
#define TEST_DEVICE_NAME "libevdev test device"
|
||||
|
||||
#define add_test(suite, func) do { \
|
||||
TCase *tc = tcase_create(#func); \
|
||||
tcase_add_test(tc, func); \
|
||||
suite_add_tcase(suite, tc); \
|
||||
} while(0)
|
||||
|
||||
#include "test-common-uinput.h"
|
||||
|
||||
#define assert_event(e_, t, c, v) \
|
||||
do { \
|
||||
const struct input_event *e = (e_); \
|
||||
ck_assert_int_eq(e->type, (t)); \
|
||||
ck_assert_int_eq(e->code, (c)); \
|
||||
ck_assert_int_eq(e->value, (v)); \
|
||||
} while(0)
|
||||
|
||||
void test_create_device(struct uinput_device **uidev,
|
||||
struct libevdev **dev,
|
||||
...);
|
||||
void test_create_abs_device(struct uinput_device **uidev,
|
||||
struct libevdev **dev,
|
||||
int nabs,
|
||||
const struct input_absinfo *abs,
|
||||
...);
|
||||
|
||||
void test_logfunc_abort_on_error(enum libevdev_log_priority priority,
|
||||
void *data,
|
||||
const char *file, int line,
|
||||
const char *func,
|
||||
const char *format, va_list args);
|
||||
void test_logfunc_ignore_error(enum libevdev_log_priority priority,
|
||||
void *data,
|
||||
const char *file, int line,
|
||||
const char *func,
|
||||
const char *format, va_list args);
|
||||
|
||||
static inline void
|
||||
print_event(const struct input_event *ev)
|
||||
{
|
||||
if (ev->type == EV_SYN)
|
||||
printf("Event: time %ld.%06ld, ++++++++++++++++++++ %s +++++++++++++++\n",
|
||||
ev->input_event_sec,
|
||||
ev->input_event_usec,
|
||||
libevdev_event_type_get_name(ev->type));
|
||||
else
|
||||
printf("Event: time %ld.%06ld, type %d (%s), code %d (%s), value %d\n",
|
||||
ev->input_event_sec,
|
||||
ev->input_event_usec,
|
||||
ev->type,
|
||||
libevdev_event_type_get_name(ev->type),
|
||||
ev->code,
|
||||
libevdev_event_code_get_name(ev->type, ev->code),
|
||||
ev->value);
|
||||
}
|
||||
#endif /* _TEST_COMMON_H_ */
|
||||
@@ -1,6 +0,0 @@
|
||||
#include <libevdev/libevdev.h>
|
||||
#include <libevdev/libevdev-uinput.h>
|
||||
|
||||
int main(void) {
|
||||
return 0;
|
||||
}
|
||||
@@ -1,178 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2019 Red Hat, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting documentation, and
|
||||
* that the name of the copyright holders not be used in advertising or
|
||||
* publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission. The copyright holders make no representations
|
||||
* about the suitability of this software for any purpose. It is provided "as
|
||||
* is" without express or implied warranty.
|
||||
*
|
||||
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
* OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "test-common.h"
|
||||
|
||||
START_TEST(test_info)
|
||||
{
|
||||
struct libevdev *d = libevdev_new();
|
||||
|
||||
libevdev_set_name(d, "some name");
|
||||
ck_assert_str_eq(libevdev_get_name(d), "some name");
|
||||
libevdev_set_phys(d, "physical");
|
||||
ck_assert_str_eq(libevdev_get_phys(d), "physical");
|
||||
libevdev_set_uniq(d, "very unique");
|
||||
ck_assert_str_eq(libevdev_get_uniq(d), "very unique");
|
||||
|
||||
libevdev_set_id_bustype(d, 1);
|
||||
libevdev_set_id_vendor(d, 2);
|
||||
libevdev_set_id_product(d, 3);
|
||||
libevdev_set_id_version(d, 4);
|
||||
ck_assert_int_eq(libevdev_get_id_bustype(d), 1);
|
||||
ck_assert_int_eq(libevdev_get_id_vendor(d), 2);
|
||||
ck_assert_int_eq(libevdev_get_id_product(d), 3);
|
||||
ck_assert_int_eq(libevdev_get_id_version(d), 4);
|
||||
|
||||
libevdev_free(d);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_properties)
|
||||
{
|
||||
for (unsigned prop = 0; prop < INPUT_PROP_CNT; prop++) {
|
||||
struct libevdev *d = libevdev_new();
|
||||
|
||||
ck_assert(!libevdev_has_property(d, prop));
|
||||
libevdev_enable_property(d, prop);
|
||||
ck_assert(libevdev_has_property(d, prop));
|
||||
libevdev_free(d);
|
||||
}
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_bits)
|
||||
{
|
||||
for (unsigned type = 1; type < EV_CNT; type++) {
|
||||
unsigned max = libevdev_event_type_get_max(type);
|
||||
|
||||
if((int)max == -1)
|
||||
continue;
|
||||
|
||||
for (unsigned code = 0; code <= max; code++) {
|
||||
struct libevdev *d = libevdev_new();
|
||||
const struct input_absinfo abs = {
|
||||
.minimum = 10,
|
||||
.maximum = 20,
|
||||
.fuzz = 30,
|
||||
.flat = 40,
|
||||
.resolution = 50,
|
||||
};
|
||||
const void *data = NULL;
|
||||
|
||||
if (type == EV_ABS || type == EV_REP)
|
||||
data = &abs;
|
||||
|
||||
ck_assert(!libevdev_has_event_code(d, type, code));
|
||||
libevdev_enable_event_code(d, type, code, data);
|
||||
ck_assert(libevdev_has_event_code(d, type, code));
|
||||
libevdev_free(d);
|
||||
}
|
||||
}
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_mt_slots_enable_disable)
|
||||
{
|
||||
struct libevdev *d = libevdev_new();
|
||||
struct input_absinfo abs = {0};
|
||||
|
||||
abs.maximum = 5;
|
||||
libevdev_enable_event_code(d, EV_ABS, ABS_MT_SLOT, &abs);
|
||||
ck_assert(libevdev_has_event_code(d, EV_ABS, ABS_MT_SLOT));
|
||||
ck_assert_int_eq(libevdev_get_num_slots(d), 6);
|
||||
|
||||
libevdev_disable_event_code(d, EV_ABS, ABS_MT_SLOT);
|
||||
ck_assert(!libevdev_has_event_code(d, EV_ABS, ABS_MT_SLOT));
|
||||
ck_assert_int_eq(libevdev_get_num_slots(d), -1);
|
||||
|
||||
abs.maximum = 2;
|
||||
libevdev_enable_event_code(d, EV_ABS, ABS_MT_SLOT, &abs);
|
||||
ck_assert(libevdev_has_event_code(d, EV_ABS, ABS_MT_SLOT));
|
||||
ck_assert_int_eq(libevdev_get_num_slots(d), 3);
|
||||
|
||||
libevdev_free(d);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_mt_slots_increase_decrease)
|
||||
{
|
||||
struct libevdev *d = libevdev_new();
|
||||
struct input_absinfo abs = {0};
|
||||
|
||||
abs.maximum = 5;
|
||||
libevdev_enable_event_code(d, EV_ABS, ABS_MT_SLOT, &abs);
|
||||
ck_assert(libevdev_has_event_code(d, EV_ABS, ABS_MT_SLOT));
|
||||
ck_assert_int_eq(libevdev_get_num_slots(d), 6);
|
||||
|
||||
abs.maximum = 2;
|
||||
libevdev_enable_event_code(d, EV_ABS, ABS_MT_SLOT, &abs);
|
||||
ck_assert(libevdev_has_event_code(d, EV_ABS, ABS_MT_SLOT));
|
||||
ck_assert_int_eq(libevdev_get_num_slots(d), 3);
|
||||
|
||||
abs.maximum = 6;
|
||||
libevdev_enable_event_code(d, EV_ABS, ABS_MT_SLOT, &abs);
|
||||
ck_assert(libevdev_has_event_code(d, EV_ABS, ABS_MT_SLOT));
|
||||
ck_assert_int_eq(libevdev_get_num_slots(d), 7);
|
||||
|
||||
abs.maximum = 10;
|
||||
libevdev_enable_event_code(d, EV_ABS, ABS_MT_SLOT, &abs);
|
||||
ck_assert(libevdev_has_event_code(d, EV_ABS, ABS_MT_SLOT));
|
||||
ck_assert_int_eq(libevdev_get_num_slots(d), 11);
|
||||
|
||||
libevdev_free(d);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_mt_tracking_id)
|
||||
{
|
||||
struct libevdev *d = libevdev_new();
|
||||
struct input_absinfo abs = { .maximum = 5 };
|
||||
|
||||
libevdev_enable_event_code(d, EV_ABS, ABS_MT_SLOT, &abs);
|
||||
|
||||
/* Not yet enabled, so 0. This is technically undefined */
|
||||
for (int slot = 0; slot < 5; slot++)
|
||||
ck_assert_int_eq(libevdev_get_slot_value(d, 0, ABS_MT_TRACKING_ID), 0);
|
||||
|
||||
libevdev_enable_event_code(d, EV_ABS, ABS_MT_TRACKING_ID, &abs);
|
||||
|
||||
for (int slot = 0; slot < 5; slot++)
|
||||
ck_assert_int_eq(libevdev_get_slot_value(d, 0, ABS_MT_TRACKING_ID), -1);
|
||||
|
||||
libevdev_free(d);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
TEST_SUITE(event_name_suite)
|
||||
{
|
||||
Suite *s = suite_create("Context manipulation");
|
||||
|
||||
add_test(s, test_info);
|
||||
add_test(s, test_properties);
|
||||
add_test(s, test_bits);
|
||||
add_test(s, test_mt_slots_enable_disable);
|
||||
add_test(s, test_mt_slots_increase_decrease);
|
||||
add_test(s, test_mt_tracking_id);
|
||||
|
||||
return s;
|
||||
}
|
||||
@@ -1,285 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2013 David Herrmann <dh.herrmann@gmail.com>
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting documentation, and
|
||||
* that the name of the copyright holders not be used in advertising or
|
||||
* publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission. The copyright holders make no representations
|
||||
* about the suitability of this software for any purpose. It is provided "as
|
||||
* is" without express or implied warranty.
|
||||
*
|
||||
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
* OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "test-common.h"
|
||||
|
||||
START_TEST(test_type_names)
|
||||
{
|
||||
ck_assert_int_eq(libevdev_event_type_from_name("EV_SYN"), EV_SYN);
|
||||
ck_assert_int_eq(libevdev_event_type_from_name("EV_KEY"), EV_KEY);
|
||||
ck_assert_int_eq(libevdev_event_type_from_name("EV_REL"), EV_REL);
|
||||
ck_assert_int_eq(libevdev_event_type_from_name("EV_ABS"), EV_ABS);
|
||||
ck_assert_int_eq(libevdev_event_type_from_name("EV_MSC"), EV_MSC);
|
||||
ck_assert_int_eq(libevdev_event_type_from_name("EV_SND"), EV_SND);
|
||||
ck_assert_int_eq(libevdev_event_type_from_name("EV_SW"), EV_SW);
|
||||
ck_assert_int_eq(libevdev_event_type_from_name("EV_LED"), EV_LED);
|
||||
ck_assert_int_eq(libevdev_event_type_from_name("EV_REP"), EV_REP);
|
||||
ck_assert_int_eq(libevdev_event_type_from_name("EV_FF"), EV_FF);
|
||||
ck_assert_int_eq(libevdev_event_type_from_name("EV_FF_STATUS"), EV_FF_STATUS);
|
||||
ck_assert_int_eq(libevdev_event_type_from_name("EV_MAX"), EV_MAX);
|
||||
|
||||
ck_assert_int_eq(libevdev_event_type_from_name_n("EV_SYNTAX", 6), EV_SYN);
|
||||
ck_assert_int_eq(libevdev_event_type_from_name_n("EV_REPTILE", 6), EV_REP);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_type_names_invalid)
|
||||
{
|
||||
ck_assert_int_eq(libevdev_event_type_from_name("EV_Syn"), -1);
|
||||
ck_assert_int_eq(libevdev_event_type_from_name("ev_SYN"), -1);
|
||||
ck_assert_int_eq(libevdev_event_type_from_name("SYN"), -1);
|
||||
ck_assert_int_eq(libevdev_event_type_from_name("EV_SYNTAX"), -1);
|
||||
|
||||
ck_assert_int_eq(libevdev_event_type_from_name_n("EV_SYN", 5), -1);
|
||||
ck_assert_int_eq(libevdev_event_type_from_name_n("EV_REPTILE", 7), -1);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_type_name_lookup)
|
||||
{
|
||||
ck_assert_int_eq(libevdev_event_type_from_code_name("SYN_REPORT"), EV_SYN);
|
||||
ck_assert_int_eq(libevdev_event_type_from_code_name("KEY_A"), EV_KEY);
|
||||
ck_assert_int_eq(libevdev_event_type_from_code_name("REL_Z"), EV_REL);
|
||||
ck_assert_int_eq(libevdev_event_type_from_code_name("ABS_Z"), EV_ABS);
|
||||
ck_assert_int_eq(libevdev_event_type_from_code_name("MSC_SERIAL"), EV_MSC);
|
||||
ck_assert_int_eq(libevdev_event_type_from_code_name("SND_TONE"), EV_SND);
|
||||
ck_assert_int_eq(libevdev_event_type_from_code_name("SW_TABLET_MODE"), EV_SW);
|
||||
ck_assert_int_eq(libevdev_event_type_from_code_name("LED_CHARGING"), EV_LED);
|
||||
ck_assert_int_eq(libevdev_event_type_from_code_name("REP_PERIOD"), EV_REP);
|
||||
ck_assert_int_eq(libevdev_event_type_from_code_name("FF_SPRING"), EV_FF);
|
||||
ck_assert_int_eq(libevdev_event_type_from_code_name("FF_STATUS_STOPPED"), EV_FF_STATUS);
|
||||
|
||||
ck_assert_int_eq(libevdev_event_type_from_code_name_n("KEY_1zzzzz", 5), EV_KEY);
|
||||
ck_assert_int_eq(libevdev_event_type_from_code_name_n("ABS_Zooom", 5), EV_ABS);
|
||||
|
||||
ck_assert_int_eq(libevdev_event_type_from_code_name("KEY_MAX"), EV_KEY);
|
||||
ck_assert_int_eq(libevdev_event_type_from_code_name("REL_MAX"), EV_REL);
|
||||
ck_assert_int_eq(libevdev_event_type_from_code_name("ABS_MAX"), EV_ABS);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_type_name_lookup_invalid)
|
||||
{
|
||||
ck_assert_int_eq(libevdev_event_type_from_name("SYN_REPORTED"), -1);
|
||||
ck_assert_int_eq(libevdev_event_type_from_name("syn_blah"), -1);
|
||||
ck_assert_int_eq(libevdev_event_type_from_name("SYN_"), -1);
|
||||
ck_assert_int_eq(libevdev_event_type_from_name("KEY_BANANA"), -1);
|
||||
|
||||
ck_assert_int_eq(libevdev_event_type_from_name_n("KEY_BA", 6), -1);
|
||||
ck_assert_int_eq(libevdev_event_type_from_name_n("KEY_BLAH", 8), -1);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_code_names)
|
||||
{
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_SYN, "SYN_REPORT"), SYN_REPORT);
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_ABS, "ABS_X"), ABS_X);
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_KEY, "BTN_A"), BTN_A);
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_KEY, "KEY_A"), KEY_A);
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_REL, "REL_X"), REL_X);
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_MSC, "MSC_RAW"), MSC_RAW);
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_LED, "LED_KANA"), LED_KANA);
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_SND, "SND_BELL"), SND_BELL);
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_REP, "REP_DELAY"), REP_DELAY);
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_SYN, "SYN_DROPPED"), SYN_DROPPED);
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_KEY, "KEY_RESERVED"), KEY_RESERVED);
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_KEY, "BTN_0"), BTN_0);
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_KEY, "KEY_0"), KEY_0);
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_FF, "FF_GAIN"), FF_GAIN);
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_FF_STATUS, "FF_STATUS_MAX"), FF_STATUS_MAX);
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_SW, "SW_PEN_INSERTED"), SW_PEN_INSERTED);
|
||||
|
||||
ck_assert_int_eq(libevdev_event_code_from_name_n(EV_ABS, "ABS_YXZ", 5), ABS_Y);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_code_name_lookup)
|
||||
{
|
||||
/* Same as test_code_names() but without the type */
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("SYN_REPORT"), SYN_REPORT);
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("ABS_X"), ABS_X);
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("BTN_A"), BTN_A);
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("KEY_A"), KEY_A);
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("REL_X"), REL_X);
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("MSC_RAW"), MSC_RAW);
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("LED_KANA"), LED_KANA);
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("SND_BELL"), SND_BELL);
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("REP_DELAY"), REP_DELAY);
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("SYN_DROPPED"), SYN_DROPPED);
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("KEY_RESERVED"), KEY_RESERVED);
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("BTN_0"), BTN_0);
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("KEY_0"), KEY_0);
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("FF_GAIN"), FF_GAIN);
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("FF_STATUS_MAX"), FF_STATUS_MAX);
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("SW_PEN_INSERTED"), SW_PEN_INSERTED);
|
||||
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name_n("ABS_YXZ", 5), ABS_Y);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_code_names_invalid)
|
||||
{
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_MAX, "MAX_FAKE"), -1);
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_CNT, "CNT_FAKE"), -1);
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_PWR, "PWR_SOMETHING"), -1);
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_ABS, "EV_ABS"), -1);
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_ABS, "ABS_XY"), -1);
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_KEY, "BTN_GAMEPAD"), -1);
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_KEY, "BUS_PCI"), -1);
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_FF_STATUS, "FF_STATUS"), -1);
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_FF_STATUS, "FF_STATUS_"), -1);
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_FF, "FF_STATUS"), -1);
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_FF, "FF_STATUS_"), -1);
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_KEY, "ID_BUS"), -1);
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_SND, "SND_CNT"), -1);
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_SW, "SW_CNT"), -1);
|
||||
|
||||
ck_assert_int_eq(libevdev_event_code_from_name_n(EV_ABS, "ABS_X", 4), -1);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_code_name_lookup_invalid)
|
||||
{
|
||||
/* Same as test_code_names_invalid() but without the type */
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("MAX_FAKE"), -1);
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("CNT_FAKE"), -1);
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("PWR_SOMETHING"), -1);
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("EV_ABS"), -1);
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("ABS_XY"), -1);
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("BTN_GAMEPAD"), -1);
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("BUS_PCI"), -1);
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("FF_STATUS"), -1);
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("FF_STATUS_"), -1);
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("FF_STATUS"), -1);
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("FF_STATUS_"), -1);
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("ID_BUS"), -1);
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("SND_CNT"), -1);
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("SW_CNT"), -1);
|
||||
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name_n("ABS_X", 4), -1);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_code_names_max)
|
||||
{
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_SYN, "SYN_MAX"), SYN_MAX);
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_KEY, "KEY_MAX"), KEY_MAX);
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_REL, "REL_MAX"), REL_MAX);
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_ABS, "ABS_MAX"), ABS_MAX);
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_MSC, "MSC_MAX"), MSC_MAX);
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_SW, "SW_MAX"), SW_MAX);
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_LED, "LED_MAX"), LED_MAX);
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_SND, "SND_MAX"), SND_MAX);
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_REP, "REP_MAX"), REP_MAX);
|
||||
ck_assert_int_eq(libevdev_event_code_from_name(EV_FF, "FF_MAX"), FF_MAX);
|
||||
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("SYN_MAX"), SYN_MAX);
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("KEY_MAX"), KEY_MAX);
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("REL_MAX"), REL_MAX);
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("ABS_MAX"), ABS_MAX);
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("MSC_MAX"), MSC_MAX);
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("SW_MAX"), SW_MAX);
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("LED_MAX"), LED_MAX);
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("SND_MAX"), SND_MAX);
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("REP_MAX"), REP_MAX);
|
||||
ck_assert_int_eq(libevdev_event_code_from_code_name("FF_MAX"), FF_MAX);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_value_names)
|
||||
{
|
||||
ck_assert_int_eq(libevdev_event_value_from_name(EV_ABS, ABS_MT_TOOL_TYPE, "MT_TOOL_PALM"), MT_TOOL_PALM);
|
||||
ck_assert_int_eq(libevdev_event_value_from_name(EV_ABS, ABS_MT_TOOL_TYPE, "MT_TOOL_FINGER"), MT_TOOL_FINGER);
|
||||
ck_assert_int_eq(libevdev_event_value_from_name(EV_ABS, ABS_MT_TOOL_TYPE, "MT_TOOL_PEN"), MT_TOOL_PEN);
|
||||
ck_assert_int_eq(libevdev_event_value_from_name(EV_ABS, ABS_MT_TOOL_TYPE, "MT_TOOL_MAX"), MT_TOOL_MAX);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_value_names_invalid)
|
||||
{
|
||||
ck_assert_int_eq(libevdev_event_value_from_name(EV_SYN, REL_X, "MT_TOOL_PALM"), -1);
|
||||
ck_assert_int_eq(libevdev_event_value_from_name(EV_REL, REL_X, "MT_TOOL_PALM"), -1);
|
||||
ck_assert_int_eq(libevdev_event_value_from_name(EV_ABS, ABS_X, "MT_TOOL_PALM"), -1);
|
||||
ck_assert_int_eq(libevdev_event_value_from_name(EV_ABS, ABS_MT_TOOL_TYPE, "MT_TOOL_"), -1);
|
||||
ck_assert_int_eq(libevdev_event_value_from_name(EV_ABS, ABS_MT_TOOL_TYPE, "MT_TOOL_PALMA"), -1);
|
||||
ck_assert_int_eq(libevdev_event_value_from_name(EV_ABS, ABS_MT_TOOL_TYPE, ""), -1);
|
||||
ck_assert_int_eq(libevdev_event_value_from_name(EV_ABS, ABS_MT_TOOL_TYPE, "EV_ABS"), -1);
|
||||
ck_assert_int_eq(libevdev_event_value_from_name(EV_ABS, ABS_MT_TOOL_TYPE, "ABS_X"), -1);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_properties)
|
||||
{
|
||||
struct prop {
|
||||
int val;
|
||||
const char *name;
|
||||
} lut[] = {
|
||||
{ INPUT_PROP_DIRECT, "INPUT_PROP_DIRECT" },
|
||||
{ INPUT_PROP_POINTER, "INPUT_PROP_POINTER" },
|
||||
{ INPUT_PROP_MAX, "INPUT_PROP_MAX" },
|
||||
{ -1, NULL}
|
||||
};
|
||||
struct prop *p = lut;
|
||||
while (p->val != -1) {
|
||||
ck_assert_int_eq(libevdev_property_from_name(p->name), p->val);
|
||||
p++;
|
||||
}
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_properties_invalid)
|
||||
{
|
||||
ck_assert_int_eq(libevdev_property_from_name("EV_ABS"), -1);
|
||||
ck_assert_int_eq(libevdev_property_from_name("INPUT_PROP"), -1);
|
||||
ck_assert_int_eq(libevdev_property_from_name("INPUT_PROP_"), -1);
|
||||
ck_assert_int_eq(libevdev_property_from_name("INPUT_PROP_FOO"), -1);
|
||||
|
||||
ck_assert_int_eq(libevdev_property_from_name_n("INPUT_PROP_POINTER", 11), -1);
|
||||
ck_assert_int_eq(libevdev_property_from_name_n("INPUT_PROP_POINTER",
|
||||
strlen("INPUT_PROP_POINTER") - 1), -1);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
TEST_SUITE(event_code_suite)
|
||||
{
|
||||
Suite *s = suite_create("Event codes");
|
||||
|
||||
add_test(s, test_type_names);
|
||||
add_test(s, test_type_names_invalid);
|
||||
add_test(s, test_type_name_lookup);
|
||||
add_test(s, test_type_name_lookup_invalid);
|
||||
|
||||
add_test(s, test_code_names);
|
||||
add_test(s, test_code_name_lookup);
|
||||
add_test(s, test_code_names_invalid);
|
||||
add_test(s, test_code_name_lookup_invalid);
|
||||
add_test(s, test_code_names_max);
|
||||
|
||||
add_test(s, test_value_names);
|
||||
add_test(s, test_value_names_invalid);
|
||||
|
||||
add_test(s, test_properties);
|
||||
add_test(s, test_properties_invalid);
|
||||
|
||||
return s;
|
||||
}
|
||||
@@ -1,331 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2013 Red Hat, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting documentation, and
|
||||
* that the name of the copyright holders not be used in advertising or
|
||||
* publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission. The copyright holders make no representations
|
||||
* about the suitability of this software for any purpose. It is provided "as
|
||||
* is" without express or implied warranty.
|
||||
*
|
||||
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
* OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "test-common.h"
|
||||
|
||||
START_TEST(test_limits)
|
||||
{
|
||||
ck_assert(libevdev_event_type_get_name(EV_MAX + 1) == NULL);
|
||||
ck_assert(libevdev_event_code_get_name(EV_ABS, ABS_MAX + 1) == NULL);
|
||||
ck_assert(libevdev_event_code_get_name(EV_REL, REL_MAX + 1) == NULL);
|
||||
ck_assert(libevdev_event_code_get_name(EV_KEY, KEY_MAX + 1) == NULL);
|
||||
ck_assert(libevdev_event_code_get_name(EV_LED, LED_MAX + 1) == NULL);
|
||||
ck_assert(libevdev_event_code_get_name(EV_SW, SW_MAX + 1) == NULL);
|
||||
ck_assert(libevdev_event_code_get_name(EV_MSC, MSC_MAX + 1) == NULL);
|
||||
ck_assert(libevdev_event_code_get_name(EV_SND, SND_MAX + 1) == NULL);
|
||||
ck_assert(libevdev_event_code_get_name(EV_REP, REP_MAX + 1) == NULL);
|
||||
ck_assert(libevdev_event_code_get_name(EV_FF, FF_MAX + 1) == NULL);
|
||||
ck_assert(libevdev_event_code_get_name(EV_MAX + 1, 0) == NULL);
|
||||
ck_assert(libevdev_event_value_get_name(EV_ABS, ABS_MT_TOOL_TYPE, MT_TOOL_MAX + 1) == NULL);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_type_name)
|
||||
{
|
||||
ck_assert_str_eq(libevdev_event_type_get_name(EV_SYN), "EV_SYN");
|
||||
ck_assert_str_eq(libevdev_event_type_get_name(EV_REL), "EV_REL");
|
||||
ck_assert_str_eq(libevdev_event_type_get_name(EV_ABS), "EV_ABS");
|
||||
ck_assert_str_eq(libevdev_event_type_get_name(EV_MSC), "EV_MSC");
|
||||
ck_assert_str_eq(libevdev_event_type_get_name(EV_SW), "EV_SW");
|
||||
ck_assert_str_eq(libevdev_event_type_get_name(EV_LED), "EV_LED");
|
||||
ck_assert_str_eq(libevdev_event_type_get_name(EV_SND), "EV_SND");
|
||||
ck_assert_str_eq(libevdev_event_type_get_name(EV_REP), "EV_REP");
|
||||
ck_assert_str_eq(libevdev_event_type_get_name(EV_FF), "EV_FF");
|
||||
ck_assert_str_eq(libevdev_event_type_get_name(EV_PWR), "EV_PWR");
|
||||
ck_assert_str_eq(libevdev_event_type_get_name(EV_FF_STATUS), "EV_FF_STATUS");
|
||||
ck_assert_str_eq(libevdev_event_type_get_name(EV_MAX), "EV_MAX");
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_code_abs_name)
|
||||
{
|
||||
/* pick out a few only */
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_ABS, ABS_X), "ABS_X");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_ABS, ABS_Y), "ABS_Y");
|
||||
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_ABS, ABS_MT_SLOT), "ABS_MT_SLOT");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_ABS, ABS_MISC), "ABS_MISC");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_ABS, ABS_MAX), "ABS_MAX");
|
||||
|
||||
ck_assert(libevdev_event_code_get_name(EV_ABS, ABS_MAX - 1) == NULL);
|
||||
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_code_rel_name)
|
||||
{
|
||||
/* pick out a few only */
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_REL, REL_X), "REL_X");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_REL, REL_Y), "REL_Y");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_REL, REL_MISC), "REL_MISC");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_REL, REL_MAX), "REL_MAX");
|
||||
|
||||
ck_assert(libevdev_event_code_get_name(EV_REL, REL_MAX - 1) == NULL);
|
||||
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_code_key_name)
|
||||
{
|
||||
/* pick out a few only */
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_KEY, KEY_RESERVED), "KEY_RESERVED");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_KEY, KEY_ESC), "KEY_ESC");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_KEY, KEY_1), "KEY_1");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_KEY, KEY_2), "KEY_2");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_KEY, KEY_UNKNOWN), "KEY_UNKNOWN");
|
||||
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_KEY, BTN_0), "BTN_0");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_KEY, BTN_LEFT), "BTN_LEFT");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_KEY, BTN_TRIGGER), "BTN_TRIGGER");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_KEY, BTN_A), "BTN_SOUTH");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_KEY, BTN_TOOL_PEN), "BTN_TOOL_PEN");
|
||||
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_KEY, KEY_TOUCHPAD_TOGGLE), "KEY_TOUCHPAD_TOGGLE");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_KEY, BTN_TRIGGER_HAPPY), "BTN_TRIGGER_HAPPY1");
|
||||
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_KEY, KEY_MAX), "KEY_MAX");
|
||||
ck_assert(libevdev_event_code_get_name(EV_KEY, KEY_MAX - 1) == NULL);
|
||||
|
||||
/* special cases that resolve to something else */
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_KEY, KEY_HANGUEL), "KEY_HANGEUL");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_KEY, KEY_SCREENLOCK), "KEY_COFFEE");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_KEY, BTN_MISC), "BTN_0");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_KEY, BTN_MOUSE), "BTN_LEFT");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_KEY, BTN_JOYSTICK), "BTN_TRIGGER");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_KEY, BTN_GAMEPAD), "BTN_SOUTH");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_KEY, BTN_DIGI), "BTN_TOOL_PEN");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_KEY, BTN_WHEEL), "BTN_GEAR_DOWN");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_KEY, BTN_TRIGGER_HAPPY), "BTN_TRIGGER_HAPPY1");
|
||||
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_code_led_name)
|
||||
{
|
||||
/* pick out a few only */
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_LED, LED_NUML), "LED_NUML");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_LED, LED_KANA), "LED_KANA");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_LED, LED_MAX), "LED_MAX");
|
||||
|
||||
ck_assert(libevdev_event_code_get_name(EV_LED, LED_MAX - 1) == NULL);
|
||||
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_code_snd_name)
|
||||
{
|
||||
/* pick out a few only */
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_SND, SND_CLICK), "SND_CLICK");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_SND, SND_TONE), "SND_TONE");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_SND, SND_MAX), "SND_MAX");
|
||||
|
||||
ck_assert(libevdev_event_code_get_name(EV_SND, SND_MAX - 1) == NULL);
|
||||
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_code_rep_name)
|
||||
{
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_REP, REP_DELAY), "REP_DELAY");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_REP, REP_PERIOD), "REP_PERIOD");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_REP, REP_MAX), "REP_PERIOD");
|
||||
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_code_msc_name)
|
||||
{
|
||||
/* pick out a few only */
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_MSC, MSC_SERIAL), "MSC_SERIAL");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_MSC, MSC_RAW), "MSC_RAW");
|
||||
#ifdef MSC_TIMESTAMP
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_MSC, MSC_TIMESTAMP), "MSC_TIMESTAMP");
|
||||
#endif
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_MSC, MSC_MAX), "MSC_MAX");
|
||||
|
||||
ck_assert(libevdev_event_code_get_name(EV_MSC, MSC_MAX - 1) == NULL);
|
||||
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_code_sw_name)
|
||||
{
|
||||
/* pick out a few only */
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_SW, SW_LID), "SW_LID");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_SW, SW_RFKILL_ALL), "SW_RFKILL_ALL");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_SW, SW_LINEIN_INSERT), "SW_LINEIN_INSERT");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_SW, SW_PEN_INSERTED), "SW_PEN_INSERTED");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_SW, SW_MAX), "SW_MACHINE_COVER");
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_code_ff_name)
|
||||
{
|
||||
/* pick out a few only */
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_FF, FF_STATUS_STOPPED), "FF_STATUS_STOPPED");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_FF, FF_FRICTION), "FF_FRICTION");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_FF, FF_CUSTOM), "FF_CUSTOM");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_FF, FF_MAX), "FF_MAX");
|
||||
|
||||
ck_assert(libevdev_event_code_get_name(EV_FF, FF_MAX - 1) == NULL);
|
||||
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_code_syn_name)
|
||||
{
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_SYN, SYN_REPORT), "SYN_REPORT");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_SYN, SYN_CONFIG), "SYN_CONFIG");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_SYN, SYN_MT_REPORT), "SYN_MT_REPORT");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_SYN, SYN_DROPPED), "SYN_DROPPED");
|
||||
ck_assert_str_eq(libevdev_event_code_get_name(EV_SYN, SYN_MAX), "SYN_MAX");
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_value_name)
|
||||
{
|
||||
unsigned int type, code;
|
||||
int value;
|
||||
|
||||
for (type = 0; type < EV_MAX; type++) {
|
||||
int max = libevdev_event_type_get_max(type);
|
||||
|
||||
if (max == -1)
|
||||
continue;
|
||||
|
||||
for (code = 0; code < (unsigned int)max; code++) {
|
||||
if (type == EV_ABS && code == ABS_MT_TOOL_TYPE)
|
||||
continue;
|
||||
|
||||
for (value = 0; value < 0xff; value++) {
|
||||
ck_assert(libevdev_event_value_get_name(type, code, value) == NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ck_assert_str_eq(libevdev_event_value_get_name(EV_ABS, ABS_MT_TOOL_TYPE, MT_TOOL_FINGER), "MT_TOOL_FINGER");
|
||||
ck_assert_str_eq(libevdev_event_value_get_name(EV_ABS, ABS_MT_TOOL_TYPE, MT_TOOL_PALM), "MT_TOOL_PALM");
|
||||
ck_assert_str_eq(libevdev_event_value_get_name(EV_ABS, ABS_MT_TOOL_TYPE, MT_TOOL_PEN), "MT_TOOL_PEN");
|
||||
ck_assert_str_eq(libevdev_event_value_get_name(EV_ABS, ABS_MT_TOOL_TYPE, MT_TOOL_MAX), "MT_TOOL_MAX");
|
||||
ck_assert(libevdev_event_value_get_name(EV_ABS, ABS_MT_TOOL_TYPE, -1) == NULL);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_prop_name)
|
||||
{
|
||||
ck_assert_str_eq(libevdev_property_get_name(INPUT_PROP_POINTER), "INPUT_PROP_POINTER");
|
||||
ck_assert_str_eq(libevdev_property_get_name(INPUT_PROP_DIRECT), "INPUT_PROP_DIRECT");
|
||||
ck_assert_str_eq(libevdev_property_get_name(INPUT_PROP_BUTTONPAD), "INPUT_PROP_BUTTONPAD");
|
||||
ck_assert_str_eq(libevdev_property_get_name(INPUT_PROP_SEMI_MT), "INPUT_PROP_SEMI_MT");
|
||||
ck_assert_str_eq(libevdev_property_get_name(INPUT_PROP_MAX), "INPUT_PROP_MAX");
|
||||
|
||||
ck_assert(libevdev_property_get_name(INPUT_PROP_MAX - 1) == NULL);
|
||||
ck_assert(libevdev_property_get_name(INPUT_PROP_MAX + 1) == NULL);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_event_type_max)
|
||||
{
|
||||
ck_assert_int_eq(libevdev_event_type_get_max(EV_ABS), ABS_MAX);
|
||||
ck_assert_int_eq(libevdev_event_type_get_max(EV_REL), REL_MAX);
|
||||
ck_assert_int_eq(libevdev_event_type_get_max(EV_KEY), KEY_MAX);
|
||||
|
||||
ck_assert_int_eq(libevdev_event_type_get_max(EV_MAX - 1), -1);
|
||||
ck_assert_int_eq(libevdev_event_type_get_max(EV_MAX + 1), -1);
|
||||
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_event_type)
|
||||
{
|
||||
struct input_event ev;
|
||||
int i = 0;
|
||||
|
||||
ev.type = EV_REL;
|
||||
|
||||
ck_assert_int_eq(libevdev_event_is_type(&ev, EV_REL), 1);
|
||||
for (i = 0; i < EV_CNT; i++) {
|
||||
if (i == ev.type)
|
||||
continue;
|
||||
ck_assert_int_eq(libevdev_event_is_type(&ev, i), 0);
|
||||
}
|
||||
ck_assert_int_eq(libevdev_event_is_type(&ev, EV_MAX + 1), 0);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_event_code)
|
||||
{
|
||||
struct input_event ev;
|
||||
int i = 0;
|
||||
|
||||
ev.type = EV_REL;
|
||||
ev.code = REL_Y;
|
||||
|
||||
ck_assert_int_eq(libevdev_event_is_code(&ev, EV_REL, REL_Y), 1);
|
||||
for (i = 0; i < EV_CNT; i++) {
|
||||
int j;
|
||||
if (i == ev.type || i == EV_SYN)
|
||||
continue;
|
||||
|
||||
for (j = 0; j < libevdev_event_type_get_max(i); i++) {
|
||||
ck_assert_int_eq(libevdev_event_is_code(&ev, i, j), 0);
|
||||
}
|
||||
}
|
||||
ck_assert_int_eq(libevdev_event_is_code(&ev, EV_MAX + 1, ev.code), 0);
|
||||
ck_assert_int_eq(libevdev_event_is_code(&ev, EV_REL, REL_MAX + 1), 0);
|
||||
|
||||
ev.type = EV_SYN;
|
||||
ev.code = SYN_REPORT;
|
||||
ck_assert_int_eq(libevdev_event_is_code(&ev, EV_SYN, SYN_REPORT), 1);
|
||||
ck_assert_int_eq(libevdev_event_is_code(&ev, EV_SYN, SYN_DROPPED), 0);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
TEST_SUITE(event_name_suite)
|
||||
{
|
||||
Suite *s = suite_create("Event names");
|
||||
|
||||
add_test(s, test_limits);
|
||||
add_test(s, test_event_type_max);
|
||||
|
||||
add_test(s, test_type_name);
|
||||
|
||||
add_test(s, test_code_abs_name);
|
||||
add_test(s, test_code_rel_name);
|
||||
add_test(s, test_code_key_name);
|
||||
add_test(s, test_code_led_name);
|
||||
add_test(s, test_code_snd_name);
|
||||
add_test(s, test_code_rep_name);
|
||||
add_test(s, test_code_msc_name);
|
||||
add_test(s, test_code_sw_name);
|
||||
add_test(s, test_code_ff_name);
|
||||
add_test(s, test_code_syn_name);
|
||||
|
||||
add_test(s, test_value_name);
|
||||
add_test(s, test_prop_name);
|
||||
|
||||
add_test(s, test_event_type);
|
||||
add_test(s, test_event_code);
|
||||
|
||||
return s;
|
||||
}
|
||||
@@ -1,355 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2013 Red Hat, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting documentation, and
|
||||
* that the name of the copyright holders not be used in advertising or
|
||||
* publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission. The copyright holders make no representations
|
||||
* about the suitability of this software for any purpose. It is provided "as
|
||||
* is" without express or implied warranty.
|
||||
*
|
||||
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
* OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <limits.h>
|
||||
#include <libevdev/libevdev-int.h>
|
||||
#include "test-common.h"
|
||||
|
||||
START_TEST(test_queue_alloc)
|
||||
{
|
||||
struct libevdev dev;
|
||||
int rc;
|
||||
|
||||
rc = queue_alloc(&dev, 0);
|
||||
ck_assert_int_eq(rc, -ENOMEM);
|
||||
|
||||
rc = queue_alloc(&dev, 100);
|
||||
ck_assert_int_eq(rc, 0);
|
||||
|
||||
ck_assert_int_eq(dev.queue_size, 100);
|
||||
ck_assert_int_eq(dev.queue_next, 0);
|
||||
|
||||
queue_free(&dev);
|
||||
ck_assert_int_eq(dev.queue_size, 0);
|
||||
ck_assert_int_eq(dev.queue_next, 0);
|
||||
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_queue_sizes)
|
||||
{
|
||||
struct libevdev dev = {0};
|
||||
|
||||
queue_alloc(&dev, 0);
|
||||
ck_assert_int_eq(queue_num_elements(&dev), 0);
|
||||
ck_assert_int_eq(queue_num_free_elements(&dev), 0);
|
||||
ck_assert_int_eq(queue_size(&dev), 0);
|
||||
|
||||
queue_alloc(&dev, 100);
|
||||
ck_assert_int_eq(queue_num_elements(&dev), 0);
|
||||
ck_assert_int_eq(queue_num_free_elements(&dev), 100);
|
||||
ck_assert_int_eq(queue_size(&dev), 100);
|
||||
|
||||
queue_free(&dev);
|
||||
|
||||
ck_assert_int_eq(queue_num_elements(&dev), 0);
|
||||
ck_assert_int_eq(queue_num_free_elements(&dev), 0);
|
||||
ck_assert_int_eq(queue_size(&dev), 0);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_queue_push)
|
||||
{
|
||||
struct libevdev dev = {0};
|
||||
struct input_event *ev;
|
||||
|
||||
queue_alloc(&dev, 0);
|
||||
ev = queue_push(&dev);
|
||||
ck_assert(ev == NULL);
|
||||
|
||||
queue_alloc(&dev, 2);
|
||||
ev = queue_push(&dev);
|
||||
ck_assert(ev == dev.queue);
|
||||
ck_assert_int_eq(queue_num_elements(&dev), 1);
|
||||
ck_assert_int_eq(queue_num_free_elements(&dev), 1);
|
||||
|
||||
ev = queue_push(&dev);
|
||||
ck_assert(ev == dev.queue + 1);
|
||||
|
||||
ev = queue_push(&dev);
|
||||
ck_assert(ev == NULL);
|
||||
|
||||
queue_free(&dev);
|
||||
ev = queue_push(&dev);
|
||||
ck_assert(ev == NULL);
|
||||
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_queue_pop)
|
||||
{
|
||||
struct libevdev dev = {0};
|
||||
struct input_event ev, *e, tmp;
|
||||
int rc;
|
||||
|
||||
queue_alloc(&dev, 0);
|
||||
rc = queue_pop(&dev, &ev);
|
||||
ck_assert_int_eq(rc, 1);
|
||||
|
||||
queue_alloc(&dev, 2);
|
||||
e = queue_push(&dev);
|
||||
memset(e, 0xab, sizeof(*e));
|
||||
ck_assert_int_eq(queue_num_elements(&dev), 1);
|
||||
ck_assert_int_eq(queue_num_free_elements(&dev), 1);
|
||||
|
||||
rc = queue_pop(&dev, &ev);
|
||||
ck_assert_int_eq(rc, 0);
|
||||
memset(&tmp, 0xab, sizeof(tmp));
|
||||
rc = memcmp(&tmp, &ev, sizeof(tmp));
|
||||
ck_assert_int_eq(rc, 0);
|
||||
|
||||
ck_assert_int_eq(queue_num_elements(&dev), 0);
|
||||
ck_assert_int_eq(queue_num_free_elements(&dev), 2);
|
||||
|
||||
rc = queue_pop(&dev, &ev);
|
||||
ck_assert_int_eq(rc, 1);
|
||||
|
||||
queue_free(&dev);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_queue_peek)
|
||||
{
|
||||
struct libevdev dev = {0};
|
||||
struct input_event ev, *e, tmp;
|
||||
int rc;
|
||||
|
||||
queue_alloc(&dev, 0);
|
||||
rc = queue_peek(&dev, 0, &ev);
|
||||
ck_assert_int_eq(rc, 1);
|
||||
|
||||
queue_alloc(&dev, 2);
|
||||
e = queue_push(&dev);
|
||||
memset(e, 0xab, sizeof(*e));
|
||||
|
||||
rc = queue_peek(&dev, 0, &ev);
|
||||
ck_assert_int_eq(rc, 0);
|
||||
memset(&tmp, 0xab, sizeof(tmp));
|
||||
rc = memcmp(&tmp, &ev, sizeof(tmp));
|
||||
ck_assert_int_eq(rc, 0);
|
||||
|
||||
ck_assert_int_eq(queue_num_elements(&dev), 1);
|
||||
e = queue_push(&dev);
|
||||
memset(e, 0xbc, sizeof(*e));
|
||||
|
||||
rc = queue_peek(&dev, 1, &ev);
|
||||
ck_assert_int_eq(rc, 0);
|
||||
memset(&tmp, 0xbc, sizeof(tmp));
|
||||
rc = memcmp(&tmp, &ev, sizeof(tmp));
|
||||
ck_assert_int_eq(rc, 0);
|
||||
|
||||
rc = queue_peek(&dev, 0, &ev);
|
||||
ck_assert_int_eq(rc, 0);
|
||||
memset(&tmp, 0xab, sizeof(tmp));
|
||||
rc = memcmp(&tmp, &ev, sizeof(tmp));
|
||||
ck_assert_int_eq(rc, 0);
|
||||
|
||||
ck_assert_int_eq(queue_num_elements(&dev), 2);
|
||||
|
||||
queue_free(&dev);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_queue_shift)
|
||||
{
|
||||
struct libevdev dev = {0};
|
||||
struct input_event ev, *first, *second, e1, e2;
|
||||
int rc;
|
||||
|
||||
ck_assert_int_eq(queue_shift(&dev, &ev), 1);
|
||||
|
||||
queue_alloc(&dev, 10);
|
||||
ck_assert_int_eq(queue_shift(&dev, &ev), 1);
|
||||
|
||||
first = queue_push(&dev);
|
||||
ck_assert(first != NULL);
|
||||
memset(first, 0xab, sizeof(*first));
|
||||
|
||||
e1 = *first;
|
||||
|
||||
second = queue_push(&dev);
|
||||
ck_assert(second != NULL);
|
||||
memset(second, 0x12, sizeof(*second));
|
||||
|
||||
e2 = *second;
|
||||
|
||||
rc = queue_shift(&dev, &ev);
|
||||
ck_assert_int_eq(rc, 0);
|
||||
rc = memcmp(&ev, &e1, sizeof(ev));
|
||||
ck_assert_int_eq(rc, 0);
|
||||
|
||||
rc = queue_shift(&dev, &ev);
|
||||
ck_assert_int_eq(rc, 0);
|
||||
rc = memcmp(&ev, &e2, sizeof(ev));
|
||||
ck_assert_int_eq(rc, 0);
|
||||
|
||||
ck_assert_int_eq(queue_shift(&dev, &ev), 1);
|
||||
|
||||
queue_free(&dev);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_queue_shift_multiple)
|
||||
{
|
||||
struct libevdev dev = {0};
|
||||
struct input_event ev, *first, *second, e1, e2;
|
||||
struct input_event events[5];
|
||||
int rc;
|
||||
|
||||
ck_assert_int_eq(queue_shift_multiple(&dev, 1, &ev), 0);
|
||||
ck_assert_int_eq(queue_shift_multiple(&dev, 0, &ev), 0);
|
||||
|
||||
queue_alloc(&dev, 10);
|
||||
ck_assert_int_eq(queue_shift_multiple(&dev, 1, &ev), 0);
|
||||
ck_assert_int_eq(queue_shift_multiple(&dev, 0, &ev), 0);
|
||||
|
||||
first = queue_push(&dev);
|
||||
ck_assert(first != NULL);
|
||||
memset(first, 0xab, sizeof(*first));
|
||||
e1 = *first;
|
||||
|
||||
second = queue_push(&dev);
|
||||
ck_assert(second != NULL);
|
||||
memset(second, 0x12, sizeof(*second));
|
||||
e2 = *second;
|
||||
|
||||
rc = queue_shift_multiple(&dev, 5, events);
|
||||
ck_assert_int_eq(rc, 2);
|
||||
rc = memcmp(&events[0], &e1, sizeof(ev));
|
||||
ck_assert_int_eq(rc, 0);
|
||||
rc = memcmp(&events[1], &e2, sizeof(ev));
|
||||
ck_assert_int_eq(rc, 0);
|
||||
|
||||
first = queue_push(&dev);
|
||||
ck_assert(first != NULL);
|
||||
memset(first, 0xab, sizeof(*first));
|
||||
e1 = *first;
|
||||
|
||||
second = queue_push(&dev);
|
||||
ck_assert(second != NULL);
|
||||
memset(second, 0x12, sizeof(*second));
|
||||
e2 = *second;
|
||||
|
||||
rc = queue_shift_multiple(&dev, 1, events);
|
||||
ck_assert_int_eq(rc, 1);
|
||||
rc = memcmp(&events[0], &e1, sizeof(ev));
|
||||
ck_assert_int_eq(rc, 0);
|
||||
|
||||
rc = queue_shift_multiple(&dev, 1, events);
|
||||
ck_assert_int_eq(rc, 1);
|
||||
rc = memcmp(&events[0], &e2, sizeof(ev));
|
||||
ck_assert_int_eq(rc, 0);
|
||||
|
||||
ck_assert_int_eq(queue_shift_multiple(&dev, 1, events), 0);
|
||||
|
||||
queue_free(&dev);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_queue_next_element)
|
||||
{
|
||||
struct libevdev dev = {0};
|
||||
struct input_event ev, *first, *second;
|
||||
int rc;
|
||||
|
||||
queue_alloc(&dev, 0);
|
||||
first = queue_next_element(&dev);
|
||||
ck_assert(first == NULL);
|
||||
|
||||
queue_alloc(&dev, 2);
|
||||
first = queue_next_element(&dev);
|
||||
ck_assert(first != NULL);
|
||||
memset(first, 0xab, sizeof(*first));
|
||||
|
||||
second = queue_next_element(&dev);
|
||||
ck_assert(second != NULL);
|
||||
memset(second, 0xbc, sizeof(*second));
|
||||
|
||||
/* queue_next_element does not advance, so we overwrite */
|
||||
memset(&ev, 0xbc, sizeof(ev));
|
||||
rc = memcmp(&ev, first, sizeof(ev));
|
||||
ck_assert_int_eq(rc, 0);
|
||||
|
||||
ck_assert_int_eq(queue_num_elements(&dev), 0);
|
||||
|
||||
first = queue_next_element(&dev);
|
||||
ck_assert(first != NULL);
|
||||
memset(first, 0xab, sizeof(*first));
|
||||
|
||||
queue_set_num_elements(&dev, 1);
|
||||
ck_assert_int_eq(queue_num_elements(&dev), 1);
|
||||
|
||||
second = queue_next_element(&dev);
|
||||
ck_assert(second != NULL);
|
||||
memset(second, 0xbc, sizeof(*second));
|
||||
|
||||
memset(&ev, 0xab, sizeof(ev));
|
||||
rc = memcmp(&ev, first, sizeof(ev));
|
||||
ck_assert_int_eq(rc, 0);
|
||||
|
||||
queue_free(&dev);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_queue_set_num_elements)
|
||||
{
|
||||
struct libevdev dev = {0};
|
||||
|
||||
queue_alloc(&dev, 0);
|
||||
ck_assert_int_eq(queue_set_num_elements(&dev, 1), 1);
|
||||
|
||||
queue_alloc(&dev, 2);
|
||||
ck_assert_int_eq(queue_set_num_elements(&dev, 3), 1);
|
||||
ck_assert_int_eq(queue_set_num_elements(&dev, 2), 0);
|
||||
|
||||
queue_free(&dev);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
TEST_SUITE(queue_suite)
|
||||
{
|
||||
Suite *s = suite_create("Event queue");
|
||||
|
||||
TCase *tc = tcase_create("Queue allocation");
|
||||
tcase_add_test(tc, test_queue_alloc);
|
||||
tcase_add_test(tc, test_queue_sizes);
|
||||
suite_add_tcase(s, tc);
|
||||
|
||||
tc = tcase_create("Queue push/pop/peek");
|
||||
tcase_add_test(tc, test_queue_push);
|
||||
tcase_add_test(tc, test_queue_pop);
|
||||
tcase_add_test(tc, test_queue_peek);
|
||||
suite_add_tcase(s, tc);
|
||||
|
||||
tc = tcase_create("Queue shift");
|
||||
tcase_add_test(tc, test_queue_shift);
|
||||
tcase_add_test(tc, test_queue_shift_multiple);
|
||||
suite_add_tcase(s, tc);
|
||||
|
||||
tc = tcase_create("Queue next elem");
|
||||
tcase_add_test(tc, test_queue_next_element);
|
||||
tcase_add_test(tc, test_queue_set_num_elements);
|
||||
suite_add_tcase(s, tc);
|
||||
|
||||
return s;
|
||||
}
|
||||
@@ -1,177 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2014 Red Hat, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting documentation, and
|
||||
* that the name of the copyright holders not be used in advertising or
|
||||
* publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission. The copyright holders make no representations
|
||||
* about the suitability of this software for any purpose. It is provided "as
|
||||
* is" without express or implied warranty.
|
||||
*
|
||||
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
* OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <errno.h>
|
||||
#include <inttypes.h>
|
||||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <linux/input.h>
|
||||
|
||||
#include <libevdev/libevdev.h>
|
||||
#include <libevdev/libevdev-uinput.h>
|
||||
#include "test-common.h"
|
||||
|
||||
START_TEST(test_revoke)
|
||||
{
|
||||
struct uinput_device* uidev;
|
||||
struct libevdev *dev, *dev2;
|
||||
int rc, fd;
|
||||
struct input_event ev1, ev2;
|
||||
int dev_fd;
|
||||
|
||||
test_create_device(&uidev, &dev,
|
||||
EV_SYN, SYN_REPORT,
|
||||
EV_REL, REL_X,
|
||||
EV_REL, REL_Y,
|
||||
EV_REL, REL_WHEEL,
|
||||
EV_KEY, BTN_LEFT,
|
||||
EV_KEY, BTN_MIDDLE,
|
||||
EV_KEY, BTN_RIGHT,
|
||||
-1);
|
||||
|
||||
fd = open(uinput_device_get_devnode(uidev), O_RDONLY|O_NONBLOCK);
|
||||
ck_assert_int_gt(fd, -1);
|
||||
rc = libevdev_new_from_fd(fd, &dev2);
|
||||
ck_assert_msg(rc == 0, "Failed to create second device: %s", strerror(-rc));
|
||||
|
||||
uinput_device_event(uidev, EV_REL, REL_X, 1);
|
||||
uinput_device_event(uidev, EV_SYN, SYN_REPORT, 0);
|
||||
|
||||
for (int i = 0; i < 2; i++) {
|
||||
rc = libevdev_next_event(dev, LIBEVDEV_READ_FLAG_NORMAL, &ev1);
|
||||
ck_assert_int_eq(rc, LIBEVDEV_READ_STATUS_SUCCESS);
|
||||
|
||||
rc = libevdev_next_event(dev2, LIBEVDEV_READ_FLAG_NORMAL, &ev2);
|
||||
ck_assert_int_eq(rc, LIBEVDEV_READ_STATUS_SUCCESS);
|
||||
|
||||
ck_assert_int_eq(ev1.type, ev2.type);
|
||||
ck_assert_int_eq(ev1.code, ev2.code);
|
||||
ck_assert_int_eq(ev1.value, ev2.value);
|
||||
}
|
||||
|
||||
/* revoke first device, expect it closed, second device still open */
|
||||
dev_fd = libevdev_get_fd(dev);
|
||||
ck_assert_int_ge(dev_fd, 0);
|
||||
rc = ioctl(dev_fd, EVIOCREVOKE, NULL);
|
||||
if (rc == -1 && errno == EINVAL) {
|
||||
fprintf(stderr, "WARNING: skipping EVIOCREVOKE test, not suported by current kernel\n");
|
||||
goto out;
|
||||
}
|
||||
ck_assert_msg(rc == 0, "Failed to revoke device: %s", strerror(errno));
|
||||
|
||||
uinput_device_event(uidev, EV_REL, REL_X, 1);
|
||||
uinput_device_event(uidev, EV_SYN, SYN_REPORT, 0);
|
||||
|
||||
rc = libevdev_next_event(dev, LIBEVDEV_READ_FLAG_NORMAL, &ev1);
|
||||
ck_assert_int_eq(rc, -ENODEV);
|
||||
|
||||
rc = libevdev_next_event(dev2, LIBEVDEV_READ_FLAG_NORMAL, &ev2);
|
||||
ck_assert_int_eq(rc, LIBEVDEV_READ_STATUS_SUCCESS);
|
||||
|
||||
out:
|
||||
uinput_device_free(uidev);
|
||||
libevdev_free(dev);
|
||||
libevdev_free(dev2);
|
||||
close(fd);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_revoke_invalid)
|
||||
{
|
||||
struct uinput_device* uidev;
|
||||
struct libevdev *dev;
|
||||
int rc;
|
||||
int dev_fd;
|
||||
|
||||
test_create_device(&uidev, &dev,
|
||||
EV_SYN, SYN_REPORT,
|
||||
EV_REL, REL_X,
|
||||
EV_REL, REL_Y,
|
||||
EV_REL, REL_WHEEL,
|
||||
EV_KEY, BTN_LEFT,
|
||||
EV_KEY, BTN_MIDDLE,
|
||||
EV_KEY, BTN_RIGHT,
|
||||
-1);
|
||||
|
||||
dev_fd = libevdev_get_fd(dev);
|
||||
ck_assert_int_ge(dev_fd, 0);
|
||||
/* ioctl requires 0 as value */
|
||||
rc = ioctl(dev_fd, EVIOCREVOKE, 1);
|
||||
ck_assert_int_eq(rc, -1);
|
||||
ck_assert_int_eq(errno, EINVAL);
|
||||
|
||||
uinput_device_free(uidev);
|
||||
libevdev_free(dev);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_revoke_fail_after)
|
||||
{
|
||||
struct uinput_device* uidev;
|
||||
struct libevdev *dev, *dev2 = NULL;
|
||||
int rc, fd;
|
||||
|
||||
test_create_device(&uidev, &dev,
|
||||
EV_SYN, SYN_REPORT,
|
||||
EV_REL, REL_X,
|
||||
EV_REL, REL_Y,
|
||||
EV_REL, REL_WHEEL,
|
||||
EV_KEY, BTN_LEFT,
|
||||
EV_KEY, BTN_MIDDLE,
|
||||
EV_KEY, BTN_RIGHT,
|
||||
-1);
|
||||
|
||||
fd = open(uinput_device_get_devnode(uidev), O_RDONLY|O_NONBLOCK);
|
||||
ck_assert_int_gt(fd, -1);
|
||||
|
||||
rc = ioctl(fd, EVIOCREVOKE, NULL);
|
||||
if (rc == -1 && errno == EINVAL) {
|
||||
fprintf(stderr, "WARNING: skipping EVIOCREVOKE test, not suported by current kernel\n");
|
||||
goto out;
|
||||
}
|
||||
ck_assert_msg(rc == 0, "Failed to revoke device: %s", strerror(errno));
|
||||
|
||||
rc = libevdev_new_from_fd(fd, &dev2);
|
||||
ck_assert_int_eq(rc, -ENODEV);
|
||||
|
||||
out:
|
||||
uinput_device_free(uidev);
|
||||
libevdev_free(dev);
|
||||
close(fd);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
TEST_SUITE_ROOT_PRIVILEGES(kernel)
|
||||
{
|
||||
Suite *s = suite_create("kernel");
|
||||
|
||||
add_test(s, test_revoke);
|
||||
add_test(s, test_revoke_invalid);
|
||||
add_test(s, test_revoke_fail_after);
|
||||
|
||||
return s;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,721 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2013 Red Hat, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting documentation, and
|
||||
* that the name of the copyright holders not be used in advertising or
|
||||
* publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission. The copyright holders make no representations
|
||||
* about the suitability of this software for any purpose. It is provided "as
|
||||
* is" without express or implied warranty.
|
||||
*
|
||||
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
* OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <errno.h>
|
||||
#include <inttypes.h>
|
||||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include <libevdev/libevdev-uinput.h>
|
||||
#include "test-common.h"
|
||||
|
||||
START_TEST(test_new_device)
|
||||
{
|
||||
struct libevdev *dev;
|
||||
|
||||
dev = libevdev_new();
|
||||
ck_assert(dev != NULL);
|
||||
libevdev_free(dev);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_free_device)
|
||||
{
|
||||
libevdev_free(NULL);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_init_from_invalid_fd)
|
||||
{
|
||||
int rc;
|
||||
struct libevdev *dev = NULL;
|
||||
|
||||
rc = libevdev_new_from_fd(-1, &dev);
|
||||
|
||||
ck_assert(dev == NULL);
|
||||
ck_assert_int_eq(rc, -EBADF);
|
||||
|
||||
rc = libevdev_new_from_fd(STDIN_FILENO, &dev);
|
||||
ck_assert(dev == NULL);
|
||||
ck_assert_int_eq(rc, -ENOTTY);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_init_and_change_fd)
|
||||
{
|
||||
struct uinput_device* uidev;
|
||||
struct libevdev *dev;
|
||||
int rc;
|
||||
|
||||
dev = libevdev_new();
|
||||
ck_assert(dev != NULL);
|
||||
ck_assert_int_eq(libevdev_set_fd(dev, -1), -EBADF);
|
||||
|
||||
libevdev_set_log_function(test_logfunc_ignore_error, NULL);
|
||||
ck_assert_int_eq(libevdev_change_fd(dev, -1), -1);
|
||||
libevdev_set_log_function(test_logfunc_abort_on_error, NULL);
|
||||
|
||||
rc = uinput_device_new_with_events(&uidev,
|
||||
TEST_DEVICE_NAME, DEFAULT_IDS,
|
||||
EV_SYN, SYN_REPORT,
|
||||
EV_REL, REL_X,
|
||||
EV_REL, REL_Y,
|
||||
EV_REL, REL_WHEEL,
|
||||
EV_KEY, BTN_LEFT,
|
||||
EV_KEY, BTN_MIDDLE,
|
||||
EV_KEY, BTN_RIGHT,
|
||||
-1);
|
||||
ck_assert_msg(rc == 0, "Failed to create uinput device: %s", strerror(-rc));
|
||||
ck_assert_int_eq(libevdev_set_fd(dev, uinput_device_get_fd(uidev)), 0);
|
||||
|
||||
libevdev_set_log_function(test_logfunc_ignore_error, NULL);
|
||||
ck_assert_int_eq(libevdev_set_fd(dev, 0), -EBADF);
|
||||
libevdev_set_log_function(test_logfunc_abort_on_error, NULL);
|
||||
|
||||
ck_assert_int_eq(libevdev_get_fd(dev), uinput_device_get_fd(uidev));
|
||||
|
||||
ck_assert_int_eq(libevdev_change_fd(dev, 0), 0);
|
||||
ck_assert_int_eq(libevdev_get_fd(dev), 0);
|
||||
|
||||
uinput_device_free(uidev);
|
||||
libevdev_free(dev);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
static int log_fn_called = 0;
|
||||
static char *logdata = "test";
|
||||
static void logfunc(enum libevdev_log_priority priority,
|
||||
void *data,
|
||||
const char *file, int line, const char *func,
|
||||
const char *f, va_list args) {
|
||||
ck_assert_int_eq(strcmp(logdata, data), 0);
|
||||
log_fn_called++;
|
||||
}
|
||||
|
||||
START_TEST(test_log_init)
|
||||
{
|
||||
struct libevdev *dev = NULL;
|
||||
enum libevdev_log_priority old;
|
||||
|
||||
old = libevdev_get_log_priority();
|
||||
|
||||
libevdev_set_log_priority(LIBEVDEV_LOG_DEBUG);
|
||||
|
||||
libevdev_set_log_function(logfunc, NULL);
|
||||
libevdev_set_log_function(NULL, NULL);
|
||||
|
||||
dev = libevdev_new();
|
||||
ck_assert(dev != NULL);
|
||||
|
||||
libevdev_set_log_function(logfunc, logdata);
|
||||
libevdev_next_event(dev, LIBEVDEV_READ_FLAG_NORMAL, NULL);
|
||||
|
||||
libevdev_set_log_function(NULL, NULL);
|
||||
libevdev_next_event(dev, LIBEVDEV_READ_FLAG_NORMAL, NULL);
|
||||
|
||||
libevdev_set_log_function(logfunc, logdata);
|
||||
libevdev_next_event(dev, LIBEVDEV_READ_FLAG_NORMAL, NULL);
|
||||
|
||||
/* libevdev_next_event(dev, LIBEVDEV_READ_FLAG_NORMAL, NULL) should
|
||||
trigger a log message. We called it three times, but only twice
|
||||
with the logfunc set, thus, ensure we only called the logfunc
|
||||
twice */
|
||||
ck_assert_int_eq(log_fn_called, 2);
|
||||
|
||||
libevdev_free(dev);
|
||||
|
||||
libevdev_set_log_function(test_logfunc_abort_on_error, NULL);
|
||||
|
||||
log_fn_called = 0;
|
||||
|
||||
libevdev_set_log_priority(old);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_log_default_priority)
|
||||
{
|
||||
ck_assert_int_eq(libevdev_get_log_priority(), LIBEVDEV_LOG_INFO);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_log_set_get_priority)
|
||||
{
|
||||
enum libevdev_log_priority pri;
|
||||
enum libevdev_log_priority old;
|
||||
|
||||
old = libevdev_get_log_priority();
|
||||
|
||||
pri = LIBEVDEV_LOG_DEBUG;
|
||||
libevdev_set_log_priority(pri);
|
||||
ck_assert_int_eq(libevdev_get_log_priority(), pri);
|
||||
|
||||
pri = LIBEVDEV_LOG_INFO;
|
||||
libevdev_set_log_priority(pri);
|
||||
ck_assert_int_eq(libevdev_get_log_priority(), pri);
|
||||
|
||||
pri = LIBEVDEV_LOG_ERROR;
|
||||
libevdev_set_log_priority(pri);
|
||||
ck_assert_int_eq(libevdev_get_log_priority(), pri);
|
||||
|
||||
/* debug and above is clamped */
|
||||
pri = LIBEVDEV_LOG_DEBUG + 1;
|
||||
libevdev_set_log_priority(pri);
|
||||
ck_assert_int_eq(libevdev_get_log_priority(), LIBEVDEV_LOG_DEBUG);
|
||||
|
||||
/* error and below is not clamped, we need this for another test */
|
||||
pri = LIBEVDEV_LOG_ERROR - 1;
|
||||
libevdev_set_log_priority(pri);
|
||||
ck_assert_int_eq(libevdev_get_log_priority(), pri);
|
||||
|
||||
libevdev_set_log_priority(old);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_log_priority)
|
||||
{
|
||||
struct libevdev *dev = NULL;
|
||||
enum libevdev_log_priority old;
|
||||
|
||||
old = libevdev_get_log_priority();
|
||||
|
||||
libevdev_set_log_function(logfunc, logdata);
|
||||
|
||||
dev = libevdev_new();
|
||||
ck_assert(dev != NULL);
|
||||
|
||||
libevdev_set_log_priority(LIBEVDEV_LOG_DEBUG);
|
||||
libevdev_next_event(dev, LIBEVDEV_READ_FLAG_NORMAL, NULL);
|
||||
ck_assert_int_eq(log_fn_called, 1);
|
||||
|
||||
libevdev_set_log_priority(LIBEVDEV_LOG_INFO);
|
||||
libevdev_next_event(dev, LIBEVDEV_READ_FLAG_NORMAL, NULL);
|
||||
ck_assert_int_eq(log_fn_called, 2);
|
||||
|
||||
libevdev_set_log_priority(LIBEVDEV_LOG_ERROR);
|
||||
libevdev_next_event(dev, LIBEVDEV_READ_FLAG_NORMAL, NULL);
|
||||
ck_assert_int_eq(log_fn_called, 3);
|
||||
|
||||
/* we don't have any log msgs > ERROR at the moment, so test it by
|
||||
setting an invalid priority. */
|
||||
libevdev_set_log_priority(LIBEVDEV_LOG_ERROR - 1);
|
||||
libevdev_next_event(dev, LIBEVDEV_READ_FLAG_NORMAL, NULL);
|
||||
ck_assert_int_eq(log_fn_called, 3);
|
||||
|
||||
libevdev_free(dev);
|
||||
|
||||
libevdev_set_log_function(test_logfunc_abort_on_error, NULL);
|
||||
|
||||
log_fn_called = 0;
|
||||
|
||||
libevdev_set_log_priority(old);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
static char *logdata_1 = "foo";
|
||||
static char *logdata_2 = "bar";
|
||||
static int log_data_fn_called = 0;
|
||||
static void logfunc_data(enum libevdev_log_priority priority,
|
||||
void *data,
|
||||
const char *file, int line, const char *func,
|
||||
const char *f, va_list args) {
|
||||
switch(log_data_fn_called) {
|
||||
case 0: ck_assert(data == logdata_1); break;
|
||||
case 1: ck_assert(data == logdata_2); break;
|
||||
case 2: ck_assert(data == NULL); break;
|
||||
default:
|
||||
ck_abort();
|
||||
}
|
||||
log_data_fn_called++;
|
||||
}
|
||||
|
||||
START_TEST(test_log_data)
|
||||
{
|
||||
struct libevdev *dev = NULL;
|
||||
|
||||
dev = libevdev_new();
|
||||
ck_assert(dev != NULL);
|
||||
|
||||
libevdev_set_log_function(logfunc_data, logdata_1);
|
||||
libevdev_next_event(dev, LIBEVDEV_READ_FLAG_NORMAL, NULL);
|
||||
|
||||
libevdev_set_log_function(logfunc_data, logdata_2);
|
||||
libevdev_next_event(dev, LIBEVDEV_READ_FLAG_NORMAL, NULL);
|
||||
|
||||
libevdev_set_log_function(logfunc_data, NULL);
|
||||
libevdev_next_event(dev, LIBEVDEV_READ_FLAG_NORMAL, NULL);
|
||||
|
||||
libevdev_free(dev);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
struct libevdev *devlogdata;
|
||||
static int dev_log_fn_called = 0;
|
||||
static void devlogfunc(const struct libevdev *dev,
|
||||
enum libevdev_log_priority priority,
|
||||
void *data,
|
||||
const char *file, int line, const char *func,
|
||||
const char *f, va_list args)
|
||||
{
|
||||
ck_assert(dev == data);
|
||||
dev_log_fn_called++;
|
||||
}
|
||||
|
||||
START_TEST(test_device_log_init)
|
||||
{
|
||||
struct libevdev *dev = NULL;
|
||||
enum libevdev_log_priority old;
|
||||
|
||||
old = libevdev_get_log_priority();
|
||||
libevdev_set_log_priority(LIBEVDEV_LOG_DEBUG);
|
||||
libevdev_set_log_function(logfunc, logdata);
|
||||
|
||||
/* error for NULL device */
|
||||
libevdev_set_device_log_function(NULL, NULL,
|
||||
LIBEVDEV_LOG_ERROR, NULL);
|
||||
ck_assert_int_eq(log_fn_called, 1);
|
||||
|
||||
/* error for NULL device */
|
||||
libevdev_set_device_log_function(NULL, devlogfunc,
|
||||
LIBEVDEV_LOG_ERROR, NULL);
|
||||
ck_assert_int_eq(log_fn_called, 2);
|
||||
|
||||
log_fn_called = 0;
|
||||
|
||||
dev = libevdev_new();
|
||||
ck_assert(dev != NULL);
|
||||
|
||||
libevdev_set_device_log_function(dev, NULL,
|
||||
LIBEVDEV_LOG_ERROR, NULL);
|
||||
|
||||
/* libevdev_next_event(dev, LIBEVDEV_READ_FLAG_NORMAL, NULL) should
|
||||
trigger a log message. */
|
||||
|
||||
/* expect global handler triggered */
|
||||
libevdev_next_event(dev, LIBEVDEV_READ_FLAG_NORMAL, NULL);
|
||||
ck_assert_int_eq(log_fn_called, 1);
|
||||
ck_assert_int_eq(dev_log_fn_called, 0);
|
||||
|
||||
/* expect device handler triggered */
|
||||
libevdev_set_device_log_function(dev, devlogfunc,
|
||||
LIBEVDEV_LOG_ERROR, dev);
|
||||
libevdev_next_event(dev, LIBEVDEV_READ_FLAG_NORMAL, NULL);
|
||||
ck_assert_int_eq(log_fn_called, 1);
|
||||
ck_assert_int_eq(dev_log_fn_called, 1);
|
||||
|
||||
/* device handler set, but priority filters. don't expect any log
|
||||
handler to be called.
|
||||
we don't have any log msgs > ERROR at the moment, so test it by
|
||||
setting an invalid priority. */
|
||||
libevdev_set_device_log_function(dev, devlogfunc,
|
||||
LIBEVDEV_LOG_ERROR - 1, dev);
|
||||
libevdev_next_event(dev, LIBEVDEV_READ_FLAG_NORMAL, NULL);
|
||||
ck_assert_int_eq(log_fn_called, 1);
|
||||
ck_assert_int_eq(dev_log_fn_called, 1);
|
||||
|
||||
libevdev_free(dev);
|
||||
|
||||
log_fn_called = 0;
|
||||
libevdev_set_log_priority(old);
|
||||
libevdev_set_log_function(test_logfunc_abort_on_error, NULL);
|
||||
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_device_init)
|
||||
{
|
||||
struct uinput_device* uidev;
|
||||
struct libevdev *dev;
|
||||
int rc;
|
||||
|
||||
rc = uinput_device_new_with_events(&uidev,
|
||||
TEST_DEVICE_NAME, DEFAULT_IDS,
|
||||
EV_SYN, SYN_REPORT,
|
||||
EV_REL, REL_X,
|
||||
EV_REL, REL_Y,
|
||||
EV_REL, REL_WHEEL,
|
||||
EV_KEY, BTN_LEFT,
|
||||
EV_KEY, BTN_MIDDLE,
|
||||
EV_KEY, BTN_RIGHT,
|
||||
-1);
|
||||
ck_assert_msg(rc == 0, "Failed to create uinput device: %s", strerror(-rc));
|
||||
|
||||
dev = libevdev_new();
|
||||
ck_assert(dev != NULL);
|
||||
rc = libevdev_set_fd(dev, uinput_device_get_fd(uidev));
|
||||
ck_assert_msg(rc == 0, "Failed to init device: %s", strerror(-rc));;
|
||||
|
||||
uinput_device_free(uidev);
|
||||
libevdev_free(dev);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_device_init_from_fd)
|
||||
{
|
||||
struct uinput_device* uidev;
|
||||
struct libevdev *dev;
|
||||
int rc;
|
||||
|
||||
rc = uinput_device_new_with_events(&uidev,
|
||||
TEST_DEVICE_NAME, DEFAULT_IDS,
|
||||
EV_SYN, SYN_REPORT,
|
||||
EV_REL, REL_X,
|
||||
EV_REL, REL_Y,
|
||||
EV_REL, REL_WHEEL,
|
||||
EV_KEY, BTN_LEFT,
|
||||
EV_KEY, BTN_MIDDLE,
|
||||
EV_KEY, BTN_RIGHT,
|
||||
-1);
|
||||
ck_assert_msg(rc == 0, "Failed to create uinput device: %s", strerror(-rc));
|
||||
|
||||
rc = libevdev_new_from_fd(uinput_device_get_fd(uidev), &dev);
|
||||
ck_assert_msg(rc == 0, "Failed to init device: %s", strerror(-rc));;
|
||||
|
||||
uinput_device_free(uidev);
|
||||
libevdev_free(dev);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_device_grab)
|
||||
{
|
||||
struct uinput_device* uidev;
|
||||
struct libevdev *dev;
|
||||
int rc;
|
||||
|
||||
test_create_device(&uidev, &dev,
|
||||
EV_SYN, SYN_REPORT,
|
||||
EV_REL, REL_X,
|
||||
EV_REL, REL_Y,
|
||||
EV_REL, REL_WHEEL,
|
||||
EV_KEY, BTN_LEFT,
|
||||
EV_KEY, BTN_MIDDLE,
|
||||
EV_KEY, BTN_RIGHT,
|
||||
-1);
|
||||
|
||||
libevdev_set_log_function(test_logfunc_ignore_error, NULL);
|
||||
rc = libevdev_grab(dev, 0);
|
||||
ck_assert_int_eq(rc, -EINVAL);
|
||||
rc = libevdev_grab(dev, 1);
|
||||
ck_assert_int_eq(rc, -EINVAL);
|
||||
libevdev_set_log_function(test_logfunc_abort_on_error, NULL);
|
||||
|
||||
rc = libevdev_grab(dev, LIBEVDEV_UNGRAB);
|
||||
ck_assert_int_eq(rc, 0);
|
||||
rc = libevdev_grab(dev, LIBEVDEV_GRAB);
|
||||
ck_assert_int_eq(rc, 0);
|
||||
rc = libevdev_grab(dev, LIBEVDEV_GRAB);
|
||||
ck_assert_int_eq(rc, 0);
|
||||
rc = libevdev_grab(dev, LIBEVDEV_UNGRAB);
|
||||
ck_assert_int_eq(rc, 0);
|
||||
|
||||
uinput_device_free(uidev);
|
||||
libevdev_free(dev);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_device_grab_invalid_fd)
|
||||
{
|
||||
struct uinput_device* uidev;
|
||||
struct libevdev *dev;
|
||||
int rc;
|
||||
|
||||
libevdev_set_log_function(test_logfunc_ignore_error, NULL);
|
||||
|
||||
dev = libevdev_new();
|
||||
rc = libevdev_grab(dev, 0);
|
||||
ck_assert_int_eq(rc, -EBADF);
|
||||
libevdev_free(dev);
|
||||
|
||||
test_create_device(&uidev, &dev,
|
||||
EV_SYN, SYN_REPORT,
|
||||
EV_REL, REL_X,
|
||||
EV_REL, REL_Y,
|
||||
EV_REL, REL_WHEEL,
|
||||
EV_KEY, BTN_LEFT,
|
||||
EV_KEY, BTN_MIDDLE,
|
||||
EV_KEY, BTN_RIGHT,
|
||||
-1);
|
||||
libevdev_change_fd(dev, -2);
|
||||
rc = libevdev_grab(dev, 0);
|
||||
ck_assert_int_eq(rc, -EBADF);
|
||||
|
||||
libevdev_set_log_function(test_logfunc_abort_on_error, NULL);
|
||||
|
||||
uinput_device_free(uidev);
|
||||
libevdev_free(dev);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_device_grab_change_fd)
|
||||
{
|
||||
struct libevdev_uinput *uidev;
|
||||
struct libevdev *dev, *other;
|
||||
struct input_event e;
|
||||
int rc;
|
||||
int other_fd;
|
||||
int dev_fd;
|
||||
|
||||
dev = libevdev_new();
|
||||
libevdev_set_name(dev, "libevdev test device");
|
||||
libevdev_enable_event_code(dev, EV_REL, REL_X, NULL);
|
||||
libevdev_enable_event_code(dev, EV_REL, REL_Y, NULL);
|
||||
libevdev_enable_event_code(dev, EV_KEY, BTN_LEFT, NULL);
|
||||
|
||||
rc = libevdev_uinput_create_from_device(dev,
|
||||
LIBEVDEV_UINPUT_OPEN_MANAGED,
|
||||
&uidev);
|
||||
ck_assert_int_eq(rc, 0);
|
||||
libevdev_free(dev);
|
||||
|
||||
dev_fd = open(libevdev_uinput_get_devnode(uidev),
|
||||
O_RDONLY|O_NONBLOCK);
|
||||
ck_assert_int_ne(dev_fd, -1);
|
||||
rc = libevdev_new_from_fd(dev_fd, &dev);
|
||||
ck_assert_int_eq(rc, 0);
|
||||
|
||||
other_fd = open(libevdev_uinput_get_devnode(uidev),
|
||||
O_RDONLY|O_NONBLOCK);
|
||||
ck_assert_int_ne(other_fd, -1);
|
||||
rc = libevdev_new_from_fd(other_fd, &other);
|
||||
ck_assert_int_eq(rc, 0);
|
||||
|
||||
/* check we're getting the events before the grab */
|
||||
libevdev_uinput_write_event(uidev, EV_REL, REL_X, -1);
|
||||
libevdev_uinput_write_event(uidev, EV_SYN, SYN_REPORT, 0);
|
||||
rc = libevdev_next_event(other, LIBEVDEV_READ_FLAG_NORMAL, &e);
|
||||
ck_assert_int_eq(rc, LIBEVDEV_READ_STATUS_SUCCESS);
|
||||
rc = libevdev_next_event(other, LIBEVDEV_READ_FLAG_NORMAL, &e);
|
||||
ck_assert_int_eq(rc, LIBEVDEV_READ_STATUS_SUCCESS);
|
||||
rc = libevdev_next_event(other, LIBEVDEV_READ_FLAG_NORMAL, &e);
|
||||
ck_assert_int_eq(rc, -EAGAIN);
|
||||
|
||||
/* no events after the grab */
|
||||
rc = libevdev_grab(dev, LIBEVDEV_GRAB);
|
||||
ck_assert_int_eq(rc, 0);
|
||||
libevdev_uinput_write_event(uidev, EV_REL, REL_X, -1);
|
||||
libevdev_uinput_write_event(uidev, EV_SYN, SYN_REPORT, 0);
|
||||
rc = libevdev_grab(dev, LIBEVDEV_GRAB);
|
||||
ck_assert_int_eq(rc, 0);
|
||||
rc = libevdev_next_event(other, LIBEVDEV_READ_FLAG_NORMAL, &e);
|
||||
ck_assert_int_eq(rc, -EAGAIN);
|
||||
|
||||
/* swapping the fd removes the grab */
|
||||
close(dev_fd);
|
||||
dev_fd = open(libevdev_uinput_get_devnode(uidev),
|
||||
O_RDONLY|O_NONBLOCK);
|
||||
ck_assert_int_ne(dev_fd, -1);
|
||||
rc = libevdev_change_fd(dev, dev_fd);
|
||||
ck_assert_int_eq(rc, 0);
|
||||
|
||||
/* check we're getting the events again */
|
||||
libevdev_uinput_write_event(uidev, EV_REL, REL_X, -1);
|
||||
libevdev_uinput_write_event(uidev, EV_SYN, SYN_REPORT, 0);
|
||||
rc = libevdev_next_event(other, LIBEVDEV_READ_FLAG_NORMAL, &e);
|
||||
ck_assert_int_eq(rc, LIBEVDEV_READ_STATUS_SUCCESS);
|
||||
rc = libevdev_next_event(other, LIBEVDEV_READ_FLAG_NORMAL, &e);
|
||||
ck_assert_int_eq(rc, LIBEVDEV_READ_STATUS_SUCCESS);
|
||||
rc = libevdev_next_event(other, LIBEVDEV_READ_FLAG_NORMAL, &e);
|
||||
ck_assert_int_eq(rc, -EAGAIN);
|
||||
|
||||
/* no events after the grab */
|
||||
rc = libevdev_grab(dev, LIBEVDEV_GRAB);
|
||||
ck_assert_int_eq(rc, 0);
|
||||
libevdev_uinput_write_event(uidev, EV_REL, REL_X, -1);
|
||||
libevdev_uinput_write_event(uidev, EV_SYN, SYN_REPORT, 0);
|
||||
rc = libevdev_next_event(other, LIBEVDEV_READ_FLAG_NORMAL, &e);
|
||||
ck_assert_int_eq(rc, -EAGAIN);
|
||||
|
||||
libevdev_uinput_destroy(uidev);
|
||||
libevdev_free(dev);
|
||||
libevdev_free(other);
|
||||
close(dev_fd);
|
||||
close(other_fd);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_set_clock_id)
|
||||
{
|
||||
struct uinput_device* uidev;
|
||||
struct libevdev *dev;
|
||||
int clockid;
|
||||
int rc;
|
||||
|
||||
test_create_device(&uidev, &dev,
|
||||
EV_SYN, SYN_REPORT,
|
||||
EV_REL, REL_X,
|
||||
EV_REL, REL_Y,
|
||||
EV_REL, REL_WHEEL,
|
||||
EV_KEY, BTN_LEFT,
|
||||
EV_KEY, BTN_MIDDLE,
|
||||
EV_KEY, BTN_RIGHT,
|
||||
-1);
|
||||
|
||||
rc = libevdev_set_clock_id(dev, CLOCK_REALTIME);
|
||||
ck_assert_int_eq(rc, 0);
|
||||
|
||||
rc = libevdev_set_clock_id(dev, CLOCK_MONOTONIC);
|
||||
ck_assert_int_eq(rc, 0);
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
clockid = CLOCK_MONOTONIC_FAST;
|
||||
#else
|
||||
clockid = CLOCK_MONOTONIC_RAW;
|
||||
#endif
|
||||
|
||||
rc = libevdev_set_clock_id(dev, clockid);
|
||||
ck_assert_int_eq(rc, -EINVAL);
|
||||
|
||||
uinput_device_free(uidev);
|
||||
libevdev_free(dev);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_set_clock_id_invalid_fd)
|
||||
{
|
||||
struct uinput_device* uidev;
|
||||
struct libevdev *dev;
|
||||
int rc;
|
||||
|
||||
libevdev_set_log_function(test_logfunc_ignore_error, NULL);
|
||||
|
||||
dev = libevdev_new();
|
||||
rc = libevdev_set_clock_id(dev, CLOCK_MONOTONIC);
|
||||
ck_assert_int_eq(rc, -EBADF);
|
||||
libevdev_free(dev);
|
||||
|
||||
test_create_device(&uidev, &dev,
|
||||
EV_SYN, SYN_REPORT,
|
||||
EV_REL, REL_X,
|
||||
EV_REL, REL_Y,
|
||||
EV_REL, REL_WHEEL,
|
||||
EV_KEY, BTN_LEFT,
|
||||
EV_KEY, BTN_MIDDLE,
|
||||
EV_KEY, BTN_RIGHT,
|
||||
-1);
|
||||
libevdev_change_fd(dev, -2);
|
||||
rc = libevdev_set_clock_id(dev, CLOCK_MONOTONIC);
|
||||
ck_assert_int_eq(rc, -EBADF);
|
||||
|
||||
uinput_device_free(uidev);
|
||||
libevdev_free(dev);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_clock_id_events)
|
||||
{
|
||||
struct uinput_device* uidev;
|
||||
struct libevdev *dev, *dev2;
|
||||
int rc, fd;
|
||||
struct input_event ev1, ev2;
|
||||
struct timespec t1_real, t2_real;
|
||||
struct timespec t1_mono, t2_mono;
|
||||
int64_t t1, t2;
|
||||
|
||||
test_create_device(&uidev, &dev,
|
||||
EV_SYN, SYN_REPORT,
|
||||
EV_REL, REL_X,
|
||||
EV_REL, REL_Y,
|
||||
EV_REL, REL_WHEEL,
|
||||
EV_KEY, BTN_LEFT,
|
||||
EV_KEY, BTN_MIDDLE,
|
||||
EV_KEY, BTN_RIGHT,
|
||||
-1);
|
||||
|
||||
fd = open(uinput_device_get_devnode(uidev), O_RDONLY);
|
||||
ck_assert_int_gt(fd, -1);
|
||||
|
||||
rc = libevdev_new_from_fd(fd, &dev2);
|
||||
ck_assert_msg(rc == 0, "Failed to create second device: %s", strerror(-rc));
|
||||
|
||||
rc = libevdev_set_clock_id(dev2, CLOCK_MONOTONIC);
|
||||
ck_assert_int_eq(rc, 0);
|
||||
|
||||
clock_gettime(CLOCK_REALTIME, &t1_real);
|
||||
clock_gettime(CLOCK_MONOTONIC, &t1_mono);
|
||||
uinput_device_event(uidev, EV_REL, REL_X, 1);
|
||||
uinput_device_event(uidev, EV_SYN, SYN_REPORT, 0);
|
||||
clock_gettime(CLOCK_REALTIME, &t2_real);
|
||||
clock_gettime(CLOCK_MONOTONIC, &t2_mono);
|
||||
|
||||
rc = libevdev_next_event(dev, LIBEVDEV_READ_FLAG_NORMAL, &ev1);
|
||||
ck_assert_int_eq(rc, LIBEVDEV_READ_STATUS_SUCCESS);
|
||||
|
||||
rc = libevdev_next_event(dev2, LIBEVDEV_READ_FLAG_NORMAL, &ev2);
|
||||
ck_assert_int_eq(rc, LIBEVDEV_READ_STATUS_SUCCESS);
|
||||
|
||||
ck_assert_int_eq(ev1.type, ev2.type);
|
||||
ck_assert_int_eq(ev1.code, ev2.code);
|
||||
ck_assert_int_eq(ev1.value, ev2.value);
|
||||
|
||||
t1 = ev1.input_event_sec * 1000000LL + ev1.input_event_usec;
|
||||
t2 = ev2.input_event_sec * 1000000LL + ev2.input_event_usec;
|
||||
ck_assert_int_ne(t1, t2);
|
||||
|
||||
ck_assert_int_ge(ev1.input_event_sec, t1_real.tv_sec);
|
||||
ck_assert_int_ge(ev1.input_event_usec, t1_real.tv_nsec/1000);
|
||||
ck_assert_int_le(ev1.input_event_sec, t2_real.tv_sec);
|
||||
ck_assert_int_le(ev1.input_event_usec, t2_real.tv_nsec/1000);
|
||||
|
||||
ck_assert_int_ge(ev2.input_event_sec, t1_mono.tv_sec);
|
||||
ck_assert_int_ge(ev2.input_event_usec, t1_mono.tv_nsec/1000);
|
||||
ck_assert_int_le(ev2.input_event_sec, t2_mono.tv_sec);
|
||||
ck_assert_int_le(ev2.input_event_usec, t2_mono.tv_nsec/1000);
|
||||
|
||||
uinput_device_free(uidev);
|
||||
libevdev_free(dev);
|
||||
libevdev_free(dev2);
|
||||
close(fd);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
TEST_SUITE_ROOT_PRIVILEGES(libevdev_init_test)
|
||||
{
|
||||
Suite *s = suite_create("libevdev init tests");
|
||||
|
||||
add_test(s, test_new_device);
|
||||
add_test(s, test_free_device);
|
||||
add_test(s, test_init_from_invalid_fd);
|
||||
add_test(s, test_init_and_change_fd);
|
||||
|
||||
add_test(s, test_log_init);
|
||||
add_test(s, test_log_priority);
|
||||
add_test(s, test_log_set_get_priority);
|
||||
add_test(s, test_log_default_priority);
|
||||
add_test(s, test_log_data);
|
||||
add_test(s, test_device_log_init);
|
||||
|
||||
add_test(s, test_device_init);
|
||||
add_test(s, test_device_init_from_fd);
|
||||
|
||||
add_test(s, test_device_grab);
|
||||
add_test(s, test_device_grab_invalid_fd);
|
||||
add_test(s, test_device_grab_change_fd);
|
||||
|
||||
add_test(s, test_set_clock_id);
|
||||
add_test(s, test_set_clock_id_invalid_fd);
|
||||
add_test(s, test_clock_id_events);
|
||||
|
||||
return s;
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
#include <stddef.h>
|
||||
#include <libevdev/libevdev.h>
|
||||
|
||||
int main(void) {
|
||||
return libevdev_new_from_fd(0, NULL);
|
||||
}
|
||||
@@ -1,134 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2013 Red Hat, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting documentation, and
|
||||
* that the name of the copyright holders not be used in advertising or
|
||||
* publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission. The copyright holders make no representations
|
||||
* about the suitability of this software for any purpose. It is provided "as
|
||||
* is" without express or implied warranty.
|
||||
*
|
||||
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
* OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <check.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/ptrace.h>
|
||||
#include <sys/resource.h>
|
||||
#include <sys/wait.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <libevdev/libevdev.h>
|
||||
|
||||
#include "test-common.h"
|
||||
|
||||
static int
|
||||
is_debugger_attached(void)
|
||||
{
|
||||
int rc = 1;
|
||||
/*
|
||||
* FreeBSD does not support PTRACE_ATTACH, disable attaching a debugger
|
||||
* on FreeBSD by skipping the rest of the function and just return 1.
|
||||
*/
|
||||
#ifndef __FreeBSD__
|
||||
int status;
|
||||
int pid = fork();
|
||||
|
||||
if (pid == -1)
|
||||
return 0;
|
||||
|
||||
if (pid == 0) {
|
||||
int ppid = getppid();
|
||||
if (ptrace(PTRACE_ATTACH, ppid, NULL, NULL) == 0) {
|
||||
waitpid(ppid, NULL, 0);
|
||||
ptrace(PTRACE_CONT, NULL, NULL);
|
||||
ptrace(PTRACE_DETACH, ppid, NULL, NULL);
|
||||
rc = 0;
|
||||
}
|
||||
_exit(rc);
|
||||
} else {
|
||||
waitpid(pid, &status, 0);
|
||||
rc = WEXITSTATUS(status);
|
||||
}
|
||||
|
||||
#endif /* !__FreeBSD__ */
|
||||
return rc;
|
||||
}
|
||||
|
||||
static bool
|
||||
device_nodes_exist(void)
|
||||
{
|
||||
struct stat st;
|
||||
int rc;
|
||||
|
||||
rc = stat("/dev/uinput", &st);
|
||||
if (rc == -1 && errno == ENOENT)
|
||||
return false;
|
||||
|
||||
rc = stat("/dev/input", &st);
|
||||
if (rc == -1 && errno == ENOENT)
|
||||
return false;
|
||||
|
||||
/* Any issues but ENOENT we just let the test suite blow up later */
|
||||
return true;
|
||||
}
|
||||
|
||||
extern const struct libevdev_test __start_test_section, __stop_test_section;
|
||||
|
||||
int main(void)
|
||||
{
|
||||
const struct libevdev_test *t;
|
||||
const struct rlimit corelimit = {0, 0};
|
||||
int failed;
|
||||
|
||||
for (t = &__start_test_section; t < &__stop_test_section; t++) {
|
||||
if (t->needs_root_privileges) {
|
||||
if (getenv("LIBEVDEV_SKIP_ROOT_TESTS"))
|
||||
return 77;
|
||||
|
||||
if (getuid() != 0) {
|
||||
fprintf(stderr, "This test needs to run as root\n");
|
||||
return 77;
|
||||
}
|
||||
if (!device_nodes_exist()) {
|
||||
fprintf(stderr, "This test needs /dev/input and /dev/uinput to exist\n");
|
||||
return 77;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (is_debugger_attached())
|
||||
setenv("CK_FORK", "no", 0);
|
||||
|
||||
if (setrlimit(RLIMIT_CORE, &corelimit) != 0)
|
||||
perror("WARNING: Core dumps not disabled. Reason");
|
||||
|
||||
libevdev_set_log_function(test_logfunc_abort_on_error, NULL);
|
||||
|
||||
SRunner *sr = srunner_create(NULL);
|
||||
for (t = &__start_test_section; t < &__stop_test_section; t++) {
|
||||
srunner_add_suite(sr, t->setup());
|
||||
}
|
||||
|
||||
srunner_run_all(sr, CK_NORMAL);
|
||||
|
||||
failed = srunner_ntests_failed(sr);
|
||||
srunner_free(sr);
|
||||
|
||||
return failed;
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Hack to check for leaking symbols in the static library.
|
||||
# See https://bugs.freedesktop.org/show_bug.cgi?id=82785
|
||||
# Note the spaces in the expressions! After the first grep, each line
|
||||
# is " T symbol_name"
|
||||
|
||||
test -z "$RUNNING_ON_VALGRIND" || exit 77
|
||||
|
||||
builddir="$1"
|
||||
|
||||
test -f "$builddir/test-static-link" || (echo "Unable to find test file" && exit 1)
|
||||
nm --extern-only "$builddir/test-static-link" |
|
||||
grep -o -e " T .*" | \
|
||||
grep -v -e " main\$" \
|
||||
-e " atexit" \
|
||||
-e " mangle_path" \
|
||||
-e " *gcov.*" \
|
||||
-e " _.*" \
|
||||
-e " libevdev_*" && \
|
||||
echo "Leaking symbols found" && exit 1 || exit 0
|
||||
@@ -1,480 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2013 Red Hat, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting documentation, and
|
||||
* that the name of the copyright holders not be used in advertising or
|
||||
* publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission. The copyright holders make no representations
|
||||
* about the suitability of this software for any purpose. It is provided "as
|
||||
* is" without express or implied warranty.
|
||||
*
|
||||
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
* OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <linux/input.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <libevdev/libevdev-uinput.h>
|
||||
|
||||
#include "test-common.h"
|
||||
#define UINPUT_NODE "/dev/uinput"
|
||||
|
||||
START_TEST(test_uinput_create_device)
|
||||
{
|
||||
struct libevdev *dev, *dev2;
|
||||
struct libevdev_uinput *uidev;
|
||||
int fd, uinput_fd;
|
||||
unsigned int type, code;
|
||||
int rc;
|
||||
const char *devnode;
|
||||
|
||||
dev = libevdev_new();
|
||||
ck_assert(dev != NULL);
|
||||
libevdev_set_name(dev, TEST_DEVICE_NAME);
|
||||
libevdev_enable_event_type(dev, EV_SYN);
|
||||
libevdev_enable_event_type(dev, EV_REL);
|
||||
libevdev_enable_event_code(dev, EV_REL, REL_X, NULL);
|
||||
libevdev_enable_event_code(dev, EV_REL, REL_Y, NULL);
|
||||
libevdev_enable_event_code(dev, EV_REL, REL_MAX, NULL);
|
||||
|
||||
rc = libevdev_uinput_create_from_device(dev, LIBEVDEV_UINPUT_OPEN_MANAGED, &uidev);
|
||||
ck_assert_int_eq(rc, 0);
|
||||
ck_assert(uidev != NULL);
|
||||
|
||||
uinput_fd = libevdev_uinput_get_fd(uidev);
|
||||
ck_assert_int_gt(uinput_fd, -1);
|
||||
|
||||
devnode = libevdev_uinput_get_devnode(uidev);
|
||||
ck_assert(devnode != NULL);
|
||||
|
||||
fd = open(devnode, O_RDONLY);
|
||||
ck_assert_int_gt(fd, -1);
|
||||
rc = libevdev_new_from_fd(fd, &dev2);
|
||||
ck_assert_int_eq(rc, 0);
|
||||
|
||||
for (type = 0; type < EV_CNT; type++) {
|
||||
int max = libevdev_event_type_get_max(type);
|
||||
if (max == -1)
|
||||
continue;
|
||||
|
||||
for (code = 0; code < (unsigned int)max; code++) {
|
||||
ck_assert_int_eq(libevdev_has_event_code(dev, type, code),
|
||||
libevdev_has_event_code(dev2, type, code));
|
||||
}
|
||||
}
|
||||
|
||||
libevdev_free(dev);
|
||||
libevdev_free(dev2);
|
||||
libevdev_uinput_destroy(uidev);
|
||||
close(fd);
|
||||
|
||||
/* uinput fd is managed, so make sure it did get closed */
|
||||
ck_assert_int_eq(close(uinput_fd), -1);
|
||||
ck_assert_int_eq(errno, EBADF);
|
||||
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_uinput_create_device_invalid)
|
||||
{
|
||||
struct libevdev *dev;
|
||||
struct libevdev_uinput *uidev = NULL;
|
||||
int rc;
|
||||
|
||||
dev = libevdev_new();
|
||||
ck_assert(dev != NULL);
|
||||
libevdev_set_name(dev, TEST_DEVICE_NAME);
|
||||
libevdev_enable_event_type(dev, EV_SYN);
|
||||
libevdev_enable_event_type(dev, EV_REL);
|
||||
libevdev_enable_event_code(dev, EV_REL, REL_X, NULL);
|
||||
libevdev_enable_event_code(dev, EV_REL, REL_Y, NULL);
|
||||
|
||||
libevdev_set_log_function(test_logfunc_ignore_error, NULL);
|
||||
rc = libevdev_uinput_create_from_device(dev, -1, &uidev);
|
||||
ck_assert_int_eq(rc, -EBADF);
|
||||
ck_assert(uidev == NULL);
|
||||
libevdev_set_log_function(test_logfunc_abort_on_error, NULL);
|
||||
|
||||
libevdev_free(dev);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_uinput_create_device_from_fd)
|
||||
{
|
||||
struct libevdev *dev, *dev2;
|
||||
struct libevdev_uinput *uidev;
|
||||
int fd, fd2;
|
||||
unsigned int type, code;
|
||||
int rc;
|
||||
const char *devnode;
|
||||
|
||||
dev = libevdev_new();
|
||||
ck_assert(dev != NULL);
|
||||
libevdev_set_name(dev, TEST_DEVICE_NAME);
|
||||
libevdev_enable_event_type(dev, EV_SYN);
|
||||
libevdev_enable_event_type(dev, EV_REL);
|
||||
libevdev_enable_event_code(dev, EV_REL, REL_X, NULL);
|
||||
libevdev_enable_event_code(dev, EV_REL, REL_Y, NULL);
|
||||
|
||||
fd = open(UINPUT_NODE, O_RDWR);
|
||||
ck_assert_int_gt(fd, -1);
|
||||
|
||||
rc = libevdev_uinput_create_from_device(dev, fd, &uidev);
|
||||
ck_assert_int_eq(rc, 0);
|
||||
ck_assert(uidev != NULL);
|
||||
|
||||
ck_assert_int_eq(libevdev_uinput_get_fd(uidev), fd);
|
||||
|
||||
devnode = libevdev_uinput_get_devnode(uidev);
|
||||
ck_assert(devnode != NULL);
|
||||
|
||||
fd2 = open(devnode, O_RDONLY);
|
||||
ck_assert_int_gt(fd2, -1);
|
||||
rc = libevdev_new_from_fd(fd2, &dev2);
|
||||
ck_assert_int_eq(rc, 0);
|
||||
|
||||
for (type = 0; type < EV_CNT; type++) {
|
||||
int max = libevdev_event_type_get_max(type);
|
||||
if (max == -1)
|
||||
continue;
|
||||
|
||||
for (code = 0; code < (unsigned int)max; code++) {
|
||||
ck_assert_int_eq(libevdev_has_event_code(dev, type, code),
|
||||
libevdev_has_event_code(dev2, type, code));
|
||||
}
|
||||
}
|
||||
|
||||
libevdev_free(dev);
|
||||
libevdev_free(dev2);
|
||||
libevdev_uinput_destroy(uidev);
|
||||
close(fd);
|
||||
close(fd2);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
START_TEST(test_uinput_check_devnode_bsd)
|
||||
{
|
||||
struct libevdev *dev;
|
||||
struct libevdev_uinput *uidev, *uidev2;
|
||||
const char *devnode, *devnode2;
|
||||
int fd, fd2;
|
||||
int rc;
|
||||
|
||||
dev = libevdev_new();
|
||||
ck_assert(dev != NULL);
|
||||
libevdev_set_name(dev, TEST_DEVICE_NAME);
|
||||
libevdev_enable_event_type(dev, EV_SYN);
|
||||
libevdev_enable_event_type(dev, EV_REL);
|
||||
libevdev_enable_event_code(dev, EV_REL, REL_X, NULL);
|
||||
libevdev_enable_event_code(dev, EV_REL, REL_Y, NULL);
|
||||
|
||||
fd = open(UINPUT_NODE, O_RDWR);
|
||||
ck_assert_int_gt(fd, -1);
|
||||
fd2 = open(UINPUT_NODE, O_RDWR);
|
||||
ck_assert_int_gt(fd2, -1);
|
||||
|
||||
rc = libevdev_uinput_create_from_device(dev, fd, &uidev);
|
||||
ck_assert_int_eq(rc, 0);
|
||||
|
||||
/* create a second one */
|
||||
libevdev_set_name(dev, TEST_DEVICE_NAME " 2");
|
||||
rc = libevdev_uinput_create_from_device(dev, fd2, &uidev2);
|
||||
ck_assert_int_eq(rc, 0);
|
||||
|
||||
devnode = libevdev_uinput_get_devnode(uidev);
|
||||
ck_assert(devnode != NULL);
|
||||
|
||||
/* get syspath twice returns same pointer */
|
||||
devnode2 = libevdev_uinput_get_devnode(uidev);
|
||||
ck_assert(devnode == devnode2);
|
||||
|
||||
/* second dev has different devnode */
|
||||
devnode2 = libevdev_uinput_get_devnode(uidev2);
|
||||
ck_assert(strcmp(devnode, devnode2) != 0);
|
||||
|
||||
libevdev_uinput_destroy(uidev2);
|
||||
libevdev_uinput_destroy(uidev);
|
||||
|
||||
close(fd2);
|
||||
close(fd);
|
||||
|
||||
libevdev_free(dev);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_uinput_check_syspath_bsd)
|
||||
{
|
||||
struct libevdev *dev;
|
||||
struct libevdev_uinput *uidev;
|
||||
const char *syspath;
|
||||
int fd;
|
||||
int rc;
|
||||
|
||||
dev = libevdev_new();
|
||||
ck_assert(dev != NULL);
|
||||
libevdev_set_name(dev, TEST_DEVICE_NAME);
|
||||
libevdev_enable_event_type(dev, EV_SYN);
|
||||
libevdev_enable_event_type(dev, EV_REL);
|
||||
libevdev_enable_event_code(dev, EV_REL, REL_X, NULL);
|
||||
libevdev_enable_event_code(dev, EV_REL, REL_Y, NULL);
|
||||
|
||||
fd = open(UINPUT_NODE, O_RDWR);
|
||||
ck_assert_int_gt(fd, -1);
|
||||
|
||||
rc = libevdev_uinput_create_from_device(dev, fd, &uidev);
|
||||
ck_assert_int_eq(rc, 0);
|
||||
|
||||
syspath = libevdev_uinput_get_syspath(uidev);
|
||||
/* FreeBSD should always return NULL for libevdev_unput_get_syspath() */
|
||||
ck_assert(syspath == NULL);
|
||||
|
||||
libevdev_uinput_destroy(uidev);
|
||||
|
||||
close(fd);
|
||||
|
||||
libevdev_free(dev);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
#else /* !__FreeBSD__ */
|
||||
|
||||
START_TEST(test_uinput_check_syspath_time)
|
||||
{
|
||||
struct libevdev *dev;
|
||||
struct libevdev_uinput *uidev, *uidev2;
|
||||
const char *syspath, *syspath2;
|
||||
int fd, fd2;
|
||||
int rc;
|
||||
|
||||
dev = libevdev_new();
|
||||
ck_assert(dev != NULL);
|
||||
libevdev_set_name(dev, TEST_DEVICE_NAME);
|
||||
libevdev_enable_event_type(dev, EV_SYN);
|
||||
libevdev_enable_event_type(dev, EV_REL);
|
||||
libevdev_enable_event_code(dev, EV_REL, REL_X, NULL);
|
||||
libevdev_enable_event_code(dev, EV_REL, REL_Y, NULL);
|
||||
|
||||
fd = open(UINPUT_NODE, O_RDWR);
|
||||
ck_assert_int_gt(fd, -1);
|
||||
fd2 = open(UINPUT_NODE, O_RDWR);
|
||||
ck_assert_int_gt(fd2, -1);
|
||||
|
||||
rc = libevdev_uinput_create_from_device(dev, fd, &uidev);
|
||||
ck_assert_int_eq(rc, 0);
|
||||
|
||||
/* sleep for 1.5 seconds. sysfs resolution is 1 second, so
|
||||
creating both devices without delay means
|
||||
libevdev_uinput_get_syspath can't actually differ between
|
||||
them. By waiting, we get different ctime for uidev and uidev2,
|
||||
and exercise that part of the code.
|
||||
*/
|
||||
usleep(1500000);
|
||||
|
||||
/* create a second one to test the syspath time filtering code */
|
||||
rc = libevdev_uinput_create_from_device(dev, fd2, &uidev2);
|
||||
ck_assert_int_eq(rc, 0);
|
||||
|
||||
syspath = libevdev_uinput_get_syspath(uidev);
|
||||
ck_assert(syspath != NULL);
|
||||
|
||||
/* get syspath twice returns same pointer */
|
||||
syspath2 = libevdev_uinput_get_syspath(uidev);
|
||||
ck_assert(syspath == syspath2);
|
||||
|
||||
/* second dev has different syspath */
|
||||
syspath2 = libevdev_uinput_get_syspath(uidev2);
|
||||
ck_assert(strcmp(syspath, syspath2) != 0);
|
||||
|
||||
libevdev_free(dev);
|
||||
libevdev_uinput_destroy(uidev);
|
||||
libevdev_uinput_destroy(uidev2);
|
||||
|
||||
close(fd);
|
||||
close(fd2);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_uinput_check_syspath_name)
|
||||
{
|
||||
struct libevdev *dev;
|
||||
struct libevdev_uinput *uidev, *uidev2;
|
||||
const char *syspath, *syspath2;
|
||||
int fd, fd2;
|
||||
int rc;
|
||||
|
||||
dev = libevdev_new();
|
||||
ck_assert(dev != NULL);
|
||||
libevdev_set_name(dev, TEST_DEVICE_NAME);
|
||||
libevdev_enable_event_type(dev, EV_SYN);
|
||||
libevdev_enable_event_type(dev, EV_REL);
|
||||
libevdev_enable_event_code(dev, EV_REL, REL_X, NULL);
|
||||
libevdev_enable_event_code(dev, EV_REL, REL_Y, NULL);
|
||||
|
||||
fd = open(UINPUT_NODE, O_RDWR);
|
||||
ck_assert_int_gt(fd, -1);
|
||||
fd2 = open(UINPUT_NODE, O_RDWR);
|
||||
ck_assert_int_gt(fd2, -1);
|
||||
|
||||
rc = libevdev_uinput_create_from_device(dev, fd, &uidev);
|
||||
ck_assert_int_eq(rc, 0);
|
||||
|
||||
/* create a second one to stress the syspath filtering code */
|
||||
libevdev_set_name(dev, TEST_DEVICE_NAME " 2");
|
||||
rc = libevdev_uinput_create_from_device(dev, fd2, &uidev2);
|
||||
ck_assert_int_eq(rc, 0);
|
||||
|
||||
syspath = libevdev_uinput_get_syspath(uidev);
|
||||
ck_assert(syspath != NULL);
|
||||
|
||||
/* get syspath twice returns same pointer */
|
||||
syspath2 = libevdev_uinput_get_syspath(uidev);
|
||||
ck_assert(syspath == syspath2);
|
||||
|
||||
/* second dev has different syspath */
|
||||
syspath2 = libevdev_uinput_get_syspath(uidev2);
|
||||
ck_assert(strcmp(syspath, syspath2) != 0);
|
||||
|
||||
libevdev_free(dev);
|
||||
libevdev_uinput_destroy(uidev);
|
||||
libevdev_uinput_destroy(uidev2);
|
||||
|
||||
close(fd);
|
||||
close(fd2);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
#endif /* __FreeBSD __ */
|
||||
|
||||
START_TEST(test_uinput_events)
|
||||
{
|
||||
struct libevdev *dev;
|
||||
struct libevdev_uinput *uidev;
|
||||
int fd, fd2;
|
||||
int rc;
|
||||
const char *devnode;
|
||||
int i;
|
||||
const int nevents = 5;
|
||||
struct input_event events[] = { {{0, 0}, EV_REL, REL_X, 1},
|
||||
{{0, 0}, EV_REL, REL_Y, -1},
|
||||
{{0, 0}, EV_SYN, SYN_REPORT, 0},
|
||||
{{0, 0}, EV_KEY, BTN_LEFT, 1},
|
||||
{{0, 0}, EV_SYN, SYN_REPORT, 0}};
|
||||
struct input_event events_read[nevents];
|
||||
|
||||
dev = libevdev_new();
|
||||
ck_assert(dev != NULL);
|
||||
libevdev_set_name(dev, TEST_DEVICE_NAME);
|
||||
libevdev_enable_event_type(dev, EV_SYN);
|
||||
libevdev_enable_event_type(dev, EV_REL);
|
||||
libevdev_enable_event_type(dev, EV_KEY);
|
||||
libevdev_enable_event_code(dev, EV_REL, REL_X, NULL);
|
||||
libevdev_enable_event_code(dev, EV_REL, REL_Y, NULL);
|
||||
libevdev_enable_event_code(dev, EV_KEY, BTN_LEFT, NULL);
|
||||
|
||||
fd = open(UINPUT_NODE, O_RDWR);
|
||||
ck_assert_int_gt(fd, -1);
|
||||
|
||||
rc = libevdev_uinput_create_from_device(dev, fd, &uidev);
|
||||
ck_assert_int_eq(rc, 0);
|
||||
ck_assert(uidev != NULL);
|
||||
|
||||
devnode = libevdev_uinput_get_devnode(uidev);
|
||||
ck_assert(devnode != NULL);
|
||||
|
||||
fd2 = open(devnode, O_RDONLY);
|
||||
|
||||
for (i = 0; i < nevents; i++)
|
||||
libevdev_uinput_write_event(uidev, events[i].type, events[i].code, events[i].value);
|
||||
|
||||
rc = read(fd2, events_read, sizeof(events_read));
|
||||
ck_assert_int_eq(rc, sizeof(events_read));
|
||||
|
||||
for (i = 0; i < nevents; i++) {
|
||||
ck_assert_int_eq(events[i].type, events_read[i].type);
|
||||
ck_assert_int_eq(events[i].code, events_read[i].code);
|
||||
ck_assert_int_eq(events[i].value, events_read[i].value);
|
||||
}
|
||||
|
||||
libevdev_free(dev);
|
||||
libevdev_uinput_destroy(uidev);
|
||||
close(fd);
|
||||
close(fd2);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_uinput_properties)
|
||||
{
|
||||
struct libevdev *dev, *dev2;
|
||||
struct libevdev_uinput *uidev;
|
||||
int fd;
|
||||
int rc;
|
||||
const char *devnode;
|
||||
|
||||
dev = libevdev_new();
|
||||
ck_assert(dev != NULL);
|
||||
libevdev_set_name(dev, TEST_DEVICE_NAME);
|
||||
libevdev_enable_event_type(dev, EV_SYN);
|
||||
libevdev_enable_event_type(dev, EV_REL);
|
||||
libevdev_enable_event_type(dev, EV_KEY);
|
||||
libevdev_enable_event_code(dev, EV_REL, REL_X, NULL);
|
||||
libevdev_enable_event_code(dev, EV_REL, REL_Y, NULL);
|
||||
libevdev_enable_event_code(dev, EV_KEY, BTN_LEFT, NULL);
|
||||
libevdev_enable_property(dev, INPUT_PROP_BUTTONPAD);
|
||||
libevdev_enable_property(dev, INPUT_PROP_MAX);
|
||||
|
||||
rc = libevdev_uinput_create_from_device(dev, LIBEVDEV_UINPUT_OPEN_MANAGED, &uidev);
|
||||
ck_assert_int_eq(rc, 0);
|
||||
ck_assert(uidev != NULL);
|
||||
|
||||
devnode = libevdev_uinput_get_devnode(uidev);
|
||||
ck_assert(devnode != NULL);
|
||||
|
||||
fd = open(devnode, O_RDONLY);
|
||||
ck_assert_int_gt(fd, -1);
|
||||
rc = libevdev_new_from_fd(fd, &dev2);
|
||||
ck_assert_int_eq(rc, 0);
|
||||
|
||||
ck_assert(libevdev_has_property(dev2, INPUT_PROP_BUTTONPAD));
|
||||
ck_assert(libevdev_has_property(dev2, INPUT_PROP_MAX));
|
||||
|
||||
libevdev_free(dev);
|
||||
libevdev_free(dev2);
|
||||
libevdev_uinput_destroy(uidev);
|
||||
close(fd);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
TEST_SUITE_ROOT_PRIVILEGES(uinput_suite)
|
||||
{
|
||||
Suite *s = suite_create("libevdev uinput device tests");
|
||||
|
||||
add_test(s, test_uinput_create_device);
|
||||
add_test(s, test_uinput_create_device_invalid);
|
||||
add_test(s, test_uinput_create_device_from_fd);
|
||||
#ifdef __FreeBSD__
|
||||
add_test(s, test_uinput_check_devnode_bsd);
|
||||
add_test(s, test_uinput_check_syspath_bsd);
|
||||
#else
|
||||
add_test(s, test_uinput_check_syspath_time);
|
||||
add_test(s, test_uinput_check_syspath_name);
|
||||
#endif
|
||||
|
||||
add_test(s, test_uinput_events);
|
||||
|
||||
add_test(s, test_uinput_properties);
|
||||
|
||||
return s;
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
{
|
||||
<timer_create@@GLIBC_2.3.3>
|
||||
Memcheck:Param
|
||||
timer_create(evp)
|
||||
fun:timer_create@@GLIBC_2.3.3
|
||||
}
|
||||
{
|
||||
<ioctl_EVIOCGRAB_unaddressable_bytes>
|
||||
Memcheck:Param
|
||||
ioctl(generic)
|
||||
fun:ioctl
|
||||
fun:libevdev_grab
|
||||
}
|
||||
{
|
||||
<ioctl_EVIOCREVOKE_unaddressable_bytes>
|
||||
Memcheck:Param
|
||||
ioctl(generic)
|
||||
fun:ioctl
|
||||
fun:test_revoke*
|
||||
}
|
||||
{
|
||||
<bash_memleak>
|
||||
Memcheck:Leak
|
||||
...
|
||||
fun:reader_loop
|
||||
fun:main
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
noinst_PROGRAMS = libevdev-events
|
||||
bin_PROGRAMS = \
|
||||
touchpad-edge-detector \
|
||||
mouse-dpi-tool \
|
||||
libevdev-tweak-device
|
||||
|
||||
AM_CPPFLAGS = $(GCC_CFLAGS) -I$(top_srcdir) -I$(top_srcdir)/include -I$(top_srcdir)/libevdev
|
||||
libevdev_ldadd = $(top_builddir)/libevdev/libevdev.la
|
||||
|
||||
libevdev_events_SOURCES = libevdev-events.c
|
||||
libevdev_events_LDADD = $(libevdev_ldadd)
|
||||
|
||||
touchpad_edge_detector_SOURCES = touchpad-edge-detector.c
|
||||
touchpad_edge_detector_LDADD = $(libevdev_ldadd)
|
||||
|
||||
mouse_dpi_tool_SOURCES = mouse-dpi-tool.c
|
||||
mouse_dpi_tool_LDADD = $(libevdev_ldadd)
|
||||
|
||||
libevdev_tweak_device_SOURCES = libevdev-tweak-device.c
|
||||
libevdev_tweak_device_LDADD = $(libevdev_ldadd)
|
||||
|
||||
dist_man_MANS = \
|
||||
libevdev-tweak-device.1 \
|
||||
touchpad-edge-detector.1 \
|
||||
$(NULL)
|
||||
@@ -1,799 +0,0 @@
|
||||
# Makefile.in generated by automake 1.16.2 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2020 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 = { \
|
||||
if test -z '$(MAKELEVEL)'; then \
|
||||
false; \
|
||||
elif test -n '$(MAKE_HOST)'; then \
|
||||
true; \
|
||||
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
|
||||
true; \
|
||||
else \
|
||||
false; \
|
||||
fi; \
|
||||
}
|
||||
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@
|
||||
noinst_PROGRAMS = libevdev-events$(EXEEXT)
|
||||
bin_PROGRAMS = touchpad-edge-detector$(EXEEXT) mouse-dpi-tool$(EXEEXT) \
|
||||
libevdev-tweak-device$(EXEEXT)
|
||||
subdir = tools
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/attributes.m4 \
|
||||
$(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)
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"
|
||||
PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
|
||||
am_libevdev_events_OBJECTS = libevdev-events.$(OBJEXT)
|
||||
libevdev_events_OBJECTS = $(am_libevdev_events_OBJECTS)
|
||||
libevdev_events_DEPENDENCIES = $(libevdev_ldadd)
|
||||
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 =
|
||||
am_libevdev_tweak_device_OBJECTS = libevdev-tweak-device.$(OBJEXT)
|
||||
libevdev_tweak_device_OBJECTS = $(am_libevdev_tweak_device_OBJECTS)
|
||||
libevdev_tweak_device_DEPENDENCIES = $(libevdev_ldadd)
|
||||
am_mouse_dpi_tool_OBJECTS = mouse-dpi-tool.$(OBJEXT)
|
||||
mouse_dpi_tool_OBJECTS = $(am_mouse_dpi_tool_OBJECTS)
|
||||
mouse_dpi_tool_DEPENDENCIES = $(libevdev_ldadd)
|
||||
am_touchpad_edge_detector_OBJECTS = touchpad-edge-detector.$(OBJEXT)
|
||||
touchpad_edge_detector_OBJECTS = $(am_touchpad_edge_detector_OBJECTS)
|
||||
touchpad_edge_detector_DEPENDENCIES = $(libevdev_ldadd)
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
|
||||
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
|
||||
am__maybe_remake_depfiles = depfiles
|
||||
am__depfiles_remade = ./$(DEPDIR)/libevdev-events.Po \
|
||||
./$(DEPDIR)/libevdev-tweak-device.Po \
|
||||
./$(DEPDIR)/mouse-dpi-tool.Po \
|
||||
./$(DEPDIR)/touchpad-edge-detector.Po
|
||||
am__mv = mv -f
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
|
||||
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
||||
$(AM_CFLAGS) $(CFLAGS)
|
||||
AM_V_CC = $(am__v_CC_@AM_V@)
|
||||
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
|
||||
am__v_CC_0 = @echo " CC " $@;
|
||||
am__v_CC_1 =
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
|
||||
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
|
||||
am__v_CCLD_0 = @echo " CCLD " $@;
|
||||
am__v_CCLD_1 =
|
||||
SOURCES = $(libevdev_events_SOURCES) $(libevdev_tweak_device_SOURCES) \
|
||||
$(mouse_dpi_tool_SOURCES) $(touchpad_edge_detector_SOURCES)
|
||||
DIST_SOURCES = $(libevdev_events_SOURCES) \
|
||||
$(libevdev_tweak_device_SOURCES) $(mouse_dpi_tool_SOURCES) \
|
||||
$(touchpad_edge_detector_SOURCES)
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
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; }; \
|
||||
}
|
||||
man1dir = $(mandir)/man1
|
||||
NROFF = nroff
|
||||
MANS = $(dist_man_MANS)
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
||||
# Read a list of newline-separated strings from the standard input,
|
||||
# and print each of them once, without duplicates. Input order is
|
||||
# *not* preserved.
|
||||
am__uniquify_input = $(AWK) '\
|
||||
BEGIN { nonempty = 0; } \
|
||||
{ items[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in items) print i; }; } \
|
||||
'
|
||||
# Make sure the list of sources is unique. This is necessary because,
|
||||
# e.g., the same source file might be shared among _SOURCES variables
|
||||
# for different programs/libraries.
|
||||
am__define_uniq_tagged_files = \
|
||||
list='$(am__tagged_files)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | $(am__uniquify_input)`
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in \
|
||||
$(top_srcdir)/build-aux/depcomp
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CHECK_CFLAGS = @CHECK_CFLAGS@
|
||||
CHECK_LIBS = @CHECK_LIBS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DOXYGEN = @DOXYGEN@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
GCC_CFLAGS = @GCC_CFLAGS@
|
||||
GCOV_CFLAGS = @GCOV_CFLAGS@
|
||||
GCOV_LDFLAGS = @GCOV_LDFLAGS@
|
||||
GNU_LD_FLAGS = @GNU_LD_FLAGS@
|
||||
GREP = @GREP@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBEVDEV_LT_VERSION = @LIBEVDEV_LT_VERSION@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OS = @OS@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||
PYTHON = @PYTHON@
|
||||
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
|
||||
PYTHON_PLATFORM = @PYTHON_PLATFORM@
|
||||
PYTHON_PREFIX = @PYTHON_PREFIX@
|
||||
PYTHON_VERSION = @PYTHON_VERSION@
|
||||
RANLIB = @RANLIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VALGRIND = @VALGRIND@
|
||||
VERSION = @VERSION@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
pkgpyexecdir = @pkgpyexecdir@
|
||||
pkgpythondir = @pkgpythondir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
pyexecdir = @pyexecdir@
|
||||
pythondir = @pythondir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
AM_CPPFLAGS = $(GCC_CFLAGS) -I$(top_srcdir) -I$(top_srcdir)/include -I$(top_srcdir)/libevdev
|
||||
libevdev_ldadd = $(top_builddir)/libevdev/libevdev.la
|
||||
libevdev_events_SOURCES = libevdev-events.c
|
||||
libevdev_events_LDADD = $(libevdev_ldadd)
|
||||
touchpad_edge_detector_SOURCES = touchpad-edge-detector.c
|
||||
touchpad_edge_detector_LDADD = $(libevdev_ldadd)
|
||||
mouse_dpi_tool_SOURCES = mouse-dpi-tool.c
|
||||
mouse_dpi_tool_LDADD = $(libevdev_ldadd)
|
||||
libevdev_tweak_device_SOURCES = libevdev-tweak-device.c
|
||||
libevdev_tweak_device_LDADD = $(libevdev_ldadd)
|
||||
dist_man_MANS = \
|
||||
libevdev-tweak-device.1 \
|
||||
touchpad-edge-detector.1 \
|
||||
$(NULL)
|
||||
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .lo .o .obj
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign tools/Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
install-binPROGRAMS: $(bin_PROGRAMS)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
|
||||
if test -n "$$list"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
|
||||
fi; \
|
||||
for p in $$list; do echo "$$p $$p"; done | \
|
||||
sed 's/$(EXEEXT)$$//' | \
|
||||
while read p p1; do if test -f $$p \
|
||||
|| test -f $$p1 \
|
||||
; then echo "$$p"; echo "$$p"; else :; fi; \
|
||||
done | \
|
||||
sed -e 'p;s,.*/,,;n;h' \
|
||||
-e 's|.*|.|' \
|
||||
-e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
|
||||
sed 'N;N;N;s,\n, ,g' | \
|
||||
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
|
||||
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
|
||||
if ($$2 == $$4) files[d] = files[d] " " $$1; \
|
||||
else { print "f", $$3 "/" $$4, $$1; } } \
|
||||
END { for (d in files) print "f", d, files[d] }' | \
|
||||
while read type dir files; do \
|
||||
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
|
||||
test -z "$$files" || { \
|
||||
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
|
||||
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
|
||||
} \
|
||||
; done
|
||||
|
||||
uninstall-binPROGRAMS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
|
||||
files=`for p in $$list; do echo "$$p"; done | \
|
||||
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
|
||||
-e 's/$$/$(EXEEXT)/' \
|
||||
`; \
|
||||
test -n "$$list" || exit 0; \
|
||||
echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
|
||||
cd "$(DESTDIR)$(bindir)" && rm -f $$files
|
||||
|
||||
clean-binPROGRAMS:
|
||||
@list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
|
||||
echo " rm -f" $$list; \
|
||||
rm -f $$list || exit $$?; \
|
||||
test -n "$(EXEEXT)" || exit 0; \
|
||||
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
|
||||
echo " rm -f" $$list; \
|
||||
rm -f $$list
|
||||
|
||||
clean-noinstPROGRAMS:
|
||||
@list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
|
||||
echo " rm -f" $$list; \
|
||||
rm -f $$list || exit $$?; \
|
||||
test -n "$(EXEEXT)" || exit 0; \
|
||||
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
|
||||
echo " rm -f" $$list; \
|
||||
rm -f $$list
|
||||
|
||||
libevdev-events$(EXEEXT): $(libevdev_events_OBJECTS) $(libevdev_events_DEPENDENCIES) $(EXTRA_libevdev_events_DEPENDENCIES)
|
||||
@rm -f libevdev-events$(EXEEXT)
|
||||
$(AM_V_CCLD)$(LINK) $(libevdev_events_OBJECTS) $(libevdev_events_LDADD) $(LIBS)
|
||||
|
||||
libevdev-tweak-device$(EXEEXT): $(libevdev_tweak_device_OBJECTS) $(libevdev_tweak_device_DEPENDENCIES) $(EXTRA_libevdev_tweak_device_DEPENDENCIES)
|
||||
@rm -f libevdev-tweak-device$(EXEEXT)
|
||||
$(AM_V_CCLD)$(LINK) $(libevdev_tweak_device_OBJECTS) $(libevdev_tweak_device_LDADD) $(LIBS)
|
||||
|
||||
mouse-dpi-tool$(EXEEXT): $(mouse_dpi_tool_OBJECTS) $(mouse_dpi_tool_DEPENDENCIES) $(EXTRA_mouse_dpi_tool_DEPENDENCIES)
|
||||
@rm -f mouse-dpi-tool$(EXEEXT)
|
||||
$(AM_V_CCLD)$(LINK) $(mouse_dpi_tool_OBJECTS) $(mouse_dpi_tool_LDADD) $(LIBS)
|
||||
|
||||
touchpad-edge-detector$(EXEEXT): $(touchpad_edge_detector_OBJECTS) $(touchpad_edge_detector_DEPENDENCIES) $(EXTRA_touchpad_edge_detector_DEPENDENCIES)
|
||||
@rm -f touchpad-edge-detector$(EXEEXT)
|
||||
$(AM_V_CCLD)$(LINK) $(touchpad_edge_detector_OBJECTS) $(touchpad_edge_detector_LDADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libevdev-events.Po@am__quote@ # am--include-marker
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libevdev-tweak-device.Po@am__quote@ # am--include-marker
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mouse-dpi-tool.Po@am__quote@ # am--include-marker
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/touchpad-edge-detector.Po@am__quote@ # am--include-marker
|
||||
|
||||
$(am__depfiles_remade):
|
||||
@$(MKDIR_P) $(@D)
|
||||
@echo '# dummy' >$@-t && $(am__mv) $@-t $@
|
||||
|
||||
am--depfiles: $(am__depfiles_remade)
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
|
||||
|
||||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
|
||||
.c.lo:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
|
||||
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
install-man1: $(dist_man_MANS)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list1=''; \
|
||||
list2='$(dist_man_MANS)'; \
|
||||
test -n "$(man1dir)" \
|
||||
&& test -n "`echo $$list1$$list2`" \
|
||||
|| exit 0; \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
|
||||
{ for i in $$list1; do echo "$$i"; done; \
|
||||
if test -n "$$list2"; then \
|
||||
for i in $$list2; do echo "$$i"; done \
|
||||
| sed -n '/\.1[a-z]*$$/p'; \
|
||||
fi; \
|
||||
} | while read p; do \
|
||||
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
|
||||
echo "$$d$$p"; echo "$$p"; \
|
||||
done | \
|
||||
sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
|
||||
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
|
||||
sed 'N;N;s,\n, ,g' | { \
|
||||
list=; while read file base inst; do \
|
||||
if test "$$base" = "$$inst"; then list="$$list $$file"; else \
|
||||
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
|
||||
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
|
||||
fi; \
|
||||
done; \
|
||||
for i in $$list; do echo "$$i"; done | $(am__base_list) | \
|
||||
while read files; do \
|
||||
test -z "$$files" || { \
|
||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
|
||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
|
||||
done; }
|
||||
|
||||
uninstall-man1:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list=''; test -n "$(man1dir)" || exit 0; \
|
||||
files=`{ for i in $$list; do echo "$$i"; done; \
|
||||
l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
|
||||
sed -n '/\.1[a-z]*$$/p'; \
|
||||
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
|
||||
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
|
||||
dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
|
||||
|
||||
ID: $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); mkid -fID $$unique
|
||||
tags: tags-am
|
||||
TAGS: tags
|
||||
|
||||
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
$(am__define_uniq_tagged_files); \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: ctags-am
|
||||
|
||||
CTAGS: ctags
|
||||
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
cscopelist: cscopelist-am
|
||||
|
||||
cscopelist-am: $(am__tagged_files)
|
||||
list='$(am__tagged_files)'; \
|
||||
case "$(srcdir)" in \
|
||||
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
|
||||
*) sdir=$(subdir)/$(srcdir) ;; \
|
||||
esac; \
|
||||
for i in $$list; do \
|
||||
if test -f "$$i"; then \
|
||||
echo "$(subdir)/$$i"; \
|
||||
else \
|
||||
echo "$$sdir/$$i"; \
|
||||
fi; \
|
||||
done >> $(top_builddir)/cscope.files
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
||||
|
||||
distdir-am: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(PROGRAMS) $(MANS)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-binPROGRAMS clean-generic clean-libtool \
|
||||
clean-noinstPROGRAMS mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f ./$(DEPDIR)/libevdev-events.Po
|
||||
-rm -f ./$(DEPDIR)/libevdev-tweak-device.Po
|
||||
-rm -f ./$(DEPDIR)/mouse-dpi-tool.Po
|
||||
-rm -f ./$(DEPDIR)/touchpad-edge-detector.Po
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-man
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am: install-binPROGRAMS
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man: install-man1
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f ./$(DEPDIR)/libevdev-events.Po
|
||||
-rm -f ./$(DEPDIR)/libevdev-tweak-device.Po
|
||||
-rm -f ./$(DEPDIR)/mouse-dpi-tool.Po
|
||||
-rm -f ./$(DEPDIR)/touchpad-edge-detector.Po
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-binPROGRAMS uninstall-man
|
||||
|
||||
uninstall-man: uninstall-man1
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
|
||||
clean-binPROGRAMS clean-generic clean-libtool \
|
||||
clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \
|
||||
distclean-compile distclean-generic distclean-libtool \
|
||||
distclean-tags distdir dvi dvi-am html html-am info info-am \
|
||||
install install-am install-binPROGRAMS install-data \
|
||||
install-data-am install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am install-info \
|
||||
install-info-am install-man install-man1 install-pdf \
|
||||
install-pdf-am install-ps install-ps-am install-strip \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \
|
||||
uninstall-man uninstall-man1
|
||||
|
||||
.PRECIOUS: Makefile
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
@@ -1,195 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2013 Red Hat, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting documentation, and
|
||||
* that the name of the copyright holders not be used in advertising or
|
||||
* publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission. The copyright holders make no representations
|
||||
* about the suitability of this software for any purpose. It is provided "as
|
||||
* is" without express or implied warranty.
|
||||
*
|
||||
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
* OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <linux/input.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "libevdev/libevdev.h"
|
||||
|
||||
static void
|
||||
print_abs_bits(struct libevdev *dev, int axis)
|
||||
{
|
||||
const struct input_absinfo *abs;
|
||||
|
||||
if (!libevdev_has_event_code(dev, EV_ABS, axis))
|
||||
return;
|
||||
|
||||
abs = libevdev_get_abs_info(dev, axis);
|
||||
|
||||
printf(" Value %6d\n", abs->value);
|
||||
printf(" Min %6d\n", abs->minimum);
|
||||
printf(" Max %6d\n", abs->maximum);
|
||||
if (abs->fuzz)
|
||||
printf(" Fuzz %6d\n", abs->fuzz);
|
||||
if (abs->flat)
|
||||
printf(" Flat %6d\n", abs->flat);
|
||||
if (abs->resolution)
|
||||
printf(" Resolution %6d\n", abs->resolution);
|
||||
}
|
||||
|
||||
static void
|
||||
print_code_bits(struct libevdev *dev, unsigned int type, unsigned int max)
|
||||
{
|
||||
unsigned int i;
|
||||
for (i = 0; i <= max; i++) {
|
||||
if (!libevdev_has_event_code(dev, type, i))
|
||||
continue;
|
||||
|
||||
printf(" Event code %i (%s)\n", i, libevdev_event_code_get_name(type, i));
|
||||
if (type == EV_ABS)
|
||||
print_abs_bits(dev, i);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
print_bits(struct libevdev *dev)
|
||||
{
|
||||
unsigned int i;
|
||||
printf("Supported events:\n");
|
||||
|
||||
for (i = 0; i <= EV_MAX; i++) {
|
||||
if (libevdev_has_event_type(dev, i))
|
||||
printf(" Event type %d (%s)\n", i, libevdev_event_type_get_name(i));
|
||||
switch(i) {
|
||||
case EV_KEY:
|
||||
print_code_bits(dev, EV_KEY, KEY_MAX);
|
||||
break;
|
||||
case EV_REL:
|
||||
print_code_bits(dev, EV_REL, REL_MAX);
|
||||
break;
|
||||
case EV_ABS:
|
||||
print_code_bits(dev, EV_ABS, ABS_MAX);
|
||||
break;
|
||||
case EV_LED:
|
||||
print_code_bits(dev, EV_LED, LED_MAX);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
print_props(struct libevdev *dev)
|
||||
{
|
||||
unsigned int i;
|
||||
printf("Properties:\n");
|
||||
|
||||
for (i = 0; i <= INPUT_PROP_MAX; i++) {
|
||||
if (libevdev_has_property(dev, i))
|
||||
printf(" Property type %d (%s)\n", i,
|
||||
libevdev_property_get_name(i));
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
print_event(struct input_event *ev)
|
||||
{
|
||||
if (ev->type == EV_SYN)
|
||||
printf("Event: time %ld.%06ld, ++++++++++++++++++++ %s +++++++++++++++\n",
|
||||
ev->input_event_sec,
|
||||
ev->input_event_usec,
|
||||
libevdev_event_type_get_name(ev->type));
|
||||
else
|
||||
printf("Event: time %ld.%06ld, type %d (%s), code %d (%s), value %d\n",
|
||||
ev->input_event_sec,
|
||||
ev->input_event_usec,
|
||||
ev->type,
|
||||
libevdev_event_type_get_name(ev->type),
|
||||
ev->code,
|
||||
libevdev_event_code_get_name(ev->type, ev->code),
|
||||
ev->value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
print_sync_event(struct input_event *ev)
|
||||
{
|
||||
printf("SYNC: ");
|
||||
print_event(ev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
struct libevdev *dev = NULL;
|
||||
const char *file;
|
||||
int fd;
|
||||
int rc = 1;
|
||||
|
||||
if (argc < 2)
|
||||
goto out;
|
||||
|
||||
file = argv[1];
|
||||
fd = open(file, O_RDONLY);
|
||||
if (fd < 0) {
|
||||
perror("Failed to open device");
|
||||
goto out;
|
||||
}
|
||||
|
||||
rc = libevdev_new_from_fd(fd, &dev);
|
||||
if (rc < 0) {
|
||||
fprintf(stderr, "Failed to init libevdev (%s)\n", strerror(-rc));
|
||||
goto out;
|
||||
}
|
||||
|
||||
printf("Input device ID: bus %#x vendor %#x product %#x\n",
|
||||
libevdev_get_id_bustype(dev),
|
||||
libevdev_get_id_vendor(dev),
|
||||
libevdev_get_id_product(dev));
|
||||
printf("Evdev version: %x\n", libevdev_get_driver_version(dev));
|
||||
printf("Input device name: \"%s\"\n", libevdev_get_name(dev));
|
||||
printf("Phys location: %s\n", libevdev_get_phys(dev));
|
||||
printf("Uniq identifier: %s\n", libevdev_get_uniq(dev));
|
||||
print_bits(dev);
|
||||
print_props(dev);
|
||||
|
||||
do {
|
||||
struct input_event ev;
|
||||
rc = libevdev_next_event(dev, LIBEVDEV_READ_FLAG_NORMAL|LIBEVDEV_READ_FLAG_BLOCKING, &ev);
|
||||
if (rc == LIBEVDEV_READ_STATUS_SYNC) {
|
||||
printf("::::::::::::::::::::: dropped ::::::::::::::::::::::\n");
|
||||
while (rc == LIBEVDEV_READ_STATUS_SYNC) {
|
||||
print_sync_event(&ev);
|
||||
rc = libevdev_next_event(dev, LIBEVDEV_READ_FLAG_SYNC, &ev);
|
||||
}
|
||||
printf("::::::::::::::::::::: re-synced ::::::::::::::::::::::\n");
|
||||
} else if (rc == LIBEVDEV_READ_STATUS_SUCCESS)
|
||||
print_event(&ev);
|
||||
} while (rc == LIBEVDEV_READ_STATUS_SYNC || rc == LIBEVDEV_READ_STATUS_SUCCESS || rc == -EAGAIN);
|
||||
|
||||
if (rc != LIBEVDEV_READ_STATUS_SUCCESS && rc != -EAGAIN)
|
||||
fprintf(stderr, "Failed to handle events: %s\n", strerror(-rc));
|
||||
|
||||
rc = 0;
|
||||
out:
|
||||
libevdev_free(dev);
|
||||
|
||||
return rc;
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
.TH LIBEVDEV-TWEAK-DEVICE "1"
|
||||
.SH NAME
|
||||
libevdev-tweak-device \- modify an evdev kernel device
|
||||
.SH SYNOPSIS
|
||||
.B libevdev-tweak-device
|
||||
--abs ABS_X [--min a] [--max b] [--res c] [--fuzz d] [--flat e]
|
||||
/dev/input/eventX
|
||||
.B libevdev-tweak-device
|
||||
--resolution res[,yres] /dev/input/eventX
|
||||
.PP
|
||||
.B libevdev-tweak-device
|
||||
--led LED_NUML --on|--off /dev/input/eventX
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
The
|
||||
.I libevdev-tweak-device
|
||||
tool changes the properties of the evdev kernel device at
|
||||
.I /dev/input/eventX.
|
||||
Currently this may be used to force an LED on or off, or to change the
|
||||
properties of an absolute axis (e.g. its minimum/maximum range or
|
||||
resolution). Changes are permanent until the device is removed.
|
||||
.SH OPTIONS
|
||||
.SS Changing absolute axes
|
||||
.TP 8
|
||||
.B --abs axis
|
||||
Change the given named ABS_ kernel axis, e.g. ABS_X. For a full list, see linux/input.h.
|
||||
Each of the options
|
||||
.B min, max, res, fuzz, flat
|
||||
may be given.
|
||||
.TP 8
|
||||
.B --min v
|
||||
Set the absinfo minimum to the value v
|
||||
.TP 8
|
||||
.B --max v
|
||||
Set the absinfo maximum to the value v
|
||||
.TP 8
|
||||
.B --res v
|
||||
Set the absinfo resolution to the value v
|
||||
.TP 8
|
||||
.B --fuzz v
|
||||
Set the absinfo fuzz to the value v
|
||||
.TP 8
|
||||
.B --flat v
|
||||
Set the absinfo flat to the value v
|
||||
.PP
|
||||
.SS Changing the x/y resolution
|
||||
.TP 8
|
||||
.B --resolution res[,yres]
|
||||
Changes the resolution of the ABS_X, ABS_MT_POSITION_X, ABS_Y, and
|
||||
ABS_MT_POSITION_Y axis to the given resolution. If only one resolution value
|
||||
is provided, both x and y axis are set to the same resolution, otherwise the
|
||||
first resolution value is applied to the x axes and the second value to the
|
||||
y axes.
|
||||
.SS Toggling LEDs
|
||||
.TP 8
|
||||
.B --led led
|
||||
Change the given LED, e.g. LED_NUML. For a full list, see linux/input.h.
|
||||
.TP 8
|
||||
.B --on
|
||||
Change the LED state to on
|
||||
.TP 8
|
||||
.B --off
|
||||
Change the LED state to off
|
||||
.SH NOTES
|
||||
.PP
|
||||
The kernel does not notify processes about absinfo property changes. Any
|
||||
process that has previously obtained the absinfo from the device will remain
|
||||
on the old information. This makes using this tool potentially racy, use
|
||||
with caution.
|
||||
@@ -1,482 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2014 Red Hat, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting documentation, and
|
||||
* that the name of the copyright holders not be used in advertising or
|
||||
* publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission. The copyright holders make no representations
|
||||
* about the suitability of this software for any purpose. It is provided "as
|
||||
* is" without express or implied warranty.
|
||||
*
|
||||
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
* OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <getopt.h>
|
||||
#include <libgen.h>
|
||||
#include <limits.h>
|
||||
#include <linux/input.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "libevdev/libevdev.h"
|
||||
|
||||
static void
|
||||
usage(const char *progname)
|
||||
{
|
||||
printf("%s --abs <axis> [--min min] [--max max] [--res res] [--fuzz fuzz] [--flat flat] /dev/input/eventXYZ\n"
|
||||
"\tChange the absinfo struct for the named axis\n"
|
||||
"%s --resolution res[,yres] /dev/input/eventXYZ\n"
|
||||
"\tChange the x/y resolution on the given device\n"
|
||||
"%s --led <led> --on|--off /dev/input/eventXYZ\n"
|
||||
"\tEnable or disable the named LED\n",
|
||||
progname,
|
||||
progname,
|
||||
progname);
|
||||
}
|
||||
|
||||
enum mode {
|
||||
MODE_NONE = 0,
|
||||
MODE_ABS,
|
||||
MODE_LED,
|
||||
MODE_RESOLUTION,
|
||||
MODE_HELP,
|
||||
};
|
||||
|
||||
enum opts {
|
||||
OPT_ABS = 1 << 0,
|
||||
OPT_MIN = 1 << 1,
|
||||
OPT_MAX = 1 << 2,
|
||||
OPT_FUZZ = 1 << 3,
|
||||
OPT_FLAT = 1 << 4,
|
||||
OPT_RES = 1 << 5,
|
||||
OPT_LED = 1 << 6,
|
||||
OPT_ON = 1 << 7,
|
||||
OPT_OFF = 1 << 8,
|
||||
OPT_RESOLUTION = 1 << 9,
|
||||
OPT_HELP = 1 << 10,
|
||||
};
|
||||
|
||||
static bool
|
||||
parse_resolution_argument(const char *arg, int *xres, int *yres)
|
||||
{
|
||||
int matched;
|
||||
|
||||
matched = sscanf(arg, "%d,%d", xres, yres);
|
||||
|
||||
switch(matched) {
|
||||
case 2:
|
||||
break;
|
||||
case 1:
|
||||
*yres = *xres;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
safe_atoi(const char *str, int *val)
|
||||
{
|
||||
char *endptr;
|
||||
long v;
|
||||
|
||||
v = strtol(str, &endptr, 10);
|
||||
if (str == endptr)
|
||||
return false;
|
||||
if (*str != '\0' && *endptr != '\0')
|
||||
return false;
|
||||
|
||||
if (v > INT_MAX || v < INT_MIN)
|
||||
return false;
|
||||
|
||||
*val = v;
|
||||
return true;
|
||||
}
|
||||
|
||||
static int
|
||||
parse_event_code(int type, const char *str)
|
||||
{
|
||||
int code;
|
||||
|
||||
code = libevdev_event_code_from_name(type, str);
|
||||
if (code != -1)
|
||||
return code;
|
||||
|
||||
if (safe_atoi(str, &code))
|
||||
return code;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int
|
||||
parse_options_abs(int argc, char **argv, unsigned int *changes,
|
||||
int *axis, struct input_absinfo *absinfo)
|
||||
{
|
||||
int rc = 1;
|
||||
int c;
|
||||
int option_index = 0;
|
||||
static struct option opts[] = {
|
||||
{ "abs", 1, 0, OPT_ABS },
|
||||
{ "min", 1, 0, OPT_MIN },
|
||||
{ "max", 1, 0, OPT_MAX },
|
||||
{ "fuzz", 1, 0, OPT_FUZZ },
|
||||
{ "flat", 1, 0, OPT_FLAT },
|
||||
{ "res", 1, 0, OPT_RES },
|
||||
{ NULL, 0, 0, 0 },
|
||||
};
|
||||
|
||||
if (argc < 2)
|
||||
goto error;
|
||||
|
||||
optind = 1;
|
||||
while (1) {
|
||||
c = getopt_long(argc, argv, "h", opts, &option_index);
|
||||
if (c == -1)
|
||||
break;
|
||||
|
||||
switch (c) {
|
||||
case OPT_ABS:
|
||||
*axis = parse_event_code(EV_ABS, optarg);
|
||||
if (*axis == -1)
|
||||
goto error;
|
||||
break;
|
||||
case OPT_MIN:
|
||||
absinfo->minimum = atoi(optarg);
|
||||
break;
|
||||
case OPT_MAX:
|
||||
absinfo->maximum = atoi(optarg);
|
||||
break;
|
||||
case OPT_FUZZ:
|
||||
absinfo->fuzz = atoi(optarg);
|
||||
break;
|
||||
case OPT_FLAT:
|
||||
absinfo->flat = atoi(optarg);
|
||||
break;
|
||||
case OPT_RES:
|
||||
absinfo->resolution = atoi(optarg);
|
||||
break;
|
||||
default:
|
||||
goto error;
|
||||
}
|
||||
*changes |= c;
|
||||
}
|
||||
rc = 0;
|
||||
error:
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int
|
||||
parse_options_led(int argc, char **argv, int *led, int *led_state)
|
||||
{
|
||||
int rc = 1;
|
||||
int c;
|
||||
int option_index = 0;
|
||||
static struct option opts[] = {
|
||||
{ "led", 1, 0, OPT_LED },
|
||||
{ "on", 0, 0, OPT_ON },
|
||||
{ "off", 0, 0, OPT_OFF },
|
||||
{ NULL, 0, 0, 0 },
|
||||
};
|
||||
|
||||
if (argc < 2)
|
||||
goto error;
|
||||
|
||||
optind = 1;
|
||||
while (1) {
|
||||
c = getopt_long(argc, argv, "h", opts, &option_index);
|
||||
if (c == -1)
|
||||
break;
|
||||
|
||||
switch (c) {
|
||||
case OPT_LED:
|
||||
*led = parse_event_code(EV_LED, optarg);
|
||||
if (*led == -1)
|
||||
goto error;
|
||||
break;
|
||||
case OPT_ON:
|
||||
if (*led_state != -1)
|
||||
goto error;
|
||||
*led_state = 1;
|
||||
break;
|
||||
case OPT_OFF:
|
||||
if (*led_state != -1)
|
||||
goto error;
|
||||
*led_state = 0;
|
||||
break;
|
||||
default:
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
rc = 0;
|
||||
error:
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int
|
||||
parse_options_resolution(int argc, char **argv, int *xres, int *yres)
|
||||
{
|
||||
int rc = 1;
|
||||
int c;
|
||||
int option_index = 0;
|
||||
static struct option opts[] = {
|
||||
{ "resolution", 1, 0, OPT_RESOLUTION },
|
||||
{ NULL, 0, 0, 0 },
|
||||
};
|
||||
|
||||
if (argc < 2)
|
||||
goto error;
|
||||
|
||||
optind = 1;
|
||||
while (1) {
|
||||
c = getopt_long(argc, argv, "h", opts, &option_index);
|
||||
if (c == -1)
|
||||
break;
|
||||
|
||||
switch (c) {
|
||||
case OPT_RESOLUTION:
|
||||
if (!parse_resolution_argument(optarg,
|
||||
xres, yres))
|
||||
goto error;
|
||||
break;
|
||||
default:
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
rc = 0;
|
||||
error:
|
||||
return rc;
|
||||
}
|
||||
|
||||
static enum mode
|
||||
parse_options_mode(int argc, char **argv)
|
||||
{
|
||||
int c;
|
||||
int option_index = 0;
|
||||
static const struct option opts[] = {
|
||||
{ "abs", 1, 0, OPT_ABS },
|
||||
{ "led", 1, 0, OPT_LED },
|
||||
{ "resolution", 1, 0, OPT_RESOLUTION },
|
||||
{ "help", 0, 0, OPT_HELP },
|
||||
{ NULL, 0, 0, 0 },
|
||||
};
|
||||
enum mode mode = MODE_NONE;
|
||||
|
||||
if (argc < 2)
|
||||
return mode;
|
||||
|
||||
while (mode == MODE_NONE) {
|
||||
c = getopt_long(argc, argv, "h", opts, &option_index);
|
||||
if (c == -1)
|
||||
break;
|
||||
|
||||
switch (c) {
|
||||
case 'h':
|
||||
case OPT_HELP:
|
||||
mode = MODE_HELP;
|
||||
break;
|
||||
case OPT_ABS:
|
||||
mode = MODE_ABS;
|
||||
break;
|
||||
case OPT_LED:
|
||||
mode = MODE_LED;
|
||||
break;
|
||||
case OPT_RESOLUTION:
|
||||
mode = MODE_RESOLUTION;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (optind >= argc && mode != MODE_HELP)
|
||||
return MODE_NONE;
|
||||
|
||||
return mode;
|
||||
}
|
||||
|
||||
static void
|
||||
set_abs(struct libevdev *dev, unsigned int changes,
|
||||
unsigned int axis, struct input_absinfo *absinfo)
|
||||
{
|
||||
int rc;
|
||||
struct input_absinfo abs;
|
||||
const struct input_absinfo *a;
|
||||
|
||||
if ((a = libevdev_get_abs_info(dev, axis)) == NULL) {
|
||||
fprintf(stderr,
|
||||
"Device '%s' doesn't have axis %s\n",
|
||||
libevdev_get_name(dev),
|
||||
libevdev_event_code_get_name(EV_ABS, axis));
|
||||
return;
|
||||
}
|
||||
|
||||
abs = *a;
|
||||
if (changes & OPT_MIN)
|
||||
abs.minimum = absinfo->minimum;
|
||||
if (changes & OPT_MAX)
|
||||
abs.maximum = absinfo->maximum;
|
||||
if (changes & OPT_FUZZ)
|
||||
abs.fuzz = absinfo->fuzz;
|
||||
if (changes & OPT_FLAT)
|
||||
abs.flat = absinfo->flat;
|
||||
if (changes & OPT_RES)
|
||||
abs.resolution = absinfo->resolution;
|
||||
|
||||
rc = libevdev_kernel_set_abs_info(dev, axis, &abs);
|
||||
if (rc != 0)
|
||||
fprintf(stderr,
|
||||
"Failed to set absinfo %s: %s",
|
||||
libevdev_event_code_get_name(EV_ABS, axis),
|
||||
strerror(-rc));
|
||||
}
|
||||
|
||||
static void
|
||||
set_led(struct libevdev *dev, unsigned int led, int led_state)
|
||||
{
|
||||
int rc;
|
||||
enum libevdev_led_value state =
|
||||
led_state ? LIBEVDEV_LED_ON : LIBEVDEV_LED_OFF;
|
||||
|
||||
if (!libevdev_has_event_code(dev, EV_LED, led)) {
|
||||
fprintf(stderr,
|
||||
"Device '%s' doesn't have %s\n",
|
||||
libevdev_get_name(dev),
|
||||
libevdev_event_code_get_name(EV_LED, led));
|
||||
return;
|
||||
}
|
||||
|
||||
rc = libevdev_kernel_set_led_value(dev, led, state);
|
||||
if (rc != 0)
|
||||
fprintf(stderr,
|
||||
"Failed to set LED %s: %s",
|
||||
libevdev_event_code_get_name(EV_LED, led),
|
||||
strerror(-rc));
|
||||
}
|
||||
|
||||
static void
|
||||
set_resolution(struct libevdev *dev, int xres, int yres)
|
||||
{
|
||||
struct input_absinfo abs;
|
||||
|
||||
abs.resolution = xres;
|
||||
if (libevdev_has_event_code(dev, EV_ABS, ABS_X))
|
||||
set_abs(dev, OPT_RES, ABS_X, &abs);
|
||||
if (libevdev_has_event_code(dev, EV_ABS, ABS_MT_POSITION_X))
|
||||
set_abs(dev, OPT_RES, ABS_MT_POSITION_X, &abs);
|
||||
|
||||
abs.resolution = yres;
|
||||
if (libevdev_has_event_code(dev, EV_ABS, ABS_Y))
|
||||
set_abs(dev, OPT_RES, ABS_Y, &abs);
|
||||
if (libevdev_has_event_code(dev, EV_ABS, ABS_MT_POSITION_Y))
|
||||
set_abs(dev, OPT_RES, ABS_MT_POSITION_Y, &abs);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
struct libevdev *dev = NULL;
|
||||
int fd = -1;
|
||||
int rc = EXIT_FAILURE;
|
||||
enum mode mode;
|
||||
const char *path;
|
||||
struct input_absinfo absinfo;
|
||||
int axis = -1;
|
||||
int led = -1;
|
||||
int led_state = -1;
|
||||
unsigned int changes = 0; /* bitmask of changes */
|
||||
int xres = 0,
|
||||
yres = 0;
|
||||
|
||||
mode = parse_options_mode(argc, argv);
|
||||
switch (mode) {
|
||||
case MODE_HELP:
|
||||
rc = EXIT_SUCCESS;
|
||||
/* fallthrough */
|
||||
case MODE_NONE:
|
||||
usage(basename(argv[0]));
|
||||
goto out;
|
||||
case MODE_ABS:
|
||||
rc = parse_options_abs(argc, argv, &changes, &axis,
|
||||
&absinfo);
|
||||
break;
|
||||
case MODE_LED:
|
||||
rc = parse_options_led(argc, argv, &led, &led_state);
|
||||
break;
|
||||
case MODE_RESOLUTION:
|
||||
rc = parse_options_resolution(argc, argv, &xres,
|
||||
&yres);
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr,
|
||||
"++?????++ Out of Cheese Error. Redo From Start.\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (rc != EXIT_SUCCESS)
|
||||
goto out;
|
||||
|
||||
if (optind >= argc) {
|
||||
rc = EXIT_FAILURE;
|
||||
usage(basename(argv[0]));
|
||||
goto out;
|
||||
}
|
||||
|
||||
path = argv[optind];
|
||||
|
||||
fd = open(path, O_RDWR);
|
||||
if (fd < 0) {
|
||||
rc = EXIT_FAILURE;
|
||||
perror("Failed to open device");
|
||||
goto out;
|
||||
}
|
||||
|
||||
rc = libevdev_new_from_fd(fd, &dev);
|
||||
if (rc < 0) {
|
||||
fprintf(stderr, "Failed to init libevdev (%s)\n", strerror(-rc));
|
||||
goto out;
|
||||
}
|
||||
|
||||
switch (mode) {
|
||||
case MODE_ABS:
|
||||
set_abs(dev, changes, axis, &absinfo);
|
||||
break;
|
||||
case MODE_LED:
|
||||
set_led(dev, led, led_state);
|
||||
break;
|
||||
case MODE_RESOLUTION:
|
||||
set_resolution(dev, xres, yres);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
out:
|
||||
libevdev_free(dev);
|
||||
if (fd != -1)
|
||||
close(fd);
|
||||
|
||||
return rc;
|
||||
}
|
||||
@@ -1,311 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2014 Red Hat, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software
|
||||
* and its documentation for any purpose is hereby granted without
|
||||
* fee, provided that the above copyright notice appear in all copies
|
||||
* and that both that copyright notice and this permission notice
|
||||
* appear in supporting documentation, and that the name of Red Hat
|
||||
* not be used in advertising or publicity pertaining to distribution
|
||||
* of the software without specific, written prior permission. Red
|
||||
* Hat makes no representations about the suitability of this software
|
||||
* for any purpose. It is provided "as is" without express or implied
|
||||
* warranty.
|
||||
*
|
||||
* THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||
* NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <libgen.h>
|
||||
#include <limits.h>
|
||||
#include <poll.h>
|
||||
#include <signal.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "libevdev/libevdev.h"
|
||||
|
||||
#define min(a, b) (((a) < (b)) ? (a) : (b))
|
||||
#define max(a, b) (((a) > (b)) ? (a) : (b))
|
||||
|
||||
static int signalled = 0;
|
||||
|
||||
struct measurements {
|
||||
int distance;
|
||||
double max_frequency;
|
||||
double *frequencies;
|
||||
size_t frequencies_sz;
|
||||
size_t nfrequencies;
|
||||
uint64_t us;
|
||||
};
|
||||
|
||||
static int
|
||||
usage(const char *progname) {
|
||||
printf("Usage: %s /dev/input/event0\n", progname);
|
||||
printf("\n");
|
||||
printf("This tool reads relative events from the kernel and calculates\n"
|
||||
"the distance covered and maximum frequency of the incoming events.\n"
|
||||
"Some mouse devices provide dynamic frequencies, it is\n"
|
||||
"recommended to measure multiple times to obtain the highest value.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
static inline double
|
||||
get_frequency(uint64_t last, uint64_t current)
|
||||
{
|
||||
return 1000000.0/(current - last);
|
||||
}
|
||||
|
||||
static inline void
|
||||
push_frequency(struct measurements *m, double freq)
|
||||
{
|
||||
if (m->nfrequencies == m->frequencies_sz) {
|
||||
m->frequencies_sz += 100;
|
||||
m->frequencies = realloc(m->frequencies,
|
||||
m->frequencies_sz * sizeof *m->frequencies);
|
||||
if (!m->frequencies)
|
||||
abort();
|
||||
}
|
||||
|
||||
m->frequencies[m->nfrequencies] = freq;
|
||||
m->nfrequencies++;
|
||||
}
|
||||
|
||||
static int
|
||||
print_current_values(const struct measurements *m)
|
||||
{
|
||||
static int progress = 0;
|
||||
char status = 0;
|
||||
|
||||
switch (progress) {
|
||||
case 0: status = '|'; break;
|
||||
case 1: status = '/'; break;
|
||||
case 2: status = '-'; break;
|
||||
case 3: status = '\\'; break;
|
||||
default:
|
||||
status = '?';
|
||||
break;
|
||||
}
|
||||
|
||||
progress = (progress + 1) % 4;
|
||||
|
||||
printf("\rCovered distance in device units: %8d at frequency %3.1fHz %c",
|
||||
abs(m->distance), m->max_frequency, status);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
handle_event(struct measurements *m, const struct input_event *ev)
|
||||
{
|
||||
if (ev->type == EV_SYN) {
|
||||
const int idle_reset = 3000000; /* us */
|
||||
uint64_t last_us = m->us;
|
||||
|
||||
m->us = ev->input_event_sec * 1000000 + ev->input_event_usec;
|
||||
|
||||
/* reset after pause */
|
||||
if (last_us + idle_reset < m->us) {
|
||||
m->max_frequency = 0.0;
|
||||
m->distance = 0;
|
||||
} else {
|
||||
double freq = get_frequency(last_us, m->us);
|
||||
push_frequency(m, freq);
|
||||
m->max_frequency = max(freq, m->max_frequency);
|
||||
return print_current_values(m);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (ev->type != EV_REL)
|
||||
return 0;
|
||||
|
||||
switch(ev->code) {
|
||||
case REL_X:
|
||||
m->distance += ev->value;
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
signal_handler(__attribute__((__unused__)) int signal)
|
||||
{
|
||||
signalled++;
|
||||
}
|
||||
|
||||
static int
|
||||
mainloop(struct libevdev *dev, struct measurements *m) {
|
||||
struct pollfd fds;
|
||||
|
||||
fds.fd = libevdev_get_fd(dev);
|
||||
fds.events = POLLIN;
|
||||
|
||||
signal(SIGINT, signal_handler);
|
||||
|
||||
while (poll(&fds, 1, -1)) {
|
||||
struct input_event ev;
|
||||
int rc;
|
||||
|
||||
if (signalled)
|
||||
break;
|
||||
|
||||
do {
|
||||
rc = libevdev_next_event(dev, LIBEVDEV_READ_FLAG_NORMAL, &ev);
|
||||
if (rc == LIBEVDEV_READ_STATUS_SYNC) {
|
||||
fprintf(stderr, "Error: cannot keep up\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (rc != -EAGAIN && rc < 0) {
|
||||
fprintf(stderr, "Error: %s\n", strerror(-rc));
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (rc == LIBEVDEV_READ_STATUS_SUCCESS)
|
||||
handle_event(m, &ev);
|
||||
} while (rc != -EAGAIN);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline double
|
||||
mean_frequency(struct measurements *m)
|
||||
{
|
||||
int idx;
|
||||
|
||||
idx = m->nfrequencies/2;
|
||||
return m->frequencies[idx];
|
||||
}
|
||||
|
||||
static inline const char*
|
||||
bustype(int bustype)
|
||||
{
|
||||
const char *bus;
|
||||
|
||||
switch(bustype) {
|
||||
case BUS_PCI: bus = "pci"; break;
|
||||
case BUS_ISAPNP: bus = "isapnp"; break;
|
||||
case BUS_USB: bus = "usb"; break;
|
||||
case BUS_HIL: bus = "hil"; break;
|
||||
case BUS_BLUETOOTH: bus = "bluetooth"; break;
|
||||
case BUS_VIRTUAL: bus = "virtual"; break;
|
||||
default: bus = "unknown bus type"; break;
|
||||
}
|
||||
|
||||
return bus;
|
||||
}
|
||||
|
||||
static void
|
||||
print_summary(struct libevdev *dev, struct measurements *m)
|
||||
{
|
||||
int res;
|
||||
int max_freq, mean_freq;
|
||||
|
||||
if (m->nfrequencies == 0) {
|
||||
fprintf(stderr, "Error: no matching events received.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
max_freq = (int)m->max_frequency;
|
||||
mean_freq = (int)mean_frequency(m);
|
||||
|
||||
printf("Estimated sampling frequency: %dHz (mean %dHz)\n",
|
||||
max_freq, mean_freq);
|
||||
|
||||
if (max_freq > mean_freq * 1.3)
|
||||
printf("WARNING: Max frequency is more than 30%% higher "
|
||||
"than mean frequency. Manual verification required!\n");
|
||||
|
||||
printf("To calculate resolution, measure physical distance covered\n"
|
||||
"and look up the matching resolution in the table below\n");
|
||||
|
||||
m->distance = abs(m->distance);
|
||||
|
||||
/* If the mouse has more than 2500dpi, the manufacturer usually
|
||||
shows off on their website anyway */
|
||||
for (res = 400; res <= 2500; res += 200) {
|
||||
double inch = m->distance/(double)res;
|
||||
printf("%8dmm %8.2fin %8ddpi\n",
|
||||
(int)(inch * 25.4), inch, res);
|
||||
}
|
||||
printf("If your resolution is not in the list, calculate it with:\n"
|
||||
"\tresolution=%d/inches, or\n"
|
||||
"\tresolution=%d * 25.4/mm\n", m->distance, m->distance);
|
||||
|
||||
printf("\n");
|
||||
printf("Entry for hwdb match (replace XXX with the resolution in DPI):\n"
|
||||
"mouse:%s:v%04xp%04x:name:%s:\n"
|
||||
" MOUSE_DPI=XXX@%d\n",
|
||||
bustype(libevdev_get_id_bustype(dev)),
|
||||
libevdev_get_id_vendor(dev),
|
||||
libevdev_get_id_product(dev),
|
||||
libevdev_get_name(dev),
|
||||
(int)m->max_frequency);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char **argv) {
|
||||
int rc;
|
||||
int fd;
|
||||
const char *path;
|
||||
struct libevdev *dev;
|
||||
struct measurements measurements = {0};
|
||||
|
||||
if (argc < 2)
|
||||
return usage(basename(argv[0]));
|
||||
|
||||
path = argv[1];
|
||||
if (path[0] == '-')
|
||||
return usage(basename(argv[0]));
|
||||
|
||||
fd = open(path, O_RDONLY|O_NONBLOCK);
|
||||
if (fd < 0) {
|
||||
fprintf(stderr, "Error opening the device: %s\n", strerror(errno));
|
||||
return 1;
|
||||
}
|
||||
|
||||
rc = libevdev_new_from_fd(fd, &dev);
|
||||
if (rc != 0) {
|
||||
fprintf(stderr, "Error fetching the device info: %s\n", strerror(-rc));
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (libevdev_grab(dev, LIBEVDEV_GRAB) != 0) {
|
||||
fprintf(stderr, "Error: cannot grab the device, something else is grabbing it.\n");
|
||||
fprintf(stderr, "Use 'fuser -v %s' to find processes with an open fd\n", path);
|
||||
return 1;
|
||||
}
|
||||
libevdev_grab(dev, LIBEVDEV_UNGRAB);
|
||||
|
||||
printf("Mouse %s on %s\n", libevdev_get_name(dev), path);
|
||||
printf("Move the device 250mm/10in or more along the x-axis.\n");
|
||||
printf("Pause 3 seconds before movement to reset, Ctrl+C to exit.\n");
|
||||
setbuf(stdout, NULL);
|
||||
|
||||
rc = mainloop(dev, &measurements);
|
||||
|
||||
printf("\n");
|
||||
|
||||
print_summary(dev, &measurements);
|
||||
|
||||
libevdev_free(dev);
|
||||
close(fd);
|
||||
|
||||
return rc;
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
.TH TOUCHPAD-EDGE-DETECTOR "1"
|
||||
.SH NAME
|
||||
touchpad-edge-detector \- print the axis ranges for a touchpad device
|
||||
.SH SYNOPSIS
|
||||
.B touchpad-edge-detector [--help] \fIWxH /dev/input/eventX\fR
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
The
|
||||
.B touchpad-edge-detector
|
||||
tool reads touchpad events from the kernel and records the minimum and
|
||||
maximum coordinates based on user input. This is an interactive tool, the
|
||||
user must move a finger around the touchpad, attempting to trigger an
|
||||
event at all edges of the touchpad.
|
||||
.PP
|
||||
To terminate the event collection and print a summary, press Ctrl+C. It is
|
||||
recommended that the tool is run several times to guarantee a reliable
|
||||
result.
|
||||
.SH OPTIONS
|
||||
.TP 8
|
||||
.I WxH
|
||||
The width and height of the touchpad in mm. For a touchpad 100mm wide and
|
||||
75mm high, the argument is thus \fI100x75\fR. This is a required argument.
|
||||
.TP 8
|
||||
.I /dev/input/eventX
|
||||
The event node of the touchpad to read events from. A list of possible event
|
||||
nodes can be obtained with either one of the following commands: \fBlibinput
|
||||
record\fR, \fBevemu-record\fR, or \fBevtest\fR. Alternatively the event node
|
||||
for a device is listed in the \fBHandlers=\fR line \fI/proc/bus/input/devices\fR.
|
||||
This is a required argument.
|
||||
.TP 8
|
||||
.B --help
|
||||
Print a short help description
|
||||
.SH NOTES
|
||||
.PP
|
||||
On completion, this tool prints a summary of the collected events and a
|
||||
suggested udev rule. Due to rounding errors it is rare to get an exact match
|
||||
for the touchpad's dimensions, but any discrepancy of more than 5mm should
|
||||
be corrected with the suggested udev rule.
|
||||
.PP
|
||||
The udev rule should be simplified and submitted as a pull request to the
|
||||
system repository at \fIhttps://github.com/systemd/systemd\fR. For further
|
||||
guidance, see the file \fI/usr/lib/udev/hwdb.d/60-evdev.hwdb\fR.
|
||||
.SH SEE ALSO
|
||||
udev(7)
|
||||
@@ -1,312 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2014 Red Hat, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software
|
||||
* and its documentation for any purpose is hereby granted without
|
||||
* fee, provided that the above copyright notice appear in all copies
|
||||
* and that both that copyright notice and this permission notice
|
||||
* appear in supporting documentation, and that the name of Red Hat
|
||||
* not be used in advertising or publicity pertaining to distribution
|
||||
* of the software without specific, written prior permission. Red
|
||||
* Hat makes no representations about the suitability of this software
|
||||
* for any purpose. It is provided "as is" without express or implied
|
||||
* warranty.
|
||||
*
|
||||
* THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||
* NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <libgen.h>
|
||||
#include <limits.h>
|
||||
#include <math.h>
|
||||
#include <poll.h>
|
||||
#include <signal.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "libevdev/libevdev.h"
|
||||
|
||||
#define min(a, b) (((a) < (b)) ? (a) : (b))
|
||||
#define max(a, b) (((a) > (b)) ? (a) : (b))
|
||||
|
||||
static int signalled = 0;
|
||||
|
||||
static int
|
||||
usage(const char *progname) {
|
||||
printf("Usage: %s 12x34 /dev/input/eventX\n", progname);
|
||||
printf("\n");
|
||||
printf("This tool reads the touchpad events from the kernel and calculates\n "
|
||||
"the minimum and maximum for the x and y coordinates, respectively.\n"
|
||||
"The first argument is the physical size of the touchpad in mm (WIDTHxHEIGHT).\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
struct dimensions {
|
||||
int top, bottom, left, right;
|
||||
};
|
||||
|
||||
struct size {
|
||||
int w, h;
|
||||
};
|
||||
|
||||
static int
|
||||
print_current_values(const struct dimensions *d)
|
||||
{
|
||||
static int progress;
|
||||
char status = 0;
|
||||
|
||||
switch (progress) {
|
||||
case 0: status = '|'; break;
|
||||
case 1: status = '/'; break;
|
||||
case 2: status = '-'; break;
|
||||
case 3: status = '\\'; break;
|
||||
}
|
||||
|
||||
progress = (progress + 1) % 4;
|
||||
|
||||
printf("\rTouchpad sends: x [%d..%d], y [%d..%d] %c",
|
||||
d->left, d->right, d->top, d->bottom, status);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
handle_event(struct dimensions *d, const struct input_event *ev) {
|
||||
if (ev->type == EV_SYN)
|
||||
return print_current_values(d);
|
||||
|
||||
if (ev->type != EV_ABS)
|
||||
return 0;
|
||||
|
||||
switch(ev->code) {
|
||||
case ABS_X:
|
||||
case ABS_MT_POSITION_X:
|
||||
d->left = min(d->left, ev->value);
|
||||
d->right = max(d->right, ev->value);
|
||||
break;
|
||||
case ABS_Y:
|
||||
case ABS_MT_POSITION_Y:
|
||||
d->top = min(d->top, ev->value);
|
||||
d->bottom = max(d->bottom, ev->value);
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
signal_handler(__attribute__((__unused__)) int signal)
|
||||
{
|
||||
signalled++;
|
||||
}
|
||||
|
||||
static int
|
||||
mainloop(struct libevdev *dev, struct dimensions *dim) {
|
||||
struct pollfd fds;
|
||||
|
||||
fds.fd = libevdev_get_fd(dev);
|
||||
fds.events = POLLIN;
|
||||
|
||||
signal(SIGINT, signal_handler);
|
||||
|
||||
while (poll(&fds, 1, -1)) {
|
||||
struct input_event ev;
|
||||
int rc;
|
||||
|
||||
if (signalled)
|
||||
break;
|
||||
|
||||
do {
|
||||
rc = libevdev_next_event(dev, LIBEVDEV_READ_FLAG_NORMAL, &ev);
|
||||
if (rc == LIBEVDEV_READ_STATUS_SYNC) {
|
||||
fprintf(stderr, "Error: cannot keep up\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (rc != -EAGAIN && rc < 0) {
|
||||
fprintf(stderr, "Error: %s\n", strerror(-rc));
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
if (rc == LIBEVDEV_READ_STATUS_SUCCESS)
|
||||
handle_event(dim, &ev);
|
||||
} while (rc != -EAGAIN);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void
|
||||
pid_vid_matchstr(struct libevdev *dev, char *match, size_t sz)
|
||||
{
|
||||
snprintf(match, sz, "input:b%04Xv%04Xp%04X",
|
||||
libevdev_get_id_bustype(dev),
|
||||
libevdev_get_id_vendor(dev),
|
||||
libevdev_get_id_product(dev));
|
||||
}
|
||||
|
||||
static inline void
|
||||
dmi_matchstr(struct libevdev *dev, char *match, size_t sz)
|
||||
{
|
||||
char modalias[PATH_MAX];
|
||||
FILE *fp;
|
||||
|
||||
fp = fopen("/sys/class/dmi/id/modalias", "r");
|
||||
if (!fp || fgets(modalias, sizeof(modalias), fp) == NULL) {
|
||||
sprintf(match, "ERROR READING DMI MODALIAS");
|
||||
if (fp)
|
||||
fclose(fp);
|
||||
return;
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
|
||||
modalias[strlen(modalias) - 1] = '\0'; /* drop \n */
|
||||
snprintf(match, sz, "name:%s:%s", libevdev_get_name(dev), modalias);
|
||||
}
|
||||
|
||||
static void
|
||||
print_udev_override_rule(struct libevdev *dev,
|
||||
const struct dimensions *dim,
|
||||
const struct size *size) {
|
||||
const struct input_absinfo *x, *y;
|
||||
char match[PATH_MAX];
|
||||
int w, h;
|
||||
int xres, yres;
|
||||
|
||||
x = libevdev_get_abs_info(dev, ABS_X);
|
||||
y = libevdev_get_abs_info(dev, ABS_Y);
|
||||
w = dim->right - dim->left;
|
||||
h = dim->bottom - dim->top;
|
||||
xres = round((double)w/size->w);
|
||||
yres = round((double)h/size->h);
|
||||
|
||||
if (x->resolution && y->resolution) {
|
||||
int width = x->maximum - x->minimum,
|
||||
height = y->maximum - y->minimum;
|
||||
printf("Touchpad size as listed by the kernel: %dx%dmm\n",
|
||||
width/x->resolution, height/y->resolution);
|
||||
} else {
|
||||
printf("Touchpad has no resolution, size unknown\n");
|
||||
}
|
||||
|
||||
printf("User-specified touchpad size: %dx%dmm\n", size->w, size->h);
|
||||
printf("Calculated ranges: %d/%d\n", w, h);
|
||||
printf("\n");
|
||||
printf("Suggested udev rule:\n");
|
||||
|
||||
switch(libevdev_get_id_bustype(dev)) {
|
||||
case BUS_USB:
|
||||
case BUS_BLUETOOTH:
|
||||
pid_vid_matchstr(dev, match, sizeof(match));
|
||||
break;
|
||||
default:
|
||||
dmi_matchstr(dev, match, sizeof(match));
|
||||
break;
|
||||
}
|
||||
|
||||
printf("# <Laptop model description goes here>\n"
|
||||
"evdev:%s*\n"
|
||||
" EVDEV_ABS_00=%d:%d:%d\n"
|
||||
" EVDEV_ABS_01=%d:%d:%d\n",
|
||||
match,
|
||||
dim->left, dim->right, xres,
|
||||
dim->top, dim->bottom, yres);
|
||||
if (libevdev_has_event_code(dev, EV_ABS, ABS_MT_POSITION_X))
|
||||
printf(" EVDEV_ABS_35=%d:%d:%d\n"
|
||||
" EVDEV_ABS_36=%d:%d:%d\n",
|
||||
dim->left, dim->right, xres,
|
||||
dim->top, dim->bottom, yres);
|
||||
}
|
||||
|
||||
int main (int argc, char **argv) {
|
||||
int rc;
|
||||
int fd;
|
||||
const char *path;
|
||||
struct libevdev *dev;
|
||||
struct dimensions dim;
|
||||
struct size size;
|
||||
|
||||
if (argc < 3)
|
||||
return usage(basename(argv[0]));
|
||||
|
||||
if (sscanf(argv[1], "%dx%d", &size.w, &size.h) != 2 ||
|
||||
size.w <= 0 || size.h <= 0)
|
||||
return usage(basename(argv[0]));
|
||||
|
||||
if (size.w < 30 || size.h < 30) {
|
||||
fprintf(stderr,
|
||||
"%dx%dmm is too small for a touchpad.\n"
|
||||
"Please specify the touchpad size in mm.\n",
|
||||
size.w, size.h);
|
||||
return 1;
|
||||
}
|
||||
|
||||
path = argv[2];
|
||||
if (path[0] == '-')
|
||||
return usage(basename(argv[0]));
|
||||
|
||||
fd = open(path, O_RDONLY|O_NONBLOCK);
|
||||
if (fd < 0) {
|
||||
fprintf(stderr, "Error opening the device: %s\n", strerror(errno));
|
||||
return 1;
|
||||
}
|
||||
|
||||
rc = libevdev_new_from_fd(fd, &dev);
|
||||
if (rc != 0) {
|
||||
fprintf(stderr, "Error fetching the device info: %s\n", strerror(-rc));
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (libevdev_grab(dev, LIBEVDEV_GRAB) != 0) {
|
||||
fprintf(stderr, "Error: cannot grab the device, something else is grabbing it.\n");
|
||||
fprintf(stderr, "Use 'fuser -v %s' to find processes with an open fd\n", path);
|
||||
return 1;
|
||||
}
|
||||
libevdev_grab(dev, LIBEVDEV_UNGRAB);
|
||||
|
||||
if (!libevdev_has_event_code(dev, EV_ABS, ABS_X) ||
|
||||
!libevdev_has_event_code(dev, EV_ABS, ABS_Y)) {
|
||||
fprintf(stderr, "Error: this device does not have abs axes\n");
|
||||
rc = EXIT_FAILURE;
|
||||
goto out;
|
||||
}
|
||||
|
||||
dim.left = INT_MAX;
|
||||
dim.right = INT_MIN;
|
||||
dim.top = INT_MAX;
|
||||
dim.bottom = INT_MIN;
|
||||
|
||||
printf("Touchpad %s on %s\n", libevdev_get_name(dev), path);
|
||||
printf("Move one finger around the touchpad to detect the actual edges\n");
|
||||
printf("Kernel says: x [%d..%d], y [%d..%d]\n",
|
||||
libevdev_get_abs_minimum(dev, ABS_X),
|
||||
libevdev_get_abs_maximum(dev, ABS_X),
|
||||
libevdev_get_abs_minimum(dev, ABS_Y),
|
||||
libevdev_get_abs_maximum(dev, ABS_Y));
|
||||
|
||||
setbuf(stdout, NULL);
|
||||
|
||||
rc = mainloop(dev, &dim);
|
||||
printf("\n\n");
|
||||
|
||||
print_udev_override_rule(dev, &dim, &size);
|
||||
|
||||
out:
|
||||
libevdev_free(dev);
|
||||
close(fd);
|
||||
|
||||
return rc;
|
||||
}
|
||||
Reference in New Issue
Block a user