| LEFT | RIGHT |
| 1 | 1 |
| 2 /* Method object implementation */ | 2 /* Method object implementation */ |
| 3 | 3 |
| 4 #include "Python.h" | 4 #include "Python.h" |
| 5 #include "structmember.h" | 5 #include "structmember.h" |
| 6 | 6 |
| 7 /* Free list for method objects to safe malloc/free overhead | 7 /* Free list for method objects to safe malloc/free overhead |
| 8 * The m_self element is used to chain the objects. | 8 * The m_self element is used to chain the objects. |
| 9 */ | 9 */ |
| 10 static PyCFunctionObject *free_list = NULL; | 10 static PyCFunctionObject *free_list = NULL; |
| (...skipping 86 matching lines...) | | Loading... |
| 97 } | 97 } |
| 98 | 98 |
| 99 int | 99 int |
| 100 PyCFunction_GetFlags(PyObject *op) | 100 PyCFunction_GetFlags(PyObject *op) |
| 101 { | 101 { |
| 102 if (!PyCFunction_Check(op)) { | 102 if (!PyCFunction_Check(op)) { |
| 103 PyErr_BadInternalCall(); | 103 PyErr_BadInternalCall(); |
| 104 return -1; | 104 return -1; |
| 105 } | 105 } |
| 106 return ((PyCFunctionObject *)op) -> m_ml -> ml_flags; | 106 return ((PyCFunctionObject *)op) -> m_ml -> ml_flags; |
| 107 } |
| 108 |
| 109 PyObject * |
| 110 PyCFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) |
| 111 { |
| 112 return PyMethodDef_Call(PyCFunction_GET_METHODDEF(func), |
| 113 PyCFunction_GET_SELF(func), arg, kw); |
| 107 } | 114 } |
| 108 | 115 |
| 109 PyObject * | 116 PyObject * |
| 110 PyMethodDef_Call(PyMethodDef *ml, PyObject *self, PyObject *arg, PyObject *kw) | 117 PyMethodDef_Call(PyMethodDef *ml, PyObject *self, PyObject *arg, PyObject *kw) |
| 111 { | 118 { |
| 112 PyCFunction meth = ml->ml_meth; | 119 PyCFunction meth = ml->ml_meth; |
| 113 Py_ssize_t size; | 120 Py_ssize_t size; |
| 114 | 121 |
| 115 switch (ml->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) { | 122 switch (ml->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) { |
| 116 case METH_VARARGS: | 123 case METH_VARARGS: |
| (...skipping 359 matching lines...) | | Loading... |
| 476 */ | 483 */ |
| 477 | 484 |
| 478 #undef PyCFunction_New | 485 #undef PyCFunction_New |
| 479 PyAPI_FUNC(PyObject *) PyCFunction_New(PyMethodDef *, PyObject *); | 486 PyAPI_FUNC(PyObject *) PyCFunction_New(PyMethodDef *, PyObject *); |
| 480 | 487 |
| 481 PyObject * | 488 PyObject * |
| 482 PyCFunction_New(PyMethodDef *ml, PyObject *self) | 489 PyCFunction_New(PyMethodDef *ml, PyObject *self) |
| 483 { | 490 { |
| 484 return PyCFunction_NewEx(ml, self, NULL); | 491 return PyCFunction_NewEx(ml, self, NULL); |
| 485 } | 492 } |
| LEFT | RIGHT |