]> andersk Git - splint.git/blob - src/Headers/mtLoseReferenceList.h
d051bf65b441277921946d6f6f48fe3534b6687f
[splint.git] / src / Headers / mtLoseReferenceList.h
1 /*
2 ** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2003.
3 ** See ../LICENSE for license information.
4 **
5 */
6
7 # ifndef MTLoseReferenceLIST_H
8 # define MTLoseReferenceLIST_H
9
10 /*@private@*/ typedef /*@only@*/ mtLoseReference o_mtLoseReference;
11
12 struct s_mtLoseReferenceList
13 {
14   int      nelements;
15   int      nspace;
16   /*@reldef@*/ /*@relnull@*/ o_mtLoseReference *elements;
17 } ;
18
19 /*@constant null mtLoseReferenceList mtLoseReferenceList_undefined;@*/
20 # define mtLoseReferenceList_undefined ((mtLoseReferenceList) NULL)
21
22 extern /*@falsewhennull@*/ bool mtLoseReferenceList_isDefined (mtLoseReferenceList p_s) /*@*/ ;
23 # define mtLoseReferenceList_isDefined(s)   ((s) != mtLoseReferenceList_undefined)
24
25 extern int mtLoseReferenceList_size (/*@sef@*/ mtLoseReferenceList) /*@*/ ;
26 # define mtLoseReferenceList_size(s) (mtLoseReferenceList_isDefined (s) ? (s)->nelements : 0)
27
28 extern /*@unused@*/ /*@falsewhennull@*/ bool mtLoseReferenceList_empty (/*@sef@*/ mtLoseReferenceList) /*@*/ ;
29 # define mtLoseReferenceList_empty(s) (mtLoseReferenceList_size(s) == 0)
30
31 extern cstring mtLoseReferenceList_unparseSep (mtLoseReferenceList p_s, cstring p_sep) /*@*/ ;
32
33 extern /*@unused@*/ /*@only@*/ mtLoseReferenceList mtLoseReferenceList_new (void) /*@*/ ;
34
35 extern /*@only@*/ mtLoseReferenceList mtLoseReferenceList_single (/*@only@*/ mtLoseReference p_el) /*@*/ ;
36
37 extern mtLoseReferenceList 
38   mtLoseReferenceList_add (/*@only@*/ mtLoseReferenceList p_s, /*@only@*/ mtLoseReference p_el) 
39   /*@modifies p_s@*/ ;
40
41 extern mtLoseReferenceList 
42   mtLoseReferenceList_prepend (/*@only@*/ mtLoseReferenceList p_s, /*@only@*/ mtLoseReference p_el) 
43   /*@modifies p_s@*/ ;
44
45 extern /*@unused@*/ /*@only@*/ cstring mtLoseReferenceList_unparse (mtLoseReferenceList p_s) ;
46 extern void mtLoseReferenceList_free (/*@only@*/ mtLoseReferenceList p_s) ;
47
48 /*@constant int mtLoseReferenceListBASESIZE;@*/
49 # define mtLoseReferenceListBASESIZE MIDBASESIZE
50
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++); 
57
58 # define end_mtLoseReferenceList_elements }}}
59
60 # else
61 # error "Multiple include"
62 # endif
63
64
65
66
This page took 0.028036 seconds and 3 git commands to generate.