diff options
| author | Tyge Løvset <[email protected]> | 2021-12-02 14:39:42 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2021-12-02 14:39:42 +0100 |
| commit | 323f21d57aaf30ffd43d6b67146bc887ad206298 (patch) | |
| tree | 3e4045251b0a0d0fb55e152ce728da6b5a3e875b /docs/ccommon_api.md | |
| parent | f857d8215a266673e25356779f740100fe362025 (diff) | |
| download | STC-modified-323f21d57aaf30ffd43d6b67146bc887ad206298.tar.gz STC-modified-323f21d57aaf30ffd43d6b67146bc887ad206298.zip | |
Breaking changes for i_fwd and i_cmp_none:
- Removed: i_cmp_none and i_fwd (replaced by c_no_compare and c_is_fwd args to i_opt).
- Added compile-time disabling of clonable and comparable container elements, controlled by i_opt (c_no_clone | c_no_compare)
- Added i_opt: can define multiple compile-time options: c_no_compare, c_no_clone, c_no_atomic, c_is_fwd: may be combined with | separator.
- Except for csptr, when i_del / i_valdel / i_keydel is defined, also i_from / i_keyfrom / i_valfrom must be defined or i_opt c_no_clone.
- For struct elements, either i_cmp must be defined (as before), or define i_opt c_no_compare for non-associative containers.
Diffstat (limited to 'docs/ccommon_api.md')
| -rw-r--r-- | docs/ccommon_api.md | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/docs/ccommon_api.md b/docs/ccommon_api.md index db89120e..3d353e6c 100644 --- a/docs/ccommon_api.md +++ b/docs/ccommon_api.md @@ -155,6 +155,17 @@ cstr a = cstr_from("Hello"), b = cstr_from("World"); c_del(cstr, &a, &b); ``` +### General predefined template parameter functions +``` +int c_default_compare(const Type*, const Type*); +Type c_default_fromraw(Type val); // simple copy +Type c_default_toraw(const Type* val); // dereference val +void c_default_del(Type* val); // does nothing + +int c_rawstr_compare(const char* const* a, const char* const* b); +bool c_rawstr_equalto(const char* const* a, const char* const* b); +``` + ### c_malloc, c_calloc, c_realloc, c_free Memory allocator for the entire library. Macros can be overloaded by the user. |
