home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / me34src.zip / me3 / mc / oman.h < prev    next >
C/C++ Source or Header  |  1995-01-14  |  2KB  |  70 lines

  1. /* 
  2.  * oman.h
  3.  */
  4.  
  5. /* Craig Durland    Public Domain
  6.  *   Distributed "as is", without warranties of any kind, but comments,
  7.  *     suggestions and bug reports are welcome.
  8.  */
  9.  
  10. #ifndef __OMAN_H_INCLUDED
  11. #define __OMAN_H_INCLUDED
  12.  
  13. #include <dstring.h>
  14.  
  15. /* ******************************************************************** */
  16. /* *********************** Atomic Object Types ************************ */
  17. /* ******************************************************************** */
  18.  
  19. typedef struct Object
  20. {
  21.   struct Object *next_object;
  22.   int type;
  23. } Object;
  24.  
  25. typedef struct ObjectPool
  26. {
  27.   struct ObjectPool *next_pool;
  28.   Object *first_object;        /* pointer to first object in pool */
  29.   pfi gc_marker;
  30. /*?????stash an int here that is passed in at create time and passed to sweeper??*/
  31. /* need a free_object call back for unknown types */
  32. } ObjectPool;
  33.  
  34. typedef struct
  35. {
  36.   Object object;
  37.   long int number;    /* or 32 bits anyway */
  38. } NumberObject;
  39.  
  40. typedef struct
  41. {
  42.   Object object;
  43.   dString string;
  44. } StringObject;
  45.  
  46. typedef struct
  47. {
  48.   Object object;
  49.   Object *elements;
  50. } ListObject;
  51.  
  52. /* To create your own type:
  53.     typedef struct
  54.     {
  55.       Object object;
  56.       Stuff thing;
  57.     } YourType;
  58. */
  59.  
  60. /* ******************************************************************** */
  61. /* ****************************** Macros ****************************** */
  62. /* ******************************************************************** */
  63.  
  64.     /* return a pointer to the string in a string object */
  65. #define OBJSTRING(object) ((StringObject *)object)->string.string
  66.     /* return the value in a number object */
  67. #define OBJNUMBER(object) ((NumberObject *)object)->number
  68.  
  69. #endif    /* __OMAN_H_INCLUDED */
  70.