chiark / gitweb /
[PATCH] change call_foreach_file to return a list
[elogind.git] / udev_utils.h
index 3bb1b25362a2dfcb6aa351446da17eea09ea7591..b45500dcff61b63f6d6ff76572b9c672720b41f8 100644 (file)
 
 #include "udev.h"
 
-#define strfieldcpy(to, from) \
-do { \
-       to[sizeof(to)-1] = '\0'; \
-       strncpy(to, from, sizeof(to)-1); \
-} while (0)
-
-#define strfieldcat(to, from) \
-do { \
-       to[sizeof(to)-1] = '\0'; \
-       strncat(to, from, sizeof(to) - strlen(to)-1); \
-} while (0)
-
-#define strfieldcpymax(to, from, maxsize) \
-do { \
-       to[maxsize-1] = '\0'; \
-       strncpy(to, from, maxsize-1); \
-} while (0)
-
-#define strfieldcatmax(to, from, maxsize) \
-do { \
-       to[maxsize-1] = '\0'; \
-       strncat(to, from, maxsize - strlen(to)-1); \
-} while (0)
-
-#ifdef asmlinkage
-# undef asmlinkage
-#endif
-#ifdef __i386__
-# define asmlinkage    __attribute__((regparm(0)))
-#endif
-#ifndef asmlinkage
-# define asmlinkage
-#endif
-
 struct name_entry {
        struct list_head node;
-       char name[NAME_SIZE];
+       char name[PATH_SIZE];
 };
 
 extern int udev_init_device(struct udevice *udev, const char* devpath, const char *subsystem);
@@ -75,6 +41,6 @@ extern void file_unmap(char *buf, size_t bufsize);
 extern size_t buf_get_line(const char *buf, size_t buflen, size_t cur);
 extern void no_trailing_slash(char *path);
 extern int name_list_add(struct list_head *name_list, const char *name, int sort);
-extern int call_foreach_file(int (*handler_function)(struct udevice *udev, const char *string),
-                            struct udevice *udev, const char *dirname, const char *suffix);
+extern int add_matching_files(struct list_head *name_list, const char *dirname, const char *suffix);
+
 #endif