| version 1.11, 2002/02/19 14:41:08 |
version 1.12, 2002/02/20 14:16:44 |
| Line 67 static struct cfg_option global_options[ |
|
| Line 67 static struct cfg_option global_options[ |
|
| static struct cfg_option process_options[] = { |
static struct cfg_option process_options[] = { |
| {"nice", 'N', "nice", CFG_INT, (void *) &(process_cfg.nice), 0}, |
{"nice", 'N', "nice", CFG_INT, (void *) &(process_cfg.nice), 0}, |
| {"name", 'n', "name", CFG_STRING+CFG_MULTI_SEPARATED, (void *) &(process_cfg.name), 0}, |
{"name", 'n', "name", CFG_STRING+CFG_MULTI_SEPARATED, (void *) &(process_cfg.name), 0}, |
| {"input", 'i', "input", CFG_STRING+CFG_MULTI_SEPARATED, (void *) &(process_cfg.fd[0]), 0}, |
{"input", 'i', "input", CFG_STRING+CFG_MULTI_SEPARATED, (void *) &(process_cfg.fd_str[0]), 0}, |
| {"output", 'o', "output", CFG_STRING+CFG_MULTI_SEPARATED, (void *) &(process_cfg.fd[1]), 0}, |
{"output", 'o', "output", CFG_STRING+CFG_MULTI_SEPARATED, (void *) &(process_cfg.fd_str[1]), 0}, |
| {"errput", 'e', "errput", CFG_STRING+CFG_MULTI_SEPARATED, (void *) &(process_cfg.fd[2]), 0}, |
{"errput", 'e', "errput", CFG_STRING+CFG_MULTI_SEPARATED, (void *) &(process_cfg.fd_str[2]), 0}, |
| {NULL, '\0', "command", CFG_LEFTOVER_ARGS+CFG_STRING+CFG_MULTI, (void *) &(process_cfg.argv), 0}, |
{NULL, '\0', "command", CFG_LEFTOVER_ARGS+CFG_STRING+CFG_MULTI, (void *) &(process_cfg.argv), 0}, |
| CFG_END_OF_LIST |
CFG_END_OF_LIST |
| }; |
}; |
| Line 99 static int add_processes_to_processes( |
|
| Line 99 static int add_processes_to_processes( |
|
| |
|
| PROCTABLE conf_parse_all(int argc, char **argv) |
PROCTABLE conf_parse_all(int argc, char **argv) |
| { |
{ |
| |
|
| register int ret, i; |
register int ret, i; |
| struct conf_struct_global *global; |
struct conf_struct_global *global; |
| struct conf_struct_global *global_work; |
struct conf_struct_global *global_work; |
| struct conf_struct_process **processes; |
struct conf_struct_process **processes; |
| struct conf_struct_process **processes_work; |
struct conf_struct_process **processes_work; |
| |
/* int *start_idx; */ |
| |
|
| ret = conf_cmdline_parse(argc - 1, argv + 1, &global, &processes); |
ret = conf_cmdline_parse(argc - 1, argv + 1, &global, &processes); |
| |
|
| Line 131 PROCTABLE conf_parse_all(int argc, char |
|
| Line 131 PROCTABLE conf_parse_all(int argc, char |
|
| } |
} |
| |
|
| #if DEBUG |
#if DEBUG |
| msg_debug_print("conf_parse_all(): parsing '%s'\n", filename); |
msg_debug_print("conf_parse_all(): parsing file '%s'\n", filename); |
| #endif |
#endif |
| |
|
| ret = conf_cfgfile_parse(filename, &global_work, &processes_work); |
ret = conf_cfgfile_parse(filename, &global_work, &processes_work); |
| Line 164 PROCTABLE conf_parse_all(int argc, char |
|
| Line 164 PROCTABLE conf_parse_all(int argc, char |
|
| #if DEBUG |
#if DEBUG |
| { |
{ |
| register int i; |
register int i; |
| |
register char *names; |
| |
register char *argvs; |
| |
|
| msg_debug_print("conf_parse_all(): ret = %d\n", ret); |
msg_debug_print("conf_parse_all(): ret = %d\n", ret); |
| |
|
| msg_debug_print("verbose = %d\n", global->verbose); |
msg_debug_print("verbose = %d\n", global->verbose); |
| |
|
| for (i = 0; processes != NULL && processes[i] != NULL; i++) { |
for (i = 0; processes != NULL && processes[i] != NULL; i++) { |
| msg_debug_print("[%d] %s, %d\n", i, |
|
| processes[i]->name != NULL ? processes[i]->name[0] : "NULL", |
if (processes[i]->name != NULL) |
| processes[i]->nice); |
names = strdyn_implode_str(processes[i]->name, ", "); |
| |
else |
| |
names = strdup("-- N/A --"); |
| |
|
| |
if (processes[i]->argv != NULL) |
| |
argvs = strdyn_implode_str(processes[i]->argv, " "); |
| |
else |
| |
argvs = strdup("-- N/A --"); |
| |
|
| |
msg_debug_print("Process %d\n NAMES: %s\n ARGVS: %s\n", |
| |
i, names, argvs); |
| |
|
| |
free(names); |
| |
free(argvs); |
| } |
} |
| } |
} |
| #endif |
#endif |