Various minor fixes for compiler/linter (other then splint itself) warnings.
[splint-patched.git] / src / Headers / annotationTable.h
blob63fae874812c654ad703ebe3ba6d1733b4cb1b72
1 /*
2 ** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2003.
3 ** See ../LICENSE for license information.
4 */
5 /*
6 ** annotationTable.h
7 **
8 ** A global table that keeps information on the user-defined annotations.
9 **
10 ** For each annotation, we need:
12 ** o [key] A name (matches @name@ in code)
13 ** o State - index into metaStateTable that identifies the state associated with this annotation
14 ** o Value
15 ** o Context information (where can annotation be used)
18 # ifndef ANNOTTABLE_H
19 # define ANNOTTABLE_H
21 /*@constant int DEFAULT_ANNOTTABLE_SIZE@*/
22 # define DEFAULT_ANNOTTABLE_SIZE 32
24 extern /*@only@*/ annotationTable annotationTable_create (void) /*@*/ ;
25 # define annotationTable_create() ((annotationTable) genericTable_create (DEFAULT_ANNOTTABLE_SIZE))
27 extern void annotationTable_insert (annotationTable p_h, /*@only@*/ annotationInfo p_annotation);
29 extern /*@null@*/ /*@dependent@*/ /*@exposed@*/ annotationInfo
30 annotationTable_lookup (annotationTable p_h, cstring p_key) /*@*/ ;
31 /*@access annotationInfo@*/
32 # define annotationTable_lookup(p_h,p_key) \
33 ((annotationInfo) genericTable_lookup ((genericTable) (p_h), p_key))
34 /*@noaccess annotationInfo@*/
36 extern bool annotationTable_contains (annotationTable p_h, cstring p_key) /*@*/ ;
37 # define annotationTable_contains(p_h,p_key) \
38 (genericTable_contains ((genericTable) (p_h), p_key))
40 extern /*@only@*/ cstring annotationTable_unparse (annotationTable p_h);
42 extern void annotationTable_free (/*@only@*/ annotationTable p_h);
43 # define annotationTable_free(p_h) (genericTable_free ((genericTable) (p_h)))
45 /*@iter annotationTable_elements (sef annotationTable p_g,
46 yield exposed cstring m_key,
47 yield exposed annotationInfo m_el) @*/
49 # define annotationTable_elements(p_g,m_key,m_el) \
50 genericTable_elements((genericTable) (p_g), m_key, m_el)
51 # define end_annotationTable_elements end_genericTable_elements
53 # else
54 # error "Multiple include"
55 # endif