mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-20 08:00:08 +01:00
tools: make the libinput tool usage static
This now makes the header obsolete too Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
12a364a858
commit
4508e29a47
7 changed files with 7 additions and 49 deletions
|
|
@ -21,9 +21,7 @@ ptraccel_debug_SOURCES = ptraccel-debug.c
|
||||||
ptraccel_debug_LDADD = ../src/libfilter.la ../src/libinput.la
|
ptraccel_debug_LDADD = ../src/libfilter.la ../src/libinput.la
|
||||||
ptraccel_debug_LDFLAGS = -no-install
|
ptraccel_debug_LDFLAGS = -no-install
|
||||||
|
|
||||||
libinput_SOURCES = \
|
libinput_SOURCES = libinput-tool.c
|
||||||
libinput-tool.c \
|
|
||||||
libinput-tool.h
|
|
||||||
libinput_LDADD = ../src/libinput.la libshared.la $(LIBUDEV_LIBS) $(LIBEVDEV_LIBS)
|
libinput_LDADD = ../src/libinput.la libshared.la $(LIBUDEV_LIBS) $(LIBEVDEV_LIBS)
|
||||||
libinput_CFLAGS = $(AM_CFLAGS) $(LIBUDEV_CFLAGS) $(LIBEVDEV_CFLAGS) \
|
libinput_CFLAGS = $(AM_CFLAGS) $(LIBUDEV_CFLAGS) $(LIBEVDEV_CFLAGS) \
|
||||||
-DLIBINPUT_TOOL_PATH="\"@libexecdir@/libinput\""
|
-DLIBINPUT_TOOL_PATH="\"@libexecdir@/libinput\""
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,6 @@
|
||||||
#include <libinput.h>
|
#include <libinput.h>
|
||||||
#include <libevdev/libevdev.h>
|
#include <libevdev/libevdev.h>
|
||||||
|
|
||||||
#include "libinput-tool.h"
|
|
||||||
#include "shared.h"
|
#include "shared.h"
|
||||||
|
|
||||||
uint32_t start_time;
|
uint32_t start_time;
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,6 @@
|
||||||
#include <libinput-util.h>
|
#include <libinput-util.h>
|
||||||
#include <libinput-version.h>
|
#include <libinput-version.h>
|
||||||
|
|
||||||
#include "libinput-tool.h"
|
|
||||||
#include "shared.h"
|
#include "shared.h"
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
|
|
|
||||||
|
|
@ -35,10 +35,8 @@
|
||||||
#include <libinput-util.h>
|
#include <libinput-util.h>
|
||||||
#include <libinput-version.h>
|
#include <libinput-version.h>
|
||||||
|
|
||||||
#include "libinput-tool.h"
|
static void
|
||||||
|
usage(void)
|
||||||
void
|
|
||||||
libinput_tool_usage(void)
|
|
||||||
{
|
{
|
||||||
printf("Usage: libinput [GLOBAL OPTIONS] [COMMAND] [ARGS]\n"
|
printf("Usage: libinput [GLOBAL OPTIONS] [COMMAND] [ARGS]\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
|
@ -99,7 +97,7 @@ exec_command(int real_argc, char **real_argv)
|
||||||
|
|
||||||
rc = snprintf(executable, sizeof(executable), "libinput-%s", command);
|
rc = snprintf(executable, sizeof(executable), "libinput-%s", command);
|
||||||
if (rc >= (int)sizeof(executable)) {
|
if (rc >= (int)sizeof(executable)) {
|
||||||
libinput_tool_usage();
|
usage();
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -137,19 +135,19 @@ main(int argc, char **argv)
|
||||||
switch(c) {
|
switch(c) {
|
||||||
case 'h':
|
case 'h':
|
||||||
case GOPT_HELP:
|
case GOPT_HELP:
|
||||||
libinput_tool_usage();
|
usage();
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
case GOPT_VERSION:
|
case GOPT_VERSION:
|
||||||
printf("%s\n", LIBINPUT_VERSION);
|
printf("%s\n", LIBINPUT_VERSION);
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
default:
|
default:
|
||||||
libinput_tool_usage();
|
usage();
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (optind >= argc) {
|
if (optind >= argc) {
|
||||||
libinput_tool_usage();
|
usage();
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,33 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright © 2017 Red Hat, Inc.
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
||||||
* copy of this software and associated documentation files (the "Software"),
|
|
||||||
* to deal in the Software without restriction, including without limitation
|
|
||||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
||||||
* and/or sell copies of the Software, and to permit persons to whom the
|
|
||||||
* Software is furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice (including the next
|
|
||||||
* paragraph) shall be included in all copies or substantial portions of the
|
|
||||||
* Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
||||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
||||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
||||||
* DEALINGS IN THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LIBINPUT_TOOL_H
|
|
||||||
#define LIBINPUT_TOOL_H 1
|
|
||||||
|
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
#include <stdbool.h>
|
|
||||||
|
|
||||||
void libinput_tool_usage(void);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -34,7 +34,6 @@
|
||||||
#include <libevdev/libevdev.h>
|
#include <libevdev/libevdev.h>
|
||||||
#include <libinput-util.h>
|
#include <libinput-util.h>
|
||||||
|
|
||||||
#include "libinput-tool.h"
|
|
||||||
#include "shared.h"
|
#include "shared.h"
|
||||||
|
|
||||||
enum options {
|
enum options {
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,6 @@
|
||||||
|
|
||||||
#include <libinput.h>
|
#include <libinput.h>
|
||||||
|
|
||||||
#include "libinput-tool.h"
|
|
||||||
|
|
||||||
enum tools_backend {
|
enum tools_backend {
|
||||||
BACKEND_DEVICE,
|
BACKEND_DEVICE,
|
||||||
BACKEND_UDEV
|
BACKEND_UDEV
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue