File indexing completed on 2025-01-18 10:06:48
0001
0002
0003 #ifndef Py_BOOLOBJECT_H
0004 #define Py_BOOLOBJECT_H
0005 #ifdef __cplusplus
0006 extern "C" {
0007 #endif
0008
0009
0010
0011
0012 #define PyBool_Check(x) Py_IS_TYPE((x), &PyBool_Type)
0013
0014
0015
0016
0017 PyAPI_DATA(PyLongObject) _Py_FalseStruct;
0018 PyAPI_DATA(PyLongObject) _Py_TrueStruct;
0019
0020
0021 #define Py_False _PyObject_CAST(&_Py_FalseStruct)
0022 #define Py_True _PyObject_CAST(&_Py_TrueStruct)
0023
0024
0025 PyAPI_FUNC(int) Py_IsTrue(PyObject *x);
0026 #define Py_IsTrue(x) Py_Is((x), Py_True)
0027
0028
0029 PyAPI_FUNC(int) Py_IsFalse(PyObject *x);
0030 #define Py_IsFalse(x) Py_Is((x), Py_False)
0031
0032
0033 #define Py_RETURN_TRUE return Py_True
0034 #define Py_RETURN_FALSE return Py_False
0035
0036
0037 PyAPI_FUNC(PyObject *) PyBool_FromLong(long);
0038
0039 #ifdef __cplusplus
0040 }
0041 #endif
0042 #endif