diff options
| author | Tyge Løvset <[email protected]> | 2023-02-03 10:38:18 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2023-02-03 10:38:18 +0100 |
| commit | feef5067e0c3f1cf113b4fa8b302ac1bfa249e68 (patch) | |
| tree | 6a0dc940e9321bbb9a22bbf1b1e3943a31981cdb /docs/cbits_api.md | |
| parent | 9bc4e3b53839d73af7e7d11043fb9e1b064836e3 (diff) | |
| download | STC-modified-feef5067e0c3f1cf113b4fa8b302ac1bfa249e68.tar.gz STC-modified-feef5067e0c3f1cf113b4fa8b302ac1bfa249e68.zip | |
Update cspan, needs more testing.
Diffstat (limited to 'docs/cbits_api.md')
| -rw-r--r-- | docs/cbits_api.md | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/docs/cbits_api.md b/docs/cbits_api.md index f3967739..60586a5b 100644 --- a/docs/cbits_api.md +++ b/docs/cbits_api.md @@ -19,40 +19,40 @@ All cbits definitions and prototypes are available by including a single header ## Methods ```c -cbits cbits_init(void); -cbits cbits_from(const char* str); -cbits cbits_with_size(intptr_t size, bool value); // size must be <= N if N is defined -cbits cbits_with_pattern(intptr_t size, uint64_t pattern); -cbits cbits_clone(cbits other); - -void cbits_clear(cbits* self); -cbits* cbits_copy(cbits* self, const cbits* other); -void cbits_resize(cbits* self, intptr_t size, bool value); // only if i_len is not defined -void cbits_drop(cbits* self); - -cbits* cbits_take(cbits* self, const cbits* other); // give other to self -cbits cbits_move(cbits* self); // transfer self to caller - -intptr_t cbits_size(const cbits* self); -intptr_t cbits_count(const cbits* self); // count number of bits set - -bool cbits_test(const cbits* self, intptr_t i); -bool cbits_at(const cbits* self, intptr_t i); // same as cbits_test() -bool cbits_subset_of(const cbits* self, const cbits* other); // is set a subset of other? -bool cbits_disjoint(const cbits* self, const cbits* other); // no common bits -char* cbits_to_str(const cbits* self, char* str, intptr_t start, intptr_t stop); - -void cbits_set(cbits* self, intptr_t i); -void cbits_reset(cbits* self, intptr_t i); -void cbits_set_value(cbits* self, intptr_t i, bool value); -void cbits_set_all(cbits* self, bool value); -void cbits_set_pattern(cbits* self, uint64_t pattern); -void cbits_flip_all(cbits* self); -void cbits_flip(cbits* self, intptr_t i); - -void cbits_intersect(cbits* self, const cbits* other); -void cbits_union(cbits* self, const cbits* other); -void cbits_xor(cbits* self, const cbits* other); // set of disjoint bits +cbits cbits_init(void); +cbits cbits_from(const char* str); +cbits cbits_with_size(intptr_t size, bool value); // size must be <= N if N is defined +cbits cbits_with_pattern(intptr_t size, uint64_t pattern); +cbits cbits_clone(cbits other); + +void cbits_clear(cbits* self); +cbits* cbits_copy(cbits* self, const cbits* other); +void cbits_resize(cbits* self, intptr_t size, bool value); // only if i_len is not defined +void cbits_drop(cbits* self); + +cbits* cbits_take(cbits* self, const cbits* other); // give other to self +cbits cbits_move(cbits* self); // transfer self to caller + +intptr_t cbits_size(const cbits* self); +intptr_t cbits_count(const cbits* self); // count number of bits set + +bool cbits_test(const cbits* self, intptr_t i); +bool cbits_at(const cbits* self, intptr_t i); // same as cbits_test() +bool cbits_subset_of(const cbits* self, const cbits* other); // is set a subset of other? +bool cbits_disjoint(const cbits* self, const cbits* other); // no common bits +char* cbits_to_str(const cbits* self, char* str, intptr_t start, intptr_t stop); + +void cbits_set(cbits* self, intptr_t i); +void cbits_reset(cbits* self, intptr_t i); +void cbits_set_value(cbits* self, intptr_t i, bool value); +void cbits_set_all(cbits* self, bool value); +void cbits_set_pattern(cbits* self, uint64_t pattern); +void cbits_flip_all(cbits* self); +void cbits_flip(cbits* self, intptr_t i); + +void cbits_intersect(cbits* self, const cbits* other); +void cbits_union(cbits* self, const cbits* other); +void cbits_xor(cbits* self, const cbits* other); // set of disjoint bits ``` ## Types |
