summaryrefslogtreecommitdiffhomepage
path: root/docs/cstr_api.md
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2021-05-27 10:07:57 +0200
committerTyge Løvset <[email protected]>2021-05-27 10:07:57 +0200
commitc7a6f7c17e2d2a2b0144cbec87f4b2c93e8150dd (patch)
treeea7c569309072360d0c439db6e5c09aa10371bd6 /docs/cstr_api.md
parentb840bc032d8500379888caf93702ab057e712937 (diff)
downloadSTC-modified-c7a6f7c17e2d2a2b0144cbec87f4b2c93e8150dd.tar.gz
STC-modified-c7a6f7c17e2d2a2b0144cbec87f4b2c93e8150dd.zip
Made substr() and slice() only returning csview. Added Both cstr and csview input argument variants. Changed def of cstr_npos.
Diffstat (limited to 'docs/cstr_api.md')
-rw-r--r--docs/cstr_api.md16
1 files changed, 7 insertions, 9 deletions
diff --git a/docs/cstr_api.md b/docs/cstr_api.md
index 26450ac7..a38718bc 100644
--- a/docs/cstr_api.md
+++ b/docs/cstr_api.md
@@ -41,9 +41,7 @@ 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_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);
@@ -63,17 +61,17 @@ void cstr_erase_n(cstr* self, size_t pos, size_t n);
int cstr_compare(const cstr *s1, const cstr *s2);
bool cstr_equals(cstr s, const char* str);
bool cstr_equals_s(cstr s, cstr s2);
-size_t cstr_find(cstr s, const char* substr);
+size_t cstr_find(cstr s, const char* needle);
size_t cstr_find_n(cstr s, const char* needle, size_t pos, size_t nmax);
bool cstr_contains(cstr s, const char* needle);
-bool cstr_begins_with(cstr s, const char* substr);
-bool cstr_ends_with(cstr s, const char* substr);
+bool cstr_begins_with(cstr s, const char* str);
+bool cstr_ends_with(cstr s, const char* str);
bool cstr_iequals(cstr s, const char* str); // prefix i = case-insensitive
size_t cstr_ifind_n(cstr s, const char* needle, size_t pos, size_t nmax);
bool cstr_icontains(cstr s, const char* needle);
-bool cstr_ibegins_with(cstr s, const char* substr);
-bool cstr_iends_with(cstr s, const char* substr);
+bool cstr_ibegins_with(cstr s, const char* str);
+bool cstr_iends_with(cstr s, const char* str);
void cstr_push_back(cstr* self, char ch);
void cstr_pop_back(cstr* self);
@@ -114,7 +112,7 @@ char* c_strncasestrn(const char* str, const char* needle, size_t slen, si
| Name | Value |
|:------------------|:------------------|
-| `cstr_npos` | `((size_t) -1)` |
+| `cstr_npos` | `INTPTR_MAX` |
| `cstr_null` | cstr null value |
## Example