PIPS
hpf.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 
8 #include <stdio.h>
9 #include <stdlib.h>
10 #include <string.h>
11 #include "genC.h"
12 #include "hpf.h"
13 
14 /* ALIGN
15  */
17  return (align) gen_copy_tree((gen_chunk*) p);
18 }
19 void free_align(align p) {
20  gen_free((gen_chunk*) p);
21 }
23  return (align) gen_check((gen_chunk*) p, align_domain);
24 }
26  check_align(p);
27  return gen_consistent_p((gen_chunk*) p);
28 }
30  return gen_defined_p((gen_chunk*) p);
31 }
33  return gen_typed_cons(ALIGN_NEWGEN_DOMAIN, p, l);
34 }
36  check_align(r);
37  check_align(v);
38  message_assert("defined references to domain align",
40  memcpy(r, v, sizeof(struct _newgen_struct_align_));
41 }
43  // should clear up contents...
44  free(p);
45 }
46 void write_align(FILE* f, align p) {
47  gen_write(f, (gen_chunk*) p);
48 }
49 align read_align(FILE* f) {
50  return (align) gen_read(f);
51 }
53  return (align) gen_alloc(3*sizeof(gen_chunk), GEN_CHECK_ALLOC, align_domain, a1, a2);
54 }
55 
56 /* ALIGNMENT
57  */
59  return (alignment) gen_copy_tree((gen_chunk*) p);
60 }
62  gen_free((gen_chunk*) p);
63 }
66 }
68  check_alignment(p);
69  return gen_consistent_p((gen_chunk*) p);
70 }
72  return gen_defined_p((gen_chunk*) p);
73 }
76 }
78  check_alignment(r);
79  check_alignment(v);
80  message_assert("defined references to domain alignment",
82  memcpy(r, v, sizeof(struct _newgen_struct_alignment_));
83 }
85  // should clear up contents...
86  free(p);
87 }
88 void write_alignment(FILE* f, alignment p) {
89  gen_write(f, (gen_chunk*) p);
90 }
92  return (alignment) gen_read(f);
93 }
95  return (alignment) gen_alloc(5*sizeof(gen_chunk), GEN_CHECK_ALLOC, alignment_domain, a1, a2, a3, a4);
96 }
97 
98 /* DISTRIBUTE
99  */
101  return (distribute) gen_copy_tree((gen_chunk*) p);
102 }
104  gen_free((gen_chunk*) p);
105 }
108 }
110  check_distribute(p);
111  return gen_consistent_p((gen_chunk*) p);
112 }
114  return gen_defined_p((gen_chunk*) p);
115 }
118 }
120  check_distribute(r);
121  check_distribute(v);
122  message_assert("defined references to domain distribute",
124  memcpy(r, v, sizeof(struct _newgen_struct_distribute_));
125 }
127  // should clear up contents...
128  free(p);
129 }
130 void write_distribute(FILE* f, distribute p) {
131  gen_write(f, (gen_chunk*) p);
132 }
134  return (distribute) gen_read(f);
135 }
137  return (distribute) gen_alloc(3*sizeof(gen_chunk), GEN_CHECK_ALLOC, distribute_domain, a1, a2);
138 }
139 
140 /* DISTRIBUTION
141  */
143  return (distribution) gen_copy_tree((gen_chunk*) p);
144 }
146  gen_free((gen_chunk*) p);
147 }
150 }
153  return gen_consistent_p((gen_chunk*) p);
154 }
156  return gen_defined_p((gen_chunk*) p);
157 }
160 }
164  message_assert("defined references to domain distribution",
166  memcpy(r, v, sizeof(struct _newgen_struct_distribution_));
167 }
169  // should clear up contents...
170  free(p);
171 }
173  gen_write(f, (gen_chunk*) p);
174 }
176  return (distribution) gen_read(f);
177 }
180 }
181 
182 /* STYLE
183  */
185  return (style) gen_copy_tree((gen_chunk*) p);
186 }
187 void free_style(style p) {
188  gen_free((gen_chunk*) p);
189 }
191  return (style) gen_check((gen_chunk*) p, style_domain);
192 }
194  check_style(p);
195  return gen_consistent_p((gen_chunk*) p);
196 }
198  return gen_defined_p((gen_chunk*) p);
199 }
201  return gen_typed_cons(STYLE_NEWGEN_DOMAIN, p, l);
202 }
204  check_style(r);
205  check_style(v);
206  message_assert("defined references to domain style",
208  memcpy(r, v, sizeof(struct _newgen_struct_style_));
209 }
211  // should clear up contents...
212  free(p);
213 }
214 void write_style(FILE* f, style p) {
215  gen_write(f, (gen_chunk*) p);
216 }
218  return (style) gen_read(f);
219 }
221  switch (tag) {
222  case is_style_none: return "none";
223  case is_style_block: return "block";
224  case is_style_cyclic: return "cyclic";
225  default: return string_undefined;
226  }
227 }
228 style make_style(enum style_utype tag, void * val) {
229  return (style) gen_alloc(3*sizeof(gen_chunk), GEN_CHECK_ALLOC, style_domain, tag, val);
230 }
232  return make_style(is_style_none, UU);
233 }
235  return make_style(is_style_block, UU);
236 }
238  return make_style(is_style_cyclic, UU);
239 }
240 
void alignment_non_recursive_free(alignment p)
Definition: hpf.c:84
void alignment_assign_contents(alignment r, alignment v)
Definition: hpf.c:77
alignment check_alignment(alignment p)
Definition: hpf.c:64
void free_distribution(distribution p)
Definition: hpf.c:145
void align_non_recursive_free(align p)
Definition: hpf.c:42
bool style_consistent_p(style p)
Definition: hpf.c:193
align read_align(FILE *f)
Definition: hpf.c:49
alignment read_alignment(FILE *f)
Definition: hpf.c:91
bool alignment_consistent_p(alignment p)
Definition: hpf.c:67
distribution make_distribution(style a1, expression a2)
Definition: hpf.c:178
void free_style(style p)
Definition: hpf.c:187
style read_style(FILE *f)
Definition: hpf.c:217
style make_style_block(void)
Definition: hpf.c:234
void write_align(FILE *f, align p)
Definition: hpf.c:46
list gen_distribute_cons(distribute p, list l)
Definition: hpf.c:116
void style_non_recursive_free(style p)
Definition: hpf.c:210
bool distribute_defined_p(distribute p)
Definition: hpf.c:113
distribute read_distribute(FILE *f)
Definition: hpf.c:133
bool distribution_consistent_p(distribution p)
Definition: hpf.c:151
list gen_alignment_cons(alignment p, list l)
Definition: hpf.c:74
bool distribute_consistent_p(distribute p)
Definition: hpf.c:109
void free_align(align p)
Definition: hpf.c:19
distribute copy_distribute(distribute p)
DISTRIBUTE.
Definition: hpf.c:100
void write_distribute(FILE *f, distribute p)
Definition: hpf.c:130
void distribution_assign_contents(distribution r, distribution v)
Definition: hpf.c:161
bool align_defined_p(align p)
Definition: hpf.c:29
list gen_align_cons(align p, list l)
Definition: hpf.c:32
style check_style(style p)
Definition: hpf.c:190
style make_style_cyclic(void)
Definition: hpf.c:237
void distribute_assign_contents(distribute r, distribute v)
Definition: hpf.c:119
distribution read_distribution(FILE *f)
Definition: hpf.c:175
bool align_consistent_p(align p)
Definition: hpf.c:25
bool distribution_defined_p(distribution p)
Definition: hpf.c:155
void free_distribute(distribute p)
Definition: hpf.c:103
distribute check_distribute(distribute p)
Definition: hpf.c:106
void write_distribution(FILE *f, distribution p)
Definition: hpf.c:172
void style_assign_contents(style r, style v)
Definition: hpf.c:203
distribution check_distribution(distribution p)
Definition: hpf.c:148
list gen_distribution_cons(distribution p, list l)
Definition: hpf.c:158
style make_style_none(void)
Definition: hpf.c:231
distribution copy_distribution(distribution p)
DISTRIBUTION.
Definition: hpf.c:142
align check_align(align p)
Definition: hpf.c:22
distribute make_distribute(list a1, entity a2)
Definition: hpf.c:136
bool style_defined_p(style p)
Definition: hpf.c:197
bool alignment_defined_p(alignment p)
Definition: hpf.c:71
void distribution_non_recursive_free(distribution p)
Definition: hpf.c:168
void write_alignment(FILE *f, alignment p)
Definition: hpf.c:88
alignment copy_alignment(alignment p)
ALIGNMENT.
Definition: hpf.c:58
string style_tag_as_string(enum style_utype tag)
Definition: hpf.c:220
style copy_style(style p)
STYLE.
Definition: hpf.c:184
void free_alignment(alignment p)
Definition: hpf.c:61
alignment make_alignment(intptr_t a1, intptr_t a2, expression a3, expression a4)
Definition: hpf.c:94
void write_style(FILE *f, style p)
Definition: hpf.c:214
void distribute_non_recursive_free(distribute p)
Definition: hpf.c:126
list gen_style_cons(style p, list l)
Definition: hpf.c:200
align copy_align(align p)
ALIGN.
Definition: hpf.c:16
align make_align(list a1, entity a2)
Definition: hpf.c:52
void align_assign_contents(align r, align v)
Definition: hpf.c:35
style make_style(enum style_utype tag, void *val)
Definition: hpf.c:228
#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 ALIGNMENT_NEWGEN_DOMAIN
Definition: hpf.h:35
#define align_domain
newgen_expression_domain_defined
Definition: hpf.h:24
#define DISTRIBUTE_NEWGEN_DOMAIN
Definition: hpf.h:43
#define distribution_domain
newgen_distribute_domain_defined
Definition: hpf.h:48
#define ALIGN_NEWGEN_DOMAIN
Definition: hpf.h:27
#define distribute_domain
newgen_alignment_domain_defined
Definition: hpf.h:40
#define alignment_domain
newgen_align_domain_defined
Definition: hpf.h:32
#define STYLE_NEWGEN_DOMAIN
Definition: hpf.h:59
#define style_domain
newgen_distribution_domain_defined
Definition: hpf.h:56
style_utype
Definition: hpf.h:236
@ is_style_cyclic
Definition: hpf.h:239
@ is_style_block
Definition: hpf.h:238
@ is_style_none
Definition: hpf.h:237
#define DISTRIBUTION_NEWGEN_DOMAIN
Definition: hpf.h:51
#define message_assert(msg, ex)
Definition: newgen_assert.h:47
int tag
TAG.
Definition: newgen_types.h:92
#define string_undefined
Definition: newgen_types.h:40
#define UU
Definition: newgen_types.h:98
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
A gen_chunk is used to store every object.
Definition: genC.h:58