home *** CD-ROM | disk | FTP | other *** search
/ Software 2000 / Software 2000 Volume 1 (Disc 1 of 2).iso / utilities / u118.dms / in.adf / iff / iff.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-11-30  |  20.1 KB  |  484 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. #ifndef COMPILER_H
  11. #include "iff/compiler.h"
  12. #endif
  13.  
  14. #ifndef LIBRARIES_DOS_H
  15. #include "libraries/dos.h"
  16. #endif
  17.  
  18. #ifndef OFFSET_BEGINNING
  19. #define OFFSET_BEGINNING OFFSET_BEGINING
  20. #endif
  21.  
  22. typedef LONG IFFP;    /* Status code result from an IFF procedure */
  23.     /* LONG, because must be type compatable with ID for GetChunkHdr.*/
  24.     /* Note that the error codes below are not legal IDs.*/
  25. #define IFF_OKAY   0L    /* Keep going...*/
  26. #define END_MARK  -1L    /* As if there was a chunk at end of group.*/
  27. #define IFF_DONE  -2L    /* clientProc returns this when it has READ enough.
  28.              * It means return thru all levels. File is Okay.*/
  29. #define DOS_ERROR -3L
  30. #define NOT_IFF   -4L    /* not an IFF file.*/
  31. #define NO_FILE   -5L    /* Tried to open file, DOS didn't find it.*/
  32. #define CLIENT_ERROR -6L /* Client made invalid request, for instance, write
  33.              * a negative size chunk.*/
  34. #define BAD_FORM  -7L    /* A client read proc complains about FORM semantics;
  35.              * e.g. valid IFF, but missing a required chunk.*/
  36. #define SHORT_CHUNK -8L    /* Client asked to IFFReadBytes more bytes than left
  37.              * in the chunk. Could be client bug or bad form.*/
  38. #define BAD_IFF   -9L    /* mal-formed IFF file. [TBD] Expand this into a
  39.              * range of error codes.*/
  40. #define LAST_ERROR BAD_IFF
  41.  
  42. /* This MACRO is used to RETURN immediately when a termination condition is
  43.  * found. This is a pretty weird macro. It requires the caller to declare a
  44.  * local "IFFP iffp" and assign it. This wouldn't work as a subroutine since
  45.  * it returns for it's caller. */
  46. #define CheckIFFP()   { if (iffp != IFF_OKAY) return(iffp); }
  47.  
  48.  
  49. /* ---------- ID -------------------------------------------------------*/
  50.  
  51. typedef LONG ID;    /* An ID is four printable ASCII chars but
  52.              * stored as a LONG for efficient copy & compare.*/
  53.  
  54. /* Four-character IDentifier builder.*/
  55. #ifdef NORTHC
  56. /* NorthC doesnt like casts in constants */
  57. #define MakeID(a,b,c,d)  ( ((a)<<24) | ((b)<<16) | ((c)<<8) | (d) )
  58. #else
  59. #define MakeID(a,b,c,d)  ( (LONG)(a)<<24L | (LONG)(b)<<16L | (c)<<8 | (d) )
  60. #endif
  61.  
  62. /* Standard group IDs.  A chunk with one of these IDs contains a
  63.    SubTypeID followed by zero or more chunks.*/
  64. #define FORM MakeID('F','O','R','M')
  65. #define PROP MakeID('P','R','O','P')
  66. #define LIST MakeID('L','I','S','T')
  67. #define CAT  MakeID('C','A','T',' ')
  68. #define FILLER MakeID(' ',' ',' ',' ')
  69. /* The IDs "FOR1".."FOR9", "LIS1".."LIS9", & "CAT1".."CAT9" are reserved
  70.  * for future standardization.*/
  71.  
  72. /* Pseudo-ID used internally by chunk reader and writer.*/
  73. #define NULL_CHUNK 0L           /* No current chunk.*/
  74.  
  75.  
  76. /* ---------- Chunk ----------------------------------------------------*/
  77.  
  78. /* All chunks start with a type ID and a count of the data bytes that 
  79.    follow--the chunk's "logicl size" or "data size". If that number is odd,
  80.    a 0 pad byte is written, too. */
  81. typedef struct {
  82.     ID      ckID;
  83.     LONG  ckSize;
  84.     } ChunkHeader;
  85.  
  86. typedef struct {
  87.     ID      ckID;
  88.     LONG  ckSize;
  89.     UBYTE ckData[ 1 /*REALLY: ckSize*/ ];
  90.     } Chunk;
  91.  
  92. /* Pass ckSize = szNotYetKnown to the writer to mean "compute the size".*/
  93. #define szNotYetKnown 0x80000001L
  94.  
  95. /* Need to know whether a value is odd so can word-align.*/
  96. #define IS_ODD(a)   ((a) & 1)
  97.  
  98. /* This macro rounds up to an even number. */
  99. #define WordAlign(size)   ((size+1)&~1)
  100.  
  101. /* ALL CHUNKS MUST BE PADDED TO EVEN NUMBER OF BYTES.
  102.  * ChunkPSize computes the total "physical size" of a padded chunk from
  103.  * its "data size" or "logical size". */
  104. #define ChunkPSize(dataSize)  (WordAlign(dataSize) + sizeof(ChunkHeader))
  105.  
  106. /* The Grouping chunks (LIST, FORM, PROP, & CAT) contain concatenations of
  107.  * chunks after a subtype ID that identifies the content chunks.
  108.  * "FORM type XXXX", "LIST of FORM type XXXX", "PROPerties associated
  109.  * with FORM type XXXX", or "conCATenation of XXXX".*/
  110. typedef struct {
  111.     ID      ckID;
  112.     LONG  ckSize;    /* this ckSize includes "grpSubID".*/
  113.     ID    grpSubID;
  114.     } GroupHeader;
  115.  
  116. typedef struct {
  117.     ID      ckID;
  118.     LONG  ckSize;
  119.     ID    grpSubID;
  120.     UBYTE grpData[ 1 /*REALLY: ckSize-sizeof(grpSubID)*/ ];
  121.     } GroupChunk;
  122.  
  123.  
  124. /* ---------- IFF Reader -----------------------------------------------*/
  125.  
  126. /******** Routines to support a stream-oriented IFF file reader *******
  127.  *
  128.  * These routines handle lots of details like error checking and skipping
  129.  * over padding. They're also careful not to read past any containing context.
  130.  *
  131.  * These routines ASSUME they're the only ones reading from the file.
  132.  * Client should check IFFP error codes. Don't press on after an error!
  133.  * These routines try to have no side effects in the error case, except
  134.  * partial I/O is sometimes unavoidable.
  135.  *
  136.  * All of these routines may return DOS_ERROR. In that case, ask DOS for the
  137.  * specific error code.
  138.  *
  139.  * The overall scheme for the low level chunk reader is to open a "group read
  140.  * context" with OpenRIFF or OpenRGroup, read the chunks with GetChunkHdr
  141.  * (and its kin) and IFFReadBytes, and close the context with CloseRGroup.
  142.  *
  143.  * The overall scheme for reading an IFF file is to use ReadIFF, ReadIList,
  144.  * and ReadICat to scan the file. See those procedures, ClientProc (below),
  145.  * and the skeleton IFF reader. */
  146.  
  147. /* Client passes ptrs to procedures of this type to ReadIFF which call them
  148.  * back to handle LISTs, FORMs, CATs, and PROPs.
  149.  *
  150.  * Use the GroupContext ptr when calling reader routines like GetChunkHdr.
  151.  * Look inside the GroupContext ptr for your ClientFrame ptr. You'll
  152.  * want to type cast it into a ptr to your containing struct to get your
  153.  * private contextual data (stacked property settings). See below. */
  154. #ifdef FDwAT
  155. typedef IFFP ClientProc(struct _GroupContext *);
  156. #else
  157. typedef IFFP ClientProc();
  158. #endif
  159.  
  160. /* Client's context for reading an IFF file or a group.
  161.  * Client should actually make this the first component of a larger struct
  162.  * (it's personal stack "frame") that has a field to store each "interesting"
  163.  * property encountered.
  164.  * Either initialize each such field to a global default or keep a boolean
  165.  * indicating if you've read a property chunk into that field.
  166.  * Your getList and getForm procs should allocate a new "frame" and copy the
  167.  * parent frame's contents. The getProp procedure should store into the frame
  168.  * allocated by getList for the containing LIST. */
  169. typedef struct _ClientFrame {
  170.    ClientProc *getList, *getProp, *getForm, *getCat;
  171.     /* client's own data follows; place to stack property settings */
  172.     } ClientFrame;
  173.  
  174. /* Our context for reading a group chunk. */
  175. typedef struct _GroupContext {
  176.     struct _GroupContext *parent; /* Containing group; NULL => whole file. */
  177.     ClientFrame *clientFrame;     /* Reader data & client's context state. */
  178.     BPTR file;        /* Byte-stream file handle. */
  179.     LONG position;    /* The context's logical file position. */
  180.     LONG bound;        /* File-absolute context bound
  181.              * or szNotYetKnown (writer only). */
  182.     ChunkHeader ckHdr;    /* Current chunk header. ckHdr.ckSize = szNotYetKnown
  183.              * means we need to go back and set the size (writer only).
  184.              * See also Pseudo-IDs, above. */
  185.     ID subtype;        /* Group's subtype ID when reading. */
  186.     LONG bytesSoFar;    /* # bytes read/written of current chunk's data. */
  187.     } GroupContext;
  188.  
  189. /* Computes the number of bytes not yet read from the current chunk, given
  190.  * a group read context gc. */
  191. #define ChunkMoreBytes(gc)  ((gc)->ckHdr.ckSize - (gc)->bytesSoFar)
  192.  
  193.  
  194. /***** Low Level IFF Chunk Reader *****/
  195.  
  196. #ifdef FDwAT
  197.  
  198. /* Given an open file, open a read context spanning the whole file.
  199.  * This is normally only called by ReadIFF.
  200.  * This sets new->clientFrame = clientFrame.
  201.  * ASSUME context allocated by caller but not initialized.
  202.  * ASSUME caller doesn't deallocate the context before calling CloseRGroup.
  203.  * NOT_IFF ERROR if the file is too short for even a chunk header.*/
  204. extern IFFP OpenRIFF(BPTR, GroupContext *, ClientFrame *);
  205.              /*  file, new,            clientFrame  */
  206.  
  207. /* Open the remainder of the current chunk as a group read context.
  208.  * This will be called just after the group's subtype ID has been read
  209.  * (automatically by GetChunkHdr for LIST, FORM, PROP, and CAT) so the
  210.  * remainder is a sequence of chunks.
  211.  * This sets new->clientFrame = parent->clientFrame. The caller should repoint
  212.  * it at a new clientFrame if opening a LIST context so it'll have a "stack
  213.  * frame" to store PROPs for the LIST. (It's usually convenient to also
  214.  * allocate a new Frame when you encounter FORM of the right type.)
  215.  *
  216.  * ASSUME new context allocated by caller but not initialized.
  217.  * ASSUME caller doesn't deallocate the context or access the parent context
  218.  * before calling CloseRGroup.
  219.  * BAD_IFF ERROR if context end is odd or extends past parent. */
  220. extern IFFP OpenRGroup(GroupContext *, GroupContext *);
  221.            /*  parent,         new  */
  222.  
  223. /* Close a group read context, updating its parent context.
  224.  * After calling this, the old context may be deallocated and the parent
  225.  * context can be accessed again. It's okay to call this particular procedure
  226.  * after an error has occurred reading the group.
  227.  * This always returns IFF_OKAY. */
  228. extern IFFP CloseRGroup(GroupContext *);
  229.             /*  old  */
  230.  
  231. /* Skip any remaining bytes of the previous chunk and any padding, then
  232.  * read the next chunk header into context.ckHdr.
  233.  * If the ckID is LIST, FORM, CAT, or PROP, this automatically reads the
  234.  * subtype ID into context->subtype.
  235.  * Caller should dispatch on ckID (and subtype) to an appropriate handler.
  236.  *
  237.  * RETURNS context.ckHdr.ckID (the ID of the new chunk header); END_MARK
  238.  * if there are no more chunks in this context; or NOT_IFF if the top level
  239.  * file chunk isn't a FORM, LIST, or CAT; or BAD_IFF if malformed chunk, e.g.
  240.  * ckSize is negative or too big for containing context, ckID isn't positive,
  241.  * or we hit end-of-file.
  242.  *
  243.  * See also GetFChunkHdr, GetF1ChunkHdr, and GetPChunkHdr, below.*/
  244. extern ID       GetChunkHdr(GroupContext *);
  245.   /*  context.ckHdr.ckID    context  */
  246.  
  247. /* Read nBytes number of data bytes of current chunk. (Use OpenGroup, etc.
  248.  * instead to read the contents of a group chunk.) You can call this several
  249.  * times to read the data piecemeal.
  250.  * CLIENT_ERROR if nBytes < 0. SHORT_CHUNK if nBytes > ChunkMoreBytes(context)
  251.  * which could be due to a client bug or a chunk that's shorter than it
  252.  * ought to be (bad form). (on either CLIENT_ERROR or SHORT_CHUNK,
  253.  * IFFReadBytes won't read any bytes.) */
  254. extern IFFP IFFReadBytes(GroupContext *, BYTE *, LONG);
  255.              /*  context,        buffer, nBytes  */
  256.  
  257.  
  258. /***** IFF File Reader *****/
  259.  
  260. /* This is a noop ClientProc that you can use for a getList, getForm, getProp,
  261.  * or getCat procedure that just skips the group. A simple reader might just
  262.  * implement getForm, store ReadICat in the getCat field of clientFrame, and
  263.  * use SkipGroup for the getList and getProp procs.*/
  264. extern IFFP SkipGroup(GroupContext *);
  265.  
  266. /* IFF file reader.
  267.  * Given an open file, allocate a group context and use it to read the FORM,
  268.  * LIST, or CAT and it's contents. The idea is to parse the file's contents,
  269.  * and for each FORM, LIST, CAT, or PROP encountered, call the getForm,
  270.  * getList, getCat, or getProp procedure in clientFrame, passing the
  271.  * GroupContext ptr.
  272.  * This is achieved with the aid of ReadIList (which your getList should
  273.  * call) and ReadICat (which your getCat should call, if you don't just use
  274.  * ReadICat for your getCat). If you want to handle FORMs, LISTs, and CATs
  275.  * nested within FORMs, the getForm procedure must dispatch to getForm,
  276.  * getList, and getCat (it can use GetF1ChunkHdr to make this easy).
  277.  *
  278.  * Normal return is IFF_OKAY (if whole file scanned) or IFF_DONE (if a client
  279.  * proc said "done" first).
  280.  * See the skeletal getList, getForm, getCat, and getProp procedures. */
  281. extern IFFP ReadIFF(BPTR, ClientFrame *);
  282.                 /*  file, clientFrame  */
  283.  
  284. /* IFF LIST reader.
  285.  * Your "getList" procedure should allocate a ClientFrame, copy the parent's
  286.  * ClientFrame, and then call this procedure to do all the work.
  287.  *
  288.  * Normal return is IFF_OKAY (if whole LIST scanned) or IFF_DONE (if a client
  289.  * proc said "done" first).
  290.  * BAD_IFF ERROR if a PROP appears after a non-PROP. */
  291. extern IFFP ReadIList(GroupContext *, ClientFrame *);
  292.           /*  parent,         clientFrame  */
  293.  
  294. /* IFF CAT reader.
  295.  * Most clients can simply use this to read their CATs. If you must do extra
  296.  * setup work, put a ptr to your getCat procedure in the clientFrame, and
  297.  * have that procedure call ReadICat to do the detail work.
  298.  *
  299.  * Normal return is IFF_OKAY (if whole CAT scanned) or IFF_DONE (if a client
  300.  * proc said "done" first).
  301.  * BAD_IFF ERROR if a PROP appears in the CAT. */
  302. extern IFFP ReadICat(GroupContext *);
  303.          /*  parent  */
  304.  
  305. /* Call GetFChunkHdr instead of GetChunkHdr to read each chunk inside a FORM.
  306.  * It just calls GetChunkHdr and returns BAD_IFF if it gets a PROP chunk. */
  307. extern ID    GetFChunkHdr(GroupContext *);
  308.   /*  context.ckHdr.ckID    context  */
  309.  
  310. /* GetF1ChunkHdr is like GetFChunkHdr, but it automatically dispatches to the
  311.  * getForm, getList, and getCat procedure (and returns the result) if it
  312.  * encounters a FORM, LIST, or CAT. */
  313. extern ID    GetF1ChunkHdr(GroupContext *);
  314.   /*  context.ckHdr.ckID    context  */
  315.  
  316. /* Call GetPChunkHdr instead of GetChunkHdr to read each chunk inside a PROP.
  317.  * It just calls GetChunkHdr and returns BAD_IFF if it gets a group chunk. */
  318. extern ID    GetPChunkHdr(GroupContext *);
  319.   /*  context.ckHdr.ckID    context  */
  320.  
  321. #else /* not FDwAT */
  322.  
  323. extern IFFP OpenRIFF();
  324. extern IFFP OpenRGroup();
  325. extern IFFP CloseRGroup();
  326. extern ID   GetChunkHdr();
  327. extern IFFP IFFReadBytes();
  328. extern IFFP SkipGroup();
  329. extern IFFP ReadIFF();
  330. extern IFFP ReadIList();
  331. extern IFFP ReadICat();
  332. extern ID   GetFChunkHdr();
  333. extern ID   GetF1ChunkHdr();
  334. extern ID   GetPChunkHdr();
  335.  
  336. #endif /* not FDwAT */
  337.  
  338. /* ---------- IFF Writer -----------------------------------------------*/
  339.  
  340. /******* Routines to support a stream-oriented IFF file writer *******
  341.  *
  342.  * These routines will random access back to set a chunk size value when the
  343.  * caller doesn't know it ahead of time. They'll also do things automatically
  344.  * like padding and error checking.
  345.  *
  346.  * These routines ASSUME they're the only ones writing to the file.
  347.  * Client should check IFFP error codes. Don't press on after an error!
  348.  * These routines try to have no side effects in the error case, except that
  349.  * partial I/O is sometimes unavoidable.
  350.  *
  351.  * All of these routines may return DOS_ERROR. In that case, ask DOS for the
  352.  * specific error code.
  353.  *
  354.  * The overall scheme is to open an output GroupContext via OpenWIFF or
  355.  * OpenWGroup, call either PutCk or {PutCkHdr {IFFWriteBytes}* PutCkEnd} for
  356.  * each chunk, then use CloseWGroup to close the GroupContext.
  357.  *
  358.  * To write a group (LIST, FORM, PROP, or CAT), call StartWGroup, write out
  359.  * its chunks, then call EndWGroup. StartWGroup automatically writes the
  360.  * group header and opens a nested context for writing the contents.
  361.  * EndWGroup closes the nested context and completes the group chunk. */
  362.  
  363.  
  364. #ifdef FDwAT
  365.  
  366. /* Given a file open for output, open a write context.
  367.  * The "limit" arg imposes a fence or upper limit on the logical file
  368.  * position for writing data in this context. Pass in szNotYetKnown to be
  369.  * bounded only by disk capacity.
  370.  * ASSUME new context structure allocated by caller but not initialized.
  371.  * ASSUME caller doesn't deallocate the context before calling CloseWGroup.
  372.  * The caller is only allowed to write out one FORM, LIST, or CAT in this top
  373.  * level context (see StartWGroup and PutCkHdr).
  374.  * CLIENT_ERROR if limit is odd.*/
  375. extern IFFP OpenWIFF(BPTR, GroupContext *, LONG);
  376.          /*  file, new,            limit {file position}  */
  377.  
  378. /* Start writing a group (presumably LIST, FORM, PROP, or CAT), opening a
  379.  * nested context. The groupSize includes all nested chunks + the subtype ID.
  380.  *
  381.  * The subtype of a LIST or CAT is a hint at the contents' FORM type(s). Pass
  382.  * in FILLER if it's a mixture of different kinds.
  383.  *
  384.  * This writes the chunk header via PutCkHdr, writes the subtype ID via
  385.  * IFFWriteBytes, and calls OpenWGroup. The caller may then write the nested
  386.  * chunks and finish by calling EndWGroup.
  387.  * The OpenWGroup call sets new->clientFrame = parent->clientFrame.
  388.  *
  389.  * ASSUME new context structure allocated by caller but not initialized.
  390.  * ASSUME caller doesn't deallocate the context or access the parent context
  391.  * before calling CloseWGroup.
  392.  * ERROR conditions: See PutCkHdr, IFFWriteBytes, OpenWGroup. */
  393. extern IFFP StartWGroup(GroupContext *, ID, LONG, ID, GroupContext *);
  394.             /*  parent, groupType, groupSize, subtype, new  */
  395.  
  396. /* End a group started by StartWGroup.
  397.  * This just calls CloseWGroup and PutCkEnd.
  398.  * ERROR conditions: See CloseWGroup and PutCkEnd. */
  399. extern IFFP EndWGroup(GroupContext *);
  400.             /*  old  */
  401.  
  402. /* Open the remainder of the current chunk as a group write context.
  403.  * This is normally only called by StartWGroup.
  404.  *
  405.  * Any fixed limit to this group chunk or a containing context will impose
  406.  * a limit on the new context.
  407.  * This will be called just after the group's subtype ID has been written
  408.  * so the remaining contents will be a sequence of chunks.
  409.  * This sets new->clientFrame = parent->clientFrame.
  410.  * ASSUME new context structure allocated by caller but not initialized.
  411.  * ASSUME caller doesn't deallocate the context or access the parent context
  412.  * before calling CloseWGroup.
  413.  * CLIENT_ERROR if context end is odd or PutCkHdr wasn't called first. */
  414. extern IFFP OpenWGroup(GroupContext *, GroupContext *);
  415.            /*  parent,         new  */
  416.  
  417. /* Close a write context and update its parent context.
  418.  * This is normally only called by EndWGroup.
  419.  *
  420.  * If this is a top level context (created by OpenWIFF) we'll set the file's
  421.  * EOF (end of file) but won't close the file.
  422.  * After calling this, the old context may be deallocated and the parent
  423.  * context can be accessed again.
  424.  *
  425.  * Amiga DOS Note: There's no call to set the EOF. We just position to the
  426.  * desired end and return. Caller must Close file at that position.
  427.  * CLIENT_ERROR if PutCkEnd wasn't called first. */
  428. extern IFFP CloseWGroup(GroupContext *);
  429.             /*  old  */
  430.  
  431. /* Write a whole chunk to a GroupContext. This writes a chunk header, ckSize
  432.  * data bytes, and (if needed) a pad byte. It also updates the GroupContext.
  433.  * CLIENT_ERROR if ckSize == szNotYetKnown. See also PutCkHdr errors. */
  434. extern IFFP PutCk(GroupContext *, ID,   LONG,   BYTE *);
  435.           /*  context,        ckID, ckSize, *data  */
  436.  
  437. /* Write just a chunk header. Follow this will any number of calls to
  438.  * IFFWriteBytes and finish with PutCkEnd.
  439.  * If you don't yet know how big the chunk is, pass in ckSize = szNotYetKnown,
  440.  * then PutCkEnd will set the ckSize for you later.
  441.  * Otherwise, IFFWriteBytes and PutCkEnd will ensure that the specified
  442.  * number of bytes get written.
  443.  * CLIENT_ERROR if the chunk would overflow the GroupContext's bound, if
  444.  * PutCkHdr was previously called without a matching PutCkEnd, if ckSize < 0
  445.  * (except szNotYetKnown), if you're trying to write something other
  446.  * than one FORM, LIST, or CAT in a top level (file level) context, or
  447.  * if ckID <= 0 (these illegal ID values are used for error codes). */
  448. extern IFFP PutCkHdr(GroupContext *, ID,   LONG);
  449.          /*  context,        ckID, ckSize  */
  450.  
  451. /* Write nBytes number of data bytes for the current chunk and update
  452.  * GroupContext.
  453.  * CLIENT_ERROR if this would overflow the GroupContext's limit or the
  454.  * current chunk's ckSize, or if PutCkHdr wasn't called first, or if
  455.  * nBytes < 0. */
  456. extern IFFP IFFWriteBytes(GroupContext *, BYTE *, LONG);
  457.               /*  context,        *data,  nBytes  */
  458.  
  459. /* Complete the current chunk, write a pad byte if needed, and update
  460.  * GroupContext.
  461.  * If current chunk's ckSize = szNotYetKnown, this goes back and sets the
  462.  * ckSize in the file.
  463.  * CLIENT_ERROR if PutCkHdr wasn't called first, or if client hasn't
  464.  * written 'ckSize' number of bytes with IFFWriteBytes. */
  465. extern IFFP PutCkEnd(GroupContext *);
  466.          /*  context  */
  467.  
  468. #else /* not FDwAT */
  469.  
  470. extern IFFP OpenWIFF();
  471. extern IFFP StartWGroup();
  472. extern IFFP EndWGroup();
  473. extern IFFP OpenWGroup();
  474. extern IFFP CloseWGroup();
  475. extern IFFP PutCk();
  476. extern IFFP PutCkHdr();
  477. extern IFFP IFFWriteBytes();
  478. extern IFFP PutCkEnd();
  479.  
  480. #endif /* not FDwAT */
  481.  
  482. #endif IFF_H
  483.  
  484.