From: Lucas De Marchi Date: Thu, 8 Dec 2011 14:25:36 +0000 (-0200) Subject: kmod_list: document exported functions X-Git-Tag: v1~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e1b3ae2b902031d3ec042a7f87fd3ecc98a4018;p=thirdparty%2Fkmod.git kmod_list: document exported functions --- diff --git a/libkmod/libkmod-list.c b/libkmod/libkmod-list.c index eff433e7..883a91a2 100644 --- a/libkmod/libkmod-list.c +++ b/libkmod/libkmod-list.c @@ -233,7 +233,7 @@ struct kmod_list *kmod_list_remove_data(struct kmod_list *list, /* * n must be greater to or equal the number of elements (we don't check the - * condition + * condition) */ struct kmod_list *kmod_list_remove_n_latest(struct kmod_list *list, unsigned int n) @@ -258,7 +258,19 @@ struct kmod_list *kmod_list_remove_n_latest(struct kmod_list *list, return list; } - +/** + * kmod_list_prev: + * @list: the head of the list + * @curr: the current node in the list + * + * Get the previous node in @list relative to @curr as if @list was not a + * circular list. I.e.: the previous of the head is NULL. It can be used to + * iterate a list by checking for NULL return to know when all elements were + * iterated. + * + * Returns: node previous to @curr or NULL if either this node is the head of + * the list or the list is empty. + */ KMOD_EXPORT struct kmod_list *kmod_list_prev(const struct kmod_list *list, const struct kmod_list *curr) { @@ -271,6 +283,19 @@ KMOD_EXPORT struct kmod_list *kmod_list_prev(const struct kmod_list *list, return container_of(curr->node.prev, struct kmod_list, node); } +/** + * kmod_list_next: + * @list: the head of the list + * @curr: the current node in the list + * + * Get the next node in @list relative to @curr as if @list was not a circular + * list. I.e. calling this function in the last node of the list returns + * NULL.. It can be used to iterate a list by checking for NULL return to know + * when all elements were iterated. + * + * Returns: node next to @curr or NULL if either this node is the last of or + * list is empty. + */ KMOD_EXPORT struct kmod_list *kmod_list_next(const struct kmod_list *list, const struct kmod_list *curr) {