| version 1.19, 2002/02/17 15:18:45 |
version 1.20, 2002/02/18 21:34:56 |
|
|
| CFG_ERR_OVERFLOW = -6, |
CFG_ERR_OVERFLOW = -6, |
| CFG_ERROR_OVERFLOW = -6, |
CFG_ERROR_OVERFLOW = -6, |
| |
|
| /* Multiple arguments user for single option. */ |
/* Multiple arguments used for single option. */ |
| CFG_ERR_MULTI = -7, |
CFG_ERR_MULTI = -7, |
| CFG_ERROR_MULTI = -7, |
CFG_ERROR_MULTI = -7, |
| |
|
| Line 303 struct cfg_context { |
|
| Line 303 struct cfg_context { |
|
| char **file_multi_vals_separator; |
char **file_multi_vals_separator; |
| }; |
}; |
| |
|
| typedef struct cfg_context* CFG_CONTEXT; |
typedef struct cfg_context * CFG_CONTEXT; |
| |
|
| /* |
/* |
| * Functions |
* Functions |
|
|
| #define cfg_is_context_flag(con, flag) cfg_get_context_flag(con, flag) |
#define cfg_is_context_flag(con, flag) cfg_get_context_flag(con, flag) |
| |
|
| #define cfg_clear_cmdline_stop_string(con) \ |
#define cfg_clear_cmdline_stop_string(con) \ |
| __cfg_clear_strdyn_array(&con->line_stop_str) |
__cfg_clear_strdyn_array(&((con)->line_stop_str)) |
| #define cfg_add_cmdline_stop_string(con, str) \ |
#define cfg_add_cmdline_stop_string(con, str) \ |
| __cfg_add_strdyn_array(&con->line_stop_str, str) |
__cfg_add_strdyn_array(&((con)->line_stop_str), str) |
| #define cfg_remove_cmdline_stop_string(con, str) \ |
#define cfg_remove_cmdline_stop_string(con, str) \ |
| __cfg_remove_strdyn_array(&con->line_stop_str, str) |
__cfg_remove_strdyn_array(&((con)->line_stop_str), str) |
| |
|
| #define cfg_clear_cfgfile_stop_prefix(con) \ |
#define cfg_clear_cfgfile_stop_prefix(con) \ |
| __cfg_clear_strdyn_array(&con->file_stop_prefix) |
__cfg_clear_strdyn_array(&((con)->file_stop_prefix)) |
| #define cfg_add_cfgfile_stop_prefix(con, str) \ |
#define cfg_add_cfgfile_stop_prefix(con, str) \ |
| __cfg_add_strdyn_array(&con->file_stop_prefix, str) |
__cfg_add_strdyn_array(&((con)->file_stop_prefix), str) |
| #define cfg_remove_cfgfile_stop_prefix(con, str) \ |
#define cfg_remove_cfgfile_stop_prefix(con, str) \ |
| __cfg_remove_strdyn_array(&con->file_stop_prefix, str) |
__cfg_remove_strdyn_array(&((con)->file_stop_prefix), str) |
| |
|
| #define cfg_clear_cfgfile_comment_prefix(con) \ |
#define cfg_clear_cfgfile_comment_prefix(con) \ |
| __cfg_clear_strdyn_array(&con->comment_prefix) |
__cfg_clear_strdyn_array(&((con)->comment_prefix)) |
| #define cfg_add_cfgfile_comment_prefix(con, str) \ |
#define cfg_add_cfgfile_comment_prefix(con, str) \ |
| __cfg_add_strdyn_array(&con->comment_prefix, str) |
__cfg_add_strdyn_array(&((con)->comment_prefix), str) |
| #define cfg_remove_cfgfile_comment_prefix(con, str) \ |
#define cfg_remove_cfgfile_comment_prefix(con, str) \ |
| __cfg_remove_strdyn_array(&con->comment_prefix, str) |
__cfg_remove_strdyn_array(&((con)->comment_prefix), str) |
| |
|
| #define cfg_clear_cmdline_short_option_prefix(con) \ |
#define cfg_clear_cmdline_short_option_prefix(con) \ |
| __cfg_clear_strdyn_array(&con->short_option_prefix) |
__cfg_clear_strdyn_array(&((con)->short_option_prefix)) |
| #define cfg_add_cmdline_short_option_prefix(con, str) \ |
#define cfg_add_cmdline_short_option_prefix(con, str) \ |
| __cfg_add_strdyn_array(&con->short_option_prefix, str) |
__cfg_add_strdyn_array(&((con)->short_option_prefix), str) |
| #define cfg_remove_cmdline_short_option_prefix(con, str) \ |
#define cfg_remove_cmdline_short_option_prefix(con, str) \ |
| __cfg_remove_strdyn_array(&con->short_option_prefix, str) |
__cfg_remove_strdyn_array(&((con)->short_option_prefix), str) |
| |
|
| #define cfg_clear_cmdline_long_option_prefix(con) \ |
#define cfg_clear_cmdline_long_option_prefix(con) \ |
| __cfg_clear_strdyn_array(&con->long_option_prefix) |
__cfg_clear_strdyn_array(&((con)->long_option_prefix)) |
| #define cfg_add_cmdline_long_option_prefix(con, str) \ |
#define cfg_add_cmdline_long_option_prefix(con, str) \ |
| __cfg_add_strdyn_array(&con->long_option_prefix, str) |
__cfg_add_strdyn_array(&((con)->long_option_prefix), str) |
| #define cfg_remove_cmdline_long_option_prefix(con, str) \ |
#define cfg_remove_cmdline_long_option_prefix(con, str) \ |
| __cfg_remove_strdyn_array(&con->long_option_prefix, str) |
__cfg_remove_strdyn_array(&((con)->long_option_prefix), str) |
| |
|
| #define cfg_clear_cfgfile_multi_line_postfix(con) \ |
#define cfg_clear_cfgfile_multi_line_postfix(con) \ |
| __cfg_clear_strdyn_array(&con->multi_line_postfix) |
__cfg_clear_strdyn_array(&((con)->multi_line_postfix)) |
| #define cfg_add_cfgfile_multi_line_postfix(con, str) \ |
#define cfg_add_cfgfile_multi_line_postfix(con, str) \ |
| __cfg_add_strdyn_array(&con->multi_line_postfix, str) |
__cfg_add_strdyn_array(&((con)->multi_line_postfix), str) |
| #define cfg_remove_cfgfile_multi_line_postfix(con, str) \ |
#define cfg_remove_cfgfile_multi_line_postfix(con, str) \ |
| __cfg_remove_strdyn_array(&con->multi_line_postfix, str) |
__cfg_remove_strdyn_array(&((con)->multi_line_postfix), str) |
| |
|
| #define cfg_clear_cmdline_multi_vals_separator(con) \ |
#define cfg_clear_cmdline_multi_vals_separator(con) \ |
| __cfg_clear_strdyn_array(&con->line_multi_vals_separator) |
__cfg_clear_strdyn_array(&((con)->line_multi_vals_separator)) |
| #define cfg_add_cmdline_multi_vals_separator(con, str) \ |
#define cfg_add_cmdline_multi_vals_separator(con, str) \ |
| __cfg_add_strdyn_array(&con->line_multi_vals_separator, str) |
__cfg_add_strdyn_array(&((con)->line_multi_vals_separator), str) |
| #define cfg_remove_cmdline_multi_vals_separator(con, str) \ |
#define cfg_remove_cmdline_multi_vals_separator(con, str) \ |
| __cfg_remove_strdyn_array(&con->line_multi_vals_separator, str) |
__cfg_remove_strdyn_array(&((con)->line_multi_vals_separator), str) |
| |
|
| #define cfg_clear_cfgfile_multi_vals_separator(con) \ |
#define cfg_clear_cfgfile_multi_vals_separator(con) \ |
| __cfg_clear_strdyn_array(&con->file_multi_vals_separator) |
__cfg_clear_strdyn_array(&((con)->file_multi_vals_separator)) |
| #define cfg_add_cfgfile_multi_vals_separator(con, str) \ |
#define cfg_add_cfgfile_multi_vals_separator(con, str) \ |
| __cfg_add_strdyn_array(&con->file_multi_vals_separator, str) |
__cfg_add_strdyn_array(&((con)->file_multi_vals_separator), str) |
| #define cfg_remove_cfgfile_multi_vals_separator(con, str) \ |
#define cfg_remove_cfgfile_multi_vals_separator(con, str) \ |
| __cfg_remove_strdyn_array(&con->file_multi_vals_separator, str) |
__cfg_remove_strdyn_array(&((con)->file_multi_vals_separator), str) |
| |
|
| #define cfg_clear_cmdline_option_arg_separator(con) \ |
#define cfg_clear_cmdline_option_arg_separator(con) \ |
| __cfg_clear_strdyn_array(&con->line_option_arg_separator) |
__cfg_clear_strdyn_array(&((con)->line_option_arg_separator)) |
| #define cfg_add_cmdline_option_arg_separator(con, str) \ |
#define cfg_add_cmdline_option_arg_separator(con, str) \ |
| __cfg_add_strdyn_array(&con->line_option_arg_separator, str) |
__cfg_add_strdyn_array(&((con)->line_option_arg_separator), str) |
| #define cfg_remove_cmdline_option_arg_separator(con, str) \ |
#define cfg_remove_cmdline_option_arg_separator(con, str) \ |
| __cfg_remove_strdyn_array(&con->line_option_arg_separator, str) |
__cfg_remove_strdyn_array(&((con)->line_option_arg_separator), str) |
| |
|
| #define cfg_clear_cfgfile_option_arg_separator(con) \ |
#define cfg_clear_cfgfile_option_arg_separator(con) \ |
| __cfg_clear_strdyn_array(&con->file_option_arg_separator) |
__cfg_clear_strdyn_array(&((con)->file_option_arg_separator)) |
| #define cfg_add_cfgfile_option_arg_separator(con, str) \ |
#define cfg_add_cfgfile_option_arg_separator(con, str) \ |
| __cfg_add_strdyn_array(&con->file_option_arg_separator, str) |
__cfg_add_strdyn_array(&((con)->file_option_arg_separator), str) |
| #define cfg_remove_cfgfile_option_arg_separator(con, str) \ |
#define cfg_remove_cfgfile_option_arg_separator(con, str) \ |
| __cfg_remove_strdyn_array(&con->file_option_arg_separator, str) |
__cfg_remove_strdyn_array(&((con)->file_option_arg_separator), str) |
| |
|
| /* Processing context options. */ |
/* Processing context options. */ |
| |
|
| int cfg_parse(const CFG_CONTEXT con); |
int cfg_parse(const CFG_CONTEXT con); |
| int cfg_get_next_opt(const CFG_CONTEXT con); |
int cfg_get_next_opt(const CFG_CONTEXT con); |
| char *cfg_get_opt_arg(const CFG_CONTEXT con); |
|
| char *cfg_get_cur_opt(const CFG_CONTEXT con); |
char *cfg_get_cur_opt(const CFG_CONTEXT con); |
| char *cfg_get_cur_arg(const CFG_CONTEXT con); |
char *cfg_get_cur_arg(const CFG_CONTEXT con); |
| int cfg_get_cur_idx(const CFG_CONTEXT con); |
int cfg_get_cur_idx(const CFG_CONTEXT con); |