* boolean.h: Added SCM_BOOL, SCM_NEGATE_BOOL, SCM_BOOLP to here,
[bpt/guile.git] / libguile / boolean.h
index 52a28b5..59c7df2 100644 (file)
 #define SCM_FALSEP(x)          (SCM_BOOL_F == (x))
 #define SCM_NFALSEP(x)                 (SCM_BOOL_F != (x))
 
+#define SCM_BOOLP(x) ((x) == SCM_BOOL_T || (x) == SCM_BOOL_F)
+
+/* Convert from a C boolean to a SCM boolean value */
+#define SCM_BOOL(f) ((f)? SCM_BOOL_T : SCM_BOOL_F)
+
+/* Convert from a C boolean to a SCM boolean value and negate it */
+#define SCM_NEGATE_BOOL(f) ((f)? SCM_BOOL_F : SCM_BOOL_T)
+
 /* SCM_BOOL_NOT returns the other boolean.  
  * The order of ^s here is important for Borland C++ (!?!?!)
  */