Merge pull request #66 from nirenjan/restructure-layout

Restructure layout
pull/67/head
nirenjan 2026-04-04 00:02:11 -07:00 committed by GitHub
commit f52e328a8b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
127 changed files with 1046 additions and 3068 deletions

View File

@ -1,9 +1,6 @@
#!/bin/bash -x #!/bin/bash -x
# Install dependencies to build and test on Ubuntu runners # Install dependencies to build and test on Ubuntu runners
brew install \ brew install \
autoconf \
automake \
libtool \
pkg-config \ pkg-config \
python3 \ python3 \
gettext \ gettext \

View File

@ -2,9 +2,6 @@
# Install dependencies to build and test on Ubuntu runners # Install dependencies to build and test on Ubuntu runners
sudo apt-get update sudo apt-get update
sudo apt-get install -y \ sudo apt-get install -y \
autoconf \
automake \
libtool \
pkg-config \ pkg-config \
python3 \ python3 \
gettext \ gettext \
@ -17,7 +14,6 @@ sudo apt-get install -y \
libcmocka-dev \ libcmocka-dev \
faketime \ faketime \
meson \ meson \
ninja-build \ ninja-build
libinih-dev
exit 0 exit 0

5
.gitignore vendored
View File

@ -10,10 +10,13 @@ x52test*
x52evtest* x52evtest*
libx52/test_* libx52/test_*
libx52test* libx52test*
libx52util/util_char_map.c libx52util/char_map.c
udev/*.rules udev/*.rules
# Built artifacts / local installs named x52d*; daemon sources use short names.
# Keep tracked daemon files that still use the x52d prefix (headers, configs).
x52d* x52d*
!daemon/x52d*.* !daemon/x52d*.*
!libx52/x52dcomm.h
test-* test-*
libx52-*.tar.gz libx52-*.tar.gz

View File

@ -988,7 +988,7 @@ FILE_PATTERNS = libx52.h \
libx52util.h \ libx52util.h \
vkm.h \ vkm.h \
x52_cli.c \ x52_cli.c \
x52ctl.c \ daemon_control.c \
x52dcomm.h \ x52dcomm.h \
*.dox *.dox
@ -1021,7 +1021,9 @@ EXCLUDE_SYMLINKS = NO
# Note that the wildcards are matched against the file with absolute path, so to # Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories for example use the pattern */test/* # exclude all test directories for example use the pattern */test/*
EXCLUDE_PATTERNS = EXCLUDE_PATTERNS = */libx52/libx52io.h \
*/libx52/libx52util.h \
*/libx52/x52dcomm.h
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the # (namespaces, classes, functions, etc.) that should be excluded from the

View File

@ -30,7 +30,7 @@ Build has been tested on the following operating systems (x86-64 only):
| Platform | Install instructions | | Platform | Install instructions |
| -------- | -------------------- | | -------- | -------------------- |
| Ubuntu | `sudo apt-get install meson gettext libhidapi-dev libevdev-dev libusb-1.0-0-dev libinih-dev pkg-config python3 git` | | Ubuntu | `sudo apt-get install meson gettext libhidapi-dev libevdev-dev libusb-1.0-0-dev libinih-dev pkg-config python3 git` |
| MacOS + Homebrew | `brew install meson gettext hidapi libtool libusb pkg-config python3 git` | | MacOS + Homebrew | `brew install meson gettext hidapi libusb pkg-config python3 git` |
| Arch Linux | `pacman -S base-devel meson libusb hidapi libevdev libinih python git` | | Arch Linux | `pacman -S base-devel meson libusb hidapi libevdev libinih python git` |
| Fedora | `sudo dnf install meson gettext-devel findutils hidapi-devel libusb-devel libevdev-devel inih-devel pkg-config python3 git` | | Fedora | `sudo dnf install meson gettext-devel findutils hidapi-devel libusb-devel libevdev-devel inih-devel pkg-config python3 git` |
@ -47,13 +47,13 @@ Build has been tested on the following operating systems (x86-64 only):
git clone https://github.com/nirenjan/libx52.git git clone https://github.com/nirenjan/libx52.git
``` ```
2. Run autogen.sh 2. Configure the build (from the repository root)
``` ```
cd ./libx52 cd libx52
meson setup build -Dprefix=/usr meson setup build -Dprefix=/usr
``` ```
3. Run the following commands: 3. Compile and install:
``` ```
meson compile -C build && meson install -C build meson compile -C build && meson install -C build
``` ```

View File

@ -1,110 +0,0 @@
# Top level Automake for libx52
#
# Copyright (C) 2012-2018 Nirenjan Krishnan (nirenjan@nirenjan.org)
#
# SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0
ACLOCAL_AMFLAGS = -I m4
# Build any support libraries first
SUBDIRS = subprojects
if USE_NLS
SUBDIRS += po
endif
#######################################################################
# Defaults
#######################################################################
bin_PROGRAMS =
check_PROGRAMS =
lib_LTLIBRARIES =
check_LTLIBRARIES =
pkgconfig_DATA =
TESTS =
EXTRA_DIST =
CLEANFILES =
BUILT_SOURCES =
x52includedir = $(includedir)/libx52
x52include_HEADERS =
LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/tap-driver.sh
########################################################################
# Get build version
########################################################################
BUILT_SOURCES += version-info.h
CLEANFILES += version-info.h
version-info.h: ${top_srcdir}/version-info
CC=${CC} ${top_srcdir}/version-info ${top_srcdir} >$@
########################################################################
# Include automake stubs
########################################################################
include libx52/Makefile.am
include libx52util/Makefile.am
include libx52io/Makefile.am
include libusbx52/Makefile.am
include cli/Makefile.am
include joytest/Makefile.am
include evtest/Makefile.am
include daemon/Makefile.am
include udev/Makefile.am
include bugreport/Makefile.am
include docs/Makefile.am
#######################################################################
# Doxygen support
#######################################################################
if HAVE_DOXYGEN
DXGEN = $(DXGEN_@AM_V@)
DXGEN_ = $(DXGEN_@AM_DEFAULT_V@)
DXGEN_0 = @printf " DXGEN $<\n";
SYSCONFDIR=@sysconfdir@
LOCALSTATEDIR=@localstatedir@
export SYSCONFDIR
export LOCALSTATEDIR
docs/.stamp: Doxyfile
$(DXGEN)$(DOXYGEN) $<
$(AM_V_at)touch $@
all-local: docs/.stamp
clean-local:
rm -rf $(top_builddir)/docs
man1_MANS = docs/man/man1/x52cli.1 docs/man/man1/x52bugreport.1
$(man1_MANS): docs/.stamp
# Install Doxygen generated HTML documentation and manpages
install-data-local:
$(INSTALL) -d $(DESTDIR)$(docdir)
cp -R -P $(top_builddir)/docs/html $(DESTDIR)$(docdir)
uninstall-local:
rm -rf $(DESTDIR)$(docdir)
endif
# Extra files that need to be in the distribution
EXTRA_DIST += \
ABOUT-NLS \
AUTHORS \
ChangeLog.md \
CONTRIBUTING.md \
Doxyfile.in \
DoxygenLayout.xml \
INSTALL.md \
LICENSE \
README.md \
config.rpath \
version-info \
Version \
gettext.h \
usb-ids.h \
po/README.md

View File

@ -1,3 +0,0 @@
#!/bin/sh -x
autoreconf --install

View File

@ -1,26 +0,0 @@
# Automake for libx52-bugreport
#
# Copyright (C) 2021 Nirenjan Krishnan (nirenjan@nirenjan.org)
#
# SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0
bin_PROGRAMS += x52bugreport
# Bug report program that reports the build and linked library versions
x52bugreport_SOURCES = bugreport/bugreport.c
x52bugreport_CFLAGS = \
-I$(top_srcdir)/libx52io \
@LIBUSB_CFLAGS@ \
@HIDAPI_CFLAGS@ \
$(WARN_CFLAGS)
x52bugreport_LDFLAGS = \
@LIBUSB_LIBS@ \
@HIDAPI_LIBS@ \
$(WARN_LDFLAGS)
x52bugreport_LDADD = libx52io.la
$(x52bugreport_OBJECTS): version-info.h
EXTRA_DIST += bugreport/bugreport.dox

View File

@ -6,7 +6,7 @@
* SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0
*/ */
#include "config.h" #include "build-config.h"
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
@ -14,7 +14,7 @@
#include "libusb.h" #include "libusb.h"
#include "hidapi.h" #include "hidapi.h"
#include "libx52io.h" #include <libx52/libx52io.h>
#include "version-info.h" #include "version-info.h"
static void print_sysinfo(void) static void print_sysinfo(void)

View File

@ -1,27 +0,0 @@
# Automake for x52cli
#
# Copyright (C) 2012-2018 Nirenjan Krishnan (nirenjan@nirenjan.org)
#
# SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0
bin_PROGRAMS += x52cli
# Command line utility that front ends the core library
x52cli_SOURCES = cli/x52_cli.c
x52cli_CFLAGS = -I $(top_srcdir)/libx52 $(WARN_CFLAGS)
x52cli_LDFLAGS = $(WARN_LDFLAGS)
x52cli_LDADD = libx52.la
if HAVE_CMOCKA
TESTS += test-cli
check_PROGRAMS += test-cli
test_cli_SOURCES = cli/x52_cli.c cli/test_x52_cli.c
test_cli_CFLAGS = @CMOCKA_CFLAGS@ -DX52_CLI_TESTING -I $(top_srcdir)/libx52
test_cli_LDFLAGS = @CMOCKA_LIBS@ $(WARN_LDFLAGS)
# Add a dependency on test_x52_cli_tests.c
cli/test_x52_cli.c: cli/test_x52_cli_tests.c
endif
EXTRA_DIST += cli/test_x52_cli_tests.c

View File

@ -12,7 +12,7 @@
#include <setjmp.h> #include <setjmp.h>
#include <cmocka.h> #include <cmocka.h>
#include "libx52.h" #include <libx52/libx52.h>
extern int run_main(int argc, char **argv); extern int run_main(int argc, char **argv);

View File

@ -150,7 +150,7 @@ possibly through \b sudo(8)
*/ */
#define _GNU_SOURCE #define _GNU_SOURCE
#include "config.h" #include "build-config.h"
#include <stdio.h> #include <stdio.h>
#include <stdint.h> #include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
@ -158,7 +158,7 @@ possibly through \b sudo(8)
#include <unistd.h> #include <unistd.h>
#include <time.h> #include <time.h>
#include "libx52.h" #include <libx52/libx52.h>
struct string_map { struct string_map {
const char *key; const char *key;

View File

@ -1,153 +0,0 @@
# Autoconf settings for libx52
#
# Copyright (C) 2012-2021 Nirenjan Krishnan (nirenjan@nirenjan.org)
#
# SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0
AC_INIT([libx52], [m4_esyscmd_s([cat ./Version])], [nirenjan@gmail.com])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([-Wall foreign subdir-objects])
AC_REQUIRE_AUX_FILE([tap-driver.sh])
AC_PROG_CC
AC_PROG_CC_STDC
AC_PROG_AWK
AC_PROG_SED
AC_PROG_MKDIR_P
AM_PROG_AR
AM_PATH_PYTHON([3.5])
LT_INIT
PKG_PROG_PKG_CONFIG
PKG_INSTALLDIR
AX_COMPILER_FLAGS
VISIBILITY_CFLAGS=
if test "x$GCC" = xyes; then
VISIBILITY_CFLAGS="-fvisibility=hidden"
fi
AC_SUBST([VISIBILITY_CFLAGS])
AC_CANONICAL_HOST
AX_GCC_FUNC_ATTRIBUTE([constructor])
AX_GCC_FUNC_ATTRIBUTE([destructor])
AX_GCC_FUNC_ATTRIBUTE([format])
AX_GCC_FUNC_ATTRIBUTE([noreturn])
AC_C_TYPEOF
AC_MSG_NOTICE([Detected host OS is ${host_os}])
build_linux=no
# Detect target system
case "${host_os}" in
linux*)
build_linux=yes
;;
esac
AM_CONDITIONAL([LINUX], [test "x${build_linux}" = "xyes"])
# Internationalization
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION(0.19)
AM_CONDITIONAL([USE_NLS], [test "x${USE_NLS}" == "xyes"])
# Check for libusb-1.0
PKG_CHECK_MODULES([LIBUSB], [libusb-1.0])
AC_SUBST([LIBUSB_PC], [libusb-1.0])
# systemd support
PKG_CHECK_MODULES([SYSTEMD], [systemd], [have_systemd=yes], [have_systemd=no])
AC_ARG_ENABLE([systemd],
[AS_HELP_STRING([--disable-systemd], [Disable systemd support])]
)
AC_ARG_WITH([systemdsystemunitdir],
[AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd unit files])],
[systemdsystemunitdir=$withval],
[systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)]
)
AC_SUBST([systemdsystemunitdir], [$systemdsystemunitdir])
AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$have_systemd" = "xyes" -a "x$enable_systemd" != "xno"])
AM_COND_IF([HAVE_SYSTEMD],,
[
AC_MSG_NOTICE([systemd not found or disabled. Enabling timestamps in logs])
AX_APPEND_FLAG([-DPINELOG_SHOW_DATE=1], [PINELOG_CFLAGS])
]
)
# evdev support
# This is only on Linux machines, so we need to set an automake conditional
PKG_CHECK_MODULES([EVDEV], [libevdev], [have_evdev=yes], [have_evdev=no])
AM_CONDITIONAL([HAVE_EVDEV], [test "x$have_evdev" = "xyes"])
# Pinelog configuration
AX_APPEND_FLAG([-DPINELOG_SHOW_LEVEL=1], [PINELOG_CFLAGS])
AX_APPEND_FLAG([-DPINELOG_SHOW_BACKTRACE=1], [PINELOG_CFLAGS])
AX_APPEND_FLAG([-DPINELOG_BUFFER_SZ=1024], [PINELOG_CFLAGS])
AC_SUBST([PINELOG_CFLAGS])
# Check for hidapi. This uses a different pkg-config file on Linux vs other
# hosts, so check accordingly
AM_COND_IF([LINUX], [hidapi_backend=hidapi-hidraw], [hidapi_backend=hidapi])
PKG_CHECK_MODULES([HIDAPI], [${hidapi_backend}])
AC_SUBST([HIDAPI_PC], [${hidapi_backend}])
# Check for inih library, this is now packaged with recent distros
PKG_CHECK_MODULES([INIH], [inih])
# Check for pthreads
ACX_PTHREAD
# make distcheck doesn't work if some files are installed outside $prefix.
# Check for a prefix ending in /_inst, if this is found, we can assume this
# to be a make distcheck, and disable some of the installcheck stuff.
AS_CASE([$prefix], [*/_inst],
[AC_MSG_NOTICE([[Prefix ends in /_inst; this looks like a 'make distcheck']])
is_make_distcheck=yes])
AM_CONDITIONAL([IS_MAKE_DISTCHECK], [test "x$is_make_distcheck" = xyes])
AC_MSG_CHECKING([final decision IS_MAKE_DISTCHECK (running "make distcheck"?)])
AM_COND_IF([IS_MAKE_DISTCHECK], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
# udev support
PKG_CHECK_MODULES([UDEV], [udev], [have_udev=yes], [have_udev=no])
AM_CONDITIONAL([HAVE_UDEV], [test "x$have_udev" = xyes])
AC_ARG_WITH([udevrulesdir],
AS_HELP_STRING([--with-udevrulesdir=DIR], [Directory for udev rules]),
[udevrulesdir=$withval],
[udevrulesdir=$($PKG_CONFIG --variable=udevdir udev)"/rules.d"])
AC_SUBST([udevrulesdir], [$udevrulesdir])
AC_ARG_WITH([input-group],
AS_HELP_STRING([--with-input-group=GROUP], [Group allowed to access input devices]),
[input_group=$withval],
[input_group=plugdev])
AC_SUBST([input_group], [$input_group])
# Doxygen Support
AC_CHECK_PROGS([DOXYGEN], [doxygen])
AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"])
AM_COND_IF([HAVE_DOXYGEN],
[AC_CONFIG_FILES([Doxyfile])],
[AC_MSG_WARN(["Doxygen not found; continuing without doxygen support"])])
# cmocka unit tests
PKG_CHECK_MODULES([CMOCKA], [cmocka >= 1.1], [have_cmocka=yes], [have_cmocka=no])
AM_CONDITIONAL([HAVE_CMOCKA], [test "x$have_cmocka" = xyes])
AM_COND_IF([HAVE_CMOCKA], [],
[AC_MSG_WARN(["cmocka not found; disabling unit test build"])])
# Check for the presence of tm_gmtoff in struct tm. If we have this, then we
# can use it to determine the true GMT offset
AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,
[AC_MSG_WARN(["Cannot find tm_gmtoff in struct tm, using slower method"])],
[#define _GNU_SOURCE
#include <time.h>
])
# Configuration headers
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([ po/Makefile.in
Makefile
subprojects/Makefile
libx52/libx52.pc
libx52io/libx52io.pc
libx52util/libx52util.pc
subprojects/pinelog/Makefile
udev/60-saitek-x52-x52pro.rules
])
AC_OUTPUT

View File

@ -1,146 +0,0 @@
# Automake for x52d
#
# Copyright (C) 2021 Nirenjan Krishnan (nirenjan@nirenjan.org)
#
# SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0
bin_PROGRAMS += x52d x52ctl
# Service daemon that manages the X52 device
x52d_SOURCES = \
daemon/x52d_main.c \
daemon/x52d_config_parser.c \
daemon/x52d_config_dump.c \
daemon/x52d_config.c \
daemon/x52d_device.c \
daemon/x52d_client.c \
daemon/x52d_clock.c \
daemon/x52d_mouse.c \
daemon/x52d_notify.c \
daemon/x52d_led.c \
daemon/x52d_command.c \
daemon/x52d_comm_internal.c \
daemon/x52d_comm_client.c
x52d_CFLAGS = \
-I $(top_srcdir) \
-I $(top_srcdir)/libx52io \
-I $(top_srcdir)/libx52 \
-I $(top_srcdir)/libx52util \
-I $(top_srcdir)/subprojects/pinelog \
-DSYSCONFDIR=\"$(sysconfdir)\" \
-DLOCALEDIR=\"$(localedir)\" \
-DLOGDIR=\"$(localstatedir)/log\" \
-DRUNDIR=\"$(localstatedir)/run\" \
@INIH_CFLAGS@ @PTHREAD_CFLAGS@ $(WARN_CFLAGS)
x52d_LDFLAGS = @INIH_LIBS@ @PTHREAD_LIBS@ $(WARN_LDFLAGS)
x52d_LDADD = \
subprojects/pinelog/libpinelog.la \
libx52.la \
@LTLIBINTL@
if HAVE_EVDEV
x52d_SOURCES += \
daemon/x52d_io.c \
daemon/x52d_mouse_evdev.c
x52d_CFLAGS += -DHAVE_EVDEV @EVDEV_CFLAGS@
x52d_LDFLAGS += @EVDEV_LIBS@
x52d_LDADD += libx52io.la
endif
lib_LTLIBRARIES += libx52dcomm.la
# Client library to communicate with X52 daemon
libx52dcomm_la_SOURCES = \
daemon/x52d_comm_client.c \
daemon/x52d_comm_internal.c
libx52dcomm_la_CFLAGS = \
-I $(top_srcdir) \
-DSYSCONFDIR=\"$(sysconfdir)\" \
-DLOCALEDIR=\"$(localedir)\" \
-DLOGDIR=\"$(localstatedir)/log\" \
-DRUNDIR=\"$(localstatedir)/run\" \
$(VISIBILITY_CFLAGS) \
$(WARN_CFLAGS)
libx52dcomm_la_LDFLAGS = \
-export-symbols-regex '^x52d_(dial_command|dial_notify|format_command|send_command|recv_notification)$' \
$(WARN_LDFLAGS)
x52include_HEADERS += daemon/x52dcomm.h
x52ctl_SOURCES = daemon/x52ctl.c
x52ctl_CFLAGS = \
-I $(top_srcdir) \
$(WARN_CFLAGS)
x52ctl_LDFLAGS = $(WARN_LDFLAGS)
x52ctl_LDADD = libx52dcomm.la @LTLIBINTL@
x52dconfdir = @sysconfdir@/x52d
x52dconf_DATA = daemon/x52d.conf
install-exec-hook:
$(MKDIR_P) $(DESTDIR)$(localstatedir)/log
$(MKDIR_P) $(DESTDIR)$(localstatedir)/run
EXTRA_DIST += \
daemon/daemon.dox \
daemon/protocol.dox \
daemon/x52d.service.in \
daemon/x52d_client.h \
daemon/x52d_clock.h \
daemon/x52d_config.def \
daemon/x52d_config.h \
daemon/x52d_const.h \
daemon/x52d_device.h \
daemon/x52d_io.h \
daemon/x52d_mouse.h \
daemon/x52d_notify.h \
daemon/x52d_command.h \
daemon/x52dcomm.h \
daemon/x52dcomm-internal.h \
daemon/x52d.conf
# Test cases
EXTRA_DIST += \
daemon/test_daemon_comm.py \
daemon/tests/config/args.tc \
daemon/tests/config/clock.tc \
daemon/tests/config/led.tc \
daemon/tests/config/mouse.tc \
daemon/tests/logging/error.tc \
daemon/tests/logging/global.tc \
daemon/tests/logging/module.tc \
daemon/tests/cli.tc
TESTS += daemon/test_daemon_comm.py
if HAVE_CMOCKA
check_PROGRAMS += x52d-mouse-test
x52d_mouse_test_SOURCES = \
daemon/x52d_mouse_test.c \
daemon/x52d_mouse.c
x52d_mouse_test_CFLAGS = \
-DLOCALEDIR='"$(localedir)"' \
-I $(top_srcdir) \
-I $(top_srcdir)/libx52 \
-I $(top_srcdir)/libx52io \
-I $(top_srcdir)/subprojects/pinelog \
$(WARN_CFLAGS) @CMOCKA_CFLAGS@
x52d_mouse_test_LDFLAGS = @CMOCKA_LIBS@ $(WARN_LDFLAGS)
x52d_mouse_test_LDADD = \
subprojects/pinelog/libpinelog.la \
@LTLIBINTL@
TESTS += x52d-mouse-test
endif
if HAVE_SYSTEMD
if !IS_MAKE_DISTCHECK
SED_ARGS = s,%bindir%,$(bindir),g
x52d.service: daemon/x52d.service.in
$(AM_V_GEN) $(SED) -e '$(SED_ARGS)' $< > $@
systemdsystemunit_DATA = x52d.service
endif
endif

View File

@ -12,8 +12,8 @@
#include <unistd.h> #include <unistd.h>
#include "pinelog.h" #include "pinelog.h"
#include "x52d_client.h" #include <daemon/client.h>
#include "x52dcomm-internal.h" #include <daemon/x52dcomm-internal.h>
void x52d_client_init(int client_fd[X52D_MAX_CLIENTS]) void x52d_client_init(int client_fd[X52D_MAX_CLIENTS])
{ {

View File

@ -12,7 +12,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <poll.h> #include <poll.h>
#include "x52d_const.h" #include <daemon/constants.h>
#define MAX_CONN (X52D_MAX_CLIENTS + 1) #define MAX_CONN (X52D_MAX_CLIENTS + 1)

View File

@ -6,7 +6,7 @@
* SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0
*/ */
#include "config.h" #include "build-config.h"
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <pthread.h> #include <pthread.h>
@ -15,10 +15,10 @@
#define PINELOG_MODULE X52D_MOD_CLOCK #define PINELOG_MODULE X52D_MOD_CLOCK
#include "pinelog.h" #include "pinelog.h"
#include "x52d_config.h" #include <daemon/config.h>
#include "x52d_clock.h" #include <daemon/clock.h>
#include "x52d_const.h" #include <daemon/constants.h>
#include "x52d_device.h" #include <daemon/device.h>
static bool clock_enabled = false; static bool clock_enabled = false;
static int clock_primary_is_local = false; static int clock_primary_is_local = false;

View File

@ -6,7 +6,7 @@
* SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0
*/ */
#include "config.h" #include "build-config.h"
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
@ -15,8 +15,8 @@
#include <sys/un.h> #include <sys/un.h>
#include <unistd.h> #include <unistd.h>
#include "x52dcomm.h" #include <libx52/x52dcomm.h>
#include "x52dcomm-internal.h" #include <daemon/x52dcomm-internal.h>
static int _setup_socket(struct sockaddr_un *remote, int len) static int _setup_socket(struct sockaddr_un *remote, int len)
{ {

View File

@ -6,15 +6,15 @@
* SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0
*/ */
#include "config.h" #include "build-config.h"
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h> #include <unistd.h>
#include "x52dcomm-internal.h" #include <daemon/x52dcomm-internal.h>
#include "x52d_const.h" #include <daemon/constants.h>
const char * x52d_command_sock_path(const char *sock_path) const char * x52d_command_sock_path(const char *sock_path)
{ {

View File

@ -6,7 +6,7 @@
* SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0
*/ */
#include "config.h" #include "build-config.h"
#include <stdbool.h> #include <stdbool.h>
#include <string.h> #include <string.h>
#include <stdarg.h> #include <stdarg.h>
@ -21,11 +21,11 @@
#define PINELOG_MODULE X52D_MOD_COMMAND #define PINELOG_MODULE X52D_MOD_COMMAND
#include "pinelog.h" #include "pinelog.h"
#include "x52d_const.h" #include <daemon/constants.h>
#include "x52d_command.h" #include <daemon/command.h>
#include "x52d_config.h" #include <daemon/config.h>
#include "x52d_client.h" #include <daemon/client.h>
#include "x52dcomm-internal.h" #include <daemon/x52dcomm-internal.h>
static int client_fd[X52D_MAX_CLIENTS]; static int client_fd[X52D_MAX_CLIENTS];

View File

@ -6,13 +6,13 @@
* SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0
*/ */
#include "config.h" #include "build-config.h"
#include <errno.h> #include <errno.h>
#define PINELOG_MODULE X52D_MOD_CONFIG #define PINELOG_MODULE X52D_MOD_CONFIG
#include "pinelog.h" #include "pinelog.h"
#include "x52d_config.h" #include <daemon/config.h>
#include "x52d_const.h" #include <daemon/constants.h>
static struct x52d_config x52d_config; static struct x52d_config x52d_config;
@ -97,7 +97,7 @@ void x52d_config_apply_immediate(const char *section, const char *key)
x52d_cfg_set_ ## c_sec ## _ ## c_key(x52d_config . name); \ x52d_cfg_set_ ## c_sec ## _ ## c_key(x52d_config . name); \
} else } else
#include "x52d_config.def" #include <daemon/config.def>
// Dummy to capture the trailing else // Dummy to capture the trailing else
// Wrap it in braces in case tracing has been disabled // Wrap it in braces in case tracing has been disabled
{ PINELOG_TRACE("Ignoring apply_immediate(%s.%s)", section, key); } { PINELOG_TRACE("Ignoring apply_immediate(%s.%s)", section, key); }
@ -108,5 +108,5 @@ void x52d_config_apply(void)
#define CFG(section, key, name, parser, def) \ #define CFG(section, key, name, parser, def) \
PINELOG_TRACE("Calling configuration callback for " #section "." #key); \ PINELOG_TRACE("Calling configuration callback for " #section "." #key); \
x52d_cfg_set_ ## section ## _ ## key(x52d_config . name); x52d_cfg_set_ ## section ## _ ## key(x52d_config . name);
#include "x52d_config.def" #include <daemon/config.def>
} }

View File

@ -12,7 +12,7 @@
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <limits.h> #include <limits.h>
#include "libx52.h" #include <libx52/libx52.h>
/** /**
* @brief Configuration structure * @brief Configuration structure

View File

@ -6,7 +6,7 @@
* SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0
*/ */
#include "config.h" #include "build-config.h"
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <stddef.h> #include <stddef.h>
@ -16,9 +16,9 @@
#define PINELOG_MODULE X52D_MOD_CONFIG #define PINELOG_MODULE X52D_MOD_CONFIG
#include "pinelog.h" #include "pinelog.h"
#include "libx52.h" #include <libx52/libx52.h>
#include "x52d_config.h" #include <daemon/config.h>
#include "x52d_const.h" #include <daemon/constants.h>
// Create a pointer "name" of type "type", which stores the value of the // Create a pointer "name" of type "type", which stores the value of the
// corresponding element within the config struct. // corresponding element within the config struct.
@ -130,7 +130,7 @@ int x52d_config_save_file(struct x52d_config *cfg, const char *cfg_file)
fprintf(cfg_fp, "%s = %s\n", #key, value); \ fprintf(cfg_fp, "%s = %s\n", #key, value); \
} \ } \
} while (0); } while (0);
#include "x52d_config.def" #include <daemon/config.def>
exit_dump: exit_dump:
free(current_section); free(current_section);
@ -145,7 +145,7 @@ const char *x52d_config_get_param(struct x52d_config *cfg, const char *section,
return type ## _dumper(section, key, cfg, offsetof(struct x52d_config, name)); \ return type ## _dumper(section, key, cfg, offsetof(struct x52d_config, name)); \
} \ } \
} while (0); } while (0);
#include "x52d_config.def" #include <daemon/config.def>
return NULL; return NULL;
} }

View File

@ -6,7 +6,7 @@
* SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0
*/ */
#include "config.h" #include "build-config.h"
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <stddef.h> #include <stddef.h>
@ -17,8 +17,8 @@
#define PINELOG_MODULE X52D_MOD_CONFIG #define PINELOG_MODULE X52D_MOD_CONFIG
#include "ini.h" #include "ini.h"
#include "pinelog.h" #include "pinelog.h"
#include "x52d_config.h" #include <daemon/config.h>
#include "x52d_const.h" #include <daemon/constants.h>
/* Parser function typedef */ /* Parser function typedef */
typedef int (*parser_fn)(struct x52d_config *, size_t, const char *); typedef int (*parser_fn)(struct x52d_config *, size_t, const char *);
@ -142,7 +142,7 @@ static const struct config_map {
parser_fn parser; parser_fn parser;
size_t offset; size_t offset;
} config_map[] = { } config_map[] = {
#include "x52d_config.def" #include <daemon/config.def>
// Terminating entry // Terminating entry
{NULL, NULL, NULL, 0} {NULL, NULL, NULL, 0}
@ -195,7 +195,7 @@ int x52d_config_set_defaults(struct x52d_config *cfg) {
if (rc != 0) { \ if (rc != 0) { \
return rc; \ return rc; \
} }
#include "x52d_config.def" #include <daemon/config.def>
return 0; return 0;
} }

View File

@ -40,7 +40,7 @@ string "quit", or terminates input by using Ctrl+D.
default socket. default socket.
*/ */
#include "config.h" #include "build-config.h"
#include <ctype.h> #include <ctype.h>
#include <stdio.h> #include <stdio.h>
#include <stdbool.h> #include <stdbool.h>
@ -48,8 +48,8 @@ string "quit", or terminates input by using Ctrl+D.
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
#include "x52d_const.h" #include <daemon/constants.h>
#include "x52dcomm.h" #include <libx52/x52dcomm.h>
#define APP_NAME "x52ctl" #define APP_NAME "x52ctl"
#if HAVE_FUNC_ATTRIBUTE_NORETURN #if HAVE_FUNC_ATTRIBUTE_NORETURN

View File

@ -6,17 +6,17 @@
* SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0
*/ */
#include "config.h" #include "build-config.h"
#include <unistd.h> #include <unistd.h>
#include <pthread.h> #include <pthread.h>
#include <stdbool.h> #include <stdbool.h>
#define PINELOG_MODULE X52D_MOD_DEVICE #define PINELOG_MODULE X52D_MOD_DEVICE
#include "x52d_const.h" #include <daemon/constants.h>
#include "x52d_config.h" #include <daemon/config.h>
#include "x52d_device.h" #include <daemon/device.h>
#include "x52d_notify.h" #include <daemon/notify.h>
#include "libx52.h" #include <libx52/libx52.h>
#include "pinelog.h" #include "pinelog.h"
static libx52_device *x52_dev; static libx52_device *x52_dev;

View File

@ -9,7 +9,7 @@
#ifndef X52D_DEVICE_H #ifndef X52D_DEVICE_H
#define X52D_DEVICE_H #define X52D_DEVICE_H
#include "libx52.h" #include <libx52/libx52.h>
void x52d_dev_init(void); void x52d_dev_init(void);
void x52d_dev_exit(void); void x52d_dev_exit(void);

View File

@ -6,16 +6,16 @@
* SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0
*/ */
#include "config.h" #include "build-config.h"
#include <stdbool.h> #include <stdbool.h>
#include <unistd.h> #include <unistd.h>
#include <pthread.h> #include <pthread.h>
#include "x52d_const.h" #include <daemon/constants.h>
#include "x52d_config.h" #include <daemon/config.h>
#include "x52d_io.h" #include <daemon/io.h>
#include "x52d_mouse.h" #include <daemon/mouse.h>
#include "libx52io.h" #include <libx52/libx52io.h>
#define PINELOG_MODULE X52D_MOD_IO #define PINELOG_MODULE X52D_MOD_IO
#include "pinelog.h" #include "pinelog.h"

View File

@ -6,7 +6,7 @@
* SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0
*/ */
#include "config.h" #include "build-config.h"
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <pthread.h> #include <pthread.h>
@ -15,9 +15,9 @@
#define PINELOG_MODULE X52D_MOD_LED #define PINELOG_MODULE X52D_MOD_LED
#include "pinelog.h" #include "pinelog.h"
#include "x52d_config.h" #include <daemon/config.h>
#include "x52d_const.h" #include <daemon/constants.h>
#include "x52d_device.h" #include <daemon/device.h>
#define SET_LED_STATE(led, state) \ #define SET_LED_STATE(led, state) \
PINELOG_TRACE("Setting LED %s state to %s (%d)", \ PINELOG_TRACE("Setting LED %s state to %s (%d)", \

View File

@ -6,7 +6,7 @@
* SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0
*/ */
#include "config.h" #include "build-config.h"
#include <stdio.h> #include <stdio.h>
#include <stdbool.h> #include <stdbool.h>
#include <string.h> #include <string.h>
@ -17,16 +17,16 @@
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
#include "x52d_clock.h" #include <daemon/clock.h>
#include "x52d_const.h" #include <daemon/constants.h>
#include "x52d_config.h" #include <daemon/config.h>
#include "x52d_device.h" #include <daemon/device.h>
#include "x52d_io.h" #include <daemon/io.h>
#include "x52d_mouse.h" #include <daemon/mouse.h>
#include "x52d_command.h" #include <daemon/command.h>
#include "x52d_notify.h" #include <daemon/notify.h>
#include "x52dcomm-internal.h" #include <daemon/x52dcomm-internal.h>
#include "x52dcomm.h" #include <libx52/x52dcomm.h>
#include "pinelog.h" #include "pinelog.h"
static volatile int flag_quit; static volatile int flag_quit;

View File

@ -1,41 +1,47 @@
# x52d # x52d (dep_config_h: Meson build-config.h; private API is daemon/config.h)
libx52dcomm_version = '1.0.0' libx52dcomm_version = '1.0.0'
libx52dcomm_sources = [ libx52dcomm_sources = [
'x52d_comm_client.c', 'comm_client.c',
'x52d_comm_internal.c' 'comm_internal.c'
] ]
install_headers('x52dcomm.h', subdir: meson.project_name()) install_headers('x52dcomm.h', subdir: meson.project_name())
lib_libx52dcomm = library('x52dcomm', libx52dcomm_sources, lib_libx52dcomm = library('x52dcomm', libx52dcomm_sources,
dependencies: [dep_intl], dependencies: [dep_intl, dep_config_h],
version: libx52dcomm_version, version: libx52dcomm_version,
c_args: sym_hidden_cargs, c_args: sym_hidden_cargs,
install: true, install: true,
include_directories: includes) include_directories: includes)
pkgconfig.generate(lib_libx52dcomm,
name: 'x52dcomm',
description: 'Client library for communicating with the x52d X52 daemon.',
version: libx52dcomm_version,
)
x52d_sources = [ x52d_sources = [
'x52d_main.c', 'main.c',
'x52d_config_parser.c', 'config_parser.c',
'x52d_config_dump.c', 'config_dump.c',
'x52d_config.c', 'config.c',
'x52d_device.c', 'device.c',
'x52d_client.c', 'client.c',
'x52d_clock.c', 'clock.c',
'x52d_mouse.c', 'mouse.c',
'x52d_notify.c', 'notify.c',
'x52d_led.c', 'led.c',
'x52d_command.c', 'command.c',
'x52d_io.c', 'io.c',
'x52d_mouse_handler.c', 'mouse_handler.c',
] ]
dep_threads = dependency('threads') dep_threads = dependency('threads')
# Comm sources are compiled into x52d (same as Autotools); libx52dcomm is only for x52ctl. # Comm sources are compiled into x52d (same as Autotools); libx52dcomm is only for x52ctl.
x52d_linkwith = [lib_libx52, lib_vkm, lib_libx52io] x52d_linkwith = [lib_libx52, lib_vkm, lib_libx52io]
x52d_deps = [dep_pinelog, dep_inih, dep_threads, dep_math, dep_intl] x52d_deps = [dep_pinelog, dep_inih, dep_threads, dep_math, dep_intl, dep_config_h]
x52d_cflags = [] x52d_cflags = []
exe_x52d = executable('x52d', x52d_sources + libx52dcomm_sources, exe_x52d = executable('x52d', x52d_sources + libx52dcomm_sources,
@ -45,9 +51,9 @@ exe_x52d = executable('x52d', x52d_sources + libx52dcomm_sources,
dependencies: x52d_deps, dependencies: x52d_deps,
link_with: x52d_linkwith) link_with: x52d_linkwith)
exe_x52ctl = executable('x52ctl', 'x52ctl.c', exe_x52ctl = executable('x52ctl', 'daemon_control.c',
install: true, install: true,
dependencies: [dep_intl], dependencies: [dep_intl, dep_config_h],
include_directories: includes, include_directories: includes,
link_with: lib_libx52dcomm) link_with: lib_libx52dcomm)
@ -57,10 +63,10 @@ install_data('x52d.conf',
test('daemon-communication', files('test_daemon_comm.py')[0], test('daemon-communication', files('test_daemon_comm.py')[0],
depends: [exe_x52d, exe_x52ctl], protocol: 'tap') depends: [exe_x52d, exe_x52ctl], protocol: 'tap')
x52d_mouse_test_sources = ['x52d_mouse_test.c', 'x52d_mouse.c'] x52d_mouse_test_sources = ['mouse_test.c', 'mouse.c']
x52d_mouse_test = executable('x52d-mouse-test', x52d_mouse_test_sources, x52d_mouse_test = executable('x52d-mouse-test', x52d_mouse_test_sources,
include_directories: includes, include_directories: includes,
dependencies: [dep_pinelog, dep_cmocka, dep_intl, dep_math]) dependencies: [dep_pinelog, dep_cmocka, dep_intl, dep_math, dep_config_h])
test('x52d-mouse-test', x52d_mouse_test, protocol: 'tap') test('x52d-mouse-test', x52d_mouse_test, protocol: 'tap')

View File

@ -6,16 +6,16 @@
* SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0
*/ */
#include "config.h" #include "build-config.h"
#include <stdio.h> #include <stdio.h>
#include <stdbool.h> #include <stdbool.h>
#include <math.h> #include <math.h>
#define PINELOG_MODULE X52D_MOD_MOUSE #define PINELOG_MODULE X52D_MOD_MOUSE
#include "pinelog.h" #include "pinelog.h"
#include "x52d_config.h" #include <daemon/config.h>
#include "x52d_const.h" #include <daemon/constants.h>
#include "x52d_mouse.h" #include <daemon/mouse.h>
// Mouse speed is the delay in microseconds between subsequent mouse reports // Mouse speed is the delay in microseconds between subsequent mouse reports
#define DEFAULT_MOUSE_DELAY 70000 #define DEFAULT_MOUSE_DELAY 70000

View File

@ -10,7 +10,7 @@
#define X52D_MOUSE_H #define X52D_MOUSE_H
#include <stdbool.h> #include <stdbool.h>
#include "libx52io.h" #include <libx52/libx52io.h>
extern volatile bool mouse_isometric_mode; extern volatile bool mouse_isometric_mode;
extern volatile int mouse_scroll_dir; extern volatile int mouse_scroll_dir;

View File

@ -6,21 +6,21 @@
* SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0
*/ */
#include "config.h" #include "build-config.h"
#include <stdio.h> #include <stdio.h>
#include <stdbool.h> #include <stdbool.h>
#include <pthread.h> #include <pthread.h>
#include <unistd.h> #include <unistd.h>
#include <math.h> #include <math.h>
#include "libx52io.h" #include <libx52/libx52io.h>
#include "vkm.h" #include <vkm/vkm.h>
#define PINELOG_MODULE X52D_MOD_MOUSE #define PINELOG_MODULE X52D_MOD_MOUSE
#include "pinelog.h" #include "pinelog.h"
#include "x52d_config.h" #include <daemon/config.h>
#include "x52d_const.h" #include <daemon/constants.h>
#include "x52d_mouse.h" #include <daemon/mouse.h>
static pthread_t mouse_thr; static pthread_t mouse_thr;
static bool mouse_thr_enabled = false; static bool mouse_thr_enabled = false;

View File

@ -6,7 +6,7 @@
* SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0
*/ */
#include "config.h" #include "build-config.h"
#include <stdio.h> #include <stdio.h>
#include <stdbool.h> #include <stdbool.h>
#include <stddef.h> #include <stddef.h>
@ -15,9 +15,9 @@
#define PINELOG_MODULE X52D_MOD_MOUSE #define PINELOG_MODULE X52D_MOD_MOUSE
#include "pinelog.h" #include "pinelog.h"
#include "x52d_config.h" #include <daemon/config.h>
#include "x52d_const.h" #include <daemon/constants.h>
#include "x52d_mouse.h" #include <daemon/mouse.h>
/* Stub for handler */ /* Stub for handler */
void x52d_mouse_thread_control(bool enabled) void x52d_mouse_thread_control(bool enabled)
@ -44,7 +44,7 @@ static void test_mouse_thread_disabled(void **state)
x52d_cfg_set_Mouse_Enabled(false); x52d_cfg_set_Mouse_Enabled(false);
} }
/* The following tests are dependent on the values in x52d_mouse.c */ /* The following tests are dependent on the values in mouse.c */
static void test_mouse_speed_negative(void **state) static void test_mouse_speed_negative(void **state)
{ {
(void)state; (void)state;

View File

@ -13,11 +13,11 @@
#define PINELOG_MODULE X52D_MOD_NOTIFY #define PINELOG_MODULE X52D_MOD_NOTIFY
#include "pinelog.h" #include "pinelog.h"
#include "x52d_const.h" #include <daemon/constants.h>
#include "x52d_notify.h" #include <daemon/notify.h>
#include "x52d_client.h" #include <daemon/client.h>
#include "x52dcomm.h" #include <libx52/x52dcomm.h>
#include "x52dcomm-internal.h" #include <daemon/x52dcomm-internal.h>
static pthread_t notify_thr; static pthread_t notify_thr;
static pthread_t notify_listen; static pthread_t notify_listen;

View File

@ -1,10 +0,0 @@
# Automake for documentation
#
# Copyright (C) 2021 Nirenjan Krishnan (nirenjan@nirenjan.org)
#
# SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0
EXTRA_DIST += \
docs/main.dox \
docs/caveats.dox \
docs/integration.dox

View File

@ -13,10 +13,9 @@ up the list of devices manually and simulate various scenarios.
# Design Overview # Design Overview
Unfortunately, the automake infrastructure does not support the use of The build system does not wire up `LD_PRELOAD` for this library: using it is
LD_PRELOAD because it is deemed "non-portable" in the automake sense. As a left to the test runner, which must arrange for the stub to be preloaded and
result, this is now up to a test runner application to implement a method to control the data passed between processes.
control the data passed between two processes.
# Data Structures # Data Structures

View File

@ -11,7 +11,7 @@ to a supported joystick. This function must be called after \ref libx52_init
<b>Example Initialization/Deinitialization Code</b> <b>Example Initialization/Deinitialization Code</b>
@code{.c} @code{.c}
#include <libx52.h> #include <libx52/libx52.h>
libx52_device* init_libx52(void) libx52_device* init_libx52(void)
{ {

View File

@ -45,10 +45,10 @@ with your application.
See the documentation for the following files for a complete list of all See the documentation for the following files for a complete list of all
functions. functions.
- libx52.h - libx52/libx52.h
- libx52io.h - libx52/libx52io.h
- libx52util.h - libx52/libx52util.h
- vkm.h - vkm/vkm.h
- x52dcomm.h - libx52/x52dcomm.h
*/ */

View File

@ -1,13 +0,0 @@
# Automake for x52evtest
#
# Copyright (C) 2012-2020 Nirenjan Krishnan (nirenjan@nirenjan.org)
#
# SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0
bin_PROGRAMS += x52evtest
# Event test utility that works similarly to the Linux evtest
x52evtest_SOURCES = evtest/ev_test.c
x52evtest_CFLAGS = -I $(top_srcdir)/libx52io -I $(top_srcdir) -DLOCALEDIR=\"$(localedir)\" $(WARN_CFLAGS)
x52evtest_LDFLAGS = $(WARN_LDFLAGS)
x52evtest_LDADD = libx52io.la

View File

@ -6,7 +6,7 @@
* SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0
*/ */
#include "config.h" #include "build-config.h"
#include <stdio.h> #include <stdio.h>
#include <stdint.h> #include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
@ -17,7 +17,7 @@
#include <time.h> #include <time.h>
#include <sys/time.h> #include <sys/time.h>
#include "libx52io.h" #include <libx52/libx52io.h>
#include "gettext.h" #include "gettext.h"
/* /*

View File

@ -1,20 +0,0 @@
# Automake for x52test
#
# Copyright (C) 2012-2018 Nirenjan Krishnan (nirenjan@nirenjan.org)
#
# SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0
bin_PROGRAMS += x52test
# Test utility that exercises all the library functions
x52test_SOURCES = \
joytest/x52_test.c \
joytest/x52_test_mfd.c \
joytest/x52_test_led.c \
joytest/x52_test_clock.c
x52test_CFLAGS = -I $(top_srcdir)/libx52 -I $(top_srcdir) -DLOCALEDIR=\"$(localedir)\" $(WARN_CFLAGS)
x52test_LDFLAGS = $(WARN_LDFLAGS)
x52test_LDADD = libx52.la
# Extra files that need to be in the distribution
EXTRA_DIST += joytest/x52_test_common.h

View File

@ -7,7 +7,7 @@
*/ */
#define _GNU_SOURCE #define _GNU_SOURCE
#include "config.h" #include "build-config.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <signal.h> #include <signal.h>
@ -15,7 +15,7 @@
#include <locale.h> #include <locale.h>
#include <time.h> #include <time.h>
#include "libx52.h" #include <libx52/libx52.h>
#include "x52_test_common.h" #include "x52_test_common.h"
libx52_device *dev; libx52_device *dev;
int test_exit; int test_exit;

View File

@ -7,13 +7,13 @@
*/ */
#define _GNU_SOURCE #define _GNU_SOURCE
#include "config.h" #include "build-config.h"
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include <time.h> #include <time.h>
#include "libx52.h" #include <libx52/libx52.h>
#include "x52_test_common.h" #include "x52_test_common.h"
int test_clock(void) int test_clock(void)

View File

@ -9,10 +9,10 @@
#ifndef X52_TEST_COMMON_H #ifndef X52_TEST_COMMON_H
#define X52_TEST_COMMON_H #define X52_TEST_COMMON_H
#include "config.h" #include "build-config.h"
#include <stdio.h> #include <stdio.h>
#include <stdbool.h> #include <stdbool.h>
#include "libx52.h" #include <libx52/libx52.h>
#include "gettext.h" #include "gettext.h"
extern libx52_device *dev; extern libx52_device *dev;

View File

@ -7,12 +7,12 @@
*/ */
#define _GNU_SOURCE #define _GNU_SOURCE
#include "config.h" #include "build-config.h"
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include "libx52.h" #include <libx52/libx52.h>
#include "x52_test_common.h" #include "x52_test_common.h"
#define TEST_LED(name, state) do { \ #define TEST_LED(name, state) do { \

View File

@ -7,12 +7,12 @@
*/ */
#define _GNU_SOURCE #define _GNU_SOURCE
#include "config.h" #include "build-config.h"
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include "libx52.h" #include <libx52/libx52.h>
#include "x52_test_common.h" #include "x52_test_common.h"
#define TEST_BRIGHTNESS(mfd, value) TEST(brightness, mfd, value) #define TEST_BRIGHTNESS(mfd, value) TEST(brightness, mfd, value)

View File

@ -18,8 +18,7 @@ and therefore, do not require this driver.
# Building # Building
This directory is deliberately not integrated with the top level Autotools This directory is deliberately not integrated with the top-level Meson build.
based build framework.
Install the Linux headers for the currently running kernel. On Ubuntu, this Install the Linux headers for the currently running kernel. On Ubuntu, this
can be done by running `sudo apt-get install -y linux-headers-$(uname -r)`. can be done by running `sudo apt-get install -y linux-headers-$(uname -r)`.

View File

@ -1,25 +0,0 @@
# Automake for libusbx52 and associated utilities
#
# Copyright (C) 2012-2018 Nirenjan Krishnan (nirenjan@nirenjan.org)
#
# SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0
# libusb stub library for use by test programs
check_LTLIBRARIES += libusbx52.la
libusbx52_la_SOURCES = libusbx52/usb_x52_stub.c libusbx52/fopen_env.c
libusbx52_la_CFLAGS = -I $(top_srcdir)/libusbx52 @LIBUSB_CFLAGS@ $(WARN_CFLAGS)
libusbx52_la_LDFLAGS = -rpath /nowhere -module $(WARN_LDFLAGS)
# Utility programs for use by tests
check_PROGRAMS += x52test_create_device_list x52test_log_actions
x52test_create_device_list_SOURCES = libusbx52/util/create_device_list.c $(libusbx52_la_SOURCES)
x52test_create_device_list_CFLAGS = $(libusbx52_la_CFLAGS)
x52test_create_device_list_LDFLAGS = $(WARN_LDFLAGS)
x52test_log_actions_SOURCES = libusbx52/util/log_actions.c $(libusbx52_la_SOURCES)
x52test_log_actions_CFLAGS = -I $(top_srcdir)/libx52 $(libusbx52_la_CFLAGS)
x52test_log_actions_LDFLAGS = $(WARN_LDFLAGS)
EXTRA_DIST += libusbx52/README.md libusbx52/libusbx52.h

View File

@ -7,7 +7,7 @@
*/ */
#define _GNU_SOURCE #define _GNU_SOURCE
#include "config.h" #include "build-config.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>

View File

@ -15,7 +15,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <errno.h> #include <errno.h>
#include "libusbx52.h" #include "libusbx52.h"
#include "x52_commands.h" #include "commands.h"
libusb_context *global_context; libusb_context *global_context;

View File

@ -1,74 +0,0 @@
# Automake for libx52
#
# Copyright (C) 2012-2018 Nirenjan Krishnan (nirenjan@nirenjan.org)
#
# SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0
lib_LTLIBRARIES += libx52.la
# Core libx52 library
# This library handles the USB communication between the host and the X52
# Libtool Version Info
# See: https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
libx52_v_CUR=6
libx52_v_AGE=4
libx52_v_REV=2
libx52_la_SOURCES = \
libx52/x52_control.c \
libx52/x52_core.c \
libx52/x52_date_time.c \
libx52/x52_mfd_led.c \
libx52/x52_strerror.c \
libx52/x52_stringify.c
libx52_la_CFLAGS = \
@LIBUSB_CFLAGS@ \
-DLOCALEDIR=\"$(localedir)\" \
-I $(top_srcdir) \
$(VISIBILITY_CFLAGS) \
$(WARN_CFLAGS)
libx52_la_LDFLAGS = \
-export-symbols-regex '^libx52_' \
-version-info $(libx52_v_CUR):$(libx52_v_REV):$(libx52_v_AGE) @LIBUSB_LIBS@ \
$(WARN_LDFLAGS)
libx52_la_LIBADD = @LTLIBINTL@
# Header files that need to be copied
x52include_HEADERS += libx52/libx52.h
# pkg-config files
pkgconfig_DATA += libx52/libx52.pc
if HAVE_CMOCKA
TESTS += libx52test libx52-string-test
check_PROGRAMS += libx52test libx52-string-test
nodist_libx52test_SOURCES = libx52/test_libx52.c
libx52test_SOURCES = $(libx52_la_SOURCES)
libx52test_CFLAGS = @CMOCKA_CFLAGS@ @LIBUSB_CFLAGS@ -DLOCALEDIR='"$(localedir)"' -I $(top_srcdir) -I $(top_srcdir)/libx52
libx52test_CFLAGS += -Dlibusb_control_transfer=__wrap_libusb_control_transfer
libx52test_LDFLAGS = @CMOCKA_LIBS@ @LIBUSB_LIBS@
libx52test_LDADD = libx52.la
CLEANFILES += libx52/test_libx52.c
test_libx52_c_DEPENDS = \
$(srcdir)/libx52/x52_test_gen.py \
$(srcdir)/libx52/x52_tests.json
libx52/test_libx52.c: $(test_libx52_c_DEPENDS)
$(AM_V_GEN) $(PYTHON) $(test_libx52_c_DEPENDS) > $@
libx52_string_test_SOURCES = \
libx52/test_strings.c \
libx52/x52_stringify.c \
libx52/x52_strerror.c
libx52_string_test_CFLAGS = @CMOCKA_CFLAGS@ -I $(top_srcdir) -I $(top_srcdir)/libx52
libx52_string_test_LDFLAGS = @CMOCKA_LIBS@
libx52_string_test_LDADD = libx52.la
endif
# Extra files that need to be in the distribution
EXTRA_DIST += \
libx52/libx52.h libx52/x52_commands.h libx52/x52_common.h libx52/README.md
# Add test files to the distribution
EXTRA_DIST += libx52/x52_test_gen.py libx52/x52_tests.json

View File

@ -12,7 +12,7 @@
#include <stdint.h> #include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
#include <libusb.h> #include <libusb.h>
#include "libx52.h" #include <libx52/libx52.h>
/* /*
* The X52 MFD supports the following: * The X52 MFD supports the following:

View File

@ -6,16 +6,16 @@
* SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0
*/ */
#include "config.h" #include "build-config.h"
#include <stdio.h> #include <stdio.h>
#include <stdint.h> #include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
#include "libx52.h" #include <libx52/libx52.h>
#include "x52_commands.h" #include "commands.h"
#include "x52_common.h" #include "common.h"
/* Translate a libusb error to a libx52 error */ /* Translate a libusb error to a libx52 error */
int _x52_translate_libusb_error(enum libusb_error errcode) int _x52_translate_libusb_error(enum libusb_error errcode)

View File

@ -6,7 +6,7 @@
* SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0
*/ */
#include "config.h" #include "build-config.h"
#include <stdio.h> #include <stdio.h>
#include <stdint.h> #include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
@ -14,9 +14,9 @@
#include <string.h> #include <string.h>
#include "usb-ids.h" #include "usb-ids.h"
#include "libx52.h" #include <libx52/libx52.h>
#include "x52_commands.h" #include "commands.h"
#include "x52_common.h" #include "common.h"
#include "gettext.h" #include "gettext.h"
/* Check if the USB device is supported by this library */ /* Check if the USB device is supported by this library */

View File

@ -7,16 +7,16 @@
*/ */
#define _GNU_SOURCE #define _GNU_SOURCE
#include "config.h" #include "build-config.h"
#include <stdio.h> #include <stdio.h>
#include <stdint.h> #include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
#include "libx52.h" #include <libx52/libx52.h>
#include "x52_commands.h" #include "commands.h"
#include "x52_common.h" #include "common.h"
#if !HAVE_STRUCT_TM_TM_GMTOFF #if !HAVE_STRUCT_TM_TM_GMTOFF
/* Slow method to compute GMT offset */ /* Slow method to compute GMT offset */

View File

@ -1,11 +0,0 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: libx52
Description: Linux/Unix library to control Saitek X52/X52Pro joystick extended functionality.
Version: 2.4.0
Libs: -L${libdir} -lx52
Cflags: -I${includedir}/libx52
Requires.private: @LIBUSB_PC@

View File

@ -0,0 +1 @@
../libx52io/libx52io.h

View File

@ -0,0 +1 @@
../libx52util/libx52util.h

View File

@ -1,12 +1,12 @@
libx52_version = '2.4.2' libx52_version = '2.4.2'
libx52_files = files( libx52_files = files(
'x52_control.c', 'control.c',
'x52_core.c', 'core.c',
'x52_date_time.c', 'date_time.c',
'x52_mfd_led.c', 'mfd_led.c',
'x52_strerror.c', 'strerror.c',
'x52_stringify.c', 'stringify.c',
) )
lib_libx52 = library('x52', libx52_files, lib_libx52 = library('x52', libx52_files,
@ -20,14 +20,13 @@ install_headers('libx52.h', subdir: meson.project_name())
pkgconfig.generate(lib_libx52, pkgconfig.generate(lib_libx52,
name: 'libx52', name: 'libx52',
description: 'Linux/Unix library to control Saitek X52/X52Pro joystick extended functionality.', description: 'Linux/Unix library to control Saitek X52/X52Pro joystick extended functionality.',
subdirs: meson.project_name(),
version: libx52_version) version: libx52_version)
# Unit tests for libx52 # Unit tests for libx52
libx52_string_test = executable('libx52-string-test', libx52_string_test = executable('libx52-string-test',
'test_strings.c', 'test_strings.c',
'x52_stringify.c', 'stringify.c',
'x52_strerror.c', 'strerror.c',
build_by_default: false, build_by_default: false,
dependencies: [dep_cmocka, dep_intl], dependencies: [dep_cmocka, dep_intl],
link_with: [lib_libx52], link_with: [lib_libx52],

View File

@ -6,14 +6,14 @@
* SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0
*/ */
#include "config.h" #include "build-config.h"
#include <stdio.h> #include <stdio.h>
#include <stdint.h> #include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
#include "x52_common.h" #include "common.h"
int libx52_set_text(libx52_device *x52, uint8_t line, const char *text, uint8_t length) int libx52_set_text(libx52_device *x52, uint8_t line, const char *text, uint8_t length)
{ {

View File

@ -6,10 +6,10 @@
* SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0
*/ */
#include "config.h" #include "build-config.h"
#include <stdio.h> #include <stdio.h>
#include "libx52.h" #include <libx52/libx52.h>
#include "gettext.h" #include "gettext.h"
#define N_(str) gettext_noop(str) #define N_(str) gettext_noop(str)

View File

@ -6,10 +6,10 @@
* SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0
*/ */
#include "config.h" #include "build-config.h"
#include <stdio.h> #include <stdio.h>
#include "libx52.h" #include <libx52/libx52.h>
#include "gettext.h" #include "gettext.h"
#define N_(str) gettext_noop(str) #define N_(str) gettext_noop(str)

View File

@ -13,7 +13,7 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include "libx52.h" #include <libx52/libx52.h>
#define TEST_STRINGIFY(name) do { \ #define TEST_STRINGIFY(name) do { \
char expected[256]; \ char expected[256]; \

View File

@ -18,7 +18,7 @@ _TEST_FILE_HEADER = """/*
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include "x52_common.h" #include "common.h"
static int group_setup(void **state) static int group_setup(void **state)
{ {

View File

@ -0,0 +1 @@
../daemon/x52dcomm.h

View File

@ -1,57 +0,0 @@
# Automake for libx52io
#
# Copyright (C) 2012-2020 Nirenjan Krishnan (nirenjan@nirenjan.org)
#
# SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0
lib_LTLIBRARIES += libx52io.la
# X52 IO library
# This library handles the HID parsing of the X52 USB reports
# Libtool Version Info
# See: https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
libx52io_v_CUR=1
libx52io_v_AGE=0
libx52io_v_REV=0
libx52io_la_SOURCES = \
libx52io/io_core.c \
libx52io/io_axis.c \
libx52io/io_parser.c \
libx52io/io_strings.c \
libx52io/io_device.c
libx52io_la_CFLAGS = @HIDAPI_CFLAGS@ -DLOCALEDIR=\"$(localedir)\" -I $(top_srcdir) $(VISIBILITY_CFLAGS) $(WARN_CFLAGS)
libx52io_la_LDFLAGS = \
-export-symbols-regex '^libx52io_' \
-version-info $(libx52io_v_CUR):$(libx52io_v_REV):$(libx52io_v_AGE) @HIDAPI_LIBS@ \
$(WARN_LDFLAGS)
libx52io_la_LIBADD = @LTLIBINTL@
# Header files that need to be copied
x52include_HEADERS += libx52io/libx52io.h
# pkg-config files
pkgconfig_DATA += libx52io/libx52io.pc
if HAVE_CMOCKA
TESTS += test-axis test-parser
check_PROGRAMS += test-axis test-parser
test_axis_SOURCES = libx52io/test_axis.c $(libx52io_la_SOURCES)
test_axis_CFLAGS = @CMOCKA_CFLAGS@ $(libx52io_la_CFLAGS)
test_axis_LDFLAGS = @CMOCKA_LIBS@ @HIDAPI_LIBS@ $(WARN_LDFLAGS)
test_axis_LDADD = @LTLIBINTL@
test_parser_SOURCES = libx52io/test_parser.c $(libx52io_la_SOURCES)
test_parser_CFLAGS = @CMOCKA_CFLAGS@ $(libx52io_la_CFLAGS)
test_parser_LDFLAGS = @CMOCKA_LIBS@ @HIDAPI_LIBS@ $(WARN_LDFLAGS)
test_parser_LDADD = @LTLIBINTL@
# Add a dependency on test_parser_tests.c
libx52io/test_parser.c: libx52io/test_parser_tests.c
endif
# Extra files that need to be in the distribution
EXTRA_DIST += \
libx52io/libx52io.h \
libx52io/io_common.h \
libx52io/test_parser_tests.c

View File

@ -7,7 +7,7 @@
*/ */
#include <string.h> #include <string.h>
#include "io_common.h" #include "common.h"
#include "usb-ids.h" #include "usb-ids.h"
static const int32_t axis_min[] = { static const int32_t axis_min[] = {

View File

@ -10,7 +10,7 @@
#define IO_COMMON_H #define IO_COMMON_H
#include <stdint.h> #include <stdint.h>
#include "libx52io.h" #include <libx52/libx52io.h>
#include "hidapi.h" #include "hidapi.h"
// Function handler for parsing reports // Function handler for parsing reports

View File

@ -6,10 +6,10 @@
* SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0
*/ */
#include "config.h" #include "build-config.h"
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "io_common.h" #include "common.h"
#include "usb-ids.h" #include "usb-ids.h"
#include "gettext.h" #include "gettext.h"

View File

@ -6,11 +6,11 @@
* SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0
*/ */
#include "config.h" #include "build-config.h"
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <wchar.h> #include <wchar.h>
#include "io_common.h" #include "common.h"
static char * _save_string(wchar_t *wcs) static char * _save_string(wchar_t *wcs)
{ {

View File

@ -1,11 +0,0 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: libx52io
Description: Linux/Unix library to read and parse X52 input
Version: 1.0.0
Libs: -L${libdir} -lx52io
Cflags: -I${includedir}/libx52
Requires.private: @HIDAPI_PC@

View File

@ -1,11 +1,11 @@
libx52io_version = '1.1.0' libx52io_version = '1.1.0'
libx52io_files = files( libx52io_files = files(
'io_core.c', 'core.c',
'io_axis.c', 'axis.c',
'io_parser.c', 'parser.c',
'io_strings.c', 'strings.c',
'io_device.c', 'device.c',
) )
lib_libx52io = library('x52io', libx52io_files, lib_libx52io = library('x52io', libx52io_files,
@ -19,7 +19,6 @@ install_headers('libx52io.h', subdir: meson.project_name())
pkgconfig.generate(lib_libx52io, pkgconfig.generate(lib_libx52io,
name: 'libx52io', name: 'libx52io',
description: 'Linux/Unix library to read and parse X52 input', description: 'Linux/Unix library to read and parse X52 input',
subdirs: meson.project_name(),
version: libx52io_version, version: libx52io_version,
) )

View File

@ -7,7 +7,7 @@
*/ */
#include <stdint.h> #include <stdint.h>
#include "io_common.h" #include "common.h"
#include "usb-ids.h" #include "usb-ids.h"
static void map_hat(uint8_t hat, libx52io_report *report) static void map_hat(uint8_t hat, libx52io_report *report)

View File

@ -6,10 +6,10 @@
* SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0
*/ */
#include "config.h" #include "build-config.h"
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include "libx52io.h" #include <libx52/libx52io.h>
#include "gettext.h" #include "gettext.h"
/* The strings corresponding to the axis and button enumerations are /* The strings corresponding to the axis and button enumerations are

View File

@ -11,7 +11,7 @@
#include <setjmp.h> #include <setjmp.h>
#include <cmocka.h> #include <cmocka.h>
#include "io_common.h" #include "common.h"
#include "usb-ids.h" #include "usb-ids.h"
static int group_setup(void **state) static int group_setup(void **state)

View File

@ -11,7 +11,7 @@
#include <setjmp.h> #include <setjmp.h>
#include <cmocka.h> #include <cmocka.h>
#include "libx52io.h" #include <libx52/libx52io.h>
static void lower_ascii_only(char *dst, const char *src) static void lower_ascii_only(char *dst, const char *src)
{ {

View File

@ -12,7 +12,7 @@
#include <cmocka.h> #include <cmocka.h>
#include <string.h> #include <string.h>
#include "io_common.h" #include "common.h"
#include "usb-ids.h" #include "usb-ids.h"
static int group_setup(void **state) static int group_setup(void **state)

View File

@ -1,50 +0,0 @@
# Automake for libx52util
#
# Copyright (C) 2012-2018 Nirenjan Krishnan (nirenjan@nirenjan.org)
#
# SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0
lib_LTLIBRARIES += libx52util.la
# libx52 utility library
# This library provides extra utilities for ease of use
nodist_libx52util_la_SOURCES = libx52util/util_char_map.c
libx52util_la_SOURCES = libx52util/x52_char_map_lookup.c
libx52util_la_CFLAGS = -I $(top_srcdir)/libx52util $(VISIBILITY_CFLAGS) $(WARN_CFLAGS)
libx52util_la_LDFLAGS = \
-export-symbols-regex '^libx52util_' \
-version-info 1:1:0 \
$(WARN_LDFLAGS)
# Header files that need to be copied
x52include_HEADERS += libx52util/libx52util.h
# pkg-config files
pkgconfig_DATA += libx52util/libx52util.pc
# Autogenerated file that needs to be cleaned up
char_map_TARGETS = \
libx52util/util_char_map.c \
libx52util/x52_char_map.bin
CLEANFILES += $(char_map_TARGETS)
char_map_DEPENDS = \
$(srcdir)/libx52util/x52_char_map_gen.py \
$(srcdir)/libx52util/x52_char_map.cfg
$(char_map_TARGETS): $(char_map_DEPENDS)
$(AM_V_GEN) $(PYTHON) $(char_map_DEPENDS) $(char_map_TARGETS)
TESTS += libx52util/test-runner.sh
check_PROGRAMS += libx52util-bmp-test
libx52util_bmp_test_SOURCES = libx52util/x52_char_map_test.c
libx52util_bmp_test_CFLAGS = -I $(top_srcdir)/libx52util
libx52util_bmp_test_LDADD = libx52util.la
# Extra files that need to be in the distribution
EXTRA_DIST += libx52util/x52_char_map.cfg \
libx52util/x52_char_map.h \
libx52util/x52_char_map_gen.py

View File

@ -6,8 +6,8 @@
* SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0
*/ */
#ifndef X52_CHAR_MAP_H #ifndef CHAR_MAP_H
#define X52_CHAR_MAP_H #define CHAR_MAP_H
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
@ -15,4 +15,4 @@
extern const uint16_t *root_table[256]; extern const uint16_t *root_table[256];
extern const uint8_t *sequence_table[]; extern const uint8_t *sequence_table[];
#endif /* !defined X52_CHAR_MAP_H */ #endif /* !defined CHAR_MAP_H */

View File

@ -9,13 +9,13 @@
* SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0
*/ */
#include "config.h" #include "build-config.h"
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
#include "libx52util.h" #include <libx52/libx52util.h>
#include "x52_char_map.h" #include "char_map.h"
/** /**
* @brief Converts a UTF8 stream to a uint32_t * @brief Converts a UTF8 stream to a uint32_t

View File

@ -16,7 +16,7 @@
#include <time.h> #include <time.h>
#include <unistd.h> #include <unistd.h>
#include "libx52util.h" #include <libx52/libx52util.h>
// Fix this if we ever hit longer sequences // Fix this if we ever hit longer sequences
#define RECORD_SIZE 8 #define RECORD_SIZE 8

View File

@ -1,10 +0,0 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: libx52util
Description: Extra utility functions to manage X52 extended functionality
Version: 1.0.0
Libs: -L${libdir} -lx52util
Cflags: -I${includedir}/libx52

View File

@ -7,9 +7,9 @@ util_char_map = custom_target('util-char-map',
depend_files: ['x52_char_map_gen.py', 'x52_char_map.cfg'], depend_files: ['x52_char_map_gen.py', 'x52_char_map.cfg'],
command: [python, gen_script, '@INPUT@', '@OUTPUT0@', '@OUTPUT1@'], command: [python, gen_script, '@INPUT@', '@OUTPUT0@', '@OUTPUT1@'],
input: 'x52_char_map.cfg', input: 'x52_char_map.cfg',
output: ['util_char_map.c', 'x52_char_map.bin']) output: ['char_map.c', 'char_map.bin'])
lib_libx52util = library('x52util', util_char_map, 'x52_char_map_lookup.c', lib_libx52util = library('x52util', util_char_map, 'char_map_lookup.c',
install: true, install: true,
version: libx52util_version, version: libx52util_version,
c_args: sym_hidden_cargs, c_args: sym_hidden_cargs,
@ -20,13 +20,12 @@ install_headers('libx52util.h', subdir: meson.project_name())
pkgconfig.generate(lib_libx52util, pkgconfig.generate(lib_libx52util,
name: 'libx52util', name: 'libx52util',
description: 'Extra utility functions to manage X52 extended functionality', description: 'Extra utility functions to manage X52 extended functionality',
subdirs: meson.project_name(),
version: libx52util_version, version: libx52util_version,
) )
libx52util_bmp_test = executable( libx52util_bmp_test = executable(
'libx52util-bmp-test', 'libx52util-bmp-test',
'x52_char_map_test.c', 'char_map_test.c',
build_by_default: false, build_by_default: false,
include_directories: [includes, lib_libx52util.private_dir_include()], include_directories: [includes, lib_libx52util.private_dir_include()],
link_with: [lib_libx52util] link_with: [lib_libx52util]

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
TEST_RUNNER="./libx52util-bmp-test" TEST_RUNNER="./libx52util-bmp-test"
TEST_BIN="./libx52util/x52_char_map.bin" TEST_BIN="./libx52util/char_map.bin"
if [ -e "${TEST_RUNNER}" ] && [ -e "${TEST_BIN}" ]; if [ -e "${TEST_RUNNER}" ] && [ -e "${TEST_BIN}" ];
then then

View File

@ -36,7 +36,7 @@ pyversion = python.language_version().split('.')
assert(pyversion[1].to_int() >= 5, 'Require Python >= 3.5') assert(pyversion[1].to_int() >= 5, 'Require Python >= 3.5')
####################################################################### #######################################################################
# config.h # build-config.h (Meson configuration; template is config.h.meson)
####################################################################### #######################################################################
compiler = meson.get_compiler('c') compiler = meson.get_compiler('c')
sym_hidden_cargs = [] sym_hidden_cargs = []
@ -59,10 +59,12 @@ cdata.set10('HAVE_STRUCT_TM_TM_GMTOFF',
config_h = configure_file( config_h = configure_file(
input: 'config.h.meson', input: 'config.h.meson',
output: 'config.h', output: 'build-config.h',
configuration: cdata configuration: cdata
) )
dep_config_h = declare_dependency(sources: config_h)
####################################################################### #######################################################################
# Internationalization # Internationalization
####################################################################### #######################################################################
@ -101,11 +103,14 @@ dep_math = compiler.find_library('m', required: false)
####################################################################### #######################################################################
# pinelog # pinelog
pinelog_options = [] pinelog_options = [
# Keep directory prefix in __FILE__ for logs (e.g. libx52/core.c vs libx52io/core.c).
'strip-file-path=false',
]
if dep_systemd.found() and not get_option('systemd-logs').disabled() if dep_systemd.found() and not get_option('systemd-logs').disabled()
# If systemd logs is enabled or auto, and systemd is found, then hide # If systemd logs is enabled or auto, and systemd is found, then hide
# the timestamps in log messages # the timestamps in log messages
pinelog_options = ['show-date=false'] pinelog_options += ['show-date=false']
endif endif
sub_pinelog = subproject('pinelog', required: true, sub_pinelog = subproject('pinelog', required: true,
@ -120,7 +125,7 @@ dep_inih = dependency('inih')
# Shared libraries and programs # Shared libraries and programs
####################################################################### #######################################################################
# Includes # Includes
includes = include_directories('.', 'libx52', 'libx52io', 'libx52util', 'vkm') includes = include_directories('.')
subdir('libx52') subdir('libx52')
subdir('libx52io') subdir('libx52io')

View File

@ -1,10 +1,10 @@
# List of source files which contain translatable strings. # List of source files which contain translatable strings.
libx52/x52_strerror.c libx52/strerror.c
libx52/x52_stringify.c libx52/stringify.c
libx52io/io_strings.c libx52io/strings.c
vkm/vkm_common.c vkm/common.c
evtest/ev_test.c evtest/ev_test.c
@ -14,16 +14,16 @@ joytest/x52_test_common.h
joytest/x52_test_led.c joytest/x52_test_led.c
joytest/x52_test_mfd.c joytest/x52_test_mfd.c
daemon/x52d_main.c daemon/client.c
daemon/x52d_client.c daemon/clock.c
daemon/x52d_clock.c daemon/command.c
daemon/x52d_command.c daemon/config.c
daemon/x52d_config.c daemon/config_dump.c
daemon/x52d_config_dump.c daemon/config_parser.c
daemon/x52d_config_parser.c daemon/daemon_control.c
daemon/x52d_device.c daemon/device.c
daemon/x52d_io.c daemon/io.c
daemon/x52d_mouse.c daemon/main.c
daemon/x52d_mouse_handler.c daemon/mouse.c
daemon/x52d_notify.c daemon/mouse_handler.c
daemon/x52ctl.c daemon/notify.c

View File

@ -22,10 +22,11 @@ Once you add new strings to be translated, update `po/POTFILES.in` to include
any new files that have to be translated. The file path is relative to the root any new files that have to be translated. The file path is relative to the root
of the project. of the project.
The next step is to rebuild the translation template `libx52.pot`. To do The next step is to rebuild the translation template `libx52.pot`. From the
this, run `make -C po update-po` from your build directory (where you ran repository root, run `meson compile -C build libx52-update-po` (adjust `build`
`configure`). This also updates any translation files (with `.po` extension) to to your build directory), or `ninja -C build libx52-update-po`. This also
include the new source strings. updates any translation files (with `.po` extension) to include the new source
strings.
# Adding new languages (translators) # Adding new languages (translators)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +0,0 @@
# Top-level automake for libx52 and associated libraries
#
# Copyright (C) 2012-2018 Nirenjan Krishnan (nirenjan@nirenjan.org)
#
# SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0
SUBDIRS = pinelog

View File

@ -1,231 +0,0 @@
# Top level Automake for pinelog
#
# Copyright (C) 2012-2018 Nirenjan Krishnan (nirenjan@nirenjan.org)
#
# SPDX-License-Identifier: MIT
ACLOCAL_AMFLAGS = -I m4
# Extra files that need to be in the distribution
EXTRA_DIST = \
LICENSE \
README.md \
pinelog.h
noinst_LTLIBRARIES = libpinelog.la
# pinelog logging library
libpinelog_la_SOURCES = pinelog.c
libpinelog_la_CFLAGS = @PINELOG_CFLAGS@ $(WARN_CFLAGS) -I $(top_builddir)
libpinelog_la_LDFLAGS = $(WARN_LDFLAGS)
test_SRCFILES = test_pinelog.c $(libpinelog_la_SOURCES)
bench_SRCFILES = bench_pinelog.c $(libpinelog_la_SOURCES)
test_CFLAGS = \
-DPINELOG_FATAL_STR='"F"' \
-DPINELOG_ERROR_STR='"E"' \
-DPINELOG_WARNING_STR='"W"' \
-DPINELOG_INFO_STR='"I"' \
-DPINELOG_DEBUG_STR='"D"' \
-DPINELOG_TRACE_STR='"T"' \
-DPINELOG_DEFAULT_LEVEL=PINELOG_LVL_TRACE \
-DPINELOG_DEFAULT_STREAM=stderr \
-DPINELOG_TEST -I $(top_builddir)
LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/tap-driver.sh --comments
TESTS = \
fp_test_ts_lvl_tr \
fp_test_ts_lvl_notr \
fp_test_ts_nolvl_tr \
fp_test_ts_nolvl_notr \
fp_test_nots_lvl_tr \
fp_test_nots_lvl_notr \
fp_test_nots_nolvl_tr \
fp_test_nots_nolvl_notr \
fp_bench_ts_lvl_tr \
fp_bench_ts_lvl_notr \
fp_bench_ts_nolvl_tr \
fp_bench_ts_nolvl_notr \
fp_bench_nots_lvl_tr \
fp_bench_nots_lvl_notr \
fp_bench_nots_nolvl_tr \
fp_bench_nots_nolvl_notr \
str_test_ts_lvl_tr \
str_test_ts_lvl_notr \
str_test_ts_nolvl_tr \
str_test_ts_nolvl_notr \
str_test_nots_lvl_tr \
str_test_nots_lvl_notr \
str_test_nots_nolvl_tr \
str_test_nots_nolvl_notr \
str_bench_ts_lvl_tr \
str_bench_ts_lvl_notr \
str_bench_ts_nolvl_tr \
str_bench_ts_nolvl_notr \
str_bench_nots_lvl_tr \
str_bench_nots_lvl_notr \
str_bench_nots_nolvl_tr \
str_bench_nots_nolvl_notr
check_PROGRAMS = $(TESTS)
fp_test_ts_lvl_tr_SOURCES = $(test_SRCFILES)
fp_test_ts_lvl_tr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \
-DPINELOG_SHOW_DATE=1 -DPINELOG_SHOW_LEVEL=1 -DPINELOG_SHOW_BACKTRACE=1
fp_test_ts_lvl_tr_LDFLAGS = $(WARN_LDFLAGS)
fp_test_ts_lvl_notr_SOURCES = $(test_SRCFILES)
fp_test_ts_lvl_notr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \
-DPINELOG_SHOW_DATE=1 -DPINELOG_SHOW_LEVEL=1 -DPINELOG_SHOW_BACKTRACE=0
fp_test_ts_lvl_notr_LDFLAGS = $(WARN_LDFLAGS)
fp_test_ts_nolvl_tr_SOURCES = $(test_SRCFILES)
fp_test_ts_nolvl_tr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \
-DPINELOG_SHOW_DATE=1 -DPINELOG_SHOW_LEVEL=0 -DPINELOG_SHOW_BACKTRACE=1
fp_test_ts_nolvl_tr_LDFLAGS = $(WARN_LDFLAGS)
fp_test_ts_nolvl_notr_SOURCES = $(test_SRCFILES)
fp_test_ts_nolvl_notr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \
-DPINELOG_SHOW_DATE=1 -DPINELOG_SHOW_LEVEL=0 -DPINELOG_SHOW_BACKTRACE=0
fp_test_ts_nolvl_notr_LDFLAGS = $(WARN_LDFLAGS)
fp_test_nots_lvl_tr_SOURCES = $(test_SRCFILES)
fp_test_nots_lvl_tr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \
-DPINELOG_SHOW_DATE=0 -DPINELOG_SHOW_LEVEL=1 -DPINELOG_SHOW_BACKTRACE=1
fp_test_nots_lvl_tr_LDFLAGS = $(WARN_LDFLAGS)
fp_test_nots_lvl_notr_SOURCES = $(test_SRCFILES)
fp_test_nots_lvl_notr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \
-DPINELOG_SHOW_DATE=0 -DPINELOG_SHOW_LEVEL=1 -DPINELOG_SHOW_BACKTRACE=0
fp_test_nots_lvl_notr_LDFLAGS = $(WARN_LDFLAGS)
fp_test_nots_nolvl_tr_SOURCES = $(test_SRCFILES)
fp_test_nots_nolvl_tr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \
-DPINELOG_SHOW_DATE=0 -DPINELOG_SHOW_LEVEL=0 -DPINELOG_SHOW_BACKTRACE=1
fp_test_nots_nolvl_tr_LDFLAGS = $(WARN_LDFLAGS)
fp_test_nots_nolvl_notr_SOURCES = $(test_SRCFILES)
fp_test_nots_nolvl_notr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \
-DPINELOG_SHOW_DATE=0 -DPINELOG_SHOW_LEVEL=0 -DPINELOG_SHOW_BACKTRACE=0
fp_test_nots_nolvl_notr_LDFLAGS = $(WARN_LDFLAGS)
fp_bench_ts_lvl_tr_SOURCES = $(bench_SRCFILES)
fp_bench_ts_lvl_tr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \
-DPINELOG_SHOW_DATE=1 -DPINELOG_SHOW_LEVEL=1 -DPINELOG_SHOW_BACKTRACE=1
fp_bench_ts_lvl_tr_LDFLAGS = $(WARN_LDFLAGS)
fp_bench_ts_lvl_notr_SOURCES = $(bench_SRCFILES)
fp_bench_ts_lvl_notr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \
-DPINELOG_SHOW_DATE=1 -DPINELOG_SHOW_LEVEL=1 -DPINELOG_SHOW_BACKTRACE=0
fp_bench_ts_lvl_notr_LDFLAGS = $(WARN_LDFLAGS)
fp_bench_ts_nolvl_tr_SOURCES = $(bench_SRCFILES)
fp_bench_ts_nolvl_tr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \
-DPINELOG_SHOW_DATE=1 -DPINELOG_SHOW_LEVEL=0 -DPINELOG_SHOW_BACKTRACE=1
fp_bench_ts_nolvl_tr_LDFLAGS = $(WARN_LDFLAGS)
fp_bench_ts_nolvl_notr_SOURCES = $(bench_SRCFILES)
fp_bench_ts_nolvl_notr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \
-DPINELOG_SHOW_DATE=1 -DPINELOG_SHOW_LEVEL=0 -DPINELOG_SHOW_BACKTRACE=0
fp_bench_ts_nolvl_notr_LDFLAGS = $(WARN_LDFLAGS)
fp_bench_nots_lvl_tr_SOURCES = $(bench_SRCFILES)
fp_bench_nots_lvl_tr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \
-DPINELOG_SHOW_DATE=0 -DPINELOG_SHOW_LEVEL=1 -DPINELOG_SHOW_BACKTRACE=1
fp_bench_nots_lvl_tr_LDFLAGS = $(WARN_LDFLAGS)
fp_bench_nots_lvl_notr_SOURCES = $(bench_SRCFILES)
fp_bench_nots_lvl_notr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \
-DPINELOG_SHOW_DATE=0 -DPINELOG_SHOW_LEVEL=1 -DPINELOG_SHOW_BACKTRACE=0
fp_bench_nots_lvl_notr_LDFLAGS = $(WARN_LDFLAGS)
fp_bench_nots_nolvl_tr_SOURCES = $(bench_SRCFILES)
fp_bench_nots_nolvl_tr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \
-DPINELOG_SHOW_DATE=0 -DPINELOG_SHOW_LEVEL=0 -DPINELOG_SHOW_BACKTRACE=1
fp_bench_nots_nolvl_tr_LDFLAGS = $(WARN_LDFLAGS)
fp_bench_nots_nolvl_notr_SOURCES = $(bench_SRCFILES)
fp_bench_nots_nolvl_notr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \
-DPINELOG_SHOW_DATE=0 -DPINELOG_SHOW_LEVEL=0 -DPINELOG_SHOW_BACKTRACE=0
fp_bench_nots_nolvl_notr_LDFLAGS = $(WARN_LDFLAGS)
test_CFLAGS += -DPINELOG_BUFFER_SZ=4096
str_test_ts_lvl_tr_SOURCES = $(test_SRCFILES)
str_test_ts_lvl_tr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \
-DPINELOG_SHOW_DATE=1 -DPINELOG_SHOW_LEVEL=1 -DPINELOG_SHOW_BACKTRACE=1
str_test_ts_lvl_tr_LDFLAGS = $(WARN_LDFLAGS)
str_test_ts_lvl_notr_SOURCES = $(test_SRCFILES)
str_test_ts_lvl_notr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \
-DPINELOG_SHOW_DATE=1 -DPINELOG_SHOW_LEVEL=1 -DPINELOG_SHOW_BACKTRACE=0
str_test_ts_lvl_notr_LDFLAGS = $(WARN_LDFLAGS)
str_test_ts_nolvl_tr_SOURCES = $(test_SRCFILES)
str_test_ts_nolvl_tr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \
-DPINELOG_SHOW_DATE=1 -DPINELOG_SHOW_LEVEL=0 -DPINELOG_SHOW_BACKTRACE=1
str_test_ts_nolvl_tr_LDFLAGS = $(WARN_LDFLAGS)
str_test_ts_nolvl_notr_SOURCES = $(test_SRCFILES)
str_test_ts_nolvl_notr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \
-DPINELOG_SHOW_DATE=1 -DPINELOG_SHOW_LEVEL=0 -DPINELOG_SHOW_BACKTRACE=0
str_test_ts_nolvl_notr_LDFLAGS = $(WARN_LDFLAGS)
str_test_nots_lvl_tr_SOURCES = $(test_SRCFILES)
str_test_nots_lvl_tr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \
-DPINELOG_SHOW_DATE=0 -DPINELOG_SHOW_LEVEL=1 -DPINELOG_SHOW_BACKTRACE=1
str_test_nots_lvl_tr_LDFLAGS = $(WARN_LDFLAGS)
str_test_nots_lvl_notr_SOURCES = $(test_SRCFILES)
str_test_nots_lvl_notr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \
-DPINELOG_SHOW_DATE=0 -DPINELOG_SHOW_LEVEL=1 -DPINELOG_SHOW_BACKTRACE=0
str_test_nots_lvl_notr_LDFLAGS = $(WARN_LDFLAGS)
str_test_nots_nolvl_tr_SOURCES = $(test_SRCFILES)
str_test_nots_nolvl_tr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \
-DPINELOG_SHOW_DATE=0 -DPINELOG_SHOW_LEVEL=0 -DPINELOG_SHOW_BACKTRACE=1
str_test_nots_nolvl_tr_LDFLAGS = $(WARN_LDFLAGS)
str_test_nots_nolvl_notr_SOURCES = $(test_SRCFILES)
str_test_nots_nolvl_notr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \
-DPINELOG_SHOW_DATE=0 -DPINELOG_SHOW_LEVEL=0 -DPINELOG_SHOW_BACKTRACE=0
str_test_nots_nolvl_notr_LDFLAGS = $(WARN_LDFLAGS)
str_bench_ts_lvl_tr_SOURCES = $(bench_SRCFILES)
str_bench_ts_lvl_tr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \
-DPINELOG_SHOW_DATE=1 -DPINELOG_SHOW_LEVEL=1 -DPINELOG_SHOW_BACKTRACE=1
str_bench_ts_lvl_tr_LDFLAGS = $(WARN_LDFLAGS)
str_bench_ts_lvl_notr_SOURCES = $(bench_SRCFILES)
str_bench_ts_lvl_notr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \
-DPINELOG_SHOW_DATE=1 -DPINELOG_SHOW_LEVEL=1 -DPINELOG_SHOW_BACKTRACE=0
str_bench_ts_lvl_notr_LDFLAGS = $(WARN_LDFLAGS)
str_bench_ts_nolvl_tr_SOURCES = $(bench_SRCFILES)
str_bench_ts_nolvl_tr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \
-DPINELOG_SHOW_DATE=1 -DPINELOG_SHOW_LEVEL=0 -DPINELOG_SHOW_BACKTRACE=1
str_bench_ts_nolvl_tr_LDFLAGS = $(WARN_LDFLAGS)
str_bench_ts_nolvl_notr_SOURCES = $(bench_SRCFILES)
str_bench_ts_nolvl_notr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \
-DPINELOG_SHOW_DATE=1 -DPINELOG_SHOW_LEVEL=0 -DPINELOG_SHOW_BACKTRACE=0
str_bench_ts_nolvl_notr_LDFLAGS = $(WARN_LDFLAGS)
str_bench_nots_lvl_tr_SOURCES = $(bench_SRCFILES)
str_bench_nots_lvl_tr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \
-DPINELOG_SHOW_DATE=0 -DPINELOG_SHOW_LEVEL=1 -DPINELOG_SHOW_BACKTRACE=1
str_bench_nots_lvl_tr_LDFLAGS = $(WARN_LDFLAGS)
str_bench_nots_lvl_notr_SOURCES = $(bench_SRCFILES)
str_bench_nots_lvl_notr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \
-DPINELOG_SHOW_DATE=0 -DPINELOG_SHOW_LEVEL=1 -DPINELOG_SHOW_BACKTRACE=0
str_bench_nots_lvl_notr_LDFLAGS = $(WARN_LDFLAGS)
str_bench_nots_nolvl_tr_SOURCES = $(bench_SRCFILES)
str_bench_nots_nolvl_tr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \
-DPINELOG_SHOW_DATE=0 -DPINELOG_SHOW_LEVEL=0 -DPINELOG_SHOW_BACKTRACE=1
str_bench_nots_nolvl_tr_LDFLAGS = $(WARN_LDFLAGS)
str_bench_nots_nolvl_notr_SOURCES = $(bench_SRCFILES)
str_bench_nots_nolvl_notr_CFLAGS = $(WARN_CFLAGS) $(test_CFLAGS) \
-DPINELOG_SHOW_DATE=0 -DPINELOG_SHOW_LEVEL=0 -DPINELOG_SHOW_BACKTRACE=0
str_bench_nots_nolvl_notr_LDFLAGS = $(WARN_LDFLAGS)

Some files were not shown because too many files have changed in this diff Show More