• 大小: 100KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-10
  • 语言: 其他
  • 标签: VC  ++  

资源简介

VC ++ Gzip解压缩代码,生成DLL可直接使用。。希望对你有帮助

资源截图

代码片段和文件信息

/* bits.c -- output variable-length bit strings
 * Copyright (C) 1992-1993 Jean-loup Gailly
 * This is free software; you can redistribute it and/or modify it under the
 * terms of the GNU General Public License see the file COPYING.
 */


/*
 *  PURPOSE
 *
 *      Output variable-length bit strings. Compression can be done
 *      to a file or to memory. (The latter is not supported in this version.)
 *
 *  DISCUSSION
 *
 *      The PKZIP “deflate“ file format interprets compressed file data
 *      as a sequence of bits.  Multi-bit strings in the file may cross
 *      byte boundaries without restriction.
 *
 *      The first bit of each byte is the low-order bit.
 *
 *      The routines in this file allow a variable-length bit value to
 *      be output right-to-left (useful for literal values). For
 *      left-to-right output (useful for code strings from the tree routines)
 *      the bits must have been reversed first with bi_reverse().
 *
 *      For in-memory compression the compressed bit stream goes directly
 *      into the requested output buffer. The input data is read in blocks
 *      by the mem_read() function. The buffer is limited to 64K on 16 bit
 *      machines.
 *
 *  INTERFACE
 *
 *      void bi_init (FILE *zipfile)
 *          Initialize the bit string routines.
 *
 *      void send_bits (int value int length)
 *          Write out a bit string taking the source bits right to
 *          left.
 *
 *      int bi_reverse (int value int length)
 *          Reverse the bits of a bit string taking the source bits left to
 *          right and emitting them right to left.
 *
 *      void bi_windup (void)
 *          Write out any remaining bits in an incomplete byte.
 *
 *      void copy_block(char *buf unsigned len int header)
 *          Copy a stored block to the zip file storing first the length and
 *          its one‘s complement if requested.
 *
 */

#include “tailor.h“
#include “gzip.h“
#include “crypt.h“

#ifdef DEBUG
#  include 
#endif

#ifdef RCSID
static char rcsid[] = “$Id: bits.cv 0.9 1993/06/11 10:16:58 jloup Exp $“;
#endif

/* ===========================================================================
 * Local data used by the “bit string“ routines.
 */

local file_t zfile; /* output gzip file */

local unsigned short bi_buf;
/* Output buffer. bits are inserted starting at the bottom (least significant
 * bits).
 */

#define Buf_size (8 * 2*sizeof(char))
/* Number of bits used within bi_buf. (bi_buf might be implemented on
 * more than 16 bits on some systems.)
 */

local int bi_valid;
/* Number of valid bits in bi_buf.  All bits above the last valid bit
 * are always zero.
 */

int (*read_buf) OF((char *buf unsigned size));
/* Current input function. Set to mem_read for in-memory compression */

#ifdef DEBUG
  ulg bits_sent;   /* bit length of the compressed data */
#endif

/* ======================

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件        6083  1993-08-13 14:35  bits.c
     文件       18321  1992-11-25 16:39  COPYING
     文件         195  1993-08-13 14:35  crypt.c
     文件         268  1993-08-13 14:35  crypt.h
     文件        2338  1999-03-02 20:20  czip.cpp
     文件        1366  1999-03-02 19:52  czip.h
     文件       29942  1993-08-13 14:35  deflate.c
     文件       22293  1993-08-17 20:24  getopt.c
     文件        4503  1993-08-13 14:35  getopt.h
     文件       49510  1999-03-02 19:38  gzip.c
     文件       10934  1993-08-13 14:35  gzip.h
     文件       32567  1993-08-13 16:50  inflate.c
     文件         614  1993-08-13 14:35  lzw.c
     文件        1523  1993-08-13 14:35  lzw.h
     文件         993  1999-02-10 21:53  main.c
     文件        8488  1993-01-21 19:49  match.asm
     文件         493  1993-08-18 19:46  revision.h
     文件        1693  1993-07-08 00:54  tailor.c
     文件        7758  1993-08-16 23:19  tailor.h
     文件       41766  1993-08-17 19:36  trees.c
     文件        9604  1993-08-13 14:35  unlzh.c
     文件         535  1999-02-11 22:08  zipdll.dsw
     文件        8425  1993-08-13 14:35  unpack.c
     文件        6225  1999-02-13 17:53  unzip.c
     文件       14561  1993-08-13 14:35  util.c
     文件        3295  1999-03-02 07:00  zip.c
     文件        9217  1993-08-13 15:31  unlzw.c
     文件        4533  1999-03-01 22:50  zipdll.001
     文件        4578  2002-02-06 15:33  zipdll.dsp
     文件        2173  2002-02-06 15:34  zipdll.plg

评论

共有 条评论