diff options
| author | Tyge Løvset <[email protected]> | 2021-12-19 21:39:25 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2021-12-19 21:39:25 +0100 |
| commit | 0c3d711c2541aebe9a44fecb732e096bed14f72c (patch) | |
| tree | 0d9c6dbe393d24fccd12107a3ec08f468656ce73 /docs | |
| parent | 09b696eab6ae640f6c1e07178d49fcd8646e1737 (diff) | |
| download | STC-modified-0c3d711c2541aebe9a44fecb732e096bed14f72c.tar.gz STC-modified-0c3d711c2541aebe9a44fecb732e096bed14f72c.zip | |
Global rename of `_equ\b` => `_eq`. In practice `i_equ` must renamed to `i_eq` in user code if used.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ccommon_api.md | 2 | ||||
| -rw-r--r-- | docs/cmap_api.md | 22 | ||||
| -rw-r--r-- | docs/cset_api.md | 8 | ||||
| -rw-r--r-- | docs/cstr_api.md | 4 | ||||
| -rw-r--r-- | docs/csview_api.md | 2 |
5 files changed, 19 insertions, 19 deletions
diff --git a/docs/ccommon_api.md b/docs/ccommon_api.md index cc021001..9318b8e3 100644 --- a/docs/ccommon_api.md +++ b/docs/ccommon_api.md @@ -170,7 +170,7 @@ Type c_default_toraw(const Type* val); // dereference val void c_default_drop(Type* val); // does nothing int c_rawstr_cmp(const char* const* a, const char* const* b); -bool c_rawstr_equalto(const char* const* a, const char* const* b); +bool c_rawstr_eq(const char* const* a, const char* const* b); ``` ### c_malloc, c_calloc, c_realloc, c_free diff --git a/docs/cmap_api.md b/docs/cmap_api.md index e2cb668f..4bb367f8 100644 --- a/docs/cmap_api.md +++ b/docs/cmap_api.md @@ -20,14 +20,14 @@ See the c++ class [std::unordered_map](https://en.cppreference.com/w/cpp/contain #define i_key // key: REQUIRED #define i_val // value: REQUIRED #define i_cmp // three-way compare two i_keyraw*: REQUIRED IF i_keyraw is non-integral type -#define i_equ // equality comparison two i_keyraw*: ALTERNATIVE to i_cmp +#define i_eq // equality comparison two i_keyraw*: ALTERNATIVE to i_cmp #define i_keydrop // destroy key func - defaults to empty destruct #define i_keyraw // convertion "raw" type - defaults to i_key -#define i_keyfrom // convertion func i_keyraw => i_key - defaults to plain copy +#define i_keyfrom // convertion func i_keyraw => i_key - defaults to plain copy #define i_keyto // convertion func i_key* => i_keyraw - defaults to plain copy #define i_valdrop // destroy value func - defaults to empty destruct #define i_valraw // convertion "raw" type - defaults to i_val -#define i_valfrom // convertion func i_valraw => i_val - defaults to plain copy +#define i_valfrom // convertion func i_valraw => i_val - defaults to plain copy #define i_valto // convertion func i_val* => i_valraw - defaults to plain copy #define i_tag // defaults to i_key #include <stc/cmap.h> @@ -89,9 +89,9 @@ uint64_t c_hash64(const void* data, size_t is8); uint64_t c_rawstr_hash(const char* const* strp, size_t unused); // equalto template parameter functions: -bool c_default_equalto(const i_keyraw* a, const i_keyraw* b); // *a == *b -bool c_memcmp_equalto(const i_keyraw* a, const i_keyraw* b); // !memcmp(a, b, sizeof *a) -bool c_rawstr_equalto(const char* const* a, const char* const* b); // !strcmp(*a, *b) +bool c_default_eq(const i_keyraw* a, const i_keyraw* b); // *a == *b +bool c_memcmp_eq(const i_keyraw* a, const i_keyraw* b); // !memcmp(a, b, sizeof *a) +bool c_rawstr_eq(const char* const* a, const char* const* b); // !strcmp(*a, *b) ``` ## Types @@ -200,7 +200,7 @@ typedef struct { int x, y, z; } Vec3i; #define i_key Vec3i #define i_val int -#define i_equ c_memcmp_equalto // bitwise compare, and use c_default_hash +#define i_eq c_memcmp_eq // bitwise equal, and use c_default_hash #define i_tag vi #include <stc/cmap.h> @@ -272,7 +272,7 @@ typedef struct { #define Viking_init() ((Viking){cstr_null, cstr_null}) -static inline bool RViking_equalto(const Viking* a, const Viking* b) { +static inline bool RViking_eq(const Viking* a, const Viking* b) { return cstr_equals_s(a->name, b->name) && cstr_equals_s(a->country, b->country); } @@ -294,7 +294,7 @@ void inline Viking_drop(Viking* vk) { #define i_key_bind Viking #define i_val int // i_key_bind auto-binds: -// #define i_equ RViking_equalto +// #define i_eq RViking_eq // #define i_hash RViking_hash // #define i_keyfrom Viking_clone // #define i_drop Viking_drop @@ -357,7 +357,7 @@ static inline uint64_t RViking_hash(const RViking* raw, size_t ignore) { uint64_t hash = c_strhash(raw->name) ^ (c_strhash(raw->country) >> 15); return hash; } -static inline bool RViking_equalto(const RViking* rx, const RViking* ry) { +static inline bool RViking_eq(const RViking* rx, const RViking* ry) { return strcmp(rx->name, ry->name) == 0 && strcmp(rx->country, ry->country) == 0; } @@ -375,7 +375,7 @@ static inline RViking Viking_toraw(const Viking* vk) { #define i_keyraw RViking // i_key_bind macro will make these functions auto-bind: // #define i_hash RViking_hash -// #define i_equ RViking_equalto +// #define i_eq RViking_eq // #define i_keyfrom Viking_from // uses _from because i_keyraw is defined // #define i_keyto Viking_toraw // #define i_keydrop Viking_drop diff --git a/docs/cset_api.md b/docs/cset_api.md index b70f5fb9..2ce43309 100644 --- a/docs/cset_api.md +++ b/docs/cset_api.md @@ -8,13 +8,13 @@ A **cset** is an associative container that contains a set of unique objects of ```c
#define i_key // key: REQUIRED
-#define i_hash // hash func: REQUIRED IF i_keyraw is a non-pod type
#define i_cmp // three-way compare two i_keyraw*: REQUIRED IF i_keyraw is a non-integral type
-#define i_equ // equality comparison two i_keyraw*: ALTERNATIVE to i_cmp
+#define i_hash // hash func: REQUIRED IF i_keyraw is a non-pod type
+#define i_eq // equality comparison two i_keyraw*: !i_cmp will be used if not defined.
#define i_drop // destroy key func - defaults to empty destruct
#define i_keyraw // convertion "raw" type - defaults to i_key
-#define i_keyfrom // convertion func i_keyraw => i_key - defaults to plain copy
-#define i_keyto // convertion func i_key* => i_keyraw - defaults to plain copy
+#define i_keyfrom // convertion func i_keyraw => i_key - defaults to plain copy
+#define i_keyto // convertion func i_key* => i_keyraw - defaults to plain copy
#define i_tag // defaults to i_key
#include <stc/cset.h>
```
diff --git a/docs/cstr_api.md b/docs/cstr_api.md index 463a723c..31f27baf 100644 --- a/docs/cstr_api.md +++ b/docs/cstr_api.md @@ -86,12 +86,12 @@ Note that all methods with arguments `(..., const char* str, size_t n)`, `n` mus #### Helper methods: ```c int cstr_cmp(const cstr *s1, const cstr *s2); -bool cstr_equalto(const cstr *s1, const cstr *s2); +bool cstr_eq(const cstr *s1, const cstr *s2); bool cstr_hash(const cstr *s, ...); typedef const char* c_rawstr; int c_rawstr_cmp(const c_rawstr* x, const c_rawstr* y); -bool c_rawstr_equalto(const c_rawstr* x, const c_rawstr* y); +bool c_rawstr_eq(const c_rawstr* x, const c_rawstr* y); uint64_t c_rawstr_hash(const c_rawstr* x, size_t dummy); uint64_t c_strhash(const char* str); diff --git a/docs/csview_api.md b/docs/csview_api.md index 609c5d10..4e5d3b0e 100644 --- a/docs/csview_api.md +++ b/docs/csview_api.md @@ -78,7 +78,7 @@ bool cstr_ends_with_v(cstr s, csview sub); #### Helper methods ```c int csview_cmp(const csview* x, const csview* y); -bool csview_equalto(const csview* x, const csview* y); +bool csview_eq(const csview* x, const csview* y); uint64_t csview_hash(const csview* x, size_t dummy); ``` ## Types |
