#pragma prototyped
/*-------------------------------------------------------------*/
/*--- Private header file for the library. ---*/
/*--- bzhdr.h ---*/
/*-------------------------------------------------------------*/
/*--
library for lossless, block-sorting data compression.
Copyright (C) 1996-1998 Julian R Seward. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product
documentation would be appreciated but is not required.
3. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
4. The name of the author may not be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Julian Seward, Guildford, Surrey, UK.
jseward@acm.org
This program is based on (at least) the work of:
Mike Burrows
David Wheeler
Peter Fenwick
Alistair Moffat
Radford Neal
Ian H. Witten
Robert Sedgewick
Jon L. Bentley
For more information on these sources, see the manual.
--*/
#ifndef _BZLIB_PRIVATE_H
#define _BZLIB_PRIVATE_H
#if _PACKAGE_ast
#include <ast_std.h>
#else
#include <stdlib.h>
#endif
#ifndef BZ_NO_STDIO
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#endif
#include "bzlib.h"
/*-- General stuff. --*/
typedef char Char;
typedef unsigned char Bool;
typedef unsigned char UChar;
typedef int Int32;
typedef unsigned int UInt32;
typedef short Int16;
typedef unsigned short UInt16;
#ifndef __GNUC__
#endif
#ifndef BZ_NO_STDIO
extern void bz__AssertH__fail ( int errcode );
#if BZ_DEBUG
{ if (!(cond)) { \
"\n\nlibbzip2(debug build): internal error\n\t%s\n", msg );\
exit(1); \
}}
#else
#endif
#else
extern void bz_internal_error ( int errcode );
#endif
/*-- Constants for the back end. --*/
#define BZ_RUNA 0
/*-- Stuff for randomising repetitive blocks. --*/
#define BZ_RAND_DECLS \
#define BZ_RAND_INIT_MASK \
s->rNToGo = 0; \
s->rTPos = 0 \
#define BZ_RAND_UPD_MASK \
if (s->rNToGo == 0) { \
s->rTPos++; \
} \
s->rNToGo--;
/*-- Stuff for doing CRCs. --*/
{ \
crcVar = 0xffffffffL; \
}
{ \
}
{ \
}
/*-- States and modes for compression. --*/
/*-- Structure holding all the compression-side stuff. --*/
typedef
struct {
/* pointer back to the struct bz_stream */
/* mode this stream is in, and whether inputting */
/* or outputting data */
/* for doing the block sorting */
/* run-length-encoding of the input */
/* input and output limits and current posns */
/* map of bytes used in block */
/* the buffer for bit stream creation */
/* block and combined CRCs */
/* misc administratium */
/* stuff for coding the MTF values */
}
/*-- externs for compression. --*/
extern void
extern void
extern void
bsInitWrite ( EState* );
extern void
extern void
/*-- states for decompression. --*/
/*-- Constants for the fast MTF decoder. --*/
/*-- Structure holding all the decompression-side stuff. --*/
typedef
struct {
/* pointer back to the struct bz_stream */
/* state indicator for this stream */
/* for doing the final run-length decoding */
/* the buffer for bit stream reading */
/* misc administratium */
/* for undoing the Burrows-Wheeler transform */
/* for undoing the Burrows-Wheeler transform (FAST) */
/* for undoing the Burrows-Wheeler transform (SMALL) */
/* stored and calculated CRCs */
/* map of bytes used in block */
/* for decoding the MTF values */
/* save area for scalars in the main decompress code */
}
/*-- Macros for decompression. --*/
s->tPos >>= 8;
c_tPos >>= 8;
#define SET_LL4(i,n) \
{ if (((i) & 0x1) == 0) \
}
#define GET_LL4(i) \
#define SET_LL(i,n) \
SET_LL4(i, n >> 16); \
}
#define GET_LL(i) \
/*-- externs for decompression. --*/
extern Int32
extern Int32
decompress ( DState* );
extern void
#endif
/*-- BZ_NO_STDIO seems to make NULL disappear on some platforms. --*/
#ifdef BZ_NO_STDIO
#ifndef NULL
#define NULL 0
#endif
#endif
/*-------------------------------------------------------------*/
/*--- end bzhdr.h ---*/
/*-------------------------------------------------------------*/