]>
Commit | Line | Data |
---|---|---|
885824d3 | 1 | /* |
2 | ** qualList.h (from slist_templace.h) | |
3 | */ | |
4 | ||
5 | # ifndef QUALLIST_H | |
6 | # define QUALLIST_H | |
7 | ||
28bf4b0b | 8 | abst_typedef /*@null@*/ struct |
885824d3 | 9 | { |
10 | int nelements; | |
11 | int free; | |
12 | /*@reldef@*/ /*@relnull@*/ qual *elements; | |
13 | } *qualList ; | |
14 | ||
15 | extern /*@falsenull@*/ bool qualList_isDefined (qualList p_s); | |
16 | extern /*@unused@*/ /*@truenull@*/ bool qualList_isUndefined (qualList p_s); | |
17 | ||
18 | /*@constant null qualList qualList_undefined; @*/ | |
19 | # define qualList_undefined ((qualList) NULL) | |
20 | ||
21 | # define qualList_isDefined(q) ((q) != qualList_undefined) | |
22 | # define qualList_isUndefined(q) ((q) == qualList_undefined) | |
23 | ||
24 | /*@iter qualList_elements (sef qualList x, yield qual el); @*/ | |
25 | # define qualList_elements(x, m_el) \ | |
26 | { if (qualList_isDefined(x)) { \ | |
27 | int m_ind; qual *m_elements = &((x)->elements[0]); \ | |
28 | for (m_ind = 0; m_ind < (x)->nelements; m_ind++) \ | |
29 | { qual m_el = *(m_elements++); | |
30 | ||
31 | # define end_qualList_elements }}} | |
32 | ||
33 | extern int qualList_size (/*@sef@*/ qualList p_s); | |
34 | # define qualList_size(s) (qualList_isDefined(s) ? (s)->nelements : 0) | |
35 | ||
36 | extern bool qualList_isEmpty (/*@sef@*/ qualList p_s); | |
37 | # define qualList_isEmpty(s) (qualList_size(s) == 0) | |
38 | ||
39 | extern qualList qualList_new (void) /*@*/ ; | |
40 | extern qualList qualList_add (/*@returned@*/ qualList p_s, qual p_el) | |
41 | /*@modifies p_s@*/; | |
42 | ||
43 | extern /*@only@*/ cstring qualList_unparse (qualList p_s) /*@*/ ; | |
44 | extern void qualList_free (/*@only@*/ qualList p_s) ; | |
45 | extern qualList qualList_appendList (/*@returned@*/ qualList p_s, qualList p_t); | |
46 | ||
47 | # ifndef NOLCL | |
48 | extern qualList qualList_copy (qualList p_s); | |
49 | extern /*@only@*/ cstring qualList_toCComments (qualList p_s); | |
50 | # endif | |
51 | ||
52 | extern void qualList_clear (qualList p_q); | |
53 | ||
54 | /*@constant int qualListBASESIZE;@*/ | |
55 | # define qualListBASESIZE 8 | |
56 | ||
57 | extern bool qualList_hasAliasQualifier (qualList p_s); | |
58 | extern bool qualList_hasExposureQualifier (qualList p_s); | |
59 | ||
1ac6313d | 60 | /* start modifications */ |
61 | extern bool qualList_hasNullTerminatedQualifier(qualList p_s); | |
28bf4b0b | 62 | |
63 | extern bool qualList_hasBufQualifiers(qualList p_s); | |
1ac6313d | 64 | |
65 | # define qualList_hasBufQualifiers(p_s) \ | |
66 | (qualList_hasNullTerminatedQualifier(p_s)) | |
67 | ||
68 | /* end modification/s */ | |
69 | ||
885824d3 | 70 | # else |
71 | # error "Multiple include" | |
72 | # endif | |
73 | ||
74 | ||
75 | ||
76 |