kerneltest/e32test/misc/inflate.h
changeset 0 a41df078684a
equal deleted inserted replaced
-1:000000000000 0:a41df078684a
       
     1 // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of the License "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // e32test\misc\inflate.h
       
    15 // 
       
    16 //
       
    17 
       
    18 #ifndef __INFLATE_H__
       
    19 #define __INFLATE_H__
       
    20 #ifdef __cplusplus
       
    21 extern "C" {
       
    22 #endif
       
    23 
       
    24 #if defined(__STDC__) || defined(PROTO)
       
    25 #  define OF(args)  args
       
    26 #else
       
    27 #  define OF(args)  ()
       
    28 #endif
       
    29 
       
    30 typedef unsigned char  uch;
       
    31 typedef unsigned short ush;
       
    32 typedef unsigned long  ulg;
       
    33 
       
    34 /* Compression methods (see algorithm.doc) */
       
    35 #define STORED      0
       
    36 #define COMPRESSED  1
       
    37 #define PACKED      2
       
    38 #define LZHED       3
       
    39 /* methods 4 to 7 reserved */
       
    40 #define DEFLATED    8
       
    41 #define MAX_METHODS 9
       
    42 
       
    43 #ifndef NULL
       
    44 #define NULL	((void*)0)
       
    45 #endif
       
    46 
       
    47 #define ZIP_WINDOW_SIZE 32768
       
    48 
       
    49 /* PKZIP header definitions */
       
    50 #define LOCSIG 0x04034b50L      /* four-byte lead-in (lsb first) */
       
    51 #define LOCFLG 6                /* offset of bit flag */
       
    52 #define  CRPFLG 1               /*  bit for encrypted entry */
       
    53 #define  EXTFLG 8               /*  bit for extended local header */
       
    54 #define LOCHOW 8                /* offset of compression method */
       
    55 #define LOCTIM 10               /* file mod time (for decryption) */
       
    56 #define LOCCRC 14               /* offset of crc */
       
    57 #define LOCSIZ 18               /* offset of compressed size */
       
    58 #define LOCLEN 22               /* offset of uncompressed length */
       
    59 #define LOCFIL 26               /* offset of file name field length */
       
    60 #define LOCEXT 28               /* offset of extra field length */
       
    61 #define LOCHDR 30               /* size of local header, including sig */
       
    62 #define EXTHDR 16               /* size of extended local header, inc sig */
       
    63 
       
    64 extern uch* volatile inbuf_end;		/* pointer to last valid input byte+1 */
       
    65 extern uch* volatile inptr;			/* pointer to next byte to be processed in inbuf */
       
    66 extern uch* volatile outptr;		/* pointer to output data */
       
    67 
       
    68 extern uch fill_inbuf(void);
       
    69 extern void* malloc(unsigned);
       
    70 extern void free(void*);
       
    71 
       
    72 extern void process_block(int error);
       
    73 extern int inflate(void);
       
    74 
       
    75 #ifdef __cplusplus
       
    76 }
       
    77 #endif
       
    78 #endif