summaryrefslogtreecommitdiffhomepage
path: root/docs/csview_api.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/csview_api.md')
-rw-r--r--docs/csview_api.md10
1 files changed, 5 insertions, 5 deletions
diff --git a/docs/csview_api.md b/docs/csview_api.md
index 3971c6a6..e3c65766 100644
--- a/docs/csview_api.md
+++ b/docs/csview_api.md
@@ -88,7 +88,7 @@ csview cstr_slice_ex(const cstr* s, intptr_t p, intptr_t q); // nega
To iterate tokens in an input string separated by a string:
```c
c_FORTOKEN (i, "hello, one, two, three", ", ")
- printf("token: %.*s\n", c_ARGSV(i.token));
+ printf("token: %.*s\n", c_SVARG(i.token));
```
#### Helper methods
@@ -112,7 +112,7 @@ uint64_t csview_hash(const csview* x);
| Name | Value | Usage |
|:---------------|:---------------------|:---------------------------------------------|
| `csview_NULL` | same as `c_SV("")` | `sview = csview_NULL;` |
-| `c_ARGSV(sv)` | printf argument | `printf("sv: %.*s\n", c_ARGSV(sv));` |
+| `c_SVARG(sv)` | printf argument | `printf("sv: %.*s\n", c_SVARG(sv));` |
## Example
```c
@@ -129,7 +129,7 @@ int main ()
csview sv2 = cstr_substr(&str1, pos, 4); // get "live"
csview sv3 = cstr_slice(&str1, -8, -1); // get "details"
printf("%.*s %.*s %.*s\n",
- c_ARGSV(sv1), c_ARGSV(sv2), c_ARGSV(sv3));
+ c_SVARG(sv1), c_SVARG(sv2), c_SVARG(sv3));
cstr s1 = cstr_lit("Apples are red");
cstr s2 = cstr_from_sv(cstr_substr(&s1, -3, 3)); // "red"
cstr s3 = cstr_from_sv(cstr_substr(&s1, 0, 6)); // "Apples"
@@ -157,7 +157,7 @@ int main()
printf("%s\n", cstr_str(&s1));
c_FOREACH (i, cstr, s1)
- printf("%.*s,", c_ARGSV(i.u8.chr));
+ printf("%.*s,", c_SVARG(i.u8.chr));
}
}
```
@@ -177,7 +177,7 @@ and does not depend on null-terminated strings. *string_split()* function return
void print_split(csview input, const char* sep)
{
c_FORTOKEN_SV (i, input, sep)
- printf("[%.*s]\n", c_ARGSV(i.token));
+ printf("[%.*s]\n", c_SVARG(i.token));
}
#include <stc/cstr.h>