]>
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 | ** lslOpSet.h | |
8 | ** | |
9 | ** based on set_template.h | |
10 | */ | |
11 | ||
12 | # ifndef lslOpSET_H | |
13 | # define lslOpSET_H | |
14 | ||
28bf4b0b | 15 | abst_typedef /*@null@*/ struct |
885824d3 | 16 | { |
17 | int entries; | |
18 | int nspace; | |
19 | /*@reldef@*/ /*@relnull@*/ o_lslOp *elements; | |
20 | } *lslOpSet ; | |
21 | ||
22 | /*@iter lslOpSet_elements (sef lslOpSet s, yield exposed lslOp el); @*/ | |
23 | # define lslOpSet_elements(x, m_el) \ | |
24 | { if (lslOpSet_isDefined (x)) { int m_ind; \ | |
25 | for (m_ind = 0 ; m_ind < (x)->entries; m_ind++) \ | |
26 | { lslOp m_el = (x)->elements[m_ind]; | |
27 | ||
28 | # define end_lslOpSet_elements }}} | |
29 | ||
30 | /*@constant null lslOpSet lslOpSet_undefined;@*/ | |
31 | # define lslOpSet_undefined ((lslOpSet) NULL) | |
32 | ||
33 | extern /*@falsenull@*/ bool lslOpSet_isDefined (lslOpSet p_s) /*@*/ ; | |
34 | # define lslOpSet_isDefined(s) ((s) != lslOpSet_undefined) | |
35 | ||
36 | extern /*@unused@*/ int | |
37 | lslOpSet_size (/*@sef@*/ lslOpSet p_s) /*@*/ ; | |
38 | ||
39 | # define lslOpSet_size(s) \ | |
40 | (lslOpSet_isDefined(s) ? (s)->entries : 0) | |
41 | ||
42 | extern /*@only@*/ lslOpSet lslOpSet_new (void) /*@*/ ; | |
43 | extern bool lslOpSet_insert (lslOpSet p_s, /*@only@*/ lslOp p_el) | |
44 | /*@modifies p_s@*/ ; | |
45 | ||
46 | extern /*@unused@*/ /*@only@*/ cstring lslOpSet_unparse (lslOpSet p_s) /*@*/ ; | |
47 | extern void lslOpSet_free (/*@only@*/ lslOpSet p_s); | |
48 | extern /*@only@*/ lslOpSet lslOpSet_copy (lslOpSet p_s) /*@*/ ; | |
49 | ||
50 | /*@constant int lslOpSetBASESIZE;@*/ | |
51 | # define lslOpSetBASESIZE MIDBASESIZE | |
52 | ||
53 | # else | |
54 | # error "Multiple include" | |
55 | # endif |