view src/dmzlib.h @ 1060:5006cfe66250

Rename constants.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 02 Mar 2015 00:02:05 +0200
parents d98fcb10df6a
children 43905dacb365
line wrap: on
line source

/*
 * DMLib
 * -- ZLib implementation
 * Public domain zlib decode v0.2 by Sean Barrett 2006-11-18
 * Modified and reformatted for DMLib by Matti 'ccr' Hamalainen
 */
#ifndef DMZLIB_H
#define DMZLIB_H

#include "dmlib.h"

#ifdef __cplusplus
extern "C" {
#endif


#define DM_ZLIB_HFAST_BITS  9  // accelerate all cases in default tables
#define DM_ZLIB_HFAST_SIZE  (1 << DM_ZLIB_HFAST_BITS)
#define DM_ZLIB_HFAST_MASK  (DM_ZLIB_HFAST_SIZE - 1)


typedef struct
{
    Uint16  fast[DM_ZLIB_HFAST_SIZE];
    Uint16  firstCode[16];
    int     maxCode[17];
    Uint16  firstSymbol[16];
    Uint8   size[288];
    Uint16  value[288];
} DMZHuffmanContext;


typedef struct
{
    Uint8 *zbuffer, *zbufferEnd;

    int window;
    int numBits;
    Uint32 codeBuffer;

    Uint8 *zout, *zoutStart, *zoutEnd;
    BOOL expandable;

    DMZHuffmanContext zlength, zdistance;
} DMZLibContext;


int    dmZLibInit();
void   dmZLibClose();
int    dmZLibParseHeader(DMZLibContext * ctx, BOOL checkPNG);
int    dmZLibDecode(DMZLibContext * ctx);


#ifdef __cplusplus
}
#endif

#endif // DMZLIB_H