/*@@ @file ProcessParameterDatabase.c @date Thu Sep 24 10:34:46 1998 @author Tom Goodale @desc Routines to determine the parameters and store them. @enddesc @version $Header$ @@*/ #include #include #include "cctk_Flesh.h" #include "cctk_Parameter.h" #include "cctki_Parameter.h" #include "ParameterData.h" static char *rcsid = "$Header$"; CCTK_FILEVERSION(main_ProcessParameterDatabase_c) /******************************************************************** ********************* Local Data Types *********************** ********************************************************************/ /******************************************************************** ********************* Local Routine Prototypes ********************* ********************************************************************/ /******************************************************************** ********************* Other Routine Prototypes ********************* ********************************************************************/ int ParseFile(FILE *ifp, int (*set_function)(const char *, const char *),tFleshConfig *ConfigData); void CCTKi_SetParameterSetMask(int mask); /******************************************************************** ********************* Local Data ***************************** ********************************************************************/ /******************************************************************** ********************* External Routines ********************** ********************************************************************/ /*@@ @routine CCTKi_ProcessParameterDatabase @date Thu Sep 24 10:37:07 1998 @author Tom Goodale @desc @enddesc @calls CCTKi_SetParameterSetMask ParseFile @calledby @history @endhistory @var ConfigData @vdesc Flesh configuration data @vtype tFleshConfig @vio inout @vcomment @endvar @returntype int @returndesc 0 - success 1 - unable to open parameter file @endreturndesc @@*/ int CCTKi_ProcessParameterDatabase(tFleshConfig *ConfigData) { int retval; FILE *parameter_file; CCTKi_SetParameterSetMask(PARAMETER_RECOVERY_PRE); if(!strcmp(ConfigData->parameter_file_name,"-")) { parameter_file = stdin; } else { parameter_file = fopen(ConfigData->parameter_file_name, "r"); } if(parameter_file) { ParseFile(parameter_file, CCTKi_SetParameter, ConfigData); if(strcmp(ConfigData->parameter_file_name,"-")) { fclose(parameter_file); } retval = 0; } else { fprintf(stderr, "Unable to open parameter file '%s'\n", ConfigData->parameter_file_name); retval = 1; } return retval; } /******************************************************************** ********************* Local Routines ************************* ********************************************************************/