| version 1.37, 2002/05/30 22:29:45 |
version 1.38, 2002/06/23 10:48:46 |
| Line 257 enum cfg_property_type { |
|
| Line 257 enum cfg_property_type { |
|
| /** default: "--" */ |
/** default: "--" */ |
| CFG_LINE_LONG_OPTION_PREFIX = 2, |
CFG_LINE_LONG_OPTION_PREFIX = 2, |
| |
|
| /** default: "=" */ |
/** Command line option argument separator (default: "=") */ |
| CFG_LINE_OPTION_ARG_SEPARATOR = 3, |
CFG_LINE_OPTION_ARG_SEPARATOR = 3, |
| |
|
| /** Multi values separator. */ |
/** Command line multi values separator. */ |
| CFG_LINE_MULTI_VALS_SEPARATOR = 4, |
CFG_LINE_NORMAL_MULTI_VALS_SEPARATOR = 4, |
| |
|
| /** Quote prefix & postfix */ |
/** Command line multi values leftover arguments separator */ |
| CFG_QUOTE_PREFIX = 5, |
CFG_LINE_LEFTOVER_MULTI_VALS_SEPARATOR = 5, |
| CFG_QUOTE_POSTFIX = 6, |
|
| |
/** Command line quote prefix & postfix */ |
| |
CFG_LINE_QUOTE_PREFIX = 6, |
| |
CFG_LINE_QUOTE_POSTFIX = 7, |
| |
|
| /** Array of strings prefixes which forces to stop config file parsing. |
/** Array of strings prefixes which forces to stop config file parsing. |
| * default: "[" |
* default: "[" |
| */ |
*/ |
| CFG_FILE_STOP_PREFIX = 7, |
CFG_FILE_STOP_PREFIX = 8, |
| |
|
| /** Array of string prefixes which mark comment line. |
/** Array of string prefixes which mark comment line. |
| * defaults: "#", ";" |
* defaults: "#", ";" |
| */ |
*/ |
| CFG_FILE_COMMENT_PREFIX = 8, |
CFG_FILE_COMMENT_PREFIX = 9, |
| |
|
| /** Array of string postfixes to determine multi lines. */ |
/** Array of string postfixes to determine multi lines. */ |
| CFG_FILE_MULTI_LINE_POSTFIX = 9, |
CFG_FILE_MULTI_LINE_POSTFIX = 10, |
| |
|
| |
/** Config file option argument separator (default: "=") */ |
| |
CFG_FILE_OPTION_ARG_SEPARATOR = 11, |
| |
|
| |
/** Config file multi values separator. */ |
| |
CFG_FILE_NORMAL_MULTI_VALS_SEPARATOR = 12, |
| |
|
| /** Option argument separator. |
/** Command line multi values leftover arguments separator */ |
| default: "=" */ |
CFG_FILE_LEFTOVER_MULTI_VALS_SEPARATOR = 13, |
| CFG_FILE_OPTION_ARG_SEPARATOR = 10, |
|
| |
|
| /** Multi values separator. */ |
/** Config file quote prefix & postfix */ |
| CFG_FILE_MULTI_VALS_SEPARATOR = 11, |
CFG_FILE_QUOTE_PREFIX = 14, |
| |
CFG_FILE_QUOTE_POSTFIX = 15, |
| |
|
| /*@}*/ |
/*@}*/ |
| |
|
| Line 294 enum cfg_property_type { |
|
| Line 303 enum cfg_property_type { |
|
| */ |
*/ |
| /*@{*/ |
/*@{*/ |
| /** Special properties count */ |
/** Special properties count */ |
| CFG_N_PROPS = 12, |
CFG_N_PROPS = 16, |
| /*@}*/ |
/*@}*/ |
| |
|
| /** |
/** |
| * @name Virtual properties codes |
* @name Virtual properties codes |
| */ |
*/ |
| /*@{*/ |
/*@{*/ |
| |
|
| |
/** File quote prefix & postfix */ |
| |
CFG_QUOTE = 50, |
| |
CFG_LINE_QUOTE = 51, |
| |
CFG_FILE_QUOTE = 52, |
| |
CFG_QUOTE_PREFIX = 53, |
| |
CFG_QUOTE_POSTFIX = 54, |
| |
|
| |
/** Multi values separator */ |
| |
CFG_MULTI_VALS_SEPARATOR = 55, |
| |
CFG_FILE_MULTI_VALS_SEPARATOR = 56, |
| |
CFG_LINE_MULTI_VALS_SEPARATOR = 57, |
| |
CFG_NORMAL_MULTI_VALS_SEPARATOR = 58, |
| |
CFG_LEFTOVER_MULTI_VALS_SEPARATOR = 59, |
| |
|
| |
/** Option argument separator */ |
| |
CFG_OPTION_ARG_SEPARATOR = 60, |
| |
|
| /* TODO: virtual properties */ |
/* TODO: virtual properties */ |
| CFG_VIRTUAL_SPECIAL_PROPERTY = 13 |
CFG_VIRTUAL_SPECIAL_PROPERTY = 99 |
| /*@}*/ |
/*@}*/ |
| }; |
}; |
| /*@}*/ |
/*@}*/ |
| Line 407 struct cfg_context { |
|
| Line 434 struct cfg_context { |
|
| /** Special properties */ |
/** Special properties */ |
| char **prop[CFG_N_PROPS]; |
char **prop[CFG_N_PROPS]; |
| |
|
| |
/** Currents */ |
| |
int cur_idx; |
| |
int cur_idx_tmp; |
| |
int cur_opt_type; |
| |
|
| |
/** Current option string */ |
| |
char *cur_opt; |
| |
|
| |
/** Current option argument*/ |
| |
char *cur_arg; |
| |
|
| /*@}*/ |
/*@}*/ |
| |
|
| /** |
/** |
| Line 417 struct cfg_context { |
|
| Line 455 struct cfg_context { |
|
| int argc; |
int argc; |
| char **argv; |
char **argv; |
| |
|
| int cur_idx; |
|
| int cur_idx_tmp; |
|
| int cur_opt_type; |
|
| |
|
| char *cur_opt; |
|
| char *cur_arg; |
|
| |
|
| /*@}*/ |
/*@}*/ |
| |
|
| /** |
/** |
|
|
| * Parse context |
* Parse context |
| * |
* |
| * @param con initialized context |
* @param con initialized context |
| * @return code of error (CFG_ERR_*) or CFG_OK |
* @return code of error (CFG_ERROR_*) or CFG_OK |
| * @see cfg_error |
* @see cfg_error |
| */ |
*/ |
| int cfg_parse(const CFG_CONTEXT con); |
int cfg_parse(const CFG_CONTEXT con); |
|
|
| * Parse next option(s) and return its value (if non-zero) or error code. |
* Parse next option(s) and return its value (if non-zero) or error code. |
| * |
* |
| * @param con initialized context |
* @param con initialized context |
| * @return next option val, code of error (CFG_ERR_*) |
* @return next option val, code of error (CFG_ERROR_*) |
| * or CFG_OK on end |
* or CFG_OK on end |
| * @see cfg_error |
* @see cfg_error |
| * @see cfg_context |
* @see cfg_context |