KvConfigGet
KvConfigGet
Description
Get stored value for key as a new Str copy.
Parameters
| Name | Direction | Description |
|---|---|---|
cfg |
in,out | Parsed config. |
key |
in | Zero-terminated key string. |
Success
Newly allocated copy of stored Str value. Caller must StrDeinit(...) it.
Failure
Empty Str if key does not exist.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
KvConfig.c:423:
}
Str KvConfigGet(KvConfig *cfg, const char *key) {
Str *value = KvConfigGetPtr(cfg, key);- In
Parse.c:74:
stored_host = KvConfigGetPtr(&cfg, "host");
host_copy = KvConfigGet(&cfg, "host");
result = result && stored_host;
Last updated on