]>
Commit | Line | Data |
---|---|---|
885824d3 | 1 | #ifndef BOOL_H |
2 | #define BOOL_H | |
3 | ||
4 | #ifndef FALSE | |
5 | #define FALSE 0 | |
6 | #endif | |
7 | ||
8 | #ifndef TRUE | |
9 | #define TRUE (!FALSE) | |
10 | #endif | |
11 | ||
12 | /* bool is a keyword in C++ */ | |
13 | /*@-cppnames@*/ | |
14 | typedef int bool; | |
15 | /*@=cppnames@*/ | |
16 | ||
17 | /* | |
18 | ** bool_initMod has no real effect | |
6fcd0b1e | 19 | ** Declared with modifies internalState, so no warnings about no effects are |
20 | ** reported when it is called. | |
885824d3 | 21 | */ |
22 | ||
23 | extern /*@unused@*/ void bool_initMod (void) /*@modifies internalState@*/ ; | |
24 | /*@-mustmod@*/ | |
25 | # define bool_initMod() | |
26 | /*@=mustmod@*/ | |
27 | ||
28 | extern /*@unused@*/ /*@observer@*/ char *bool_unparse (bool) /*@*/ ; | |
29 | # define bool_unparse(b) ((b) ? "true" : "false" ) | |
30 | ||
31 | extern /*@unused@*/ bool bool_not (bool) /*@*/ ; | |
32 | # define bool_not(b) ((b) ? FALSE : TRUE) | |
33 | ||
34 | extern /*@unused@*/ bool bool_equal (bool, bool) /*@*/ ; | |
35 | # define bool_equal(a,b) ((a) ? (b) : !(b)) | |
36 | ||
37 | # endif |