]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
libkmod/docs: move libkmod-list section to the header
authorEmil Velikov <emil.l.velikov@gmail.com>
Mon, 2 Sep 2024 22:20:18 +0000 (23:20 +0100)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Fri, 6 Sep 2024 16:43:24 +0000 (11:43 -0500)
In part to ease my life as I'm going through (shortly) and updating the
log. In part so that developers how don't install the gtk-doc html
pages, still have the information at hand.

While here, sort the API akin to the HTML documentation.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/94
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
libkmod/libkmod-list.c
libkmod/libkmod.h

index 38a3c273b1933d318c961332d2d8fcfbadbfa37e..5c49570763b8f33e0e7418d20162bc0a43eefb7e 100644 (file)
@@ -8,11 +8,6 @@
 #include "libkmod.h"
 #include "libkmod-internal.h"
 
-/**
- * SECTION:libkmod-list
- * @short_description: general purpose list
- */
-
 static inline struct list_node *list_node_init(struct list_node *node)
 {
        node->next = node;
@@ -229,19 +224,6 @@ struct kmod_list *kmod_list_remove_n_latest(struct kmod_list *list,
        return l;
 }
 
-/**
- * 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)
 {
@@ -254,19 +236,6 @@ 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)
 {
@@ -279,19 +248,6 @@ KMOD_EXPORT struct kmod_list *kmod_list_next(const struct kmod_list *list,
        return container_of(curr->node.next, struct kmod_list, node);
 }
 
-/**
- * kmod_list_last:
- * @list: the head of the list
- *
- * Get the last element of the @list. As @list is a circular list,
- * this is a cheap operation O(1) with the last element being the
- * previous element.
- *
- * If the list has a single element it will return the list itself (as
- * expected, and this is what differentiates from kmod_list_prev()).
- *
- * Returns: last node at @list or NULL if the list is empty.
- */
 KMOD_EXPORT struct kmod_list *kmod_list_last(const struct kmod_list *list)
 {
        if (list == NULL)
index 22811d8e7c5694b8808b5db83f19f1514c62203f..b008af78ea3fc2e8ee89b932c9de7ea2a031b242 100644 (file)
@@ -63,17 +63,19 @@ enum kmod_index {
 };
 int kmod_dump_index(struct kmod_ctx *ctx, enum kmod_index type, int fd);
 
+
+
+/**
+ * SECTION:libkmod-list
+ * @short_description: general purpose list
+ */
+
 /*
  * kmod_list
  *
  * access to kmod generated lists
  */
 struct kmod_list;
-struct kmod_list *kmod_list_next(const struct kmod_list *list,
-                                               const struct kmod_list *curr);
-struct kmod_list *kmod_list_prev(const struct kmod_list *list,
-                                               const struct kmod_list *curr);
-struct kmod_list *kmod_list_last(const struct kmod_list *list);
 
 #define kmod_list_foreach(list_entry, first_entry) \
        for (list_entry = first_entry; \
@@ -85,6 +87,53 @@ struct kmod_list *kmod_list_last(const struct kmod_list *list);
                list_entry != NULL; \
                list_entry = kmod_list_prev(first_entry, list_entry))
 
+/**
+ * kmod_list_last:
+ * @list: the head of the list
+ *
+ * Get the last element of the @list. As @list is a circular list,
+ * this is a cheap operation O(1) with the last element being the
+ * previous element.
+ *
+ * If the list has a single element it will return the list itself (as
+ * expected, and this is what differentiates from kmod_list_prev()).
+ *
+ * Returns: last node at @list or NULL if the list is empty.
+ */
+struct kmod_list *kmod_list_last(const struct kmod_list *list);
+
+/**
+ * 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.
+ */
+struct kmod_list *kmod_list_next(const struct kmod_list *list,
+                                               const struct kmod_list *curr);
+
+/**
+ * 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.
+ */
+struct kmod_list *kmod_list_prev(const struct kmod_list *list,
+                                               const struct kmod_list *curr);
+
 
 
 /**