Skip to content
KvConfigSkipLine

KvConfigSkipLine

Description

Skip current line including trailing newline when present.

Parameters

Name Direction Description
si in Iterator positioned anywhere on a line.

Success

Returns iterator positioned at the first character of the next line.

Failure

Function cannot fail. Returns an iterator at end of input when no trailing newline is present.

Usage example (Cross-references)

Usage examples (Cross-references)
    }
    
    StrIter KvConfigSkipLine(StrIter si) {
        char c;
        while (StrIterPeek(&si, &c) && c != '\n') {
        }
        if (kvconfig_is_comment_start(c)) {
            si = KvConfigSkipLine(si);
        } else if (c != '\n') {
            LOG_ERROR("Unexpected trailing characters after config value");
    
            if (kvconfig_is_comment_start(c)) {
                si = KvConfigSkipLine(si);
                StrDeinit(&key);
                StrDeinit(&value);
Last updated on