File indexing completed on 2025-03-13 09:20:54
0001 #ifndef Py_CPYTHON_ABSTRACTOBJECT_H
0002 # error "this header file must not be included directly"
0003 #endif
0004
0005
0006
0007 #ifdef PY_SSIZE_T_CLEAN
0008 # define _PyObject_CallMethodId _PyObject_CallMethodId_SizeT
0009 #endif
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 PyAPI_FUNC(PyObject *) _PyStack_AsDict(
0022 PyObject *const *values,
0023 PyObject *kwnames);
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034 #define _PY_FASTCALL_SMALL_STACK 5
0035
0036 PyAPI_FUNC(PyObject *) _Py_CheckFunctionResult(
0037 PyThreadState *tstate,
0038 PyObject *callable,
0039 PyObject *result,
0040 const char *where);
0041
0042
0043
0044
0045
0046
0047 PyAPI_FUNC(PyObject *) _PyObject_MakeTpCall(
0048 PyThreadState *tstate,
0049 PyObject *callable,
0050 PyObject *const *args, Py_ssize_t nargs,
0051 PyObject *keywords);
0052
0053
0054
0055
0056 #define PyVectorcall_NARGS(n) _PyVectorcall_NARGS(n)
0057 static inline Py_ssize_t
0058 _PyVectorcall_NARGS(size_t n)
0059 {
0060 return n & ~PY_VECTORCALL_ARGUMENTS_OFFSET;
0061 }
0062
0063 PyAPI_FUNC(vectorcallfunc) PyVectorcall_Function(PyObject *callable);
0064
0065
0066 #define _PyObject_Vectorcall PyObject_Vectorcall
0067 #define _PyObject_VectorcallMethod PyObject_VectorcallMethod
0068 #define _PyObject_FastCallDict PyObject_VectorcallDict
0069 #define _PyVectorcall_Function PyVectorcall_Function
0070 #define _PyObject_CallOneArg PyObject_CallOneArg
0071 #define _PyObject_CallMethodNoArgs PyObject_CallMethodNoArgs
0072 #define _PyObject_CallMethodOneArg PyObject_CallMethodOneArg
0073
0074
0075
0076 PyAPI_FUNC(PyObject *) PyObject_VectorcallDict(
0077 PyObject *callable,
0078 PyObject *const *args,
0079 size_t nargsf,
0080 PyObject *kwargs);
0081
0082
0083 PyAPI_FUNC(PyObject *) _PyObject_FastCall(
0084 PyObject *func,
0085 PyObject *const *args,
0086 Py_ssize_t nargs);
0087
0088 PyAPI_FUNC(PyObject *) PyObject_CallOneArg(PyObject *func, PyObject *arg);
0089
0090 static inline PyObject *
0091 PyObject_CallMethodNoArgs(PyObject *self, PyObject *name)
0092 {
0093 size_t nargsf = 1 | PY_VECTORCALL_ARGUMENTS_OFFSET;
0094 return PyObject_VectorcallMethod(name, &self, nargsf, _Py_NULL);
0095 }
0096
0097 static inline PyObject *
0098 PyObject_CallMethodOneArg(PyObject *self, PyObject *name, PyObject *arg)
0099 {
0100 PyObject *args[2] = {self, arg};
0101 size_t nargsf = 2 | PY_VECTORCALL_ARGUMENTS_OFFSET;
0102 assert(arg != NULL);
0103 return PyObject_VectorcallMethod(name, args, nargsf, _Py_NULL);
0104 }
0105
0106 PyAPI_FUNC(PyObject *) _PyObject_CallMethod(PyObject *obj,
0107 PyObject *name,
0108 const char *format, ...);
0109
0110
0111
0112 PyAPI_FUNC(PyObject *) _PyObject_CallMethodId(PyObject *obj,
0113 _Py_Identifier *name,
0114 const char *format, ...);
0115
0116 PyAPI_FUNC(PyObject *) _PyObject_CallMethodId_SizeT(PyObject *obj,
0117 _Py_Identifier *name,
0118 const char *format,
0119 ...);
0120
0121 PyAPI_FUNC(PyObject *) _PyObject_CallMethodIdObjArgs(
0122 PyObject *obj,
0123 _Py_Identifier *name,
0124 ...);
0125
0126 static inline PyObject *
0127 _PyObject_VectorcallMethodId(
0128 _Py_Identifier *name, PyObject *const *args,
0129 size_t nargsf, PyObject *kwnames)
0130 {
0131 PyObject *oname = _PyUnicode_FromId(name);
0132 if (!oname) {
0133 return _Py_NULL;
0134 }
0135 return PyObject_VectorcallMethod(oname, args, nargsf, kwnames);
0136 }
0137
0138 static inline PyObject *
0139 _PyObject_CallMethodIdNoArgs(PyObject *self, _Py_Identifier *name)
0140 {
0141 size_t nargsf = 1 | PY_VECTORCALL_ARGUMENTS_OFFSET;
0142 return _PyObject_VectorcallMethodId(name, &self, nargsf, _Py_NULL);
0143 }
0144
0145 static inline PyObject *
0146 _PyObject_CallMethodIdOneArg(PyObject *self, _Py_Identifier *name, PyObject *arg)
0147 {
0148 PyObject *args[2] = {self, arg};
0149 size_t nargsf = 2 | PY_VECTORCALL_ARGUMENTS_OFFSET;
0150 assert(arg != NULL);
0151 return _PyObject_VectorcallMethodId(name, args, nargsf, _Py_NULL);
0152 }
0153
0154 PyAPI_FUNC(int) _PyObject_HasLen(PyObject *o);
0155
0156
0157
0158
0159 PyAPI_FUNC(Py_ssize_t) PyObject_LengthHint(PyObject *o, Py_ssize_t);
0160
0161
0162
0163
0164
0165 #define PySequence_ITEM(o, i)\
0166 ( Py_TYPE(o)->tp_as_sequence->sq_item((o), (i)) )
0167
0168 #define PY_ITERSEARCH_COUNT 1
0169 #define PY_ITERSEARCH_INDEX 2
0170 #define PY_ITERSEARCH_CONTAINS 3
0171
0172
0173
0174
0175
0176
0177
0178
0179
0180
0181
0182
0183 PyAPI_FUNC(Py_ssize_t) _PySequence_IterSearch(PyObject *seq,
0184 PyObject *obj, int operation);
0185
0186
0187
0188 PyAPI_FUNC(int) _PyObject_RealIsInstance(PyObject *inst, PyObject *cls);
0189
0190 PyAPI_FUNC(int) _PyObject_RealIsSubclass(PyObject *derived, PyObject *cls);
0191
0192 PyAPI_FUNC(char *const *) _PySequence_BytesToCharpArray(PyObject* self);
0193
0194 PyAPI_FUNC(void) _Py_FreeCharPArray(char *const array[]);
0195
0196
0197 PyAPI_FUNC(void) _Py_add_one_to_index_F(int nd, Py_ssize_t *index,
0198 const Py_ssize_t *shape);
0199 PyAPI_FUNC(void) _Py_add_one_to_index_C(int nd, Py_ssize_t *index,
0200 const Py_ssize_t *shape);
0201
0202
0203 PyAPI_FUNC(int) _Py_convert_optional_to_ssize_t(PyObject *, void *);
0204
0205
0206 PyAPI_FUNC(PyObject *) _PyNumber_Index(PyObject *o);