home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 300-399 / ff397.lzh / DKBTrace / DKBSource.LZH / frame.h < prev    next >
C/C++ Source or Header  |  1990-08-26  |  15KB  |  621 lines

  1. /*****************************************************************************
  2. *
  3. *                                   frame.h
  4. *
  5. *   from DKBTrace (c) 1990  David Buck
  6. *
  7. *  This header file is included by all C modules in DKBTrace.  It defines all
  8. *  globally-accessible types and constants.
  9. *
  10. * This software is freely distributable. The source and/or object code may be
  11. * copied or uploaded to communications services so long as this notice remains
  12. * at the top of each file.  If any changes are made to the program, you must
  13. * clearly indicate in the documentation and in the programs startup message
  14. * who it was who made the changes. The documentation should also describe what
  15. * those changes were. This software may not be included in whole or in
  16. * part into any commercial package without the express written consent of the
  17. * author.  It may, however, be included in other public domain or freely
  18. * distributed software so long as the proper credit for the software is given.
  19. *
  20. * This software is provided as is without any guarantees or warranty. Although
  21. * the author has attempted to find and correct any bugs in the software, he
  22. * is not responsible for any damage caused by the use of the software.  The
  23. * author is under no obligation to provide service, corrections, or upgrades
  24. * to this package.
  25. *
  26. * Despite all the legal stuff above, if you do find bugs, I would like to hear
  27. * about them.  Also, if you have any comments or questions, you may contact me
  28. * at the following address:
  29. *
  30. *     David Buck
  31. *     22C Sonnet Cres.
  32. *     Nepean Ontario
  33. *     Canada, K2H 8W7
  34. *
  35. *  I can also be reached on the following bulleton boards:
  36. *
  37. *     ATX              (613) 526-4141
  38. *     OMX              (613) 731-3419
  39. *     Mystic           (613) 731-0088 or (613) 731-6698
  40. *
  41. *  Fidonet:   1:163/109.9
  42. *  Internet:  David_Buck@Carleton.CA
  43. *
  44. *  IBM Port by Aaron A. Collins. Aaron may be reached on the following BBS'es:
  45. *
  46. *     Lattice BBS                      (708) 916-1200
  47. *     The Information Exchange BBS     (708) 945-5575
  48. *     Stillwaters BBS                  (708) 403-2826
  49. *
  50. *****************************************************************************/
  51.  
  52.  
  53. /* Generic header for all modules */
  54.  
  55. #include "config.h"
  56. #include <stdio.h>
  57. #include <string.h>
  58. #include <math.h>
  59.  
  60. #ifndef TRUE
  61. #define TRUE 1
  62. #define FALSE 0
  63. #endif
  64.  
  65. #ifndef FILE_NAME_LENGTH
  66. #define FILE_NAME_LENGTH 150
  67. #endif
  68.  
  69. #ifndef DBL
  70. #define DBL double
  71. #endif
  72.  
  73. #ifndef HUGE_VAL
  74. #define HUGE_VAL 1.0e+17
  75. #endif
  76.  
  77. #ifndef DBL_FORMAT_STRING
  78. #define DBL_FORMAT_STRING "%lf"
  79. #endif
  80.  
  81. #ifndef TEST_ABORT
  82. #define TEST_ABORT
  83. #endif
  84.  
  85. /* These values determine the minumum and maximum distances
  86.    that qualify as ray-object intersections */
  87. #define Small_Tolerance 0.001
  88. #define Max_Distance 1.0e7
  89.  
  90. /* Maximum gif bitmap size allowed. */
  91. #define BITMAP_X_SIZE 640
  92. #define BITMAP_Y_SIZE 480
  93.  
  94. typedef struct q_entry INTERSECTION;
  95. typedef struct Vector_Struct VECTOR;
  96. typedef DBL MATRIX [4][4];
  97. typedef struct Colour_Struct COLOUR;
  98. typedef struct Colour_Map_Entry COLOUR_MAP_ENTRY;
  99. typedef struct Colour_Map_Struct COLOUR_MAP;
  100. typedef struct Transformation_Struct TRANSFORMATION;
  101. typedef struct Image_Struct IMAGE;
  102. typedef struct Texture_Struct TEXTURE;
  103. typedef struct Method_Struct METHODS;
  104. typedef struct Viewpoint_Struct VIEWPOINT;
  105. typedef struct Object_Shape SHAPE;
  106. typedef struct Object_Struct OBJECT;
  107. typedef struct Sphere_Shape SPHERE;
  108. typedef struct Quadric_Shape QUADRIC;
  109. typedef struct Triangle_Shape TRIANGLE;
  110. typedef struct Smooth_Triangle_Shape SMOOTH_TRIANGLE;
  111. typedef struct Plane_Shape PLANE;
  112. typedef struct CSG_Type CSG_SHAPE;
  113. typedef struct Composite_Object_Struct COMPOSITE;
  114. typedef struct Ray_Struct RAY;
  115. typedef struct Frame_Struct FRAME;
  116. typedef struct prioq_struct PRIOQ;
  117. typedef enum Token_Type TOKEN;
  118. typedef enum Constant_Type CONSTANT;
  119. typedef struct Chunk_Header_Struct CHUNK_HEADER;
  120.  
  121. struct Vector_Struct
  122.    {
  123.    DBL x, y, z;
  124.    };
  125.  
  126.  
  127.  
  128. struct Colour_Struct
  129.    {
  130.    DBL Red, Green, Blue, Alpha;
  131.    };
  132.  
  133.  
  134. struct Colour_Map_Entry
  135.    {
  136.    DBL start, end;
  137.    COLOUR Start_Colour, End_Colour;
  138.    };
  139.  
  140.  
  141. struct Colour_Map_Struct
  142.    {
  143.    int Number_Of_Entries;
  144.    COLOUR_MAP_ENTRY *Colour_Map_Entries;
  145.    };
  146.  
  147.  
  148. struct Transformation_Struct
  149.    {
  150.    MATRIX matrix;
  151.    MATRIX inverse;
  152.    };
  153.  
  154.  
  155. struct Image_Struct
  156.    {
  157.    DBL width, height;
  158.    int iwidth, iheight;
  159.    unsigned char *red, *green, *blue;
  160.    };
  161.  
  162.  
  163. enum Texture_Type { NO_TEXTURE, BOZO_TEXTURE, MARBLE_TEXTURE, WOOD_TEXTURE, CHECKER_TEXTURE, SPOTTED_TEXTURE, AGATE_TEXTURE, GRANITE_TEXTURE, GRADIENT_TEXTURE, IMAGEMAP_TEXTURE } ;
  164.  
  165. enum Bump_Type { NO_BUMPS, WAVES, RIPPLES, WRINKLES, BUMPS, DENTS };
  166.  
  167. struct Texture_Struct
  168.    {
  169.    DBL Object_Reflection;
  170.    DBL Object_Ambient;
  171.    DBL Object_Diffuse, Object_Brilliance;
  172.    DBL Object_Index_Of_Refraction;
  173.    DBL Object_Refraction;
  174.    DBL Object_Specular, Object_Roughness;
  175.    DBL Object_Phong, Object_PhongSize;
  176.    DBL Bump_Amount;
  177.    DBL Texture_Randomness;
  178.    DBL Frequency;
  179.    DBL Phase;
  180.    enum Texture_Type Texture_Number ;
  181.    enum Bump_Type Bump_Number;
  182.    TRANSFORMATION *Texture_Transformation;
  183.    COLOUR Colour1;
  184.    COLOUR Colour2;
  185.    DBL Turbulence;
  186.    VECTOR Texture_Gradient;
  187.    COLOUR_MAP *Colour_Map;
  188.    IMAGE *Image;
  189.    short Once_Flag;
  190.    };
  191.  
  192. enum Object_Type {SPHERE_TYPE, TRIANGLE_TYPE, SMOOTH_TRIANGLE_TYPE, PLANE_TYPE,
  193.                   QUADRIC_TYPE, COMPOSITE_TYPE, OBJECT_TYPE,
  194.                   CSG_UNION_TYPE, CSG_INTERSECTION_TYPE, CSG_DIFFERENCE_TYPE,
  195.                   VIEWPOINT_TYPE };
  196.  
  197. struct Object_Struct
  198.    {
  199.    METHODS *Methods;
  200.    enum Object_Type Type;
  201.    struct Object_Struct *Next_Object;
  202.    struct Object_Struct *Next_Light_Source;
  203.    SHAPE *Bounding_Shapes;
  204.    SHAPE *Shape;
  205.    char Light_Source_Flag;
  206.    char Transparency;
  207.    VECTOR  Object_Center;
  208.    COLOUR Object_Colour;
  209.    TEXTURE *Object_Texture;
  210.    };
  211.  
  212.  
  213. typedef INTERSECTION *(*INTERSECTION_METHOD)PARAMS((OBJECT *, RAY *));
  214. typedef int (*ALL_INTERSECTIONS_METHOD)PARAMS((OBJECT *, RAY *, PRIOQ *));
  215. typedef int (*INSIDE_METHOD)PARAMS((VECTOR *, OBJECT *));
  216. typedef void (*NORMAL_METHOD)PARAMS((VECTOR *, OBJECT *, VECTOR *));
  217. typedef void *(*COPY_METHOD)PARAMS((OBJECT *));
  218. typedef void (*TRANSLATE_METHOD)PARAMS((OBJECT *, VECTOR *));
  219. typedef void (*ROTATE_METHOD)PARAMS((OBJECT *, VECTOR *));
  220. typedef void (*SCALE_METHOD)PARAMS((OBJECT *, VECTOR *));
  221. typedef void (*INVERT_METHOD)PARAMS((OBJECT *));
  222.  
  223. struct Method_Struct
  224.    {
  225.    INTERSECTION_METHOD Intersection_Method;
  226.    ALL_INTERSECTIONS_METHOD All_Intersections_Method;
  227.    INSIDE_METHOD Inside_Method;
  228.    NORMAL_METHOD Normal_Method;
  229.    COPY_METHOD Copy_Method;
  230.    TRANSLATE_METHOD Translate_Method;
  231.    ROTATE_METHOD Rotate_Method;
  232.    SCALE_METHOD Scale_Method;
  233.    INVERT_METHOD Invert_Method;
  234.    };
  235.  
  236.  
  237. #define All_Intersections(x,y,z) ((*((x)->Methods->All_Intersections_Method)) (x,y,z))
  238. #define Intersection(x,y) ((*((x)->Methods->Intersection_Method)) (x,y))
  239. #define Inside(x,y) ((*((y)->Methods->Inside_Method)) (x,y))
  240. #define Normal(x,y,z) ((*((y)->Methods->Normal_Method)) (x,y,z))
  241. #define Copy(x) ((*((x)->Methods->Copy_Method)) (x))
  242. #define Translate(x,y) ((*((x)->Methods->Translate_Method)) (x,y))
  243. #define Scale(x,y) ((*((x)->Methods->Scale_Method)) (x,y))
  244. #define Rotate(x,y) ((*((x)->Methods->Rotate_Method)) (x,y))
  245. #define Invert(x) ((*((x)->Methods->Invert_Method)) (x))
  246.  
  247. struct Viewpoint_Struct
  248.    {
  249.    METHODS *Methods;
  250.    enum Object_Type Type;
  251.    VECTOR Location;
  252.    VECTOR Direction;
  253.    VECTOR Up;
  254.    VECTOR Right;
  255.    VECTOR Sky;
  256.    };
  257.  
  258.  
  259. struct Object_Shape
  260.    {
  261.    METHODS *Methods;
  262.    enum Object_Type Type;
  263.    struct Object_Shape *Next_Object;
  264.    void *Parent_Object;
  265.    };
  266.  
  267.  
  268. struct Sphere_Shape
  269.    {
  270.    METHODS *Methods;
  271.    enum Object_Type Type;
  272.    SHAPE *Next_Object;
  273.    OBJECT *Parent_Object;
  274.    VECTOR  Center;
  275.    DBL     Radius;
  276.    DBL     Radius_Squared;
  277.    DBL     Inverse_Radius;
  278.    VECTOR  VPOtoC;
  279.    DBL     VPOCSquared;
  280.    short   VPinside, VPCached, Inverted;
  281.    };
  282.  
  283.  
  284. struct Quadric_Shape
  285.    {
  286.    METHODS *Methods;
  287.    enum Object_Type Type;
  288.    SHAPE *Next_Object;
  289.    OBJECT *Parent_Object;
  290.    VECTOR  Object_2_Terms;
  291.    VECTOR  Object_Mixed_Terms;
  292.    VECTOR  Object_Terms;
  293.    DBL Object_Constant;
  294.    DBL Object_VP_Constant;
  295.    int Constant_Cached;
  296.    int Non_Zero_Square_Term;
  297.    };
  298.  
  299.  
  300. #define X_AXIS 0
  301. #define Y_AXIS 1
  302. #define Z_AXIS 2
  303.  
  304. struct Triangle_Shape
  305.    {
  306.    METHODS *Methods;
  307.    enum Object_Type Type;
  308.    SHAPE *Next_Object;
  309.    OBJECT *Parent_Object;
  310.    VECTOR  Normal_Vector;
  311.    DBL     Distance;
  312.    DBL     VPNormDotOrigin;
  313.    unsigned int  VPCached:1;
  314.    unsigned int  Dominant_Axis:2;
  315.    unsigned int  Inverted:1;
  316.    unsigned int  vAxis:2;         /* used only for smooth triangles */
  317.    VECTOR  P1, P2, P3;
  318.    };
  319.  
  320.  
  321. struct Smooth_Triangle_Shape
  322.    {
  323.    METHODS *Methods;
  324.    enum Object_Type Type;
  325.    SHAPE *Next_Object;
  326.    OBJECT *Parent_Object;
  327.    VECTOR  Normal_Vector;
  328.    DBL     Distance;
  329.    DBL     VPNormDotOrigin;
  330.    unsigned int  VPCached:1;
  331.    unsigned int  Dominant_Axis:2;
  332.    unsigned int  Inverted:1;
  333.    unsigned int  vAxis:2;         /* used only for smooth triangles */
  334.    VECTOR  P1, P2, P3;
  335.    VECTOR  N1, DN12, DN13, Perp;
  336.    DBL  BaseDelta;
  337.    };
  338.  
  339.  
  340.  
  341. struct Plane_Shape
  342.    {
  343.    METHODS *Methods;
  344.    enum Object_Type Type;
  345.    SHAPE *Next_Object;
  346.    OBJECT *Parent_Object;
  347.    VECTOR  Normal_Vector;
  348.    DBL     Distance;
  349.    DBL     VPNormDotOrigin;
  350.    int     VPCached;
  351.    };
  352.  
  353.  
  354. struct CSG_Type
  355.    {
  356.    METHODS *Methods;
  357.    enum Object_Type Type;
  358.    SHAPE *Next_Object;
  359.    OBJECT *Parent_Object;
  360.    SHAPE *Shapes;
  361.    };
  362.    
  363.  
  364. struct Composite_Object_Struct
  365.    {
  366.    METHODS *Methods;
  367.    enum Object_Type Type;
  368.    OBJECT *Next_Object;
  369.    OBJECT *Next_Light_Source;
  370.    SHAPE *Bounding_Shapes;
  371.    OBJECT *Objects;
  372.    };
  373.  
  374.  
  375. #define MAX_CONTAINING_OBJECTS 5
  376.  
  377. struct Ray_Struct
  378.    {
  379.    VECTOR Initial;               /*  Xo  Yo  Zo  */
  380.    VECTOR Direction;             /*  Xv  Yv  Zv  */
  381.    VECTOR Initial_2;             /*  Xo^2  Yo^2  Zo^2  */
  382.    VECTOR Direction_2;           /*  Xv^2  Yv^2  Zv^2  */
  383.    VECTOR Initial_Direction;     /*  XoXv  YoYv  ZoZv  */
  384.    VECTOR Mixed_Initial_Initial; /*  XoYo  XoZo  YoZo  */
  385.    VECTOR Mixed_Dir_Dir;         /*  XvYv  XvZv  YvZv  */
  386.    VECTOR Mixed_Init_Dir;        /*  XoYv+XvYo  XoZv+XvZo  YoZv+YvZo  */
  387.    int Containing_Index;
  388.    OBJECT *Containing_Objects [MAX_CONTAINING_OBJECTS];
  389.    DBL Containing_IORs [MAX_CONTAINING_OBJECTS];
  390.    int Quadric_Constants_Cached;
  391.    };
  392.  
  393.  
  394. struct Frame_Struct
  395.    {
  396.    VIEWPOINT View_Point;
  397.    int Screen_Height, Screen_Width;
  398.    OBJECT *Light_Sources;
  399.    OBJECT *Objects;
  400.    DBL Atmosphere_IOR, Antialias_Threshold;
  401.    DBL Fog_Distance;
  402.    COLOUR Fog_Colour;
  403.    };
  404.  
  405.  
  406. #define DISPLAY 1
  407. #define VERBOSE 2
  408. #define DISKWRITE 4
  409. #define PROMPTEXIT 8
  410. #define ANTIALIAS 16
  411. #define DEBUGGING 32
  412. #define RGBSEPARATE 64
  413. #define TARGA 128
  414. #define EXITENABLE 256
  415.  
  416. #define Make_Colour(c,r,g,b) { (c)->Red=(r);(c)->Green=(g);(c)->Blue=(b); (c)->Alpha=0.0; }
  417.  
  418. #define Make_Vector(v,a,b,c) { (v)->x=(a);(v)->y=(b);(v)->z=(c); }
  419.  
  420. /* Definitions for PRIOQ structure */
  421.  
  422. struct q_entry
  423.    {
  424.    DBL Depth;
  425.    OBJECT *Object;
  426.    VECTOR Point;
  427.    SHAPE *Shape;
  428.    };
  429.  
  430. struct prioq_struct
  431.    {
  432.    struct prioq_struct *next_pq;
  433.    struct q_entry *queue;
  434.    unsigned int current_entry, queue_size;
  435.    };
  436.  
  437.  
  438. /* Token Definitions for Parser */
  439.  
  440. enum Token_Type
  441.    {
  442.    AGATE_TOKEN,
  443.    ALPHA_TOKEN,
  444.    AMBIENT_TOKEN,
  445.    AMPERSAND_TOKEN,
  446.    AT_TOKEN,
  447.    BACK_QUOTE_TOKEN,
  448.    BACK_SLASH_TOKEN,
  449.    BAR_TOKEN,
  450.    BLUE_TOKEN,
  451.    BRILLIANCE_TOKEN,
  452.    BOZO_TOKEN,
  453.    BOUNDED_TOKEN,
  454.    BUMPS_TOKEN,
  455.    CHECKER_TOKEN,
  456.    COLON_TOKEN,
  457.    COLOR_TOKEN,
  458.    COLOUR_TOKEN,
  459.    COLOR_MAP_TOKEN,
  460.    COLOUR_MAP_TOKEN,
  461.    COMMA_TOKEN,
  462.    COMPOSITE_TOKEN,
  463.    DASH_TOKEN,
  464.    DECLARE_TOKEN,
  465.    DENTS_TOKEN,
  466.    DIFFERENCE_TOKEN,
  467.    DIFFUSE_TOKEN,
  468.    DIRECTION_TOKEN,
  469.    DOLLAR_TOKEN,
  470.    END_BOUNDED_TOKEN,
  471.    END_COLOR_MAP_TOKEN,
  472.    END_COLOUR_MAP_TOKEN,
  473.    END_COMPOSITE_TOKEN,
  474.    END_DIFFERENCE_TOKEN,
  475.    END_FOG_TOKEN,
  476.    END_INTERSECTION_TOKEN,
  477.    END_OBJECT_TOKEN,
  478.    END_OF_FILE_TOKEN,
  479.    END_PLANE_TOKEN,
  480.    END_POINTS_TOKEN,
  481.    END_POLYGON_TOKEN,
  482.    END_QUADRIC_TOKEN,
  483.    END_SHAPE_TOKEN,
  484.    END_SPHERE_TOKEN,
  485.    END_TEXTURE_TOKEN,
  486.    END_TRIANGLE_TOKEN,
  487.    END_UNION_TOKEN,
  488.    END_VIEW_POINT_TOKEN,
  489.    EQUALS_TOKEN,
  490.    EXCLAMATION_TOKEN,
  491.    FLOAT_TOKEN,
  492.    FOG_TOKEN,
  493.    FREQUENCY_TOKEN,
  494.    GIF_TOKEN,
  495.    GRADIENT_TOKEN,
  496.    GRANITE_TOKEN,
  497.    GREEN_TOKEN,
  498.    HASH_TOKEN,
  499.    HAT_TOKEN,
  500.    IDENTIFIER_TOKEN,
  501.    IFF_TOKEN,
  502.    IMAGEMAP_TOKEN,
  503.    INCLUDE_TOKEN,
  504.    INTERSECTION_TOKEN,
  505.    INVERSE_TOKEN,
  506.    IOR_TOKEN,
  507.    LEFT_ANGLE_TOKEN,
  508.    LEFT_BRACKET_TOKEN,
  509.    LEFT_SQUARE_TOKEN,
  510.    LIGHT_SOURCE_TOKEN,
  511.    LOCATION_TOKEN,
  512.    LOOK_AT_TOKEN,
  513.    MARBLE_TOKEN,
  514.    OBJECT_TOKEN,
  515.    ONCE_TOKEN,
  516.    PERCENT_TOKEN,
  517.    PHASE_TOKEN,
  518.    PHONG_TOKEN,
  519.    PHONGSIZE_TOKEN,
  520.    PLANE_TOKEN,
  521.    PLUS_TOKEN,
  522.    POINTS_TOKEN,
  523.    POLYGON_TOKEN,
  524.    QUADRIC_TOKEN,
  525.    QUESTION_TOKEN,
  526.    RAW_TOKEN,
  527.    RED_TOKEN,
  528.    REFLECTION_TOKEN,
  529.    REFRACTION_TOKEN,
  530.    REVOLVE_TOKEN,
  531.    RIGHT_TOKEN,
  532.    RIGHT_ANGLE_TOKEN,
  533.    RIGHT_BRACKET_TOKEN,
  534.    RIGHT_SQUARE_TOKEN,
  535.    RIPPLES_TOKEN,
  536.    ROTATE_TOKEN,
  537.    ROUGHNESS_TOKEN,
  538.    SCALE_TOKEN,
  539.    SEMI_COLON_TOKEN,
  540.    SHAPE_TOKEN,
  541.    SINGLE_QUOTE_TOKEN,
  542.    SIZE_TOKEN,
  543.    SKY_TOKEN,
  544.    SLASH_TOKEN,
  545.    SMOOTH_TRIANGLE_TOKEN,
  546.    SPECULAR_TOKEN,
  547.    SPHERE_TOKEN,
  548.    SPOTTED_TOKEN,
  549.    STAR_TOKEN,
  550.    STRING_TOKEN,
  551.    TEXTURE_TOKEN,
  552.    TILDE_TOKEN,
  553.    TRANSLATE_TOKEN,
  554.    TRIANGLE_TOKEN,
  555.    TURBULENCE_TOKEN,
  556.    UNION_TOKEN,
  557.    UP_TOKEN,
  558.    VIEW_POINT_TOKEN,
  559.    WAVES_TOKEN,
  560.    WOOD_TOKEN,
  561.    WRINKLES_TOKEN,
  562.    LAST_TOKEN };
  563.  
  564.  
  565. struct Reserved_Word_Struct
  566.    {
  567.    TOKEN Token_Number;
  568.    char *Token_Name;
  569.    };
  570.  
  571. /* Here's where you dump the information on the current token (fm. PARSE.C) */
  572.  
  573. struct Token_Struct
  574.    {
  575.    TOKEN Token_Id;
  576.    int Token_Line_No;
  577.    char Token_String[FILE_NAME_LENGTH];
  578.    DBL Token_Float;
  579.    int Identifier_Number;
  580.    int Unget_Token, End_Of_File;
  581.    };
  582.  
  583. /* Types of constants allowed in DECLARE statement (fm. PARSE.C) */
  584.  
  585. enum Constant_Type
  586.    {
  587.    OBJECT_CONSTANT,
  588.    VIEW_POINT_CONSTANT,
  589.    VECTOR_CONSTANT,
  590.    FLOAT_CONSTANT,
  591.    COLOUR_CONSTANT,
  592.    QUADRIC_CONSTANT,
  593.    SPHERE_CONSTANT,
  594.    PLANE_CONSTANT,
  595.    TRIANGLE_CONSTANT,
  596.    SMOOTH_TRIANGLE_CONSTANT,
  597.    CSG_INTERSECTION_CONSTANT,
  598.    CSG_UNION_CONSTANT,
  599.    CSG_DIFFERENCE_CONSTANT,
  600.    COMPOSITE_CONSTANT,
  601.    TEXTURE_CONSTANT
  602.    };
  603.  
  604.  
  605. struct Constant_Struct
  606.    {
  607.    int Identifier_Number;
  608.    CONSTANT Constant_Type;
  609.    char *Constant_Data;
  610.    };
  611.  
  612. /* Types for reading IFF files. */
  613. typedef struct {
  614.    unsigned short Red, Green, Blue;
  615.    } IMAGE_COLOUR;
  616.  
  617. struct Chunk_Header_Struct {
  618.    long name;
  619.    long size;
  620.    };
  621.