X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=udev.h;h=e8f93ad5ada2c49fb8076742a50bf14bddaad906;hb=896e5aa9aa6ea467a34b53d5053621b9cfc58548;hp=9e01e40492ea8c75cc8bb5958120ea00a8a2ee44;hpb=d45ea2b70c0cba69b02dae81d696a8b4c05c1771;p=elogind.git diff --git a/udev.h b/udev.h index 9e01e4049..e8f93ad5a 100644 --- a/udev.h +++ b/udev.h @@ -24,6 +24,7 @@ #define UDEV_H #include "libsysfs/libsysfs.h" +#include #include #define COMMENT_CHARACTER '#' @@ -33,6 +34,9 @@ #define GROUP_SIZE 30 #define MODE_SIZE 8 +/* length of public data */ +#define UDEVICE_LEN (offsetof(struct udevice, bus_id)) + struct udevice { char name[NAME_SIZE]; char owner[OWNER_SIZE]; @@ -42,12 +46,13 @@ struct udevice { int minor; unsigned int mode; /* not mode_t due to conflicting definitions in different libcs */ char symlink[NAME_SIZE]; + int partitions; - /* fields that help us in building strings */ - unsigned char bus_id[SYSFS_NAME_LEN]; - unsigned char program_result[NAME_SIZE]; - unsigned char kernel_number[NAME_SIZE]; - unsigned char kernel_name[NAME_SIZE]; + /* private data that help us in building strings */ + char bus_id[SYSFS_NAME_LEN]; + char program_result[NAME_SIZE]; + char kernel_number[NAME_SIZE]; + char kernel_name[NAME_SIZE]; }; #define strfieldcpy(to, from) \ @@ -56,7 +61,7 @@ do { \ strncpy(to, from, sizeof(to)-1); \ } while (0) -extern int udev_add_device(char *path, char *subsystem); +extern int udev_add_device(char *path, char *subsystem, int fake); extern int udev_remove_device(char *path, char *subsystem); extern void udev_init_config(void); extern int parse_get_pair(char **orig_string, char **left, char **right);