diff options
| author | Tyge Løvset <[email protected]> | 2022-11-13 13:35:16 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-11-13 13:35:16 +0100 |
| commit | be9ce096ba5e143a04d81563ac1acd51e04ef2cb (patch) | |
| tree | 8a05be4bc2bb75182c3a600b234d15709f272eda /examples | |
| parent | 99fb2a81c771739e11091b84161f03d740eab084 (diff) | |
| download | STC-modified-be9ce096ba5e143a04d81563ac1acd51e04ef2cb.tar.gz STC-modified-be9ce096ba5e143a04d81563ac1acd51e04ef2cb.zip | |
Simplified csview API and usage. Fixed c++ compilation of csmap.
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/forfilter.c | 2 | ||||
| -rw-r--r-- | examples/sview_split.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/examples/forfilter.c b/examples/forfilter.c index 3c30b976..25ed07cd 100644 --- a/examples/forfilter.c +++ b/examples/forfilter.c @@ -94,7 +94,7 @@ void demo3(void) SVec_push(&words, *w.ref); c_forfilter (w, SVec, words, - csview_contains(*w.ref, c_sv("i"))) + csview_contains(*w.ref, "i")) SVec_push(&words_containing_i, *w.ref); puts("demo3:"); diff --git a/examples/sview_split.c b/examples/sview_split.c index 155cdc28..634fdc38 100644 --- a/examples/sview_split.c +++ b/examples/sview_split.c @@ -7,9 +7,9 @@ int main() // No memory allocations or string length calculations! const csview date = c_sv("2021/03/12"); size_t pos = 0; - const csview year = csview_token(date, c_sv("/"), &pos); - const csview month = csview_token(date, c_sv("/"), &pos); - const csview day = csview_token(date, c_sv("/"), &pos); + const csview year = csview_token(date, "/", &pos); + const csview month = csview_token(date, "/", &pos); + const csview day = csview_token(date, "/", &pos); printf("%.*s, %.*s, %.*s\n", c_ARGsv(year), c_ARGsv(month), c_ARGsv(day)); |
