From 16df3be369823c66cc8de70c282260844d67eb8f Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 10 May 2026 16:03:30 +0100 Subject: [PATCH] Update doubly linked list doc --- base/Home.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/base/Home.md b/base/Home.md index 3cff8b2..57b2e4a 100644 --- a/base/Home.md +++ b/base/Home.md @@ -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_item(type, node)` | Returns pointer to the item in a node | -### Mutation +### Mutation (stack-allocated nodes) | 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_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