⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 inflatetables.h

📁 This is a java virtual machine implement in c
💻 H
📖 第 1 页 / 共 3 页
字号:
/*0001*//*
/*0002./ * Copyright (c) 1999-2001 Sun Microsystems, Inc. All Rights Reserved.
/*0003./ *
/*0004./ * This software is the confidential and proprietary information of Sun
/*0005./ * Microsystems, Inc. ("Confidential Information").  You shall not
/*0006./ * disclose such Confidential Information and shall use it only in
/*0007./ * accordance with the terms of the license agreement you entered into
/*0008./ * with Sun.
/*0009./ *
/*0010./ * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
/*0011./ * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
/*0012./ * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
/*0013./ * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
/*0014./ * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
/*0015./ * THIS SOFTWARE OR ITS DERIVATIVES.
/*0016./ *
/*0017./ */
/*0018*/
/*0019*//*=========================================================================
/*0020./ * SYSTEM:    KVM
/*0021./ * SUBSYSTEM: JAR file reader / inflater.
/*0022./ * FILE:      inflatetables.h
/*0023./ * OVERVIEW:  Public header file for the data tables needed by
/*0024./ *            the JAR file reader / inflater.
/*0025./ * AUTHOR:    Ioi Lam 
/*0026./ *            Tasneem Sayeed
/*0027./ *=========================================================================*/
/*0028*/
/*0029*/#ifndef _KJARTABLES_H_
/*0030*/#define _KJARTABLES_H_
/*0031*/
/*0032*/static const unsigned char ll_extra_bits[] = {
/*0033*/    /* 257 */   0,   /* 3       */
/*0034*/    /* 258 */   0,   /* 4       */
/*0035*/    /* 259 */   0,   /* 5       */
/*0036*/    /* 260 */   0,   /* 6       */
/*0037*/    /* 261 */   0,   /* 7       */
/*0038*/    /* 262 */   0,   /* 8       */
/*0039*/    /* 263 */   0,   /* 9       */
/*0040*/    /* 264 */   0,   /* 10      */
/*0041*/    /* 265 */   1,   /* 11,12   */
/*0042*/    /* 266 */   1,   /* 13,14   */
/*0043*/
/*0044*/    /* 267 */   1,   /* 15,16   */
/*0045*/    /* 268 */   1,   /* 17,18   */
/*0046*/    /* 269 */   2,   /* 19-22   */
/*0047*/    /* 270 */   2,   /* 23-26   */
/*0048*/    /* 271 */   2,   /* 27-30   */
/*0049*/    /* 272 */   2,   /* 31-34   */
/*0050*/    /* 273 */   3,   /* 35-42   */
/*0051*/    /* 274 */   3,   /* 43-50   */
/*0052*/    /* 275 */   3,   /* 51-58   */
/*0053*/    /* 276 */   3,   /* 59-66   */
/*0054*/
/*0055*/    /* 277 */   4,   /* 67-82   */
/*0056*/    /* 278 */   4,   /* 83-98   */
/*0057*/    /* 279 */   4,   /* 99-114  */
/*0058*/    /* 280 */   4,   /* 115-130 */
/*0059*/    /* 281 */   5,   /* 131-162 */
/*0060*/    /* 282 */   5,   /* 163-194 */
/*0061*/    /* 283 */   5,   /* 195-226 */
/*0062*/    /* 284 */   5,   /* 227-257 */
/*0063*/    /* 285 */   0,   /* 258     */
/*0064*/};
/*0065*/
/*0066*/#define MAX_ZIP_EXTRA_LENGTH_BITS 5
/*0067*/
/*0068*/static const unsigned short ll_length_base[] = {
/*0069*/    /* 257   0 */   3,
/*0070*/    /* 258   0 */   4,
/*0071*/    /* 259   0 */   5,
/*0072*/    /* 260   0 */   6,
/*0073*/    /* 261   0 */   7,
/*0074*/    /* 262   0 */   8,
/*0075*/    /* 263   0 */   9,
/*0076*/    /* 264   0 */   10,
/*0077*/    /* 265   1 */   11,  /* - 12 */ 
/*0078*/    /* 266   1 */   13,  /* - 14 */ 
/*0079*/
/*0080*/    /* 267   1 */   15,  /* - 16 */ 
/*0081*/    /* 268   1 */   17,  /* - 18 */ 
/*0082*/    /* 269   2 */   19,  /* - 22 */ 
/*0083*/    /* 270   2 */   23,  /* - 26 */ 
/*0084*/    /* 271   2 */   27,  /* - 30 */ 
/*0085*/    /* 272   2 */   31,  /* - 34 */ 
/*0086*/    /* 273   3 */   35,  /* - 42 */ 
/*0087*/    /* 274   3 */   43,  /* - 50 */ 
/*0088*/    /* 275   3 */   51,  /* - 58 */ 
/*0089*/    /* 276   3 */   59,  /* - 66 */ 
/*0090*/
/*0091*/    /* 277   4 */   67,  /* - 82 */ 
/*0092*/    /* 278   4 */   83,  /* - 98 */ 
/*0093*/    /* 279   4 */   99,  /* - 114 */ 
/*0094*/    /* 280   4 */   115, /* - 130 */ 
/*0095*/    /* 281   5 */   131, /* - 162 */ 
/*0096*/    /* 282   5 */   163, /* - 194 */ 
/*0097*/    /* 283   5 */   195, /* - 226 */ 
/*0098*/    /* 284   5 */   227, /* - 257 */ 
/*0099*/    /* 285   0 */   258
/*0100*/};
/*0101*/
/*0102*/
/*0103*/static const unsigned char dist_extra_bits[] = {
/*0104*/    /*  0 */   0,    /* 1            */
/*0105*/    /*  1 */   0,    /* 2            */
/*0106*/    /*  2 */   0,    /* 3            */
/*0107*/    /*  3 */   0,    /* 4            */
/*0108*/    /*  4 */   1,    /* 5,6          */
/*0109*/    /*  5 */   1,    /* 7,8          */
/*0110*/    /*  6 */   2,    /* 9-12         */
/*0111*/    /*  7 */   2,    /* 13-16        */
/*0112*/    /*  8 */   3,    /* 17-24        */
/*0113*/    /*  9 */   3,    /* 25-32        */
/*0114*/
/*0115*/    /* 10 */   4,    /* 33-48        */
/*0116*/    /* 11 */   4,    /* 49-64        */
/*0117*/    /* 12 */   5,    /* 65-96        */
/*0118*/    /* 13 */   5,    /* 97-128       */
/*0119*/    /* 14 */   6,    /* 129-192      */
/*0120*/    /* 15 */   6,    /* 193-256      */
/*0121*/    /* 16 */   7,    /* 257-384      */
/*0122*/    /* 17 */   7,    /* 385-512      */
/*0123*/    /* 18 */   8,    /* 513-768      */
/*0124*/    /* 19 */   8,    /* 769-1024     */
/*0125*/
/*0126*/    /* 20 */   9,    /* 1025-1536    */
/*0127*/    /* 21 */   9,    /* 1537-2048    */
/*0128*/    /* 22 */   10,   /* 2049-3072    */
/*0129*/    /* 23 */   10,   /* 3073-4096    */
/*0130*/    /* 24 */   11,   /* 4097-6144    */
/*0131*/    /* 25 */   11,   /* 6145-8192    */
/*0132*/    /* 26 */   12,   /* 8193-12288   */
/*0133*/    /* 27 */   12,   /* 12289-16384  */
/*0134*/    /* 28 */   13,   /* 16385-24576  */
/*0135*/    /* 29 */   13,   /* 24577-32768  */
/*0136*/};
/*0137*/
/*0138*/#define MAX_ZIP_EXTRA_DISTANCE_BITS 13
/*0139*/#define MAX_ZIP_DISTANCE_CODE 29
/*0140*/
/*0141*/static const unsigned int dist_base[] = {
/*0142*/    /*  0   0  */   1,
/*0143*/    /*  1   0  */   2,
/*0144*/    /*  2   0  */   3,
/*0145*/    /*  3   0  */   4,
/*0146*/    /*  4   1  */   5,      /* -6     */
/*0147*/    /*  5   1  */   7,      /* -8     */
/*0148*/    /*  6   2  */   9,      /* -12    */
/*0149*/    /*  7   2  */   13,     /* -16    */
/*0150*/    /*  8   3  */   17,     /* -24    */
/*0151*/    /*  9   3  */   25,     /* -32    */
/*0152*/
/*0153*/    /* 10   4  */   33,     /* -48    */
/*0154*/    /* 11   4  */   49,     /* -64    */
/*0155*/    /* 12   5  */   65,     /* -96    */
/*0156*/    /* 13   5  */   97,     /* -128   */
/*0157*/    /* 14   6  */   129,    /* -192   */
/*0158*/    /* 15   6  */   193,    /* -256   */
/*0159*/    /* 16   7  */   257,    /* -384   */
/*0160*/    /* 17   7  */   385,    /* -512   */
/*0161*/    /* 18   8  */   513,    /* -768   */
/*0162*/    /* 19   8  */   769,    /* -1024  */
/*0163*/    /* 20   9  */   1025,   /* -1536  */
/*0164*/    /* 21   9  */   1537,   /* -2048  */
/*0165*/    /* 22   10 */   2049,   /* -3072  */
/*0166*/    /* 23   10 */   3073,   /* -4096  */
/*0167*/    /* 24   11 */   4097,   /* -6144  */
/*0168*/    /* 25   11 */   6145,   /* -8192  */
/*0169*/    /* 26   12 */   8193,   /* -12288 */
/*0170*/    /* 27   12 */   12289,  /* -16384 */
/*0171*/    /* 28   13 */   16385,  /* -24576 */
/*0172*/    /* 29   13 */   24577,  /* -32768 */
/*0173*/};
/*0174*/
/*0175*/
/*0176*//*
/*0177./ * The order in which the code lengths of the Code Length Alphabet is
/*0178./ * given. See section 3.2.7 of RFC 1951.
/*0179./ */
/*0180*/
/*0181*/static const char ccode_idx[] = {
/*0182*/    16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15,
/*0183*/};
/*0184*/
/*0185*//* A table for reversing 5 bits in a binary number */
/*0186*/
/*0187*/static const unsigned char reverse5[] = {
/*0188*/    0x0, 0x10, 0x8, 0x18, 0x4, 0x14, 0xc, 0x1c,
/*0189*/    0x2, 0x12, 0xa, 0x1a, 0x6, 0x16, 0xe, 0x1e,
/*0190*/    0x1, 0x11, 0x9, 0x19, 0x5, 0x15, 0xd, 0x1d,
/*0191*/    0x3, 0x13, 0xb, 0x1b, 0x7, 0x17, 0xf, 0x1f
/*0192*/};
/*0193*/
/*0194*/#define REVERSE_5BITS(code) reverse5[code]
/*0195*/#define REVERSE_9BITS(code) \
/*0196*/      ((reverse5[((code) & 0x1F)] << 4) | reverse5[(code) >> 4])
/*0197*/#define REVERSE_15BITS(code) \
/*0198*/      (  (reverse5[code & 0x1F] << 10) | (reverse5[((code) >> 5) & 0x1F] << 5) \
/*0199*/       | (reverse5[code >> 10]) )
/*0200*/
/*0201*/
/*0202*/#define HUFFMAN_ENTRY(char, bits) ((char << 4) + bits)
/*0203*/
/*0204*/
/*0205*/#ifdef USE_FIXED_HUFFMAN_CODE_TABLES
/*0206*/
/*0207*//* The following tables can be removed from releases
/*0208./ * that care for size rather that speed. 
/*0209./ *
/*0210./ * "Fixed Huffman" can use the following tables, rather than doing the
/*0211./ * complicated calculations that it does.
/*0212./ */
/*0213*/
/*0214*/static const struct HuffmanCodeTable fixedHuffmanCodeTable = { 
/*0215*/    { 
/*0216*/        7,            /* min code length */
/*0217*/        9,            /* max code length */
/*0218*/    }, 
/*0219*/    { 
/*0220*/        HUFFMAN_ENTRY(0x100, 7), 
/*0221*/        HUFFMAN_ENTRY('P',   8), 
/*0222*/        HUFFMAN_ENTRY(0x010, 8), 
/*0223*/        HUFFMAN_ENTRY(0x118, 8), 
/*0224*/        HUFFMAN_ENTRY(0x110, 7), 
/*0225*/        HUFFMAN_ENTRY('p',   8), 
/*0226*/        HUFFMAN_ENTRY('0',   8), 
/*0227*/        HUFFMAN_ENTRY(0x0c0, 9), 
/*0228*/        HUFFMAN_ENTRY(0x108, 7), 
/*0229*/        HUFFMAN_ENTRY('`',   8), 
/*0230*/        HUFFMAN_ENTRY(' ',   8), 
/*0231*/        HUFFMAN_ENTRY(0x0a0, 9), 
/*0232*/        HUFFMAN_ENTRY(0x000, 8), 
/*0233*/        HUFFMAN_ENTRY(0x080, 8), 
/*0234*/        HUFFMAN_ENTRY('@',   8), 
/*0235*/        HUFFMAN_ENTRY(0x0e0, 9), 
/*0236*/        HUFFMAN_ENTRY(0x104, 7), 
/*0237*/        HUFFMAN_ENTRY('X',   8), 
/*0238*/        HUFFMAN_ENTRY(0x018, 8), 
/*0239*/        HUFFMAN_ENTRY(0x090, 9), 
/*0240*/        HUFFMAN_ENTRY(0x114, 7), 
/*0241*/        HUFFMAN_ENTRY('x',   8), 
/*0242*/        HUFFMAN_ENTRY('8',   8), 
/*0243*/        HUFFMAN_ENTRY(0x0d0, 9), 
/*0244*/        HUFFMAN_ENTRY(0x10c, 7), 
/*0245*/        HUFFMAN_ENTRY('h',   8), 
/*0246*/        HUFFMAN_ENTRY('(',   8), 
/*0247*/        HUFFMAN_ENTRY(0x0b0, 9), 
/*0248*/        HUFFMAN_ENTRY(0x008, 8), 
/*0249*/        HUFFMAN_ENTRY(0x088, 8), 
/*0250*/        HUFFMAN_ENTRY('H',   8), 
/*0251*/        HUFFMAN_ENTRY(0x0f0, 9), 
/*0252*/        HUFFMAN_ENTRY(0x102, 7), 
/*0253*/        HUFFMAN_ENTRY('T',   8), 
/*0254*/        HUFFMAN_ENTRY(0x014, 8), 
/*0255*/        HUFFMAN_ENTRY(0x11c, 8), 
/*0256*/        HUFFMAN_ENTRY(0x112, 7), 
/*0257*/        HUFFMAN_ENTRY('t',   8), 
/*0258*/        HUFFMAN_ENTRY('4',   8), 
/*0259*/        HUFFMAN_ENTRY(0x0c8, 9), 
/*0260*/        HUFFMAN_ENTRY(0x10a, 7), 
/*0261*/        HUFFMAN_ENTRY('d',   8), 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -