mirror of
https://github.com/AuxXxilium/kmod.git
synced 2024-11-23 23:10:53 +07:00
Add kmod_list_prev to exported functions
This commit is contained in:
parent
9ba6f57b5b
commit
79d77111dc
@ -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)
|
||||
{
|
||||
|
@ -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; \
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user