StrCmpZstr
- Macro
- October 8, 2025
Table of Contents
StrCmpZstr
StrCmpZstrDescription
Compare string with a null-terminated const char* string
Parameters
| Name | Direction | Description |
|---|---|---|
str | in | Pointer to Str object to compare with. |
zstr | in | Null-terminated string to compare with. |
Usage example (Cross-references)
- In
Io.Read.c:705:
WriteFmt("Input: '{}', Output: '{} {}'", in, result1, result2);
bool test2_pass = (StrCmpZstr(&result1, "HELLO") == 0);
test2_pass &= (StrCmpZstr(&result2, "WORLD") == 0);
WriteFmt("Expected: 'HELLO WORLD', Pass: {}\n\n", test2_pass ? "true" : "false");
- In
Io.Read.c:706:
bool test2_pass = (StrCmpZstr(&result1, "HELLO") == 0);
test2_pass &= (StrCmpZstr(&result2, "WORLD") == 0);
WriteFmt("Expected: 'HELLO WORLD', Pass: {}\n\n", test2_pass ? "true" : "false");
success = success && test2_pass;
- In
Io.Read.c:728:
WriteFmt("Input: '{}', Output: '{}{}'", in, result1, result2);
bool test2_pass = (StrCmpZstr(&result1, "HELLO") == 0);
test2_pass &= (StrCmpZstr(&result2, " WORLD MIGHTY MISRA") == 0); // notice the extra space
WriteFmt("Expected: 'HELLO WORLD MIGHTY MISRA', Pass: {}\n\n", test2_pass ? "true" : "false");
- In
Io.Read.c:729:
bool test2_pass = (StrCmpZstr(&result1, "HELLO") == 0);
test2_pass &= (StrCmpZstr(&result2, " WORLD MIGHTY MISRA") == 0); // notice the extra space
WriteFmt("Expected: 'HELLO WORLD MIGHTY MISRA', Pass: {}\n\n", test2_pass ? "true" : "false");
success = success && test2_pass;
- In
JSON.h:240:
#define JR_STR_KV(si, k, str) \
do { \
if (!StrCmpZstr(&key, (k))) { \
Str my_str = StrInit(); \
si = JReadString((si), &my_str); \
- In
JSON.h:285:
#define JR_INT_KV(si, k, i) \
do { \
if (!StrCmpZstr(&key, (k))) { \
i64 my_int = 0; \
si = JReadInteger((si), &my_int); \
- In
JSON.h:330:
#define JR_FLT_KV(si, k, f) \
do { \
if (!StrCmpZstr(&key, (k))) { \
f64 my_flt = 0; \
si = JReadFloat((si), &my_flt); \
- In
JSON.h:375:
#define JR_BOOL_KV(si, k, b) \
do { \
if (!StrCmpZstr(&key, (k))) { \
bool my_b = 0; \
si = JReadBool((si), &my_b); \
- In
JSON.h:623:
#define JR_OBJ_KV(si, k, reader) \
do { \
if (!StrCmpZstr(&key, (k))) { \
JR_OBJ(si, reader); \
} \
- In
JSON.h:648:
#define JR_ARR_KV(si, k, reader) \
do { \
if (!StrCmpZstr(&key, (k))) { \
JR_ARR(si, reader); \
} \
- In
Str.c:208:
char *zstr = generate_cstring(data, offset, size, 20);
if (zstr) {
int result = StrCmpZstr(str, zstr);
(void)result; // Suppress unused variable warning
free(zstr);