cuikequations.c
Go to the documentation of this file.
1 #include "parameters.h"
2 #include "defines.h"
3 #include "world.h"
4 #include "error.h"
5 #include "filename.h"
6 
7 #include <stdlib.h>
8 #include <string.h>
9 
63 int main(int argc, char **arg)
64 {
65  Tparameters parameters; /* Parameters */
66  Tworld world; /* Environemtn and mechanisms */
67 
68  Tfilename fparam;
69 
70  if (argc>1)
71  {
72  /*Init parameters*/
73  CreateFileName(NULL,arg[1],NULL,PARAM_EXT,&fparam);
74  #if (_DEBUG>0)
75  printf("Reading parameter file : %s\n",GetFileFullName(&fparam));
76  #endif
77  InitParametersFromFile(GetFileFullName(&fparam),&parameters);
78 
79  /*Init world*/
80  InitWorldFromFile(&parameters,FALSE,TRUE,arg[1],&world);
81 
82  PrintWorldCS(&parameters,arg[1],&world);
83 
84  /* Delete the data structures */
85  DeleteWorld(&world);
86  DeleteParameters(&parameters);
87 
88  /* Delete the file names */
89  DeleteFileName(&fparam);
90  }
91  else
92  {
93  fprintf(stderr," Wrong number of parameters.\n");
94  fprintf(stderr," Use:\n");
95  fprintf(stderr," cuikequations <Sing> <problem name>\n");
96  fprintf(stderr," where \n");
97  fprintf(stderr," <problem name> is the world file from which to generate the equations\n");
98  }
99 
100  return(EXIT_SUCCESS);
101 }
102