Add kmod_list_prev to exported functions

This commit is contained in:
Lucas De Marchi 2011-12-01 14:47:03 -02:00
parent 9ba6f57b5b
commit 79d77111dc
3 changed files with 15 additions and 0 deletions

View File

@ -138,6 +138,18 @@ struct kmod_list *kmod_list_remove_data(struct kmod_list *list,
return container_of(node, struct kmod_list, node);
}
KMOD_EXPORT struct kmod_list *kmod_list_prev(struct kmod_list *list,
struct kmod_list *curr)
{
if (list == NULL || curr == NULL)
return NULL;
if (curr->node.prev == &list->node)
return NULL;
return container_of(curr->node.prev, struct kmod_list, node);
}
KMOD_EXPORT struct kmod_list *kmod_list_next(struct kmod_list *list,
struct kmod_list *curr)
{

View File

@ -56,6 +56,8 @@ void kmod_set_userdata(struct kmod_ctx *ctx, void *userdata);
struct kmod_list;
struct kmod_list *kmod_list_next(struct kmod_list *first_entry,
struct kmod_list *list_entry);
struct kmod_list *kmod_list_prev(struct kmod_list *first_entry,
struct kmod_list *list_entry);
#define kmod_list_foreach(list_entry, first_entry) \
for (list_entry = first_entry; \
list_entry != NULL; \

View File

@ -10,6 +10,7 @@ global:
kmod_set_userdata;
kmod_unref;
kmod_list_next;
kmod_list_prev;
kmod_loaded_new;
kmod_loaded_ref;
kmod_loaded_unref;