]> andersk Git - splint.git/blob - src/Headers/ynm.h
7f2da0ecea1bcef9e72537a167742aeb7fc23722
[splint.git] / src / Headers / ynm.h
1 /*
2 ** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2001.
3 ** See ../LICENSE for license information.
4 */
5
6 # if !defined(YNM_H)
7 # define YNM_H
8
9 typedef enum { NO, YES, MAYBE } ynm;
10
11 extern /*@observer@*/ cstring ynm_unparse (/*@sef@*/ ynm p_b) /*@*/ ;
12 extern /*@observer@*/ cstring ynm_unparseCode (/*@sef@*/ ynm p_b) /*@*/ ;
13 extern bool ynm_toBoolStrict (ynm p_b) /*@*/ ;
14 extern bool ynm_toBoolRelaxed (ynm p_b) /*@*/ ;
15 extern ynm ynm_fromBool (bool p_b) /*@*/ ;
16 extern bool ynm_isOff (ynm p_b) /*@*/ ;
17 extern bool ynm_isOn (ynm p_b) /*@*/ ;
18 extern bool ynm_isMaybe (ynm p_b) /*@*/ ;
19 extern int ynm_compare (ynm p_x, ynm p_y) /*@*/ ;
20 extern ynm ynm_fromCodeChar (char p_c) /*@*/ ;
21
22 # define ynm_unparse(b) \
23   (cstring_makeLiteralTemp (((b) == NO) ? "no" : ((b) == YES) ? "yes" : "maybe"))
24 # define ynm_unparseCode(b) \
25   (cstring_makeLiteralTemp (((b) == NO) ? "-" : ((b) == YES) ? "+" : "="))
26
27 # define ynm_toBoolStrict(y) ((y) == YES)
28 # define ynm_toBoolRelaxed(y) ((y) != NO)
29 # define ynm_fromBool(b)   ((b) ? YES : NO)
30 # define ynm_isOff(y)      ((y) == NO)
31 # define ynm_isOn(y)       ((y) == YES)
32 # define ynm_isMaybe(y)    ((y) == MAYBE)
33
34 # else
35 # error "Multiple include"
36 # endif
37
This page took 0.025794 seconds and 3 git commands to generate.