diff options
| -rw-r--r-- | docs/clist_api.md | 90 | ||||
| -rw-r--r-- | docs/cmap_api.md | 88 | ||||
| -rw-r--r-- | docs/cvec_api.md | 122 |
3 files changed, 150 insertions, 150 deletions
diff --git a/docs/clist_api.md b/docs/clist_api.md index 268fe7bd..ebb056bf 100644 --- a/docs/clist_api.md +++ b/docs/clist_api.md @@ -9,15 +9,15 @@ This describes the API of circular singly linked list type **clist**. ```c #define using_clist_str() -#define using_clist($, Value, valueDestroy=c_default_del, +#define using_clist(T, Value, valueDestroy=c_default_del, valueCompareRaw=c_default_compare, RawValue=Value, valueToRaw=c_default_to_raw, valueFromRaw=c_default_from_raw) ``` The macro `using_clist()` can be instantiated with 2, 3, 4, or 7 arguments in the global scope. -Default values are given above for args not specified. `$` is a type tag name and -will affect the names of all clist types and methods. E.g. declaring `using_clist(my, int);`, `$` should +Default values are given above for args not specified. `T` is a type tag name and +will affect the names of all clist types and methods. E.g. declaring `using_clist(my, int);`, `T` should be replaced by `my` in all of the following documentation. `using_clist_str()` is a predefined macro for `using_clist(str, cstr_t, ...)`. @@ -26,17 +26,17 @@ be replaced by `my` in all of the following documentation. | Type name | Type definition | Used to represent... | |:----------------------|:---------------------------------------|:------------------------------------| -| `clist_$` | `struct { clist_$_node_t* last; }` | The clist type | -| `clist_$_node_t` | `struct {` | clist node | -| | ` struct clist_$_node* next;` | | -| | ` clist_$_value_t value;` | | +| `clist_T` | `struct { clist_T_node_t* last; }` | The clist type | +| `clist_T_node_t` | `struct {` | clist node | +| | ` struct clist_T_node* next;` | | +| | ` clist_T_value_t value;` | | | | `}` | | -| `clist_$_value_t` | `Value` | The clist element type | -| `clist_$_input_t` | `clist_$_value_t` | clist input type | -| `clist_$_rawvalue_t` | `RawValue` | clist raw value type | -| `clist_$_iter_t` | `struct {` | clist iterator | +| `clist_T_value_t` | `Value` | The clist element type | +| `clist_T_input_t` | `clist_T_value_t` | clist input type | +| `clist_T_rawvalue_t` | `RawValue` | clist raw value type | +| `clist_T_iter_t` | `struct {` | clist iterator | | | ` ...;` | | -| | ` clist_$_value_t* val;` | | +| | ` clist_T_value_t* val;` | | | | `}` | | @@ -58,50 +58,50 @@ All clist definitions and prototypes may be included in your C source file by in ### Construction -The interfaces to create a clist_$ object: +The interfaces to create a clist_T object: ```c -clist_$ clist_$_init(void); +clist_T clist_T_init(void); -void clist_$_clear(clist_$* self); -void clist_$_del(clist_$* self); +void clist_T_clear(clist_T* self); +void clist_T_del(clist_T* self); -bool clist_$_empty(clist_$ list); -size_t clist_$_size(clist_$ list); -Value clist_$_value_from_raw(RawValue val); +bool clist_T_empty(clist_T list); +size_t clist_T_size(clist_T list); +Value clist_T_value_from_raw(RawValue val); -clist_$_value_t* clist_$_front(clist_$* self); -clist_$_value_t* clist_$_back(clist_$* self); +clist_T_value_t* clist_T_front(clist_T* self); +clist_T_value_t* clist_T_back(clist_T* self); -void clist_$_push_n(clist_$ *self, const clist_$_input_t in[], size_t size); -void clist_$_push_back(clist_$* self, Value value); -void clist_$_emplace_back(clist_$* self, RawValue val); +void clist_T_push_n(clist_T *self, const clist_T_input_t in[], size_t size); +void clist_T_push_back(clist_T* self, Value value); +void clist_T_emplace_back(clist_T* self, RawValue val); -void clist_$_push_front(clist_$* self, Value value); -void clist_$_emplace_front(clist_$* self, RawValue val); -void clist_$_pop_front(clist_$* self); +void clist_T_push_front(clist_T* self, Value value); +void clist_T_emplace_front(clist_T* self, RawValue val); +void clist_T_pop_front(clist_T* self); -clist_$_iter_t clist_$_insert_after(clist_$* self, clist_$_iter_t pos, Value val); -clist_$_iter_t clist_$_emplace_after(clist_$* self, clist_$_iter_t pos, RawValue val); +clist_T_iter_t clist_T_insert_after(clist_T* self, clist_T_iter_t pos, Value val); +clist_T_iter_t clist_T_emplace_after(clist_T* self, clist_T_iter_t pos, RawValue val); -clist_$_iter_t clist_$_erase_after(clist_$* self, clist_$_iter_t pos); -clist_$_iter_t clist_$_erase_range_after(clist_$* self, clist_$_iter_t pos, clist_$_iter_t finish); +clist_T_iter_t clist_T_erase_after(clist_T* self, clist_T_iter_t pos); +clist_T_iter_t clist_T_erase_range_after(clist_T* self, clist_T_iter_t pos, clist_T_iter_t finish); -void clist_$_splice_front(clist_$* self, clist_$* other); -void clist_$_splice_back(clist_$* self, clist_$* other); -void clist_$_splice_after(clist_$* self, clist_$_iter_t pos, clist_$* other); +void clist_T_splice_front(clist_T* self, clist_T* other); +void clist_T_splice_back(clist_T* self, clist_T* other); +void clist_T_splice_after(clist_T* self, clist_T_iter_t pos, clist_T* other); -clist_$_iter_t clist_$_find(const clist_$* self, RawValue val); -clist_$_iter_t clist_$_find_before(const clist_$* self, - clist_$_iter_t first, clist_$_iter_t finish, RawValue val); +clist_T_iter_t clist_T_find(const clist_T* self, RawValue val); +clist_T_iter_t clist_T_find_before(const clist_T* self, + clist_T_iter_t first, clist_T_iter_t finish, RawValue val); -size_t clist_$_remove(clist_$* self, RawValue val); +size_t clist_T_remove(clist_T* self, RawValue val); -void clist_$_sort(clist_$* self); +void clist_T_sort(clist_T* self); -clist_$_iter_t clist_$_before_begin(const clist_$* self); -clist_$_iter_t clist_$_begin(const clist_$* self); -clist_$_iter_t clist_$_last(const clist_$* self); -clist_$_iter_t clist_$_end(const clist_$* self); -void clist_$_next(clist_$_iter_t* it); -clist_$_value_t* clist_$_itval(clist_$_iter_t it); +clist_T_iter_t clist_T_before_begin(const clist_T* self); +clist_T_iter_t clist_T_begin(const clist_T* self); +clist_T_iter_t clist_T_last(const clist_T* self); +clist_T_iter_t clist_T_end(const clist_T* self); +void clist_T_next(clist_T_iter_t* it); +clist_T_value_t* clist_T_itval(clist_T_iter_t it); ``` diff --git a/docs/cmap_api.md b/docs/cmap_api.md index 0b9cd6a7..1f6d13ff 100644 --- a/docs/cmap_api.md +++ b/docs/cmap_api.md @@ -11,14 +11,14 @@ This describes the API of circular singly linked list type **cmap**. #define using_cmap_strkey(Mapped, mappedDestroy=c_default_del) -#define using_cmap_strval($, Key, keyEquals=c_default_equals, +#define using_cmap_strval(T, Key, keyEquals=c_default_equals, keyHash=c_default_hash16, keyDestroy=c_default_del, RawKey=Key, keyToRaw=c_default_to_raw, keyFromRaw=c_default_from_raw) -#define using_cmap($, Key, Mapped, mappedDestroy=c_default_del, +#define using_cmap(T, Key, Mapped, mappedDestroy=c_default_del, keyEqualsRaw=c_default_equals, keyHashRaw=c_default_hash16, keyDestroy=c_default_del, @@ -29,8 +29,8 @@ This describes the API of circular singly linked list type **cmap**. mappedFromRaw=c_default_from_raw) ``` The macro `using_cmap()` can be instantiated with 3, 4, 6, 10, or 12 arguments in the global scope. -Default values are given above for args not specified. `$` is a type tag name and -will affect the names of all cmap types and methods. E.g. declaring `using_cmap(my, int);`, `$` should +Default values are given above for args not specified. `T` is a type tag name and +will affect the names of all cmap types and methods. E.g. declaring `using_cmap(my, int);`, `T` should be replaced by `my` in all of the following documentation. `using_cmap_str()` is a predefined macro for `using_cmap(str, cstr_t, ...)`. @@ -39,21 +39,21 @@ be replaced by `my` in all of the following documentation. | Type name | Type definition | Used to represent... | |:---------------------|:--------------------------------------|:-----------------------------------| -| `cmap_$` | `struct {` | The cmap type | -| | ` cmap_$_value_t* table; | | +| `cmap_T` | `struct {` | The cmap type | +| | ` cmap_T_value_t* table; | | | | ` uint8_t* _hashx;` | | | | ` ...;` | | | | `}` | | -| `cmap_$_key_t` | `Key` | The cmap key type | -| `cmap_$_mapped_t` | `Mapped` | cmap mapped type | -| `cmap_$_value_t` | `struct {` | The cmap value type | -| | ` cmap_$_key_t first; | | -| | ` cmap_$_mapped_t second;` | | +| `cmap_T_key_t` | `Key` | The cmap key type | +| `cmap_T_mapped_t` | `Mapped` | cmap mapped type | +| `cmap_T_value_t` | `struct {` | The cmap value type | +| | ` cmap_T_key_t first; | | +| | ` cmap_T_mapped_t second;` | | | | `}` | | -| `cmap_$_input_t` | `cmap_$_value_t` | cmap input type | -| `cmap_$_rawvalue_t` | `RawMapped` | cmap raw value type | -| `cmap_$_iter_t` | `struct {` | cmap iterator | -| | ` cmap_$_value_t* val;` | | +| `cmap_T_input_t` | `cmap_T_value_t` | cmap input type | +| `cmap_T_rawvalue_t` | `RawMapped` | cmap raw value type | +| `cmap_T_iter_t` | `struct {` | cmap iterator | +| | ` cmap_T_value_t* val;` | | | | ` ...;` | | | | `}` | | @@ -78,45 +78,45 @@ All cmap definitions and prototypes may be included in your C source file by inc ### Construction -The interfaces to create a cmap_$ object: +The interfaces to create a cmap_T object: ```c -cmap_$ cmap_$_init(void); -cmap_$ cmap_$_with_capacity(size_t cap); -void cmap_$_set_load_factors(cmap_$* self, float max, float shrink); +cmap_T cmap_T_init(void); +cmap_T cmap_T_with_capacity(size_t cap); +void cmap_T_set_load_factors(cmap_T* self, float max, float shrink); -void cmap_$_clear(cmap_$* self); -void cmap_$_reserve(cmap_$* self, size_t size); -void cmap_$_swap(cmap_$* a, cmap_$* b); +void cmap_T_clear(cmap_T* self); +void cmap_T_reserve(cmap_T* self, size_t size); +void cmap_T_swap(cmap_T* a, cmap_T* b); -void cmap_$_del(cmap_$* self); +void cmap_T_del(cmap_T* self); -bool cmap_$_empty(cmap_$ m); -size_t cmap_$_size(cmap_$ m); -size_t cmap_$_bucket_count(cmap_$ m); -size_t cmap_$_capacity(cmap_$ m); +bool cmap_T_empty(cmap_T m); +size_t cmap_T_size(cmap_T m); +size_t cmap_T_bucket_count(cmap_T m); +size_t cmap_T_capacity(cmap_T m); -void cmap_$_push_n(cmap_$* self, const cmap_$_input_t in[], size_t size); +void cmap_T_push_n(cmap_T* self, const cmap_T_input_t in[], size_t size); -cmap_$_result_t cmap_$_emplace(cmap_$* self, RawKey rawKey RawMapped rawVal); -cmap_$_result_t cmap_$_insert(cmap_$* self, cmap_$_input_t in); -cmap_$_result_t cmap_$_insert_or_assign(cmap_$* self, RawKey rawKey, RawMapped rawVal); -cmap_$_result_t cmap_$_put(cmap_$* self, RawKey rawKey, RawMapped rawVal); -cmap_$_result_t cmap_$_putv(cmap_$* self, RawKey rawKey, Mapped mapped); -cmap_$_mapped_t* cmap_$_at(const cmap_$* self, RawKey rawKey); +cmap_T_result_t cmap_T_emplace(cmap_T* self, RawKey rawKey RawMapped rawVal); +cmap_T_result_t cmap_T_insert(cmap_T* self, cmap_T_input_t in); +cmap_T_result_t cmap_T_insert_or_assign(cmap_T* self, RawKey rawKey, RawMapped rawVal); +cmap_T_result_t cmap_T_put(cmap_T* self, RawKey rawKey, RawMapped rawVal); +cmap_T_result_t cmap_T_putv(cmap_T* self, RawKey rawKey, Mapped mapped); +cmap_T_mapped_t* cmap_T_at(const cmap_T* self, RawKey rawKey); -size_t cmap_$_erase(cmap_$* self, RawKey rawKey) -void cmap_$_erase_entry(cmap_$* self, cmap_$_value_t* val); -cmap_$_iter_t cmap_$_erase_at(cmap_$* self, cmap_$_iter_t pos); +size_t cmap_T_erase(cmap_T* self, RawKey rawKey) +void cmap_T_erase_entry(cmap_T* self, cmap_T_value_t* val); +cmap_T_iter_t cmap_T_erase_at(cmap_T* self, cmap_T_iter_t pos); -cmap_$_value_t* cmap_$_find(const cmap_$* self, RawKey rawKey); -bool cmap_$_contains(const cmap_$* self, RawKey rawKey); +cmap_T_value_t* cmap_T_find(const cmap_T* self, RawKey rawKey); +bool cmap_T_contains(const cmap_T* self, RawKey rawKey); -cmap_$_iter_t cmap_$_begin(cmap_$* self); -cmap_$_iter_t cmap_$_end(cmap_$* self) -void cmap_$_next(cmap_$_iter_t* it); -cmap_$_mapped_t* cmap_$_itval(cmap_$_iter_t it); +cmap_T_iter_t cmap_T_begin(cmap_T* self); +cmap_T_iter_t cmap_T_end(cmap_T* self) +void cmap_T_next(cmap_T_iter_t* it); +cmap_T_mapped_t* cmap_T_itval(cmap_T_iter_t it); -cmap_bucket_t cmap_$_bucket(const cmap_$* self, const cmap_$_rawkey_t* rawKeyPtr); +cmap_bucket_t cmap_T_bucket(const cmap_T* self, const cmap_T_rawkey_t* rawKeyPtr); uint32_t c_default_hash16(const void *data, size_t len); uint32_t c_default_hash32(const void* data, size_t len); diff --git a/docs/cvec_api.md b/docs/cvec_api.md index 34d055c2..b9782341 100644 --- a/docs/cvec_api.md +++ b/docs/cvec_api.md @@ -9,15 +9,15 @@ This describes the API of vector type **cvec**. ```c #define using_cvec_str() -#define using_cvec($, Value, valueDestroy=c_default_del, +#define using_cvec(T, Value, valueDestroy=c_default_del, valueCompareRaw=c_default_compare, RawValue=Value, valueToRaw=c_default_to_raw, valueFromRaw=c_default_from_raw) ``` The macro `using_cvec()` can be instantiated with 2, 3, 4, or 7 arguments in the global scope. -Defaults values are given above for args not specified. `$` is a type tag name and -will affect the names of all cvec types and methods. E.g. declaring `using_cvec(my, int);`, `$` should +Defaults values are given above for args not specified. `T` is a type tag name and +will affect the names of all cvec types and methods. E.g. declaring `using_cvec(my, int);`, `T` should be replaced by `my` in all of the following documentation. `using_cvec_str()` is a predefined macro for `using_cvec(str, cstr_t, ...)`. @@ -26,11 +26,11 @@ be replaced by `my` in all of the following documentation. | Type name | Type definition | Used to represent... | |:---------------------|:---------------------------------------|:------------------------------------| -| `cvec_$` | `struct { cvec_$_value_t* data; }` | The cvec type | -| `cvec_$_value_t` | `Value` | The cvec element type | -| `cvec_$_input_t` | `cvec_$_value_t` | cvec input type | -| `cvec_$_rawvalue_t` | `RawValue` | cvec raw value type | -| `cvec_$_iter_t` | `struct { cvec_$_value_t* val; }` | cvec iterator | +| `cvec_T` | `struct { cvec_T_value_t* data; }` | The cvec type | +| `cvec_T_value_t` | `Value` | The cvec element type | +| `cvec_T_input_t` | `cvec_T_value_t` | cvec input type | +| `cvec_T_rawvalue_t` | `RawValue` | cvec raw value type | +| `cvec_T_iter_t` | `struct { cvec_T_value_t* val; }` | cvec iterator | ## Constants and macros @@ -55,57 +55,57 @@ All cvec definitions and prototypes may be included in your C source file by inc The interface for cvec: ```c -cvec_$ cvec_$_init(void); -cvec_$ cvec_$_with_size(size_t size, Value fill_val); -cvec_$ cvec_$_with_capacity(size_t size); - -void cvec_$_clear(cvec_$* self); -void cvec_$_reserve(cvec_$* self, size_t cap); -void cvec_$_resize(cvec_$* self, size_t size, Value fill_val); -void cvec_$_swap(cvec_$* a, cvec_$* b); - -void cvec_$_del(cvec_$* self); - -bool cvec_$_empty(cvec_$ vec); -size_t cvec_$_size(cvec_$ vec); -size_t cvec_$_capacity(cvec_$ vec); -Value cvec_$_value_from_raw(RawValue val); - -cvec_$_value_t* cvec_$_at(cvec_$* self, size_t i); -cvec_$_value_t* cvec_$_front(cvec_$* self); -cvec_$_value_t* cvec_$_back(cvec_$* self); - -void cvec_$_push_n(cvec_$ *self, const cvec_$_input_t in[], size_t size); -void cvec_$_push_back(cvec_$* self, Value value); -void cvec_$_emplace_back(cvec_$* self, RawValue val); -void cvec_$_pop_back(cvec_$* self); - -cvec_$_iter_t cvec_$_insert_at(cvec_$* self, cvec_$_iter_t pos, Value value); -cvec_$_iter_t cvec_$_insert_at_idx(cvec_$* self, size_t idx, Value value); -cvec_$_iter_t cvec_$_emplace_at(cvec_$* self, cvec_$_iter_t pos, RawValue val); -cvec_$_iter_t cvec_$_emplace_at_idx(cvec_$* self, size_t idx, RawValue val); -cvec_$_iter_t cvec_$_insert_range(cvec_$* self, cvec_$_iter_t pos, - cvec_$_iter_t first, cvec_$_iter_t finish); -cvec_$_iter_t cvec_$_insert_range_p(cvec_$* self, cvec_$_value_t* pos, - const cvec_$_value_t* pfirst, const cvec_$_value_t* pfinish); - -cvec_$_iter_t cvec_$_erase_at(cvec_$* self, cvec_$_iter_t pos); -cvec_$_iter_t cvec_$_erase_at_idx(cvec_$* self, size_t idx); -cvec_$_iter_t cvec_$_erase_range(cvec_$* self, cvec_$_iter_t first, cvec_$_iter_t finish); -cvec_$_iter_t cvec_$_erase_range_p(cvec_$* self, cvec_$_value_t* first, cvec_$_value_t* finish); -cvec_$_iter_t cvec_$_erase_range_idx(cvec_$* self, size_t ifirst, size_t ifinish); - -cvec_$_iter_t cvec_$_find(const cvec_$* self, RawValue val); -cvec_$_iter_t cvec_$_find_in_range(const cvec_$* self, - cvec_$_iter_t first, cvec_$_iter_t finish, RawValue val); - -void cvec_$_sort(cvec_$* self); -void cvec_$_sort_with(cvec_$* self, size_t ifirst, size_t ifinish, - int(*cmp)(const cvec_$_value_t*, const cvec_$_value_t*)); - -cvec_$_iter_t cvec_$_begin(const cvec_$* self); -cvec_$_iter_t cvec_$_last(const cvec_$* self); -cvec_$_iter_t cvec_$_end(const cvec_$* self); -void cvec_$_next(cvec_$_iter_t* it); -cvec_$_value_t* cvec_$_itval(cvec_$_iter_t it); +cvec_T cvec_T_init(void); +cvec_T cvec_T_with_size(size_t size, Value fill_val); +cvec_T cvec_T_with_capacity(size_t size); + +void cvec_T_clear(cvec_T* self); +void cvec_T_reserve(cvec_T* self, size_t cap); +void cvec_T_resize(cvec_T* self, size_t size, Value fill_val); +void cvec_T_swap(cvec_T* a, cvec_T* b); + +void cvec_T_del(cvec_T* self); + +bool cvec_T_empty(cvec_T vec); +size_t cvec_T_size(cvec_T vec); +size_t cvec_T_capacity(cvec_T vec); +Value cvec_T_value_from_raw(RawValue val); + +cvec_T_value_t* cvec_T_at(cvec_T* self, size_t i); +cvec_T_value_t* cvec_T_front(cvec_T* self); +cvec_T_value_t* cvec_T_back(cvec_T* self); + +void cvec_T_push_n(cvec_T *self, const cvec_T_input_t in[], size_t size); +void cvec_T_push_back(cvec_T* self, Value value); +void cvec_T_emplace_back(cvec_T* self, RawValue val); +void cvec_T_pop_back(cvec_T* self); + +cvec_T_iter_t cvec_T_insert_at(cvec_T* self, cvec_T_iter_t pos, Value value); +cvec_T_iter_t cvec_T_insert_at_idx(cvec_T* self, size_t idx, Value value); +cvec_T_iter_t cvec_T_emplace_at(cvec_T* self, cvec_T_iter_t pos, RawValue val); +cvec_T_iter_t cvec_T_emplace_at_idx(cvec_T* self, size_t idx, RawValue val); +cvec_T_iter_t cvec_T_insert_range(cvec_T* self, cvec_T_iter_t pos, + cvec_T_iter_t first, cvec_T_iter_t finish); +cvec_T_iter_t cvec_T_insert_range_p(cvec_T* self, cvec_T_value_t* pos, + const cvec_T_value_t* pfirst, const cvec_T_value_t* pfinish); + +cvec_T_iter_t cvec_T_erase_at(cvec_T* self, cvec_T_iter_t pos); +cvec_T_iter_t cvec_T_erase_at_idx(cvec_T* self, size_t idx); +cvec_T_iter_t cvec_T_erase_range(cvec_T* self, cvec_T_iter_t first, cvec_T_iter_t finish); +cvec_T_iter_t cvec_T_erase_range_p(cvec_T* self, cvec_T_value_t* first, cvec_T_value_t* finish); +cvec_T_iter_t cvec_T_erase_range_idx(cvec_T* self, size_t ifirst, size_t ifinish); + +cvec_T_iter_t cvec_T_find(const cvec_T* self, RawValue val); +cvec_T_iter_t cvec_T_find_in_range(const cvec_T* self, + cvec_T_iter_t first, cvec_T_iter_t finish, RawValue val); + +void cvec_T_sort(cvec_T* self); +void cvec_T_sort_with(cvec_T* self, size_t ifirst, size_t ifinish, + int(*cmp)(const cvec_T_value_t*, const cvec_T_value_t*)); + +cvec_T_iter_t cvec_T_begin(const cvec_T* self); +cvec_T_iter_t cvec_T_last(const cvec_T* self); +cvec_T_iter_t cvec_T_end(const cvec_T* self); +void cvec_T_next(cvec_T_iter_t* it); +cvec_T_value_t* cvec_T_itval(cvec_T_iter_t it); ``` |
