2 ** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2001.
3 ** See ../LICENSE for license information.
9 abst_typedef /*@null@*/ struct s_cstringList
13 /*@reldef@*/ /*@relnull@*/ o_cstring *elements;
16 /*@constant null cstringList cstringList_undefined;@*/
17 # define cstringList_undefined ((cstringList) NULL)
19 extern /*@falsenull@*/ bool cstringList_isDefined (cstringList p_s) /*@*/ ;
20 # define cstringList_isDefined(s) ((s) != cstringList_undefined)
22 extern int cstringList_size (/*@sef@*/ cstringList) /*@*/ ;
23 # define cstringList_size(s) (cstringList_isDefined (s) ? (s)->nelements : 0)
25 extern /*@unused@*/ /*@falsenull@*/ bool cstringList_empty (/*@sef@*/ cstringList) /*@*/ ;
26 # define cstringList_empty(s) (cstringList_size(s) == 0)
28 extern cstring cstringList_unparseSep (cstringList p_s, cstring p_sep) /*@*/ ;
30 extern /*@unused@*/ /*@only@*/ cstringList cstringList_new (void) /*@*/ ;
32 extern /*@only@*/ cstringList cstringList_single (/*@keep@*/ cstring p_el) /*@*/ ;
35 cstringList_add (/*@returned@*/ cstringList p_s, /*@keep@*/ cstring p_el)
38 extern /*@only@*/ cstringList
39 cstringList_prepend (/*@only@*/ /*@returned@*/ cstringList p_s,
40 /*@keep@*/ cstring p_el)
43 extern bool cstringList_contains (cstringList p_s, cstring p_key) /*@*/ ;
44 extern int cstringList_getIndex (cstringList p_s, cstring p_key) /*@*/ ;
45 extern /*@observer@*/ cstring cstringList_get (cstringList p_s, int p_index) /*@*/ ;
47 extern /*@unused@*/ void cstringList_alphabetize (cstringList p_s);
48 extern /*@unused@*/ /*@only@*/ cstring cstringList_unparseAbbrev (cstringList p_s) /*@*/ ;
49 extern /*@unused@*/ /*@only@*/ cstring cstringList_unparse (cstringList p_s) ;
50 extern void cstringList_free (/*@only@*/ cstringList p_s) ;
52 extern /*@unused@*/ void cstringList_printSpaced (cstringList p_s, int p_indent, int p_gap, int p_linelen);
54 extern /*@only@*/ cstringList cstringList_copy (cstringList p_s) /*@*/ ;
56 /*@constant int cstringListBASESIZE;@*/
57 # define cstringListBASESIZE MIDBASESIZE
59 /*@iter cstringList_elements (sef cstringList x, yield exposed cstring el); @*/
60 # define cstringList_elements(x, m_el) \
61 { if (cstringList_isDefined (x)) { \
62 int m_ind; cstring *m_elements = &((x)->elements[0]); \
63 for (m_ind = 0 ; m_ind < (x)->nelements; m_ind++) \
64 { cstring m_el = *(m_elements++);
66 # define end_cstringList_elements }}}
69 # error "Multiple include"