TheBoussinesqModel  3.2.1
 All Data Structures Files Functions Variables Typedefs Macros Pages
geometry_freememory.c
Go to the documentation of this file.
1 
27 #include "turtle.h"
28 #include "geometry.h"
29 #include "t_datamanipulation.h"
30 #include "geometry_utilities.h"
31 #include "geometry_attribute.h"
32 #include "geometry_freememory.h"
33 
34 void free_point(POINT *P){
43  free(P);
45 
46 }
47 
48 void free_line(LINE *L){
55  free_point(L->begin);
56  free_point(L->end);
57 // if (L->attributes) free_line_attributes(L->attributes);
58 
59  free(L);
60 
61 }
62 
70  free_point(PO->centroid);
72  //if (PO->attributes) free_polygon_attributes(PO->attributes);
73 
74  free(PO);
75 }
76 
84  long i;
85 
86  for (i=lv->nl;i<=lv->nh;i++){
87  free_line(lv->element[i]);
88 
89  }
90  free(lv->element);
91  free(lv);
92 
93 
94 }
95 
103  long i;
104 
105  for (i=pv->nl;i<=pv->nh;i++){
106  free_polygon(pv->element[i]);
107  }
108  free(pv->element);
109  free(pv);
110 
111 
112 }
113 
114 
117 
118  free(point);
119 
120 
121 }
122 
124 
125  free(line);
126 
127 
128 }
129 
131 
132  free(polygon);
133 
134 
135 }
136 
138 
141  free(pca);
142 }
143 
145 
146  long l;
147 
148  if (!pcaa) printf("Error in free_polygon_connection_array: polygon_connection_attribute_array was never allocated! \n");
149  for (l=pcaa->nl;l<=pcaa->nh;l++){
150  if (!pcaa->element[l]) printf("Error in free_poylogon_connection_array: attributes of polygon %ld (of %ld) was never allocated! \n",l,pcaa->nh);
152  }
153  free(pcaa->element);
154  free(pcaa);
155 }