]> andersk Git - splint.git/blame - src/Headers/cstringList.h
Added splint.spec file contributed by Heiko Abraham
[splint.git] / src / Headers / cstringList.h
CommitLineData
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 cstringList_H
7# define cstringList_H
8
28bf4b0b 9abst_typedef /*@null@*/ struct s_cstringList
885824d3 10{
11 int nelements;
12 int nspace;
13 /*@reldef@*/ /*@relnull@*/ o_cstring *elements;
14} *cstringList ;
15
16/*@constant null cstringList cstringList_undefined;@*/
17# define cstringList_undefined ((cstringList) NULL)
18
0e41eb0e 19extern /*@falsewhennull@*/ bool cstringList_isDefined (cstringList p_s) /*@*/ ;
885824d3 20# define cstringList_isDefined(s) ((s) != cstringList_undefined)
21
22extern int cstringList_size (/*@sef@*/ cstringList) /*@*/ ;
23# define cstringList_size(s) (cstringList_isDefined (s) ? (s)->nelements : 0)
24
0e41eb0e 25extern /*@unused@*/ /*@falsewhennull@*/ bool cstringList_empty (/*@sef@*/ cstringList) /*@*/ ;
885824d3 26# define cstringList_empty(s) (cstringList_size(s) == 0)
27
28extern cstring cstringList_unparseSep (cstringList p_s, cstring p_sep) /*@*/ ;
29
30extern /*@unused@*/ /*@only@*/ cstringList cstringList_new (void) /*@*/ ;
31
32extern /*@only@*/ cstringList cstringList_single (/*@keep@*/ cstring p_el) /*@*/ ;
33
34extern cstringList
35 cstringList_add (/*@returned@*/ cstringList p_s, /*@keep@*/ cstring p_el)
36 /*@modifies p_s@*/ ;
37
28bf4b0b 38extern /*@only@*/ cstringList
39 cstringList_prepend (/*@only@*/ /*@returned@*/ cstringList p_s,
40 /*@keep@*/ cstring p_el)
41 /*@modifies p_s@*/ ;
42
43extern bool cstringList_contains (cstringList p_s, cstring p_key) /*@*/ ;
44extern int cstringList_getIndex (cstringList p_s, cstring p_key) /*@*/ ;
45extern /*@observer@*/ cstring cstringList_get (cstringList p_s, int p_index) /*@*/ ;
46
885824d3 47extern /*@unused@*/ void cstringList_alphabetize (cstringList p_s);
48extern /*@unused@*/ /*@only@*/ cstring cstringList_unparseAbbrev (cstringList p_s) /*@*/ ;
49extern /*@unused@*/ /*@only@*/ cstring cstringList_unparse (cstringList p_s) ;
50extern void cstringList_free (/*@only@*/ cstringList p_s) ;
51
abd7f895 52extern /*@unused@*/ void cstringList_printSpaced (cstringList p_s, size_t p_indent, size_t p_gap, int p_linelen);
885824d3 53
28bf4b0b 54extern /*@only@*/ cstringList cstringList_copy (cstringList p_s) /*@*/ ;
55
885824d3 56/*@constant int cstringListBASESIZE;@*/
57# define cstringListBASESIZE MIDBASESIZE
58
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++);
65
66# define end_cstringList_elements }}}
67
68# else
69# error "Multiple include"
70# endif
71
72
73
74
This page took 0.520637 seconds and 5 git commands to generate.