]>
Commit | Line | Data |
---|---|---|
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 | /* | |
7 | ** intSet.h | |
8 | ** | |
9 | ** based on set_template.h | |
10 | */ | |
11 | ||
12 | # ifndef intSET_H | |
13 | # define intSET_H | |
14 | ||
28bf4b0b | 15 | abst_typedef struct |
885824d3 | 16 | { |
17 | int entries; | |
18 | int nspace; | |
19 | /*@reldef@*/ /*@relnull@*/ int *elements; | |
20 | } *intSet; | |
21 | ||
22 | /*@iter intSet_elements (sef intSet s, yield int el)@*/ | |
23 | # define intSet_elements(x, m_el) \ | |
24 | { int m_ind; for (m_ind = 0 ; m_ind < (x)->entries; m_ind++) \ | |
25 | { int m_el = (x)->elements[m_ind]; | |
26 | ||
27 | # define end_intSet_elements }} | |
28 | ||
29 | extern /*@only@*/ intSet intSet_new (void); | |
30 | ||
31 | extern bool intSet_isEmpty (intSet p_s); | |
32 | # define intSet_isEmpty(s) ((s)->entries == 0) | |
33 | ||
34 | extern int intSet_size (intSet p_s); | |
35 | # define intSet_size(s) ((s)->entries) | |
36 | ||
37 | extern bool intSet_insert (intSet p_s, int p_el); | |
38 | extern /*@unused@*/ bool intSet_member (intSet p_s, int p_el); | |
39 | extern /*@only@*/ /*@unused@*/ cstring intSet_unparse (intSet p_s); | |
40 | extern void intSet_free (/*@only@*/ intSet p_s); | |
41 | ||
42 | # ifndef NOLCL | |
43 | extern /*@only@*/ cstring intSet_unparseText (intSet p_s); | |
44 | # endif | |
45 | ||
46 | /*@constant int intSetBASESIZE;@*/ | |
47 | # define intSetBASESIZE SMALLBASESIZE | |
48 | ||
49 | # else | |
50 | # error "Multiple include" | |
51 | # endif | |
52 | ||
53 | ||
54 |