StrDeinit
Description
Release the backing storage of str through its inline allocator and zero the handle so a later double-Deinit is a no-op.
Success
Returns to the caller. *str is zeroed.
Failure
Function cannot fail. NULL str is a no-op.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Sys.c:246:
Str out = StrInit(alloc);
StrAppendFmt(&out, "{} (errno {})", errno_description(eno), eno);
StrDeinit(err_str);
*err_str = out;
return err_str;- In
Log.c:72:
FormatStackTrace(&trace, frames, n, ALLOCATOR_OF(&h));
(void)FileWrite(&out, StrBegin(&trace), StrLen(&trace));
StrDeinit(&trace);
}
#else- In
Log.c:87:
#endif
StrDeinit(&full);
HeapAllocatorDeinit(&h);
}- In
Io.c:514:
}
}
StrDeinit(&tmp);
DefaultAllocatorDeinit(&scratch);
return ok;- In
Io.c:553:
}
StrDeinit(&out);
DefaultAllocatorDeinit(&scratch);
return ok;- In
Io.c:1087:
}
}
StrDeinit(&tmp);
DefaultAllocatorDeinit(&scratch);
return ok;- In
Io.c:1124:
if (end_pos < 0) {
LOG_ERROR("FileSeek(END) failed during f_read_fmt");
StrDeinit(&buffer);
DefaultAllocatorDeinit(&scratch);
return;- In
Io.c:1136:
if (got < 0) {
LOG_ERROR("FileRead failed during f_read_fmt");
StrDeinit(&buffer);
DefaultAllocatorDeinit(&scratch);
return;- In
Io.c:1156:
}
StrDeinit(&buffer);
DefaultAllocatorDeinit(&scratch);
}- In
Io.c:1379:
}
StrDeinit(&canonical);
*out = result;
return true;- In
Io.c:1404:
}
StrDeinit(&canonical);
*out = result;
return true;- In
Io.c:1410:
fail:
StrDeinit(&canonical);
StrDeinit(&result);
return false;- In
Io.c:1411:
fail:
StrDeinit(&canonical);
StrDeinit(&result);
return false;
}- In
Io.c:1462:
goto fail;
}
StrDeinit(&digits);
*out = result;
return true;- In
Io.c:1499:
goto fail;
}
StrDeinit(&digits);
*out = result;
return true;- In
Io.c:1504:
fail:
StrDeinit(&digits);
StrDeinit(&result);
return false;- In
Io.c:1505:
fail:
StrDeinit(&digits);
StrDeinit(&result);
return false;
}- In
Io.c:1644:
Str hex = StrInit(StrAllocator(o));
if (!StrFromU64(&hex, c, &config)) {
StrDeinit(&hex);
return false;
}- In
Io.c:1649:
if (StrLen(&hex) == 1) {
if (!StrPushFrontR(&hex, '0')) {
StrDeinit(&hex);
return false;
}- In
Io.c:1654:
}
if (!StrPushBackMany(o, "0x") || !StrMerge(o, &hex)) {
StrDeinit(&hex);
return false;
}- In
Io.c:1657:
return false;
}
StrDeinit(&hex);
}
} else {- In
Io.c:1732:
StrIntFormat config = {.base = 16, .uppercase = (fmt_info->flags & FMT_FLAG_CAPS) != 0};
if (!StrFromU64(&hex, (u8)xs[i], &config)) {
StrDeinit(&hex);
return false;
}- In
Io.c:1737:
if (StrLen(&hex) == 1) {
if (!StrPushFrontR(&hex, '0')) {
StrDeinit(&hex);
return false;
}- In
Io.c:1742:
}
if (!StrPushBackMany(o, "0x") || !StrMerge(o, &hex)) {
StrDeinit(&hex);
return false;
}- In
Io.c:1745:
return false;
}
StrDeinit(&hex);
i++;
}- In
Io.c:1838:
StrIntFormat config = {.base = base, .uppercase = (fmt_info->flags & FMT_FLAG_CAPS) != 0, .use_prefix = use_prefix};
if (!StrFromU64(&temp, *v, &config)) {
StrDeinit(&temp);
return false;
}- In
Io.c:1843:
if (!StrMerge(o, &temp)) {
StrDeinit(&temp);
return false;
}- In
Io.c:1846:
return false;
}
StrDeinit(&temp);
if (fmt_info->width > 0) {- In
Io.c:1938:
StrIntFormat config = {.base = base, .uppercase = (fmt_info->flags & FMT_FLAG_CAPS) != 0, .use_prefix = use_prefix};
if (!StrFromI64(&temp, *v, &config)) {
StrDeinit(&temp);
return false;
}- In
Io.c:1943:
if (!StrMerge(o, &temp)) {
StrDeinit(&temp);
return false;
}- In
Io.c:1946:
return false;
}
StrDeinit(&temp);
if (fmt_info->width > 0) {- In
Io.c:2065:
};
if (!StrFromF64(&temp, *v, &config)) {
StrDeinit(&temp);
return false;
}- In
Io.c:2070:
if (!StrMerge(o, &temp)) {
StrDeinit(&temp);
return false;
}- In
Io.c:2073:
return false;
}
StrDeinit(&temp);
}- In
Io.c:2146:
if (!StrMerge(o, &temp)) {
StrDeinit(&temp);
return false;
}- In
Io.c:2149:
return false;
}
StrDeinit(&temp);
if (fmt_info->width > 0) {- In
Io.c:2263:
char c = ZstrProcessEscape(&curr);
if (c == 0) {
StrDeinit(s);
return NULL;
}- In
Io.c:2302:
char c = ZstrProcessEscape(&curr);
if (c == 0) {
StrDeinit(s);
return NULL;
}- In
Io.c:2329:
if (quote) {
LOG_ERROR("Unterminated quoted string");
StrDeinit(s);
return NULL;
}- In
Io.c:2552:
// the digit-by-digit scan below.
if (StrToF64(&temp, v, NULL)) {
StrDeinit(&temp);
DefaultAllocatorDeinit(&scratch);
return StrIterDataAt(&si, StrIterIndex(&si));- In
Io.c:2556:
return StrIterDataAt(&si, StrIterIndex(&si));
}
StrDeinit(&temp);
si = saved;- In
Io.c:2609:
if (!is_valid_numeric_string(&temp, true)) {
LOG_ERROR("Invalid floating point format");
StrDeinit(&temp);
DefaultAllocatorDeinit(&scratch);
return start;- In
Io.c:2616:
if (!StrToF64(&temp, v, NULL)) {
LOG_ERROR("Failed to parse f64");
StrDeinit(&temp);
DefaultAllocatorDeinit(&scratch);
return start;- In
Io.c:2621:
}
StrDeinit(&temp);
DefaultAllocatorDeinit(&scratch);
return start + pos;- In
Io.c:2675:
StrBegin(&temp)[1] == 'B' || StrBegin(&temp)[1] == 'o' || StrBegin(&temp)[1] == 'O')) {
LOG_ERROR("Incomplete number format");
StrDeinit(&temp);
DefaultAllocatorDeinit(&scratch);
return start;- In
Io.c:2682:
if (!is_valid_numeric_string(&temp, false)) {
LOG_ERROR("Invalid numeric format");
StrDeinit(&temp);
DefaultAllocatorDeinit(&scratch);
return start;- In
Io.c:2693:
if (!StrToU64(&temp, &val, NULL)) {
LOG_ERROR("Failed to parse u8");
StrDeinit(&temp);
DefaultAllocatorDeinit(&scratch);
return start;- In
Io.c:2700:
if (val > UINT8_MAX) {
LOG_ERROR("Value {} exceeds u8 maximum ({})", val, UINT8_MAX);
StrDeinit(&temp);
DefaultAllocatorDeinit(&scratch);
return start;- In
Io.c:2706:
*v = (u8)val;
StrDeinit(&temp);
DefaultAllocatorDeinit(&scratch);
return start + pos;- In
Io.c:2782:
StrBegin(&temp)[1] == 'B' || StrBegin(&temp)[1] == 'o' || StrBegin(&temp)[1] == 'O')) { \
LOG_ERROR("Incomplete number format"); \
StrDeinit(&temp); \
DefaultAllocatorDeinit(&scratch); \
return start; \
- In
Io.c:2789:
if (!is_valid_numeric_string(&temp, false)) { \
LOG_ERROR("Invalid numeric format"); \
StrDeinit(&temp); \
DefaultAllocatorDeinit(&scratch); \
return start; \
- In
Io.c:2797:
if (!PARSER(&temp, &val, NULL)) { \
LOG_ERROR("Failed to parse " #NAME); \
StrDeinit(&temp); \
DefaultAllocatorDeinit(&scratch); \
return start; \
- In
Io.c:2805:
\
*v = (T)val; \
StrDeinit(&temp); \
DefaultAllocatorDeinit(&scratch); \
return start + pos; \
- In
Io.c:2814:
if (val > UMAX) { \
LOG_ERROR("Value {} exceeds " #NAME " maximum ({})", val, UMAX); \
StrDeinit(&temp); \
DefaultAllocatorDeinit(&scratch); \
return start; \
- In
Io.c:2823:
if (val > IMAX || val < IMIN) { \
LOG_ERROR("Value {} outside " #NAME " range ({} to {})", val, IMIN, IMAX); \
StrDeinit(&temp); \
DefaultAllocatorDeinit(&scratch); \
return start; \
- In
Io.c:2880:
next = _read_Str(i, &default_fmt, &temp);
if (next == i) {
StrDeinit(&temp);
return i;
}- In
Io.c:2890:
if (!result) {
LOG_ERROR("Failed to allocate memory for string");
StrDeinit(&temp);
return i;
}- In
Io.c:2899:
*out = result;
StrDeinit(&temp);
return next;
}- In
Io.c:2959:
}
if (!StrMerge(o, &bit_str)) {
StrDeinit(&bit_str);
return false;
}- In
Io.c:2962:
return false;
}
StrDeinit(&bit_str);
}
}- In
Io.c:3025:
if (!StrMerge(o, &temp)) {
StrDeinit(&temp);
return false;
}- In
Io.c:3028:
return false;
}
StrDeinit(&temp);
if (fmt_info->width > 0) {- In
Io.c:3095:
if (!StrToU64(&hex_str, &value, &config)) {
LOG_ERROR("Failed to parse hex value");
StrDeinit(&hex_str);
return start;
}- In
Io.c:3107:
*bv = BitVecFromInteger(value, bit_len, BitVecAllocator(bv));
StrDeinit(&hex_str);
return StrIterDataAt(&si, StrIterIndex(&si));
}- In
Io.c:3136:
if (!StrToU64(&oct_str, &value, &config)) {
LOG_ERROR("Failed to parse octal value");
StrDeinit(&oct_str);
return start;
}- In
Io.c:3145:
*bv = BitVecFromInteger(value, bit_len, BitVecAllocator(bv));
StrDeinit(&oct_str);
return StrIterDataAt(&si, StrIterIndex(&si));
}- In
Io.c:3169:
*bv = BitVecFromStr(StrBegin(&bin_str), BitVecAllocator(bv));
StrDeinit(&bin_str);
return StrIterDataAt(&si, StrIterIndex(&si));
}- In
Io.c:3249:
if (!ok) {
StrDeinit(&temp);
return start;
}- In
Io.c:3256:
*value = parsed;
StrDeinit(&temp);
return StrIterDataAt(&si, StrIterIndex(&si));
}- In
Io.c:3277:
if (float_fmt_uses_unsupported_flags(fmt_info)) {
LOG_ERROR("Float only supports decimal and scientific reading");
StrDeinit(&temp);
FloatDeinit(&parsed);
return i;- In
Io.c:3293:
if (!StrIterRemainingLength(&si)) {
LOG_ERROR("Failed to parse Float: empty input");
StrDeinit(&temp);
FloatDeinit(&parsed);
return StrIterDataAt(&si, StrIterIndex(&si));- In
Io.c:3303:
if (token_len == 0) {
LOG_ERROR("Failed to parse Float");
StrDeinit(&temp);
FloatDeinit(&parsed);
return start;- In
Io.c:3308:
}
StrDeinit(&temp);
temp = StrInitFromCstr(start, token_len, FloatAllocator(value));
if (!FloatTryFromStr(&parsed, StrBegin(&temp))) {- In
Io.c:3311:
temp = StrInitFromCstr(start, token_len, FloatAllocator(value));
if (!FloatTryFromStr(&parsed, StrBegin(&temp))) {
StrDeinit(&temp);
FloatDeinit(&parsed);
return start;- In
Io.c:3319:
*value = parsed;
StrDeinit(&temp);
return start + token_len;
}- In
Io.c:3373:
if (StrToF64(&temp, &val, NULL)) {
*v = (f32)val;
StrDeinit(&temp);
DefaultAllocatorDeinit(&scratch);
return StrIterDataAt(&si, StrIterIndex(&si));- In
Io.c:3377:
return StrIterDataAt(&si, StrIterIndex(&si));
}
StrDeinit(&temp);
si = saved;- In
Io.c:3427:
if (!is_valid_numeric_string(&temp, true)) {
LOG_ERROR("Invalid floating point format");
StrDeinit(&temp);
DefaultAllocatorDeinit(&scratch);
return start;- In
Io.c:3437:
if (!StrToF64(&temp, &val, NULL)) {
LOG_ERROR("Failed to parse f32");
StrDeinit(&temp);
DefaultAllocatorDeinit(&scratch);
return start;- In
Io.c:3443:
*v = (f32)val;
StrDeinit(&temp);
DefaultAllocatorDeinit(&scratch);
return start + pos;- In
ArgParse.c:361:
FWriteFmtLn(&err, "{}", usage);
StrDeinit(&usage);
FWriteFmtLn(&err, "");- In
ArgParse.c:414:
for (u64 i = 0; i < n_specs; ++i) {
StrDeinit(&left_col[i]);
}
}- In
Debug.c:299:
#endif
LOG_ERROR(" {} trace:\n{}", label, rendered);
StrDeinit(&rendered);
}- In
BitVec.c:850:
char bit_char = BitVecGet(bv, i) ? '1' : '0';
if (!StrPushBackR(out, bit_char)) {
StrDeinit(out);
*out = StrInit(alloc);
return false;- In
BitVec.c:1866:
}
StrDeinit(&bv_str);
return result;
}- In
BitVec.c:1883:
}
StrDeinit(&bv_str);
return result;
}- In
Float.c:568:
result.exponent = explicit_exp - fractional;
StrDeinit(&digits);
float_normalize(&result);
FloatDeinit(out);- In
Float.c:575:
fail:
StrDeinit(&digits);
FloatDeinit(&result);
return false;- In
Float.c:681:
}
StrDeinit(&digits);
*out = result;
return true;- In
Float.c:686:
fail:
StrDeinit(&digits);
StrDeinit(&result);
return false;- In
Float.c:687:
fail:
StrDeinit(&digits);
StrDeinit(&result);
return false;
}- In
Str.c:154:
}
void StrDeinit(Str *copy) {
ValidateStr(copy);
deinit_vec(GENERIC_VEC(copy), sizeof(char));- In
Str.c:161:
void str_deinit(void *copy, const Allocator *alloc) {
(void)alloc;
StrDeinit((Str *)copy);
}- In
Int.c:756:
IntDeinit("ient);
IntDeinit(¤t);
StrDeinit(&result);
return false;
}- In
PdbCache.c:71:
Str pdb_path = StrInit(alloc);
if (!find_pdb(&entry->pe, StrBegin(&entry->module_path), &pdb_path)) {
StrDeinit(&pdb_path);
return false;
}- In
PdbCache.c:75:
}
bool ok = PdbOpen(&entry->pdb, &pdb_path, alloc);
StrDeinit(&pdb_path);
if (!ok)
return false;- In
PdbCache.c:108:
if (!VecPushBackR(&self->entries, entry)) {
StrDeinit(&entry.module_path);
return NULL;
}- In
PdbCache.c:127:
if (e->pe_open)
PeDeinit(&e->pe);
StrDeinit(&e->module_path);
}
VecDeinit(&self->entries); if (sys_path_exists(StrBegin(&path)) && ElfOpen(out, &path, alloc)) {
if (sidecar_matches(main, out, /*by_build_id*/ true)) {
StrDeinit(&path);
return true;
} if (sys_path_exists(StrBegin(&path)) && ElfOpen(out, &path, alloc)) {
if (sidecar_matches(main, out, /*by_build_id*/ false)) {
StrDeinit(&path);
return true;
} if (sys_path_exists(StrBegin(&path)) && ElfOpen(out, &path, alloc)) {
if (sidecar_matches(main, out, /*by_build_id*/ false)) {
StrDeinit(&path);
return true;
} if (sys_path_exists(StrBegin(&path)) && ElfOpen(out, &path, alloc)) {
if (sidecar_matches(main, out, /*by_build_id*/ false)) {
StrDeinit(&path);
return true;
} }
StrDeinit(&path);
return false;
}- In
Proc.c:233:
if (!CreateProcessA(NULL, StrBegin(&cmdline), NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi)) {
LOG_ERROR("CreateProcessA() failed (GetLastError={})", (i32)GetLastError());
StrDeinit(&cmdline);
CloseHandle(hStdinRead);
CloseHandle(hStdinWrite);- In
Proc.c:242:
return proc;
}
StrDeinit(&cmdline);
CloseHandle(hStdinRead);- In
ProcMaps.c:243:
if (!self)
return;
StrDeinit(&self->raw);
VecDeinit(&self->entries);
MemSet(self, 0, sizeof(*self));- In
Dir.c:57:
}
StrDeinit(©->name);
copy->type = 0;- In
MachoCache.c:54:
if (!VecPushBackR(&self->entries, entry)) {
StrDeinit(&entry.module_path);
return NULL;
}- In
MachoCache.c:85:
Str path = StrInit(alloc);
if (!compose_dsym_path(StrBegin(&e->module_path), &path)) {
StrDeinit(&path);
return false;
}- In
MachoCache.c:89:
}
if (!sys_path_exists(StrBegin(&path)) || !MachoOpen(&e->dsym, &path, alloc)) {
StrDeinit(&path);
return false;
}- In
MachoCache.c:92:
return false;
}
StrDeinit(&path);
if (!MachoHasUuid(&e->dsym) || MemCompare(MachoUuid(&e->dsym), MachoUuid(&e->main), 16) != 0) {- In
MachoCache.c:141:
if (e->main_open)
MachoDeinit(&e->main);
StrDeinit(&e->module_path);
}
VecDeinit(&self->entries);- In
Dns.c:157:
Str buf = StrInit(alloc);
if (!slurp_file(HOSTS_FILE_PATH, &buf)) {
StrDeinit(&buf);
return;
}- In
Dns.c:230:
// failure ownership of `e.name` stays with us. Release
// it to avoid leaking the cstr allocation.
StrDeinit(&e.name);
break;
}- In
Dns.c:239:
}
StrDeinit(&buf);
}- In
Dns.c:252:
Str buf = StrInit(alloc);
if (!slurp_file(RESOLV_CONF_FILE_PATH, &buf)) {
StrDeinit(&buf);
return;
}- In
Dns.c:303:
}
StrDeinit(&buf);
}- In
Dns.c:338:
if (VecBegin(&self->hosts)) {
VecForeachPtr(&self->hosts, e) {
StrDeinit(&e->name);
}
VecDeinit(&self->hosts);- In
Http.c:23:
LOG_FATAL("invalid arguments");
}
StrDeinit(&header->key);
StrDeinit(&header->value);
MemSet(header, 0, sizeof(*header));- In
Http.c:24:
}
StrDeinit(&header->key);
StrDeinit(&header->value);
MemSet(header, 0, sizeof(*header));
}- In
Http.c:31:
(void)alloc; // each Str carries its own allocator handle
HttpHeader *header = (HttpHeader *)header_ptr;
StrDeinit(&header->key);
StrDeinit(&header->value);
MemSet(header, 0, sizeof(*header));- In
Http.c:32:
HttpHeader *header = (HttpHeader *)header_ptr;
StrDeinit(&header->key);
StrDeinit(&header->value);
MemSet(header, 0, sizeof(*header));
}- In
Http.c:47:
if (!StrInitCopy(&dst->key, &src->key)) {
StrDeinit(&dst->key);
return false;
}- In
Http.c:51:
}
if (!StrInitCopy(&dst->value, &src->value)) {
StrDeinit(&dst->key);
StrDeinit(&dst->value);
return false;- In
Http.c:52:
if (!StrInitCopy(&dst->value, &src->value)) {
StrDeinit(&dst->key);
StrDeinit(&dst->value);
return false;
}- In
Http.c:121:
if (cursor == in) {
LOG_ERROR("http request parse failed: invalid request line");
StrDeinit(&method);
StrDeinit(&version);
return in;- In
Http.c:122:
LOG_ERROR("http request parse failed: invalid request line");
StrDeinit(&method);
StrDeinit(&version);
return in;
}- In
Http.c:128:
if (0 != ZstrCompareN(StrBegin(&version), "HTTP/1.1", 8)) {
LOG_ERROR("invalid/unsupported HTTP version");
StrDeinit(&method);
StrDeinit(&version);
return in;- In
Http.c:129:
LOG_ERROR("invalid/unsupported HTTP version");
StrDeinit(&method);
StrDeinit(&version);
return in;
}- In
Http.c:132:
return in;
}
StrDeinit(&version);
req->method = http_request_method_from_str(&method);- In
Http.c:135:
req->method = http_request_method_from_str(&method);
StrDeinit(&method);
if (req->method == HTTP_REQUEST_METHOD_UNKNOWN) {
LOG_ERROR("invalid http request method");- In
Http.c:191:
LOG_FATAL("invalid arguments");
}
StrDeinit(&req->url);
VecDeinit(&req->headers);
MemSet(req, 0, sizeof(*req));- In
Http.c:414:
response->status_code = status;
response->content_type = HTTP_CONTENT_TYPE_TEXT_HTML;
StrDeinit(&response->body);
response->body = StrDup(html, response->allocator);
return response;- In
Http.c:431:
response->status_code = status;
response->content_type = content_type;
StrDeinit(&response->body);
response->body = StrInit(response->allocator);
if (FileReadAndClose(filepath, &response->body) < 0) {- In
Http.c:490:
if (!StrPushBackMany(&out, StrBegin(&response->body), StrLen(&response->body))) {
LOG_ERROR("HttpResponseSerialize: failed to append body");
StrDeinit(&out);
return StrInit(alloc);
}- In
Http.c:501:
LOG_FATAL("invalid arguments");
}
StrDeinit(&response->body);
VecDeinit(&response->headers);
MemSet(response, 0, sizeof(*response));- In
KvConfig.c:215:
if (StrLen(value) > 0) {
Str stripped = StrStrip(value, NULL);
StrDeinit(value);
*value = stripped;
}- In
KvConfig.c:306:
if (!StrIterPeek(&si, &c)) {
StrDeinit(&key);
StrDeinit(&value);
break;- In
KvConfig.c:307:
if (!StrIterPeek(&si, &c)) {
StrDeinit(&key);
StrDeinit(&value);
break;
}- In
KvConfig.c:313:
if (kvconfig_is_comment_start(c)) {
si = KvConfigSkipLine(si);
StrDeinit(&key);
StrDeinit(&value);
continue;- In
KvConfig.c:314:
si = KvConfigSkipLine(si);
StrDeinit(&key);
StrDeinit(&value);
continue;
}- In
KvConfig.c:320:
read_si = KvConfigReadPair(si, &key, &value);
if (StrIterIndex(&read_si) == StrIterIndex(&si)) {
StrDeinit(&key);
StrDeinit(&value);
return saved_si;- In
KvConfig.c:321:
if (StrIterIndex(&read_si) == StrIterIndex(&si)) {
StrDeinit(&key);
StrDeinit(&value);
return saved_si;
}- In
KvConfig.c:326:
MapSetOnlyL(cfg, key, value);
StrDeinit(&key);
StrDeinit(&value);
si = read_si;- In
KvConfig.c:327:
MapSetOnlyL(cfg, key, value);
StrDeinit(&key);
StrDeinit(&value);
si = read_si;
}- In
KvConfig.c:351:
lookup = StrInitFromCstr(key, ZstrLen(key), MapAllocator(cfg));
value = kvconfig_get_ptr_str(cfg, &lookup);
StrDeinit(&lookup);
return value;
}- In
JSON.c:60:
if (StrIterIndex(&read_si) == StrIterIndex(&si)) {
LOG_ERROR("Failed to read string key in object. Invalid JSON");
StrDeinit(&key);
DefaultAllocatorDeinit(&scratch);
return saved_si;- In
JSON.c:69:
if (!StrIterPeek(&si, &c) || c != ':') {
LOG_ERROR("Expected ':' after key string. Failed to read JSON");
StrDeinit(&key);
DefaultAllocatorDeinit(&scratch);
return saved_si;- In
JSON.c:82:
if (StrIterIndex(&read_si) == StrIterIndex(&si)) {
LOG_ERROR("Failed to parse value. Invalid JSON.");
StrDeinit(&key);
DefaultAllocatorDeinit(&scratch);
return saved_si;- In
JSON.c:89:
LOG_INFO("User skipped reading of '{}' field in JSON object.", key);
StrDeinit(&key);
si = read_si;
si = JSkipWhitespace(si);- In
JSON.c:334:
if (has_exp) {
LOG_ERROR("Invalid number. Multiple exponent indicators.");
StrDeinit(&ns);
DefaultAllocatorDeinit(&scratch);
return saved_si;- In
JSON.c:347:
if (is_flt) {
LOG_ERROR("Invalid number. Multiple decimal indicators.");
StrDeinit(&ns);
DefaultAllocatorDeinit(&scratch);
return saved_si;- In
JSON.c:378:
"must appear after exponent 'E' or 'e' indicator."
);
StrDeinit(&ns);
DefaultAllocatorDeinit(&scratch);
return saved_si;- In
JSON.c:387:
"Expected only once after 'e' or 'E'."
);
StrDeinit(&ns);
DefaultAllocatorDeinit(&scratch);
return saved_si;- In
JSON.c:404:
if (!StrLen(&ns)) {
LOG_ERROR("Failed to parse number. '{.8}'", LVAL(StrIterDataAt(&saved_si, StrIterIndex(&saved_si))));
StrDeinit(&ns);
DefaultAllocatorDeinit(&scratch);
return saved_si;- In
JSON.c:418:
if (end == StrBegin(&ns)) {
LOG_ERROR("Failed to convert string to number.");
StrDeinit(&ns);
DefaultAllocatorDeinit(&scratch);
return saved_si;- In
JSON.c:439:
num->is_float = is_flt;
StrDeinit(&ns);
DefaultAllocatorDeinit(&scratch);
return si;- In
JSON.c:642:
Str s = StrInit(&scratch);
si = JReadString(si, &s);
StrDeinit(&s);
DefaultAllocatorDeinit(&scratch);- In
Dwarf.c:662:
return;
VecDeinit(&self->entries);
StrDeinit(&self->string_pool);
MemSet(self, 0, sizeof(*self));
}- In
DwarfInfo.c:684:
VecDeinit(&self->entries);
if (StrAllocator(&self->string_pool))
StrDeinit(&self->string_pool);
MemSet(self, 0, sizeof(*self));
}- In
Pdb.c:771:
AllocatorFree(alloc, self->stream_block_counts);
}
StrDeinit(&self->name_pool);
VecDeinit(&self->functions);
BufDeinit(&self->data);- In
Dns.c:299:
Str dummy = StrInit(alloc);
if (!decode_name(&it, &dummy)) {
StrDeinit(&dummy);
return false;
}- In
Dns.c:302:
return false;
}
StrDeinit(&dummy);
u16 qtype, qclass;
if (!BufReadFmt(&it, "{>2r}{>2r}", qtype, qclass)) {- In
Dns.c:324:
return;
}
StrDeinit(&self->name);
StrDeinit(&self->target);
VecDeinit(&self->rdata);- In
Dns.c:325:
}
StrDeinit(&self->name);
StrDeinit(&self->target);
VecDeinit(&self->rdata);
}- In
Resolve.c:54:
}
WriteFmtLn("{}", s);
StrDeinit(&s);
}- In
Beam.c:293:
}
HttpRequestDeinit(&req);
StrDeinit(&raw);
}
}- In
Beam.c:352:
LOG_ERROR("failed to dial upstream for client [{}]", peer_str);
SocketClose(client);
StrDeinit(&peer_str);
return;
}- In
Beam.c:362:
SocketClose(&upstream);
SocketClose(client);
StrDeinit(&peer_str);
return;
}- In
Beam.c:379:
SocketClose(&upstream);
SocketClose(client);
StrDeinit(&peer_str);
}- In
VecStr.c:460:
Str str = generate_str_from_input(data, offset, data_size, 16, alloc);
VecPushBack(&temp, str);
StrDeinit(&str);
} if (StrIterIndex(&UNPL(read_si)) == StrIterIndex(&si)) { \
LOG_ERROR("Failed to read string key in object. Invalid JSON"); \
StrDeinit(&key); \
UNPL(failed) = true; \
si = UNPL(saved_si); \
if (!StrIterPeek(&si, &UNPL(jr_c)) || UNPL(jr_c) != ':') { \
LOG_ERROR("Expected ':' after key string. Failed to read JSON"); \
StrDeinit(&key); \
UNPL(failed) = true; \
si = UNPL(saved_si); \
if (StrIterIndex(&UNPL(skip_si)) == StrIterIndex(&si)) { \
LOG_ERROR("Failed to parse value. Invalid JSON."); \
StrDeinit(&key); \
UNPL(failed) = true; \
si = UNPL(saved_si); \
si = UNPL(skip_si); \
} \
StrDeinit(&key); \
si = JSkipWhitespace(si); \
UNPL(expect_comma) = true; \
void EdgeCaseDataDeinit(EdgeCaseData *data) {
StrDeinit(&data->empty_string);
VecDeinit(&data->empty_array);
VecDeinit(&data->numbers); }
StrDeinit(&json1);
StrDeinit(&json2);
DefaultAllocatorDeinit(&alloc);
StrDeinit(&json1);
StrDeinit(&json2);
DefaultAllocatorDeinit(&alloc);
return success; StrIter si2 = StrIterFromStr(json2);
Vec(Str) data = VecInitWithDeepCopy(NULL, StrDeinit, &alloc);
JR_OBJ(si2, { }
StrDeinit(&json1);
StrDeinit(&json2);
VecDeinit(&items);
StrDeinit(&json1);
StrDeinit(&json2);
VecDeinit(&items);
VecDeinit(&data); }
StrDeinit(&json);
StrDeinit(&obj.name);
StrDeinit(&obj.description);
StrDeinit(&json);
StrDeinit(&obj.name);
StrDeinit(&obj.description);
DefaultAllocatorDeinit(&alloc); StrDeinit(&json);
StrDeinit(&obj.name);
StrDeinit(&obj.description);
DefaultAllocatorDeinit(&alloc);
return success; }
StrDeinit(&json);
DefaultAllocatorDeinit(&alloc);
return success; }
StrDeinit(&json);
DefaultAllocatorDeinit(&alloc);
return success; }
StrDeinit(&json);
DefaultAllocatorDeinit(&alloc);
return success; }
StrDeinit(&json);
StrDeinit(&obj.path);
StrDeinit(&obj.message);
StrDeinit(&json);
StrDeinit(&obj.path);
StrDeinit(&obj.message);
StrDeinit(&obj.data); StrDeinit(&json);
StrDeinit(&obj.path);
StrDeinit(&obj.message);
StrDeinit(&obj.data);
DefaultAllocatorDeinit(&alloc); StrDeinit(&obj.path);
StrDeinit(&obj.message);
StrDeinit(&obj.data);
DefaultAllocatorDeinit(&alloc);
return success; }
StrDeinit(&json);
StrDeinit(&obj.escaped);
StrDeinit(&obj.backslash);
StrDeinit(&json);
StrDeinit(&obj.escaped);
StrDeinit(&obj.backslash);
StrDeinit(&obj.newline); StrDeinit(&json);
StrDeinit(&obj.escaped);
StrDeinit(&obj.backslash);
StrDeinit(&obj.newline);
StrDeinit(&obj.tab); StrDeinit(&obj.escaped);
StrDeinit(&obj.backslash);
StrDeinit(&obj.newline);
StrDeinit(&obj.tab);
DefaultAllocatorDeinit(&alloc); StrDeinit(&obj.backslash);
StrDeinit(&obj.newline);
StrDeinit(&obj.tab);
DefaultAllocatorDeinit(&alloc);
return success; }
StrDeinit(&json);
StrDeinit(&obj.name);
DefaultAllocatorDeinit(&alloc);
StrDeinit(&json);
StrDeinit(&obj.name);
DefaultAllocatorDeinit(&alloc);
return success; }
StrDeinit(&json);
DefaultAllocatorDeinit(&alloc);
return success; }
StrDeinit(&json);
VecDeinit(&obj.filled_items);
DefaultAllocatorDeinit(&alloc); }
StrDeinit(&json);
DefaultAllocatorDeinit(&alloc);
return success; }
StrDeinit(&json);
DefaultAllocatorDeinit(&alloc);
return success; // Cleanup functions
void AnnSymbolDeinit(AnnSymbol *sym) {
StrDeinit(&sym->analysis_name);
StrDeinit(&sym->function_name);
StrDeinit(&sym->sha256); void AnnSymbolDeinit(AnnSymbol *sym) {
StrDeinit(&sym->analysis_name);
StrDeinit(&sym->function_name);
StrDeinit(&sym->sha256);
StrDeinit(&sym->function_mangled_name); StrDeinit(&sym->analysis_name);
StrDeinit(&sym->function_name);
StrDeinit(&sym->sha256);
StrDeinit(&sym->function_mangled_name);
} StrDeinit(&sym->function_name);
StrDeinit(&sym->sha256);
StrDeinit(&sym->function_mangled_name);
}
void FunctionInfoDeinit(FunctionInfo *info) {
StrDeinit(&info->name);
}
void SearchResultDeinit(SearchResult *result) {
StrDeinit(&result->binary_name);
StrDeinit(&result->sha256);
VecDeinit(&result->tags); void SearchResultDeinit(SearchResult *result) {
StrDeinit(&result->binary_name);
StrDeinit(&result->sha256);
VecDeinit(&result->tags);
StrDeinit(&result->created_at); StrDeinit(&result->sha256);
VecDeinit(&result->tags);
StrDeinit(&result->created_at);
StrDeinit(&result->model_name);
StrDeinit(&result->owned_by); VecDeinit(&result->tags);
StrDeinit(&result->created_at);
StrDeinit(&result->model_name);
StrDeinit(&result->owned_by);
} StrDeinit(&result->created_at);
StrDeinit(&result->model_name);
StrDeinit(&result->owned_by);
} }
StrDeinit(&expected_str);
StrDeinit(&output_clean);
StrDeinit(&expected_clean);
StrDeinit(&expected_str);
StrDeinit(&output_clean);
StrDeinit(&expected_clean);
return result; StrDeinit(&expected_str);
StrDeinit(&output_clean);
StrDeinit(&expected_clean);
return result;
} }
StrDeinit(&json);
StrDeinit(&data.user.profile.name);
StrDeinit(&data.status);
StrDeinit(&json);
StrDeinit(&data.user.profile.name);
StrDeinit(&data.status);
DefaultAllocatorDeinit(&alloc); StrDeinit(&json);
StrDeinit(&data.user.profile.name);
StrDeinit(&data.status);
DefaultAllocatorDeinit(&alloc);
return success; }
StrDeinit(&json);
StrDeinit(&data.company.departments.engineering.head);
StrDeinit(&data.company.name);
StrDeinit(&json);
StrDeinit(&data.company.departments.engineering.head);
StrDeinit(&data.company.name);
DefaultAllocatorDeinit(&alloc); StrDeinit(&json);
StrDeinit(&data.company.departments.engineering.head);
StrDeinit(&data.company.name);
DefaultAllocatorDeinit(&alloc);
return success; });
StrDeinit(&target_key);
}
}); });
StrDeinit(&source_key);
});
}); }
StrDeinit(&json);
StrDeinit(&response.message);
VecDeinit(&response.data);
StrDeinit(&json);
StrDeinit(&response.message);
VecDeinit(&response.data);
DefaultAllocatorDeinit(&alloc); }
StrDeinit(&json);
VecDeinit(&functions);
DefaultAllocatorDeinit(&alloc); result.analysis_id = 999;
result.sha256 = StrInitFromZstr("abc123", &alloc);
result.tags = VecInitWithDeepCopyT(result.tags, NULL, StrDeinit, &alloc);
// Create strings and push them properly
}
StrDeinit(&json);
SearchResultDeinit(&result);
DefaultAllocatorDeinit(&alloc); });
StrDeinit(&target_key);
}); });
StrDeinit(&source_key);
}
}); }
StrDeinit(&json);
VecDeinit(&symbols);
return success; }
StrDeinit(&json);
StrDeinit(&deep_message);
StrDeinit(&test_name);
StrDeinit(&json);
StrDeinit(&deep_message);
StrDeinit(&test_name);
DefaultAllocatorDeinit(&alloc); StrDeinit(&json);
StrDeinit(&deep_message);
StrDeinit(&test_name);
DefaultAllocatorDeinit(&alloc);
return success; VecPushBack(&numbers, num3);
Vec(Str) strings = VecInitWithDeepCopy(NULL, StrDeinit, &alloc);
// Create strings and push them properly
}
StrDeinit(&json);
VecDeinit(&numbers);
VecDeinit(&strings); // Cleanup functions
void PersonDeinit(Person *person) {
StrDeinit(&person->name);
}
void ConfigDeinit(Config *config) {
StrDeinit(&config->log_level);
}
void SimpleProductDeinit(SimpleProduct *product) {
StrDeinit(&product->name);
VecDeinit(&product->tags);
} }
StrDeinit(&expected_str);
StrDeinit(&output_clean);
StrDeinit(&expected_clean);
StrDeinit(&expected_str);
StrDeinit(&output_clean);
StrDeinit(&expected_clean);
return result; StrDeinit(&expected_str);
StrDeinit(&output_clean);
StrDeinit(&expected_clean);
return result;
} }
StrDeinit(&json);
StrDeinit(&name);
StrDeinit(&city);
StrDeinit(&json);
StrDeinit(&name);
StrDeinit(&city);
DefaultAllocatorDeinit(&alloc); StrDeinit(&json);
StrDeinit(&name);
StrDeinit(&city);
DefaultAllocatorDeinit(&alloc);
return success; }
StrDeinit(&json);
DefaultAllocatorDeinit(&alloc);
return success; }
StrDeinit(&json);
DefaultAllocatorDeinit(&alloc);
return success; }
StrDeinit(&json);
PersonDeinit(&person);
DefaultAllocatorDeinit(&alloc); }
StrDeinit(&json);
ConfigDeinit(&config);
DefaultAllocatorDeinit(&alloc); Str json = StrInit(&alloc);
Vec(Str) languages = VecInitWithDeepCopy(NULL, StrDeinit, &alloc);
// Create strings and push them properly
}
StrDeinit(&json);
VecDeinit(&languages);
DefaultAllocatorDeinit(&alloc); }
StrDeinit(&json);
StrDeinit(&data.user.name);
StrDeinit(&data.user.email);
StrDeinit(&json);
StrDeinit(&data.user.name);
StrDeinit(&data.user.email);
DefaultAllocatorDeinit(&alloc); StrDeinit(&json);
StrDeinit(&data.user.name);
StrDeinit(&data.user.email);
DefaultAllocatorDeinit(&alloc);
return success; product.name = StrInitFromZstr("Laptop", &alloc);
product.price = 999.99;
product.tags = VecInitWithDeepCopyT(product.tags, NULL, StrDeinit, &alloc);
// Create strings and push them properly
}
StrDeinit(&json);
SimpleProductDeinit(&product);
DefaultAllocatorDeinit(&alloc); }
StrDeinit(&expected_str);
StrDeinit(&output_clean);
StrDeinit(&expected_clean);
StrDeinit(&expected_str);
StrDeinit(&output_clean);
StrDeinit(&expected_clean);
return result; StrDeinit(&expected_str);
StrDeinit(&output_clean);
StrDeinit(&expected_clean);
return result;
} }
StrDeinit(&json);
DefaultAllocatorDeinit(&alloc);
return success;
Vec(i32) empty_numbers = VecInit(&alloc);
Vec(Str) empty_strings = VecInitWithDeepCopy(NULL, StrDeinit, &alloc);
JW_OBJ(json, { }
StrDeinit(&json);
VecDeinit(&empty_numbers);
VecDeinit(&empty_strings); }
StrDeinit(&json);
StrDeinit(&empty_name);
StrDeinit(&empty_desc);
StrDeinit(&json);
StrDeinit(&empty_name);
StrDeinit(&empty_desc);
DefaultAllocatorDeinit(&alloc); StrDeinit(&json);
StrDeinit(&empty_name);
StrDeinit(&empty_desc);
DefaultAllocatorDeinit(&alloc);
return success; }
StrDeinit(&json);
DefaultAllocatorDeinit(&alloc);
return success; WriteFmtLn("[DEBUG] Large numbers JSON: {}", json);
StrDeinit(&json);
DefaultAllocatorDeinit(&alloc);
return success; }
StrDeinit(&json);
DefaultAllocatorDeinit(&alloc);
return success; }
StrDeinit(&json);
StrDeinit(&path);
StrDeinit(&message);
StrDeinit(&json);
StrDeinit(&path);
StrDeinit(&message);
StrDeinit(&data); StrDeinit(&json);
StrDeinit(&path);
StrDeinit(&message);
StrDeinit(&data);
DefaultAllocatorDeinit(&alloc); StrDeinit(&path);
StrDeinit(&message);
StrDeinit(&data);
DefaultAllocatorDeinit(&alloc);
return success; }
StrDeinit(&json);
StrDeinit("es);
StrDeinit(&backslash);
StrDeinit(&json);
StrDeinit("es);
StrDeinit(&backslash);
StrDeinit(&newline); StrDeinit(&json);
StrDeinit("es);
StrDeinit(&backslash);
StrDeinit(&newline);
StrDeinit(&tab); StrDeinit("es);
StrDeinit(&backslash);
StrDeinit(&newline);
StrDeinit(&tab);
DefaultAllocatorDeinit(&alloc); StrDeinit(&backslash);
StrDeinit(&newline);
StrDeinit(&tab);
DefaultAllocatorDeinit(&alloc);
return success; }
StrDeinit(&json);
VecDeinit(&empty_list);
DefaultAllocatorDeinit(&alloc); }
StrDeinit(&json);
VecDeinit(&empty_arr);
VecDeinit(&filled_arr); }
StrDeinit(&json);
DefaultAllocatorDeinit(&alloc);
return success; }
StrDeinit(&json);
DefaultAllocatorDeinit(&alloc);
return success; success = false;
StrDeinit(&json1);
StrDeinit(&json2);
StrDeinit(&json3);
StrDeinit(&json1);
StrDeinit(&json2);
StrDeinit(&json3);
StrDeinit(&json4); StrDeinit(&json1);
StrDeinit(&json2);
StrDeinit(&json3);
StrDeinit(&json4);
StrDeinit(&single_str); StrDeinit(&json2);
StrDeinit(&json3);
StrDeinit(&json4);
StrDeinit(&single_str);
DefaultAllocatorDeinit(&alloc); StrDeinit(&json3);
StrDeinit(&json4);
StrDeinit(&single_str);
DefaultAllocatorDeinit(&alloc);
return success;- In
Read.Nested.c:37:
void AnnSymbolDeinit(AnnSymbol *sym) {
StrDeinit(&sym->analysis_name);
StrDeinit(&sym->function_name);
StrDeinit(&sym->sha256);- In
Read.Nested.c:38:
void AnnSymbolDeinit(AnnSymbol *sym) {
StrDeinit(&sym->analysis_name);
StrDeinit(&sym->function_name);
StrDeinit(&sym->sha256);
StrDeinit(&sym->function_mangled_name);- In
Read.Nested.c:39:
StrDeinit(&sym->analysis_name);
StrDeinit(&sym->function_name);
StrDeinit(&sym->sha256);
StrDeinit(&sym->function_mangled_name);
}- In
Read.Nested.c:40:
StrDeinit(&sym->function_name);
StrDeinit(&sym->sha256);
StrDeinit(&sym->function_mangled_name);
}- In
Read.Nested.c:75:
void FunctionInfoDeinit(FunctionInfo *info) {
StrDeinit(&info->name);
}- In
Read.Nested.c:79:
void ModelInfoDeinit(ModelInfo *info) {
StrDeinit(&info->name);
}- In
Read.Nested.c:83:
void SearchResultDeinit(SearchResult *result) {
StrDeinit(&result->binary_name);
StrDeinit(&result->sha256);
VecForeach(&result->tags, tag) {- In
Read.Nested.c:84:
void SearchResultDeinit(SearchResult *result) {
StrDeinit(&result->binary_name);
StrDeinit(&result->sha256);
VecForeach(&result->tags, tag) {
StrDeinit(&tag);- In
Read.Nested.c:86:
StrDeinit(&result->sha256);
VecForeach(&result->tags, tag) {
StrDeinit(&tag);
}
VecDeinit(&result->tags);- In
Read.Nested.c:89:
}
VecDeinit(&result->tags);
StrDeinit(&result->created_at);
StrDeinit(&result->model_name);
StrDeinit(&result->owned_by);- In
Read.Nested.c:90:
VecDeinit(&result->tags);
StrDeinit(&result->created_at);
StrDeinit(&result->model_name);
StrDeinit(&result->owned_by);
}- In
Read.Nested.c:91:
StrDeinit(&result->created_at);
StrDeinit(&result->model_name);
StrDeinit(&result->owned_by);
} }
StrDeinit(&json);
DefaultAllocatorDeinit(&alloc);
return success; }
StrDeinit(&json);
StrDeinit(&data.name);
DefaultAllocatorDeinit(&alloc);
StrDeinit(&json);
StrDeinit(&data.name);
DefaultAllocatorDeinit(&alloc);
return success; }
StrDeinit(&json);
StrDeinit(&data.user.profile.name);
StrDeinit(&data.status);
StrDeinit(&json);
StrDeinit(&data.user.profile.name);
StrDeinit(&data.status);
DefaultAllocatorDeinit(&alloc); StrDeinit(&json);
StrDeinit(&data.user.profile.name);
StrDeinit(&data.status);
DefaultAllocatorDeinit(&alloc);
return success; }
StrDeinit(&json);
StrDeinit(&data.company.departments.engineering.head);
StrDeinit(&data.company.name);
StrDeinit(&json);
StrDeinit(&data.company.departments.engineering.head);
StrDeinit(&data.company.name);
DefaultAllocatorDeinit(&alloc); StrDeinit(&json);
StrDeinit(&data.company.departments.engineering.head);
StrDeinit(&data.company.name);
DefaultAllocatorDeinit(&alloc);
return success; }
StrDeinit(&json);
VecDeinit(&symbols);
DefaultAllocatorDeinit(&alloc); }
StrDeinit(&json);
StrDeinit(&response.message);
VecDeinit(&response.data);
StrDeinit(&json);
StrDeinit(&response.message);
VecDeinit(&response.data);
DefaultAllocatorDeinit(&alloc); }
StrDeinit(&json);
StrDeinit(&info.name);
DefaultAllocatorDeinit(&alloc);
StrDeinit(&json);
StrDeinit(&info.name);
DefaultAllocatorDeinit(&alloc);
return success; }
StrDeinit(&json);
StrDeinit(&info.name);
DefaultAllocatorDeinit(&alloc);
StrDeinit(&json);
StrDeinit(&info.name);
DefaultAllocatorDeinit(&alloc);
return success; result.binary_name = StrInit(&alloc);
result.sha256 = StrInit(&alloc);
result.tags = VecInitWithDeepCopyT(result.tags, NULL, StrDeinit, &alloc);
result.created_at = StrInit(&alloc);
result.model_name = StrInit(&alloc); }
StrDeinit(&json);
SearchResultDeinit(&result);
DefaultAllocatorDeinit(&alloc); }
StrDeinit(&json);
StrDeinit(&response.message);
VecDeinit(&response.data);
StrDeinit(&json);
StrDeinit(&response.message);
VecDeinit(&response.data);
DefaultAllocatorDeinit(&alloc); }
StrDeinit(&json);
StrDeinit(&response.message);
VecDeinit(&response.data);
StrDeinit(&json);
StrDeinit(&response.message);
VecDeinit(&response.data);
DefaultAllocatorDeinit(&alloc);- In
Read.Simple.c:38:
// Cleanup functions
void PersonDeinit(Person *person) {
StrDeinit(&person->name);
}- In
Read.Simple.c:42:
void ConfigDeinit(Config *config) {
StrDeinit(&config->log_level);
}- In
Read.Simple.c:46:
void SimpleProductDeinit(SimpleProduct *product) {
StrDeinit(&product->name);
VecDeinit(&product->tags);
}- In
Read.Simple.c:96:
}
StrDeinit(&json);
StrDeinit(&name);
StrDeinit(&city);- In
Read.Simple.c:97:
StrDeinit(&json);
StrDeinit(&name);
StrDeinit(&city);
DefaultAllocatorDeinit(&alloc);- In
Read.Simple.c:98:
StrDeinit(&json);
StrDeinit(&name);
StrDeinit(&city);
DefaultAllocatorDeinit(&alloc);
return success; }
StrDeinit(&json);
DefaultAllocatorDeinit(&alloc);
return success; }
StrDeinit(&json);
DefaultAllocatorDeinit(&alloc);
return success; }
StrDeinit(&json);
PersonDeinit(&person);
DefaultAllocatorDeinit(&alloc); }
StrDeinit(&json);
ConfigDeinit(&config);
DefaultAllocatorDeinit(&alloc); StrIter si = StrIterFromStr(json);
Vec(Str) languages = VecInitWithDeepCopy(NULL, StrDeinit, &alloc);
JR_OBJ(si, { }
StrDeinit(&json);
VecDeinit(&languages);
DefaultAllocatorDeinit(&alloc); }
StrDeinit(&json);
StrDeinit(&data.user.name);
StrDeinit(&data.user.email);
StrDeinit(&json);
StrDeinit(&data.user.name);
StrDeinit(&data.user.email);
DefaultAllocatorDeinit(&alloc); StrDeinit(&json);
StrDeinit(&data.user.name);
StrDeinit(&data.user.email);
DefaultAllocatorDeinit(&alloc);
return success; SimpleProduct product = {0};
product.name = StrInit(&alloc);
product.tags = VecInitWithDeepCopyT(product.tags, NULL, StrDeinit, &alloc);
JR_OBJ(si, { }
StrDeinit(&json);
SimpleProductDeinit(&product);
DefaultAllocatorDeinit(&alloc);- In
RoundTrip.c:40:
// Cleanup functions
void TestPersonDeinit(TestPerson *person) {
StrDeinit(&person->name);
}- In
RoundTrip.c:44:
void TestConfigDeinit(TestConfig *config) {
StrDeinit(&config->log_level);
VecDeinit(&config->features);
}- In
RoundTrip.c:154:
}
StrDeinit(&json);
StrDeinit(&original.message);
StrDeinit(&parsed.message);- In
RoundTrip.c:155:
StrDeinit(&json);
StrDeinit(&original.message);
StrDeinit(&parsed.message);
DefaultAllocatorDeinit(&alloc);- In
RoundTrip.c:156:
StrDeinit(&json);
StrDeinit(&original.message);
StrDeinit(&parsed.message);
DefaultAllocatorDeinit(&alloc);
return success;- In
RoundTrip.c:231:
}
StrDeinit(&json);
DefaultAllocatorDeinit(&alloc);
return success;- In
RoundTrip.c:286:
}
StrDeinit(&json);
DefaultAllocatorDeinit(&alloc);
return success;- In
RoundTrip.c:348:
// Cleanup
StrDeinit(&json);
StrDeinit(&original.empty);
StrDeinit(&original.simple);- In
RoundTrip.c:349:
// Cleanup
StrDeinit(&json);
StrDeinit(&original.empty);
StrDeinit(&original.simple);
StrDeinit(&original.with_spaces);- In
RoundTrip.c:350:
StrDeinit(&json);
StrDeinit(&original.empty);
StrDeinit(&original.simple);
StrDeinit(&original.with_spaces);
StrDeinit(&original.with_special);- In
RoundTrip.c:351:
StrDeinit(&original.empty);
StrDeinit(&original.simple);
StrDeinit(&original.with_spaces);
StrDeinit(&original.with_special);
StrDeinit(&parsed.empty);- In
RoundTrip.c:352:
StrDeinit(&original.simple);
StrDeinit(&original.with_spaces);
StrDeinit(&original.with_special);
StrDeinit(&parsed.empty);
StrDeinit(&parsed.simple);- In
RoundTrip.c:353:
StrDeinit(&original.with_spaces);
StrDeinit(&original.with_special);
StrDeinit(&parsed.empty);
StrDeinit(&parsed.simple);
StrDeinit(&parsed.with_spaces);- In
RoundTrip.c:354:
StrDeinit(&original.with_special);
StrDeinit(&parsed.empty);
StrDeinit(&parsed.simple);
StrDeinit(&parsed.with_spaces);
StrDeinit(&parsed.with_special);- In
RoundTrip.c:355:
StrDeinit(&parsed.empty);
StrDeinit(&parsed.simple);
StrDeinit(&parsed.with_spaces);
StrDeinit(&parsed.with_special);
DefaultAllocatorDeinit(&alloc);- In
RoundTrip.c:356:
StrDeinit(&parsed.simple);
StrDeinit(&parsed.with_spaces);
StrDeinit(&parsed.with_special);
DefaultAllocatorDeinit(&alloc);
return success;- In
RoundTrip.c:371:
// Original data
Vec(i32) original_numbers = VecInit(&alloc);
Vec(Str) original_strings = VecInitWithDeepCopy(NULL, StrDeinit, &alloc);
// Populate arrays
- In
RoundTrip.c:399:
// Read back from JSON
Vec(i32) parsed_numbers = VecInit(&alloc);
Vec(Str) parsed_strings = VecInitWithDeepCopy(NULL, StrDeinit, &alloc);
StrIter si = StrIterFromStr(json);- In
RoundTrip.c:458:
// Cleanup
StrDeinit(&json);
VecDeinit(&original_numbers);
VecDeinit(&original_strings);- In
RoundTrip.c:513:
// Cleanup
StrDeinit(&json);
TestPersonDeinit(&original_person);
TestPersonDeinit(&parsed_person);- In
RoundTrip.c:539:
original.config.timeout = 30;
original.config.log_level = StrInitFromZstr("INFO", &alloc);
original.config.features = VecInitWithDeepCopyT(original.config.features, NULL, StrDeinit, &alloc);
// Create strings and push them properly
- In
RoundTrip.c:588:
parsed.config.timeout = 0;
parsed.config.log_level = StrInit(&alloc);
parsed.config.features = VecInitWithDeepCopyT(parsed.config.features, NULL, StrDeinit, &alloc);
parsed.numbers = VecInitT(parsed.numbers, &alloc);
parsed.flags = VecInitT(parsed.flags, &alloc);- In
RoundTrip.c:659:
// Cleanup
StrDeinit(&json);
ComplexDataDeinit(&original);
ComplexDataDeinit(&parsed);- In
RoundTrip.c:676:
// Original empty data
Vec(i32) empty_numbers = VecInit(&alloc);
Vec(Str) empty_strings = VecInitWithDeepCopy(NULL, StrDeinit, &alloc);
Str empty_str = StrInit(&alloc);- In
RoundTrip.c:696:
// Read back from JSON
Vec(i32) parsed_numbers = VecInit(&alloc);
Vec(Str) parsed_strings = VecInitWithDeepCopy(NULL, StrDeinit, &alloc);
Str parsed_str = StrInit(&alloc);
bool found_empty_object = false;- In
RoundTrip.c:733:
// Cleanup
StrDeinit(&json);
StrDeinit(&empty_str);
StrDeinit(&parsed_str);- In
RoundTrip.c:734:
// Cleanup
StrDeinit(&json);
StrDeinit(&empty_str);
StrDeinit(&parsed_str);
VecDeinit(&empty_numbers);- In
RoundTrip.c:735:
StrDeinit(&json);
StrDeinit(&empty_str);
StrDeinit(&parsed_str);
VecDeinit(&empty_numbers);
VecDeinit(&empty_strings);- In
RoundTrip.c:803:
}
StrDeinit(&json);
DefaultAllocatorDeinit(&alloc);
return success;- In
Parse.c:30:
result = result && KvConfigGetBool(&cfg, "debug", &debug) && debug;
StrDeinit(&src);
MapDeinit(&cfg);
DefaultAllocatorDeinit(&alloc);- In
Parse.c:64:
result = result && empty && (StrLen(empty) == 0);
StrDeinit(&src);
MapDeinit(&cfg);
DefaultAllocatorDeinit(&alloc);- In
Parse.c:96:
result = result && (StrCmp(stored_host, "localhost") == 0);
StrDeinit(&host_copy);
StrDeinit(&src);
MapDeinit(&cfg);- In
Parse.c:97:
StrDeinit(&host_copy);
StrDeinit(&src);
MapDeinit(&cfg);
DefaultAllocatorDeinit(&alloc);- In
Parse.c:131:
result = result && !KvConfigGetF64(&cfg, "missing", &pi);
StrDeinit(&src);
MapDeinit(&cfg);
DefaultAllocatorDeinit(&alloc);- In
Parse.c:155:
result = result && !KvConfigContains(&cfg, "later");
StrDeinit(&src);
MapDeinit(&cfg);
DefaultAllocatorDeinit(&alloc);- In
Str.Remove.c:42:
result = result && (ZstrCompare(StrBegin(&s), "Hel") == 0);
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Remove.c:69:
result = result && (ZstrCompare(StrBegin(&s), "llo") == 0);
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Remove.c:96:
result = result && (ZstrCompare(StrBegin(&s), "Hlo") == 0);
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Remove.c:126:
result = result && (ZstrCompare(StrBegin(&s), "Hell") == 0);
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Remove.c:151:
result = result && (ZstrCompare(StrBegin(&s), "Hel") == 0);
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Remove.c:176:
result = result && (ZstrCompare(StrBegin(&s), "Hlo") == 0);
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Remove.c:201:
result = result && (ZstrCompare(StrBegin(&s), "Heo") == 0);
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;- In
Http.c:43:
StrAppendFmt(&body, "<h1>hi</h1>");
HttpRespondWithHtml(&response, HTTP_RESPONSE_CODE_OK, &body);
StrDeinit(&body);
Str wire = HttpResponseSerialize(&response, alloc_base);- In
Http.c:57:
ZstrFindSubstring(StrBegin(&wire), "\r\n\r\n<h1>hi</h1>") != NULL;
StrDeinit(&wire);
HttpResponseDeinit(&response);
DefaultAllocatorDeinit(&alloc);- In
Str.Memory.c:40:
result = result && (StrCapacity(&s) < 100) && (StrCapacity(&s) >= StrLen(&s));
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Memory.c:65:
result = result && (StrBegin(&s)[1] == 'l' && StrBegin(&s)[2] == 'e');
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Memory.c:94:
result = result && (StrLen(&s) == 8) && (ZstrCompareN(StrBegin(&s), "Hel", 3) == 0);
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Memory.c:122:
result = result && (StrCapacity(&s) >= 100);
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Memory.c:147:
result = result && (StrBegin(&s) != NULL);
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Memory.c:167:
// Test with an even-length string
StrDeinit(&s);
s = StrInitFromZstr("abcd", &alloc);- In
Str.Memory.c:177:
// Test with a single-character string
StrDeinit(&s);
s = StrInitFromZstr("a", &alloc);- In
Str.Memory.c:187:
// Test with an empty string
StrDeinit(&s);
s = StrInit(&alloc);- In
Str.Memory.c:196:
result = result && (StrLen(&s) == 0);
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Ops.c:51:
result = result && (cmp5 != 0);
StrDeinit(&s1);
StrDeinit(&s2);
StrDeinit(&s3);- In
Str.Ops.c:52:
StrDeinit(&s1);
StrDeinit(&s2);
StrDeinit(&s3);
StrDeinit(&s4);- In
Str.Ops.c:53:
StrDeinit(&s1);
StrDeinit(&s2);
StrDeinit(&s3);
StrDeinit(&s4);
DefaultAllocatorDeinit(&alloc);- In
Str.Ops.c:54:
StrDeinit(&s2);
StrDeinit(&s3);
StrDeinit(&s4);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Ops.c:90:
result = result && (found5 != NULL && ZstrCompareN(found5, "World", 3) == 0);
StrDeinit(&haystack);
StrDeinit(&needle1);
StrDeinit(&needle2);- In
Str.Ops.c:91:
StrDeinit(&haystack);
StrDeinit(&needle1);
StrDeinit(&needle2);
StrDeinit(&needle3);- In
Str.Ops.c:92:
StrDeinit(&haystack);
StrDeinit(&needle1);
StrDeinit(&needle2);
StrDeinit(&needle3);
DefaultAllocatorDeinit(&alloc);- In
Str.Ops.c:93:
StrDeinit(&needle1);
StrDeinit(&needle2);
StrDeinit(&needle3);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Ops.c:118:
result = result && (StrIndexOf(&haystack, "") == 0);
StrDeinit(&haystack);
StrDeinit(&needle);
DefaultAllocatorDeinit(&alloc);- In
Str.Ops.c:119:
StrDeinit(&haystack);
StrDeinit(&needle);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Ops.c:156:
result = result && !StrEndsWith(&s, "ello", 4);
StrDeinit(&s);
StrDeinit(&prefix);
StrDeinit(&suffix);- In
Str.Ops.c:157:
StrDeinit(&s);
StrDeinit(&prefix);
StrDeinit(&suffix);
DefaultAllocatorDeinit(&alloc);- In
Str.Ops.c:158:
StrDeinit(&s);
StrDeinit(&prefix);
StrDeinit(&suffix);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Ops.c:175:
// Test multiple replacements
StrDeinit(&s1);
s1 = StrInitFromZstr("Hello Hello Hello", &alloc);
StrReplace(&s1, "Hello", "Hi", 2);- In
Str.Ops.c:181:
// Test Cstr-form (fixed-length views) - use the full "World" string instead of just "Wo"
StrDeinit(&s1);
s1 = StrInitFromZstr("Hello World", &alloc);
StrReplace(&s1, "World", 5, "Universe", 8, 1);- In
Str.Ops.c:187:
// Test Str-form
StrDeinit(&s1);
s1 = StrInitFromZstr("Hello World", &alloc);
Str find = StrInitFromZstr("World", &alloc);- In
Str.Ops.c:194:
result = result && (ZstrCompare(StrBegin(&s1), "Hello Universe") == 0);
StrDeinit(&s1);
StrDeinit(&find);
StrDeinit(&replace);- In
Str.Ops.c:195:
StrDeinit(&s1);
StrDeinit(&find);
StrDeinit(&replace);
DefaultAllocatorDeinit(&alloc);- In
Str.Ops.c:196:
StrDeinit(&s1);
StrDeinit(&find);
StrDeinit(&replace);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Ops.c:245:
VecDeinit(&iters);
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Ops.c:260:
Str stripped = StrLStrip(&s1, NULL);
bool result = (ZstrCompare(StrBegin(&stripped), "Hello ") == 0);
StrDeinit(&stripped);
// Test StrRStrip
- In
Str.Ops.c:265:
stripped = StrRStrip(&s1, NULL);
result = result && (ZstrCompare(StrBegin(&stripped), " Hello") == 0);
StrDeinit(&stripped);
// Test StrStrip
- In
Str.Ops.c:270:
stripped = StrStrip(&s1, NULL);
result = result && (ZstrCompare(StrBegin(&stripped), "Hello") == 0);
StrDeinit(&stripped);
// Test with custom strip characters
- In
Str.Ops.c:273:
// Test with custom strip characters
StrDeinit(&s1);
s1 = StrInitFromZstr("***Hello***", &alloc);- In
Str.Ops.c:278:
stripped = StrLStrip(&s1, "*");
result = result && (ZstrCompare(StrBegin(&stripped), "Hello***") == 0);
StrDeinit(&stripped);
stripped = StrRStrip(&s1, "*");- In
Str.Ops.c:282:
stripped = StrRStrip(&s1, "*");
result = result && (ZstrCompare(StrBegin(&stripped), "***Hello") == 0);
StrDeinit(&stripped);
stripped = StrStrip(&s1, "*");- In
Str.Ops.c:286:
stripped = StrStrip(&s1, "*");
result = result && (ZstrCompare(StrBegin(&stripped), "Hello") == 0);
StrDeinit(&stripped);
StrDeinit(&s1);- In
Str.Ops.c:288:
StrDeinit(&stripped);
StrDeinit(&s1);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Ops.c:326:
ok = ok && StrCmpIgnoreCase(&non_ascii_a, &non_ascii_b) == 0;
StrDeinit(&hello_lc);
StrDeinit(&hello_uc);
StrDeinit(&hello_mc);- In
Str.Ops.c:327:
StrDeinit(&hello_lc);
StrDeinit(&hello_uc);
StrDeinit(&hello_mc);
StrDeinit(&world);- In
Str.Ops.c:328:
StrDeinit(&hello_lc);
StrDeinit(&hello_uc);
StrDeinit(&hello_mc);
StrDeinit(&world);
StrDeinit(&hello_x);- In
Str.Ops.c:329:
StrDeinit(&hello_uc);
StrDeinit(&hello_mc);
StrDeinit(&world);
StrDeinit(&hello_x);
StrDeinit(&non_ascii_a);- In
Str.Ops.c:330:
StrDeinit(&hello_mc);
StrDeinit(&world);
StrDeinit(&hello_x);
StrDeinit(&non_ascii_a);
StrDeinit(&non_ascii_b);- In
Str.Ops.c:331:
StrDeinit(&world);
StrDeinit(&hello_x);
StrDeinit(&non_ascii_a);
StrDeinit(&non_ascii_b);
DefaultAllocatorDeinit(&alloc);- In
Str.Ops.c:332:
StrDeinit(&hello_x);
StrDeinit(&non_ascii_a);
StrDeinit(&non_ascii_b);
DefaultAllocatorDeinit(&alloc);
return ok;- In
Int.Convert.c:51:
result = result && (ZstrCompare(StrBegin(&text), "1101") == 0);
StrDeinit(&text);
IntDeinit(&value);
DefaultAllocatorDeinit(&alloc);- In
Int.Convert.c:72:
result = result && (ZstrCompare(StrBegin(&text), "cdef1234") == 0);
StrDeinit(&text);
IntDeinit(&value);
DefaultAllocatorDeinit(&alloc);- In
Int.Convert.c:93:
result = result && (ZstrCompare(StrBegin(&text), "12345678") == 0);
StrDeinit(&text);
IntDeinit(&value);
DefaultAllocatorDeinit(&alloc); result = result && (ZstrCompare(StrBegin(&text), "1011") == 0);
StrDeinit(&text);
IntDeinit(&value);
DefaultAllocatorDeinit(&alloc); bool result = ZstrCompare(StrBegin(&text), digits) == 0;
StrDeinit(&text);
IntDeinit(&value);
DefaultAllocatorDeinit(&alloc); result = result && (ZstrCompare(StrBegin(&text), "zz") == 0);
StrDeinit(&text);
IntDeinit(&value);
DefaultAllocatorDeinit(&alloc); bool result = ZstrCompare(StrBegin(&text), "BEEF") == 0;
StrDeinit(&text);
IntDeinit(&value);
DefaultAllocatorDeinit(&alloc); (StrAllocator(&text)->retry_limit == alloc.base.retry_limit);
StrDeinit(&text);
IntDeinit(&value);
DefaultAllocatorDeinit(&alloc); result = result && (ZstrCompare(StrBegin(&text), "0") == 0);
StrDeinit(&text);
IntDeinit(&zero);
DefaultAllocatorDeinit(&alloc); result = result && (ZstrCompare(StrBegin(&text), "755") == 0);
StrDeinit(&text);
IntDeinit(&value);
DefaultAllocatorDeinit(&alloc); bool result = ZstrCompare(StrBegin(&text), hex) == 0;
StrDeinit(&text);
IntDeinit(&value);
DefaultAllocatorDeinit(&alloc); bool result = StrLen(&text) == 0;
StrDeinit(&text);
IntDeinit(&value);
DefaultAllocatorDeinit(&alloc);- In
Backtrace.c:51:
#endif
StrDeinit(&rendered);
DefaultAllocatorDeinit(&alloc);
return ok;- In
Backtrace.c:84:
ok = ok && ZstrFindSubstring(StrBegin(&rendered), "bt_vec_capture_outer") != NULL;
StrDeinit(&rendered);
VecDeinit(&frames);
DefaultAllocatorDeinit(&alloc);- In
Backtrace.c:113:
bool ok = StrLen(&out) > 0 && ZstrFindSubstring(StrBegin(&out), "bt_capture_with_helper") != NULL;
StrDeinit(&out);
SymbolResolverDeinit(&res);
DefaultAllocatorDeinit(&alloc);- In
Backtrace.c:157:
ok = ok && ZstrFindSubstring(StrBegin(&rendered), "cfi_capture_outer") != NULL;
StrDeinit(&rendered);
SymbolResolverDeinit(&res);
DefaultAllocatorDeinit(&alloc);- In
Str.Convert.c:89:
}
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result; }
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result; result = result && (ZstrCompare(StrBegin(&s), "nan") == 0);
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;
// Test hexadecimal conversion with explicit base
StrDeinit(&s);
s = StrInitFromZstr("ABCD", &alloc); // No 0x prefix when base is explicitly 16
StrParseConfig config = {.base = 16};
// Test hexadecimal conversion (auto-detect base with 0)
StrDeinit(&s);
s = StrInitFromZstr("0xABCD", &alloc);
success = StrToU64(&s, &value, NULL);
// Test binary conversion
StrDeinit(&s);
s = StrInitFromZstr("0b101010", &alloc);
success = StrToU64(&s, &value, NULL);
// Test octal conversion
StrDeinit(&s);
s = StrInitFromZstr("0o52", &alloc);
success = StrToU64(&s, &value, NULL);
// Test zero
StrDeinit(&s);
s = StrInitFromZstr("0", &alloc);
success = StrToU64(&s, &value, NULL);
// Test invalid input
StrDeinit(&s);
s = StrInitFromZstr("not a number", &alloc);
success = StrToU64(&s, &value, NULL);
// Test negative number (should fail for unsigned)
StrDeinit(&s);
s = StrInitFromZstr("-123", &alloc);
success = StrToU64(&s, &value, NULL); result = result && (!success);
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;
// Test negative decimal conversion
StrDeinit(&s);
s = StrInitFromZstr("-12345", &alloc);
success = StrToI64(&s, &value, NULL);
// Test hexadecimal conversion
StrDeinit(&s);
s = StrInitFromZstr("0xABCD", &alloc);
success = StrToI64(&s, &value, NULL);
// Test binary conversion
StrDeinit(&s);
s = StrInitFromZstr("0b101010", &alloc);
success = StrToI64(&s, &value, NULL);
// Test zero
StrDeinit(&s);
s = StrInitFromZstr("0", &alloc);
success = StrToI64(&s, &value, NULL);
// Test invalid input
StrDeinit(&s);
s = StrInitFromZstr("not a number", &alloc);
success = StrToI64(&s, &value, NULL); result = result && (!success);
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;
// Test fractional conversion
StrDeinit(&s);
s = StrInitFromZstr("123.456", &alloc);
success = StrToF64(&s, &value, NULL);
// Test negative number
StrDeinit(&s);
s = StrInitFromZstr("-123.456", &alloc);
success = StrToF64(&s, &value, NULL);
// Test scientific notation
StrDeinit(&s);
s = StrInitFromZstr("1.23e2", &alloc);
success = StrToF64(&s, &value, NULL);
// Test zero
StrDeinit(&s);
s = StrInitFromZstr("0", &alloc);
success = StrToF64(&s, &value, NULL);
// Test infinity
StrDeinit(&s);
s = StrInitFromZstr("inf", &alloc);
success = StrToF64(&s, &value, NULL);
// Test negative infinity
StrDeinit(&s);
s = StrInitFromZstr("-inf", &alloc);
success = StrToF64(&s, &value, NULL);
// Test NaN
StrDeinit(&s);
s = StrInitFromZstr("nan", &alloc);
success = StrToF64(&s, &value, NULL);
// Test invalid input
StrDeinit(&s);
s = StrInitFromZstr("not a number", &alloc);
success = StrToF64(&s, &value, NULL); result = result && (!success);
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result; result = result && success && (recovered_u64 == u64_values[i]);
StrDeinit(&s);
} result = result && success && (recovered_i64 == i64_values[i]);
StrDeinit(&s);
} result = result && success && (F64Abs(recovered_f64 - f64_values[i]) < tolerance);
StrDeinit(&s);
}
} result = result && success && (recovered == base);
StrDeinit(&s);
} result = result && success && (recovered_large > 1e299);
StrDeinit(&s);
// Test prefix handling
bool success = StrToU64(&test_str, &value, prefix_tests[i].base == 0 ? NULL : &config);
result = result && success && (value == prefix_tests[i].expected);
StrDeinit(&test_str);
} }
StrDeinit(&s);
} result = result && has_E;
StrDeinit(&s);
} result = result && success && (recovered == large_value);
StrDeinit(&s);
} result = result && success && (recovered == test_value);
StrDeinit(&s);
} result = result && success && (recovered == test_value);
StrDeinit(&s);
} result = result && success && (recovered == test_values[i]);
StrDeinit(&s);
if (!result) result = result && success && (recovered == test_value);
StrDeinit(&s);
if (!result) result = result && success && (F64Abs(recovered - test_value) < tolerance);
StrDeinit(&s);
if (!result) result = result && (success || !success); // Either succeeds or fails gracefully
StrDeinit(&long_str);
DefaultAllocatorDeinit(&alloc);- In
Str.Access.c:39:
result = result && StrEmpty(&s);
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Access.c:58:
bool result = (first == 'H');
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Access.c:77:
bool result = (last == 'o');
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Access.c:96:
bool result = (*begin == 'H');
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Access.c:116:
bool result = (*end == '\0');
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Access.c:140:
bool result = (c0 == 'H' && c1 == 'e' && c2 == 'l' && c3 == 'l' && c4 == 'o');
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Access.c:164:
bool result = (*p0 == 'H' && *p1 == 'e' && *p2 == 'l' && *p3 == 'l' && *p4 == 'o');
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;- In
Socket.c:48:
SocketAddr connect_addr;
bool parsed = SocketAddrParse(&connect_addr, (Zstr)StrBegin(&local_str), SOCKET_KIND_TCP);
StrDeinit(&local_str);
if (!parsed) {
ListenerClose(&listener);- In
Socket.c:103:
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:114:
Str rendered = SocketAddrFormat(&addr, alloc_base);
ok = ok && StrLen(&rendered) > 0 && ZstrCompare(StrBegin(&rendered), "[::1]:8080") == 0;
StrDeinit(&rendered);
} ok = ok && (ZstrCompare(StrBegin(&out), "(3, 4)") == 0);
StrDeinit(&out);
DefaultAllocatorDeinit(&alloc);
return ok; ok = ok && (ZstrCompare(StrBegin(&out), "got 7 hits at (-1, 2)") == 0);
StrDeinit(&out);
DefaultAllocatorDeinit(&alloc);
return ok; ok = ok && (dst.x == src.x) && (dst.y == src.y);
StrDeinit(&out);
DefaultAllocatorDeinit(&alloc);
return ok; ok = ok && (ZstrCompare(StrBegin(&out), "[(0, 0)..(10, 20)]") == 0);
StrDeinit(&out);
DefaultAllocatorDeinit(&alloc);
return ok; ok = ok && (dst.max.x == src.max.x) && (dst.max.y == src.max.y);
StrDeinit(&out);
DefaultAllocatorDeinit(&alloc);
return ok; ok = ok && (ZstrCompare(StrBegin(&out), "42:[(0, 0)..(100, 50)]@(50, 25)") == 0);
StrDeinit(&out);
DefaultAllocatorDeinit(&alloc);
return ok; ok = ok && (dst.centroid.x == src.centroid.x) && (dst.centroid.y == src.centroid.y);
StrDeinit(&out);
DefaultAllocatorDeinit(&alloc);
return ok; ok = ok && (ZstrCompare(StrBegin(&out), "score=1.5 region=7:[(1, 2)..(3, 4)]@(2, 3) origin=(0, 0)") == 0);
StrDeinit(&out);
DefaultAllocatorDeinit(&alloc);
return ok;- In
SysDns.c:95:
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:120:
// SocketAddrFormat emits the bracketed form for IPv6.
ok = (StrLen(&s) > 0) && ZstrCompare(StrBegin(&s), "[::1]:443") == 0;
StrDeinit(&s);
}- In
SysDns.c:149:
ok = false;
}
StrDeinit(&s);
}
}- In
SysDns.c:175:
Str s = SocketAddrFormat(&one, a);
ok = (StrLen(&s) > 0) && ZstrCompare(StrBegin(&s), "127.0.0.1:80") == 0;
StrDeinit(&s);
}- In
AllocDebug.c:132:
ok = ok && (ZstrFindSubstring(StrBegin(&out), "40 bytes") != NULL);
StrDeinit(&out);
HeapAllocatorDeinit(&scratch);
if (p1)- In
Io.Read.c:329:
Str expected = StrInitFromZstr("Hello", &alloc);
success = success && (StrCmp(&s, &expected) == 0);
StrDeinit(&expected);
StrClear(&s);- In
Io.Read.c:337:
expected = StrInitFromZstr("Hello, World!", &alloc);
success = success && (StrCmp(&s, &expected) == 0);
StrDeinit(&expected);
{- In
Io.Read.c:352:
}
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);- In
Io.Read.c:376:
Str expected = StrInitFromZstr("Alice", &alloc);
success = success && (StrCmp(&name, &expected) == 0);
StrDeinit(&expected);
StrClear(&name);- In
Io.Read.c:387:
expected = StrInitFromZstr("Bob", &alloc);
success = success && (StrCmp(&name, &expected) == 0);
StrDeinit(&expected);
StrDeinit(&name);- In
Io.Read.c:389:
StrDeinit(&expected);
StrDeinit(&name);
DefaultAllocatorDeinit(&alloc);- In
Io.Read.c:582:
WriteFmt("str_val test: comparing with 'Hello', pass = {}\n", str_pass ? "true" : "false");
success = success && str_pass;
StrDeinit(&expected);
StrDeinit(&str_val);- In
Io.Read.c:583:
success = success && str_pass;
StrDeinit(&expected);
StrDeinit(&str_val);
str_val = StrInit(&alloc);- In
Io.Read.c:592:
WriteFmt("quoted str_val test: comparing with 'World', pass = {}\n", quoted_str_pass ? "true" : "false");
success = success && quoted_str_pass;
StrDeinit(&expected);
StrDeinit(&str_val);- In
Io.Read.c:593:
success = success && quoted_str_pass;
StrDeinit(&expected);
StrDeinit(&str_val);
WriteFmt("Overall success: {}\n", success ? "true" : "false");- In
Io.Read.c:630:
success = success && test1_pass;
StrDeinit(&expected);
StrDeinit(&result);
}- In
Io.Read.c:631:
StrDeinit(&expected);
StrDeinit(&result);
}- In
Io.Read.c:655:
success = success && test1_pass;
StrDeinit(&expected);
StrDeinit(&result);
}- In
Io.Read.c:656:
StrDeinit(&expected);
StrDeinit(&result);
}- In
Io.Read.c:680:
success = success && test2_pass;
StrDeinit(&expected);
StrDeinit(&result);
}- In
Io.Read.c:681:
StrDeinit(&expected);
StrDeinit(&result);
}- In
Io.Read.c:701:
success = success && test2_pass;
StrDeinit(&result1);
StrDeinit(&result2);
}- In
Io.Read.c:702:
StrDeinit(&result1);
StrDeinit(&result2);
}- In
Io.Read.c:724:
success = success && test2_pass;
StrDeinit(&result1);
StrDeinit(&result2);
}- In
Io.Read.c:725:
StrDeinit(&result1);
StrDeinit(&result2);
}- In
Io.Read.c:749:
success = success && test3_pass;
StrDeinit(&expected);
StrDeinit(&result);
}- In
Io.Read.c:750:
StrDeinit(&expected);
StrDeinit(&result);
}- In
Io.Read.c:774:
success = success && test4_pass;
StrDeinit(&expected);
StrDeinit(&result);
}- In
Io.Read.c:775:
StrDeinit(&expected);
StrDeinit(&result);
}- In
Io.Read.c:799:
success = success && test5_pass;
StrDeinit(&expected);
StrDeinit(&result);
}- In
Io.Read.c:800:
StrDeinit(&expected);
StrDeinit(&result);
}- In
Io.Read.c:828:
(ZstrCompare(StrBegin(&result1), "10110") == 0) ? "true" : "false"
);
StrDeinit(&result1);
BitVecDeinit(&bv1);- In
Io.Read.c:857:
(ZstrCompare(StrBegin(&result4), "1101") == 0) ? "true" : "false"
);
StrDeinit(&result4);
BitVecDeinit(&bv4);- In
Io.Read.c:870:
(ZstrCompare(StrBegin(&result5), "0") == 0) ? "true" : "false"
);
StrDeinit(&result5);
BitVecDeinit(&bv5);- In
Io.Read.c:917:
success = success && (ZstrCompare(StrBegin(&oct_text), "755") == 0);
StrDeinit(&dec_text);
StrDeinit(&hex_text);
StrDeinit(&bin_text);- In
Io.Read.c:918:
StrDeinit(&dec_text);
StrDeinit(&hex_text);
StrDeinit(&bin_text);
StrDeinit(&oct_text);- In
Io.Read.c:919:
StrDeinit(&dec_text);
StrDeinit(&hex_text);
StrDeinit(&bin_text);
StrDeinit(&oct_text);
IntDeinit(&dec);- In
Io.Read.c:920:
StrDeinit(&hex_text);
StrDeinit(&bin_text);
StrDeinit(&oct_text);
IntDeinit(&dec);
IntDeinit(&hex);- In
Io.Read.c:962:
success = success && (ZstrCompare(StrBegin(&neg_text), "-0.00125") == 0);
StrDeinit(&dec_text);
StrDeinit(&sci_text);
StrDeinit(&neg_text);- In
Io.Read.c:963:
StrDeinit(&dec_text);
StrDeinit(&sci_text);
StrDeinit(&neg_text);
FloatDeinit(&dec);- In
Io.Read.c:964:
StrDeinit(&dec_text);
StrDeinit(&sci_text);
StrDeinit(&neg_text);
FloatDeinit(&dec);
FloatDeinit(&sci);- In
Graph.Init.c:92:
ZstrCompare(StrBegin(stored_name), "alpha") == 0 && StrBegin(stored_name) != StrBegin(&name);
StrDeinit(&name);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);- In
Float.Type.c:63:
result = result && !FloatEQ(&clone, &original);
StrDeinit(&text);
FloatDeinit(&original);
FloatDeinit(&clone); result = result && !FloatIsNegative(&value);
StrDeinit(&text);
FloatDeinit(&value);
DefaultAllocatorDeinit(&alloc); result = result && FloatIsNegative(&value);
StrDeinit(&text);
FloatDeinit(&value);
DefaultAllocatorDeinit(&alloc);
IntDeinit(&integer);
StrDeinit(&text);
FloatDeinit(&value);
DefaultAllocatorDeinit(&alloc); FloatDeinit(&value);
IntDeinit(&result_value);
StrDeinit(&text);
DefaultAllocatorDeinit(&alloc);
return result; bool result = ZstrCompare(StrBegin(&text), "-123.45") == 0;
StrDeinit(&text);
FloatDeinit(&value);
DefaultAllocatorDeinit(&alloc); (StrAllocator(&text)->retry_limit == alloc.base.retry_limit);
StrDeinit(&text);
FloatDeinit(&value);
DefaultAllocatorDeinit(&alloc); bool result = ZstrCompare(StrBegin(&text), FLOAT_TEST_VERY_LARGE_ONES) == 0;
StrDeinit(&text);
FloatDeinit(&value);
DefaultAllocatorDeinit(&alloc); bool result = ZstrCompare(StrBegin(&text), "1230") == 0;
StrDeinit(&text);
FloatDeinit(&value);
DefaultAllocatorDeinit(&alloc);- In
Io.Write.c:53:
success = success && (ZstrCompare(StrBegin(&output), "{{") == 0);
StrDeinit(&output);
DefaultAllocatorDeinit(&alloc);
return success;- In
Io.Write.c:91:
StrAppendFmt(&output, "{}", s);
success = success && (ZstrCompare(StrBegin(&output), "World") == 0);
StrDeinit(&s);
StrDeinit(&output);- In
Io.Write.c:93:
StrDeinit(&s);
StrDeinit(&output);
DefaultAllocatorDeinit(&alloc);
return success;- In
Io.Write.c:165:
success = success && (ZstrCompare(StrBegin(&output), "0") == 0);
StrDeinit(&output);
DefaultAllocatorDeinit(&alloc);
return success;- In
Io.Write.c:186:
success = success && (ZstrCompare(StrBegin(&output), "0xDEADBEEF") == 0);
StrDeinit(&output);
DefaultAllocatorDeinit(&alloc);
return success;- In
Io.Write.c:203:
success = success && (ZstrCompare(StrBegin(&output), "0b10100101") == 0);
StrDeinit(&output);
DefaultAllocatorDeinit(&alloc);
return success;- In
Io.Write.c:220:
success = success && (ZstrCompare(StrBegin(&output), "0o777") == 0);
StrDeinit(&output);
DefaultAllocatorDeinit(&alloc);
return success;- In
Io.Write.c:242:
success = success && (ZstrCompare(StrBegin(&output), "2.718280") == 0);
StrDeinit(&output);
DefaultAllocatorDeinit(&alloc);
return success;- In
Io.Write.c:268:
success = success && (ZstrCompare(StrBegin(&output), "3.1415926536") == 0);
StrDeinit(&output);
DefaultAllocatorDeinit(&alloc);
return success;- In
Io.Write.c:295:
success = success && (ZstrCompare(StrBegin(&output), "nan") == 0);
StrDeinit(&output);
DefaultAllocatorDeinit(&alloc);
return success;- In
Io.Write.c:333:
success = success && (ZstrCompare(StrBegin(&output), " abc ") == 0);
StrDeinit(&output);
DefaultAllocatorDeinit(&alloc);
return success;- In
Io.Write.c:357:
success = success && (ZstrCompare(StrBegin(&output), "3.140000 Hello 42") == 0);
StrDeinit(&output);
DefaultAllocatorDeinit(&alloc);
return success;- In
Io.Write.c:515:
StrBegin(&output)[5] == 'Z' && StrBegin(&output)[6] == '1' && StrBegin(&output)[7] == '2');
StrDeinit(&output);
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);- In
Io.Write.c:516:
StrDeinit(&output);
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return success;- In
Io.Write.c:580:
BitVecDeinit(&bv3);
BitVecDeinit(&bv_zero);
StrDeinit(&output);
DefaultAllocatorDeinit(&alloc);
return success;- In
Io.Write.c:626:
IntDeinit(&bin_val);
IntDeinit(&oct_val);
StrDeinit(&output);
DefaultAllocatorDeinit(&alloc);
return success;- In
Io.Write.c:665:
FloatDeinit(&sci);
FloatDeinit(&short_v);
StrDeinit(&output);
DefaultAllocatorDeinit(&alloc);
return success;- In
Io.Write.c:679:
StrWriteFmt(&s, "fresh {}", LVAL(42));
bool ok = (StrLen(&s) == 8) && (StrBegin(&s)[0] == 'f') && (StrBegin(&s)[StrLen(&s) - 1] == '2');
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return ok;- In
Io.Write.c:704:
ok = ok && StrBegin(&s)[6] == 'A' && StrBegin(&s)[7] == 'A';
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return ok;- In
Str.Insert.c:53:
result = result && (ZstrCompare(StrBegin(&s), "?He!llo.") == 0);
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Insert.c:72:
bool result = (ZstrCompare(StrBegin(&s), "He Worldllo") == 0);
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Insert.c:92:
bool result = (ZstrCompare(StrBegin(&s), "He Worldllo") == 0);
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Insert.c:111:
bool result = (ZstrCompare(StrBegin(&s), "He Worldllo") == 0);
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Insert.c:130:
bool result = (ZstrCompare(StrBegin(&s), "He Worldllo") == 0);
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Insert.c:149:
bool result = (ZstrCompare(StrBegin(&s), "Hello World") == 0);
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Insert.c:168:
bool result = (ZstrCompare(StrBegin(&s), "Hello World") == 0);
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Insert.c:187:
bool result = (ZstrCompare(StrBegin(&s), "Hello World") == 0);
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Insert.c:206:
bool result = (ZstrCompare(StrBegin(&s), "Hello World") == 0);
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Insert.c:230:
bool result = (ZstrCompare(StrBegin(&s), "Hello World") == 0);
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Insert.c:254:
bool result = (ZstrCompare(StrBegin(&s), "Hello World") == 0);
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Insert.c:281:
result = result && (StrLen(&s2) == 0 && StrBegin(&s2) == NULL);
StrDeinit(&s1);
StrDeinit(&s2);
DefaultAllocatorDeinit(&alloc);- In
Str.Insert.c:282:
StrDeinit(&s1);
StrDeinit(&s2);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Insert.c:305:
result = result && (StrLen(&s2) == 6 && ZstrCompare(StrBegin(&s2), " World") == 0);
StrDeinit(&s1);
StrDeinit(&s2);
DefaultAllocatorDeinit(&alloc);- In
Str.Insert.c:306:
StrDeinit(&s1);
StrDeinit(&s2);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Insert.c:329:
result = result && (StrLen(&s2) == 0 && StrBegin(&s2) == NULL);
StrDeinit(&s1);
StrDeinit(&s2);
DefaultAllocatorDeinit(&alloc);- In
Str.Insert.c:330:
StrDeinit(&s1);
StrDeinit(&s2);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Insert.c:350:
bool result = (ZstrCompare(StrBegin(&s), "Hello World 2023") == 0);
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;- In
Float.Math.c:38:
bool result = ZstrCompare(StrBegin(&text), "-12.5") == 0;
StrDeinit(&text);
FloatAbs(&value);
text = FloatToStr(&value);- In
Float.Math.c:43:
result = result && (ZstrCompare(StrBegin(&text), "12.5") == 0);
StrDeinit(&text);
FloatDeinit(&value);
DefaultAllocatorDeinit(&alloc);- In
Float.Math.c:64:
bool result = ZstrCompare(StrBegin(&text), "1.23") == 0;
StrDeinit(&text);
FloatDeinit(&a);
FloatDeinit(&b);- In
Float.Math.c:87:
bool result = ZstrCompare(StrBegin(&text), FLOAT_TEST_VERY_LARGE_THREES) == 0;
StrDeinit(&text);
FloatDeinit(&a);
FloatDeinit(&b);- In
Float.Math.c:110:
bool result = ZstrCompare(StrBegin(&text), "2") == 0;
StrDeinit(&text);
FloatAdd(&result_value, &a, &whole);
text = FloatToStr(&result_value);- In
Float.Math.c:115:
result = result && (ZstrCompare(StrBegin(&text), "3.25") == 0);
StrDeinit(&text);
FloatAdd(&result_value, &a, 2u);
text = FloatToStr(&result_value);- In
Float.Math.c:120:
result = result && (ZstrCompare(StrBegin(&text), "3.25") == 0);
StrDeinit(&text);
FloatAdd(&result_value, &a, -1);
text = FloatToStr(&result_value);- In
Float.Math.c:125:
result = result && (ZstrCompare(StrBegin(&text), "0.25") == 0);
StrDeinit(&text);
FloatAdd(&result_value, &a, 0.75f);
text = FloatToStr(&result_value);- In
Float.Math.c:130:
result = result && (ZstrCompare(StrBegin(&text), "2") == 0);
StrDeinit(&text);
FloatAdd(&result_value, &a, 0.75);
text = FloatToStr(&result_value);- In
Float.Math.c:139:
IntDeinit(&whole);
FloatDeinit(&result_value);
StrDeinit(&text);
DefaultAllocatorDeinit(&alloc);
return result;- In
Float.Math.c:159:
bool result = ZstrCompare(StrBegin(&text), "-0.5") == 0;
StrDeinit(&text);
FloatDeinit(&a);
FloatDeinit(&b);- In
Float.Math.c:182:
bool result = ZstrCompare(StrBegin(&text), FLOAT_TEST_VERY_LARGE_TWOS) == 0;
StrDeinit(&text);
FloatDeinit(&a);
FloatDeinit(&b);- In
Float.Math.c:205:
bool result = ZstrCompare(StrBegin(&text), "5") == 0;
StrDeinit(&text);
FloatSub(&result_value, &a, &whole);
text = FloatToStr(&result_value);- In
Float.Math.c:210:
result = result && (ZstrCompare(StrBegin(&text), "3.5") == 0);
StrDeinit(&text);
FloatSub(&result_value, &a, 2u);
text = FloatToStr(&result_value);- In
Float.Math.c:215:
result = result && (ZstrCompare(StrBegin(&text), "3.5") == 0);
StrDeinit(&text);
FloatSub(&result_value, &a, -2);
text = FloatToStr(&result_value);- In
Float.Math.c:220:
result = result && (ZstrCompare(StrBegin(&text), "7.5") == 0);
StrDeinit(&text);
FloatSub(&result_value, &a, 0.5f);
text = FloatToStr(&result_value);- In
Float.Math.c:229:
IntDeinit(&whole);
FloatDeinit(&result_value);
StrDeinit(&text);
DefaultAllocatorDeinit(&alloc);
return result;- In
Float.Math.c:249:
bool result = ZstrCompare(StrBegin(&text), "-2.5") == 0;
StrDeinit(&text);
FloatDeinit(&a);
FloatDeinit(&b);- In
Float.Math.c:272:
bool result = ZstrCompare(StrBegin(&text), FLOAT_TEST_VERY_LARGE_TWOS) == 0;
StrDeinit(&text);
FloatDeinit(&a);
FloatDeinit(&b);- In
Float.Math.c:295:
bool result = ZstrCompare(StrBegin(&text), "3") == 0;
StrDeinit(&text);
FloatMul(&result_value, &a, &whole);
text = FloatToStr(&result_value);- In
Float.Math.c:300:
result = result && (ZstrCompare(StrBegin(&text), "3") == 0);
StrDeinit(&text);
FloatMul(&result_value, &a, 2u);
text = FloatToStr(&result_value);- In
Float.Math.c:305:
result = result && (ZstrCompare(StrBegin(&text), "3") == 0);
StrDeinit(&text);
FloatMul(&result_value, &a, -2);
text = FloatToStr(&result_value);- In
Float.Math.c:310:
result = result && (ZstrCompare(StrBegin(&text), "-3") == 0);
StrDeinit(&text);
FloatMul(&result_value, &a, 0.5f);
text = FloatToStr(&result_value);- In
Float.Math.c:319:
IntDeinit(&whole);
FloatDeinit(&result_value);
StrDeinit(&text);
DefaultAllocatorDeinit(&alloc);
return result;- In
Float.Math.c:339:
bool result = ZstrCompare(StrBegin(&text), "0.125") == 0;
StrDeinit(&text);
FloatDeinit(&a);
FloatDeinit(&b);- In
Float.Math.c:362:
bool result = ZstrCompare(StrBegin(&text), FLOAT_TEST_VERY_LARGE_ONES) == 0;
StrDeinit(&text);
FloatDeinit(&a);
FloatDeinit(&b);- In
Float.Math.c:385:
bool result = ZstrCompare(StrBegin(&text), "3") == 0;
StrDeinit(&text);
FloatDiv(&result_value, &a, &whole, 1);
text = FloatToStr(&result_value);- In
Float.Math.c:390:
result = result && (ZstrCompare(StrBegin(&text), "2.5") == 0);
StrDeinit(&text);
FloatDiv(&result_value, &a, 3u, 1);
text = FloatToStr(&result_value);- In
Float.Math.c:395:
result = result && (ZstrCompare(StrBegin(&text), "2.5") == 0);
StrDeinit(&text);
FloatDiv(&result_value, &a, -3, 1);
text = FloatToStr(&result_value);- In
Float.Math.c:400:
result = result && (ZstrCompare(StrBegin(&text), "-2.5") == 0);
StrDeinit(&text);
FloatDiv(&result_value, &a, 0.5f, 1);
text = FloatToStr(&result_value);- In
Float.Math.c:405:
result = result && (ZstrCompare(StrBegin(&text), "15") == 0);
StrDeinit(&text);
FloatDiv(&result_value, &a, 0.5, 1);
text = FloatToStr(&result_value);- In
Float.Math.c:414:
IntDeinit(&whole);
FloatDeinit(&result_value);
StrDeinit(&text);
DefaultAllocatorDeinit(&alloc);
return result;- In
Int.Math.c:112:
result = result && (ZstrCompare(StrBegin(&text), "100000000") == 0);
StrDeinit(&text);
IntDeinit(&a);
IntDeinit(&b);- In
Int.Math.c:148:
IntDeinit(&result_value);
IntDeinit(&huge);
StrDeinit(&text);
DefaultAllocatorDeinit(&alloc);
return result;- In
Int.Math.c:205:
IntDeinit(&preserved);
IntDeinit(&huge);
StrDeinit(&text);
DefaultAllocatorDeinit(&alloc);
return result;- In
Int.Math.c:265:
IntDeinit(&value);
IntDeinit(&result_value);
StrDeinit(&text);
DefaultAllocatorDeinit(&alloc);
return result;- In
Int.Math.c:323:
bool result = ZstrCompare(StrBegin(&text), "79792266297612001") == 0;
StrDeinit(&text);
IntPow(&result_value, &base, &exponent);
text = IntToStr(&result_value);- In
Int.Math.c:331:
IntDeinit(&exponent);
IntDeinit(&result_value);
StrDeinit(&text);
DefaultAllocatorDeinit(&alloc);
return result;- In
Int.Math.c:352:
result = result && (IntToU64(&remainder) == 3);
StrDeinit(&qtext);
IntDeinit(÷nd);
IntDeinit("ient);- In
Int.Math.c:393:
IntDeinit(÷nd);
IntDeinit(&result_value);
StrDeinit(&text);
DefaultAllocatorDeinit(&alloc);
return result;- In
Int.Math.c:436:
IntDeinit("ient);
IntDeinit(&remainder);
StrDeinit(&text);
DefaultAllocatorDeinit(&alloc);
return result;- In
Int.Math.c:904:
IntDeinit(&value);
IntDeinit(&next);
StrDeinit(&text);
DefaultAllocatorDeinit(&alloc);
return result;- In
File.c:25:
if (!ok) {
FileRemove(out_path);
StrDeinit(out_path);
}
return ok;- In
File.c:45:
if (!FileIsOpen(&f)) {
FileRemove(&path);
StrDeinit(&path);
DefaultAllocatorDeinit(&alloc);
return false;- In
File.c:57:
ZstrCompare(StrBegin(&body), "hello from file") == 0;
StrDeinit(&body);
FileRemove(&path);
StrDeinit(&path);- In
File.c:59:
StrDeinit(&body);
FileRemove(&path);
StrDeinit(&path);
DefaultAllocatorDeinit(&alloc);
return result;- In
File.c:79:
if (!FileIsOpen(&f)) {
FileRemove(&path);
StrDeinit(&path);
DefaultAllocatorDeinit(&alloc);
return false;- In
File.c:92:
ZstrCompare(StrBegin(&body), expected) == 0 && StrCapacity(&body) >= StrLen(&body) + 1;
StrDeinit(&body);
FileRemove(&path);
StrDeinit(&path);- In
File.c:94:
StrDeinit(&body);
FileRemove(&path);
StrDeinit(&path);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Type.c:38:
bool result = (StrLen(&s) == 5 && ZstrCompare(StrBegin(&s), "Hello") == 0);
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Type.c:50:
// Create a Strs object (vector of strings)
Strs sv = VecInitWithDeepCopy(NULL, StrDeinit, &alloc);
// Add some strings
- In
Str.Type.c:71:
}
VecDeinit(&sv); // This should call StrDeinit on each element
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Type.c:94:
bool result = true; // If we got here, the validation didn't crash
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;
// Clean up
StrDeinit(&str);
BitVecDeinit(&bv); (StrAllocator(&str)->retry_limit == alloc.base.retry_limit) && (ZstrCompare(StrBegin(&str), "101001") == 0);
StrDeinit(&str);
BitVecDeinit(&bv);
DefaultAllocatorDeinit(&alloc); Str str_obj = BitVecToStr(&bv);
result = result && (StrLen(&str_obj) == 0);
StrDeinit(&str_obj);
// Test converting single bit
result = result && (StrLen(&str_obj) == 1);
result = result && (StrCmp(&str_obj, "1", 1) == 0);
StrDeinit(&str_obj);
// Test large conversions
str_obj = BitVecToStr(&bv);
result = result && (StrLen(&str_obj) == 1000);
StrDeinit(&str_obj);
BitVecDeinit(&bv); result = result && (ZstrCompare(StrBegin(&str), patterns[i]) == 0);
StrDeinit(&str);
BitVecDeinit(&bv);
} Str empty_str = BitVecToStr(&empty);
result = result && (StrLen(&empty_str) == 0);
StrDeinit(&empty_str);
u64 empty_value = BitVecToInteger(&empty); Str str = BitVecToStr(&bv);
result = result && (ZstrCompare(StrBegin(&str), test_cases[i].pattern) == 0);
StrDeinit(&str);
// Test integer conversion (may depend on bit order)
result = result && cross_match;
StrDeinit(&str1);
StrDeinit(&str2);
StrDeinit(&str3);
StrDeinit(&str1);
StrDeinit(&str2);
StrDeinit(&str3);
BitVecDeinit(&bv1); StrDeinit(&str1);
StrDeinit(&str2);
StrDeinit(&str3);
BitVecDeinit(&bv1);
BitVecDeinit(&bv2); result = result && pattern_correct;
StrDeinit(&large_str);
// Test byte conversion
result = result && !city_reachable(&graph, &index, &s_unknown, &s_alpha);
StrDeinit(&s_alpha);
StrDeinit(&s_beta);
StrDeinit(&s_gamma);
StrDeinit(&s_alpha);
StrDeinit(&s_beta);
StrDeinit(&s_gamma);
StrDeinit(&s_delta); StrDeinit(&s_alpha);
StrDeinit(&s_beta);
StrDeinit(&s_gamma);
StrDeinit(&s_delta);
StrDeinit(&s_echo); StrDeinit(&s_beta);
StrDeinit(&s_gamma);
StrDeinit(&s_delta);
StrDeinit(&s_echo);
StrDeinit(&s_unknown); StrDeinit(&s_gamma);
StrDeinit(&s_delta);
StrDeinit(&s_echo);
StrDeinit(&s_unknown); StrDeinit(&s_delta);
StrDeinit(&s_echo);
StrDeinit(&s_unknown);
city_reset_visits(&graph);- In
Str.Init.c:37:
bool result = (StrLen(&s) == 0);
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Init.c:58:
bool result = (StrLen(&s) == len && ZstrCompareN(StrBegin(&s), test_str, len) == 0 && StrBegin(&s)[len] == '\0');
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Init.c:78:
bool result = (StrLen(&s) == ZstrLen(test_str) && ZstrCompare(StrBegin(&s), test_str) == 0);
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Init.c:96:
bool result = (StrLen(&s) == ZstrLen(test_str) && ZstrCompare(StrBegin(&s), test_str) == 0);
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Init.c:117:
bool result = (StrLen(&dst) == StrLen(&src) && ZstrCompare(StrBegin(&dst), StrBegin(&src)) == 0);
StrDeinit(&src);
StrDeinit(&dst);
DefaultAllocatorDeinit(&alloc);- In
Str.Init.c:118:
StrDeinit(&src);
StrDeinit(&dst);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Init.c:139:
bool result = (StrLen(&dst) == StrLen(&src) && ZstrCompare(StrBegin(&dst), StrBegin(&src)) == 0);
StrDeinit(&src);
StrDeinit(&dst);
DefaultAllocatorDeinit(&alloc);- In
Str.Init.c:140:
StrDeinit(&src);
StrDeinit(&dst);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Init.c:160:
bool result = (ZstrCompare(StrBegin(&s), "Hello, World!") == 0);
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Init.c:212:
bool result = (success && StrLen(&dst) == StrLen(&src) && ZstrCompare(StrBegin(&dst), StrBegin(&src)) == 0);
StrDeinit(&src);
StrDeinit(&dst);
DefaultAllocatorDeinit(&alloc);- In
Str.Init.c:213:
StrDeinit(&src);
StrDeinit(&dst);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Init.c:241:
ZstrCompare(StrBegin(&dst), StrBegin(&src)) == 0 && dup_allocator_matches && dst_allocator_matches;
StrDeinit(&src);
StrDeinit(&dup);
StrDeinit(&dst);- In
Str.Init.c:242:
StrDeinit(&src);
StrDeinit(&dup);
StrDeinit(&dst);
DefaultAllocatorDeinit(&alloc);- In
Str.Init.c:243:
StrDeinit(&src);
StrDeinit(&dup);
StrDeinit(&dst);
DefaultAllocatorDeinit(&alloc);
return result;- In
Str.Init.c:250:
// Test StrDeinit function
bool test_str_deinit(void) {
WriteFmt("Testing StrDeinit\n");
DefaultAllocator alloc = DefaultAllocatorInit();- In
Str.Init.c:260:
// Deinit the string
StrDeinit(&s);
// Check that the string is deinited correctly
- In
Str.Foreach.c:50:
bool success = (ZstrCompare(StrBegin(&result), "H0e1l2l3o4") == 0);
StrDeinit(&s);
StrDeinit(&result);
DefaultAllocatorDeinit(&alloc);- In
Str.Foreach.c:51:
StrDeinit(&s);
StrDeinit(&result);
DefaultAllocatorDeinit(&alloc);
return success;- In
Str.Foreach.c:75:
WriteFmt(" (Index 0 was processed)\n");
StrDeinit(&s);
StrDeinit(&result);
DefaultAllocatorDeinit(&alloc);- In
Str.Foreach.c:76:
StrDeinit(&s);
StrDeinit(&result);
DefaultAllocatorDeinit(&alloc);
return success; success = success && (ZstrCompare(StrBegin(&s), "HELLO") == 0);
StrDeinit(&s);
StrDeinit(&result);
DefaultAllocatorDeinit(&alloc);
StrDeinit(&s);
StrDeinit(&result);
DefaultAllocatorDeinit(&alloc);
return success; WriteFmt(" (Index 0 was processed)\n");
StrDeinit(&s);
StrDeinit(&result);
DefaultAllocatorDeinit(&alloc);
StrDeinit(&s);
StrDeinit(&result);
DefaultAllocatorDeinit(&alloc);
return success; bool success = (ZstrCompare(StrBegin(&result), "Hello") == 0);
StrDeinit(&s);
StrDeinit(&result);
DefaultAllocatorDeinit(&alloc);
StrDeinit(&s);
StrDeinit(&result);
DefaultAllocatorDeinit(&alloc);
return success; }
StrDeinit(&s);
StrDeinit(&result);
DefaultAllocatorDeinit(&alloc);
StrDeinit(&s);
StrDeinit(&result);
DefaultAllocatorDeinit(&alloc);
return success; success = success && (ZstrCompare(StrBegin(&s), "HELLO") == 0);
StrDeinit(&s);
StrDeinit(&result);
DefaultAllocatorDeinit(&alloc);
StrDeinit(&s);
StrDeinit(&result);
DefaultAllocatorDeinit(&alloc);
return success; }
StrDeinit(&s);
StrDeinit(&result);
DefaultAllocatorDeinit(&alloc);
StrDeinit(&s);
StrDeinit(&result);
DefaultAllocatorDeinit(&alloc);
return success; success = success && (StrLen(&empty_result) == 0);
StrDeinit(&s);
StrDeinit(&result);
StrDeinit(&empty_result);
StrDeinit(&s);
StrDeinit(&result);
StrDeinit(&empty_result);
DefaultAllocatorDeinit(&alloc); StrDeinit(&s);
StrDeinit(&result);
StrDeinit(&empty_result);
DefaultAllocatorDeinit(&alloc);
return success; success = success && (ZstrCompare(StrBegin(&end_result), "World") == 0);
StrDeinit(&s);
StrDeinit(&result);
StrDeinit(&end_result);
StrDeinit(&s);
StrDeinit(&result);
StrDeinit(&end_result);
DefaultAllocatorDeinit(&alloc); StrDeinit(&s);
StrDeinit(&result);
StrDeinit(&end_result);
DefaultAllocatorDeinit(&alloc);
return success; success = success && (ZstrCompare(StrBegin(&s), "Hello WORLD") == 0);
StrDeinit(&s);
StrDeinit(&result);
DefaultAllocatorDeinit(&alloc);
StrDeinit(&s);
StrDeinit(&result);
DefaultAllocatorDeinit(&alloc);
return success; success = success && (ZstrCompare(StrBegin(&s), "HELLO World") == 0);
StrDeinit(&s);
StrDeinit(&result);
DefaultAllocatorDeinit(&alloc);
StrDeinit(&s);
StrDeinit(&result);
DefaultAllocatorDeinit(&alloc);
return success; if (idx > 4) {
LOG_ERROR("Should've terminated");
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return false; }
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return true; if (idx >= 5) {
LOG_ERROR("Should've terminated");
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return false; }
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return true; if (idx < 10) {
LOG_ERROR("Should've terminated");
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return false; }
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return true; if (idx > 4) {
LOG_ERROR("Should've terminated");
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return false; }
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return true; if (idx < 12) {
LOG_ERROR("Should've terminated");
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return false; }
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return true; if (idx >= StrLen(&s)) {
LOG_ERROR("Should've terminated");
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return false; }
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return true; if (idx > 3) {
LOG_ERROR("Should've terminated");
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return false; }
StrDeinit(&s);
DefaultAllocatorDeinit(&alloc);
return true;- In
ArgParse.c:258:
bool ok = (rc == ARG_RUN_OK) && StrLen(&name) == 5 && StrBegin(&name)[0] == 'a' && StrBegin(&name)[4] == 'e';
ArgParseDeinit(&p);
StrDeinit(&name);
DefaultAllocatorDeinit(&a);
return ok;- In
Log.h:46:
StrAppendFmt(&UNPL(m), __VA_ARGS__); \
LogWrite(LOG_MESSAGE_TYPE_FATAL, __func__, __LINE__, StrBegin(&UNPL(m))); \
StrDeinit(&UNPL(m)); \
HeapAllocatorDeinit(&UNPL(log_alloc)); \
Abort(); \
- In
Log.h:70:
StrAppendFmt(&UNPL(m), __VA_ARGS__); \
LogWrite(LOG_MESSAGE_TYPE_ERROR, __func__, __LINE__, StrBegin(&UNPL(m))); \
StrDeinit(&UNPL(m)); \
HeapAllocatorDeinit(&UNPL(log_alloc)); \
} while (0)- In
Log.h:93:
StrAppendFmt(&UNPL(m), __VA_ARGS__); \
LogWrite(LOG_MESSAGE_TYPE_INFO, __func__, __LINE__, StrBegin(&UNPL(m))); \
StrDeinit(&UNPL(m)); \
HeapAllocatorDeinit(&UNPL(log_alloc)); \
} while (0)- In
Log.h:132:
} \
LogWrite(LOG_MESSAGE_TYPE_FATAL, __func__, __LINE__, StrBegin(&UNPL(m))); \
StrDeinit(&UNPL(m)); \
HeapAllocatorDeinit(&UNPL(log_alloc)); \
Abort(); \
- In
Log.h:161:
} \
LogWrite(LOG_MESSAGE_TYPE_ERROR, __func__, __LINE__, StrBegin(&UNPL(m))); \
StrDeinit(&UNPL(m)); \
HeapAllocatorDeinit(&UNPL(log_alloc)); \
} while (0)- In
Log.h:189:
} \
LogWrite(LOG_MESSAGE_TYPE_INFO, __func__, __LINE__, StrBegin(&UNPL(m))); \
StrDeinit(&UNPL(m)); \
HeapAllocatorDeinit(&UNPL(log_alloc)); \
} while (0)- In
Proc.h:290:
Zstr UNPL(in) = StrBegin(&UNPL(buf)); \
StrReadFmt(UNPL(in), __VA_ARGS__); \
StrDeinit(&UNPL(buf)); \
} while (0)- In
Proc.h:317:
Zstr UNPL(in) = StrBegin(&UNPL(buf)); \
StrReadFmt(UNPL(in), __VA_ARGS__); \
StrDeinit(&UNPL(buf)); \
} while (0)- In
Proc.h:343:
StrAppendFmt(&UNPL(buf), __VA_ARGS__); \
ProcWriteToStdin((p), &UNPL(buf)); \
StrDeinit(&UNPL(buf)); \
} while (0)- In
Proc.h:369:
StrPushBackR(&UNPL(buf), '\n'); \
ProcWriteToStdin((p), &UNPL(buf)); \
StrDeinit(&UNPL(buf)); \
} while (0)- In
PdbCache.h:34:
typedef struct PdbCacheEntry {
Str module_path; // owned; cleaned via StrDeinit
u64 module_base; // last-seen runtime load base
Pe pe;- In
JSON.h:576:
if (StrIterIndex(&UNPL(read_si)) == StrIterIndex(&si)) { \
LOG_ERROR("Failed to read string key in object. Invalid JSON"); \
StrDeinit(&key); \
UNPL(failed) = true; \
si = UNPL(saved_si); \
- In
JSON.h:588:
if (!StrIterPeek(&si, &UNPL(jr_c)) || UNPL(jr_c) != ':') { \
LOG_ERROR("Expected ':' after key string. Failed to read JSON"); \
StrDeinit(&key); \
UNPL(failed) = true; \
si = UNPL(saved_si); \
- In
JSON.h:610:
if (StrIterIndex(&UNPL(read_si)) == StrIterIndex(&si)) { \
LOG_ERROR("Failed to parse value. Invalid JSON."); \
StrDeinit(&key); \
UNPL(failed) = true; \
si = UNPL(saved_si); \
- In
JSON.h:619:
si = UNPL(read_si); \
} \
StrDeinit(&key); \
si = JSkipWhitespace(si); \
\
Last updated on