File: ghash_insert.c

package info (click to toggle)
bglibs 2.04%2Bdfsg-8
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 3,468 kB
  • sloc: ansic: 15,821; perl: 674; sh: 63; makefile: 29
file content (12 lines) | stat: -rw-r--r-- 273 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
#include "ghash.h"

/** Insert an entry into a \c ghash table, without resizing it. */
void ghash_insert(struct ghash* d, void* e)
{
  unsigned i;
  i = ghash_entry_hash(e) % d->size;
  while (d->table[i] != 0)
    i = (i + 1) % d->size;
  d->table[i] = e;
  ++d->count;
}