PIPS
freia_spoc_private.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "genC.h"
#include "freia_spoc_private.h"
+ Include dependency graph for freia_spoc_private.c:

Go to the source code of this file.

Functions

dag copy_dag (dag p)
 DAG. More...
 
void free_dag (dag p)
 
dag check_dag (dag p)
 
bool dag_consistent_p (dag p)
 
bool dag_defined_p (dag p)
 
list gen_dag_cons (dag p, list l)
 
void dag_assign_contents (dag r, dag v)
 
void dag_non_recursive_free (dag p)
 
void write_dag (FILE *f, dag p)
 
dag read_dag (FILE *f)
 
dag make_dag (list a1, list a2, list a3)
 
dagvtx copy_dagvtx (dagvtx p)
 DAGVTX. More...
 
void free_dagvtx (dagvtx p)
 
dagvtx check_dagvtx (dagvtx p)
 
bool dagvtx_consistent_p (dagvtx p)
 
bool dagvtx_defined_p (dagvtx p)
 
list gen_dagvtx_cons (dagvtx p, list l)
 
void dagvtx_assign_contents (dagvtx r, dagvtx v)
 
void dagvtx_non_recursive_free (dagvtx p)
 
void write_dagvtx (FILE *f, dagvtx p)
 
dagvtx read_dagvtx (FILE *f)
 
dagvtx make_dagvtx (vtxcontent a1, list a2)
 
pstatement copy_pstatement (pstatement p)
 PSTATEMENT. More...
 
void free_pstatement (pstatement p)
 
pstatement check_pstatement (pstatement p)
 
bool pstatement_consistent_p (pstatement p)
 
bool pstatement_defined_p (pstatement p)
 
list gen_pstatement_cons (pstatement p, list l)
 
void pstatement_assign_contents (pstatement r, pstatement v)
 
void pstatement_non_recursive_free (pstatement p)
 
void write_pstatement (FILE *f, pstatement p)
 
pstatement read_pstatement (FILE *f)
 
string pstatement_tag_as_string (enum pstatement_utype tag)
 
pstatement make_pstatement (enum pstatement_utype tag, void *val)
 
pstatement make_pstatement_statement (statement _field_)
 
pstatement make_pstatement_empty (void)
 
vtxcontent copy_vtxcontent (vtxcontent p)
 VTXCONTENT. More...
 
void free_vtxcontent (vtxcontent p)
 
vtxcontent check_vtxcontent (vtxcontent p)
 
bool vtxcontent_consistent_p (vtxcontent p)
 
bool vtxcontent_defined_p (vtxcontent p)
 
list gen_vtxcontent_cons (vtxcontent p, list l)
 
void vtxcontent_assign_contents (vtxcontent r, vtxcontent v)
 
void vtxcontent_non_recursive_free (vtxcontent p)
 
void write_vtxcontent (FILE *f, vtxcontent p)
 
vtxcontent read_vtxcontent (FILE *f)
 
vtxcontent make_vtxcontent (intptr_t a1, intptr_t a2, pstatement a3, list a4, entity a5)
 

Function Documentation

◆ check_dag()

dag check_dag ( dag  p)

Definition at line 22 of file freia_spoc_private.c.

22  {
23  return (dag) gen_check((gen_chunk*) p, dag_domain);
24 }
#define dag_domain
newgen_statement_domain_defined
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
A gen_chunk is used to store every object.
Definition: genC.h:58

References dag_domain, and gen_check().

+ Here is the call graph for this function:

◆ check_dagvtx()

dagvtx check_dagvtx ( dagvtx  p)

Definition at line 64 of file freia_spoc_private.c.

64  {
65  return (dagvtx) gen_check((gen_chunk*) p, dagvtx_domain);
66 }
#define dagvtx_domain
newgen_dag_domain_defined

References dagvtx_domain, and gen_check().

+ Here is the call graph for this function:

◆ check_pstatement()

pstatement check_pstatement ( pstatement  p)

Definition at line 106 of file freia_spoc_private.c.

106  {
108 }
#define pstatement_domain
newgen_dagvtx_domain_defined

References gen_check(), and pstatement_domain.

+ Here is the call graph for this function:

◆ check_vtxcontent()

vtxcontent check_vtxcontent ( vtxcontent  p)

Definition at line 161 of file freia_spoc_private.c.

161  {
163 }
#define vtxcontent_domain
newgen_pstatement_domain_defined

References gen_check(), and vtxcontent_domain.

+ Here is the call graph for this function:

◆ copy_dag()

dag copy_dag ( dag  p)

DAG.

Definition at line 16 of file freia_spoc_private.c.

16  {
17  return (dag) gen_copy_tree((gen_chunk*) p);
18 }
gen_chunk * gen_copy_tree(gen_chunk *obj)
Definition: genClib.c:1429

References gen_copy_tree().

+ Here is the call graph for this function:

◆ copy_dagvtx()

dagvtx copy_dagvtx ( dagvtx  p)

DAGVTX.

Definition at line 58 of file freia_spoc_private.c.

58  {
59  return (dagvtx) gen_copy_tree((gen_chunk*) p);
60 }

References gen_copy_tree().

+ Here is the call graph for this function:

◆ copy_pstatement()

pstatement copy_pstatement ( pstatement  p)

PSTATEMENT.

Definition at line 100 of file freia_spoc_private.c.

100  {
101  return (pstatement) gen_copy_tree((gen_chunk*) p);
102 }

References gen_copy_tree().

+ Here is the call graph for this function:

◆ copy_vtxcontent()

vtxcontent copy_vtxcontent ( vtxcontent  p)

VTXCONTENT.

Definition at line 155 of file freia_spoc_private.c.

155  {
156  return (vtxcontent) gen_copy_tree((gen_chunk*) p);
157 }

References gen_copy_tree().

+ Here is the call graph for this function:

◆ dag_assign_contents()

void dag_assign_contents ( dag  r,
dag  v 
)

Definition at line 35 of file freia_spoc_private.c.

35  {
36  check_dag(r);
37  check_dag(v);
38  message_assert("defined references to domain dag",
39  dag_defined_p(r) && dag_defined_p(v));
40  memcpy(r, v, sizeof(struct _newgen_struct_dag_));
41 }
dag check_dag(dag p)
bool dag_defined_p(dag p)
#define message_assert(msg, ex)
Definition: newgen_assert.h:47

References check_dag(), dag_defined_p(), and message_assert.

+ Here is the call graph for this function:

◆ dag_consistent_p()

bool dag_consistent_p ( dag  p)

Definition at line 25 of file freia_spoc_private.c.

25  {
26  check_dag(p);
27  return gen_consistent_p((gen_chunk*) p);
28 }
int gen_consistent_p(gen_chunk *obj)
GEN_CONSISTENT_P dynamically checks the type correctness of OBJ.
Definition: genClib.c:2398

References check_dag(), and gen_consistent_p().

+ Here is the call graph for this function:

◆ dag_defined_p()

bool dag_defined_p ( dag  p)

Definition at line 29 of file freia_spoc_private.c.

29  {
30  return gen_defined_p((gen_chunk*) p);
31 }
int gen_defined_p(gen_chunk *obj)
Definition: genClib.c:2438

References gen_defined_p().

+ Here is the call graph for this function:

◆ dag_non_recursive_free()

void dag_non_recursive_free ( dag  p)

Definition at line 42 of file freia_spoc_private.c.

42  {
43  // should clear up contents...
44  free(p);
45 }
void free(void *)

References free().

+ Here is the call graph for this function:

◆ dagvtx_assign_contents()

void dagvtx_assign_contents ( dagvtx  r,
dagvtx  v 
)

Definition at line 77 of file freia_spoc_private.c.

77  {
78  check_dagvtx(r);
79  check_dagvtx(v);
80  message_assert("defined references to domain dagvtx",
82  memcpy(r, v, sizeof(struct _newgen_struct_dagvtx_));
83 }
dagvtx check_dagvtx(dagvtx p)
bool dagvtx_defined_p(dagvtx p)

References check_dagvtx(), dagvtx_defined_p(), and message_assert.

+ Here is the call graph for this function:

◆ dagvtx_consistent_p()

bool dagvtx_consistent_p ( dagvtx  p)

Definition at line 67 of file freia_spoc_private.c.

67  {
68  check_dagvtx(p);
69  return gen_consistent_p((gen_chunk*) p);
70 }

References check_dagvtx(), and gen_consistent_p().

+ Here is the call graph for this function:

◆ dagvtx_defined_p()

bool dagvtx_defined_p ( dagvtx  p)

Definition at line 71 of file freia_spoc_private.c.

71  {
72  return gen_defined_p((gen_chunk*) p);
73 }

References gen_defined_p().

+ Here is the call graph for this function:

◆ dagvtx_non_recursive_free()

void dagvtx_non_recursive_free ( dagvtx  p)

Definition at line 84 of file freia_spoc_private.c.

84  {
85  // should clear up contents...
86  free(p);
87 }

References free().

+ Here is the call graph for this function:

◆ free_dag()

void free_dag ( dag  p)

Definition at line 19 of file freia_spoc_private.c.

19  {
20  gen_free((gen_chunk*) p);
21 }
void gen_free(gen_chunk *obj)
version without shared_pointers.
Definition: genClib.c:992

References gen_free().

+ Here is the call graph for this function:

◆ free_dagvtx()

void free_dagvtx ( dagvtx  p)

Definition at line 61 of file freia_spoc_private.c.

61  {
62  gen_free((gen_chunk*) p);
63 }

References gen_free().

+ Here is the call graph for this function:

◆ free_pstatement()

void free_pstatement ( pstatement  p)

Definition at line 103 of file freia_spoc_private.c.

103  {
104  gen_free((gen_chunk*) p);
105 }

References gen_free().

+ Here is the call graph for this function:

◆ free_vtxcontent()

void free_vtxcontent ( vtxcontent  p)

Definition at line 158 of file freia_spoc_private.c.

158  {
159  gen_free((gen_chunk*) p);
160 }

References gen_free().

+ Here is the call graph for this function:

◆ gen_dag_cons()

list gen_dag_cons ( dag  p,
list  l 
)

Definition at line 32 of file freia_spoc_private.c.

32  {
33  return gen_typed_cons(DAG_NEWGEN_DOMAIN, p, l);
34 }
#define DAG_NEWGEN_DOMAIN
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

References DAG_NEWGEN_DOMAIN, and gen_typed_cons().

+ Here is the call graph for this function:

◆ gen_dagvtx_cons()

list gen_dagvtx_cons ( dagvtx  p,
list  l 
)

Definition at line 74 of file freia_spoc_private.c.

74  {
76 }
#define DAGVTX_NEWGEN_DOMAIN

References DAGVTX_NEWGEN_DOMAIN, and gen_typed_cons().

+ Here is the call graph for this function:

◆ gen_pstatement_cons()

list gen_pstatement_cons ( pstatement  p,
list  l 
)

Definition at line 116 of file freia_spoc_private.c.

116  {
118 }
#define PSTATEMENT_NEWGEN_DOMAIN

References gen_typed_cons(), and PSTATEMENT_NEWGEN_DOMAIN.

+ Here is the call graph for this function:

◆ gen_vtxcontent_cons()

list gen_vtxcontent_cons ( vtxcontent  p,
list  l 
)

Definition at line 171 of file freia_spoc_private.c.

171  {
173 }
#define VTXCONTENT_NEWGEN_DOMAIN

References gen_typed_cons(), and VTXCONTENT_NEWGEN_DOMAIN.

+ Here is the call graph for this function:

◆ make_dag()

dag make_dag ( list  a1,
list  a2,
list  a3 
)

Definition at line 52 of file freia_spoc_private.c.

52  {
53  return (dag) gen_alloc(4*sizeof(gen_chunk), GEN_CHECK_ALLOC, dag_domain, a1, a2, a3);
54 }
#define GEN_CHECK_ALLOC
Definition: genC.h:307
gen_chunk * gen_alloc(int size, int gen_check_p, int dom,...)
allocates something in newgen.
Definition: genClib.c:298

References dag_domain, gen_alloc(), and GEN_CHECK_ALLOC.

+ Here is the call graph for this function:

◆ make_dagvtx()

dagvtx make_dagvtx ( vtxcontent  a1,
list  a2 
)

Definition at line 94 of file freia_spoc_private.c.

94  {
95  return (dagvtx) gen_alloc(3*sizeof(gen_chunk), GEN_CHECK_ALLOC, dagvtx_domain, a1, a2);
96 }

References dagvtx_domain, gen_alloc(), and GEN_CHECK_ALLOC.

+ Here is the call graph for this function:

◆ make_pstatement()

pstatement make_pstatement ( enum pstatement_utype  tag,
void *  val 
)

Definition at line 143 of file freia_spoc_private.c.

143  {
145 }
int tag
TAG.
Definition: newgen_types.h:92

References gen_alloc(), GEN_CHECK_ALLOC, and pstatement_domain.

+ Here is the call graph for this function:

◆ make_pstatement_empty()

pstatement make_pstatement_empty ( void  )

Definition at line 149 of file freia_spoc_private.c.

149  {
151 }
pstatement make_pstatement(enum pstatement_utype tag, void *val)
@ is_pstatement_empty
#define UU
Definition: newgen_types.h:98

References is_pstatement_empty, make_pstatement(), and UU.

+ Here is the call graph for this function:

◆ make_pstatement_statement()

pstatement make_pstatement_statement ( statement  _field_)

Definition at line 146 of file freia_spoc_private.c.

146  {
147  return make_pstatement(is_pstatement_statement, (void*)(intptr_t) _field_);
148 }
@ is_pstatement_statement
#define intptr_t
Definition: stdint.in.h:294

References intptr_t, is_pstatement_statement, and make_pstatement().

+ Here is the call graph for this function:

◆ make_vtxcontent()

vtxcontent make_vtxcontent ( intptr_t  a1,
intptr_t  a2,
pstatement  a3,
list  a4,
entity  a5 
)

Definition at line 191 of file freia_spoc_private.c.

191  {
192  return (vtxcontent) gen_alloc(6*sizeof(gen_chunk), GEN_CHECK_ALLOC, vtxcontent_domain, a1, a2, a3, a4, a5);
193 }

References gen_alloc(), GEN_CHECK_ALLOC, and vtxcontent_domain.

+ Here is the call graph for this function:

◆ pstatement_assign_contents()

void pstatement_assign_contents ( pstatement  r,
pstatement  v 
)

Definition at line 119 of file freia_spoc_private.c.

119  {
120  check_pstatement(r);
121  check_pstatement(v);
122  message_assert("defined references to domain pstatement",
124  memcpy(r, v, sizeof(struct _newgen_struct_pstatement_));
125 }
pstatement check_pstatement(pstatement p)
bool pstatement_defined_p(pstatement p)

References check_pstatement(), message_assert, and pstatement_defined_p().

+ Here is the call graph for this function:

◆ pstatement_consistent_p()

bool pstatement_consistent_p ( pstatement  p)

Definition at line 109 of file freia_spoc_private.c.

109  {
110  check_pstatement(p);
111  return gen_consistent_p((gen_chunk*) p);
112 }

References check_pstatement(), and gen_consistent_p().

+ Here is the call graph for this function:

◆ pstatement_defined_p()

bool pstatement_defined_p ( pstatement  p)

Definition at line 113 of file freia_spoc_private.c.

113  {
114  return gen_defined_p((gen_chunk*) p);
115 }

References gen_defined_p().

+ Here is the call graph for this function:

◆ pstatement_non_recursive_free()

void pstatement_non_recursive_free ( pstatement  p)

Definition at line 126 of file freia_spoc_private.c.

126  {
127  // should clear up contents...
128  free(p);
129 }

References free().

+ Here is the call graph for this function:

◆ pstatement_tag_as_string()

string pstatement_tag_as_string ( enum pstatement_utype  tag)

Definition at line 136 of file freia_spoc_private.c.

136  {
137  switch (tag) {
138  case is_pstatement_statement: return "statement";
139  case is_pstatement_empty: return "empty";
140  default: return string_undefined;
141  }
142 }
#define string_undefined
Definition: newgen_types.h:40

References is_pstatement_empty, is_pstatement_statement, and string_undefined.

◆ read_dag()

dag read_dag ( FILE *  f)

Definition at line 49 of file freia_spoc_private.c.

49  {
50  return (dag) gen_read(f);
51 }
gen_chunk * gen_read(FILE *file)
GEN_READ reads any object from the FILE stream.
Definition: genClib.c:2323
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
Definition: offsets.c:15

References f(), and gen_read().

+ Here is the call graph for this function:

◆ read_dagvtx()

dagvtx read_dagvtx ( FILE *  f)

Definition at line 91 of file freia_spoc_private.c.

91  {
92  return (dagvtx) gen_read(f);
93 }

References f(), and gen_read().

+ Here is the call graph for this function:

◆ read_pstatement()

pstatement read_pstatement ( FILE *  f)

Definition at line 133 of file freia_spoc_private.c.

133  {
134  return (pstatement) gen_read(f);
135 }

References f(), and gen_read().

+ Here is the call graph for this function:

◆ read_vtxcontent()

vtxcontent read_vtxcontent ( FILE *  f)

Definition at line 188 of file freia_spoc_private.c.

188  {
189  return (vtxcontent) gen_read(f);
190 }

References f(), and gen_read().

+ Here is the call graph for this function:

◆ vtxcontent_assign_contents()

void vtxcontent_assign_contents ( vtxcontent  r,
vtxcontent  v 
)

Definition at line 174 of file freia_spoc_private.c.

174  {
175  check_vtxcontent(r);
176  check_vtxcontent(v);
177  message_assert("defined references to domain vtxcontent",
179  memcpy(r, v, sizeof(struct _newgen_struct_vtxcontent_));
180 }
vtxcontent check_vtxcontent(vtxcontent p)
bool vtxcontent_defined_p(vtxcontent p)

References check_vtxcontent(), message_assert, and vtxcontent_defined_p().

+ Here is the call graph for this function:

◆ vtxcontent_consistent_p()

bool vtxcontent_consistent_p ( vtxcontent  p)

Definition at line 164 of file freia_spoc_private.c.

164  {
165  check_vtxcontent(p);
166  return gen_consistent_p((gen_chunk*) p);
167 }

References check_vtxcontent(), and gen_consistent_p().

+ Here is the call graph for this function:

◆ vtxcontent_defined_p()

bool vtxcontent_defined_p ( vtxcontent  p)

Definition at line 168 of file freia_spoc_private.c.

168  {
169  return gen_defined_p((gen_chunk*) p);
170 }

References gen_defined_p().

+ Here is the call graph for this function:

◆ vtxcontent_non_recursive_free()

void vtxcontent_non_recursive_free ( vtxcontent  p)

Definition at line 181 of file freia_spoc_private.c.

181  {
182  // should clear up contents...
183  free(p);
184 }

References free().

+ Here is the call graph for this function:

◆ write_dag()

void write_dag ( FILE *  f,
dag  p 
)

Definition at line 46 of file freia_spoc_private.c.

46  {
47  gen_write(f, (gen_chunk*) p);
48 }
void gen_write(FILE *fd, gen_chunk *obj)
GEN_WRITE writes the OBJect on the stream FD.
Definition: genClib.c:1745

References f(), and gen_write().

+ Here is the call graph for this function:

◆ write_dagvtx()

void write_dagvtx ( FILE *  f,
dagvtx  p 
)

Definition at line 88 of file freia_spoc_private.c.

88  {
89  gen_write(f, (gen_chunk*) p);
90 }

References f(), and gen_write().

+ Here is the call graph for this function:

◆ write_pstatement()

void write_pstatement ( FILE *  f,
pstatement  p 
)

Definition at line 130 of file freia_spoc_private.c.

130  {
131  gen_write(f, (gen_chunk*) p);
132 }

References f(), and gen_write().

+ Here is the call graph for this function:

◆ write_vtxcontent()

void write_vtxcontent ( FILE *  f,
vtxcontent  p 
)

Definition at line 185 of file freia_spoc_private.c.

185  {
186  gen_write(f, (gen_chunk*) p);
187 }

References f(), and gen_write().

+ Here is the call graph for this function: