X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=udevdb.h;h=6eaeb25668f6a17a92e57ba6c234e3a8fb39a4db;hp=656613b593242a1a53cc930eaf017a004252e922;hb=245f9f52cec28b0377376beec222c8d5c0d07276;hpb=c2405f502cae4a634a25674306cffefb85df9ebb diff --git a/udevdb.h b/udevdb.h index 656613b59..6eaeb2566 100644 --- a/udevdb.h +++ b/udevdb.h @@ -4,40 +4,19 @@ #ifndef _UDEVDB_H_ #define _UDEVDB_H_ -#define UDEV_DB "udevdb.tdb" - -#define PATH_SIZE 256 - -#define UDEVDB_DEL "#" - /* 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 */ +#define UDEVDB_DEFAULT 0 /* defaults database to use file */ +#define UDEVDB_INTERNAL 1 /* don't store db on disk, use in memory */ -struct udevice { - char name[NAME_SIZE]; - char sysfs_dev_path[PATH_SIZE]; - char class_dev_name[NAME_SIZE]; - char class_name[NAME_SIZE]; - char bus_id[NAME_SIZE]; - char bus_name[NAME_SIZE]; - char driver[NAME_SIZE]; - char type; - int major; - int minor; - mode_t mode; -}; - -/* Function Prototypes */ +/* function prototypes */ extern void udevdb_exit(void); extern int udevdb_init(int init_flag); -extern int udevdb_delete_udevice(const char *name); -extern int udevdb_add_device(const char *device, const struct sysfs_class_device *class_dev, const char *name, char type, int major, int minor, int mode); -extern struct udevice *udevdb_get_udevice(const char *name); -extern struct udevice *udevdb_get_udevice_by_bus(const char *bus, - const char *id); -extern struct udevice *udevdb_get_udevice_by_class(const char *cls, - const char *cls_dev); -extern char *udevdb_get_udevice_by_sysfs(const char *path); +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_ */