summaryrefslogtreecommitdiffhomepage
path: root/misc/examples/read.c
diff options
context:
space:
mode:
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))