| version 1.47, 2002/07/16 13:42:11 |
version 1.48, 2002/07/18 22:16:30 |
|
|
| * ____________________________________________________________ |
* ____________________________________________________________ |
| * |
* |
| * Developed by Ondrej Jombik <nepto@pobox.sk> |
* Developed by Ondrej Jombik <nepto@pobox.sk> |
| * and Lubomir Host <rajo@host.sk> |
* and Lubomir Host <rajo@host.sk> |
| * Copyright (c) 2001-2002 Platon SDG, http://www.platon.sk/ |
* Copyright (c) 2001-2002 Platon SDG, http://www.platon.sk/ |
| * All rights reserved. |
* All rights reserved. |
| * |
* |
|
|
| #include "shared.h" |
#include "shared.h" |
| /* }}} */ |
/* }}} */ |
| |
|
| /* extern char ***cfg_default_properties; */ |
|
| extern char *cfg_default_properties[CFG_N_PROPS][4]; |
extern char *cfg_default_properties[CFG_N_PROPS][4]; |
| |
|
| CFG_CONTEXT |
CFG_CONTEXT |
| Line 98 cfg_get_cmdline_context(begin_pos, size, |
|
| Line 97 cfg_get_cmdline_context(begin_pos, size, |
|
| } /* }}} */ |
} /* }}} */ |
| |
|
| CFG_CONTEXT |
CFG_CONTEXT |
| |
cfg_get_cmdline_context_argc(argc, argv, options) |
| |
int argc; |
| |
char **argv; |
| |
struct cfg_option *options; |
| |
{ /* {{{ */ |
| |
CFG_CONTEXT con; |
| |
|
| |
/* Starting from the beginning and parsing till the end */ |
| |
con = cfg_get_cmdline_context((long) 0, (long) argc, argv, options); |
| |
if (con == NULL) |
| |
return con; |
| |
|
| |
/* When parsing by argc/argv we must skip first argument argv[0], |
| |
because there is the name of program. */ |
| |
cfg_set_context_flag(con, CFG_SKIP_FIRST); |
| |
|
| |
return con; |
| |
} /* }}} */ |
| |
|
| |
CFG_CONTEXT |
| cfg_get_cfgfile_context(begin_pos, size, filename, options) |
cfg_get_cfgfile_context(begin_pos, size, filename, options) |
| long begin_pos; |
long begin_pos; |
| long size; |
long size; |
| Line 129 cfg_set_cmdline_context(con, begin_pos, |
|
| Line 148 cfg_set_cmdline_context(con, begin_pos, |
|
| con->size = size; |
con->size = size; |
| con->argv = argv; |
con->argv = argv; |
| |
|
| /* TODO: move this stuff to particular parsing function */ |
} /* }}} */ |
| /* con->cur_idx = 0; |
|
| con->cur_idx_tmp = 0; |
void |
| con->cur_idx_tmp += con->begin_pos; */ |
cfg_set_cmdline_context_argc(con, argc, argv) |
| |
const CFG_CONTEXT con; |
| |
int argc; |
| |
char **argv; |
| |
{ /* {{{ */ |
| |
|
| |
/* This function could be macro. But appropriate `get' equivalent, function |
| |
cfg_get_cmdline_context_argc(), is in fact function. So this is function |
| |
analogically too. */ |
| |
|
| |
cfg_set_cmdline_context(con, (long) 0, (long) argc, argv); |
| |
|
| } /* }}} */ |
} /* }}} */ |
| |
|
| void |
void |