diff options
| author | Tyge Løvset <[email protected]> | 2020-11-30 15:37:45 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2020-11-30 15:37:45 +0100 |
| commit | 7f2b2054cabdc3fac698f14dd4f3e1498d295119 (patch) | |
| tree | 64b297ea7ed4b076a85a15b32798c0515823b828 /docs | |
| parent | 479c68a7946e5a07648ff2d716f4f61837f595d1 (diff) | |
| download | STC-modified-7f2b2054cabdc3fac698f14dd4f3e1498d295119.tar.gz STC-modified-7f2b2054cabdc3fac698f14dd4f3e1498d295119.zip | |
Fixed cvec docs.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/clist_api.md | 22 | ||||
| -rw-r--r-- | docs/cvec_api.md | 37 |
2 files changed, 31 insertions, 28 deletions
diff --git a/docs/clist_api.md b/docs/clist_api.md index 5d6f789d..9ade0bf1 100644 --- a/docs/clist_api.md +++ b/docs/clist_api.md @@ -10,15 +10,15 @@ This describes the API of circular singly linked list type **clist**. #define using_clist_str() #define using_clist(z, Value, valueDestroy=c_default_del, - valueCompareRaw=c_default_compare, - RawValue=Value, - valueToRaw=c_default_to_raw, - valueFromRaw=c_default_from_raw) + 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. Defaults are given above for args not specified. Note that `z` can be any name, it's a tag and will affect the names of all clist types and methods, e.g. for `using_clist(my, int);` `_z` should be replaced by `_my` in all the following documentation. -`using_clist_str()` is a predefined macro for `clist_using(str, cstr_t, ...)`. +`using_clist_str()` is a predefined macro for `using_clist(str, cstr_t, ...)`. ## Types @@ -33,9 +33,8 @@ e.g. for `using_clist(my, int);` `_z` should be replaced by `_my` in all the fol | `clist_z_input_t` | `clist_z_value_t` | clist input type | | `clist_z_rawvalue_t` | `RawValue` | clist raw value type | | `clist_z_iter_t` | `struct {` | clist iterator | -| | ` clist_z_node_t* const* _...;` | | +| | ` ...;` | | | | ` clist_z_value_t* val;` | | -| | ` int _...;` | | | | `}` | | @@ -68,6 +67,9 @@ bool clist_z_empty(clist_z list); size_t clist_z_size(clist_z list); Value clist_z_value_from_raw(RawValue val); +clist_z_value_t* clist_z_front(clist_z* self); +clist_z_value_t* clist_z_back(clist_z* self); + void clist_z_push_n(clist_z *self, const clist_z_input_t in[], size_t size); void clist_z_push_back(clist_z* self, Value value); void clist_z_emplace_back(clist_z* self, RawValue val); @@ -87,15 +89,13 @@ void clist_z_splice_back(clist_z* self, clist_z* other); void clist_z_splice_after(clist_z* self, clist_z_iter_t pos, clist_z* other); clist_z_iter_t clist_z_find(const clist_z* self, RawValue val); -clist_z_iter_t clist_z_find_before(const clist_z* self, clist_z_iter_t first, clist_z_iter_t finish, RawValue val); +clist_z_iter_t clist_z_find_before(const clist_z* self, + clist_z_iter_t first, clist_z_iter_t finish, RawValue val); size_t clist_z_remove(clist_z* self, RawValue val); void clist_z_sort(clist_z* self); -Value* clist_z_front(clist_z* self); -Value* clist_z_back(clist_z* self); - clist_z_iter_t clist_z_before_begin(const clist_z* self); clist_z_iter_t clist_z_begin(const clist_z* self); clist_z_iter_t clist_z_last(const clist_z* self); diff --git a/docs/cvec_api.md b/docs/cvec_api.md index 44e09de5..38e0b915 100644 --- a/docs/cvec_api.md +++ b/docs/cvec_api.md @@ -18,17 +18,17 @@ This describes the API of vector type **cvec**. The macro `using_cvec()` can be instantiated with 2, 3, 4, or 7 arguments. Defaults are given above for args not specified. Note that `z` can be any name, it's a tag and will affect the names of all cvec types and methods, e.g. for `using_cvec(my, int);` `_z` should be replaced by `_my` in all the following documentation. -`using_cvec_str()` is a predefined macro for `cvec_using(str, cstr_t, ...)`. +`using_cvec_str()` is a predefined macro for `using_cvec(str, cstr_t, ...)`. ## Types -| Type name | Type definition | Used to represent... | -|:---------------------|:------------------------------------- --|:------------------------------------| -| `cvec_z` | `struct { cvec_z_value_t* data; }` | The cvec type | -| `cvec_z_value_t` | `Value` | The cvec element type | -| `cvec_z_input_t` | `cvec_z_value_t` | cvec input type | -| `cvec_z_rawvalue_t` | `RawValue` | cvec raw value type | -| `cvec_z_iter_t` | `struct { cvec_z_value_t* val; }` | cvec iterator | +| Type name | Type definition | Used to represent... | +|:---------------------|:---------------------------------------|:------------------------------------| +| `cvec_z` | `struct { cvec_z_value_t* data; }` | The cvec type | +| `cvec_z_value_t` | `Value` | The cvec element type | +| `cvec_z_input_t` | `cvec_z_value_t` | cvec input type | +| `cvec_z_rawvalue_t` | `RawValue` | cvec raw value type | +| `cvec_z_iter_t` | `struct { cvec_z_value_t* val; }` | cvec iterator | ## Constants and macros @@ -68,13 +68,19 @@ size_t cvec_z_size(cvec_z vec); size_t cvec_z_capacity(cvec_z vec); Value cvec_z_value_from_raw(RawValue val); +cvec_z_value_t* cvec_z_at(cvec_z* self, size_t i); +cvec_z_value_t* cvec_z_front(cvec_z* self); +cvec_z_value_t* cvec_z_back(cvec_z* self); + void cvec_z_push_n(cvec_z *self, const cvec_z_input_t in[], size_t size); void cvec_z_push_back(cvec_z* self, Value value); void cvec_z_emplace_back(cvec_z* self, RawValue val); void cvec_z_pop_back(cvec_z* self); -cvec_z_iter_t cvec_z_insert_range(cvec_z* self, cvec_z_iter_t pos, cvec_z_iter_t first, cvec_z_iter_t finish); -cvec_z_iter_t cvec_z_insert_range_p(cvec_z* self, cvec_z_value_t* pos, const cvec_z_value_t* pfirst, const cvec_z_value_t* pfinish); +cvec_z_iter_t cvec_z_insert_range(cvec_z* self, cvec_z_iter_t pos, + cvec_z_iter_t first, cvec_z_iter_t finish); +cvec_z_iter_t cvec_z_insert_range_p(cvec_z* self, cvec_z_value_t* pos, + const cvec_z_value_t* pfirst, const cvec_z_value_t* pfinish); cvec_z_iter_t cvec_z_insert_at(cvec_z* self, cvec_z_iter_t pos, Value value); cvec_z_iter_t cvec_z_insert_at_idx(cvec_z* self, size_t idx, Value value); cvec_z_iter_t cvec_z_emplace_at(cvec_z* self, cvec_z_iter_t pos, RawValue val); @@ -87,15 +93,12 @@ cvec_z_iter_t cvec_z_erase_at_idx(cvec_z* self, size_t idx); cvec_z_iter_t cvec_z_erase_range_idx(cvec_z* self, size_t ifirst, size_t ifinish); cvec_z_iter_t cvec_z_find(const cvec_z* self, RawValue val); -cvec_z_iter_t cvec_z_find_in_range(const cvec_z* self, cvec_z_iter_t first, cvec_z_iter_t finish, RawValue val); - -cvec_z_value_t* cvec_z_at(cvec_z* self, size_t i); +cvec_z_iter_t cvec_z_find_in_range(const cvec_z* self, + cvec_z_iter_t first, cvec_z_iter_t finish, RawValue val); void cvec_z_sort(cvec_z* self); -void cvec_z_sort_with(cvec_z* self, size_t ifirst, size_t ifinish, int(*cmp)(const cvec_z_value_t*, const cvec_z_value_t*)); - -Value* cvec_z_front(cvec_z* self); -Value* cvec_z_back(cvec_z* self); +void cvec_z_sort_with(cvec_z* self, size_t ifirst, size_t ifinish, + int(*cmp)(const cvec_z_value_t*, const cvec_z_value_t*)); cvec_z_iter_t cvec_z_begin(const cvec_z* self); cvec_z_iter_t cvec_z_last(const cvec_z* self); |
