47 #define TABULATED_ELEMENTS_SIZE (500)
48 #define TABULATED_ELEMENTS_INCR (10000)
90 register int nsize, i;
99 for (i=gtp->
size; i<nsize; i++)
110 static struct intlist il;
118 il.cdr = (
struct intlist *) NULL;
130 register int i, size = gtp->
size;
132 for (i=0; i<size; i++)
147 register int i, size = gtp->
size;
150 for (l=
NIL, i=0; i<size; i++) {
165 register int i, size = gtp->
size;
173 for (i = gtp->
used? gtp->
used: 1; i != gtp->
used-1 ; i%=(size-1), i++)
184 fatal(
"cannot put tabulated dom=%d... no space available!",
domain);
200 char * key = (obj+2)->s;
207 fatal(
"gen_delete_tabulated_name: clearing unexisting (%s)\n", key);
229 message_assert(
"valid tabulated number", number>=0 && number<gtp->size);
230 return gtp->
table[number].
p;
255 int number = (obj+1)->i;
268 (
cp+1)->i = is_a_ref? -number: number;
289 register int i, size, number = (gp+1)->i;
292 fprintf(stderr,
"warning: '%s' of %d redefined\n",
id,
domain);
297 fprintf(stderr,
"unexpected reference to '%s' of %d\n",
id,
domain);
304 for (i=3; i<size; i++)
char * alloc(int size)
ALLOC is an "iron-clad" version of malloc(3).
int gen_size(int domain)
GEN_SIZE returns the size (in gen_chunks) of an object of type defined by the BP type.
#define gen_chunk_undefined
int gen_read_tabulated(FILE *file, int create_p)
GEN_READ_TABULATED reads FILE to update the Gen_tabulated_ table.
struct gen_binding * Tabulated_bp
pointer to tabulated domain hack
struct gen_binding Domains[MAX_DOMAIN]
in build.c
#define NIL
The empty list (nil in Lisp)
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
hash_table hash_table_make(hash_key_type key_type, size_t size)
void * hash_get(const hash_table htp, const void *key)
this function retrieves in the hash table pointed to by htp the couple whose key is equal to key.
void hash_put(hash_table htp, const void *key, const void *val)
This functions stores a couple (key,val) in the hash table pointed to by htp.
void * hash_delget(hash_table htp, const void *key, void **pkey)
deletes key from the hash table.
#define message_assert(msg, ex)
#define HASH_UNDEFINED_VALUE
value returned by hash_get() when the key is not found; could also be called HASH_KEY_NOT_FOUND,...
#define quick_domain_index(obj)
inlined version of domain_index.
#define check_domain(dom)
#define same_string_p(s1, s2)
struct _gtp * gen_tabulated_p
actually defined in tabulated.c
Pvecteur cp
pointeur sur l'egalite ou l'inegalite courante
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
int used
current allocated size
gen_chunk * table
how many are used
hash_table names
actual table
The structure used to build lists in NewGen.
gen_tabulated_p tabulated
number of chunks to hold this data.
#define TABULATED_ELEMENTS_SIZE
table of tabulated elements.
gen_chunk * gen_do_enter_tabulated(int domain, string id, gen_chunk *cp, bool is_a_ref)
static int gen_put_tabulated(int domain, gen_chunk *gc)
add tabulated in table.
static void extends_tabulated(gen_tabulated_p gtp)
gen_chunk * gen_tabulated_fake_object_hack(int domain)
WARNING: it is not reentrant...
static void gen_delete_tabulated_name(gen_chunk *obj)
deletes obj from the tabulated names...
void * gen_find_tabulated(const char *key, int domain)
#define TABULATED_ELEMENTS_INCR
void gen_mapc_tabulated(void(*fp)(gen_chunk *), int domain)
apply fp to domain...
gen_chunk * gen_enter_tabulated(int domain, string id, gen_chunk *cp, bool allow_ref)
ENTER_TABULATED_DEF enters a new definition (previous refs are allowed if ALLOW_REF) in the INDEX tab...
list gen_filter_tabulated(bool(*filter)(gen_chunk *), int domain)
returns the list of entities with this caracteristics.
gen_tabulated_p gen_init_tabulated(int domain)
static void gen_put_tabulated_name(int domain, char *id, _int number)
void gen_clear_tabulated_element(gen_chunk *obj)
GEN_CLEAR_TABULATED_ELEMENT only clears the entry for object OBJ in the gen_tabulated_ and gen_tabula...
static _int gen_get_tabulated_name_basic(int domain, const char *id)
static void positive_number(gen_chunk *o)
static gen_tabulated_p get_tabulated_from_domain(int domain)
int gen_read_and_check_tabulated(FILE *file, int create_p)
A DOMAIN union describes the structure of a user type.
struct gen_binding * element
struct intlist * dimensions
A gen_chunk is used to store every object.