]> andersk Git - splint.git/blob - src/Headers/cstringSList.h
Initial revision
[splint.git] / src / Headers / cstringSList.h
1 /*
2 ** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2000.
3 ** See ../LICENSE for license information.
4 **
5 */
6 # ifndef cstringSList_H
7 # define cstringSList_H
8
9 typedef /*@observer@*/ cstring ob_cstring;
10
11 abst_typedef /*@null@*/ struct _cstringSList
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
42 extern /*@only@*/ cstring cstringSList_unparseAbbrev (cstringSList p_s) /*@*/ ;
43 extern /*@unused@*/ /*@only@*/ cstring cstringSList_unparse (cstringSList p_s) ;
44 extern void cstringSList_free (/*@only@*/ cstringSList p_s) ;
45
46 extern void cstringSList_printSpaced (cstringSList p_s, int p_indent, int p_gap, int p_linelen);
47
48 /*@constant int cstringSListBASESIZE;@*/
49 # define cstringSListBASESIZE MIDBASESIZE
50
51 /*@iter cstringSList_elements (sef cstringSList x, yield exposed cstring el); @*/
52 # define cstringSList_elements(x, m_el) \
53    { if (cstringSList_isDefined (x)) { \
54        int m_ind; cstring *m_elements = &((x)->elements[0]); \
55          for (m_ind = 0 ; m_ind < (x)->nelements; m_ind++) \
56            { cstring m_el = *(m_elements++); 
57
58 # define end_cstringSList_elements }}}
59
60 # else
61 # error "Multiple include"
62 # endif
63
64
65
66
This page took 0.053193 seconds and 5 git commands to generate.