home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 113 / EnigmaAmiga113CD.iso / software / sviluppo / fm2000 / iff.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-02-04  |  3.0 KB  |  124 lines

  1. /*
  2.      Filemaster - Multitasking directory utility.
  3.      Copyright (C) 2000  Toni Wilen
  4.      
  5.      This program is free software; you can redistribute it and/or
  6.      modify it under the terms of the GNU General Public License
  7.      as published by the Free Software Foundation; either version 2
  8.      of the License, or (at your option) any later version.
  9.      
  10.      This program is distributed in the hope that it will be useful,
  11.      but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.      GNU General Public License for more details.
  14.      
  15.      You should have received a copy of the GNU General Public License
  16.      along with this program; if not, write to the Free Software
  17.      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  18. */
  19.  
  20. /* 
  21.  *
  22.  * iff.h:    General Definitions for IFFParse modules
  23.  *
  24.  * 10/20/91
  25.  */
  26.  
  27. #ifndef IFFP_IFF_H
  28. #define IFFP_IFF_H
  29.  
  30. #ifndef EXEC_TYPES_H
  31. #include <exec/types.h>
  32. #endif
  33. #ifndef EXEC_MEMORY_H
  34. #include <exec/memory.h>
  35. #endif
  36. #ifndef UTILITY_TAGITEM_H
  37. #include <utility/tagitem.h>
  38. #endif
  39. #ifndef UTILITY_HOOKS_H
  40. #include <utility/hooks.h>
  41. #endif
  42. #ifndef LIBRARIES_IFFPARSE_H
  43. #include <libraries/iffparse.h>
  44. #endif
  45.  
  46. #include <stdio.h>
  47. #include <stdlib.h>
  48. #include <string.h>
  49.  
  50. #ifndef MAX
  51. #define    MAX(a,b)    ((a) > (b) ? (a) : (b))
  52. #endif
  53. #ifndef MIN
  54. #define    MIN(a,b)    ((a) < (b) ? (a) : (b))
  55. #endif
  56. #ifndef ABS
  57. #define    ABS(x)        ((x) < 0 ? -(x) : (x))
  58. #endif
  59.  
  60. /* Locale stuff */
  61. #include "iffpstringids.h"
  62.  
  63. #ifndef TEXTTABLE_H
  64. struct AppString
  65. {
  66.     LONG   as_ID;
  67.     STRPTR as_Str;
  68. };
  69. #endif
  70.  
  71. extern struct  AppString AppStrings[];
  72. #define SI(i)  GetString(i)
  73.  
  74.  
  75. #define CkErr(expression)  {if (!error) error = (expression);}
  76. #define ChunkMoreBytes(cn)    (cn->cn_Size - cn->cn_Scan)
  77. #define IS_ODD(a)        (a & 1)
  78.  
  79. #define IFF_OKAY    0L
  80. #define    CLIENT_ERROR    1L
  81. #define NOFILE          5L
  82.  
  83. #define message printf
  84.  
  85. /* Generic Chunk ID's we may encounter */
  86. #define    ID_ANNO        MAKE_ID('A','N','N','O')
  87. #define    ID_AUTH        MAKE_ID('A','U','T','H')
  88. #define    ID_CHRS        MAKE_ID('C','H','R','S')
  89. #define    ID_Copyright    MAKE_ID('(','c',')',' ')
  90. #define    ID_CSET        MAKE_ID('C','S','E','T')
  91. #define    ID_FVER        MAKE_ID('F','V','E','R')
  92. #define    ID_NAME        MAKE_ID('N','A','M','E')
  93. #define ID_TEXT        MAKE_ID('T','E','X','T')
  94. #define ID_BODY        MAKE_ID('B','O','D','Y')
  95.  
  96.  
  97. struct ParseInfo {
  98.     /* general parse.c related */
  99.     struct  IFFHandle *iff;        /* to be alloc'd with AllocIFF */
  100.     UBYTE    *filename;        /* current filename of this ui */
  101.     LONG    *propchks;        /* properties to get */
  102.     LONG    *collectchks;        /* properties to collect */
  103.     LONG    *stopchks;        /* stop on these (like BODY) */
  104.     BOOL    opened;            /* this iff has been opened */
  105.     BOOL    clipboard;        /* file is clipboard */
  106.     BOOL    hunt;            /* we are parsing a complex file */
  107.     BOOL    Reserved1;        /* must be zero for now */        
  108.     struct Chunk *copiedchunks;
  109.     struct Chunk *newchunks;
  110.  
  111.     ULONG    Reserved[8];
  112.     };
  113.  
  114.  
  115. struct Chunk {
  116.     struct  Chunk *ch_Next;
  117.     long    ch_Type;
  118.     long    ch_ID;
  119.         long    ch_Size;
  120.         void    *ch_Data;
  121. };
  122.  
  123. #endif /* IFFP_IFF_H */
  124.