Lines Matching refs:udev
38 * The context contains the default values read from the udev config file,
43 * udev:
47 struct udev {
49 void (*log_fn)(struct udev *udev,
57 * @udev: udev library context
64 _public_ void *udev_get_userdata(struct udev *udev) {
65 if (udev == NULL)
67 return udev->userdata;
72 * @udev: udev library context
77 _public_ void udev_set_userdata(struct udev *udev, void *userdata) {
78 if (udev == NULL)
80 udev->userdata = userdata;
86 * Create udev library context. This reads the udev configuration
90 * release the resources of the udev library context.
92 * Returns: a new udev library context
94 _public_ struct udev *udev_new(void) {
95 struct udev *udev;
98 udev = new0(struct udev, 1);
99 if (udev == NULL)
101 udev->refcount = 1;
171 log_debug("/etc/udev/udev.conf:%u: invalid log level '%s', ignoring.", line_nr, val);
179 return udev;
184 * @udev: udev library context
186 * Take a reference of the udev library context.
188 * Returns: the passed udev library context
190 _public_ struct udev *udev_ref(struct udev *udev) {
191 if (udev == NULL)
193 udev->refcount++;
194 return udev;
199 * @udev: udev library context
201 * Drop a reference of the udev library context. If the refcount
204 * Returns: the passed udev library context if it has still an active reference, or #NULL otherwise.
206 _public_ struct udev *udev_unref(struct udev *udev) {
207 if (udev == NULL)
209 udev->refcount--;
210 if (udev->refcount > 0)
211 return udev;
212 free(udev);
218 * @udev: udev library context
224 _public_ void udev_set_log_fn(struct udev *udev,
225 void (*log_fn)(struct udev *udev,
233 * @udev: udev library context
238 _public_ int udev_get_log_priority(struct udev *udev) {
244 * @udev: udev library context
250 _public_ void udev_set_log_priority(struct udev *udev, int priority) {