diff options
| author | Tyge Løvset <[email protected]> | 2021-05-26 20:24:37 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2021-05-26 20:24:37 +0200 |
| commit | b840bc032d8500379888caf93702ab057e712937 (patch) | |
| tree | 7a1fa0fcc56e7d5c4e5ba333345ca3f803f800a6 /docs | |
| parent | 3fbc5727832c0687d97a218e85d93857aadcea1c (diff) | |
| download | STC-modified-b840bc032d8500379888caf93702ab057e712937.tar.gz STC-modified-b840bc032d8500379888caf93702ab057e712937.zip | |
Removed cstr_trim, csview_trim, Changed cstr_substr to mutable. Allow negative pos on cstr_substr, csview_substr. Added cstr_slice, csview_slice.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/cstr_api.md | 6 | ||||
| -rw-r--r-- | docs/csview_api.md | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/docs/cstr_api.md b/docs/cstr_api.md index 49ece6e0..26450ac7 100644 --- a/docs/cstr_api.md +++ b/docs/cstr_api.md @@ -23,7 +23,6 @@ cstr cstr_with_capacity(size_t cap); cstr cstr_with_size(size_t len, char fill); // repeat fill len times cstr cstr_from_fmt(const char* fmt, ...); // printf() formatting cstr cstr_clone(cstr s); -cstr cstr_substr(cstr s, size_t pos, size_t n); cstr* cstr_take(cstr* self, cstr s); // take the constructed or moved string cstr cstr_move(cstr* self); // move string to caller, leave empty string @@ -42,8 +41,9 @@ cstr* cstr_assign(cstr* self, const char* str); cstr* cstr_assign_n(cstr* self, const char* str, size_t n); // assign n first chars of str cstr* cstr_assign_fmt(cstr* self, const char* fmt, ...); // printf() formatting cstr* cstr_copy(cstr* self, cstr s); // cstr_take(self, cstr_clone(s)) -cstr* cstr_trim(cstr* self, size_t left, size_t right); - +cstr* cstr_substr(cstr* self, intptr_t pos, size_t n); // negative pos count from end +cstr* cstr_slice(cstr* self, intptr_t p1, intptr_t p2); // negative p1,p2 count from end. + // substr(), slice() modifies self cstr* cstr_append(cstr* self, const char* str); cstr* cstr_append_s(cstr* self, cstr s); cstr* cstr_append_n(cstr* self, const char* str, size_t n); diff --git a/docs/csview_api.md b/docs/csview_api.md index 64c42973..63b84a1d 100644 --- a/docs/csview_api.md +++ b/docs/csview_api.md @@ -37,9 +37,9 @@ size_t csview_length(csview sv); bool csview_empty(csview sv); void csview_clear(csview* self); -csview csview_substr(csview sv, size_t pos, size_t n); -csview csview_trimmed(csview sv, size_t left, size_t right); -csview csview_first_token(csview sv, csview sep); +csview csview_substr(csview sv, intptr_t pos, size_t n); // negative pos count from end +csview csview_slice(csview sv, intptr_t p1, intptr_t p2); // negative p1,p2 count from end +csview csview_first_token(csview sv, csview sep); // see split example below. csview csview_next_token(csview sv, csview sep, csview token); bool csview_equals(csview sv, csview sv2); |
