summaryrefslogtreecommitdiff
path: root/udev_utils.c
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2005-03-04 21:33:57 +0100
committerGreg KH <gregkh@suse.de>2005-04-26 23:39:48 -0700
commitf0308095c78fd68c29be9b3b391bc1c077afa04c (patch)
tree3a932afd373dd9b2ea447f392acf1dbf7392b037 /udev_utils.c
parent03cfa1394fcc2c4386f8af22e5a4d9fdd7cecc50 (diff)
[PATCH] remove typedef for call_foreach_file() handler function
Diffstat (limited to 'udev_utils.c')
-rw-r--r--udev_utils.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/udev_utils.c b/udev_utils.c
index f2534dd331..cfa4ab51b3 100644
--- a/udev_utils.c
+++ b/udev_utils.c
@@ -259,13 +259,7 @@ void no_trailing_slash(char *path)
path[--len] = '\0';
}
-struct name_entry {
- struct list_head node;
- char name[NAME_SIZE];
-};
-
-/* sort files in lexical order */
-static int name_list_add(struct list_head *name_list, const char *name, int sort)
+int name_list_add(struct list_head *name_list, const char *name, int sort)
{
struct name_entry *loop_name;
struct name_entry *new_name;
@@ -288,11 +282,13 @@ static int name_list_add(struct list_head *name_list, const char *name, int sort
strfieldcpy(new_name->name, name);
list_add_tail(&new_name->node, &loop_name->node);
+
return 0;
}
/* calls function for every file found in specified directory */
-int call_foreach_file(file_fnct_t fnct, const char *dirname, const char *suffix, void *data)
+int call_foreach_file(int (*handler_function)(struct udevice *udev, const char *string),
+ struct udevice *udev, const char *dirname, const char *suffix)
{
struct dirent *ent;
DIR *dir;
@@ -335,7 +331,7 @@ int call_foreach_file(file_fnct_t fnct, const char *dirname, const char *suffix,
snprintf(filename, NAME_SIZE, "%s/%s", dirname, loop_file->name);
filename[NAME_SIZE-1] = '\0';
- fnct(filename, data);
+ handler_function(udev, filename);
list_del(&loop_file->node);
free(loop_file);