]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/libudev/libudev-util.h
libudev: hide definition of struct udev_list from other libudev components
[thirdparty/systemd.git] / src / libudev / libudev-util.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 #include "libudev.h"
5
6 #include "macro.h"
7
8 /* libudev-util.c */
9 #define UTIL_PATH_SIZE 1024
10 #define UTIL_NAME_SIZE 512
11 #define UTIL_LINE_SIZE 16384
12 #define UDEV_ALLOWED_CHARS_INPUT "/ $%?,"
13 size_t util_path_encode(const char *src, char *dest, size_t size);
14 size_t util_replace_whitespace(const char *str, char *to, size_t len);
15 size_t util_replace_chars(char *str, const char *white);
16 int util_resolve_subsys_kernel(const char *string, char *result, size_t maxsize, bool read_value);
17
18 /* Cleanup functions */
19 DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev*, udev_unref);
20 DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_device*, udev_device_unref);
21 DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_enumerate*, udev_enumerate_unref);
22 DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_monitor*, udev_monitor_unref);
23 DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_hwdb*, udev_hwdb_unref);
24 DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_queue*, udev_queue_unref);