]>
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 cstringSList_H | |
7 | # define cstringSList_H | |
8 | ||
9 | typedef /*@observer@*/ cstring ob_cstring; | |
10 | ||
28bf4b0b | 11 | abst_typedef /*@null@*/ struct s_cstringSList |
885824d3 | 12 | { |
13 | int nelements; | |
14 | int nspace; | |
15 | /*@reldef@*/ /*@relnull@*/ ob_cstring *elements; | |
16 | } *cstringSList ; | |
17 | ||
18 | /*@constant null cstringSList cstringSList_undefined;@*/ | |
19 | # define cstringSList_undefined ((cstringSList) NULL) | |
20 | ||
21 | extern /*@falsenull@*/ bool cstringSList_isDefined (cstringSList p_s) /*@*/ ; | |
22 | # define cstringSList_isDefined(s) ((s) != cstringSList_undefined) | |
23 | ||
24 | extern int cstringSList_size (/*@sef@*/ cstringSList) /*@*/ ; | |
25 | # define cstringSList_size(s) (cstringSList_isDefined (s) ? (s)->nelements : 0) | |
26 | ||
27 | extern /*@falsenull@*/ bool cstringSList_empty (/*@sef@*/ cstringSList) /*@*/ ; | |
28 | # define cstringSList_empty(s) (cstringSList_size(s) == 0) | |
29 | ||
30 | extern /*@unused@*/ cstring cstringSList_unparseSep (cstringSList p_s, cstring p_sep) /*@*/ ; | |
31 | ||
32 | extern /*@only@*/ cstringSList cstringSList_new (void) /*@*/ ; | |
33 | ||
34 | extern /*@unused@*/ /*@only@*/ cstringSList cstringSList_single (/*@exposed@*/ cstring p_el) /*@*/ ; | |
35 | ||
36 | extern cstringSList | |
37 | cstringSList_add (/*@returned@*/ cstringSList p_s, /*@exposed@*/ cstring p_el) | |
38 | /*@modifies p_s@*/ ; | |
39 | ||
40 | extern void cstringSList_alphabetize (cstringSList p_s); | |
41 | ||
28bf4b0b | 42 | extern /*@observer@*/ cstring cstringSList_get (cstringSList p_s, int p_index) /*@*/ ; |
43 | ||
885824d3 | 44 | extern /*@only@*/ cstring cstringSList_unparseAbbrev (cstringSList p_s) /*@*/ ; |
45 | extern /*@unused@*/ /*@only@*/ cstring cstringSList_unparse (cstringSList p_s) ; | |
46 | extern void cstringSList_free (/*@only@*/ cstringSList p_s) ; | |
47 | ||
48 | extern void cstringSList_printSpaced (cstringSList p_s, int p_indent, int p_gap, int p_linelen); | |
49 | ||
50 | /*@constant int cstringSListBASESIZE;@*/ | |
51 | # define cstringSListBASESIZE MIDBASESIZE | |
52 | ||
53 | /*@iter cstringSList_elements (sef cstringSList x, yield exposed cstring el); @*/ | |
54 | # define cstringSList_elements(x, m_el) \ | |
55 | { if (cstringSList_isDefined (x)) { \ | |
56 | int m_ind; cstring *m_elements = &((x)->elements[0]); \ | |
57 | for (m_ind = 0 ; m_ind < (x)->nelements; m_ind++) \ | |
58 | { cstring m_el = *(m_elements++); | |
59 | ||
60 | # define end_cstringSList_elements }}} | |
61 | ||
62 | # else | |
63 | # error "Multiple include" | |
64 | # endif | |
65 | ||
66 | ||
67 | ||
68 |