PIPS
pipsdbm_private.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 * db_void;
8 
9 #include <stdio.h>
10 #include <stdlib.h>
11 #include <string.h>
12 #include "genC.h"
13 #include "pipsdbm_private.h"
14 
15 
16 /* DB_OWNED_RESOURCES
17  */
20 }
22  gen_free((gen_chunk*) p);
23 }
26 }
29  return gen_consistent_p((gen_chunk*) p);
30 }
32  return gen_defined_p((gen_chunk*) p);
33 }
36 }
40  message_assert("defined references to domain db_owned_resources",
42  memcpy(r, v, sizeof(struct _newgen_struct_db_owned_resources_));
43 }
45  // should clear up contents...
46  free(p);
47 }
49  gen_write(f, (gen_chunk*) p);
50 }
52  return (db_owned_resources) gen_read(f);
53 }
56 }
59 }
62 }
65 }
68 }
71 }
72 
73 /* DB_RESOURCE
74  */
76  return (db_resource) gen_copy_tree((gen_chunk*) p);
77 }
79  gen_free((gen_chunk*) p);
80 }
83 }
86  return gen_consistent_p((gen_chunk*) p);
87 }
89  return gen_defined_p((gen_chunk*) p);
90 }
93 }
97  message_assert("defined references to domain db_resource",
99  memcpy(r, v, sizeof(struct _newgen_struct_db_resource_));
100 }
102  // should clear up contents...
103  free(p);
104 }
106  gen_write(f, (gen_chunk*) p);
107 }
109  return (db_resource) gen_read(f);
110 }
112  return (db_resource) gen_alloc(5*sizeof(gen_chunk), GEN_CHECK_ALLOC, db_resource_domain, a1, a2, a3, a4);
113 }
114 
115 /* DB_RESOURCES
116  */
118  return (db_resources) gen_copy_tree((gen_chunk*) p);
119 }
121  gen_free((gen_chunk*) p);
122 }
125 }
128  return gen_consistent_p((gen_chunk*) p);
129 }
131  return gen_defined_p((gen_chunk*) p);
132 }
135 }
139  message_assert("defined references to domain db_resources",
141  memcpy(r, v, sizeof(struct _newgen_struct_db_resources_));
142 }
144  // should clear up contents...
145  free(p);
146 }
148  gen_write(f, (gen_chunk*) p);
149 }
151  return (db_resources) gen_read(f);
152 }
155 }
158 }
161 }
164 }
167 }
169  return (intptr_t)HASH_BOUND_P(p, p, db_resources_hash_table(f), k);
170 }
171 
172 /* DB_STATUS
173  */
175  return (db_status) gen_copy_tree((gen_chunk*) p);
176 }
178  gen_free((gen_chunk*) p);
179 }
182 }
184  check_db_status(p);
185  return gen_consistent_p((gen_chunk*) p);
186 }
188  return gen_defined_p((gen_chunk*) p);
189 }
192 }
194  check_db_status(r);
195  check_db_status(v);
196  message_assert("defined references to domain db_status",
198  memcpy(r, v, sizeof(struct _newgen_struct_db_status_));
199 }
201  // should clear up contents...
202  free(p);
203 }
204 void write_db_status(FILE* f, db_status p) {
205  gen_write(f, (gen_chunk*) p);
206 }
208  return (db_status) gen_read(f);
209 }
211  switch (tag) {
212  case is_db_status_loaded: return "loaded";
213  case is_db_status_stored: return "stored";
214  case is_db_status_required: return "required";
215  case is_db_status_loaded_and_stored: return "loaded_and_stored";
216  default: return string_undefined;
217  }
218 }
220  return (db_status) gen_alloc(3*sizeof(gen_chunk), GEN_CHECK_ALLOC, db_status_domain, tag, val);
221 }
224 }
227 }
230 }
233 }
234 
235 /* DB_SYMBOL
236  */
238  return (db_symbol) gen_copy_tree((gen_chunk*) p);
239 }
241  gen_free((gen_chunk*) p);
242 }
245 }
247  check_db_symbol(p);
248  return gen_consistent_p((gen_chunk*) p);
249 }
251  return gen_defined_p((gen_chunk*) p);
252 }
255 }
257  check_db_symbol(r);
258  check_db_symbol(v);
259  message_assert("defined references to domain db_symbol",
261  memcpy(r, v, sizeof(struct _newgen_struct_db_symbol_));
262 }
264  // should clear up contents...
265  free(p);
266 }
269 }
272 }
274  int domain = gen_read_tabulated(f, 0);
275  if (domain!=db_symbol_domain) {
276  fprintf(stderr, "[newgen internal error]""inconsistent domain number for db_symbol: %d (expecting %d)\n",
278  abort();
279  }
280 }
283 }
284 
void free_db_symbol(db_symbol p)
void free_db_owned_resources(db_owned_resources p)
db_resources check_db_resources(db_resources p)
db_symbol check_db_symbol(db_symbol p)
list gen_db_symbol_cons(db_symbol p, list l)
db_status make_db_status(enum db_status_utype tag, void *val)
void db_resources_non_recursive_free(db_resources p)
db_resource apply_db_owned_resources(db_owned_resources f, db_symbol k)
bool db_resources_defined_p(db_resources p)
list gen_db_resource_cons(db_resource p, list l)
list gen_db_status_cons(db_status p, list l)
void db_status_assign_contents(db_status r, db_status v)
bool db_owned_resources_defined_p(db_owned_resources p)
void * db_void
db_resources make_db_resources(void)
bool db_owned_resources_consistent_p(db_owned_resources p)
db_symbol gen_find_db_symbol(char *s)
db_owned_resources check_db_owned_resources(db_owned_resources p)
db_owned_resources apply_db_resources(db_resources f, db_symbol k)
db_status make_db_status_loaded_and_stored(void)
bool db_status_consistent_p(db_status p)
bool bound_db_owned_resources_p(db_owned_resources f, db_symbol k)
db_status check_db_status(db_status p)
void read_tabulated_db_symbol(FILE *f)
list gen_db_resources_cons(db_resources p, list l)
db_resource read_db_resource(FILE *f)
bool db_status_defined_p(db_status p)
void update_db_resources(db_resources f, db_symbol k, db_owned_resources v)
void db_resource_assign_contents(db_resource r, db_resource v)
void update_db_owned_resources(db_owned_resources f, db_symbol k, db_resource v)
db_owned_resources copy_db_owned_resources(db_owned_resources p)
DB_OWNED_RESOURCES.
void db_owned_resources_non_recursive_free(db_owned_resources p)
db_resource check_db_resource(db_resource p)
bool db_resource_defined_p(db_resource p)
string db_status_tag_as_string(enum db_status_utype tag)
void db_symbol_assign_contents(db_symbol r, db_symbol v)
db_resource copy_db_resource(db_resource p)
DB_RESOURCE.
bool db_resources_consistent_p(db_resources p)
void free_db_resource(db_resource p)
list gen_db_owned_resources_cons(db_owned_resources p, list l)
void write_db_resource(FILE *f, db_resource p)
db_symbol copy_db_symbol(db_symbol p)
DB_SYMBOL.
db_resource delete_db_owned_resources(db_owned_resources f, db_symbol k)
db_status read_db_status(FILE *f)
db_status copy_db_status(db_status p)
DB_STATUS.
void db_symbol_non_recursive_free(db_symbol p)
db_owned_resources make_db_owned_resources(void)
db_status make_db_status_loaded(void)
void db_owned_resources_assign_contents(db_owned_resources r, db_owned_resources v)
void write_tabulated_db_symbol(FILE *f)
db_status make_db_status_stored(void)
bool db_resource_consistent_p(db_resource p)
void write_db_owned_resources(FILE *f, db_owned_resources p)
db_resources read_db_resources(FILE *f)
void write_db_status(FILE *f, db_status p)
db_symbol make_db_symbol(string a1)
db_owned_resources read_db_owned_resources(FILE *f)
db_status make_db_status_required(void)
bool bound_db_resources_p(db_resources f, db_symbol k)
void db_status_non_recursive_free(db_status p)
void write_db_resources(FILE *f, db_resources p)
bool db_symbol_consistent_p(db_symbol p)
db_resources copy_db_resources(db_resources p)
DB_RESOURCES.
void db_resource_non_recursive_free(db_resource p)
void free_db_status(db_status p)
db_owned_resources delete_db_resources(db_resources f, db_symbol k)
void db_resources_assign_contents(db_resources r, db_resources v)
db_resource make_db_resource(db_void a1, db_status a2, intptr_t a3, intptr_t a4)
void extend_db_resources(db_resources f, db_symbol k, db_owned_resources v)
bool db_symbol_defined_p(db_symbol p)
void extend_db_owned_resources(db_owned_resources f, db_symbol k, db_resource v)
void free_db_resources(db_resources p)
#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_write_tabulated(FILE *fd, int domain)
GEN_WRITE_TABULATED writes the tabulated object TABLE on FD.
Definition: genClib.c:1866
int gen_read_tabulated(FILE *file, int create_p)
GEN_READ_TABULATED reads FILE to update the Gen_tabulated_ table.
Definition: genClib.c:2334
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 abort()
Definition: misc-local.h:53
void * db_void
Definition: newgen.c:37
#define message_assert(msg, ex)
Definition: newgen_assert.h:47
void * gen_find_tabulated(const char *, int)
Definition: tabulated.c:218
#define HASH_GET(start, image, h, k)
Definition: newgen_map.h:30
#define HASH_EXTEND(start, image, h, k, v)
Definition: newgen_map.h:36
#define HASH_DELETE(start, image, h, k)
Definition: newgen_map.h:38
#define HASH_UPDATE(start, image, h, k, v)
Definition: newgen_map.h:34
#define HASH_BOUND_P(start, image, h, k)
Definition: newgen_map.h:32
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 db_owned_resources_domain
newgen_db_void_domain_defined
#define DB_RESOURCES_NEWGEN_DOMAIN
#define DB_SYMBOL_NEWGEN_DOMAIN
#define DB_STATUS_NEWGEN_DOMAIN
db_status_utype
@ is_db_status_loaded_and_stored
@ is_db_status_loaded
@ is_db_status_stored
@ is_db_status_required
#define DB_OWNED_RESOURCES_NEWGEN_DOMAIN
#define db_resource_domain
newgen_db_owned_resources_domain_defined
#define DB_RESOURCE_NEWGEN_DOMAIN
#define db_resources_hash_table(x)
#define db_status_domain
newgen_db_resources_domain_defined
#define db_symbol_domain
newgen_db_status_domain_defined
#define db_owned_resources_hash_table(x)
#define db_resources_domain
newgen_db_resource_domain_defined
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
#define intptr_t
Definition: stdint.in.h:294
The structure used to build lists in NewGen.
Definition: newgen_list.h:41
A DOMAIN union describes the structure of a user type.
A gen_chunk is used to store every object.
Definition: genC.h:58