]>
Commit | Line | Data |
---|---|---|
28bf4b0b | 1 | /* |
2 | ** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2001. | |
3 | ** See ../LICENSE for license information. | |
4 | ** | |
5 | */ | |
6 | # ifndef MTANNOTATIONLIST_H | |
7 | # define MTANNOTATIONLIST_H | |
8 | ||
9 | struct s_mtAnnotationList | |
10 | { | |
11 | int nelements; | |
12 | int nspace; | |
13 | /*@reldef@*/ /*@relnull@*/ mtAnnotationDecl *elements; | |
14 | } ; | |
15 | ||
16 | /*@constant null mtAnnotationList mtAnnotationList_undefined;@*/ | |
17 | # define mtAnnotationList_undefined ((mtAnnotationList) NULL) | |
18 | ||
19 | extern /*@falsenull@*/ bool mtAnnotationList_isDefined (mtAnnotationList p_s) /*@*/ ; | |
20 | # define mtAnnotationList_isDefined(s) ((s) != mtAnnotationList_undefined) | |
21 | ||
22 | extern int mtAnnotationList_size (/*@sef@*/ mtAnnotationList) /*@*/ ; | |
23 | # define mtAnnotationList_size(s) (mtAnnotationList_isDefined (s) ? (s)->nelements : 0) | |
24 | ||
25 | extern /*@unused@*/ /*@falsenull@*/ bool mtAnnotationList_empty (/*@sef@*/ mtAnnotationList) /*@*/ ; | |
26 | # define mtAnnotationList_empty(s) (mtAnnotationList_size(s) == 0) | |
27 | ||
28 | extern cstring mtAnnotationList_unparseSep (mtAnnotationList p_s, cstring p_sep) /*@*/ ; | |
29 | ||
30 | extern /*@unused@*/ /*@only@*/ mtAnnotationList mtAnnotationList_new (void) /*@*/ ; | |
31 | ||
32 | extern /*@only@*/ mtAnnotationList mtAnnotationList_single (/*@keep@*/ mtAnnotationDecl p_el) /*@*/ ; | |
33 | ||
34 | extern mtAnnotationList | |
35 | mtAnnotationList_add (/*@returned@*/ mtAnnotationList p_s, /*@keep@*/ mtAnnotationDecl p_el) | |
36 | /*@modifies p_s@*/ ; | |
37 | ||
38 | extern mtAnnotationList | |
39 | mtAnnotationList_prepend (/*@returned@*/ mtAnnotationList p_s, /*@keep@*/ mtAnnotationDecl p_el) | |
40 | /*@modifies p_s@*/ ; | |
41 | ||
42 | extern /*@unused@*/ /*@only@*/ cstring mtAnnotationList_unparse (mtAnnotationList p_s) ; | |
43 | extern void mtAnnotationList_free (/*@only@*/ mtAnnotationList p_s) ; | |
44 | ||
45 | /*@constant int mtAnnotationListBASESIZE;@*/ | |
46 | # define mtAnnotationListBASESIZE MIDBASESIZE | |
47 | ||
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++); | |
54 | ||
55 | # define end_mtAnnotationList_elements }}} | |
56 | ||
57 | # else | |
58 | # error "Multiple include" | |
59 | # endif | |
60 | ||
61 | ||
62 | ||
63 |