2007-11-27 06:40:20 -04:00
|
|
|
/* Former class object interface -- now only bound methods are here */
|
1990-10-14 09:07:46 -03:00
|
|
|
|
1993-05-21 16:56:10 -03:00
|
|
|
/* Revealing some structures (not for general use) */
|
1990-10-14 09:07:46 -03:00
|
|
|
|
2010-12-03 16:14:31 -04:00
|
|
|
#ifndef Py_LIMITED_API
|
2000-07-08 21:20:36 -03:00
|
|
|
#ifndef Py_CLASSOBJECT_H
|
|
|
|
#define Py_CLASSOBJECT_H
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
1998-07-10 12:46:33 -03:00
|
|
|
typedef struct {
|
2000-07-08 21:20:36 -03:00
|
|
|
PyObject_HEAD
|
|
|
|
PyObject *im_func; /* The callable object implementing the method */
|
2007-11-27 06:40:20 -04:00
|
|
|
PyObject *im_self; /* The instance it is bound to */
|
2001-03-23 00:17:58 -04:00
|
|
|
PyObject *im_weakreflist; /* List of weak references */
|
2019-05-29 15:31:52 -03:00
|
|
|
vectorcallfunc vectorcall;
|
1998-07-10 12:46:33 -03:00
|
|
|
} PyMethodObject;
|
|
|
|
|
2006-08-17 02:42:55 -03:00
|
|
|
PyAPI_DATA(PyTypeObject) PyMethod_Type;
|
1990-10-14 09:07:46 -03:00
|
|
|
|
2020-02-14 03:48:12 -04:00
|
|
|
#define PyMethod_Check(op) Py_IS_TYPE(op, &PyMethod_Type)
|
1990-10-14 09:07:46 -03:00
|
|
|
|
2007-11-27 06:40:20 -04:00
|
|
|
PyAPI_FUNC(PyObject *) PyMethod_New(PyObject *, PyObject *);
|
1990-10-14 09:07:46 -03:00
|
|
|
|
2002-08-12 04:21:58 -03:00
|
|
|
PyAPI_FUNC(PyObject *) PyMethod_Function(PyObject *);
|
|
|
|
PyAPI_FUNC(PyObject *) PyMethod_Self(PyObject *);
|
2001-09-05 19:52:50 -03:00
|
|
|
|
1998-07-10 12:46:33 -03:00
|
|
|
/* Macros for direct access to these values. Type checks are *not*
|
|
|
|
done, so use with care. */
|
|
|
|
#define PyMethod_GET_FUNCTION(meth) \
|
|
|
|
(((PyMethodObject *)meth) -> im_func)
|
|
|
|
#define PyMethod_GET_SELF(meth) \
|
2017-11-28 11:56:10 -04:00
|
|
|
(((PyMethodObject *)meth) -> im_self)
|
1998-07-10 12:46:33 -03:00
|
|
|
|
2007-12-11 15:56:40 -04:00
|
|
|
typedef struct {
|
2017-11-28 11:56:10 -04:00
|
|
|
PyObject_HEAD
|
|
|
|
PyObject *func;
|
2007-12-11 15:56:40 -04:00
|
|
|
} PyInstanceMethodObject;
|
|
|
|
|
|
|
|
PyAPI_DATA(PyTypeObject) PyInstanceMethod_Type;
|
|
|
|
|
2020-02-14 03:48:12 -04:00
|
|
|
#define PyInstanceMethod_Check(op) Py_IS_TYPE(op, &PyInstanceMethod_Type)
|
2007-12-11 15:56:40 -04:00
|
|
|
|
|
|
|
PyAPI_FUNC(PyObject *) PyInstanceMethod_New(PyObject *);
|
|
|
|
PyAPI_FUNC(PyObject *) PyInstanceMethod_Function(PyObject *);
|
|
|
|
|
|
|
|
/* Macros for direct access to these values. Type checks are *not*
|
|
|
|
done, so use with care. */
|
|
|
|
#define PyInstanceMethod_GET_FUNCTION(meth) \
|
|
|
|
(((PyInstanceMethodObject *)meth) -> func)
|
|
|
|
|
1993-07-28 06:05:47 -03:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif /* !Py_CLASSOBJECT_H */
|
2010-12-03 16:14:31 -04:00
|
|
|
#endif /* Py_LIMITED_API */
|