Various minor fixes for compiler/linter (other then splint itself) warnings.
[splint-patched.git] / src / Headers / mtLoseReferenceList.h
blobecfe3f3d83b6453659e8dfa32da3255a8a12db17
1 /*
2 ** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2003.
3 ** See ../LICENSE for license information.
4 **
5 */
7 # ifndef MTLoseReferenceLIST_H
8 # define MTLoseReferenceLIST_H
10 /*:private:*/ typedef /*@only@*/ mtLoseReference o_mtLoseReference;
12 struct s_mtLoseReferenceList
14 int nelements;
15 int nspace;
16 /*@reldef@*/ /*@relnull@*/ o_mtLoseReference *elements;
17 } ;
19 /*@constant null mtLoseReferenceList mtLoseReferenceList_undefined;@*/
20 # define mtLoseReferenceList_undefined ((mtLoseReferenceList) NULL)
22 extern /*@falsewhennull@*/ bool mtLoseReferenceList_isDefined (mtLoseReferenceList p_s) /*@*/ ;
23 # define mtLoseReferenceList_isDefined(s) ((s) != mtLoseReferenceList_undefined)
25 extern int mtLoseReferenceList_size (/*@sef@*/ mtLoseReferenceList) /*@*/ ;
26 # define mtLoseReferenceList_size(s) (mtLoseReferenceList_isDefined (s) ? (s)->nelements : 0)
28 extern /*@unused@*/ /*@falsewhennull@*/ bool mtLoseReferenceList_empty (/*@sef@*/ mtLoseReferenceList) /*@*/ ;
29 # define mtLoseReferenceList_empty(s) (mtLoseReferenceList_size(s) == 0)
31 extern cstring mtLoseReferenceList_unparseSep (mtLoseReferenceList p_s, cstring p_sep) /*@*/ ;
33 extern /*@unused@*/ /*@only@*/ mtLoseReferenceList mtLoseReferenceList_new (void) /*@*/ ;
35 extern /*@only@*/ mtLoseReferenceList mtLoseReferenceList_single (/*@only@*/ mtLoseReference p_el) /*@*/ ;
37 extern mtLoseReferenceList
38 mtLoseReferenceList_add (/*@only@*/ mtLoseReferenceList p_s, /*@only@*/ mtLoseReference p_el)
39 /*@modifies p_s@*/ ;
41 extern mtLoseReferenceList
42 mtLoseReferenceList_prepend (/*@only@*/ mtLoseReferenceList p_s, /*@only@*/ mtLoseReference p_el)
43 /*@modifies p_s@*/ ;
45 extern /*@unused@*/ /*@only@*/ cstring mtLoseReferenceList_unparse (mtLoseReferenceList p_s) ;
46 extern void mtLoseReferenceList_free (/*@only@*/ mtLoseReferenceList p_s) ;
48 /*@constant int mtLoseReferenceListBASESIZE;@*/
49 # define mtLoseReferenceListBASESIZE MIDBASESIZE
51 /*@iter mtLoseReferenceList_elements (sef mtLoseReferenceList x, yield exposed mtLoseReference el); @*/
52 # define mtLoseReferenceList_elements(x, m_el) \
53 { if (mtLoseReferenceList_isDefined (x)) { \
54 int m_ind; mtLoseReference *m_elements = &((x)->elements[0]); \
55 for (m_ind = 0 ; m_ind < (x)->nelements; m_ind++) \
56 { mtLoseReference m_el = *(m_elements++);
58 # define end_mtLoseReferenceList_elements }}}
60 # else
61 # error "Multiple include"
62 # endif