亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? bits.c

?? 匯編大全 中國礦業大學計算機學院 匯編實驗5
?? C
字號:
/* Copyright (C) 1990-1993 Mark Adler, Richard B. Wales, Jean-loup Gailly, Kai Uwe Rommel and Igor Mandrichenko. Permission is granted to any individual or institution to use, copy, or redistribute this software so long as all of the original files are included, that it is not sold for profit, and that this copyright notice is retained.*//* *  bits.c by Jean-loup Gailly and Kai Uwe Rommel. * *  This is a new version of im_bits.c originally written by Richard B. Wales * *  PURPOSE * *      Output variable-length bit strings. Compression can be done *      to a file or to memory. * *  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 far *buf, unsigned len, int header) *          Copy a stored block to the zip file, storing first the length and *          its one's complement if requested. * *      int seekable(void) *          Return true if the zip file can be seeked. * *      ulg memcompress (char *tgt, ulg tgtsize, char *src, ulg srcsize); *          Compress the source buffer src into the target buffer tgt. */#include "zip.h"#include "crypt.h"/* =========================================================================== * Local data used by the "bit string" routines. */local FILE *zfile; /* output zip 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. */char file_outbuf[1024];/* Output buffer for compression to file */local char *in_buf, *out_buf;/* Current input and output buffers. in_buf is used only for in-memory * compression. */local unsigned in_offset, out_offset;/* Current offset in input and output buffers. in_offset is used only for * in-memory compression. On 16 bit machiens, the buffer is limited to 64K. */local unsigned in_size, out_size;/* Size of current input and output buffers */int (*read_buf) OF((char *buf, unsigned size)) = file_read;/* Current input function. Set to mem_read for in-memory compression */#ifdef DEBUGulg bits_sent;   /* bit length of the compressed data */#endif/* Output a 16 bit value to the bit stream, lower (oldest) byte first */#define PUTSHORT(w) \{ if (out_offset < out_size-1) { \    out_buf[out_offset++] = (char) ((w) & 0xff); \    out_buf[out_offset++] = (char) ((ush)(w) >> 8); \  } else { \    flush_outbuf((w),2); \  } \}#define PUTBYTE(b) \{ if (out_offset < out_size) { \    out_buf[out_offset++] = (char) (b); \  } else { \    flush_outbuf((b),1); \  } \}/* =========================================================================== *  Prototypes for local functions */local int  mem_read     OF((char *b,    unsigned bsize));local void flush_outbuf OF((unsigned w, unsigned bytes));/* =========================================================================== * Initialize the bit string routines. */void bi_init (zipfile)    FILE *zipfile;  /* output zip file, NULL for in-memory compression */{    zfile  = zipfile;    bi_buf = 0;    bi_valid = 0;#ifdef DEBUG    bits_sent = 0L;#endif    /* Set the defaults for file compression. They are set by memcompress     * for in-memory compression.     */    if (zfile != NULL) {        out_buf = file_outbuf;        out_size = sizeof(file_outbuf);        out_offset = 0;        read_buf  = file_read;    }}/* =========================================================================== * Send a value on a given number of bits. * IN assertion: length <= 16 and value fits in length bits. */void send_bits(value, length)    int value;  /* value to send */    int length; /* number of bits */{#ifdef DEBUG    Tracevv((stderr," l %2d v %4x ", length, value));    Assert(length > 0 && length <= 15, "invalid length");    bits_sent += (ulg)length;#endif    /* If not enough room in bi_buf, use (valid) bits from bi_buf and     * (16 - bi_valid) bits from value, leaving (width - (16-bi_valid))     * unused bits in value.     */    if (bi_valid > (int)Buf_size - length) {        bi_buf |= (value << bi_valid);        PUTSHORT(bi_buf);        bi_buf = (ush)value >> (Buf_size - bi_valid);        bi_valid += length - Buf_size;    } else {        bi_buf |= value << bi_valid;        bi_valid += length;    }}/* =========================================================================== * Reverse the first len bits of a code, using straightforward code (a faster * method would use a table) * IN assertion: 1 <= len <= 15 */unsigned bi_reverse(code, len)    unsigned code; /* the value to invert */    int len;       /* its bit length */{    register unsigned res = 0;    do {        res |= code & 1;        code >>= 1, res <<= 1;    } while (--len > 0);    return res >> 1;}/* =========================================================================== * Flush the current output buffer. */local void flush_outbuf(w, bytes)    unsigned w;     /* value to flush */    unsigned bytes; /* number of bytes to flush (0, 1 or 2) */{    if (zfile == NULL) {        error("output buffer too small for in-memory compression");    }    /* Encrypt and write the output buffer: */    if (out_offset != 0) {        zfwrite(out_buf, 1, (extent)out_offset, zfile);        if (ferror(zfile)) error ("write error on zip file");    }    out_offset = 0;    if (bytes == 2) {        PUTSHORT(w);    } else if (bytes == 1) {        out_buf[out_offset++] = (char) (w & 0xff);    }}/* =========================================================================== * Write out any remaining bits in an incomplete byte. */void bi_windup(){    if (bi_valid > 8) {        PUTSHORT(bi_buf);    } else if (bi_valid > 0) {        PUTBYTE(bi_buf);    }    if (zfile != NULL) {        flush_outbuf(0, 0);    }    bi_buf = 0;    bi_valid = 0;#ifdef DEBUG    bits_sent = (bits_sent+7) & ~7;#endif}/* =========================================================================== * Copy a stored block to the zip file, storing first the length and its * one's complement if requested. */void copy_block(buf, len, header)    char far *buf; /* the input data */    unsigned len;  /* its length */    int header;    /* true if block header must be written */{    bi_windup();              /* align on byte boundary */    if (header) {        PUTSHORT((ush)len);           PUTSHORT((ush)~len);#ifdef DEBUG        bits_sent += 2*16;#endif    }    if (zfile) {        flush_outbuf(0, 0);        zfwrite(buf, 1, len, zfile);        if (ferror(zfile)) error ("write error on zip file");    } else if (out_offset + len > out_size) {        error("output buffer too small for in-memory compression");    } else {        memcpy(out_buf + out_offset, buf, len);        out_offset += len;    }#ifdef DEBUG    bits_sent += (ulg)len<<3;#endif}/* =========================================================================== * Return true if the zip file can be seeked. This is used to check if * the local header can be re-rewritten. This function always returns * true for in-memory compression. * IN assertion: the local header has already been written (ftell() > 0). */int seekable(){    return (zfile == NULL ||            (fseek(zfile, -1L, SEEK_CUR) == 0 &&             fseek(zfile,  1L, SEEK_CUR) == 0));}    /* =========================================================================== * In-memory compression. This version can be used only if the entire input * fits in one memory buffer. The compression is then done in a single * call of memcompress(). (An extension to allow repeated calls would be * possible but is not needed here.) * The first two bytes of the compressed output are set to a short with the * method used (DEFLATE or STORE). The following four bytes contain the CRC. * The values are stored in little-endian order on all machines. * This function returns the byte size of the compressed output, including * the first six bytes (method and crc). */ulg memcompress(tgt, tgtsize, src, srcsize)    char *tgt, *src;       /* target and source buffers */    ulg tgtsize, srcsize;  /* target and source sizes */{    ush att      = (ush)UNKNOWN;    ush flags    = 0;    ulg crc      = 0;    int method   = DEFLATE;    if (tgtsize <= 6L) error("target buffer too small");    crc = updcrc((char *)NULL, 0);    crc = updcrc(src, (extent) srcsize);    read_buf  = mem_read;    in_buf    = src;    in_size   = (unsigned)srcsize;    in_offset = 0;    out_buf    = tgt;    out_size   = (unsigned)tgtsize;    out_offset = 2 + 4;    bi_init((FILE *)NULL);    ct_init(&att, &method);    lm_init((level != 0 ? level : 1), &flags);    deflate();    /* For portability, force little-endian order on all machines: */    tgt[0] = (char)(method & 0xff);    tgt[1] = (char)((method >> 8) & 0xff);    tgt[2] = (char)(crc & 0xff);    tgt[3] = (char)((crc >> 8) & 0xff);    tgt[4] = (char)((crc >> 16) & 0xff);    tgt[5] = (char)((crc >> 24) & 0xff);    return (ulg)out_offset;}/* =========================================================================== * In-memory read function. As opposed to file_read(), this function * does not perform end-of-line translation, and does not update the * crc and input size. *    Note that the size of the entire input buffer is an unsigned long, * but the size used in mem_read() is only an unsigned int. This makes a * difference on 16 bit machines. mem_read() may be called several * times for an in-memory compression. */local int mem_read(b, bsize)     char *b;     unsigned bsize; {    if (in_offset < in_size) {        ulg block_size = in_size - in_offset;        if (block_size > (ulg)bsize) block_size = (ulg)bsize;        memcpy(b, in_buf + in_offset, (unsigned)block_size);        in_offset += (unsigned)block_size;        return (int)block_size;    } else {        return 0; /* end of input */    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线视频欧美区| 欧美久久一二三四区| 国产主播一区二区三区| 热久久一区二区| 青青草国产精品97视觉盛宴| 亚洲午夜在线电影| 午夜一区二区三区视频| 亚洲v日本v欧美v久久精品| 亚洲国产日韩a在线播放| 亚洲国产成人tv| 日韩精品免费视频人成| 日韩精品一级二级 | 午夜影视日本亚洲欧洲精品| 亚洲午夜电影网| 婷婷开心久久网| 麻豆久久久久久| 国产精品一区2区| 成人丝袜高跟foot| 99久久精品国产导航| 色婷婷狠狠综合| 欧美性生交片4| 91精品国产91久久久久久一区二区| 69久久99精品久久久久婷婷| 日韩免费视频线观看| 亚洲精品一区二区三区四区高清 | 日韩精品一区二区三区中文不卡 | 这里是久久伊人| 日韩手机在线导航| 久久久久久免费| 国产精品免费网站在线观看| 一区二区视频在线看| 丝袜脚交一区二区| 极品尤物av久久免费看| 丰满白嫩尤物一区二区| 欧美综合一区二区三区| 欧美一区二区三区爱爱| 国产亚洲女人久久久久毛片| 亚洲色图在线播放| 天堂精品中文字幕在线| 国产一区二三区| 91成人网在线| 欧美不卡激情三级在线观看| 中文字幕亚洲在| 日韩精品一级二级 | 欧美人xxxx| 国产免费成人在线视频| 亚洲制服丝袜一区| 国产在线乱码一区二区三区| 91麻豆国产自产在线观看| 日韩视频一区二区三区在线播放| 欧美国产精品劲爆| 视频一区欧美精品| 成人免费黄色大片| 欧美一区二区三区影视| 国产农村妇女毛片精品久久麻豆 | 国产三区在线成人av| 亚洲图片自拍偷拍| 国产成人精品影视| 欧美丰满一区二区免费视频| 国产女人18毛片水真多成人如厕| 午夜精品爽啪视频| 成人av在线网| 精品乱人伦一区二区三区| 亚洲欧美二区三区| 国产乱妇无码大片在线观看| 欧美日韩中字一区| 中文字幕一区二区在线观看| 寂寞少妇一区二区三区| 欧美日韩亚州综合| 亚洲欧洲精品天堂一级| 国产精品中文字幕日韩精品| 欧美日韩久久一区二区| 亚洲欧美在线aaa| 国产一区二区三区在线观看免费 | 欧美激情一区二区三区蜜桃视频| 视频精品一区二区| 色婷婷激情综合| 国产精品视频在线看| 激情图区综合网| 欧美电影一区二区| 亚洲精品国产一区二区三区四区在线| 国产精品亚洲一区二区三区在线| 欧美精三区欧美精三区| 亚洲精品成人精品456| av在线一区二区三区| 久久久久久电影| 国模大尺度一区二区三区| 91精品国产aⅴ一区二区| 亚洲一卡二卡三卡四卡五卡| 91麻豆免费观看| 亚洲视频在线观看一区| 成人黄动漫网站免费app| 国产亚洲精品中文字幕| 韩国一区二区三区| 欧美tk—视频vk| 久久国产精品露脸对白| 日韩精品自拍偷拍| 日本三级亚洲精品| 7777女厕盗摄久久久| 日本一区中文字幕| 在线综合亚洲欧美在线视频| 丝袜美腿亚洲综合| 欧美伦理电影网| 日韩在线卡一卡二| 日韩午夜精品视频| 精品一区二区在线免费观看| 欧美mv和日韩mv的网站| 久久99精品久久久久| 日韩你懂的在线观看| 久久精品国产一区二区| 欧美mv日韩mv国产网站app| 极品少妇一区二区| 久久久亚洲欧洲日产国码αv| 国产麻豆精品在线| 欧美国产精品一区二区三区| 成人aaaa免费全部观看| 亚洲人成影院在线观看| 欧洲精品一区二区| 视频一区中文字幕国产| 精品日韩成人av| 国产精品一区二区免费不卡| 国产精品三级久久久久三级| 91亚洲国产成人精品一区二区三 | 日韩精品欧美成人高清一区二区| 7777精品久久久大香线蕉| 男男成人高潮片免费网站| 欧美精品tushy高清| 久久爱www久久做| 欧美极品美女视频| 色婷婷亚洲婷婷| 日韩高清中文字幕一区| 精品福利视频一区二区三区| 成人网页在线观看| 夜夜揉揉日日人人青青一国产精品| 欧美日韩精品欧美日韩精品| 久久国产生活片100| 久久综合成人精品亚洲另类欧美| 国产.欧美.日韩| 一区二区日韩av| 日韩精品一区二区三区中文不卡| 国产成人精品午夜视频免费 | 成人精品鲁一区一区二区| 亚洲女爱视频在线| 欧美一级专区免费大片| 国产高清精品网站| 亚洲一区二区美女| 久久久国产一区二区三区四区小说| 97久久久精品综合88久久| 天堂一区二区在线| 欧美激情综合五月色丁香小说| 91国在线观看| 国产剧情一区二区| 亚洲午夜免费福利视频| 亚洲精品一区在线观看| 在线视频一区二区免费| 国产一区二区精品久久| 亚洲一区二区综合| 国产欧美一区二区精品性| 欧美图区在线视频| 国产精品夜夜爽| 午夜视频在线观看一区| 国产精品久久久久久久久久久免费看 | 日韩毛片在线免费观看| 日韩欧美中文字幕制服| 91首页免费视频| 激情成人午夜视频| 亚洲第一二三四区| 国产色产综合产在线视频| 欧美二区三区的天堂| 不卡av在线网| 韩国三级电影一区二区| 亚洲成人综合视频| 成人免费一区二区三区在线观看| 欧美一区二区黄| 在线国产电影不卡| 成人精品一区二区三区中文字幕| 日本欧美大码aⅴ在线播放| 亚洲日本韩国一区| 国产亲近乱来精品视频| 日韩三级精品电影久久久| 91久久精品网| 成人一区在线看| 国内精品久久久久影院薰衣草 | 亚洲国产中文字幕| 国产精品夫妻自拍| 久久久不卡网国产精品一区| 91精品国产手机| 欧美中文字幕一区| 99国产精品久久久久久久久久久| 国模少妇一区二区三区| 免费看日韩a级影片| 亚洲综合视频网| 亚洲乱码国产乱码精品精98午夜| 日本一区二区三区在线不卡| 精品久久久久久无| 日韩欧美国产三级| 欧美一区二区高清| 欧美一区二区私人影院日本| 欧美另类一区二区三区| 欧美视频中文字幕|