Go to the documentation of this file.
19 int cp, t_p, t_f, e_p, e_f;
24 if ((cfg_file = fopen(fname,
"r")) ==
NULL) {
25 printf(
"loadconfig: File %s was not found\n", fname);
30 while (!feof(cfg_file)) {
33 cp = strlen(
line) - 1;
35 if (
line[cp] ==
'\n')
line[cp] =
'\0';
44 for (cp = 0; cp < strlen(
line); cp++) {
72 fprintf(
stderr,
"Entry %s not found in configuration file\n", tok);
89 fprintf(
stderr,
"Entry %s not found in configuration file\n", tok);
106 fprintf(
stderr,
"Entry %s not found in configuration file\n", tok);
128 fprintf(
stderr,
"Entry %s not found in configuration file\n", tok);
135 p = strtok(tmp_entry,
",");
137 tmp_arr = calloc(
MAX_ARR,
sizeof (
float));
140 tmp_arr[n_arr] = (
float) atof(
p);
141 p = strtok(
NULL,
",");
void loadconfig(char *fname)
int get_cfg_i(char *tok, char *fname)
float * get_cfg_array(char *tok, char *fname)
struct tab_atom cfg_tab[MAX_TAB]
char * get_cfg_s(char *tok, char *fname)
float get_cfg_f(char *tok, char *fname)
How many dimensions is the output array Default is Not sure if anything above will work correctly strcpy(l2prod->title, "no title yet")