COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

	Copyright (c) GeoWorks 1991 -- All Rights Reserved

PROJECT:	PC GEOS
MODULE:		Compress Library
FILE:		compress.def

AUTHOR:		David Loftesness, Jun  1, 1992

REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	DL	6/ 1/92		Initial revision


DESCRIPTION:
	This library performs compression/decompression of data using
	the pkware compression library.
		
	$Id: compress.def,v 1.1 97/04/04 14:25:17 newdeal Exp $

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@

SetDef	__COMPRESS

StartLibrary	compress

COMPRESS_PROTO_MAJOR	equ	1
COMPRESS_PROTO_MINOR	equ	0
;--------------------------------------
; 		Constants & Structures
;--------------------------------------

CompLibFlags	record
	CLF_SOURCE_IS_BUFFER:1,	; set if source is not a file
	CLF_DEST_IS_BUFFER:1,	; set if destination is not file
	CLF_DECOMPRESS:1,		; set if we're decompressing
	CLF_MOSTLY_ASCII:1,
	:12
CompLibFlags	end

CL_DECOMP_FILE_TO_FILE		equ mask CLF_DECOMPRESS
CL_COMP_FILE_TO_FILE		equ 0
CL_DECOMP_FILE_TO_BUFFER 	equ mask CLF_DECOMPRESS or mask CLF_DEST_IS_BUFFER
CL_COMP_FILE_TO_BUFFER		equ mask CLF_DEST_IS_BUFFER
CL_DECOMP_BUFFER_TO_BUFFER	equ mask CLF_DECOMPRESS or mask CLF_DEST_IS_BUFFER or mask CLF_SOURCE_IS_BUFFER
CL_COMP_BUFFER_TO_BUFFER	equ mask CLF_DEST_IS_BUFFER or mask CLF_SOURCE_IS_BUFFER
CL_DECOMP_BUFFER_TO_FILE 	equ mask CLF_DECOMPRESS or mask CLF_SOURCE_IS_BUFFER
CL_COMP_BUFFER_TO_FILE		equ mask CLF_SOURCE_IS_BUFFER

;----------------------------------------
;		Compression Routines
;----------------------------------------
global COMPRESSDECOMPRESS:far
CompressDecompress	equ	COMPRESSDECOMPRESS
;
;	DESCRIPTION:	This routine is the main entry point for
;			the compression/uncompression code.
;
;	PASS (on stack, in pascal format):
;
;			CompLibFlags	flags
;			hptr 		sourceFileHan
;			fptr		sourceBuff
;			word		sourceBuffSize
;			hptr		destFileHan
;			fptr		destBuffer
;
;	RETURN:		AX - # bytes written out (0 if error)
;	DESTROYED:	nothing

EndLibrary	compress


