cuikcad.c
Go to the documentation of this file.
1 
2 #include "cuiksystem.h"
3 #include "parameters.h"
4 
5 #include "defines.h"
6 #include "error.h"
7 #include "filename.h"
8 
9 #include <stdlib.h>
10 
43 int main(int argc, char **arg)
44 {
45  TCuikSystem cuiksystem; /* The set of equations */
46  Tparameters parameters; /* Parameters used in the Cuik process */
47 
48  Tfilename fcad;
49  Tfilename fparam;
50 
51 
52  if (argc>1)
53  {
54 
55  /*Init parameters*/
56  CreateFileName(NULL,arg[1],NULL,PARAM_EXT,&fparam);
57  InitParametersFromFile(GetFileFullName(&fparam),&parameters);
58 
59  /*Read the problem from file*/
60  CreateFileName(NULL,arg[1],NULL,CAD_EXT,&fcad);
61 
62  InitCuikSystem(&cuiksystem);
63 
64  Error("Not implemented yet. Sorry....\n");
65 
66  DeleteParameters(&parameters);
67  DeleteCuikSystem(&cuiksystem);
68 
69  DeleteFileName(&fparam);
70  DeleteFileName(&fcad);
71 
72  }
73  else
74  {
75  fprintf(stderr," Wrong number of parameters.\n");
76  fprintf(stderr," Use:\n");
77  fprintf(stderr," cuikcad <problem filename>.cad \n");
78  fprintf(stderr," where <problem filename> contains the CAD information\n");
79  fprintf(stderr," (the '.cad' extension is not required)\n");
80  }
81  return(EXIT_SUCCESS);
82 }
83 
Data structure to hold the information about the name of a file.
Definition: filename.h:248
void DeleteCuikSystem(TCuikSystem *cs)
Destructor.
Definition: cuiksystem.c:5113
Definition of the Tfilename type and the associated functions.
void Error(const char *s)
General error function.
Definition: error.c:80
#define PARAM_EXT
File extension for parameter files.
Definition: filename.h:131
Error and warning functions.
void DeleteFileName(Tfilename *fn)
Destructor.
Definition: filename.c:205
Definitions of constants and macros used in several parts of the cuik library.
void InitCuikSystem(TCuikSystem *cs)
Constructor.
Definition: cuiksystem.c:2155
A table of parameters.
Definition of the TCuikSystem type and the associated functions.
void CreateFileName(char *path, char *name, char *suffix, char *ext, Tfilename *fn)
Constructor.
Definition: filename.c:22
void InitParametersFromFile(char *file, Tparameters *p)
Constructor from a file.
Definition: parameters.c:51
char * GetFileFullName(Tfilename *fn)
Gets the file full name (paht+name+extension).
Definition: filename.c:151
A cuiksystem, i.e., a set of variables and equations defining a position analysis problem...
Definition: cuiksystem.h:181
void DeleteParameters(Tparameters *p)
Destructor.
Definition: parameters.c:295
#define CAD_EXT
File extension for CAD files.
Definition: filename.h:118
int main(int argc, char **arg)
Main body of the cuikcad application.
Definition: cuikcad.c:43
Definition of the Tparameters type and the associated functions.