/*-------------------------------------------------------------*/
/*--- Private header file for the library. ---*/
/*--- bzlib_private.h ---*/
/*-------------------------------------------------------------*/
/* ------------------------------------------------------------------
lossless, block-sorting data compression.
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
This program is released under the terms of the license contained
in the file LICENSE.
------------------------------------------------------------------ */
#ifndef _BZLIB_PRIVATE_H
#define _BZLIB_PRIVATE_H
#ifdef _KERNEL
#define BZ_NO_STDIO
#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 BZ2_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
/*-- Header bytes. --*/
/*-- 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 = 0xffffffffUL; \
}
{ \
}
{ \
}
/*-- 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 */
/* aliases for arr1 and arr2 */
/* for deciding when to use the fallback sorting algorithm */
/* 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 */
/* second dimension: only 3 needed; 4 makes index calculations faster */
}
/*-- externs for compression. --*/
extern void
BZ2_blockSort ( EState* );
extern void
extern void
BZ2_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. --*/
/* c_tPos is unsigned, hence test < 0 is pointless. */ \
s->tPos >>= 8;
/* c_tPos is unsigned, hence test < 0 is pointless. */ \
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) \
/* c_tPos is unsigned, hence test < 0 is pointless. */ \
/*-- externs for decompression. --*/
extern Int32
extern Int32
BZ2_decompress ( DState* );
extern void
/*-- BZ_NO_STDIO seems to make NULL disappear on some platforms. --*/
#ifdef BZ_NO_STDIO
#ifndef NULL
#define NULL 0
#endif
#endif
/*-------------------------------------------------------------*/
/*--- end bzlib_private.h ---*/
/*-------------------------------------------------------------*/
#endif /* _BZLIB_PRIVATE_H */