Lines Matching refs:n
110 #define hashsize(n) ((uint32_t)1<<(n)) argument
111 #define hashmask(n) (hashsize(n)-1) argument
495 unsigned long h, n; in lh_table_insert() local
501 n = h % t->size; in lh_table_insert()
504 if(t->table[n].k == LH_EMPTY || t->table[n].k == LH_FREED) break; in lh_table_insert()
506 if ((int)++n == t->size) n = 0; in lh_table_insert()
509 t->table[n].k = k; in lh_table_insert()
510 t->table[n].v = v; in lh_table_insert()
514 t->head = t->tail = &t->table[n]; in lh_table_insert()
515 t->table[n].next = t->table[n].prev = NULL; in lh_table_insert()
517 t->tail->next = &t->table[n]; in lh_table_insert()
518 t->table[n].prev = t->tail; in lh_table_insert()
519 t->table[n].next = NULL; in lh_table_insert()
520 t->tail = &t->table[n]; in lh_table_insert()
530 unsigned long n = h % t->size; in lh_table_lookup_entry() local
535 if(t->table[n].k == LH_EMPTY) return NULL; in lh_table_lookup_entry()
536 if(t->table[n].k != LH_FREED && in lh_table_lookup_entry()
537 t->equal_fn(t->table[n].k, k)) return &t->table[n]; in lh_table_lookup_entry()
538 if ((int)++n == t->size) n = 0; in lh_table_lookup_entry()
565 …ptrdiff_t n = (ptrdiff_t)(e - t->table); /* CAW: fixed to be 64bit nice, still need the crazy nega… in lh_table_delete_entry() local
568 if(n < 0) { return -2; } in lh_table_delete_entry()
570 if(t->table[n].k == LH_EMPTY || t->table[n].k == LH_FREED) return -1; in lh_table_delete_entry()
573 t->table[n].v = NULL; in lh_table_delete_entry()
574 t->table[n].k = LH_FREED; in lh_table_delete_entry()
575 if(t->tail == &t->table[n] && t->head == &t->table[n]) { in lh_table_delete_entry()
577 } else if (t->head == &t->table[n]) { in lh_table_delete_entry()
580 } else if (t->tail == &t->table[n]) { in lh_table_delete_entry()
584 t->table[n].prev->next = t->table[n].next; in lh_table_delete_entry()
585 t->table[n].next->prev = t->table[n].prev; in lh_table_delete_entry()
587 t->table[n].next = t->table[n].prev = NULL; in lh_table_delete_entry()