summaryrefslogtreecommitdiffhomepage
path: root/misc/examples/read.c
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-07-18 02:36:04 +0200
committerGitHub <[email protected]>2023-07-18 02:36:04 +0200
commitda70303c149b37dbf442e41038a00836132562ee (patch)
tree06d795c66d6759e06de5f2d166215b461ac40d1d /misc/examples/read.c
parent071b41c0fe95cb3f9a72bbe0417d856e7989ca08 (diff)
parent23eeedb3fc298602732f394adba6a43c876ca7d8 (diff)
downloadSTC-modified-da70303c149b37dbf442e41038a00836132562ee.tar.gz
STC-modified-da70303c149b37dbf442e41038a00836132562ee.zip
Merge branch 'dev43' into master
Diffstat (limited to 'misc/examples/read.c')
-rw-r--r--misc/examples/read.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/misc/examples/read.c b/misc/examples/read.c
index 4efdcfeb..b12f7409 100644
--- a/misc/examples/read.c
+++ b/misc/examples/read.c
@@ -1,5 +1,7 @@
+#define i_implement
#include <stc/cstr.h>
-#define i_val_str
+#include <stc/algo/raii.h>
+#define i_key_str
#include <stc/cvec.h>
#include <errno.h>
@@ -7,13 +9,13 @@ cvec_str read_file(const char* name)
{
cvec_str vec = cvec_str_init();
c_with (FILE* f = fopen(name, "r"), fclose(f))
- c_with (cstr line = cstr_NULL, cstr_drop(&line))
+ c_with (cstr line = cstr_null, cstr_drop(&line))
while (cstr_getline(&line, f))
cvec_str_push(&vec, cstr_clone(line));
return vec;
}
-int main()
+int main(void)
{
int n = 0;
c_with (cvec_str vec = read_file(__FILE__), cvec_str_drop(&vec))