/*
**	$Filename: xpknuke.h $
**	$Release: 0.9 $
**
**	(C) Copyright 1991 U. Dominik Mueller & Christian Schneider
**	    All Rights Reserved
*/

#ifndef LIBRARIES_XPKSUB_H
#define LIBRARIES_XPKSUB_H

#ifndef LIBRARIES_XPK_H
#include <libraries/xpk.h>
#endif

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



/**************************************************************************
 *
 *                     The XpkInfo structure
 *
 */


/* Sublibs return this structure to xpkmaster when asked nicely
 * This is version 1 of XpkInfo.  It's not #define'd because we don't want
 * it changing automatically with recompiles - you've got to actually update
 * your code when it changes. */
typedef struct XpkInfo {
	UWORD   XpkInfoVersion  ; /* Version number of this structure        */
	UWORD   LibVersion      ; /* The version of this sublibrary          */
	UWORD   MasterVersion   ; /* The required master lib version         */
	UWORD   ModesVersion    ; /* Version number of mode descriptors      */
	STRPTR  Name            ; /* Brief name of the packer, 20 char max   */
	STRPTR  LongName        ; /* Full name of the packer   30 char max   */
	STRPTR  Description     ; /* Short packer desc., 70 char max         */
	LONG    ID              ; /* ID the packer goes by (XPK format)      */
	LONG    Flags           ; /* Defined below                           */
	LONG    MaxPkInChunk    ; /* Max input chunk size for packing        */
	LONG    MinPkInChunk    ; /* Min input chunk size for packing        */
	LONG    DefPkInChunk    ; /* Default packing chunk size              */
	STRPTR  PackMsg         ; /* Packing message, present tense          */
	STRPTR  UnpackMsg       ; /* Unpacking message, present tense        */
	STRPTR  PackedMsg       ; /* Packing message, past tense             */
	STRPTR  UnpackedMsg     ; /* Unpacking message, past tense           */
	UWORD   DefMode         ; /* Default mode number                     */
	UWORD   Pad             ; /* for future use                          */
	struct XpkMode *ModeDesc; /* List of individual descriptors          */
	ULONG   Reserved[6]     ; /* Future expansion - set to zero          */

/*	LABEL	xi_SIZEOF */
} XINFO;

/* defines for Flags: see xpk.h, XPKIF_xxxxx */

/**************************************************************************
 *
 *                     The XpkSubParams structure
 *
 */

typedef struct XpkSubParams {
	APTR	InBuf		; /* The input data               */
	LONG	InLen		; /* The number of bytes to pack  */
	APTR	OutBuf		; /* The output buffer            */
	LONG	OutBufLen	; /* The length of the output buf */
	LONG	OutLen		; /* Number of bytes written      */
	LONG	Flags		; /* Flags for master/sub comm.   */
	LONG	Number		; /* The number of this chunk     */
	LONG	Mode		; /* The packing mode to use      */
	APTR	Password	; /* The password to use          */
	LONG	Arg[4]		; /* Reserved; don't use          */
	LONG	Sub[4]		; /* Sublib private data          */
} XPARAMS;

#define XSF_STEPDOWN   1  /* May reduce pack eff. to save mem   */
#define XSF_PREVCHUNK  2  /* Previous chunk available on unpack */


#ifndef NO_SUB_PRAGMAS

XINFO * __saveds XpksPackerInfo (   void    );
long    __saveds XpksPackChunk  ( XPARAMS * );
void    __saveds XpksPackFree   ( XPARAMS * );
long    __saveds XpksPackReset  ( XPARAMS * );
long    __saveds XpksUnpackChunk( XPARAMS * );
void    __saveds XpksUnpackFree ( XPARAMS * );

#pragma libcall XpkSubBase XpksPackerInfo  1E   0
#pragma libcall XpkSubBase XpksPackChunk   24 801
#pragma libcall XpkSubBase XpksPackFree    2A 801
#pragma libcall XpkSubBase XpksPackReset   30 801
#pragma libcall XpkSubBase XpksUnpackChunk 36 801
#pragma libcall XpkSubBase XpksUnpackFree  3C 801

#else

XINFO * __saveds __asm XpksPackerInfo (     void      );
long    __saveds __asm XpksPackChunk  ( _a0 XPARAMS * );
void    __saveds __asm XpksPackFree   ( _a0 XPARAMS * );
long    __saveds __asm XpksPackReset  ( _a0 XPARAMS * );
long    __saveds __asm XpksUnpackChunk( _a0 XPARAMS * );
void    __saveds __asm XpksUnpackFree ( _a0 XPARAMS * );

#endif

#endif /* XPKSUB_H */
