home *** CD-ROM | disk | FTP | other *** search
/ ftptest.leeds.ac.uk / 2015.02.ftptest.leeds.ac.uk.tar / ftptest.leeds.ac.uk / bionet / CAE-GROUP / SCL-WIN3x / FED_PLUS.EXE / OBJECT.H < prev    next >
C/C++ Source or Header  |  1994-07-23  |  3KB  |  124 lines

  1. #ifndef OBJECT_H
  2. #define OBJECT_H
  3.  
  4. /* $Id: object.h,v 1.7 1993/10/15 18:49:23 libes Exp $ */
  5.  
  6. /************************************************************************
  7. ** Module:    Object
  8. ** Description:    This module implements the Object abstraction.
  9. ** Constants:
  10. **    OBJECT_NULL    - the null class
  11. **
  12. ************************************************************************/
  13.  
  14. /*
  15.  * This software was developed by U.S. Government employees as part of
  16.  * their official duties and is not subject to copyright.
  17.  *
  18.  * $Log: object.h,v $
  19.  * Revision 1.7  1993/10/15  18:49:23  libes
  20.  * CADDETC certified
  21.  *
  22.  * Revision 1.6  1993/01/19  22:17:27  libes
  23.  * *** empty log message ***
  24.  *
  25.  * Revision 1.5  1992/08/18  17:15:40  libes
  26.  * rm'd extraneous error messages
  27.  *
  28.  * Revision 1.4  1992/06/08  18:07:35  libes
  29.  * prettied up interface to print_objects_when_running
  30.  *
  31.  * Revision 1.3  1992/05/31  23:33:15  libes
  32.  * implemented ALIAS resolution
  33.  *
  34.  * Revision 1.2  1992/05/31  08:36:48  libes
  35.  * multiple files
  36.  *
  37.  * Revision 1.1  1992/05/28  03:56:02  libes
  38.  * Initial revision
  39.  */
  40.  
  41. /*************/
  42. /* constants */
  43. /*************/
  44.  
  45. /* each object has an index - current the index is a mnemonic character */
  46. /* hence the array is rather sparse, but the extra slop is only a hundred */
  47. /* or so bytes, so it's nothing to sweat about */
  48. #define MAX_OBJECT_TYPES    127    /* really could be a LOT less */
  49.  
  50. /*****************/
  51. /* packages used */
  52. /*****************/
  53.  
  54. #include "basic.h"    /* get basic definitions */
  55. #include "symbol.h"
  56.  
  57. /************/
  58. /* typedefs */
  59. /************/
  60.  
  61. /***************************/
  62. /* hidden type definitions */
  63. /***************************/
  64.  
  65. struct Object {
  66.     struct Symbol *(*get_symbol)();
  67.     char* type;    /* should complete the phrase "X is ..." */
  68.             /* i.e., "an entity", "a type", "of unknown type" */
  69.     int bits;    /* a bitwise selector of a type, i.e. OBJ_XX_BITS */
  70. };
  71.  
  72. /****************/
  73. /* modules used */
  74. /****************/
  75.  
  76. /********************/
  77. /* global variables */
  78. /********************/
  79.  
  80. #ifdef OBJECT_C
  81. #include "defstart.h"
  82. #else
  83. #include "decstart.h"
  84. #endif /*OBJECT_C */
  85.  
  86. GLOBAL struct Object *OBJ;
  87.  
  88. #include "de_end.h"
  89.  
  90. /******************************/
  91. /* macro function definitions */
  92. /******************************/
  93.  
  94. #define OBJget_symbol(obj,type)     (*OBJ[type].get_symbol)(obj)
  95. #define OBJget_type(_type_)        (OBJ[_type_].type)
  96. #define OBJget_bits(_type_)        (OBJ[_type_].bits)
  97. #define OBJtype_is_oneof(_type_,class)    (OBJ[_type_].bits & (class))
  98. #define OBJget_name(obj,type)        (OBJget_symbol(obj,type)->name)
  99.  
  100. /* for backwards compatibility */
  101. #define OBJequal(x,y)            ((x) == (y))
  102. #define OBJfree(x)
  103. #define OBJreference(x)            (x)
  104. #define OBJget_data(obj,type,err)    (obj)
  105.  
  106. /***********************/
  107. /* function prototypes */
  108. /***********************/
  109.  
  110. extern void    OBJinitialize PROTO((void));
  111. extern void    OBJcreate PROTO((char,struct Symbol *(*)(Generic),char *,int));
  112. #if 0
  113. extern void    OBJcreate(char,struct Symbol *(*)(Generic),char *,int);
  114. #endif
  115.  
  116. /********************/
  117. /* inline functions */
  118. /********************/
  119.  
  120. #if supports_inline_functions || defined(OBJECT_C)
  121. #endif /* supports_inline_functions || defined(OBJECT_C) */
  122.  
  123. #endif /*OBJECT_H*/
  124.