2 /* Method object interface */
4 #ifndef Py_METHODOBJECT_H
5 #define Py_METHODOBJECT_H
10 extern DL_IMPORT(PyTypeObject
) PyCFunction_Type
;
12 #define PyCFunction_Check(op) ((op)->ob_type == &PyCFunction_Type)
14 typedef PyObject
*(*PyCFunction
)(PyObject
*, PyObject
*);
15 typedef PyObject
*(*PyCFunctionWithKeywords
)(PyObject
*, PyObject
*,
18 extern DL_IMPORT(PyCFunction
) PyCFunction_GetFunction(PyObject
*);
19 extern DL_IMPORT(PyObject
*) PyCFunction_GetSelf(PyObject
*);
20 extern DL_IMPORT(int) PyCFunction_GetFlags(PyObject
*);
22 /* Macros for direct access to these values. Type checks are *not*
23 done, so use with care. */
24 #define PyCFunction_GET_FUNCTION(func) \
25 (((PyCFunctionObject *)func) -> m_ml -> ml_meth)
26 #define PyCFunction_GET_SELF(func) \
27 (((PyCFunctionObject *)func) -> m_self)
28 #define PyCFunction_GET_FLAGS(func) \
29 (((PyCFunctionObject *)func) -> m_ml -> ml_flags)
37 typedef struct PyMethodDef PyMethodDef
;
39 extern DL_IMPORT(PyObject
*) Py_FindMethod(PyMethodDef
[], PyObject
*, char *);
41 extern DL_IMPORT(PyObject
*) PyCFunction_New(PyMethodDef
*, PyObject
*);
43 /* Flag passed to newmethodobject */
44 #define METH_OLDARGS 0x0000
45 #define METH_VARARGS 0x0001
46 #define METH_KEYWORDS 0x0002
48 typedef struct PyMethodChain
{
49 PyMethodDef
*methods
; /* Methods of this type */
50 struct PyMethodChain
*link
; /* NULL or base type */
53 extern DL_IMPORT(PyObject
*) Py_FindMethodInChain(PyMethodChain
*, PyObject
*,
65 #endif /* !Py_METHODOBJECT_H */