mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-01-04 02:40:16 +01:00
Define a set of cleanup helpers
These are all data structs that are used in libinput and the tests, let's declare them in a shared header so we can use them everywhere. For udev and libevdev let's use an ifdef check for a known #define so we don't have to add those deps everywhere. Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1184>
This commit is contained in:
parent
ae423bc3fe
commit
bbbe757a26
1 changed files with 18 additions and 0 deletions
|
|
@ -43,6 +43,7 @@
|
|||
#include "util-range.h"
|
||||
#include "util-prop-parsers.h"
|
||||
#include "util-time.h"
|
||||
#include "util-mem.h"
|
||||
|
||||
#define VENDOR_ID_APPLE 0x5ac
|
||||
#define VENDOR_ID_CHICONY 0x4f2
|
||||
|
|
@ -71,4 +72,21 @@
|
|||
#define LIBINPUT_EXPORT __attribute__ ((visibility("default")))
|
||||
#define LIBINPUT_UNUSED __attribute__ ((unused))
|
||||
|
||||
/* Commonly-used cleanup */
|
||||
#ifdef udev_list_entry_foreach
|
||||
DEFINE_UNREF_CLEANUP_FUNC(udev);
|
||||
DEFINE_UNREF_CLEANUP_FUNC(udev_device);
|
||||
DEFINE_UNREF_CLEANUP_FUNC(udev_enumerate);
|
||||
DEFINE_UNREF_CLEANUP_FUNC(udev_monitor);
|
||||
#endif
|
||||
#ifdef LIBEVDEV_ATTRIBUTE_PRINTF
|
||||
DEFINE_FREE_CLEANUP_FUNC(libevdev);
|
||||
#endif
|
||||
DEFINE_UNREF_CLEANUP_FUNC(libinput);
|
||||
DEFINE_UNREF_CLEANUP_FUNC(libinput_device);
|
||||
DEFINE_UNREF_CLEANUP_FUNC(libinput_tablet_tool);
|
||||
DEFINE_UNREF_CLEANUP_FUNC(libinput_seat);
|
||||
DEFINE_DESTROY_CLEANUP_FUNC(libinput_event);
|
||||
DEFINE_DESTROY_CLEANUP_FUNC(libinput_config_accel);
|
||||
|
||||
#endif /* LIBINPUT_UTIL_H */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue