diff options
| author | Tyge Løvset <[email protected]> | 2021-01-20 13:04:26 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2021-01-20 13:04:26 +0100 |
| commit | 03303cddb4181b5679b17002d1dbf619d64a556f (patch) | |
| tree | 12d89072429e3e998592b4846d9afe7c057a36c1 /docs | |
| parent | 6332a8a0db0533c7c7bb56f69064a5ce03e62b4a (diff) | |
| download | STC-modified-03303cddb4181b5679b17002d1dbf619d64a556f.tar.gz STC-modified-03303cddb4181b5679b17002d1dbf619d64a556f.zip | |
Moved types below API in docs.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/carray_api.md | 15 | ||||
| -rw-r--r-- | docs/cbits_api.md | 14 | ||||
| -rw-r--r-- | docs/cdeq_api.md | 24 | ||||
| -rw-r--r-- | docs/clist_api.md | 25 | ||||
| -rw-r--r-- | docs/cmap_api.md | 45 | ||||
| -rw-r--r-- | docs/cpque_api.md | 16 | ||||
| -rw-r--r-- | docs/cptr_api.md | 29 | ||||
| -rw-r--r-- | docs/cqueue_api.md | 18 | ||||
| -rw-r--r-- | docs/cset_api.md | 30 | ||||
| -rw-r--r-- | docs/csmap_api.md | 27 | ||||
| -rw-r--r-- | docs/csset_api.md | 25 | ||||
| -rw-r--r-- | docs/cstack_api.md | 18 | ||||
| -rw-r--r-- | docs/cstr_api.md | 30 | ||||
| -rw-r--r-- | docs/cvec_api.md | 24 |
14 files changed, 156 insertions, 184 deletions
diff --git a/docs/carray_api.md b/docs/carray_api.md index 39ecdcbd..0e4e5643 100644 --- a/docs/carray_api.md +++ b/docs/carray_api.md @@ -16,14 +16,6 @@ Default values are given above for args not specified. `X` and `N` are type tags will affect the names of all cset types and methods. E.g. declaring `using_carray(my, int);`, `X` should be replaced by `my` in all of the following documentation. The `N` character should be replaced by `1`, `2` or `3`. -## Types - -| Type name | Type definition | Used to represent... | -|:---------------------|:------------------------------|:--------------------------| -| `carrayNX` | `struct { ... }` | The carray type | -| `carrayNX_value_t` | `Value` | The value type | -| `carrayNX_iter_t` | `struct { Value *ref; }` | Iterator type | - ## Header file All carray definitions and prototypes may be included in your C source file by including a single header file. @@ -63,6 +55,13 @@ carrayNX_iter_t carrayNX_end(carrayNX* self); void carrayNX_next(carrayNX_iter_t* it); carrayNX_value_t* carrayNX_itval(carrayNX_iter_t it); ``` +## Types + +| Type name | Type definition | Used to represent... | +|:---------------------|:------------------------------|:--------------------------| +| `carrayNX` | `struct { ... }` | The carray type | +| `carrayNX_value_t` | `Value` | The value type | +| `carrayNX_iter_t` | `struct { Value *ref; }` | Iterator type | ## Example ```c diff --git a/docs/cbits_api.md b/docs/cbits_api.md index 9da2ad04..86b50f1e 100644 --- a/docs/cbits_api.md +++ b/docs/cbits_api.md @@ -5,13 +5,6 @@ A **cbits** represents a set of bits. It provides accesses to the value of indiv The **cbits** container is similar to the c++ class [std::bitset](https://en.cppreference.com/w/cpp/utility/bitset) and [boost::dynamic_bitset](https://www.boost.org/doc/libs/release/libs/dynamic_bitset/dynamic_bitset.html). -## Types - -| cbits | Type definition | Used to represent... | -|:--------------------|:--------------------------|:-----------------------------| -| `cbits` | `struct { ... }` | The cbits type | -| `cbits_iter_t` | `struct { ... }` | The cbits iterator type | - ## Header file All cstr definitions and prototypes may be included in your C source file by including a single header file. @@ -68,6 +61,13 @@ void cbits_next(cbits_iter_t* it); bool cbits_itval(cbits_iter_t it); ``` +## Types + +| cbits | Type definition | Used to represent... | +|:--------------------|:--------------------------|:-----------------------------| +| `cbits` | `struct { ... }` | The cbits type | +| `cbits_iter_t` | `struct { ... }` | The cbits iterator type | + ## Example ```c #include <stdio.h> diff --git a/docs/cdeq_api.md b/docs/cdeq_api.md index 7bc68b88..f118504a 100644 --- a/docs/cdeq_api.md +++ b/docs/cdeq_api.md @@ -24,21 +24,6 @@ be replaced by `my` in all of the following documentation. using_cdeq(str, cstr_t, cstr_compare_raw, cstr_del, cstr_from, cstr_to_raw, const char*) ``` -## Types - -| Type name | Type definition | Used to represent... | -|:---------------------|:------------------------------------|:-----------------------| -| `cdeq_X` | `struct { cdeq_X_value_t* data; }` | The cdeq type | -| `cdeq_X_value_t` | `Value` | The cdeq value type | -| `cdeq_X_rawvalue_t` | `RawValue` | The raw value type | -| `cdeq_X_iter_t` | `struct { cdeq_X_value_t* ref; }` | The iterator type | - -## Constants and macros - -| Name | Purpose | -|:---------------------------|:---------------------| -| `cdeq_inits` | Initializer constant | - ## Header file All cdeq definitions and prototypes may be included in your C source file by including a single header file. @@ -109,6 +94,15 @@ size_t cdeq_X_index(const cdeq_X deq, cdeq_X_iter_t it); cdeq_X_value_t cdeq_X_value_clone(cdeq_X_value_t val); ``` +## Types + +| Type name | Type definition | Used to represent... | +|:---------------------|:------------------------------------|:-----------------------| +| `cdeq_X` | `struct { cdeq_X_value_t* data; }` | The cdeq type | +| `cdeq_X_value_t` | `Value` | The cdeq value type | +| `cdeq_X_rawvalue_t` | `RawValue` | The raw value type | +| `cdeq_X_iter_t` | `struct { cdeq_X_value_t* ref; }` | The iterator type | + ## Examples ```c #include <stdio.h> diff --git a/docs/clist_api.md b/docs/clist_api.md index 53e3b350..702f3344 100644 --- a/docs/clist_api.md +++ b/docs/clist_api.md @@ -25,21 +25,6 @@ be replaced by `my` in all of the following documentation. `using_clist_str()` i using_clist(str, cstr_t, cstr_compare_raw, cstr_del, cstr_from, cstr_to_raw, const char*) ``` -## Types - -| Type name | Type definition | Used to represent... | -|:----------------------|:------------------------------------|:--------------------------| -| `clist_X` | `struct { clist_X_node_t* last; }` | The clist type | -| `clist_X_value_t` | `Value` | The clist element type | -| `clist_X_rawvalue_t` | `RawValue` | clist raw value type | -| `clist_X_iter_t` | `struct { clist_value_t *ref; ... }`| clist iterator | - -## Constants and macros - -| Name | Purpose | -|:---------------------------|:---------------------| -| `clist_inits` | Initializer constant | - ## Header file All clist definitions and prototypes may be included in your C source file by including a single header file. @@ -104,6 +89,16 @@ clist_X_iter_t clist_X_fwd(clist_X_iter it, size_t n); clist_X_value_t clist_X_value_clone(clist_X_value_t val); ``` + +## Types + +| Type name | Type definition | Used to represent... | +|:----------------------|:------------------------------------|:--------------------------| +| `clist_X` | `struct { clist_X_node_t* last; }` | The clist type | +| `clist_X_value_t` | `Value` | The clist element type | +| `clist_X_rawvalue_t` | `RawValue` | clist raw value type | +| `clist_X_iter_t` | `struct { clist_value_t *ref; ... }`| clist iterator | + The `clist_X_splice_out(self, it1, it2)` can be combined with `clist_X_splice_after(self, it, other)` to mimic c++ `std::forward_list::splice_after(it, other, it1, it2)`. Note however that *it2* is included in elements to be spliced, unlike with *std::forward_list()*. Example: splice in `[2, 3]` from *L1* after `10` in *L2*: ```c c_init (clist_i, L1, {1, 2, 3, 4, 5}); diff --git a/docs/cmap_api.md b/docs/cmap_api.md index a21bd732..d9b69961 100644 --- a/docs/cmap_api.md +++ b/docs/cmap_api.md @@ -33,35 +33,12 @@ Default values are given above for args not specified. `X` is a type tag name an will affect the names of all cmap types and methods. E.g. declaring `using_cmap(my, int);`, `X` should be replaced by `my` in all of the following documentation. -`c_default_hash` requires Key to be 16-bit aligned, and size to be a multiple of 16. There is also a `c_default_hash32` which is slightly faster. - `using_cmap_strkey()` and `using_cmap_strval()` are special macros defined by `using_cmap()`. The macro `using_cmap_str()` is a shorthand for ```c using_cmap(str, cstr_t, cstr_t, cstr_del, ...) // uses char* as "raw" types ``` -## Types - -| Type name | Type definition | Used to represent... | -|:---------------------|:------------------------------------------------|:------------------------------| -| `cmap_X` | `struct { ... }` | The cmap type | -| `cmap_X_rawkey_t` | `RawKey` | The raw key type | -| `cmap_X_rawmapped_t` | `RawMapped` | The raw mapped type | -| `cmap_X_key_t` | `Key` | The key type | -| `cmap_X_mapped_t` | `Mapped` | The mapped type | -| `cmap_X_value_t` | `struct { Key first; Mapped second; }` | The value type | -| `cmap_X_rawvalue_t` | `struct { RawKey first; RawMapped second; }` | RawKey + RawMapped type | -| `cmap_X_result_t` | `struct { cmap_X_value_t first; bool second; }` | Result of insert/put/emplace | -| `cmap_X_iter_t` | `struct { cmap_X_value_t *ref; ... }` | Iterator type | - -## Constants and macros - -| Name | Purpose | -|:--------------------------------------------|:-----------------------| -| `cmap_inits` | Initializer const | -| `c_try_emplace(self, ctype, rkey, mapped)` | Emplace if key exist | - ## Header file All cmap definitions and prototypes may be included in your C source file by including a single header file. @@ -115,6 +92,28 @@ uint32_t c_default_hash(const void *data, size_t len); uint32_t c_default_hash32(const void* data, size_t len); ``` +## Types + +| Type name | Type definition | Used to represent... | +|:---------------------|:------------------------------------------------|:------------------------------| +| `cmap_X` | `struct { ... }` | The cmap type | +| `cmap_X_rawkey_t` | `RawKey` | The raw key type | +| `cmap_X_rawmapped_t` | `RawMapped` | The raw mapped type | +| `cmap_X_key_t` | `Key` | The key type | +| `cmap_X_mapped_t` | `Mapped` | The mapped type | +| `cmap_X_value_t` | `struct { Key first; Mapped second; }` | The value type | +| `cmap_X_rawvalue_t` | `struct { RawKey first; RawMapped second; }` | RawKey + RawMapped type | +| `cmap_X_result_t` | `struct { cmap_X_value_t first; bool second; }` | Result of insert/put/emplace | +| `cmap_X_iter_t` | `struct { cmap_X_value_t *ref; ... }` | Iterator type | + +`c_default_hash` requires Key to be 16-bit aligned, and size to be a multiple of 16. There is also a `c_default_hash32` which is slightly faster. + +## Constants and macros + +| Name | Purpose | +|:--------------------------------------------|:-----------------------| +| `c_try_emplace(self, ctype, rkey, mapped)` | Emplace if key exist | + ## Examples ```c #include <stdio.h> diff --git a/docs/cpque_api.md b/docs/cpque_api.md index 10a40043..276f1ce3 100644 --- a/docs/cpque_api.md +++ b/docs/cpque_api.md @@ -19,14 +19,6 @@ Note that the function `{ctype}_value_compare(x, y)` defined by the underlying v compare values (priorities). `X` is a type tag name and will affect the names of all cpque types and methods. Declaring `using_cpque(my, cvec_my, >);`, `X` should be replaced by `my` in the following documentation. -## Types - -| Type name | Type definition | Used to represent... | -|:---------------------|:--------------------------------------|:------------------------| -| `cpque_X` | `struct {cpque_X_value_t* data; ...}` | The cpque type | -| `cpque_X_value_t` | Depends on underlying container type | The cpque element type | -| `cpque_X_rawvalue_t` | " | cpque raw value type | - ## Header file All cpque definitions and prototypes may be included in your C source file by including a single header file. @@ -57,6 +49,14 @@ void cpque_X_erase_at(cpque_X* self, size_t idx); cpque_X_value_t cpque_X_value_clone(cpque_X_value_t val); ``` +## Types + +| Type name | Type definition | Used to represent... | +|:---------------------|:--------------------------------------|:------------------------| +| `cpque_X` | `struct {cpque_X_value_t* data; ...}` | The cpque type | +| `cpque_X_value_t` | Depends on underlying container type | The cpque element type | +| `cpque_X_rawvalue_t` | " | cpque raw value type | + ## Example ```c #include <stdio.h> diff --git a/docs/cptr_api.md b/docs/cptr_api.md index b6ea7324..c44e08a3 100644 --- a/docs/cptr_api.md +++ b/docs/cptr_api.md @@ -22,21 +22,6 @@ affect the names of all cptr types and methods. E.g. declaring `using_cptr(my, c Note: for shared-ptr **csptr**, "cloning" is done by pointer sharing (ref counting), so *valueClone* is not required and ignored. - Types - -| Type name | Type definition | Used to represent... | -|:-------------------|:----------------------|:------------------------| -| `cptr_X` | `cptr_X_value_t *` | The cptr type | -| `cptr_X_value_t` | `Value` | The cptr element type | - - -| Type name | Type definition | Used to represent... | -|:--------------------|:--------------------------------------------------------------|:-------------------------| -| `csptr_X` | `struct { csptr_X_value_t* get; atomic_count_t* use_count; }` | The csptr type | -| `csptr_X_value_t` | `Value` | The csptr element type | -| `atomic_count_t` | `long` | The reference counter | - - ## Header file All cptr definitions and prototypes may be included in your C source file by including a single header file. @@ -64,6 +49,20 @@ void csptr_X_del(csptr_X* self); int csptr_X_compare(csptr_X* x, csptr_X* y); ``` +## Types + +| Type name | Type definition | Used to represent... | +|:-------------------|:----------------------|:------------------------| +| `cptr_X` | `cptr_X_value_t *` | The cptr type | +| `cptr_X_value_t` | `Value` | The cptr element type | + + +| Type name | Type definition | Used to represent... | +|:--------------------|:--------------------------------------------------------------|:-------------------------| +| `csptr_X` | `struct { csptr_X_value_t* get; atomic_count_t* use_count; }` | The csptr type | +| `csptr_X_value_t` | `Value` | The csptr element type | +| `atomic_count_t` | `long` | The reference counter | + ## Example This example shows three different ways to store struct Person in vectors: 1) `cvec<Person>`, 2) `cvec<Person *>`, and 3) `cvec<csptr<Person>>`. diff --git a/docs/cqueue_api.md b/docs/cqueue_api.md index 96b46c64..8e200b36 100644 --- a/docs/cqueue_api.md +++ b/docs/cqueue_api.md @@ -14,15 +14,6 @@ a **cdeq_X** or **clist_X** type as underlying implementation, given as `ctype`. will affect the names of all cqueue types and methods. E.g. declaring `using_cqueue(my, clist_my);`, `X` should be replaced by `my` in all of the following documentation. -## Types - -| Type name | Type definition | Used to represent... | -|:----------------------|:---------------------------------------|:-------------------------| -| `cqueue_X` | Depends on underlying container type | The cqueue type | -| `cqueue_X_value_t` | " | The cqueue element type | -| `cqueue_X_rawvalue_t` | " | cqueue raw value type | -| `cqueue_X_iter_t` | " | cqueue iterator | - ## Header file All cqueue definitions and prototypes may be included in your C source file by including a single header file. @@ -56,6 +47,15 @@ cqueue_X_value_t* cqueue_X_itval(cqueue_X_iter_t it); cqueue_X_value_t cqueue_X_value_clone(cqueue_X_value_t val); ``` +## Types + +| Type name | Type definition | Used to represent... | +|:----------------------|:---------------------------------------|:-------------------------| +| `cqueue_X` | Depends on underlying container type | The cqueue type | +| `cqueue_X_value_t` | " | The cqueue element type | +| `cqueue_X_rawvalue_t` | " | cqueue raw value type | +| `cqueue_X_iter_t` | " | cqueue iterator | + ## Examples ```c #include <stdio.h> diff --git a/docs/cset_api.md b/docs/cset_api.md index 4fe694e7..67bc4f92 100644 --- a/docs/cset_api.md +++ b/docs/cset_api.md @@ -21,24 +21,6 @@ be replaced by `my` in all of the following documentation. `using_cset_str()` is a predefined macro for `using_cset(str, cstr_t, ...)`.
-## Types
-
-| Type name | Type definition | Used to represent... |
-|:---------------------|:--------------------------------------|:-------------------------|
-| `cset_X` | `struct { ... }` | The cset type |
-| `cset_X_rawkey_t` | `RawKey` | The raw key type |
-| `cset_X_rawvalue_t` | `cset_X_rawkey_t` | The raw key type |
-| `cset_X_key_t` | `Key` | The key type |
-| `cset_X_value_t` | `cset_X_key_t` | The value type |
-| `cset_X_result_t` | `struct { Key first; bool second; }` | Result of insert/emplace |
-| `cset_X_iter_t` | `struct { cset_X_value_t *ref; ... }` | Iterator type |
-
-## Constants and macros
-
-| Name | Purpose |
-|:------------------------------------------------|:-------------------------|
-| `cset_inits` | Initializer const |
-
## Header file
All cset definitions and prototypes may be included in your C source file by including a single header file.
@@ -88,6 +70,18 @@ uint32_t c_default_hash(const void *data, size_t len); uint32_t c_default_hash32(const void* data, size_t len);
```
+## Types
+
+| Type name | Type definition | Used to represent... |
+|:---------------------|:--------------------------------------|:-------------------------|
+| `cset_X` | `struct { ... }` | The cset type |
+| `cset_X_rawkey_t` | `RawKey` | The raw key type |
+| `cset_X_rawvalue_t` | `cset_X_rawkey_t` | The raw key type |
+| `cset_X_key_t` | `Key` | The key type |
+| `cset_X_value_t` | `cset_X_key_t` | The value type |
+| `cset_X_result_t` | `struct { Key first; bool second; }` | Result of insert/emplace |
+| `cset_X_iter_t` | `struct { cset_X_value_t *ref; ... }` | Iterator type |
+
## Example
```c
#include <stdio.h>
diff --git a/docs/csmap_api.md b/docs/csmap_api.md index 9259df62..db876ad6 100644 --- a/docs/csmap_api.md +++ b/docs/csmap_api.md @@ -36,20 +36,6 @@ be replaced by `my` in all of the following documentation. using_csmap(str, cstr_t, cstr_t, cstr_compare_raw, cstr_del, cstr_from, ...) ``` -## Types - -| Type name | Type definition | Used to represent... | -|:----------------------|:------------------------------------------------ |:-----------------------------| -| `csmap_X` | `struct { ... }` | The csmap type | -| `csmap_X_rawkey_t` | `RawKey` | The raw key type | -| `csmap_X_rawmapped_t` | `RawMapped` | The raw mapped type | -| `csmap_X_key_t` | `Key` | The key type | -| `csmap_X_mapped_t` | `Mapped` | The mapped type | -| `csmap_X_value_t` | `struct { Key first; Mapped second; }` | The value type | -| `csmap_X_rawvalue_t` | `struct { RawKey first; RawMapped second; }` | RawKey + RawVal type | -| `csmap_X_result_t` | `struct { csmap_X_value_t first; bool second; }` | Result of insert/put/emplace | -| `csmap_X_iter_t` | `struct { csmap_X_value_t *ref; ... }` | Iterator type | - ## Header file All csmap definitions and prototypes may be included in your C source file by including a single header file. @@ -93,6 +79,19 @@ csmap_X_mapped_t* csmap_X_itval(csmap_X_iter_t it); csmap_X_value_t csmap_X_value_clone(csmap_X_value_t val); void csmap_X_value_del(csmap_X_value_t* val); ``` +## Types + +| Type name | Type definition | Used to represent... | +|:----------------------|:------------------------------------------------ |:-----------------------------| +| `csmap_X` | `struct { ... }` | The csmap type | +| `csmap_X_rawkey_t` | `RawKey` | The raw key type | +| `csmap_X_rawmapped_t` | `RawMapped` | The raw mapped type | +| `csmap_X_key_t` | `Key` | The key type | +| `csmap_X_mapped_t` | `Mapped` | The mapped type | +| `csmap_X_value_t` | `struct { Key first; Mapped second; }` | The value type | +| `csmap_X_rawvalue_t` | `struct { RawKey first; RawMapped second; }` | RawKey + RawVal type | +| `csmap_X_result_t` | `struct { csmap_X_value_t first; bool second; }` | Result of insert/put/emplace | +| `csmap_X_iter_t` | `struct { csmap_X_value_t *ref; ... }` | Iterator type | ## Examples ```c diff --git a/docs/csset_api.md b/docs/csset_api.md index 23510763..4aded6a8 100644 --- a/docs/csset_api.md +++ b/docs/csset_api.md @@ -20,19 +20,6 @@ be replaced by `my` in all of the following documentation. `using_csset_str()` is a predefined macro for `using_csset(str, cstr_t, ...)`.
-## Types
-
-| Type name | Type definition | Used to represent... |
-|:---------------------|:---------------------------------------|:-------------------------|
-| `csset_X` | `struct { ... }` | The csset type |
-| `csset_X_rawkey_t` | `RawKey` | The raw key type |
-| `csset_X_rawvalue_t` | `csset_X_rawkey_t` | The raw key type |
-| `csset_X_key_t` | `Key` | The key type |
-| `csset_X_value_t` | `csset_X_key_t` | The value type |
-| `csset_X_result_t` | `struct { Key first; bool second; }` | Result of insert/emplace |
-| `csset_X_iter_t` | `struct { csset_X_value_t *ref; ... }` | Iterator type |
-
-
## Header file
All csset definitions and prototypes may be included in your C source file by including a single header file.
@@ -73,6 +60,18 @@ csset_X_value_t csset_X_value_clone(csset_X_value_t val); void csset_X_value_del(csset_X_value_t* val);
```
+## Types
+
+| Type name | Type definition | Used to represent... |
+|:---------------------|:---------------------------------------|:-------------------------|
+| `csset_X` | `struct { ... }` | The csset type |
+| `csset_X_rawkey_t` | `RawKey` | The raw key type |
+| `csset_X_rawvalue_t` | `csset_X_rawkey_t` | The raw key type |
+| `csset_X_key_t` | `Key` | The key type |
+| `csset_X_value_t` | `csset_X_key_t` | The value type |
+| `csset_X_result_t` | `struct { Key first; bool second; }` | Result of insert/emplace |
+| `csset_X_iter_t` | `struct { csset_X_value_t *ref; ... }` | Iterator type |
+
## Example
```c
#include <stdio.h>
diff --git a/docs/cstack_api.md b/docs/cstack_api.md index 5a2516b8..b32e9dc5 100644 --- a/docs/cstack_api.md +++ b/docs/cstack_api.md @@ -14,15 +14,6 @@ a **cvec_X** or **cdeq_X** type as underlying implementation, given as `ctype`. affect the names of all cstack types and methods. E.g. declaring `using_cstack(my, cvec_my);`, `X` should be replaced by `my` in all of the following documentation. -## Types - -| Type name | Type definition | Used to represent... | -|:----------------------|:---------------------------------------|:----------------------------| -| `cstack_X` | Depends on underlying container type | The cstack type | -| `cstack_X_value_t` | " | The cstack element type | -| `cstack_X_rawvalue_t` | " | cstack raw value type | -| `cstack_X_iter_t` | " | cstack iterator | - ## Header file All cstack definitions and prototypes may be included in your C source file by including a single header file. @@ -55,6 +46,15 @@ cstack_X_value_t* cstack_X_itval(cstack_X_iter_t it); cstack_X_value_t cstack_X_value_clone(cstack_X_value_t val); ``` +## Types + +| Type name | Type definition | Used to represent... | +|:----------------------|:---------------------------------------|:----------------------------| +| `cstack_X` | Depends on underlying container type | The cstack type | +| `cstack_X_value_t` | " | The cstack element type | +| `cstack_X_rawvalue_t` | " | cstack raw value type | +| `cstack_X_iter_t` | " | cstack iterator | + ## Example ```c #include <stdio.h> diff --git a/docs/cstr_api.md b/docs/cstr_api.md index 2ecec8ef..cab7aa3b 100644 --- a/docs/cstr_api.md +++ b/docs/cstr_api.md @@ -4,21 +4,6 @@ This describes the API of string type **cstr**. See [std::basic_string](https://en.cppreference.com/w/cpp/string/basic_string) for a similar c++ class. -## Types - -| Type name | Type definition | Used to represent... | -|:------------------|:---------------------------------|:-------------------------| -| `cstr, cstr_t` | `struct { const char *str; }` | The string type | -| `cstr_value_t` | `char` | The string element type | -| `cstr_iter_t` | `struct { cstr_value_t *ref; }` | cstr iterator | - -## Constants and macros - -| Name | Value | -|:------------------|:-----------------| -| `cstr_inits` | `{...}` | -| `cstr_npos` | `-1ull` | - ## Header file All cstr definitions and prototypes may be included in your C source file by including a single header file. @@ -118,6 +103,21 @@ Iterator methods, typically used via the general *c_foreach* macro. ``` Helper methods, used by other container types. +## Types + +| Type name | Type definition | Used to represent... | +|:------------------|:---------------------------------|:-------------------------| +| `cstr, cstr_t` | `struct { const char *str; }` | The string type | +| `cstr_value_t` | `char` | The string element type | +| `cstr_iter_t` | `struct { cstr_value_t *ref; }` | cstr iterator | + +## Constants and macros + +| Name | Value | +|:------------------|:-----------------| +| `cstr_inits` | `{...}` | +| `cstr_npos` | `-1ull` | + ## Example ```c #include <stc/cstr.h> diff --git a/docs/cvec_api.md b/docs/cvec_api.md index b19cf436..23083920 100644 --- a/docs/cvec_api.md +++ b/docs/cvec_api.md @@ -28,21 +28,6 @@ be replaced by `my` in all of the following documentation. using_cvec(str, cstr_t, cstr_compare_raw, cstr_del, cstr_from, cstr_to_raw, const char*) ``` -## Types - -| Type name | Type definition | Used to represent... | -|:---------------------|:------------------------------------|:-----------------------| -| `cvec_X` | `struct { cvec_X_value_t* data; }` | The cvec type | -| `cvec_X_value_t` | `Value` | The cvec value type | -| `cvec_X_rawvalue_t` | `RawValue` | The raw value type | -| `cvec_X_iter_t` | `struct { cvec_X_value_t* ref; }` | The iterator type | - -## Constants and macros - -| Name | Purpose | -|:---------------------------|:---------------------| -| `cvec_inits` | Initializer constant | - ## Header file All cvec definitions and prototypes may be included in your C source file by including a single header file. @@ -110,6 +95,15 @@ size_t cvec_X_index(const cvec_X vec, cvec_X_iter_t it); cvec_X_value_t cvec_X_value_clone(cvec_X_value_t val); ``` +## Types + +| Type name | Type definition | Used to represent... | +|:---------------------|:------------------------------------|:-----------------------| +| `cvec_X` | `struct { cvec_X_value_t* data; }` | The cvec type | +| `cvec_X_value_t` | `Value` | The cvec value type | +| `cvec_X_rawvalue_t` | `RawValue` | The raw value type | +| `cvec_X_iter_t` | `struct { cvec_X_value_t* ref; }` | The iterator type | + ## Examples ```c #include <stdio.h> |
