codekingpro/portable-devtools
115k
1#ifndef Py_INTERNAL_FUNCTION_H2#define Py_INTERNAL_FUNCTION_H3#ifdef __cplusplus4extern "C" {5#endif6 7#ifndef Py_BUILD_CORE8# error "this header requires Py_BUILD_CORE define"9#endif10 11extern PyObject* _PyFunction_Vectorcall(12 PyObject *func,13 PyObject *const *stack,14 size_t nargsf,15 PyObject *kwnames);16 17 18#define FUNC_VERSION_UNSET 019#define FUNC_VERSION_CLEARED 120#define FUNC_VERSION_FIRST_VALID 221 22extern PyFunctionObject* _PyFunction_FromConstructor(PyFrameConstructor *constr);23 24static inline int25_PyFunction_IsVersionValid(uint32_t version)26{27 return version >= FUNC_VERSION_FIRST_VALID;28}29 30extern uint32_t _PyFunction_GetVersionForCurrentState(PyFunctionObject *func);31PyAPI_FUNC(void) _PyFunction_SetVersion(PyFunctionObject *func, uint32_t version);32void _PyFunction_ClearCodeByVersion(uint32_t version);33PyFunctionObject *_PyFunction_LookupByVersion(uint32_t version, PyObject **p_code);34 35extern PyObject *_Py_set_function_type_params(36 PyThreadState* unused, PyObject *func, PyObject *type_params);37 38 39/* See pycore_code.h for explanation about what "stateless" means. */40 41PyAPI_FUNC(int)42_PyFunction_VerifyStateless(PyThreadState *, PyObject *);43 44static inline PyObject* _PyFunction_GET_BUILTINS(PyObject *func) {45 return _PyFunction_CAST(func)->func_builtins;46}47#define _PyFunction_GET_BUILTINS(func) _PyFunction_GET_BUILTINS(_PyObject_CAST(func))48 49 50/* Get the callable wrapped by a classmethod.51 Returns a borrowed reference.52 The caller must ensure 'cm' is a classmethod object. */53extern PyObject *_PyClassMethod_GetFunc(PyObject *cm);54 55/* Get the callable wrapped by a staticmethod.56 Returns a borrowed reference.57 The caller must ensure 'sm' is a staticmethod object. */58extern PyObject *_PyStaticMethod_GetFunc(PyObject *sm);59 60 61#ifdef __cplusplus62}63#endif64#endif /* !Py_INTERNAL_FUNCTION_H */65 