1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/modules/libbz2/src/bzlib.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,282 @@ 1.4 + 1.5 +/*-------------------------------------------------------------*/ 1.6 +/*--- Public header file for the library. ---*/ 1.7 +/*--- bzlib.h ---*/ 1.8 +/*-------------------------------------------------------------*/ 1.9 + 1.10 +/* ------------------------------------------------------------------ 1.11 + This file is part of bzip2/libbzip2, a program and library for 1.12 + lossless, block-sorting data compression. 1.13 + 1.14 + bzip2/libbzip2 version 1.0.4 of 20 December 2006 1.15 + Copyright (C) 1996-2006 Julian Seward <jseward@bzip.org> 1.16 + 1.17 + Please read the WARNING, DISCLAIMER and PATENTS sections in the 1.18 + README file. 1.19 + 1.20 + This program is released under the terms of the license contained 1.21 + in the file LICENSE. 1.22 + ------------------------------------------------------------------ */ 1.23 + 1.24 + 1.25 +#ifndef _BZLIB_H 1.26 +#define _BZLIB_H 1.27 + 1.28 +#ifdef __cplusplus 1.29 +extern "C" { 1.30 +#endif 1.31 + 1.32 +#define BZ_RUN 0 1.33 +#define BZ_FLUSH 1 1.34 +#define BZ_FINISH 2 1.35 + 1.36 +#define BZ_OK 0 1.37 +#define BZ_RUN_OK 1 1.38 +#define BZ_FLUSH_OK 2 1.39 +#define BZ_FINISH_OK 3 1.40 +#define BZ_STREAM_END 4 1.41 +#define BZ_SEQUENCE_ERROR (-1) 1.42 +#define BZ_PARAM_ERROR (-2) 1.43 +#define BZ_MEM_ERROR (-3) 1.44 +#define BZ_DATA_ERROR (-4) 1.45 +#define BZ_DATA_ERROR_MAGIC (-5) 1.46 +#define BZ_IO_ERROR (-6) 1.47 +#define BZ_UNEXPECTED_EOF (-7) 1.48 +#define BZ_OUTBUFF_FULL (-8) 1.49 +#define BZ_CONFIG_ERROR (-9) 1.50 + 1.51 +typedef 1.52 + struct { 1.53 + char *next_in; 1.54 + unsigned int avail_in; 1.55 + unsigned int total_in_lo32; 1.56 + unsigned int total_in_hi32; 1.57 + 1.58 + char *next_out; 1.59 + unsigned int avail_out; 1.60 + unsigned int total_out_lo32; 1.61 + unsigned int total_out_hi32; 1.62 + 1.63 + void *state; 1.64 + 1.65 + void *(*bzalloc)(void *,int,int); 1.66 + void (*bzfree)(void *,void *); 1.67 + void *opaque; 1.68 + } 1.69 + bz_stream; 1.70 + 1.71 + 1.72 +#ifndef BZ_IMPORT 1.73 +#define BZ_EXPORT 1.74 +#endif 1.75 + 1.76 +#ifndef BZ_NO_STDIO 1.77 +/* Need a definitition for FILE */ 1.78 +#include <stdio.h> 1.79 +#endif 1.80 + 1.81 +#ifdef _WIN32 1.82 +# include <windows.h> 1.83 +# ifdef small 1.84 + /* windows.h define small to char */ 1.85 +# undef small 1.86 +# endif 1.87 +# ifdef BZ_EXPORT 1.88 +# define BZ_API(func) WINAPI func 1.89 +# define BZ_EXTERN extern 1.90 +# else 1.91 + /* import windows dll dynamically */ 1.92 +# define BZ_API(func) (WINAPI * func) 1.93 +# define BZ_EXTERN 1.94 +# endif 1.95 +#else 1.96 +# define BZ_API(func) func 1.97 +# define BZ_EXTERN extern 1.98 +#endif 1.99 + 1.100 + 1.101 +/*-- Core (low-level) library functions --*/ 1.102 + 1.103 +BZ_EXTERN int BZ_API(BZ2_bzCompressInit) ( 1.104 + bz_stream* strm, 1.105 + int blockSize100k, 1.106 + int verbosity, 1.107 + int workFactor 1.108 + ); 1.109 + 1.110 +BZ_EXTERN int BZ_API(BZ2_bzCompress) ( 1.111 + bz_stream* strm, 1.112 + int action 1.113 + ); 1.114 + 1.115 +BZ_EXTERN int BZ_API(BZ2_bzCompressEnd) ( 1.116 + bz_stream* strm 1.117 + ); 1.118 + 1.119 +BZ_EXTERN int BZ_API(BZ2_bzDecompressInit) ( 1.120 + bz_stream *strm, 1.121 + int verbosity, 1.122 + int small 1.123 + ); 1.124 + 1.125 +BZ_EXTERN int BZ_API(BZ2_bzDecompress) ( 1.126 + bz_stream* strm 1.127 + ); 1.128 + 1.129 +BZ_EXTERN int BZ_API(BZ2_bzDecompressEnd) ( 1.130 + bz_stream *strm 1.131 + ); 1.132 + 1.133 + 1.134 + 1.135 +/*-- High(er) level library functions --*/ 1.136 + 1.137 +#ifndef BZ_NO_STDIO 1.138 +#define BZ_MAX_UNUSED 5000 1.139 + 1.140 +typedef void BZFILE; 1.141 + 1.142 +BZ_EXTERN BZFILE* BZ_API(BZ2_bzReadOpen) ( 1.143 + int* bzerror, 1.144 + FILE* f, 1.145 + int verbosity, 1.146 + int small, 1.147 + void* unused, 1.148 + int nUnused 1.149 + ); 1.150 + 1.151 +BZ_EXTERN void BZ_API(BZ2_bzReadClose) ( 1.152 + int* bzerror, 1.153 + BZFILE* b 1.154 + ); 1.155 + 1.156 +BZ_EXTERN void BZ_API(BZ2_bzReadGetUnused) ( 1.157 + int* bzerror, 1.158 + BZFILE* b, 1.159 + void** unused, 1.160 + int* nUnused 1.161 + ); 1.162 + 1.163 +BZ_EXTERN int BZ_API(BZ2_bzRead) ( 1.164 + int* bzerror, 1.165 + BZFILE* b, 1.166 + void* buf, 1.167 + int len 1.168 + ); 1.169 + 1.170 +BZ_EXTERN BZFILE* BZ_API(BZ2_bzWriteOpen) ( 1.171 + int* bzerror, 1.172 + FILE* f, 1.173 + int blockSize100k, 1.174 + int verbosity, 1.175 + int workFactor 1.176 + ); 1.177 + 1.178 +BZ_EXTERN void BZ_API(BZ2_bzWrite) ( 1.179 + int* bzerror, 1.180 + BZFILE* b, 1.181 + void* buf, 1.182 + int len 1.183 + ); 1.184 + 1.185 +BZ_EXTERN void BZ_API(BZ2_bzWriteClose) ( 1.186 + int* bzerror, 1.187 + BZFILE* b, 1.188 + int abandon, 1.189 + unsigned int* nbytes_in, 1.190 + unsigned int* nbytes_out 1.191 + ); 1.192 + 1.193 +BZ_EXTERN void BZ_API(BZ2_bzWriteClose64) ( 1.194 + int* bzerror, 1.195 + BZFILE* b, 1.196 + int abandon, 1.197 + unsigned int* nbytes_in_lo32, 1.198 + unsigned int* nbytes_in_hi32, 1.199 + unsigned int* nbytes_out_lo32, 1.200 + unsigned int* nbytes_out_hi32 1.201 + ); 1.202 +#endif 1.203 + 1.204 + 1.205 +/*-- Utility functions --*/ 1.206 + 1.207 +BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffCompress) ( 1.208 + char* dest, 1.209 + unsigned int* destLen, 1.210 + char* source, 1.211 + unsigned int sourceLen, 1.212 + int blockSize100k, 1.213 + int verbosity, 1.214 + int workFactor 1.215 + ); 1.216 + 1.217 +BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffDecompress) ( 1.218 + char* dest, 1.219 + unsigned int* destLen, 1.220 + char* source, 1.221 + unsigned int sourceLen, 1.222 + int small, 1.223 + int verbosity 1.224 + ); 1.225 + 1.226 + 1.227 +/*-- 1.228 + Code contributed by Yoshioka Tsuneo (tsuneo@rr.iij4u.or.jp) 1.229 + to support better zlib compatibility. 1.230 + This code is not _officially_ part of libbzip2 (yet); 1.231 + I haven't tested it, documented it, or considered the 1.232 + threading-safeness of it. 1.233 + If this code breaks, please contact both Yoshioka and me. 1.234 +--*/ 1.235 + 1.236 +BZ_EXTERN const char * BZ_API(BZ2_bzlibVersion) ( 1.237 + void 1.238 + ); 1.239 + 1.240 +#ifndef BZ_NO_STDIO 1.241 +BZ_EXTERN BZFILE * BZ_API(BZ2_bzopen) ( 1.242 + const char *path, 1.243 + const char *mode 1.244 + ); 1.245 + 1.246 +BZ_EXTERN BZFILE * BZ_API(BZ2_bzdopen) ( 1.247 + int fd, 1.248 + const char *mode 1.249 + ); 1.250 + 1.251 +BZ_EXTERN int BZ_API(BZ2_bzread) ( 1.252 + BZFILE* b, 1.253 + void* buf, 1.254 + int len 1.255 + ); 1.256 + 1.257 +BZ_EXTERN int BZ_API(BZ2_bzwrite) ( 1.258 + BZFILE* b, 1.259 + void* buf, 1.260 + int len 1.261 + ); 1.262 + 1.263 +BZ_EXTERN int BZ_API(BZ2_bzflush) ( 1.264 + BZFILE* b 1.265 + ); 1.266 + 1.267 +BZ_EXTERN void BZ_API(BZ2_bzclose) ( 1.268 + BZFILE* b 1.269 + ); 1.270 + 1.271 +BZ_EXTERN const char * BZ_API(BZ2_bzerror) ( 1.272 + BZFILE *b, 1.273 + int *errnum 1.274 + ); 1.275 +#endif 1.276 + 1.277 +#ifdef __cplusplus 1.278 +} 1.279 +#endif 1.280 + 1.281 +#endif 1.282 + 1.283 +/*-------------------------------------------------------------*/ 1.284 +/*--- end bzlib.h ---*/ 1.285 +/*-------------------------------------------------------------*/