35 lines
694 B
C
35 lines
694 B
C
|
#ifndef boolean_h
|
||
|
#define boolean_h
|
||
|
|
||
|
/**
|
||
|
* \file boolean.h
|
||
|
* \brief Provides boolean variables in C.
|
||
|
* \author Thomas Stegemann
|
||
|
* \version $Id: boolean.h,v 1.1 2006/09/26 18:18:27 rschaten Exp $
|
||
|
*
|
||
|
* License: See documentation.
|
||
|
*/
|
||
|
|
||
|
/** Possible boolean values */
|
||
|
typedef enum E_Boolean {
|
||
|
False = 0, /**< logical false */
|
||
|
True = 1 /**< logical true */
|
||
|
} Boolean;
|
||
|
|
||
|
/**
|
||
|
* Boolean function. Returns true or false, depending on the given condition.
|
||
|
* \param condition The condition to evaluate, must be integer.
|
||
|
* \return True or false.
|
||
|
*/
|
||
|
static inline Boolean
|
||
|
boolean (int condition)
|
||
|
{
|
||
|
if (condition) {
|
||
|
return True;
|
||
|
} else {
|
||
|
return False;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
#endif
|