X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=udev.h;h=33cb89af5542ef6684971cc6e90c0514325e85b1;hb=8634e6d111730b6c95a8b846ddbadafb147b4a34;hp=458d1d9c370256e520031c2925fa4f6ebb5c2563;hpb=85511f02466297b7dca07c3fe5491230f3f06d14;p=elogind.git diff --git a/udev.h b/udev.h index 458d1d9c3..33cb89af5 100644 --- a/udev.h +++ b/udev.h @@ -34,25 +34,38 @@ #define dbg(format, arg...) do { } while (0) #endif +/* Parser needs it's own debugging statement, we usually don't care about this at all */ +#ifdef DEBUG_PARSER +#define dbg_parse(format, arg...) \ + do { \ + log_message (LOG_DEBUG , "%s: " format , __FUNCTION__ , ## arg); \ + } while (0) +#else + #define dbg_parse(format, arg...) do { } while (0) +#endif -/* Lots of constants that should be in a config file sometime */ - -/* Location of sysfs mount */ -#define SYSFS_ROOT "/sys" - -/* Where udev should create its device nodes, trailing / needed */ -#define UDEV_ROOT "/home/greg/linux/udev/" -/* device file in sysfs that contains major/minor number, leading / needed */ -#define DEV_FILE "/dev" +extern int log_message (int level, const char *format, ...) + __attribute__ ((format (printf, 2, 3))); -/* Binaries that udev calls to do stuff */ -#define MKNOD "/bin/mknod" +/* Lots of constants that should be in a config file sometime */ +#define NAME_SIZE 100 +#define OWNER_SIZE 30 +#define GROUP_SIZE 30 -extern int log_message (int level, const char *format, ...); +struct device_attr { + char name[NAME_SIZE]; + char owner[OWNER_SIZE]; + char group[GROUP_SIZE]; + int mode; +}; +extern int udev_add_device(char *device, char *subsystem); +extern int udev_remove_device(char *device, char *subsystem); +extern char **main_argv; +extern char **main_envp; #endif