home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / pyth_os2.zip / python-1.0.2 / Include / classobject.h < prev    next >
C/C++ Source or Header  |  1994-01-02  |  2KB  |  68 lines

  1. #ifndef Py_CLASSOBJECT_H
  2. #define Py_CLASSOBJECT_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6.  
  7. /***********************************************************
  8. Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum,
  9. Amsterdam, The Netherlands.
  10.  
  11.                         All Rights Reserved
  12.  
  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.
  20.  
  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.
  28.  
  29. ******************************************************************/
  30.  
  31. /* Class object interface */
  32.  
  33. /* Revealing some structures (not for general use) */
  34.  
  35. typedef struct {
  36.     OB_HEAD
  37.     object    *cl_bases;    /* A tuple of class objects */
  38.     object    *cl_dict;    /* A dictionary */
  39.     object    *cl_name;    /* A string */
  40. } classobject;
  41.  
  42. typedef struct {
  43.     OB_HEAD
  44.     classobject    *in_class;    /* The class object */
  45.     object        *in_dict;    /* A dictionary */
  46. } instanceobject;
  47.  
  48. extern typeobject Classtype, Instancetype, Instancemethodtype;
  49.  
  50. #define is_classobject(op) ((op)->ob_type == &Classtype)
  51. #define is_instanceobject(op) ((op)->ob_type == &Instancetype)
  52. #define is_instancemethodobject(op) ((op)->ob_type == &Instancemethodtype)
  53.  
  54. extern object *newclassobject PROTO((object *, object *, object *));
  55. extern object *newinstanceobject PROTO((object *, object *));
  56. extern object *newinstancemethodobject PROTO((object *, object *, object *));
  57.  
  58. extern object *instancemethodgetfunc PROTO((object *));
  59. extern object *instancemethodgetself PROTO((object *));
  60. extern object *instancemethodgetclass PROTO((object *));
  61.  
  62. extern int issubclass PROTO((object *, object *));
  63.  
  64. #ifdef __cplusplus
  65. }
  66. #endif
  67. #endif /* !Py_CLASSOBJECT_H */
  68.