blob: 1bb811c4a18a93a1e937c843045857779fa4f62e [file] [log] [blame]
Denis Vlasenko77f1ec12007-10-13 03:36:03 +00001/*
2 * bzip2 is written by Julian Seward <jseward@bzip.org>.
3 * Adapted for busybox by Denys Vlasenko <vda.linux@googlemail.com>.
4 * See README and LICENSE files in this directory for more information.
5 */
6
7/*-------------------------------------------------------------*/
8/*--- Public header file for the library. ---*/
9/*--- bzlib.h ---*/
10/*-------------------------------------------------------------*/
11
12/* ------------------------------------------------------------------
13This file is part of bzip2/libbzip2, a program and library for
14lossless, block-sorting data compression.
15
16bzip2/libbzip2 version 1.0.4 of 20 December 2006
17Copyright (C) 1996-2006 Julian Seward <jseward@bzip.org>
18
19Please read the WARNING, DISCLAIMER and PATENTS sections in the
20README file.
21
22This program is released under the terms of the license contained
23in the file LICENSE.
24------------------------------------------------------------------ */
25
26#define BZ_RUN 0
27#define BZ_FLUSH 1
28#define BZ_FINISH 2
29
30#define BZ_OK 0
31#define BZ_RUN_OK 1
32#define BZ_FLUSH_OK 2
33#define BZ_FINISH_OK 3
34#define BZ_STREAM_END 4
35#define BZ_SEQUENCE_ERROR (-1)
36#define BZ_PARAM_ERROR (-2)
37#define BZ_MEM_ERROR (-3)
38#define BZ_DATA_ERROR (-4)
39#define BZ_DATA_ERROR_MAGIC (-5)
40#define BZ_IO_ERROR (-6)
41#define BZ_UNEXPECTED_EOF (-7)
42#define BZ_OUTBUFF_FULL (-8)
43#define BZ_CONFIG_ERROR (-9)
44
45typedef struct bz_stream {
Denis Vlasenko686b0ef2007-10-16 14:07:41 +000046 void *state;
Denis Vlasenko77f1ec12007-10-13 03:36:03 +000047 char *next_in;
48 char *next_out;
49 unsigned avail_in;
50 unsigned avail_out;
51 /*unsigned long long total_in;*/
52 unsigned long long total_out;
Denis Vlasenko77f1ec12007-10-13 03:36:03 +000053} bz_stream;
54
55/*-- Core (low-level) library functions --*/
56
57static void BZ2_bzCompressInit(bz_stream *strm, int blockSize100k);
58static int BZ2_bzCompress(bz_stream *strm, int action);
Denis Vlasenko686b0ef2007-10-16 14:07:41 +000059#if ENABLE_FEATURE_CLEAN_UP
Denis Vlasenkoef3aabe2007-10-14 00:43:01 +000060static void BZ2_bzCompressEnd(bz_stream *strm);
Denis Vlasenko686b0ef2007-10-16 14:07:41 +000061#endif
Denis Vlasenko77f1ec12007-10-13 03:36:03 +000062
63/*-------------------------------------------------------------*/
64/*--- end bzlib.h ---*/
65/*-------------------------------------------------------------*/