Skip to content

KvConfigInit

KvConfigInit

Description

Initialize a KvConfig object with deep-copy ownership for both keys and values.

Success

Returns initialized config object.

Usage example (Cross-references)

Usage examples (Cross-references)
    
    static bool test_kvconfig_basic_parse(void) {
        KvConfig cfg = KvConfigInit();
        Str      src = StrInitFromZstr(
            "host = localhost\n"
    
    static bool test_kvconfig_comments_quotes_and_duplicates(void) {
        KvConfig cfg = KvConfigInit();
        Str      src = StrInitFromZstr(
            "# comment line\n"
    
    static bool test_kvconfig_get_returns_copy(void) {
        KvConfig cfg         = KvConfigInit();
        Str      src         = StrInitFromZstr("host = localhost\n");
        StrIter  input       = StrIterFromStr(src);
    
    static bool test_kvconfig_numeric_and_bool_accessors(void) {
        KvConfig cfg = KvConfigInit();
        Str      src = StrInitFromZstr(
            "workers = 16\n"
    
    static bool test_kvconfig_invalid_line_fails(void) {
        KvConfig cfg = KvConfigInit();
        Str      src = StrInitFromZstr(
            "valid = yes\n"
Last updated on