home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_08_02 / 8n02046a < prev    next >
Text File  |  1990-03-01  |  715b  |  29 lines

  1.  
  2.  
  3. *****Listing 2*****
  4.  
  5.  
  6. 001  /*  obj.h - Interface to module for object oriented
  7. 002      programming in C. */
  8. 003  
  9. 004  struct class {
  10. 005      int size;   /* size of data */
  11. 006      int nbr_methods;
  12. 007      void (**method)();
  13. 008  };
  14. 009  
  15. 010  typedef struct class CLASS;
  16. 011  
  17. 012  typedef struct {
  18. 013      void *data;
  19. 014      CLASS *class;
  20. 015  } OBJECT;
  21. 016  
  22. 017  void new_class(CLASS *class, CLASS *super_class,
  23. 018    int nbr_methods, int size);
  24. 019  void reg_method(CLASS *class, int mth, void (*fcn)());
  25. 020  void new_object(OBJECT *obj, CLASS *class);
  26. 021  void message(OBJECT *obj, int msg, ...);
  27. 022  void free_object(OBJECT *obj);
  28. 023  void free_class(CLASS *class);
  29.