X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=udev.h;h=6798f136663275fc05198fbc3def8d39b0023781;hb=67922099bfb10b274988e6061218ff2af4a53f09;hp=1f6e981cc2d627841661737d95f660664cc0ec88;hpb=d41120879358f783eb1a457f340c1a4b538a9410;p=elogind.git diff --git a/udev.h b/udev.h index 1f6e981cc..6798f1366 100644 --- a/udev.h +++ b/udev.h @@ -60,13 +60,6 @@ extern int log_message (int level, const char *format, ...) #define OWNER_SIZE 30 #define GROUP_SIZE 30 -struct device_attr { - char name[NAME_SIZE]; - char owner[OWNER_SIZE]; - char group[GROUP_SIZE]; - mode_t mode; -}; - struct udevice { char name[NAME_SIZE]; char owner[OWNER_SIZE]; @@ -75,8 +68,20 @@ struct udevice { int major; int minor; mode_t mode; + + /* fields that help us in building strings */ + unsigned char bus_id[SYSFS_NAME_LEN]; + unsigned char callout_value[NAME_SIZE]; + unsigned char kernel_number[NAME_SIZE]; + }; +#define strfieldcpy(to, from) \ +do { \ + to[sizeof(to)-1] = '\0'; \ + strncpy(to, from, sizeof(to)-1); \ +} while (0) + extern int udev_add_device(char *path, char *subsystem); extern int udev_remove_device(char *path, char *subsystem);