]> andersk Git - splint.git/blob - src/Headers/usymIdSet.h
57dc1161aed14c992dccc82bb6be3be21e10370f
[splint.git] / src / Headers / usymIdSet.h
1 /*
2 ** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2003.
3 ** See ../LICENSE for license information.
4 */
5 /*
6 ** usymIdSet.h
7 **
8 ** based on set_template.h
9 */
10
11 # ifndef USYMIDSET_H
12 # define USYMIDSET_H
13
14 # include "usymId.h"
15
16 abst_typedef /*@null@*/ struct
17 {
18   int entries;
19   int nspace;
20   /*@reldef@*/ /*@relnull@*/ usymId  *elements;
21 } *usymIdSet ;
22
23 extern usymIdSet usymIdSet_new(void);
24 extern bool usymIdSet_member (usymIdSet p_s, usymId p_el) /*@*/ ;
25 extern usymIdSet usymIdSet_subtract (usymIdSet p_s, usymIdSet p_t);
26 extern void usymIdSet_free (/*@only@*/ /*@only@*/ usymIdSet p_s);
27 extern /*@only@*/ cstring usymIdSet_unparse (usymIdSet p_ll);
28 extern /*@only@*/ cstring usymIdSet_dump (usymIdSet p_lset);
29 extern usymIdSet usymIdSet_undump (char **p_s);
30 extern /*@only@*/ usymIdSet usymIdSet_single (usymId p_t);
31
32 extern int usymIdSet_compare (usymIdSet p_l1, usymIdSet p_l2);
33
34 /*@constant int usymIdSetBASESIZE;@*/
35 # define usymIdSetBASESIZE SMALLBASESIZE
36
37 extern usymIdSet usymIdSet_newUnion (usymIdSet p_s1, usymIdSet p_s2) /*@*/ ;
38 extern usymIdSet usymIdSet_add (usymIdSet p_s, usymId p_el) /*@*/ ;
39
40 extern /*@only@*/ usymIdSet 
41   usymIdSet_removeFresh (/*@temp@*/ usymIdSet p_s, usymId p_el);
42
43 /*@constant null usymIdSet usymIdSet_undefined; @*/
44 # define usymIdSet_undefined    ((usymIdSet) NULL)
45
46 extern /*@falsewhennull@*/ bool usymIdSet_isDefined (usymIdSet p_s) /*@*/ ;
47 # define usymIdSet_isDefined(s) ((s) != usymIdSet_undefined)
48
49 extern /*@nullwhentrue@*/ bool usymIdSet_isUndefined (usymIdSet p_s) /*@*/ ;
50 # define usymIdSet_isUndefined(s) ((s) == usymIdSet_undefined)
51
52 /*@iter usymIdSet_elements (sef usymIdSet u, yield usymId el); @*/ 
53 # define usymIdSet_elements(x, m_el) \
54    { int m_ind; if (usymIdSet_isDefined (x)) { \
55      for (m_ind = 0 ; m_ind < usymIdSet_size(x); m_ind++) \
56        { usymId m_el = (x)->elements[m_ind];
57
58 # define end_usymIdSet_elements }}}
59
60 extern int usymIdSet_size (/*@sef@*/ usymIdSet p_s);
61 # define usymIdSet_size(s) (usymIdSet_isUndefined(s) ? 0 : (s)->entries)
62
63 # else
64 # error "Multiple include"
65 # endif
66
This page took 0.027917 seconds and 3 git commands to generate.