bzlib.h
Go to the documentation of this file.
00001 
00002 /*-------------------------------------------------------------*/
00003 /*--- Public header file for the library.                   ---*/
00004 /*---                                               bzlib.h ---*/
00005 /*-------------------------------------------------------------*/
00006 
00007 /* ------------------------------------------------------------------
00008    This file is part of bzip2/libbzip2, a program and library for
00009    lossless, block-sorting data compression.
00010 
00011    bzip2/libbzip2 version 1.0.6 of 6 September 2010
00012    Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
00013 
00014    Please read the WARNING, DISCLAIMER and PATENTS sections in the 
00015    README file.
00016 
00017    This program is released under the terms of the license contained
00018    in the file LICENSE.
00019    ------------------------------------------------------------------ */
00020 
00021 
00022 #ifndef _BZLIB_H
00023 #define _BZLIB_H
00024 
00025 #ifdef __cplusplus
00026 extern "C" {
00027 #endif
00028 
00029 #define BZ_RUN               0
00030 #define BZ_FLUSH             1
00031 #define BZ_FINISH            2
00032 
00033 #define BZ_OK                0
00034 #define BZ_RUN_OK            1
00035 #define BZ_FLUSH_OK          2
00036 #define BZ_FINISH_OK         3
00037 #define BZ_STREAM_END        4
00038 #define BZ_SEQUENCE_ERROR    (-1)
00039 #define BZ_PARAM_ERROR       (-2)
00040 #define BZ_MEM_ERROR         (-3)
00041 #define BZ_DATA_ERROR        (-4)
00042 #define BZ_DATA_ERROR_MAGIC  (-5)
00043 #define BZ_IO_ERROR          (-6)
00044 #define BZ_UNEXPECTED_EOF    (-7)
00045 #define BZ_OUTBUFF_FULL      (-8)
00046 #define BZ_CONFIG_ERROR      (-9)
00047 
00048 typedef 
00049    struct {
00050       char *next_in;
00051       unsigned int avail_in;
00052       unsigned int total_in_lo32;
00053       unsigned int total_in_hi32;
00054 
00055       char *next_out;
00056       unsigned int avail_out;
00057       unsigned int total_out_lo32;
00058       unsigned int total_out_hi32;
00059 
00060       void *state;
00061 
00062       void *(*bzalloc)(void *,int,int);
00063       void (*bzfree)(void *,void *);
00064       void *opaque;
00065    } 
00066    bz_stream;
00067 
00068 
00069 #ifndef BZ_IMPORT
00070 #define BZ_EXPORT
00071 #endif
00072 
00073 #ifndef BZ_NO_STDIO
00074 /* Need a definitition for FILE */
00075 #include <stdio.h>
00076 #endif
00077 
00078 #ifdef _WIN32
00079 #   include <windows.h>
00080 #   ifdef small
00081       /* windows.h define small to char */
00082 #      undef small
00083 #   endif
00084 #   ifdef BZ_EXPORT
00085 #   define BZ_API(func) WINAPI func
00086 #   define BZ_EXTERN extern
00087 #   else
00088    /* import windows dll dynamically */
00089 #   define BZ_API(func) (WINAPI * func)
00090 #   define BZ_EXTERN
00091 #   endif
00092 #else
00093 #   define BZ_API(func) func
00094 #   define BZ_EXTERN extern
00095 #endif
00096 
00097 
00098 /*-- Core (low-level) library functions --*/
00099 
00100 BZ_EXTERN int BZ_API(BZ2_bzCompressInit) ( 
00101       bz_stream* strm, 
00102       int        blockSize100k, 
00103       int        verbosity, 
00104       int        workFactor 
00105    );
00106 
00107 BZ_EXTERN int BZ_API(BZ2_bzCompress) ( 
00108       bz_stream* strm, 
00109       int action 
00110    );
00111 
00112 BZ_EXTERN int BZ_API(BZ2_bzCompressEnd) ( 
00113       bz_stream* strm 
00114    );
00115 
00116 BZ_EXTERN int BZ_API(BZ2_bzDecompressInit) ( 
00117       bz_stream *strm, 
00118       int       verbosity, 
00119       int       small
00120    );
00121 
00122 BZ_EXTERN int BZ_API(BZ2_bzDecompress) ( 
00123       bz_stream* strm 
00124    );
00125 
00126 BZ_EXTERN int BZ_API(BZ2_bzDecompressEnd) ( 
00127       bz_stream *strm 
00128    );
00129 
00130 
00131 
00132 /*-- High(er) level library functions --*/
00133 
00134 #ifndef BZ_NO_STDIO
00135 #define BZ_MAX_UNUSED 5000
00136 
00137 typedef void BZFILE;
00138 
00139 BZ_EXTERN BZFILE* BZ_API(BZ2_bzReadOpen) ( 
00140       int*  bzerror,   
00141       FILE* f, 
00142       int   verbosity, 
00143       int   small,
00144       void* unused,    
00145       int   nUnused 
00146    );
00147 
00148 BZ_EXTERN void BZ_API(BZ2_bzReadClose) ( 
00149       int*    bzerror, 
00150       BZFILE* b 
00151    );
00152 
00153 BZ_EXTERN void BZ_API(BZ2_bzReadGetUnused) ( 
00154       int*    bzerror, 
00155       BZFILE* b, 
00156       void**  unused,  
00157       int*    nUnused 
00158    );
00159 
00160 BZ_EXTERN int BZ_API(BZ2_bzRead) ( 
00161       int*    bzerror, 
00162       BZFILE* b, 
00163       void*   buf, 
00164       int     len 
00165    );
00166 
00167 BZ_EXTERN BZFILE* BZ_API(BZ2_bzWriteOpen) ( 
00168       int*  bzerror,      
00169       FILE* f, 
00170       int   blockSize100k, 
00171       int   verbosity, 
00172       int   workFactor 
00173    );
00174 
00175 BZ_EXTERN void BZ_API(BZ2_bzWrite) ( 
00176       int*    bzerror, 
00177       BZFILE* b, 
00178       void*   buf, 
00179       int     len 
00180    );
00181 
00182 BZ_EXTERN void BZ_API(BZ2_bzWriteClose) ( 
00183       int*          bzerror, 
00184       BZFILE*       b, 
00185       int           abandon, 
00186       unsigned int* nbytes_in, 
00187       unsigned int* nbytes_out 
00188    );
00189 
00190 BZ_EXTERN void BZ_API(BZ2_bzWriteClose64) ( 
00191       int*          bzerror, 
00192       BZFILE*       b, 
00193       int           abandon, 
00194       unsigned int* nbytes_in_lo32, 
00195       unsigned int* nbytes_in_hi32, 
00196       unsigned int* nbytes_out_lo32, 
00197       unsigned int* nbytes_out_hi32
00198    );
00199 #endif
00200 
00201 
00202 /*-- Utility functions --*/
00203 
00204 BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffCompress) ( 
00205       char*         dest, 
00206       unsigned int* destLen,
00207       char*         source, 
00208       unsigned int  sourceLen,
00209       int           blockSize100k, 
00210       int           verbosity, 
00211       int           workFactor 
00212    );
00213 
00214 BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffDecompress) ( 
00215       char*         dest, 
00216       unsigned int* destLen,
00217       char*         source, 
00218       unsigned int  sourceLen,
00219       int           small, 
00220       int           verbosity 
00221    );
00222 
00223 
00224 /*--
00225    Code contributed by Yoshioka Tsuneo (tsuneo@rr.iij4u.or.jp)
00226    to support better zlib compatibility.
00227    This code is not _officially_ part of libbzip2 (yet);
00228    I haven't tested it, documented it, or considered the
00229    threading-safeness of it.
00230    If this code breaks, please contact both Yoshioka and me.
00231 --*/
00232 
00233 BZ_EXTERN const char * BZ_API(BZ2_bzlibVersion) (
00234       void
00235    );
00236 
00237 #ifndef BZ_NO_STDIO
00238 BZ_EXTERN BZFILE * BZ_API(BZ2_bzopen) (
00239       const char *path,
00240       const char *mode
00241    );
00242 
00243 BZ_EXTERN BZFILE * BZ_API(BZ2_bzdopen) (
00244       int        fd,
00245       const char *mode
00246    );
00247          
00248 BZ_EXTERN int BZ_API(BZ2_bzread) (
00249       BZFILE* b, 
00250       void* buf, 
00251       int len 
00252    );
00253 
00254 BZ_EXTERN int BZ_API(BZ2_bzwrite) (
00255       BZFILE* b, 
00256       void*   buf, 
00257       int     len 
00258    );
00259 
00260 BZ_EXTERN int BZ_API(BZ2_bzflush) (
00261       BZFILE* b
00262    );
00263 
00264 BZ_EXTERN void BZ_API(BZ2_bzclose) (
00265       BZFILE* b
00266    );
00267 
00268 BZ_EXTERN const char * BZ_API(BZ2_bzerror) (
00269       BZFILE *b, 
00270       int    *errnum
00271    );
00272 #endif
00273 
00274 #ifdef __cplusplus
00275 }
00276 #endif
00277 
00278 #endif
00279 
00280 /*-------------------------------------------------------------*/
00281 /*--- end                                           bzlib.h ---*/
00282 /*-------------------------------------------------------------*/


win_bzip2
Author(s): Daniel Stonier
autogenerated on Wed Sep 16 2015 07:14:10