src/cx/linked_list.h

changeset 1424
563033aa998c
parent 1423
9a72258446cd
--- a/src/cx/linked_list.h	Sat Oct 11 15:42:48 2025 +0200
+++ b/src/cx/linked_list.h	Sun Oct 12 20:21:56 2025 +0200
@@ -44,7 +44,7 @@
 #endif
 
 /**
- * Meta data for a linked list.
+ * Metadata for a linked list.
  */
 typedef struct cx_linked_list_s {
     /** Base members. */
@@ -79,8 +79,8 @@
  * Allocates a linked list for storing elements with @p elem_size bytes each.
  *
  * If @p elem_size is #CX_STORE_POINTERS, the created list stores pointers instead of
- * copies of the added elements and the compare function will be automatically set
- * to cx_cmp_ptr(), if none is given.
+ * copies of the added elements, and the compare function will be automatically set
+ * to cx_cmp_ptr() if none is given.
  *
  * @param allocator the allocator for allocating the list nodes
  * (if @c NULL, the cxDefaultAllocator will be used)
@@ -108,7 +108,7 @@
  * after list creation or use cxLinkedListCreate().
  *
  * If @p elem_size is #CX_STORE_POINTERS, the created list stores pointers instead of
- * copies of the added elements and the compare function will be automatically set
+ * copies of the added elements, and the compare function will be automatically set
  * to cx_cmp_ptr().
  *
  * @param elem_size (@c size_t) the size of each element in bytes
@@ -121,12 +121,12 @@
  * Finds the node at a certain index.
  *
  * This function can be used to start at an arbitrary position within the list.
- * If the search index is large than the start index, @p loc_advance must denote
- * the location of some sort of @c next pointer (i.e. a pointer to the next node).
+ * If the search index is larger than the start index, @p loc_advance must denote
+ * the location of a @c next pointer (i.e., a pointer to the next node).
  * But it is also possible that the search index is smaller than the start index
- * (e.g. in cases where traversing a list backwards is faster) in which case
- * @p loc_advance must denote the location of some sort of @c prev pointer
- * (i.e. a pointer to the previous node).
+ * (e.g., in cases where traversing a list backwards is faster).
+ * In that case @p loc_advance must denote the location of a @c prev pointer
+ * (i.e., a pointer to the previous node).
  *
  * @param start a pointer to the start node
  * @param start_index the start index
@@ -225,7 +225,7 @@
 
 /**
  * Adds a new node to a linked list.
- * The node must not be part of any list already.
+ * The node must not be part of any list yet.
  *
  * @remark One of the pointers @p begin or @p end may be @c NULL, but not both.
  *
@@ -247,7 +247,7 @@
 
 /**
  * Prepends a new node to a linked list.
- * The node must not be part of any list already.
+ * The node must not be part of any list yet.
  *
  * @remark One of the pointers @p begin or @p end may be @c NULL, but not both.
  *
@@ -305,7 +305,7 @@
 
 /**
  * Inserts a new node after a given node of a linked list.
- * The new node must not be part of any list already.
+ * The new node must not be part of any list yet.
  *
  * @note If you specify @c NULL as the @p node to insert after, this function needs either the @p begin or
  * the @p end pointer to determine the start of the list. Then the new node will be prepended to the list.
@@ -330,7 +330,7 @@
 
 /**
  * Inserts a chain of nodes after a given node of a linked list.
- * The chain must not be part of any list already.
+ * The chain must not be part of any list yet.
  *
  * If you do not explicitly specify the end of the chain, it will be determined by traversing
  * the @c next pointer.
@@ -362,7 +362,7 @@
 
 /**
  * Inserts a node into a sorted linked list.
- * The new node must not be part of any list already.
+ * The new node must not be part of any list yet.
  *
  * If the list starting with the node pointed to by @p begin is not sorted
  * already, the behavior is undefined.
@@ -394,7 +394,7 @@
  *
  * @attention In contrast to cx_linked_list_insert_chain(), the source chain
  * will be broken and inserted into the target list so that the resulting list
- * will be sorted according to @p cmp_func. That means, each node in the source
+ * will be sorted according to @p cmp_func. That means each node in the source
  * chain may be re-linked with nodes from the target list.
  *
  * @param begin a pointer to the beginning node pointer (required)
@@ -475,7 +475,7 @@
 /**
  * Removes a chain of nodes from the linked list.
  *
- * If one of the nodes to remove is the beginning (resp. end) node of the list and if @p begin (resp. @p end)
+ * If one of the nodes to remove is the beginning (resp. end) node of the list, and if @p begin (resp. @p end)
  * addresses are provided, the pointers are adjusted accordingly.
  *
  * The following combinations of arguments are valid (more arguments are optional):
@@ -507,7 +507,7 @@
 /**
  * Removes a node from the linked list.
  *
- * If the node to remove is the beginning (resp. end) node of the list and if @p begin (resp. @p end)
+ * If the node to remove is the beginning (resp. end) node of the list, and if @p begin (resp. @p end)
  * addresses are provided, the pointers are adjusted accordingly.
  *
  * The following combinations of arguments are valid (more arguments are optional):
@@ -585,7 +585,7 @@
 /**
  * Compares two lists element wise.
  *
- * @attention Both list must have the same structure.
+ * @attention Both lists must have the same structure.
  *
  * @param begin_left the beginning of the left list (@c NULL denotes an empty list)
  * @param begin_right the beginning of the right list  (@c NULL denotes an empty list)

mercurial