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.
27 lines
505 B
27 lines
505 B
9 years ago
|
#include "init.h"
|
||
|
#include "debug.h"
|
||
|
#include "parser/lexical.h"
|
||
|
#include "parser/parser.h"
|
||
|
|
||
|
int ParseConfigFile(char* config)
|
||
|
{
|
||
|
yyscan_t scanner;
|
||
|
struct lexical_extra extra;
|
||
|
FILE* conffd;
|
||
|
|
||
|
conffd=fopen(config,"r");
|
||
|
if(conffd==0)
|
||
|
{
|
||
|
COUT(ERROR)<<"Can't open file "<<config<<std::endl;
|
||
|
return 1;
|
||
|
}
|
||
|
extra.filename=config;
|
||
|
extra.inclevel=0;
|
||
|
extra.maxinclevel=10;
|
||
|
conflex_init_extra(&extra,&scanner);
|
||
|
confset_in(conffd,scanner);
|
||
|
conflex(scanner);
|
||
|
conflex_destroy(scanner);
|
||
|
fclose(conffd);
|
||
|
}
|