[PATCH wayland 1/2] util: Document wl_list methods
Yong Bakos
junk at humanoriented.com
Thu Aug 25 23:12:33 UTC 2016
From: Yong Bakos <ybakos at humanoriented.com>
Add doxygen comment blocks to all wl_list methods.
Signed-off-by: Yong Bakos <ybakos at humanoriented.com>
---
src/wayland-util.h | 41 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
diff --git a/src/wayland-util.h b/src/wayland-util.h
index cacc122..1044324 100644
--- a/src/wayland-util.h
+++ b/src/wayland-util.h
@@ -121,21 +121,62 @@ struct wl_list {
struct wl_list *next;
};
+/**
+ * Initializes the list.
+ *
+ * \param list to initialize
+ */
void
wl_list_init(struct wl_list *list);
+/**
+ * Inserts an element into the list, after the element represented by `list`.
+ * When `list` is empty, set `elm` as the head.
+ *
+ * \param list list element after which the new element is inserted
+ * \param elm element to insert
+ */
void
wl_list_insert(struct wl_list *list, struct wl_list *elm);
+/**
+ * Removes an element from the list.
+ *
+ * \param elm element to remove from the list
+ */
void
wl_list_remove(struct wl_list *elm);
+/**
+ * Determines the length of the list.
+ *
+ * \note This is an O(n) operation.
+ *
+ * \param list list whose length is to be determined
+ *
+ * \return number of elements in the list
+ */
int
wl_list_length(const struct wl_list *list);
+/**
+ * Determines if the list is empty.
+ *
+ * \param list list whose emptiness is to be determined
+ *
+ * \return 1 if empty, or 0 if not empty
+ */
int
wl_list_empty(const struct wl_list *list);
+/**
+ * Inserts all of the elements of one list into another, after the element
+ * represented by `list`.
+ *
+ * \param list list element after which the other list elements will be inserted
+ * \param other list of elements to insert
+ *
+ */
void
wl_list_insert_list(struct wl_list *list, struct wl_list *other);
--
2.7.2
More information about the wayland-devel
mailing list