chiark / gitweb /
udev: add helper udev_device_new_from_stat_rdev()
[elogind.git] / src / shared / udev-util.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 /***
5   This file is part of systemd.
6
7   Copyright 2013 Zbigniew JÄ™drzejewski-Szmek
8 ***/
9
10 #if 0 /// elogind needs the systems udev header
11 #include "udev.h"
12 #else
13 #include <libudev.h>
14 #endif // 0
15 #include "util.h"
16
17 DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev*, udev_unref);
18 DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_device*, udev_device_unref);
19 DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_enumerate*, udev_enumerate_unref);
20 #if 0 /// UNNEEDED by elogind
21 DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_event*, udev_event_unref);
22 DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_rules*, udev_rules_unref);
23 DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_ctrl*, udev_ctrl_unref);
24 DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_ctrl_connection*, udev_ctrl_connection_unref);
25 DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_ctrl_msg*, udev_ctrl_msg_unref);
26 #endif // 0
27 DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_monitor*, udev_monitor_unref);
28
29 #if 0 /// UNNEEDED by elogind
30 #endif // 0
31 int udev_parse_config(void);
32
33 int udev_device_new_from_stat_rdev(struct udev *udev, const struct stat *st, struct udev_device **ret);