2 ** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2003.
3 ** See ../LICENSE for license information.
6 # ifndef cstringSList_H
7 # define cstringSList_H
9 typedef /*@observer@*/ cstring ob_cstring
;
15 /*@reldef@*/ /*@relnull@*/ ob_cstring
*elements
;
18 /*@constant null cstringSList cstringSList_undefined;@*/
19 # define cstringSList_undefined ((cstringSList) NULL)
21 extern /*@falsewhennull@*/ bool cstringSList_isDefined (cstringSList p_s
) /*@*/ ;
22 # define cstringSList_isDefined(s) ((s) != cstringSList_undefined)
24 extern int cstringSList_size (/*@sef@*/ cstringSList
) /*@*/ ;
25 # define cstringSList_size(s) (cstringSList_isDefined (s) ? (s)->nelements : 0)
27 extern /*@falsewhennull@*/ bool cstringSList_empty (/*@sef@*/ cstringSList
) /*@*/ ;
28 # define cstringSList_empty(s) (cstringSList_size(s) == 0)
30 extern /*@only@*/ cstringSList
cstringSList_new (void) /*@*/ ;
33 cstringSList_add (/*@returned@*/ cstringSList p_s
, /*@exposed@*/ cstring p_el
)
36 extern void cstringSList_alphabetize (cstringSList p_s
);
38 extern /*@only@*/ cstring
cstringSList_unparseAbbrev (cstringSList p_s
) /*@*/ ;
39 extern /*@unused@*/ /*@only@*/ cstring
cstringSList_unparse (cstringSList p_s
) /*@*/ ;
40 extern void cstringSList_free (/*@only@*/ cstringSList p_s
) ;
42 extern void cstringSList_printSpaced (cstringSList p_s
, size_t p_indent
, size_t p_gap
, int p_linelen
);
44 /*@constant int cstringSListBASESIZE;@*/
45 # define cstringSListBASESIZE MIDBASESIZE
47 /*@iter cstringSList_elements (sef cstringSList x, yield exposed cstring el); @*/
48 # define cstringSList_elements(x, m_el) \
49 { if (cstringSList_isDefined (x)) { \
50 int m_ind; cstring *m_elements = &((x)->elements[0]); \
51 for (m_ind = 0 ; m_ind < (x)->nelements; m_ind++) \
52 { cstring m_el = *(m_elements++);
54 # define end_cstringSList_elements }}}
57 # error "Multiple include"