Monitoring du Phytotron
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

61 lines
922 B

/*
* parseconf
*/
#include <stdio.h>
#include <string.h>
#include "config.h"
extern int verbosity;
extern Configuration config;
/* ---------------------------------------------------------------- */
int parse_config(char *fname, int flags)
{
FILE *fp;
char line[SZ_STRINGS+1];
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( '%s' $%x )\n", fname, flags);
#endif
config.valid = 49;
if (NULL==(fp=fopen(fname, "r"))) {
perror(fname);
return -2;
}
while (fgets(line, SZ_STRINGS, fp))
{
/* massage the end of line */
/* skip comments */
/* seek for keyword */
}
fclose(fp);
return -1;
}
/* ---------------------------------------------------------------- */
int show_config(char *title)
{
if (verbosity) {
printf("********** %s **********\n", title);
}
printf("valid %d\n", config.valid);
puts("");
return 0;
}
/* ---------------------------------------------------------------- */