Lines Matching defs:udev
39 * The context contains the default values read from the udev config file,
44 * udev:
48 struct udev {
50 void (*log_fn)(struct udev *udev,
58 * @udev: udev library context
65 _public_ void *udev_get_userdata(struct udev *udev) {
66 if (udev == NULL)
68 return udev->userdata;
73 * @udev: udev library context
78 _public_ void udev_set_userdata(struct udev *udev, void *userdata) {
79 if (udev == NULL)
81 udev->userdata = userdata;
87 * Create udev library context. This reads the udev configuration
91 * release the resources of the udev library context.
93 * Returns: a new udev library context
95 _public_ struct udev *udev_new(void) {
96 struct udev *udev;
99 udev = new0(struct udev, 1);
100 if (udev == NULL)
102 udev->refcount = 1;
104 f = fopen("/etc/udev/udev.conf", "re");
128 log_debug("/etc/udev/udev.conf:%u: missing assignment, skipping line.", line_nr);
160 log_debug("/etc/udev/udev.conf:%u: inconsistent quoting, skipping line.", line_nr);
172 log_debug("/etc/udev/udev.conf:%u: invalid log level '%s', ignoring.", line_nr, val);
180 return udev;
185 * @udev: udev library context
187 * Take a reference of the udev library context.
189 * Returns: the passed udev library context
191 _public_ struct udev *udev_ref(struct udev *udev) {
192 if (udev == NULL)
194 udev->refcount++;
195 return udev;
200 * @udev: udev library context
202 * Drop a reference of the udev library context. If the refcount
205 * Returns: the passed udev library context if it has still an active reference, or #NULL otherwise.
207 _public_ struct udev *udev_unref(struct udev *udev) {
208 if (udev == NULL)
210 udev->refcount--;
211 if (udev->refcount > 0)
212 return udev;
213 free(udev);
219 * @udev: udev library context
225 _public_ void udev_set_log_fn(struct udev *udev,
226 void (*log_fn)(struct udev *udev,
234 * @udev: udev library context
239 _public_ int udev_get_log_priority(struct udev *udev) {
245 * @udev: udev library context
251 _public_ void udev_set_log_priority(struct udev *udev, int priority) {