1 #ifndef Py_CLASSOBJECT_H
2 #define Py_CLASSOBJECT_H
7 /***********************************************************
8 Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
13 Permission to use, copy, modify, and distribute this software and its
14 documentation for any purpose and without fee is hereby granted,
15 provided that the above copyright notice appear in all copies and that
16 both that copyright notice and this permission notice appear in
17 supporting documentation, and that the names of Stichting Mathematisch
18 Centrum or CWI not be used in advertising or publicity pertaining to
19 distribution of the software without specific, written prior permission.
21 STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
22 THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
23 FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
24 FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
25 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
26 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
27 OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
29 ******************************************************************/
31 /* Class object interface */
36 #define get_thread_ident() 1L
39 /* Revealing some structures (not for general use) */
43 PyObject
*cl_bases
; /* A tuple of class objects */
44 PyObject
*cl_dict
; /* A dictionary */
45 PyObject
*cl_name
; /* A string */
46 /* The following three are functions or NULL */
54 PyClassObject
*in_class
; /* The class object */
55 PyObject
*in_dict
; /* A dictionary */
58 extern DL_IMPORT(PyTypeObject
) PyClass_Type
, PyInstance_Type
, PyMethod_Type
;
60 #define PyClass_Check(op) ((op)->ob_type == &PyClass_Type)
61 #define PyInstance_Check(op) ((op)->ob_type == &PyInstance_Type)
62 #define PyMethod_Check(op) ((op)->ob_type == &PyMethod_Type)
64 extern PyObject
*PyClass_New
Py_PROTO((PyObject
*, PyObject
*, PyObject
*));
65 extern PyObject
*PyInstance_New
Py_PROTO((PyObject
*, PyObject
*, PyObject
*));
66 extern PyObject
*PyMethod_New
Py_PROTO((PyObject
*, PyObject
*, PyObject
*));
68 extern PyObject
*PyMethod_Function
Py_PROTO((PyObject
*));
69 extern PyObject
*PyMethod_Self
Py_PROTO((PyObject
*));
70 extern PyObject
*PyMethod_Class
Py_PROTO((PyObject
*));
72 extern int PyClass_IsSubclass
Py_PROTO((PyObject
*, PyObject
*));
74 extern PyObject
*PyInstance_DoBinOp
75 Py_PROTO((PyObject
*, PyObject
*,
77 PyObject
* (*) Py_PROTO((PyObject
*, PyObject
*)) ));
82 #endif /* !Py_CLASSOBJECT_H */