7
typedef struct arg_node_def
10
struct arg_node_def *next;
13
static arg_node *arg_node_root = 0;
14
static arg_node *arg_node_tail = 0;
17
static void AddParam(char *s)
21
node = malloc(sizeof(arg_node));
24
node->param = malloc(strlen(s)+1);
25
strcpy(node->param, s);
27
if(arg_node_tail == 0)
33
arg_node_tail->next = node;
38
void LoadConfigurationFile(char *s, int err)
42
arg_node *node, *node2;
47
strncpy(file, s, 121);
50
in = fopen(file, "rt");
55
fprintf(stderr, "Could not find configuration file %s.\n", file);
63
arg_node_root = arg_node_root->next;
70
node2 = arg_node_tail;
75
while(fgets(line, 256, in) != 0)
96
arg_node_tail->next = node;
99
arg_node_tail = node2;
104
void LoadConfiguration(int argc, char *argv[])
108
for(n = 0; n < argc; n++)
112
char *WalkConfiguration()
119
arg_node_root = arg_node_root->next;
125
if (arg_node_root == 0)
131
return arg_node_root->param;