]> andersk Git - splint.git/blame - src/Headers/ynm.h
Fix tracker issue 1837229.
[splint.git] / src / Headers / ynm.h
CommitLineData
885824d3 1/*
c0de361f 2** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2003.
885824d3 3** See ../LICENSE for license information.
4*/
5
6# if !defined(YNM_H)
7# define YNM_H
8
9typedef enum { NO, YES, MAYBE } ynm;
10
11extern /*@observer@*/ cstring ynm_unparse (/*@sef@*/ ynm p_b) /*@*/ ;
12extern /*@observer@*/ cstring ynm_unparseCode (/*@sef@*/ ynm p_b) /*@*/ ;
13extern bool ynm_toBoolStrict (ynm p_b) /*@*/ ;
14extern bool ynm_toBoolRelaxed (ynm p_b) /*@*/ ;
15extern ynm ynm_fromBool (bool p_b) /*@*/ ;
16extern bool ynm_isOff (ynm p_b) /*@*/ ;
17extern bool ynm_isOn (ynm p_b) /*@*/ ;
18extern bool ynm_isMaybe (ynm p_b) /*@*/ ;
19extern int ynm_compare (ynm p_x, ynm p_y) /*@*/ ;
20extern 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.070022 seconds and 5 git commands to generate.