#include #include "etoile.h" #include #include #include #include "t1font.h" // or why use lex when.. void about_error(char *format, ...); int nump=0; parameters *ps=0; parameters p; extern char *configfilename; extern int IKnowAboutConfigFile; parameters p_parsed; static int newconfig = 1; enum { INT, STR, FLOAT, CHAR }; struct param_params{ char *pname; int type; void * where; }; param_params pp[] = { { "name", STR, &p_parsed.name }, { "key", CHAR, &p_parsed.key }, { "mode", INT, &p_parsed.mode }, { "k", FLOAT, &p_parsed.k }, { "d0min", FLOAT, &p_parsed.d0min }, { "d1", FLOAT, &p_parsed.d1 }, { "ag", FLOAT, &p_parsed.ag }, { "agnumparts", INT, &p_parsed.agnumparts }, { "antigorder", INT, &p_parsed.antigorder }, { "maxantig", FLOAT, &p_parsed.maxantig }, { "noagexplosion", INT, &p_parsed.noagexplosion }, { "dancingpart", FLOAT, &p_parsed.dancingpart }, { "dancingpartk", INT, &p_parsed.dancingpartk }, { "velocity", FLOAT, &p_parsed.velocity }, { "numfrq", INT, &p_parsed.numfrq }, { "visc", FLOAT, &p_parsed.visc }, { "rotspeed1", FLOAT, &p_parsed.rotspeed1 }, { "rotspeed2", FLOAT, &p_parsed.rotspeed2 }, { "strombo", FLOAT, &p_parsed.strombo }, { "numpart", INT, &p_parsed.numpart}, { "size", FLOAT, &p_parsed.size}, { "sizeloudness", FLOAT, &p_parsed.sizeloudness}, { "chance", INT, &p_parsed.chance }, { "duration_f", INT, &p_parsed.duration_f }, { "duration_b", INT, &p_parsed.duration_b }, { "MaxParticles", INT, &ptsNumMax }, { "IKnowAboutConfigFile", INT, &IKnowAboutConfigFile }, }; int numpp= sizeof(pp)/sizeof(pp[0]); char *nextword(char * &ptr) { char *deb; while ( *ptr==' ' || *ptr=='\t') ptr++; deb = ptr; while ( *ptr!=' ' && *ptr!='\t' && *ptr!='\0' && *ptr!='\n') ptr++; if(*ptr!=0) *ptr++ = 0; return deb; } void freeparams() { for(int i=0;i