#ifndef  CLIB_IFFPARSE_PROTOS_H
#define  CLIB_IFFPARSE_PROTOS_H

/*******************************************************************
 pOS / Amiga adapt
*******************************************************************/


#ifndef  EXEC_TYPES_H
#include <exec/types.h>
#endif
#ifndef  LIBRARIES_IFFPARSE_H
#include <libraries/iffparse.h>
#endif

#ifdef __cplusplus
extern "C" {
#endif


struct IFFHandle *AllocIFF( void );
LONG OpenIFF( struct IFFHandle *iff, long rwMode );
LONG ParseIFF( struct IFFHandle *iff, long control );
void CloseIFF( struct IFFHandle *iff );
void FreeIFF( struct IFFHandle *iff );

LONG ReadChunkBytes( struct IFFHandle *iff, APTR buf, long numBytes );
LONG WriteChunkBytes( struct IFFHandle *iff, APTR buf, long numBytes );
LONG ReadChunkRecords( struct IFFHandle *iff, APTR buf, long bytesPerRecord,
        long numRecords );
LONG WriteChunkRecords( struct IFFHandle *iff, APTR buf, long bytesPerRecord,
        long numRecords );

LONG PushChunk( struct IFFHandle *iff, long type, long id, long size );
LONG PopChunk( struct IFFHandle *iff );

LONG PropChunk( struct IFFHandle *iff, long type, long id );
LONG PropChunks( struct IFFHandle *iff, LONG *propArray, long numPairs );
LONG StopChunk( struct IFFHandle *iff, long type, long id );
LONG StopChunks( struct IFFHandle *iff, LONG *propArray, long numPairs );
LONG StopOnExit( struct IFFHandle *iff, long type, long id );

struct StoredProperty *FindProp( struct IFFHandle *iff, long type, long id );
struct ContextNode *CurrentChunk( struct IFFHandle *iff );

void InitIFFasDOS( struct IFFHandle *iff );

STRPTR IDtoStr( long id, STRPTR buf );


/*****************************************************************************/


#ifdef __IGNORE_NOT_SUPPORTED__


LONG EntryHandler( struct IFFHandle *iff, long type, long id, long position,struct Hook *handler, APTR object );
LONG ExitHandler( struct IFFHandle *iff, long type, long id, long position,struct Hook *handler, APTR object );
struct CollectionItem *FindCollection( struct IFFHandle *iff, long type,long id );
struct ContextNode *FindPropContext( struct IFFHandle *iff );
LONG CollectionChunk( struct IFFHandle *iff, long type, long id );
LONG CollectionChunks( struct IFFHandle *iff, LONG *propArray,long numPairs );
struct ContextNode *ParentChunk( struct ContextNode *contextNode );
struct LocalContextItem *AllocLocalItem( long type, long id, long ident,long dataSize );
APTR LocalItemData( struct LocalContextItem *localItem );
void SetLocalItemPurge( struct LocalContextItem *localItem,struct Hook *purgeHook );
void FreeLocalItem( struct LocalContextItem *localItem );
struct LocalContextItem *FindLocalItem( struct IFFHandle *iff, long type,long id, long ident );
LONG StoreLocalItem( struct IFFHandle *iff, struct LocalContextItem *localItem,long position );
void StoreItemInContext( struct IFFHandle *iff,struct LocalContextItem *localItem,struct ContextNode *contextNode );
void InitIFF( struct IFFHandle *iff, long flags, struct Hook *streamHook );
void InitIFFasClip( struct IFFHandle *iff );
struct ClipboardHandle *OpenClipboard( long unitNumber );
void CloseClipboard( struct ClipboardHandle *clipHandle );
LONG GoodID( long id );
LONG GoodType( long type );


#else


#define EntryHandler EntryHandler__NOT_SUPPORTED__
LONG EntryHandler( struct __NOT_SUPPORTED__*, struct IFFHandle *iff, long type, long id, long position,struct Hook *handler, APTR object );

#define ExitHandler ExitHandler__NOT_SUPPORTED__
LONG ExitHandler( struct __NOT_SUPPORTED__*, struct IFFHandle *iff, long type, long id, long position,struct Hook *handler, APTR object );

#define FindCollection FindCollection__NOT_SUPPORTED__
struct CollectionItem *FindCollection( struct __NOT_SUPPORTED__*,struct IFFHandle *iff, long type,long id );

#define FindPropContext FindPropContext__NOT_SUPPORTED__
struct ContextNode *FindPropContext( struct __NOT_SUPPORTED__*,struct IFFHandle *iff );

#define CollectionChunk CollectionChunk__NOT_SUPPORTED__
LONG CollectionChunk( struct __NOT_SUPPORTED__*, struct IFFHandle *iff, long type, long id );

#define CollectionChunks CollectionChunks__NOT_SUPPORTED__
LONG CollectionChunks( struct __NOT_SUPPORTED__*, struct IFFHandle *iff, LONG *propArray,long numPairs );

#define ParentChunk ParentChunk__NOT_SUPPORTED__
struct ContextNode *ParentChunk( struct __NOT_SUPPORTED__*,struct ContextNode *contextNode );

#define AllocLocalItem AllocLocalItem__NOT_SUPPORTED__
struct LocalContextItem *AllocLocalItem( struct __NOT_SUPPORTED__*,long type, long id, long ident,long dataSize );

#define LocalItemData LocalItemData__NOT_SUPPORTED__
APTR LocalItemData( struct __NOT_SUPPORTED__*, struct LocalContextItem *localItem );

#define SetLocalItemPurge SetLocalItemPurge__NOT_SUPPORTED__
void SetLocalItemPurge( struct __NOT_SUPPORTED__*, struct LocalContextItem *localItem,struct Hook *purgeHook );

#define FreeLocalItem FreeLocalItem__NOT_SUPPORTED__
void FreeLocalItem( struct __NOT_SUPPORTED__*, struct LocalContextItem *localItem );

#define FindLocalItem FindLocalItem__NOT_SUPPORTED__
struct LocalContextItem *FindLocalItem( struct __NOT_SUPPORTED__*,struct IFFHandle *iff, long type,long id, long ident );

#define StoreLocalItem StoreLocalItem__NOT_SUPPORTED__
LONG StoreLocalItem( struct __NOT_SUPPORTED__*, struct IFFHandle *iff, struct LocalContextItem *localItem,long position );

#define StoreItemInContext StoreItemInContext__NOT_SUPPORTED__
void StoreItemInContext( struct __NOT_SUPPORTED__*, struct IFFHandle *iff,struct LocalContextItem *localItem,struct ContextNode *contextNode );

#define InitIFF InitIFF__NOT_SUPPORTED__
void InitIFF( struct __NOT_SUPPORTED__*, struct IFFHandle *iff, long flags, struct Hook *streamHook );

#define InitIFFasClip InitIFFasClip__NOT_SUPPORTED__
void InitIFFasClip( struct __NOT_SUPPORTED__*, struct IFFHandle *iff );

#define OpenClipboard OpenClipboard__NOT_SUPPORTED__
struct ClipboardHandle *OpenClipboard( struct __NOT_SUPPORTED__*,long unitNumber );

#define CloseClipboard CloseClipboard__NOT_SUPPORTED__
void CloseClipboard( struct __NOT_SUPPORTED__*, struct ClipboardHandle *clipHandle );

#define GoodID GoodID__NOT_SUPPORTED__
LONG GoodID( struct __NOT_SUPPORTED__*, long id );

#define GoodType GoodType__NOT_SUPPORTED__
LONG GoodType( struct __NOT_SUPPORTED__*, long type );


#endif /* __IGNORE_NOT_SUPPORTED__ */

#ifdef __cplusplus
}
#endif

#endif   /* CLIB_IFFPARSE_PROTOS_H */
