]>
Commit | Line | Data |
---|---|---|
885824d3 | 1 | /* |
28bf4b0b | 2 | ** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2001. |
885824d3 | 3 | ** See ../LICENSE for license information. |
4 | ** | |
5 | */ | |
6 | # ifndef ctypeLIST_H | |
7 | # define ctypeLIST_H | |
8 | ||
9 | /* | |
10 | ** there is a special ctypeList used to represent the () argument list | |
11 | ** this has nelements = -1 | |
12 | ** | |
13 | ** (that is, not void, so any number of arguments is okay.) | |
14 | */ | |
15 | ||
28bf4b0b | 16 | abst_typedef /*@null@*/ struct |
885824d3 | 17 | { |
18 | int nelements; | |
19 | int nspace; | |
20 | /*@reldef@*/ /*@relnull@*/ ctype *elements; | |
21 | } *ctypeList ; | |
22 | ||
23 | extern int ctypeList_size (/*@sef@*/ ctypeList p_s) /*@*/ ; | |
24 | # define ctypeList_size(s) (ctypeList_isDefined(s) ? (s)->nelements : 0) | |
25 | ||
26 | extern /*@only@*/ ctypeList ctypeList_new(void); | |
27 | extern void ctypeList_addh (ctypeList p_s, ctype p_el) /*@modifies p_s@*/; | |
28 | ||
28bf4b0b | 29 | extern /*@only@*/ ctypeList |
30 | ctypeList_append (/*@returned@*/ /*@only@*/ ctypeList p_s1, | |
31 | ctypeList p_s2) /*@modifies p_s1@*/ ; | |
32 | ||
33 | extern ctypeList ctypeList_add (/*@only@*/ ctypeList p_s, ctype p_el) /*@modifies p_s@*/; | |
34 | ||
885824d3 | 35 | extern /*@unused@*/ /*@only@*/ cstring ctypeList_unparse (ctypeList) /*@*/ ; |
36 | extern void ctypeList_free (/*@only@*/ /*@only@*/ ctypeList p_s) /*@modifies p_s@*/; | |
37 | ||
38 | extern /*@falsenull@*/ bool ctypeList_isDefined (/*@null@*/ ctypeList p_ct) /*@*/ ; | |
39 | extern /*@unused@*/ /*@truenull@*/ bool | |
40 | ctypeList_isUndefined (/*@null@*/ ctypeList p_ct) /*@*/ ; | |
41 | ||
42 | /*@constant null ctypeList ctypeList_undefined; @*/ | |
43 | # define ctypeList_undefined ((ctypeList) NULL) | |
44 | ||
45 | # define ctypeList_isDefined(ct) ((ct) != ctypeList_undefined) | |
46 | # define ctypeList_isUndefined(ct) ((ct) == ctypeList_undefined) | |
47 | ||
28bf4b0b | 48 | /*@iter ctypeList_elements (sef ctypeList x, yield ctype el); @*/ |
49 | # define ctypeList_elements(x, m_el) \ | |
50 | { if (!ctypeList_isUndefined(x)) \ | |
51 | { int m_ind; ctype *m_elements = &((x)->elements[0]); \ | |
52 | for (m_ind = 0 ; m_ind < (x)->nelements; m_ind++) \ | |
53 | { ctype m_el = *(m_elements++); | |
54 | ||
55 | # define end_ctypeList_elements }}} | |
56 | ||
885824d3 | 57 | /*@constant int ctypeListBASESIZE;@*/ |
58 | # define ctypeListBASESIZE SMALLBASESIZE | |
59 | ||
60 | # else | |
61 | # error "Multiple include" | |
62 | # endif | |
63 | ||
64 | ||
65 | ||
66 |