]> andersk Git - splint.git/blame - src/Headers/cstringTable.h
Fixes after removing -unrecogcomments flag for make splintme.
[splint.git] / src / Headers / cstringTable.h
CommitLineData
28bf4b0b 1/*
c0de361f 2** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2003.
28bf4b0b 3** See ../LICENSE for license information.
4**
5*/
6/*
7** cstringTable.h
8*/
9
10# ifndef CSTRINGTABLE_H
11# define CSTRINGTABLE_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
19/* in forwardTypes:
20 abst_typedef null struct _cstringTable *cstringTable;
21*/
22
517a2db3 23/*:private:*/ typedef struct
28bf4b0b 24{
25 /*@only@*/ cstring key;
26 int val;
27} *hentry;
28
517a2db3 29/*:private:*/ typedef /*@only@*/ hentry o_hentry;
28bf4b0b 30
31typedef /*@null@*/ struct
32{
33 int size;
34 int nspace;
35 /*@only@*/ o_hentry *entries;
36} *hbucket;
37
38typedef /*@only@*/ hbucket o_hbucket;
39
40struct s_cstringTable
41{
42 int size;
43 int nentries;
44 /*@only@*/ o_hbucket *buckets;
45} ;
46
47
48/*@constant null cstringTable cstringTable_undefined; @*/
49# define cstringTable_undefined ((cstringTable) NULL)
50
0e41eb0e 51extern /*@falsewhennull@*/ bool cstringTable_isDefined(cstringTable) /*@*/ ;
28bf4b0b 52# define cstringTable_isDefined(p_h) ((p_h) != cstringTable_undefined)
53
0e41eb0e 54extern /*@nullwhentrue@*/ /*@unused@*/ bool cstringTable_isUndefined(cstringTable) /*@*/ ;
28bf4b0b 55# define cstringTable_isUndefined(p_h) ((p_h) == cstringTable_undefined)
56
57extern /*@only@*/ cstringTable cstringTable_create(int p_size) /*@*/ ;
58extern void cstringTable_insert (cstringTable p_h,
59 /*@only@*/ cstring p_key,
60 int p_value) /*@modifies p_h@*/ ;
61
62extern int cstringTable_lookup (cstringTable p_h, cstring p_key);
63extern /*@unused@*/ /*@only@*/ cstring cstringTable_stats(cstringTable p_h);
64extern void cstringTable_free (/*@only@*/ cstringTable p_h);
65extern void cstringTable_remove (cstringTable p_h, cstring p_key) /*@modifies p_h@*/ ;
66
67extern /*@unused@*/ cstring cstringTable_unparse (cstringTable) /*@*/ ;
68
69extern /*@unused@*/ void cstringTable_update (cstringTable p_h, cstring p_key, int p_newval) /*@modifies p_h@*/ ;
70
71extern void
72 cstringTable_replaceKey (cstringTable p_h, cstring p_oldkey,
73 /*@only@*/ cstring p_newkey);
74
75# else
76# error "Multiple include"
77# endif
78
79
80
81
82
83
84
85
86
87
88
89
90
This page took 2.007242 seconds and 5 git commands to generate.