Mercurial > cgi-bin > hgwebdir.cgi > PR > Applications > HWSim > HWSim__PingPong__HWDef
view src/Application/main.c @ 0:8ea476474093
Initial add -- gobbeldegook
| author | Me@portablequad |
|---|---|
| date | Mon, 07 Nov 2011 16:03:01 -0800 |
| parents | |
| children | 7566745e812a |
line source
1 /*
3 * Copyright Oct 24, 2009 OpenSourceStewardshipFoundation.org
5 * Licensed under GNU General Public License version 2
7 *
9 * author seanhalle@yahoo.com
11 */
15 #include <malloc.h>
17 #include <stdlib.h>
21 #include "SimParams.h"
23 #include "HWSim_TeraFlux/HWSim_TeraFlux.h"
27 /**
29 *
31 */
33 int main( int argc, char **argv )
35 { SimulationParams *simParams;
37 SimulationResults *simResults;
39 ParamBag *paramBag;
43 printf( "arguments: %s | %s\n", argv[0], argv[1] );
47 simParams = malloc( sizeof(SimulationParams) );
53 //VMS has its own separate internal malloc, so to get results out,
55 // have to pass in empty array for it to fill up
57 //The alternative is internally telling HWSim make external space to use
59 simResults = malloc( sizeof(SimulationResults) );
61 simParams->simResults = simResults;
65 paramBag = makeParamBag();
69 readParamFileIntoBag( argv[1], paramBag );
71 fill_sim_params_from_bag( simParams, paramBag );
77 constructAndSimulateSystem( simParams );
81 printSimResults( simResults );
85 fflush(stdin);
89 exit(0); //cleans up
91 }
