jpayne@69: /* Former class object interface -- now only bound methods are here */ jpayne@69: jpayne@69: /* Revealing some structures (not for general use) */ jpayne@69: jpayne@69: #ifndef Py_LIMITED_API jpayne@69: #ifndef Py_CLASSOBJECT_H jpayne@69: #define Py_CLASSOBJECT_H jpayne@69: #ifdef __cplusplus jpayne@69: extern "C" { jpayne@69: #endif jpayne@69: jpayne@69: typedef struct { jpayne@69: PyObject_HEAD jpayne@69: PyObject *im_func; /* The callable object implementing the method */ jpayne@69: PyObject *im_self; /* The instance it is bound to */ jpayne@69: PyObject *im_weakreflist; /* List of weak references */ jpayne@69: vectorcallfunc vectorcall; jpayne@69: } PyMethodObject; jpayne@69: jpayne@69: PyAPI_DATA(PyTypeObject) PyMethod_Type; jpayne@69: jpayne@69: #define PyMethod_Check(op) ((op)->ob_type == &PyMethod_Type) jpayne@69: jpayne@69: PyAPI_FUNC(PyObject *) PyMethod_New(PyObject *, PyObject *); jpayne@69: jpayne@69: PyAPI_FUNC(PyObject *) PyMethod_Function(PyObject *); jpayne@69: PyAPI_FUNC(PyObject *) PyMethod_Self(PyObject *); jpayne@69: jpayne@69: /* Macros for direct access to these values. Type checks are *not* jpayne@69: done, so use with care. */ jpayne@69: #define PyMethod_GET_FUNCTION(meth) \ jpayne@69: (((PyMethodObject *)meth) -> im_func) jpayne@69: #define PyMethod_GET_SELF(meth) \ jpayne@69: (((PyMethodObject *)meth) -> im_self) jpayne@69: jpayne@69: PyAPI_FUNC(int) PyMethod_ClearFreeList(void); jpayne@69: jpayne@69: typedef struct { jpayne@69: PyObject_HEAD jpayne@69: PyObject *func; jpayne@69: } PyInstanceMethodObject; jpayne@69: jpayne@69: PyAPI_DATA(PyTypeObject) PyInstanceMethod_Type; jpayne@69: jpayne@69: #define PyInstanceMethod_Check(op) ((op)->ob_type == &PyInstanceMethod_Type) jpayne@69: jpayne@69: PyAPI_FUNC(PyObject *) PyInstanceMethod_New(PyObject *); jpayne@69: PyAPI_FUNC(PyObject *) PyInstanceMethod_Function(PyObject *); jpayne@69: jpayne@69: /* Macros for direct access to these values. Type checks are *not* jpayne@69: done, so use with care. */ jpayne@69: #define PyInstanceMethod_GET_FUNCTION(meth) \ jpayne@69: (((PyInstanceMethodObject *)meth) -> func) jpayne@69: jpayne@69: #ifdef __cplusplus jpayne@69: } jpayne@69: #endif jpayne@69: #endif /* !Py_CLASSOBJECT_H */ jpayne@69: #endif /* Py_LIMITED_API */