home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / TRSICAT.LZX / CATS_CD2_TRSI / Inc&AD2.1 / includes / libraries / iffparse.i < prev    next >
Encoding:
Text File  |  1992-09-11  |  5.9 KB  |  204 lines

  1.     IFND    IFF_IFFPARSE_I
  2. IFF_IFFPARSE_I    SET    1
  3. **
  4. **    $VER: iffparse.i 33.1 (20.11.90)
  5. **    Includes Release 38.56
  6. **
  7. **    Assembly include file for iffparse.library.
  8. **    Generated by hand from iffparse.h (9006.04)
  9. **
  10. **    (C) Copyright 1989-1992 Commodore-Amiga Inc., Stuart Ferguson
  11. **    and Leo L. Schwab
  12. **        All Rights Reserved
  13. **
  14.  
  15.         IFND    EXEC_TYPES_I
  16.         include "exec/types.i"
  17.         ENDC
  18.  
  19.         IFND    EXEC_LISTS_I
  20.         include "exec/lists.i"
  21.         ENDC
  22.  
  23.         IFND    EXEC_PORTS_I
  24.         include "exec/ports.i"
  25.         ENDC
  26.  
  27.         IFND    DEVICES_CLIPBOARD_I
  28.         include "devices/clipboard.i"
  29.         ENDC
  30.  
  31. *\
  32. * Struct associated with an active IFF stream.
  33. * "iff_Stream" is a value used by the client's read/write/seek functions -
  34. * it will not be accessed by the library itself and can have any value
  35. * (could even be a pointer or a BPTR).
  36. */
  37.     STRUCTURE IFFHandle,0
  38.         ULONG    iff_Stream
  39.         ULONG    iff_Flags
  40.         LONG    iff_Depth    ; Depth of context stack.
  41. * There are private fields hiding here.
  42.     LABEL    iff_SIZEOF
  43.  
  44. *\
  45. * Bit masks for "iff_Flags" field.
  46. */
  47. IFFF_READ    EQU    0            ; read mode - default
  48. IFFF_WRITE    EQU    1            ; write mode
  49. IFFF_RWBITS    EQU    IFFF_READ!IFFF_WRITE    ; read/write bits
  50. IFFF_FSEEK    EQU    1<<1            ; forward seek only
  51. IFFF_RSEEK    EQU    1<<2            ; random seek
  52. IFFF_RESERVED    EQU    $FFFF0000        ; Don't touch these bits.
  53.  
  54. *\
  55. * When the library calls your stream handler, you'll be passed a pointer
  56. * to this structure as the "message packet".
  57. * NOTE:  ASSEMBLY PREFIX (isc_) DIFFERENT FROM C PREFIX (sc_).
  58. */
  59.     STRUCTURE IFFStreamCmd,0
  60.         LONG    isc_Command    ; Operation to be performed (IFFCMD_)
  61.         APTR    isc_Buf        ; Pointer to data buffer
  62.         LONG    isc_NBytes    ; Number of bytes to be affected
  63.     LABEL    isc_SIZEOF
  64.  
  65. *\
  66. * A node associated with a context on the iff_Stack.  Each node
  67. * represents a chunk, the stack representing the current nesting 
  68. * of chunks in the open IFF file.  Each context node has associated
  69. * local context items in the (private) LocalItems list.  The ID, type,
  70. * size and scan values describe the chunk associated with this node.
  71. */
  72.     STRUCTURE ContextNode,MLN_SIZE    ; cn_Node
  73.         LONG    cn_ID
  74.         LONG    cn_Type
  75.         LONG    cn_Size        ; Size of this chunk
  76.         LONG    cn_Scan        ; # of bytes read/written so far
  77. * There are private fields hiding here.
  78.     LABEL    cn_SIZEOF
  79.  
  80. *\
  81. * Local context items live in the ContextNode's.  Each class is identified
  82. * by its lci_Ident code and has a (private) purge vector for when the
  83. * parent context node is popped.
  84. */
  85.     STRUCTURE LocalContextItem,MLN_SIZE    ; lci_Node
  86.         ULONG    lci_ID
  87.         ULONG    lci_Type
  88.         ULONG    lci_Ident
  89. * There are private fields hiding here.
  90.     LABEL    lci_SIZEOF
  91.  
  92. *\
  93. * StoredProperty: a local context item containing the data stored
  94. * from a previously encountered property chunk.
  95. * NOTE:  ASSEMBLY PREFIX (spr_) DIFFERENT FROM C PREFIX (sp_).
  96. */
  97.     STRUCTURE StoredProperty,0
  98.         LONG    spr_Size
  99.         APTR    spr_Data
  100.     LABEL    spr_SIZEOF
  101.  
  102. *\
  103. * Collection Item: the actual node in the collection list at which
  104. * client will look.  The next pointers cross context boundaries so
  105. * that the complete list is accessable.
  106. * NOTE:  ASSEMBLY PREFIX (cit_) DIFFERENT FROM C PREFIX (ci_).
  107. */
  108.     STRUCTURE CollectionItem,0
  109.         APTR    cit_Next
  110.         LONG    cit_Size
  111.         APTR    cit_Data
  112.     LABEL    cit_SIZEOF
  113.  
  114. *\
  115. * Structure returned by OpenClipboard().  You may do CMD_POSTs and such
  116. * using this structure.  However, once you call OpenIFF(), you may not
  117. * do any more of your own I/O to the clipboard until you call CloseIFF().
  118. */
  119.     STRUCTURE ClipboardHandle,iocr_SIZEOF    ; cbh_Reg
  120.         STRUCT    cbh_CBport,MP_SIZE
  121.         STRUCT    cbh_SatisfyPort,MP_SIZE
  122.     LABEL    cbh_SIZEOF
  123.  
  124. *\
  125. * IFF return codes.  Most functions return either zero for success or
  126. * one of these codes.  The exceptions are the read/write functions which
  127. * return positive values for number of bytes or records read or written,
  128. * or a negative error code.  Some of these codes are not errors per sae,
  129. * but valid conditions such as EOF or EOC (End of Chunk).
  130. */
  131. IFFERR_EOF        EQU    -1    ; Reached logical end of file
  132. IFFERR_EOC        EQU    -2    ; About to leave context
  133. IFFERR_NOSCOPE        EQU    -3    ; No valid scope for property
  134. IFFERR_NOMEM        EQU    -4    ; Internal memory alloc failed
  135. IFFERR_READ        EQU    -5    ; Stream read error
  136. IFFERR_WRITE        EQU    -6    ; Stream write error
  137. IFFERR_SEEK        EQU    -7    ; Stream seek error
  138. IFFERR_MANGLED        EQU    -8    ; Data in file is corrupt
  139. IFFERR_SYNTAX        EQU    -9    ; IFF syntax error
  140. IFFERR_NOTIFF        EQU    -10    ; Not an IFF file
  141. IFFERR_NOHOOK        EQU    -11    ; No call-back hook provided
  142. IFF_RETURN2CLIENT    EQU    -12    ; Client handler normal return
  143.  
  144. *\
  145. * Universal IFF identifiers.
  146. */
  147. ID_FORM            EQU    'FORM'
  148. ID_LIST            EQU    'LIST'
  149. ID_CAT            EQU    'CAT '
  150. ID_PROP            EQU    'PROP'
  151. ID_NULL            EQU    '    '
  152.  
  153. *\
  154. * Ident codes for universally recognized local context items.
  155. */
  156. IFFLCI_PROP        EQU    'prop'
  157. IFFLCI_COLLECTION    EQU    'coll'
  158. IFFLCI_ENTRYHANDLER    EQU    'enhd'
  159. IFFLCI_EXITHANDLER    EQU    'exhd'
  160.  
  161. *\
  162. * Control modes for ParseIFF() function.
  163. */
  164. IFFPARSE_SCAN        EQU    0
  165. IFFPARSE_STEP        EQU    1
  166. IFFPARSE_RAWSTEP    EQU    2
  167.  
  168. *\
  169. * Control modes for StoreLocalItem().
  170. */
  171. IFFSLI_ROOT        EQU    1    ; Store in default context
  172. IFFSLI_TOP        EQU    2    ; Store in current context
  173. IFFSLI_PROP        EQU    3    ; Store in topmost FORM or LIST
  174.  
  175. *\
  176. * "Flag" for writing functions.  If you pass this value in as a size
  177. * to PushChunk() when writing a file, the parser will figure out the
  178. * size of the chunk for you.  (Chunk sizes >= 2**31 are forbidden by the
  179. * IFF specification, so this works.)
  180. */
  181. IFFSIZE_UNKNOWN        EQU    -1
  182.  
  183. *\
  184. * Possible call-back command values.  (Gee, it would be nice if there was an
  185. * ENUM macro.)
  186. */
  187. IFFCMD_INIT        EQU    0    ; Prepare your stream for a session
  188. IFFCMD_CLEANUP        EQU    1    ; Terminate stream session
  189. IFFCMD_READ        EQU    2    ; Read bytes from stream
  190. IFFCMD_WRITE        EQU    3    ; Write bytes to stream
  191. IFFCMD_SEEK        EQU    4    ; Seek on stream
  192. IFFCMD_ENTRY        EQU    5    ; You just entered a new context
  193. IFFCMD_EXIT        EQU    6    ; You're about to leave a context
  194. IFFCMD_PURGELCI        EQU    7    ; Purge a LocalContextItem
  195.  
  196. * Backward compatibility.  Don't use these in new code.
  197. IFFSCC_INIT        EQU    IFFCMD_INIT
  198. IFFSCC_CLEANUP        EQU    IFFCMD_CLEANUP
  199. IFFSCC_READ        EQU    IFFCMD_READ
  200. IFFSCC_WRITE        EQU    IFFCMD_WRITE
  201. IFFSCC_SEEK        EQU    IFFCMD_SEEK
  202.  
  203.         ENDC    ; IFF_IFFPARSE_I
  204.