| version 1.26, 2002/07/15 18:57:54 |
version 1.27, 2002/07/16 13:42:11 |
|
|
| * ____________________________________________________________ |
* ____________________________________________________________ |
| * |
* |
| * 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. |
| * |
* |
| Line 54 cfg_cmdline_get_next_opt(con) |
|
| Line 54 cfg_cmdline_get_next_opt(con) |
|
| |
|
| con->error_code = CFG_OK; |
con->error_code = CFG_OK; |
| |
|
| |
/* Initial position seek */ |
| |
if (! con->parsing_started) { |
| |
con->parsing_started = 1; |
| |
|
| |
if (con->begin_pos < 0) { |
| |
con->error_code = CFG_ERROR_SEEK_ERROR; |
| |
return con->error_code; |
| |
} |
| |
|
| |
if (con->begin_pos > 0) { |
| |
for (; con->cur_idx < con->begin_pos; con->cur_idx++) |
| |
if (con->argv[con->cur_idx] == NULL) { |
| |
con->error_code = CFG_ERROR_SEEK_ERROR; |
| |
return con->error_code; |
| |
} |
| |
} |
| |
|
| |
if (con->flags & CFG_SKIP_FIRST) |
| |
con->cur_idx_tmp = 1; |
| |
else |
| |
con->cur_idx_tmp = 0; |
| |
} |
| |
|
| |
/* |
| |
* Main loop |
| |
*/ |
| while (1) { |
while (1) { |
| |
|
| arg_used = 0; |
arg_used = 0; |
| Line 63 cfg_cmdline_get_next_opt(con) |
|
| Line 89 cfg_cmdline_get_next_opt(con) |
|
| if (con->argv[con->cur_idx] == NULL) |
if (con->argv[con->cur_idx] == NULL) |
| break; |
break; |
| |
|
| /* Finished? */ |
/* Finished? (size is reached) */ |
| if ((con->end_pos >= con->begin_pos && con->cur_idx > con->end_pos) |
if (con->size >= 0 && con->cur_idx >= con->begin_pos + con->size) |
| || con->argv[con->cur_idx] == NULL) |
break; |
| |
|
| |
/* Finished? (NULL is detected) */ |
| |
if (con->argv[con->cur_idx] == NULL) |
| break; |
break; |
| |
|
| if (con->cur_opt_type & CFG_SHORT_OPTIONS) { |
if (con->cur_opt_type & CFG_SHORT_OPTIONS) { |