2 ** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2003.
3 ** See ../LICENSE for license information.
6 # ifndef MTANNOTATIONLIST_H
7 # define MTANNOTATIONLIST_H
9 typedef /*@only@*/ mtAnnotationDecl o_mtAnnotationDecl;
11 struct s_mtAnnotationList
15 /*@reldef@*/ /*@relnull@*/ o_mtAnnotationDecl *elements;
18 /*@constant null mtAnnotationList mtAnnotationList_undefined;@*/
19 # define mtAnnotationList_undefined ((mtAnnotationList) NULL)
21 extern /*@falsewhennull@*/ bool mtAnnotationList_isDefined (mtAnnotationList p_s) /*@*/ ;
22 # define mtAnnotationList_isDefined(s) ((s) != mtAnnotationList_undefined)
24 extern int mtAnnotationList_size (/*@sef@*/ mtAnnotationList) /*@*/ ;
25 # define mtAnnotationList_size(s) (mtAnnotationList_isDefined (s) ? (s)->nelements : 0)
27 extern /*@unused@*/ /*@falsewhennull@*/ bool mtAnnotationList_empty (/*@sef@*/ mtAnnotationList) /*@*/ ;
28 # define mtAnnotationList_empty(s) (mtAnnotationList_size(s) == 0)
30 extern cstring mtAnnotationList_unparseSep (mtAnnotationList p_s, cstring p_sep) /*@*/ ;
32 extern /*@unused@*/ /*@only@*/ mtAnnotationList mtAnnotationList_new (void) /*@*/ ;
34 extern /*@only@*/ mtAnnotationList mtAnnotationList_single (/*@only@*/ mtAnnotationDecl p_el) /*@*/ ;
36 extern mtAnnotationList
37 mtAnnotationList_add (/*@returned@*/ mtAnnotationList p_s, /*@only@*/ mtAnnotationDecl p_el)
40 extern /*@only@*/ mtAnnotationList
41 mtAnnotationList_prepend (/*@only@*/ mtAnnotationList p_s, /*@only@*/ mtAnnotationDecl p_el)
44 extern /*@unused@*/ /*@only@*/ cstring mtAnnotationList_unparse (mtAnnotationList p_s) ;
45 extern void mtAnnotationList_free (/*@only@*/ mtAnnotationList p_s) ;
47 /*@constant int mtAnnotationListBASESIZE;@*/
48 # define mtAnnotationListBASESIZE MIDBASESIZE
50 /*@iter mtAnnotationList_elements (sef mtAnnotationList x, yield exposed mtAnnotationDecl el); @*/
51 # define mtAnnotationList_elements(x, m_el) \
52 { if (mtAnnotationList_isDefined (x)) { \
53 int m_ind; mtAnnotationDecl *m_elements = &((x)->elements[0]); \
54 for (m_ind = 0 ; m_ind < (x)->nelements; m_ind++) \
55 { mtAnnotationDecl m_el = *(m_elements++);
57 # define end_mtAnnotationList_elements }}}
60 # error "Multiple include"