Context flags

For setting particular context flages there are these functions:

#include <cfg+.h>

void cfg_set_context_flag(const CFG_CONTEXT con, int flag);

void cfg_clear_context_flag(const CFG_CONTEXT con, int flag);

int cfg_get_context_flag(const CFG_CONTEXT con, int flag);

int cfg_is_context_flag(const CFG_CONTEXT con, int flag);

void cfg_set_context_flags(const CFG_CONTEXT con, int flags);

int cfg_get_context_flags(const CFG_CONTEXT con, int flags);

These functions and macros manipulate with context flags. The function cfg_set_context_flag() sets one particular context flag. Similary, function cfg_clear_context_flag() clears one context flags. Functions cfg_get_context_flag() and its macro alias cfg_is_context_flag() which is indentical in every way, detect if particular context flag is set.

Remaining two functions cfg_set_context_flags() and cfg_get_context_flags() can set and get all flags in one call. Note that when you set flags with cfg_set_context_flags() current flag state of context is overwritten by flags parameter passed to this function.

List of setable context flags described in following table.

Table 2-3. Context flags

FlagDescription
CFG_IGNORE_MULTIIgnore multiple arguments for single option.
CFG_IGNORE_UNKNOWNIgnore unknown options.
CFG_PROCESS_FIRSTProcess also the first argument on command line.
CFG_ADVANCED_LEFTOVERSAdvanced leftover arguments.
CFG_STRICT_LEFTOVERSStrict leftover arguments initialization in file.
CFG_FILE_LINE_POS_USAGELine type position usage in file.

Constants CFG_SKIP_FIRST (Skip processing of the first argument on command line.), CFG_POSIXLY_LEFTOVERS (Posixly correct leftover arguments.), CFG_NORMAL_LEFTOVERS (Normal leftover arguments initialization in file.) and CFG_FILE_BYTE_POS_USAGE (Byte type position usage in file.) are set by default. Note that these constants contain real values of 0, thus they cannot be set. Instead of that, clear appropriate opposite equivalent described in Context flags table to get result.