	IFND	LIBRARIES_XPKSUB_I
LIBRARIES_XPKSUB_I	SET	1

	IFND	EXEC_LIBRARIES_I
	include "exec/libraries.i"
	ENDC





**************************************************************************
*
*        Sublibs return this structure to xpkmaster when asked nicely
*
*

 STRUCTURE XpkInfo,0
	UWORD	xi_XpkInfoVersion;/* Version number of this structure   */
	UWORD	xi_LibVersion	; /* The version of this sublibrary     */
	UWORD	xi_MasterVersion; /* The required master lib version    */
	UWORD	xi_ModesVersion	; /* Longword align                     */
	APTR	xi_Name		; /* Brief name of the packer           */
	APTR	xi_LongName	; /* Full name of the packer            */
	APTR	xi_Description	; /* One line description of packer     */
	LONG	xi_ID		; /* ID the packer goes by (XPK format) */
	LONG	xi_Flags	; /* Defined below                      */
	LONG	xi_MaxPkInChunk	; /* Max input chunk size for packing   */
	LONG	xi_MinPkInChunk	; /* Min input chunk size for packing   */
	LONG	xi_DefPkInChunk	; /* Default packing chunk size         */
	APTR	xi_PackMsg	; /* Packing message, present tense     */
	APTR	xi_UnpackMsg	; /* Unpacking message, present tense   */
	APTR	xi_PackedMsg	; /* Packing message, past tense        */
	APTR	xi_UnpackedMsg	; /* Unpacking message, past tense      */
	UWORD	xi_DefMode	; /* Default mode number                */
	UWORD	xi_Pad		; /* for future use                     */
	APTR	xi_Modes	; /* Array of compression modes         */
	STRUCT	xi_Reserved,6*4	; /* Future expansion - set to zero     */
	LABEL	xi_SIZEOF	; /* Size of the *first* part only	*/

* Defines for XpkInfo.Flags *
XPKIF_PK_CHUNK		equ	$0001	;* Library supplies chunk packing	*/
XPKIF_PK_STREAM		equ	$0002	;* Library supplies stream packing	*/
XPKIF_PK_ARCHIVE	equ	$0004	;* Library supplies archive packing	*/
XPKIF_UP_CHUNK		equ	$0008	;* Library supplies chunk unpacking	*/
XPKIF_UP_STREAM		equ	$0010	;* Library supplies stream unpacking	*/
XPKIF_UP_ARCHIVE	equ	$0020	;* Library supplies archive unpacking	*/
XPKIF_HOOKIO		equ	$0080	;* Uses full Hook I/O			*/
XPKIF_CHECKING		equ	$0400	;* Does its own data checking		*/
XPKIF_PREREADHDR	equ	$0800	;* Unpacker pre-reads the next chunkhdr	*/
XPKIF_ENCRYPTION	equ	$2000	;* Sub library supports encryption      */
XPKIF_NEEDPASSWD	equ	$4000	;* Sub library requires encryption      */
XPKIF_MODES		equ	$8000	;* Sub library has different modes      */
XPKIF_LOSSY		equ	$10000	;* Sub library does lossy compression   */






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

 STRUCTURE XpkSubParams,0
	APTR	xsp_InBuf	; /* The input data               */
	ULONG	xsp_InLen	; /* The number of bytes to pack  */
	APTR	xsp_OutBuf	; /* The output buffer            */
	ULONG	xsp_OutBufLen	; /* The length of the output buf */
	ULONG	xsp_OutLen	; /* Number of bytes written      */
	ULONG	xsp_Flags	; /* Flags for master/sub comm.   */
	ULONG	xsp_Number	; /* The number of this chunk     */
	LONG	xsp_Mode	; /* The packing mode to use      */
	APTR	xsp_Password	; /* The password to use          */
	STRUCT	xsp_Arg,4*4	; /* Reserved; don't use          */
	STRUCT	xsp_Sub,4*4	; /* Sublib private data          */
	LABEL	xsp_SIZEOF

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


	LIBINIT
	LIBDEF	_LVOXpksPackerInfo
	LIBDEF	_LVOXpksPackChunk
	LIBDEF	_LVOXpksPackFree
	LIBDEF	_LVOXpksPackReset
	LIBDEF	_LVOXpksUnpackChunk
	LIBDEF	_LVOXpksUnpackFree

	ENDC
