]> andersk Git - splint.git/blame - src/Headers/ltokenList.h
Renamed truenull nullwhentrue and falsenull falsewhennull
[splint.git] / src / Headers / ltokenList.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 LTOKENLIST_H
7# define LTOKENLIST_H
8
28bf4b0b 9abst_typedef /*@null@*/ struct
885824d3 10{
11 int nelements;
12 int nspace;
13 int current;
14 /*@reldef@*/ /*@relnull@*/ o_ltoken *elements;
15} *ltokenList ;
16
17/*@iter ltokenList_elements (sef ltokenList x, yield exposed ltoken el); @*/
18# define ltokenList_elements(x, m_el) \
19 { if (ltokenList_isDefined(x)) { \
20 int m_ind; ltoken *m_elements = &((x)->elements[0]); \
21 for (m_ind = 0 ; m_ind < (x)->nelements; m_ind++) \
22 { ltoken m_el; m_el = *m_elements; m_elements++;
23
24# define end_ltokenList_elements }}}
25
26/*
27** ltokenList_elements is split up to avoid compiler bugs
28** and incompatibilities in older C compilers. This has caused problems
29** on both RS/AIX and SGI IRIX machines.
30*/
31
32/*@constant null ltokenList ltokenList_undefined;@*/
33# define ltokenList_undefined NULL
34
0e41eb0e 35extern /*@falsewhennull@*/ bool ltokenList_isDefined (ltokenList p_s) /*@*/ ;
885824d3 36# define ltokenList_isDefined(s) ((s) != ltokenList_undefined)
37
0e41eb0e 38extern /*@nullwhentrue@*/ bool ltokenList_isUndefined (ltokenList p_s) /*@*/ ;
885824d3 39# define ltokenList_isUndefined(s) ((s) == ltokenList_undefined)
40
41extern int ltokenList_size (/*@sef@*/ ltokenList p_s) /*@*/ ;
42extern bool ltokenList_empty (/*@sef@*/ ltokenList p_s) /*@*/ ;
43extern /*@unused@*/ bool ltokenList_isEmpty (/*@sef@*/ ltokenList p_s) /*@*/ ;
44
45# define ltokenList_size(s) (ltokenList_isUndefined(s) ? 0 : (s)->nelements)
46# define ltokenList_empty(s) (ltokenList_isUndefined(s) || ltokenList_size(s) == 0)
47# define ltokenList_isEmpty(s) (ltokenList_empty(s))
48
49extern /*@only@*/ /*@notnull@*/ ltokenList ltokenList_new (void) /*@*/ ;
50extern void ltokenList_addh (ltokenList p_s, /*@only@*/ ltoken p_el) /*@modifies p_s@*/ ;
51
52extern void ltokenList_reset (ltokenList p_s) /*@modifies p_s@*/ ;
53extern void ltokenList_advance (ltokenList p_s) /*@modifies p_s@*/ ;
54
55extern /*@only@*/ cstring ltokenList_unparse (ltokenList p_s) /*@*/ ;
56extern void ltokenList_free (/*@only@*/ ltokenList p_s) ;
57
58extern /*@observer@*/ ltoken ltokenList_head (ltokenList p_s) /*@*/ ;
59extern /*@observer@*/ ltoken ltokenList_current (ltokenList p_s) /*@*/ ;
60
61extern /*@only@*/ ltokenList ltokenList_copy (ltokenList p_s) /*@*/ ;
62extern /*@only@*/ /*@notnull@*/ ltokenList ltokenList_singleton (/*@only@*/ ltoken p_l);
63extern ltokenList ltokenList_push (/*@returned@*/ ltokenList p_s, /*@only@*/ ltoken p_el);
64extern bool ltokenList_equal (ltokenList p_s1, ltokenList p_s2) /*@*/ ;
65extern bool ltokenList_isFinished (ltokenList p_s) /*@*/ ;
66extern void ltokenList_removeCurrent (ltokenList p_s) /*@modifies p_s@*/ ;
67
68/*@constant int ltokenListBASESIZE;@*/
69# define ltokenListBASESIZE SMALLBASESIZE
70
71# else
72# error "Multiple include"
73# endif
74
75
76
77
This page took 0.212317 seconds and 5 git commands to generate.