diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2008-10-17 01:39:10 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2008-10-17 01:39:10 +0200 |
commit | 3feeb77c97a62cbb714bb95ed38ec8c44cb459ce (patch) | |
tree | e633cd60ae007eb9b07a0978a05ec025ab5bf319 /udev/lib | |
parent | d130881d348bff7a593bfc4e3530e0b63d87b795 (diff) |
libudev: list - prepend udev_* to all functions
Diffstat (limited to 'udev/lib')
-rw-r--r-- | udev/lib/libudev-list.c | 29 | ||||
-rw-r--r-- | udev/lib/libudev-private.h | 1 |
2 files changed, 11 insertions, 19 deletions
diff --git a/udev/lib/libudev-list.c b/udev/lib/libudev-list.c index fb8301b0bd..76c2f7e93b 100644 --- a/udev/lib/libudev-list.c +++ b/udev/lib/libudev-list.c @@ -43,12 +43,12 @@ void udev_list_init(struct udev_list_node *list) list->prev = list; } -static int list_is_empty(struct udev_list_node *list) +static int udev_list_is_empty(struct udev_list_node *list) { return list->next == list; } -static void list_node_insert_between(struct udev_list_node *new, +static void udev_list_node_insert_between(struct udev_list_node *new, struct udev_list_node *prev, struct udev_list_node *next) { @@ -58,7 +58,7 @@ static void list_node_insert_between(struct udev_list_node *new, prev->next = new; } -static void list_node_remove(struct udev_list_node *entry) +static void udev_list_node_remove(struct udev_list_node *entry) { struct udev_list_node *prev = entry->prev; struct udev_list_node *next = entry->next; @@ -84,14 +84,14 @@ static struct udev_list_entry *list_node_to_entry(struct udev_list_node *node) static void list_entry_append(struct udev_list_entry *new, struct udev_list_node *list) { /* inserting before the list head make the node the last node in the list */ - list_node_insert_between(&new->node, list->prev, list); + udev_list_node_insert_between(&new->node, list->prev, list); new->list = list; } /* insert entry into a list, before a given existing entry */ static void list_entry_insert_before(struct udev_list_entry *new, struct udev_list_entry *entry) { - list_node_insert_between(&new->node, entry->node.prev, &entry->node); + udev_list_node_insert_between(&new->node, entry->node.prev, &entry->node); new->list = entry->list; } @@ -154,7 +154,7 @@ struct udev_list_entry *udev_list_entry_add(struct udev *udev, struct udev_list_ void udev_list_entry_remove(struct udev_list_entry *entry) { - list_node_remove(&entry->node); + udev_list_node_remove(&entry->node); free(entry->name); free(entry->value); free(entry); @@ -171,27 +171,20 @@ void udev_list_cleanup(struct udev *udev, struct udev_list_node *list) void udev_list_entry_move_to_end(struct udev_list_entry *list_entry) { - list_node_remove(&list_entry->node); - list_node_insert_between(&list_entry->node, list_entry->list->prev, list_entry->list); -} - -void udev_list_entry_move_to_list(struct udev_list_entry *list_entry, struct udev_list_node *list) -{ - list_node_remove(&list_entry->node); - list_node_insert_between(&list_entry->node, list->prev, list); - list_entry->list = list; + udev_list_node_remove(&list_entry->node); + udev_list_node_insert_between(&list_entry->node, list_entry->list->prev, list_entry->list); } void udev_list_entry_move_before(struct udev_list_entry *list_entry, struct udev_list_entry *entry) { - list_node_remove(&list_entry->node); - list_node_insert_between(&list_entry->node, entry->node.prev, &entry->node); + udev_list_node_remove(&list_entry->node); + udev_list_node_insert_between(&list_entry->node, entry->node.prev, &entry->node); list_entry->list = entry->list; } struct udev_list_entry *udev_list_get_entry(struct udev_list_node *list) { - if (list_is_empty(list)) + if (udev_list_is_empty(list)) return NULL; return list_node_to_entry(list->next); } diff --git a/udev/lib/libudev-private.h b/udev/lib/libudev-private.h index 96e62a8ec5..f2814c4ad6 100644 --- a/udev/lib/libudev-private.h +++ b/udev/lib/libudev-private.h @@ -130,7 +130,6 @@ extern struct udev_list_entry *udev_list_entry_add(struct udev *udev, struct ude extern void udev_list_entry_remove(struct udev_list_entry *entry); extern struct udev_list_entry *udev_list_get_entry(struct udev_list_node *list); extern void udev_list_entry_move_to_end(struct udev_list_entry *list_entry); -extern void udev_list_entry_move_to_list(struct udev_list_entry *list_entry, struct udev_list_node *list); extern void udev_list_entry_move_before(struct udev_list_entry *list_entry, struct udev_list_entry *entry); extern int udev_list_entry_get_flag(struct udev_list_entry *list_entry); extern void udev_list_entry_set_flag(struct udev_list_entry *list_entry, int flag); |