diff options
Diffstat (limited to 'Include')
-rw-r--r-- | Include/funcobject.h | 4 | ||||
-rw-r--r-- | Include/methodobject.h | 5 |
2 files changed, 8 insertions, 1 deletions
diff --git a/Include/funcobject.h b/Include/funcobject.h index 7fee800..758c76d 100644 --- a/Include/funcobject.h +++ b/Include/funcobject.h @@ -17,6 +17,7 @@ typedef struct { PyObject *func_name; PyObject *func_dict; PyObject *func_weakreflist; + PyObject *func_module; } PyFunctionObject; PyAPI_DATA(PyTypeObject) PyFunction_Type; @@ -26,6 +27,7 @@ PyAPI_DATA(PyTypeObject) PyFunction_Type; PyAPI_FUNC(PyObject *) PyFunction_New(PyObject *, PyObject *); PyAPI_FUNC(PyObject *) PyFunction_GetCode(PyObject *); PyAPI_FUNC(PyObject *) PyFunction_GetGlobals(PyObject *); +PyAPI_FUNC(PyObject *) PyFunction_GetModule(PyObject *); PyAPI_FUNC(PyObject *) PyFunction_GetDefaults(PyObject *); PyAPI_FUNC(int) PyFunction_SetDefaults(PyObject *, PyObject *); PyAPI_FUNC(PyObject *) PyFunction_GetClosure(PyObject *); @@ -37,6 +39,8 @@ PyAPI_FUNC(int) PyFunction_SetClosure(PyObject *, PyObject *); (((PyFunctionObject *)func) -> func_code) #define PyFunction_GET_GLOBALS(func) \ (((PyFunctionObject *)func) -> func_globals) +#define PyFunction_GET_MODULE(func) \ + (((PyFunctionObject *)func) -> func_module) #define PyFunction_GET_DEFAULTS(func) \ (((PyFunctionObject *)func) -> func_defaults) #define PyFunction_GET_CLOSURE(func) \ diff --git a/Include/methodobject.h b/Include/methodobject.h index 993bdae..887385d 100644 --- a/Include/methodobject.h +++ b/Include/methodobject.h @@ -40,7 +40,9 @@ typedef struct PyMethodDef PyMethodDef; PyAPI_FUNC(PyObject *) Py_FindMethod(PyMethodDef[], PyObject *, char *); -PyAPI_FUNC(PyObject *) PyCFunction_New(PyMethodDef *, PyObject *); +#define PyCFunction_New(ML, SELF) PyCFunction_NewEx((ML), (SELF), NULL) +PyAPI_FUNC(PyObject *) PyCFunction_NewEx(PyMethodDef *, PyObject *, + PyObject *); /* Flag passed to newmethodobject */ #define METH_OLDARGS 0x0000 @@ -68,6 +70,7 @@ typedef struct { PyObject_HEAD PyMethodDef *m_ml; PyObject *m_self; + PyObject *m_module; } PyCFunctionObject; #ifdef __cplusplus |