Mercurial > repos > rliterman > csp2
annotate CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/include/python3.8/boolobject.h @ 69:33d812a61356
planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author | jpayne |
---|---|
date | Tue, 18 Mar 2025 17:55:14 -0400 |
parents | |
children |
rev | line source |
---|---|
jpayne@69 | 1 /* Boolean object interface */ |
jpayne@69 | 2 |
jpayne@69 | 3 #ifndef Py_BOOLOBJECT_H |
jpayne@69 | 4 #define Py_BOOLOBJECT_H |
jpayne@69 | 5 #ifdef __cplusplus |
jpayne@69 | 6 extern "C" { |
jpayne@69 | 7 #endif |
jpayne@69 | 8 |
jpayne@69 | 9 |
jpayne@69 | 10 PyAPI_DATA(PyTypeObject) PyBool_Type; |
jpayne@69 | 11 |
jpayne@69 | 12 #define PyBool_Check(x) (Py_TYPE(x) == &PyBool_Type) |
jpayne@69 | 13 |
jpayne@69 | 14 /* Py_False and Py_True are the only two bools in existence. |
jpayne@69 | 15 Don't forget to apply Py_INCREF() when returning either!!! */ |
jpayne@69 | 16 |
jpayne@69 | 17 /* Don't use these directly */ |
jpayne@69 | 18 PyAPI_DATA(struct _longobject) _Py_FalseStruct, _Py_TrueStruct; |
jpayne@69 | 19 |
jpayne@69 | 20 /* Use these macros */ |
jpayne@69 | 21 #define Py_False ((PyObject *) &_Py_FalseStruct) |
jpayne@69 | 22 #define Py_True ((PyObject *) &_Py_TrueStruct) |
jpayne@69 | 23 |
jpayne@69 | 24 /* Macros for returning Py_True or Py_False, respectively */ |
jpayne@69 | 25 #define Py_RETURN_TRUE return Py_INCREF(Py_True), Py_True |
jpayne@69 | 26 #define Py_RETURN_FALSE return Py_INCREF(Py_False), Py_False |
jpayne@69 | 27 |
jpayne@69 | 28 /* Function to return a bool from a C long */ |
jpayne@69 | 29 PyAPI_FUNC(PyObject *) PyBool_FromLong(long); |
jpayne@69 | 30 |
jpayne@69 | 31 #ifdef __cplusplus |
jpayne@69 | 32 } |
jpayne@69 | 33 #endif |
jpayne@69 | 34 #endif /* !Py_BOOLOBJECT_H */ |