Erste CVS-Version
This commit is contained in:
34
firmware/boolean.h
Normal file
34
firmware/boolean.h
Normal file
@ -0,0 +1,34 @@
|
||||
#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
|
Reference in New Issue
Block a user