StrIterMustMove
Description
Aborting variant of StrIterMove. Alias for IterMustMove; see IterMustMove for the full contract.
Parameters
| Name | Direction | Description |
|---|---|---|
si |
in | Pointer to the StrIter cursor to move. |
n |
in | Signed character offset; negative steps backward. |
Success
Cursor position is updated; returns to the caller.
Failure
Does not return – aborts via LOG_FATAL when the target position would be out of range.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Io.c:3208:
// zero-initialised; the only way it carries 'x'/'X' here is that
// the offset-1 peek succeeded, which proves 2 bytes are available.
StrIterMustMove(&si, 2);
StrIter hex_saved = si;- In
Io.c:3249:
// can only happen when the offset-1 peek succeeded, proving 2 bytes
// remain ahead of the cursor.
StrIterMustMove(&si, 2);
StrIter oct_saved = si;- In
Dns.c:276:
MemCompare(StrIterDataAt(&si, StrIterIndex(&si)), NS_KEYWORD, kw_len) == 0 &&
StrIterPeekAt(&si, (i64)kw_len, &sep) && (sep == ' ' || sep == '\t')) {
StrIterMustMove(&si, (i64)kw_len);
skip_hspace_iter(&si);- In
ProcMaps.c:123:
if (p3 == 'p')
perms |= PROC_MAP_PERM_PRIVATE;
StrIterMustMove(si, 4);
skip_ws(si);- In
JSON.c:513:
Zstr pos = StrIterPos(&si);
if (pos && ZstrCompareN(pos, "true", 4) == 0) {
StrIterMustMove(&si, 4);
*b = true;
return si;- In
JSON.c:525:
Zstr pos = StrIterPos(&si);
if (pos && ZstrCompareN(pos, "false", 5) == 0) {
StrIterMustMove(&si, 5);
*b = false;
return si;- In
JSON.c:563:
Zstr pos = StrIterPos(&si);
if (pos && ZstrCompareN(pos, "null", 4) == 0) {
StrIterMustMove(&si, 4);
*is_null = true;
return si;
Last updated on