StrBegin
Description
Pointer to the first character of the string. Equivalent to str->data.
Parameters
| Name | Direction | Description |
|---|---|---|
str |
in | String to query. |
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Log.c:58:
File out = (type == LOG_MESSAGE_TYPE_INFO) ? FileFromFd(1) : FileFromFd(2);
(void)FileWrite(&out, StrBegin(&full), StrLen(&full));
#if FEATURE_SYS_BACKTRACE && (!defined(LOG_NO_BACKTRACE) || !LOG_NO_BACKTRACE)- In
Log.c:71:
// boundary; pass at the call site, no intermediate variable.
FormatStackTrace(&trace, frames, n, ALLOCATOR_OF(&h));
(void)FileWrite(&out, StrBegin(&trace), StrLen(&trace));
StrDeinit(&trace);
}- In
Io.c:511:
ok = false;
} else if (StrLen(&tmp)) {
MemCopy(StrBegin(o) + offset, StrBegin(&tmp), StrLen(&tmp));
}
}- In
Io.c:543:
}
if (ok && StrLen(&out) > 0 && FileWrite(stream, StrBegin(&out), StrLen(&out)) != (i64)StrLen(&out)) {
LOG_ERROR("Failed to write formatted output");
ok = false;- In
Io.c:620:
bool spec_ok = false;
StrInitStack(spec_buf, 32) {
char *data = StrBegin(&spec_buf);
MemCopy(data, start, spec_len);
data[spec_len] = '\0';- In
Io.c:1084:
ok = false;
} else if (StrLen(&tmp)) {
MemCopy(BufData(out) + offset, StrBegin(&tmp), StrLen(&tmp));
}
}- In
Io.c:1115:
StrPushBackR(&buffer, buf_byte);
}
str_read_fmt(StrBegin(&buffer), fmtstr, argv, argc);
} else {
// Remember the start position so we can rewind after a parse
- In
Io.c:1133:
if (file_len > 0) {
StrReserve(&buffer, (u64)file_len);
i64 got = FileRead(file, StrBegin(&buffer), (u64)file_len);
if (got < 0) {
LOG_ERROR("FileRead failed during f_read_fmt");- In
Io.c:1144:
if (StrLen(&buffer)) {
Zstr new_pos = str_read_fmt(StrBegin(&buffer), fmtstr, argv, argc);
if (!new_pos) {
LOG_ERROR("Parse failed, rolling back...");- In
Io.c:1150:
} else {
// Advance the channel position past the bytes we consumed.
i64 consumed = (i64)(new_pos - StrBegin(&buffer));
(void)FileSeek(file, cur_pos + consumed, FILE_SEEK_SET);
}- In
Io.c:1293:
bool ok = true;
StrInitStack(digits, 32) {
char *data = StrBegin(&digits);
u32 digit_count = 0;- In
Io.c:1348:
{
Zstr body = StrBegin(&canonical);
Zstr dot = NULL;
u64 prefix = 0;- In
Io.c:1355:
result = StrInit(alloc);
if (StrBegin(&canonical)[0] == '-') {
if (!StrPushBackR(&result, '-')) {
goto fail;- In
Io.c:1474:
exponent = value->exponent + (i64)StrLen(&digits) - 1;
if (!StrPushBackR(&result, StrBegin(&digits)[0])) {
goto fail;
}- In
Io.c:1485:
for (u64 i = 0; i < frac_digits; i++) {
if (i + 1 < StrLen(&digits)) {
if (!StrPushBackR(&result, StrBegin(&digits)[i + 1])) {
goto fail;
}- In
Io.c:1673:
if (fmt_info->flags & FMT_FLAG_CHAR) {
if (!write_char_internal(o, fmt_info->flags, (Zstr)StrBegin(s), len)) {
return false;
}- In
Io.c:2374:
// the slice is handed to the typed `StrToU64` / `StrToI64` parser.
static bool is_valid_numeric_string(const Str *str, bool allow_float) {
if (!str || !StrBegin(str))
return false;- In
Io.c:2378:
size len = StrLen(str);
const char *data = StrBegin(str);
if (len == 0)- In
Io.c:2671:
// a malformed integer; the parser proper would accept the leading
// '0' and silently lose the prefix, so reject early.
if (StrLen(&temp) == 2 && StrBegin(&temp)[0] == '0' &&
(StrBegin(&temp)[1] == 'x' || StrBegin(&temp)[1] == 'X' || StrBegin(&temp)[1] == 'b' ||
StrBegin(&temp)[1] == 'B' || StrBegin(&temp)[1] == 'o' || StrBegin(&temp)[1] == 'O')) {- In
Io.c:2672:
// '0' and silently lose the prefix, so reject early.
if (StrLen(&temp) == 2 && StrBegin(&temp)[0] == '0' &&
(StrBegin(&temp)[1] == 'x' || StrBegin(&temp)[1] == 'X' || StrBegin(&temp)[1] == 'b' ||
StrBegin(&temp)[1] == 'B' || StrBegin(&temp)[1] == 'o' || StrBegin(&temp)[1] == 'O')) {
LOG_ERROR("Incomplete number format");- In
Io.c:2673:
if (StrLen(&temp) == 2 && StrBegin(&temp)[0] == '0' &&
(StrBegin(&temp)[1] == 'x' || StrBegin(&temp)[1] == 'X' || StrBegin(&temp)[1] == 'b' ||
StrBegin(&temp)[1] == 'B' || StrBegin(&temp)[1] == 'o' || StrBegin(&temp)[1] == 'O')) {
LOG_ERROR("Incomplete number format");
StrDeinit(&temp);- In
Io.c:2778:
Str temp = StrInitFromCstr(start, pos, &scratch); \
\
if (StrLen(&temp) == 2 && StrBegin(&temp)[0] == '0' && \
(StrBegin(&temp)[1] == 'x' || StrBegin(&temp)[1] == 'X' || StrBegin(&temp)[1] == 'b' || \
StrBegin(&temp)[1] == 'B' || StrBegin(&temp)[1] == 'o' || StrBegin(&temp)[1] == 'O')) { \
- In
Io.c:2779:
\
if (StrLen(&temp) == 2 && StrBegin(&temp)[0] == '0' && \
(StrBegin(&temp)[1] == 'x' || StrBegin(&temp)[1] == 'X' || StrBegin(&temp)[1] == 'b' || \
StrBegin(&temp)[1] == 'B' || StrBegin(&temp)[1] == 'o' || StrBegin(&temp)[1] == 'O')) { \
LOG_ERROR("Incomplete number format"); \
- In
Io.c:2780:
if (StrLen(&temp) == 2 && StrBegin(&temp)[0] == '0' && \
(StrBegin(&temp)[1] == 'x' || StrBegin(&temp)[1] == 'X' || StrBegin(&temp)[1] == 'b' || \
StrBegin(&temp)[1] == 'B' || StrBegin(&temp)[1] == 'o' || StrBegin(&temp)[1] == 'O')) { \
LOG_ERROR("Incomplete number format"); \
StrDeinit(&temp); \
- In
Io.c:2887:
// the caller owns and may mutate the returned buffer. ZstrDupN's Zstr
// return is just the project-wide convention for fresh allocations.
result = (char *)ZstrDupN(StrBegin(&temp), StrLen(&temp), allocator_ptr);
if (!result) {
LOG_ERROR("Failed to allocate memory for string");- In
Io.c:3167:
);
*bv = BitVecFromStr(StrBegin(&bin_str), BitVecAllocator(bv));
StrDeinit(&bin_str);- In
Io.c:3246:
Str temp = StrInitFromCstr(start, StrIterIndex(&si) - StrIterIndex(&saved), IntAllocator(value));
Int parsed = IntInit(IntAllocator(value));
bool ok = IntTryFromStrRadix(&parsed, StrBegin(&temp), radix);
if (!ok) {- In
Io.c:3310:
StrDeinit(&temp);
temp = StrInitFromCstr(start, token_len, FloatAllocator(value));
if (!FloatTryFromStr(&parsed, StrBegin(&temp))) {
StrDeinit(&temp);
FloatDeinit(&parsed);- In
ArgParse.c:500:
break;
}
char *data = StrBegin(&flagbuf);
MemCopy(data, tok, n);
data[n] = '\0';- In
ArgParse.c:587:
bool iter_ok = false;
StrInitStack(buf, 3) {
char *data = StrBegin(&buf);
data[0] = '-';
data[1] = *p;- In
ArgParse.c:684:
} decision = BUNDLE_REJECT;
StrInitStack(two, 3) {
char *data = StrBegin(&two);
data[0] = '-';
data[1] = tok[1];- In
BitVec.c:1862:
bool result = false;
if (ZstrFindSubstring(StrBegin(&bv_str), pattern) != NULL) {
result = true;
}- In
BitVec.c:1879:
bool result = false;
if (ZstrFindSubstringN(StrBegin(&bv_str), StrBegin(pattern), StrLen(pattern)) != NULL) {
result = true;
}- In
Float.c:591:
LOG_FATAL("Invalid arguments");
}
return float_try_from_str_impl(out, StrBegin(text), StrLen(text));
}- In
Str.c:193:
min = StrLen(a) < StrLen(b) ? StrLen(a) : StrLen(b);
cmp = MemCompare(StrBegin(a), StrBegin(b), min);
if (cmp != 0) {- In
Str.c:215:
i32 str_cmp_zstr(const Str *s, Zstr other) {
ValidateStr(s);
return ZstrCompare(StrBegin(s), other);
}- In
Str.c:220:
i32 str_cmp_cstr(const Str *s, Zstr other, size other_len) {
ValidateStr(s);
return ZstrCompareN(StrBegin(s), other, other_len);
}- In
Str.c:226:
ValidateStr(s);
ValidateStr(other);
return ZstrCompareIgnoreCase(StrBegin(s), StrBegin(other));
}- In
Str.c:231:
i32 str_cmp_zstr_ignore_case(const Str *s, Zstr other) {
ValidateStr(s);
return ZstrCompareIgnoreCase(StrBegin(s), other);
}- In
Str.c:236:
i32 str_cmp_cstr_ignore_case(const Str *s, Zstr other, size other_len) {
ValidateStr(s);
return ZstrCompareNIgnoreCase(StrBegin(s), other, other_len);
}- In
Str.c:241:
Zstr str_find_cstr(const Str *s, Zstr key, size key_len) {
ValidateStr(s);
return ZstrFindSubstringN(StrBegin(s), key, key_len);
}- In
Str.c:246:
Zstr str_find_zstr(const Str *s, Zstr key) {
ValidateStr(s);
return ZstrFindSubstring(StrBegin(s), key);
}- In
Str.c:252:
ValidateStr(s);
ValidateStr(key);
return ZstrFindSubstringN(StrBegin(s), StrBegin(key), StrLen(key));
}- In
Str.c:597:
bool ok = true;
StrInitStack(buffer, 65) {
char *data = StrBegin(&buffer);
size pos = 0;- In
Str.c:778:
bool ok = true;
StrInitStack(exp_buf, 8) {
char *data = StrBegin(&exp_buf);
size exp_pos = 0;
while (exp > 0) {- In
Str.c:809:
bool ok = true;
StrInitStack(int_buf, 32) {
char *data = StrBegin(&int_buf);
size int_pos = 0;
while (int_part > 0) {- In
Int.c:647:
}
return int_try_from_str_radix_impl(out, StrBegin(decimal), StrLen(decimal), start, 10, true);
}- In
Int.c:705:
}
return int_try_from_str_radix_impl(out, StrBegin(digits), StrLen(digits), start, radix, true);
}- In
Int.c:817:
}
return int_try_from_str_radix_impl(out, StrBegin(binary), StrLen(binary), start, 2, true);
}- In
Int.c:866:
}
return int_try_from_str_radix_impl(out, StrBegin(octal), StrLen(octal), start, 8, true);
}- In
Int.c:903:
}
return int_try_from_str_radix_impl(out, StrBegin(hex), StrLen(hex), 0, 16, false);
}- In
PdbCache.c:38:
*out_path = StrInit(StrAllocator(out_path));
StrPushBackMany(out_path, cv->pdb_path);
if (sys_path_exists(StrBegin(out_path)))
return true;- In
PdbCache.c:51:
StrPushBackR(out_path, '/');
StrPushBackMany(out_path, pdb_base);
if (sys_path_exists(StrBegin(out_path)))
return true;- In
PdbCache.c:70:
Str pdb_path = StrInit(alloc);
if (!find_pdb(&entry->pe, StrBegin(&entry->module_path), &pdb_path)) {
StrDeinit(&pdb_path);
return false;- In
PdbCache.c:96:
for (size i = 0; i < VecLen(&self->entries); ++i) {
PdbCacheEntry *e = VecPtrAt(&self->entries, i);
if (StrBegin(&e->module_path) && ZstrCompare(StrBegin(&e->module_path), module_path) == 0) {
return e;
}- In
PdbCache.c:179:
return false;
}
return pdb_cache_resolve_zstr(self, StrBegin(module_path), module_base, runtime_ip, out_name, out_offset);
}- In
Backtrace.c:225:
if (pdb_cache_ok) {
StrInitStack(module_path, MAX_PATH) {
char *data = StrBegin(&module_path);
u64 module_base = 0;
if (win_module_for_ip(frames[i].ip, data, MAX_PATH, &module_base)) { append_build_id_path(&path, main->build_id, main->build_id_size);
StrPushBackMany(&path, ".debug");
if (sys_path_exists(StrBegin(&path)) && ElfOpen(out, &path, alloc)) {
if (sidecar_matches(main, out, /*by_build_id*/ true)) {
StrDeinit(&path); StrPushBackR(&path, '/');
StrPushBackMany(&path, main->debuglink_name);
if (sys_path_exists(StrBegin(&path)) && ElfOpen(out, &path, alloc)) {
if (sidecar_matches(main, out, /*by_build_id*/ false)) {
StrDeinit(&path); StrPushBackMany(&path, "/.debug/");
StrPushBackMany(&path, main->debuglink_name);
if (sys_path_exists(StrBegin(&path)) && ElfOpen(out, &path, alloc)) {
if (sidecar_matches(main, out, /*by_build_id*/ false)) {
StrDeinit(&path); StrPushBackR(&path, '/');
StrPushBackMany(&path, main->debuglink_name);
if (sys_path_exists(StrBegin(&path)) && ElfOpen(out, &path, alloc)) {
if (sidecar_matches(main, out, /*by_build_id*/ false)) {
StrDeinit(&path);- In
Socket.c:153:
bool iter_ok = true;
StrInitStack(tmp, 4) {
char *data = StrBegin(&tmp);
i32 n = 0;
if (v == 0) {- In
Socket.c:186:
bool ok = true;
StrInitStack(tmp, 4) {
char *data = StrBegin(&tmp);
i32 n = 0;
if (v == 0) {- In
Socket.c:394:
bool ok = false;
StrInitStack(host, 256) {
char *host_data = StrBegin(&host);
Zstr port_str = NULL;
if (!split_host_port(spec, host_data, 256, &port_str)) {- In
Socket.c:454:
// semantics for non-degenerate input. The empty-spec edge case is
// already handled by the zstr arm (returns false on no colon).
return socket_addr_parse_zstr(out, StrBegin(spec), kind);
}- In
Socket.c:464:
StrInitStack(host, 48) {
char *host_data = StrBegin(&host);
u16 port = 0;
if (addr->family == SOCKET_FAMILY_INET) {- In
Proc.c:231:
}
if (!CreateProcessA(NULL, StrBegin(&cmdline), NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi)) {
LOG_ERROR("CreateProcessA() failed (GetLastError={})", (i32)GetLastError());
StrDeinit(&cmdline);- In
Proc.c:471:
#if PLATFORM_UNIX
return direct_sys3(MISRA_SYS_write, (long)(proc->_stdin_fd), (long)(u64)(StrBegin(buf)), (long)(StrLen(buf)));
#else
DWORD written = 0;- In
Proc.c:474:
#else
DWORD written = 0;
if (!WriteFile(proc->_hStdinWrite, StrBegin(buf), StrLen(buf), &written, NULL))
return -1;
return (int)written;- In
Proc.c:500:
while (true) {
ssize_t n = direct_sys3(MISRA_SYS_read, (long)(rfd), (long)(u64)(StrBegin(&tmpbuf)), (long)(1023));
if (n > 0) {
StrResize(&tmpbuf, (size)n);- In
Proc.c:539:
DWORD bytes_read = 0;
if (!ReadFile(rhandle, StrBegin(&tmpbuf), 1023, &bytes_read, NULL)) {
LOG_ERROR("ReadFile failed (GetLastError={})", (i32)GetLastError());
total_read = -1;- In
Proc.c:648:
bool got = false;
StrInitStack(buffer, MAX_PATH) {
DWORD len = GetModuleFileNameA(NULL, StrBegin(&buffer), MAX_PATH);
if (len == 0 || len >= MAX_PATH) {
LOG_ERROR("Failed to get executable path or buffer too small");- In
Proc.c:665:
bool got = false;
StrInitStack(buffer, 4096) {
char *data = StrBegin(&buffer);
ssize_t len = proc_readlink("/proc/self/exe", data, 4095);
if (len >= 0) {- In
Dir.c:83:
break;
}
char *data = StrBegin(&search_path);
MemCopy(data, path, path_len);
data[path_len] = '\\';- In
Dir.c:479:
i8 ok = 1;
StrInitStack(buf, 4096) {
char *data = StrBegin(&buf);
MemCopy(data, path, n);
data[n] = 0;- In
Dir.c:547:
for (size i = 0; i < VecLen(&dc); ++i) {
DirEntry *e = VecPtrAt(&dc, i);
Zstr entry_nm = StrBegin(&e->name);
if (ZstrCompare(entry_nm, ".") == 0 || ZstrCompare(entry_nm, "..") == 0) {
continue;- In
MachoCache.c:42:
for (size i = 0; i < VecLen(&self->entries); ++i) {
MachoCacheEntry *e = VecPtrAt(&self->entries, i);
if (StrBegin(&e->module_path) && ZstrCompare(StrBegin(&e->module_path), module_path) == 0) {
return e;
}- In
MachoCache.c:84:
Str path = StrInit(alloc);
if (!compose_dsym_path(StrBegin(&e->module_path), &path)) {
StrDeinit(&path);
return false;- In
MachoCache.c:88:
return false;
}
if (!sys_path_exists(StrBegin(&path)) || !MachoOpen(&e->dsym, &path, alloc)) {
StrDeinit(&path);
return false;- In
MachoCache.c:215:
return false;
}
return macho_cache_resolve_zstr(self, StrBegin(module_path), slide, runtime_ip, out_name, out_offset);
}- In
Dns.c:108:
bool ok = true;
StrInitStack(chunk, 4096) {
char *data = StrBegin(&chunk);
for (;;) {
i64 n = FileRead(&f, data, 4096);- In
Dns.c:189:
StrInitStack(ip_buf, 64) {
StrPushBackMany(&ip_buf, (Zstr)StrIterDataAt(&si, ip_start), ip_len);
got_v4 = parse_ipv4(StrBegin(&ip_buf), v4);
if (!got_v4) {
got_v6 = parse_ipv6(StrBegin(&ip_buf), v6);- In
Dns.c:191:
got_v4 = parse_ipv4(StrBegin(&ip_buf), v4);
if (!got_v4) {
got_v6 = parse_ipv6(StrBegin(&ip_buf), v6);
}
}- In
Dns.c:218:
HostsEntry e = {0};
e.name = StrInitFromCstr((Zstr)StrIterDataAt(&si, nm_start), nm_len, alloc);
ascii_lower((u8 *)StrBegin(&e.name), StrLen(&e.name));
if (got_v4) {
MemCopy(e.ip, v4, 4);- In
Dns.c:289:
u8 v4[4] = {0};
u8 v6[16] = {0};
if (parse_ipv4(StrBegin(&ip_buf), v4)) {
SocketAddr a = sockaddr_v4(v4, 53);
VecPushBackR(out, a);- In
Dns.c:292:
SocketAddr a = sockaddr_v4(v4, 53);
VecPushBackR(out, a);
} else if (parse_ipv6(StrBegin(&ip_buf), v6)) {
SocketAddr a = sockaddr_v6(v6, 53);
VecPushBackR(out, a);- In
Dns.c:499:
// is a valid Zstr for the matchers / DNS query below.
normalize_hostname(hostname, &norm);
Zstr nq = StrBegin(&norm);
// 1. /etc/hosts fast path.
- In
Dns.c:503:
// 1. /etc/hosts fast path.
VecForeachPtr(&self->hosts, e) {
if (StrLen(&e->name) > 0 && ZstrCompare(StrBegin(&e->name), nq) == 0) {
SocketAddr a = e->is_ipv6 ? sockaddr_v6(e->ip, port) : sockaddr_v4(e->ip, port);
VecPushBackR(out, a);- In
Dns.c:604:
StrInitStack(host, 256) {
StrPushBackMany(&host, spec, colon_at);
ok = dns_resolve_5_zstr(self, StrBegin(&host), port, kind, out);
}
return ok;- In
Dns.c:613:
return false;
}
return dns_resolve_5_zstr(self, StrBegin(hostname), port, kind, out);
}- In
Dns.c:620:
return false;
}
return dns_resolve_4_vec_zstr(self, StrBegin(spec), kind, out);
}- In
Dns.c:641:
return false;
}
return dns_resolve_4_one_zstr(self, StrBegin(spec), kind, out);
}- In
Http.c:63:
}
VecForeachPtr(headers, header) {
if (0 == ZstrCompare(StrBegin(&header->key), key)) {
return header;
}- In
Http.c:76:
// Str values are NUL-terminated by construction; comparison scans
// to '\0', so forward the .data view.
return http_headers_find_zstr(headers, StrBegin(key));
}- In
Http.c:84:
static HttpRequestMethod http_request_method_from_str(const Str *mstr) {
if (!mstr || !StrBegin(mstr)) {
return HTTP_REQUEST_METHOD_UNKNOWN;
}- In
Http.c:87:
return HTTP_REQUEST_METHOD_UNKNOWN;
}
if (0 == ZstrCompareN(StrBegin(mstr), "GET", 3) && StrLen(mstr) == 3)
return HTTP_REQUEST_METHOD_GET;
if (0 == ZstrCompareN(StrBegin(mstr), "POST", 4) && StrLen(mstr) == 4)- In
Http.c:89:
if (0 == ZstrCompareN(StrBegin(mstr), "GET", 3) && StrLen(mstr) == 3)
return HTTP_REQUEST_METHOD_GET;
if (0 == ZstrCompareN(StrBegin(mstr), "POST", 4) && StrLen(mstr) == 4)
return HTTP_REQUEST_METHOD_POST;
if (0 == ZstrCompareN(StrBegin(mstr), "DELETE", 6) && StrLen(mstr) == 6)- In
Http.c:91:
if (0 == ZstrCompareN(StrBegin(mstr), "POST", 4) && StrLen(mstr) == 4)
return HTTP_REQUEST_METHOD_POST;
if (0 == ZstrCompareN(StrBegin(mstr), "DELETE", 6) && StrLen(mstr) == 6)
return HTTP_REQUEST_METHOD_DELETE;
if (0 == ZstrCompareN(StrBegin(mstr), "PUT", 3) && StrLen(mstr) == 3)- In
Http.c:93:
if (0 == ZstrCompareN(StrBegin(mstr), "DELETE", 6) && StrLen(mstr) == 6)
return HTTP_REQUEST_METHOD_DELETE;
if (0 == ZstrCompareN(StrBegin(mstr), "PUT", 3) && StrLen(mstr) == 3)
return HTTP_REQUEST_METHOD_PUT;
if (0 == ZstrCompareN(StrBegin(mstr), "PATCH", 5) && StrLen(mstr) == 5)- In
Http.c:95:
if (0 == ZstrCompareN(StrBegin(mstr), "PUT", 3) && StrLen(mstr) == 3)
return HTTP_REQUEST_METHOD_PUT;
if (0 == ZstrCompareN(StrBegin(mstr), "PATCH", 5) && StrLen(mstr) == 5)
return HTTP_REQUEST_METHOD_PATCH;
if (0 == ZstrCompareN(StrBegin(mstr), "HEAD", 4) && StrLen(mstr) == 4)- In
Http.c:97:
if (0 == ZstrCompareN(StrBegin(mstr), "PATCH", 5) && StrLen(mstr) == 5)
return HTTP_REQUEST_METHOD_PATCH;
if (0 == ZstrCompareN(StrBegin(mstr), "HEAD", 4) && StrLen(mstr) == 4)
return HTTP_REQUEST_METHOD_HEAD;
if (0 == ZstrCompareN(StrBegin(mstr), "OPTIONS", 7) && StrLen(mstr) == 7)- In
Http.c:99:
if (0 == ZstrCompareN(StrBegin(mstr), "HEAD", 4) && StrLen(mstr) == 4)
return HTTP_REQUEST_METHOD_HEAD;
if (0 == ZstrCompareN(StrBegin(mstr), "OPTIONS", 7) && StrLen(mstr) == 7)
return HTTP_REQUEST_METHOD_OPTIONS;
if (0 == ZstrCompareN(StrBegin(mstr), "CONNECT", 7) && StrLen(mstr) == 7)- In
Http.c:101:
if (0 == ZstrCompareN(StrBegin(mstr), "OPTIONS", 7) && StrLen(mstr) == 7)
return HTTP_REQUEST_METHOD_OPTIONS;
if (0 == ZstrCompareN(StrBegin(mstr), "CONNECT", 7) && StrLen(mstr) == 7)
return HTTP_REQUEST_METHOD_CONNECT;
if (0 == ZstrCompareN(StrBegin(mstr), "TRACE", 5) && StrLen(mstr) == 5)- In
Http.c:103:
if (0 == ZstrCompareN(StrBegin(mstr), "CONNECT", 7) && StrLen(mstr) == 7)
return HTTP_REQUEST_METHOD_CONNECT;
if (0 == ZstrCompareN(StrBegin(mstr), "TRACE", 5) && StrLen(mstr) == 5)
return HTTP_REQUEST_METHOD_TRACE;
return HTTP_REQUEST_METHOD_UNKNOWN;- In
Http.c:126:
}
if (0 != ZstrCompareN(StrBegin(&version), "HTTP/1.1", 8)) {
LOG_ERROR("invalid/unsupported HTTP version");
StrDeinit(&method);- In
Http.c:184:
// parser scans format-by-format with NUL-aware readers, so the
// .data view is sufficient.
return http_request_parse_zstr(req, StrBegin(in));
}- In
Http.c:449:
LOG_FATAL("invalid arguments");
}
return http_respond_with_file_zstr(response, status, content_type, (Zstr)StrBegin(filepath));
}
#endif- In
Http.c:488:
if (StrLen(&response->body)) {
if (!StrPushBackMany(&out, StrBegin(&response->body), StrLen(&response->body))) {
LOG_ERROR("HttpResponseSerialize: failed to append body");
StrDeinit(&out);- In
KvConfig.c:51:
}
parsed = ZstrToI64(StrBegin(value), &endptr);
if (!endptr || endptr == StrBegin(value) || *endptr != '\0') {- In
KvConfig.c:53:
parsed = ZstrToI64(StrBegin(value), &endptr);
if (!endptr || endptr == StrBegin(value) || *endptr != '\0') {
return false;
}- In
KvConfig.c:69:
}
parsed = ZstrToF64(StrBegin(value), &endptr);
if (!endptr || endptr == StrBegin(value) || *endptr != '\0') {- In
KvConfig.c:71:
parsed = ZstrToF64(StrBegin(value), &endptr);
if (!endptr || endptr == StrBegin(value) || *endptr != '\0') {
return false;
}- In
KvConfig.c:362:
}
return StrInitFromCstr(StrBegin(value), StrLen(value), MapAllocator(cfg));
}- In
KvConfig.c:372:
}
return StrInitFromCstr(StrBegin(value), StrLen(value), MapAllocator(cfg));
}- In
JSON.c:412:
Zstr end = NULL;
if (is_flt) {
num->f = ZstrToF64(StrBegin(&ns), &end);
} else {
num->i = ZstrToI64(StrBegin(&ns), &end);- In
JSON.c:414:
num->f = ZstrToF64(StrBegin(&ns), &end);
} else {
num->i = ZstrToI64(StrBegin(&ns), &end);
}
if (end == StrBegin(&ns)) {- In
JSON.c:416:
num->i = ZstrToI64(StrBegin(&ns), &end);
}
if (end == StrBegin(&ns)) {
LOG_ERROR("Failed to convert string to number.");
StrDeinit(&ns);- In
Elf.c:551:
if (!self || !name)
return NULL;
return elf_find_section_zstr(self, StrBegin(name));
}- In
Dwarf.c:643:
u64 fo = VecAt(&pending_file_offsets, i);
u64 dofs = VecAt(&pending_dir_offsets, i);
VecPtrAt(&out->entries, i)->file = fo ? (Zstr)(StrBegin(&out->string_pool) + fo) : NULL;
VecPtrAt(&out->entries, i)->dir = dofs ? (Zstr)(StrBegin(&out->string_pool) + dofs) : NULL;
}- In
Dwarf.c:644:
u64 dofs = VecAt(&pending_dir_offsets, i);
VecPtrAt(&out->entries, i)->file = fo ? (Zstr)(StrBegin(&out->string_pool) + fo) : NULL;
VecPtrAt(&out->entries, i)->dir = dofs ? (Zstr)(StrBegin(&out->string_pool) + dofs) : NULL;
}
}- In
DwarfInfo.c:614:
.low_pc = pf->low_pc,
.high_pc = pf->high_pc,
.name = StrBegin(&out->string_pool) + pf->name_offset_in_pool,
};
if (!VecPushBackR(&out->entries, f)) {- In
Pdb.c:669:
.rva = pp->rva,
.size = 0,
.name = StrBegin(&self->name_pool) + pp->name_offset_in_pool,
};
if (i + 1 < VecLen(&pending)) {- In
Dns.c:88:
// Str values are NUL-terminated by construction; encode_qname scans
// to '\0', so forward the Str's data view directly.
return dns_build_query_zstr(out, id, StrBegin(name), type);
}- In
Pe.c:592:
if (!self || !name)
return NULL;
return pe_find_section_zstr(self, StrBegin(name));
}- In
Resolve.c:49:
// bracket form on v6 to round-trip through SocketAddrParse.
size n = StrLen(&s);
Zstr p = StrBegin(&s);
if (n >= 2 && p[n - 1] == '0' && p[n - 2] == ':') {
StrMustResize(&s, n - 2);- In
Beam.c:253:
HttpRequest req = HttpRequestInit(scope);
Zstr end = HttpRequestParse(&req, (Zstr)StrBegin(&raw));
if (end == StrBegin(&raw)) {
LOG_INFO("[{}] (unparseable request, {} bytes)", client_addr, (u64)prefix_len);- In
Beam.c:254:
HttpRequest req = HttpRequestInit(scope);
Zstr end = HttpRequestParse(&req, (Zstr)StrBegin(&raw));
if (end == StrBegin(&raw)) {
LOG_INFO("[{}] (unparseable request, {} bytes)", client_addr, (u64)prefix_len);
} else {- In
Beam.c:370:
if ((size)first_n < sizeof(first)) {
first[first_n] = 0;
log_request_summary(StrBegin(&peer_str), first, (size)first_n);
} else {
LOG_INFO("[{}] (request larger than {} bytes, not logging line)", peer_str, (u64)sizeof(first));- In
VecStr.c:28:
// empty fresh Str.
Str copy = (StrLen(src) == 0) ? StrInit((Allocator *)alloc) :
StrInitFromCstr(StrBegin(src), StrLen(src), (Allocator *)alloc);
*(Str *)dst_ptr = copy;
return true; WriteFmt(
"[DEBUG] Whitespace variations test passed - name: {}, value: {}, flag: {}\n",
StrBegin(&obj.name),
obj.value,
obj.flag ? "true" : "false" WriteFmt(
"[DEBUG] Whitespace variations test FAILED - name: {}, value: {}, flag: {}\n",
StrBegin(&obj.name),
obj.value,
obj.flag ? "true" : "false" // Remove whitespace from both strings for comparison
for (u64 i = 0; i < StrLen(output); i++) {
char c = StrBegin(output)[i];
if (c != ' ' && c != '\n' && c != '\r' && c != '\t') {
StrPushBackR(&output_clean, c);
for (u64 i = 0; i < StrLen(&expected_str); i++) {
char c = StrBegin(&expected_str)[i];
if (c != ' ' && c != '\n' && c != '\r' && c != '\t') {
StrPushBackR(&expected_clean, c); WriteFmt("[DEBUG] Expected: '");
for (u64 i = 0; i < StrLen(&expected_clean); i++) {
WriteFmt("{c}", StrBegin(&expected_clean)[i]);
}
WriteFmt("'\n"); WriteFmt("[DEBUG] Got: '");
for (u64 i = 0; i < StrLen(&output_clean); i++) {
WriteFmt("%c", StrBegin(&output_clean)[i]);
}
WriteFmt("'\n"); StrAppendFmt(&source_key, "{}", source_id);
JW_OBJ_KV(json, StrBegin(&source_key), {
if (VecLen(&response.data) > 0) {
AnnSymbol *s = &VecAt(&response.data, 0); StrAppendFmt(&target_key, "{}", s->target_function_id);
JW_OBJ_KV(json, StrBegin(&target_key), {
JW_FLT_KV(json, "distance", s->distance);
JW_INT_KV(json, "nearest_neighbor_analysis_id", s->analysis_id); StrAppendFmt(&source_key, "{}", symbol.source_function_id);
JW_OBJ_KV(json, StrBegin(&source_key), {
Str target_key = StrInit(&alloc);
StrAppendFmt(&target_key, "{}", symbol.target_function_id); StrAppendFmt(&target_key, "{}", symbol.target_function_id);
JW_OBJ_KV(json, StrBegin(&target_key), {
JW_FLT_KV(json, "distance", symbol.distance);
JW_STR_KV(json, "name", symbol.function_name); // Remove spaces and newlines from both strings for comparison
for (size i = 0; i < StrLen(output); i++) {
char c = StrBegin(output)[i];
if (c != ' ' && c != '\n' && c != '\r' && c != '\t') {
StrPushBackR(&output_clean, c);
for (size i = 0; i < StrLen(&expected_str); i++) {
char c = StrBegin(&expected_str)[i];
if (c != ' ' && c != '\n' && c != '\r' && c != '\t') {
StrPushBackR(&expected_clean, c); WriteFmt("[DEBUG] Expected: '");
for (size i = 0; i < StrLen(&expected_clean); i++) {
WriteFmt("{c}", StrBegin(&expected_clean)[i]);
}
WriteFmt("'\n"); WriteFmt("[DEBUG] Got: '");
for (size i = 0; i < StrLen(&output_clean); i++) {
WriteFmt("{c}", StrBegin(&output_clean)[i]);
}
WriteFmt("'\n"); // Remove spaces and newlines from both strings for comparison
for (size i = 0; i < StrLen(output); i++) {
char c = StrBegin(output)[i];
if (c != ' ' && c != '\n' && c != '\r' && c != '\t') {
StrPushBackR(&output_clean, c);
for (size i = 0; i < StrLen(&expected_str); i++) {
char c = StrBegin(&expected_str)[i];
if (c != ' ' && c != '\n' && c != '\r' && c != '\t') {
StrPushBackR(&expected_clean, c); WriteFmt("[DEBUG] Expected: '");
for (u64 i = 0; i < StrLen(&expected_clean); i++) {
WriteFmt("{c}", StrBegin(&expected_clean)[i]);
}
WriteFmtLn("'"); WriteFmt("[DEBUG] Got: '");
for (u64 i = 0; i < StrLen(&output_clean); i++) {
WriteFmt("{c}", StrBegin(&output_clean)[i]);
}
WriteFmtLn("'");
// For large numbers, just check that valid JSON was produced
if (StrLen(&json) > 0 && StrBegin(&json)[0] == '{' && StrBegin(&json)[StrLen(&json) - 1] == '}') {
WriteFmtLn("[DEBUG] Large numbers test passed - produced valid JSON structure");
} else {
// Just verify that valid JSON structure was produced
if (StrLen(&json) > 0 && StrBegin(&json)[0] == '{' && StrBegin(&json)[StrLen(&json) - 1] == '}') {
WriteFmtLn("[DEBUG] Special characters test passed - produced valid JSON");
} else {
// Verify valid JSON structure was produced
if (StrLen(&json) > 0 && StrBegin(&json)[0] == '{' && StrBegin(&json)[StrLen(&json) - 1] == '}') {
WriteFmtLn("[DEBUG] Escape sequences test passed - produced valid JSON");
} else {
// Check for reasonable float formatting (exact precision may vary)
if (StrLen(&json) > 0 && StrBegin(&json)[0] == '{' && StrBegin(&json)[StrLen(&json) - 1] == '}') {
WriteFmtLn("[DEBUG] Boundary floats test passed - JSON: {}", json);
} else { WriteFmt("[DEBUG] Name check failed: expected 'test', got '");
for (size i = 0; i < StrLen(&data.name); i++) {
WriteFmt("{c}", StrBegin(&data.name)[i]);
}
WriteFmt("'\n"); WriteFmt("[DEBUG] Profile name check failed: expected 'Alice', got '");
for (u64 i = 0; i < StrLen(&data.user.profile.name); i++) {
WriteFmt("{}", StrBegin(&data.user.profile.name)[i]);
}
WriteFmt("'\n"); WriteFmt("[DEBUG] Status check failed: expected 'active', got '");
for (size i = 0; i < StrLen(&data.status); i++) {
WriteFmt("{}", StrBegin(&data.status)[i]);
}
WriteFmt("'\n"); WriteFmt("[DEBUG] Engineering head check failed: expected 'John', got '");
for (size i = 0; i < StrLen(&data.company.departments.engineering.head); i++) {
WriteFmt("{c}", StrBegin(&data.company.departments.engineering.head)[i]);
}
WriteFmt("'\n"); WriteFmt("[DEBUG] Company name check failed: expected 'TechCorp', got '");
for (size i = 0; i < StrLen(&data.company.name); i++) {
WriteFmt("{c}", StrBegin(&data.company.name)[i]);
}
WriteFmt("'\n"); JR_OBJ_KV(si, "functions", {
// First level: source function ID from key
u64 source_function_id = (u64)ZstrToI64(StrBegin(&key), NULL);
JR_OBJ(si, {
// Second level: target function ID from key
JR_OBJ(si, {
// Second level: target function ID from key
u64 target_function_id = (u64)ZstrToI64(StrBegin(&key), NULL);
// Properly initialize all Str fields
if (response.status) {
JR_OBJ_KV(si, "data", {
u64 source_function_id = (u64)ZstrToI64(StrBegin(&key), NULL);
JR_OBJ(si, {
// Properly initialize all Str fields
sym.function_mangled_name = StrInit(&alloc);
sym.source_function_id = source_function_id;
sym.target_function_id = (u64)ZstrToI64(StrBegin(&key), NULL);
JR_OBJ(si, { WriteFmt("[DEBUG] Message check failed: expected 'Success', got '");
for (size i = 0; i < StrLen(&response.message); i++) {
WriteFmt("{c}", StrBegin(&response.message)[i]);
}
WriteFmt("'\n"); WriteFmt("[DEBUG] Analysis name check failed: expected 'test_analysis', got '");
for (size i = 0; i < StrLen(&sym->analysis_name); i++) {
WriteFmt("{c}", StrBegin(&sym->analysis_name)[i]);
}
WriteFmt("'\n"); WriteFmt("[DEBUG] SHA256 check failed: expected 'abc123', got '");
for (size i = 0; i < StrLen(&sym->sha256); i++) {
WriteFmt("{c}", StrBegin(&sym->sha256)[i]);
}
WriteFmt("'\n"); WriteFmt("[DEBUG] Mangled name check failed: expected '_Z4main', got '");
for (size i = 0; i < StrLen(&sym->function_mangled_name); i++) {
WriteFmt("{c}", StrBegin(&sym->function_mangled_name)[i]);
}
WriteFmt("'\n"); WriteFmt("[DEBUG] Function name check failed: expected 'test_func', got '");
for (size i = 0; i < StrLen(&info.name); i++) {
WriteFmt("{}", StrBegin(&info.name)[i]);
}
WriteFmt("'\n"); WriteFmt("[DEBUG] Model name check failed: expected 'test_model', got '");
for (size i = 0; i < StrLen(&info.name); i++) {
WriteFmt("{}", StrBegin(&info.name)[i]);
}
WriteFmt("'\n"); WriteFmt("[DEBUG] Binary name check failed: expected 'test_binary', got '");
for (size i = 0; i < StrLen(&result.binary_name); i++) {
WriteFmt("{c}", StrBegin(&result.binary_name)[i]);
}
WriteFmt("'\n"); WriteFmt("[DEBUG] SHA256 check failed: expected 'abc123', got '");
for (size i = 0; i < StrLen(&result.sha256); i++) {
WriteFmt("{c}", StrBegin(&result.sha256)[i]);
}
WriteFmt("'\n"); WriteFmt("[DEBUG] Model name check failed: expected 'test_model', got '");
for (size i = 0; i < StrLen(&result.model_name); i++) {
WriteFmt("{c}", StrBegin(&result.model_name)[i]);
}
WriteFmt("'\n"); WriteFmt("[DEBUG] Owned by check failed: expected 'user1', got '");
for (size i = 0; i < StrLen(&result.owned_by); i++) {
WriteFmt("{c}", StrBegin(&result.owned_by)[i]);
}
WriteFmt("'\n"); WriteFmt("[DEBUG] Parsed status: {}, message: '", response.status ? "true" : "false");
for (size i = 0; i < StrLen(&response.message); i++) {
WriteFmt("{c}", StrBegin(&response.message)[i]);
}
WriteFmt("'\n"); WriteFmt("[DEBUG] Status is true, parsing data...\n");
JR_OBJ_KV(si, "data", {
u64 source_function_id = (u64)ZstrToI64(StrBegin(&key), NULL);
WriteFmt("[DEBUG] Source function ID from key: {}\n", source_function_id);
JR_OBJ(si, { sym.function_mangled_name = StrInit(&alloc);
sym.source_function_id = source_function_id;
sym.target_function_id = (u64)ZstrToI64(StrBegin(&key), NULL);
WriteFmt("[DEBUG] Target function ID from key: {}\n", sym.target_function_id); WriteFmt("[DEBUG] Message check failed: expected 'Success', got '");
for (size i = 0; i < StrLen(&response.message); i++) {
WriteFmt("{c}", StrBegin(&response.message)[i]);
}
WriteFmt("'\n"); WriteFmt("[DEBUG] Analysis name check failed: expected 'test_analysis', got '");
for (size i = 0; i < StrLen(&sym->analysis_name); i++) {
WriteFmt("{c}", StrBegin(&sym->analysis_name)[i]);
}
WriteFmt("'\n"); WriteFmt("[DEBUG] SHA256 check failed: expected 'abc123', got '");
for (size i = 0; i < StrLen(&sym->sha256); i++) {
WriteFmt("{c}", StrBegin(&sym->sha256)[i]);
}
WriteFmt("'\n"); WriteFmt("[DEBUG] Mangled name check failed: expected '_Z4main', got '");
for (size i = 0; i < StrLen(&sym->function_mangled_name); i++) {
WriteFmt("{c}", StrBegin(&sym->function_mangled_name)[i]);
}
WriteFmt("'\n"); WriteFmt("[DEBUG] Parsed status: {}, message: '", response.status ? "true" : "false");
for (size i = 0; i < StrLen(&response.message); i++) {
WriteFmt("{c}", StrBegin(&response.message)[i]);
}
WriteFmt("'\n"); WriteFmt("[DEBUG] Status is true, parsing data...\n");
JR_OBJ_KV(si, "data", {
u64 source_function_id = (u64)ZstrToI64(StrBegin(&key), NULL);
WriteFmt("[DEBUG] Source function ID from key: {}\n", source_function_id);
JR_OBJ(si, { sym.function_mangled_name = StrInit(&alloc);
sym.source_function_id = source_function_id;
sym.target_function_id = (u64)ZstrToI64(StrBegin(&key), NULL);
WriteFmt("[DEBUG] Target function ID from key: {}\n", sym.target_function_id); WriteFmt("[DEBUG] Message check failed: expected 'Success', got '");
for (u64 i = 0; i < StrLen(&response.message); i++) {
WriteFmt("{c}", StrBegin(&response.message)[i]);
}
WriteFmt("'\n"); WriteFmt("[DEBUG] Analysis name check failed: expected 'test_analysis', got '");
for (size i = 0; i < StrLen(&sym->analysis_name); i++) {
WriteFmt("{}", StrBegin(&sym->analysis_name)[i]);
}
WriteFmt("'\n"); WriteFmt("[DEBUG] Function name check failed: expected 'main_func', got '");
for (size i = 0; i < StrLen(&sym->function_name); i++) {
WriteFmt("{c}", StrBegin(&sym->function_name)[i]);
}
WriteFmt("'\n"); WriteFmt("[DEBUG] SHA256 check failed: expected 'abc123', got '");
for (size i = 0; i < StrLen(&sym->sha256); i++) {
WriteFmt("{}", StrBegin(&sym->sha256)[i]);
}
WriteFmt("'\n"); WriteFmt("[DEBUG] Mangled name check failed: expected '_Z4main', got '");
for (size i = 0; i < StrLen(&sym->function_mangled_name); i++) {
WriteFmt("{c}", StrBegin(&sym->function_mangled_name)[i]);
}
WriteFmt("'\n");- In
Read.Simple.c:81:
WriteFmt("[DEBUG] Name check failed: expected 'Alice', got '");
for (size i = 0; i < StrLen(&name); i++) {
WriteFmt("{c}", StrBegin(&name)[i]);
}
WriteFmt("'\n");- In
Read.Simple.c:90:
WriteFmt("[DEBUG] City check failed: expected 'New York', got '");
for (size i = 0; i < StrLen(&city); i++) {
WriteFmt("{c}", StrBegin(&city)[i]);
}
WriteFmt("'\n"); WriteFmt("[DEBUG] Person name check failed: expected 'Bob', got '");
for (size i = 0; i < StrLen(&person.name); i++) {
WriteFmt("{c}", StrBegin(&person.name)[i]);
}
WriteFmt("'\n"); WriteFmt("[DEBUG] Log level check failed: expected 'INFO', got '");
for (size i = 0; i < StrLen(&config.log_level); i++) {
WriteFmt("{c}", StrBegin(&config.log_level)[i]);
}
WriteFmt("'\n"); WriteFmt("[DEBUG] Language 1 check failed: expected 'C', got '");
for (size i = 0; i < StrLen(lang1); i++) {
WriteFmt("{c}", StrBegin(lang1)[i]);
}
WriteFmt("'\n"); WriteFmt("[DEBUG] Language 2 check failed: expected 'Python', got '");
for (size i = 0; i < StrLen(lang2); i++) {
WriteFmt("{c}", StrBegin(lang2)[i]);
}
WriteFmt("'\n"); WriteFmt("[DEBUG] Language 3 check failed: expected 'Rust', got '");
for (size i = 0; i < StrLen(lang3); i++) {
WriteFmt("{c}", StrBegin(lang3)[i]);
}
WriteFmt("'\n"); WriteFmt("[DEBUG] User name check failed: expected 'Charlie', got '");
for (size i = 0; i < StrLen(&data.user.name); i++) {
WriteFmt("{c}", StrBegin(&data.user.name)[i]);
}
WriteFmt("'\n"); WriteFmt("[DEBUG] User email check failed: expected 'charlie@example.com', got '");
for (size i = 0; i < StrLen(&data.user.email); i++) {
WriteFmt("{c}", StrBegin(&data.user.email)[i]);
}
WriteFmt("'\n"); WriteFmt("[DEBUG] Product name check failed: expected 'Laptop', got '");
for (size i = 0; i < StrLen(&product.name); i++) {
WriteFmt("{c}", StrBegin(&product.name)[i]);
}
WriteFmt("'\n"); WriteFmt("[DEBUG] Tag 1 check failed: expected 'electronics', got '");
for (size i = 0; i < StrLen(tag1); i++) {
WriteFmt("{c}", StrBegin(tag1)[i]);
}
WriteFmt("'\n"); WriteFmt("[DEBUG] Tag 2 check failed: expected 'computers', got '");
for (size i = 0; i < StrLen(tag2); i++) {
WriteFmt("{c}", StrBegin(tag2)[i]);
}
WriteFmt("'\n"); WriteFmt("[DEBUG] Tag 3 check failed: expected 'portable', got '");
for (size i = 0; i < StrLen(tag3); i++) {
WriteFmt("{c}", StrBegin(tag3)[i]);
}
WriteFmt("'\n");- In
RoundTrip.c:142:
original.temperature,
original.enabled ? "true" : "false",
StrBegin(&original.message)
);
WriteFmtLn(- In
RoundTrip.c:149:
parsed.temperature,
parsed.enabled ? "true" : "false",
StrBegin(&parsed.message)
);
success = false;- In
Parse.c:85:
result = result && stored_host;
result = result && (StrBegin(&host_copy) != NULL);
result = result && (StrLen(&host_copy) > 0);
result = result && (StrBegin(&host_copy) != StrBegin(stored_host));- In
Parse.c:87:
result = result && (StrBegin(&host_copy) != NULL);
result = result && (StrLen(&host_copy) > 0);
result = result && (StrBegin(&host_copy) != StrBegin(stored_host));
result = result && (StrCmp(&host_copy, "localhost") == 0);
result = result && (StrCmp(stored_host, "localhost") == 0);- In
Parse.c:91:
result = result && (StrCmp(stored_host, "localhost") == 0);
StrBegin(&host_copy)[0] = 'L';
result = result && (StrCmp(&host_copy, "Localhost") == 0);- In
Str.Remove.c:33:
// Check that the character was popped correctly
bool result = (c == 'o' && ZstrCompare(StrBegin(&s), "Hell") == 0);
// Pop another character without storing it - avoid passing NULL directly
- In
Str.Remove.c:40:
// Check that the character was removed
result = result && (ZstrCompare(StrBegin(&s), "Hel") == 0);
StrDeinit(&s);- In
Str.Remove.c:60:
// Check that the character was popped correctly
bool result = (c == 'H' && ZstrCompare(StrBegin(&s), "ello") == 0);
// Pop another character without storing it - avoid passing NULL directly
- In
Str.Remove.c:67:
// Check that the character was removed
result = result && (ZstrCompare(StrBegin(&s), "llo") == 0);
StrDeinit(&s);- In
Str.Remove.c:87:
// Check that the character was removed correctly
bool result = (c == 'l' && ZstrCompare(StrBegin(&s), "Helo") == 0);
// Remove another character without storing it - avoid passing NULL directly
- In
Str.Remove.c:94:
// Check that the character was removed
result = result && (ZstrCompare(StrBegin(&s), "Hlo") == 0);
StrDeinit(&s);- In
Str.Remove.c:117:
// Check that the characters were removed correctly
bool result = (ZstrCompare(buffer, " Worl") == 0 && ZstrCompare(StrBegin(&s), "Hellod") == 0);
// Remove another range without storing it - use a temporary buffer instead of NULL
- In
Str.Remove.c:124:
// Check that the characters were removed
result = result && (ZstrCompare(StrBegin(&s), "Hell") == 0);
StrDeinit(&s);- In
Str.Remove.c:143:
// Check that the character was deleted
bool result = (ZstrCompare(StrBegin(&s), "Hell") == 0);
// Delete another character
- In
Str.Remove.c:149:
// Check that the character was deleted
result = result && (ZstrCompare(StrBegin(&s), "Hel") == 0);
StrDeinit(&s);- In
Str.Remove.c:168:
// Check that the character was deleted
bool result = (ZstrCompare(StrBegin(&s), "Helo") == 0);
// Delete another character
- In
Str.Remove.c:174:
// Check that the character was deleted
result = result && (ZstrCompare(StrBegin(&s), "Hlo") == 0);
StrDeinit(&s);- In
Str.Remove.c:193:
// Check that the characters were deleted
bool result = (ZstrCompare(StrBegin(&s), "Hello") == 0);
// Delete another range
- In
Str.Remove.c:199:
// Check that the characters were deleted
result = result && (ZstrCompare(StrBegin(&s), "Heo") == 0);
StrDeinit(&s);- In
Http.c:24:
bool ok = (next != raw) && (req.method == HTTP_REQUEST_METHOD_GET) && (StrLen(&req.url) == 11) &&
(ZstrCompare(StrBegin(&req.url), "/index.html") == 0) && (VecLen(&req.headers) == 2) &&
(ZstrCompare(next, "body-bytes") == 0);- In
Http.c:28:
HttpHeader *host = HttpHeadersFind(&req.headers, "Host");
ok = ok && host && ZstrCompare(StrBegin(&host->value), "example.com") == 0;
HttpRequestDeinit(&req);- In
Http.c:52:
// - includes a Content-Length: 11 (length of "<h1>hi</h1>")
// - ends with the body
bool ok = StrLen(&wire) > 0 && ZstrFindSubstring(StrBegin(&wire), "HTTP/1.1 200 OK\r\n") == StrBegin(&wire) &&
ZstrFindSubstring(StrBegin(&wire), "Content-Type: text/html\r\n") != NULL &&
ZstrFindSubstring(StrBegin(&wire), "Content-Length: 11\r\n") != NULL &&- In
Http.c:53:
// - ends with the body
bool ok = StrLen(&wire) > 0 && ZstrFindSubstring(StrBegin(&wire), "HTTP/1.1 200 OK\r\n") == StrBegin(&wire) &&
ZstrFindSubstring(StrBegin(&wire), "Content-Type: text/html\r\n") != NULL &&
ZstrFindSubstring(StrBegin(&wire), "Content-Length: 11\r\n") != NULL &&
ZstrFindSubstring(StrBegin(&wire), "\r\n\r\n<h1>hi</h1>") != NULL;- In
Http.c:54:
bool ok = StrLen(&wire) > 0 && ZstrFindSubstring(StrBegin(&wire), "HTTP/1.1 200 OK\r\n") == StrBegin(&wire) &&
ZstrFindSubstring(StrBegin(&wire), "Content-Type: text/html\r\n") != NULL &&
ZstrFindSubstring(StrBegin(&wire), "Content-Length: 11\r\n") != NULL &&
ZstrFindSubstring(StrBegin(&wire), "\r\n\r\n<h1>hi</h1>") != NULL;- In
Http.c:55:
ZstrFindSubstring(StrBegin(&wire), "Content-Type: text/html\r\n") != NULL &&
ZstrFindSubstring(StrBegin(&wire), "Content-Length: 11\r\n") != NULL &&
ZstrFindSubstring(StrBegin(&wire), "\r\n\r\n<h1>hi</h1>") != NULL;
StrDeinit(&wire);- In
Str.Memory.c:57:
// Check that the characters were swapped
bool result = (StrBegin(&s)[0] == 'o' && StrBegin(&s)[4] == 'H');
// Swap 'e' and 'l'
- In
Str.Memory.c:63:
// Check that the characters were swapped
result = result && (StrBegin(&s)[1] == 'l' && StrBegin(&s)[2] == 'e');
StrDeinit(&s);- In
Str.Memory.c:85:
// Length should now be 3 and content should be "Hel"
result = result && (StrLen(&s) == 3) && (ZstrCompareN(StrBegin(&s), "Hel", 3) == 0);
// Resize to a larger length
- In
Str.Memory.c:92:
// Length should now be 8, and the first 3 characters should still be "Hel"
// The rest will be filled with zeros
result = result && (StrLen(&s) == 8) && (ZstrCompareN(StrBegin(&s), "Hel", 3) == 0);
StrDeinit(&s);- In
Str.Memory.c:145:
// Data pointer should still be valid
result = result && (StrBegin(&s) != NULL);
StrDeinit(&s);- In
Str.Memory.c:164:
// Check that the string was reversed
bool result = (ZstrCompare(StrBegin(&s), "olleH") == 0);
// Test with an even-length string
- In
Str.Memory.c:174:
// Check that the string was reversed
result = result && (ZstrCompare(StrBegin(&s), "dcba") == 0);
// Test with a single-character string
- In
Str.Memory.c:184:
// Check that the string is unchanged
result = result && (ZstrCompare(StrBegin(&s), "a") == 0);
// Test with an empty string
- In
Str.Ops.c:172:
Str s1 = StrInitFromZstr("Hello World", &alloc);
StrReplace(&s1, "World", "Universe", 1);
bool result = (ZstrCompare(StrBegin(&s1), "Hello Universe") == 0);
// Test multiple replacements
- In
Str.Ops.c:178:
s1 = StrInitFromZstr("Hello Hello Hello", &alloc);
StrReplace(&s1, "Hello", "Hi", 2);
result = result && (ZstrCompare(StrBegin(&s1), "Hi Hi Hello") == 0);
// Test Cstr-form (fixed-length views) - use the full "World" string instead of just "Wo"
- In
Str.Ops.c:184:
s1 = StrInitFromZstr("Hello World", &alloc);
StrReplace(&s1, "World", 5, "Universe", 8, 1);
result = result && (ZstrCompare(StrBegin(&s1), "Hello Universe") == 0);
// Test Str-form
- In
Str.Ops.c:192:
Str replace = StrInitFromZstr("Universe", &alloc);
StrReplace(&s1, &find, &replace, 1);
result = result && (ZstrCompare(StrBegin(&s1), "Hello Universe") == 0);
StrDeinit(&s1);- In
Str.Ops.c:213:
bool result = (VecLen(&split) == 3);
if (VecLen(&split) >= 3) {
result = result && (ZstrCompare(StrBegin(VecPtrAt(&split, 0)), "Hello") == 0);
result = result && (ZstrCompare(StrBegin(VecPtrAt(&split, 1)), "World") == 0);
result = result && (ZstrCompare(StrBegin(VecPtrAt(&split, 2)), "Test") == 0);- In
Str.Ops.c:214:
if (VecLen(&split) >= 3) {
result = result && (ZstrCompare(StrBegin(VecPtrAt(&split, 0)), "Hello") == 0);
result = result && (ZstrCompare(StrBegin(VecPtrAt(&split, 1)), "World") == 0);
result = result && (ZstrCompare(StrBegin(VecPtrAt(&split, 2)), "Test") == 0);
}- In
Str.Ops.c:215:
result = result && (ZstrCompare(StrBegin(VecPtrAt(&split, 0)), "Hello") == 0);
result = result && (ZstrCompare(StrBegin(VecPtrAt(&split, 1)), "World") == 0);
result = result && (ZstrCompare(StrBegin(VecPtrAt(&split, 2)), "Test") == 0);
}- In
Str.Ops.c:259:
Str s1 = StrInitFromZstr(" Hello ", &alloc);
Str stripped = StrLStrip(&s1, NULL);
bool result = (ZstrCompare(StrBegin(&stripped), "Hello ") == 0);
StrDeinit(&stripped);- In
Str.Ops.c:264:
// Test StrRStrip
stripped = StrRStrip(&s1, NULL);
result = result && (ZstrCompare(StrBegin(&stripped), " Hello") == 0);
StrDeinit(&stripped);- In
Str.Ops.c:269:
// Test StrStrip
stripped = StrStrip(&s1, NULL);
result = result && (ZstrCompare(StrBegin(&stripped), "Hello") == 0);
StrDeinit(&stripped);- In
Str.Ops.c:277:
stripped = StrLStrip(&s1, "*");
result = result && (ZstrCompare(StrBegin(&stripped), "Hello***") == 0);
StrDeinit(&stripped);- In
Str.Ops.c:281:
stripped = StrRStrip(&s1, "*");
result = result && (ZstrCompare(StrBegin(&stripped), "***Hello") == 0);
StrDeinit(&stripped);- In
Str.Ops.c:285:
stripped = StrStrip(&s1, "*");
result = result && (ZstrCompare(StrBegin(&stripped), "Hello") == 0);
StrDeinit(&stripped);- In
Int.Convert.c:49:
bool result = IntBitLength(&value) == 4;
result = result && (IntToU64(&value) == 13);
result = result && (ZstrCompare(StrBegin(&text), "1101") == 0);
StrDeinit(&text);- In
Int.Convert.c:70:
bool result = written == 4;
result = result && (MemCompare(out, bytes, sizeof(bytes)) == 0);
result = result && (ZstrCompare(StrBegin(&text), "cdef1234") == 0);
StrDeinit(&text);- In
Int.Convert.c:91:
bool result = written == 4;
result = result && (MemCompare(out, bytes, sizeof(bytes)) == 0);
result = result && (ZstrCompare(StrBegin(&text), "12345678") == 0);
StrDeinit(&text);
bool result = IntToU64(&value) == 11;
result = result && (ZstrCompare(StrBegin(&text), "1011") == 0);
StrDeinit(&text); Str text = IntToStr(&value);
bool result = ZstrCompare(StrBegin(&text), digits) == 0;
StrDeinit(&text);
bool result = IntToU64(&value) == 1295;
result = result && (ZstrCompare(StrBegin(&text), "zz") == 0);
StrDeinit(&text); Str text = IntToStrRadix(&value, 16, true);
bool result = ZstrCompare(StrBegin(&text), "BEEF") == 0;
StrDeinit(&text); ok = int_try_to_str_radix(&text, &value, 16, true, ALLOCATOR_OF(&alloc));
bool result = ok && (ZstrCompare(StrBegin(&text), "BEEF") == 0) &&
(StrAllocator(&text)->effort == alloc.base.effort) &&
(StrAllocator(&text)->retry_limit == alloc.base.retry_limit); result = result && (IntToU64(&zero, &error) == 0);
result = result && !error;
result = result && (ZstrCompare(StrBegin(&text), "0") == 0);
StrDeinit(&text);
bool result = IntToU64(&value) == 493;
result = result && (ZstrCompare(StrBegin(&text), "755") == 0);
StrDeinit(&text); Str text = IntToHexStr(&value);
bool result = ZstrCompare(StrBegin(&text), hex) == 0;
StrDeinit(&text);- In
Backtrace.c:41:
// (Apple's C mangling prepends `_`; substring search matches both
// "bt_capture_with_helper" and "_bt_capture_with_helper".)
bool ok = StrLen(&rendered) > 0 && ZstrFindSubstring(StrBegin(&rendered), "bt_capture_with_helper") != NULL &&
ZstrFindSubstring(StrBegin(&rendered), "bt_capture_outer") != NULL;- In
Backtrace.c:42:
// "bt_capture_with_helper" and "_bt_capture_with_helper".)
bool ok = StrLen(&rendered) > 0 && ZstrFindSubstring(StrBegin(&rendered), "bt_capture_with_helper") != NULL &&
ZstrFindSubstring(StrBegin(&rendered), "bt_capture_outer") != NULL;
#if FEATURE_SYS_SYMRESOLVE- In
Backtrace.c:48:
// the Linux backend emits source filenames today (via DwarfLines);
// macOS / Windows only emit names + offsets.
ok = ok && ZstrFindSubstring(StrBegin(&rendered), "Backtrace.c") != NULL;
#endif- In
Backtrace.c:81:
ok = ok && StrLen(&rendered) > 0;
ok = ok && ZstrFindSubstring(StrBegin(&rendered), "bt_vec_capture_with_helper") != NULL;
ok = ok && ZstrFindSubstring(StrBegin(&rendered), "bt_vec_capture_outer") != NULL;- In
Backtrace.c:82:
ok = ok && StrLen(&rendered) > 0;
ok = ok && ZstrFindSubstring(StrBegin(&rendered), "bt_vec_capture_with_helper") != NULL;
ok = ok && ZstrFindSubstring(StrBegin(&rendered), "bt_vec_capture_outer") != NULL;
StrDeinit(&rendered);- In
Backtrace.c:111:
// Should also contain the helper name through the shared resolver.
bool ok = StrLen(&out) > 0 && ZstrFindSubstring(StrBegin(&out), "bt_capture_with_helper") != NULL;
StrDeinit(&out);- In
Backtrace.c:154:
bool ok = n >= 2;
ok = ok && StrLen(&rendered) > 0;
ok = ok && ZstrFindSubstring(StrBegin(&rendered), "cfi_capture_inner") != NULL;
ok = ok && ZstrFindSubstring(StrBegin(&rendered), "cfi_capture_outer") != NULL;- In
Backtrace.c:155:
ok = ok && StrLen(&rendered) > 0;
ok = ok && ZstrFindSubstring(StrBegin(&rendered), "cfi_capture_inner") != NULL;
ok = ok && ZstrFindSubstring(StrBegin(&rendered), "cfi_capture_outer") != NULL;
StrDeinit(&rendered);- In
Str.Convert.c:39:
StrIntFormat config = {.base = 10, .uppercase = false};
StrFromU64(&s, 12345, &config);
bool result = (ZstrCompare(StrBegin(&s), "12345") == 0);
if (!result) {
WriteFmt(" FAIL: Expected '12345', got '{}'\n", s);- In
Str.Convert.c:48:
config = (StrIntFormat) {.base = 16, .uppercase = false, .use_prefix = true};
StrFromU64(&s, 0xABCD, &config);
result = result && (ZstrCompare(StrBegin(&s), "0xabcd") == 0);
if (!result) {
WriteFmt(" FAIL: Expected '0xabcd', got '{}'\n", s);- In
Str.Convert.c:57:
config = (StrIntFormat) {.base = 16, .uppercase = true, .use_prefix = true};
StrFromU64(&s, 0xABCD, &config);
result = result && (ZstrCompare(StrBegin(&s), "0xABCD") == 0);
if (!result) {
WriteFmt(" FAIL: Expected '0xABCD', got '{}'\n", s);- In
Str.Convert.c:66:
config = (StrIntFormat) {.base = 2, .uppercase = false, .use_prefix = true};
StrFromU64(&s, 42, &config);
result = result && (ZstrCompare(StrBegin(&s), "0b101010") == 0);
if (!result) {
WriteFmt(" FAIL: Expected '0b101010', got '{}'\n", s);- In
Str.Convert.c:75:
config = (StrIntFormat) {.base = 8, .uppercase = false, .use_prefix = true};
StrFromU64(&s, 42, &config);
result = result && (ZstrCompare(StrBegin(&s), "0o52") == 0);
if (!result) {
WriteFmt(" FAIL: Expected '0o52', got '{}'\n", s);- In
Str.Convert.c:84:
config = (StrIntFormat) {.base = 10, .uppercase = false};
StrFromU64(&s, 0, &config);
result = result && (ZstrCompare(StrBegin(&s), "0") == 0);
if (!result) {
WriteFmt(" FAIL: Expected '0', got '{}'\n", s); StrIntFormat config = {.base = 10, .uppercase = false};
StrFromI64(&s, 12345, &config);
bool result = (ZstrCompare(StrBegin(&s), "12345") == 0);
if (!result) {
WriteFmt(" FAIL: Expected '12345', got '{}'\n", StrBegin(&s)); bool result = (ZstrCompare(StrBegin(&s), "12345") == 0);
if (!result) {
WriteFmt(" FAIL: Expected '12345', got '{}'\n", StrBegin(&s));
} config = (StrIntFormat) {.base = 10, .uppercase = false};
StrFromI64(&s, -12345, &config);
result = result && (ZstrCompare(StrBegin(&s), "-12345") == 0);
if (!result) {
WriteFmt(" FAIL: Expected '-12345', got '{}'\n", StrBegin(&s)); result = result && (ZstrCompare(StrBegin(&s), "-12345") == 0);
if (!result) {
WriteFmt(" FAIL: Expected '-12345', got '{}'\n", StrBegin(&s));
} // For negative numbers in non-decimal bases, it uses unsigned representation
// -0xABCD = -(43981) = large positive number when treated as unsigned
result = result && (ZstrCompareN(StrBegin(&s), "0x", 2) == 0);
if (!result) {
WriteFmt(" FAIL: Expected hex prefix '0x', got '{}'\n", StrBegin(&s)); result = result && (ZstrCompareN(StrBegin(&s), "0x", 2) == 0);
if (!result) {
WriteFmt(" FAIL: Expected hex prefix '0x', got '{}'\n", StrBegin(&s));
} config = (StrIntFormat) {.base = 10, .uppercase = false};
StrFromI64(&s, 0, &config);
result = result && (ZstrCompare(StrBegin(&s), "0") == 0);
if (!result) {
WriteFmt(" FAIL: Expected '0', got '{}'\n", StrBegin(&s)); result = result && (ZstrCompare(StrBegin(&s), "0") == 0);
if (!result) {
WriteFmt(" FAIL: Expected '0', got '{}'\n", StrBegin(&s));
} config = (StrIntFormat) {.base = 2, .uppercase = false, .use_prefix = true};
StrFromI64(&s, 42, &config);
result = result && (ZstrCompare(StrBegin(&s), "0b101010") == 0);
if (!result) {
WriteFmt(" FAIL: Expected '0b101010', got '{}'\n", StrBegin(&s)); result = result && (ZstrCompare(StrBegin(&s), "0b101010") == 0);
if (!result) {
WriteFmt(" FAIL: Expected '0b101010', got '{}'\n", StrBegin(&s));
} StrFloatFormat config = {.precision = 2, .force_sci = false, .uppercase = false};
StrFromF64(&s, 123.0, &config);
bool result = (ZstrCompare(StrBegin(&s), "123.00") == 0);
if (!result) {
WriteFmt(" FAIL: Expected '123.00', got '{}'\n", StrBegin(&s)); bool result = (ZstrCompare(StrBegin(&s), "123.00") == 0);
if (!result) {
WriteFmt(" FAIL: Expected '123.00', got '{}'\n", StrBegin(&s));
} config = (StrFloatFormat) {.precision = 3, .force_sci = false, .uppercase = false};
StrFromF64(&s, 123.456, &config);
result = result && (ZstrCompare(StrBegin(&s), "123.456") == 0);
if (!result) {
WriteFmt(" FAIL: Expected '123.456', got '{}'\n", StrBegin(&s)); result = result && (ZstrCompare(StrBegin(&s), "123.456") == 0);
if (!result) {
WriteFmt(" FAIL: Expected '123.456', got '{}'\n", StrBegin(&s));
} config = (StrFloatFormat) {.precision = 3, .force_sci = false, .uppercase = false};
StrFromF64(&s, -123.456, &config);
result = result && (ZstrCompare(StrBegin(&s), "-123.456") == 0);
// Test scientific notation (forced)
config = (StrFloatFormat) {.precision = 3, .force_sci = true, .uppercase = false};
StrFromF64(&s, 123.456, &config);
result = result && (ZstrCompare(StrBegin(&s), "1.235e+02") == 0);
// Test scientific notation (uppercase)
config = (StrFloatFormat) {.precision = 3, .force_sci = true, .uppercase = true};
StrFromF64(&s, 123.456, &config);
result = result && (ZstrCompare(StrBegin(&s), "1.235E+02") == 0);
// Test very small number (auto scientific notation)
config = (StrFloatFormat) {.precision = 3, .force_sci = false, .uppercase = false};
StrFromF64(&s, 0.0000123, &config);
result = result && (ZstrCompare(StrBegin(&s), "1.230e-05") == 0);
// Test very large number (auto scientific notation)
config = (StrFloatFormat) {.precision = 2, .force_sci = false, .uppercase = false};
StrFromF64(&s, 1234567890123.0, &config);
result = result && (ZstrCompare(StrBegin(&s), "1.23e+12") == 0);
// Test zero
config = (StrFloatFormat) {.precision = 2, .force_sci = false, .uppercase = false};
StrFromF64(&s, 0.0, &config);
result = result && (ZstrCompare(StrBegin(&s), "0.00") == 0);
// Test infinity
config = (StrFloatFormat) {.precision = 2, .force_sci = false, .uppercase = false};
StrFromF64(&s, F64_INFINITY, &config);
result = result && (ZstrCompare(StrBegin(&s), "inf") == 0);
// Test negative infinity
config = (StrFloatFormat) {.precision = 2, .force_sci = false, .uppercase = false};
StrFromF64(&s, -F64_INFINITY, &config);
result = result && (ZstrCompare(StrBegin(&s), "-inf") == 0);
// Test NaN
config = (StrFloatFormat) {.precision = 2, .force_sci = false, .uppercase = false};
StrFromF64(&s, F64_NAN, &config);
result = result && (ZstrCompare(StrBegin(&s), "nan") == 0);
StrDeinit(&s);
// String should have expected decimal places
char *dot_pos = ZstrFindChar(StrBegin(&s), '.');
if (dot_pos) {
size decimal_places = ZstrLen(dot_pos + 1); StrFloatFormat config = {.precision = 3, .force_sci = true, .uppercase = false};
StrFromF64(&s, sci_values[i], &config);
bool has_e = (ZstrFindChar(StrBegin(&s), 'e') != NULL);
result = result && has_e; config = (StrFloatFormat) {.precision = 3, .force_sci = true, .uppercase = true};
StrFromF64(&s, sci_values[i], &config);
bool has_E = (ZstrFindChar(StrBegin(&s), 'E') != NULL);
result = result && has_E;- In
Str.Access.c:84:
// Test StrBegin function
bool test_str_begin(void) {
WriteFmt("Testing StrBegin\n");
DefaultAllocator alloc = DefaultAllocatorInit();- In
Str.Access.c:91:
// Get a pointer to the first character using StrBegin
char *begin = StrBegin(&s);
// Check that the pointer dereferences to the expected first character.
- In
Socket.c:47:
Str local_str = SocketAddrFormat(&local, a);
SocketAddr connect_addr;
bool parsed = SocketAddrParse(&connect_addr, (Zstr)StrBegin(&local_str), SOCKET_KIND_TCP);
StrDeinit(&local_str);
if (!parsed) {- In
Socket.c:102:
}
Str rendered = SocketAddrFormat(&addr, alloc_base);
ok = ok && StrLen(&rendered) > 0 && ZstrCompare(StrBegin(&rendered), "127.0.0.1:8080") == 0;
StrDeinit(&rendered);
}- In
Socket.c:113:
}
Str rendered = SocketAddrFormat(&addr, alloc_base);
ok = ok && StrLen(&rendered) > 0 && ZstrCompare(StrBegin(&rendered), "[::1]:8080") == 0;
StrDeinit(&rendered);
} Point2D p = {.x = 3, .y = 4};
bool ok = StrAppendFmt(&out, "{}", p);
ok = ok && (ZstrCompare(StrBegin(&out), "(3, 4)") == 0);
StrDeinit(&out); i32 count = 7;
bool ok = StrAppendFmt(&out, "got {} hits at {}", count, p);
ok = ok && (ZstrCompare(StrBegin(&out), "got 7 hits at (-1, 2)") == 0);
StrDeinit(&out);
bool ok = StrAppendFmt(&out, "{}", src);
Zstr in = StrBegin(&out);
StrReadFmt(in, "{}", dst);
ok = ok && (dst.x == src.x) && (dst.y == src.y); };
bool ok = StrAppendFmt(&out, "{}", b);
ok = ok && (ZstrCompare(StrBegin(&out), "[(0, 0)..(10, 20)]") == 0);
StrDeinit(&out);
bool ok = StrAppendFmt(&out, "{}", src);
Zstr in = StrBegin(&out);
StrReadFmt(in, "{}", dst); };
bool ok = StrAppendFmt(&out, "{}", r);
ok = ok && (ZstrCompare(StrBegin(&out), "42:[(0, 0)..(100, 50)]@(50, 25)") == 0);
StrDeinit(&out);
bool ok = StrAppendFmt(&out, "{}", src);
Zstr in = StrBegin(&out);
StrReadFmt(in, "{}", dst); // types and built-ins coexist in one IOFMT expansion.
bool ok = StrAppendFmt(&out, "score={.1} region={} origin={}", score, region, origin);
ok = ok && (ZstrCompare(StrBegin(&out), "score=1.5 region=7:[(1, 2)..(3, 4)]@(2, 3) origin=(0, 0)") == 0);
StrDeinit(&out);- In
SysDns.c:94:
if (ok) {
Str s = SocketAddrFormat(VecPtrAt(&out, 0), a);
ok = (StrLen(&s) > 0) && ZstrCompare(StrBegin(&s), "203.0.113.7:9999") == 0;
StrDeinit(&s);
}- In
SysDns.c:119:
Str s = SocketAddrFormat(VecPtrAt(&out, 0), a);
// SocketAddrFormat emits the bracketed form for IPv6.
ok = (StrLen(&s) > 0) && ZstrCompare(StrBegin(&s), "[::1]:443") == 0;
StrDeinit(&s);
}- In
SysDns.c:146:
Str s = SocketAddrFormat(ad, a);
u64 L = StrLen(&s);
if (L < 3 || StrBegin(&s)[L - 1] != '3' || StrBegin(&s)[L - 2] != '5' || StrBegin(&s)[L - 3] != ':') {
ok = false;
}- In
SysDns.c:174:
if (ok) {
Str s = SocketAddrFormat(&one, a);
ok = (StrLen(&s) > 0) && ZstrCompare(StrBegin(&s), "127.0.0.1:80") == 0;
StrDeinit(&s);
}- In
AllocDebug.c:128:
bool ok = StrLen(&out) > 0;
ok = ok && (ZstrFindSubstring(StrBegin(&out), "leak:") != NULL);
ok = ok && (ZstrFindSubstring(StrBegin(&out), "24 bytes") != NULL);
ok = ok && (ZstrFindSubstring(StrBegin(&out), "40 bytes") != NULL);- In
AllocDebug.c:129:
bool ok = StrLen(&out) > 0;
ok = ok && (ZstrFindSubstring(StrBegin(&out), "leak:") != NULL);
ok = ok && (ZstrFindSubstring(StrBegin(&out), "24 bytes") != NULL);
ok = ok && (ZstrFindSubstring(StrBegin(&out), "40 bytes") != NULL);- In
AllocDebug.c:130:
ok = ok && (ZstrFindSubstring(StrBegin(&out), "leak:") != NULL);
ok = ok && (ZstrFindSubstring(StrBegin(&out), "24 bytes") != NULL);
ok = ok && (ZstrFindSubstring(StrBegin(&out), "40 bytes") != NULL);
StrDeinit(&out);- In
Io.Read.c:620:
WriteFmt("Input: '{}', Output: '", in);
for (size i = 0; i < StrLen(&result); i++) {
WriteFmt("{c}", StrBegin(&result)[i]);
}
WriteFmt("'\n");- In
Io.Read.c:645:
WriteFmt("Input: '{}', Output: '", in);
for (size i = 0; i < StrLen(&result); i++) {
WriteFmt("{c}", StrBegin(&result)[i]);
}
WriteFmt("'\n");- In
Io.Read.c:670:
WriteFmt("Input: '{}', Output: '", in);
for (size i = 0; i < StrLen(&result); i++) {
WriteFmt("{c}", StrBegin(&result)[i]);
}
WriteFmt("'\n");- In
Io.Read.c:739:
WriteFmt("Input: '{}', Output: '", in);
for (size i = 0; i < StrLen(&result); i++) {
WriteFmt("{c}", StrBegin(&result)[i]);
}
WriteFmt("'\n");- In
Io.Read.c:764:
WriteFmt("Input: '{}', Output: '", in);
for (size i = 0; i < StrLen(&result); i++) {
WriteFmt("{c}", StrBegin(&result)[i]);
}
WriteFmt("'\n");- In
Io.Read.c:789:
WriteFmt("Input: '{}', Output: '", in);
for (size i = 0; i < StrLen(&result); i++) {
WriteFmt("{c}", StrBegin(&result)[i]);
}
WriteFmt("'\n");- In
Io.Read.c:822:
StrReadFmt(z, "{}", bv1);
Str result1 = BitVecToStr(&bv1);
success = success && (ZstrCompare(StrBegin(&result1), "10110") == 0);
WriteFmt(
"Test 1 - Binary: {}, Success: {}\n",- In
Io.Read.c:826:
"Test 1 - Binary: {}, Success: {}\n",
result1,
(ZstrCompare(StrBegin(&result1), "10110") == 0) ? "true" : "false"
);
StrDeinit(&result1);- In
Io.Read.c:851:
StrReadFmt(z, "{}", bv4);
Str result4 = BitVecToStr(&bv4);
success = success && (ZstrCompare(StrBegin(&result4), "1101") == 0);
WriteFmt(
"Test 4 - Whitespace: {}, Success: {}\n",- In
Io.Read.c:855:
"Test 4 - Whitespace: {}, Success: {}\n",
result4,
(ZstrCompare(StrBegin(&result4), "1101") == 0) ? "true" : "false"
);
StrDeinit(&result4);- In
Io.Read.c:864:
StrReadFmt(z, "{}", bv5);
Str result5 = BitVecToStr(&bv5);
success = success && (ZstrCompare(StrBegin(&result5), "0") == 0);
WriteFmt(
"Test 5 - Zero: {}, Success: {}\n",- In
Io.Read.c:868:
"Test 5 - Zero: {}, Success: {}\n",
result5,
(ZstrCompare(StrBegin(&result5), "0") == 0) ? "true" : "false"
);
StrDeinit(&result5);- In
Io.Read.c:900:
StrReadFmt(z, "{}", dec);
dec_text = IntToStr(&dec);
success = success && (ZstrCompare(StrBegin(&dec_text), "123456789012345678901234567890") == 0);
z = "deadbeefcafebabe1234";- In
Io.Read.c:905:
StrReadFmt(z, "{x}", hex);
hex_text = IntToHexStr(&hex);
success = success && (ZstrCompare(StrBegin(&hex_text), "deadbeefcafebabe1234") == 0);
z = "10100011";- In
Io.Read.c:910:
StrReadFmt(z, "{b}", bin);
bin_text = IntToBinary(&bin);
success = success && (ZstrCompare(StrBegin(&bin_text), "10100011") == 0);
z = "755";- In
Io.Read.c:915:
StrReadFmt(z, "{o}", oct);
oct_text = IntToOctStr(&oct);
success = success && (ZstrCompare(StrBegin(&oct_text), "755") == 0);
StrDeinit(&dec_text);- In
Io.Read.c:950:
StrReadFmt(z, "{}", dec);
dec_text = FloatToStr(&dec);
success = success && (ZstrCompare(StrBegin(&dec_text), "1234567890.012345") == 0);
z = "1.234567e+04";- In
Io.Read.c:955:
StrReadFmt(z, "{e}", sci);
sci_text = FloatToStr(&sci);
success = success && (ZstrCompare(StrBegin(&sci_text), "12345.67") == 0);
z = "-0.00125";- In
Io.Read.c:960:
StrReadFmt(z, "{}", neg);
neg_text = FloatToStr(&neg);
success = success && (ZstrCompare(StrBegin(&neg_text), "-0.00125") == 0);
StrDeinit(&dec_text);- In
Graph.Init.c:89:
stored_name = GraphNodeDataPtr(&graph, node);
bool result = GraphNodeIdIndex(node_id) == 0 && StrBegin(&name) != NULL && GraphNodeCount(&graph) == 1 &&
ZstrCompare(StrBegin(stored_name), "alpha") == 0 && StrBegin(stored_name) != StrBegin(&name);- In
Graph.Init.c:90:
bool result = GraphNodeIdIndex(node_id) == 0 && StrBegin(&name) != NULL && GraphNodeCount(&graph) == 1 &&
ZstrCompare(StrBegin(stored_name), "alpha") == 0 && StrBegin(stored_name) != StrBegin(&name);
StrDeinit(&name);- In
Graph.Init.c:113:
stored_name = GraphNodeDataPtr(&graph, node);
bool result = GraphNodeIdIndex(node_id) == 0 && GraphNodeCount(&graph) == 1 && StrBegin(stored_name) != NULL &&
ZstrCompare(StrBegin(stored_name), "alpha") == 0;- In
Graph.Init.c:114:
bool result = GraphNodeIdIndex(node_id) == 0 && GraphNodeCount(&graph) == 1 && StrBegin(stored_name) != NULL &&
ZstrCompare(StrBegin(stored_name), "alpha") == 0;
GraphDeinit(&graph);- In
Float.Type.c:60:
bool result = FloatEQ(&clone, &expected);
result = result && (ZstrCompare(StrBegin(&text), "-12.5") == 0);
result = result && !FloatEQ(&clone, &original); Str text = FloatToStr(&value);
bool result = ZstrCompare(StrBegin(&text), "42") == 0;
result = result && !FloatIsNegative(&value); Str text = FloatToStr(&value);
bool result = ZstrCompare(StrBegin(&text), "-42") == 0;
result = result && FloatIsNegative(&value); Str text = FloatToStr(&value);
bool result = ZstrCompare(StrBegin(&text), "12345678901234567890") == 0;
IntDeinit(&integer); bool result = FloatToInt(&result_value, &value);
text = IntToStr(&result_value);
result = result && (ZstrCompare(StrBegin(&text), "12345") == 0);
FloatDeinit(&value); Str text = FloatToStr(&value);
bool result = ZstrCompare(StrBegin(&text), "-123.45") == 0;
StrDeinit(&text); ok = float_try_to_str(&text, &value, ALLOCATOR_OF(&alloc));
bool result = ok && (ZstrCompare(StrBegin(&text), "-123.45") == 0) &&
(StrAllocator(&text)->effort == alloc.base.effort) &&
(StrAllocator(&text)->retry_limit == alloc.base.retry_limit); Str text = FloatToStr(&value);
bool result = ZstrCompare(StrBegin(&text), FLOAT_TEST_VERY_LARGE_ONES) == 0;
StrDeinit(&text); Str text = FloatToStr(&value);
bool result = ZstrCompare(StrBegin(&text), "1230") == 0;
StrDeinit(&text);- In
Io.Write.c:43:
StrAppendFmt(&output, "Hello, world!");
success = success && (ZstrCompare(StrBegin(&output), "Hello, world!") == 0);
StrClear(&output);- In
Io.Write.c:47:
StrAppendFmt(&output, "{{Hello}}");
success = success && (ZstrCompare(StrBegin(&output), "{Hello}") == 0);
StrClear(&output);- In
Io.Write.c:51:
StrAppendFmt(&output, "{{{{");
success = success && (ZstrCompare(StrBegin(&output), "{{") == 0);
StrDeinit(&output);- In
Io.Write.c:68:
Zstr str = "Hello";
StrAppendFmt(&output, "{}", str);
success = success && (ZstrCompare(StrBegin(&output), "Hello") == 0);
StrClear(&output);- In
Io.Write.c:77:
StrAppendFmt(&output, "{>10}", str);
success = success && (ZstrCompare(StrBegin(&output), " Hello") == 0);
StrClear(&output);- In
Io.Write.c:81:
StrAppendFmt(&output, "{<10}", str);
success = success && (ZstrCompare(StrBegin(&output), "Hello ") == 0);
StrClear(&output);- In
Io.Write.c:85:
StrAppendFmt(&output, "{^10}", str);
success = success && (ZstrCompare(StrBegin(&output), " Hello ") == 0);
StrClear(&output);- In
Io.Write.c:90:
Str s = StrInitFromZstr("World", &alloc);
StrAppendFmt(&output, "{}", s);
success = success && (ZstrCompare(StrBegin(&output), "World") == 0);
StrDeinit(&s);- In
Io.Write.c:108:
i8 i8_val = -42;
StrAppendFmt(&output, "{}", i8_val);
success = success && (ZstrCompare(StrBegin(&output), "-42") == 0);
StrClear(&output);- In
Io.Write.c:113:
i16 i16_val = -1234;
StrAppendFmt(&output, "{}", i16_val);
success = success && (ZstrCompare(StrBegin(&output), "-1234") == 0);
StrClear(&output);- In
Io.Write.c:118:
i32 i32_val = -123456;
StrAppendFmt(&output, "{}", i32_val);
success = success && (ZstrCompare(StrBegin(&output), "-123456") == 0);
StrClear(&output);- In
Io.Write.c:123:
i64 i64_val = -1234567890LL;
StrAppendFmt(&output, "{}", i64_val);
success = success && (ZstrCompare(StrBegin(&output), "-1234567890") == 0);
StrClear(&output);- In
Io.Write.c:128:
u8 u8_val = 42;
StrAppendFmt(&output, "{}", u8_val);
success = success && (ZstrCompare(StrBegin(&output), "42") == 0);
StrClear(&output);- In
Io.Write.c:133:
u16 u16_val = 1234;
StrAppendFmt(&output, "{}", u16_val);
success = success && (ZstrCompare(StrBegin(&output), "1234") == 0);
StrClear(&output);- In
Io.Write.c:138:
u32 u32_val = 123456;
StrAppendFmt(&output, "{}", u32_val);
success = success && (ZstrCompare(StrBegin(&output), "123456") == 0);
StrClear(&output);- In
Io.Write.c:143:
u64 u64_val = 1234567890ULL;
StrAppendFmt(&output, "{}", u64_val);
success = success && (ZstrCompare(StrBegin(&output), "1234567890") == 0);
StrClear(&output);- In
Io.Write.c:148:
i8 i8_max = 127;
StrAppendFmt(&output, "{}", i8_max);
success = success && (ZstrCompare(StrBegin(&output), "127") == 0);
StrClear(&output);- In
Io.Write.c:153:
i8 i8_min = -128;
StrAppendFmt(&output, "{}", i8_min);
success = success && (ZstrCompare(StrBegin(&output), "-128") == 0);
StrClear(&output);- In
Io.Write.c:158:
u8 u8_max = 255;
StrAppendFmt(&output, "{}", u8_max);
success = success && (ZstrCompare(StrBegin(&output), "255") == 0);
StrClear(&output);- In
Io.Write.c:163:
u8 u8_min = 0;
StrAppendFmt(&output, "{}", u8_min);
success = success && (ZstrCompare(StrBegin(&output), "0") == 0);
StrDeinit(&output);- In
Io.Write.c:180:
u32 val = 0xDEADBEEF;
StrAppendFmt(&output, "{x}", val);
success = success && (ZstrCompare(StrBegin(&output), "0xdeadbeef") == 0);
StrClear(&output);- In
Io.Write.c:184:
StrAppendFmt(&output, "{X}", val);
success = success && (ZstrCompare(StrBegin(&output), "0xDEADBEEF") == 0);
StrDeinit(&output);- In
Io.Write.c:201:
u8 val = 0xA5; // 10100101 in binary
StrAppendFmt(&output, "{b}", val);
success = success && (ZstrCompare(StrBegin(&output), "0b10100101") == 0);
StrDeinit(&output);- In
Io.Write.c:218:
u16 val = 0777;
StrAppendFmt(&output, "{o}", val);
success = success && (ZstrCompare(StrBegin(&output), "0o777") == 0);
StrDeinit(&output);- In
Io.Write.c:235:
f32 f32_val = 3.14159f;
StrAppendFmt(&output, "{}", f32_val);
success = success && (ZstrCompare(StrBegin(&output), "3.141590") == 0);
StrClear(&output);- In
Io.Write.c:240:
f64 f64_val = 2.71828;
StrAppendFmt(&output, "{}", f64_val);
success = success && (ZstrCompare(StrBegin(&output), "2.718280") == 0);
StrDeinit(&output);- In
Io.Write.c:258:
StrAppendFmt(&output, "{.2}", val);
success = success && (ZstrCompare(StrBegin(&output), "3.14") == 0);
StrClear(&output);- In
Io.Write.c:262:
StrAppendFmt(&output, "{.0}", val);
success = success && (ZstrCompare(StrBegin(&output), "3") == 0);
StrClear(&output);- In
Io.Write.c:266:
StrAppendFmt(&output, "{.10}", val);
success = success && (ZstrCompare(StrBegin(&output), "3.1415926536") == 0);
StrDeinit(&output);- In
Io.Write.c:283:
f64 pos_inf = F64_INFINITY;
StrAppendFmt(&output, "{}", pos_inf);
success = success && (ZstrCompare(StrBegin(&output), "inf") == 0);
StrClear(&output);- In
Io.Write.c:288:
f64 neg_inf = -F64_INFINITY;
StrAppendFmt(&output, "{}", neg_inf);
success = success && (ZstrCompare(StrBegin(&output), "-inf") == 0);
StrClear(&output);- In
Io.Write.c:293:
f64 nan_val = F64_NAN;
StrAppendFmt(&output, "{}", nan_val);
success = success && (ZstrCompare(StrBegin(&output), "nan") == 0);
StrDeinit(&output);- In
Io.Write.c:310:
i32 val = 42;
StrAppendFmt(&output, "{5}", val);
success = success && (ZstrCompare(StrBegin(&output), " 42") == 0);
StrClear(&output);- In
Io.Write.c:314:
StrAppendFmt(&output, "{<5}", val);
success = success && (ZstrCompare(StrBegin(&output), "42 ") == 0);
StrClear(&output);- In
Io.Write.c:318:
StrAppendFmt(&output, "{^5}", val);
success = success && (ZstrCompare(StrBegin(&output), " 42 ") == 0);
StrClear(&output);- In
Io.Write.c:323:
Zstr str = "abc";
StrAppendFmt(&output, "{5}", str);
success = success && (ZstrCompare(StrBegin(&output), " abc") == 0);
StrClear(&output);- In
Io.Write.c:327:
StrAppendFmt(&output, "{<5}", str);
success = success && (ZstrCompare(StrBegin(&output), "abc ") == 0);
StrClear(&output);- In
Io.Write.c:331:
StrAppendFmt(&output, "{^5}", str);
success = success && (ZstrCompare(StrBegin(&output), " abc ") == 0);
StrDeinit(&output);- In
Io.Write.c:351:
StrAppendFmt(&output, "{} {} {}", hello, num, pi);
success = success && (ZstrCompare(StrBegin(&output), "Hello 42 3.140000") == 0);
StrClear(&output);- In
Io.Write.c:355:
StrAppendFmt(&output, "{} {} {}", pi, hello, num);
success = success && (ZstrCompare(StrBegin(&output), "3.140000 Hello 42") == 0);
StrDeinit(&output);- In
Io.Write.c:372:
Zstr mixed_case = "MiXeD CaSe";
StrAppendFmt(&output, "{c}", mixed_case);
success = success && (ZstrCompare(StrBegin(&output), "MiXeD CaSe") == 0);
StrClear(&output);- In
Io.Write.c:376:
StrAppendFmt(&output, "{a}", mixed_case);
success = success && (ZstrCompare(StrBegin(&output), "mixed case") == 0);
StrClear(&output);- In
Io.Write.c:380:
StrAppendFmt(&output, "{A}", mixed_case);
success = success && (ZstrCompare(StrBegin(&output), "MIXED CASE") == 0);
StrClear(&output);- In
Io.Write.c:386:
StrAppendFmt(&output, "{c}", s);
success = success && (ZstrCompare(StrBegin(&output), "MiXeD CaSe") == 0);
StrClear(&output);- In
Io.Write.c:390:
StrAppendFmt(&output, "{a}", s);
success = success && (ZstrCompare(StrBegin(&output), "mixed case") == 0);
StrClear(&output);- In
Io.Write.c:394:
StrAppendFmt(&output, "{A}", s);
success = success && (ZstrCompare(StrBegin(&output), "MIXED CASE") == 0);
StrClear(&output);- In
Io.Write.c:401:
StrAppendFmt(&output, "{c}", upper_char);
success = success && (ZstrCompare(StrBegin(&output), "M") == 0);
StrClear(&output);- In
Io.Write.c:405:
StrAppendFmt(&output, "{a}", upper_char);
success = success && (ZstrCompare(StrBegin(&output), "m") == 0);
StrClear(&output);- In
Io.Write.c:409:
StrAppendFmt(&output, "{A}", lower_char);
success = success && (ZstrCompare(StrBegin(&output), "M") == 0);
StrClear(&output);- In
Io.Write.c:415:
StrAppendFmt(&output, "{c}", u16_value);
success = success && (StrLen(&output) == 2 && StrBegin(&output)[0] == 'A' && StrBegin(&output)[1] == 'B');
StrClear(&output);- In
Io.Write.c:419:
StrAppendFmt(&output, "{a}", u16_value);
success = success && (StrLen(&output) == 2 && StrBegin(&output)[0] == 'a' && StrBegin(&output)[1] == 'b');
StrClear(&output);- In
Io.Write.c:423:
StrAppendFmt(&output, "{A}", u16_value);
success = success && (StrLen(&output) == 2 && StrBegin(&output)[0] == 'A' && StrBegin(&output)[1] == 'B');
StrClear(&output);- In
Io.Write.c:429:
StrAppendFmt(&output, "{c}", i16_value);
success = success && (StrLen(&output) == 2 && StrBegin(&output)[0] == 'C' && StrBegin(&output)[1] == 'd');
StrClear(&output);- In
Io.Write.c:433:
StrAppendFmt(&output, "{a}", i16_value);
success = success && (StrLen(&output) == 2 && StrBegin(&output)[0] == 'c' && StrBegin(&output)[1] == 'd');
StrClear(&output);- In
Io.Write.c:437:
StrAppendFmt(&output, "{A}", i16_value);
success = success && (StrLen(&output) == 2 && StrBegin(&output)[0] == 'C' && StrBegin(&output)[1] == 'D');
StrClear(&output);- In
Io.Write.c:443:
StrAppendFmt(&output, "{c}", u32_value);
success = success && (StrLen(&output) == 4 && StrBegin(&output)[0] == 'E' && StrBegin(&output)[1] == 'f' &&
StrBegin(&output)[2] == 'G' && StrBegin(&output)[3] == 'h');
StrClear(&output);- In
Io.Write.c:444:
StrAppendFmt(&output, "{c}", u32_value);
success = success && (StrLen(&output) == 4 && StrBegin(&output)[0] == 'E' && StrBegin(&output)[1] == 'f' &&
StrBegin(&output)[2] == 'G' && StrBegin(&output)[3] == 'h');
StrClear(&output);- In
Io.Write.c:448:
StrAppendFmt(&output, "{a}", u32_value);
success = success && (StrLen(&output) == 4 && StrBegin(&output)[0] == 'e' && StrBegin(&output)[1] == 'f' &&
StrBegin(&output)[2] == 'g' && StrBegin(&output)[3] == 'h');
StrClear(&output);- In
Io.Write.c:449:
StrAppendFmt(&output, "{a}", u32_value);
success = success && (StrLen(&output) == 4 && StrBegin(&output)[0] == 'e' && StrBegin(&output)[1] == 'f' &&
StrBegin(&output)[2] == 'g' && StrBegin(&output)[3] == 'h');
StrClear(&output);- In
Io.Write.c:453:
StrAppendFmt(&output, "{A}", u32_value);
success = success && (StrLen(&output) == 4 && StrBegin(&output)[0] == 'E' && StrBegin(&output)[1] == 'F' &&
StrBegin(&output)[2] == 'G' && StrBegin(&output)[3] == 'H');
StrClear(&output);- In
Io.Write.c:454:
StrAppendFmt(&output, "{A}", u32_value);
success = success && (StrLen(&output) == 4 && StrBegin(&output)[0] == 'E' && StrBegin(&output)[1] == 'F' &&
StrBegin(&output)[2] == 'G' && StrBegin(&output)[3] == 'H');
StrClear(&output);- In
Io.Write.c:460:
StrAppendFmt(&output, "{c}", i32_value);
success = success && (StrLen(&output) == 4 && StrBegin(&output)[0] == 'I' && StrBegin(&output)[1] == 'j' &&
StrBegin(&output)[2] == 'K' && StrBegin(&output)[3] == 'l');
StrClear(&output);- In
Io.Write.c:461:
StrAppendFmt(&output, "{c}", i32_value);
success = success && (StrLen(&output) == 4 && StrBegin(&output)[0] == 'I' && StrBegin(&output)[1] == 'j' &&
StrBegin(&output)[2] == 'K' && StrBegin(&output)[3] == 'l');
StrClear(&output);- In
Io.Write.c:465:
StrAppendFmt(&output, "{a}", i32_value);
success = success && (StrLen(&output) == 4 && StrBegin(&output)[0] == 'i' && StrBegin(&output)[1] == 'j' &&
StrBegin(&output)[2] == 'k' && StrBegin(&output)[3] == 'l');
StrClear(&output);- In
Io.Write.c:466:
StrAppendFmt(&output, "{a}", i32_value);
success = success && (StrLen(&output) == 4 && StrBegin(&output)[0] == 'i' && StrBegin(&output)[1] == 'j' &&
StrBegin(&output)[2] == 'k' && StrBegin(&output)[3] == 'l');
StrClear(&output);- In
Io.Write.c:470:
StrAppendFmt(&output, "{A}", i32_value);
success = success && (StrLen(&output) == 4 && StrBegin(&output)[0] == 'I' && StrBegin(&output)[1] == 'J' &&
StrBegin(&output)[2] == 'K' && StrBegin(&output)[3] == 'L');
StrClear(&output);- In
Io.Write.c:471:
StrAppendFmt(&output, "{A}", i32_value);
success = success && (StrLen(&output) == 4 && StrBegin(&output)[0] == 'I' && StrBegin(&output)[1] == 'J' &&
StrBegin(&output)[2] == 'K' && StrBegin(&output)[3] == 'L');
StrClear(&output);- In
Io.Write.c:478:
StrAppendFmt(&output, "{c}", u64_value);
success = success && (StrLen(&output) == 8 && StrBegin(&output)[0] == 'M' && StrBegin(&output)[1] == 'n' &&
StrBegin(&output)[2] == 'O' && StrBegin(&output)[3] == 'p' && StrBegin(&output)[4] == 'Q' &&
StrBegin(&output)[5] == 'r' && StrBegin(&output)[6] == 'S' && StrBegin(&output)[7] == 't');- In
Io.Write.c:479:
StrAppendFmt(&output, "{c}", u64_value);
success = success && (StrLen(&output) == 8 && StrBegin(&output)[0] == 'M' && StrBegin(&output)[1] == 'n' &&
StrBegin(&output)[2] == 'O' && StrBegin(&output)[3] == 'p' && StrBegin(&output)[4] == 'Q' &&
StrBegin(&output)[5] == 'r' && StrBegin(&output)[6] == 'S' && StrBegin(&output)[7] == 't');
StrClear(&output);- In
Io.Write.c:480:
success = success && (StrLen(&output) == 8 && StrBegin(&output)[0] == 'M' && StrBegin(&output)[1] == 'n' &&
StrBegin(&output)[2] == 'O' && StrBegin(&output)[3] == 'p' && StrBegin(&output)[4] == 'Q' &&
StrBegin(&output)[5] == 'r' && StrBegin(&output)[6] == 'S' && StrBegin(&output)[7] == 't');
StrClear(&output);- In
Io.Write.c:484:
StrAppendFmt(&output, "{a}", u64_value);
success = success && (StrLen(&output) == 8 && StrBegin(&output)[0] == 'm' && StrBegin(&output)[1] == 'n' &&
StrBegin(&output)[2] == 'o' && StrBegin(&output)[3] == 'p' && StrBegin(&output)[4] == 'q' &&
StrBegin(&output)[5] == 'r' && StrBegin(&output)[6] == 's' && StrBegin(&output)[7] == 't');- In
Io.Write.c:485:
StrAppendFmt(&output, "{a}", u64_value);
success = success && (StrLen(&output) == 8 && StrBegin(&output)[0] == 'm' && StrBegin(&output)[1] == 'n' &&
StrBegin(&output)[2] == 'o' && StrBegin(&output)[3] == 'p' && StrBegin(&output)[4] == 'q' &&
StrBegin(&output)[5] == 'r' && StrBegin(&output)[6] == 's' && StrBegin(&output)[7] == 't');
StrClear(&output);- In
Io.Write.c:486:
success = success && (StrLen(&output) == 8 && StrBegin(&output)[0] == 'm' && StrBegin(&output)[1] == 'n' &&
StrBegin(&output)[2] == 'o' && StrBegin(&output)[3] == 'p' && StrBegin(&output)[4] == 'q' &&
StrBegin(&output)[5] == 'r' && StrBegin(&output)[6] == 's' && StrBegin(&output)[7] == 't');
StrClear(&output);- In
Io.Write.c:490:
StrAppendFmt(&output, "{A}", u64_value);
success = success && (StrLen(&output) == 8 && StrBegin(&output)[0] == 'M' && StrBegin(&output)[1] == 'N' &&
StrBegin(&output)[2] == 'O' && StrBegin(&output)[3] == 'P' && StrBegin(&output)[4] == 'Q' &&
StrBegin(&output)[5] == 'R' && StrBegin(&output)[6] == 'S' && StrBegin(&output)[7] == 'T');- In
Io.Write.c:491:
StrAppendFmt(&output, "{A}", u64_value);
success = success && (StrLen(&output) == 8 && StrBegin(&output)[0] == 'M' && StrBegin(&output)[1] == 'N' &&
StrBegin(&output)[2] == 'O' && StrBegin(&output)[3] == 'P' && StrBegin(&output)[4] == 'Q' &&
StrBegin(&output)[5] == 'R' && StrBegin(&output)[6] == 'S' && StrBegin(&output)[7] == 'T');
StrClear(&output);- In
Io.Write.c:492:
success = success && (StrLen(&output) == 8 && StrBegin(&output)[0] == 'M' && StrBegin(&output)[1] == 'N' &&
StrBegin(&output)[2] == 'O' && StrBegin(&output)[3] == 'P' && StrBegin(&output)[4] == 'Q' &&
StrBegin(&output)[5] == 'R' && StrBegin(&output)[6] == 'S' && StrBegin(&output)[7] == 'T');
StrClear(&output);- In
Io.Write.c:499:
StrAppendFmt(&output, "{c}", i64_value);
success = success && (StrLen(&output) == 8 && StrBegin(&output)[0] == 'U' && StrBegin(&output)[1] == 'v' &&
StrBegin(&output)[2] == 'W' && StrBegin(&output)[3] == 'x' && StrBegin(&output)[4] == 'Y' &&
StrBegin(&output)[5] == 'z' && StrBegin(&output)[6] == '1' && StrBegin(&output)[7] == '2');- In
Io.Write.c:500:
StrAppendFmt(&output, "{c}", i64_value);
success = success && (StrLen(&output) == 8 && StrBegin(&output)[0] == 'U' && StrBegin(&output)[1] == 'v' &&
StrBegin(&output)[2] == 'W' && StrBegin(&output)[3] == 'x' && StrBegin(&output)[4] == 'Y' &&
StrBegin(&output)[5] == 'z' && StrBegin(&output)[6] == '1' && StrBegin(&output)[7] == '2');
StrClear(&output);- In
Io.Write.c:501:
success = success && (StrLen(&output) == 8 && StrBegin(&output)[0] == 'U' && StrBegin(&output)[1] == 'v' &&
StrBegin(&output)[2] == 'W' && StrBegin(&output)[3] == 'x' && StrBegin(&output)[4] == 'Y' &&
StrBegin(&output)[5] == 'z' && StrBegin(&output)[6] == '1' && StrBegin(&output)[7] == '2');
StrClear(&output);- In
Io.Write.c:505:
StrAppendFmt(&output, "{a}", i64_value);
success = success && (StrLen(&output) == 8 && StrBegin(&output)[0] == 'u' && StrBegin(&output)[1] == 'v' &&
StrBegin(&output)[2] == 'w' && StrBegin(&output)[3] == 'x' && StrBegin(&output)[4] == 'y' &&
StrBegin(&output)[5] == 'z' && StrBegin(&output)[6] == '1' && StrBegin(&output)[7] == '2');- In
Io.Write.c:506:
StrAppendFmt(&output, "{a}", i64_value);
success = success && (StrLen(&output) == 8 && StrBegin(&output)[0] == 'u' && StrBegin(&output)[1] == 'v' &&
StrBegin(&output)[2] == 'w' && StrBegin(&output)[3] == 'x' && StrBegin(&output)[4] == 'y' &&
StrBegin(&output)[5] == 'z' && StrBegin(&output)[6] == '1' && StrBegin(&output)[7] == '2');
StrClear(&output);- In
Io.Write.c:507:
success = success && (StrLen(&output) == 8 && StrBegin(&output)[0] == 'u' && StrBegin(&output)[1] == 'v' &&
StrBegin(&output)[2] == 'w' && StrBegin(&output)[3] == 'x' && StrBegin(&output)[4] == 'y' &&
StrBegin(&output)[5] == 'z' && StrBegin(&output)[6] == '1' && StrBegin(&output)[7] == '2');
StrClear(&output);- In
Io.Write.c:511:
StrAppendFmt(&output, "{A}", i64_value);
success = success && (StrLen(&output) == 8 && StrBegin(&output)[0] == 'U' && StrBegin(&output)[1] == 'V' &&
StrBegin(&output)[2] == 'W' && StrBegin(&output)[3] == 'X' && StrBegin(&output)[4] == 'Y' &&
StrBegin(&output)[5] == 'Z' && StrBegin(&output)[6] == '1' && StrBegin(&output)[7] == '2');- In
Io.Write.c:512:
StrAppendFmt(&output, "{A}", i64_value);
success = success && (StrLen(&output) == 8 && StrBegin(&output)[0] == 'U' && StrBegin(&output)[1] == 'V' &&
StrBegin(&output)[2] == 'W' && StrBegin(&output)[3] == 'X' && StrBegin(&output)[4] == 'Y' &&
StrBegin(&output)[5] == 'Z' && StrBegin(&output)[6] == '1' && StrBegin(&output)[7] == '2');- In
Io.Write.c:513:
success = success && (StrLen(&output) == 8 && StrBegin(&output)[0] == 'U' && StrBegin(&output)[1] == 'V' &&
StrBegin(&output)[2] == 'W' && StrBegin(&output)[3] == 'X' && StrBegin(&output)[4] == 'Y' &&
StrBegin(&output)[5] == 'Z' && StrBegin(&output)[6] == '1' && StrBegin(&output)[7] == '2');
StrDeinit(&output);- In
Io.Write.c:532:
BitVec bv1 = BitVecFromStr("10110", alloc_base);
StrAppendFmt(&output, "{}", bv1);
success = success && (ZstrCompare(StrBegin(&output), "10110") == 0);
StrClear(&output);- In
Io.Write.c:542:
BitVec bv2 = BitVecFromInteger(0xABCD, 16, alloc_base);
StrAppendFmt(&output, "{x}", bv2);
success = success && (ZstrCompare(StrBegin(&output), "0xabcd") == 0);
StrClear(&output);- In
Io.Write.c:546:
StrAppendFmt(&output, "{X}", bv2);
success = success && (ZstrCompare(StrBegin(&output), "0xABCD") == 0);
StrClear(&output);- In
Io.Write.c:551:
BitVec bv3 = BitVecFromInteger(0755, 10, alloc_base);
StrAppendFmt(&output, "{o}", bv3);
success = success && (ZstrCompare(StrBegin(&output), "0o755") == 0);
StrClear(&output);- In
Io.Write.c:555:
StrAppendFmt(&output, "{>10}", bv1);
success = success && (ZstrCompare(StrBegin(&output), " 10110") == 0);
StrClear(&output);- In
Io.Write.c:559:
StrAppendFmt(&output, "{<10}", bv1);
success = success && (ZstrCompare(StrBegin(&output), "10110 ") == 0);
StrClear(&output);- In
Io.Write.c:563:
StrAppendFmt(&output, "{^10}", bv1);
success = success && (ZstrCompare(StrBegin(&output), " 10110 ") == 0);
StrClear(&output);- In
Io.Write.c:568:
BitVec bv_zero = BitVecFromInteger(0, 1, alloc_base);
StrAppendFmt(&output, "{x}", bv_zero);
success = success && (ZstrCompare(StrBegin(&output), "0x0") == 0);
StrClear(&output);- In
Io.Write.c:572:
StrAppendFmt(&output, "{o}", bv_zero);
success = success && (ZstrCompare(StrBegin(&output), "0o0") == 0);
StrClear(&output);- In
Io.Write.c:600:
StrAppendFmt(&output, "{}", big_dec);
success = success && (ZstrCompare(StrBegin(&output), "123456789012345678901234567890") == 0);
StrClear(&output);- In
Io.Write.c:604:
StrAppendFmt(&output, "{x}", hex_val);
success = success && (ZstrCompare(StrBegin(&output), "deadbeefcafebabe1234") == 0);
StrClear(&output);- In
Io.Write.c:608:
StrAppendFmt(&output, "{X}", hex_val);
success = success && (ZstrCompare(StrBegin(&output), "DEADBEEFCAFEBABE1234") == 0);
StrClear(&output);- In
Io.Write.c:612:
StrAppendFmt(&output, "{b}", bin_val);
success = success && (ZstrCompare(StrBegin(&output), "10100011") == 0);
StrClear(&output);- In
Io.Write.c:616:
StrAppendFmt(&output, "{o}", oct_val);
success = success && (ZstrCompare(StrBegin(&output), "755") == 0);
StrClear(&output);- In
Io.Write.c:620:
StrAppendFmt(&output, "{>34}", big_dec);
success = success && (ZstrCompare(StrBegin(&output), " 123456789012345678901234567890") == 0);
IntDeinit(&big_dec);- In
Io.Write.c:644:
StrAppendFmt(&output, "{}", exact);
success = success && (ZstrCompare(StrBegin(&output), "1234567890.012345") == 0);
StrClear(&output);- In
Io.Write.c:648:
StrAppendFmt(&output, "{e}", sci);
success = success && (ZstrCompare(StrBegin(&output), "1.234567e+04") == 0);
StrClear(&output);- In
Io.Write.c:652:
StrAppendFmt(&output, "{E}", sci);
success = success && (ZstrCompare(StrBegin(&output), "1.234567E+04") == 0);
StrClear(&output);- In
Io.Write.c:656:
StrAppendFmt(&output, "{.3}", short_v);
success = success && (ZstrCompare(StrBegin(&output), "1.200") == 0);
StrClear(&output);- In
Io.Write.c:660:
StrAppendFmt(&output, "{>18}", sci);
success = success && (ZstrCompare(StrBegin(&output), " 12345.67") == 0);
FloatDeinit(&exact);- In
Io.Write.c:678:
StrAppendFmt(&s, "old prefix ");
StrWriteFmt(&s, "fresh {}", LVAL(42));
bool ok = (StrLen(&s) == 8) && (StrBegin(&s)[0] == 'f') && (StrBegin(&s)[StrLen(&s) - 1] == '2');
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);- In
Io.Write.c:695:
bool ok = StrPatchFmt(&s, 2, "{}", LVAL(1234));
ok = ok && StrLen(&s) == before_length;
ok = ok && StrBegin(&s)[0] == 'A' && StrBegin(&s)[1] == 'A';
ok = ok && StrBegin(&s)[2] == '1' && StrBegin(&s)[3] == '2' && StrBegin(&s)[4] == '3' && StrBegin(&s)[5] == '4';
ok = ok && StrBegin(&s)[6] == 'A' && StrBegin(&s)[7] == 'A';- In
Io.Write.c:696:
ok = ok && StrLen(&s) == before_length;
ok = ok && StrBegin(&s)[0] == 'A' && StrBegin(&s)[1] == 'A';
ok = ok && StrBegin(&s)[2] == '1' && StrBegin(&s)[3] == '2' && StrBegin(&s)[4] == '3' && StrBegin(&s)[5] == '4';
ok = ok && StrBegin(&s)[6] == 'A' && StrBegin(&s)[7] == 'A';- In
Io.Write.c:697:
ok = ok && StrBegin(&s)[0] == 'A' && StrBegin(&s)[1] == 'A';
ok = ok && StrBegin(&s)[2] == '1' && StrBegin(&s)[3] == '2' && StrBegin(&s)[4] == '3' && StrBegin(&s)[5] == '4';
ok = ok && StrBegin(&s)[6] == 'A' && StrBegin(&s)[7] == 'A';
// Patch that would extend past the end must fail.
- In
Io.Write.c:702:
ok = ok && !StrPatchFmt(&s, 6, "{}", LVAL(9999));
ok = ok && StrLen(&s) == before_length;
ok = ok && StrBegin(&s)[6] == 'A' && StrBegin(&s)[7] == 'A';
StrDeinit(&s);- In
Str.Insert.c:39:
// Check that the character was inserted correctly
bool result = (ZstrCompare(StrBegin(&s), "He!llo") == 0);
// Insert a character at the beginning
- In
Str.Insert.c:45:
// Check that the character was inserted correctly
result = result && (ZstrCompare(StrBegin(&s), "?He!llo") == 0);
// Insert a character at the end
- In
Str.Insert.c:51:
// Check that the character was inserted correctly
result = result && (ZstrCompare(StrBegin(&s), "?He!llo.") == 0);
StrDeinit(&s);- In
Str.Insert.c:70:
// Check that the string was inserted correctly
bool result = (ZstrCompare(StrBegin(&s), "He Worldllo") == 0);
StrDeinit(&s);- In
Str.Insert.c:90:
// Check that the string was inserted correctly
bool result = (ZstrCompare(StrBegin(&s), "He Worldllo") == 0);
StrDeinit(&s);- In
Str.Insert.c:109:
// Check that the string was inserted correctly
bool result = (ZstrCompare(StrBegin(&s), "He Worldllo") == 0);
StrDeinit(&s);- In
Str.Insert.c:128:
// Check that the string was inserted correctly
bool result = (ZstrCompare(StrBegin(&s), "He Worldllo") == 0);
StrDeinit(&s);- In
Str.Insert.c:147:
// Check that the string was inserted correctly
bool result = (ZstrCompare(StrBegin(&s), "Hello World") == 0);
StrDeinit(&s);- In
Str.Insert.c:166:
// Check that the string was inserted correctly
bool result = (ZstrCompare(StrBegin(&s), "Hello World") == 0);
StrDeinit(&s);- In
Str.Insert.c:185:
// Check that the string was inserted correctly
bool result = (ZstrCompare(StrBegin(&s), "Hello World") == 0);
StrDeinit(&s);- In
Str.Insert.c:204:
// Check that the string was inserted correctly
bool result = (ZstrCompare(StrBegin(&s), "Hello World") == 0);
StrDeinit(&s);- In
Str.Insert.c:228:
// Check that the characters were inserted correctly
bool result = (ZstrCompare(StrBegin(&s), "Hello World") == 0);
StrDeinit(&s);- In
Str.Insert.c:252:
// Check that the characters were inserted correctly
bool result = (ZstrCompare(StrBegin(&s), "Hello World") == 0);
StrDeinit(&s);- In
Str.Insert.c:276:
// Check that the strings were merged correctly
bool result = (ZstrCompare(StrBegin(&s1), "Hello World") == 0);
// Check that s2 was reset - data should be NULL, length should be 0
- In
Str.Insert.c:279:
// Check that s2 was reset - data should be NULL, length should be 0
result = result && (StrLen(&s2) == 0 && StrBegin(&s2) == NULL);
StrDeinit(&s1);- In
Str.Insert.c:300:
// Check that the strings were merged correctly
bool result = (ZstrCompare(StrBegin(&s1), "Hello World") == 0);
// Check that s2 was not reset
- In
Str.Insert.c:303:
// Check that s2 was not reset
result = result && (StrLen(&s2) == 6 && ZstrCompare(StrBegin(&s2), " World") == 0);
StrDeinit(&s1);- In
Str.Insert.c:324:
// Check that the strings were merged correctly
bool result = (ZstrCompare(StrBegin(&s1), "Hello World") == 0);
// s2 was zeroed on take per L-form contract
- In
Str.Insert.c:327:
// s2 was zeroed on take per L-form contract
result = result && (StrLen(&s2) == 0 && StrBegin(&s2) == NULL);
StrDeinit(&s1);- In
Str.Insert.c:348:
// Check that the string was appended correctly
bool result = (ZstrCompare(StrBegin(&s), "Hello World 2023") == 0);
StrDeinit(&s);- In
Float.Math.c:36:
text = FloatToStr(&value);
bool result = ZstrCompare(StrBegin(&text), "-12.5") == 0;
StrDeinit(&text);- In
Float.Math.c:41:
FloatAbs(&value);
text = FloatToStr(&value);
result = result && (ZstrCompare(StrBegin(&text), "12.5") == 0);
StrDeinit(&text);- In
Float.Math.c:62:
text = FloatToStr(&result_value);
bool result = ZstrCompare(StrBegin(&text), "1.23") == 0;
StrDeinit(&text);- In
Float.Math.c:85:
text = FloatToStr(&result_value);
bool result = ZstrCompare(StrBegin(&text), FLOAT_TEST_VERY_LARGE_THREES) == 0;
StrDeinit(&text);- In
Float.Math.c:108:
FloatAdd(&result_value, &a, &b);
text = FloatToStr(&result_value);
bool result = ZstrCompare(StrBegin(&text), "2") == 0;
StrDeinit(&text);- In
Float.Math.c:113:
FloatAdd(&result_value, &a, &whole);
text = FloatToStr(&result_value);
result = result && (ZstrCompare(StrBegin(&text), "3.25") == 0);
StrDeinit(&text);- In
Float.Math.c:118:
FloatAdd(&result_value, &a, 2u);
text = FloatToStr(&result_value);
result = result && (ZstrCompare(StrBegin(&text), "3.25") == 0);
StrDeinit(&text);- In
Float.Math.c:123:
FloatAdd(&result_value, &a, -1);
text = FloatToStr(&result_value);
result = result && (ZstrCompare(StrBegin(&text), "0.25") == 0);
StrDeinit(&text);- In
Float.Math.c:128:
FloatAdd(&result_value, &a, 0.75f);
text = FloatToStr(&result_value);
result = result && (ZstrCompare(StrBegin(&text), "2") == 0);
StrDeinit(&text);- In
Float.Math.c:133:
FloatAdd(&result_value, &a, 0.75);
text = FloatToStr(&result_value);
result = result && (ZstrCompare(StrBegin(&text), "2") == 0);
FloatDeinit(&a);- In
Float.Math.c:157:
text = FloatToStr(&result_value);
bool result = ZstrCompare(StrBegin(&text), "-0.5") == 0;
StrDeinit(&text);- In
Float.Math.c:180:
text = FloatToStr(&result_value);
bool result = ZstrCompare(StrBegin(&text), FLOAT_TEST_VERY_LARGE_TWOS) == 0;
StrDeinit(&text);- In
Float.Math.c:203:
FloatSub(&result_value, &a, &b);
text = FloatToStr(&result_value);
bool result = ZstrCompare(StrBegin(&text), "5") == 0;
StrDeinit(&text);- In
Float.Math.c:208:
FloatSub(&result_value, &a, &whole);
text = FloatToStr(&result_value);
result = result && (ZstrCompare(StrBegin(&text), "3.5") == 0);
StrDeinit(&text);- In
Float.Math.c:213:
FloatSub(&result_value, &a, 2u);
text = FloatToStr(&result_value);
result = result && (ZstrCompare(StrBegin(&text), "3.5") == 0);
StrDeinit(&text);- In
Float.Math.c:218:
FloatSub(&result_value, &a, -2);
text = FloatToStr(&result_value);
result = result && (ZstrCompare(StrBegin(&text), "7.5") == 0);
StrDeinit(&text);- In
Float.Math.c:223:
FloatSub(&result_value, &a, 0.5f);
text = FloatToStr(&result_value);
result = result && (ZstrCompare(StrBegin(&text), "5") == 0);
FloatDeinit(&a);- In
Float.Math.c:247:
text = FloatToStr(&result_value);
bool result = ZstrCompare(StrBegin(&text), "-2.5") == 0;
StrDeinit(&text);- In
Float.Math.c:270:
text = FloatToStr(&result_value);
bool result = ZstrCompare(StrBegin(&text), FLOAT_TEST_VERY_LARGE_TWOS) == 0;
StrDeinit(&text);- In
Float.Math.c:293:
FloatMul(&result_value, &a, &b);
text = FloatToStr(&result_value);
bool result = ZstrCompare(StrBegin(&text), "3") == 0;
StrDeinit(&text);- In
Float.Math.c:298:
FloatMul(&result_value, &a, &whole);
text = FloatToStr(&result_value);
result = result && (ZstrCompare(StrBegin(&text), "3") == 0);
StrDeinit(&text);- In
Float.Math.c:303:
FloatMul(&result_value, &a, 2u);
text = FloatToStr(&result_value);
result = result && (ZstrCompare(StrBegin(&text), "3") == 0);
StrDeinit(&text);- In
Float.Math.c:308:
FloatMul(&result_value, &a, -2);
text = FloatToStr(&result_value);
result = result && (ZstrCompare(StrBegin(&text), "-3") == 0);
StrDeinit(&text);- In
Float.Math.c:313:
FloatMul(&result_value, &a, 0.5f);
text = FloatToStr(&result_value);
result = result && (ZstrCompare(StrBegin(&text), "0.75") == 0);
FloatDeinit(&a);- In
Float.Math.c:337:
text = FloatToStr(&result_value);
bool result = ZstrCompare(StrBegin(&text), "0.125") == 0;
StrDeinit(&text);- In
Float.Math.c:360:
text = FloatToStr(&result_value);
bool result = ZstrCompare(StrBegin(&text), FLOAT_TEST_VERY_LARGE_ONES) == 0;
StrDeinit(&text);- In
Float.Math.c:383:
FloatDiv(&result_value, &a, &b, 1);
text = FloatToStr(&result_value);
bool result = ZstrCompare(StrBegin(&text), "3") == 0;
StrDeinit(&text);- In
Float.Math.c:388:
FloatDiv(&result_value, &a, &whole, 1);
text = FloatToStr(&result_value);
result = result && (ZstrCompare(StrBegin(&text), "2.5") == 0);
StrDeinit(&text);- In
Float.Math.c:393:
FloatDiv(&result_value, &a, 3u, 1);
text = FloatToStr(&result_value);
result = result && (ZstrCompare(StrBegin(&text), "2.5") == 0);
StrDeinit(&text);- In
Float.Math.c:398:
FloatDiv(&result_value, &a, -3, 1);
text = FloatToStr(&result_value);
result = result && (ZstrCompare(StrBegin(&text), "-2.5") == 0);
StrDeinit(&text);- In
Float.Math.c:403:
FloatDiv(&result_value, &a, 0.5f, 1);
text = FloatToStr(&result_value);
result = result && (ZstrCompare(StrBegin(&text), "15") == 0);
StrDeinit(&text);- In
Float.Math.c:408:
FloatDiv(&result_value, &a, 0.5, 1);
text = FloatToStr(&result_value);
result = result && (ZstrCompare(StrBegin(&text), "15") == 0);
FloatDeinit(&a);- In
Int.Math.c:110:
bool result = IntToU64(&result_value) == 256;
result = result && (ZstrCompare(StrBegin(&text), "100000000") == 0);
StrDeinit(&text);- In
Int.Math.c:142:
IntAdd(&result_value, &huge, 10);
text = IntToStr(&result_value);
result = result && (ZstrCompare(StrBegin(&text), "123456789012345678901234567900") == 0);
IntDeinit(&base);- In
Int.Math.c:195:
result = result && IntSub(&result_value, &huge, 90);
text = IntToStr(&result_value);
result = result && (ZstrCompare(StrBegin(&text), "12345678901234567800") == 0);
result = result && !IntSub(&preserved, &base, 50);- In
Int.Math.c:261:
text = IntToStr(&result_value);
bool result = ZstrCompare(StrBegin(&text), "308641972530864197250") == 0;
IntDeinit(&value);- In
Int.Math.c:321:
IntPow(&result_value, &base, 20u);
text = IntToStr(&result_value);
bool result = ZstrCompare(StrBegin(&text), "79792266297612001") == 0;
StrDeinit(&text);- In
Int.Math.c:326:
IntPow(&result_value, &base, &exponent);
text = IntToStr(&result_value);
result = result && (ZstrCompare(StrBegin(&text), "79792266297612001") == 0);
IntDeinit(&base);- In
Int.Math.c:349:
qtext = IntToStr("ient);
bool result = ZstrCompare(StrBegin(&qtext), "127275040218913071") == 0;
result = result && (IntToU64(&remainder) == 3);- In
Int.Math.c:389:
bool result = IntDivExact(&result_value, ÷nd, 90u);
text = IntToStr(&result_value);
result = result && (ZstrCompare(StrBegin(&text), "137174210013717421") == 0);
IntDeinit(÷nd);- In
Int.Math.c:430:
text = IntToStr("ient);
bool result = ZstrCompare(StrBegin(&text), "127275040218913071") == 0;
result = result && (IntToU64(&remainder) == 3);- In
Int.Math.c:900:
text = IntToStr(&next);
bool result = ok && ZstrCompare(StrBegin(&text), "1000000007") == 0;
IntDeinit(&value);- In
File.c:55:
bool result = (got == (i64)ZstrLen("hello from file")) && (StrLen(&body) == (size)ZstrLen("hello from file")) &&
ZstrCompare(StrBegin(&body), "hello from file") == 0;
StrDeinit(&body);- In
File.c:90:
Zstr expected = "this is longer than the initial buffer";
bool result = (got == (i64)ZstrLen(expected)) && (StrLen(&body) == (size)ZstrLen(expected)) &&
ZstrCompare(StrBegin(&body), expected) == 0 && StrCapacity(&body) >= StrLen(&body) + 1;
StrDeinit(&body);- In
Str.Type.c:36:
StrPushBackR(&s, 'o');
bool result = (StrLen(&s) == 5 && ZstrCompare(StrBegin(&s), "Hello") == 0);
StrDeinit(&s);- In
Str.Type.c:67:
Str *str2 = &VecAt(&sv, 1);
result = result && (ZstrCompare(StrBegin(str1), "Hello") == 0);
result = result && (ZstrCompare(StrBegin(str2), "World") == 0);
}- In
Str.Type.c:68:
result = result && (ZstrCompare(StrBegin(str1), "Hello") == 0);
result = result && (ZstrCompare(StrBegin(str2), "World") == 0);
} // Check result
bool result = ok && (StrLen(&str) == 4);
result = result && (StrBegin(&str)[0] == '1');
result = result && (StrBegin(&str)[1] == '0');
result = result && (StrBegin(&str)[2] == '1'); bool result = ok && (StrLen(&str) == 4);
result = result && (StrBegin(&str)[0] == '1');
result = result && (StrBegin(&str)[1] == '0');
result = result && (StrBegin(&str)[2] == '1');
result = result && (StrBegin(&str)[3] == '1'); result = result && (StrBegin(&str)[0] == '1');
result = result && (StrBegin(&str)[1] == '0');
result = result && (StrBegin(&str)[2] == '1');
result = result && (StrBegin(&str)[3] == '1'); result = result && (StrBegin(&str)[1] == '0');
result = result && (StrBegin(&str)[2] == '1');
result = result && (StrBegin(&str)[3] == '1');
// Clean up
ok = BitVecTryToStr(&str, &bv);
result = result && ok && (StrAllocator(&str)->effort == alloc.base.effort) &&
(StrAllocator(&str)->retry_limit == alloc.base.retry_limit) && (ZstrCompare(StrBegin(&str), "101001") == 0);
StrDeinit(&str);
// Should get exact same string back
result = result && (ZstrCompare(StrBegin(&str), patterns[i]) == 0);
StrDeinit(&str); // Test string conversion consistency
Str str = BitVecToStr(&bv);
result = result && (ZstrCompare(StrBegin(&str), test_cases[i].pattern) == 0);
StrDeinit(&str);
// At least two of them should match (bit order might affect one)
bool cross_match = (ZstrCompare(StrBegin(&str1), StrBegin(&str2)) == 0) ||
(ZstrCompare(StrBegin(&str1), StrBegin(&str3)) == 0) ||
(ZstrCompare(StrBegin(&str2), StrBegin(&str3)) == 0); // At least two of them should match (bit order might affect one)
bool cross_match = (ZstrCompare(StrBegin(&str1), StrBegin(&str2)) == 0) ||
(ZstrCompare(StrBegin(&str1), StrBegin(&str3)) == 0) ||
(ZstrCompare(StrBegin(&str2), StrBegin(&str3)) == 0);
result = result && cross_match; bool cross_match = (ZstrCompare(StrBegin(&str1), StrBegin(&str2)) == 0) ||
(ZstrCompare(StrBegin(&str1), StrBegin(&str3)) == 0) ||
(ZstrCompare(StrBegin(&str2), StrBegin(&str3)) == 0);
result = result && cross_match; for (u64 i = 0; i < StrLen(&large_str); i++) {
bool expected = (i % 3) == 0;
bool actual = (StrBegin(&large_str)[i] == '1');
if (expected != actual) {
pattern_correct = false;
static GraphNodeId city_add_intersection(CityGraph *graph, CityIndex *index, const Str *name, DefaultAllocator *alloc) {
GraphNodeId id = GraphAddNodeR(graph, StrInitFromCstr(StrBegin(name), StrLen(name), alloc));
Str key_copy = StrInitFromCstr(StrBegin(name), StrLen(name), alloc); GraphNodeId id = GraphAddNodeR(graph, StrInitFromCstr(StrBegin(name), StrLen(name), alloc));
Str key_copy = StrInitFromCstr(StrBegin(name), StrLen(name), alloc);
MapInsertR(index, key_copy, id);
return id;- In
Dns.c:162:
match = r0->type == DNS_TYPE_A && r0->ttl == 300 && r0->ipv4[0] == 93 && r0->ipv4[1] == 184 &&
r0->ipv4[2] == 216 && r0->ipv4[3] == 34 && StrLen(&r0->name) > 0 &&
ZstrCompare(StrBegin(&r0->name), "example.com") == 0;
}
if (match) {- In
Dns.c:296:
DnsRecord *r = VecPtrAt(&resp.answers, 0);
match = r->type == DNS_TYPE_CNAME && StrLen(&r->target) > 0 &&
ZstrCompare(StrBegin(&r->target), "example.com") == 0;
}- In
Str.Init.c:56:
// Check that it's initialized correctly
bool result = (StrLen(&s) == len && ZstrCompareN(StrBegin(&s), test_str, len) == 0 && StrBegin(&s)[len] == '\0');
StrDeinit(&s);- In
Str.Init.c:76:
// Check that it's initialized correctly
bool result = (StrLen(&s) == ZstrLen(test_str) && ZstrCompare(StrBegin(&s), test_str) == 0);
StrDeinit(&s);- In
Str.Init.c:94:
ValidateStr(&s);
bool result = (StrLen(&s) == ZstrLen(test_str) && ZstrCompare(StrBegin(&s), test_str) == 0);
StrDeinit(&s);- In
Str.Init.c:115:
// Check that dst is initialized correctly
bool result = (StrLen(&dst) == StrLen(&src) && ZstrCompare(StrBegin(&dst), StrBegin(&src)) == 0);
StrDeinit(&src);- In
Str.Init.c:137:
// Check that dst is initialized correctly
bool result = (StrLen(&dst) == StrLen(&src) && ZstrCompare(StrBegin(&dst), StrBegin(&src)) == 0);
StrDeinit(&src);- In
Str.Init.c:158:
// Check that it's initialized correctly
bool result = (ZstrCompare(StrBegin(&s), "Hello, World!") == 0);
StrDeinit(&s);- In
Str.Init.c:178:
ValidateStr(&stack_str);
if (ZstrCompare(StrBegin(&stack_str), "Hello, Stack!") != 0) {
result = false;
}- In
Str.Init.c:210:
// Check that the copy was successful
bool result = (success && StrLen(&dst) == StrLen(&src) && ZstrCompare(StrBegin(&dst), StrBegin(&src)) == 0);
StrDeinit(&src);- In
Str.Init.c:238:
bool result = copied && StrLen(&dup) == StrLen(&src) && StrLen(&dst) == StrLen(&src) &&
ZstrCompare(StrBegin(&dup), StrBegin(&src)) == 0 &&
ZstrCompare(StrBegin(&dst), StrBegin(&src)) == 0 && dup_allocator_matches && dst_allocator_matches;- In
Str.Init.c:239:
bool result = copied && StrLen(&dup) == StrLen(&src) && StrLen(&dst) == StrLen(&src) &&
ZstrCompare(StrBegin(&dup), StrBegin(&src)) == 0 &&
ZstrCompare(StrBegin(&dst), StrBegin(&src)) == 0 && dup_allocator_matches && dst_allocator_matches;
StrDeinit(&src);- In
Str.Foreach.c:48:
// The result should be "H0e1l2l3o4"
bool success = (ZstrCompare(StrBegin(&result), "H0e1l2l3o4") == 0);
StrDeinit(&s);- In
Str.Foreach.c:72:
}
bool success = (ZstrCompare(StrBegin(&result), "o4l3l2e1H0") == 0);
WriteFmt(" (Index 0 was processed)\n");
// The result should be "H0e1l2l3o4"
bool success = (ZstrCompare(StrBegin(&result), "H0e1l2l3o4") == 0);
// The original string should now be "HELLO" (all uppercase)
// The original string should now be "HELLO" (all uppercase)
success = success && (ZstrCompare(StrBegin(&s), "HELLO") == 0);
StrDeinit(&s);
bool success = false;
success = (ZstrCompare(StrBegin(&result), "o4l3l2e1H0") == 0);
success = success && (ZstrCompare(StrBegin(&s), "HELLO") == 0); // All uppercase
WriteFmt(" (Index 0 was processed)\n"); bool success = false;
success = (ZstrCompare(StrBegin(&result), "o4l3l2e1H0") == 0);
success = success && (ZstrCompare(StrBegin(&s), "HELLO") == 0); // All uppercase
WriteFmt(" (Index 0 was processed)\n");
// The result should be "Hello"
bool success = (ZstrCompare(StrBegin(&result), "Hello") == 0);
StrDeinit(&s); bool success = false;
if (char_count == StrLen(&s)) {
success = (ZstrCompare(StrBegin(&result), "olleH") == 0);
WriteFmt(" (All characters were processed)\n");
} else { WriteFmt(" (All characters were processed)\n");
} else {
success = (ZstrCompare(StrBegin(&result), "olle") == 0);
WriteFmt(" (First character was NOT processed - bug in macro)\n");
}
// The result should be "Hello" (original values before modification)
bool success = (ZstrCompare(StrBegin(&result), "Hello") == 0);
// The original string should now be "HELLO" (all uppercase)
// The original string should now be "HELLO" (all uppercase)
success = success && (ZstrCompare(StrBegin(&s), "HELLO") == 0);
StrDeinit(&s); bool success = false;
if (char_count == StrLen(&s)) {
success = (ZstrCompare(StrBegin(&result), "olleH") == 0);
success = success && (ZstrCompare(StrBegin(&s), "HELLO") == 0); // All uppercase
WriteFmt(" (All characters were processed)\n"); if (char_count == StrLen(&s)) {
success = (ZstrCompare(StrBegin(&result), "olleH") == 0);
success = success && (ZstrCompare(StrBegin(&s), "HELLO") == 0); // All uppercase
WriteFmt(" (All characters were processed)\n");
} else { WriteFmt(" (All characters were processed)\n");
} else {
success = (ZstrCompare(StrBegin(&result), "olle") == 0);
success = success && (ZstrCompare(StrBegin(&s), "HELLo") == 0); // All uppercase except first char
WriteFmt(" (First character was NOT processed - bug in macro)\n"); } else {
success = (ZstrCompare(StrBegin(&result), "olle") == 0);
success = success && (ZstrCompare(StrBegin(&s), "HELLo") == 0); // All uppercase except first char
WriteFmt(" (First character was NOT processed - bug in macro)\n");
}
// The result should be "W6o7r8l9d10" (characters from index 6-10 with their indices)
bool success = (ZstrCompare(StrBegin(&result), "W6o7r8l9d10") == 0);
// Test with empty range
// The result should be "Hello" (first 5 characters)
bool success = (ZstrCompare(StrBegin(&result), "Hello") == 0);
// Test with range at the end of the string
// The end_result should be "World" (last 5 characters)
success = success && (ZstrCompare(StrBegin(&end_result), "World") == 0);
StrDeinit(&s);
// The result should be "W6o7r8l9d10" (characters from index 6-10 with their indices)
bool success = (ZstrCompare(StrBegin(&result), "W6o7r8l9d10") == 0);
// The original string should now have "WORLD" in uppercase
// The original string should now have "WORLD" in uppercase
success = success && (ZstrCompare(StrBegin(&s), "Hello WORLD") == 0);
StrDeinit(&s);
// The result should be "Hello" (first 5 characters)
bool success = (ZstrCompare(StrBegin(&result), "Hello") == 0);
// The original string should now have "HELLO" in uppercase
// The original string should now have "HELLO" in uppercase
success = success && (ZstrCompare(StrBegin(&s), "HELLO World") == 0);
StrDeinit(&s);- In
ArgParse.c:256:
ArgRun rc = ArgParseRun(&p, 3, argv);
bool ok = (rc == ARG_RUN_OK) && StrLen(&name) == 5 && StrBegin(&name)[0] == 'a' && StrBegin(&name)[4] == 'e';
ArgParseDeinit(&p);
StrDeinit(&name);- In
Log.h:45:
Str UNPL(m) = StrInit(&UNPL(log_alloc)); \
StrAppendFmt(&UNPL(m), __VA_ARGS__); \
LogWrite(LOG_MESSAGE_TYPE_FATAL, __func__, __LINE__, StrBegin(&UNPL(m))); \
StrDeinit(&UNPL(m)); \
HeapAllocatorDeinit(&UNPL(log_alloc)); \
- In
Log.h:69:
Str UNPL(m) = StrInit(&UNPL(log_alloc)); \
StrAppendFmt(&UNPL(m), __VA_ARGS__); \
LogWrite(LOG_MESSAGE_TYPE_ERROR, __func__, __LINE__, StrBegin(&UNPL(m))); \
StrDeinit(&UNPL(m)); \
HeapAllocatorDeinit(&UNPL(log_alloc)); \
- In
Log.h:92:
Str UNPL(m) = StrInit(&UNPL(log_alloc)); \
StrAppendFmt(&UNPL(m), __VA_ARGS__); \
LogWrite(LOG_MESSAGE_TYPE_INFO, __func__, __LINE__, StrBegin(&UNPL(m))); \
StrDeinit(&UNPL(m)); \
HeapAllocatorDeinit(&UNPL(log_alloc)); \
- In
Log.h:131:
StrAppendFmt(&UNPL(m), " : {}", UNPL(syserr)); \
} \
LogWrite(LOG_MESSAGE_TYPE_FATAL, __func__, __LINE__, StrBegin(&UNPL(m))); \
StrDeinit(&UNPL(m)); \
HeapAllocatorDeinit(&UNPL(log_alloc)); \
- In
Log.h:160:
StrAppendFmt(&UNPL(m), " : {}", UNPL(syserr)); \
} \
LogWrite(LOG_MESSAGE_TYPE_ERROR, __func__, __LINE__, StrBegin(&UNPL(m))); \
StrDeinit(&UNPL(m)); \
HeapAllocatorDeinit(&UNPL(log_alloc)); \
- In
Log.h:188:
StrAppendFmt(&UNPL(m), " : {}", UNPL(syserr)); \
} \
LogWrite(LOG_MESSAGE_TYPE_INFO, __func__, __LINE__, StrBegin(&UNPL(m))); \
StrDeinit(&UNPL(m)); \
HeapAllocatorDeinit(&UNPL(log_alloc)); \
- In
File.h:83:
_Generic( \
(path), \
Str *: file_open((Zstr)StrBegin((Str *)(path)), (mode)), \
Zstr: file_open((Zstr)(path), (mode)), \
char *: file_open((Zstr)(path), (mode)) \
- In
File.h:208:
Buf *: _Generic( \
(path), \
Str *: file_read_and_close_to_buf((Zstr)StrBegin((Str *)(path)), (Buf *)(out)), \
Zstr: file_read_and_close_to_buf((Zstr)(path), (Buf *)(out)), \
char *: file_read_and_close_to_buf((Zstr)(path), (Buf *)(out)) \
- In
File.h:214:
Str *: _Generic( \
(path), \
Str *: file_read_and_close_to_str((Zstr)StrBegin((Str *)(path)), (Str *)(out)), \
Zstr: file_read_and_close_to_str((Zstr)(path), (Str *)(out)), \
char *: file_read_and_close_to_str((Zstr)(path), (Str *)(out)) \
- In
File.h:259:
Buf *: _Generic( \
(path), \
Str *: file_write_and_close_from_buf((Zstr)StrBegin((Str *)(path)), (const Buf *)(container)), \
Zstr: file_write_and_close_from_buf((Zstr)(path), (const Buf *)(container)), \
char *: file_write_and_close_from_buf((Zstr)(path), (const Buf *)(container)) \
- In
File.h:265:
Str *: _Generic( \
(path), \
Str *: file_write_and_close_from_str((Zstr)StrBegin((Str *)(path)), (const Str *)(container)), \
Zstr: file_write_and_close_from_str((Zstr)(path), (const Str *)(container)), \
char *: file_write_and_close_from_str((Zstr)(path), (const Str *)(container)) \
- In
File.h:273:
_Generic( \
(path), \
Str *: file_write_and_close_from_bytes((Zstr)StrBegin((Str *)(path)), (buf), (n)), \
Zstr: file_write_and_close_from_bytes((Zstr)(path), (buf), (n)), \
char *: file_write_and_close_from_bytes((Zstr)(path), (buf), (n)) \
- In
Init.h:145:
///
#define StrInitFromStr(...) OVERLOAD(StrInitFromStr, __VA_ARGS__)
#define StrInitFromStr_1(str) StrInitFromCstr_2(StrBegin(str), StrLen(str))
#define StrInitFromStr_2(str, a) StrInitFromCstr_3(StrBegin(str), StrLen(str), (a))- In
Init.h:146:
#define StrInitFromStr(...) OVERLOAD(StrInitFromStr, __VA_ARGS__)
#define StrInitFromStr_1(str) StrInitFromCstr_2(StrBegin(str), StrLen(str))
#define StrInitFromStr_2(str, a) StrInitFromCstr_3(StrBegin(str), StrLen(str), (a))
///
- In
Proc.h:288:
Str UNPL(buf) = StrInit(); \
ProcReadFromStdout((p), &UNPL(buf)); \
Zstr UNPL(in) = StrBegin(&UNPL(buf)); \
StrReadFmt(UNPL(in), __VA_ARGS__); \
StrDeinit(&UNPL(buf)); \
- In
Proc.h:315:
Str UNPL(buf) = StrInit(); \
ProcReadFromStderr((p), &UNPL(buf)); \
Zstr UNPL(in) = StrBegin(&UNPL(buf)); \
StrReadFmt(UNPL(in), __VA_ARGS__); \
StrDeinit(&UNPL(buf)); \
- In
Dir.h:119:
_Generic( \
(path), \
Str *: dir_get_contents((Zstr)StrBegin((Str *)(path)), MisraScope), \
Zstr: dir_get_contents((Zstr)(path), MisraScope), \
char *: dir_get_contents((Zstr)(path), MisraScope) \
- In
Dir.h:126:
_Generic( \
(path), \
Str *: dir_get_contents((Zstr)StrBegin((Str *)(path)), ALLOCATOR_OF(alloc)), \
Zstr: dir_get_contents((Zstr)(path), ALLOCATOR_OF(alloc)), \
char *: dir_get_contents((Zstr)(path), ALLOCATOR_OF(alloc)) \
- In
Dir.h:145:
_Generic( \
(path), \
Str *: file_get_size((Zstr)StrBegin((Str *)(path))), \
Zstr: file_get_size((Zstr)(path)), \
char *: file_get_size((Zstr)(path)) \
- In
Dir.h:173:
_Generic( \
(path), \
Str *: file_remove((Zstr)StrBegin((Str *)(path))), \
Zstr: file_remove((Zstr)(path)), \
char *: file_remove((Zstr)(path)) \
- In
Dir.h:196:
_Generic( \
(path), \
Str *: dir_remove((Zstr)StrBegin((Str *)(path))), \
Zstr: dir_remove((Zstr)(path)), \
char *: dir_remove((Zstr)(path)) \
- In
Dir.h:219:
_Generic( \
(path), \
Str *: dir_create((Zstr)StrBegin((Str *)(path))), \
Zstr: dir_create((Zstr)(path)), \
char *: dir_create((Zstr)(path)) \
- In
Dir.h:241:
_Generic( \
(path), \
Str *: dir_create_all((Zstr)StrBegin((Str *)(path))), \
Zstr: dir_create_all((Zstr)(path)), \
char *: dir_create_all((Zstr)(path)) \
- In
Dir.h:262:
_Generic( \
(path), \
Str *: dir_remove_all((Zstr)StrBegin((Str *)(path))), \
Zstr: dir_remove_all((Zstr)(path)), \
char *: dir_remove_all((Zstr)(path)) \
- In
Pe.h:139:
_Generic( \
(path), \
Str *: pe_open((out), (Zstr)StrBegin((Str *)(path)), MisraScope), \
Zstr: pe_open((out), (Zstr)(path), MisraScope), \
char *: pe_open((out), (Zstr)(path), MisraScope) \
- In
Pe.h:146:
_Generic( \
(path), \
Str *: pe_open((out), (Zstr)StrBegin((Str *)(path)), ALLOCATOR_OF(alloc)), \
Zstr: pe_open((out), (Zstr)(path), ALLOCATOR_OF(alloc)), \
char *: pe_open((out), (Zstr)(path), ALLOCATOR_OF(alloc)) \
- In
Pdb.h:134:
_Generic( \
(path), \
Str *: pdb_open((out), (Zstr)StrBegin((Str *)(path)), MisraScope), \
Zstr: pdb_open((out), (Zstr)(path), MisraScope), \
char *: pdb_open((out), (Zstr)(path), MisraScope) \
- In
Pdb.h:141:
_Generic( \
(path), \
Str *: pdb_open((out), (Zstr)StrBegin((Str *)(path)), ALLOCATOR_OF(alloc)), \
Zstr: pdb_open((out), (Zstr)(path), ALLOCATOR_OF(alloc)), \
char *: pdb_open((out), (Zstr)(path), ALLOCATOR_OF(alloc)) \
- In
Elf.h:218:
_Generic( \
(path), \
Str *: elf_open((out), (Zstr)StrBegin((Str *)(path)), MisraScope), \
Zstr: elf_open((out), (Zstr)(path), MisraScope), \
char *: elf_open((out), (Zstr)(path), MisraScope) \
- In
Elf.h:225:
_Generic( \
(path), \
Str *: elf_open((out), (Zstr)StrBegin((Str *)(path)), ALLOCATOR_OF(alloc)), \
Zstr: elf_open((out), (Zstr)(path), ALLOCATOR_OF(alloc)), \
char *: elf_open((out), (Zstr)(path), ALLOCATOR_OF(alloc)) \
- In
MachO.h:160:
_Generic( \
(path), \
Str *: macho_open((out), (Zstr)StrBegin((Str *)(path)), MisraScope), \
Zstr: macho_open((out), (Zstr)(path), MisraScope), \
char *: macho_open((out), (Zstr)(path), MisraScope) \
- In
MachO.h:167:
_Generic( \
(path), \
Str *: macho_open((out), (Zstr)StrBegin((Str *)(path)), ALLOCATOR_OF(alloc)), \
Zstr: macho_open((out), (Zstr)(path), ALLOCATOR_OF(alloc)), \
char *: macho_open((out), (Zstr)(path), ALLOCATOR_OF(alloc)) \
- In
MachO.h:238:
macho_find_section( \
(self), \
_Generic((segment), Str *: (Zstr)StrBegin((Str *)(segment)), Zstr: (Zstr)(segment), char *: (Zstr)(segment)), \
_Generic((section), Str *: (Zstr)StrBegin((Str *)(section)), Zstr: (Zstr)(section), char *: (Zstr)(section)) \
)- In
MachO.h:239:
(self), \
_Generic((segment), Str *: (Zstr)StrBegin((Str *)(segment)), Zstr: (Zstr)(segment), char *: (Zstr)(segment)), \
_Generic((section), Str *: (Zstr)StrBegin((Str *)(section)), Zstr: (Zstr)(section), char *: (Zstr)(section)) \
)- In
JSON.h:925:
const Str *UNPL(jw_s) = &(s); \
u64 UNPL(jw_len) = StrLen(UNPL(jw_s)); \
StrAppendFmt(&(j), "\"{}\"", UNPL(jw_len) ? (Zstr)StrBegin(UNPL(jw_s)) : (Zstr) ""); \
} while (0)
Last updated on