]>
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 | # if !defined(BOOL_H) | |
7 | ||
8 | # define BOOL_H | |
9 | ||
10 | # ifndef FALSE | |
11 | # define FALSE 0 | |
12 | # endif | |
13 | ||
14 | # ifndef TRUE | |
15 | # define TRUE (! FALSE) | |
16 | # endif | |
17 | ||
18 | extern /*@observer@*/ cstring bool_unparse (bool p_b) /*@*/ ; | |
19 | extern /*@observer@*/ cstring bool_dump (bool p_b) /*@*/ ; | |
20 | extern /*@unused@*/ bool bool_not (bool p_b) /*@*/ ; | |
21 | extern bool bool_equal (bool p_b1, bool p_b2) /*@*/ ; | |
22 | extern int bool_compare (bool p_b1, bool p_b2) /*@*/ ; | |
23 | extern bool bool_fromInt (int p_i) /*@*/ ; | |
24 | extern int bool_toInt (bool p_b) /*@*/ ; | |
25 | ||
885824d3 | 26 | # define bool_unparse(b) (cstring_makeLiteralTemp ((b) ? "true" : "false" )) |
27 | # define bool_dump(b) (cstring_makeLiteralTemp ((b) ? "1" : "0" )) | |
28 | # define bool_not(b) ((b) ? FALSE : TRUE) | |
29 | # define bool_equal(a,b) ((a) ? (b) : !(b)) | |
30 | # define bool_compare(a,b) ((a) ? ((b) ? 0 : 1) : ((b) ? -1 : 0)) | |
31 | # define bool_fromInt(i) (((i) != 0) ? TRUE : FALSE) | |
32 | # define bool_toInt(b) ((b) ? 1 : 0) | |
33 | ||
34 | # else | |
35 | # error "Multiple include" | |
36 | # endif | |
37 | ||
38 | ||
39 | ||
40 |