PIPS
dg.c
Go to the documentation of this file.
1 /*
2  * THIS FILE HAS BEEN AUTOMATICALLY GENERATED BY NEWGEN.
3  *
4  * PLEASE DO NOT MODIFY IT.
5  */
6 
7 typedef void * Ptsg;
8 
9 #include <stdio.h>
10 #include <stdlib.h>
11 #include <string.h>
12 #include "genC.h"
13 #include "dg.h"
14 
15 
16 /* CONE
17  */
19  return (cone) gen_copy_tree((gen_chunk*) p);
20 }
21 void free_cone(cone p) {
22  gen_free((gen_chunk*) p);
23 }
25  return (cone) gen_check((gen_chunk*) p, cone_domain);
26 }
28  check_cone(p);
29  return gen_consistent_p((gen_chunk*) p);
30 }
32  return gen_defined_p((gen_chunk*) p);
33 }
35  return gen_typed_cons(CONE_NEWGEN_DOMAIN, p, l);
36 }
38  check_cone(r);
39  check_cone(v);
40  message_assert("defined references to domain cone",
42  memcpy(r, v, sizeof(struct _newgen_struct_cone_));
43 }
45  // should clear up contents...
46  free(p);
47 }
48 void write_cone(FILE* f, cone p) {
49  gen_write(f, (gen_chunk*) p);
50 }
51 cone read_cone(FILE* f) {
52  return (cone) gen_read(f);
53 }
55  return (cone) gen_alloc(3*sizeof(gen_chunk), GEN_CHECK_ALLOC, cone_domain, a1, a2);
56 }
57 
58 /* CONFLICT
59  */
61  return (conflict) gen_copy_tree((gen_chunk*) p);
62 }
64  gen_free((gen_chunk*) p);
65 }
68 }
70  check_conflict(p);
71  return gen_consistent_p((gen_chunk*) p);
72 }
74  return gen_defined_p((gen_chunk*) p);
75 }
78 }
80  check_conflict(r);
81  check_conflict(v);
82  message_assert("defined references to domain conflict",
84  memcpy(r, v, sizeof(struct _newgen_struct_conflict_));
85 }
87  // should clear up contents...
88  free(p);
89 }
90 void write_conflict(FILE* f, conflict p) {
91  gen_write(f, (gen_chunk*) p);
92 }
94  return (conflict) gen_read(f);
95 }
97  return (conflict) gen_alloc(4*sizeof(gen_chunk), GEN_CHECK_ALLOC, conflict_domain, a1, a2, a3);
98 }
99 
100 /* DG_ARC_LABEL
101  */
103  return (dg_arc_label) gen_copy_tree((gen_chunk*) p);
104 }
106  gen_free((gen_chunk*) p);
107 }
110 }
113  return gen_consistent_p((gen_chunk*) p);
114 }
116  return gen_defined_p((gen_chunk*) p);
117 }
120 }
124  message_assert("defined references to domain dg_arc_label",
126  memcpy(r, v, sizeof(struct _newgen_struct_dg_arc_label_));
127 }
129  // should clear up contents...
130  free(p);
131 }
133  gen_write(f, (gen_chunk*) p);
134 }
136  return (dg_arc_label) gen_read(f);
137 }
140 }
141 
142 /* DG_VERTEX_LABEL
143  */
145  return (dg_vertex_label) gen_copy_tree((gen_chunk*) p);
146 }
148  gen_free((gen_chunk*) p);
149 }
152 }
155  return gen_consistent_p((gen_chunk*) p);
156 }
158  return gen_defined_p((gen_chunk*) p);
159 }
162 }
166  message_assert("defined references to domain dg_vertex_label",
168  memcpy(r, v, sizeof(struct _newgen_struct_dg_vertex_label_));
169 }
171  // should clear up contents...
172  free(p);
173 }
175  gen_write(f, (gen_chunk*) p);
176 }
178  return (dg_vertex_label) gen_read(f);
179 }
182 }
183 
184 /* SCCFLAGS
185  */
187  return (sccflags) gen_copy_tree((gen_chunk*) p);
188 }
190  gen_free((gen_chunk*) p);
191 }
194 }
196  check_sccflags(p);
197  return gen_consistent_p((gen_chunk*) p);
198 }
200  return gen_defined_p((gen_chunk*) p);
201 }
204 }
206  check_sccflags(r);
207  check_sccflags(v);
208  message_assert("defined references to domain sccflags",
210  memcpy(r, v, sizeof(struct _newgen_struct_sccflags_));
211 }
213  // should clear up contents...
214  free(p);
215 }
216 void write_sccflags(FILE* f, sccflags p) {
217  gen_write(f, (gen_chunk*) p);
218 }
220  return (sccflags) gen_read(f);
221 }
223  return (sccflags) gen_alloc(5*sizeof(gen_chunk), GEN_CHECK_ALLOC, sccflags_domain, a1, a2, a3, a4);
224 }
225 
226 /* SCCS
227  */
229  return (sccs) gen_copy_tree((gen_chunk*) p);
230 }
231 void free_sccs(sccs p) {
232  gen_free((gen_chunk*) p);
233 }
235  return (sccs) gen_check((gen_chunk*) p, sccs_domain);
236 }
238  check_sccs(p);
239  return gen_consistent_p((gen_chunk*) p);
240 }
242  return gen_defined_p((gen_chunk*) p);
243 }
245  return gen_typed_cons(SCCS_NEWGEN_DOMAIN, p, l);
246 }
248  check_sccs(r);
249  check_sccs(v);
250  message_assert("defined references to domain sccs",
251  sccs_defined_p(r) && sccs_defined_p(v));
252  memcpy(r, v, sizeof(struct _newgen_struct_sccs_));
253 }
255  // should clear up contents...
256  free(p);
257 }
258 void write_sccs(FILE* f, sccs p) {
259  gen_write(f, (gen_chunk*) p);
260 }
261 sccs read_sccs(FILE* f) {
262  return (sccs) gen_read(f);
263 }
265  return (sccs) gen_alloc(2*sizeof(gen_chunk), GEN_CHECK_ALLOC, sccs_domain, a);
266 }
267 
268 /* SCC
269  */
271  return (scc) gen_copy_tree((gen_chunk*) p);
272 }
273 void free_scc(scc p) {
274  gen_free((gen_chunk*) p);
275 }
277  return (scc) gen_check((gen_chunk*) p, scc_domain);
278 }
280  check_scc(p);
281  return gen_consistent_p((gen_chunk*) p);
282 }
284  return gen_defined_p((gen_chunk*) p);
285 }
287  return gen_typed_cons(SCC_NEWGEN_DOMAIN, p, l);
288 }
290  check_scc(r);
291  check_scc(v);
292  message_assert("defined references to domain scc",
293  scc_defined_p(r) && scc_defined_p(v));
294  memcpy(r, v, sizeof(struct _newgen_struct_scc_));
295 }
297  // should clear up contents...
298  free(p);
299 }
300 void write_scc(FILE* f, scc p) {
301  gen_write(f, (gen_chunk*) p);
302 }
303 scc read_scc(FILE* f) {
304  return (scc) gen_read(f);
305 }
307  return (scc) gen_alloc(3*sizeof(gen_chunk), GEN_CHECK_ALLOC, scc_domain, a1, a2);
308 }
309 
list gen_dg_arc_label_cons(dg_arc_label p, list l)
Definition: dg.c:118
cone read_cone(FILE *f)
Definition: dg.c:51
cone check_cone(cone p)
Definition: dg.c:24
void free_cone(cone p)
Definition: dg.c:21
sccflags copy_sccflags(sccflags p)
SCCFLAGS.
Definition: dg.c:186
bool dg_vertex_label_consistent_p(dg_vertex_label p)
Definition: dg.c:153
dg_arc_label make_dg_arc_label(list a)
Definition: dg.c:138
void sccflags_assign_contents(sccflags r, sccflags v)
Definition: dg.c:205
list gen_cone_cons(cone p, list l)
Definition: dg.c:34
void cone_non_recursive_free(cone p)
Definition: dg.c:44
void sccs_assign_contents(sccs r, sccs v)
Definition: dg.c:247
void write_dg_vertex_label(FILE *f, dg_vertex_label p)
Definition: dg.c:174
void scc_assign_contents(scc r, scc v)
Definition: dg.c:289
void free_conflict(conflict p)
Definition: dg.c:63
conflict make_conflict(effect a1, effect a2, cone a3)
Definition: dg.c:96
bool sccflags_defined_p(sccflags p)
Definition: dg.c:199
sccflags read_sccflags(FILE *f)
Definition: dg.c:219
bool conflict_defined_p(conflict p)
Definition: dg.c:73
void free_sccs(sccs p)
Definition: dg.c:231
list gen_dg_vertex_label_cons(dg_vertex_label p, list l)
Definition: dg.c:160
sccs check_sccs(sccs p)
Definition: dg.c:234
bool dg_arc_label_defined_p(dg_arc_label p)
Definition: dg.c:115
void write_sccflags(FILE *f, sccflags p)
Definition: dg.c:216
dg_arc_label read_dg_arc_label(FILE *f)
Definition: dg.c:135
bool scc_defined_p(scc p)
Definition: dg.c:283
conflict check_conflict(conflict p)
Definition: dg.c:66
void free_dg_arc_label(dg_arc_label p)
Definition: dg.c:105
sccs make_sccs(list a)
Definition: dg.c:264
void conflict_non_recursive_free(conflict p)
Definition: dg.c:86
sccs read_sccs(FILE *f)
Definition: dg.c:261
dg_arc_label check_dg_arc_label(dg_arc_label p)
Definition: dg.c:108
scc copy_scc(scc p)
SCC.
Definition: dg.c:270
conflict copy_conflict(conflict p)
CONFLICT.
Definition: dg.c:60
void dg_arc_label_non_recursive_free(dg_arc_label p)
Definition: dg.c:128
bool cone_defined_p(cone p)
Definition: dg.c:31
bool dg_arc_label_consistent_p(dg_arc_label p)
Definition: dg.c:111
bool sccflags_consistent_p(sccflags p)
Definition: dg.c:195
sccs copy_sccs(sccs p)
SCCS.
Definition: dg.c:228
void write_conflict(FILE *f, conflict p)
Definition: dg.c:90
scc check_scc(scc p)
Definition: dg.c:276
list gen_scc_cons(scc p, list l)
Definition: dg.c:286
void dg_arc_label_assign_contents(dg_arc_label r, dg_arc_label v)
Definition: dg.c:121
cone make_cone(list a1, Ptsg a2)
Definition: dg.c:54
void conflict_assign_contents(conflict r, conflict v)
Definition: dg.c:79
void sccs_non_recursive_free(sccs p)
Definition: dg.c:254
void scc_non_recursive_free(scc p)
Definition: dg.c:296
void write_scc(FILE *f, scc p)
Definition: dg.c:300
void write_dg_arc_label(FILE *f, dg_arc_label p)
Definition: dg.c:132
void dg_vertex_label_non_recursive_free(dg_vertex_label p)
Definition: dg.c:170
bool conflict_consistent_p(conflict p)
Definition: dg.c:69
void cone_assign_contents(cone r, cone v)
Definition: dg.c:37
void free_scc(scc p)
Definition: dg.c:273
conflict read_conflict(FILE *f)
Definition: dg.c:93
bool dg_vertex_label_defined_p(dg_vertex_label p)
Definition: dg.c:157
list gen_sccflags_cons(sccflags p, list l)
Definition: dg.c:202
dg_vertex_label read_dg_vertex_label(FILE *f)
Definition: dg.c:177
dg_vertex_label make_dg_vertex_label(intptr_t a1, sccflags a2)
Definition: dg.c:180
sccflags make_sccflags(scc a1, intptr_t a2, intptr_t a3, intptr_t a4)
Definition: dg.c:222
scc make_scc(list a1, intptr_t a2)
Definition: dg.c:306
cone copy_cone(cone p)
CONE.
Definition: dg.c:18
void free_dg_vertex_label(dg_vertex_label p)
Definition: dg.c:147
list gen_conflict_cons(conflict p, list l)
Definition: dg.c:76
void dg_vertex_label_assign_contents(dg_vertex_label r, dg_vertex_label v)
Definition: dg.c:163
bool cone_consistent_p(cone p)
Definition: dg.c:27
void * Ptsg
Definition: dg.c:7
dg_arc_label copy_dg_arc_label(dg_arc_label p)
DG_ARC_LABEL.
Definition: dg.c:102
void write_cone(FILE *f, cone p)
Definition: dg.c:48
sccflags check_sccflags(sccflags p)
Definition: dg.c:192
dg_vertex_label copy_dg_vertex_label(dg_vertex_label p)
DG_VERTEX_LABEL.
Definition: dg.c:144
void sccflags_non_recursive_free(sccflags p)
Definition: dg.c:212
list gen_sccs_cons(sccs p, list l)
Definition: dg.c:244
bool sccs_defined_p(sccs p)
Definition: dg.c:241
void free_sccflags(sccflags p)
Definition: dg.c:189
dg_vertex_label check_dg_vertex_label(dg_vertex_label p)
Definition: dg.c:150
bool scc_consistent_p(scc p)
Definition: dg.c:279
void write_sccs(FILE *f, sccs p)
Definition: dg.c:258
scc read_scc(FILE *f)
Definition: dg.c:303
bool sccs_consistent_p(sccs p)
Definition: dg.c:237
#define sccflags_domain
newgen_dg_vertex_label_domain_defined
Definition: dg.h:71
#define SCCFLAGS_NEWGEN_DOMAIN
Definition: dg.h:74
#define dg_arc_label_domain
newgen_conflict_domain_defined
Definition: dg.h:55
#define DG_ARC_LABEL_NEWGEN_DOMAIN
Definition: dg.h:58
#define CONFLICT_NEWGEN_DOMAIN
Definition: dg.h:50
#define SCCS_NEWGEN_DOMAIN
Definition: dg.h:82
#define conflict_domain
newgen_cone_domain_defined
Definition: dg.h:47
#define DG_VERTEX_LABEL_NEWGEN_DOMAIN
Definition: dg.h:66
#define sccs_domain
newgen_sccflags_domain_defined
Definition: dg.h:79
#define scc_domain
newgen_sccs_domain_defined
Definition: dg.h:87
#define CONE_NEWGEN_DOMAIN
Definition: dg.h:42
#define dg_vertex_label_domain
newgen_dg_arc_label_domain_defined
Definition: dg.h:63
#define SCC_NEWGEN_DOMAIN
Definition: dg.h:90
#define cone_domain
newgen_Ptsg_domain_defined
Definition: dg.h:39
#define GEN_CHECK_ALLOC
Definition: genC.h:307
void gen_free(gen_chunk *obj)
version without shared_pointers.
Definition: genClib.c:992
gen_chunk * gen_alloc(int size, int gen_check_p, int dom,...)
allocates something in newgen.
Definition: genClib.c:298
int gen_consistent_p(gen_chunk *obj)
GEN_CONSISTENT_P dynamically checks the type correctness of OBJ.
Definition: genClib.c:2398
int gen_defined_p(gen_chunk *obj)
Definition: genClib.c:2438
gen_chunk * gen_check(gen_chunk *obj, int t)
GEN_CHECK checks that the gen_chunk received OBJ is of the appropriate TYPE.
Definition: genClib.c:2356
gen_chunk * gen_read(FILE *file)
GEN_READ reads any object from the FILE stream.
Definition: genClib.c:2323
gen_chunk * gen_copy_tree(gen_chunk *obj)
Definition: genClib.c:1429
void gen_write(FILE *fd, gen_chunk *obj)
GEN_WRITE writes the OBJect on the stream FD.
Definition: genClib.c:1745
void free(void *)
list gen_typed_cons(_int type, const void *item, const list next)
CONS a list with minimal type checking this cannot be done within the CONS macro because possible fun...
Definition: list.c:900
#define message_assert(msg, ex)
Definition: newgen_assert.h:47
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
Definition: offsets.c:15
#define intptr_t
Definition: stdint.in.h:294
The structure used to build lists in NewGen.
Definition: newgen_list.h:41
Representation d'un systeme generateur par trois ensembles de sommets de rayons et de droites.
Definition: sg-local.h:66
A gen_chunk is used to store every object.
Definition: genC.h:58