libcfg+/man/cfg_set_context_flag.3.html
CFG_SET_CONTEXT_FLAG(3) libcfg+ 0.7.0 CFG_SET_CONTEXT_FLAG(3)
NAME
cfg_set_context_flag, cfg_clear_context_flag, cfg_get_context_flag, cfg_set_context_flags, cfg_get_context_flags - libcfg+
context flags manipulation functions
SYNOPSIS
The following functions can be used to set various context flags:
#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);
void cfg_set_context_flags (const CFG_CONTEXT con, int flags);
int cfg_get_context_flags (const CFG_CONTEXT con, int flags);
DESCRIPTION
You can set a context flag with cfg_set_context_flag(). You can clear a flag with cfg_clear_context_flag(). To see whether
a flag is set, use cfg_get_context_flag(). It has a macro alias cfg_is_context_flag(), which is identical in every way.
The functions cfg_set_context_flags() and cfg_get_context_flags() can set and retrieve the value of all flags in one call.
A list of all settable context flags is provided in the following table.
"CONTEXT FLAGS"
CFG_IGNORE_MULTI
Ignore multiple arguments for a single option. The first argument will be used to store the option value. The others
are skipped.
By default, multiple arguments for an option that has not allowed them, cause the CFG_ERROR_MULTI error.
CFG_IGNORE_UNKNOWN
Ignore all unknown options.
The default behaviour is to produce the CFG_ERROR_UNKNOWN error when an unknown option is encountered.
CFG_SKIP_FIRST
Setting this flag will cause the first argument on the command line to be skipped. This flag affects only command
line contexts.
The default behaviour is to parse all command line arguments.
CFG_ADVANCED_LEFTOVERS
Advanced leftover arguments. Setting this flag will drop the requirement of the leftover arguments to conform to the
POSIX standard.
The default behaviour is to require the leftover arguments to conform to POSIX. According to POSIX, all option argu
ments must precede any non-option (leftover) arguments. Once a non-option argument is found, all remaining arguments
are also interpreted as non-option.
CFG_FILE_LINE_POS_USAGE
Setting this flag will cause the parsing of configuration file to become line- instead of byte-oriented. This will
also change the meaning of the values stored in begin_pos and size.
By default, parsing is byte-oriented.
You can use the cfg_clear_context_flag() function to restore the value of a flag to its default value.
SEE ALSO
You can get library overview, table of contents and such additional information info from main libcfg+(3) manpage by typing
"man libcfg+" on UNIX-based systems. Also use this command to get information about authors, homepage and license condi
tions.
libcfg+ 0.7.0 13 September 2015 CFG_SET_CONTEXT_FLAG(3)
|