blob: 5bbe9695b1c3455476bd77a62de3978710d9051f [file] [log] [blame]
Guido van Rossum5f820362002-04-03 23:01:45 +00001/* Boolean object interface */
2
3typedef PyIntObject PyBoolObject;
4
5extern DL_IMPORT(PyTypeObject) PyBool_Type;
6
7#define PyBool_Check(x) ((x)->ob_type == &PyBool_Type)
8
9/* Py_False and Py_True are the only two bools in existence.
10Don't forget to apply Py_INCREF() when returning either!!! */
11
12/* Don't use these directly */
13extern DL_IMPORT(PyIntObject) _Py_ZeroStruct, _Py_TrueStruct;
14
15/* Use these macros */
16#define Py_False ((PyObject *) &_Py_ZeroStruct)
17#define Py_True ((PyObject *) &_Py_TrueStruct)
18
19/* Function to return a bool from a C long */
20PyObject *PyBool_FromLong(long);