From bf3a35e3cd8d1df9548aa0e57b58d7a0e5dfef14 Mon Sep 17 00:00:00 2001 From: Tyge Lovset Date: Fri, 6 May 2022 05:44:41 +0200 Subject: Made cstr_buffer() func. public, and docs for cstr_sv() - convert to csview. --- docs/cstr_api.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/cstr_api.md b/docs/cstr_api.md index 2e8cde33..66a604a0 100644 --- a/docs/cstr_api.md +++ b/docs/cstr_api.md @@ -31,6 +31,9 @@ void cstr_drop(cstr *self); // destruc const char* cstr_str(const cstr* self); // access to const char* char* cstr_data(cstr* self); // access to char* +csview cstr_sv(const cstr* self); // access to string view +cstr_buf cstr_buffer(cstr* self); // access to mutable buffer (with capacity) + size_t cstr_size(cstr s); size_t cstr_length(cstr s); size_t cstr_capacity(cstr s); @@ -94,10 +97,12 @@ int c_strncasecmp(const char* str1, const char* str2, size_t n); ## Types -| Type name | Type definition | Used to represent... | -|:----------------|:-------------------------------|:-------------------------| -| `cstr` | `struct { char *str; }` | The string type | -| `cstr_value` | `char` | The string element type | +| Type name | Type definition | Used to represent... | +|:----------------|:-------------------------------------------|:---------------------| +| `cstr` | `struct { ... }` | The string type | +| `cstr_value` | `char` | String element type | +| `csview` | `struct { const char *str; size_t size; }` | String view type | +| `cstr_buf` | `struct { char *data; size_t size, cap; }` | String buffer type | ## Constants and macros -- cgit v1.2.3