| 1 | /*
|
|---|
| 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 | /* ------------------------------------------------------------------
|
|---|
| 13 | This file is part of bzip2/libbzip2, a program and library for
|
|---|
| 14 | lossless, block-sorting data compression.
|
|---|
| 15 |
|
|---|
| 16 | bzip2/libbzip2 version 1.0.4 of 20 December 2006
|
|---|
| 17 | Copyright (C) 1996-2006 Julian Seward <jseward@bzip.org>
|
|---|
| 18 |
|
|---|
| 19 | Please read the WARNING, DISCLAIMER and PATENTS sections in the
|
|---|
| 20 | README file.
|
|---|
| 21 |
|
|---|
| 22 | This program is released under the terms of the license contained
|
|---|
| 23 | in 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 |
|
|---|
| 45 | typedef struct bz_stream {
|
|---|
| 46 | void *state;
|
|---|
| 47 | 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;
|
|---|
| 53 | } bz_stream;
|
|---|
| 54 |
|
|---|
| 55 | /*-- Core (low-level) library functions --*/
|
|---|
| 56 |
|
|---|
| 57 | static void BZ2_bzCompressInit(bz_stream *strm, int blockSize100k);
|
|---|
| 58 | static int BZ2_bzCompress(bz_stream *strm, int action);
|
|---|
| 59 | #if ENABLE_FEATURE_CLEAN_UP
|
|---|
| 60 | static void BZ2_bzCompressEnd(bz_stream *strm);
|
|---|
| 61 | #endif
|
|---|
| 62 |
|
|---|
| 63 | /*-------------------------------------------------------------*/
|
|---|
| 64 | /*--- end bzlib.h ---*/
|
|---|
| 65 | /*-------------------------------------------------------------*/
|
|---|