#ifndef IFFLIB_H
#define IFFLIB_H 1

/* iff.library Copyright 1990
 * Robert W. Albrecht
 * 1457 Zion Way
 * Ventura, CA 93003
 */

/* masking */
#define mskNone 	       0
#define mskHasMask	       1
#define mskHasTransparentColor 2
#define mskLasso	       3

/* aspect */
#define x320x200Aspect 10
#define y320x200Aspect 11
#define x320x400Aspect 20
#define y320x400Aspect 11
#define x640x200Aspect 5
#define y640x200Aspect 11
#define x640x400Aspect 10
#define y640x400Aspect 11

/* compression */
#define cmpNone     0
#define cmpByteRun1 1

typedef struct
   {
   unsigned short w, h;       /* width, height */
   unsigned short x, y;       /* position */
   unsigned char nPlanes;     /* number of bit-planes */
   unsigned char masking;     /* type of masking used */
   unsigned char compression; /* type of compression used */
   unsigned char pad1;
   unsigned short transparentColor;
   unsigned char xAspect, yAspect;	 /* aspect ration */
   unsigned short pageWidth, pageHeight; /* size of the screen */
   unsigned long viewmodes;
   } BitMapHeader;

/* error codes */
#define NO_ERROR 0
#define YOUR_ERROR 1
#define OPEN_ERROR 2
#define FILE_WAS_CLOSED 3
#define SEEK_ERROR 4
#define READ_ERROR 5
#define MEMORY_ERROR 6
#define IFFBAD_ERROR 7
#define WIERD_MASKING 8
#define WIERD_COMPRESSION 9
#define COMPRESSION_ERROR 10
#define IFF_TO_BIG 11
#define WIERD_COLORTABLE 12
#define WRITE_ERROR 13
#define UNKNOWN_ERROR -1

/* library name */
#define IFFNAME "iff.library"

/* library version */
#define IFFVERSION 1L

/* memory types */
#define DONTCARE ((unsigned short)0)
#define CHIP ((unsigned short)1)
#define FAST ((unsigned short)2)

#define ALLOC ((unsigned short)1)
#define NOALLOC ((unsigned short)0)

/* set this if you want to get the
 * ViewModes from the IFF picture
 * using QueryIFF. */
#define GETVIEWMODES -1000000L

/* functions */
#ifdef AZTEC_C
#if VERSION == 500
/* AZTEC C 5.00 and above, (should always work) */
extern void *IFFalloc(long,unsigned short);
extern void IFFfree(void *);
extern void RlsBitMap(struct BitMap *);
extern void RlsImage(struct Image *);
extern short QueryIFF(char *,BitMapHeader *);
extern short GetIFF_bitmap(char *,struct BitMap **,UWORD **, UWORD *,UWORD);
extern short GetIFF_image(char *,struct Image **,UWORD **, UWORD *,UWORD);
/* The Put functions are only available to registered users */
extern short PutIFF(char *,struct BitMap *,
	     struct ViewPort *,struct ColorMap *);
extern short PutIFF_screen(char *,struct Screen *);
extern short PutIFF_window(char *,struct Window *);
#else
/* AZTEC C 3.6 and below (must use 16 bit ints!) */
extern void *IFFalloc(), IFFfree(), RlsImage(), RlsBitMap();
extern short QueryIFF(), GetIFF_bitmap(), GetIFF_image();
extern short PutIFF(), PutIFF_screen(), PutIFF_window();
#endif

#else
/* Some other compiler (must pass 16 bit ints on the stack)
 * and not use registerized parameters).  */
extern void *IFFalloc(), IFFfree(), RlsImage(), RlsBitMap();
extern short QueryIFF(), GetIFF_bitmap(), GetIFF_image();
extern short PutIFF(), PutIFF_screen(), PutIFF_window();
#endif

#endif
