summaryrefslogtreecommitdiffhomepage
path: root/misc/examples/read.c
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-12-23 23:55:10 +0100
committerTyge Løvset <[email protected]>2022-12-23 23:55:10 +0100
commitd623c6c85071b9af5d607bb5d9aceceaea05220a (patch)
treef20fc3714f86e1553d1103bed6dc8efefcbd9d6b /misc/examples/read.c
parent5f57d597cd27aef55adbcb3b452973b0c6e33667 (diff)
downloadSTC-modified-d623c6c85071b9af5d607bb5d9aceceaea05220a.tar.gz
STC-modified-d623c6c85071b9af5d607bb5d9aceceaea05220a.zip
Experimental uppercase macros.
Diffstat (limited to 'misc/examples/read.c')
-rw-r--r--misc/examples/read.c8
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)