File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,6 +49,15 @@ extern PyCFunction PyCFunction_GetFunction Py_PROTO((PyObject *));
4949extern PyObject * PyCFunction_GetSelf Py_PROTO ((PyObject * ) );
5050extern int PyCFunction_GetFlags Py_PROTO ((PyObject * ) );
5151
52+ /* Macros for direct access to these values. Type checks are *not*
53+ done, so use with care. */
54+ #define PyCFunction_GET_FUNCTION (func ) \
55+ (((PyCFunctionObject *)func) -> m_ml -> ml_meth)
56+ #define PyCFunction_GET_SELF (func ) \
57+ (((PyCFunctionObject *)func) -> m_self)
58+ #define PyCFunction_GET_FLAGS (func ) \
59+ (((PyCFunctionObject *)func) -> m_ml -> ml_flags)
60+
5261struct PyMethodDef {
5362 char * ml_name ;
5463 PyCFunction ml_meth ;
@@ -75,6 +84,12 @@ typedef struct PyMethodChain {
7584extern PyObject * Py_FindMethodInChain
7685 Py_PROTO ((PyMethodChain * , PyObject * , char * ) );
7786
87+ typedef struct {
88+ PyObject_HEAD
89+ PyMethodDef * m_ml ;
90+ PyObject * m_self ;
91+ } PyCFunctionObject ;
92+
7893#ifdef __cplusplus
7994}
8095#endif
Original file line number Diff line number Diff line change @@ -35,12 +35,6 @@ PERFORMANCE OF THIS SOFTWARE.
3535
3636#include "token.h"
3737
38- typedef struct {
39- PyObject_HEAD
40- PyMethodDef * m_ml ;
41- PyObject * m_self ;
42- } PyCFunctionObject ;
43-
4438static PyCFunctionObject * free_list = NULL ;
4539
4640PyObject *
You can’t perform that action at this time.
0 commit comments