home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 2001 June
/
VPR0106A.BIN
/
OLS
/
BZ2L003
/
bz2l003.lzh
/
BZ2LIB
/
BZ2LIB.H
< prev
next >
Wrap
C/C++ Source or Header
|
1998-06-02
|
2KB
|
74 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 __BZ2LIB_H
#define __BZ2LIB_H
#include <stdio.h>
#ifdef _WIN32
#include <windows.h>
#define EXPORTAPI WINAPI
#else
#define EXPORTAPI
#endif
struct STRINGQ_; /* stringq.h */
#ifndef TYPEDEF_STRINGQ
#define TYPEDEF_STRINGQ
typedef struct STRINGQ_ STRINGQ;
#endif
/* preserve bzip2 compess/uncompress processing state */
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 3 /* 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 */
BZ2FILE * EXPORTAPI BZ2OpenStream(FILE *fp,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 */
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);
#define STRING_QUEUE_BUFFER_SIZE 0x10000
#endif