| verzia 1.13, 2001/12/08 18:23:52 |
verzia 1.14, 2001/12/09 15:07:37 |
|
|
| static int cfg_cmdline_get_next_opt(const CFG_CONTEXT con); |
static int cfg_cmdline_get_next_opt(const CFG_CONTEXT con); |
| static int process_currents(const CFG_CONTEXT con, int *ret_val, int *arg_used); |
static int process_currents(const CFG_CONTEXT con, int *ret_val, int *arg_used); |
| static void free_currents(const CFG_CONTEXT con); |
static void free_currents(const CFG_CONTEXT con); |
| static int set_currents(const CFG_CONTEXT con); |
static int cmdline_set_currents(const CFG_CONTEXT con); |
| static int search_cur_opt_idx(const CFG_CONTEXT con); |
static int search_cur_opt_idx(const CFG_CONTEXT con); |
| static int add_to_used_opt_idx(const CFG_CONTEXT con, int opt_idx); |
static int add_to_used_opt_idx(const CFG_CONTEXT con, int opt_idx); |
| static int store_multi_arg(const int type, const char **multi_arg, void ***ar); |
static int store_multi_arg(const int type, const char **multi_arg, void ***ar); |
| Riadok 71 static int cfg_cmdline_get_next_opt(cons |
|
| Riadok 71 static int cfg_cmdline_get_next_opt(cons |
|
| if (! strdyn_compare(con->line_stop_str, con->argv[con->cur_idx])) |
if (! strdyn_compare(con->line_stop_str, con->argv[con->cur_idx])) |
| return CFG_ERROR_STOP_STR_FOUND; |
return CFG_ERROR_STOP_STR_FOUND; |
| |
|
| /* Skip option analyze in set_currents(), count it as leftover. */ |
/* Skip option analyze in cmdline_set_currents(), |
| |
count it as leftover. */ |
| if (leftover_init) { |
if (leftover_init) { |
| con->cur_opt_type = CFG_NONE_OPTION; |
con->cur_opt_type = CFG_NONE_OPTION; |
| con->cur_opt = NULL; |
con->cur_opt = NULL; |
| Riadok 79 static int cfg_cmdline_get_next_opt(cons |
|
| Riadok 80 static int cfg_cmdline_get_next_opt(cons |
|
| return CFG_ERROR_NOMEM; |
return CFG_ERROR_NOMEM; |
| } |
} |
| else { |
else { |
| if (set_currents(con) == 0) |
if (cmdline_set_currents(con) == 0) |
| return CFG_ERROR_NOMEM; |
return CFG_ERROR_NOMEM; |
| } |
} |
| } |
} |
| Riadok 301 static void free_currents(const CFG_CONT |
|
| Riadok 302 static void free_currents(const CFG_CONT |
|
| |
|
| |
|
| /* |
/* |
| * set_curents() |
* cmdline_set_curents() |
| * |
* |
| * Function allocate and initialize variables con->cur_opt and con->cur_arg |
* Function allocate and initialize variables con->cur_opt and con->cur_arg |
| * according to con->argv[con->cur_idx]. |
* according to con->argv[con->cur_idx]. |
| * Returns 1 on success, 0 on error (not enough memory). |
* Returns 1 on success, 0 on error (not enough memory). |
| */ |
*/ |
| |
|
| static int set_currents(const CFG_CONTEXT con) |
static int cmdline_set_currents(const CFG_CONTEXT con) |
| { |
{ |
| register int i, size; |
register int i, size; |
| register char *s, *s_sep, *s_tmp; |
register char *s, *s_sep, *s_tmp; |