From c4ae61de5be08e719e3183f4e2d1115c11856796 Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Fri, 17 Feb 2023 10:21:30 +0100 Subject: Improved clist: 1) added clist_X_sort_with(self, cmp) - custom compare func. 2) shortened mergesort function. --- docs/clist_api.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'docs/clist_api.md') diff --git a/docs/clist_api.md b/docs/clist_api.md index 45721f8d..929931af 100644 --- a/docs/clist_api.md +++ b/docs/clist_api.md @@ -79,8 +79,9 @@ clist_X_iter clist_X_find_in(clist_X_iter it1, clist_X_iter it2, i_valraw const i_val* clist_X_get(const clist_X* self, i_valraw raw); i_val* clist_X_get_mut(clist_X* self, i_valraw raw); -void clist_X_sort(clist_X* self); // needs i_extern once void clist_X_reverse(clist_X* self); +void clist_X_sort(clist_X* self); // needs i_extern defined +void clist_X_sort_with(clist_X* self, int(*cmp)(const clist_X_node*, const clist_X_node*)); // Node API clist_X_node* clist_X_get_node(clist_X_value* val); // get the enclosing node @@ -100,12 +101,13 @@ clist_X_value clist_X_value_clone(clist_X_value val); ## Types -| Type name | Type definition | Used to represent... | -|:--------------------|:------------------------------------|:--------------------------| -| `clist_X` | `struct { clist_X_node* last; }` | The clist type | -| `clist_X_value` | `i_val` | The clist element type | -| `clist_X_raw` | `i_valraw` | clist raw value type | -| `clist_X_iter` | `struct { clist_value *ref; ... }` | clist iterator | +| Type name | Type definition | Used to represent... | +|:--------------------|:------------------------------------|:-----------------------------------------| +| `clist_X` | `struct { clist_X_node* last; }` | The clist type | +| `clist_X_node` | `struct { clist_X_node* next; clist_X_value value; }` | The clist node type | +| `clist_X_value` | `i_val` | The clist element type | +| `clist_X_raw` | `i_valraw` | clist raw value type | +| `clist_X_iter` | `struct { clist_value *ref; ... }` | clist iterator | ## Example -- cgit v1.2.3