home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1999 October
/
VPR9910A.BIN
/
OLS
/
bz2l003
/
bz2l003.lzh
/
BZ2LIB
/
BZ2DLL.H
< prev
next >
Wrap
C/C++ Source or Header
|
1998-06-02
|
3KB
|
79 lines
/*
bz2lib
a library for compress/uncompress bzip2 library
by Yoshioka Tsuneo
This file(bz2lib.h/bz2lib.c) can copy,edit,re-distribute FREE.
bzip2.c is GPL'ed file. so bz2lib package is GPL'ed.
please see the file "copying" for GPL(GNU Public License).
*/
#ifndef __BZ2DLL_H
#define __BZ2DLL_H
#include <stdio.h>
#ifdef _WIN32
#include <windows.h>
#define EXPORTAPI WINAPI
#else
#define EXPORTAPI
#endif
typedef struct _STRINGQ STRINGQ; /* string queue (stringq.h) */
/* preserve bzip2 compess/uncompress processing state structure */
/* This structure will change. don't access each member. */
typedef struct{
FILE *fp; /* File Pointer of compressed file */
STRINGQ *sq; /* String Queue for uncompress input/output stream */
char mode; /* 'r' for read ,or 'w' for write*/
int level; /* compress level( 1(fast) - 9(best)) */
int blocking; /* internal state whether String Queue is blocking or not */
int error; /* whether error was happened or not */
int getRLEpair_state; /* current executing code position(label) of function getRLEpair */
int loadAndRLEsource_state; /* - */
int compressStream_state; /* - */
int undoReversibleTransformation_small_state;
int undoReversibleTransformation_fast_state;
int uncompressStream_state;
}BZ2FILE;
#define BZ2LIB_VERSION 1 /* x 0.01 */
/* Get Version Number (x 100) of bz2lib */
int (EXPORTAPI *BZ2GetVersion)(void);
/* return 1 if bz2lib is already running (check for multithreading) */
int (EXPORTAPI *BZ2GetRunning)(void);
/* get bz2 file's level. if not bzip2 file,return -1 */
int (EXPORTAPI *BZ2GetLevelStream)(FILE *zStream);
int (EXPORTAPI *BZ2GetLevel)(char *file);
/* open bzip2 file like fdopen */
/* At windows DLL, File Pointer cant send to dll,so comment outed.*/
/* BZ2FILE * (EXPORTAPI *BZ2OpenStream)(FILE * zStream,char *mode);*/
/* open bzip2 file like fopen */
/* mode can contain 'r','w', '1'..'9'(for level) */
BZ2FILE * (EXPORTAPI *BZ2Open)(char *file,char *mode);
/* close bzip2 file opened by BZ2OpenStream */
/* At windows DLL, File Pointer cant send to dll,so comment outed*/
/* void (EXPORTAPI *BZ2CloseStream)(BZ2FILE *BZ2fp); */
/* close bzip2 file opened by BZ2Open */
void (EXPORTAPI *BZ2Close)(BZ2FILE *BZ2fp);
/* compress and write to the file */
int (EXPORTAPI *BZ2Write)(BZ2FILE *BZ2fp,char *buff,int size);
/* read and uncompress from the file */
int (EXPORTAPI *BZ2Read)(BZ2FILE *BZ2fp,char *buff,int size);
/* First,please call this function. then you can access each BZ2LIB.DLL API */
int BZ2DLLLoadLibrary(void);
/* Release BZ2LIB.DLL */
int BZ2DLLFreeLibrary(void);
#define STRING_QUEUE_BUFFER_SIZE 0x10000
#endif