C API functions can accept or return boolean values of
Qfalse. These can be converted to and from a C program's idea of true and false as follows:
- To convert a
VALUEto a C boolean, use
RTEST(val);. This evaluates as false if
Qnil, and true otherwise.
- To convert a C boolean to a
flag ? Qtrue : Qfalse.
dl.h has a macro
INT2BOOL that converts a C boolean to a VALUE; but it is not clear that dl.h is meant to be used in extensions.