summaryrefslogtreecommitdiffhomepage
path: root/misc
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-02-05 21:21:55 +0100
committerTyge Løvset <[email protected]>2023-02-05 21:21:55 +0100
commite6dfaf1720f6833784d17d5364e1dd76324dff6a (patch)
tree0808f479425e58971aef993288bb818e60417422 /misc
parent217865ae413f9cfcc72af176ec7e98f418bddbea (diff)
downloadSTC-modified-e6dfaf1720f6833784d17d5364e1dd76324dff6a.tar.gz
STC-modified-e6dfaf1720f6833784d17d5364e1dd76324dff6a.zip
Some last minute changes: reverted mostly the c_extern from last commit.
Renamed c_ARGSV(sv) macro to c_SVARG(sv). Both available.
Diffstat (limited to 'misc')
-rw-r--r--misc/examples/cstr_match.c4
-rw-r--r--misc/examples/forfilter.c2
-rw-r--r--misc/examples/regex2.c2
-rw-r--r--misc/examples/splitstr.c4
-rw-r--r--misc/examples/sso_substr.c2
-rw-r--r--misc/examples/sview_split.c2
-rw-r--r--misc/examples/utf8replace_c.c2
7 files changed, 9 insertions, 9 deletions
diff --git a/misc/examples/cstr_match.c b/misc/examples/cstr_match.c
index bfb0df6b..828ef424 100644
--- a/misc/examples/cstr_match.c
+++ b/misc/examples/cstr_match.c
@@ -17,7 +17,7 @@ int main()
csview ch1 = cstr_u8_chr(&s1, 7);
csview ch2 = cstr_u8_chr(&s1, 10);
printf("%s\nsize: %" c_ZI ", %" c_ZI "\n", cstr_str(&s1), cstr_u8_size(&s1), cstr_size(&s1));
- printf("ch1: %.*s\n", c_ARGSV(ch1));
- printf("ch2: %.*s\n", c_ARGSV(ch2));
+ printf("ch1: %.*s\n", c_SVARG(ch1));
+ printf("ch2: %.*s\n", c_SVARG(ch2));
}
}
diff --git a/misc/examples/forfilter.c b/misc/examples/forfilter.c
index 1c64c9e0..d7e1bb1e 100644
--- a/misc/examples/forfilter.c
+++ b/misc/examples/forfilter.c
@@ -102,7 +102,7 @@ void demo3(void)
puts("demo3:");
c_FOREACH (w, SVec, words_containing_i)
- printf(" %.*s", c_ARGSV(*w.ref));
+ printf(" %.*s", c_SVARG(*w.ref));
puts("");
}
}
diff --git a/misc/examples/regex2.c b/misc/examples/regex2.c
index 2b742529..296d4135 100644
--- a/misc/examples/regex2.c
+++ b/misc/examples/regex2.c
@@ -27,7 +27,7 @@ int main()
c_FORMATCH (j, &re, s[i].input) {
c_FORRANGE (k, cregex_captures(&re))
- printf(" submatch %lld: %.*s\n", k, c_ARGSV(j.match[k]));
+ printf(" submatch %lld: %.*s\n", k, c_SVARG(j.match[k]));
}
}
}
diff --git a/misc/examples/splitstr.c b/misc/examples/splitstr.c
index ba927412..43309634 100644
--- a/misc/examples/splitstr.c
+++ b/misc/examples/splitstr.c
@@ -8,12 +8,12 @@ int main()
puts("Split with c_FORTOKEN (csview):");
c_FORTOKEN (i, "Hello World C99!", " ")
- printf("'%.*s'\n", c_ARGSV(i.token));
+ printf("'%.*s'\n", c_SVARG(i.token));
puts("\nSplit with c_FORMATCH (regex):");
c_WITH (cregex re = cregex_from("[^ ]+"), cregex_drop(&re))
c_FORMATCH (i, &re, " Hello World C99! ")
- printf("'%.*s'\n", c_ARGSV(i.match[0]));
+ printf("'%.*s'\n", c_SVARG(i.match[0]));
}
diff --git a/misc/examples/sso_substr.c b/misc/examples/sso_substr.c
index 317f5e78..d17dc89c 100644
--- a/misc/examples/sso_substr.c
+++ b/misc/examples/sso_substr.c
@@ -8,7 +8,7 @@ int main ()
intptr_t pos = cstr_find(&str, "live"); // position of "live"
csview sv2 = cstr_substr_ex(&str, pos, 4); // "live"
csview sv3 = cstr_slice_ex(&str, -8, -1); // "details"
- printf("%.*s, %.*s, %.*s\n", c_ARGSV(sv1), c_ARGSV(sv2), c_ARGSV(sv3));
+ printf("%.*s, %.*s, %.*s\n", c_SVARG(sv1), c_SVARG(sv2), c_SVARG(sv3));
cstr_assign(&str, "apples are green or red");
cstr s2 = cstr_from_sv(cstr_substr_ex(&str, -3, 3)); // "red"
diff --git a/misc/examples/sview_split.c b/misc/examples/sview_split.c
index 2dd21a1a..77caf640 100644
--- a/misc/examples/sview_split.c
+++ b/misc/examples/sview_split.c
@@ -10,7 +10,7 @@ int main()
const csview month = csview_token(date, "/", &pos);
const csview day = csview_token(date, "/", &pos);
- printf("%.*s, %.*s, %.*s\n", c_ARGSV(year), c_ARGSV(month), c_ARGSV(day));
+ printf("%.*s, %.*s, %.*s\n", c_SVARG(year), c_SVARG(month), c_SVARG(day));
c_AUTO (cstr, y, m, d) {
y = cstr_from_sv(year), m = cstr_from_sv(month), d = cstr_from_sv(day);
diff --git a/misc/examples/utf8replace_c.c b/misc/examples/utf8replace_c.c
index 3f98a2a6..035c5b00 100644
--- a/misc/examples/utf8replace_c.c
+++ b/misc/examples/utf8replace_c.c
@@ -14,7 +14,7 @@ int main() {
printf("%s\n", cstr_str(&hello));
c_FOREACH (c, cstr, hello)
- printf("%.*s,", c_ARGSV(c.u8.chr));
+ printf("%.*s,", c_SVARG(c.u8.chr));
str = cstr_lit("scooby, dooby doo");
cstr_replace(&str, "oo", "00");