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 /*@unused@*/ cstring cstringSList_unparseSep (cstringSList p_s, cstring p_sep) /*@*/ ;
32 extern /*@only@*/ cstringSList cstringSList_new (void) /*@*/ ;
34 extern /*@unused@*/ /*@only@*/ cstringSList cstringSList_single (/*@exposed@*/ cstring p_el) /*@*/ ;
37 cstringSList_add (/*@returned@*/ cstringSList p_s, /*@exposed@*/ cstring p_el)
40 extern void cstringSList_alphabetize (cstringSList p_s);
42 extern /*@observer@*/ cstring cstringSList_get (cstringSList p_s, int p_index) /*@*/ ;
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) ;
48 extern void cstringSList_printSpaced (cstringSList p_s, size_t p_indent, size_t p_gap, int p_linelen);
50 /*@constant int cstringSListBASESIZE;@*/
51 # define cstringSListBASESIZE MIDBASESIZE
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++);
60 # define end_cstringSList_elements }}}
63 # error "Multiple include"