more flexible handling of startup XML's
This commit is contained in:
@ -97,22 +97,11 @@ int main(int argc, char *argv[])
|
||||
return PMUSR_WRONG_STARTUP_SYNTAX;
|
||||
}
|
||||
|
||||
// get default path (for the moment only linux like)
|
||||
char *pmusrpath;
|
||||
char musrpath[128];
|
||||
pmusrpath = getenv("MUSRFITPATH");
|
||||
if (pmusrpath == 0) { // not set, will try default one
|
||||
strcpy(musrpath, "/home/nemu/analysis/bin");
|
||||
cout << endl << "**WARNING** MUSRFITPATH environment variable not set will try " << musrpath << endl;
|
||||
} else {
|
||||
strncpy(musrpath, pmusrpath, sizeof(musrpath));
|
||||
}
|
||||
|
||||
// read startup file
|
||||
char startup_path_name[128];
|
||||
sprintf(startup_path_name, "%s/musrfit_startup.xml", musrpath);
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
PStartupHandler *startupHandler = new PStartupHandler();
|
||||
strcpy(startup_path_name, startupHandler->GetStartupFilePath().Data());
|
||||
saxParser->ConnectToHandler("PStartupHandler", startupHandler);
|
||||
status = saxParser->ParseFile(startup_path_name);
|
||||
// check for parse errors
|
||||
|
Reference in New Issue
Block a user