diff options
| -rw-r--r-- | docs/carray_api.md | 8 | ||||
| -rw-r--r-- | docs/cbits_api.md | 14 | ||||
| -rw-r--r-- | docs/cdeq_api.md | 11 | ||||
| -rw-r--r-- | docs/clist_api.md | 13 | ||||
| -rw-r--r-- | docs/cmap_api.md | 13 | ||||
| -rw-r--r-- | docs/cpque_api.md | 12 | ||||
| -rw-r--r-- | docs/cptr_api.md | 12 | ||||
| -rw-r--r-- | docs/cqueue_api.md | 12 | ||||
| -rw-r--r-- | docs/cset_api.md | 24 | ||||
| -rw-r--r-- | docs/csmap_api.md | 11 | ||||
| -rw-r--r-- | docs/csset_api.md | 16 | ||||
| -rw-r--r-- | docs/cstack_api.md | 12 | ||||
| -rw-r--r-- | docs/cvec_api.md | 13 |
13 files changed, 54 insertions, 117 deletions
diff --git a/docs/carray_api.md b/docs/carray_api.md index 36cb3950..5d260129 100644 --- a/docs/carray_api.md +++ b/docs/carray_api.md @@ -8,9 +8,11 @@ the same property of storing data in one block of memory, which can be passed to See the c++ class [boost::multi_array](https://www.boost.org/doc/libs/release/libs/multi_array) for similar functionality. -## Declaration +## Header file and declaration ```c +#include <stc/carray.h> + using_carray2(X, Value); using_carray2(X, Value, valueDel, valueClone); using_carray3(X, Value); @@ -20,10 +22,6 @@ The macro `using_carray2()` must be instantiated in the global scope. `X` and `N will affect the names of all cset types and methods. E.g. declaring `using_carray3(i, int);`, `X` should be replaced by `i` in all of the following documentation. -## Header file - -All carray definitions and prototypes are available by including a single header file. - ```c #include <stc/carray.h> ``` diff --git a/docs/cbits_api.md b/docs/cbits_api.md index 80a20c6f..86a91e1b 100644 --- a/docs/cbits_api.md +++ b/docs/cbits_api.md @@ -27,16 +27,16 @@ void cbits_resize(cbits* self, size_t size, bool value); void cbits_del(cbits* self); cbits* cbits_assign(cbits* self, cbits other); -cbits* cbits_take(cbits* self, cbits other); -cbits cbits_move(cbits* self); +cbits* cbits_take(cbits* self, cbits other); // give other to self +cbits cbits_move(cbits* self); // transfer self to caller size_t cbits_size(cbits set); -size_t cbits_count(cbits set); +size_t cbits_count(cbits set); // count number of bits set bool cbits_test(cbits set, size_t i); -bool cbits_at(cbits set, size_t i); // same as cbits_test() -bool cbits_is_subset(cbits set, cbits other); -bool cbits_is_disjoint(cbits set, cbits other); +bool cbits_at(cbits set, size_t i); // same as cbits_test() +bool cbits_is_subset(cbits set, cbits other); // is set a subset of other? +bool cbits_is_disjoint(cbits set, cbits other); // xor test char* cbits_to_str(cbits set, char* str, size_t start, intptr_t stop); void cbits_set(cbits *self, size_t i); @@ -49,7 +49,7 @@ void cbits_flip_all(cbits *self); void cbits_intersect(cbits *self, cbits other); void cbits_union(cbits *self, cbits other); -void cbits_xor(cbits *self, cbits other); +void cbits_xor(cbits *self, cbits other); // set of disjoint bits ``` ## Types diff --git a/docs/cdeq_api.md b/docs/cdeq_api.md index 4422655c..a5920c6d 100644 --- a/docs/cdeq_api.md +++ b/docs/cdeq_api.md @@ -5,9 +5,11 @@ A **cdeq** is an indexed sequence container that allows fast insertion and delet See the c++ class [std::deque](https://en.cppreference.com/w/cpp/container/deque) for a functional description. -## Declaration +## Header file and declaration ```c +#include <stc/cdeq.h> + using_cdeq(X, Value); using_cdeq(X, Value, valueCompare); using_cdeq(X, Value, valueCompare, valueDel, valueClone); @@ -24,13 +26,6 @@ be replaced by `i` in all of the following documentation. using_cdeq(str, cstr, cstr_compare_raw, cstr_del, cstr_from, cstr_c_str, const char*) ``` -## Header file - -All cdeq definitions and prototypes are available by including a single header file. - -```c -#include <stc/cdeq.h> -``` ## Methods ```c diff --git a/docs/clist_api.md b/docs/clist_api.md index 4114eeb6..afc20fdf 100644 --- a/docs/clist_api.md +++ b/docs/clist_api.md @@ -14,15 +14,17 @@ however computed in **O**(*n*) time. See the c++ class [std::forward_list](https://en.cppreference.com/w/cpp/container/forward_list) for a functional description. -## Declaration +## Header file and declaration ```c +#include <stc/clist.h> + using_clist(X, Value); using_clist(X, Value, valueCompare); using_clist(X, Value, valueCompare, valueDel, valueClone); using_clist(X, Value, valueCompareRaw, valueDel, valueFromRaw, valueToRaw, RawValue); -using_clist_str() +using_clist_str() // using_clist(str, cstr, ...) ``` The macro `using_clist()` must be instantiated in the global scope. `X` is a type tag name and will affect the names of all clist types and methods. E.g. declaring `using_clist(i, int);`, `X` should @@ -31,13 +33,6 @@ be replaced by `i` in all of the following documentation. `using_clist_str()` is using_clist(str, cstr, cstr_compare_raw, cstr_del, cstr_from, cstr_c_str, const char*) ``` -## Header file - -All clist definitions and prototypes are available by including a single header file. - -```c -#include <stc/clist.h> -``` ## Methods ```c diff --git a/docs/cmap_api.md b/docs/cmap_api.md index 7fccbc46..9c5bcf48 100644 --- a/docs/cmap_api.md +++ b/docs/cmap_api.md @@ -6,9 +6,11 @@ and removal of elements have average constant-time complexity. Internally, the e See the c++ class [std::unordered_map](https://en.cppreference.com/w/cpp/container/unordered_map) for a functional description. -## Declaration +## Header file and declaration ```c +#include <stc/cmap.h> + using_cmap(X, Key, Mapped); using_cmap(X, Key, Mapped, keyEquals, keyHash); using_cmap(X, Key, Mapped, keyEquals, keyHash, mappedDel, mappedClone); @@ -33,13 +35,6 @@ The `using_cmap()` macro family must be instantiated in the global scope. `X` is will affect the names of all cmap types and methods. E.g. declaring `using_cmap(ii, int, int);`, `X` should be replaced by `ii` in all of the following documentation. -## Header file - -All cmap definitions and prototypes are available by including a single header file. - -```c -#include <stc/cmap.h> -``` ## Methods ```c @@ -48,7 +43,7 @@ cmap_X cmap_X_with_capacity(size_t cap); cmap_X cmap_X_clone(cmap_x map); void cmap_X_clear(cmap_X* self); -void cmap_X_set_load_factors(cmap_X* self, float min_load, float max_load); +void cmap_X_set_load_factors(cmap_X* self, float min_load, float max_load); // default: 0.15, 0.85 void cmap_X_reserve(cmap_X* self, size_t size); void cmap_X_swap(cmap_X* a, cmap_X* b); void cmap_X_del(cmap_X* self); // destructor diff --git a/docs/cpque_api.md b/docs/cpque_api.md index 44f35b22..e2439c56 100644 --- a/docs/cpque_api.md +++ b/docs/cpque_api.md @@ -5,9 +5,11 @@ A user-provided argument `<`or `>` must be supplied to set the ordering, e.g. us See the c++ class [std::priority_queue](https://en.cppreference.com/w/cpp/container/priority_queue) for a functional reference. -## Declaration +## Header file and declaration ```c +#include <stc/cpque.h> + using_cpque(X, ctype, direction) ``` The macro `using_cpque()` must be instantiated in the global scope. **cpque** uses normally **cvec_X** @@ -18,14 +20,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(i, cvec_i, >)`, `X` should be replaced by `i` in the following documentation. -## Header file - -All cpque definitions and prototypes are available by including a single header file. - -```c -#include <stc/cpque.h> -``` - ## Methods ```c diff --git a/docs/cptr_api.md b/docs/cptr_api.md index 4ef2e443..3583bc62 100644 --- a/docs/cptr_api.md +++ b/docs/cptr_api.md @@ -6,9 +6,11 @@ The pointed-to elements are automatically destructed and deleted when the contai See the c++ classes [std::shared_ptr](https://en.cppreference.com/w/cpp/memory/shared_ptr) for a functional reference. -## Declaration +## Header file and declaration ```c +#include <stc/cptr.h> + using_cptr(X, Value); using_cptr(X, Value, valueCompare); using_cptr(X, Value, valueCompare, valueDel); @@ -21,14 +23,6 @@ The macro `using_cptr()` must be instantiated in the global scope. `X` is a type affect the names of all cptr types and methods. E.g. declaring `using_cptr(v4, Vec4);`, `X` should be replaced by `v4` in all of the following documentation. -## Header file - -All cptr and csptr definitions and prototypes are available by including a single header file. - -```c -#include <stc/cptr.h> -``` - ## Methods The *del()* and *compare()* methods are defined based on the arguments passed to the **using**-macro. For **csptr**, use *csptr_X_clone(p)* when sharing ownership of the pointed-to object. See examples below. diff --git a/docs/cqueue_api.md b/docs/cqueue_api.md index b1ce475a..a99f7176 100644 --- a/docs/cqueue_api.md +++ b/docs/cqueue_api.md @@ -5,8 +5,10 @@ The **cqueue** is container adapter that gives the programmer the functionality See the c++ class [std::queue](https://en.cppreference.com/w/cpp/container/queue) for a functional reference. -## Declaration +## Header file and declaration ```c +#include <stc/cqueue.h> /* includes default underlying implementation header cdeq.h */ + using_cqueue(X, ctype) ``` The macro `using_cqueue()` must be instantiated in the global scope. **cqueue** uses normally @@ -14,14 +16,6 @@ a **cdeq_X** or **clist_X** type as underlying implementation, given as `ctype`. `X` is a type tag name and will affect the names of all cqueue types and methods. E.g. declaring `using_cqueue(i, clist_i)`, `X` should be replaced by `i` in all of the following documentation. -## Header file - -All cqueue definitions and prototypes are available by including a single header file. - -```c -#include <stc/cqueue.h> /* includes default underlying implementation header cdeq.h */ -``` - ## Methods ```c diff --git a/docs/cset_api.md b/docs/cset_api.md index 04159cf9..fe35c56c 100644 --- a/docs/cset_api.md +++ b/docs/cset_api.md @@ -4,28 +4,22 @@ A **cset** is an associative container that contains a set of unique objects of type Key. Search, insertion, and removal have average constant-time complexity. See the c++ class
[std::unordered_set](https://en.cppreference.com/w/cpp/container/unordered_set) for a functional description.
-## Declaration
+## Header file and declaration
```c
+#include <stc/cset.h>
+
using_cset(X, Key);
using_cset(X, Key, keyEquals, keyHash);
using_cset(X, Key, keyEquals, keyHash, keyDel, keyClone);
using_cset(X, Key, keyEqualsRaw, keyHashRaw, keyDel, keyFromRaw, keyToRaw, RawKey);
-using_cset_str();
+
+using_cset_str(); // using_cset(str, cstr, ...)
```
The macro `using_cset()` must be instantiated in the global scope. `X` is a type tag name and
will affect the names of all cset types and methods. E.g. declaring `using_cset(i, int);`, `X` should
be replaced by `i` in all of the following documentation.
-`using_cset_str()` is a predefined macro for `using_cset(str, cstr, ...)`.
-
-## Header file
-
-All cset definitions and prototypes are available by including a single header file.
-
-```c
-#include <stc/cset.h>
-```
## Methods
```c
@@ -34,14 +28,14 @@ cset_X cset_X_with_capacity(size_t cap); cset_X cset_X_clone(cset_x set);
void cset_X_clear(cset_X* self);
-void cset_X_set_load_factors(cset_X* self, float min_load, float max_load);
+void cset_X_set_load_factors(cset_X* self, float min_load, float max_load); // default: 0.15, 0.85
void cset_X_reserve(cset_X* self, size_t size);
void cset_X_swap(cset_X* a, cset_X* b);
-void cset_X_del(cset_X* self); // destructor
+void cset_X_del(cset_X* self); // destructor
bool cset_X_empty(cset_X set);
-size_t cset_X_size(cset_X set); // num. of allocated buckets
-size_t cset_X_capacity(cset_X set); // buckets * max_load_factor
+size_t cset_X_size(cset_X set); // num. of allocated buckets
+size_t cset_X_capacity(cset_X set); // buckets * max_load_factor
size_t cset_X_bucket_count(cset_X set);
cset_X_iter_t cset_X_find(const cset_X* self, RawKey rkey);
diff --git a/docs/csmap_api.md b/docs/csmap_api.md index bf3d3525..bb023c64 100644 --- a/docs/csmap_api.md +++ b/docs/csmap_api.md @@ -8,9 +8,11 @@ using the comparison function *keyCompare*. Search, removal, and insertion opera See the c++ class [std::map](https://en.cppreference.com/w/cpp/container/map) for a functional description. -## Declaration +## Header file and declaration ```c +#include <stc/csmap.h> + using_csmap(X, Key, Mapped); using_csmap(X, Key, Mapped, keyCompare); using_csmap(X, Key, Mapped, keyCompare, mappedDel, mappedClone); @@ -35,13 +37,6 @@ The `using_csmap()` macro family must be instantiated in the global scope. `X` i will affect the names of all csmap types and methods. E.g. declaring `using_csmap(ii, int, int);`, `X` should be replaced by `ii` in all of the following documentation. -## Header file - -All csmap definitions and prototypes are available by including a single header file. - -```c -#include <stc/csmap.h> -``` ## Methods ```c diff --git a/docs/csset_api.md b/docs/csset_api.md index 3d1996e8..fc425292 100644 --- a/docs/csset_api.md +++ b/docs/csset_api.md @@ -5,28 +5,22 @@ A **csset** is an associative container that contains a sorted set of unique obj See the c++ class [std::set](https://en.cppreference.com/w/cpp/container/set) for a functional description.
-## Declaration
+## Header file and declaration
```c
+#include <stc/csset.h>
+
using_csset(X, Key);
using_csset(X, Key, keyCompare);
using_csset(X, Key, keyCompare, keyDel, keyClone);
using_csset(X, Key, keyCompareRaw, keyDel, keyFromRaw, keyToRaw, RawKey);
-using_csset_str();
+
+using_csset_str(); // using_csset(str, cstr, ...)
```
The macro `using_csset()` must be instantiated in the global scope. `X` is a type tag name and
will affect the names of all csset types and methods. E.g. declaring `using_csset(i, int);`, `X` should
be replaced by `i` in all of the following documentation.
-`using_csset_str()` is a predefined macro for `using_csset(str, cstr, ...)`.
-
-## Header file
-
-All csset definitions and prototypes are available by including a single header file.
-
-```c
-#include <stc/csset.h>
-```
## Methods
```c
diff --git a/docs/cstack_api.md b/docs/cstack_api.md index 9d644b5c..85e23455 100644 --- a/docs/cstack_api.md +++ b/docs/cstack_api.md @@ -5,9 +5,11 @@ The **cstack** is a container adapter that gives the programmer the functionalit See the c++ class [std::stack](https://en.cppreference.com/w/cpp/container/stack) for a functional description. -## Declaration +## Header file and declaration ```c +#include <stc/cstack.h> /* includes default underlying implementation header cvec.h */ + using_cstack(X, ctype) ``` The macro `using_cstack()` must be instantiated in the global scope. **cstack** uses normally @@ -15,14 +17,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(i, cvec_i);`, `X` should be replaced by `i` in all of the following documentation. -## Header file - -All cstack definitions and prototypes are available by including a single header file. - -```c -#include <stc/cstack.h> /* includes default underlying implementation header cvec.h */ -``` - ## Methods ```c diff --git a/docs/cvec_api.md b/docs/cvec_api.md index 48bb5475..d1a23695 100644 --- a/docs/cvec_api.md +++ b/docs/cvec_api.md @@ -9,15 +9,17 @@ Reallocations are usually costly operations in terms of performance. The *cvec_X See the c++ class [std::vector](https://en.cppreference.com/w/cpp/container/vector) for a functional description. -## Declaration +## Header file and declaration ```c +#include <stc/cvec.h> + using_cvec(X, Value); using_cvec(X, Value, valueCompare); using_cvec(X, Value, valueCompare, valueDel, valueClone); using_cvec(X, Value, valueCompareRaw, valueDel, valueFromRaw, valueToRaw, RawValue); -using_cvec_str() +using_cvec_str(); // using_cvec(str, cstr, ...) ``` The macro `using_cvec()` must be instantiated in the global scope. `X` is a type tag name and will affect the names of all cvec types and methods. E.g. declaring `using_cvec(i, int);`, `X` should @@ -28,13 +30,6 @@ be replaced by `i` in all of the following documentation. using_cvec(str, cstr, cstr_compare_raw, cstr_del, cstr_from, cstr_c_str, const char*) ``` -## Header file - -All cvec definitions and prototypes are available by including a single header file. - -```c -#include <stc/cvec.h> -``` ## Methods ```c |
