Lines Matching defs:list
34 #include "list.h"
42 init_list(elem_list *list, int hsize)
46 list->type = 0;
47 list->list = (elem**)malloc(sizeof (elem *) * hsize);
48 list->num_of_buckets = hsize;
49 for (i = 0; i < list->num_of_buckets; i++)
50 list->list[i] = NULL;
55 examine_list(elem_list *list)
61 for (i = 0; i < list->num_of_buckets; i++) {
63 for (cur = list->list[i]; cur; cur = cur->next)
72 * print all elements of a list
77 print_list(elem_list *list)
82 for (i = 0; i < list->num_of_buckets; i++) {
83 for (cur = list->list[i]; cur; cur = cur->next)
90 * print all elements of a list of type 'file_type'
95 print_type_list(elem_list *list, char file_type)
100 for (i = 0; i < list->num_of_buckets; i++) {
101 for (cur = list->list[i]; cur; cur = cur->next) {
140 find_elem(elem_list *list, elem *key, int flag)
144 for (e = list->list[hash(key->name) % list->num_of_buckets]; e;
163 find_elem_isa(elem_list *list, elem *key, int flag)
170 e = find_elem(list, key, flag);
181 find_elem_mach(elem_list *list, elem *key, int flag)
185 for (e = list->list[hash(key->name) % list->num_of_buckets]; e;
245 add_elem(elem_list *list, elem *e)
252 bucket = hash(e->name) % list->num_of_buckets;
253 if (list->list[bucket]) {
254 for (cur = list->list[bucket]; cur; cur = cur->next) {
271 * insert at head of list
273 e->next = list->list[bucket];
274 list->list[bucket] = e;