For setting particular context flages there are these functions:
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. Function cfg_get_context_flag() detects if particular context flag is set. It has the macro alias cfg_is_context_flag() which is indentical in every way,
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
| Flag | Description | Default behaviour |
|---|---|---|
| CFG_IGNORE_MULTI | Ignore multiple arguments for single option. | Multiple argument for single option causes CFG_ERROR_MULTI error. |
| CFG_IGNORE_UNKNOWN | Ignore unknown options. | Unknown option causes CFG_ERROR_UNKNOWN error. |
| CFG_SKIP_FIRST | Processing of the first argument on command line is skipped. Affects only command line. | Process also the first argument on command line. |
| CFG_ADVANCED_LEFTOVERS | Advanced leftover arguments. | Leftover arguments must be posixly correct. That means all options must go before any leftover argument. Once the first leftover argument is found, all further arguments are considered as leftover. |
| CFG_STRICT_LEFTOVERS | Strict leftover arguments initialization in file. | Leftover arguments initialization in file are normal (as-is). |
| CFG_FILE_LINE_POS_USAGE | Positions and size in configuration file are specified in lines starting from 0. | Positions and size in configuration file are specified in bytes starting from 0. |
If you have flag set and you want to get again default behaviour, simply clear flag with cfg_clear_context_flag() function.