Update doubly linked list doc

2026-05-10 16:03:30 +01:00
parent 2e6dd6cfa1
commit 16df3be369
+16 -2
@@ -159,7 +159,7 @@ A type-generic doubly-linked list with node-level operations.
| `wapp_dbl_list_get_node(type, list, index)` | Returns the `GenericNode*` at `index` | | `wapp_dbl_list_get_node(type, list, index)` | Returns the `GenericNode*` at `index` |
| `wapp_dbl_list_get_node_item(type, node)` | Returns pointer to the item in a node | | `wapp_dbl_list_get_node_item(type, node)` | Returns pointer to the item in a node |
### Mutation ### Mutation (stack-allocated nodes)
| Macro | Description | | Macro | Description |
|-------|-------------| |-------|-------------|
@@ -171,7 +171,21 @@ A type-generic doubly-linked list with node-level operations.
| `wapp_dbl_list_remove(type, list, index)` | Removes and returns element at `index` | | `wapp_dbl_list_remove(type, list, index)` | Removes and returns element at `index` |
| `wapp_dbl_list_empty(type, list)` | Removes all elements | | `wapp_dbl_list_empty(type, list)` | Removes all elements |
Allocation-backed variants (`_push_front_alloc`, `_push_back_alloc`, `_insert_alloc`) accept an `allocator` parameter for node allocation. Node-level variants (`_pop_front_node`, `_pop_back_node`, `_remove_node`) return the `GenericNode*` directly. ### Mutation (allocator-backed nodes)
| Macro | Description |
|-------|-------------|
| `wapp_dbl_list_push_front_alloc(type, allocator, list, item_ptr)` | Inserts at the front with an allocated node |
| `wapp_dbl_list_push_back_alloc(type, allocator, list, item_ptr)` | Appends at the back with an allocated node |
| `wapp_dbl_list_insert_alloc(type, allocator, list, item_ptr, index)` | Inserts at `index` with an allocated node |
### Node-Level Operations
| Macro | Description |
|-------|-------------|
| `wapp_dbl_list_pop_front_node(type, list)` | Removes and returns the front `GenericNode*` (or `NULL`) |
| `wapp_dbl_list_pop_back_node(type, list)` | Removes and returns the back `GenericNode*` (or `NULL`) |
| `wapp_dbl_list_remove_node(type, list, index)` | Removes and returns the `GenericNode*` at `index` (or `NULL`) |
### Example ### Example