]>
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 | ** boolStack.h | |
8 | */ | |
9 | ||
10 | # ifndef boolStack_H | |
11 | # define boolStack_H | |
12 | ||
13 | typedef struct _boolStack | |
14 | { | |
15 | int nelements; | |
16 | int nspace; | |
17 | int current; | |
18 | /*@reldef@*/ bool *elements; | |
19 | } _boolStack ; | |
20 | ||
21 | typedef _boolStack *boolStack ; | |
22 | ||
23 | # define boolStack_size(s) ((s)->nelements) | |
24 | # define boolStack_isEmpty(s) (boolStack_size(s) == 0) | |
25 | # define boolStack_empty(s) (boolStack_size(s) == 0) | |
26 | ||
27 | extern boolStack boolStack_new(void); | |
28 | ||
29 | extern void boolStack_push (boolStack s, bool el) ; | |
30 | extern void boolStack_pop (boolStack s) ; | |
31 | extern bool boolStack_top (boolStack s) ; | |
32 | ||
33 | extern cstring boolStack_unparse (boolStack s) ; | |
34 | extern void boolStack_free (/*@only@*/ boolStack s) ; | |
35 | extern void boolStack_switchTop (boolStack s); | |
36 | ||
37 | # define boolStackBASESIZE MIDBASESIZE | |
38 | ||
39 | # else | |
40 | # error "Multiple include" | |
41 | # endif | |
42 | ||
43 | ||
44 | ||
45 |