summaryrefslogtreecommitdiffhomepage
path: root/misc/examples/sview_split.c
diff options
context:
space:
mode:
authortylov <[email protected]>2023-07-20 15:09:10 +0200
committertylov <[email protected]>2023-07-20 15:12:29 +0200
commit900295256d825fc323149cd223c49787f32a3696 (patch)
tree6c79cf4209e3975bb6865e2940b9cb56ea469c73 /misc/examples/sview_split.c
parent224a04f7fa7549ed94d2a1415eb25829e39a7cca (diff)
downloadSTC-modified-900295256d825fc323149cd223c49787f32a3696.tar.gz
STC-modified-900295256d825fc323149cd223c49787f32a3696.zip
Moved examples to sub-directories. Added cotask1.c cotask2.c examples.
Diffstat (limited to 'misc/examples/sview_split.c')
-rw-r--r--misc/examples/sview_split.c20
1 files changed, 0 insertions, 20 deletions
diff --git a/misc/examples/sview_split.c b/misc/examples/sview_split.c
deleted file mode 100644
index ac275da0..00000000
--- a/misc/examples/sview_split.c
+++ /dev/null
@@ -1,20 +0,0 @@
-#define i_implement
-#include <stc/cstr.h>
-#define i_implement
-#include <stc/csview.h>
-
-int main(void)
-{
- // No memory allocations or string length calculations!
- const csview date = c_sv("2021/03/12");
- intptr_t pos = 0;
- 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_SV(year), c_SV(month), c_SV(day));
-
- cstr y = cstr_from_sv(year), m = cstr_from_sv(month), d = cstr_from_sv(day);
- printf("%s, %s, %s\n", cstr_str(&y), cstr_str(&m), cstr_str(&d));
- c_drop(cstr, &y, &m, &d);
-}