• Home
  • Raw
  • Download

Lines Matching refs:symtab

54 void cil_symtab_init(symtab_t *symtab, unsigned int size)  in cil_symtab_init()  argument
56 int rc = symtab_init(symtab, size); in cil_symtab_init()
66 datum->symtab = NULL; in cil_symtab_datum_init()
88 int cil_symtab_insert(symtab_t *symtab, hashtab_key_t key, struct cil_symtab_datum *datum, struct c… in cil_symtab_insert() argument
90 int rc = hashtab_insert(symtab->table, key, (hashtab_datum_t)datum); in cil_symtab_insert()
94 datum->symtab = symtab; in cil_symtab_insert()
95 symtab->nprim++; in cil_symtab_insert()
108 symtab_t *symtab = datum->symtab; in cil_symtab_remove_datum() local
110 if (symtab == NULL) { in cil_symtab_remove_datum()
114 hashtab_remove(symtab->table, datum->name, NULL, NULL); in cil_symtab_remove_datum()
115 symtab->nprim--; in cil_symtab_remove_datum()
116 datum->symtab = NULL; in cil_symtab_remove_datum()
119 int cil_symtab_get_datum(symtab_t *symtab, char *key, struct cil_symtab_datum **datum) in cil_symtab_get_datum() argument
121 *datum = (struct cil_symtab_datum*)hashtab_search(symtab->table, (hashtab_key_t)key); in cil_symtab_get_datum()
129 int cil_symtab_map(symtab_t *symtab, in cil_symtab_map() argument
133 return hashtab_map(symtab->table, apply, args); in cil_symtab_map()
139 datum->symtab = NULL; in __cil_symtab_destroy_helper()
143 void cil_symtab_destroy(symtab_t *symtab) in cil_symtab_destroy() argument
145 if (symtab->table != NULL){ in cil_symtab_destroy()
146 cil_symtab_map(symtab, __cil_symtab_destroy_helper, NULL); in cil_symtab_destroy()
147 hashtab_destroy(symtab->table); in cil_symtab_destroy()
148 symtab->table = NULL; in cil_symtab_destroy()
158 void cil_complex_symtab_init(struct cil_complex_symtab *symtab, unsigned int size) in cil_complex_symtab_init() argument
160 symtab->htable = cil_calloc(size, sizeof(struct cil_complex_symtab *)); in cil_complex_symtab_init()
162 symtab->nelems = 0; in cil_complex_symtab_init()
163 symtab->nslots = size; in cil_complex_symtab_init()
164 symtab->mask = size - 1; in cil_complex_symtab_init()
167 int cil_complex_symtab_insert(struct cil_complex_symtab *symtab, in cil_complex_symtab_insert() argument
182 cil_complex_symtab_hash(ckey, symtab->mask, &hash); in cil_complex_symtab_insert()
184 for (prev = NULL, curr = symtab->htable[hash]; curr != NULL; in cil_complex_symtab_insert()
217 node->next = symtab->htable[hash]; in cil_complex_symtab_insert()
218 symtab->htable[hash] = node; in cil_complex_symtab_insert()
221 symtab->nelems++; in cil_complex_symtab_insert()
226 void cil_complex_symtab_search(struct cil_complex_symtab *symtab, in cil_complex_symtab_search() argument
233 cil_complex_symtab_hash(ckey, symtab->mask, &hash); in cil_complex_symtab_search()
234 for (curr = symtab->htable[hash]; curr != NULL; curr = curr->next) { in cil_complex_symtab_search()
265 void cil_complex_symtab_destroy(struct cil_complex_symtab *symtab) in cil_complex_symtab_destroy() argument
271 if (symtab == NULL) { in cil_complex_symtab_destroy()
275 for (i = 0; i < symtab->nslots; i++) { in cil_complex_symtab_destroy()
276 curr = symtab->htable[i]; in cil_complex_symtab_destroy()
282 symtab->htable[i] = NULL; in cil_complex_symtab_destroy()
284 free(symtab->htable); in cil_complex_symtab_destroy()
285 symtab->htable = NULL; in cil_complex_symtab_destroy()
286 symtab->nelems = 0; in cil_complex_symtab_destroy()
287 symtab->nslots = 0; in cil_complex_symtab_destroy()
288 symtab->mask = 0; in cil_complex_symtab_destroy()