{
struct libinput *li;
enum tools_backend backend = BACKEND_NONE;
- char *seat_or_devices[60] = {NULL};
+ const char *seat_or_devices[60] = {NULL};
size_t ndevices = 0;
bool grab = false;
bool verbose = false;
}
backend = BACKEND_DEVICE;
- seat_or_devices[ndevices++] = safe_strdup(optarg);
+ seat_or_devices[ndevices++] = optarg;
break;
case OPT_UDEV:
if (backend == BACKEND_DEVICE ||
}
backend = BACKEND_UDEV;
- seat_or_devices[0] = safe_strdup(optarg);
+ seat_or_devices[0] = optarg;
ndevices = 1;
break;
case OPT_GRAB:
usage();
return EXIT_INVALID_USAGE;
}
- seat_or_devices[ndevices++] = safe_strdup(argv[optind]);
+ seat_or_devices[ndevices++] = argv[optind];
} while(++optind < argc);
} else if (backend == BACKEND_NONE) {
backend = BACKEND_UDEV;
- seat_or_devices[0] = safe_strdup("seat0");
- ndevices = 1;
+ seat_or_devices[0] = "seat0";
}
memset(&act, 0, sizeof(act));
if (!li)
return EXIT_FAILURE;
- while (ndevices-- > 0)
- free(seat_or_devices[ndevices]);
-
mainloop(li);
libinput_unref(li);
struct tools_options options;
struct libinput *li;
enum tools_backend backend = BACKEND_NONE;
- char *seat_or_device[2] = {"seat0", NULL};
+ const char *seat_or_device[2] = {"seat0", NULL};
bool verbose = false;
if (!gtk_init_check(&argc, &argv))
struct context ctx;
struct libinput *li;
enum tools_backend backend = BACKEND_NONE;
- char *seat_or_device[2] = {"seat0", NULL};
+ const char *seat_or_device[2] = {"seat0", NULL};
struct sigaction act;
bool grab = false;
struct libinput *li;
struct libinput_event *ev;
bool grab = false;
- char *seat[2] = {"seat0", NULL};
+ const char *seat[2] = {"seat0", NULL};
/* This is kept for backwards-compatibility with the old
libinput-list-devices */
}
static struct libinput *
-tools_open_device(char **paths, bool verbose, bool *grab)
+tools_open_device(const char **paths, bool verbose, bool *grab)
{
struct libinput_device *device;
struct libinput *li;
- char **p = paths;
+ const char **p = paths;
li = libinput_path_create_context(&interface, grab);
if (!li) {
struct libinput *
tools_open_backend(enum tools_backend which,
- char **seat_or_device,
+ const char **seat_or_device,
bool verbose,
bool *grab)
{
const char *optarg,
struct tools_options *options);
struct libinput* tools_open_backend(enum tools_backend which,
- char **seat_or_devices,
+ const char **seat_or_devices,
bool verbose,
bool *grab);
void tools_device_apply_config(struct libinput_device *device,