File: hash.ih

package info (click to toggle)
trn4 4.0-test76-15
  • links: PTS
  • area: non-free
  • in suites: lenny
  • size: 3,048 kB
  • ctags: 2,964
  • sloc: ansic: 48,338; sh: 6,770; tcl: 1,696; yacc: 660; perl: 108; makefile: 73
file content (27 lines) | stat: -rw-r--r-- 686 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* hash.ih
 */

#define BADTBL(tbl)	((tbl) == NULL || (tbl)->ht_magic != HASHMAG)

#define HASHMAG  ((char)0257)

struct hashent {
    HASHENT* he_next;		/* in hash chain */
    HASHDATUM he_data;
    int he_keylen;		/* to help verify a match */
};

struct hashtable {
    HASHENT** ht_addr;		/* array of HASHENT pointers */
    unsigned ht_size;
    char ht_magic;
    int (*ht_cmp) _((char*,int,HASHDATUM));
};

/* DON'T EDIT BELOW THIS LINE OR YOUR CHANGES WILL BE LOST! */

static HASHENT** hashfind _((HASHTABLE*,char*,int));
static unsigned hash _((char*,int));
static int default_cmp _((char*,int,HASHDATUM));
static HASHENT* healloc _((void));
static void hefree _((HASHENT*));