1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-06 08:26:52 +03:00
systemd/udevdb.h
kay.sievers@vrfy.org b2a21a3547 [PATCH] udev - reverse user query options
Here we get the ability to query with the name of the node instead of
the device path. It uses a linear search over the whole database.

  kay@pim:~/src/udev.kay$ ./udev -q path -n video/webcam0
  /class/video4linux/video0


New version, with better function return codes for error handling.
2005-04-26 21:13:17 -07:00

23 lines
754 B
C

/*
* udevdb header file
*/
#ifndef _UDEVDB_H_
#define _UDEVDB_H_
/* Udevdb initialization flags */
#define UDEVDB_DEFAULT 0 /* defaults database to use file */
#define UDEVDB_INTERNAL 1 /* don't store db on disk, use in memory */
/* function prototypes */
extern void udevdb_exit(void);
extern int udevdb_init(int init_flag);
extern int udevdb_open_ro(void);
extern int udevdb_call_foreach(int (*user_record_handler) (char *path, struct udevice *dev));
extern int udevdb_add_dev(const char *path, const struct udevice *dev);
extern int udevdb_get_dev(const char *path, struct udevice *dev);
extern int udevdb_delete_dev(const char *path);
extern int udevdb_get_dev_byname(const char *name, char *path, struct udevice *dev);
#endif /* _UDEVDB_H_ */