+++ /dev/null
-\r
-/* Method object interface */\r
-\r
-#ifndef Py_METHODOBJECT_H\r
-#define Py_METHODOBJECT_H\r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-/* This is about the type 'builtin_function_or_method',\r
- not Python methods in user-defined classes. See classobject.h\r
- for the latter. */\r
-\r
-PyAPI_DATA(PyTypeObject) PyCFunction_Type;\r
-\r
-#define PyCFunction_Check(op) (Py_TYPE(op) == &PyCFunction_Type)\r
-\r
-typedef PyObject *(*PyCFunction)(PyObject *, PyObject *);\r
-typedef PyObject *(*PyCFunctionWithKeywords)(PyObject *, PyObject *,\r
- PyObject *);\r
-typedef PyObject *(*PyNoArgsFunction)(PyObject *);\r
-\r
-PyAPI_FUNC(PyCFunction) PyCFunction_GetFunction(PyObject *);\r
-PyAPI_FUNC(PyObject *) PyCFunction_GetSelf(PyObject *);\r
-PyAPI_FUNC(int) PyCFunction_GetFlags(PyObject *);\r
-\r
-/* Macros for direct access to these values. Type checks are *not*\r
- done, so use with care. */\r
-#define PyCFunction_GET_FUNCTION(func) \\r
- (((PyCFunctionObject *)func) -> m_ml -> ml_meth)\r
-#define PyCFunction_GET_SELF(func) \\r
- (((PyCFunctionObject *)func) -> m_self)\r
-#define PyCFunction_GET_FLAGS(func) \\r
- (((PyCFunctionObject *)func) -> m_ml -> ml_flags)\r
-PyAPI_FUNC(PyObject *) PyCFunction_Call(PyObject *, PyObject *, PyObject *);\r
-\r
-struct PyMethodDef {\r
- const char *ml_name; /* The name of the built-in function/method */\r
- PyCFunction ml_meth; /* The C function that implements it */\r
- int ml_flags; /* Combination of METH_xxx flags, which mostly\r
- describe the args expected by the C func */\r
- const char *ml_doc; /* The __doc__ attribute, or NULL */\r
-};\r
-typedef struct PyMethodDef PyMethodDef;\r
-\r
-PyAPI_FUNC(PyObject *) Py_FindMethod(PyMethodDef[], PyObject *, const char *);\r
-\r
-#define PyCFunction_New(ML, SELF) PyCFunction_NewEx((ML), (SELF), NULL)\r
-PyAPI_FUNC(PyObject *) PyCFunction_NewEx(PyMethodDef *, PyObject *, \r
- PyObject *);\r
-\r
-/* Flag passed to newmethodobject */\r
-#define METH_OLDARGS 0x0000\r
-#define METH_VARARGS 0x0001\r
-#define METH_KEYWORDS 0x0002\r
-/* METH_NOARGS and METH_O must not be combined with the flags above. */\r
-#define METH_NOARGS 0x0004\r
-#define METH_O 0x0008\r
-\r
-/* METH_CLASS and METH_STATIC are a little different; these control\r
- the construction of methods for a class. These cannot be used for\r
- functions in modules. */\r
-#define METH_CLASS 0x0010\r
-#define METH_STATIC 0x0020\r
-\r
-/* METH_COEXIST allows a method to be entered eventhough a slot has\r
- already filled the entry. When defined, the flag allows a separate\r
- method, "__contains__" for example, to coexist with a defined \r
- slot like sq_contains. */\r
-\r
-#define METH_COEXIST 0x0040\r
-\r
-typedef struct PyMethodChain {\r
- PyMethodDef *methods; /* Methods of this type */\r
- struct PyMethodChain *link; /* NULL or base type */\r
-} PyMethodChain;\r
-\r
-PyAPI_FUNC(PyObject *) Py_FindMethodInChain(PyMethodChain *, PyObject *,\r
- const char *);\r
-\r
-typedef struct {\r
- PyObject_HEAD\r
- PyMethodDef *m_ml; /* Description of the C function to call */\r
- PyObject *m_self; /* Passed as 'self' arg to the C func, can be NULL */\r
- PyObject *m_module; /* The __module__ attribute, can be anything */\r
-} PyCFunctionObject;\r
-\r
-PyAPI_FUNC(int) PyCFunction_ClearFreeList(void);\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-#endif /* !Py_METHODOBJECT_H */\r