1 #ifndef IFF_IFFPARSE_H
    2 #define IFF_IFFPARSE_H
    3 
    4 /*
    5 	iffparse.library include
    6 
    7 	Copyright © 2002 The MorphOS Development Team, All Rights Reserved.
    8 */
    9 
   10 #ifndef EXEC_TYPES_H
   11 # include <exec/types.h>
   12 #endif
   13 
   14 #ifndef EXEC_LISTS_H
   15 # include <exec/lists.h>
   16 #endif
   17 
   18 #ifndef EXEC_PORTS_H
   19 # include <exec/ports.h>
   20 #endif
   21 
   22 #ifndef DEVICES_CLIPBOARD_H
   23 # include <devices/clipboard.h>
   24 #endif
   25 
   26 #pragma pack(2)
   27 
   28 
   29 struct IFFHandle
   30 {
   31 	ULONG iff_Stream;
   32 	ULONG iff_Flags;
   33 	LONG  iff_Depth;
   34 };
   35 
   36 #define IFFF_READ      0
   37 #define IFFF_WRITE     1
   38 #define IFFF_RWBITS    (IFFF_READ | IFFF_WRITE)
   39 #define IFFF_FSEEK     (1<<1)
   40 #define IFFF_RSEEK     (1<<2)
   41 #define IFFF_RESERVED  0xFFFF0000
   42 
   43 
   44 struct IFFStreamCmd
   45 {
   46 	LONG sc_Command;
   47 	APTR sc_Buf;
   48 	LONG sc_NBytes;
   49 };
   50 
   51 
   52 struct ContextNode
   53 {
   54 	struct MinNode cn_Node;
   55 	LONG           cn_ID;
   56 	LONG           cn_Type;
   57 	LONG           cn_Size;
   58 	LONG           cn_Scan;
   59 };
   60 
   61 
   62 struct LocalContextItem
   63 {
   64 	struct MinNode lci_Node;
   65 	ULONG          lci_ID;
   66 	ULONG          lci_Type;
   67 	ULONG          lci_Ident;
   68 };
   69 
   70 
   71 struct StoredProperty
   72 {
   73 	LONG sp_Size;
   74 	APTR sp_Data;
   75 };
   76 
   77 
   78 struct CollectionItem
   79 {
   80 	struct CollectionItem *ci_Next;
   81 	LONG                   ci_Size;
   82 	APTR                   ci_Data;
   83 };
   84 
   85 
   86 struct ClipboardHandle
   87 {
   88 	struct IOClipReq cbh_Req;
   89 	struct MsgPort   cbh_CBport;
   90 	struct MsgPort   cbh_SatisfyPort;
   91 };
   92 
   93 
   94 #define IFFERR_EOF         -1
   95 #define IFFERR_EOC         -2
   96 #define IFFERR_NOSCOPE     -3
   97 #define IFFERR_NOMEM       -4
   98 #define IFFERR_READ        -5
   99 #define IFFERR_WRITE       -6
  100 #define IFFERR_SEEK        -7
  101 #define IFFERR_MANGLED     -8
  102 #define IFFERR_SYNTAX      -9
  103 #define IFFERR_NOTIFF      -10
  104 #define IFFERR_NOHOOK      -11
  105 #define IFF_RETURN2CLIENT  -12
  106 
  107 
  108 #define MAKE_ID(a,b,c,d)  ((ULONG) (a)<<24 | (ULONG) (b)<<16 | (ULONG) (c)<<8 | (ULONG) (d))
  109 
  110 #define ID_FORM  MAKE_ID('F','O','R','M')
  111 #define ID_LIST  MAKE_ID('L','I','S','T')
  112 #define ID_CAT   MAKE_ID('C','A','T',' ')
  113 #define ID_PROP  MAKE_ID('P','R','O','P')
  114 #define ID_NULL  MAKE_ID(' ',' ',' ',' ')
  115 
  116 #define IFFLCI_PROP          MAKE_ID('p','r','o','p')
  117 #define IFFLCI_COLLECTION    MAKE_ID('c','o','l','l')
  118 #define IFFLCI_ENTRYHANDLER  MAKE_ID('e','n','h','d')
  119 #define IFFLCI_EXITHANDLER   MAKE_ID('e','x','h','d')
  120 
  121 
  122 #define IFFPARSE_SCAN     0
  123 #define IFFPARSE_STEP     1
  124 #define IFFPARSE_RAWSTEP  2
  125 
  126 
  127 #define IFFSLI_ROOT  1
  128 #define IFFSLI_TOP   2
  129 #define IFFSLI_PROP  3
  130 
  131 
  132 #define IFFSIZE_UNKNOWN  -1
  133 
  134 
  135 #define IFFCMD_INIT      0
  136 #define IFFCMD_CLEANUP   1
  137 #define IFFCMD_READ      2
  138 #define IFFCMD_WRITE     3
  139 #define IFFCMD_SEEK      4
  140 #define IFFCMD_ENTRY     5
  141 #define IFFCMD_EXIT      6
  142 #define IFFCMD_PURGELCI  7
  143 
  144 /* Seek modes for SeekChunkBytes() and SeekChunkRecords() */
  145 
  146 #define IFFOFFSET_BEGINNING     0
  147 #define IFFOFFSET_END           1
  148 #define IFFOFFSET_CURRENT       2
  149 
  150 
  151 /*** OBSOLETE ***/
  152 
  153 #ifndef IFFPARSE_V37_NAMES_ONLY
  154 
  155 #define IFFSCC_INIT     IFFCMD_INIT
  156 #define IFFSCC_CLEANUP  IFFCMD_CLEANUP
  157 #define IFFSCC_READ     IFFCMD_READ
  158 #define IFFSCC_WRITE    IFFCMD_WRITE
  159 #define IFFSCC_SEEK     IFFCMD_SEEK
  160 
  161 #endif /* IFFPARSE_V37_NAMES_ONLY */
  162 
  163 
  164 #pragma pack()
  165 
  166 #endif /* IFFPARSE_H */