KvConfigGet
Description
Get stored value for key as a new Str copy.
Parameters
| Name | Direction | Description |
|---|---|---|
cfg |
in,out | Parsed config. |
key |
in | Lookup key. Prefer Str *; Zstr accepted. |
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
Parse.c:82:
stored_host = KvConfigGetPtr(&cfg, "host");
host_copy = KvConfigGet(&cfg, "host");
result = result && stored_host;
Last updated on