chiark / gitweb /
[PATCH] support SUBSYSTEM as a rule key
[elogind.git] / udev_lib.h
index 53ad92d505443b584567fbeca8118bdef9662c45..2bc9ba82ab74e2d534e0d5981fadf1df8bf32c2d 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef _UDEV_LIB_H_
 #define _UDEV_LIB_H_
 
+#include "udev.h"
 
 #define strfieldcpy(to, from) \
 do { \
@@ -59,31 +60,33 @@ do { \
        snprintf((to) + strlen(to), maxsize - strlen(to)-1, "%u", i); \
 } while (0)
 
-#define strlongcat(to, i) \
-do { \
-       to[sizeof(to)-1] = '\0'; \
-       snprintf((to) + strlen(to), sizeof(to) - strlen(to)-1, "%li", i); \
-} while (0)
-
 #define foreach_strpart(str, separator, pos, len) \
        for(pos = str, len = 0; \
            (pos) < ((str) + strlen(str)); \
            pos = pos + len + strspn(pos, separator), len = strcspn(pos, separator)) \
                if (len > 0)
 
+#ifdef asmlinkage
+# undef asmlinkage
+#endif
+#ifdef __i386__
+# define asmlinkage    __attribute__((regparm(0)))
+#endif
+#ifndef asmlinkage
+# define asmlinkage    /* nothing */
+#endif
 
-extern char *get_action(void);
-extern char *get_devpath(void);
-extern char *get_devname(void);
-extern char *get_seqnum(void);
-extern char *get_subsystem(char *subsystem);
 extern char get_device_type(const char *path, const char *subsystem);
+extern void udev_set_values(struct udevice *udev, const char* devpath,
+                           const char *subsystem, const char* action);
+extern int create_path(const char *path);
 extern int file_map(const char *filename, char **buf, size_t *bufsize);
 extern void file_unmap(char *buf, size_t bufsize);
 extern size_t buf_get_line(char *buf, size_t buflen, size_t cur);
-extern void leading_slash(char *path);
-extern void no_leading_slash(char *path);
-extern int  call_foreach_file(int fnct(char *f) , char *filename, char *extension);
+extern void no_trailing_slash(char *path);
 
+typedef int (*file_fnct_t)(const char *filename, void *data);
+extern int  call_foreach_file(file_fnct_t fnct, const char *dirname,
+                             const char *suffix, void *data);
 
 #endif