StrIterFromZstr
Description
Construct a forward-walking StrIter over a NUL-terminated Zstr. Alias-reframe of the IterInitFromVec shape: length is taken from ZstrLen(s), alignment is fixed at 1. See IterInitFromVec for the overall borrowed-data semantics.
Parameters
| Name | Direction | Description |
|---|---|---|
s |
in | NUL-terminated string. Must outlive the iterator. |
Success
Returns a compound-literal StrIter covering [s, s + ZstrLen(s)) with pos = 0, dir = 1. The NUL terminator is not part of the iterated range.
Failure
Macro cannot fail. Passing a non-NUL-terminated buffer is a usage error – ZstrLen would run past the end.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Io.c:819:
BufIter start = *iter;
u64 arg_index = 0;
StrIter fsi = StrIterFromZstr(fmtstr);
char fc = 0;- In
Io.c:1003:
static bool render_binary_fmt(Str *out, Zstr fmtstr, TypeSpecificIO *argv, u64 argc) {
u64 arg_index = 0;
StrIter fsi = StrIterFromZstr(fmtstr);
char fc = 0;
while (StrIterPeek(&fsi, &fc)) {- In
Io.c:2521:
}
StrIter si = StrIterFromZstr(i);
char c = 0;- In
Io.c:2634:
}
StrIter si = StrIterFromZstr(i);
char c = 0;- In
Io.c:2753:
} \
\
StrIter si = StrIterFromZstr(i); \
char c = 0; \
\
- In
Io.c:3051:
ValidateBitVec(bv);
StrIter si = StrIterFromZstr(i);
char c = 0;- In
Io.c:3187:
ValidateInt(value);
StrIter si = StrIterFromZstr(i);
char c = 0;- In
Io.c:3284:
ValidateFloat(value);
StrIter si = StrIterFromZstr(i);
char c = 0;- In
Io.c:3340:
}
StrIter si = StrIterFromZstr(i);
char c = 0;- In
ArgParse.c:80:
if (!s || !*s)
return false;
StrIter si = StrIterFromZstr(s);
u64 v = 0;
char c; size aug_end_pos = IterIndex(body) + aug_len;
StrIter aug_it = StrIterFromZstr(augmentation + 1);
char a;
while (StrIterRead(&aug_it, &a)) {- In
Dns.c:26:
return false;
}
StrIter si = StrIterFromZstr(name);
u64 total_bytes = 0;
char c;
Last updated on