home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 497a.lha / ComSMUS_v2.2 / voicebank.prog / iff.h < prev    next >
C/C++ Source or Header  |  1991-04-07  |  2KB  |  79 lines

  1. #ifndef IFF_H
  2. #define IFF_H
  3. /*----------------------------------------------------------------------*/
  4. /* IFF.H  defs for IFF-85 Interchange Format Files.                1/22/86 */
  5. /*                                                                        */
  6. /* By Jerry Morrison and Steve Shaw, Electronic Arts.                    */
  7. /* This software is in the public domain.                                */
  8. /*----------------------------------------------------------------------*/
  9.  
  10. /* mods by Karl Lehenbauer, 1987, 1988 */
  11.  
  12. #ifndef COMPILER_H
  13. #include "compiler.h"
  14. #endif
  15.  
  16. #ifndef LIBRARIES_DOS_H
  17. #include "libraries/dos.h"
  18. #endif
  19.  
  20. typedef LONG ID;
  21.  
  22. /* Four-character IDentifier builder.*/
  23. #define MakeID(a,b,c,d)  ( (LONG)(a)<<24L | (LONG)(b)<<16L | (c)<<8 | (d) )
  24.  
  25. /* Standard group IDs.  A chunk with one of these IDs contains a
  26.    SubTypeID followed by zero or more chunks.*/
  27. #define ID_FORM MakeID('F','O','R','M')
  28. #define ID_PROP MakeID('P','R','O','P')
  29. #define ID_LIST MakeID('L','I','S','T')
  30. #define ID_CAT  MakeID('C','A','T',' ')
  31. #define ID_FILLER MakeID(' ',' ',' ',' ')
  32. #define ID_FNAM MakeID('F','N','A','M')
  33. #define ID_MISC MakeID('M','I','S','C')
  34.  
  35. /* The IDs "FOR1".."FOR9", "LIS1".."LIS9", & "CAT1".."CAT9" are reserved
  36.  * for future standardization.*/
  37.  
  38. /* ---------- Chunk ----------------------------------------------------*/
  39.  
  40. /* All chunks start with a type ID and a count of the data bytes that 
  41.    follow--the chunk's "logicl size" or "data size". If that number is odd,
  42.    a 0 pad byte is written, too. */
  43.  
  44. typedef struct {
  45.     ID      ckID;
  46.     LONG  ckSize;
  47.     } ChunkHeader;
  48.  
  49. typedef struct {
  50.     ID      ckID;
  51.     LONG  ckSize;
  52.     UBYTE ckData[ 1 /*REALLY: ckSize*/ ];
  53.     } Chunk;
  54.  
  55. /* define the maximum reasonable chunk size - the real max is around 2^32,
  56.  * but we need some reasonability limit to check for */
  57. #define MAXCHUNKSIZE 900000
  58.  
  59. /* The Grouping chunks (LIST, FORM, PROP, & CAT) contain concatenations of
  60.  * chunks after a subtype ID that identifies the content chunks.
  61.  * "FORM type XXXX", "LIST of FORM type XXXX", "PROPerties associated
  62.  * with FORM type XXXX", or "conCATenation of XXXX".*/
  63. typedef struct {
  64.     ID      ckID;
  65.     LONG  ckSize;    /* this ckSize includes "grpSubID".*/
  66.     ID    grpSubID;
  67.     } GroupHeader;
  68.  
  69. typedef struct {
  70.     ID      ckID;
  71.     LONG  ckSize;
  72.     ID    grpSubID;
  73.     UBYTE grpData[ 1 /*REALLY: ckSize-sizeof(grpSubID)*/ ];
  74.     } GroupChunk;
  75.  
  76.  
  77. #endif IFF_H
  78.  
  79.