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

📄 bzip2_8h-source.html

📁 用来介绍ZIG Library游戏网络引擎的文档
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>bzip2.h Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.2.18 --><center><a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; </center><hr><h1>bzip2.h</h1><div class="fragment"><pre>00001 <span class="comment">/*-------------------------------------------------------------*/</span>00002 <span class="comment">/*--- Public header file for the library.                   ---*/</span>00003 <span class="comment">/*---                                               bzlib.h ---*/</span>00004 <span class="comment">/*-------------------------------------------------------------*/</span>00005 00006 <span class="comment">/*--</span>00007 <span class="comment">  This file is a part of bzip2 and/or libbzip2, a program and</span>00008 <span class="comment">  library for lossless, block-sorting data compression.</span>00009 <span class="comment"></span>00010 <span class="comment">  Copyright (C) 1996-2002 Julian R Seward.  All rights reserved.</span>00011 <span class="comment"></span>00012 <span class="comment">  Redistribution and use in source and binary forms, with or without</span>00013 <span class="comment">  modification, are permitted provided that the following conditions</span>00014 <span class="comment">  are met:</span>00015 <span class="comment"></span>00016 <span class="comment">  1. Redistributions of source code must retain the above copyright</span>00017 <span class="comment">     notice, this list of conditions and the following disclaimer.</span>00018 <span class="comment"></span>00019 <span class="comment">  2. The origin of this software must not be misrepresented; you must </span>00020 <span class="comment">     not claim that you wrote the original software.  If you use this </span>00021 <span class="comment">     software in a product, an acknowledgment in the product </span>00022 <span class="comment">     documentation would be appreciated but is not required.</span>00023 <span class="comment"></span>00024 <span class="comment">  3. Altered source versions must be plainly marked as such, and must</span>00025 <span class="comment">     not be misrepresented as being the original software.</span>00026 <span class="comment"></span>00027 <span class="comment">  4. The name of the author may not be used to endorse or promote </span>00028 <span class="comment">     products derived from this software without specific prior written </span>00029 <span class="comment">     permission.</span>00030 <span class="comment"></span>00031 <span class="comment">  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS</span>00032 <span class="comment">  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED</span>00033 <span class="comment">  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span>00034 <span class="comment">  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY</span>00035 <span class="comment">  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL</span>00036 <span class="comment">  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE</span>00037 <span class="comment">  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS</span>00038 <span class="comment">  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,</span>00039 <span class="comment">  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING</span>00040 <span class="comment">  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS</span>00041 <span class="comment">  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span>00042 <span class="comment"></span>00043 <span class="comment">  Julian Seward, Cambridge, UK.</span>00044 <span class="comment">  jseward@acm.org</span>00045 <span class="comment">  bzip2/libbzip2 version 1.0 of 21 March 2000</span>00046 <span class="comment"></span>00047 <span class="comment">  This program is based on (at least) the work of:</span>00048 <span class="comment">     Mike Burrows</span>00049 <span class="comment">     David Wheeler</span>00050 <span class="comment">     Peter Fenwick</span>00051 <span class="comment">     Alistair Moffat</span>00052 <span class="comment">     Radford Neal</span>00053 <span class="comment">     Ian H. Witten</span>00054 <span class="comment">     Robert Sedgewick</span>00055 <span class="comment">     Jon L. Bentley</span>00056 <span class="comment"></span>00057 <span class="comment">  For more information on these sources, see the manual.</span>00058 <span class="comment">--*/</span>00059 00060 <span class="preprocessor">#include "zigdefs.h"</span>00061 <span class="preprocessor">#ifndef ZIG_NO_BZIP2 // don't include BZIP2</span>00062 <span class="preprocessor"></span>00063 <span class="preprocessor">#ifndef _BZLIB_H</span>00064 <span class="preprocessor"></span><span class="preprocessor">#define _BZLIB_H</span>00065 <span class="preprocessor"></span>00066 <span class="preprocessor">#ifdef __cplusplus</span>00067 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> {00068 <span class="preprocessor">#endif</span>00069 <span class="preprocessor"></span>00070 <span class="preprocessor">#define BZ_RUN               0</span>00071 <span class="preprocessor"></span><span class="preprocessor">#define BZ_FLUSH             1</span>00072 <span class="preprocessor"></span><span class="preprocessor">#define BZ_FINISH            2</span>00073 <span class="preprocessor"></span>00074 <span class="preprocessor">#define BZ_OK                0</span>00075 <span class="preprocessor"></span><span class="preprocessor">#define BZ_RUN_OK            1</span>00076 <span class="preprocessor"></span><span class="preprocessor">#define BZ_FLUSH_OK          2</span>00077 <span class="preprocessor"></span><span class="preprocessor">#define BZ_FINISH_OK         3</span>00078 <span class="preprocessor"></span><span class="preprocessor">#define BZ_STREAM_END        4</span>00079 <span class="preprocessor"></span><span class="preprocessor">#define BZ_SEQUENCE_ERROR    (-1)</span>00080 <span class="preprocessor"></span><span class="preprocessor">#define BZ_PARAM_ERROR       (-2)</span>00081 <span class="preprocessor"></span><span class="preprocessor">#define BZ_MEM_ERROR         (-3)</span>00082 <span class="preprocessor"></span><span class="preprocessor">#define BZ_DATA_ERROR        (-4)</span>00083 <span class="preprocessor"></span><span class="preprocessor">#define BZ_DATA_ERROR_MAGIC  (-5)</span>00084 <span class="preprocessor"></span><span class="preprocessor">#define BZ_IO_ERROR          (-6)</span>00085 <span class="preprocessor"></span><span class="preprocessor">#define BZ_UNEXPECTED_EOF    (-7)</span>00086 <span class="preprocessor"></span><span class="preprocessor">#define BZ_OUTBUFF_FULL      (-8)</span>00087 <span class="preprocessor"></span><span class="preprocessor">#define BZ_CONFIG_ERROR      (-9)</span>00088 <span class="preprocessor"></span>00089 <span class="keyword">typedef</span> 00090    <span class="keyword">struct </span>{00091       <span class="keywordtype">char</span> *next_in;00092       <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> avail_in;00093       <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> total_in_lo32;00094       <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> total_in_hi32;00095 00096       <span class="keywordtype">char</span> *next_out;00097       <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> avail_out;00098       <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> total_out_lo32;00099       <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> total_out_hi32;00100 00101       <span class="keywordtype">void</span> *state;00102 00103       <span class="keywordtype">void</span> *(*bzalloc)(<span class="keywordtype">void</span> *,<span class="keywordtype">int</span>,<span class="keywordtype">int</span>);00104       void (*bzfree)(<span class="keywordtype">void</span> *,<span class="keywordtype">void</span> *);00105       <span class="keywordtype">void</span> *opaque;00106    } 00107    bz_stream;00108 00109 00110 <span class="preprocessor">#ifndef BZ_IMPORT</span>00111 <span class="preprocessor"></span><span class="preprocessor">#define BZ_EXPORT</span>00112 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00113 <span class="preprocessor"></span>00114 <span class="comment">/* Need a definitition for FILE */</span>00115 <span class="preprocessor">#include &lt;stdio.h&gt;</span>00116 00117          00118 <span class="preprocessor">#ifdef _WIN32</span>00119 <span class="preprocessor"></span><span class="comment">//#ifdef _DEBUG</span>00120 <span class="comment">//#pragma comment(lib,"BZipLibd")</span>00121 <span class="comment">//#else</span>00122 <span class="comment">//#pragma comment(lib,"BZipLib")</span>00123 <span class="comment">//#endif</span>00124 <span class="preprocessor">#   include &lt;windows.h&gt;</span>00125 <span class="preprocessor">#   ifdef small</span>00126 <span class="preprocessor"></span>      <span class="comment">// windows.h define small to char</span>00127 <span class="preprocessor">#      undef small</span>00128 <span class="preprocessor"></span><span class="preprocessor">#   endif</span>00129 <span class="preprocessor"></span><span class="preprocessor">#   ifdef BZ_EXPORT</span>00130 <span class="preprocessor"></span><span class="preprocessor">#   define BZ_API(func) WINAPI func</span>00131 <span class="preprocessor"></span><span class="preprocessor">#   define BZ_EXTERN extern</span>00132 <span class="preprocessor"></span><span class="preprocessor">#   else</span>00133 <span class="preprocessor"></span>   <span class="comment">// import windows dll dynamically</span>00134 <span class="preprocessor">#   define BZ_API(func) (WINAPI * func)</span>00135 <span class="preprocessor"></span><span class="preprocessor">#   define BZ_EXTERN</span>00136 <span class="preprocessor"></span><span class="preprocessor">#   endif</span>00137 <span class="preprocessor"></span><span class="preprocessor">#else</span>00138 <span class="preprocessor"></span><span class="preprocessor">#   define BZ_API(func) func</span>00139 <span class="preprocessor"></span><span class="preprocessor">#   define BZ_EXTERN extern</span>00140 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00141 <span class="preprocessor"></span>00142 00143 <span class="comment">/*-- Core (low-level) library functions --*/</span>00144 00145 BZ_EXTERN <span class="keywordtype">int</span> BZ_API(BZ2_bzCompressInit) ( 00146       bz_stream* strm, 00147       <span class="keywordtype">int</span>        blockSize100k, 00148       <span class="keywordtype">int</span>        verbosity, 00149       <span class="keywordtype">int</span>        workFactor 00150    );00151 00152 BZ_EXTERN <span class="keywordtype">int</span> BZ_API(BZ2_bzCompress) ( 00153       bz_stream* strm, 00154       <span class="keywordtype">int</span> action 00155    );00156 00157 BZ_EXTERN <span class="keywordtype">int</span> BZ_API(BZ2_bzCompressEnd) ( 00158       bz_stream* strm 00159    );00160 00161 BZ_EXTERN <span class="keywordtype">int</span> BZ_API(BZ2_bzDecompressInit) ( 00162       bz_stream *strm, 00163       <span class="keywordtype">int</span>       verbosity, 

⌨️ 快捷键说明

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