| version 1.8, 2001/10/23 15:41:32 |
version 1.9, 2001/11/28 14:42:52 |
|
|
| CFG_PROCESS_FIRST = 4, |
CFG_PROCESS_FIRST = 4, |
| |
|
| /* |
/* |
| CFG_APPEND, |
CFG_APPEND, |
| CFG_OVERWRITE, |
CFG_OVERWRITE, |
| CFG_APPEND_MULTI_ONLY |
CFG_APPEND_MULTI_ONLY |
| */ |
*/ |
| }; |
}; |
| |
|
| enum cfg_option_type { |
enum cfg_option_type { |
| Line 132 enum cfg_option_type { |
|
| Line 132 enum cfg_option_type { |
|
| CFG_LEFTOVER_ARGS = 128, |
CFG_LEFTOVER_ARGS = 128, |
| CFG_LEFTOVER_ARGUMENTS = 128 |
CFG_LEFTOVER_ARGUMENTS = 128 |
| |
|
| /* TODO: Thinking about case insensitivy of option. (--input, --INPUT) */ |
/* TODO: Thinking about case insensitivy of option. (--input, --INPUT) */ |
| |
|
| }; |
}; |
| |
|
| Line 225 struct cfg_context { |
|
| Line 225 struct cfg_context { |
|
| int end_pos; |
int end_pos; |
| char *filename; |
char *filename; |
| |
|
| |
FILE *fhandle; |
| |
|
| /* Array of strings prefixes which forces to stop config file parsing. */ |
/* Array of strings prefixes which forces to stop config file parsing. */ |
| char **file_stop_str; |
char **file_stop_str; /* default: "[" */ |
| |
|
| /* Array of string prefixes which mark comment line. */ |
/* Array of string prefixes which mark comment line. */ |
| char **comment_str; |
char **comment_str; /* defaults: "#", ";" */ |
| |
|
| /* Option argument separator. */ |
/* Option argument separator. */ |
| char **file_option_arg_separator; /* default: "=" */ |
char **file_option_arg_separator; /* default: "=" */ |
| Line 237 struct cfg_context { |
|
| Line 239 struct cfg_context { |
|
| |
|
| typedef struct cfg_context* CFG_CONTEXT; |
typedef struct cfg_context* CFG_CONTEXT; |
| |
|
| /* Getting & modifying context functions. */ |
/* |
| |
* Functions |
| CFG_CONTEXT cfg_get_context( |
*/ |
| struct cfg_option *options |
|
| ); |
#ifdef __cplusplus |
| |
extern "C" { |
| CFG_CONTEXT cfg_get_cmdline_context( |
#endif |
| int argc, |
|
| char **argv, |
/* Getting & modifying context functions. */ |
| struct cfg_option *options |
|
| ); |
CFG_CONTEXT cfg_get_context( |
| |
struct cfg_option *options |
| CFG_CONTEXT cfg_get_cfgfile_context( |
); |
| int begin_pos, |
|
| int end_pos, |
CFG_CONTEXT cfg_get_cmdline_context( |
| char *filename, |
int argc, |
| struct cfg_option *options |
char **argv, |
| ); |
struct cfg_option *options |
| |
); |
| void cfg_set_cmdline_context( |
|
| const CFG_CONTEXT con, |
CFG_CONTEXT cfg_get_cfgfile_context( |
| int argc, |
int begin_pos, |
| char **argv |
int end_pos, |
| ); |
char *filename, |
| |
struct cfg_option *options |
| void cfg_set_cfgfile_context( |
); |
| const CFG_CONTEXT con, |
|
| int begin_pos, |
void cfg_set_cmdline_context( |
| int end_pos, |
const CFG_CONTEXT con, |
| char *filename |
int argc, |
| ); |
char **argv |
| |
); |
| /* Context flags & special properties manipulation. */ |
|
| |
void cfg_set_cfgfile_context( |
| void cfg_set_context_flags( |
const CFG_CONTEXT con, |
| const CFG_CONTEXT con, |
int begin_pos, |
| int flags |
int end_pos, |
| ); |
char *filename |
| |
); |
| void cfg_clear_cmdline_stop_str( |
|
| const CFG_CONTEXT con |
/* Context flags & special properties manipulation. */ |
| ); |
|
| |
void cfg_set_context_flags( |
| void cfg_add_cmdline_stop_str( |
const CFG_CONTEXT con, |
| const CFG_CONTEXT con, |
int flags |
| char *str |
); |
| ); |
|
| |
void cfg_clear_cmdline_stop_str( |
| void cfg_clear_cfgfile_stop_str( |
const CFG_CONTEXT con |
| const CFG_CONTEXT con |
); |
| ); |
|
| |
void cfg_add_cmdline_stop_str( |
| void cfg_add_cfgfile_stop_str( |
const CFG_CONTEXT con, |
| const CFG_CONTEXT con, |
char *str |
| char *str |
); |
| ); |
|
| |
void cfg_clear_cfgfile_stop_str( |
| void cfg_clear_cfgfile_comment_str( |
const CFG_CONTEXT con |
| const CFG_CONTEXT con |
); |
| ); |
|
| |
void cfg_add_cfgfile_stop_str( |
| void cfg_add_cfgfile_comment_str( |
const CFG_CONTEXT con, |
| const CFG_CONTEXT con, |
char *str |
| char *str |
); |
| ); |
|
| |
void cfg_clear_cfgfile_comment_str( |
| void cfg_clear_cmdline_short_option_prefix( |
const CFG_CONTEXT con |
| const CFG_CONTEXT con |
); |
| ); |
|
| |
void cfg_add_cfgfile_comment_str( |
| void cfg_add_cmdline_short_option_prefix( |
const CFG_CONTEXT con, |
| const CFG_CONTEXT con, |
char *str |
| char *str |
); |
| ); |
|
| |
void cfg_clear_cmdline_short_option_prefix( |
| void cfg_clear_cmdline_long_option_prefix( |
const CFG_CONTEXT con |
| const CFG_CONTEXT con |
); |
| ); |
|
| |
void cfg_add_cmdline_short_option_prefix( |
| void cfg_add_cmdline_long_option_prefix( |
const CFG_CONTEXT con, |
| const CFG_CONTEXT con, |
char *str |
| char *str |
); |
| ); |
|
| |
void cfg_clear_cmdline_long_option_prefix( |
| void cfg_clear_cmdline_option_arg_separator( |
const CFG_CONTEXT con |
| const CFG_CONTEXT con |
); |
| ); |
|
| |
void cfg_add_cmdline_long_option_prefix( |
| void cfg_add_cmdline_option_arg_separator( |
const CFG_CONTEXT con, |
| const CFG_CONTEXT con, |
char *str |
| char *str |
); |
| ); |
|
| |
void cfg_clear_cmdline_option_arg_separator( |
| void cfg_clear_cfgfile_option_arg_separator( |
const CFG_CONTEXT con |
| const CFG_CONTEXT con |
); |
| ); |
|
| |
void cfg_add_cmdline_option_arg_separator( |
| void cfg_add_cfgfile_option_arg_separator( |
const CFG_CONTEXT con, |
| const CFG_CONTEXT con, |
char *str |
| char *str |
); |
| ); |
|
| |
void cfg_clear_cfgfile_option_arg_separator( |
| |
const CFG_CONTEXT con |
| /* Processing context options. */ |
); |
| |
|
| int cfg_parse( |
void cfg_add_cfgfile_option_arg_separator( |
| const CFG_CONTEXT con |
const CFG_CONTEXT con, |
| ); |
char *str |
| |
); |
| int cfg_get_next_opt( |
|
| const CFG_CONTEXT con |
|
| ); |
/* Processing context options. */ |
| |
|
| int cfg_get_opt_arg( |
int cfg_parse( |
| const CFG_CONTEXT con |
const CFG_CONTEXT con |
| ); |
); |
| |
|
| /* Reseting context. */ |
int cfg_get_next_opt( |
| |
const CFG_CONTEXT con |
| void cfg_reset_context( |
); |
| const CFG_CONTEXT con |
|
| ); |
int cfg_get_opt_arg( |
| |
const CFG_CONTEXT con |
| /* Freeing context. */ |
); |
| |
|
| void cfg_free_context( |
/* Reseting context. */ |
| const CFG_CONTEXT con |
|
| ); |
void cfg_reset_context( |
| |
const CFG_CONTEXT con |
| |
); |
| |
|
| |
/* Freeing context. */ |
| |
|
| |
void cfg_free_context( |
| |
const CFG_CONTEXT con |
| |
); |
| |
|
| |
#ifdef __cplusplus |
| |
} |
| |
#endif |
| |
|
| #endif /* _CFG_H */ |
#endif /* _CFG_H */ |
| |
|