home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / gwm18a.zip / wl_coll.h < prev    next >
C/C++ Source or Header  |  1995-07-03  |  3KB  |  107 lines

  1. /* Copyright 1989 GROUPE BULL -- See license conditions in file COPYRIGHT
  2.  * Copyright 1989 Massachusetts Institute of Technology
  3.  */
  4. /**************************\
  5. *                *
  6. *  WOOL_OBJECT Collection  *
  7. *  DEFINITIONS           *
  8. *                *
  9. \**************************/
  10.  
  11. #ifndef INCLUDE_WL_COLL_H
  12. #define INCLUDE_WL_COLL_H
  13.  
  14. /* type */
  15.  
  16. typedef struct _WOOL_Collection {
  17.     WOOL_HEADER;
  18.     int             size;    /* number of elements */
  19.     int             limit;    /* elements allowable in the malloced aera */
  20.     WOOL_OBJECT    *list;    /* malloced region to store elements */
  21. }              *WOOL_Collection;
  22.  
  23. typedef struct _WOOL_QuotedExpr {    /* 'foo */
  24.     WOOL_HEADER;
  25.     WOOL_OBJECT    expr;            /* foo */
  26. }           *WOOL_QuotedExpr;
  27.  
  28. /* exported functions */
  29.  
  30. EXT WOOL_Collection WLCollection_make();
  31. EXT WOOL_OBJECT WLCollection_print();
  32. EXT WOOL_OBJECT WLCollection_free();
  33. EXT WOOL_Collection WLCollection_add();
  34. EXT WOOL_OBJECT WLCollection_progn();
  35.  
  36. EXT WOOL_QuotedExpr WLQuotedExpr_make();
  37. EXT WOOL_OBJECT WLQuotedExpr_eval();
  38. EXT WOOL_OBJECT WLQuotedExpr_print();
  39. EXT WOOL_OBJECT WLQuotedExpr_free();
  40. EXT WOOL_OBJECT WLQuotedExpr_equal();
  41.  
  42. /* methods */
  43.  
  44. EXT WOOL_METHOD WLCollection[]
  45. #ifdef DO_INIT
  46. = {
  47.    (WOOL_METHOD) 0,        /* METHODS_ARRAY */
  48.    WLNumber_eval,        /* WOOL_eval 1 */
  49.    WLCollection_print,        /* WOOL_print 2 */
  50.    WLCollection_free,        /* WOOL_free 3 */
  51.    wool_undefined_method_2,        /* WOOL_execute 4 */
  52.    wool_undefined_method_2,        /* WOOL_set 5 */
  53.    (WOOL_METHOD) wool_undefined_method_1,/* WOOL_get_C_value 6 */
  54.    wool_undefined_method_1,    /* WOOL_open 7 */
  55.    wool_undefined_method_1,    /* WOOL_close 8 */
  56.    wool_undefined_method_2,    /* WOOL_process_event 9 */
  57.    wool_undefined_method_1,    /* WOOL_copy 10 */
  58.    wool_undefined_method_2,    /* WOOL_get_dimensions 11 */
  59.    wool_undefined_method_2,    /* WOOL_draw 12 */
  60.    wool_undefined_method_2,    /* WOOL_equal 13 */
  61.    wool_undefined_method_2,
  62.    wool_undefined_method_2,
  63.    wool_undefined_method_1,
  64.    wool_undefined_method_1,
  65.    wool_undefined_method_1,
  66.    wool_undefined_method_1,
  67.    wool_undefined_method_1
  68. }
  69. #endif /* DO_INIT */
  70.                ;
  71.  
  72. EXT WOOL_METHOD WLQuotedExpr[]
  73. #ifdef DO_INIT
  74. = {
  75.    (WOOL_METHOD) 0,        /* METHODS_ARRAY */
  76.    WLQuotedExpr_eval,        /* WOOL_eval 1 */
  77.    WLQuotedExpr_print,        /* WOOL_print 2 */
  78.    WLQuotedExpr_free,        /* WOOL_free 3 */
  79.    wool_undefined_method_2,        /* WOOL_execute 4 */
  80.    wool_undefined_method_2,        /* WOOL_set 5 */
  81.    (WOOL_METHOD) wool_undefined_method_1,/* WOOL_get_C_value 6 */
  82.    wool_undefined_method_1,    /* WOOL_open 7 */
  83.    wool_undefined_method_1,    /* WOOL_close 8 */
  84.    wool_undefined_method_2,    /* WOOL_process_event 9 */
  85.    wool_undefined_method_1,    /* WOOL_copy 10 */
  86.    wool_undefined_method_2,    /* WOOL_get_dimensions 11 */
  87.    wool_undefined_method_2,    /* WOOL_draw 12 */
  88.    WLQuotedExpr_equal,        /* WOOL_equal 13 */
  89.    wool_undefined_method_2,
  90.    wool_undefined_method_1,
  91.    wool_undefined_method_1,
  92.    wool_undefined_method_1,
  93.    wool_undefined_method_1,
  94.    wool_undefined_method_1,
  95.    wool_undefined_method_1
  96. }
  97. #endif /* DO_INIT */
  98.                ;
  99.  
  100. /* Initialisations */
  101.  
  102. #ifdef DO_INIT
  103. #define INITIAL_COLLECTION_SIZE 7    /* initial size allocated in
  104.                      * WLCollection_make */
  105. #endif /* DO_INIT */
  106. #endif /* INCLUDE_WL_COLL_H */
  107.