11 #include <libxml/xmlmemory.h>
12 #include <libxml/parser.h>
13 #include <libxml/encoding.h>
16 # define _BSD_SOURCE /* need strdup */
17 # endif /* ! defined _BSD_SOURCE */
19 # define MY_ENCODING "ISO-8859-1"
21 # define CHECK(ptr,msg) assert (ptr && msg)
23 # define NODE_NAME(n, m) (0 == xmlStrcmp (n->name, (const xmlChar*) #m))
24 # define CHECK_NAME(n, m) assert (0 == xmlStrcmp (n->name, (const xmlChar*) #m))
26 # define NEW(T) (T*) malloc (sizeof (T))
28 /* first, the xml structures */
30 typedef struct type_str
34 void *f_tp; /* firm type */
35 struct type_str *prev;
38 typedef struct entity_str
43 void *f_ent; /* firm entity */
44 struct entity_str *prev;
47 /* now the xml nodes */
48 typedef enum eff_node_kind {
62 /* dummy type for all other effects */
63 typedef struct eff_str
66 /* struct eff_str *next; */
69 typedef struct effs_str
74 struct effs_str *next;
77 typedef struct arg_str
80 /* struct eff_str *next; */
85 typedef struct valref_str
88 /* struct eff_str *next; */
92 typedef struct select_str
95 /* struct eff_str *next; */
96 int valrefid; /* id of enclosed valref node, or -1 */
100 typedef struct load_str
102 eff_node_kind_t kind;
103 /* struct eff_str *next; */
105 int ptrrefid; /* id of valref node enclosed in select, or -1 */
109 typedef struct store_str
111 eff_node_kind_t kind;
112 /* struct eff_str *next; */
113 int ptrrefid; /* id of ptr valref node enclosed in select, or -1 */
114 int valrefid; /* id of val valref node enclosed in select, or -1 */
118 typedef struct alloc_str
120 eff_node_kind_t kind;
125 typedef struct call_str
127 eff_node_kind_t kind;
128 /* struct eff_str *next; */
130 int valrefid; /* id of enclosed valref node, or -1 */
131 entity_t *ent; /* called entity */
136 typedef struct unknown_str
138 eff_node_kind_t kind;
139 /* struct eff_str *next; */
143 typedef struct join_str
145 eff_node_kind_t kind;
146 /* struct eff_str *next; */
152 typedef struct ret_str
154 eff_node_kind_t kind;
155 /* struct eff_str *next; */
157 } ret_t; /* returned value, or -1 */
159 typedef struct raise_str
161 eff_node_kind_t kind;
162 /* struct eff_str *next; */
163 int valref; /* what was that one for? */
171 /** get the type entry with the given name */
172 type_t *getTypeByName (const char*);
174 /** get the type entry with the given Id */
175 type_t *getTypeById (const int);
177 /** get the entity entry that has the given names */
178 entity_t *getEntityByNames (const char*, const char*);
180 /** get the entity entry that has the given Id */
181 entity_t *getEntityById (const int);
183 /** get the effect entry for the given name */
184 effs_t *getEffectByName (const char*);
186 /** read in the file of the given name */
187 void read_extern (const char*);
190 #endif /* defined _READ_H_ */
194 Revision 1.1 2004/10/11 09:31:06 liekweg
195 First Import of XML reading procs --flo