2 ** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2001.
3 ** See ../LICENSE for license information.
6 # ifndef MTANNOTATIONLIST_H
7 # define MTANNOTATIONLIST_H
9 struct s_mtAnnotationList
13 /*@reldef@*/ /*@relnull@*/ mtAnnotationDecl *elements;
16 /*@constant null mtAnnotationList mtAnnotationList_undefined;@*/
17 # define mtAnnotationList_undefined ((mtAnnotationList) NULL)
19 extern /*@falsenull@*/ bool mtAnnotationList_isDefined (mtAnnotationList p_s) /*@*/ ;
20 # define mtAnnotationList_isDefined(s) ((s) != mtAnnotationList_undefined)
22 extern int mtAnnotationList_size (/*@sef@*/ mtAnnotationList) /*@*/ ;
23 # define mtAnnotationList_size(s) (mtAnnotationList_isDefined (s) ? (s)->nelements : 0)
25 extern /*@unused@*/ /*@falsenull@*/ bool mtAnnotationList_empty (/*@sef@*/ mtAnnotationList) /*@*/ ;
26 # define mtAnnotationList_empty(s) (mtAnnotationList_size(s) == 0)
28 extern cstring mtAnnotationList_unparseSep (mtAnnotationList p_s, cstring p_sep) /*@*/ ;
30 extern /*@unused@*/ /*@only@*/ mtAnnotationList mtAnnotationList_new (void) /*@*/ ;
32 extern /*@only@*/ mtAnnotationList mtAnnotationList_single (/*@keep@*/ mtAnnotationDecl p_el) /*@*/ ;
34 extern mtAnnotationList
35 mtAnnotationList_add (/*@returned@*/ mtAnnotationList p_s, /*@keep@*/ mtAnnotationDecl p_el)
38 extern mtAnnotationList
39 mtAnnotationList_prepend (/*@returned@*/ mtAnnotationList p_s, /*@keep@*/ mtAnnotationDecl p_el)
42 extern /*@unused@*/ /*@only@*/ cstring mtAnnotationList_unparse (mtAnnotationList p_s) ;
43 extern void mtAnnotationList_free (/*@only@*/ mtAnnotationList p_s) ;
45 /*@constant int mtAnnotationListBASESIZE;@*/
46 # define mtAnnotationListBASESIZE MIDBASESIZE
48 /*@iter mtAnnotationList_elements (sef mtAnnotationList x, yield exposed mtAnnotationDecl el); @*/
49 # define mtAnnotationList_elements(x, m_el) \
50 { if (mtAnnotationList_isDefined (x)) { \
51 int m_ind; mtAnnotationDecl *m_elements = &((x)->elements[0]); \
52 for (m_ind = 0 ; m_ind < (x)->nelements; m_ind++) \
53 { mtAnnotationDecl m_el = *(m_elements++);
55 # define end_mtAnnotationList_elements }}}
58 # error "Multiple include"