jpayne@69
|
1 /* Former class object interface -- now only bound methods are here */
|
jpayne@69
|
2
|
jpayne@69
|
3 /* Revealing some structures (not for general use) */
|
jpayne@69
|
4
|
jpayne@69
|
5 #ifndef Py_LIMITED_API
|
jpayne@69
|
6 #ifndef Py_CLASSOBJECT_H
|
jpayne@69
|
7 #define Py_CLASSOBJECT_H
|
jpayne@69
|
8 #ifdef __cplusplus
|
jpayne@69
|
9 extern "C" {
|
jpayne@69
|
10 #endif
|
jpayne@69
|
11
|
jpayne@69
|
12 typedef struct {
|
jpayne@69
|
13 PyObject_HEAD
|
jpayne@69
|
14 PyObject *im_func; /* The callable object implementing the method */
|
jpayne@69
|
15 PyObject *im_self; /* The instance it is bound to */
|
jpayne@69
|
16 PyObject *im_weakreflist; /* List of weak references */
|
jpayne@69
|
17 vectorcallfunc vectorcall;
|
jpayne@69
|
18 } PyMethodObject;
|
jpayne@69
|
19
|
jpayne@69
|
20 PyAPI_DATA(PyTypeObject) PyMethod_Type;
|
jpayne@69
|
21
|
jpayne@69
|
22 #define PyMethod_Check(op) ((op)->ob_type == &PyMethod_Type)
|
jpayne@69
|
23
|
jpayne@69
|
24 PyAPI_FUNC(PyObject *) PyMethod_New(PyObject *, PyObject *);
|
jpayne@69
|
25
|
jpayne@69
|
26 PyAPI_FUNC(PyObject *) PyMethod_Function(PyObject *);
|
jpayne@69
|
27 PyAPI_FUNC(PyObject *) PyMethod_Self(PyObject *);
|
jpayne@69
|
28
|
jpayne@69
|
29 /* Macros for direct access to these values. Type checks are *not*
|
jpayne@69
|
30 done, so use with care. */
|
jpayne@69
|
31 #define PyMethod_GET_FUNCTION(meth) \
|
jpayne@69
|
32 (((PyMethodObject *)meth) -> im_func)
|
jpayne@69
|
33 #define PyMethod_GET_SELF(meth) \
|
jpayne@69
|
34 (((PyMethodObject *)meth) -> im_self)
|
jpayne@69
|
35
|
jpayne@69
|
36 PyAPI_FUNC(int) PyMethod_ClearFreeList(void);
|
jpayne@69
|
37
|
jpayne@69
|
38 typedef struct {
|
jpayne@69
|
39 PyObject_HEAD
|
jpayne@69
|
40 PyObject *func;
|
jpayne@69
|
41 } PyInstanceMethodObject;
|
jpayne@69
|
42
|
jpayne@69
|
43 PyAPI_DATA(PyTypeObject) PyInstanceMethod_Type;
|
jpayne@69
|
44
|
jpayne@69
|
45 #define PyInstanceMethod_Check(op) ((op)->ob_type == &PyInstanceMethod_Type)
|
jpayne@69
|
46
|
jpayne@69
|
47 PyAPI_FUNC(PyObject *) PyInstanceMethod_New(PyObject *);
|
jpayne@69
|
48 PyAPI_FUNC(PyObject *) PyInstanceMethod_Function(PyObject *);
|
jpayne@69
|
49
|
jpayne@69
|
50 /* Macros for direct access to these values. Type checks are *not*
|
jpayne@69
|
51 done, so use with care. */
|
jpayne@69
|
52 #define PyInstanceMethod_GET_FUNCTION(meth) \
|
jpayne@69
|
53 (((PyInstanceMethodObject *)meth) -> func)
|
jpayne@69
|
54
|
jpayne@69
|
55 #ifdef __cplusplus
|
jpayne@69
|
56 }
|
jpayne@69
|
57 #endif
|
jpayne@69
|
58 #endif /* !Py_CLASSOBJECT_H */
|
jpayne@69
|
59 #endif /* Py_LIMITED_API */
|