]> andersk Git - splint.git/blob - src/Headers/fcnNodeList.h
Fixed problem with NULL being changed.
[splint.git] / src / Headers / fcnNodeList.h
1 /*
2 ** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2003.
3 ** See ../LICENSE for license information.
4 **
5 */
6
7 # ifndef FCNNODELIST_H
8 # define FCNNODELIST_H
9
10 typedef /*@only@*/ fcnNode o_fcnNode;
11
12 abst_typedef /*@null@*/ struct
13 {
14   int nelements;
15   int nspace;
16   /*@reldef@*/ /*@relnull@*/ o_fcnNode  *elements;
17 } *fcnNodeList;
18
19 /*@iter fcnNodeList_elements (sef fcnNodeList x, yield exposed fcnNode el); @*/
20 # define fcnNodeList_elements(x, m_el) \
21    if (fcnNodeList_isDefined (x)) \
22      { int m_ind; fcnNode *m_elements = &((x)->elements[0]); \
23        for (m_ind = 0 ; m_ind < (x)->nelements; m_ind++) \
24           { fcnNode m_el = *(m_elements++); 
25
26 # define end_fcnNodeList_elements }}
27
28 /*@constant null fcnNodeList fcnNodeList_undefined; @*/
29 # define fcnNodeList_undefined ((fcnNodeList)0)
30
31 extern /*@falsewhennull@*/ bool fcnNodeList_isDefined (fcnNodeList p_f);
32 # define fcnNodeList_isDefined(f) ((f) != fcnNodeList_undefined)
33
34 extern /*@unused@*/ /*@nullwhentrue@*/ bool 
35   fcnNodeList_isUndefined (fcnNodeList p_f);
36 # define fcnNodeList_isUndefined(f) ((f) == fcnNodeList_undefined)
37
38 extern int fcnNodeList_size (/*@sef@*/ fcnNodeList p_f);
39 extern bool fcnNodeList_isEmpty (/*@sef@*/ fcnNodeList p_f);
40
41 # define fcnNodeList_size(s)  (fcnNodeList_isDefined(s) ? (s)->nelements : 0)
42 # define fcnNodeList_isEmpty(s) (fcnNodeList_size(s) == 0)
43
44 extern /*@only@*/ fcnNodeList fcnNodeList_new(void);
45 extern fcnNodeList fcnNodeList_add (/*@returned@*/ fcnNodeList p_s, /*@keep@*/ fcnNode p_el) ;
46
47
48 extern /*@unused@*/ /*@only@*/ cstring fcnNodeList_unparse (fcnNodeList p_s) ;
49 extern void fcnNodeList_free (/*@null@*/ /*@only@*/ fcnNodeList p_s) ;
50
51 /*@constant int fcnNodeListBASESIZE;@*/
52 # define fcnNodeListBASESIZE SMALLBASESIZE
53
54 # else
55 # error "Multiple include"
56 # endif
57
58
59
60
This page took 0.03935 seconds and 5 git commands to generate.