]> andersk Git - splint.git/blame - src/Headers/hashTable.h
*** empty log message ***
[splint.git] / src / Headers / hashTable.h
CommitLineData
885824d3 1/*
2** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2000.
3** See ../LICENSE for license information.
4**
5*/
6/*
7** hashTable.h
8*/
9
10# ifndef HTABLE_H
11# define HTABLE_H
12
13/*@constant int HBUCKET_BASESIZE; @*/
14# define HBUCKET_BASESIZE 2
15
16/*@constant int HBUCKET_DNE; @*/
17# define HBUCKET_DNE NOT_FOUND
18
19typedef struct _hashTable *hashTable ;
20
21typedef struct _hentry
22{
23 /*@dependent@*/ cstring key;
24 int val;
25} hentry;
26
27typedef /*@null@*/ struct _hbucket
28{
29 int size;
30 int nspace;
31 /*@only@*/ hentry *entries;
32} *hbucket;
33
34typedef /*@only@*/ hbucket o_hbucket;
35
36struct _hashTable
37{
38 int size;
39 int nentries;
40 /*@only@*/ o_hbucket *buckets;
41} ;
42
43
44extern /*@only@*/ hashTable hashTable_create(int p_size);
45extern void hashTable_insert (hashTable p_h, cstring p_key, int p_value);
46extern int hashTable_lookup (hashTable p_h, cstring p_key);
47extern /*@unused@*/ /*@only@*/ cstring hashTable_stats(hashTable p_h);
48extern void hashTable_free (/*@only@*/ hashTable p_h);
49extern void hashTable_remove (hashTable p_h, cstring p_key) /*@modifies p_h@*/ ;
50extern void
51 hashTable_replaceKey (hashTable p_h, cstring p_oldkey, /*@dependent@*/ cstring p_newkey);
52
53# else
54# error "Multiple include"
55# endif
56
57
58
59
60
61
62
63
64
65
66
67
68
This page took 0.134354 seconds and 5 git commands to generate.