]>
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 | ||
7 | # ifndef FUNCTIONCLAUSELIST_H | |
8 | # define FUNCTIONCLAUSELIST_H | |
9 | ||
10 | /*@private@*/ typedef /*@only@*/ functionClause o_functionClause; | |
11 | ||
12 | struct s_functionClauseList | |
13 | { | |
14 | int nelements; | |
15 | int nspace; | |
16 | /*@reldef@*/ /*@relnull@*/ o_functionClause *elements; | |
17 | } ; | |
18 | ||
19 | /*@constant null functionClauseList functionClauseList_undefined;@*/ | |
20 | # define functionClauseList_undefined ((functionClauseList) NULL) | |
21 | ||
22 | extern /*@falsenull@*/ bool functionClauseList_isDefined (functionClauseList p_s) /*@*/ ; | |
23 | # define functionClauseList_isDefined(s) ((s) != functionClauseList_undefined) | |
24 | ||
25 | extern /*@truenull@*/ bool functionClauseList_isUndefined (functionClauseList p_s) /*@*/ ; | |
26 | # define functionClauseList_isUndefined(s) ((s) == functionClauseList_undefined) | |
27 | ||
28 | extern int functionClauseList_size (/*@sef@*/ functionClauseList) /*@*/ ; | |
29 | # define functionClauseList_size(s) (functionClauseList_isDefined (s) ? (s)->nelements : 0) | |
30 | ||
31 | extern /*@unused@*/ /*@falsenull@*/ bool functionClauseList_empty (/*@sef@*/ functionClauseList) /*@*/ ; | |
32 | # define functionClauseList_empty(s) (functionClauseList_size(s) == 0) | |
33 | ||
34 | extern cstring functionClauseList_unparseSep (functionClauseList p_s, cstring p_sep) /*@*/ ; | |
35 | ||
36 | extern /*@unused@*/ /*@only@*/ functionClauseList functionClauseList_new (void) /*@*/ ; | |
37 | ||
38 | extern /*@only@*/ functionClauseList functionClauseList_single (/*@keep@*/ functionClause p_el) /*@*/ ; | |
39 | ||
40 | extern /*@unused@*/ functionClauseList | |
41 | functionClauseList_add (/*@returned@*/ functionClauseList p_s, /*@keep@*/ functionClause p_el) | |
42 | /*@modifies p_s@*/ ; | |
43 | ||
44 | extern functionClauseList | |
45 | functionClauseList_prepend (/*@returned@*/ functionClauseList p_s, /*@keep@*/ functionClause p_el) | |
46 | /*@modifies p_s@*/ ; | |
47 | ||
48 | extern /*@unused@*/ /*@only@*/ cstring functionClauseList_unparse (functionClauseList p_s) ; | |
49 | extern void functionClauseList_free (/*@only@*/ functionClauseList p_s) ; | |
50 | ||
51 | /*@constant int functionClauseListBASESIZE;@*/ | |
52 | # define functionClauseListBASESIZE MIDBASESIZE | |
53 | ||
54 | /*@iter functionClauseList_elements (sef functionClauseList x, yield exposed functionClause el); @*/ | |
55 | # define functionClauseList_elements(x, m_el) \ | |
56 | { if (functionClauseList_isDefined (x)) { \ | |
57 | int m_ind; functionClause *m_elements = &((x)->elements[0]); \ | |
58 | for (m_ind = 0 ; m_ind < (x)->nelements; m_ind++) \ | |
59 | { functionClause m_el = *(m_elements++); | |
60 | ||
61 | # define end_functionClauseList_elements }}} | |
62 | ||
63 | # else | |
64 | # error "Multiple include" | |
65 | # endif | |
66 | ||
67 | ||
68 | ||
69 |