Changeset 17672 for branches/eam_branch_20080511/ppSim/src/ppSim.c
- Timestamp:
- May 13, 2008, 4:56:38 PM (18 years ago)
- File:
-
- 1 edited
-
branches/eam_branch_20080511/ppSim/src/ppSim.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20080511/ppSim/src/ppSim.c
r17615 r17672 1 1 # include "ppSim.h" 2 3 int failure (pmConfig *config, psExit status, char *message) { 4 psErrorStackPrint(stderr, message); 5 psFree(config); 6 pmModelClassCleanup(); 7 psLibFinalize(); 8 exit (status); 9 } 2 10 3 11 int main(int argc, char *argv[]) … … 8 16 pmConfig *config = pmConfigRead(&argc, argv, PPSIM_RECIPE); // Configuration 9 17 if (!config) { 10 psErrorStackPrint(stderr, "Unable to read configurations."); 11 exit(PS_EXIT_CONFIG_ERROR); 18 failure (config, PS_EXIT_CONFIG_ERROR, "Unable to read configurations."); 12 19 } 13 20 14 ppSimArguments(argc, argv, config); 21 if (!ppSimArguments(argc, argv, config)) { 22 failure (config, PS_EXIT_CONFIG_ERROR, "Error parsing command-line arguments"); 23 } 15 24 16 25 if (!ppSimCreate(config)) { 17 psErrorStackPrint(stderr, "Unable to create output file."); 18 psFree(config); 19 exit(PS_EXIT_CONFIG_ERROR); 26 failure (config, PS_EXIT_CONFIG_ERROR, "Unable to create output file."); 20 27 } 21 28 22 29 if (!ppSimLoop(config)) { 23 psErrorStackPrint(stderr, "Unable to generate data."); 24 psFree(config); 25 exit(PS_EXIT_SYS_ERROR); 30 failure (config, PS_EXIT_SYS_ERROR, "Unable to generate data."); 26 31 } 27 32 … … 32 37 psLibFinalize(); 33 38 34 return PS_EXIT_SUCCESS;39 exit (PS_EXIT_SUCCESS); 35 40 }
Note:
See TracChangeset
for help on using the changeset viewer.
