KvConfigGetI64
Description
Parse and fetch a signed 64-bit integer config value.
Parameters
| Name | Direction | Description |
|---|---|---|
cfg |
in,out | Parsed config. |
key |
in | Lookup key. Prefer Str *; Zstr accepted. |
value |
out | Parsed integer. |
Success
true if key exists and value is a valid integer.
Failure
false
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Parse.c:116:
result = result && (StrIterIndex(&si) == StrIterLength(&si));
result = result && (MapPairCount(&cfg) == 2);
result = result && KvConfigGetI64(&cfg, "a", &a) && (a == 1);
result = result && KvConfigGetI64(&cfg, "b", &b) && (b == 2);- In
Parse.c:117:
result = result && (MapPairCount(&cfg) == 2);
result = result && KvConfigGetI64(&cfg, "a", &a) && (a == 1);
result = result && KvConfigGetI64(&cfg, "b", &b) && (b == 2);
StrDeinit(&src);- In
Parse.c:207:
result = result && (StrIterIndex(&si) == StrIterLength(&si));
result = result && (MapPairCount(&cfg) == 2);
result = result && KvConfigGetI64(&cfg, "a", &a) && (a == 1);
result = result && KvConfigGetI64(&cfg, "b", &b) && (b == 2);- In
Parse.c:208:
result = result && (MapPairCount(&cfg) == 2);
result = result && KvConfigGetI64(&cfg, "a", &a) && (a == 1);
result = result && KvConfigGetI64(&cfg, "b", &b) && (b == 2);
StrDeinit(&src);- In
Parse.c:329:
result = result && KvConfigContains(&cfg, "host");
result = result && host && StrCmp(host, "localhost") == 0;
result = result && KvConfigGetI64(&cfg, "port", &port) && (port == 8080);
result = result && KvConfigGetBool(&cfg, "debug", &debug) && debug;- In
Parse.c:425:
(void)KvConfigParse(input, &cfg);
result = result && KvConfigGetI64(&cfg, "workers", &workers) && (workers == 16);
result = result && KvConfigGetF64(&cfg, "pi", &pi) && (pi > 3.1415 && pi < 3.1416);
result = result && KvConfigGetBool(&cfg, "enabled", &enabled) && enabled;- In
Parse.c:430:
result = result && KvConfigGetBool(&cfg, "disabled", &disabled) && !disabled;
result = result && !KvConfigGetBool(&cfg, "invalid_bool", &enabled);
result = result && !KvConfigGetI64(&cfg, "pi", &workers);
result = result && !KvConfigGetF64(&cfg, "missing", &pi);- In
Parse.c:543:
f64 ratio = 0.0;
bool en = false;
result = result && KvConfigGetI64(&cfg, &k_workers, &workers) && (workers == 16);
result = result && KvConfigGetF64(&cfg, &k_ratio, &ratio) && (ratio > 0.24 && ratio < 0.26);
result = result && KvConfigGetBool(&cfg, &k_enabled, &en) && en;- In
Parse.c:617:
result = result && host && (StrCmp(host, "localhost") == 0);
result = result && name && (StrCmp(name, "misra") == 0);
result = result && KvConfigGetI64(&cfg, "port", &port) && (port == 8080);
StrDeinit(&src);
Last updated on