diff options
Diffstat (limited to 'misc/examples/read.c')
| -rw-r--r-- | misc/examples/read.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/misc/examples/read.c b/misc/examples/read.c index 4efdcfeb..ee5dd377 100644 --- a/misc/examples/read.c +++ b/misc/examples/read.c @@ -6,8 +6,8 @@ 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 (FILE* f = fopen(name, "r"), fclose(f)) + c_WITH (cstr line = cstr_NULL, cstr_drop(&line)) while (cstr_getline(&line, f)) cvec_str_push(&vec, cstr_clone(line)); return vec; @@ -16,8 +16,8 @@ cvec_str read_file(const char* name) int main() { int n = 0; - c_with (cvec_str vec = read_file(__FILE__), cvec_str_drop(&vec)) - c_foreach (i, cvec_str, vec) + c_WITH (cvec_str vec = read_file(__FILE__), cvec_str_drop(&vec)) + c_FOREACH (i, cvec_str, vec) printf("%5d: %s\n", ++n, cstr_str(i.ref)); if (errno) |
