]> git.pld-linux.org Git - packages/bzip2.git/blob - bzip2-libtoolizeautoconf.patch
6c3f2e7a18cf4ebb0830fc40e3cb56361693964a
[packages/bzip2.git] / bzip2-libtoolizeautoconf.patch
1 diff -Nru bzip2-1.0.1/AUTHORS bzip2-1.0.1.new/AUTHORS
2 --- bzip2-1.0.1/AUTHORS Thu Jan  1 01:00:00 1970
3 +++ bzip2-1.0.1.new/AUTHORS     Sat Jun 24 20:13:05 2000
4 @@ -0,0 +1 @@
5 +Julian Seward <jseward@acm.org>
6 diff -Nru bzip2-1.0.1/CHANGES bzip2-1.0.1.new/CHANGES
7 --- bzip2-1.0.1/CHANGES Sat Jun 24 20:13:27 2000
8 +++ bzip2-1.0.1.new/CHANGES     Thu Jan  1 01:00:00 1970
9 @@ -1,167 +0,0 @@
10 -
11 -
12 -0.9.0
13 -~~~~~
14 -First version.
15 -
16 -
17 -0.9.0a
18 -~~~~~~
19 -Removed 'ranlib' from Makefile, since most modern Unix-es 
20 -don't need it, or even know about it.
21 -
22 -
23 -0.9.0b
24 -~~~~~~
25 -Fixed a problem with error reporting in bzip2.c.  This does not effect
26 -the library in any way.  Problem is: versions 0.9.0 and 0.9.0a (of the
27 -program proper) compress and decompress correctly, but give misleading
28 -error messages (internal panics) when an I/O error occurs, instead of
29 -reporting the problem correctly.  This shouldn't give any data loss
30 -(as far as I can see), but is confusing.
31 -
32 -Made the inline declarations disappear for non-GCC compilers.
33 -
34 -
35 -0.9.0c
36 -~~~~~~
37 -Fixed some problems in the library pertaining to some boundary cases.
38 -This makes the library behave more correctly in those situations.  The
39 -fixes apply only to features (calls and parameters) not used by
40 -bzip2.c, so the non-fixedness of them in previous versions has no
41 -effect on reliability of bzip2.c.
42 -
43 -In bzlib.c:
44 -   * made zero-length BZ_FLUSH work correctly in bzCompress().
45 -   * fixed bzWrite/bzRead to ignore zero-length requests.
46 -   * fixed bzread to correctly handle read requests after EOF.
47 -   * wrong parameter order in call to bzDecompressInit in
48 -     bzBuffToBuffDecompress.  Fixed.
49 -
50 -In compress.c:
51 -   * changed setting of nGroups in sendMTFValues() so as to 
52 -     do a bit better on small files.  This _does_ effect
53 -     bzip2.c.
54 -
55 -
56 -0.9.5a
57 -~~~~~~
58 -Major change: add a fallback sorting algorithm (blocksort.c)
59 -to give reasonable behaviour even for very repetitive inputs.
60 -Nuked --repetitive-best and --repetitive-fast since they are
61 -no longer useful.
62 -
63 -Minor changes: mostly a whole bunch of small changes/
64 -bugfixes in the driver (bzip2.c).  Changes pertaining to the
65 -user interface are:
66 -
67 -   allow decompression of symlink'd files to stdout
68 -   decompress/test files even without .bz2 extension
69 -   give more accurate error messages for I/O errors
70 -   when compressing/decompressing to stdout, don't catch control-C
71 -   read flags from BZIP2 and BZIP environment variables
72 -   decline to break hard links to a file unless forced with -f
73 -   allow -c flag even with no filenames
74 -   preserve file ownerships as far as possible
75 -   make -s -1 give the expected block size (100k)
76 -   add a flag -q --quiet to suppress nonessential warnings
77 -   stop decoding flags after --, so files beginning in - can be handled
78 -   resolved inconsistent naming: bzcat or bz2cat ?
79 -   bzip2 --help now returns 0
80 -
81 -Programming-level changes are:
82 -
83 -   fixed syntax error in GET_LL4 for Borland C++ 5.02
84 -   let bzBuffToBuffDecompress return BZ_DATA_ERROR{_MAGIC}
85 -   fix overshoot of mode-string end in bzopen_or_bzdopen
86 -   wrapped bzlib.h in #ifdef __cplusplus ... extern "C" { ... }
87 -   close file handles under all error conditions
88 -   added minor mods so it compiles with DJGPP out of the box
89 -   fixed Makefile so it doesn't give problems with BSD make
90 -   fix uninitialised memory reads in dlltest.c
91 -
92 -0.9.5b
93 -~~~~~~
94 -Open stdin/stdout in binary mode for DJGPP.
95 -
96 -0.9.5c
97 -~~~~~~
98 -Changed BZ_N_OVERSHOOT to be ... + 2 instead of ... + 1.  The + 1
99 -version could cause the sorted order to be wrong in some extremely
100 -obscure cases.  Also changed setting of quadrant in blocksort.c.
101 -
102 -0.9.5d
103 -~~~~~~
104 -The only functional change is to make bzlibVersion() in the library
105 -return the correct string.  This has no effect whatsoever on the
106 -functioning of the bzip2 program or library.  Added a couple of casts
107 -so the library compiles without warnings at level 3 in MS Visual
108 -Studio 6.0.  Included a Y2K statement in the file Y2K_INFO.  All other
109 -changes are minor documentation changes.
110 -
111 -1.0
112 -~~~
113 -Several minor bugfixes and enhancements:
114 -
115 -* Large file support.  The library uses 64-bit counters to
116 -  count the volume of data passing through it.  bzip2.c 
117 -  is now compiled with -D_FILE_OFFSET_BITS=64 to get large
118 -  file support from the C library.  -v correctly prints out
119 -  file sizes greater than 4 gigabytes.  All these changes have
120 -  been made without assuming a 64-bit platform or a C compiler
121 -  which supports 64-bit ints, so, except for the C library
122 -  aspect, they are fully portable.
123 -
124 -* Decompression robustness.  The library/program should be
125 -  robust to any corruption of compressed data, detecting and
126 -  handling _all_ corruption, instead of merely relying on
127 -  the CRCs.  What this means is that the program should 
128 -  never crash, given corrupted data, and the library should
129 -  always return BZ_DATA_ERROR.
130 -
131 -* Fixed an obscure race-condition bug only ever observed on
132 -  Solaris, in which, if you were very unlucky and issued
133 -  control-C at exactly the wrong time, both input and output
134 -  files would be deleted.
135 -
136 -* Don't run out of file handles on test/decompression when
137 -  large numbers of files have invalid magic numbers.
138 -
139 -* Avoid library namespace pollution.  Prefix all exported 
140 -  symbols with BZ2_.
141 -
142 -* Minor sorting enhancements from my DCC2000 paper.
143 -
144 -* Advance the version number to 1.0, so as to counteract the
145 -  (false-in-this-case) impression some people have that programs 
146 -  with version numbers less than 1.0 are in someway, experimental,
147 -  pre-release versions.
148 -
149 -* Create an initial Makefile-libbz2_so to build a shared library.
150 -  Yes, I know I should really use libtool et al ...
151 -
152 -* Make the program exit with 2 instead of 0 when decompression
153 -  fails due to a bad magic number (ie, an invalid bzip2 header).
154 -  Also exit with 1 (as the manual claims :-) whenever a diagnostic
155 -  message would have been printed AND the corresponding operation 
156 -  is aborted, for example
157 -     bzip2: Output file xx already exists.
158 -  When a diagnostic message is printed but the operation is not 
159 -  aborted, for example
160 -     bzip2: Can't guess original name for wurble -- using wurble.out
161 -  then the exit value 0 is returned, unless some other problem is
162 -  also detected.
163 -
164 -  I think it corresponds more closely to what the manual claims now.
165 -
166 -
167 -1.0.1
168 -~~~~~
169 -* Modified dlltest.c so it uses the new BZ2_ naming scheme.
170 -* Modified makefile-msc to fix minor build probs on Win2k.
171 -* Updated README.COMPILATION.PROBLEMS.
172 -
173 -There are no functionality changes or bug fixes relative to version
174 -1.0.0.  This is just a documentation update + a fix for minor Win32
175 -build problems.  For almost everyone, upgrading from 1.0.0 to 1.0.1 is
176 -utterly pointless.  Don't bother.
177 diff -Nru bzip2-1.0.1/COPYING bzip2-1.0.1.new/COPYING
178 --- bzip2-1.0.1/COPYING Thu Jan  1 01:00:00 1970
179 +++ bzip2-1.0.1.new/COPYING     Sat Jun 24 20:13:05 2000
180 @@ -0,0 +1,39 @@
181 +
182 +This program, "bzip2" and associated library "libbzip2", are
183 +copyright (C) 1996-2000 Julian R Seward.  All rights reserved.
184 +
185 +Redistribution and use in source and binary forms, with or without
186 +modification, are permitted provided that the following conditions
187 +are met:
188 +
189 +1. Redistributions of source code must retain the above copyright
190 +   notice, this list of conditions and the following disclaimer.
191 +
192 +2. The origin of this software must not be misrepresented; you must 
193 +   not claim that you wrote the original software.  If you use this 
194 +   software in a product, an acknowledgment in the product 
195 +   documentation would be appreciated but is not required.
196 +
197 +3. Altered source versions must be plainly marked as such, and must
198 +   not be misrepresented as being the original software.
199 +
200 +4. The name of the author may not be used to endorse or promote 
201 +   products derived from this software without specific prior written 
202 +   permission.
203 +
204 +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
205 +OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
206 +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
207 +ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
208 +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
209 +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
210 +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
211 +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
212 +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
213 +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
214 +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
215 +
216 +Julian Seward, Cambridge, UK.
217 +jseward@acm.org
218 +bzip2/libbzip2 version 1.0 of 21 March 2000
219 +
220 diff -Nru bzip2-1.0.1/ChangeLog bzip2-1.0.1.new/ChangeLog
221 --- bzip2-1.0.1/ChangeLog       Thu Jan  1 01:00:00 1970
222 +++ bzip2-1.0.1.new/ChangeLog   Sat Jun 24 20:13:05 2000
223 @@ -0,0 +1 @@
224 +
225 diff -Nru bzip2-1.0.1/INSTALL bzip2-1.0.1.new/INSTALL
226 --- bzip2-1.0.1/INSTALL Thu Jan  1 01:00:00 1970
227 +++ bzip2-1.0.1.new/INSTALL     Sat Jun 24 20:13:06 2000
228 @@ -0,0 +1,182 @@
229 +Basic Installation
230 +==================
231 +
232 +   These are generic installation instructions.
233 +
234 +   The `configure' shell script attempts to guess correct values for
235 +various system-dependent variables used during compilation.  It uses
236 +those values to create a `Makefile' in each directory of the package.
237 +It may also create one or more `.h' files containing system-dependent
238 +definitions.  Finally, it creates a shell script `config.status' that
239 +you can run in the future to recreate the current configuration, a file
240 +`config.cache' that saves the results of its tests to speed up
241 +reconfiguring, and a file `config.log' containing compiler output
242 +(useful mainly for debugging `configure').
243 +
244 +   If you need to do unusual things to compile the package, please try
245 +to figure out how `configure' could check whether to do them, and mail
246 +diffs or instructions to the address given in the `README' so they can
247 +be considered for the next release.  If at some point `config.cache'
248 +contains results you don't want to keep, you may remove or edit it.
249 +
250 +   The file `configure.in' is used to create `configure' by a program
251 +called `autoconf'.  You only need `configure.in' if you want to change
252 +it or regenerate `configure' using a newer version of `autoconf'.
253 +
254 +The simplest way to compile this package is:
255 +
256 +  1. `cd' to the directory containing the package's source code and type
257 +     `./configure' to configure the package for your system.  If you're
258 +     using `csh' on an old version of System V, you might need to type
259 +     `sh ./configure' instead to prevent `csh' from trying to execute
260 +     `configure' itself.
261 +
262 +     Running `configure' takes awhile.  While running, it prints some
263 +     messages telling which features it is checking for.
264 +
265 +  2. Type `make' to compile the package.
266 +
267 +  3. Optionally, type `make check' to run any self-tests that come with
268 +     the package.
269 +
270 +  4. Type `make install' to install the programs and any data files and
271 +     documentation.
272 +
273 +  5. You can remove the program binaries and object files from the
274 +     source code directory by typing `make clean'.  To also remove the
275 +     files that `configure' created (so you can compile the package for
276 +     a different kind of computer), type `make distclean'.  There is
277 +     also a `make maintainer-clean' target, but that is intended mainly
278 +     for the package's developers.  If you use it, you may have to get
279 +     all sorts of other programs in order to regenerate files that came
280 +     with the distribution.
281 +
282 +Compilers and Options
283 +=====================
284 +
285 +   Some systems require unusual options for compilation or linking that
286 +the `configure' script does not know about.  You can give `configure'
287 +initial values for variables by setting them in the environment.  Using
288 +a Bourne-compatible shell, you can do that on the command line like
289 +this:
290 +     CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
291 +
292 +Or on systems that have the `env' program, you can do it like this:
293 +     env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
294 +
295 +Compiling For Multiple Architectures
296 +====================================
297 +
298 +   You can compile the package for more than one kind of computer at the
299 +same time, by placing the object files for each architecture in their
300 +own directory.  To do this, you must use a version of `make' that
301 +supports the `VPATH' variable, such as GNU `make'.  `cd' to the
302 +directory where you want the object files and executables to go and run
303 +the `configure' script.  `configure' automatically checks for the
304 +source code in the directory that `configure' is in and in `..'.
305 +
306 +   If you have to use a `make' that does not supports the `VPATH'
307 +variable, you have to compile the package for one architecture at a time
308 +in the source code directory.  After you have installed the package for
309 +one architecture, use `make distclean' before reconfiguring for another
310 +architecture.
311 +
312 +Installation Names
313 +==================
314 +
315 +   By default, `make install' will install the package's files in
316 +`/usr/local/bin', `/usr/local/man', etc.  You can specify an
317 +installation prefix other than `/usr/local' by giving `configure' the
318 +option `--prefix=PATH'.
319 +
320 +   You can specify separate installation prefixes for
321 +architecture-specific files and architecture-independent files.  If you
322 +give `configure' the option `--exec-prefix=PATH', the package will use
323 +PATH as the prefix for installing programs and libraries.
324 +Documentation and other data files will still use the regular prefix.
325 +
326 +   In addition, if you use an unusual directory layout you can give
327 +options like `--bindir=PATH' to specify different values for particular
328 +kinds of files.  Run `configure --help' for a list of the directories
329 +you can set and what kinds of files go in them.
330 +
331 +   If the package supports it, you can cause programs to be installed
332 +with an extra prefix or suffix on their names by giving `configure' the
333 +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
334 +
335 +Optional Features
336 +=================
337 +
338 +   Some packages pay attention to `--enable-FEATURE' options to
339 +`configure', where FEATURE indicates an optional part of the package.
340 +They may also pay attention to `--with-PACKAGE' options, where PACKAGE
341 +is something like `gnu-as' or `x' (for the X Window System).  The
342 +`README' should mention any `--enable-' and `--with-' options that the
343 +package recognizes.
344 +
345 +   For packages that use the X Window System, `configure' can usually
346 +find the X include and library files automatically, but if it doesn't,
347 +you can use the `configure' options `--x-includes=DIR' and
348 +`--x-libraries=DIR' to specify their locations.
349 +
350 +Specifying the System Type
351 +==========================
352 +
353 +   There may be some features `configure' can not figure out
354 +automatically, but needs to determine by the type of host the package
355 +will run on.  Usually `configure' can figure that out, but if it prints
356 +a message saying it can not guess the host type, give it the
357 +`--host=TYPE' option.  TYPE can either be a short name for the system
358 +type, such as `sun4', or a canonical name with three fields:
359 +     CPU-COMPANY-SYSTEM
360 +
361 +See the file `config.sub' for the possible values of each field.  If
362 +`config.sub' isn't included in this package, then this package doesn't
363 +need to know the host type.
364 +
365 +   If you are building compiler tools for cross-compiling, you can also
366 +use the `--target=TYPE' option to select the type of system they will
367 +produce code for and the `--build=TYPE' option to select the type of
368 +system on which you are compiling the package.
369 +
370 +Sharing Defaults
371 +================
372 +
373 +   If you want to set default values for `configure' scripts to share,
374 +you can create a site shell script called `config.site' that gives
375 +default values for variables like `CC', `cache_file', and `prefix'.
376 +`configure' looks for `PREFIX/share/config.site' if it exists, then
377 +`PREFIX/etc/config.site' if it exists.  Or, you can set the
378 +`CONFIG_SITE' environment variable to the location of the site script.
379 +A warning: not all `configure' scripts look for a site script.
380 +
381 +Operation Controls
382 +==================
383 +
384 +   `configure' recognizes the following options to control how it
385 +operates.
386 +
387 +`--cache-file=FILE'
388 +     Use and save the results of the tests in FILE instead of
389 +     `./config.cache'.  Set FILE to `/dev/null' to disable caching, for
390 +     debugging `configure'.
391 +
392 +`--help'
393 +     Print a summary of the options to `configure', and exit.
394 +
395 +`--quiet'
396 +`--silent'
397 +`-q'
398 +     Do not print messages saying which checks are being made.  To
399 +     suppress all normal output, redirect it to `/dev/null' (any error
400 +     messages will still be shown).
401 +
402 +`--srcdir=DIR'
403 +     Look for the package's source code in directory DIR.  Usually
404 +     `configure' can determine that directory automatically.
405 +
406 +`--version'
407 +     Print the version of Autoconf used to generate the `configure'
408 +     script, and exit.
409 +
410 +`configure' also accepts some other, not widely useful, options.
411 diff -Nru bzip2-1.0.1/LICENSE bzip2-1.0.1.new/LICENSE
412 --- bzip2-1.0.1/LICENSE Sat Jun 24 20:13:27 2000
413 +++ bzip2-1.0.1.new/LICENSE     Thu Jan  1 01:00:00 1970
414 @@ -1,39 +0,0 @@
415 -
416 -This program, "bzip2" and associated library "libbzip2", are
417 -copyright (C) 1996-2000 Julian R Seward.  All rights reserved.
418 -
419 -Redistribution and use in source and binary forms, with or without
420 -modification, are permitted provided that the following conditions
421 -are met:
422 -
423 -1. Redistributions of source code must retain the above copyright
424 -   notice, this list of conditions and the following disclaimer.
425 -
426 -2. The origin of this software must not be misrepresented; you must 
427 -   not claim that you wrote the original software.  If you use this 
428 -   software in a product, an acknowledgment in the product 
429 -   documentation would be appreciated but is not required.
430 -
431 -3. Altered source versions must be plainly marked as such, and must
432 -   not be misrepresented as being the original software.
433 -
434 -4. The name of the author may not be used to endorse or promote 
435 -   products derived from this software without specific prior written 
436 -   permission.
437 -
438 -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
439 -OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
440 -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
441 -ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
442 -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
443 -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
444 -GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
445 -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
446 -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
447 -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
448 -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
449 -
450 -Julian Seward, Cambridge, UK.
451 -jseward@acm.org
452 -bzip2/libbzip2 version 1.0 of 21 March 2000
453 -
454 diff -Nru bzip2-1.0.1/Makefile-libbz2_so bzip2-1.0.1.new/Makefile-libbz2_so
455 --- bzip2-1.0.1/Makefile-libbz2_so      Sat Jun 24 20:13:27 2000
456 +++ bzip2-1.0.1.new/Makefile-libbz2_so  Thu Jan  1 01:00:00 1970
457 @@ -1,43 +0,0 @@
458 -
459 -# This Makefile builds a shared version of the library, 
460 -# libbz2.so.1.0.1, with soname libbz2.so.1.0,
461 -# at least on x86-Linux (RedHat 5.2), 
462 -# with gcc-2.7.2.3.  Please see the README file for some 
463 -# important info about building the library like this.
464 -
465 -SHELL=/bin/sh
466 -CC=gcc
467 -BIGFILES=-D_FILE_OFFSET_BITS=64
468 -CFLAGS=-fpic -fPIC -Wall -Winline -O2 -fomit-frame-pointer -fno-strength-reduce $(BIGFILES)
469 -
470 -OBJS= blocksort.o  \
471 -      huffman.o    \
472 -      crctable.o   \
473 -      randtable.o  \
474 -      compress.o   \
475 -      decompress.o \
476 -      bzlib.o
477 -
478 -all: $(OBJS)
479 -       $(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.1 $(OBJS)
480 -       $(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.1
481 -       rm -f libbz2.so.1.0
482 -       ln -s libbz2.so.1.0.1 libbz2.so.1.0
483 -
484 -clean: 
485 -       rm -f $(OBJS) bzip2.o libbz2.so.1.0.1 libbz2.so.1.0 bzip2-shared
486 -
487 -blocksort.o: blocksort.c
488 -       $(CC) $(CFLAGS) -c blocksort.c
489 -huffman.o: huffman.c
490 -       $(CC) $(CFLAGS) -c huffman.c
491 -crctable.o: crctable.c
492 -       $(CC) $(CFLAGS) -c crctable.c
493 -randtable.o: randtable.c
494 -       $(CC) $(CFLAGS) -c randtable.c
495 -compress.o: compress.c
496 -       $(CC) $(CFLAGS) -c compress.c
497 -decompress.o: decompress.c
498 -       $(CC) $(CFLAGS) -c decompress.c
499 -bzlib.o: bzlib.c
500 -       $(CC) $(CFLAGS) -c bzlib.c
501 diff -Nru bzip2-1.0.1/Makefile.am bzip2-1.0.1.new/Makefile.am
502 --- bzip2-1.0.1/Makefile.am     Thu Jan  1 01:00:00 1970
503 +++ bzip2-1.0.1.new/Makefile.am Sat Jun 24 20:17:47 2000
504 @@ -0,0 +1,31 @@
505 +SUBDIRS                = doc
506 +
507 +bin_PROGRAMS   = bzip2 bzip2recover 
508 +bzip2_SOURCES  = bzip2.c
509 +
510 +bzip2_LDADD            =  libbz2.la
511 +bzip2recover_SOURCES   = bzip2recover.c
512 +lib_LTLIBRARIES                = libbz2.la
513 +libbz2_la_SOURCES = \
514 +       blocksort.c \
515 +       huffman.c \
516 +       crctable.c \
517 +       randtable.c \
518 +       compress.c \
519 +       decompress.c \
520 +       bzlib.c \
521 +       bzlib.h \
522 +       bzlib_private.h
523 +
524 +libbz2_la_LDFLAGS      = -version-info 1:0:0
525 +include_HEADERS                = bzlib.h bzlib_private.h
526 +
527 +bzip2SCRIPTS           = bzless
528 +
529 +EXTRA_DIST = README README.COMPILATION.PROBLEMS \
530 +       Y2K_INFO libbz2.def libbz2.dsp \
531 +       sample1.bz2 sample1.ref sample2.bz2 sample2.ref sample3.bz2 sample3.ref
532 +
533 +install-exec-hook:
534 +       $(LN_S) -f bzip2 $(DESTDIR)$(bindir)/bunzip2
535 +       $(LN_S) -f bzip2 $(DESTDIR)$(bindir)/bzcat
536 diff -Nru bzip2-1.0.1/NEWS bzip2-1.0.1.new/NEWS
537 --- bzip2-1.0.1/NEWS    Thu Jan  1 01:00:00 1970
538 +++ bzip2-1.0.1.new/NEWS        Sat Jun 24 20:13:06 2000
539 @@ -0,0 +1,12 @@
540 +
541 +
542 +1.0.1
543 +~~~~~
544 +* Modified dlltest.c so it uses the new BZ2_ naming scheme.
545 +* Modified makefile-msc to fix minor build probs on Win2k.
546 +* Updated README.COMPILATION.PROBLEMS.
547 +
548 +There are no functionality changes or bug fixes relative to version
549 +1.0.0.  This is just a documentation update + a fix for minor Win32
550 +build problems.  For almost everyone, upgrading from 1.0.0 to 1.0.1 is
551 +utterly pointless.  Don't bother.
552 diff -Nru bzip2-1.0.1/acinclude.m4 bzip2-1.0.1.new/acinclude.m4
553 --- bzip2-1.0.1/acinclude.m4    Thu Jan  1 01:00:00 1970
554 +++ bzip2-1.0.1.new/acinclude.m4        Sat Jun 24 20:13:06 2000
555 @@ -0,0 +1,129 @@
556 +#serial 7
557 +
558 +dnl By default, many hosts won't let programs access large files;
559 +dnl one must use special compiler options to get large-file access to work.
560 +dnl For more details about this brain damage please see:
561 +dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
562 +
563 +dnl Written by Paul Eggert <eggert@twinsun.com>.
564 +
565 +dnl Internal subroutine of AC_SYS_LARGEFILE.
566 +dnl AC_SYS_LARGEFILE_FLAGS(FLAGSNAME)
567 +AC_DEFUN(AC_SYS_LARGEFILE_FLAGS,
568 +  [AC_CACHE_CHECK([for $1 value to request large file support],
569 +     ac_cv_sys_largefile_$1,
570 +     [if ($GETCONF LFS_$1) >conftest.1 2>conftest.2 && test ! -s conftest.2
571 +      then
572 +        ac_cv_sys_largefile_$1=`cat conftest.1`
573 +      else
574 +       ac_cv_sys_largefile_$1=no
575 +       ifelse($1, CFLAGS,
576 +         [case "$host_os" in
577 +          # HP-UX 10.20 requires -D__STDC_EXT__ with gcc 2.95.1.
578 +changequote(, )dnl
579 +          hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
580 +changequote([, ])dnl
581 +            if test "$GCC" = yes; then
582 +              ac_cv_sys_largefile_CFLAGS=-D__STDC_EXT__
583 +            fi
584 +            ;;
585 +          # IRIX 6.2 and later require cc -n32.
586 +changequote(, )dnl
587 +          irix6.[2-9]* | irix6.1[0-9]* | irix[7-9].* | irix[1-9][0-9]*)
588 +changequote([, ])dnl
589 +            if test "$GCC" != yes; then
590 +              ac_cv_sys_largefile_CFLAGS=-n32
591 +            fi
592 +          esac
593 +          if test "$ac_cv_sys_largefile_CFLAGS" != no; then
594 +            ac_save_CC="$CC"
595 +            CC="$CC $ac_cv_sys_largefile_CFLAGS"
596 +            AC_TRY_LINK(, , , ac_cv_sys_largefile_CFLAGS=no)
597 +            CC="$ac_save_CC"
598 +          fi])
599 +      fi
600 +      rm -f conftest*])])
601 +
602 +dnl Internal subroutine of AC_SYS_LARGEFILE.
603 +dnl AC_SYS_LARGEFILE_SPACE_APPEND(VAR, VAL)
604 +AC_DEFUN(AC_SYS_LARGEFILE_SPACE_APPEND,
605 +  [case $2 in
606 +   no) ;;
607 +   ?*)
608 +     case "[$]$1" in
609 +     '') $1=$2 ;;
610 +     *) $1=[$]$1' '$2 ;;
611 +     esac ;;
612 +   esac])
613 +
614 +dnl Internal subroutine of AC_SYS_LARGEFILE.
615 +dnl AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, CACHE-VAR, COMMENT, CODE-TO-SET-DEFAULT)
616 +AC_DEFUN(AC_SYS_LARGEFILE_MACRO_VALUE,
617 +  [AC_CACHE_CHECK([for $1], $2,
618 +     [$2=no
619 +changequote(, )dnl
620 +      $4
621 +      for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do
622 +       case "$ac_flag" in
623 +       -D$1)
624 +         $2=1 ;;
625 +       -D$1=*)
626 +         $2=`expr " $ac_flag" : '[^=]*=\(.*\)'` ;;
627 +       esac
628 +      done
629 +changequote([, ])dnl
630 +      ])
631 +   if test "[$]$2" != no; then
632 +     AC_DEFINE_UNQUOTED([$1], [$]$2, [$3])
633 +   fi])
634 +
635 +AC_DEFUN(AC_SYS_LARGEFILE,
636 +  [AC_REQUIRE([AC_CANONICAL_HOST])
637 +   AC_ARG_ENABLE(largefile,
638 +     [  --disable-largefile     omit support for large files])
639 +   if test "$enable_largefile" != no; then
640 +     AC_CHECK_TOOL(GETCONF, getconf)
641 +     AC_SYS_LARGEFILE_FLAGS(CFLAGS)
642 +     AC_SYS_LARGEFILE_FLAGS(LDFLAGS)
643 +     AC_SYS_LARGEFILE_FLAGS(LIBS)
644 +
645 +     for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do
646 +       case "$ac_flag" in
647 +       no) ;;
648 +       -D_FILE_OFFSET_BITS=*) ;;
649 +       -D_LARGEFILE_SOURCE | -D_LARGEFILE_SOURCE=*) ;;
650 +       -D_LARGE_FILES | -D_LARGE_FILES=*) ;;
651 +       -D?* | -I?*)
652 +        AC_SYS_LARGEFILE_SPACE_APPEND(CPPFLAGS, "$ac_flag") ;;
653 +       *)
654 +        AC_SYS_LARGEFILE_SPACE_APPEND(CFLAGS, "$ac_flag") ;;
655 +       esac
656 +     done
657 +     AC_SYS_LARGEFILE_SPACE_APPEND(LDFLAGS, "$ac_cv_sys_largefile_LDFLAGS")
658 +     AC_SYS_LARGEFILE_SPACE_APPEND(LIBS, "$ac_cv_sys_largefile_LIBS")
659 +     AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS,
660 +       ac_cv_sys_file_offset_bits,
661 +       [Number of bits in a file offset, on hosts where this is settable.],
662 +       [case "$host_os" in
663 +       # HP-UX 10.20 and later
664 +       hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
665 +         ac_cv_sys_file_offset_bits=64 ;;
666 +       esac])
667 +     AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE,
668 +       ac_cv_sys_largefile_source,
669 +       [Define to make fseeko etc. visible, on some hosts.],
670 +       [case "$host_os" in
671 +       # HP-UX 10.20 and later
672 +       hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
673 +         ac_cv_sys_largefile_source=1 ;;
674 +       esac])
675 +     AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES,
676 +       ac_cv_sys_large_files,
677 +       [Define for large files, on AIX-style hosts.],
678 +       [case "$host_os" in
679 +       # AIX 4.2 and later
680 +       aix4.[2-9]* | aix4.1[0-9]* | aix[5-9].* | aix[1-9][0-9]*)
681 +         ac_cv_sys_large_files=1 ;;
682 +       esac])
683 +   fi
684 +  ])
685 diff -Nru bzip2-1.0.1/bzip2.1 bzip2-1.0.1.new/bzip2.1
686 --- bzip2-1.0.1/bzip2.1 Sat Jun 24 20:13:27 2000
687 +++ bzip2-1.0.1.new/bzip2.1     Thu Jan  1 01:00:00 1970
688 @@ -1,439 +0,0 @@
689 -.PU
690 -.TH bzip2 1
691 -.SH NAME
692 -bzip2, bunzip2 \- a block-sorting file compressor, v1.0
693 -.br
694 -bzcat \- decompresses files to stdout
695 -.br
696 -bzip2recover \- recovers data from damaged bzip2 files
697 -
698 -.SH SYNOPSIS
699 -.ll +8
700 -.B bzip2
701 -.RB [ " \-cdfkqstvzVL123456789 " ]
702 -[
703 -.I "filenames \&..."
704 -]
705 -.ll -8
706 -.br
707 -.B bunzip2
708 -.RB [ " \-fkvsVL " ]
709 -[ 
710 -.I "filenames \&..."
711 -]
712 -.br
713 -.B bzcat
714 -.RB [ " \-s " ]
715 -[ 
716 -.I "filenames \&..."
717 -]
718 -.br
719 -.B bzip2recover
720 -.I "filename"
721 -
722 -.SH DESCRIPTION
723 -.I bzip2
724 -compresses files using the Burrows-Wheeler block sorting
725 -text compression algorithm, and Huffman coding.  Compression is
726 -generally considerably better than that achieved by more conventional
727 -LZ77/LZ78-based compressors, and approaches the performance of the PPM
728 -family of statistical compressors.
729 -
730 -The command-line options are deliberately very similar to 
731 -those of 
732 -.I GNU gzip, 
733 -but they are not identical.
734 -
735 -.I bzip2
736 -expects a list of file names to accompany the
737 -command-line flags.  Each file is replaced by a compressed version of
738 -itself, with the name "original_name.bz2".  
739 -Each compressed file
740 -has the same modification date, permissions, and, when possible,
741 -ownership as the corresponding original, so that these properties can
742 -be correctly restored at decompression time.  File name handling is
743 -naive in the sense that there is no mechanism for preserving original
744 -file names, permissions, ownerships or dates in filesystems which lack
745 -these concepts, or have serious file name length restrictions, such as
746 -MS-DOS.
747 -
748 -.I bzip2
749 -and
750 -.I bunzip2
751 -will by default not overwrite existing
752 -files.  If you want this to happen, specify the \-f flag.
753 -
754 -If no file names are specified,
755 -.I bzip2
756 -compresses from standard
757 -input to standard output.  In this case,
758 -.I bzip2
759 -will decline to
760 -write compressed output to a terminal, as this would be entirely
761 -incomprehensible and therefore pointless.
762 -
763 -.I bunzip2
764 -(or
765 -.I bzip2 \-d) 
766 -decompresses all
767 -specified files.  Files which were not created by 
768 -.I bzip2
769 -will be detected and ignored, and a warning issued.  
770 -.I bzip2
771 -attempts to guess the filename for the decompressed file 
772 -from that of the compressed file as follows:
773 -
774 -       filename.bz2    becomes   filename
775 -       filename.bz     becomes   filename
776 -       filename.tbz2   becomes   filename.tar
777 -       filename.tbz    becomes   filename.tar
778 -       anyothername    becomes   anyothername.out
779 -
780 -If the file does not end in one of the recognised endings, 
781 -.I .bz2, 
782 -.I .bz, 
783 -.I .tbz2
784 -or
785 -.I .tbz, 
786 -.I bzip2 
787 -complains that it cannot
788 -guess the name of the original file, and uses the original name
789 -with
790 -.I .out
791 -appended.
792 -
793 -As with compression, supplying no
794 -filenames causes decompression from 
795 -standard input to standard output.
796 -
797 -.I bunzip2 
798 -will correctly decompress a file which is the
799 -concatenation of two or more compressed files.  The result is the
800 -concatenation of the corresponding uncompressed files.  Integrity
801 -testing (\-t) 
802 -of concatenated 
803 -compressed files is also supported.
804 -
805 -You can also compress or decompress files to the standard output by
806 -giving the \-c flag.  Multiple files may be compressed and
807 -decompressed like this.  The resulting outputs are fed sequentially to
808 -stdout.  Compression of multiple files 
809 -in this manner generates a stream
810 -containing multiple compressed file representations.  Such a stream
811 -can be decompressed correctly only by
812 -.I bzip2 
813 -version 0.9.0 or
814 -later.  Earlier versions of
815 -.I bzip2
816 -will stop after decompressing
817 -the first file in the stream.
818 -
819 -.I bzcat
820 -(or
821 -.I bzip2 -dc) 
822 -decompresses all specified files to
823 -the standard output.
824 -
825 -.I bzip2
826 -will read arguments from the environment variables
827 -.I BZIP2
828 -and
829 -.I BZIP,
830 -in that order, and will process them
831 -before any arguments read from the command line.  This gives a 
832 -convenient way to supply default arguments.
833 -
834 -Compression is always performed, even if the compressed 
835 -file is slightly
836 -larger than the original.  Files of less than about one hundred bytes
837 -tend to get larger, since the compression mechanism has a constant
838 -overhead in the region of 50 bytes.  Random data (including the output
839 -of most file compressors) is coded at about 8.05 bits per byte, giving
840 -an expansion of around 0.5%.
841 -
842 -As a self-check for your protection, 
843 -.I 
844 -bzip2
845 -uses 32-bit CRCs to
846 -make sure that the decompressed version of a file is identical to the
847 -original.  This guards against corruption of the compressed data, and
848 -against undetected bugs in
849 -.I bzip2
850 -(hopefully very unlikely).  The
851 -chances of data corruption going undetected is microscopic, about one
852 -chance in four billion for each file processed.  Be aware, though, that
853 -the check occurs upon decompression, so it can only tell you that
854 -something is wrong.  It can't help you 
855 -recover the original uncompressed
856 -data.  You can use 
857 -.I bzip2recover
858 -to try to recover data from
859 -damaged files.
860 -
861 -Return values: 0 for a normal exit, 1 for environmental problems (file
862 -not found, invalid flags, I/O errors, &c), 2 to indicate a corrupt
863 -compressed file, 3 for an internal consistency error (eg, bug) which
864 -caused
865 -.I bzip2
866 -to panic.
867 -
868 -.SH OPTIONS
869 -.TP
870 -.B \-c --stdout
871 -Compress or decompress to standard output.
872 -.TP
873 -.B \-d --decompress
874 -Force decompression.  
875 -.I bzip2, 
876 -.I bunzip2 
877 -and
878 -.I bzcat 
879 -are
880 -really the same program, and the decision about what actions to take is
881 -done on the basis of which name is used.  This flag overrides that
882 -mechanism, and forces 
883 -.I bzip2
884 -to decompress.
885 -.TP
886 -.B \-z --compress
887 -The complement to \-d: forces compression, regardless of the
888 -invokation name.
889 -.TP
890 -.B \-t --test
891 -Check integrity of the specified file(s), but don't decompress them.
892 -This really performs a trial decompression and throws away the result.
893 -.TP
894 -.B \-f --force
895 -Force overwrite of output files.  Normally,
896 -.I bzip2 
897 -will not overwrite
898 -existing output files.  Also forces 
899 -.I bzip2 
900 -to break hard links
901 -to files, which it otherwise wouldn't do.
902 -.TP
903 -.B \-k --keep
904 -Keep (don't delete) input files during compression
905 -or decompression.
906 -.TP
907 -.B \-s --small
908 -Reduce memory usage, for compression, decompression and testing.  Files
909 -are decompressed and tested using a modified algorithm which only
910 -requires 2.5 bytes per block byte.  This means any file can be
911 -decompressed in 2300k of memory, albeit at about half the normal speed.
912 -
913 -During compression, \-s selects a block size of 200k, which limits
914 -memory use to around the same figure, at the expense of your compression
915 -ratio.  In short, if your machine is low on memory (8 megabytes or
916 -less), use \-s for everything.  See MEMORY MANAGEMENT below.
917 -.TP
918 -.B \-q --quiet
919 -Suppress non-essential warning messages.  Messages pertaining to
920 -I/O errors and other critical events will not be suppressed.
921 -.TP
922 -.B \-v --verbose
923 -Verbose mode -- show the compression ratio for each file processed.
924 -Further \-v's increase the verbosity level, spewing out lots of
925 -information which is primarily of interest for diagnostic purposes.
926 -.TP
927 -.B \-L --license -V --version
928 -Display the software version, license terms and conditions.
929 -.TP
930 -.B \-1 to \-9
931 -Set the block size to 100 k, 200 k ..  900 k when compressing.  Has no
932 -effect when decompressing.  See MEMORY MANAGEMENT below.
933 -.TP
934 -.B \--
935 -Treats all subsequent arguments as file names, even if they start
936 -with a dash.  This is so you can handle files with names beginning
937 -with a dash, for example: bzip2 \-- \-myfilename.
938 -.TP
939 -.B \--repetitive-fast --repetitive-best
940 -These flags are redundant in versions 0.9.5 and above.  They provided
941 -some coarse control over the behaviour of the sorting algorithm in
942 -earlier versions, which was sometimes useful.  0.9.5 and above have an
943 -improved algorithm which renders these flags irrelevant.
944 -
945 -.SH MEMORY MANAGEMENT
946 -.I bzip2 
947 -compresses large files in blocks.  The block size affects
948 -both the compression ratio achieved, and the amount of memory needed for
949 -compression and decompression.  The flags \-1 through \-9
950 -specify the block size to be 100,000 bytes through 900,000 bytes (the
951 -default) respectively.  At decompression time, the block size used for
952 -compression is read from the header of the compressed file, and
953 -.I bunzip2
954 -then allocates itself just enough memory to decompress
955 -the file.  Since block sizes are stored in compressed files, it follows
956 -that the flags \-1 to \-9 are irrelevant to and so ignored
957 -during decompression.
958 -
959 -Compression and decompression requirements, 
960 -in bytes, can be estimated as:
961 -
962 -       Compression:   400k + ( 8 x block size )
963 -
964 -       Decompression: 100k + ( 4 x block size ), or
965 -                      100k + ( 2.5 x block size )
966 -
967 -Larger block sizes give rapidly diminishing marginal returns.  Most of
968 -the compression comes from the first two or three hundred k of block
969 -size, a fact worth bearing in mind when using
970 -.I bzip2
971 -on small machines.
972 -It is also important to appreciate that the decompression memory
973 -requirement is set at compression time by the choice of block size.
974 -
975 -For files compressed with the default 900k block size,
976 -.I bunzip2
977 -will require about 3700 kbytes to decompress.  To support decompression
978 -of any file on a 4 megabyte machine, 
979 -.I bunzip2
980 -has an option to
981 -decompress using approximately half this amount of memory, about 2300
982 -kbytes.  Decompression speed is also halved, so you should use this
983 -option only where necessary.  The relevant flag is -s.
984 -
985 -In general, try and use the largest block size memory constraints allow,
986 -since that maximises the compression achieved.  Compression and
987 -decompression speed are virtually unaffected by block size.
988 -
989 -Another significant point applies to files which fit in a single block
990 --- that means most files you'd encounter using a large block size.  The
991 -amount of real memory touched is proportional to the size of the file,
992 -since the file is smaller than a block.  For example, compressing a file
993 -20,000 bytes long with the flag -9 will cause the compressor to
994 -allocate around 7600k of memory, but only touch 400k + 20000 * 8 = 560
995 -kbytes of it.  Similarly, the decompressor will allocate 3700k but only
996 -touch 100k + 20000 * 4 = 180 kbytes.
997 -
998 -Here is a table which summarises the maximum memory usage for different
999 -block sizes.  Also recorded is the total compressed size for 14 files of
1000 -the Calgary Text Compression Corpus totalling 3,141,622 bytes.  This
1001 -column gives some feel for how compression varies with block size.
1002 -These figures tend to understate the advantage of larger block sizes for
1003 -larger files, since the Corpus is dominated by smaller files.
1004 -
1005 -           Compress   Decompress   Decompress   Corpus
1006 -    Flag     usage      usage       -s usage     Size
1007 -
1008 -     -1      1200k       500k         350k      914704
1009 -     -2      2000k       900k         600k      877703
1010 -     -3      2800k      1300k         850k      860338
1011 -     -4      3600k      1700k        1100k      846899
1012 -     -5      4400k      2100k        1350k      845160
1013 -     -6      5200k      2500k        1600k      838626
1014 -     -7      6100k      2900k        1850k      834096
1015 -     -8      6800k      3300k        2100k      828642
1016 -     -9      7600k      3700k        2350k      828642
1017 -
1018 -.SH RECOVERING DATA FROM DAMAGED FILES
1019 -.I bzip2
1020 -compresses files in blocks, usually 900kbytes long.  Each
1021 -block is handled independently.  If a media or transmission error causes
1022 -a multi-block .bz2
1023 -file to become damaged, it may be possible to
1024 -recover data from the undamaged blocks in the file.
1025 -
1026 -The compressed representation of each block is delimited by a 48-bit
1027 -pattern, which makes it possible to find the block boundaries with
1028 -reasonable certainty.  Each block also carries its own 32-bit CRC, so
1029 -damaged blocks can be distinguished from undamaged ones.
1030 -
1031 -.I bzip2recover
1032 -is a simple program whose purpose is to search for
1033 -blocks in .bz2 files, and write each block out into its own .bz2 
1034 -file.  You can then use
1035 -.I bzip2 
1036 -\-t
1037 -to test the
1038 -integrity of the resulting files, and decompress those which are
1039 -undamaged.
1040 -
1041 -.I bzip2recover
1042 -takes a single argument, the name of the damaged file, 
1043 -and writes a number of files "rec0001file.bz2",
1044 -"rec0002file.bz2", etc, containing the  extracted  blocks.
1045 -The  output  filenames  are  designed  so  that the use of
1046 -wildcards in subsequent processing -- for example,  
1047 -"bzip2 -dc  rec*file.bz2 > recovered_data" -- lists the files in
1048 -the correct order.
1049 -
1050 -.I bzip2recover
1051 -should be of most use dealing with large .bz2
1052 -files,  as  these will contain many blocks.  It is clearly
1053 -futile to use it on damaged single-block  files,  since  a
1054 -damaged  block  cannot  be recovered.  If you wish to minimise 
1055 -any potential data loss through media  or  transmission errors, 
1056 -you might consider compressing with a smaller
1057 -block size.
1058 -
1059 -.SH PERFORMANCE NOTES
1060 -The sorting phase of compression gathers together similar strings in the
1061 -file.  Because of this, files containing very long runs of repeated
1062 -symbols, like "aabaabaabaab ..."  (repeated several hundred times) may
1063 -compress more slowly than normal.  Versions 0.9.5 and above fare much
1064 -better than previous versions in this respect.  The ratio between
1065 -worst-case and average-case compression time is in the region of 10:1.
1066 -For previous versions, this figure was more like 100:1.  You can use the
1067 -\-vvvv option to monitor progress in great detail, if you want.
1068 -
1069 -Decompression speed is unaffected by these phenomena.
1070 -
1071 -.I bzip2
1072 -usually allocates several megabytes of memory to operate
1073 -in, and then charges all over it in a fairly random fashion.  This means
1074 -that performance, both for compressing and decompressing, is largely
1075 -determined by the speed at which your machine can service cache misses.
1076 -Because of this, small changes to the code to reduce the miss rate have
1077 -been observed to give disproportionately large performance improvements.
1078 -I imagine 
1079 -.I bzip2
1080 -will perform best on machines with very large caches.
1081 -
1082 -.SH CAVEATS
1083 -I/O error messages are not as helpful as they could be.
1084 -.I bzip2
1085 -tries hard to detect I/O errors and exit cleanly, but the details of
1086 -what the problem is sometimes seem rather misleading.
1087 -
1088 -This manual page pertains to version 1.0 of
1089 -.I bzip2.  
1090 -Compressed
1091 -data created by this version is entirely forwards and backwards
1092 -compatible with the previous public releases, versions 0.1pl2, 0.9.0
1093 -and 0.9.5,
1094 -but with the following exception: 0.9.0 and above can correctly
1095 -decompress multiple concatenated compressed files.  0.1pl2 cannot do
1096 -this; it will stop after decompressing just the first file in the
1097 -stream.
1098 -
1099 -.I bzip2recover
1100 -uses 32-bit integers to represent bit positions in
1101 -compressed files, so it cannot handle compressed files more than 512
1102 -megabytes long.  This could easily be fixed.
1103 -
1104 -.SH AUTHOR
1105 -Julian Seward, jseward@acm.org.
1106 -
1107 -http://sourceware.cygnus.com/bzip2
1108 -http://www.muraroa.demon.co.uk
1109 -
1110 -The ideas embodied in
1111 -.I bzip2
1112 -are due to (at least) the following
1113 -people: Michael Burrows and David Wheeler (for the block sorting
1114 -transformation), David Wheeler (again, for the Huffman coder), Peter
1115 -Fenwick (for the structured coding model in the original
1116 -.I bzip,
1117 -and many refinements), and Alistair Moffat, Radford Neal and Ian Witten
1118 -(for the arithmetic coder in the original
1119 -.I bzip).  
1120 -I am much
1121 -indebted for their help, support and advice.  See the manual in the
1122 -source distribution for pointers to sources of documentation.  Christian
1123 -von Roques encouraged me to look for faster sorting algorithms, so as to
1124 -speed up compression.  Bela Lubkin encouraged me to improve the
1125 -worst-case compression performance.  Many people sent patches, helped
1126 -with portability problems, lent machines, gave advice and were generally
1127 -helpful.
1128 diff -Nru bzip2-1.0.1/bzip2.1.preformatted bzip2-1.0.1.new/bzip2.1.preformatted
1129 --- bzip2-1.0.1/bzip2.1.preformatted    Sat Jun 24 20:13:27 2000
1130 +++ bzip2-1.0.1.new/bzip2.1.preformatted        Thu Jan  1 01:00:00 1970
1131 @@ -1,462 +0,0 @@
1132 -
1133 -
1134 -
1135 -bzip2(1)                                                 bzip2(1)
1136 -
1137 -
1138 -N\bNA\bAM\bME\bE
1139 -       bzip2, bunzip2 - a block-sorting file compressor, v1.0
1140 -       bzcat - decompresses files to stdout
1141 -       bzip2recover - recovers data from damaged bzip2 files
1142 -
1143 -
1144 -S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
1145 -       b\bbz\bzi\bip\bp2\b2 [ -\b-c\bcd\bdf\bfk\bkq\bqs\bst\btv\bvz\bzV\bVL\bL1\b12\b23\b34\b45\b56\b67\b78\b89\b9 ] [ _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be_\bs _\b._\b._\b.  ]
1146 -       b\bbu\bun\bnz\bzi\bip\bp2\b2 [ -\b-f\bfk\bkv\bvs\bsV\bVL\bL ] [ _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be_\bs _\b._\b._\b.  ]
1147 -       b\bbz\bzc\bca\bat\bt [ -\b-s\bs ] [ _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be_\bs _\b._\b._\b.  ]
1148 -       b\bbz\bzi\bip\bp2\b2r\bre\bec\bco\bov\bve\ber\br _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be
1149 -
1150 -
1151 -D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
1152 -       _\bb_\bz_\bi_\bp_\b2  compresses  files  using  the Burrows-Wheeler block
1153 -       sorting text compression algorithm,  and  Huffman  coding.
1154 -       Compression  is  generally  considerably  better than that
1155 -       achieved by more conventional LZ77/LZ78-based compressors,
1156 -       and  approaches  the performance of the PPM family of sta-
1157 -       tistical compressors.
1158 -
1159 -       The command-line options are deliberately very similar  to
1160 -       those of _\bG_\bN_\bU _\bg_\bz_\bi_\bp_\b, but they are not identical.
1161 -
1162 -       _\bb_\bz_\bi_\bp_\b2  expects  a list of file names to accompany the com-
1163 -       mand-line flags.  Each file is replaced  by  a  compressed
1164 -       version  of  itself,  with  the  name "original_name.bz2".
1165 -       Each compressed file has the same modification date,  per-
1166 -       missions, and, when possible, ownership as the correspond-
1167 -       ing original, so that these properties  can  be  correctly
1168 -       restored  at  decompression  time.   File name handling is
1169 -       naive in the sense that there is no mechanism for preserv-
1170 -       ing  original file names, permissions, ownerships or dates
1171 -       in filesystems which lack these concepts, or have  serious
1172 -       file name length restrictions, such as MS-DOS.
1173 -
1174 -       _\bb_\bz_\bi_\bp_\b2  and  _\bb_\bu_\bn_\bz_\bi_\bp_\b2 will by default not overwrite existing
1175 -       files.  If you want this to happen, specify the -f flag.
1176 -
1177 -       If no file names  are  specified,  _\bb_\bz_\bi_\bp_\b2  compresses  from
1178 -       standard  input  to  standard output.  In this case, _\bb_\bz_\bi_\bp_\b2
1179 -       will decline to write compressed output to a terminal,  as
1180 -       this  would  be  entirely  incomprehensible  and therefore
1181 -       pointless.
1182 -
1183 -       _\bb_\bu_\bn_\bz_\bi_\bp_\b2 (or _\bb_\bz_\bi_\bp_\b2 _\b-_\bd_\b) decompresses  all  specified  files.
1184 -       Files which were not created by _\bb_\bz_\bi_\bp_\b2 will be detected and
1185 -       ignored, and a warning issued.  _\bb_\bz_\bi_\bp_\b2  attempts  to  guess
1186 -       the  filename  for  the decompressed file from that of the
1187 -       compressed file as follows:
1188 -
1189 -              filename.bz2    becomes   filename
1190 -              filename.bz     becomes   filename
1191 -              filename.tbz2   becomes   filename.tar
1192 -
1193 -
1194 -
1195 -                                                                1
1196 -
1197 -
1198 -
1199 -
1200 -
1201 -bzip2(1)                                                 bzip2(1)
1202 -
1203 -
1204 -              filename.tbz    becomes   filename.tar
1205 -              anyothername    becomes   anyothername.out
1206 -
1207 -       If the file does not end in one of the recognised endings,
1208 -       _\b._\bb_\bz_\b2_\b,  _\b._\bb_\bz_\b,  _\b._\bt_\bb_\bz_\b2 or _\b._\bt_\bb_\bz_\b, _\bb_\bz_\bi_\bp_\b2 complains that it cannot
1209 -       guess the name of the original file, and uses the original
1210 -       name with _\b._\bo_\bu_\bt appended.
1211 -
1212 -       As  with compression, supplying no filenames causes decom-
1213 -       pression from standard input to standard output.
1214 -
1215 -       _\bb_\bu_\bn_\bz_\bi_\bp_\b2 will correctly decompress a file which is the con-
1216 -       catenation of two or more compressed files.  The result is
1217 -       the concatenation of the corresponding uncompressed files.
1218 -       Integrity testing (-t) of concatenated compressed files is
1219 -       also supported.
1220 -
1221 -       You can also compress or decompress files to the  standard
1222 -       output  by giving the -c flag.  Multiple files may be com-
1223 -       pressed and decompressed like this.  The resulting outputs
1224 -       are  fed  sequentially to stdout.  Compression of multiple
1225 -       files in this manner generates a stream containing  multi-
1226 -       ple compressed file representations.  Such a stream can be
1227 -       decompressed correctly only  by  _\bb_\bz_\bi_\bp_\b2  version  0.9.0  or
1228 -       later.   Earlier  versions of _\bb_\bz_\bi_\bp_\b2 will stop after decom-
1229 -       pressing the first file in the stream.
1230 -
1231 -       _\bb_\bz_\bc_\ba_\bt (or _\bb_\bz_\bi_\bp_\b2 _\b-_\bd_\bc_\b) decompresses all specified  files  to
1232 -       the standard output.
1233 -
1234 -       _\bb_\bz_\bi_\bp_\b2  will  read arguments from the environment variables
1235 -       _\bB_\bZ_\bI_\bP_\b2 and _\bB_\bZ_\bI_\bP_\b, in  that  order,  and  will  process  them
1236 -       before  any  arguments  read  from the command line.  This
1237 -       gives a convenient way to supply default arguments.
1238 -
1239 -       Compression is always performed, even  if  the  compressed
1240 -       file  is slightly larger than the original.  Files of less
1241 -       than about one hundred bytes tend to get larger, since the
1242 -       compression  mechanism  has  a  constant  overhead  in the
1243 -       region of 50 bytes.  Random data (including the output  of
1244 -       most  file  compressors)  is  coded at about 8.05 bits per
1245 -       byte, giving an expansion of around 0.5%.
1246 -
1247 -       As a self-check for your  protection,  _\bb_\bz_\bi_\bp_\b2  uses  32-bit
1248 -       CRCs  to make sure that the decompressed version of a file
1249 -       is identical to the original.  This guards against corrup-
1250 -       tion  of  the compressed data, and against undetected bugs
1251 -       in _\bb_\bz_\bi_\bp_\b2 (hopefully very unlikely).  The chances  of  data
1252 -       corruption  going  undetected  is  microscopic,  about one
1253 -       chance in four billion for each file processed.  Be aware,
1254 -       though,  that  the  check occurs upon decompression, so it
1255 -       can only tell you that something is wrong.  It can't  help
1256 -       you  recover  the original uncompressed data.  You can use
1257 -       _\bb_\bz_\bi_\bp_\b2_\br_\be_\bc_\bo_\bv_\be_\br to try to recover data from damaged files.
1258 -
1259 -
1260 -
1261 -                                                                2
1262 -
1263 -
1264 -
1265 -
1266 -
1267 -bzip2(1)                                                 bzip2(1)
1268 -
1269 -
1270 -       Return values: 0 for a normal exit,  1  for  environmental
1271 -       problems  (file not found, invalid flags, I/O errors, &c),
1272 -       2 to indicate a corrupt compressed file, 3 for an internal
1273 -       consistency error (eg, bug) which caused _\bb_\bz_\bi_\bp_\b2 to panic.
1274 -
1275 -
1276 -O\bOP\bPT\bTI\bIO\bON\bNS\bS
1277 -       -\b-c\bc -\b--\b-s\bst\btd\bdo\bou\but\bt
1278 -              Compress or decompress to standard output.
1279 -
1280 -       -\b-d\bd -\b--\b-d\bde\bec\bco\bom\bmp\bpr\bre\bes\bss\bs
1281 -              Force  decompression.  _\bb_\bz_\bi_\bp_\b2_\b, _\bb_\bu_\bn_\bz_\bi_\bp_\b2 and _\bb_\bz_\bc_\ba_\bt are
1282 -              really the same program,  and  the  decision  about
1283 -              what  actions to take is done on the basis of which
1284 -              name is used.  This flag overrides that  mechanism,
1285 -              and forces _\bb_\bz_\bi_\bp_\b2 to decompress.
1286 -
1287 -       -\b-z\bz -\b--\b-c\bco\bom\bmp\bpr\bre\bes\bss\bs
1288 -              The  complement  to -d: forces compression, regard-
1289 -              less of the invokation name.
1290 -
1291 -       -\b-t\bt -\b--\b-t\bte\bes\bst\bt
1292 -              Check integrity of the specified file(s), but don't
1293 -              decompress  them.   This  really  performs  a trial
1294 -              decompression and throws away the result.
1295 -
1296 -       -\b-f\bf -\b--\b-f\bfo\bor\brc\bce\be
1297 -              Force overwrite of output files.   Normally,  _\bb_\bz_\bi_\bp_\b2
1298 -              will  not  overwrite  existing  output files.  Also
1299 -              forces _\bb_\bz_\bi_\bp_\b2 to break hard links to files, which it
1300 -              otherwise wouldn't do.
1301 -
1302 -       -\b-k\bk -\b--\b-k\bke\bee\bep\bp
1303 -              Keep  (don't delete) input files during compression
1304 -              or decompression.
1305 -
1306 -       -\b-s\bs -\b--\b-s\bsm\bma\bal\bll\bl
1307 -              Reduce memory usage, for compression, decompression
1308 -              and  testing.   Files  are  decompressed and tested
1309 -              using a modified algorithm which only requires  2.5
1310 -              bytes  per  block byte.  This means any file can be
1311 -              decompressed in 2300k of memory,  albeit  at  about
1312 -              half the normal speed.
1313 -
1314 -              During  compression,  -s  selects  a  block size of
1315 -              200k, which limits memory use to  around  the  same
1316 -              figure,  at  the expense of your compression ratio.
1317 -              In short, if your  machine  is  low  on  memory  (8
1318 -              megabytes  or  less),  use  -s for everything.  See
1319 -              MEMORY MANAGEMENT below.
1320 -
1321 -       -\b-q\bq -\b--\b-q\bqu\bui\bie\bet\bt
1322 -              Suppress non-essential warning messages.   Messages
1323 -              pertaining  to I/O errors and other critical events
1324 -
1325 -
1326 -
1327 -                                                                3
1328 -
1329 -
1330 -
1331 -
1332 -
1333 -bzip2(1)                                                 bzip2(1)
1334 -
1335 -
1336 -              will not be suppressed.
1337 -
1338 -       -\b-v\bv -\b--\b-v\bve\ber\brb\bbo\bos\bse\be
1339 -              Verbose mode -- show the compression ratio for each
1340 -              file  processed.   Further  -v's  increase the ver-
1341 -              bosity level, spewing out lots of information which
1342 -              is primarily of interest for diagnostic purposes.
1343 -
1344 -       -\b-L\bL -\b--\b-l\bli\bic\bce\ben\bns\bse\be -\b-V\bV -\b--\b-v\bve\ber\brs\bsi\bio\bon\bn
1345 -              Display  the  software  version,  license terms and
1346 -              conditions.
1347 -
1348 -       -\b-1\b1 t\bto\bo -\b-9\b9
1349 -              Set the block size to 100 k, 200 k ..  900  k  when
1350 -              compressing.   Has  no  effect  when decompressing.
1351 -              See MEMORY MANAGEMENT below.
1352 -
1353 -       -\b--\b-     Treats all subsequent arguments as file names, even
1354 -              if they start with a dash.  This is so you can han-
1355 -              dle files with names beginning  with  a  dash,  for
1356 -              example: bzip2 -- -myfilename.
1357 -
1358 -       -\b--\b-r\bre\bep\bpe\bet\bti\bit\bti\biv\bve\be-\b-f\bfa\bas\bst\bt -\b--\b-r\bre\bep\bpe\bet\bti\bit\bti\biv\bve\be-\b-b\bbe\bes\bst\bt
1359 -              These  flags  are  redundant  in versions 0.9.5 and
1360 -              above.  They provided some coarse control over  the
1361 -              behaviour  of the sorting algorithm in earlier ver-
1362 -              sions, which was sometimes useful.  0.9.5 and above
1363 -              have  an  improved  algorithm  which  renders these
1364 -              flags irrelevant.
1365 -
1366 -
1367 -M\bME\bEM\bMO\bOR\bRY\bY M\bMA\bAN\bNA\bAG\bGE\bEM\bME\bEN\bNT\bT
1368 -       _\bb_\bz_\bi_\bp_\b2 compresses large files in blocks.   The  block  size
1369 -       affects  both  the  compression  ratio  achieved,  and the
1370 -       amount of memory needed for compression and decompression.
1371 -       The  flags  -1  through  -9  specify  the block size to be
1372 -       100,000 bytes through 900,000 bytes (the default)  respec-
1373 -       tively.   At  decompression  time, the block size used for
1374 -       compression is read from  the  header  of  the  compressed
1375 -       file, and _\bb_\bu_\bn_\bz_\bi_\bp_\b2 then allocates itself just enough memory
1376 -       to decompress the file.  Since block sizes are  stored  in
1377 -       compressed  files,  it follows that the flags -1 to -9 are
1378 -       irrelevant to and so ignored during decompression.
1379 -
1380 -       Compression and decompression requirements, in bytes,  can
1381 -       be estimated as:
1382 -
1383 -              Compression:   400k + ( 8 x block size )
1384 -
1385 -              Decompression: 100k + ( 4 x block size ), or
1386 -                             100k + ( 2.5 x block size )
1387 -
1388 -       Larger  block  sizes  give  rapidly  diminishing  marginal
1389 -       returns.  Most of the compression comes from the first two
1390 -
1391 -
1392 -
1393 -                                                                4
1394 -
1395 -
1396 -
1397 -
1398 -
1399 -bzip2(1)                                                 bzip2(1)
1400 -
1401 -
1402 -       or  three hundred k of block size, a fact worth bearing in
1403 -       mind when using _\bb_\bz_\bi_\bp_\b2  on  small  machines.   It  is  also
1404 -       important  to  appreciate  that  the  decompression memory
1405 -       requirement is set at compression time by  the  choice  of
1406 -       block size.
1407 -
1408 -       For  files  compressed  with  the default 900k block size,
1409 -       _\bb_\bu_\bn_\bz_\bi_\bp_\b2 will require about 3700 kbytes to decompress.   To
1410 -       support decompression of any file on a 4 megabyte machine,
1411 -       _\bb_\bu_\bn_\bz_\bi_\bp_\b2 has an option to  decompress  using  approximately
1412 -       half this amount of memory, about 2300 kbytes.  Decompres-
1413 -       sion speed is also halved, so you should use  this  option
1414 -       only where necessary.  The relevant flag is -s.
1415 -
1416 -       In general, try and use the largest block size memory con-
1417 -       straints  allow,  since  that  maximises  the  compression
1418 -       achieved.   Compression and decompression speed are virtu-
1419 -       ally unaffected by block size.
1420 -
1421 -       Another significant point applies to files which fit in  a
1422 -       single  block  --  that  means  most files you'd encounter
1423 -       using a large block  size.   The  amount  of  real  memory
1424 -       touched is proportional to the size of the file, since the
1425 -       file is smaller than a block.  For example, compressing  a
1426 -       file  20,000  bytes  long  with the flag -9 will cause the
1427 -       compressor to allocate around 7600k of  memory,  but  only
1428 -       touch 400k + 20000 * 8 = 560 kbytes of it.  Similarly, the
1429 -       decompressor will allocate 3700k but  only  touch  100k  +
1430 -       20000 * 4 = 180 kbytes.
1431 -
1432 -       Here  is a table which summarises the maximum memory usage
1433 -       for different block sizes.  Also  recorded  is  the  total
1434 -       compressed  size for 14 files of the Calgary Text Compres-
1435 -       sion Corpus totalling 3,141,622 bytes.  This column  gives
1436 -       some  feel  for  how  compression  varies with block size.
1437 -       These figures tend to understate the advantage  of  larger
1438 -       block  sizes  for  larger files, since the Corpus is domi-
1439 -       nated by smaller files.
1440 -
1441 -                  Compress   Decompress   Decompress   Corpus
1442 -           Flag     usage      usage       -s usage     Size
1443 -
1444 -            -1      1200k       500k         350k      914704
1445 -            -2      2000k       900k         600k      877703
1446 -            -3      2800k      1300k         850k      860338
1447 -            -4      3600k      1700k        1100k      846899
1448 -            -5      4400k      2100k        1350k      845160
1449 -            -6      5200k      2500k        1600k      838626
1450 -            -7      6100k      2900k        1850k      834096
1451 -            -8      6800k      3300k        2100k      828642
1452 -            -9      7600k      3700k        2350k      828642
1453 -
1454 -
1455 -
1456 -
1457 -
1458 -
1459 -                                                                5
1460 -
1461 -
1462 -
1463 -
1464 -
1465 -bzip2(1)                                                 bzip2(1)
1466 -
1467 -
1468 -R\bRE\bEC\bCO\bOV\bVE\bER\bRI\bIN\bNG\bG D\bDA\bAT\bTA\bA F\bFR\bRO\bOM\bM D\bDA\bAM\bMA\bAG\bGE\bED\bD F\bFI\bIL\bLE\bES\bS
1469 -       _\bb_\bz_\bi_\bp_\b2 compresses files in blocks, usually 900kbytes  long.
1470 -       Each block is handled independently.  If a media or trans-
1471 -       mission error causes a multi-block  .bz2  file  to  become
1472 -       damaged,  it  may  be  possible  to  recover data from the
1473 -       undamaged blocks in the file.
1474 -
1475 -       The compressed representation of each block  is  delimited
1476 -       by  a  48-bit pattern, which makes it possible to find the
1477 -       block boundaries with reasonable  certainty.   Each  block
1478 -       also  carries its own 32-bit CRC, so damaged blocks can be
1479 -       distinguished from undamaged ones.
1480 -
1481 -       _\bb_\bz_\bi_\bp_\b2_\br_\be_\bc_\bo_\bv_\be_\br is a  simple  program  whose  purpose  is  to
1482 -       search  for blocks in .bz2 files, and write each block out
1483 -       into its own .bz2 file.  You can then use _\bb_\bz_\bi_\bp_\b2 -t to test
1484 -       the integrity of the resulting files, and decompress those
1485 -       which are undamaged.
1486 -
1487 -       _\bb_\bz_\bi_\bp_\b2_\br_\be_\bc_\bo_\bv_\be_\br takes a single argument, the name of the dam-
1488 -       aged file, and writes a number of files "rec0001file.bz2",
1489 -       "rec0002file.bz2", etc, containing the  extracted  blocks.
1490 -       The  output  filenames  are  designed  so  that the use of
1491 -       wildcards in subsequent processing -- for example,  "bzip2
1492 -       -dc   rec*file.bz2 > recovered_data" -- lists the files in
1493 -       the correct order.
1494 -
1495 -       _\bb_\bz_\bi_\bp_\b2_\br_\be_\bc_\bo_\bv_\be_\br should be of most use dealing with large .bz2
1496 -       files,  as  these will contain many blocks.  It is clearly
1497 -       futile to use it on damaged single-block  files,  since  a
1498 -       damaged  block  cannot  be recovered.  If you wish to min-
1499 -       imise any potential data loss through media  or  transmis-
1500 -       sion errors, you might consider compressing with a smaller
1501 -       block size.
1502 -
1503 -
1504 -P\bPE\bER\bRF\bFO\bOR\bRM\bMA\bAN\bNC\bCE\bE N\bNO\bOT\bTE\bES\bS
1505 -       The sorting phase of compression gathers together  similar
1506 -       strings  in  the  file.  Because of this, files containing
1507 -       very long runs of  repeated  symbols,  like  "aabaabaabaab
1508 -       ..."   (repeated  several hundred times) may compress more
1509 -       slowly than normal.  Versions 0.9.5 and  above  fare  much
1510 -       better  than previous versions in this respect.  The ratio
1511 -       between worst-case and average-case compression time is in
1512 -       the  region  of  10:1.  For previous versions, this figure
1513 -       was more like 100:1.  You can use the -vvvv option to mon-
1514 -       itor progress in great detail, if you want.
1515 -
1516 -       Decompression speed is unaffected by these phenomena.
1517 -
1518 -       _\bb_\bz_\bi_\bp_\b2  usually  allocates  several  megabytes of memory to
1519 -       operate in, and then charges all over it in a fairly  ran-
1520 -       dom  fashion.   This means that performance, both for com-
1521 -       pressing and decompressing, is largely determined  by  the
1522 -
1523 -
1524 -
1525 -                                                                6
1526 -
1527 -
1528 -
1529 -
1530 -
1531 -bzip2(1)                                                 bzip2(1)
1532 -
1533 -
1534 -       speed  at  which  your  machine  can service cache misses.
1535 -       Because of this, small changes to the code to  reduce  the
1536 -       miss  rate  have  been observed to give disproportionately
1537 -       large performance improvements.  I imagine _\bb_\bz_\bi_\bp_\b2 will per-
1538 -       form best on machines with very large caches.
1539 -
1540 -
1541 -C\bCA\bAV\bVE\bEA\bAT\bTS\bS
1542 -       I/O  error  messages  are not as helpful as they could be.
1543 -       _\bb_\bz_\bi_\bp_\b2 tries hard to detect I/O errors  and  exit  cleanly,
1544 -       but  the  details  of  what  the problem is sometimes seem
1545 -       rather misleading.
1546 -
1547 -       This manual page pertains to version 1.0 of  _\bb_\bz_\bi_\bp_\b2_\b.   Com-
1548 -       pressed  data created by this version is entirely forwards
1549 -       and  backwards  compatible  with   the   previous   public
1550 -       releases,  versions  0.1pl2, 0.9.0 and 0.9.5, but with the
1551 -       following exception: 0.9.0 and above can correctly  decom-
1552 -       press multiple concatenated compressed files.  0.1pl2 can-
1553 -       not do this; it will stop  after  decompressing  just  the
1554 -       first file in the stream.
1555 -
1556 -       _\bb_\bz_\bi_\bp_\b2_\br_\be_\bc_\bo_\bv_\be_\br  uses  32-bit integers to represent bit posi-
1557 -       tions in compressed files, so it cannot handle  compressed
1558 -       files  more than 512 megabytes long.  This could easily be
1559 -       fixed.
1560 -
1561 -
1562 -A\bAU\bUT\bTH\bHO\bOR\bR
1563 -       Julian Seward, jseward@acm.org.
1564 -
1565 -       http://sourceware.cygnus.com/bzip2
1566 -       http://www.muraroa.demon.co.uk
1567 -
1568 -       The ideas embodied in _\bb_\bz_\bi_\bp_\b2 are due to (at least) the fol-
1569 -       lowing people: Michael Burrows and David Wheeler (for  the
1570 -       block  sorting  transformation), David Wheeler (again, for
1571 -       the Huffman coder), Peter Fenwick (for the structured cod-
1572 -       ing model in the original _\bb_\bz_\bi_\bp_\b, and many refinements), and
1573 -       Alistair Moffat, Radford Neal  and  Ian  Witten  (for  the
1574 -       arithmetic  coder  in  the  original  _\bb_\bz_\bi_\bp_\b)_\b.   I  am  much
1575 -       indebted for their help, support and advice.  See the man-
1576 -       ual  in the source distribution for pointers to sources of
1577 -       documentation.  Christian von Roques encouraged me to look
1578 -       for  faster sorting algorithms, so as to speed up compres-
1579 -       sion.  Bela Lubkin encouraged me to improve the worst-case
1580 -       compression performance.  Many people sent patches, helped
1581 -       with portability problems, lent machines, gave advice  and
1582 -       were generally helpful.
1583 -
1584 -
1585 -
1586 -
1587 -
1588 -
1589 -
1590 -
1591 -                                                                7
1592 -
1593 -
1594 diff -Nru bzip2-1.0.1/bzless bzip2-1.0.1.new/bzless
1595 --- bzip2-1.0.1/bzless  Thu Jan  1 01:00:00 1970
1596 +++ bzip2-1.0.1.new/bzless      Sat Jun 24 20:16:09 2000
1597 @@ -0,0 +1,2 @@
1598 +#!/bin/sh
1599 +%{_bindir}/bunzip2 -c "\$@" | /usr/bin/less
1600 diff -Nru bzip2-1.0.1/config.h.in bzip2-1.0.1.new/config.h.in
1601 --- bzip2-1.0.1/config.h.in     Thu Jan  1 01:00:00 1970
1602 +++ bzip2-1.0.1.new/config.h.in Sat Jun 24 20:13:06 2000
1603 @@ -0,0 +1,17 @@
1604 +/* config.h.in.  Generated automatically from configure.in by autoheader.  */
1605 +
1606 +/* Name of package */
1607 +#undef PACKAGE
1608 +
1609 +/* Version number of package */
1610 +#undef VERSION
1611 +
1612 +/* Number of bits in a file offset, on hosts where this is settable. */
1613 +#undef _FILE_OFFSET_BITS
1614 +
1615 +/* Define to make fseeko etc. visible, on some hosts. */
1616 +#undef _LARGEFILE_SOURCE
1617 +
1618 +/* Define for large files, on AIX-style hosts. */
1619 +#undef _LARGE_FILES
1620 +
1621 diff -Nru bzip2-1.0.1/configure.in bzip2-1.0.1.new/configure.in
1622 --- bzip2-1.0.1/configure.in    Thu Jan  1 01:00:00 1970
1623 +++ bzip2-1.0.1.new/configure.in        Sat Jun 24 20:13:06 2000
1624 @@ -0,0 +1,10 @@
1625 +AC_INIT(bzip2.c)
1626 +AM_INIT_AUTOMAKE(bzip2,1.0.1)
1627 +AM_CONFIG_HEADER(config.h)
1628 +AC_PROG_CC
1629 +AM_PROG_LIBTOOL
1630 +AC_PROG_LN_S
1631 +AC_SYS_LARGEFILE
1632 +AC_OUTPUT(Makefile
1633 +       doc/Makefile
1634 +       doc/pl/Makefile)
1635 diff -Nru bzip2-1.0.1/crctable.c bzip2-1.0.1.new/crctable.c
1636 --- bzip2-1.0.1/crctable.c      Sat Jun 24 20:13:27 2000
1637 +++ bzip2-1.0.1.new/crctable.c  Sat Jun 24 20:13:06 2000
1638 @@ -58,6 +58,10 @@
1639    For more information on these sources, see the manual.
1640  --*/
1641  
1642 +#ifdef HAVE_CONFIG_H
1643 +#include <config.h>
1644 +#endif
1645 +
1646  
1647  #include "bzlib_private.h"
1648  
1649 diff -Nru bzip2-1.0.1/decompress.c bzip2-1.0.1.new/decompress.c
1650 --- bzip2-1.0.1/decompress.c    Sat Jun 24 20:13:27 2000
1651 +++ bzip2-1.0.1.new/decompress.c        Sat Jun 24 20:13:06 2000
1652 @@ -58,6 +58,10 @@
1653    For more information on these sources, see the manual.
1654  --*/
1655  
1656 +#ifdef HAVE_CONFIG_H
1657 +#include <config.h>
1658 +#endif
1659 +
1660  
1661  #include "bzlib_private.h"
1662  
1663 diff -Nru bzip2-1.0.1/dlltest.c bzip2-1.0.1.new/dlltest.c
1664 --- bzip2-1.0.1/dlltest.c       Sat Jun 24 20:13:27 2000
1665 +++ bzip2-1.0.1.new/dlltest.c   Sat Jun 24 20:13:06 2000
1666 @@ -8,6 +8,10 @@
1667     usage: minibz2 [-d] [-{1,2,..9}] [[srcfilename] destfilename]\r
1668  */\r
1669  \r
1670 +#ifdef HAVE_CONFIG_H
1671 +#include <config.h>
1672 +#endif
1673 +
1674  #define BZ_IMPORT\r
1675  #include <stdio.h>\r
1676  #include <stdlib.h>\r
1677 diff -Nru bzip2-1.0.1/doc/Makefile.am bzip2-1.0.1.new/doc/Makefile.am
1678 --- bzip2-1.0.1/doc/Makefile.am Thu Jan  1 01:00:00 1970
1679 +++ bzip2-1.0.1.new/doc/Makefile.am     Sat Jun 24 20:14:43 2000
1680 @@ -0,0 +1,5 @@
1681 +
1682 +SUBDIRS                = pl
1683 +
1684 +man_MANS       = bzip2.1 bunzip2.1 bzcat.1 bzip2recover.1
1685 +#info_TEXINFOS = bzip2.texi
1686 diff -Nru bzip2-1.0.1/doc/bunzip2.1 bzip2-1.0.1.new/doc/bunzip2.1
1687 --- bzip2-1.0.1/doc/bunzip2.1   Thu Jan  1 01:00:00 1970
1688 +++ bzip2-1.0.1.new/doc/bunzip2.1       Sat Jun 24 20:13:06 2000
1689 @@ -0,0 +1 @@
1690 +.so bzip2.1
1691 \ No newline at end of file
1692 diff -Nru bzip2-1.0.1/doc/bzcat.1 bzip2-1.0.1.new/doc/bzcat.1
1693 --- bzip2-1.0.1/doc/bzcat.1     Thu Jan  1 01:00:00 1970
1694 +++ bzip2-1.0.1.new/doc/bzcat.1 Sat Jun 24 20:13:06 2000
1695 @@ -0,0 +1 @@
1696 +.so bzip2.1
1697 \ No newline at end of file
1698 diff -Nru bzip2-1.0.1/doc/bzip2.1 bzip2-1.0.1.new/doc/bzip2.1
1699 --- bzip2-1.0.1/doc/bzip2.1     Thu Jan  1 01:00:00 1970
1700 +++ bzip2-1.0.1.new/doc/bzip2.1 Sat Jun 24 20:13:06 2000
1701 @@ -0,0 +1,439 @@
1702 +.PU
1703 +.TH bzip2 1
1704 +.SH NAME
1705 +bzip2, bunzip2 \- a block-sorting file compressor, v1.0
1706 +.br
1707 +bzcat \- decompresses files to stdout
1708 +.br
1709 +bzip2recover \- recovers data from damaged bzip2 files
1710 +
1711 +.SH SYNOPSIS
1712 +.ll +8
1713 +.B bzip2
1714 +.RB [ " \-cdfkqstvzVL123456789 " ]
1715 +[
1716 +.I "filenames \&..."
1717 +]
1718 +.ll -8
1719 +.br
1720 +.B bunzip2
1721 +.RB [ " \-fkvsVL " ]
1722 +[ 
1723 +.I "filenames \&..."
1724 +]
1725 +.br
1726 +.B bzcat
1727 +.RB [ " \-s " ]
1728 +[ 
1729 +.I "filenames \&..."
1730 +]
1731 +.br
1732 +.B bzip2recover
1733 +.I "filename"
1734 +
1735 +.SH DESCRIPTION
1736 +.I bzip2
1737 +compresses files using the Burrows-Wheeler block sorting
1738 +text compression algorithm, and Huffman coding.  Compression is
1739 +generally considerably better than that achieved by more conventional
1740 +LZ77/LZ78-based compressors, and approaches the performance of the PPM
1741 +family of statistical compressors.
1742 +
1743 +The command-line options are deliberately very similar to 
1744 +those of 
1745 +.I GNU gzip, 
1746 +but they are not identical.
1747 +
1748 +.I bzip2
1749 +expects a list of file names to accompany the
1750 +command-line flags.  Each file is replaced by a compressed version of
1751 +itself, with the name "original_name.bz2".  
1752 +Each compressed file
1753 +has the same modification date, permissions, and, when possible,
1754 +ownership as the corresponding original, so that these properties can
1755 +be correctly restored at decompression time.  File name handling is
1756 +naive in the sense that there is no mechanism for preserving original
1757 +file names, permissions, ownerships or dates in filesystems which lack
1758 +these concepts, or have serious file name length restrictions, such as
1759 +MS-DOS.
1760 +
1761 +.I bzip2
1762 +and
1763 +.I bunzip2
1764 +will by default not overwrite existing
1765 +files.  If you want this to happen, specify the \-f flag.
1766 +
1767 +If no file names are specified,
1768 +.I bzip2
1769 +compresses from standard
1770 +input to standard output.  In this case,
1771 +.I bzip2
1772 +will decline to
1773 +write compressed output to a terminal, as this would be entirely
1774 +incomprehensible and therefore pointless.
1775 +
1776 +.I bunzip2
1777 +(or
1778 +.I bzip2 \-d) 
1779 +decompresses all
1780 +specified files.  Files which were not created by 
1781 +.I bzip2
1782 +will be detected and ignored, and a warning issued.  
1783 +.I bzip2
1784 +attempts to guess the filename for the decompressed file 
1785 +from that of the compressed file as follows:
1786 +
1787 +       filename.bz2    becomes   filename
1788 +       filename.bz     becomes   filename
1789 +       filename.tbz2   becomes   filename.tar
1790 +       filename.tbz    becomes   filename.tar
1791 +       anyothername    becomes   anyothername.out
1792 +
1793 +If the file does not end in one of the recognised endings, 
1794 +.I .bz2, 
1795 +.I .bz, 
1796 +.I .tbz2
1797 +or
1798 +.I .tbz, 
1799 +.I bzip2 
1800 +complains that it cannot
1801 +guess the name of the original file, and uses the original name
1802 +with
1803 +.I .out
1804 +appended.
1805 +
1806 +As with compression, supplying no
1807 +filenames causes decompression from 
1808 +standard input to standard output.
1809 +
1810 +.I bunzip2 
1811 +will correctly decompress a file which is the
1812 +concatenation of two or more compressed files.  The result is the
1813 +concatenation of the corresponding uncompressed files.  Integrity
1814 +testing (\-t) 
1815 +of concatenated 
1816 +compressed files is also supported.
1817 +
1818 +You can also compress or decompress files to the standard output by
1819 +giving the \-c flag.  Multiple files may be compressed and
1820 +decompressed like this.  The resulting outputs are fed sequentially to
1821 +stdout.  Compression of multiple files 
1822 +in this manner generates a stream
1823 +containing multiple compressed file representations.  Such a stream
1824 +can be decompressed correctly only by
1825 +.I bzip2 
1826 +version 0.9.0 or
1827 +later.  Earlier versions of
1828 +.I bzip2
1829 +will stop after decompressing
1830 +the first file in the stream.
1831 +
1832 +.I bzcat
1833 +(or
1834 +.I bzip2 -dc) 
1835 +decompresses all specified files to
1836 +the standard output.
1837 +
1838 +.I bzip2
1839 +will read arguments from the environment variables
1840 +.I BZIP2
1841 +and
1842 +.I BZIP,
1843 +in that order, and will process them
1844 +before any arguments read from the command line.  This gives a 
1845 +convenient way to supply default arguments.
1846 +
1847 +Compression is always performed, even if the compressed 
1848 +file is slightly
1849 +larger than the original.  Files of less than about one hundred bytes
1850 +tend to get larger, since the compression mechanism has a constant
1851 +overhead in the region of 50 bytes.  Random data (including the output
1852 +of most file compressors) is coded at about 8.05 bits per byte, giving
1853 +an expansion of around 0.5%.
1854 +
1855 +As a self-check for your protection, 
1856 +.I 
1857 +bzip2
1858 +uses 32-bit CRCs to
1859 +make sure that the decompressed version of a file is identical to the
1860 +original.  This guards against corruption of the compressed data, and
1861 +against undetected bugs in
1862 +.I bzip2
1863 +(hopefully very unlikely).  The
1864 +chances of data corruption going undetected is microscopic, about one
1865 +chance in four billion for each file processed.  Be aware, though, that
1866 +the check occurs upon decompression, so it can only tell you that
1867 +something is wrong.  It can't help you 
1868 +recover the original uncompressed
1869 +data.  You can use 
1870 +.I bzip2recover
1871 +to try to recover data from
1872 +damaged files.
1873 +
1874 +Return values: 0 for a normal exit, 1 for environmental problems (file
1875 +not found, invalid flags, I/O errors, &c), 2 to indicate a corrupt
1876 +compressed file, 3 for an internal consistency error (eg, bug) which
1877 +caused
1878 +.I bzip2
1879 +to panic.
1880 +
1881 +.SH OPTIONS
1882 +.TP
1883 +.B \-c --stdout
1884 +Compress or decompress to standard output.
1885 +.TP
1886 +.B \-d --decompress
1887 +Force decompression.  
1888 +.I bzip2, 
1889 +.I bunzip2 
1890 +and
1891 +.I bzcat 
1892 +are
1893 +really the same program, and the decision about what actions to take is
1894 +done on the basis of which name is used.  This flag overrides that
1895 +mechanism, and forces 
1896 +.I bzip2
1897 +to decompress.
1898 +.TP
1899 +.B \-z --compress
1900 +The complement to \-d: forces compression, regardless of the
1901 +invokation name.
1902 +.TP
1903 +.B \-t --test
1904 +Check integrity of the specified file(s), but don't decompress them.
1905 +This really performs a trial decompression and throws away the result.
1906 +.TP
1907 +.B \-f --force
1908 +Force overwrite of output files.  Normally,
1909 +.I bzip2 
1910 +will not overwrite
1911 +existing output files.  Also forces 
1912 +.I bzip2 
1913 +to break hard links
1914 +to files, which it otherwise wouldn't do.
1915 +.TP
1916 +.B \-k --keep
1917 +Keep (don't delete) input files during compression
1918 +or decompression.
1919 +.TP
1920 +.B \-s --small
1921 +Reduce memory usage, for compression, decompression and testing.  Files
1922 +are decompressed and tested using a modified algorithm which only
1923 +requires 2.5 bytes per block byte.  This means any file can be
1924 +decompressed in 2300k of memory, albeit at about half the normal speed.
1925 +
1926 +During compression, \-s selects a block size of 200k, which limits
1927 +memory use to around the same figure, at the expense of your compression
1928 +ratio.  In short, if your machine is low on memory (8 megabytes or
1929 +less), use \-s for everything.  See MEMORY MANAGEMENT below.
1930 +.TP
1931 +.B \-q --quiet
1932 +Suppress non-essential warning messages.  Messages pertaining to
1933 +I/O errors and other critical events will not be suppressed.
1934 +.TP
1935 +.B \-v --verbose
1936 +Verbose mode -- show the compression ratio for each file processed.
1937 +Further \-v's increase the verbosity level, spewing out lots of
1938 +information which is primarily of interest for diagnostic purposes.
1939 +.TP
1940 +.B \-L --license -V --version
1941 +Display the software version, license terms and conditions.
1942 +.TP
1943 +.B \-1 to \-9
1944 +Set the block size to 100 k, 200 k ..  900 k when compressing.  Has no
1945 +effect when decompressing.  See MEMORY MANAGEMENT below.
1946 +.TP
1947 +.B \--
1948 +Treats all subsequent arguments as file names, even if they start
1949 +with a dash.  This is so you can handle files with names beginning
1950 +with a dash, for example: bzip2 \-- \-myfilename.
1951 +.TP
1952 +.B \--repetitive-fast --repetitive-best
1953 +These flags are redundant in versions 0.9.5 and above.  They provided
1954 +some coarse control over the behaviour of the sorting algorithm in
1955 +earlier versions, which was sometimes useful.  0.9.5 and above have an
1956 +improved algorithm which renders these flags irrelevant.
1957 +
1958 +.SH MEMORY MANAGEMENT
1959 +.I bzip2 
1960 +compresses large files in blocks.  The block size affects
1961 +both the compression ratio achieved, and the amount of memory needed for
1962 +compression and decompression.  The flags \-1 through \-9
1963 +specify the block size to be 100,000 bytes through 900,000 bytes (the
1964 +default) respectively.  At decompression time, the block size used for
1965 +compression is read from the header of the compressed file, and
1966 +.I bunzip2
1967 +then allocates itself just enough memory to decompress
1968 +the file.  Since block sizes are stored in compressed files, it follows
1969 +that the flags \-1 to \-9 are irrelevant to and so ignored
1970 +during decompression.
1971 +
1972 +Compression and decompression requirements, 
1973 +in bytes, can be estimated as:
1974 +
1975 +       Compression:   400k + ( 8 x block size )
1976 +
1977 +       Decompression: 100k + ( 4 x block size ), or
1978 +                      100k + ( 2.5 x block size )
1979 +
1980 +Larger block sizes give rapidly diminishing marginal returns.  Most of
1981 +the compression comes from the first two or three hundred k of block
1982 +size, a fact worth bearing in mind when using
1983 +.I bzip2
1984 +on small machines.
1985 +It is also important to appreciate that the decompression memory
1986 +requirement is set at compression time by the choice of block size.
1987 +
1988 +For files compressed with the default 900k block size,
1989 +.I bunzip2
1990 +will require about 3700 kbytes to decompress.  To support decompression
1991 +of any file on a 4 megabyte machine, 
1992 +.I bunzip2
1993 +has an option to
1994 +decompress using approximately half this amount of memory, about 2300
1995 +kbytes.  Decompression speed is also halved, so you should use this
1996 +option only where necessary.  The relevant flag is -s.
1997 +
1998 +In general, try and use the largest block size memory constraints allow,
1999 +since that maximises the compression achieved.  Compression and
2000 +decompression speed are virtually unaffected by block size.
2001 +
2002 +Another significant point applies to files which fit in a single block
2003 +-- that means most files you'd encounter using a large block size.  The
2004 +amount of real memory touched is proportional to the size of the file,
2005 +since the file is smaller than a block.  For example, compressing a file
2006 +20,000 bytes long with the flag -9 will cause the compressor to
2007 +allocate around 7600k of memory, but only touch 400k + 20000 * 8 = 560
2008 +kbytes of it.  Similarly, the decompressor will allocate 3700k but only
2009 +touch 100k + 20000 * 4 = 180 kbytes.
2010 +
2011 +Here is a table which summarises the maximum memory usage for different
2012 +block sizes.  Also recorded is the total compressed size for 14 files of
2013 +the Calgary Text Compression Corpus totalling 3,141,622 bytes.  This
2014 +column gives some feel for how compression varies with block size.
2015 +These figures tend to understate the advantage of larger block sizes for
2016 +larger files, since the Corpus is dominated by smaller files.
2017 +
2018 +           Compress   Decompress   Decompress   Corpus
2019 +    Flag     usage      usage       -s usage     Size
2020 +
2021 +     -1      1200k       500k         350k      914704
2022 +     -2      2000k       900k         600k      877703
2023 +     -3      2800k      1300k         850k      860338
2024 +     -4      3600k      1700k        1100k      846899
2025 +     -5      4400k      2100k        1350k      845160
2026 +     -6      5200k      2500k        1600k      838626
2027 +     -7      6100k      2900k        1850k      834096
2028 +     -8      6800k      3300k        2100k      828642
2029 +     -9      7600k      3700k        2350k      828642
2030 +
2031 +.SH RECOVERING DATA FROM DAMAGED FILES
2032 +.I bzip2
2033 +compresses files in blocks, usually 900kbytes long.  Each
2034 +block is handled independently.  If a media or transmission error causes
2035 +a multi-block .bz2
2036 +file to become damaged, it may be possible to
2037 +recover data from the undamaged blocks in the file.
2038 +
2039 +The compressed representation of each block is delimited by a 48-bit
2040 +pattern, which makes it possible to find the block boundaries with
2041 +reasonable certainty.  Each block also carries its own 32-bit CRC, so
2042 +damaged blocks can be distinguished from undamaged ones.
2043 +
2044 +.I bzip2recover
2045 +is a simple program whose purpose is to search for
2046 +blocks in .bz2 files, and write each block out into its own .bz2 
2047 +file.  You can then use
2048 +.I bzip2 
2049 +\-t
2050 +to test the
2051 +integrity of the resulting files, and decompress those which are
2052 +undamaged.
2053 +
2054 +.I bzip2recover
2055 +takes a single argument, the name of the damaged file, 
2056 +and writes a number of files "rec0001file.bz2",
2057 +"rec0002file.bz2", etc, containing the  extracted  blocks.
2058 +The  output  filenames  are  designed  so  that the use of
2059 +wildcards in subsequent processing -- for example,  
2060 +"bzip2 -dc  rec*file.bz2 > recovered_data" -- lists the files in
2061 +the correct order.
2062 +
2063 +.I bzip2recover
2064 +should be of most use dealing with large .bz2
2065 +files,  as  these will contain many blocks.  It is clearly
2066 +futile to use it on damaged single-block  files,  since  a
2067 +damaged  block  cannot  be recovered.  If you wish to minimise 
2068 +any potential data loss through media  or  transmission errors, 
2069 +you might consider compressing with a smaller
2070 +block size.
2071 +
2072 +.SH PERFORMANCE NOTES
2073 +The sorting phase of compression gathers together similar strings in the
2074 +file.  Because of this, files containing very long runs of repeated
2075 +symbols, like "aabaabaabaab ..."  (repeated several hundred times) may
2076 +compress more slowly than normal.  Versions 0.9.5 and above fare much
2077 +better than previous versions in this respect.  The ratio between
2078 +worst-case and average-case compression time is in the region of 10:1.
2079 +For previous versions, this figure was more like 100:1.  You can use the
2080 +\-vvvv option to monitor progress in great detail, if you want.
2081 +
2082 +Decompression speed is unaffected by these phenomena.
2083 +
2084 +.I bzip2
2085 +usually allocates several megabytes of memory to operate
2086 +in, and then charges all over it in a fairly random fashion.  This means
2087 +that performance, both for compressing and decompressing, is largely
2088 +determined by the speed at which your machine can service cache misses.
2089 +Because of this, small changes to the code to reduce the miss rate have
2090 +been observed to give disproportionately large performance improvements.
2091 +I imagine 
2092 +.I bzip2
2093 +will perform best on machines with very large caches.
2094 +
2095 +.SH CAVEATS
2096 +I/O error messages are not as helpful as they could be.
2097 +.I bzip2
2098 +tries hard to detect I/O errors and exit cleanly, but the details of
2099 +what the problem is sometimes seem rather misleading.
2100 +
2101 +This manual page pertains to version 1.0 of
2102 +.I bzip2.  
2103 +Compressed
2104 +data created by this version is entirely forwards and backwards
2105 +compatible with the previous public releases, versions 0.1pl2, 0.9.0
2106 +and 0.9.5,
2107 +but with the following exception: 0.9.0 and above can correctly
2108 +decompress multiple concatenated compressed files.  0.1pl2 cannot do
2109 +this; it will stop after decompressing just the first file in the
2110 +stream.
2111 +
2112 +.I bzip2recover
2113 +uses 32-bit integers to represent bit positions in
2114 +compressed files, so it cannot handle compressed files more than 512
2115 +megabytes long.  This could easily be fixed.
2116 +
2117 +.SH AUTHOR
2118 +Julian Seward, jseward@acm.org.
2119 +
2120 +http://sourceware.cygnus.com/bzip2
2121 +http://www.muraroa.demon.co.uk
2122 +
2123 +The ideas embodied in
2124 +.I bzip2
2125 +are due to (at least) the following
2126 +people: Michael Burrows and David Wheeler (for the block sorting
2127 +transformation), David Wheeler (again, for the Huffman coder), Peter
2128 +Fenwick (for the structured coding model in the original
2129 +.I bzip,
2130 +and many refinements), and Alistair Moffat, Radford Neal and Ian Witten
2131 +(for the arithmetic coder in the original
2132 +.I bzip).  
2133 +I am much
2134 +indebted for their help, support and advice.  See the manual in the
2135 +source distribution for pointers to sources of documentation.  Christian
2136 +von Roques encouraged me to look for faster sorting algorithms, so as to
2137 +speed up compression.  Bela Lubkin encouraged me to improve the
2138 +worst-case compression performance.  Many people sent patches, helped
2139 +with portability problems, lent machines, gave advice and were generally
2140 +helpful.
2141 diff -Nru bzip2-1.0.1/doc/bzip2.texi bzip2-1.0.1.new/doc/bzip2.texi
2142 --- bzip2-1.0.1/doc/bzip2.texi  Thu Jan  1 01:00:00 1970
2143 +++ bzip2-1.0.1.new/doc/bzip2.texi      Sat Jun 24 20:13:06 2000
2144 @@ -0,0 +1,2217 @@
2145 +\input texinfo  @c                                  -*- Texinfo -*-
2146 +@setfilename bzip2.info
2147 +
2148 +@ignore
2149 +This file documents bzip2 version 1.0, and associated library
2150 +libbzip2, written by Julian Seward (jseward@acm.org).
2151 +
2152 +Copyright (C) 1996-2000 Julian R Seward
2153 +
2154 +Permission is granted to make and distribute verbatim copies of
2155 +this manual provided the copyright notice and this permission notice
2156 +are preserved on all copies.
2157 +
2158 +Permission is granted to copy and distribute translations of this manual
2159 +into another language, under the above conditions for verbatim copies.
2160 +@end ignore
2161 +
2162 +@ifinfo
2163 +@format
2164 +@dircategory File utilities:
2165 +* Bzip2: (bzip2).                      A program and library for data
2166 +                                       compression
2167 +@end direntry
2168 +@end format
2169 +@end ifinfo
2170 +
2171 +@iftex
2172 +@c @finalout
2173 +@settitle bzip2 and libbzip2
2174 +@titlepage
2175 +@title bzip2 and libbzip2
2176 +@subtitle a program and library for data compression
2177 +@subtitle copyright (C) 1996-2000 Julian Seward
2178 +@subtitle version 1.0 of 21 March 2000
2179 +@author Julian Seward
2180 +
2181 +@end titlepage
2182 +
2183 +@parindent 0mm
2184 +@parskip 2mm
2185 +
2186 +@end iftex
2187 +@node Top, Overview, (dir), (dir)
2188 +
2189 +@top bzip2
2190 +
2191 +This program, @code{bzip2}, 
2192 +and associated library @code{libbzip2}, are
2193 +Copyright (C) 1996-2000 Julian R Seward.  All rights reserved.
2194 +
2195 +Redistribution and use in source and binary forms, with or without
2196 +modification, are permitted provided that the following conditions
2197 +are met:
2198 +@itemize @bullet
2199 +@item
2200 +   Redistributions of source code must retain the above copyright
2201 +   notice, this list of conditions and the following disclaimer.
2202 +@item
2203 +   The origin of this software must not be misrepresented; you must 
2204 +   not claim that you wrote the original software.  If you use this 
2205 +   software in a product, an acknowledgment in the product 
2206 +   documentation would be appreciated but is not required.
2207 +@item
2208 +   Altered source versions must be plainly marked as such, and must
2209 +   not be misrepresented as being the original software.
2210 +@item
2211 +   The name of the author may not be used to endorse or promote 
2212 +   products derived from this software without specific prior written 
2213 +   permission.
2214 +@end itemize
2215 +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
2216 +OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
2217 +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2218 +ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
2219 +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2220 +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
2221 +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2222 +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
2223 +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
2224 +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
2225 +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2226 +
2227 +Julian Seward, Cambridge, UK.
2228 +
2229 +@code{jseward@@acm.org}
2230 +
2231 +@code{http://sourceware.cygnus.com/bzip2}
2232 +
2233 +@code{http://www.cacheprof.org}
2234 +
2235 +@code{http://www.muraroa.demon.co.uk}
2236 +
2237 +@code{bzip2}/@code{libbzip2} version 1.0 of 21 March 2000.
2238 +
2239 +PATENTS: To the best of my knowledge, @code{bzip2} does not use any patented
2240 +algorithms.  However, I do not have the resources available to carry out
2241 +a full patent search.  Therefore I cannot give any guarantee of the
2242 +above statement.
2243 +
2244 +
2245 +
2246 +
2247 +
2248 +
2249 +
2250 +@node Overview, Implementation, Top, Top
2251 +@chapter Introduction
2252 +
2253 +@code{bzip2}  compresses  files  using the Burrows-Wheeler 
2254 +block-sorting text compression algorithm,  and  Huffman  coding.
2255 +Compression  is  generally  considerably  better than that
2256 +achieved by more conventional LZ77/LZ78-based compressors,
2257 +and  approaches  the performance of the PPM family of statistical compressors.
2258 +
2259 +@code{bzip2} is built on top of @code{libbzip2}, a flexible library
2260 +for handling compressed data in the @code{bzip2} format.  This manual
2261 +describes both how to use the program and 
2262 +how to work with the library interface.  Most of the
2263 +manual is devoted to this library, not the program, 
2264 +which is good news if your interest is only in the program.
2265 +
2266 +Chapter 2 describes how to use @code{bzip2}; this is the only part 
2267 +you need to read if you just want to know how to operate the program.
2268 +Chapter 3 describes the programming interfaces in detail, and
2269 +Chapter 4 records some miscellaneous notes which I thought
2270 +ought to be recorded somewhere.
2271 +
2272 +
2273 +@chapter How to use @code{bzip2}
2274 +
2275 +This chapter contains a copy of the @code{bzip2} man page,
2276 +and nothing else.
2277 +
2278 +@quotation
2279 +
2280 +@unnumberedsubsubsec NAME
2281 +@itemize
2282 +@item @code{bzip2}, @code{bunzip2}
2283 +- a block-sorting file compressor, v1.0
2284 +@item @code{bzcat} 
2285 +- decompresses files to stdout
2286 +@item @code{bzip2recover}
2287 +- recovers data from damaged bzip2 files
2288 +@end itemize
2289 +
2290 +@unnumberedsubsubsec SYNOPSIS
2291 +@itemize
2292 +@item @code{bzip2} [ -cdfkqstvzVL123456789 ] [ filenames ...  ]
2293 +@item @code{bunzip2} [ -fkvsVL ] [ filenames ...  ]
2294 +@item @code{bzcat} [ -s ] [ filenames ...  ]
2295 +@item @code{bzip2recover} filename
2296 +@end itemize
2297 +
2298 +@unnumberedsubsubsec DESCRIPTION
2299 +
2300 +@code{bzip2} compresses files using the Burrows-Wheeler block sorting
2301 +text compression algorithm, and Huffman coding.  Compression is
2302 +generally considerably better than that achieved by more conventional
2303 +LZ77/LZ78-based compressors, and approaches the performance of the PPM
2304 +family of statistical compressors.
2305 +
2306 +The command-line options are deliberately very similar to those of GNU
2307 +@code{gzip}, but they are not identical.
2308 +
2309 +@code{bzip2} expects a list of file names to accompany the command-line
2310 +flags.  Each file is replaced by a compressed version of itself, with
2311 +the name @code{original_name.bz2}.  Each compressed file has the same
2312 +modification date, permissions, and, when possible, ownership as the
2313 +corresponding original, so that these properties can be correctly
2314 +restored at decompression time.  File name handling is naive in the
2315 +sense that there is no mechanism for preserving original file names,
2316 +permissions, ownerships or dates in filesystems which lack these
2317 +concepts, or have serious file name length restrictions, such as MS-DOS.
2318 +
2319 +@code{bzip2} and @code{bunzip2} will by default not overwrite existing
2320 +files.  If you want this to happen, specify the @code{-f} flag.
2321 +
2322 +If no file names are specified, @code{bzip2} compresses from standard
2323 +input to standard output.  In this case, @code{bzip2} will decline to
2324 +write compressed output to a terminal, as this would be entirely
2325 +incomprehensible and therefore pointless.
2326 +
2327 +@code{bunzip2} (or @code{bzip2 -d}) decompresses all
2328 +specified files.  Files which were not created by @code{bzip2}
2329 +will be detected and ignored, and a warning issued.  
2330 +@code{bzip2} attempts to guess the filename for the decompressed file 
2331 +from that of the compressed file as follows:
2332 +@itemize
2333 +@item @code{filename.bz2 } becomes @code{filename}
2334 +@item @code{filename.bz  } becomes @code{filename}
2335 +@item @code{filename.tbz2} becomes @code{filename.tar}
2336 +@item @code{filename.tbz } becomes @code{filename.tar}
2337 +@item @code{anyothername } becomes @code{anyothername.out}
2338 +@end itemize
2339 +If the file does not end in one of the recognised endings, 
2340 +@code{.bz2}, @code{.bz}, 
2341 +@code{.tbz2} or @code{.tbz}, @code{bzip2} complains that it cannot
2342 +guess the name of the original file, and uses the original name
2343 +with @code{.out} appended.
2344 +
2345 +As with compression, supplying no
2346 +filenames causes decompression from standard input to standard output.
2347 +
2348 +@code{bunzip2} will correctly decompress a file which is the
2349 +concatenation of two or more compressed files.  The result is the
2350 +concatenation of the corresponding uncompressed files.  Integrity
2351 +testing (@code{-t}) of concatenated compressed files is also supported.
2352 +
2353 +You can also compress or decompress files to the standard output by
2354 +giving the @code{-c} flag.  Multiple files may be compressed and
2355 +decompressed like this.  The resulting outputs are fed sequentially to
2356 +stdout.  Compression of multiple files in this manner generates a stream
2357 +containing multiple compressed file representations.  Such a stream
2358 +can be decompressed correctly only by @code{bzip2} version 0.9.0 or
2359 +later.  Earlier versions of @code{bzip2} will stop after decompressing
2360 +the first file in the stream.
2361 +
2362 +@code{bzcat} (or @code{bzip2 -dc}) decompresses all specified files to
2363 +the standard output.
2364 +
2365 +@code{bzip2} will read arguments from the environment variables
2366 +@code{BZIP2} and @code{BZIP}, in that order, and will process them
2367 +before any arguments read from the command line.  This gives a 
2368 +convenient way to supply default arguments.
2369 +
2370 +Compression is always performed, even if the compressed file is slightly
2371 +larger than the original.  Files of less than about one hundred bytes
2372 +tend to get larger, since the compression mechanism has a constant
2373 +overhead in the region of 50 bytes.  Random data (including the output
2374 +of most file compressors) is coded at about 8.05 bits per byte, giving
2375 +an expansion of around 0.5%.
2376 +
2377 +As a self-check for your protection, @code{bzip2} uses 32-bit CRCs to
2378 +make sure that the decompressed version of a file is identical to the
2379 +original.  This guards against corruption of the compressed data, and
2380 +against undetected bugs in @code{bzip2} (hopefully very unlikely).  The
2381 +chances of data corruption going undetected is microscopic, about one
2382 +chance in four billion for each file processed.  Be aware, though, that
2383 +the check occurs upon decompression, so it can only tell you that
2384 +something is wrong.  It can't help you recover the original uncompressed
2385 +data.  You can use @code{bzip2recover} to try to recover data from
2386 +damaged files.
2387 +
2388 +Return values: 0 for a normal exit, 1 for environmental problems (file
2389 +not found, invalid flags, I/O errors, &c), 2 to indicate a corrupt
2390 +compressed file, 3 for an internal consistency error (eg, bug) which
2391 +caused @code{bzip2} to panic.
2392 +
2393 +
2394 +@unnumberedsubsubsec OPTIONS
2395 +@table @code
2396 +@item -c  --stdout
2397 +Compress or decompress to standard output.
2398 +@item -d  --decompress
2399 +Force decompression.  @code{bzip2}, @code{bunzip2} and @code{bzcat} are
2400 +really the same program, and the decision about what actions to take is
2401 +done on the basis of which name is used.  This flag overrides that
2402 +mechanism, and forces bzip2 to decompress.
2403 +@item -z --compress
2404 +The complement to @code{-d}: forces compression, regardless of the
2405 +invokation name.
2406 +@item -t --test
2407 +Check integrity of the specified file(s), but don't decompress them.
2408 +This really performs a trial decompression and throws away the result.
2409 +@item -f --force
2410 +Force overwrite of output files.  Normally, @code{bzip2} will not overwrite
2411 +existing output files.  Also forces @code{bzip2} to break hard links
2412 +to files, which it otherwise wouldn't do.
2413 +@item -k --keep
2414 +Keep (don't delete) input files during compression
2415 +or decompression.
2416 +@item -s --small
2417 +Reduce memory usage, for compression, decompression and testing.  Files
2418 +are decompressed and tested using a modified algorithm which only
2419 +requires 2.5 bytes per block byte.  This means any file can be
2420 +decompressed in 2300k of memory, albeit at about half the normal speed.
2421 +
2422 +During compression, @code{-s} selects a block size of 200k, which limits
2423 +memory use to around the same figure, at the expense of your compression
2424 +ratio.  In short, if your machine is low on memory (8 megabytes or
2425 +less), use -s for everything.  See MEMORY MANAGEMENT below.
2426 +@item -q --quiet
2427 +Suppress non-essential warning messages.  Messages pertaining to
2428 +I/O errors and other critical events will not be suppressed.
2429 +@item -v --verbose
2430 +Verbose mode -- show the compression ratio for each file processed.
2431 +Further @code{-v}'s increase the verbosity level, spewing out lots of
2432 +information which is primarily of interest for diagnostic purposes.
2433 +@item -L --license -V --version
2434 +Display the software version, license terms and conditions.
2435 +@item -1 to -9
2436 +Set the block size to 100 k, 200 k ..  900 k when compressing.  Has no
2437 +effect when decompressing.  See MEMORY MANAGEMENT below.
2438 +@item --
2439 +Treats all subsequent arguments as file names, even if they start
2440 +with a dash.  This is so you can handle files with names beginning
2441 +with a dash, for example: @code{bzip2 -- -myfilename}.
2442 +@item --repetitive-fast 
2443 +@item --repetitive-best
2444 +These flags are redundant in versions 0.9.5 and above.  They provided
2445 +some coarse control over the behaviour of the sorting algorithm in
2446 +earlier versions, which was sometimes useful.  0.9.5 and above have an
2447 +improved algorithm which renders these flags irrelevant.
2448 +@end table
2449 +
2450 +
2451 +@unnumberedsubsubsec MEMORY MANAGEMENT
2452 +
2453 +@code{bzip2} compresses large files in blocks.  The block size affects
2454 +both the compression ratio achieved, and the amount of memory needed for
2455 +compression and decompression.  The flags @code{-1} through @code{-9}
2456 +specify the block size to be 100,000 bytes through 900,000 bytes (the
2457 +default) respectively.  At decompression time, the block size used for
2458 +compression is read from the header of the compressed file, and
2459 +@code{bunzip2} then allocates itself just enough memory to decompress
2460 +the file.  Since block sizes are stored in compressed files, it follows
2461 +that the flags @code{-1} to @code{-9} are irrelevant to and so ignored
2462 +during decompression.
2463 +
2464 +Compression and decompression requirements, in bytes, can be estimated
2465 +as:
2466 +@example
2467 +     Compression:   400k + ( 8 x block size )
2468 +
2469 +     Decompression: 100k + ( 4 x block size ), or
2470 +                    100k + ( 2.5 x block size )
2471 +@end example
2472 +Larger block sizes give rapidly diminishing marginal returns.  Most of
2473 +the compression comes from the first two or three hundred k of block
2474 +size, a fact worth bearing in mind when using @code{bzip2} on small machines.
2475 +It is also important to appreciate that the decompression memory
2476 +requirement is set at compression time by the choice of block size.
2477 +
2478 +For files compressed with the default 900k block size, @code{bunzip2}
2479 +will require about 3700 kbytes to decompress.  To support decompression
2480 +of any file on a 4 megabyte machine, @code{bunzip2} has an option to
2481 +decompress using approximately half this amount of memory, about 2300
2482 +kbytes.  Decompression speed is also halved, so you should use this
2483 +option only where necessary.  The relevant flag is @code{-s}.
2484 +
2485 +In general, try and use the largest block size memory constraints allow,
2486 +since that maximises the compression achieved.  Compression and
2487 +decompression speed are virtually unaffected by block size.
2488 +
2489 +Another significant point applies to files which fit in a single block
2490 +-- that means most files you'd encounter using a large block size.  The
2491 +amount of real memory touched is proportional to the size of the file,
2492 +since the file is smaller than a block.  For example, compressing a file
2493 +20,000 bytes long with the flag @code{-9} will cause the compressor to
2494 +allocate around 7600k of memory, but only touch 400k + 20000 * 8 = 560
2495 +kbytes of it.  Similarly, the decompressor will allocate 3700k but only
2496 +touch 100k + 20000 * 4 = 180 kbytes.
2497 +
2498 +Here is a table which summarises the maximum memory usage for different
2499 +block sizes.  Also recorded is the total compressed size for 14 files of
2500 +the Calgary Text Compression Corpus totalling 3,141,622 bytes.  This
2501 +column gives some feel for how compression varies with block size.
2502 +These figures tend to understate the advantage of larger block sizes for
2503 +larger files, since the Corpus is dominated by smaller files.
2504 +@example
2505 +          Compress   Decompress   Decompress   Corpus
2506 +   Flag     usage      usage       -s usage     Size
2507 +
2508 +    -1      1200k       500k         350k      914704
2509 +    -2      2000k       900k         600k      877703
2510 +    -3      2800k      1300k         850k      860338
2511 +    -4      3600k      1700k        1100k      846899
2512 +    -5      4400k      2100k        1350k      845160
2513 +    -6      5200k      2500k        1600k      838626
2514 +    -7      6100k      2900k        1850k      834096
2515 +    -8      6800k      3300k        2100k      828642
2516 +    -9      7600k      3700k        2350k      828642
2517 +@end example
2518 +
2519 +@unnumberedsubsubsec RECOVERING DATA FROM DAMAGED FILES
2520 +
2521 +@code{bzip2} compresses files in blocks, usually 900kbytes long.  Each
2522 +block is handled independently.  If a media or transmission error causes
2523 +a multi-block @code{.bz2} file to become damaged, it may be possible to
2524 +recover data from the undamaged blocks in the file.
2525 +
2526 +The compressed representation of each block is delimited by a 48-bit
2527 +pattern, which makes it possible to find the block boundaries with
2528 +reasonable certainty.  Each block also carries its own 32-bit CRC, so
2529 +damaged blocks can be distinguished from undamaged ones.
2530 +
2531 +@code{bzip2recover} is a simple program whose purpose is to search for
2532 +blocks in @code{.bz2} files, and write each block out into its own
2533 +@code{.bz2} file.  You can then use @code{bzip2 -t} to test the
2534 +integrity of the resulting files, and decompress those which are
2535 +undamaged.
2536 +
2537 +@code{bzip2recover} 
2538 +takes a single argument, the name of the damaged file, 
2539 +and writes a number of files @code{rec0001file.bz2},
2540 +       @code{rec0002file.bz2}, etc, containing the  extracted  blocks.
2541 +       The  output  filenames  are  designed  so  that the use of
2542 +       wildcards in subsequent processing -- for example,  
2543 +@code{bzip2 -dc  rec*file.bz2 > recovered_data} -- lists the files in
2544 +       the correct order.
2545 +
2546 +@code{bzip2recover} should be of most use dealing with large @code{.bz2}
2547 +       files,  as  these will contain many blocks.  It is clearly
2548 +       futile to use it on damaged single-block  files,  since  a
2549 +       damaged  block  cannot  be recovered.  If you wish to minimise 
2550 +any potential data loss through media  or  transmission errors, 
2551 +you might consider compressing with a smaller
2552 +       block size.
2553 +
2554 +
2555 +@unnumberedsubsubsec PERFORMANCE NOTES
2556 +
2557 +The sorting phase of compression gathers together similar strings in the
2558 +file.  Because of this, files containing very long runs of repeated
2559 +symbols, like "aabaabaabaab ..."  (repeated several hundred times) may
2560 +compress more slowly than normal.  Versions 0.9.5 and above fare much
2561 +better than previous versions in this respect.  The ratio between
2562 +worst-case and average-case compression time is in the region of 10:1.
2563 +For previous versions, this figure was more like 100:1.  You can use the
2564 +@code{-vvvv} option to monitor progress in great detail, if you want.
2565 +
2566 +Decompression speed is unaffected by these phenomena.
2567 +
2568 +@code{bzip2} usually allocates several megabytes of memory to operate
2569 +in, and then charges all over it in a fairly random fashion.  This means
2570 +that performance, both for compressing and decompressing, is largely
2571 +determined by the speed at which your machine can service cache misses.
2572 +Because of this, small changes to the code to reduce the miss rate have
2573 +been observed to give disproportionately large performance improvements.
2574 +I imagine @code{bzip2} will perform best on machines with very large
2575 +caches.
2576 +
2577 +
2578 +@unnumberedsubsubsec CAVEATS
2579 +
2580 +I/O error messages are not as helpful as they could be.  @code{bzip2}
2581 +tries hard to detect I/O errors and exit cleanly, but the details of
2582 +what the problem is sometimes seem rather misleading.
2583 +
2584 +This manual page pertains to version 1.0 of @code{bzip2}.  Compressed
2585 +data created by this version is entirely forwards and backwards
2586 +compatible with the previous public releases, versions 0.1pl2, 0.9.0 and
2587 +0.9.5, but with the following exception: 0.9.0 and above can correctly
2588 +decompress multiple concatenated compressed files.  0.1pl2 cannot do
2589 +this; it will stop after decompressing just the first file in the
2590 +stream.
2591 +
2592 +@code{bzip2recover} uses 32-bit integers to represent bit positions in
2593 +compressed files, so it cannot handle compressed files more than 512
2594 +megabytes long.  This could easily be fixed.
2595 +
2596 +
2597 +@unnumberedsubsubsec AUTHOR
2598 +Julian Seward, @code{jseward@@acm.org}.
2599 +
2600 +The ideas embodied in @code{bzip2} are due to (at least) the following
2601 +people: Michael Burrows and David Wheeler (for the block sorting
2602 +transformation), David Wheeler (again, for the Huffman coder), Peter
2603 +Fenwick (for the structured coding model in the original @code{bzip},
2604 +and many refinements), and Alistair Moffat, Radford Neal and Ian Witten
2605 +(for the arithmetic coder in the original @code{bzip}).  I am much
2606 +indebted for their help, support and advice.  See the manual in the
2607 +source distribution for pointers to sources of documentation.  Christian
2608 +von Roques encouraged me to look for faster sorting algorithms, so as to
2609 +speed up compression.  Bela Lubkin encouraged me to improve the
2610 +worst-case compression performance.  Many people sent patches, helped
2611 +with portability problems, lent machines, gave advice and were generally
2612 +helpful.
2613 +
2614 +@end quotation
2615 +
2616 +
2617 +
2618 +
2619 +@chapter Programming with @code{libbzip2}
2620 +
2621 +This chapter describes the programming interface to @code{libbzip2}.
2622 +
2623 +For general background information, particularly about memory
2624 +use and performance aspects, you'd be well advised to read Chapter 2
2625 +as well.
2626 +
2627 +@section Top-level structure
2628 +
2629 +@code{libbzip2} is a flexible library for compressing and decompressing
2630 +data in the @code{bzip2} data format.  Although packaged as a single
2631 +entity, it helps to regard the library as three separate parts: the low
2632 +level interface, and the high level interface, and some utility
2633 +functions.
2634 +
2635 +The structure of @code{libbzip2}'s interfaces is similar to
2636 +that of Jean-loup Gailly's and Mark Adler's excellent @code{zlib} 
2637 +library.
2638 +
2639 +All externally visible symbols have names beginning @code{BZ2_}.
2640 +This is new in version 1.0.  The intention is to minimise pollution
2641 +of the namespaces of library clients.
2642 +
2643 +@subsection Low-level summary
2644 +
2645 +This interface provides services for compressing and decompressing
2646 +data in memory.  There's no provision for dealing with files, streams
2647 +or any other I/O mechanisms, just straight memory-to-memory work.
2648 +In fact, this part of the library can be compiled without inclusion
2649 +of @code{stdio.h}, which may be helpful for embedded applications.
2650 +
2651 +The low-level part of the library has no global variables and
2652 +is therefore thread-safe.
2653 +
2654 +Six routines make up the low level interface: 
2655 +@code{BZ2_bzCompressInit}, @code{BZ2_bzCompress}, and @* @code{BZ2_bzCompressEnd}
2656 +for compression,
2657 +and a corresponding trio @code{BZ2_bzDecompressInit}, @* @code{BZ2_bzDecompress}
2658 +and @code{BZ2_bzDecompressEnd} for decompression.  
2659 +The @code{*Init} functions allocate
2660 +memory for compression/decompression and do other
2661 +initialisations, whilst the @code{*End} functions close down operations
2662 +and release memory.
2663 +
2664 +The real work is done by @code{BZ2_bzCompress} and @code{BZ2_bzDecompress}.  
2665 +These compress and decompress data from a user-supplied input buffer
2666 +to a user-supplied output buffer.  These buffers can be any size;
2667 +arbitrary quantities of data are handled by making repeated calls
2668 +to these functions.  This is a flexible mechanism allowing a 
2669 +consumer-pull style of activity, or producer-push, or a mixture of
2670 +both.
2671 +
2672 +
2673 +
2674 +@subsection High-level summary
2675 +
2676 +This interface provides some handy wrappers around the low-level
2677 +interface to facilitate reading and writing @code{bzip2} format
2678 +files (@code{.bz2} files).  The routines provide hooks to facilitate
2679 +reading files in which the @code{bzip2} data stream is embedded 
2680 +within some larger-scale file structure, or where there are
2681 +multiple @code{bzip2} data streams concatenated end-to-end.
2682 +
2683 +For reading files, @code{BZ2_bzReadOpen}, @code{BZ2_bzRead},
2684 +@code{BZ2_bzReadClose} and @* @code{BZ2_bzReadGetUnused} are supplied.  For
2685 +writing files, @code{BZ2_bzWriteOpen}, @code{BZ2_bzWrite} and
2686 +@code{BZ2_bzWriteFinish} are available.
2687 +
2688 +As with the low-level library, no global variables are used
2689 +so the library is per se thread-safe.  However, if I/O errors
2690 +occur whilst reading or writing the underlying compressed files,
2691 +you may have to consult @code{errno} to determine the cause of
2692 +the error.  In that case, you'd need a C library which correctly
2693 +supports @code{errno} in a multithreaded environment.
2694 +
2695 +To make the library a little simpler and more portable,
2696 +@code{BZ2_bzReadOpen} and @code{BZ2_bzWriteOpen} require you to pass them file
2697 +handles (@code{FILE*}s) which have previously been opened for reading or
2698 +writing respectively.  That avoids portability problems associated with
2699 +file operations and file attributes, whilst not being much of an
2700 +imposition on the programmer.
2701 +
2702 +
2703 +
2704 +@subsection Utility functions summary
2705 +For very simple needs, @code{BZ2_bzBuffToBuffCompress} and
2706 +@code{BZ2_bzBuffToBuffDecompress} are provided.  These compress
2707 +data in memory from one buffer to another buffer in a single
2708 +function call.  You should assess whether these functions
2709 +fulfill your memory-to-memory compression/decompression
2710 +requirements before investing effort in understanding the more
2711 +general but more complex low-level interface.
2712 +
2713 +Yoshioka Tsuneo (@code{QWF00133@@niftyserve.or.jp} /
2714 +@code{tsuneo-y@@is.aist-nara.ac.jp}) has contributed some functions to
2715 +give better @code{zlib} compatibility.  These functions are
2716 +@code{BZ2_bzopen}, @code{BZ2_bzread}, @code{BZ2_bzwrite}, @code{BZ2_bzflush},
2717 +@code{BZ2_bzclose},
2718 +@code{BZ2_bzerror} and @code{BZ2_bzlibVersion}.  You may find these functions
2719 +more convenient for simple file reading and writing, than those in the
2720 +high-level interface.  These functions are not (yet) officially part of
2721 +the library, and are minimally documented here.  If they break, you
2722 +get to keep all the pieces.  I hope to document them properly when time
2723 +permits.
2724 +
2725 +Yoshioka also contributed modifications to allow the library to be
2726 +built as a Windows DLL.
2727 +
2728 +
2729 +@section Error handling
2730 +
2731 +The library is designed to recover cleanly in all situations, including
2732 +the worst-case situation of decompressing random data.  I'm not 
2733 +100% sure that it can always do this, so you might want to add
2734 +a signal handler to catch segmentation violations during decompression
2735 +if you are feeling especially paranoid.  I would be interested in
2736 +hearing more about the robustness of the library to corrupted
2737 +compressed data.
2738 +
2739 +Version 1.0 is much more robust in this respect than
2740 +0.9.0 or 0.9.5.  Investigations with Checker (a tool for 
2741 +detecting problems with memory management, similar to Purify)
2742 +indicate that, at least for the few files I tested, all single-bit
2743 +errors in the decompressed data are caught properly, with no
2744 +segmentation faults, no reads of uninitialised data and no 
2745 +out of range reads or writes.  So it's certainly much improved,
2746 +although I wouldn't claim it to be totally bombproof.
2747 +
2748 +The file @code{bzlib.h} contains all definitions needed to use
2749 +the library.  In particular, you should definitely not include
2750 +@code{bzlib_private.h}.
2751 +
2752 +In @code{bzlib.h}, the various return values are defined.  The following
2753 +list is not intended as an exhaustive description of the circumstances 
2754 +in which a given value may be returned -- those descriptions are given
2755 +later.  Rather, it is intended to convey the rough meaning of each
2756 +return value.  The first five actions are normal and not intended to 
2757 +denote an error situation.
2758 +@table @code
2759 +@item BZ_OK
2760 +The requested action was completed successfully.
2761 +@item BZ_RUN_OK
2762 +@itemx BZ_FLUSH_OK
2763 +@itemx BZ_FINISH_OK
2764 +In @code{BZ2_bzCompress}, the requested flush/finish/nothing-special action
2765 +was completed successfully.
2766 +@item BZ_STREAM_END
2767 +Compression of data was completed, or the logical stream end was
2768 +detected during decompression.
2769 +@end table
2770 +
2771 +The following return values indicate an error of some kind.
2772 +@table @code
2773 +@item BZ_CONFIG_ERROR
2774 +Indicates that the library has been improperly compiled on your
2775 +platform -- a major configuration error.  Specifically, it means
2776 +that @code{sizeof(char)}, @code{sizeof(short)} and @code{sizeof(int)}
2777 +are not 1, 2 and 4 respectively, as they should be.  Note that the 
2778 +library should still work properly on 64-bit platforms which follow
2779 +the LP64 programming model -- that is, where @code{sizeof(long)}
2780 +and @code{sizeof(void*)} are 8.  Under LP64, @code{sizeof(int)} is
2781 +still 4, so @code{libbzip2}, which doesn't use the @code{long} type,
2782 +is OK.
2783 +@item BZ_SEQUENCE_ERROR
2784 +When using the library, it is important to call the functions in the
2785 +correct sequence and with data structures (buffers etc) in the correct
2786 +states.  @code{libbzip2} checks as much as it can to ensure this is
2787 +happening, and returns @code{BZ_SEQUENCE_ERROR} if not.  Code which
2788 +complies precisely with the function semantics, as detailed below,
2789 +should never receive this value; such an event denotes buggy code
2790 +which you should investigate.
2791 +@item BZ_PARAM_ERROR
2792 +Returned when a parameter to a function call is out of range 
2793 +or otherwise manifestly incorrect.  As with @code{BZ_SEQUENCE_ERROR},
2794 +this denotes a bug in the client code.  The distinction between
2795 +@code{BZ_PARAM_ERROR} and @code{BZ_SEQUENCE_ERROR} is a bit hazy, but still worth
2796 +making.
2797 +@item BZ_MEM_ERROR
2798 +Returned when a request to allocate memory failed.  Note that the
2799 +quantity of memory needed to decompress a stream cannot be determined
2800 +until the stream's header has been read.  So @code{BZ2_bzDecompress} and
2801 +@code{BZ2_bzRead} may return @code{BZ_MEM_ERROR} even though some of
2802 +the compressed data has been read.  The same is not true for
2803 +compression; once @code{BZ2_bzCompressInit} or @code{BZ2_bzWriteOpen} have
2804 +successfully completed, @code{BZ_MEM_ERROR} cannot occur.
2805 +@item BZ_DATA_ERROR
2806 +Returned when a data integrity error is detected during decompression.
2807 +Most importantly, this means when stored and computed CRCs for the
2808 +data do not match.  This value is also returned upon detection of any
2809 +other anomaly in the compressed data.
2810 +@item BZ_DATA_ERROR_MAGIC
2811 +As a special case of @code{BZ_DATA_ERROR}, it is sometimes useful to
2812 +know when the compressed stream does not start with the correct
2813 +magic bytes (@code{'B' 'Z' 'h'}).  
2814 +@item BZ_IO_ERROR
2815 +Returned by @code{BZ2_bzRead} and @code{BZ2_bzWrite} when there is an error
2816 +reading or writing in the compressed file, and by @code{BZ2_bzReadOpen}
2817 +and @code{BZ2_bzWriteOpen} for attempts to use a file for which the
2818 +error indicator (viz, @code{ferror(f)}) is set.
2819 +On receipt of @code{BZ_IO_ERROR}, the caller should consult
2820 +@code{errno} and/or @code{perror} to acquire operating-system
2821 +specific information about the problem.
2822 +@item BZ_UNEXPECTED_EOF
2823 +Returned by @code{BZ2_bzRead} when the compressed file finishes
2824 +before the logical end of stream is detected.
2825 +@item BZ_OUTBUFF_FULL
2826 +Returned by @code{BZ2_bzBuffToBuffCompress} and
2827 +@code{BZ2_bzBuffToBuffDecompress} to indicate that the output data
2828 +will not fit into the output buffer provided.
2829 +@end table
2830 +
2831 +
2832 +
2833 +@section Low-level interface
2834 +
2835 +@subsection @code{BZ2_bzCompressInit}
2836 +@example
2837 +typedef 
2838 +   struct @{
2839 +      char *next_in;
2840 +      unsigned int avail_in;
2841 +      unsigned int total_in_lo32;
2842 +      unsigned int total_in_hi32;
2843 +
2844 +      char *next_out;
2845 +      unsigned int avail_out;
2846 +      unsigned int total_out_lo32;
2847 +      unsigned int total_out_hi32;
2848 +
2849 +      void *state;
2850 +
2851 +      void *(*bzalloc)(void *,int,int);
2852 +      void (*bzfree)(void *,void *);
2853 +      void *opaque;
2854 +   @} 
2855 +   bz_stream;
2856 +
2857 +int BZ2_bzCompressInit ( bz_stream *strm, 
2858 +                         int blockSize100k, 
2859 +                         int verbosity,
2860 +                         int workFactor );
2861 +
2862 +@end example
2863 +
2864 +Prepares for compression.  The @code{bz_stream} structure
2865 +holds all data pertaining to the compression activity.  
2866 +A @code{bz_stream} structure should be allocated and initialised
2867 +prior to the call.
2868 +The fields of @code{bz_stream}
2869 +comprise the entirety of the user-visible data.  @code{state}
2870 +is a pointer to the private data structures required for compression.
2871 +
2872 +Custom memory allocators are supported, via fields @code{bzalloc}, 
2873 +@code{bzfree},
2874 +and @code{opaque}.  The value 
2875 +@code{opaque} is passed to as the first argument to
2876 +all calls to @code{bzalloc} and @code{bzfree}, but is 
2877 +otherwise ignored by the library.
2878 +The call @code{bzalloc ( opaque, n, m )} is expected to return a 
2879 +pointer @code{p} to
2880 +@code{n * m} bytes of memory, and @code{bzfree ( opaque, p )} 
2881 +should free
2882 +that memory.
2883 +
2884 +If you don't want to use a custom memory allocator, set @code{bzalloc}, 
2885 +@code{bzfree} and
2886 +@code{opaque} to @code{NULL}, 
2887 +and the library will then use the standard @code{malloc}/@code{free}
2888 +routines.
2889 +
2890 +Before calling @code{BZ2_bzCompressInit}, fields @code{bzalloc}, 
2891 +@code{bzfree} and @code{opaque} should
2892 +be filled appropriately, as just described.  Upon return, the internal
2893 +state will have been allocated and initialised, and @code{total_in_lo32}, 
2894 +@code{total_in_hi32}, @code{total_out_lo32} and 
2895 +@code{total_out_hi32} will have been set to zero.  
2896 +These four fields are used by the library
2897 +to inform the caller of the total amount of data passed into and out of
2898 +the library, respectively.  You should not try to change them.
2899 +As of version 1.0, 64-bit counts are maintained, even on 32-bit
2900 +platforms, using the @code{_hi32} fields to store the upper 32 bits
2901 +of the count.  So, for example, the total amount of data in
2902 +is @code{(total_in_hi32 << 32) + total_in_lo32}.
2903 +
2904 +Parameter @code{blockSize100k} specifies the block size to be used for
2905 +compression.  It should be a value between 1 and 9 inclusive, and the
2906 +actual block size used is 100000 x this figure.  9 gives the best
2907 +compression but takes most memory.
2908 +
2909 +Parameter @code{verbosity} should be set to a number between 0 and 4
2910 +inclusive.  0 is silent, and greater numbers give increasingly verbose
2911 +monitoring/debugging output.  If the library has been compiled with
2912 +@code{-DBZ_NO_STDIO}, no such output will appear for any verbosity
2913 +setting.
2914 +
2915 +Parameter @code{workFactor} controls how the compression phase behaves
2916 +when presented with worst case, highly repetitive, input data.  If
2917 +compression runs into difficulties caused by repetitive data, the
2918 +library switches from the standard sorting algorithm to a fallback
2919 +algorithm.  The fallback is slower than the standard algorithm by
2920 +perhaps a factor of three, but always behaves reasonably, no matter how
2921 +bad the input.
2922 +
2923 +Lower values of @code{workFactor} reduce the amount of effort the
2924 +standard algorithm will expend before resorting to the fallback.  You
2925 +should set this parameter carefully; too low, and many inputs will be
2926 +handled by the fallback algorithm and so compress rather slowly, too
2927 +high, and your average-to-worst case compression times can become very
2928 +large.  The default value of 30 gives reasonable behaviour over a wide
2929 +range of circumstances.
2930 +
2931 +Allowable values range from 0 to 250 inclusive.  0 is a special case,
2932 +equivalent to using the default value of 30.
2933 +
2934 +Note that the compressed output generated is the same regardless of
2935 +whether or not the fallback algorithm is used.
2936 +
2937 +Be aware also that this parameter may disappear entirely in future
2938 +versions of the library.  In principle it should be possible to devise a
2939 +good way to automatically choose which algorithm to use.  Such a
2940 +mechanism would render the parameter obsolete.
2941 +
2942 +Possible return values:
2943 +@display
2944 +      @code{BZ_CONFIG_ERROR}
2945 +         if the library has been mis-compiled
2946 +      @code{BZ_PARAM_ERROR} 
2947 +         if @code{strm} is @code{NULL} 
2948 +         or @code{blockSize} < 1 or @code{blockSize} > 9
2949 +         or @code{verbosity} < 0 or @code{verbosity} > 4
2950 +         or @code{workFactor} < 0 or @code{workFactor} > 250
2951 +      @code{BZ_MEM_ERROR} 
2952 +         if not enough memory is available
2953 +      @code{BZ_OK} 
2954 +         otherwise
2955 +@end display
2956 +Allowable next actions:
2957 +@display
2958 +      @code{BZ2_bzCompress} 
2959 +         if @code{BZ_OK} is returned
2960 +      no specific action needed in case of error
2961 +@end display
2962 +
2963 +@subsection @code{BZ2_bzCompress}
2964 +@example
2965 +   int BZ2_bzCompress ( bz_stream *strm, int action );
2966 +@end example
2967 +Provides more input and/or output buffer space for the library.  The
2968 +caller maintains input and output buffers, and calls @code{BZ2_bzCompress} to
2969 +transfer data between them.
2970 +
2971 +Before each call to @code{BZ2_bzCompress}, @code{next_in} should point at
2972 +the data to be compressed, and @code{avail_in} should indicate how many
2973 +bytes the library may read.  @code{BZ2_bzCompress} updates @code{next_in},
2974 +@code{avail_in} and @code{total_in} to reflect the number of bytes it
2975 +has read.
2976 +
2977 +Similarly, @code{next_out} should point to a buffer in which the
2978 +compressed data is to be placed, with @code{avail_out} indicating how
2979 +much output space is available.  @code{BZ2_bzCompress} updates
2980 +@code{next_out}, @code{avail_out} and @code{total_out} to reflect the
2981 +number of bytes output.
2982 +
2983 +You may provide and remove as little or as much data as you like on each
2984 +call of @code{BZ2_bzCompress}.  In the limit, it is acceptable to supply and
2985 +remove data one byte at a time, although this would be terribly
2986 +inefficient.  You should always ensure that at least one byte of output
2987 +space is available at each call.
2988 +
2989 +A second purpose of @code{BZ2_bzCompress} is to request a change of mode of the
2990 +compressed stream.  
2991 +
2992 +Conceptually, a compressed stream can be in one of four states: IDLE,
2993 +RUNNING, FLUSHING and FINISHING.  Before initialisation
2994 +(@code{BZ2_bzCompressInit}) and after termination (@code{BZ2_bzCompressEnd}), a
2995 +stream is regarded as IDLE.
2996 +
2997 +Upon initialisation (@code{BZ2_bzCompressInit}), the stream is placed in the
2998 +RUNNING state.  Subsequent calls to @code{BZ2_bzCompress} should pass
2999 +@code{BZ_RUN} as the requested action; other actions are illegal and
3000 +will result in @code{BZ_SEQUENCE_ERROR}.
3001 +
3002 +At some point, the calling program will have provided all the input data
3003 +it wants to.  It will then want to finish up -- in effect, asking the
3004 +library to process any data it might have buffered internally.  In this
3005 +state, @code{BZ2_bzCompress} will no longer attempt to read data from
3006 +@code{next_in}, but it will want to write data to @code{next_out}.
3007 +Because the output buffer supplied by the user can be arbitrarily small,
3008 +the finishing-up operation cannot necessarily be done with a single call
3009 +of @code{BZ2_bzCompress}.
3010 +
3011 +Instead, the calling program passes @code{BZ_FINISH} as an action to
3012 +@code{BZ2_bzCompress}.  This changes the stream's state to FINISHING.  Any
3013 +remaining input (ie, @code{next_in[0 .. avail_in-1]}) is compressed and
3014 +transferred to the output buffer.  To do this, @code{BZ2_bzCompress} must be
3015 +called repeatedly until all the output has been consumed.  At that
3016 +point, @code{BZ2_bzCompress} returns @code{BZ_STREAM_END}, and the stream's
3017 +state is set back to IDLE.  @code{BZ2_bzCompressEnd} should then be
3018 +called.
3019 +
3020 +Just to make sure the calling program does not cheat, the library makes
3021 +a note of @code{avail_in} at the time of the first call to
3022 +@code{BZ2_bzCompress} which has @code{BZ_FINISH} as an action (ie, at the
3023 +time the program has announced its intention to not supply any more
3024 +input).  By comparing this value with that of @code{avail_in} over
3025 +subsequent calls to @code{BZ2_bzCompress}, the library can detect any
3026 +attempts to slip in more data to compress.  Any calls for which this is
3027 +detected will return @code{BZ_SEQUENCE_ERROR}.  This indicates a
3028 +programming mistake which should be corrected.
3029 +
3030 +Instead of asking to finish, the calling program may ask
3031 +@code{BZ2_bzCompress} to take all the remaining input, compress it and
3032 +terminate the current (Burrows-Wheeler) compression block.  This could
3033 +be useful for error control purposes.  The mechanism is analogous to
3034 +that for finishing: call @code{BZ2_bzCompress} with an action of
3035 +@code{BZ_FLUSH}, remove output data, and persist with the
3036 +@code{BZ_FLUSH} action until the value @code{BZ_RUN} is returned.  As
3037 +with finishing, @code{BZ2_bzCompress} detects any attempt to provide more
3038 +input data once the flush has begun.
3039 +
3040 +Once the flush is complete, the stream returns to the normal RUNNING
3041 +state.
3042 +
3043 +This all sounds pretty complex, but isn't really.  Here's a table
3044 +which shows which actions are allowable in each state, what action
3045 +will be taken, what the next state is, and what the non-error return
3046 +values are.  Note that you can't explicitly ask what state the
3047 +stream is in, but nor do you need to -- it can be inferred from the
3048 +values returned by @code{BZ2_bzCompress}.
3049 +@display
3050 +IDLE/@code{any}           
3051 +      Illegal.  IDLE state only exists after @code{BZ2_bzCompressEnd} or
3052 +      before @code{BZ2_bzCompressInit}.
3053 +      Return value = @code{BZ_SEQUENCE_ERROR}
3054 +
3055 +RUNNING/@code{BZ_RUN}     
3056 +      Compress from @code{next_in} to @code{next_out} as much as possible.
3057 +      Next state = RUNNING
3058 +      Return value = @code{BZ_RUN_OK}
3059 +
3060 +RUNNING/@code{BZ_FLUSH}   
3061 +      Remember current value of @code{next_in}.  Compress from @code{next_in}
3062 +      to @code{next_out} as much as possible, but do not accept any more input.  
3063 +      Next state = FLUSHING
3064 +      Return value = @code{BZ_FLUSH_OK}
3065 +
3066 +RUNNING/@code{BZ_FINISH}  
3067 +      Remember current value of @code{next_in}.  Compress from @code{next_in}
3068 +      to @code{next_out} as much as possible, but do not accept any more input.
3069 +      Next state = FINISHING
3070 +      Return value = @code{BZ_FINISH_OK}
3071 +
3072 +FLUSHING/@code{BZ_FLUSH}  
3073 +      Compress from @code{next_in} to @code{next_out} as much as possible, 
3074 +      but do not accept any more input.  
3075 +      If all the existing input has been used up and all compressed
3076 +      output has been removed
3077 +         Next state = RUNNING; Return value = @code{BZ_RUN_OK}
3078 +      else
3079 +         Next state = FLUSHING; Return value = @code{BZ_FLUSH_OK}
3080 +
3081 +FLUSHING/other     
3082 +      Illegal.
3083 +      Return value = @code{BZ_SEQUENCE_ERROR}
3084 +
3085 +FINISHING/@code{BZ_FINISH}  
3086 +      Compress from @code{next_in} to @code{next_out} as much as possible,
3087 +      but to not accept any more input.  
3088 +      If all the existing input has been used up and all compressed
3089 +      output has been removed
3090 +         Next state = IDLE; Return value = @code{BZ_STREAM_END}
3091 +      else
3092 +         Next state = FINISHING; Return value = @code{BZ_FINISHING}
3093 +
3094 +FINISHING/other
3095 +      Illegal.
3096 +      Return value = @code{BZ_SEQUENCE_ERROR}
3097 +@end display
3098 +
3099 +That still looks complicated?  Well, fair enough.  The usual sequence
3100 +of calls for compressing a load of data is:
3101 +@itemize @bullet
3102 +@item Get started with @code{BZ2_bzCompressInit}.
3103 +@item Shovel data in and shlurp out its compressed form using zero or more
3104 +calls of @code{BZ2_bzCompress} with action = @code{BZ_RUN}.
3105 +@item Finish up.  
3106 +Repeatedly call @code{BZ2_bzCompress} with action = @code{BZ_FINISH}, 
3107 +copying out the compressed output, until @code{BZ_STREAM_END} is returned.
3108 +@item Close up and go home.  Call @code{BZ2_bzCompressEnd}.
3109 +@end itemize
3110 +If the data you want to compress fits into your input buffer all
3111 +at once, you can skip the calls of @code{BZ2_bzCompress ( ..., BZ_RUN )} and 
3112 +just do the @code{BZ2_bzCompress ( ..., BZ_FINISH )} calls.
3113 +
3114 +All required memory is allocated by @code{BZ2_bzCompressInit}.  The
3115 +compression library can accept any data at all (obviously).  So you
3116 +shouldn't get any error return values from the @code{BZ2_bzCompress} calls.
3117 +If you do, they will be @code{BZ_SEQUENCE_ERROR}, and indicate a bug in
3118 +your programming.
3119 +
3120 +Trivial other possible return values:
3121 +@display
3122 +      @code{BZ_PARAM_ERROR}   
3123 +         if @code{strm} is @code{NULL}, or @code{strm->s} is @code{NULL}
3124 +@end display
3125 +
3126 +@subsection @code{BZ2_bzCompressEnd}
3127 +@example
3128 +int BZ2_bzCompressEnd ( bz_stream *strm );
3129 +@end example
3130 +Releases all memory associated with a compression stream.
3131 +
3132 +Possible return values:
3133 +@display
3134 +   @code{BZ_PARAM_ERROR}    if @code{strm} is @code{NULL} or @code{strm->s} is @code{NULL}
3135 +   @code{BZ_OK}    otherwise
3136 +@end display
3137 +
3138 +
3139 +@subsection @code{BZ2_bzDecompressInit}
3140 +@example
3141 +int BZ2_bzDecompressInit ( bz_stream *strm, int verbosity, int small );
3142 +@end example
3143 +Prepares for decompression.  As with @code{BZ2_bzCompressInit}, a
3144 +@code{bz_stream} record should be allocated and initialised before the
3145 +call.  Fields @code{bzalloc}, @code{bzfree} and @code{opaque} should be
3146 +set if a custom memory allocator is required, or made @code{NULL} for
3147 +the normal @code{malloc}/@code{free} routines.  Upon return, the internal
3148 +state will have been initialised, and @code{total_in} and
3149 +@code{total_out} will be zero.
3150 +
3151 +For the meaning of parameter @code{verbosity}, see @code{BZ2_bzCompressInit}.
3152 +
3153 +If @code{small} is nonzero, the library will use an alternative
3154 +decompression algorithm which uses less memory but at the cost of
3155 +decompressing more slowly (roughly speaking, half the speed, but the
3156 +maximum memory requirement drops to around 2300k).  See Chapter 2 for
3157 +more information on memory management.
3158 +
3159 +Note that the amount of memory needed to decompress
3160 +a stream cannot be determined until the stream's header has been read,
3161 +so even if @code{BZ2_bzDecompressInit} succeeds, a subsequent
3162 +@code{BZ2_bzDecompress} could fail with @code{BZ_MEM_ERROR}.
3163 +
3164 +Possible return values:
3165 +@display
3166 +      @code{BZ_CONFIG_ERROR}
3167 +         if the library has been mis-compiled
3168 +      @code{BZ_PARAM_ERROR}
3169 +         if @code{(small != 0 && small != 1)}
3170 +         or @code{(verbosity < 0 || verbosity > 4)}
3171 +      @code{BZ_MEM_ERROR}
3172 +         if insufficient memory is available
3173 +@end display
3174 +
3175 +Allowable next actions:
3176 +@display
3177 +      @code{BZ2_bzDecompress}
3178 +         if @code{BZ_OK} was returned
3179 +      no specific action required in case of error
3180 +@end display
3181 +
3182
3183 +
3184 +@subsection @code{BZ2_bzDecompress}
3185 +@example
3186 +int BZ2_bzDecompress ( bz_stream *strm );
3187 +@end example
3188 +Provides more input and/out output buffer space for the library.  The
3189 +caller maintains input and output buffers, and uses @code{BZ2_bzDecompress}
3190 +to transfer data between them.
3191 +
3192 +Before each call to @code{BZ2_bzDecompress}, @code{next_in} 
3193 +should point at the compressed data,
3194 +and @code{avail_in} should indicate how many bytes the library
3195 +may read.  @code{BZ2_bzDecompress} updates @code{next_in}, @code{avail_in} 
3196 +and @code{total_in}
3197 +to reflect the number of bytes it has read.
3198 +
3199 +Similarly, @code{next_out} should point to a buffer in which the uncompressed
3200 +output is to be placed, with @code{avail_out} indicating how much output space
3201 +is available.  @code{BZ2_bzCompress} updates @code{next_out},
3202 +@code{avail_out} and @code{total_out} to reflect
3203 +the number of bytes output.
3204 +
3205 +You may provide and remove as little or as much data as you like on
3206 +each call of @code{BZ2_bzDecompress}.  
3207 +In the limit, it is acceptable to
3208 +supply and remove data one byte at a time, although this would be
3209 +terribly inefficient.  You should always ensure that at least one
3210 +byte of output space is available at each call.
3211 +
3212 +Use of @code{BZ2_bzDecompress} is simpler than @code{BZ2_bzCompress}.
3213 +
3214 +You should provide input and remove output as described above, and
3215 +repeatedly call @code{BZ2_bzDecompress} until @code{BZ_STREAM_END} is
3216 +returned.  Appearance of @code{BZ_STREAM_END} denotes that
3217 +@code{BZ2_bzDecompress} has detected the logical end of the compressed
3218 +stream.  @code{BZ2_bzDecompress} will not produce @code{BZ_STREAM_END} until
3219 +all output data has been placed into the output buffer, so once
3220 +@code{BZ_STREAM_END} appears, you are guaranteed to have available all
3221 +the decompressed output, and @code{BZ2_bzDecompressEnd} can safely be
3222 +called.
3223 +
3224 +If case of an error return value, you should call @code{BZ2_bzDecompressEnd}
3225 +to clean up and release memory.
3226 +
3227 +Possible return values:
3228 +@display
3229 +      @code{BZ_PARAM_ERROR}
3230 +         if @code{strm} is @code{NULL} or @code{strm->s} is @code{NULL}
3231 +         or @code{strm->avail_out < 1}
3232 +      @code{BZ_DATA_ERROR}
3233 +         if a data integrity error is detected in the compressed stream
3234 +      @code{BZ_DATA_ERROR_MAGIC}
3235 +         if the compressed stream doesn't begin with the right magic bytes
3236 +      @code{BZ_MEM_ERROR}
3237 +         if there wasn't enough memory available
3238 +      @code{BZ_STREAM_END}
3239 +         if the logical end of the data stream was detected and all
3240 +         output in has been consumed, eg @code{s->avail_out > 0}
3241 +      @code{BZ_OK}
3242 +         otherwise
3243 +@end display
3244 +Allowable next actions:
3245 +@display
3246 +      @code{BZ2_bzDecompress}
3247 +         if @code{BZ_OK} was returned
3248 +      @code{BZ2_bzDecompressEnd}
3249 +         otherwise
3250 +@end display
3251 +
3252 +
3253 +@subsection @code{BZ2_bzDecompressEnd}
3254 +@example
3255 +int BZ2_bzDecompressEnd ( bz_stream *strm );
3256 +@end example
3257 +Releases all memory associated with a decompression stream.
3258 +
3259 +Possible return values:
3260 +@display
3261 +      @code{BZ_PARAM_ERROR}
3262 +         if @code{strm} is @code{NULL} or @code{strm->s} is @code{NULL}
3263 +      @code{BZ_OK}
3264 +         otherwise
3265 +@end display
3266 +
3267 +Allowable next actions:
3268 +@display
3269 +      None.
3270 +@end display
3271 +
3272 +
3273 +@section High-level interface
3274 +
3275 +This interface provides functions for reading and writing 
3276 +@code{bzip2} format files.  First, some general points.
3277 +
3278 +@itemize @bullet
3279 +@item All of the functions take an @code{int*} first argument,
3280 +  @code{bzerror}.
3281 +  After each call, @code{bzerror} should be consulted first to determine
3282 +  the outcome of the call.  If @code{bzerror} is @code{BZ_OK}, 
3283 +  the call completed
3284 +  successfully, and only then should the return value of the function
3285 +  (if any) be consulted.  If @code{bzerror} is @code{BZ_IO_ERROR}, 
3286 +  there was an error
3287 +  reading/writing the underlying compressed file, and you should
3288 +  then consult @code{errno}/@code{perror} to determine the 
3289 +  cause of the difficulty.
3290 +  @code{bzerror} may also be set to various other values; precise details are
3291 +  given on a per-function basis below.
3292 +@item If @code{bzerror} indicates an error 
3293 +  (ie, anything except @code{BZ_OK} and @code{BZ_STREAM_END}),
3294 +  you should immediately call @code{BZ2_bzReadClose} (or @code{BZ2_bzWriteClose},
3295 +  depending on whether you are attempting to read or to write)
3296 +  to free up all resources associated
3297 +  with the stream.  Once an error has been indicated, behaviour of all calls
3298 +  except @code{BZ2_bzReadClose} (@code{BZ2_bzWriteClose}) is undefined.  
3299 +  The implication is that (1) @code{bzerror} should
3300 +  be checked after each call, and (2) if @code{bzerror} indicates an error, 
3301 +  @code{BZ2_bzReadClose} (@code{BZ2_bzWriteClose}) should then be called to clean up.
3302 +@item The @code{FILE*} arguments passed to
3303 +   @code{BZ2_bzReadOpen}/@code{BZ2_bzWriteOpen}  
3304 +  should be set to binary mode.
3305 +  Most Unix systems will do this by default, but other platforms,
3306 +  including Windows and Mac, will not.  If you omit this, you may
3307 +  encounter problems when moving code to new platforms.
3308 +@item Memory allocation requests are handled by
3309 +  @code{malloc}/@code{free}.  
3310 +  At present
3311 +  there is no facility for user-defined memory allocators in the file I/O
3312 +  functions (could easily be added, though).
3313 +@end itemize
3314 +
3315 +
3316 +
3317 +@subsection @code{BZ2_bzReadOpen}
3318 +@example
3319 +   typedef void BZFILE;
3320 +
3321 +   BZFILE *BZ2_bzReadOpen ( int *bzerror, FILE *f, 
3322 +                            int small, int verbosity,
3323 +                            void *unused, int nUnused );
3324 +@end example
3325 +Prepare to read compressed data from file handle @code{f}.  @code{f}
3326 +should refer to a file which has been opened for reading, and for which
3327 +the error indicator (@code{ferror(f)})is not set.  If @code{small} is 1,
3328 +the library will try to decompress using less memory, at the expense of
3329 +speed.
3330 +
3331 +For reasons explained below, @code{BZ2_bzRead} will decompress the
3332 +@code{nUnused} bytes starting at @code{unused}, before starting to read
3333 +from the file @code{f}.  At most @code{BZ_MAX_UNUSED} bytes may be
3334 +supplied like this.  If this facility is not required, you should pass
3335 +@code{NULL} and @code{0} for @code{unused} and n@code{Unused}
3336 +respectively.
3337 +
3338 +For the meaning of parameters @code{small} and @code{verbosity},
3339 +see @code{BZ2_bzDecompressInit}.
3340 +
3341 +The amount of memory needed to decompress a file cannot be determined
3342 +until the file's header has been read.  So it is possible that
3343 +@code{BZ2_bzReadOpen} returns @code{BZ_OK} but a subsequent call of
3344 +@code{BZ2_bzRead} will return @code{BZ_MEM_ERROR}.
3345 +
3346 +Possible assignments to @code{bzerror}:
3347 +@display
3348 +      @code{BZ_CONFIG_ERROR}
3349 +         if the library has been mis-compiled
3350 +      @code{BZ_PARAM_ERROR}
3351 +         if @code{f} is @code{NULL} 
3352 +         or @code{small} is neither @code{0} nor @code{1}                 
3353 +         or @code{(unused == NULL && nUnused != 0)}
3354 +         or @code{(unused != NULL && !(0 <= nUnused <= BZ_MAX_UNUSED))}
3355 +      @code{BZ_IO_ERROR}    
3356 +         if @code{ferror(f)} is nonzero
3357 +      @code{BZ_MEM_ERROR}   
3358 +         if insufficient memory is available
3359 +      @code{BZ_OK}
3360 +         otherwise.
3361 +@end display
3362 +
3363 +Possible return values:
3364 +@display
3365 +      Pointer to an abstract @code{BZFILE}        
3366 +         if @code{bzerror} is @code{BZ_OK}   
3367 +      @code{NULL}
3368 +         otherwise
3369 +@end display
3370 +
3371 +Allowable next actions:
3372 +@display
3373 +      @code{BZ2_bzRead}
3374 +         if @code{bzerror} is @code{BZ_OK}   
3375 +      @code{BZ2_bzClose} 
3376 +         otherwise
3377 +@end display
3378 +
3379 +
3380 +@subsection @code{BZ2_bzRead}
3381 +@example
3382 +   int BZ2_bzRead ( int *bzerror, BZFILE *b, void *buf, int len );
3383 +@end example
3384 +Reads up to @code{len} (uncompressed) bytes from the compressed file 
3385 +@code{b} into
3386 +the buffer @code{buf}.  If the read was successful, 
3387 +@code{bzerror} is set to @code{BZ_OK}
3388 +and the number of bytes read is returned.  If the logical end-of-stream
3389 +was detected, @code{bzerror} will be set to @code{BZ_STREAM_END}, 
3390 +and the number
3391 +of bytes read is returned.  All other @code{bzerror} values denote an error.
3392 +
3393 +@code{BZ2_bzRead} will supply @code{len} bytes,
3394 +unless the logical stream end is detected
3395 +or an error occurs.  Because of this, it is possible to detect the 
3396 +stream end by observing when the number of bytes returned is 
3397 +less than the number
3398 +requested.  Nevertheless, this is regarded as inadvisable; you should
3399 +instead check @code{bzerror} after every call and watch out for
3400 +@code{BZ_STREAM_END}.
3401 +
3402 +Internally, @code{BZ2_bzRead} copies data from the compressed file in chunks
3403 +of size @code{BZ_MAX_UNUSED} bytes
3404 +before decompressing it.  If the file contains more bytes than strictly
3405 +needed to reach the logical end-of-stream, @code{BZ2_bzRead} will almost certainly
3406 +read some of the trailing data before signalling @code{BZ_SEQUENCE_END}.
3407 +To collect the read but unused data once @code{BZ_SEQUENCE_END} has 
3408 +appeared, call @code{BZ2_bzReadGetUnused} immediately before @code{BZ2_bzReadClose}.
3409 +
3410 +Possible assignments to @code{bzerror}:
3411 +@display
3412 +      @code{BZ_PARAM_ERROR}
3413 +         if @code{b} is @code{NULL} or @code{buf} is @code{NULL} or @code{len < 0}
3414 +      @code{BZ_SEQUENCE_ERROR} 
3415 +         if @code{b} was opened with @code{BZ2_bzWriteOpen}
3416 +      @code{BZ_IO_ERROR} 
3417 +         if there is an error reading from the compressed file
3418 +      @code{BZ_UNEXPECTED_EOF} 
3419 +         if the compressed file ended before the logical end-of-stream was detected
3420 +      @code{BZ_DATA_ERROR} 
3421 +         if a data integrity error was detected in the compressed stream
3422 +      @code{BZ_DATA_ERROR_MAGIC}
3423 +         if the stream does not begin with the requisite header bytes (ie, is not 
3424 +         a @code{bzip2} data file).  This is really a special case of @code{BZ_DATA_ERROR}.
3425 +      @code{BZ_MEM_ERROR} 
3426 +         if insufficient memory was available
3427 +      @code{BZ_STREAM_END} 
3428 +         if the logical end of stream was detected.
3429 +      @code{BZ_OK}
3430 +         otherwise.
3431 +@end display
3432 +
3433 +Possible return values:
3434 +@display
3435 +      number of bytes read
3436 +         if @code{bzerror} is @code{BZ_OK} or @code{BZ_STREAM_END}
3437 +      undefined
3438 +         otherwise
3439 +@end display
3440 +
3441 +Allowable next actions:
3442 +@display
3443 +      collect data from @code{buf}, then @code{BZ2_bzRead} or @code{BZ2_bzReadClose}
3444 +         if @code{bzerror} is @code{BZ_OK} 
3445 +      collect data from @code{buf}, then @code{BZ2_bzReadClose} or @code{BZ2_bzReadGetUnused} 
3446 +         if @code{bzerror} is @code{BZ_SEQUENCE_END}   
3447 +      @code{BZ2_bzReadClose} 
3448 +         otherwise
3449 +@end display
3450 +
3451 +
3452 +
3453 +@subsection @code{BZ2_bzReadGetUnused}
3454 +@example
3455 +   void BZ2_bzReadGetUnused ( int* bzerror, BZFILE *b, 
3456 +                              void** unused, int* nUnused );
3457 +@end example
3458 +Returns data which was read from the compressed file but was not needed
3459 +to get to the logical end-of-stream.  @code{*unused} is set to the address
3460 +of the data, and @code{*nUnused} to the number of bytes.  @code{*nUnused} will
3461 +be set to a value between @code{0} and @code{BZ_MAX_UNUSED} inclusive.
3462 +
3463 +This function may only be called once @code{BZ2_bzRead} has signalled 
3464 +@code{BZ_STREAM_END} but before @code{BZ2_bzReadClose}.
3465 +
3466 +Possible assignments to @code{bzerror}:
3467 +@display
3468 +      @code{BZ_PARAM_ERROR} 
3469 +         if @code{b} is @code{NULL} 
3470 +         or @code{unused} is @code{NULL} or @code{nUnused} is @code{NULL}
3471 +      @code{BZ_SEQUENCE_ERROR} 
3472 +         if @code{BZ_STREAM_END} has not been signalled
3473 +         or if @code{b} was opened with @code{BZ2_bzWriteOpen}
3474 +     @code{BZ_OK}
3475 +         otherwise
3476 +@end display
3477 +
3478 +Allowable next actions:
3479 +@display 
3480 +      @code{BZ2_bzReadClose}
3481 +@end display
3482 +
3483 +
3484 +@subsection @code{BZ2_bzReadClose}
3485 +@example
3486 +   void BZ2_bzReadClose ( int *bzerror, BZFILE *b );
3487 +@end example
3488 +Releases all memory pertaining to the compressed file @code{b}.  
3489 +@code{BZ2_bzReadClose} does not call @code{fclose} on the underlying file
3490 +handle, so you should do that yourself if appropriate.
3491 +@code{BZ2_bzReadClose} should be called to clean up after all error
3492 +situations.
3493 +
3494 +Possible assignments to @code{bzerror}:
3495 +@display
3496 +      @code{BZ_SEQUENCE_ERROR} 
3497 +         if @code{b} was opened with @code{BZ2_bzOpenWrite} 
3498 +      @code{BZ_OK} 
3499 +         otherwise
3500 +@end display
3501 +
3502 +Allowable next actions:
3503 +@display
3504 +      none
3505 +@end display
3506 +
3507 +
3508 +
3509 +@subsection @code{BZ2_bzWriteOpen}
3510 +@example
3511 +   BZFILE *BZ2_bzWriteOpen ( int *bzerror, FILE *f, 
3512 +                             int blockSize100k, int verbosity,
3513 +                             int workFactor );
3514 +@end example
3515 +Prepare to write compressed data to file handle @code{f}.  
3516 +@code{f} should refer to
3517 +a file which has been opened for writing, and for which the error
3518 +indicator (@code{ferror(f)})is not set.  
3519 +
3520 +For the meaning of parameters @code{blockSize100k},
3521 +@code{verbosity} and @code{workFactor}, see
3522 +@* @code{BZ2_bzCompressInit}.
3523 +
3524 +All required memory is allocated at this stage, so if the call
3525 +completes successfully, @code{BZ_MEM_ERROR} cannot be signalled by a
3526 +subsequent call to @code{BZ2_bzWrite}.
3527 +
3528 +Possible assignments to @code{bzerror}:
3529 +@display 
3530 +      @code{BZ_CONFIG_ERROR}
3531 +         if the library has been mis-compiled
3532 +      @code{BZ_PARAM_ERROR} 
3533 +         if @code{f} is @code{NULL} 
3534 +         or @code{blockSize100k < 1} or @code{blockSize100k > 9}
3535 +      @code{BZ_IO_ERROR} 
3536 +         if @code{ferror(f)} is nonzero
3537 +      @code{BZ_MEM_ERROR} 
3538 +         if insufficient memory is available
3539 +      @code{BZ_OK} 
3540 +         otherwise
3541 +@end display
3542 +
3543 +Possible return values:
3544 +@display
3545 +      Pointer to an abstract @code{BZFILE}  
3546 +         if @code{bzerror} is @code{BZ_OK}   
3547 +      @code{NULL} 
3548 +         otherwise
3549 +@end display
3550 +
3551 +Allowable next actions:
3552 +@display
3553 +      @code{BZ2_bzWrite} 
3554 +         if @code{bzerror} is @code{BZ_OK} 
3555 +         (you could go directly to @code{BZ2_bzWriteClose}, but this would be pretty pointless)
3556 +      @code{BZ2_bzWriteClose} 
3557 +         otherwise
3558 +@end display
3559 +
3560 +
3561 +
3562 +@subsection @code{BZ2_bzWrite}
3563 +@example
3564 +   void BZ2_bzWrite ( int *bzerror, BZFILE *b, void *buf, int len );
3565 +@end example
3566 +Absorbs @code{len} bytes from the buffer @code{buf}, eventually to be
3567 +compressed and written to the file.
3568 +
3569 +Possible assignments to @code{bzerror}:
3570 +@display
3571 +      @code{BZ_PARAM_ERROR} 
3572 +         if @code{b} is @code{NULL} or @code{buf} is @code{NULL} or @code{len < 0}
3573 +      @code{BZ_SEQUENCE_ERROR} 
3574 +         if b was opened with @code{BZ2_bzReadOpen}
3575 +      @code{BZ_IO_ERROR} 
3576 +         if there is an error writing the compressed file.
3577 +      @code{BZ_OK} 
3578 +         otherwise
3579 +@end display
3580 +
3581 +
3582 +
3583 +
3584 +@subsection @code{BZ2_bzWriteClose}
3585 +@example
3586 +   void BZ2_bzWriteClose ( int *bzerror, BZFILE* f,
3587 +                           int abandon,
3588 +                           unsigned int* nbytes_in,
3589 +                           unsigned int* nbytes_out );
3590 +
3591 +   void BZ2_bzWriteClose64 ( int *bzerror, BZFILE* f,
3592 +                             int abandon,
3593 +                             unsigned int* nbytes_in_lo32,
3594 +                             unsigned int* nbytes_in_hi32,
3595 +                             unsigned int* nbytes_out_lo32,
3596 +                             unsigned int* nbytes_out_hi32 );
3597 +@end example
3598 +
3599 +Compresses and flushes to the compressed file all data so far supplied
3600 +by @code{BZ2_bzWrite}.  The logical end-of-stream markers are also written, so
3601 +subsequent calls to @code{BZ2_bzWrite} are illegal.  All memory associated 
3602 +with the compressed file @code{b} is released.  
3603 +@code{fflush} is called on the
3604 +compressed file, but it is not @code{fclose}'d.
3605 +
3606 +If @code{BZ2_bzWriteClose} is called to clean up after an error, the only
3607 +action is to release the memory.  The library records the error codes
3608 +issued by previous calls, so this situation will be detected
3609 +automatically.  There is no attempt to complete the compression
3610 +operation, nor to @code{fflush} the compressed file.  You can force this
3611 +behaviour to happen even in the case of no error, by passing a nonzero
3612 +value to @code{abandon}.
3613 +
3614 +If @code{nbytes_in} is non-null, @code{*nbytes_in} will be set to be the
3615 +total volume of uncompressed data handled.  Similarly, @code{nbytes_out}
3616 +will be set to the total volume of compressed data written.  For 
3617 +compatibility with older versions of the library, @code{BZ2_bzWriteClose}
3618 +only yields the lower 32 bits of these counts.  Use
3619 +@code{BZ2_bzWriteClose64} if you want the full 64 bit counts.  These
3620 +two functions are otherwise absolutely identical.
3621 +
3622 +
3623 +Possible assignments to @code{bzerror}:
3624 +@display
3625 +      @code{BZ_SEQUENCE_ERROR} 
3626 +         if @code{b} was opened with @code{BZ2_bzReadOpen}
3627 +      @code{BZ_IO_ERROR} 
3628 +         if there is an error writing the compressed file
3629 +      @code{BZ_OK} 
3630 +         otherwise
3631 +@end display
3632 +
3633 +@subsection Handling embedded compressed data streams
3634 +
3635 +The high-level library facilitates use of
3636 +@code{bzip2} data streams which form some part of a surrounding, larger
3637 +data stream.
3638 +@itemize @bullet
3639 +@item For writing, the library takes an open file handle, writes
3640 +compressed data to it, @code{fflush}es it but does not @code{fclose} it.
3641 +The calling application can write its own data before and after the
3642 +compressed data stream, using that same file handle.
3643 +@item Reading is more complex, and the facilities are not as general
3644 +as they could be since generality is hard to reconcile with efficiency.
3645 +@code{BZ2_bzRead} reads from the compressed file in blocks of size
3646 +@code{BZ_MAX_UNUSED} bytes, and in doing so probably will overshoot
3647 +the logical end of compressed stream.
3648 +To recover this data once decompression has
3649 +ended, call @code{BZ2_bzReadGetUnused} after the last call of @code{BZ2_bzRead}
3650 +(the one returning @code{BZ_STREAM_END}) but before calling
3651 +@code{BZ2_bzReadClose}.
3652 +@end itemize
3653 +
3654 +This mechanism makes it easy to decompress multiple @code{bzip2}
3655 +streams placed end-to-end.  As the end of one stream, when @code{BZ2_bzRead}
3656 +returns @code{BZ_STREAM_END}, call @code{BZ2_bzReadGetUnused} to collect the
3657 +unused data (copy it into your own buffer somewhere).  
3658 +That data forms the start of the next compressed stream.
3659 +To start uncompressing that next stream, call @code{BZ2_bzReadOpen} again,
3660 +feeding in the unused data via the @code{unused}/@code{nUnused}
3661 +parameters.
3662 +Keep doing this until @code{BZ_STREAM_END} return coincides with the
3663 +physical end of file (@code{feof(f)}).  In this situation
3664 +@code{BZ2_bzReadGetUnused}
3665 +will of course return no data.
3666 +
3667 +This should give some feel for how the high-level interface can be used.
3668 +If you require extra flexibility, you'll have to bite the bullet and get
3669 +to grips with the low-level interface.
3670 +
3671 +@subsection Standard file-reading/writing code
3672 +Here's how you'd write data to a compressed file:
3673 +@example @code
3674 +FILE*   f;
3675 +BZFILE* b;
3676 +int     nBuf;
3677 +char    buf[ /* whatever size you like */ ];
3678 +int     bzerror;
3679 +int     nWritten;
3680 +
3681 +f = fopen ( "myfile.bz2", "w" );
3682 +if (!f) @{
3683 +   /* handle error */
3684 +@}
3685 +b = BZ2_bzWriteOpen ( &bzerror, f, 9 );
3686 +if (bzerror != BZ_OK) @{
3687 +   BZ2_bzWriteClose ( b );
3688 +   /* handle error */
3689 +@}
3690 +
3691 +while ( /* condition */ ) @{
3692 +   /* get data to write into buf, and set nBuf appropriately */
3693 +   nWritten = BZ2_bzWrite ( &bzerror, b, buf, nBuf );
3694 +   if (bzerror == BZ_IO_ERROR) @{ 
3695 +      BZ2_bzWriteClose ( &bzerror, b );
3696 +      /* handle error */
3697 +   @}
3698 +@}
3699 +
3700 +BZ2_bzWriteClose ( &bzerror, b );
3701 +if (bzerror == BZ_IO_ERROR) @{
3702 +   /* handle error */
3703 +@}
3704 +@end example
3705 +And to read from a compressed file:
3706 +@example
3707 +FILE*   f;
3708 +BZFILE* b;
3709 +int     nBuf;
3710 +char    buf[ /* whatever size you like */ ];
3711 +int     bzerror;
3712 +int     nWritten;
3713 +
3714 +f = fopen ( "myfile.bz2", "r" );
3715 +if (!f) @{
3716 +   /* handle error */
3717 +@}
3718 +b = BZ2_bzReadOpen ( &bzerror, f, 0, NULL, 0 );
3719 +if (bzerror != BZ_OK) @{
3720 +   BZ2_bzReadClose ( &bzerror, b );
3721 +   /* handle error */
3722 +@}
3723 +
3724 +bzerror = BZ_OK;
3725 +while (bzerror == BZ_OK && /* arbitrary other conditions */) @{
3726 +   nBuf = BZ2_bzRead ( &bzerror, b, buf, /* size of buf */ );
3727 +   if (bzerror == BZ_OK) @{
3728 +      /* do something with buf[0 .. nBuf-1] */
3729 +   @}
3730 +@}
3731 +if (bzerror != BZ_STREAM_END) @{
3732 +   BZ2_bzReadClose ( &bzerror, b );
3733 +   /* handle error */
3734 +@} else @{
3735 +   BZ2_bzReadClose ( &bzerror );
3736 +@}
3737 +@end example
3738 +
3739 +
3740 +
3741 +@section Utility functions
3742 +@subsection @code{BZ2_bzBuffToBuffCompress}
3743 +@example
3744 +   int BZ2_bzBuffToBuffCompress( char*         dest,
3745 +                                 unsigned int* destLen,
3746 +                                 char*         source,
3747 +                                 unsigned int  sourceLen,
3748 +                                 int           blockSize100k,
3749 +                                 int           verbosity,
3750 +                                 int           workFactor );
3751 +@end example
3752 +Attempts to compress the data in @code{source[0 .. sourceLen-1]}
3753 +into the destination buffer, @code{dest[0 .. *destLen-1]}.
3754 +If the destination buffer is big enough, @code{*destLen} is
3755 +set to the size of the compressed data, and @code{BZ_OK} is
3756 +returned.  If the compressed data won't fit, @code{*destLen}
3757 +is unchanged, and @code{BZ_OUTBUFF_FULL} is returned.
3758 +
3759 +Compression in this manner is a one-shot event, done with a single call
3760 +to this function.  The resulting compressed data is a complete
3761 +@code{bzip2} format data stream.  There is no mechanism for making
3762 +additional calls to provide extra input data.  If you want that kind of
3763 +mechanism, use the low-level interface.
3764 +
3765 +For the meaning of parameters @code{blockSize100k}, @code{verbosity}
3766 +and @code{workFactor}, @* see @code{BZ2_bzCompressInit}.
3767 +
3768 +To guarantee that the compressed data will fit in its buffer, allocate
3769 +an output buffer of size 1% larger than the uncompressed data, plus
3770 +six hundred extra bytes.
3771 +
3772 +@code{BZ2_bzBuffToBuffDecompress} will not write data at or
3773 +beyond @code{dest[*destLen]}, even in case of buffer overflow.
3774 +
3775 +Possible return values:
3776 +@display
3777 +      @code{BZ_CONFIG_ERROR}
3778 +         if the library has been mis-compiled
3779 +      @code{BZ_PARAM_ERROR} 
3780 +         if @code{dest} is @code{NULL} or @code{destLen} is @code{NULL}
3781 +         or @code{blockSize100k < 1} or @code{blockSize100k > 9}
3782 +         or @code{verbosity < 0} or @code{verbosity > 4} 
3783 +         or @code{workFactor < 0} or @code{workFactor > 250}
3784 +      @code{BZ_MEM_ERROR}
3785 +         if insufficient memory is available 
3786 +      @code{BZ_OUTBUFF_FULL}
3787 +         if the size of the compressed data exceeds @code{*destLen}
3788 +      @code{BZ_OK} 
3789 +         otherwise
3790 +@end display
3791 +
3792 +
3793 +
3794 +@subsection @code{BZ2_bzBuffToBuffDecompress}
3795 +@example
3796 +   int BZ2_bzBuffToBuffDecompress ( char*         dest,
3797 +                                    unsigned int* destLen,
3798 +                                    char*         source,
3799 +                                    unsigned int  sourceLen,
3800 +                                    int           small,
3801 +                                    int           verbosity );
3802 +@end example
3803 +Attempts to decompress the data in @code{source[0 .. sourceLen-1]}
3804 +into the destination buffer, @code{dest[0 .. *destLen-1]}.
3805 +If the destination buffer is big enough, @code{*destLen} is
3806 +set to the size of the uncompressed data, and @code{BZ_OK} is
3807 +returned.  If the compressed data won't fit, @code{*destLen}
3808 +is unchanged, and @code{BZ_OUTBUFF_FULL} is returned.
3809 +
3810 +@code{source} is assumed to hold a complete @code{bzip2} format
3811 +data stream.  @* @code{BZ2_bzBuffToBuffDecompress} tries to decompress
3812 +the entirety of the stream into the output buffer.
3813 +
3814 +For the meaning of parameters @code{small} and @code{verbosity},
3815 +see @code{BZ2_bzDecompressInit}.
3816 +
3817 +Because the compression ratio of the compressed data cannot be known in
3818 +advance, there is no easy way to guarantee that the output buffer will
3819 +be big enough.  You may of course make arrangements in your code to
3820 +record the size of the uncompressed data, but such a mechanism is beyond
3821 +the scope of this library.
3822 +
3823 +@code{BZ2_bzBuffToBuffDecompress} will not write data at or
3824 +beyond @code{dest[*destLen]}, even in case of buffer overflow.
3825 +
3826 +Possible return values:
3827 +@display
3828 +      @code{BZ_CONFIG_ERROR}
3829 +         if the library has been mis-compiled
3830 +      @code{BZ_PARAM_ERROR} 
3831 +         if @code{dest} is @code{NULL} or @code{destLen} is @code{NULL}
3832 +         or @code{small != 0 && small != 1}
3833 +         or @code{verbosity < 0} or @code{verbosity > 4} 
3834 +      @code{BZ_MEM_ERROR}
3835 +         if insufficient memory is available 
3836 +      @code{BZ_OUTBUFF_FULL}
3837 +         if the size of the compressed data exceeds @code{*destLen}
3838 +      @code{BZ_DATA_ERROR}
3839 +         if a data integrity error was detected in the compressed data
3840 +      @code{BZ_DATA_ERROR_MAGIC}
3841 +         if the compressed data doesn't begin with the right magic bytes
3842 +      @code{BZ_UNEXPECTED_EOF}
3843 +         if the compressed data ends unexpectedly
3844 +      @code{BZ_OK} 
3845 +         otherwise
3846 +@end display
3847 +
3848 +
3849 +
3850 +@section @code{zlib} compatibility functions
3851 +Yoshioka Tsuneo has contributed some functions to
3852 +give better @code{zlib} compatibility.  These functions are
3853 +@code{BZ2_bzopen}, @code{BZ2_bzread}, @code{BZ2_bzwrite}, @code{BZ2_bzflush},
3854 +@code{BZ2_bzclose},
3855 +@code{BZ2_bzerror} and @code{BZ2_bzlibVersion}.
3856 +These functions are not (yet) officially part of
3857 +the library.  If they break, you get to keep all the pieces.
3858 +Nevertheless, I think they work ok.
3859 +@example
3860 +typedef void BZFILE;
3861 +
3862 +const char * BZ2_bzlibVersion ( void );
3863 +@end example
3864 +Returns a string indicating the library version.
3865 +@example
3866 +BZFILE * BZ2_bzopen  ( const char *path, const char *mode );
3867 +BZFILE * BZ2_bzdopen ( int        fd,    const char *mode );
3868 +@end example
3869 +Opens a @code{.bz2} file for reading or writing, using either its name
3870 +or a pre-existing file descriptor. 
3871 +Analogous to @code{fopen} and @code{fdopen}.
3872 +@example         
3873 +int BZ2_bzread  ( BZFILE* b, void* buf, int len );
3874 +int BZ2_bzwrite ( BZFILE* b, void* buf, int len );
3875 +@end example
3876 +Reads/writes data from/to a previously opened @code{BZFILE}.
3877 +Analogous to @code{fread} and @code{fwrite}.
3878 +@example
3879 +int  BZ2_bzflush ( BZFILE* b );
3880 +void BZ2_bzclose ( BZFILE* b );
3881 +@end example
3882 +Flushes/closes a @code{BZFILE}.  @code{BZ2_bzflush} doesn't actually do
3883 +anything.  Analogous to @code{fflush} and @code{fclose}.
3884 +
3885 +@example 
3886 +const char * BZ2_bzerror ( BZFILE *b, int *errnum )
3887 +@end example
3888 +Returns a string describing the more recent error status of
3889 +@code{b}, and also sets @code{*errnum} to its numerical value.
3890 +
3891 +
3892 +@section Using the library in a @code{stdio}-free environment
3893 +
3894 +@subsection Getting rid of @code{stdio}
3895 +
3896 +In a deeply embedded application, you might want to use just
3897 +the memory-to-memory functions.  You can do this conveniently
3898 +by compiling the library with preprocessor symbol @code{BZ_NO_STDIO}
3899 +defined.  Doing this gives you a library containing only the following
3900 +eight functions:
3901 +
3902 +@code{BZ2_bzCompressInit}, @code{BZ2_bzCompress}, @code{BZ2_bzCompressEnd} @*
3903 +@code{BZ2_bzDecompressInit}, @code{BZ2_bzDecompress}, @code{BZ2_bzDecompressEnd} @*
3904 +@code{BZ2_bzBuffToBuffCompress}, @code{BZ2_bzBuffToBuffDecompress}
3905 +
3906 +When compiled like this, all functions will ignore @code{verbosity}
3907 +settings.
3908 +
3909 +@subsection Critical error handling
3910 +@code{libbzip2} contains a number of internal assertion checks which
3911 +should, needless to say, never be activated.  Nevertheless, if an
3912 +assertion should fail, behaviour depends on whether or not the library
3913 +was compiled with @code{BZ_NO_STDIO} set.
3914 +
3915 +For a normal compile, an assertion failure yields the message
3916 +@example
3917 +   bzip2/libbzip2: internal error number N.
3918 +   This is a bug in bzip2/libbzip2, 1.0 of 21-Mar-2000.
3919 +   Please report it to me at: jseward@@acm.org.  If this happened
3920 +   when you were using some program which uses libbzip2 as a
3921 +   component, you should also report this bug to the author(s)
3922 +   of that program.  Please make an effort to report this bug;
3923 +   timely and accurate bug reports eventually lead to higher
3924 +   quality software.  Thanks.  Julian Seward, 21 March 2000.
3925 +@end example
3926 +where @code{N} is some error code number.  @code{exit(3)}
3927 +is then called.
3928 +
3929 +For a @code{stdio}-free library, assertion failures result
3930 +in a call to a function declared as:
3931 +@example
3932 +   extern void bz_internal_error ( int errcode );
3933 +@end example
3934 +The relevant code is passed as a parameter.  You should supply
3935 +such a function.
3936 +
3937 +In either case, once an assertion failure has occurred, any 
3938 +@code{bz_stream} records involved can be regarded as invalid.
3939 +You should not attempt to resume normal operation with them.
3940 +
3941 +You may, of course, change critical error handling to suit
3942 +your needs.  As I said above, critical errors indicate bugs
3943 +in the library and should not occur.  All "normal" error
3944 +situations are indicated via error return codes from functions,
3945 +and can be recovered from.
3946 +
3947 +
3948 +@section Making a Windows DLL
3949 +Everything related to Windows has been contributed by Yoshioka Tsuneo
3950 +@* (@code{QWF00133@@niftyserve.or.jp} /
3951 +@code{tsuneo-y@@is.aist-nara.ac.jp}), so you should send your queries to
3952 +him (but perhaps Cc: me, @code{jseward@@acm.org}).
3953 +
3954 +My vague understanding of what to do is: using Visual C++ 5.0,
3955 +open the project file @code{libbz2.dsp}, and build.  That's all.
3956 +
3957 +If you can't
3958 +open the project file for some reason, make a new one, naming these files:
3959 +@code{blocksort.c}, @code{bzlib.c}, @code{compress.c}, 
3960 +@code{crctable.c}, @code{decompress.c}, @code{huffman.c}, @*
3961 +@code{randtable.c} and @code{libbz2.def}.  You will also need
3962 +to name the header files @code{bzlib.h} and @code{bzlib_private.h}.
3963 +
3964 +If you don't use VC++, you may need to define the proprocessor symbol
3965 +@code{_WIN32}. 
3966 +
3967 +Finally, @code{dlltest.c} is a sample program using the DLL.  It has a
3968 +project file, @code{dlltest.dsp}.
3969 +
3970 +If you just want a makefile for Visual C, have a look at
3971 +@code{makefile.msc}.
3972 +
3973 +Be aware that if you compile @code{bzip2} itself on Win32, you must set
3974 +@code{BZ_UNIX} to 0 and @code{BZ_LCCWIN32} to 1, in the file
3975 +@code{bzip2.c}, before compiling.  Otherwise the resulting binary won't
3976 +work correctly.
3977 +
3978 +I haven't tried any of this stuff myself, but it all looks plausible.
3979 +
3980 +
3981 +
3982 +@chapter Miscellanea
3983 +
3984 +These are just some random thoughts of mine.  Your mileage may
3985 +vary.
3986 +
3987 +@section Limitations of the compressed file format
3988 +@code{bzip2-1.0}, @code{0.9.5} and @code{0.9.0}
3989 +use exactly the same file format as the previous
3990 +version, @code{bzip2-0.1}.  This decision was made in the interests of
3991 +stability.  Creating yet another incompatible compressed file format
3992 +would create further confusion and disruption for users.
3993 +
3994 +Nevertheless, this is not a painless decision.  Development
3995 +work since the release of @code{bzip2-0.1} in August 1997
3996 +has shown complexities in the file format which slow down
3997 +decompression and, in retrospect, are unnecessary.  These are:
3998 +@itemize @bullet
3999 +@item The run-length encoder, which is the first of the 
4000 +      compression transformations, is entirely irrelevant.
4001 +      The original purpose was to protect the sorting algorithm
4002 +      from the very worst case input: a string of repeated
4003 +      symbols.  But algorithm steps Q6a and Q6b in the original
4004 +      Burrows-Wheeler technical report (SRC-124) show how
4005 +      repeats can be handled without difficulty in block
4006 +      sorting.
4007 +@item The randomisation mechanism doesn't really need to be
4008 +      there.  Udi Manber and Gene Myers published a suffix
4009 +      array construction algorithm a few years back, which
4010 +      can be employed to sort any block, no matter how 
4011 +      repetitive, in O(N log N) time.  Subsequent work by
4012 +      Kunihiko Sadakane has produced a derivative O(N (log N)^2) 
4013 +      algorithm which usually outperforms the Manber-Myers
4014 +      algorithm.
4015 +
4016 +      I could have changed to Sadakane's algorithm, but I find
4017 +      it to be slower than @code{bzip2}'s existing algorithm for
4018 +      most inputs, and the randomisation mechanism protects
4019 +      adequately against bad cases.  I didn't think it was
4020 +      a good tradeoff to make.  Partly this is due to the fact
4021 +      that I was not flooded with email complaints about
4022 +      @code{bzip2-0.1}'s performance on repetitive data, so
4023 +      perhaps it isn't a problem for real inputs.
4024 +
4025 +      Probably the best long-term solution,
4026 +      and the one I have incorporated into 0.9.5 and above,
4027 +      is to use the existing sorting
4028 +      algorithm initially, and fall back to a O(N (log N)^2)
4029 +      algorithm if the standard algorithm gets into difficulties.
4030 +@item The compressed file format was never designed to be
4031 +      handled by a library, and I have had to jump though
4032 +      some hoops to produce an efficient implementation of
4033 +      decompression.  It's a bit hairy.  Try passing
4034 +      @code{decompress.c} through the C preprocessor 
4035 +      and you'll see what I mean.  Much of this complexity
4036 +      could have been avoided if the compressed size of
4037 +      each block of data was recorded in the data stream.
4038 +@item An Adler-32 checksum, rather than a CRC32 checksum,
4039 +      would be faster to compute.
4040 +@end itemize
4041 +It would be fair to say that the @code{bzip2} format was frozen
4042 +before I properly and fully understood the performance
4043 +consequences of doing so.
4044 +
4045 +Improvements which I was able to incorporate into
4046 +0.9.0, despite using the same file format, are:
4047 +@itemize @bullet
4048 +@item Single array implementation of the inverse BWT.  This
4049 +      significantly speeds up decompression, presumably
4050 +      because it reduces the number of cache misses.
4051 +@item Faster inverse MTF transform for large MTF values.  The
4052 +      new implementation is based on the notion of sliding blocks
4053 +      of values.
4054 +@item @code{bzip2-0.9.0} now reads and writes files with @code{fread}
4055 +      and @code{fwrite}; version 0.1 used @code{putc} and @code{getc}.
4056 +      Duh!  Well, you live and learn.
4057 +
4058 +@end itemize
4059 +Further ahead, it would be nice 
4060 +to be able to do random access into files.  This will 
4061 +require some careful design of compressed file formats.
4062 +
4063 +
4064 +
4065 +@section Portability issues
4066 +After some consideration, I have decided not to use
4067 +GNU @code{autoconf} to configure 0.9.5 or 1.0.
4068 +
4069 +@code{autoconf}, admirable and wonderful though it is, 
4070 +mainly assists with portability problems between Unix-like
4071 +platforms.  But @code{bzip2} doesn't have much in the way
4072 +of portability problems on Unix; most of the difficulties appear
4073 +when porting to the Mac, or to Microsoft's operating systems.
4074 +@code{autoconf} doesn't help in those cases, and brings in a 
4075 +whole load of new complexity.
4076 +
4077 +Most people should be able to compile the library and program
4078 +under Unix straight out-of-the-box, so to speak, especially 
4079 +if you have a version of GNU C available.
4080 +
4081 +There are a couple of @code{__inline__} directives in the code.  GNU C
4082 +(@code{gcc}) should be able to handle them.  If you're not using
4083 +GNU C, your C compiler shouldn't see them at all.
4084 +If your compiler does, for some reason, see them and doesn't
4085 +like them, just @code{#define} @code{__inline__} to be @code{/* */}.  One
4086 +easy way to do this is to compile with the flag @code{-D__inline__=}, 
4087 +which should be understood by most Unix compilers.
4088 +
4089 +If you still have difficulties, try compiling with the macro
4090 +@code{BZ_STRICT_ANSI} defined.  This should enable you to build the
4091 +library in a strictly ANSI compliant environment.  Building the program
4092 +itself like this is dangerous and not supported, since you remove
4093 +@code{bzip2}'s checks against compressing directories, symbolic links,
4094 +devices, and other not-really-a-file entities.  This could cause
4095 +filesystem corruption!
4096 +
4097 +One other thing: if you create a @code{bzip2} binary for public
4098 +distribution, please try and link it statically (@code{gcc -s}).  This
4099 +avoids all sorts of library-version issues that others may encounter
4100 +later on.
4101 +
4102 +If you build @code{bzip2} on Win32, you must set @code{BZ_UNIX} to 0 and
4103 +@code{BZ_LCCWIN32} to 1, in the file @code{bzip2.c}, before compiling.
4104 +Otherwise the resulting binary won't work correctly.
4105 +
4106 +
4107 +
4108 +@section Reporting bugs
4109 +I tried pretty hard to make sure @code{bzip2} is
4110 +bug free, both by design and by testing.  Hopefully
4111 +you'll never need to read this section for real.
4112 +
4113 +Nevertheless, if @code{bzip2} dies with a segmentation
4114 +fault, a bus error or an internal assertion failure, it
4115 +will ask you to email me a bug report.  Experience with
4116 +version 0.1 shows that almost all these problems can
4117 +be traced to either compiler bugs or hardware problems.
4118 +@itemize @bullet
4119 +@item
4120 +Recompile the program with no optimisation, and see if it
4121 +works.  And/or try a different compiler.
4122 +I heard all sorts of stories about various flavours
4123 +of GNU C (and other compilers) generating bad code for
4124 +@code{bzip2}, and I've run across two such examples myself.
4125 +
4126 +2.7.X versions of GNU C are known to generate bad code from
4127 +time to time, at high optimisation levels.  
4128 +If you get problems, try using the flags
4129 +@code{-O2} @code{-fomit-frame-pointer} @code{-fno-strength-reduce}.
4130 +You should specifically @emph{not} use @code{-funroll-loops}.
4131 +
4132 +You may notice that the Makefile runs six tests as part of
4133 +the build process.  If the program passes all of these, it's
4134 +a pretty good (but not 100%) indication that the compiler has
4135 +done its job correctly.
4136 +@item
4137 +If @code{bzip2} crashes randomly, and the crashes are not
4138 +repeatable, you may have a flaky memory subsystem.  @code{bzip2}
4139 +really hammers your memory hierarchy, and if it's a bit marginal,
4140 +you may get these problems.  Ditto if your disk or I/O subsystem
4141 +is slowly failing.  Yup, this really does happen.
4142 +
4143 +Try using a different machine of the same type, and see if
4144 +you can repeat the problem.
4145 +@item This isn't really a bug, but ... If @code{bzip2} tells
4146 +you your file is corrupted on decompression, and you
4147 +obtained the file via FTP, there is a possibility that you
4148 +forgot to tell FTP to do a binary mode transfer.  That absolutely
4149 +will cause the file to be non-decompressible.  You'll have to transfer
4150 +it again.
4151 +@end itemize
4152 +
4153 +If you've incorporated @code{libbzip2} into your own program
4154 +and are getting problems, please, please, please, check that the 
4155 +parameters you are passing in calls to the library, are
4156 +correct, and in accordance with what the documentation says
4157 +is allowable.  I have tried to make the library robust against
4158 +such problems, but I'm sure I haven't succeeded.
4159 +
4160 +Finally, if the above comments don't help, you'll have to send
4161 +me a bug report.  Now, it's just amazing how many people will 
4162 +send me a bug report saying something like
4163 +@display
4164 +   bzip2 crashed with segmentation fault on my machine
4165 +@end display
4166 +and absolutely nothing else.  Needless to say, a such a report
4167 +is @emph{totally, utterly, completely and comprehensively 100% useless; 
4168 +a waste of your time, my time, and net bandwidth}.
4169 +With no details at all, there's no way I can possibly begin
4170 +to figure out what the problem is.
4171 +
4172 +The rules of the game are: facts, facts, facts.  Don't omit
4173 +them because "oh, they won't be relevant".  At the bare 
4174 +minimum:
4175 +@display
4176 +   Machine type.  Operating system version.  
4177 +   Exact version of @code{bzip2} (do @code{bzip2 -V}).  
4178 +   Exact version of the compiler used.  
4179 +   Flags passed to the compiler.
4180 +@end display
4181 +However, the most important single thing that will help me is
4182 +the file that you were trying to compress or decompress at the
4183 +time the problem happened.  Without that, my ability to do anything
4184 +more than speculate about the cause, is limited.
4185 +
4186 +Please remember that I connect to the Internet with a modem, so
4187 +you should contact me before mailing me huge files.
4188 +
4189 +
4190 +@section Did you get the right package?
4191 +
4192 +@code{bzip2} is a resource hog.  It soaks up large amounts of CPU cycles
4193 +and memory.  Also, it gives very large latencies.  In the worst case, you
4194 +can feed many megabytes of uncompressed data into the library before
4195 +getting any compressed output, so this probably rules out applications
4196 +requiring interactive behaviour.
4197 +
4198 +These aren't faults of my implementation, I hope, but more
4199 +an intrinsic property of the Burrows-Wheeler transform (unfortunately).  
4200 +Maybe this isn't what you want.
4201 +
4202 +If you want a compressor and/or library which is faster, uses less
4203 +memory but gets pretty good compression, and has minimal latency,
4204 +consider Jean-loup
4205 +Gailly's and Mark Adler's work, @code{zlib-1.1.2} and
4206 +@code{gzip-1.2.4}.  Look for them at
4207 +
4208 +@code{http://www.cdrom.com/pub/infozip/zlib} and
4209 +@code{http://www.gzip.org} respectively.
4210 +
4211 +For something faster and lighter still, you might try Markus F X J
4212 +Oberhumer's @code{LZO} real-time compression/decompression library, at
4213 +@* @code{http://wildsau.idv.uni-linz.ac.at/mfx/lzo.html}.
4214 +
4215 +If you want to use the @code{bzip2} algorithms to compress small blocks
4216 +of data, 64k bytes or smaller, for example on an on-the-fly disk
4217 +compressor, you'd be well advised not to use this library.  Instead,
4218 +I've made a special library tuned for that kind of use.  It's part of
4219 +@code{e2compr-0.40}, an on-the-fly disk compressor for the Linux
4220 +@code{ext2} filesystem.  Look at
4221 +@code{http://www.netspace.net.au/~reiter/e2compr}.
4222 +
4223 +
4224 +
4225 +@section Testing
4226 +
4227 +A record of the tests I've done.
4228 +
4229 +First, some data sets:
4230 +@itemize @bullet
4231 +@item B: a directory containing 6001 files, one for every length in the
4232 +      range 0 to 6000 bytes.  The files contain random lowercase
4233 +      letters.  18.7 megabytes.
4234 +@item H: my home directory tree.  Documents, source code, mail files,
4235 +      compressed data.  H contains B, and also a directory of 
4236 +      files designed as boundary cases for the sorting; mostly very
4237 +      repetitive, nasty files.  565 megabytes.
4238 +@item A: directory tree holding various applications built from source:
4239 +      @code{egcs}, @code{gcc-2.8.1}, KDE, GTK, Octave, etc.
4240 +      2200 megabytes.
4241 +@end itemize
4242 +The tests conducted are as follows.  Each test means compressing 
4243 +(a copy of) each file in the data set, decompressing it and
4244 +comparing it against the original.
4245 +
4246 +First, a bunch of tests with block sizes and internal buffer
4247 +sizes set very small, 
4248 +to detect any problems with the
4249 +blocking and buffering mechanisms.  
4250 +This required modifying the source code so as to try to 
4251 +break it.
4252 +@enumerate
4253 +@item Data set H, with
4254 +      buffer size of 1 byte, and block size of 23 bytes.
4255 +@item Data set B, buffer sizes 1 byte, block size 1 byte.
4256 +@item As (2) but small-mode decompression.
4257 +@item As (2) with block size 2 bytes.
4258 +@item As (2) with block size 3 bytes.
4259 +@item As (2) with block size 4 bytes.
4260 +@item As (2) with block size 5 bytes.
4261 +@item As (2) with block size 6 bytes and small-mode decompression.
4262 +@item H with buffer size of 1 byte, but normal block
4263 +      size (up to 900000 bytes).
4264 +@end enumerate
4265 +Then some tests with unmodified source code.
4266 +@enumerate
4267 +@item H, all settings normal.
4268 +@item As (1), with small-mode decompress.
4269 +@item H, compress with flag @code{-1}.
4270 +@item H, compress with flag @code{-s}, decompress with flag @code{-s}.
4271 +@item Forwards compatibility: H, @code{bzip2-0.1pl2} compressing,
4272 +      @code{bzip2-0.9.5} decompressing, all settings normal.
4273 +@item Backwards compatibility:  H, @code{bzip2-0.9.5} compressing,
4274 +      @code{bzip2-0.1pl2} decompressing, all settings normal.
4275 +@item Bigger tests: A, all settings normal.
4276 +@item As (7), using the fallback (Sadakane-like) sorting algorithm.
4277 +@item As (8), compress with flag @code{-1}, decompress with flag
4278 +      @code{-s}.
4279 +@item H, using the fallback sorting algorithm.
4280 +@item Forwards compatibility: A, @code{bzip2-0.1pl2} compressing,
4281 +      @code{bzip2-0.9.5} decompressing, all settings normal.
4282 +@item Backwards compatibility:  A, @code{bzip2-0.9.5} compressing,
4283 +      @code{bzip2-0.1pl2} decompressing, all settings normal.
4284 +@item Misc test: about 400 megabytes of @code{.tar} files with
4285 +      @code{bzip2} compiled with Checker (a memory access error
4286 +       detector, like Purify).
4287 +@item Misc tests to make sure it builds and runs ok on non-Linux/x86
4288 +      platforms.
4289 +@end enumerate
4290 +These tests were conducted on a 225 MHz IDT WinChip machine, running
4291 +Linux 2.0.36.  They represent nearly a week of continuous computation.
4292 +All tests completed successfully.
4293 +
4294 +
4295 +@section Further reading
4296 +@code{bzip2} is not research work, in the sense that it doesn't present
4297 +any new ideas.  Rather, it's an engineering exercise based on existing
4298 +ideas.
4299 +
4300 +Four documents describe essentially all the ideas behind @code{bzip2}:
4301 +@example
4302 +Michael Burrows and D. J. Wheeler:
4303 +  "A block-sorting lossless data compression algorithm"
4304 +   10th May 1994. 
4305 +   Digital SRC Research Report 124.
4306 +   ftp://ftp.digital.com/pub/DEC/SRC/research-reports/SRC-124.ps.gz
4307 +   If you have trouble finding it, try searching at the
4308 +   New Zealand Digital Library, http://www.nzdl.org.
4309 +
4310 +Daniel S. Hirschberg and Debra A. LeLewer
4311 +  "Efficient Decoding of Prefix Codes"
4312 +   Communications of the ACM, April 1990, Vol 33, Number 4.
4313 +   You might be able to get an electronic copy of this
4314 +      from the ACM Digital Library.
4315 +
4316 +David J. Wheeler
4317 +   Program bred3.c and accompanying document bred3.ps.
4318 +   This contains the idea behind the multi-table Huffman
4319 +   coding scheme.
4320 +   ftp://ftp.cl.cam.ac.uk/users/djw3/
4321 +
4322 +Jon L. Bentley and Robert Sedgewick
4323 +  "Fast Algorithms for Sorting and Searching Strings"
4324 +   Available from Sedgewick's web page,
4325 +   www.cs.princeton.edu/~rs
4326 +@end example
4327 +The following paper gives valuable additional insights into the
4328 +algorithm, but is not immediately the basis of any code
4329 +used in bzip2.
4330 +@example
4331 +Peter Fenwick:
4332 +   Block Sorting Text Compression
4333 +   Proceedings of the 19th Australasian Computer Science Conference,
4334 +     Melbourne, Australia.  Jan 31 - Feb 2, 1996.
4335 +   ftp://ftp.cs.auckland.ac.nz/pub/peter-f/ACSC96paper.ps
4336 +@end example
4337 +Kunihiko Sadakane's sorting algorithm, mentioned above,
4338 +is available from:
4339 +@example
4340 +http://naomi.is.s.u-tokyo.ac.jp/~sada/papers/Sada98b.ps.gz
4341 +@end example
4342 +The Manber-Myers suffix array construction
4343 +algorithm is described in a paper
4344 +available from:
4345 +@example
4346 +http://www.cs.arizona.edu/people/gene/PAPERS/suffix.ps
4347 +@end example
4348 +Finally, the following paper documents some recent investigations
4349 +I made into the performance of sorting algorithms:
4350 +@example
4351 +Julian Seward:
4352 +   On the Performance of BWT Sorting Algorithms
4353 +   Proceedings of the IEEE Data Compression Conference 2000
4354 +     Snowbird, Utah.  28-30 March 2000.
4355 +@end example
4356 +
4357 +
4358 +@contents
4359 +
4360 +@bye
4361 +
4362 diff -Nru bzip2-1.0.1/doc/bzip2recover.1 bzip2-1.0.1.new/doc/bzip2recover.1
4363 --- bzip2-1.0.1/doc/bzip2recover.1      Thu Jan  1 01:00:00 1970
4364 +++ bzip2-1.0.1.new/doc/bzip2recover.1  Sat Jun 24 20:13:06 2000
4365 @@ -0,0 +1 @@
4366 +.so bzip2.1
4367 \ No newline at end of file
4368 diff -Nru bzip2-1.0.1/doc/pl/Makefile.am bzip2-1.0.1.new/doc/pl/Makefile.am
4369 --- bzip2-1.0.1/doc/pl/Makefile.am      Thu Jan  1 01:00:00 1970
4370 +++ bzip2-1.0.1.new/doc/pl/Makefile.am  Sat Jun 24 20:13:06 2000
4371 @@ -0,0 +1,4 @@
4372 +
4373 +mandir = @mandir@/pl
4374 +man_MANS = bzip2.1 bunzip2.1 bzcat.1 bzip2recover.1
4375 +
4376 diff -Nru bzip2-1.0.1/doc/pl/bunzip2.1 bzip2-1.0.1.new/doc/pl/bunzip2.1
4377 --- bzip2-1.0.1/doc/pl/bunzip2.1        Thu Jan  1 01:00:00 1970
4378 +++ bzip2-1.0.1.new/doc/pl/bunzip2.1    Sat Jun 24 20:13:06 2000
4379 @@ -0,0 +1 @@
4380 +.so bzip2.1
4381 \ No newline at end of file
4382 diff -Nru bzip2-1.0.1/doc/pl/bzcat.1 bzip2-1.0.1.new/doc/pl/bzcat.1
4383 --- bzip2-1.0.1/doc/pl/bzcat.1  Thu Jan  1 01:00:00 1970
4384 +++ bzip2-1.0.1.new/doc/pl/bzcat.1      Sat Jun 24 20:13:06 2000
4385 @@ -0,0 +1 @@
4386 +.so bzip2.1
4387 \ No newline at end of file
4388 diff -Nru bzip2-1.0.1/doc/pl/bzip2.1 bzip2-1.0.1.new/doc/pl/bzip2.1
4389 --- bzip2-1.0.1/doc/pl/bzip2.1  Thu Jan  1 01:00:00 1970
4390 +++ bzip2-1.0.1.new/doc/pl/bzip2.1      Sat Jun 24 20:13:06 2000
4391 @@ -0,0 +1,384 @@
4392 +.\" T³umaczenie  Maciej Wojciechowski     wojciech@staszic.waw.pl
4393 +.PU
4394 +.TH bzip2 1 "" "" "wersja 1.0"
4395 +.SH NAZWA
4396 +bzip2, bunzip2 \- sortuj±cy bloki kompresor/dekompresor plików, v1.0
4397 +.br
4398 +bzcat \- dekompresuje pliki na standardowe wyj¶cie
4399 +.br
4400 +bzip2recover \- odzyskuje dane ze zniszczonych archiwów bzip2
4401 +.SH SK£ADNIA
4402 +.ll +8
4403 +.B bzip2
4404 +.RB [ \-cdfkqstvzVL123456789 ]
4405 +.RI [ nazwy_plików \&...]
4406 +.ll -8
4407 +.br
4408 +.B bunzip2
4409 +.RB [ \-fkvsVL ]
4410 +.RI [ nazwy_plików \&...]
4411 +.br
4412 +.B bzcat
4413 +.RB [ \-s ]
4414 +.RI [ nazwy_plików \&...]
4415 +.br
4416 +.B bzip2recover
4417 +.I nazwa_pliku
4418 +.SH OPIS
4419 +.I bzip2
4420 +kompresuje pliki u¿ywaj±c algorytmu sortowania bloków Burrowsa-Wheelera i 
4421 +kodu Huffmana. Kompresja jest generalnie sporo lepsza od konwencjonalnych 
4422 +kompresorów opartych o metodê LZ77/LZ78, i jest porównywalna z 
4423 +osi±gniêciami statystycznych kompresorów z rodziny PPM.
4424 +
4425 +Opcje linii poleceñ s± w wiêkszo¶ci bardzo podobne do tych z
4426 +.IR "GNU gzip" ,
4427 +ale nie s± identyczne.
4428 +
4429 +.I bzip2
4430 +oczekuje listy plików towarzysz±cych parametrom linii poleceñ. Ka¿dy plik jest 
4431 +zastêpowany przez swoj± skompresowan± wersjê, z nazw± 
4432 +"oryginalny_plik.bz2". Ka¿dy skompresowany plik ma ten sam czas modyfikacji, 
4433 +uprawnienia i, je¶li to mo¿liwe, w³a¶ciciela co orygina³, po to, aby te 
4434 +ustawienia mog³y zostaæ odtworzone podczas dekompresji. Utrzymywanie nazwy 
4435 +plików nie jest do koñca dok³adne w tym sensie, Â¿e nie ma mo¿liwo¶ci 
4436 +przetrzymywania daty, uprawnieñ, w³a¶ciciela i nazw plików na systemach, na 
4437 +których brakuje tych mo¿liwo¶ci lub maj± ograniczenia co do d³ugo¶ci nazwy, 
4438 +tak np. jak MS-DOS.
4439 +
4440 +.I bzip2
4441 +i
4442 +.I bunzip2
4443 +standardowo nie nadpisuj± istniej±cych ju¿ plików. Je¶li chcesz aby to 
4444 +robi³y, musisz u¿yæ parametru \-f.
4445 +
4446 +Je¶li nie podano Â¿adnej nazwy pliku,
4447 +.I bzip2
4448 +kompresuje ze standardowego wej¶cia na standardowe wyj¶cie. Odmiawia wówczas
4449 +wypisywania skompresowanego wyj¶cie na terminal, gdy¿ by³oby to
4450 +ca³kiem niezrozumia³e i przez to bez wiêkszego sensu.
4451 +
4452 +.I bunzip2
4453 +(lub
4454 +.IR bzip2 \-d ) 
4455 +dekompresuje wszystkie podane pliki. Pliki, które nie by³y 
4456 +utworzone przez
4457 +.I bzip2
4458 +zostan± wykryte i zignorowane, a na ekranie pojawi siê komunikat 
4459 +ostrzegawczy.
4460 +.I bzip2
4461 +próbuje zgadn±æ nazwê dla dekompresowanego pliku w nastêpuj±cy sposób:
4462 +.nf
4463 +       nazwa_pliku.bz2    staje siê   nazwa_pliku
4464 +       nazwa_pliku.bz     staje siê   nazwa_pliku
4465 +       nazwa_pliku.tbz2   staje siê   nazwa_pliku.tar
4466 +       nazwa_pliku.tbz    staje siê   nazwa_pliku.tar
4467 +       inna_nazwa        staje siê   inna_nazwa.out
4468 +.fi
4469 +Je¶li plik nie ma jednego z nastêpuj±cych rozpoznawalnych rozszerzeñ,
4470 +.IR .bz2 , 
4471 +.IR .bz , 
4472 +.I .tbz2
4473 +lub
4474 +.IR .tbz ,
4475 +to
4476 +.I bzip2 
4477 +napisze, Â¿e nie mo¿e zgadn±æ nazwy pierwotnego pliku, i u¿yje
4478 +oryginalnej nazwy z dodanym rozszerzeniem
4479 +.IR .out .
4480 +
4481 +Tak jak kompresja, nie posiadaj±ca Â¿adnych plików, powoduje kompresjê ze 
4482 +standardowego wej¶cia na standardowe wyj¶cie.
4483 +
4484 +.I bunzip2 
4485 +poprawnie zdekompresuje plik, który jest po³aczeniem dwóch lub wiêcej 
4486 +skompresowanych plików. Rezultatem jest po³±czony odpowiedni 
4487 +nieskompresowany plik. Obs³ugiwane jest równie¿ sprawdzanie spójno¶ci
4488 +(\-t) po³±czonych skompresowanych plików.
4489 +
4490 +Mo¿esz równie¿ kompresowaæ lub dekompresowaæ pliki na standardowe wyj¶cie 
4491 +u¿ywaj±c parametru \-c. W ten w³a¶nie sposób mo¿na przeprowadzaæ kompresjê
4492 +wielu plików równocze¶nie.
4493 +Powsta³e wyniki s± przesy³ane sekwencyjnie na standardowe wyj¶cie.
4494 +W ten sposób kompresja wielu plików generuje strumieñ 
4495 +zawieraj±cy reprezentacje kilku skompresowanych plików. Taki strumieñ mo¿e 
4496 +byæ zdekompresowany poprawnie tylko przez 
4497 +.I bzip2
4498 +w wersji 0.9.0 lub pó¼niejszej. Wcze¶niejsze wersje
4499 +.I bzip2
4500 +zatrzymaj± siê po zdekmpresowaniu pierwszego pliku w strumieniu.
4501 +
4502 +.I bzcat
4503 +(lub
4504 +.I bzip2 -dc) 
4505 +dekompresuje wszystkie wybrane pliki na standardowe wyj¶cie.
4506 +
4507 +.I bzip2
4508 +czyta argumenty ze zmiennych Â¶rodowiskowych
4509 +.I BZIP2
4510 +i
4511 +.I BZIP,
4512 +w podanej kolejno¶ci, i przetwarza je przed jakimikolwiek argumentami 
4513 +przeczytanymi z linii poleceñ. To dobra metoda na specyfikowanie 
4514 +standardowych ustawieñ.
4515 +
4516 +Kompresja stosowana jest zawsze, nawet je¶li skompresowany plik jest 
4517 +nieznaczniej wiêkszy od pliku oryginalnego. Pliki mniejsze ni¿ mniej wiêcej 
4518 +sto bajtów staj± siê wiêksze, poniewa¿ mechanizm kompresji ma sta³y 
4519 +nag³ówek wynosz±cy oko³o 50 bajtów. Przypadkowe dane (w³±czaj±c wyj¶cie 
4520 +wiêkszo¶ci kompresorów plików) d± kodowane na mniej wiêcej 8.05 bitu na 
4521 +bajt, daj±c zysk oko³o 0.5%.
4522 +
4523 +Jako samosprawdzenie dla twojej ochrony
4524 +.I bzip2
4525 +u¿ywa 32-bitowego CRC aby upewniæ siê, Â¿e zdekompresowana wersja pliku jest 
4526 +identyczna z oryginaln±. To strze¿e przed stratami w skompresowanych danych 
4527 +i przed niewykrytymi b³êdami w 
4528 +.I bzip2
4529 +(na szczê¶cie bardzo rzadkich). Mo¿liwo¶æ niewykrycia utraty danych 
4530 +jest mikroskopijna, mniej wiêcej jedna szansa na cztery biliony dla ka¿dego 
4531 +pliku. Uwa¿aj jednak, gdy¿ sprawdzenie jest dokonywane przed dekompresj±, 
4532 +wiêc dowiesz siê tylko tego, Â¿e co¶ jest nie w porz±dku. Nie pomo¿e ci to odzyskaæ 
4533 +oryginalnych nieskompresowanych danych. Mo¿esz u¿yæ
4534 +.I bzip2recover
4535 +aby spróbowaæ odzyskaæ dane z uszkodzonych plików.
4536 +
4537 +Zwracane warto¶ci: 0 dla normalnego wyj¶cia, 1 dla problemów technicznych 
4538 +(plik nie znaleziony, niew³a¶ciwy parametr, b³±d wyj¶cia/wyj¶cia itp.), 2 dla 
4539 +zasygnalizowania b³êdu skompresowanego pliku, 3 dla wewnêtrznego b³êdu (np. 
4540 +bug), który zmusi³ \fIbzip2\fP do przerwania.
4541 +
4542 +.SH OPCJE
4543 +.TP
4544 +.B \-c --stdout
4545 +Kompresuje lub dekompresuje na standardowe wyj¶cie.
4546 +.TP
4547 +.B \-d --decompress
4548 +Wymusza dekompresjê.
4549 +.IR bzip2 , 
4550 +.I bunzip2 
4551 +i
4552 +.I bzcat 
4553 +s± tak naprawdê tymi samymi programami i decyzja jakie akcje bêd± wykonane 
4554 +jest wykonywana na podstawie nazwy jaka zosta³a u¿yta. Ten parametr ma wy¿szy 
4555 +priorytet i wymusza na \fIbzip2\fP dekompresjê.
4556 +.TP
4557 +.B \-z --compress
4558 +Podobne do \-d: wymusza kompresjê, bez wzglêdu na sposób wywo³ania.
4559 +.TP
4560 +.B \-t --test
4561 +Sprawdza integralno¶æ wybranego pliku(ów), ale nie dekompresuje ich. Wymusza
4562 +to próbn± dekompresjê i mówi, jaki jest rezultat.
4563 +.TP
4564 +.B \-f --force
4565 +Wymusza zastêpowanie plików wyj¶ciowych. Normalnie, \fIbzip2\fP nie 
4566 +zastêpuje istniej±cych plików wyj¶ciowych. Wymusza równie¿ na \fIbzip2\fP 
4567 +³amanie dowi±zañ twardych, czego normalnie nie robi.
4568 +.TP
4569 +.B \-k --keep
4570 +Zatrzymaj (nie kasuj) pliki wej¶ciowe przy kompresji lub dekompresji.
4571 +.TP
4572 +.B \-s --small
4573 +Zredukuj u¿ycie pamiêci na kompresjê, dekompresjê i testowanie. Pliki s± 
4574 +dekompresowane i testowane przy u¿yciu zmodyfikowanego algorytmu, który 
4575 +potrzebuje tylko 2.5 bajtu na blok bajtów. Oznacza to, Â¿e ka¿dy plik mo¿e 
4576 +byæ zdekompresowany przy u¿yciu oko³o 2300k pamiêci, jednak trac±c oko³o po³owê 
4577 +normalnej szybko¶ci.
4578 +
4579 +Podczas kompresji, \-s wybiera bloki wielko¶ci 200k, których limity 
4580 +pamiêci wynosz± mniej wiêcej tyle samo, w zamian za jako¶æ kompresji. W 
4581 +skrócie, je¶li twój komputer ma ma³o pamiêci (8 megabajtów lub mniej), 
4582 +u¿ywaj opcji \-s do wszystkiego. Zobacz \fBzarz±dzanie pamiêci±\fP poni¿ej.
4583 +.TP
4584 +.B \-q --quiet
4585 +Wy³±cza wszystkie nieistotne komunikaty ostrzegawcze.
4586 +Nie s± eliminowane komunikaty dotycz±ce b³êdów wej¶cia/wyj¶cia i innych
4587 +zdarzeñ krytycznych.
4588 +.TP
4589 +.B \-v --verbose
4590 +Tryb gadatliwy -- pokazuje stopieñ kompresji dla ka¿dego pliku. Nastêpne 
4591 +\fB\-v\fP zwiêkszaj± stopieñ gadatliwo¶ci, powoduj±c wy¶wietlanie du¿ej 
4592 +ilo¶ci informacji, przydatnych g³ównie przy diagnostyce.
4593 +.TP
4594 +.B \-L --license -V --version
4595 +Wy¶wietla wersjê programu i warunki licencji.
4596 +.TP
4597 +.B \-1 to \-9
4598 +Ustawia wielko¶æ bloku na 100 k, 200 k .. 900 k przy kompresji. Nie ma 
4599 +¿adnego znaczenia przy dekompresji. Zobacz \fBzarz±dzanie pamiêci±\fP 
4600 +poni¿ej.
4601 +.TP
4602 +.B \--
4603 +Traktuje wszystkie nastêpuj±ce po nim argumenty jako nazwy plików, nawet je¶li 
4604 +zaczynaj± siê one od my¶lnika. Mo¿esz wiêc kompresowaæ i dekompresowaæ 
4605 +pliki, których nazwa zaczyna siê od my¶lnika, na przyk³ad: bzip2 \-- 
4606 +\-mój_plik.
4607 +.TP
4608 +.B \--repetitive-fast --repetitive-best
4609 +Te parametry nie maj± znaczenia w wersjach 0.9.5 i wy¿szych. Umo¿liwia³y one 
4610 +pewn± infantyln± kontrolê nad zachowaniem algorytmu sortuj±cego we 
4611 +wcze¶niejszych wersjach, co by³o czasami u¿yteczne. Wersje 0.9.5 i wy¿sze 
4612 +maj± usprawniony algorytm, który powoduje bezu¿yteczno¶æ tej funkcji.
4613 +
4614 +.SH ZARZ¡DZANIE PAMIÊCI¡
4615 +.I bzip2 
4616 +kompresuje du¿e pliki w blokach. Rozmiar bloku ma wp³yw zarówno na stopieñ 
4617 +osi±ganej kompresji, jak równie¿ na ilo¶æ pamiêci potrzebnej do kompresji 
4618 +i dekompresji. Parametry od \-1 do \-9 wybieraj± rozmiar bloku odpowiednio
4619 +od 100,000 bajtów a¿ do 900,000 bajtów (standardowo). W czasie dekompresji, 
4620 +rozmiar bloku u¿ytego do kompresji jest odczytywany z nag³ówku pliku 
4621 +skompresowanego i
4622 +.I bunzip2
4623 +sam zajmuje odpowiedni± do dekompresji ilo¶æ pamiêci. Poniewa¿ rozmiar
4624 +bloków jest przetrzymywany w pliku skompresowanym, parametry od \-1 do \-9 
4625 +nie maj± przy dekompresji Â¿adnego znaczenia.
4626 +
4627 +Wymagania kompresji i dekompresji w bajtach, mog± byæ wyliczone przez:
4628 +
4629 +       Kompresja :   400k + ( 8 x rozmiar bloku )
4630 +
4631 +       Dekompresja :  100k + ( 4 x rozmiar bloku ) lub
4632 +                      100k + ( 2.5 x rozmiar bloku )
4633 +
4634 +Wiêksze bloki daj± du¿e zmniejszenie zwrotów marginalnych. Wiêkszo¶æ 
4635 +kompresji pochodzi z pierwszych stu lub dwustu kilobajtów rozmiaru bloku.
4636 +Warto o tym pamiêtaæ u¿ywaj±c \fIbzip2\fP na wolnych 
4637 +komputerach. Warto równie¿ podkre¶liæ, Â¿e rozmiar pamiêci potrzebnej do 
4638 +dekompresji jest wybierany poprzez ustawienie odpowiedniej 
4639 +wielko¶ci bloku przy kompresji.
4640 +
4641 +Dla plików skompresowanych standardowym blokiem wielko¶ci 900k, 
4642 +\fIbunzip2\fP bêdzie wymaga³ oko³o 3700 kilobajtów do dekompresji. Aby 
4643 +umo¿liwiæ dekompresjê na komputerze wyposa¿onym jedynie w 4 megabajty 
4644 +pamiêci, \fIbunzip2\fP ma opcjê, która mo¿e zmniejszyæ wymagania prawie do 
4645 +po³owy, tzn. oko³o 2300 kilobajtów. Prêdko¶æ dekompresji jest równie¿ bardzo 
4646 +zmiejszona, wiêc u¿ywaj tej opcji tylko wtedy, kiedy jest to konieczne. Tym 
4647 +parametrem jest -s.
4648 +
4649 +Generalnie, próbuj i u¿ywaj najwiêkszych rozmiarów bloków, je¶li ilo¶æ 
4650 +pamiêci ci na to pozwala. Prêdko¶æ kompresji i dekompresji w zasadzie nie 
4651 +zale¿y od wielko¶ci u¿ytego bloku.
4652 +
4653 +Inna wa¿na rzecz dotyczy plików, które mieszcz± siê w pojedyñczym bloku -- 
4654 +oznacza to wiêkszo¶æ plików na które siê natkniesz u¿ywaj±c du¿ych bloków. 
4655 +Rozmiar realny pamiêci zabieranej jest proporcjonalny do wielko¶ci pliku, 
4656 +je¶li plik jest mniejszy ni¿ blok. Na przyk³ad, kompresja pliku o 
4657 +wielko¶ci 20,000 bajtów z parametrem -9 wymusi na kompresorze odnalezienie 
4658 +7600 k pamiêci, ale zajêcie tylko 400k + 20000 * 8 = 560 kilobajtów z 
4659 +tego. Podobnie, dekompresor odnajdzie 3700k, ale zajmie tylko 100k + 20000 
4660 +* 4 = 180 kilobajtów.
4661 +
4662 +Tu jest tabela, która podsumowuje maksymalne u¿ycie pamiêci dla ró¿nych 
4663 +rozmiarów bloków. Podano te¿ ca³kowity rozmiar skompresowanych 14 
4664 +plików tekstowych (Calgary Text Compressione Corpus) zajmuj±cych razem 
4665 +3,141,622 bajtów. Ta kolumna daje pewne pojêcie o tym, jaki wp³yw na 
4666 +kompresjê ma wielko¶æ bloków. Ta tabela uzmys³awia równie¿ przewagê u¿ycia 
4667 +wiêkszych bloków dla wiêkszych plików, poniewa¿ "Corpus" jest zdominowany 
4668 +przez mniejsze pliki.
4669 +.nf
4670 +             U¿ycie       U¿ycie        U¿ycie         Corpus
4671 +   Parametr kompresji   dekompresji   dekompresji -s    Size
4672 +
4673 +     -1      1200k         500k          350k          914704
4674 +     -2      2000k         900k          600k          877703
4675 +     -3      2800k         1300k         850k          860338
4676 +     -4      3600k         1700k        1100k          846899
4677 +     -5      4400k         2100k        1350k          845160
4678 +     -6      5200k         2500k        1600k          838626
4679 +     -7      6100k         2900k        1850k          834096
4680 +     -8      6800k         3300k        2100k          828642
4681 +     -9      7600k         3700k        2350k          828642
4682 +.fi
4683 +.SH ODZYSKIWANIE DANYCH ZE ZNISZCZONYCH PLIKÓW BZIP2
4684 +.I bzip2
4685 +kompresuje pliki w blokach, zazwyczaj 900 kilbajtowych. Ka¿dy blok jest 
4686 +trzymany osobno. Je¶li b³êdy transmisji lub no¶nika uszkodz± plik 
4687 +wieloblokowy .bz2, mo¿liwe jest odtworzenie danych zawartych w 
4688 +niezniszczonych blokach pliku.
4689 +
4690 +Ka¿dy blok jest reprezentowany przez 48-bitowy wzorzec, który umo¿liwia 
4691 +znajdowanie przyporz±dkowañ bloków z rozs±dn± pewno¶ci±. Ka¿dy blok 
4692 +ma równie¿ swój 32-bitowy CRC, wiêc bloki uszkodzone mog± byæ Â³atwo 
4693 +odseparowane od poprawnych.
4694 +
4695 +.I bzip2recover
4696 +jest oddzielnym programem, którego zadaniem jest poszukiwanie bloków w 
4697 +plikach .bz2 i zapisywanie ich do w³asnego pliku .bz2. Mo¿esz potem u¿yæ 
4698 +\fIbzip2\fP \-t aby sprawdziæ spójno¶æ wyj¶ciowego pliku i zdekompresowaæ 
4699 +te, które nie s± uszkodzone.
4700 +
4701 +.I bzip2recover
4702 +pobiera pojedynczy argument, nazwê uszkodzonego pliku, i tworzy pewn± liczbê 
4703 +plików "rec0001plik.bz2", "rec0002plik.bz2", itd., przetrzymuj±ce odzyskane 
4704 +bloki. Wyj¶ciowe nazwy plików s± tak tworzone, aby Â³atwo by³o potem u¿ywaæ 
4705 +ich razem za pomoc± gwiazdek -- na przyk³ad, "bzip2 -dc rec*plik.bz2 > 
4706 +odzyskany_plik" -- wylistuje pliki we w³a¶ciwej kolejno¶ci.
4707 +
4708 +.I bzip2recover
4709 +powinien byæ u¿ywany najczê¶ciej z du¿ymi plikami .bz2, jako i¿ one 
4710 +zawieraj± najczê¶ciej du¿o bloków. Jest czystym bezsensem u¿ywaæ go na 
4711 +uszkodzonym jedno-blokowym pliku, poniewa¿ uszkodzony blok nie mo¿e byæ 
4712 +odzyskany. Je¶li chcesz zminimalizowaæ jakiekolwiek mo¿liwe straty danych 
4713 +poprzez no¶nik lub transmisjê, powiniene¶ zastanowiæ siê nad u¿yciem 
4714 +mniejszych bloków.
4715 +
4716 +.SH OPISY WYNIKÓW
4717 +Etap sortuj±cy kompresji Â³Â±czy razem podobne ci±gi znaków w pliku. Przez 
4718 +to, pliki zawieraj±ce bardzo d³ugie ci±gi powtarzaj±cych siê symboli, jak 
4719 +"aabaabaabaab ..." (powtórzone kilkaset razy) mog± byæ kompresowane wolniej 
4720 +ni¿ normalnie. Wersje 0.9.5 i wy¿sze zachowuj± siê du¿o lepiej w tej 
4721 +sytuacji ni¿ wersje poprzednie. Ró¿nica stopnia kompresji pomiêdzy 
4722 +najgorszym i najlepszym przypadkiem kompresji wynosi oko³o 10:1. Dla 
4723 +wcze¶niejszych wersji by³o to nawet oko³o 100:1. Je¶li chcesz, mo¿esz u¿yæ
4724 +parametru \-vvvv aby monitorowaæ postêpy bardzo szczegó³owo.
4725 +
4726 +Prêdko¶æ dekompresji nie jest zmieniana przez to zjawisko.
4727 +
4728 +.I bzip2
4729 +zazwyczaj rezerwuje kilka megabajtów pamiêci do dzia³ania a 
4730 +potem wykorzystuje j± w sposób zupe³nie przypadkowy.
4731 +Oznacza to, Â¿e zarówno prêdko¶æ kompresji jak i dekompresji jest w 
4732 +du¿ej czê¶ci zale¿na od prêdko¶ci, z jak± twój komputer mo¿e naprawiaæ braki 
4733 +bufora podrêcznego. Z tego powodu, wprowadzone zosta³y ma³e zmiany kody aby 
4734 +zmniejszyæ straty, które da³y nieproporcjonalnie du¿y wzrost osi±gniêæ.
4735 +My¶lê, Â¿e
4736 +.I bzip2
4737 +bêdzie dzia³a³ najlepiej na komputerach z du¿ymi buforami podrêcznymi.
4738 +
4739 +.SH ZAKAMARKI
4740 +Wiadomo¶ci o b³êdach wej¶cia/wyj¶cia nie s± a¿ tak pomocne, jak mog³yby byæ.
4741 +.I bzip2
4742 +stara siê wykryæ b³±d wej¶cia/wyj¶cia i wyj¶æ "czysto", ale 
4743 +szczegó³y tego, jaki to problem mog± byæ czasami bardzo myl±ce.
4744 +
4745 +Ta strona podrêcznika odnosi siê do wersji 1.0 programu \fIbzip2\fP.
4746 +Skompresowane pliki utworzone przez tê wersjê s± kompatybilne zarówno z 
4747 +w przód jak i wstecznie z poprzednimi publicznymi wydaniami, 
4748 +wersjami 0.1pl2, 0.9.0 i 0.9.5 ale z ma³ymi wyj±tkami: 0.9.0 i wy¿sze potrafi± 
4749 +poprawnie dekompresowaæ wiele skompresowanych plików z³±czonych w jeden. 
4750 +0.1pl2 nie potrafi tego; zatrzyma siê ju¿ po dekompresji pierwszego pliku w 
4751 +strumieniu.
4752 +
4753 +.I bzip2recover
4754 +u¿ywa 32-bitowych liczb do reprezentacji pozycji bitu w skompresowanym 
4755 +pliku, wiêc nie mo¿e przetwarzaæ skompresowanych plików d³u¿szych ni¿ 512 
4756 +megabajtów. Mo¿na to Â³atwo naprawiæ.
4757 +
4758 +.SH AUTOR
4759 +Julian Seward, jseward@acm.org.
4760 +
4761 +http://www.muraroa.demon.co.uk
4762 +http://sourceware.cygnus.com/bzip2
4763 +
4764 +Idee zawarte w \fIbzip2\fP s± podzielone (przynajmniej) pomiêdzy 
4765 +nastepuj±cy ludzi: Michael Burrows i David Wheeler (transformacja
4766 +sortuj±c± bloki), David Wheeler (znów, koder Huffmana), Peter Fenwick 
4767 +(struktura kodowania modelu w oryginalnym \fIbzip2\fP, i wiele 
4768 +udoskonaleñ), i Alistair Moffar, Radford Neal i Ian Witten (arytmetyczny 
4769 +koder w oryginalnym \fIbzip2\fP). Jestem im bardzo wdziêczny za ich pomoc, 
4770 +wsparcie i porady. Zobacz stronê manuala w Â¼ród³owej dystrybucji po 
4771 +wska¼niki do Â¼róde³ dokumentacji. Christian von Roques zachêci³ mnie do 
4772 +wymy¶lenia szybszego algorytmu sortuj±cego, po to Â¿eby przyspieszyæ 
4773 +kompresjê. Bela Lubkin zachêci³a mnie do polepszenia najgorszych wyników 
4774 +kompresji. Wiele ludzi przys³a³o Â³atki, pomog³o w ró¿nych problemach, 
4775 +po¿yczy³o komputerów, da³o rady i by³o ogólnie pomocnych.
4776 diff -Nru bzip2-1.0.1/doc/pl/bzip2recover.1 bzip2-1.0.1.new/doc/pl/bzip2recover.1
4777 --- bzip2-1.0.1/doc/pl/bzip2recover.1   Thu Jan  1 01:00:00 1970
4778 +++ bzip2-1.0.1.new/doc/pl/bzip2recover.1       Sat Jun 24 20:13:06 2000
4779 @@ -0,0 +1 @@
4780 +.so bzip2.1
4781 \ No newline at end of file
4782 diff -Nru bzip2-1.0.1/huffman.c bzip2-1.0.1.new/huffman.c
4783 --- bzip2-1.0.1/huffman.c       Sat Jun 24 20:13:27 2000
4784 +++ bzip2-1.0.1.new/huffman.c   Sat Jun 24 20:13:06 2000
4785 @@ -58,6 +58,10 @@
4786    For more information on these sources, see the manual.
4787  --*/
4788  
4789 +#ifdef HAVE_CONFIG_H
4790 +#include <config.h>
4791 +#endif
4792 +
4793  
4794  #include "bzlib_private.h"
4795  
4796 diff -Nru bzip2-1.0.1/makefile.msc bzip2-1.0.1.new/makefile.msc
4797 --- bzip2-1.0.1/makefile.msc    Sat Jun 24 20:13:27 2000
4798 +++ bzip2-1.0.1.new/makefile.msc        Thu Jan  1 01:00:00 1970
4799 @@ -1,63 +0,0 @@
4800 -# Makefile for Microsoft Visual C++ 6.0\r
4801 -# usage: nmake -f makefile.msc\r
4802 -# K.M. Syring (syring@gsf.de)\r
4803 -# Fixed up by JRS for bzip2-0.9.5d release.\r
4804 -\r
4805 -CC=cl\r
4806 -CFLAGS= -DWIN32 -MD -Ox -D_FILE_OFFSET_BITS=64\r
4807 -\r
4808 -OBJS= blocksort.obj  \\r
4809 -      huffman.obj    \\r
4810 -      crctable.obj   \\r
4811 -      randtable.obj  \\r
4812 -      compress.obj   \\r
4813 -      decompress.obj \\r
4814 -      bzlib.obj\r
4815 -\r
4816 -all: lib bzip2 test\r
4817 -\r
4818 -bzip2: lib\r
4819 -       $(CC) $(CFLAGS) -o bzip2 bzip2.c libbz2.lib setargv.obj\r
4820 -       $(CC) $(CFLAGS) -o bzip2recover bzip2recover.c\r
4821 -\r
4822 -lib: $(OBJS)\r
4823 -       lib /out:libbz2.lib $(OBJS)\r
4824 -\r
4825 -test: bzip2\r
4826 -       type words1\r
4827 -       .\\bzip2 -1  < sample1.ref > sample1.rb2\r
4828 -       .\\bzip2 -2  < sample2.ref > sample2.rb2\r
4829 -       .\\bzip2 -3  < sample3.ref > sample3.rb2\r
4830 -       .\\bzip2 -d  < sample1.bz2 > sample1.tst\r
4831 -       .\\bzip2 -d  < sample2.bz2 > sample2.tst\r
4832 -       .\\bzip2 -ds < sample3.bz2 > sample3.tst\r
4833 -       @echo All six of the fc's should find no differences.\r
4834 -       @echo If fc finds an error on sample3.bz2, this could be\r
4835 -       @echo because WinZip's 'TAR file smart CR/LF conversion'\r
4836 -       @echo is too clever for its own good.  Disable this option.\r
4837 -       @echo The correct size for sample3.ref is 120,244.  If it\r
4838 -       @echo is 150,251, WinZip has messed it up.\r
4839 -       fc sample1.bz2 sample1.rb2 \r
4840 -       fc sample2.bz2 sample2.rb2\r
4841 -       fc sample3.bz2 sample3.rb2\r
4842 -       fc sample1.tst sample1.ref\r
4843 -       fc sample2.tst sample2.ref\r
4844 -       fc sample3.tst sample3.ref\r
4845 -\r
4846 -\r
4847 -\r
4848 -clean: \r
4849 -       del *.obj\r
4850 -       del libbz2.lib \r
4851 -       del bzip2.exe\r
4852 -       del bzip2recover.exe\r
4853 -       del sample1.rb2 \r
4854 -       del sample2.rb2 \r
4855 -       del sample3.rb2\r
4856 -       del sample1.tst \r
4857 -       del sample2.tst\r
4858 -       del sample3.tst\r
4859 -\r
4860 -.c.obj: \r
4861 -       $(CC) $(CFLAGS) -c $*.c -o $*.obj\r
4862 -\r
4863 diff -Nru bzip2-1.0.1/manual.ps bzip2-1.0.1.new/manual.ps
4864 --- bzip2-1.0.1/manual.ps       Sat Jun 24 20:13:27 2000
4865 +++ bzip2-1.0.1.new/manual.ps   Thu Jan  1 01:00:00 1970
4866 @@ -1,3808 +0,0 @@
4867 -%!PS-Adobe-2.0
4868 -%%Creator: dvips(k) 5.78 Copyright 1998 Radical Eye Software (www.radicaleye.com)
4869 -%%Title: manual.dvi
4870 -%%Pages: 39
4871 -%%PageOrder: Ascend
4872 -%%BoundingBox: 0 0 596 842
4873 -%%EndComments
4874 -%DVIPSCommandLine: dvips -o manual.ps manual.dvi
4875 -%DVIPSParameters: dpi=600, compressed
4876 -%DVIPSSource:  TeX output 2000.03.23:2343
4877 -%%BeginProcSet: texc.pro
4878 -%!
4879 -/TeXDict 300 dict def TeXDict begin /N{def}def /B{bind def}N /S{exch}N
4880 -/X{S N}B /TR{translate}N /isls false N /vsize 11 72 mul N /hsize 8.5 72
4881 -mul N /landplus90{false}def /@rigin{isls{[0 landplus90{1 -1}{-1 1}
4882 -ifelse 0 0 0]concat}if 72 Resolution div 72 VResolution div neg scale
4883 -isls{landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div
4884 -hsize mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul
4885 -TR[matrix currentmatrix{dup dup round sub abs 0.00001 lt{round}if}
4886 -forall round exch round exch]setmatrix}N /@landscape{/isls true N}B
4887 -/@manualfeed{statusdict /manualfeed true put}B /@copies{/#copies X}B
4888 -/FMat[1 0 0 -1 0 0]N /FBB[0 0 0 0]N /nn 0 N /IE 0 N /ctr 0 N /df-tail{
4889 -/nn 8 dict N nn begin /FontType 3 N /FontMatrix fntrx N /FontBBox FBB N
4890 -string /base X array /BitMaps X /BuildChar{CharBuilder}N /Encoding IE N
4891 -end dup{/foo setfont}2 array copy cvx N load 0 nn put /ctr 0 N[}B /df{
4892 -/sf 1 N /fntrx FMat N df-tail}B /dfs{div /sf X /fntrx[sf 0 0 sf neg 0 0]
4893 -N df-tail}B /E{pop nn dup definefont setfont}B /ch-width{ch-data dup
4894 -length 5 sub get}B /ch-height{ch-data dup length 4 sub get}B /ch-xoff{
4895 -128 ch-data dup length 3 sub get sub}B /ch-yoff{ch-data dup length 2 sub
4896 -get 127 sub}B /ch-dx{ch-data dup length 1 sub get}B /ch-image{ch-data
4897 -dup type /stringtype ne{ctr get /ctr ctr 1 add N}if}B /id 0 N /rw 0 N
4898 -/rc 0 N /gp 0 N /cp 0 N /G 0 N /sf 0 N /CharBuilder{save 3 1 roll S dup
4899 -/base get 2 index get S /BitMaps get S get /ch-data X pop /ctr 0 N ch-dx
4900 -0 ch-xoff ch-yoff ch-height sub ch-xoff ch-width add ch-yoff
4901 -setcachedevice ch-width ch-height true[1 0 0 -1 -.1 ch-xoff sub ch-yoff
4902 -.1 sub]/id ch-image N /rw ch-width 7 add 8 idiv string N /rc 0 N /gp 0 N
4903 -/cp 0 N{rc 0 ne{rc 1 sub /rc X rw}{G}ifelse}imagemask restore}B /G{{id
4904 -gp get /gp gp 1 add N dup 18 mod S 18 idiv pl S get exec}loop}B /adv{cp
4905 -add /cp X}B /chg{rw cp id gp 4 index getinterval putinterval dup gp add
4906 -/gp X adv}B /nd{/cp 0 N rw exit}B /lsh{rw cp 2 copy get dup 0 eq{pop 1}{
4907 -dup 255 eq{pop 254}{dup dup add 255 and S 1 and or}ifelse}ifelse put 1
4908 -adv}B /rsh{rw cp 2 copy get dup 0 eq{pop 128}{dup 255 eq{pop 127}{dup 2
4909 -idiv S 128 and or}ifelse}ifelse put 1 adv}B /clr{rw cp 2 index string
4910 -putinterval adv}B /set{rw cp fillstr 0 4 index getinterval putinterval
4911 -adv}B /fillstr 18 string 0 1 17{2 copy 255 put pop}for N /pl[{adv 1 chg}
4912 -{adv 1 chg nd}{1 add chg}{1 add chg nd}{adv lsh}{adv lsh nd}{adv rsh}{
4913 -adv rsh nd}{1 add adv}{/rc X nd}{1 add set}{1 add clr}{adv 2 chg}{adv 2
4914 -chg nd}{pop nd}]dup{bind pop}forall N /D{/cc X dup type /stringtype ne{]
4915 -}if nn /base get cc ctr put nn /BitMaps get S ctr S sf 1 ne{dup dup
4916 -length 1 sub dup 2 index S get sf div put}if put /ctr ctr 1 add N}B /I{
4917 -cc 1 add D}B /bop{userdict /bop-hook known{bop-hook}if /SI save N @rigin
4918 -0 0 moveto /V matrix currentmatrix dup 1 get dup mul exch 0 get dup mul
4919 -add .99 lt{/QV}{/RV}ifelse load def pop pop}N /eop{SI restore userdict
4920 -/eop-hook known{eop-hook}if showpage}N /@start{userdict /start-hook
4921 -known{start-hook}if pop /VResolution X /Resolution X 1000 div /DVImag X
4922 -/IE 256 array N 2 string 0 1 255{IE S dup 360 add 36 4 index cvrs cvn
4923 -put}for pop 65781.76 div /vsize X 65781.76 div /hsize X}N /p{show}N
4924 -/RMat[1 0 0 -1 0 0]N /BDot 260 string N /rulex 0 N /ruley 0 N /v{/ruley
4925 -X /rulex X V}B /V{}B /RV statusdict begin /product where{pop false[
4926 -(Display)(NeXT)(LaserWriter 16/600)]{dup length product length le{dup
4927 -length product exch 0 exch getinterval eq{pop true exit}if}{pop}ifelse}
4928 -forall}{false}ifelse end{{gsave TR -.1 .1 TR 1 1 scale rulex ruley false
4929 -RMat{BDot}imagemask grestore}}{{gsave TR -.1 .1 TR rulex ruley scale 1 1
4930 -false RMat{BDot}imagemask grestore}}ifelse B /QV{gsave newpath transform
4931 -round exch round exch itransform moveto rulex 0 rlineto 0 ruley neg
4932 -rlineto rulex neg 0 rlineto fill grestore}B /a{moveto}B /delta 0 N /tail
4933 -{dup /delta X 0 rmoveto}B /M{S p delta add tail}B /b{S p tail}B /c{-4 M}
4934 -B /d{-3 M}B /e{-2 M}B /f{-1 M}B /g{0 M}B /h{1 M}B /i{2 M}B /j{3 M}B /k{
4935 -4 M}B /w{0 rmoveto}B /l{p -4 w}B /m{p -3 w}B /n{p -2 w}B /o{p -1 w}B /q{
4936 -p 1 w}B /r{p 2 w}B /s{p 3 w}B /t{p 4 w}B /x{0 S rmoveto}B /y{3 2 roll p
4937 -a}B /bos{/SS save N}B /eos{SS restore}B end
4938 -
4939 -%%EndProcSet
4940 -TeXDict begin 39158280 55380996 1000 600 600 (manual.dvi)
4941 -@start
4942 -%DVIPSBitmapFont: Fa cmti10 10.95 1
4943 -/Fa 1 47 df<120FEA3FC0127FA212FFA31380EA7F00123C0A0A77891C>46
4944 -D E
4945 -%EndDVIPSBitmapFont
4946 -%DVIPSBitmapFont: Fb cmbxti10 14.4 1
4947 -/Fb 1 47 df<13FCEA03FF000F13804813C05AA25AA2B5FCA31480A214006C5A6C5A6C5A
4948 -EA0FE0121271912B>46 D E
4949 -%EndDVIPSBitmapFont
4950 -%DVIPSBitmapFont: Fc cmsl10 10.95 25
4951 -/Fc 25 122 df<D901F8160CD907FE161ED91F07163E90263E0380157E017C6D15FC496C
4952 -6CEC03F8D801F06DEC07F00003D900FCEC1FE04901EFEC7FC00007913AE3E007EF804901
4953 -E0B5129F000F913A701FF83F0093C7127E48485E604D5A03F01303003F4A495A90C74A5A
4954 -4D5A4DC7FC0201143E4B5B17FC4C5A003E4948485A4C5A003F01075C6C4A485A020E131F
4955 -021E49C8FC6C6C48137E02385B3A07C0F001F82603E1E05B3A00FF8003E090263E000714
4956 -7E90C73A0FC001FF80923A1F8007C1C0923A3F000F80E0033E90381F00F04B013E137003
4957 -FC4913784A4801FC13384A485B913807E001DA0FC05BDB8003141CEC1F004A495A147E5C
4958 -4948163C4948010F14384A5C495A130F4948167849C71570137E017C17F0494B13E01201
4959 -4848EDC0014848020714C04848EE03804848160790C83903E00F00003E170E007E923801
4960 -F03C486F6C5A48EE3FE00070EE0F803F4975C34C>37 D<EA0780EA0FE0EA1FF0123FA512
4961 -1FEA0F301200A213701360A213E013C0120113801203EA07001206120E5A5A5A5A5A0C1C
4962 -7A8919>44 D<EC07F8EC3FFF9138FC0FC0903903F003E0903907C001F0D90F8013F849C7
4963 -FC013E14FC017E147C017C147E13FC485AA20003157F5B1207A2120F5BA2121F16FF5BA2
4964 -123FA44848EB01FEA648C7EA03FCA5ED07F8A25A16F0A2150F16E0A3ED1FC0A21680007E
4965 -143F1600157E123E003F5C4A5AD81F805B000FEB07E06C6C485A2603F03FC7FC3800FFFC
4966 -EB1FE0283F79BC2D>48 D<157015F014011407143F903803FFE0137FEBFFCFEBF80F1300
4967 -141F15C0A5143F1580A5147F1500A55C5CA513015CA513035CA513075CA5130F5CA3131F
4968 -497EB612F8A31D3D78BC2D>I<133C137F5B481380A31400A26C5A137890C7FCB3EA0780
4969 -EA0FE0121F123FA5121FEA0F601200A213E05BA212015B120390C7FC5A1206120E5A5A12
4970 -3012705A5A11397AA619>59 D<EC7FC0903803FFF890380FC07E90383E003F496D7E01FF
4971 -6D7E82A248140782A26C5A137890C7120FA25EA2EC03FF147F903807FF1FEB1FE0D97F80
4972 -5B3801FE00EA03F8485A4848133F485A003F5D49EC81C048C7FCA2157F48ED03804814FF
4973 -A2007F5B913903BF0700903880073F3A3FC00E1F8E260FE03C13FC3A03FFF00FF83A007F
4974 -C003E02A2A7CA82D>97 D<EB3F80EA1FFFA3C6FC137FA291C9FCA55B5BA512015BA4EC07
4975 -F80003EB3FFF9039F8F80FC09039FBE003E09039FF8001F891C77E5B4848147E49147F5B
4976 -821780A2120F5B17C0A3167F001F16805BA4EEFF00123F5B4B5AA24B5A5E007F4A5AA24B
4977 -5A6D495A4BC7FCD87CE0137E39F87001F839F03C07E039E00FFF80260003FCC8FC2A4077
4978 -BE33>I<EC1FF0ECFFFE903903F01F8090390FC003C0D93F0013E0017E130F49131F0001
4979 -15F04848EB3FE0485AA24848EB1FC0001FEC0F004990C7FC123FA2485AA412FF90C9FCA9
4980 -6CEC0380150716006C6C5B151E001F5C6C6C5B6C6C5B6C6C485A3901F80F8026007FFEC7
4981 -FCEB0FF0242A7AA828>I<EE03F8ED01FFA3ED000F1607A217F0A4160FA217E0A4161FA2
4982 -17C0A491380FF03FECFFFC902603F81F138090390FC007BF90391F8003FF90387E000149
4983 -7F0001157F48481500485A120F5B001F5D485A5E5B127FA2150112FF90C75BA41503A25E
4984 -A37E1507A26C4A5A7F001F141F6C6C133F6C6CEBFFF83B03F001EFFFC03900F80F8F9038
4985 -3FFE0FD90FF0EBE0002D407ABE33>I<EC3FE0903801FFF8903807E07E90380F801F9039
4986 -3F000F80017E14C049EB07E0485A12034848EB03F0485AA2121F5B123FA248481307A290
4987 -B6FCA2D8FF80C8FC90C9FCA87EED01C015036C15806D1307001FEC0F006D131E000F5C6C
4988 -6C5B6C6C485A3900FC07C0D93FFFC7FCEB07F8242A7BA828>I<ED07F0ED3FFCEDFC1E91
4989 -3803F03F4A48B4FC4A481380141FEC3F81DA7F0113008102FE137C93C7FCA213015CA513
4990 -035CA50007B512F8A3260007F0C8FCA3130F5CA5131F5CA5133F5CA5137F91C9FCA55B5B
4991 -A4EA03FF007F13FEB5FCA229407DBF1C>I<147FEB3FFFA313017FA25CA513015CA51303
4992 -5CA4ED07F80107EB1FFF9139F0781FC09138F1E00F9139F38007E0ECF70002FE14F0495A
4993 -5CA25CA24A130F131F4A14E0A4161F133F4A14C0A4163F137F91C71380A4167F5B491500
4994 -A300015D486C491380B5D8F87F13FCA32E3F7DBE33>104 D<1478EB01FE130314FFA25B
4995 -14FE130314FCEB00F01400ACEB03F8EA01FF14F0A2EA001F130FA314E0A5131F14C0A513
4996 -3F1480A5137F1400A55B5BA4EA03FF007F13F0A2B5FC183E7DBD1A>I<143FEB1FFF5BA2
4997 -13017FA214FEA5130114FCA5130314F8A5130714F0A5130F14E0A5131F14C0A5133F1480
4998 -A5137F1400A55B5BA4EA03FF007F13F8A2B5FC183F7DBE1A>108
4999 -D<902707F007F8EB03FCD803FFD91FFF90380FFF80913CE0781FC03C0FE09126E1E00FEB
5000 -F0073E001FE38007E1C003F090260FE700EBE38002EEDAF70013F802FC14FE02D85C14F8
5001 -4A5CA24A5C011F020F14074A4A14F0A5013F021F140F4A4A14E0A5017F023F141F91C749
5002 -14C0A549027F143F4992C71380A300014B147F486C496DEBFFC0B5D8F87FD9FC3F13FEA3
5003 -47287DA74C>I<903907F007F8D803FFEB1FFF9139E0781FC09138E1E00F3B001FE38007
5004 -E090380FE70002EE14F014FC14D814F85CA24A130F131F4A14E0A4161F133F4A14C0A416
5005 -3F137F91C71380A4167F5B491500A300015D486C491380B5D8F87F13FCA32E287DA733>
5006 -I<EC0FF0ECFFFE903903F01F8090390FC007C049C66C7E013E6D7E01FC6D7E4848804914
5007 -7C0003157E485A000F157F5B121FA2485AA2007F1680A2170048C85AA54B5AA25E5A6C4A
5008 -5A7E4B5A5E6C140F6C6C5C4B5A6C6C013EC7FC6C6C5B6C6C485A3900FC0FE090383FFF80
5009 -D90FF8C8FC292A7BA82D>I<91387F01FE903A7FFF0FFFC09139FE3E03F09238F801F890
5010 -3A01FFE000FE4B137F6D497F4990C713804A15C04A141FA218E0A20103150F5C18F0A317
5011 -1F010716E05CA3173F18C0130F4A147F1880A2EFFF004C5A011F5D16034C5A6E495AEE1F
5012 -C06E495AD93FDC017EC7FC91388F01F8913883FFE0028090C8FC92C9FC137FA291CAFCA4
5013 -5BA25BA31201487EB512F8A3343A81A733>I<903907F01F80D803FFEB7FE09138E1E1F0
5014 -9138E387F839001FE707EB0FE614EE02FC13F002D813E09138F801804AC7FCA25C131FA2
5015 -5CA4133F5CA5137F91C8FCA55B5BA31201487EB512FEA325287EA724>114
5016 -D<9138FF81C0010713E390381F807F90397C003F8049131F4848130F5B00031407A24848
5017 -1400A27FA27F6D90C7FCEBFF8014FC6C13FF6C14C015F06C6C7F011F7F13079038007FFE
5018 -1403140100381300157EA2123C153E157E007C147CA2007E147815F8007F495A4A5A486C
5019 -485A26F9E01FC7FC38E0FFFC38C01FE0222A7DA824>I<EB0380A4130791C7FCA25BA25B
5020 -A2133EA2137E13FE12011207001FB512C0B6FCA2D801FCC7FCA312035BA512075BA5120F
5021 -5BA41407001F130E13C0A4141E141C1380A26D5AA2000F5B14F03807E1E03801FF80D800
5022 -7EC7FC1A3978B723>I<01FE147F00FFEC7FFF4914FEA20007140300031401A34914FCA4
5023 -150312074914F8A41507120F4914F0A4150F121F4914E0A2151FA3153F4914C0157F15FF
5024 -EC01DF3A0FC003BFE09138073FFF3803F01E3801FFF826003FE01380282977A733>I<B5
5025 -39E007FFF05D17E02707FE000313006C48EB01FC6F5A5E00014A5A5EA24B5A6D13070000
5026 -92C7FC5D150E6D5B7F5DA25D1480013F5B14815D14C3011F5B02C7C8FCA214CE14EEEB0F
5027 -FCA25CA26D5A5CA25CA26D5A2C2878A630>I<B500C3B53803FFFCA204FE14F8290FFE00
5028 -3FE00013C0D807F86D48EB7F000003173E183C150F18386D5E0001141F705B153F4D5A15
5029 -776D4B5A0000ECE7F04DC7FCEC01C3170E9038FF0383017F5D91380703F85FEC0E01021E
5030 -5CD93F9C14F002BC6D5A02B813FDDAF8005B4A13FF5F6D5A94C8FC5C4A137E167C6DC7FC
5031 -1678010E14383E2878A642>I<90B539E007FFF05E18E0902707FE000313006D48EB01FC
5032 -705A5F01014A5A5F16036E5C0100140794C7FC160E805E805E1678ED8070023F13F05EED
5033 -81C015C191381FC38015C793C8FC15EF15EEEC0FFCA25DA26E5AA25DA26E5A5DA24AC9FC
5034 -5C140E141E141C5C121C003F5B5A485B495A130300FE5B4848CAFCEA701EEA783CEA3FF0
5035 -EA0FC0343A80A630>121 D E
5036 -%EndDVIPSBitmapFont
5037 -%DVIPSBitmapFont: Fd cmtt12 14.4 10
5038 -/Fd 10 123 df<EC3FF80103B57E010F14E0013F14F84914FE48B7FC4816C048D9C01F7F
5039 -270FFE00017F49EB007FD81FF0EC1FF848486E7E160748486E7E4914018300FF81A26D16
5040 -80177FA36C5AA26CC9FCCAFCA217FF1800A25E5F16035F16075F160F4C5A163F4C5A5F4C
5041 -5A4B90C7FCED07FE4B5A4B5A4B5A4B5A4B5A4A5B4A90C8FCEC0FFE4A5AEC3FF04A5A4A5A
5042 -495B4990C9FCEB0FFC495A495A495A4948143F485B4890C8EA7F80EA0FFC485A48B8FC5A
5043 -B9FCA36C17007E314A7AC93E>50 D<383FFF805AB57EA37E7EEA003FAEED07FC92383FFF
5044 -8092B512E002C314F802CF8002DF8091B7FCDBF80F1380DBC00113C092C713E04A143F4A
5045 -EC1FF04A15F84A140F4AEC07FCA217034A15FE1701A318FF83A95F18FEA280170318FC6E
5046 -140718F86E140FEF1FF06E143F6EEC7FE06EECFFC0DBC0031380EDF01F92B6120002DF14
5047 -FC02CF5C02C35CD91F8114C090260F807F90C7FC90C7EA0FF8384A7FC83E>98
5048 -D<923803FFF85D4B7FA38181ED0003AEEC1FF0ECFFFE0103EBFF83010F14E34914F3017F
5049 -14FB90B7FC48EBF80F48EBC00191C7FC4848143F4848141F5B4848140F491407123F4914
5050 -03127F5BA312FF90C8FCA97F127FA216077F123F6D140FA26C6C141F6D143F000F157F6C
5051 -6C14FF01FF5B6C6D5A6CD9F01FEBFFFC6C90B500FB13FE6D02F313FF6D14E3010F14C36D
5052 -020113FE010101FC14FC9026003FE0C8FC384A7CC83E>100 D<143E147F4A7E497FA56D
5053 -5B6EC8FC143E91C9FCAC003FB57E5A81A47EC7123FB3B3007FB71280B812C0A56C16802A
5054 -4A76C93E>105 D<007FB512C0B6FC81A47EC7121FB3B3B3A5007FB712F8B812FCA56C16
5055 -F82E4978C83E>108 D<EC1FF0ECFFFE01036D7E010F14E04980017F14FC90B67E489038
5056 -F01FFFECC00748D90001138048486D13C04848EC7FE049143F4848EC1FF049140F003F16
5057 -F8491407A24848EC03FCA448C8EA01FEAA6D1403007F16FCA26D1407A2003F16F86D140F
5058 -6C6CEC1FF0A26C6CEC3FE06D147F6C6CECFFC06D5B6CD9C00713806CD9F01F13006C90B5
5059 -5A6D5C6D5C010F14E001031480010049C7FCEC1FF02F3679B43E>111
5060 -D<ED07FC3B3FFF803FFF804891B512E0B500C314F802CF8002DF806C90B7FC6CDAF80F13
5061 -80D8003FD9C00113C092C713E04A143F4AEC1FF04A15F84A140F4AEC07FCA217034A15FE
5062 -1701A318FF83A95F18FEA280170318FC6E140718F86E140FEF1FF06E143F6EEC7FE06EEC
5063 -FFC0DBC0031380EDF01F92B6120002DF14FC02CF5C02C35C02C114C0DAC07F90C7FCED0F
5064 -F892C9FCB3003FB512C04880B67EA36C5C6C5C384F7FB33E>I<903901FFF00F011F9038
5065 -FE1F8090B612BF000315FF5A5A5A393FFE003F01F01307D87FC0130190C8FC5A48157FA4
5066 -7EEE3F00D87FC091C7FC13F0EA3FFE381FFFF06CEBFFC06C14FE6C6E7EC615E0013F14F8
5067 -010780D9003F7F02007F03071380030013C0003EED3FE0007F151F48150F17F06D1407A3
5068 -7FA26D140F6D15E0161F01FCEC3FC06D14FF9026FFC00F138091B612005E485D013F5C6D
5069 -14E0D8FC0714802778007FF8C7FC2C3677B43E>115 D<147C14FC497EAD003FB712FC5A
5070 -B87EA36C5EA2260001FEC9FCB3A6173FA2EF7F80A76E14FF6D16006F5A9238C007FE9138
5071 -7FF01F92B55A6E5C6E5C6E5C6E1480020149C7FC9138003FF031437DC13E>I<000FB812
5072 -804817C04817E0A418C001C0C712014C13804C1300EE1FFE4C5AEE7FF06C484A5A4B5BC8
5073 -485B4B90C7FC4B5A4B5A4B5A4B5A4B5A4A5B4A5B4A90C8FC4A5A4A5A4A5A4A5A4A5A495B
5074 -495B4990C9FC495A495A4948EC0FC0495A4948EC1FE0485B00075B4890C8FCEA1FFC485A
5075 -485A90B8FCB9FCA46C17C07E33337CB23E>122 D E
5076 -%EndDVIPSBitmapFont
5077 -%DVIPSBitmapFont: Fe cmtt12 13.14 31
5078 -/Fe 31 123 df<ECFFE0010713FC011FEBFF80017F14E048B67E48814815FE489038007F
5079 -FF01F8130748480101138048489038007FC049EC3FE04848141F90C8120F17F048150717
5080 -F87F1603A36CC8FC123EC9FCA2160717F0A2160F17E0161F17C0163FEE7F80A2EEFF004B
5081 -5A15034B5A4B5A4B5AED7FE04B5A4A5B4A90C7FC4A5AEC1FF84A5A4A5A4A5A495BD907FE
5082 -C8FC495A495A495A495A2601FF80EB01F04890C7EA03F8485A485A485A48B7FC5AB8FCA3
5083 -7E6C16F02D447BC338>50 D<003FB6FC4815E0B712F882826C816C16802701FC000113C0
5084 -9238007FE0161FEE0FF0A2160717F81603A6160717F0A2160FEE1FE0163FEE7FC0923801
5085 -FF80030F130090B65A5E16F08216FEEEFF8017C001FCC7EA7FE0EE1FF0EE07F8160317FC
5086 -EE01FE1600A217FF177FA717FF17FE16011603EE07FC160FEE3FF8EEFFF0003FB7FC4816
5087 -E0B812C01780EEFE006C15F86C15C030437DC238>66 D<DA07FC133C91393FFF807E91B5
5088 -12E00103ECF8FE4914FC4914FF5B90383FFE0390387FF000D9FFC0133F4849131F91C712
5089 -0F48481407485A49140348481401A2485AA248481400A25BA2007F167C90CAFCA35A5AAD
5090 -7E7EA37F003F167C17FE7FA26C7EA26C6C140117FC6C7E6D14036C6C15F86C6C14076EEB
5091 -0FF06C6D131FD97FF0EB7FE0903A3FFE03FFC06DB612806D15006D5C6D5C010014F0023F
5092 -13C0DA07FCC7FC2F457CC338>I<007FB512F8B7FC16C08216F8826C813A03F8001FFF15
5093 -07030113806F13C0167FEE3FE0161FEE0FF0A2EE07F8A2EE03FCA21601A217FE1600A417
5094 -7FAD17FF17FEA4160117FCA2160317F81607A2EE0FF0161FEE3FE0167FEEFFC04B13805D
5095 -031F1300007FB65AB75A5E5E16C093C7FC6C14F830437DC238>I<007FB712FCB87EA57E
5096 -D801FCC8FCA9177C94C7FCA6ED07C04B7EA590B6FCA79038FC000FA56F5A92C9FCA7EF0F
5097 -80EF1FC0AA007FB8FCB9FCA56C178032437DC238>I<91391FF003C091397FFC07E049B5
5098 -FC010714CF4914EF4914FF5B90387FF81F9038FFE00748EB800191C7FC4848147F485A49
5099 -143F485A161F485AA249140F123F5BA2127F90C8EA07C093C7FCA35A5AAA923807FFFC4B
5100 -13FE4B13FF7E7E6F13FE6F13FC9238000FE07F003F151FA27F121F7F163F6C7EA26C6C14
5101 -7F7F6C6C14FF6C6C5B6E5A6C6D5A90387FF81F6DB6FC6D14EF6D14CF6D148F0101140F90
5102 -3A007FFC07C0DA1FF0C7FC30457CC338>71 D<007FB612F0B712F8A56C15F0260001FCC7
5103 -FCB3B3B1007FB612F0B712F8A56C15F0254377C238>73 D<90380FFFFE90B612E0000315
5104 -F8488148814881A2273FFE000F138001F01301497F49147F4848EC3FC0A290C8121FA448
5105 -16E0A248150FB3AC6C151FA36C16C0A36D143FA36C6CEC7F806D14FF6D5B01FE130F6CB7
5106 -1200A26C5D6C5D6C5DC615E0010F49C7FC2B457AC338>79 D<003FB512F04814FEB77E16
5107 -E0826C816C813A01FC003FFEED07FF03017F81707E163F161F83160FA7161F5F163F167F
5108 -4C5A5D030790C7FCED3FFE90B65A5E5E5EA282829038FC001FED07FC6F7E150115008282
5109 -AA18E0EF01F0EF03F8A31783EE3F87263FFFE0ECC7F0486D14FFB56C7F18E07013C06C49
5110 -6D13806C496D1300CA12FC35447EC238>82 D<003FB8FC481780B9FCA53BFE0007F0003F
5111 -A9007CEE1F00C792C7FCB3B3A70107B512F04980A56D5C31437DC238>84
5112 -D<267FFFF090387FFFF0B56C90B512F8A56C496D13F0D801FCC73801FC00B3B3A66D1403
5113 -00005EA36D14076D5D6E130F6D6C495A6E133F6D6C495A6D6C495AECFF076D90B5C7FC6D
5114 -5C6D5C6D5C023F13E0020F1380DA03FEC8FC35447FC238>I<D83FFE913803FFE0486C4A
5115 -13F0B56C4913F8A36C90C76C13F06C486E13E0D80FC09138001F80A36C6CED3F00A86C6C
5116 -157EA86C6C5DEC01FC4A7EA24A7EA4D800FC9038DF01F8020F1381A3158F021F13C1A201
5117 -7C5DA2017E14C31507023F13E3A490263E3E035BA2027E13F3A2EC7C01013F14F7A3011F
5118 -5DEC7800A202F813FFA34A137F010F5DA24A133F6D486DC7FC35447FC238>87
5119 -D<001FB712F04816F85AA417F090C8121F17E0EE3FC0167F1780EEFF00A24B5A4B5A123E
5120 -C8485A4B5AA24B5A4B5AA24B5A4BC7FCA24A5A14035D4A5A140F5D4A5A143F5D4A5A14FF
5121 -92C8FC495A13035C495AA2495A495AA2495A495A17F849C7EA01FC485AA2485A485AA248
5122 -5A121F5B485A127F90B7FCB8FCA56C16F82E437BC238>90 D<003FB712804816C0B812E0
5123 -A46C16C06C16802B087A7D38>95 D<EB1FFF90B512E0000314F84814FE4880824881D9F0
5124 -017F9138003FF0ED0FF815076C486D7E6C481301C87FA21500A4EC03FF147F0107B5FC13
5125 -1F90B6FC5A000714C048EBE0004890C7FCEA3FF813E0EA7F8090C8FC5A5AA415017E6C6C
5126 -13036D13076C6CEB3FFFD9FC01B6FC6CB812807E6C816C4A7E6CECF80F6C6CD9C0031300
5127 -D90FFCC9FC31327AB038>97 D<EA3FFE487EB5FCA37E7EC67EACED3FC0913801FFF80207
5128 -13FE021F7F4A804A8091B67E03C07F9139FE001FF802F86D7E4A13034A6D7E5C707E4A80
5129 -188091C8123FA318C0171FA9173F6E1580A2177FA26EECFF00A26E495A6E13034C5A6E49
5130 -5A02FE133F6E6CB45A92B55A6E5C6E5C6E91C7FC6D6C13FCD91E0313F090C7EA7F803244
5131 -7FC238>I<EC3FFF49B512E0010714F8011F8049805B90B7FC48EBE001481300485AEA0F
5132 -F8496D5A4848147C93C7FC485A5B127F90CAFCA35A5AA97E7EA27F123F6D141F6DEC3F80
5133 -121F6C7E01FC147F6C6CECFF006C6C6C5A6C9038F00FFE91B55A6C6C5C6D5C6D5C010714
5134 -80010149C7FC9038003FF0293278B038>I<ED1FFF4B7F5DA38181ED003FACEC7F809038
5135 -03FFF0010F13FC013F13FF4914BF90B7FC5A48EBC07F48EB000FD80FFC7F497F48487F49
5136 -7F485A167F485A163F90C8FCA25A5AA97E6C157FA36D14FF123F6D5B6C7E5D6C6C5B01FC
5137 -5B6C6C133F2603FFC0B6FC6C90B712806C03BF13C06D143F6D13FC6D01F814800107D9E0
5138 -1F1300010090C9FC32447CC238>I<EC3FE0903801FFFC010713FF011F14C04980498090
5139 -B67E489038E03FFC4890380007FE48481301D80FF86D7E49804848158049143F003F16C0
5140 -49141F127F90C8FC17E0160F5A90B7FCA617C048CAFC7E7EA27FA26C7EEE07C06C6CEC0F
5141 -E07F6C7ED807FE141F6DEC3FC06C01C013FF6CD9FC0713806C90B612006D5C6D5C010F5C
5142 -010314E001001480DA1FFCC7FC2B327AB038>I<ED1FF8ED7FFE4AB5FC020714804A14C0
5143 -5C5C91387FF07F15809139FF003F804AEB1F00010191C7FC5CA9003FB612FE4881B8FCA4
5144 -6C5D260001FCC8FCB3AF003FB612E04881A56C5D2A447CC338>I<14F0497E497E497EA4
5145 -6D5A6D5A6D5A91C8FCAB383FFFFC487FB5FCA37E7EC7FCB3AF007FB612F0B712F816FCA3
5146 -16F86C15F0264476C338>105 D<387FFFFEB6FCA57EC77EB3B3B1007FB7FCB81280A56C
5147 -1600294379C238>108 D<023FEB07E03B3FE0FFC01FF8D87FF39038E07FFCD8FFF76D48
5148 -7E90B500F97F15FB6C91B612806C01C1EBF83F00030100EBE01F4902C013C0A24990387F
5149 -800FA2491400A349137EB3A73C3FFF03FFE07FFC4801879038F0FFFEB500C76D13FFA36C
5150 -01874913FE6C01039038E07FFC383080AF38>I<ED7FC03A3FFE01FFF8267FFF0713FEB5
5151 -001F7F4A805C6C90B67E6CECC07F3B007FFE001FE002F8130F4A805C16075C5CA391C7FC
5152 -B3A6273FFFFE03B512E0486D4814F0B6008F14F8A36C020714F06C496C14E035307FAF38
5153 ->I<EC7FC0903803FFF8010F13FE497F017F14C090B67E4881489038C07FF8489038001F
5154 -FC01FC130748486D7E49130148486D7E4980003F168049143F007F16C090C8121FA300FE
5155 -ED0FE0A96C151FA26C16C0A26D143FA26C6CEC7F80A26C6CECFF006D5B6C6C495A6D1307
5156 -6CB4EB1FFC6C9038C07FF86C90B55A6C5D6D5C6D5C010F49C7FC010313F89038007FC02B
5157 -327AB038>I<ED3FC03A3FFE01FFF8267FFF0713FEB5001F7F4A804A806C90B67E6C02C0
5158 -7F3B007FFE001FF802F86D7E4A13034A6D7E5C707E4A80188091C8123FA318C0171FA917
5159 -3F6E1580A2177FA26EECFF00A26E495A6E13034C5A6E495A02FE133F6E6CB45A92B55A6E
5160 -5C6E5C6E91C7FC6E13FC020313F09138007F8092C9FCB0383FFFFE487FB67EA36C91C9FC
5161 -6C5B32487FAF38>I<EEFFC0277FFFC00713F8B5D8E01F13FC037F13FE92B5FC02E114FF
5162 -14E36C01E713813A000FEFFC019139FFF000FE4B137C0380130092C8FCA25C5CA25CA25C
5163 -A45CB2007FB67EB77E82A35E6C5D30307CAF38>114 D<903907FF80F0017FEBF1F848B5
5164 -12FD000714FF5A5A5AEBFC00D87FE0131F0180130F48C71207481403A5007FEC01F001C0
5165 -90C7FCEA3FF013FE381FFFF86CEBFFC0000314F8C614FF013F1480010714E0D9003F13F0
5166 -020013F8ED0FFC1503003CEC01FE007E140000FE15FF167F7EA37F6D14FF16FE01F01303
5167 -6DEB07FC01FF137F91B512F816F016E04815C0D8FC3F1400010F13FCD8780113E0283278
5168 -B038>I<EB01E0497E1307AB003FB712804816C0B8FCA46C1680260007F0C8FCB3A4EE03
5169 -E0EE07F0A66E130F17E06D6C131F6EEB3FC0903901FF81FF92B512806D15006E5B6E5B6E
5170 -13F002075B020190C7FC2C3D7DBB38>I<D83FFE903803FFE0486C497FB55BA36C806C80
5171 -C66CEB0007B3A9160FA2161F163F6E137F6D6C13FFDAF007EBFFE091B712F06D16F87F6D
5172 -14E76D02C713F00100020313E0DA3FF8C8FC35307FAE38>I<000FB712FC4816FE5AA417
5173 -FC0180C7EA1FF8EE3FF0EE7FE0EEFFC04B13804B13006CC7485AC8485A4B5A4B5A4B5A4B
5174 -5A4A5B4A90C7FCEC07FC4A5A4A5A4A5A4A5A49485A4990C8FC495A495A495A495A494814
5175 -7C494814FE485B4890C8FC485A485A485A485A48B7FCB8FCA56C16FC2F2F7DAE38>122
5176 -D E
5177 -%EndDVIPSBitmapFont
5178 -%DVIPSBitmapFont: Ff cmbx12 13.14 53
5179 -/Ff 53 122 df<923807FFE092B512FC020714FF021F81027F9038007FC0902601FFF0EB
5180 -0FE04901C0497E4990C7487ED90FFC147F011F824A14FF495AA2137F5CA2715A715A715A
5181 -EF078094C8FCA7EF07FCB9FCA526007FF0C7123F171FB3B3A2003FB5D8E00FB512F8A53D
5182 -4D7ECC44>12 D<B7FCAA200A7F9D29>45 D<EA07E0EA1FF8EA3FFCEA7FFEA2B5FCA6EA7F
5183 -FEA2EA3FFCEA1FF8EA07E01010778F22>I<177817F8EE01FCA21603A2EE07F8A217F016
5184 -0FA217E0161FA2EE3FC0A21780167FA217005EA24B5AA25E1503A24B5AA25E150FA25E15
5185 -1FA24B5AA25E157FA24BC7FCA25D1401A25D1403A24A5AA25D140FA24A5AA25D143FA25D
5186 -147FA24AC8FCA25C1301A25C1303A2495AA25C130FA2495AA25C133FA25C137FA249C9FC
5187 -A25B1201A2485AA25B1207A25B120FA2485AA25B123FA25B127FA248CAFCA25AA2127CA2
5188 -2E6D79D13D>I<15F014011407141F147FEB03FF137FB6FCA313FC1380C7FCB3B3B2007F
5189 -B712E0A52B4777C63D>49 D<ECFFF80107EBFF80013F14F090B612FC4881480101EBFF80
5190 -2707F8003F13C0D80FE0010F13E0D81F806D13F0003F80D87FF06D13F86D15FC6D7F00FF
5191 -16FE6D147FA217FF82A36C5A6C5A6C5A6C5AC95A17FEA3EEFFFCA24B13F817F05D17E04B
5192 -13C017804B13004B5A4B5A5EED7FE04B5A4A5B4A90C7FCEC07FC4A5A4A5A4B131FEC3F80
5193 -4AC7FC14FE4948143E495AEB07E0495A4948147E49C8FC017E15FE90B7FC4816FC5A5A5A
5194 -5A5A5AB8FC17F8A430477AC63D>I<EC3FFE0103B512E0010F14FC013F14FF90267FE01F
5195 -7F9026FF000713E0D801FC6D7FD803F07F486C6D7FD80FFE817F486D80167FA3805C16FF
5196 -7E91C75B6C5A6C5AD80020495B90C75C5D5F4B5B5F031F90C7FCED3FFC4AB45A49B512E0
5197 -168016E016FC90C7EA3FFF030713C06F7F6F7F6F7F83707E83A2701380A318C0EA07E0EA
5198 -1FF8487E487EA2B5FCA31880A25E491600127F494A5A6C485D01E05B001F4A5BD80FFC49
5199 -5B2707FFC03F13C06C90B65AC64BC7FC013F14F8010714E09026007FFEC8FC32487BC63D
5200 ->I<EE07E0160FA2161F163F167F16FFA25D5D5DA25D5D5DA2157D15FDEC01F915F1EC03
5201 -E11407EC0FC1EC1F811501143F147E14FC14F8EB01F01303EB07E014C0EB0F80131FEB3F
5202 -00133E5B13FC485A485A5B1207485A485A90C7FC123E127E5AB912FCA5C80003EBE000AD
5203 -023FB612FCA536487DC73D>I<D8038015E001E0140301FC143F9039FFE003FF91B612C0
5204 -17801700A25E5E16F05E5E93C7FC15FC15F001E790C8FC01E0C9FCAAEC1FFC01E1B512C0
5205 -01E714F001EF14FC9039FFE01FFFDA0007138001FC6D13C001F06D13E04915F0497F17F8
5206 -C913FC167F17FEA417FFA3EA0FC0EA3FF0487EA2487EA317FEA34914FF6C4815FC5B0180
5207 -15F86CC74813F07F6C6C4913E0D80FF04913C0D807FC011F13806CB46CB512006C90B512
5208 -FC6C5D013F14C0010F91C7FC010113F030487AC63D>I<ED7FF8913807FFFE021F6D7E02
5209 -7F80903A01FFF01FE0010790388003F04948486C7E49486D7ED93FF013074948130F01FF
5210 -4A7E4849133F5C5A4890C7FCA25A705A48486E5A705A003F92C8FCA3485AA21520913807
5211 -FFE0021F13FC00FF497F4A6D7EDAFC017F9026FDF0007F4A6D7ED9FFC06D7E4A6D7E8391
5212 -C7FC8382491680A318C05BA3127FA6123FA27F001F1780A3000F4B1300A26C6C5DA26C6D
5213 -495A6C6D5C6C6D495A6D6C48485A90263FFC075B6DB65A6D4AC7FC01035C010014F0020F
5214 -90C8FC32487BC63D>I<121F7F7F13FE90B812E0A45A18C0188018005F5FA25F485E90C8
5215 -EA07E0007E4B5A5F007C151F4CC7FC167E5E485D15014B5A4B5AC8485A4B5AA24BC8FC15
5216 -7EA25D1401A24A5A1407A24A5AA2141FA24A5AA2147FA314FFA3495BA45BA55BAA6D5BA2
5217 -6D90C9FCEB007C334B79C93D>I<EC1FFF49B512F0010714FC011F14FF90263FF00713C0
5218 -49C77F01FCEC3FF04848EC0FF848481407000782491403000F821601A2121F7FA27F13FE
5219 -6D140302C05C14F002FC495A6C6D130FDAFF805B9238E01FE06C6E485A9238FCFF806C91
5220 -B5C7FC6C15FC6C5D7F6D14FE6D806D15C06D81011F81017F81D9FFDF804813072603FE01
5221 -8048486C804848133F4848010F1480003F8049130148486D6C13C0161F824848140382A2
5222 -82A2177FA218807F127FEFFF007F6C6C4A5AA2D81FFC4A5A6C6CEC0FF86C6C6CEB3FF06C
5223 -9039F003FFE06C90B612806C6C92C7FC011F14FC010714E09026003FFEC8FC32487BC63D
5224 ->I<EC1FFE49B512C0010F14F04914FC90397FFC0FFE903AFFE003FF804849C67F48496D
5225 -7E4890C7FC486F7E484881161F003F825B007F82A28300FF81A31880A518C0A45E127FA3
5226 -003F5D7F121F5E120F6C6C91B5FC6C90388001EF6CEBC0036C9038E00FCF6DB5128F011F
5227 -140F010701FE1480010113F8903800010091C7FCA24C1300A3D803F85D487E487E486C4A
5228 -5AA25F4C5AA24C5A49495B6C485D49010790C7FC01E0495AD807F8EB3FFC6CB448B45A6C
5229 -90B55A6C15C06D91C8FC011F13FC010313C032487BC63D>I<EE01F8A24C7EA34C7EA24C
5230 -7EA34C7FA24C7FA34C7FA293B57EA34B8016F303038016E316E103078016C0030F805E83
5231 -031F814C7E4B81153E83037E81037C7F03FC815D830201824B7F0203825D830207824B7F
5232 -020F825D84021F8392B8FC4A83A34A83027CC8120F02FC835C840101844A810103845C84
5233 -0107844A81010F845C85011F85496C82B600C091B712F0A5544D7CCC5D>65
5234 -D<93261FFF80EB01C00307B500F81303033F02FE13074AB7EAC00F0207EEE03F021F903A
5235 -FE007FF87F027F01E0903807FCFF91B5C70001B5FC010301FC6E7E4901F0151F4901C081
5236 -4949814990C97E494882494882485B48197F4A173F5A4A171F5A5C48190FA2485B1A07A2
5237 -5AA297C7FC91CDFCA2B5FCAD7EA280A2F207C07EA36C7FA26C190F6E18807E6E171F6C1A
5238 -006E5F6C193E6C6D177E6D6C5F6D6C4C5A6D6D15036D6D4B5A6D01F04B5A6D01FCED3FC0
5239 -010001FFEDFF806E01E0D903FEC7FC021F01FEEB3FFC020790B612F002015EDA003F92C8
5240 -FC030714FCDB001F13804A4D79CB59>67 D<B912F0F0FF8019F019FC19FFD8001F902680
5241 -000114C0DD001F7F060713F806017F726C7E737E737F737F737F8587737F8587A2747EA3
5242 -8786A21C80A51CC0A586A462A51C80A51C00A26263A2631AFF636163614F5B634F5B073F
5243 -90C7FC4F5A4F5A06035B061F5B4DB512C0BBC8FC19FC19F0198006F0C9FC524B7CCA5E>
5244 -I<BB12C0A486D8000F01E0C77E18071801F0007F193F191F190F1907861903A31901A3EF
5245 -0F80A2737EA497C7FC171FA2173F177F17FF160392B6FCA5EDE0031600177F173F171FA2
5246 -050FEC0F80A3F21F00A494C8FC621A3EA21A7EA31AFE6219011903A21907190FF13FF819
5247 -FF1803183FBBFCA262A3494A7CC951>I<BBFCA41A80D8001F01C0C7FC181F1803848419
5248 -7F193F191F1AC0190FA31907A4171FF103E0A496C7FCA25FA25F5F5E160792B6FCA5EDC0
5249 -071601828383A283A794C9FCB1B8FCA5434A7CC94D>I<93261FFF80EB01C00307B500F8
5250 -1303033F02FE13074AB7EAC00F0207EEE03F021F903AFE007FF87F027F01E0903807FCFF
5251 -91B5C70001B5FC010301FC6E7E4901F0151F4901C0814949814990C97E49488249488248
5252 -5B48197F4A173F5A4A171F5A5C48190FA2485B1A07A25AA297C8FC91CEFCA2B5FCAD6C04
5253 -0FB712C0A280A36C93C7001FEBC000A2807EA27E807E807E806C7F7E6D7E6D7E6D7F6D01
5254 -E05D6D6D5D6D13FC010001FF4AB5FC6E01E0EB07F9021F01FFEB3FF0020791B5EAE07F02
5255 -01EEC01FDA003FED0007030702F81301DB001F018090C8FC524D79CB61>I<B7D8FC01B7
5256 -12F8A5D8001F01C0C8001FEBC000B3AA92B9FCA503C0C8121FB3AEB7D8FC01B712F8A555
5257 -4B7BCA60>I<B712FEA5D8000FEBE000B3B3B3ABB712FEA5274B7DCA2E>I<B8FCA5D8001F
5258 -01C0C9FCB3B3A4193EA4197E197CA519FCA31801A2F003F8A21807180F181F183F187FEF
5259 -01FF1707173FBA12F0A53F4B7BCA4A>76 D<B600E04DB612806F5FA26F5FA2D8001F09FC
5260 -C7FC6FEF0F7FA2DABFFE171EA2DA9FFF173CA3028F6D1678A202876D16F0A202836DED01
5261 -E0A302816DED03C0A202806DED0780A26F6CED0F00A36F6C151EA26F6C5DA26F6D5CA26F
5262 -6D5CA36F6D495AA26F6D495AA26F6D495AA3706C49C7FCA2706C131EA2706C5BA3706D5A
5263 -A2706D5AA270EBE1E0A370EBF3C0A270EBFF80A27190C8FCA2715AA3715AA2715A497EB6
5264 -00F06D480103B71280A3715A715A694B7BCA74>I<B600E092B612F88181A281D8001F6D
5265 -9239001FE0006F705A82A28202BF7F029F7FA2028F7F02877F02837F8214810280806F7F
5266 -6F7F83816F7F6F7F6F7F83816F80707F707F8482707F707F707FA2707F7014807113C019
5267 -E0837113F07113F87113FC19FE837113FF71148F7213CF1AEF847213FF8484A284848485
5268 -A2858585A285858585497EB600F8167F1A3F1A1F1A0FA2554B7BCA60>I<EEFFF8031FEB
5269 -FFC04AB612FC020715FF021FD9C01F13C091277FFE000313F0902601FFF09038007FFC49
5270 -496E7E490180EC0FFF4990C86C7F49486F7F49486F7F017F8449486F7F4849707EA24849
5271 -707E4885A24849701380A2481AC04A82A2481AE0A34890CA6C13F0A5B519F8AE6C1AF0A2
5272 -6E5EA36C1AE0A26E5E6C1AC0A26C1A806E5E6C1A006E5E6C616E16FF6C616C6D4B5B6D6C
5273 -4B5B6E5D6D6D4A5B6D6D4A5B01076D4A90C7FC6D01F8ECFFFE6D01FE01035B9028007FFF
5274 -C01F13F0021F90B612C0020793C8FC020115FCDA001F14C0030101FCC9FC4D4D79CB5C>
5275 -I<B912C018FCF0FF8019F085D8001F902680000713FE05007F063F1380060F13C07213E0
5276 -1AF0841AF8A27213FCA31AFEA81AFCA34E13F8A21AF0601AE04E13C0063F138095B51200
5277 -050713FC92B75A19E096C7FC18F803C0CAFCB3ABB712FCA5474B7BCA54>I<B9FC18F8F0
5278 -FF8019E019F8D8000F9026C0000713FE9439007FFF80061F7F727F727F727F84868684A2
5279 -86A862A24E5BA2624E5B4E5B4E5B4E5B95B5C8FC050713FC92B712F0198006FCC9FC18FF
5280 -9226C0003F13C0050713F0717F717F717F187F85727FA28486A786A71C3E86A28474137E
5281 -72157C726D13FCB700FC6D9038FE01F872EBFF8373EBFFF0071F14E007031480CD383FFE
5282 -00574C7CCA5C>82 D<DA7FFCEB01C00103B5EAC003011FECF00749ECFC0F90B7121F48D9
5283 -E00F13BF4890C713FFD807FC141F4848804848140382484880177F485A173F171F12FFA2
5284 -170F7FA217077F7F7F6D92C7FC6D7E6C13F014FF15F86CECFF8016F86C15FF6C16C0836C
5285 -826C826C826C82013F816D1680010716C01300020F15E01400030714F0ED007F160F1603
5286 -7013F882177F127800F8163FA3171FA27E18F0A27EA26CEE3FE07F18C001E0157F6DEDFF
5287 -8001FC160001FF140302E0EB0FFED97FFEEB3FFC486CB612F0D8FC0F5DD8F803158048C6
5288 -6C49C7FC48010313F0354D79CB44>I<003FBB12C0A5DA80019038FC001FD9FC001601D8
5289 -7FF09438007FE001C0183F49181F90C7170FA2007E1907A3007C1903A500FC1AF0481901
5290 -A5C894C7FCB3B3A749B812FCA54C4A7CC955>I<B700F8023FB512F8A5D8001F01C0C938
5291 -0FE000745AB3B3AD6D180F63811A1F6D96C7FC626D7F1A7E6D7F6D606E6C4B5A6E6CED07
5292 -F06E6C4B5A6E01C0EC3FC06E01F049B45A020101FF011F90C8FC6E91B55A033F15F80307
5293 -15E0030092C9FC040713F0554C7CCA5E>I<B700F00203B6FCA5D8001F01E0C93803FC00
5294 -745A6D61811A036D6D5F1A076D6D5F1A0F6D616F161FA26D6D94C7FC626E6D153E1A7E6E
5295 -177C7015FC6E5F8219016E6D5D19036E5F7014076E5F82190F6E6D5D191F6E6D92C8FC61
5296 -6F153E83197E6F6D137C19FC6F6D5B18016F5DEFF003A26F01F85B18076F01FC5B180F6F
5297 -5DEFFE1F6F92C9FC17FF607013BE18FE705BA2705BA3705BA2705BA2705BA3705BA27090
5298 -CAFCA2177EA2584C7ECA5D>I<B700F84AB6FCA5D8001F01F0C93803FC006F705A6D4E5A
5299 -6D6D4C5A816D4E5A6D6D4C5A826D4EC7FC6E6D5D70157E6E5F6E7F704A5A6E4C5A6E7F70
5300 -4A5A6E4C5A6E7F71495A6E4CC8FC6F7F71137E6F5D6F7F71485A6F4A5A6F13FC71485A6F
5301 -4A5A6F13FFF09F806F02BFC9FC7013FF60705B8260705B8260B3A7037FB612FEA5584B7E
5302 -CA5D>89 D<ECFFFC010FEBFFC0017F14F090B612FC489038803FFE3B03FC0007FF80486C
5303 -6D7F6D7F486D6C7F83167F83A2707E6C90C7FC6C5A6C5AC9FCA5ED1FFF021FB5FC49B6FC
5304 -130F013FEBC03F9038FFFE00000313F04813C04890C7FC485A485AA2485AA2485AA4167F
5305 -A26D14FF007F15EF6D01017F6C6C903907CFFF806C6CD90F8F13FE6C9038E07F076C9038
5306 -FFFE0300014A7ED8003F9038F0007F0103018090C7FC37347CB23C>97
5307 -D<EB7FC0B5FCA512037EB3ED07FF037F13E002C1B512FC02C714FF9126CFF80F7F9126DF
5308 -C0017F02FFC77F4AEC3FF002F8814A6E7E717E4A81831980A37113C0A319E0AC19C0A35F
5309 -1980A219005F606E141F6E5D4D5A6E4A5A02BF4A5A91261FC0035B9027FE0FF01F5B496C
5310 -B548C7FCD9F80114F8496C6C13E0C8D80FFEC8FC3B4D7CCB44>I<91380FFF8091B512F8
5311 -010314FF010F15804948C613C0D97FF8EB1FE0D9FFE0EB3FF04849137F4849EBFFF84890
5312 -C7FCA2485A121FA24848EC7FF0EE3FE0EE1FC0007F92C7FC5BA212FFAC127FA27FA2123F
5313 -A26C6C153EA26C6C157E177C6C6D14FC6C6D14F86C6D13036C6DEB07F0D97FFCEB1FE06D
5314 -B4EBFFC0010F90B5120001035C010014F0020F13802F347CB237>I<EF1FF0EE3FFFA516
5315 -00177FB3EC0FFF91B512E0010314F8010F14FC013FEB01FF903A7FF8003FFFD9FFE0130F
5316 -48497F48497F4890C77E48815B121F5B123FA2127F5BA312FFAC127FA36C7EA3121F6D5C
5317 -120F6C6C5C6C6D5B6C5D6C01E0013F7F6D6C49EBFFE090393FFE03FE6DB512F801075C01
5318 -00148091261FFC00EBC0003B4D7CCB44>I<EC0FFF91B512F0010314FC010F14FF90263F
5319 -FE077F90267FF0007F49486D7E4801806D7E486F7E4890C7120F484881707E121F491403
5320 -003F82A2127F5B701380A212FFA390B8FCA401F8CAFCA5127FA27FA2123FA26C6CED0F80
5321 -A26C6C151F6C17006E5C6C6D147E6C6D5C6C6D495AD93FFCEB07F0903A1FFF803FE00107
5322 -90B55A010192C7FC6D6C13FC020713C031347DB238>I<ED7FF0913807FFFC023F7F4A7F
5323 -902601FFE0138049018113C049484813E0EB0FFCEB1FF8A2EB3FF0A2017F6D13C04A6C13
5324 -80EE7F00163E93C7FCACB77EA526007FF0C8FCB3B3A3003FB512F8A52B4D7DCC26>I<DA
5325 -7FFCEB0FE00103B538807FF8010F9138E1FFFC013F02FB13FE903A7FF01FFFF39026FFC0
5326 -07138348D90001130348168348486DEBC1FCEFC0F8000FEEE00049147F001F82A9000F5E
5327 -6D14FF00075EA26C6C495B6C93C7FC6C9038C007FE9138F01FFC4890B55A01EF14E0D803
5328 -C314809026C07FFCC8FC000790CAFCA47FA27F13FC90B612FCEEFFC06C16F817FE6C8218
5329 -806C17C06D16E00003B812F0120FD81FFCC7000F13F8D83FF0140049153F4848ED1FFC00
5330 -FF160F491507A56D150F007F17F86D151F6C6CED3FF06C6CED7FE0D80FFE913801FFC06C
5331 -6C6C010713806C01F8017F1300C690B612FC013F15F001071580D9003F01F0C7FC37497D
5332 -B13D>I<EB7FC0B5FCA512037EB3923801FFC0030F13F8033F7F4B13FFDBFE077F9138C1
5333 -F0039126C3E0017FDAC78080ECCF0014DE02DC6D7F14FC5CA25CA35CB3AAB6D8C07FEBFF
5334 -E0A53B4C7BCB44>I<13FCEA03FF487F487FA2487FA66C5BA26C5B6C90C7FCEA00FC90C8
5335 -FCABEB7FC0B5FCA512037EB3B3A2B61280A5194D7BCC22>I<EB7FC0B5FCA512037EB3B3
5336 -B3AAB61280A5194C7BCB22>108 D<90287FC001FFC0EC7FF0B5010F01FC0103B5FC033F
5337 -6D010F804B6D4980DBFE079026803F817F9126C1F801903AC07E007FF00003D9C3E0DAE0
5338 -F8806C9026C78000D9F1E06D7E02CFC7EBF3C002DEEDF780DD7FFF6E7E02FC93C7FC4A5D
5339 -A24A5DA34A5DB3AAB6D8C03FB5D8F00FB512FCA55E327BB167>I<903A7FC001FFC0B501
5340 -0F13F8033F7F4B13FFDBFE077F9138C1F00300039026C3E0017F6CD9C78080ECCF0014DE
5341 -02DC6D7F14FC5CA25CA35CB3AAB6D8C07FEBFFE0A53B327BB144>I<913807FF80027F13
5342 -F80103B6FC010F15C090261FFE017F903A7FF0003FF849486D7E480180EB07FE4890C76C
5343 -7E4817804980000F17C048486E13E0A2003F17F0A249157F007F17F8A400FF17FCAB007F
5344 -17F8A46C6CEDFFF0A2001F17E0A26C6C4A13C0A26C6C4A13806C6D4913006C5E6C01E0EB
5345 -1FFC6D6C495A903A3FFE01FFF0010FB612C0010392C7FCD9007F13F80207138036347DB2
5346 -3D>I<90397FC007FFB5017F13E002C1B512FC02C714FF9126CFF80F7F9126DFC0037F00
5347 -0301FFC77F6C496E7E02F8814A6E7E717E4A81831980A28319C0A37113E0AC19C05FA319
5348 -805F19005F606E143F6E5D4D5A6E4A5A02FF495BDBC0075B9126EFF01F5B02E7B548C7FC
5349 -02E114F8DAE07F13E0DB0FFEC8FC92CAFCAFB612C0A53B477CB144>I<9039FF803FE0B5
5350 -EBFFF8028113FE02837FDA87E11380EC8F830003D99F0713C06C139E14BCA214F8A24A6C
5351 -13806F13006F5A4A90C7FCA45CB3A8B612E0A52A327CB132>114
5352 -D<903907FF8070017FEBF1F048B6FC1207380FFC01391FE0003F4848130F491307127F90
5353 -C71203A2481401A27FA27F01F090C7FC13FCEBFFC06C13FEECFFE06C14FC6C806CECFF80
5354 -6C15C06C15E06C15F06C7E011F14F8010114FCEB000FEC007FED1FFE0078140F00F81407
5355 -15037E1501A27E16FC7E15036D14F86D13076D14F001F8EB1FE001FFEBFFC04890B51280
5356 -486C1400D8F81F13FCD8E00313C027347CB230>I<14F8A51301A41303A21307A2130FA2
5357 -131F133F137F13FF1203000F90B512F0B7FCA426007FF8C7FCB3A7167CAA013F14F880A2
5358 -90391FFE01F0010F1303903907FF87E06DEBFFC06D14806D6C1300EC0FFC26467EC430>
5359 -I<D97FE0EC3FF0B5EC7FFFA5000315016C81B3AC5EA25EA25E7E6EEB0F7F017F021E7F6E
5360 -017CEBFFE090393FFE01F86DB512F0010714E0010114C09027003FFE00EBC0003B337BB1
5361 -44>I<B600C090387FFFF0A5C601F0C73803F8006E5D017F5E801707013F5E6E140F011F
5362 -5E6E141F6D93C7FC6F5B6D153E81177E6D157C6F13FC6D5DEDF0016D5DEDF803027F5CA2
5363 -EDFC07023F5CEDFE0F021F5CEDFF1F6E91C8FC169F16BF6E13BE16FE6E5BA26E5BA26E5B
5364 -A36F5AA26F5AA26F5AA23C327EB041>I<B60081B500FC90387FFFF0A500019026E00003
5365 -90C73801FC006E6F5C6C6F5E6E6F1303017F61A26E6F1307013F4A5E846E49150F011F61
5366 -6E6F131F6D4A93C7FC179F03806E5B6D021F153EEF0FFE6DD9C03F5DEE3E0703E06E13FC
5367 -6D027E5DEE7C0303F015816D4A6C5C03F815C3DA7FF95E4C7E03FD15E7DA3FFF5E4C137F
5368 -19FF6E496D5BA26E94C8FC4C7FA26E5E93C7120FA26E486E5AA202015E4B1403A26E486E
5369 -5A54327EB059>I<007FB500C090387FFFE0A5C601F0C73803F8006E5D017F5E6E140701
5370 -3F5E80170F011F5E6E141F6D93C7FC6F5B6D153E6F137E6D157C6F13FCA26D6D5B16016D
5371 -5DEDF803027F5CEDFC07023F5CEDFE0F021F5C15FF161F6E91C8FC16BF6E13BE16FE6E5B
5372 -A26E5BA36E5BA26F5AA26F5AA26F5AA393C9FC5D153E157E157CD81F8013FC486C5B387F
5373 -E001D8FFF05B14035D14074A5A49485A007F133F4948CAFC383F81FE381FFFF86C5B6C13
5374 -C0C648CBFC3B477EB041>121 D E
5375 -%EndDVIPSBitmapFont
5376 -%DVIPSBitmapFont: Fg cmtt12 17.28 6
5377 -/Fg 6 123 df<913803FFC0023F13FC49B67E010715F04981013F15FE498190B812C048
5378 -8348D9FC0180489026E0001F7F480180130391C87F48486F7E49153F4848ED0FFF834848
5379 -178083496F13C012FF8319E07FA2187FA36C5A6C5A6C5ACBFCA218FFA219C05FA219805F
5380 -A24D13005F604D5A173F4D5A4D5AA24C5B4C5B4C5B041F90C7FC4C5A4C5A4C5A4B5B4B5B
5381 -4B5B031F5B4B90C8FC4B5AEDFFF84A5B4A5B4A5B021F5B4A90C9FCEC7FFC4A5A495B495B
5382 -010F5B495B4948CAFC4948ED1F804948ED3FC04849ED7FE0485B000F5B4890C9FC4890B8
5383 -FC5ABAFCA56C18C06C18803B5A79D94A>50 D<383FFFF0487F80B5FCA37EA27EEA000FB0
5384 -EE0FFC93B57E030714E0031F14F84B14FE92B7FC02FD8291B87E85DCE01F7FEE000703FC
5385 -01017F4B6D7F03E0143F4B6E7E4B140F8592C87E4A6F1380A34A6F13C0A284A21AE0A219
5386 -7FAA19FFA21AC0A26E5DA24E138080606F1600606F4A5A6F143F6F4A5A6F4A5A6F130303
5387 -FF010F5BDCC03F5B93B65A6102FD93C7FC02FC5D6F5C031F14F0902607F80714C0902603
5388 -F00191C8FC90C8EA3FF043597FD74A>98 D<EC01F0EC07FC4A7EA24A7EA56E5AA26E5AEC
5389 -01F091CAFCAE001FB512FC4880815AA37EA27EC71203B3B3A8003FB812C04817E0A2B912
5390 -F0A36C17E0A26C17C0345974D84A>105 D<003FB512FE4880B77EA57E7EC71201B3B3B3
5391 -B0003FB812FC4817FEBAFCA56C17FE6C17FC385877D74A>108 D<EE0FFC263FFFF090B5
5392 -7E48D9F80714E0DAFC1F14F8B54914FE92B7FC02FD826C90B87E856CDBE01F7FD8000FEC
5393 -000703FC01017F4B6D7F03E0143F4B6E7E4B140F8592C87E4A6F1380A34A6F13C0A284A2
5394 -1AE0A2197FAA19FFA21AC0A26E5DA24E138080606F1600606F4A5A6F143F6F4A5A6F4A5A
5395 -6F130303FF010F5BDCC03F5B93B65A6102FD93C7FC02FC5D6F5C031F14F0030714C00301
5396 -91C8FC9238003FF093CAFCB3A4003FB6FC4881A2B77EA36C5DA26C92CAFC435F7FBE4A>
5397 -112 D<000FB912E04818F04818F8A619F001F0C8000313E04D13C04D13804D13004D5A4D
5398 -5A4D5A6C484A5B6C484A5BC9000F5B4C5B4C90C7FC4C5A4C5A4B5B4B5B4B5B4B5B4B5B4B
5399 -90C8FC4B5A4B5A4A5B4A5B4A5B4A5B4A5B4A90C9FC4A5A4A5A495B495B495B4949EC07E0
5400 -4949EC0FF04948C8EA1FF8495A495A485B485B485B485B4890C9FC485A48B9FCBAFCA66C
5401 -18F06C18E03D3E7BBD4A>122 D E
5402 -%EndDVIPSBitmapFont
5403 -%DVIPSBitmapFont: Fh cmbx12 17.28 28
5404 -/Fh 28 120 df<16F04B7E1507151F153FEC01FF1407147F010FB5FCB7FCA41487EBF007
5405 -C7FCB3B3B3B3007FB91280A6395E74DD51>49 D<913801FFF8021FEBFFC091B612F80103
5406 -15FF010F16C0013F8290267FFC0114F89027FFE0003F7F4890C7000F7F48486E7FD807F8
5407 -6E148048486E14C048486E14E048486F13F001FC17F8486C816D17FC6E80B56C16FE8380
5408 -A219FFA283A36C5BA26C5B6C90C8FCD807FC5DEA01F0CA14FEA34D13FCA219F85F19F04D
5409 -13E0A294B512C019804C14004C5B604C5B4C5B604C13804C90C7FC4C5A4C5A4B13F05F4B
5410 -13804B90C8FC4B5AED1FF84B5A4B5A4B48143F4A5B4A48C8FC4A5A4A48157E4A5A4A5AEC
5411 -7F8092C9FC02FE16FE495A495A4948ED01FCD90FC0150749B8FC5B5B90B9FC5A4818F85A
5412 -5A5A5A5ABAFCA219F0A4405E78DD51>I<92B5FC020F14F8023F14FF49B712C04916F001
5413 -0FD9C01F13FC90271FFC00077FD93FE001017F49486D8049C86C7F484883486C6F7F14C0
5414 -486D826E806E82487FA4805CA36C5E4A5E6C5B6C5B6C495E011FC85A90C95CA294B55A61
5415 -4C91C7FC604C5B4C5B4C5B4C5B047F138092260FFFFEC8FC020FB512F817E094C9FC17F8
5416 -17FF91C7003F13E0040713F8040113FE707F717F7113E085717FA2717F85A285831A80A3
5417 -1AC0EA03FCEA0FFF487F487F487FA2B57EA31A80A34D14005C7E4A5E5F6C495E49C8485B
5418 -D81FF85F000F5ED807FE92B55A6C6C6C4914806C01F0010791C7FC6C9026FF803F5B6D90
5419 -B65A011F16F0010716C001014BC8FCD9001F14F0020149C9FC426079DD51>I<F01F804E
5420 -7E187F18FFA25F5F5F5FA25F5F5FA294B5FC5E5E5EA25E5EEE3FBFEE7F3FA216FEED01FC
5421 -ED03F8ED07F0A2ED0FE0ED1FC0ED3F8016005D15FE4A5A4A5AA24A5A4A5A4A5A4A5AA24A
5422 -C7FC14FE495A5C1303495A495A495A5C133F49C8FC13FE485AA2485A485A485A5B121F48
5423 -5A48C9FC12FEBCFCA6CA6CEBC000B1037FB8FCA6485E7CDD51>I<4DB5ED03C0057F02F0
5424 -14070407B600FE140F047FDBFFC0131F4BB800F0133F030F05FC137F033F9127F8007FFE
5425 -13FF92B6C73807FF814A02F0020113C3020702C09138007FE74A91C9001FB5FC023F01FC
5426 -16074A01F08291B54882490280824991CB7E49498449498449498449865D49498490B5FC
5427 -484A84A2484A84A24891CD127FA25A4A1A3F5AA348491A1FA44899C7FCA25CA3B5FCB07E
5428 -A380A27EA2F50FC0A26C7FA37E6E1A1F6C1D80A26C801D3F6C6E1A00A26C6E616D1BFE6D
5429 -7F6F4E5A7F6D6D4E5A6D6D4E5A6D6D4E5A6D6E171F6D02E04D5A6E6DEFFF806E01FC4C90
5430 -C7FC020F01FFEE07FE6E02C0ED1FF8020102F8ED7FF06E02FF913803FFE0033F02F8013F
5431 -1380030F91B648C8FC030117F86F6C16E004071680DC007F02F8C9FC050191CAFC626677
5432 -E375>67 D<B96C90B91280A6D8000102C0C9000102C0C7FCB3B3A293BBFCA604C0C91201
5433 -B3B3A6B96C90B91280A671627AE17E>72 D<B912E0A6C702E0C7FCB3B3B3B3AEB912E0A6
5434 -33627CE13C>I<B700C0083FB612F070627097B7FCA37061D800010DF8C7FC70F103EFA2
5435 -02FD6DF107CFA202FC6DF10F8FA36F6DF01F0FA26F6D183EA26F6D187CA26F6D18F8A36F
5436 -6DEF01F0A26F6DEF03E0A26F6DEF07C0A26F6DEF0F80A3706DEE1F00A2706D163EA2706D
5437 -5EA2706D5EA3706D4B5AA2706D4B5AA2706D4B5AA2706D4B5AA3716D4AC7FCA2716D143E
5438 -A2716D5CA2716D5CA3716D495AA2716D495AA2716D495AA2716D495AA3726D48C8FCA272
5439 -EBC03EA2726D5AA2726D5AA372EBF9F0A272EBFFE0A2725CA2725CA37390C9FCA2735AA2
5440 -735A90381FFFC0B700F86E480207B812F0A3735AA2735A8C627AE199>77
5441 -D<BB7E1AFCF2FFC01BF81BFE757ED800010280C7001F80070114F0736C7F081F7F747F74
5442 -7F7414807414C0A27414E0A21DF0A27513F8A41DFCA91DF8A498B512F0A21DE0A25014C0
5443 -1D8062501400505B505B087F5B4FB512E0071F5C93B9C7FC1BFC1BF01B8008F0C8FC04C0
5444 -CCFCB3B3A2B97EA65E627AE16E>80 D<001FBEFCA64849C79126E0000F148002E0180091
5445 -C8171F498601F81A0349864986A2491B7FA2491B3F007F1DC090C9181FA4007E1C0FA600
5446 -FE1DE0481C07A5CA95C7FCB3B3B3A3021FBAFCA663617AE070>84
5447 -D<913803FFFE027FEBFFF00103B612FE010F6F7E4916E090273FFE001F7FD97FE001077F
5448 -D9FFF801017F486D6D7F717E486D6E7F85717FA2717FA36C496E7FA26C5B6D5AEB1FC090
5449 -C9FCA74BB6FC157F0207B7FC147F49B61207010F14C0013FEBFE004913F048B512C04891
5450 -C7FC485B4813F85A5C485B5A5CA2B55AA45FA25F806C5E806C047D7F6EEB01F96C6DD903
5451 -F1EBFF806C01FED90FE114FF6C9027FFC07FC01580000191B5487E6C6C4B7E011F02FC13
5452 -0F010302F001011400D9001F90CBFC49437CC14E>97 D<903807FF80B6FCA6C6FC7F7FB3
5453 -A8EFFFF8040FEBFF80047F14F00381B612FC038715FF038F010014C0DBBFF0011F7FDBFF
5454 -C001077F93C76C7F4B02007F03F8824B6F7E4B6F13804B17C0851BE0A27313F0A21BF8A3
5455 -7313FCA41BFEAE1BFCA44F13F8A31BF0A24F13E0A24F13C06F17804F1300816F4B5A6F4A
5456 -5B4AB402075B4A6C6C495B9126F83FE0013F13C09127F00FFC03B55A4A6CB648C7FCDAC0
5457 -0115F84A6C15E091C7001F91C8FC90C8000313E04F657BE35A>I<92380FFFF04AB67E02
5458 -0F15F0023F15FC91B77E01039039FE001FFF4901F8010113804901E0010713C049018049
5459 -13E0017F90C7FC49484A13F0A2485B485B5A5C5A7113E0485B7113C048701380943800FE
5460 -0095C7FC485BA4B5FCAE7EA280A27EA2806C18FCA26C6D150119F87E6C6D15036EED07F0
5461 -6C18E06C6D150F6D6DEC1FC06D01E0EC7F806D6DECFF00010701FCEB03FE6D9039FFC03F
5462 -FC010091B512F0023F5D020F1580020102FCC7FCDA000F13C03E437BC148>I<F17FF805
5463 -0FB5FCA6EF000F8484B3A892380FFF804AB512F8020F14FE023FECFF8391B712E3010391
5464 -38807FF3499039F8000FFB011F01E00103B5FC494913004990C87E49488148498148834A
5465 -815A485BA2485BA25AA3485BA4B5FCAE7EA46C7FA37EA26C7FA26C5F806C5F6C6D5D6C6D
5466 -5D017F93B5FC6D6C6C0103806D6D49806D01F0D91FF7EBFFFE6D9039FE01FFE7010190B6
5467 -12876D6CECFE07021F14F8020314E09127003FFE00ECC0004F657BE35A>I<92380FFFC0
5468 -4AB512FC020FECFF80023F15E091B712F80103D9FE037F499039F0007FFF011F01C0011F
5469 -7F49496D7F4990C76C7F49486E7F48498048844A804884485B727E5A5C48717EA35A5C72
5470 -1380A2B5FCA391B9FCA41A0002C0CBFCA67EA380A27EA27E6E160FF11F806C183F6C7FF1
5471 -7F006C7F6C6D16FE6C17016D6C4B5A6D6D4A5A6D01E04A5A6D6DEC3FE0010301FC49B45A
5472 -6D9026FFC01F90C7FC6D6C90B55A021F15F8020715E0020092C8FC030713F041437CC14A
5473 ->I<EE3FFC0307B51280033F14C04AB612F0020715F84A9038F03FFC4AEB807F913A7FFE
5474 -00FFFE4A5A4B4813FF4913F05B4913E0A24913C0A27013FE4949EB7FFCEF3FF8EF1FF0EF
5475 -07C094C7FCB0B812C0A6D8001F01C0C8FCB3B3B0007FB612FCA638657CE431>I<F107F8
5476 -DB7FFEEC3FFE020FB5D8F001B5FC027FDAFE03148049B7128F49DCDFFD13C0010FD9F00F
5477 -EBFFC149D9800114014990C7EBFC0349486E6C7E4948EC3FFF48496E0181138007801300
5478 -48F0C03E97C7FC48496E7FA34884A96C60A36C6D4A5BA26C60A26C6D4A90C8FC6D6C4A5A
5479 -6D6C4A5A6D6D485BDBF00F5B4990B612C060D97C7F4AC9FCD9FC0F14F09126007FFECAFC
5480 -92CCFC1201A47FA27F8014F091B77E18FE6CEFFFC019F06D17FC19FF6D846D846D846D84
5481 -013F8490BAFC0003854801E0C712014890C9000F7F484816014848EE007F4848717E8512
5482 -FF5B85A56D5F007F616D173F003F616D177F6C6C4D5A6C01C003035B6C6D4B5B6C01F803
5483 -1F5BC601FF92B5C7FC6D01F8011F5B011F90B712F8010717E0010094C8FC020F15F0DA00
5484 -3F01FCC9FC4A607CC151>I<903807FF80B6FCA6C6FC7F7FB3A8EF1FFF94B512F0040714
5485 -FC041F14FF4C8193267FE07F7F922781FE001F7FDB83F86D7FDB87F07FDB8FC0814C7F03
5486 -9FC78015BE03BC8003FC825DA25DA25DA45DB3B2B7D8F007B71280A651647BE35A>I<EB
5487 -0FE0EB3FF8497E48B5FCA24880A24880A76C5CA26C91C7FCA238007FFC6D5AEB0FE090C9
5488 -FCAF903807FF80007FB5FCA6C6FC7F7FB3B3AEB712C0A622657BE42C>I<903807FF80B6
5489 -FCA6C6FC7F7FB3B3B3B3ADB712E0A623647BE32C>108 D<902607FF80D91FFFEEFFF8B6
5490 -91B500F00207EBFF80040702FC023F14E0041F02FF91B612F84C6F488193267FE07F6D48
5491 -01037F922781FE001F9027E00FF0007FC6DA83F86D9026F01FC06D7F6DD987F06D4A487F
5492 -6DD98FC0DBF87EC7804C6D027C80039FC76E488203BEEEFDF003BC6E4A8003FC04FF834B
5493 -5FA24B5FA24B94C8FCA44B5EB3B2B7D8F007B7D8803FB612FCA67E417BC087>I<902607
5494 -FF80EB1FFFB691B512F0040714FC041F14FF4C8193267FE07F7F922781FE001F7FC6DA83
5495 -F86D7F6DD987F07F6DD98FC0814C7F039FC78015BE03BC8003FC825DA25DA25DA45DB3B2
5496 -B7D8F007B71280A651417BC05A>I<923807FFE092B6FC020715E0021F15F8027F15FE49
5497 -4848C66C6C7E010701F0010F13E04901C001037F49496D7F4990C87F49486F7E49486F7E
5498 -48496F13804819C04A814819E048496F13F0A24819F8A348496F13FCA34819FEA4B518FF
5499 -AD6C19FEA46C6D4B13FCA36C19F8A26C6D4B13F0A26C19E06C6D4B13C0A26C6D4B13806C
5500 -6D4B13006D6C4B5A6D6D495B6D6D495B010701F0010F13E06D01FE017F5B010090B7C7FC
5501 -023F15FC020715E0020092C8FC030713E048437CC151>I<D90FFFEB0FFCB690383FFF80
5502 -93B512E04B14F04B14F8923907FC7FFC92390FE0FFFEC6EC1F806DD93F0113FF6D133E15
5503 -7E157C15F8A215F07013FEA24BEB7FFCEF3FF8EF0FE04B90C7FCA55DB3B0B712F8A63841
5504 -7BC042>114 D<913A3FFF8007800107B5EAF81F011FECFE7F017F91B5FC48B8FC48EBE0
5505 -014890C7121FD80FFC1407D81FF0801600485A007F167F49153FA212FF171FA27F7F7F6D
5506 -92C7FC13FF14E014FF6C14F8EDFFC06C15FC16FF6C16C06C16F06C826C826C826C82013F
5507 -1680010F16C01303D9007F15E0020315F0EC001F1500041F13F81607007C150100FC8117
5508 -7F6C163FA2171F7EA26D16F0A27F173F6D16E06D157F6D16C001FEEDFF806D0203130002
5509 -C0EB0FFE02FCEB7FFC01DFB65A010F5DD8FE0315C026F8007F49C7FC48010F13E035437B
5510 -C140>I<EC07E0A6140FA5141FA3143FA2147FA214FF5BA25B5B5B5B137F48B5FC000F91
5511 -B512FEB8FCA5D8001F01E0C8FCB3AFEF0FC0AC171F6D6D1480A2173F6D16006F5B6D6D13
5512 -7E6D6D5B6DEBFF836EEBFFF86E5C020F14C002035C9126003FFCC7FC325C7DDA3F>I<90
5513 -2607FFC0ED3FFEB60207B5FCA6C6EE00076D826D82B3B3A260A360A2607F60183E6D6D14
5514 -7E4E7F6D6D4948806D6DD907F0ECFF806D01FFEB3FE06D91B55A6E1500021F5C020314F8
5515 -DA003F018002F0C7FC51427BC05A>I<B70081B600FC0103B512FCA6C66C0180C701FCC8
5516 -381FFE006F6FED03F86D047F5F856F6E16076D646F70140F6D705F866F6E161F6D646F4A
5517 -6D143F6D99C7FC4E7F6F616D1B7E6F4A6D14FE6D6395B57E7001FC15016E62DCC0016E13
5518 -036EDBF87F5D05038004E0496C14076E62DCF007ED800F6E4B6C5D050F15C004F8496C14
5519 -1F6E62DCFC1FEDE03F6E4B6C92C8FC053F15F004FE496C5C6E197E7048EDF8FE6E027E6D
5520 -5C05FE15FC4D6D13FD6F601BFF6F496E5BA24D806F60A26F496E5BA24D806F60A26F496E
5521 -90C9FCA294C87E6F5FA26F486F5A047C6F5A6E417DBF75>119 D
5522 -E
5523 -%EndDVIPSBitmapFont
5524 -%DVIPSBitmapFont: Fi cmsy10 10.95 1
5525 -/Fi 1 16 df<EB0FFCEB3FFF90B512C0000314F04880488048804880A2481580A3B712C0
5526 -AA6C1580A36C1500A26C5C6C5C6C5C6C5CC614C0013F90C7FCEB0FFC22227BA72D>15
5527 -D E
5528 -%EndDVIPSBitmapFont
5529 -%DVIPSBitmapFont: Fj cmtt10 10.95 89
5530 -/Fj 89 127 df<121C127FEAFF80B3EA7F00B2123EC7FCA8121C127FA2EAFF80A3EA7F00
5531 -A2121C09396DB830>33 D<00101304007C131F00FEEB3F80A26C137FA248133FB2007E14
5532 -00007C7F003C131E00101304191C75B830>I<903907C007C0A2496C487EA8011F131FA2
5533 -02C05BA3007FB7FCA2B81280A36C16006C5D3A007F807F80A2020090C7FCA9495BA2003F
5534 -90B512FE4881B81280A36C1600A22701FC01FCC7FCA300031303A201F85BA76C486C5AA2
5535 -29387DB730>I<EB07E0EB1FF8497E137F497E803801FC7F497E810003131F13F0A6143F
5536 -92C8FC91387F0FFF9026F87E1F1380000113FEEBF9FC13FB4A6C1300D9FFF013C06C13E0
5537 -151F02C05BEB7F809038FF003F4892C7FC485C48EB807E5A15FE391FDFC0FC383F8FE014
5538 -E1397F07F1F8EB03F300FEEBFBF0EB01FF5D7FEDC006027F130F91393F801F8015C06C13
5539 -7F6CEBFFE049EBF83F018701FC1300263FFFFBB5FC6C01F15B14E06C9038C03FFC000390
5540 -38001FF8D801FCEB07E0293A7DB830>38 D<EA07C0EA0FF0EA1FF8A213FCA213FE120F12
5541 -07EA007EA513FE13FCA2120113F81203EA07F0120FEA1FE0127FEAFFC013801300127C12
5542 -380F1D70B730>I<141E147F14FF5BEB03FEEB07FCEB0FF0EB1FE0EB3FC0EB7F80EBFF00
5543 -485A5B12035B485A120F5BA2485AA2123F5BA2127F90C7FCA412FEAD127FA47F123FA27F
5544 -121FA26C7EA27F12076C7E7F12017F6C7EEB7F80EB3FC0EB1FE0EB0FF0EB07FCEB03FEEB
5545 -01FF7F147F141E184771BE30>I<127812FE7E7F6C7E6C7EEA0FF06C7E6C7E6C7E6C7EEB
5546 -7F80133F14C0131FEB0FE014F01307A2EB03F8A214FC1301A214FE1300A4147FAD14FEA4
5547 -130114FCA2130314F8A2EB07F0A2130F14E0EB1FC0133F1480137FEBFF00485A485A485A
5548 -485AEA3FE0485A485A90C7FC5A1278184778BE30>I<14E0497E497EA60038EC0380007E
5549 -EC0FC0D8FF83EB3FE001C3137F9038F3F9FF267FFBFB13C06CB61280000FECFE00000314
5550 -F86C5C6C6C13C0011F90C7FC017F13C048B512F04880000F14FE003FECFF80267FFBFB13
5551 -C026FFF3F913E09038C3F87F0183133FD87E03EB0FC00038EC0380000091C7FCA66D5A6D
5552 -5A23277AAE30>I<143EA2147FAF007FB7FCA2B81280A36C1600A2C76CC8FCAF143EA229
5553 -297DAF30>I<EA03E0EA0FF0EA1FF813FCEA3FFEA213FFA27EA27E1203EA007FA2137E13
5554 -FEEA01FC1203EA07F8EA3FF0127FEAFFE0EA7F801300123C1019708B30>I<007FB612F0
5555 -A2B712F8A36C15F0A225077B9E30>I<120FEA3FC0EA7FE0A2EAFFF0A4EA7FE0A2EA3FC0
5556 -EA0F000C0C6E8B30>I<16F01501ED03F8A21507A2ED0FF0A2ED1FE0A2ED3FC0A2ED7F80
5557 -A2EDFF00A24A5AA25D1403A24A5AA24A5AA24A5AA24A5AA24A5AA24AC7FCA2495AA25C13
5558 -03A2495AA2495AA2495AA2495AA2495AA249C8FCA2485AA25B1203A2485AA2485AA2485A
5559 -A2485AA2485AA248C9FCA25AA2127CA225477BBE30>I<14FE903807FFC0497F013F13F8
5560 -497F90B57E48EB83FF4848C6138049137F4848EB3FC04848EB1FE049130F001F15F04913
5561 -07A24848EB03F8A290C712014815FCA400FEEC00FEAD6C14016C15FCA36D1303003F15F8
5562 -A26D1307001F15F0A26D130F6C6CEB1FE0A26C6CEB3FC06C6CEB7F806D13FF2601FF8313
5563 -006CEBFFFE6D5B6D5B010F13E06D5BD900FEC7FC273A7CB830>I<EB03C0497EA2130FA2
5564 -131FA2133F137F13FF1203123FB5FCA213EF138FEA7E0F1200B3B0003FB512F84814FCB6
5565 -12FEA26C14FC6C14F81F3977B830>I<EB07FC90383FFFC090B512F00003804814FE4880
5566 -261FF80F1380263FE00113C09038C0007F4848EB3FE090C7121FED0FF04814075A6C15F8
5567 -1503A3127E1218C8FCA2150716F0150F16E0151F16C0153FED7F8015FF4A13005DEC07FC
5568 -4A5A4A5A4A5A4A5A4A5A4990C7FC495A495AEB0FF0EB3FE0495A495A4890C8FC4848EB01
5569 -F04848EB03F8485AEA1FE048B6FCB7FCA37E6C15F025397BB830>I<EB03FF013F13E090
5570 -B512F84814FE4880481580260FFE0113C09038F0007F4848EB1FE0150F16F01507A26C5A
5571 -6C5AC8FC150F16E0A2151FED3FC0157FEDFF8002071300903807FFFE495B5D8115FF6D14
5572 -80D9000113C09138003FE0ED1FF0ED07F8150316FC150116FE1500A21218127EB4FCA215
5573 -0116FC4814036C15F86C6C13076DEB1FF0D83FF0133F3A1FFE01FFE06CB612C06C15806C
5574 -ECFE00C65C013F13F001031380273A7CB830>I<EC03FC4A7E140F141FA2143F147F157E
5575 -14FEA2EB01FCEB03F8A2EB07F0A2EB0FE0EB1FC0A2EB3F80A2EB7F0013FEA2485A485AA2
5576 -485AA2485A485AA2485AA248C7FC12FEB8FC1780A46C1600C8007EC7FCAA91387FFFFE91
5577 -B6FCA46E5B29397DB830>I<000FB612804815C05AA316800180C8FCAEEB83FF019F13C0
5578 -90B512F015FC8181D9FE0313809039F0007FC049133F0180EB1FE06CC7120F000E15F0C8
5579 -1207A216F81503A31218127EA2B4FC150716F048140F6C15E06C141F6DEB3FC06D137F3A
5580 -3FE001FF80261FFC0F13006CB55A6C5C6C5C6C14E06C6C1380D90FFCC7FC25397BB730>
5581 -I<EC0FF8EC7FFF49B51280010714E0131F4914F090387FF80F9039FFC007F84813803803
5582 -FE005B485A4848EB03F0ED01E0484890C7FC5B123F5BA2127FEB000C903803FFE0010F13
5583 -F8D8FF3F13FE48B6FCB7128016C09039FE007FE001F8EB1FF001E0130F49EB07F8ED03FC
5584 -5B90C7120116FE1500A37EA46C7E15016D14FC121F6D1303000FEC07F86D130F6C6CEB1F
5585 -F06DEB3FE03A03FF81FFC06C90B512806C15006D5B011F13F8010713E001011380273A7C
5586 -B830>I<127CB712FC16FEA416FC48C7EA0FF816F0ED1FE0007CEC3FC0C8EA7F80EDFF00
5587 -A24A5A4A5A5D14075D140F5D4A5AA24A5AA24AC7FCA25C5C13015CA213035CA213075CA4
5588 -495AA6131F5CA96D5A6DC8FC273A7CB830>I<49B4FC011F13F0017F13FC90B57E0003EC
5589 -FF804815C048010113E03A1FF8003FF049131FD83FC0EB07F8A24848EB03FC90C71201A5
5590 -6D1303003F15F86D13076C6CEB0FF06C6CEB1FE0D807FCEB7FC03A03FF83FF806C90B512
5591 -006C6C13FC011F13F0497F90B512FE48802607FE0013C0D80FF8EB3FE0D81FE0EB0FF048
5592 -48EB07F8491303007F15FC90C712014815FE481400A66C14016C15FC6D1303003F15F86D
5593 -1307D81FF0EB1FF06D133F3A0FFF01FFE06C90B512C06C1580C6ECFE006D5B011F13F001
5594 -0190C7FC273A7CB830>I<49B4FC010F13E0013F13F890B57E4880488048010113803A0F
5595 -FC007FC0D81FF0EB3FE04848131F49EB0FF048481307A290C7EA03F85A4815FC1501A416
5596 -FEA37E7E6D130315076C7E6C6C130F6D133FD80FFC13FF6CB6FC7E6C14FE6C14F9013FEB
5597 -E1FC010F138190380060011400ED03F8A2150716F0150F000F15E0486C131F486CEB3FC0
5598 -157FEDFF804A1300EC07FE391FF01FFC90B55A6C5C6C5C6C1480C649C7FCEB3FF0273A7C
5599 -B830>I<120FEA3FC0EA7FE0A2EAFFF0A4EA7FE0A2EA3FC0EA0F00C7FCAF120FEA3FC0EA
5600 -7FE0A2EAFFF0A4EA7FE0A2EA3FC0EA0F000C276EA630>I<EA03C0EA0FF0EA1FF8A2EA3F
5601 -FCA4EA1FF8A2EA0FF0EA03C0C7FCAFEA03C0EA0FF0121F13F8123F13FCA3121FA2120F12
5602 -031200120113F8120313F01207EA1FE0123FEA7FC0EAFF80EA7F00127E12380E3470A630
5603 ->I<16F01503ED07F8151F157FEDFFF014034A13C0021F138091383FFE00ECFFF8495B01
5604 -0713C0495BD93FFEC7FC495A3801FFF0485B000F13804890C8FCEA7FFC5BEAFFE05B7FEA
5605 -7FF87FEA1FFF6C7F000313E06C7F38007FFC6D7E90380FFF806D7F010113F06D7FEC3FFE
5606 -91381FFF80020713C06E13F01400ED7FF8151F1507ED03F01500252F7BB230>I<007FB7
5607 -FCA2B81280A36C16006C5DCBFCA7003FB612FE4881B81280A36C1600A229157DA530>I<
5608 -1278127EB4FC13C07FEA7FF813FEEA1FFF6C13C000037F6C13F86C6C7EEB1FFF6D7F0103
5609 -13E06D7F9038007FFC6E7E91380FFF806E13C0020113F080ED3FF8151F153FEDFFF05C02
5610 -0713C04A138091383FFE004A5A903801FFF0495B010F13804990C7FCEB7FFC48485A4813
5611 -E0000F5B4890C8FCEA7FFE13F8EAFFE05B90C9FC127E1278252F7BB230>I<EC1FE0ECFF
5612 -F8010313FE010F7F4914804914C090397FF03FE09038FF800F4890380007F0D803FC1303
5613 -3A07F801FBF89038F007FF380FE01F4A13FCEA1FC0495A003FEBFF0F903800FE07903901
5614 -FC03FE007FEBF801EA7E03ECF000A2EAFE0700FC49137EAA00FE6D13FED87E0314FCA2EC
5615 -F801D87F0114F8003FEBFC03903900FE07F0903880FF0F001F90387FFFE06D6C13C0EA0F
5616 -E06E13803A07F007FE009038F801F86C6CC7127C6CB414FE6CEB800390387FF01F6DB512
5617 -FC6D14F86D14E0010314C00100EBFE00EC1FF0273A7CB830>64 D<147F4A7EA2497FA449
5618 -7F14F7A401077F14E3A3010F7FA314C1A2011F7FA490383F80FEA590387F007FA4498049
5619 -133F90B6FCA34881A39038FC001F00038149130FA4000781491307A2D87FFFEB7FFFB56C
5620 -B51280A46C496C130029397DB830>I<007FB512F0B612FE6F7E82826C813A03F8001FF8
5621 -15076F7E1501A26F7EA615015EA24B5A1507ED1FF0ED7FE090B65A5E4BC7FC6F7E16E082
5622 -9039F8000FF8ED03FC6F7E1500167FA3EE3F80A6167F1700A25E4B5A1503ED1FFC007FB6
5623 -FCB75A5E16C05E6C02FCC7FC29387EB730>I<91387F803C903903FFF03E49EBFC7E011F
5624 -13FE49EBFFFE5B9038FFE07F48EB801F3903FE000F484813075B48481303A2484813015B
5625 -123F491300A2127F90C8FC167C16005A5AAC7E7EA2167C6D14FE123FA27F121F6D13016C
5626 -6C14FCA26C6CEB03F86D13076C6CEB0FF03901FF801F6C9038E07FE06DB512C06D14806D
5627 -1400010713FC6D13F09038007FC0273A7CB830>I<003FB512E04814FCB67E6F7E6C816C
5628 -813A03F8007FF0ED1FF8150F6F7E6F7E15016F7EA2EE7F80A2163F17C0161FA4EE0FE0AC
5629 -161F17C0A3163F1780A2167F17005E4B5A15034B5A150F4B5AED7FF0003FB65A485DB75A
5630 -93C7FC6C14FC6C14E02B387FB730>I<007FB7FCB81280A47ED803F8C7123FA8EE1F0093
5631 -C7FCA4157C15FEA490B5FCA6EBF800A4157C92C8FCA5EE07C0EE0FE0A9007FB7FCB8FCA4
5632 -6C16C02B387EB730>I<003FB712804816C0B8FCA27E7ED801FCC7121FA8EE0F8093C7FC
5633 -A5153E157FA490B6FCA69038FC007FA4153E92C8FCAE383FFFF8487FB5FCA27E6C5B2A38
5634 -7EB730>I<02FF13F00103EBC0F8010F13F1013F13FD4913FF90B6FC4813C1EC007F4848
5635 -133F4848131F49130F485A491307121F5B123F491303A2127F90C7FC6F5A92C8FC5A5AA8
5636 -92B5FC4A14805CA26C7F6C6D1400ED03F8A27F003F1407A27F121F6D130F120F7F6C6C13
5637 -1FA2D803FE133F6C6C137FECC1FF6C90B5FC7F6D13FB010F13F30103EBC1F0010090C8FC
5638 -293A7DB830>I<3B3FFF800FFFE0486D4813F0B56C4813F8A26C496C13F06C496C13E0D8
5639 -03F8C7EAFE00B290B6FCA601F8C7FCB3A23B3FFF800FFFE0486D4813F0B56C4813F8A26C
5640 -496C13F06C496C13E02D387FB730>I<007FB6FCB71280A46C1500260007F0C7FCB3B3A8
5641 -007FB6FCB71280A46C1500213879B730>I<49B512F04914F85BA27F6D14F090C7EAFE00
5642 -B3B3123C127EB4FCA24A5A1403EB8007397FF01FF86CB55A5D6C5C00075C000149C7FC38
5643 -003FF025397AB730>I<D83FFF90380FFF80486D4813C0B56C5AA26C497E6C496C1380D8
5644 -03F0903803F8004B5A4B5A151F4B5A5E4BC7FC15FE14014A5A5D4A5A4A5A141F5D4A5A4A
5645 -C8FC5C13F18101F37F13F790B57E14EFECC7F01483EC03F8140101FE7F496C7E5B157F49
5646 -7F82151F82150F826F7EA26F7E1501821500D83FFF903803FFC0486D4813E0B56C5AA26C
5647 -497E6C496C13C02B387FB730>I<383FFFF8487FB57EA26C5B6C5BD801FCC9FCB3B0EE0F
5648 -80EE1FC0A9003FB7FC5AB8FCA27E6C16802A387EB730>I<D83FF8ECFFE0486C4913F048
5649 -6C4913F8A2007F16F06C6C4913E00007160001EF14BFEC800FA39039E7C01F3FA4ECE03F
5650 -01E3133EA2ECF07EA201E1137CA2ECF8FCA201E013F8A214FDEC7DF0A3147FEC3FE0A3EC
5651 -1FC0A2EC070091C7FCADD83FFC903801FFE0486C4913F0B54913F8A26C486D13F06C486D
5652 -13E02D387FB730>I<D83FFC90381FFF80486C4913C0B54913E0A26C6D6C13C06C6E1380
5653 -0003913801F800EBF7C0A3EBF3E0A314F013F1A214F8A213F014FCA2147C147EA2143E14
5654 -3FA2141FA21581A2140F15C1A2140715E1A2140315F1A21401A215F91400A3157DA3153F
5655 -EA3FFF481380B5EAC01FA26CEB800F6C496C5A2B387EB730>I<90383FFFE048B512FC00
5656 -0714FF4815804815C04815E0EBF80001E0133FD87F80EB0FF0A290C71207A44815F84814
5657 -03B3A96C1407A26C15F0A36D130FA26D131F6C6CEB3FE001F813FF90B6FC6C15C06C1580
5658 -6C1500000114FCD8003F13E0253A7BB830>I<007FB512F0B612FE6F7E16E0826C813903
5659 -F8003FED0FFCED03FE15016F7EA2821780163FA6167F17005EA24B5A1503ED0FFCED3FF8
5660 -90B6FC5E5E16804BC7FC15F001F8C9FCB0387FFFC0B57EA46C5B29387EB730>I<90383F
5661 -FFE048B512FC000714FF4815804815C04815E0EBF80001E0133F4848EB1FF049130F90C7
5662 -1207A44815F8481403B3A8147E14FE6CEBFF076C15F0EC7F87A2EC3FC7018013CF9038C0
5663 -1FFFD83FE014E0EBF80F90B6FC6C15C06C15806C1500000114FCD8003F7FEB00016E7EA2
5664 -1680157F16C0153F16E0151F16F0150FED07E025467BB830>I<003FB57E4814F0B612FC
5665 -15FF6C816C812603F8017F9138003FF0151F6F7E15071503821501A515035E1507150F4B
5666 -5A153F4AB45A90B65A5E93C7FC5D8182D9F8007FED3FE0151F150F821507A817F8EEF1FC
5667 -A53A3FFF8003FB4801C0EBFFF8B56C7E17F06C496C13E06C49EB7FC0C9EA1F002E397FB7
5668 -30>I<90390FF803C0D97FFF13E048B512C74814F74814FF5A381FF80F383FE001497E48
5669 -48137F90C7123F5A48141FA2150FA37EED07C06C91C7FC7F7FEA3FF0EA1FFEEBFFF06C13
5670 -FF6C14E0000114F86C80011F13FF01031480D9003F13C014019138007FE0151FED0FF0A2
5671 -ED07F8A2007C140312FEA56C140716F07F6DEB0FE06D131F01F8EB3FC001FF13FF91B512
5672 -80160000FD5CD8FC7F13F8D8F81F5BD878011380253A7BB830>I<003FB712C04816E0B8
5673 -FCA43AFE003F800FA8007CED07C0C791C7FCB3B1011FB5FC4980A46D91C7FC2B387EB730
5674 ->I<3B7FFFC007FFFCB56C4813FEA46C496C13FCD803F8C7EA3F80B3B16D147F00011600
5675 -A36C6C14FE6D13016D5CEC800390393FE00FF890391FF83FF06DB55A6D5C6D5C6D91C7FC
5676 -9038007FFCEC1FF02F3980B730>I<D87FFE90380FFFC0B54913E06E5AA24A7E6C486D13
5677 -C0D807F0903801FC00A26D130300035DA46C6C495AA46C6C495AA46D131F6D5CA3EC803F
5678 -013F5CA46D6C48C7FCA490380FE0FEA401075B14F1A301035BA314FB01015BA314FFA26D
5679 -5BA46E5A6E5A2B397EB730>I<D83FFC903801FFE0486C4913F000FF16F8A2007F16F06C
5680 -486D13E0D81FC09038001FC0000F1680A76D143F00071600A7000390380F803E9039F01F
5681 -C07EEC3FE0A3EC7FF0A2147D0001157CA29039F8FDF8FCA314F8A300005D01F913FCA2EC
5682 -F07CA201FD137DA2017D5CECE03DA3017F133FA2ECC01FA2013F5CA2EC800F6D486C5A2D
5683 -397FB730>I<3A3FFF01FFF84801837F02C77FA202835B6C01015B3A01FC007F806D91C7
5684 -FC00005C6D5BEB7F01EC81FCEB3F8314C3011F5B14E7010F5B14FF6D5BA26D5BA26D5BA2
5685 -6D90C8FCA4497FA2497FA2815B81EB0FE781EB1FC381EB3F8181EB7F0081497F49800001
5686 -143F49800003141F49800007140FD87FFEEB7FFFB590B5128080A25C6C486D130029387D
5687 -B730>I<D87FFF90381FFFC0B56C4813E0A46C496C13C0D803F8903803F8006D1307A26C
5688 -6C495AA26C6C5C151F6D5CEC803F013F5CECC07F011F91C7FCA290380FE0FEA214F10107
5689 -5BA2903803FBF8A201015B14FF6D5BA26E5AA36E5AB1903803FFF8497F497FA26D5B6D5B
5690 -2B387EB730>I<001FB612FC4815FE5AA490C7EA03FCED07F816F0150FED1FE016C0153F
5691 -ED7F80003E1500C85A4A5A5D14034A5A5D140F4A5A5D143F4A5A92C7FC5C495A5C130349
5692 -5A5C130F495A5C133F495A91C8FC5B4848147C4914FE1203485A5B120F485A5B123F485A
5693 -90B6FCB7FCA46C15FC27387CB730>I<007FB5FCB61280A4150048C8FCB3B3B3A5B6FC15
5694 -80A46C140019476DBE30>I<007FB5FCB61280A47EC7123FB3B3B3A5007FB5FCB6FCA46C
5695 -140019477DBE30>93 D<1307EB1FC0EB7FF0497E000313FE000FEBFF80003F14E0D87FFD
5696 -13F039FFF07FF8EBC01FEB800F38FE0003007CEB01F00010EB00401D0E77B730>I<007F
5697 -B612F0A2B712F8A36C15F0A225077B7D30>I<EB3FFC48B57E4814E04880488048809038
5698 -F00FFE9038E001FF806F7E6C48133F6C4880C8121FA491B5FC130F137F48B6FC12075A48
5699 -EBC01F383FFC00EA7FE0138048C7FC5AA46C143FA26C6C137F9038C001FF263FF80FEBFF
5700 -C06CB712E0A2000714F76C14C3C6020013C0D93FF090C7FC2B2A7CA830>97
5701 -D<EA3FFC487E12FFA2127F123F1200AAEC03FE91381FFF80027F13E091B57E90B612FC82
5702 -ECFE079138F001FF4A6C13804A137F4AEB3FC091C7121F4915E0160FA217F01607A8160F
5703 -A217E07F161F6EEB3FC0A26EEB7F806E13FFDAF00313009138FC0FFE91B55A5E495CD97E
5704 -7F13C0D93C1F90C7FC90380003FC2C3980B730>I<ECFFE0010713FC011F7F017F7F90B6
5705 -12804815C048EB807F3907FC003F485A485A49EB1F804848EB0F004990C7FC127F90C9FC
5706 -A25A5AA87E7EA27F003FEC07C06DEB0FE06C7E6D131F6C6C14C0D807FE133F9039FFC0FF
5707 -806C90B5FCC615006D5B011F13F801075B01011380232A7AA830>I<913801FFE04A7F5C
5708 -A28080EC0007AAEB03FE90381FFF874913E790B6FC5A5A481303380FFC00D81FF0133F49
5709 -131F485A150F4848130790C7FCA25AA25AA87E6C140FA27F003F141F6D133F6C7E6D137F
5710 -390FF801FF2607FE07EBFFC06CB712E06C16F06C14F76D01C713E0011F010313C0D907FC
5711 -C8FC2C397DB730>I<49B4FC010713E0011F13F8017F7F90B57E488048018113803A07FC
5712 -007FC04848133FD81FE0EB1FE0150F484814F0491307127F90C7FCED03F85A5AB7FCA516
5713 -F048C9FC7E7EA27F003FEC01F06DEB03F86C7E6C7E6D1307D807FEEB1FF03A03FFC07FE0
5714 -6C90B5FC6C15C0013F14806DEBFE00010713F8010013C0252A7CA830>I<EDFF80020713
5715 -E0021F13F05C4A13F891B5FC491387903803FE079138FC03F0903907F800C04A1300A800
5716 -3FB612C04815E0B7FCA36C15C0260007F0C7FCB3A9003FB512FE4880B71280A26C15006C
5717 -5C25397DB830>I<D903FC13FF90261FFF8713C04913DF90B712E05A5A2607FE07138F90
5718 -3AF801FE07C048486C6CC7FCA2497F001F8149133FA56D137F000F92C7FC6D5BA26C6C48
5719 -5AEBFE0790B55A5D485C15C001DF5BD9C3FCC8FC01C0C9FCA37F7F6CB512F015FF6C15C0
5720 -4815F0488148813A3FE0001FFE0180130148C8127F007E8100FE168048151FA56C153F00
5721 -7FED7F006D5C6C6C495A01F013076CB4EB7FFC6C90B55A6C5D000115C06C6C91C7FC011F
5722 -13FC010113C02B3E7DA730>I<EA3FFC487E12FFA2127F123F1200AAEC01FE91380FFF80
5723 -023F13E091B57E90B67EA29138FE07FCECF8039138E001FE14C0EC8000A291C7FCA25BB3
5724 -A23B3FFFF81FFFF8486D4813FCB500FE14FEA26C01FC14FC6C496C13F82F3880B730>I<
5725 -14E0EB03F8A2497EA36D5AA2EB00E091C8FCA9381FFFF8487F5AA27E7EEA0001B3A9003F
5726 -B612C04815E0B7FCA27E6C15C023397AB830>I<EC01C0EC07F0A2EC0FF8A3EC07F0A2EC
5727 -01C091C7FCA990B512F04814F8A47EEB0003B3B3A5EC07F0A2123C007EEB0FE0B4131FEC
5728 -3FC0147F90B512806C14005C6C5B000F13F0000313C01D4E7CB830>I<EA7FF8487EA412
5729 -7F1200AB0203B512804A14C017E0A217C06E14809139001FE0004B5A4B5A4BC7FC4A5A4A
5730 -5AEC0FF84A5A4A5A4A5A4A5A01FD7F90B57E8114F7ECE3F8ECC1FCEC81FEEC00FF497F49
5731 -6D7E6F7E826F7E15076F7E6F7E3B7FFFF81FFFE0B56C4813F017F8A217F06C496C13E02D
5732 -387FB730>I<387FFFF8B57EA47EEA0001B3B3A8007FB612F0B712F8A46C15F025387BB7
5733 -30>I<02FC137E3B7FC3FF01FF80D8FFEF01877F90B500CF7F15DF92B57E6C010F138726
5734 -07FE07EB03F801FC13FE9039F803FC01A201F013F8A301E013F0B3A23C7FFE0FFF07FF80
5735 -B548018F13C0A46C486C01071380322881A730>I<EC01FE3A3FFC0FFF80267FFE3F13E0
5736 -00FF90B57E90B67E7E6C9038FE07FCC6EBF8039138E001FE14C0EC8000A291C7FCA25BB3
5737 -A23B3FFFF81FFFF8486D4813FCB500FE14FEA26C01FC14FC6C496C13F82F2880A730>I<
5738 -49B4FC010F13E0013F13F8497F90B57E0003ECFF8014013A07FC007FC04848EB3FE0D81F
5739 -E0EB0FF0A24848EB07F8491303007F15FC90C71201A300FEEC00FEA86C14016C15FCA26D
5740 -1303003F15F86D13076D130F6C6CEB1FF06C6CEB3FE06D137F3A07FF01FFC06C90B51280
5741 -6C15006C6C13FC6D5B010F13E0010190C7FC272A7CA830>I<EC03FE3A3FFC1FFF80267F
5742 -FE7F13E000FF90B57E90B612FC6C816CEBFE07C69038F001FF4A6C13804A137F4AEB3FC0
5743 -91C7121F4915E0160FA217F01607A8160FA217E07F161F6EEB3FC0A26EEB7F806E13FFDA
5744 -F00313009138FC0FFE91B55A5E495C6E13C0021F90C7FCEC03FC91C9FCAD383FFFF8487F
5745 -B57EA26C5B6C5B2C3C80A730>I<49B413F8010FEBC1FC013F13F14913FD48B6FC5A4813
5746 -81390FFC007F49131F4848130F491307485A491303127F90C7FC15015A5AA77E7E15037F
5747 -A26C6C1307150F6C6C131F6C6C133F01FC137F3907FF01FF6C90B5FC6C14FD6C14F9013F
5748 -13F1010F13C1903803FE0190C7FCAD92B512F84A14FCA46E14F82E3C7DA730>I<ED07F8
5749 -3A3FFF803FFF486DB51280B512C302CF14C06C13DF6C9038FFFC3FD8001F13E09238801F
5750 -809238000F004A90C7FC5C5C5CA25CA45CAF003FB512FC4880B7FCA26C5C6C5C2A287EA7
5751 -30>I<90381FFC1E48B5129F000714FF5A5A5A387FF007EB800100FEC7FC4880A46C143E
5752 -007F91C7FC13E06CB4FC6C13FC6CEBFF806C14E0000114F86C6C7F01037F9038000FFF02
5753 -001380007C147F00FEEC1FC0A2150F7EA27F151F6DEB3F806D137F9039FC03FF0090B6FC
5754 -5D5D00FC14F0D8F83F13C026780FFEC7FC222A79A830>I<EB0780497E131FA9003FB612
5755 -E04815F0B7FCA36C15E026001FC0C7FCB216F8ED01FCA5ECE003010FEB07F814F09138FC
5756 -1FF06DB512E06D14C016806D14009038007FFCEC1FF026337EB130>I<D83FFCEB3FFC48
5757 -6C497E00FF14FFA2007F147F003F143F00001400B3A41501A2150315076D130F903A7FC0
5758 -7FFFF891B612FC6D15FE7F6D4913FC6D9038F87FF8010001C0C7FC2F2880A630>I<3B3F
5759 -FFC07FFF80486DB512C0B515E0A26C16C06C496C13803B01F80003F000A26D130700005D
5760 -A26D130F017E5CA2017F131F6D5CA2EC803F011F91C7FCA26E5A010F137EA2ECE0FE0107
5761 -5BA214F101035BA3903801FBF0A314FF6D5BA36E5A6E5A2B277EA630>I<3B3FFFC01FFF
5762 -E0486D4813F0B515F8A26C16F06C496C13E0D807E0C7EA3F00A26D5C0003157EA56D14FE
5763 -00015DEC0F80EC1FC0EC3FE0A33A00FC7FF1F8A2147DA2ECFDF9017C5C14F8A3017E13FB
5764 -A290393FF07FE0A3ECE03FA2011F5C90390F800F802D277FA630>I<3A3FFF81FFFC4801
5765 -C37FB580A26C5D6C01815BC648C66CC7FC137FEC80FE90383F81FC90381FC3F8EB0FE3EC
5766 -E7F06DB45A6D5B7F6D5B92C8FC147E147F5C497F81903803F7E0EB07E790380FE3F0ECC1
5767 -F890381F81FC90383F80FE90387F007E017E137F01FE6D7E48486D7E267FFF80B5FCB500
5768 -C1148014E3A214C16C0180140029277DA630>I<3B3FFFC07FFF80486DB512C0B515E0A2
5769 -6C16C06C496C13803B01FC0003F000A2000014076D5C137E150F017F5C7F151FD91F805B
5770 -A214C0010F49C7FCA214E00107137EA2EB03F0157C15FCEB01F85DA2EB00F9ECFDF0147D
5771 -147FA26E5AA36E5AA35DA2143F92C8FCA25C147EA2000F13FE486C5AEA3FC1EBC3F81387
5772 -EB8FF0EBFFE06C5B5C6C90C9FC6C5AEA01F02B3C7EA630>I<001FB612FC4815FE5AA316
5773 -FC90C7EA0FF8ED1FF0ED3FE0ED7FC0EDFF80003E491300C7485A4A5A4A5A4A5A4A5A4A5A
5774 -4A5A4990C7FC495A495A495A495A495A495A4948133E4890C7127F485A485A485A485A48
5775 -5A48B7FCB8FCA46C15FE28277DA630>I<ED3FF0913803FFF8140F5C147F16F09138FFF0
5776 -0092C7FC495A5CB3A21303495A133F383FFFF0B55A5C91C8FC14C080003F7F38003FF813
5777 -076D7E1301B3A2806D7E15F091387FFFF016F8141F8014039138003FF025477BBE30>I<
5778 -127CA212FEB3B3B3AD127CA207476CBE30>I<EA7FE0EAFFFE6D7E8014F07EC66C7E1307
5779 -6D7E1301B3A2806D7E15E091387FFFE06E13F8801407141F5C4A13E09138FFE00092C7FC
5780 -495A5CB3A21303495A137F387FFFF0B5FC14C05C49C8FCEA7FE025477BBE30>I<017C13
5781 -3848B4137C48EB80FE4813C14813C348EBEFFC397FEFFFF0D8FF8713E0010713C0486C13
5782 -80D87C0113003838007C1F0C78B730>I E
5783 -%EndDVIPSBitmapFont
5784 -%DVIPSBitmapFont: Fk cmbx12 14.4 49
5785 -/Fk 49 122 df<EEFFFC031FEBFF804AB612E0020781021F9038C00FF8913A7FFE0003FC
5786 -DAFFF0EB00FE4949EB03FF4901805B4990C7487F49485CA2495A4D7F013F6F5B5CA37190
5787 -C7FC715AEF01F894C9FCA90403B512C0BAFCA526003FFCC7120783B3B3A6003FB5D8FC03
5788 -B612C0A542547DD34B>12 D<B712F0AB240B7F9F2D>45 D<EA07F0487E487E487E487EB5
5789 -1280A76C13006C5A6C5A6C5A6C5A1111769025>I<157815FC14031407141F14FF130F00
5790 -07B5FCB6FCA2147F13F0EAF800C7FCB3B3B3A6007FB712FEA52F4E76CD43>49
5791 -D<EC3FFE0103B512E0010F14FC013F14FF90B712C048D9C07F7F2703FE000F13F8D807F8
5792 -01037FD80FE06D7F48486D7F48488001F01680486C6E13C07F486C6E13E07FA27013F0A5
5793 -6C5AA26C5AEA0FF0EA03C0C914E05EA218C05E1880A24C13005F4C5A4B5B5F4B5B5F4B5B
5794 -4B90C7FC4B5A5E4B5AED7FE04B5A4A5B4A48C8FC4A5A5D4A48EB01F04A5AEC3F804AC7FC
5795 -02FEEC03E0495A495A495A495AD91F80140749C8FC013E150F017FB7FC90B812C05A5A5A
5796 -5A5A5A5AB9FC1880A4344E79CD43>I<91380FFFC091B512FC0107ECFF80011F15E09026
5797 -3FF8077F9026FF800113FC4848C76C7ED803F86E7E491680D807FC8048B416C080486D15
5798 -E0A4805CA36C17C06C5B6C90C75AD801FC1680C9FC4C13005FA24C5A4B5B4B5B4B13C04B
5799 -5BDBFFFEC7FC91B512F816E016FCEEFF80DA000713E0030113F89238007FFE707E701380
5800 -7013C018E07013F0A218F8A27013FCA218FEA2EA03E0EA0FF8487E487E487EB57EA318FC
5801 -A25E18F891C7FC6C17F0495C6C4816E001F04A13C06C484A1380D80FF84A13006CB44A5A
5802 -6CD9F0075BC690B612F06D5D011F1580010302FCC7FCD9001F1380374F7ACD43>I<177C
5803 -17FEA2160116031607160FA2161F163F167FA216FF5D5DA25D5DED1FBFED3F3F153E157C
5804 -15FCEC01F815F0EC03E01407EC0FC01580EC1F005C147E147C5C1301495A495A5C495A13
5805 -1F49C7FC133E5B13FC485A5B485A1207485A485A90C8FC123E127E5ABA12C0A5C96C48C7
5806 -FCAF020FB712C0A53A4F7CCE43>I<D80380150ED807E0157E01FEEC03FED9FFF0137F91
5807 -B65A5F5F5F5F5F94C7FC5E5E16F016C093C8FC15F801E190C9FC01E0CAFCABEC0FFF027F
5808 -13F001E3B512FE01E76E7E9026FFF8077FDAC0017F49C713F8496E7E49143F4981496E7E
5809 -6C481680C9FC18C08218E0A418F0A3EA0FE0487E487E487E487EA418E0A35B6C484A13C0
5810 -5B491680003EC85A003F17006C6C4A5A6D5D6C6C4A5AD807F8495BD803FE01075B2701FF
5811 -C03F5B6C90B65A013F4AC7FC6D14F8010314C09026007FF8C8FC344F79CD43>I<ED0FFF
5812 -92B512E0020780021F14FC91397FFE03FE903A01FFF0007F4901C0EB3F804990C7121F49
5813 -48EC7FC0494814FF49484913E049485B01FF5C485BA2485B5AA2486F13C04A6D1380486F
5814 -1300177E94C7FC5AA291CAFC5AA21508913801FFF8020713FFB54814C04A14F04AC66C7E
5815 -023C6D7E4A6D7E4A6D7E7013804A15C0A24A15E07013F05C18F8A491C714FCA37EA67EA4
5816 -6C17F880A27E18F06C5D18E06C6D15C07E6E4913806C6D15006D6C495A6D6CEB7FFC6DB4
5817 -48485A6D90B55A010315C0010092C7FC023F13FC020713C0364F7ACD43>I<121F7F7FEB
5818 -FF8091B81280A45A1900606060A2606060485F0180C86CC7FC007EC95A4C5A007C4B5A5F
5819 -4C5A160F4C5A484B5A4C5A94C8FC16FEC812014B5A5E4B5A150F4B5AA24B5AA24B5A15FF
5820 -A24A90C9FCA25C5D1407A2140FA25D141FA2143FA4147F5DA314FFA55BAC6D5BA2EC3FC0
5821 -6E5A395279D043>I<913807FFC0027F13FC0103B67E010F15E090261FFC0113F8903A3F
5822 -E0003FFCD97F80EB0FFE49C76C7E48488048486E1380000717C04980120F18E0177FA212
5823 -1F7FA27F7F6E14FF02E015C014F802FE4913806C7FDBC00313009238F007FE6C02F85B92
5824 -38FE1FF86C9138FFBFF06CEDFFE017806C4BC7FC6D806D81010F15E06D81010115FC0107
5825 -81011F81491680EBFFE748018115C048D9007F14E04848011F14F048487F484813030300
5826 -14F8484880161F4848020713FC1601824848157F173FA2171FA2170FA218F8A27F007F17
5827 -F06D151FA26C6CED3FE0001F17C06D157F6C6CEDFF806C6C6C010313006C01E0EB0FFE6C
5828 -01FCEBFFFC6C6CB612F06D5D010F1580010102FCC7FCD9000F13C0364F7ACD43>I<9138
5829 -0FFF8091B512F8010314FE010F6E7E4901037F90267FF8007F4948EB3FF048496D7E4849
5830 -80486F7E484980824817805A91C714C05A7013E0A218F0B5FCA318F8A618FCA46C5DA37E
5831 -A25E6C7F6C5DA26C5D6C7F6C6D137B6C6D13F390387FF803011FB512E36D14C301030283
5832 -13F89039007FFE03EC00401500A218F05EA3D801F816E0487E486C16C0487E486D491380
5833 -A218005E5F4C5A91C7FC6C484A5A494A5A49495B6C48495BD803FC010F5B9027FF807FFE
5834 -C7FC6C90B55A6C6C14F06D14C0010F49C8FC010013F0364F7ACD43>I<91B5FC010F14F8
5835 -017F14FF90B712C00003D9C00F7F2707FC00017FD80FE06D7F48486E7E48C87FD87FE06E
5836 -7E7F7F486C1680A66C5A18006C485C6C5AC9485A5F4B5B4B5B4B5B4B5B4B90C7FC16FC4B
5837 -5A4B5A16C04B5A93C8FC4A5A5D14035D5D14075DA25D140FA25DAB91CAFCAAEC1FC04A7E
5838 -ECFFF8497FA2497FA76D5BA26D5BEC3FE06E5A315479D340>63 D<BA7E19FCF1FF801AF0
5839 -1AFCD8000701F0C7000F13FF060014C0071F7F070713F807017F737F747E747F747F8674
5840 -7F747F8886888688A2757EA31D8087A21DC0A51DE0A387A963A31DC0A51D80A2631D00A3
5841 -515AA2646264505B6264505B505B5090C7FCF2FFFE4F5B07075B071F5B96B512C0060F91
5842 -C8FCBB5A1AF01AC007FCC9FC19805B527CD167>68 D<BC1280A5D8000701F8C7000114C0
5843 -F0001F19071901851A7F1A3F1A1FA2F20FE0A21A07A31A03A318F81BF01A01A497C7FC17
5844 -01A317031707170F177F92B6FCA59238F8007F170F170717031701A317001B3EA31B7CA3
5845 -95C8FCA21BFCA21BF8A21A01A31A031BF01A071A0FA21A1F1A3FF27FE0F101FF1907191F
5846 -0603B5FCBCFCA21BC0A34F517CD058>I<BB12FEA5D8000701F8C700077FF0007F191F19
5847 -0785858586861B80A21A1FA31A0FA41BC006F81307A497C7FCA31701A317031707170F17
5848 -7F92B6FCA59238F8007F170F170717031701A31700A795C9FCB3B812F8A54A517CD055>
5849 -I<B8D8C003B8FCA5D8000701F8C9001FEBE000B3AE92BAFCA503F8C9121FB3B1B8D8C003
5850 -B8FCA560527CD169>72 D<B812C0A5D8000701F8C7FCB3B3B3B2B812C0A52A527CD132>
5851 -I<027FB71280A591C76C90C7FCB3B3B3EA07F0EA1FFC487E487EA2B57EA44C5AA34A485B
5852 -7E49495BD83FF8495BD81FE05DD80FFC011F5B2707FF807F90C8FC000190B512FC6C6C14
5853 -F0011F14C0010101F8C9FC39537DD145>I<B812F8A5D8000701F8CAFCB3B3A91A7CA41A
5854 -FC1AF8A51901A31903A219071AF0190FA2191F193F197F19FF180360183F4DB5FCBB12E0
5855 -A546527CD151>76 D<B600FC073FB512FE6F61A26F96B6FCA2D80007F5C00070EF01EFA2
5856 -02EF6DEF03CFA202E76DEF078FA202E36DEF0F0FA202E16D171EA302E06D173CA26F6C17
5857 -78A26F6C17F0A26F6DED01E0A26F6DED03C0A36F6DED0780A26F6DED0F00A26F6D151EA2
5858 -6F6D5DA3706C5DA2706C5DA2706D495AA2706D495AA2706D495AA3706D49C7FCA2706D13
5859 -1EA2706D5BA2716C5BA3716C5BA271EB81E0A271EBC3C0A271EBE780A27101FFC8FCA371
5860 -5BA2715BA2725AA2725AA2D93FFC6F5AB74DB712FEA2725AA2725A77527CD180>I<BAFC
5861 -19F819FF1AE086D8000701F0C7001F13FC060113FF726C13807313C0070F13E01BF08573
5862 -13F81BFCA27313FEA41BFFA81BFEA31BFC61A21BF84F13F04F13E0614F13C04F13004E48
5863 -5A061F5B92B812F01AC04FC7FC19E003F8CBFCB3AEB812C0A550527CD15C>80
5864 -D<B912F0F0FF8019F819FF1AC0D8000701F0C714F0060F7F060113FE727F737F737F8573
5865 -7F87A2737FA387A863A2616363A24F5B4F5B4F90C8FC4F5A06035B060F13F095B512C092
5866 -B8C9FC19F819E019F89226F0000313FE9439007FFF80727F727F727F727F727F8684A286
5867 -84A787A71D1C75133EA38575137E73157C7513FC731401B86C6D9038F803F807039038FE
5868 -07F07390B512E0736C14C0080F1400CEEA7FFC5F537CD164>82 D<91260FFF80130791B5
5869 -00F85B010702FF5B011FEDC03F49EDF07F9026FFFC006D5A4801E0EB0FFD4801800101B5
5870 -FC4848C87E48488149150F001F824981123F4981007F82A28412FF84A27FA26D82A27F7F
5871 -6D93C7FC14C06C13F014FF15F86CECFF8016FC6CEDFFC017F06C16FC6C16FF6C17C06C83
5872 -6C836D826D82010F821303010082021F16801400030F15C0ED007F040714E01600173F05
5873 -0F13F08383A200788200F882A3187FA27EA219E07EA26CEFFFC0A27F6D4B13806D17006D
5874 -5D01FC4B5A01FF4B5A02C04A5A02F8EC7FF0903B1FFFC003FFE0486C90B65AD8FC0393C7
5875 -FC48C66C14FC48010F14F048D9007F90C8FC3C5479D24B>I<003FBC1280A59126C0003F
5876 -9038C0007F49C71607D87FF8060113C001E08449197F49193F90C8171FA2007E1A0FA300
5877 -7C1A07A500FC1BE0481A03A6C994C7FCB3B3AC91B912F0A553517BD05E>I<B800C00103
5878 -B612FCA5D8000701F8CAEBF000F31F80B3B3B11B3FA26D97C7FC81637F1B7E6D6D17FE50
5879 -5A6E7E505A6E6D15076E4D5A6E6D4B5A6E6D4B5A6E01F84B5A6E6DDA03FFC8FC6E6CB46C
5880 -EB0FFE6F9039F001FFF8030F90B65A030316C0DB007F92C9FC040F14F8DC007F13805E53
5881 -7CD167>I<B700FC017FB600FE91B612F0A5D8003F01C0C8001F01E0C9EBF8006F71EE0F
5882 -C06D7161876F1C1F6D7196C7FC6F8373606D1E3E6F836D7160876F1CFC6D666F4B801F01
5883 -6D66704A806E525A88704A17076E059F5F70021F80080F160F6E6570023F806EDC3E074C
5884 -C8FC8870027E5F6EDC7C03163E7002FC804F6C167E6E1C7C700101814F6C16FC6E745B70
5885 -010317016E4C6D5D060716C00580496D14036F63DDC00F16E04F6D14076F07F05BDDE01F
5886 -170F6F92C76C5D1DF8DDF03E6E141F6F98C9FCDDF87E16FC067C6E5C6FF1FE3EDDFCFC17
5887 -7E6F4A6E147C1DFFDDFFF06E14FC6F62A24E816F62A270496F5BA24E817061A295C97E70
5888 -61A270487090CAFCA37048705AA24D1601040360A27048705A84537DD18B>87
5889 -D<EC7FFF0107B512F0013F14FE90B77E48D9E00F7F2703FE000113F0486C6D7F6EEB3FFC
5890 -48826E131F83707FA36C496D7FA26C90C7FC6C5AC9FCA6037FB5FC020FB6FC91B7FC0107
5891 -1487013FEBF0074913803901FFFC004813F0485B485B485B4890C7FC5A5BA2485AA45EA2
5892 -6D5C007F151D163D6C6C02797F6C6D01F113F86C9026C003E1EBFFE06C9026F81FC014F0
5893 -6C90B5487EC6ED001F011F01FC010713E0010101E090C8FC3C387CB641>97
5894 -D<EB3FF0B5FCA51203C6FCB3A4923801FFE0030F13FE033FEBFFC092B612F002F301017F
5895 -913AF7F8003FFEDAFFE0EB0FFF03806D7F92C76C7F4A6E7F4A824A6E7FA2727EA285A285
5896 -84A31A80AC1A00A44E5AA36118FF616E4A5BA26E4A5B6E4A5B6F495BDACFC04990C7FCDA
5897 -87F0EB7FFC913A03FE03FFF849C6B612E0496D148049011F01FCC8FC90C7000313C04154
5898 -7BD24B>I<913801FFF8021FEBFF8091B612F0010315FC010F9038C00FFE903A1FFE0001
5899 -FFD97FFC491380D9FFF05B4817C048495B5C5A485BA2486F138091C7FC486F1300705A48
5900 -92C8FC5BA312FFAD127F7FA27EA2EF03E06C7F17076C6D15C07E6E140F6CEE1F806C6DEC
5901 -3F006C6D147ED97FFE5C6D6CEB03F8010F9038E01FF0010390B55A01001580023F49C7FC
5902 -020113E033387CB63C>I<4DB47E0407B5FCA5EE001F1707B3A4913801FFE0021F13FC91
5903 -B6FC010315C7010F9038E03FE74990380007F7D97FFC0101B5FC49487F4849143F484980
5904 -485B83485B5A91C8FC5AA3485AA412FFAC127FA36C7EA37EA26C7F5F6C6D5C7E6C6D5C6C
5905 -6D49B5FC6D6C4914E0D93FFED90FEFEBFF80903A0FFFC07FCF6D90B5128F0101ECFE0FD9
5906 -003F13F8020301C049C7FC41547CD24B>I<913803FFC0023F13FC49B6FC010715C04901
5907 -817F903A3FFC007FF849486D7E49486D7E4849130F48496D7E48178048497F18C0488191
5908 -C7FC4817E0A248815B18F0A212FFA490B8FCA318E049CAFCA6127FA27F7EA218E06CEE01
5909 -F06E14037E6C6DEC07E0A26C6DEC0FC06C6D141F6C6DEC3F806D6CECFF00D91FFEEB03FE
5910 -903A0FFFC03FF8010390B55A010015C0021F49C7FC020113F034387CB63D>I<ED3FFC02
5911 -03B5FC020F14C0023F14E09139FFF81FF0499038C03FF849EB807F49903800FFFC495A49
5912 -5AA2495AA2EE7FF8495AEE3FF0EE0FC093C7FCAEB712E0A526007FF8C8FCB3B3A7007FB5
5913 -12FEA52E547CD329>I<DA3FFF14FF0103B5D8F00713C0010FDAFC1F13E0013FECFF7F90
5914 -267FFC0F9038FF9FF09026FFE001EBF83F48496C13E0484990387FF01F4890C7D83FF813
5915 -E0489338FC0FC0F0078048486E6CC7FCA2003F82A9001F5EA26C6C4A5AA26C5E6C6D495A
5916 -6C6D495A6C6D485BDAFC0F5B4890B6C8FCD803EF14FC01C314F02607C03F90C9FC91CBFC
5917 -A2120FA37FA213F813FE90B7FC6C16F817FF18C06C836C836C836D828448B9FC12074848
5918 -C700031480D81FF8EC003F4848150748486F13C083485A83A56D5D007F18806D5D003F18
5919 -006C6C4B5AD80FFEED1FFC6C6C6CEC7FF86C01E049485A6C01FE011F5B6C6CB71280010F
5920 -03FCC7FC010115E0D9000F01FCC8FC3C4F7CB543>I<EB3FF0B5FCA51203C6FCB3A4EE1F
5921 -FC93B512C0030314F0030F8092391FE07FFC92393F001FFE037C8003F07FDAF1E081ECF3
5922 -C0DAF7807F8502FFC7FC5CA25CA45CB3ACB6D8F807B612C0A542537BD24B>I<137F497E
5923 -000313E0487FA2487FA76C5BA26C5BC613806DC7FC90C8FCADEB3FF0B5FCA512017EB3B3
5924 -A6B612E0A51B547BD325>I<EB3FF0B5FCA51203C6FCB3A54CB512F8A59339003FFE00EF
5925 -1FF0EF3FC04D5A4DC7FCEE03FEEE07F84C5A4C5AEE7FC04CC8FC4B5A4B5AED0FF8ED1FE0
5926 -4B7E4B7EECF1FF02F37F02F77F91B6FC83159F030F7F02FE80DAF8077F4A7E6F7F6F7F83
5927 -707E82707F84707F707F82707F84707F177F717E4D13C0B6D8F003B6FCA540537CD247>
5928 -107 D<EB3FF0B5FCA512017EB3B3B3B1B612F0A51C537BD225>I<D93FF0D91FFCEDFFE0
5929 -B591B500C0010713FE030302F0011F6D7E030F6E017F8092271FE07FFCD9FF037F922A3F
5930 -001FFE01F8007F0003027C9126FF03E080C602F06DD90780137FDAF1E0038FC77FDAF3C0
5931 -159EDAF7806D01BC143F07FC8102FFC75C4A5EA24A5EA44A5EB3ACB6D8F807B6D8C03FB5
5932 -12FEA567367BB570>I<D93FF0EB1FFCB591B512C0030314F0030F8092391FE07FFC9239
5933 -3F001FFE0003027C80C602F07FDAF1E081ECF3C0DAF7807F8502FFC7FC5CA25CA45CB3AC
5934 -B6D8F807B612C0A542367BB54B>I<913801FFE0021F13FE91B612C0010315F0010F9038
5935 -807FFC903A1FFC000FFED97FF86D6C7E49486D7F48496D7F48496D7F4A147F48834890C8
5936 -6C7EA24883A248486F7EA3007F1880A400FF18C0AC007F1880A3003F18006D5DA26C5FA2
5937 -6C5F6E147F6C5F6C6D4A5A6C6D495B6C6D495B6D6C495BD93FFE011F90C7FC903A0FFF80
5938 -7FFC6D90B55A010015C0023F91C8FC020113E03A387CB643>I<903A3FF001FFE0B5010F
5939 -13FE033FEBFFC092B612F002F301017F913AF7F8007FFE0003D9FFE0EB1FFFC602806D7F
5940 -92C76C7F4A824A6E7F4A6E7FA2717FA285187F85A4721380AC1A0060A36118FFA2615F61
5941 -6E4A5BA26E4A5B6E4A5B6F495B6F4990C7FC03F0EBFFFC9126FBFE075B02F8B612E06F14
5942 -80031F01FCC8FC030313C092CBFCB1B612F8A5414D7BB54B>I<90397FE003FEB590380F
5943 -FF80033F13E04B13F09238FE1FF89139E1F83FFC0003D9E3E013FEC6ECC07FECE78014EF
5944 -150014EE02FEEB3FFC5CEE1FF8EE0FF04A90C7FCA55CB3AAB612FCA52F367CB537>114
5945 -D<903903FFF00F013FEBFE1F90B7FC120348EB003FD80FF81307D81FE0130148487F4980
5946 -127F90C87EA24881A27FA27F01F091C7FC13FCEBFFC06C13FF15F86C14FF16C06C15F06C
5947 -816C816C81C681013F1580010F15C01300020714E0EC003F030713F015010078EC007F00
5948 -F8153F161F7E160FA27E17E07E6D141F17C07F6DEC3F8001F8EC7F0001FEEB01FE9039FF
5949 -C00FFC6DB55AD8FC1F14E0D8F807148048C601F8C7FC2C387CB635>I<143EA6147EA414
5950 -FEA21301A313031307A2130F131F133F13FF5A000F90B6FCB8FCA426003FFEC8FCB3A9EE
5951 -07C0AB011FEC0F8080A26DEC1F0015806DEBC03E6DEBF0FC6DEBFFF86D6C5B021F5B0203
5952 -13802A4D7ECB34>I<D93FF8913801FFC0B50207B5FCA50003ED001FC61607B3AE5FA35F
5953 -A2017F5D173B177B6D6C14F3DC01E313F06D6CD907C3EBFFC0903A0FFFC03F836D90B512
5954 -03010114FE6D6C13F8020701E091C7FC42377BB54B>I<B600F00107B5FCA5000101F8C8
5955 -EA7FE06C6DED3F00A2017F163E6E157E013F167C6E15FC6D5E6F13016D5E8117036D5E6F
5956 -13076D5E6F130F6D5E6F131F6D93C7FC815F6E6C133E177E023F147C6F13FC6E5C16816E
5957 -5C16C3A26EEBE3E016E76E5C16FF6E5CA26E91C8FCA26F5AA36F5AA26F5AA26F5AA26F5A
5958 -6F5A40367DB447>I<B6D8E07FB5D8C003B512C0A5000101F0C701F0C7381FF8006E027F
5959 -ED07E06C715DA26E023F150F017F705DA26E181F013F4B6C92C7FC6E606D70143E94B5FC
5960 -6F177E6D4A6E137C03C001F315FC6D715B160303E001E114016D020702E05B03F013C06D
5961 -71485A160F03F8D9807F13076D05F85B93381F003F03FC160F027F4902FC5BDBFE3E011F
5962 -131F023F04FE90C8FC167EDBFF7C010F5B6E01FCECFF3E4C6D137E6E5FA24C7F6E5F4C7F
5963 -6E5FA24C7F6E5F4C147FA26E5F93C8123F6F5EA2033E6FC9FC5A367DB461>I<B600F001
5964 -07B5FCA5C601F8C8EA7FE06EED3F00A26D6C153E187E013F167C6E15FC6D5E6F13016D5E
5965 -6F13036D5E8117076D6D5C170F6D6D5C171F6D93C7FC6F5B027F143E6F137E023F147C6F
5966 -13FCA26E6D5A16816EEBC1F016C36E5C16E76E5C16FF6E5CA26E91C8FCA36F5AA26F5AA2
5967 -6F5AA26F5AA26F5AA35E150F5E151F93C9FC5DD81FC0133E486C137E486C137C486C13FC
5968 -5D14015D14034A5A6C48485A49485A263FC07FCAFCEB81FE6CB45A6C13F000035BC690CB
5969 -FC404D7DB447>121 D E
5970 -%EndDVIPSBitmapFont
5971 -%DVIPSBitmapFont: Fl cmr10 10.95 86
5972 -/Fl 86 124 df<4AB4EB0FE0021F9038E03FFC913A7F00F8FC1ED901FC90383FF03FD907
5973 -F090397FE07F80494801FF13FF4948485BD93F805C137F0200ED7F00EF003E01FE6D91C7
5974 -FC82ADB97EA3C648C76CC8FCB3AE486C4A7E007FD9FC3FEBFF80A339407FBF35>11
5975 -D<4AB4FC021F13C091387F01F0903901FC0078D907F0131C4948133E494813FF49485A13
5976 -7F1400A213FE6F5A163893C7FCAA167FB8FCA33900FE00018182B3AC486CECFF80007FD9
5977 -FC3F13FEA32F407FBF33>I<4AB47E021F13F791387F00FFEB01F8903807F001EB0FE0EB
5978 -1FC0EB3F80137F14008101FE80AEB8FCA3C648C77EB3AE486CECFF80007FD9FC3F13FEA3
5979 -2F407FBF33>I<4AB4ECFF80021FD9C00F13E0913B7F01F03F80F8903C01F80078FE003C
5980 -D907F0D93FF8130E49484948131F49484948EB7F804948484913FF137F02005CA201FE92
5981 -C7FC6FED7F0070141C96C7FCAAF13F80BBFCA3C648C76CC7FC197F193FB3AC486C4A6CEB
5982 -7FC0007FD9FC3FD9FE1FB5FCA348407FBF4C>I<121EEA7F80EAFFC0A9EA7F80ACEA3F00
5983 -AC121EAB120CC7FCA8121EEA7F80A2EAFFC0A4EA7F80A2EA1E000A4179C019>33
5984 -D<001E130F397F803FC000FF137F01C013E0A201E013F0A3007F133F391E600F30000013
5985 -00A401E01370491360A3000114E04913C00003130101001380481303000EEB070048130E
5986 -0018130C0038131C003013181C1C7DBE2D>I<013F4C7ED9FFC04B7E2601E0E015072607
5987 -C070150F48486C4B5A023E4BC7FC48486C5D48D90FC0EB01FE003ED90EF0EB07FCDA0F3F
5988 -133E007E903A070FFFF8F8007C0200EBC1F0EE000300FC6D6C495A604D5A171F95C8FC17
5989 -3E177E177C5F16015F007C4948485A1607007E5E003E49495A020E131F003F93C9FC6C49
5990 -133E260F803C137E0238137C6C6C485B3901E0E0016CB448485AD93F0049133F90C74848
5991 -EBFFC0030F903801E0E093398007C0704B4848487E4B153C033E90381F001C4B497F03FC
5992 -133E4B150F4A48017E7F0203147C5D4A4801FCEB0380140F5D4AC7FC5C143E5C14FC5C49
5993 -5A13034948027CEB07005C4948147E011F033E5B91C8140E013E153F017E6F5B017C9238
5994 -0F803C4917380001706C5A49923801E0E0496FB45A6C48043FC7FC41497BC34C>37
5995 -D<EC0FC0EC3FF0ECF878903801F01CEB03E049487E130FEC800F011F7FA2EB3F00A5EC80
5996 -0EA25DA25DA25D6D6C5AECC1C0A2ECC38002E7C7387FFFFCEB0FEE14FC4A020713C06D48
5997 -913801FE006E5DEF00F06D7E4D5A496C5D010F1503D91DFF4A5A013893C7FC496C6C5B01
5998 -E0150E48486C6C131E00036E131C2607801F143C000F6E5B001F6D6C1370263F000714F0
5999 -6F485A48D903FE5B913801FF03486D495A0487C8FCED7FCFED3FFE6F4814386D6D5AA200
6000 -7F6E6C14786D6D6C14704B6C14F06C6C496C6C13E0001F91393E3FC0016C6C903AFC1FF0
6001 -03C03D07FC07F007FC1F800001B5D8C001B512006C6C90C7EA7FFCD90FF8EC0FF03E437C
6002 -C047>I<121EEA7F8012FF13C0A213E0A3127FEA1E601200A413E013C0A3120113801203
6003 -13005A120E5A1218123812300B1C79BE19>I<1430147014E0EB01C0EB03801307EB0F00
6004 -131E133E133C5B13F85B12015B1203A2485AA2120F5BA2121F90C7FCA25AA3123E127EA6
6005 -127C12FCB2127C127EA6123E123FA37EA27F120FA27F1207A26C7EA212017F12007F1378
6006 -7F133E131E7FEB07801303EB01C0EB00E014701430145A77C323>I<12C07E12707E7E12
6007 -1E7E6C7E7F12036C7E7F12007F1378137CA27FA2133F7FA21480130FA214C0A3130714E0
6008 -A6130314F0B214E01307A614C0130FA31480A2131F1400A25B133EA25BA2137813F85B12
6009 -015B485A12075B48C7FC121E121C5A5A5A5A145A7BC323>I<EB03C0A2805CA600F0140F
6010 -00FC143F00FE147F00FF14FF393FC3C3FC390FE187F03903F18FC03900FDBF00EB3FFCEB
6011 -0FF0EB03C0EB0FF0EB3FFCEBFDBF3903F18FC0390FE187F0393FC3C3FC39FF03C0FF00FE
6012 -147F00FC143F00F0140F00001400A6805CA220277AC32D>I<121EEA7F8012FF13C0A213
6013 -E0A3127FEA1E601200A413E013C0A312011380120313005A120E5A1218123812300B1C79
6014 -8919>44 D<B512FEA617067F961E>I<121EEA7F80A2EAFFC0A4EA7F80A2EA1E000A0A79
6015 -8919>I<ED0180ED03C01507A21680150FA216005DA2151E153EA2153C157CA2157815F8
6016 -A25D1401A25D1403A25D1407A25D140FA24AC7FCA2141E143EA2143C147CA2147814F8A2
6017 -5C1301A25C1303A25C1307A25C130FA291C8FC5BA2131E133EA25BA2137813F8A25B1201
6018 -A25B1203A25B1207A25B120FA290C9FC5AA2121E123EA2123C127CA2127812F8A25A1260
6019 -225B7BC32D>I<EB01FE90380FFFC090383F03F090387C00F849137C48487F48487F4848
6020 -EB0F80A2000F15C04848EB07E0A3003F15F0A290C712034815F8A64815FCB3A26C15F8A5
6021 -6C6CEB07F0A3001F15E0A36C6CEB0FC0A26C6CEB1F80000315006C6C133E6C6C5B017C5B
6022 -90383F03F090380FFFC0D901FEC7FC263F7DBC2D>I<EB01C013031307131F137FEA07FF
6023 -B5FC139FEAF81F1200B3B3ACEB7FF0B612F8A31D3D78BC2D>I<EB07FC90383FFF8090B5
6024 -12E03903F01FF83907C007FC390F0001FE001E6D7E001C1580003CEC7FC05AED3FE01270
6025 -B4FC6DEB1FF07FA56C5A6CC7FC120CC813E0153FA216C0157F168015FF16004A5A5D4A5A
6026 -4A5A5D4A5A4A5A4AC7FC147E147C5C495A495A495A495A49C71270133E133C5B4914E048
6027 -5A485A485A48C7120148B6FCA25A4815C0B7FCA3243D7CBC2D>I<EB07FC90383FFF8090
6028 -38F80FE03901E003F839078001FCD80F007F000E6D7E001E1580D81F80137F486C14C07F
6029 -A27F5BA2121F6C5AC8138015FF1600A24A5AA24A5A5DEC07E04A5A023FC7FCEB1FFCECFF
6030 -809038000FE0EC07F86E7E6E7E6E7E1680ED7FC0A216E0153FA216F0A2120C123F487E48
6031 -7EA316E0A249137F6CC713C01278EDFF807E6C4913006C495A3907C007FC3903F80FF0C6
6032 -B55A013F1380D907F8C7FC243F7CBC2D>I<150E151E153EA2157EA215FE1401A21403EC
6033 -077E1406140E141CA214381470A214E0EB01C0A2EB0380EB0700A2130E5BA25B5BA25B5B
6034 -1201485A90C7FC5A120E120C121C5AA25A5AB8FCA3C8EAFE00AC4A7E49B6FCA3283E7EBD
6035 -2D>I<00061403D80780131F01F813FE90B5FC5D5D5D15C092C7FC14FCEB3FE090C9FCAC
6036 -EB01FE90380FFF8090383E03E090387001F8496C7E49137E497F90C713800006141FC813
6037 -C0A216E0150FA316F0A3120C127F7F12FFA416E090C7121F12FC007015C012780038EC3F
6038 -80123C6CEC7F00001F14FE6C6C485A6C6C485A3903F80FE0C6B55A013F90C7FCEB07F824
6039 -3F7CBC2D>I<EC1FE0ECFFF8903803F03E90380FC00F90391F000780133E017EEB1FC049
6040 -133F4848137F12035B12074848EB3F80ED1F00001F91C7FC5BA2123FA3485AA214FE9038
6041 -87FF8039FF8F07E090389C01F09038B800FC01B0137E13F0497F16804914C0A2ED1FE0A3
6042 -4914F0A5127FA6123F6D14E0A2121FED3FC0A26C6C1480A20007EC7F006C6C137E6C6C5B
6043 -6C6C485A90387E07F06DB45A010F1380D903FCC7FC243F7CBC2D>I<1238123C123F90B6
6044 -12FCA316F85A16F016E00078C712010070EC03C0ED078016005D48141E151C153C5DC812
6045 -7015F04A5A5D14034A5A92C7FC5C141EA25CA2147C147814F8A213015C1303A31307A313
6046 -0F5CA2131FA6133FAA6D5A0107C8FC26407BBD2D>I<EB03FC90381FFF8090387C07E090
6047 -38F001F83901E0007C48487F48487F48C7FCED0F80121E16C0003E1407A4123FA26DEB0F
6048 -807F6C6C131F6D140001FC133E6C6C5B9038FF80786C6D5A6CEBF3E06CEBFF806C91C7FC
6049 -133F6D13C06D7F013F13F801787F48486C7E3903E01FFF48486C1380260F800313C04848
6050 -7E489038007FE0003E143F007E141F007CEC0FF01507481403A31501A46C15E0007C1403
6051 -A2007E15C06C14076CEC0F806DEB1F006C6C133ED807F05B3901FC03F86CB512E0011F13
6052 -80D903FCC7FC243F7CBC2D>I<EB03FCEB1FFF90387E07C09038FC03F048486C7E48486C
6053 -7E4848137C000F147E4848137F81003F15805B007F15C0A2151F12FF16E0A516F0A5127F
6054 -153FA36C7EA2001F147F120F6C6C13FF6D13DF000313013900F8039F90387E0F1FD91FFE
6055 -13E0EB07F090C7FCA2ED3FC0A41680157FD80F801400487E486C13FEA24A5A5D49485AEB
6056 -8007391E000FE0001F495A260FC07FC7FC3803FFFE6C13F838003FC0243F7CBC2D>I<12
6057 -1EEA7F80A2EAFFC0A4EA7F80A2EA1E00C7FCB3121EEA7F80A2EAFFC0A4EA7F80A2EA1E00
6058 -0A2779A619>I<121EEA7F80A2EAFFC0A4EA7F80A2EA1E00C7FCB3121E127FEAFF80A213
6059 -C0A4127F121E1200A412011380A3120313005A1206120E120C121C5A1230A20A3979A619
6060 ->I<007FB912E0BA12F0A26C18E0CDFCAE007FB912E0BA12F0A26C18E03C167BA147>61
6061 -D<EB1FF890B5FC3903E01FC0390F0007F0001EEB03F848EB01FC4814FE140000FE14FF7E
6062 -7FA46CC7FC123EC7EA01FEA2EC03FCEC07F815F0EC0FC0EC1F80EC3F00143E5C147814F8
6063 -5C13015CA2495AA25CAB91C7FC90C8FCA8EB0780EB1FE0A2497EA46D5AA2EB078020407B
6064 -BF2B>63 D<15074B7EA34B7EA34B7EA34B7EA34B7E15E7A2913801C7FC15C3A291380381
6065 -FEA34AC67EA3020E6D7EA34A6D7EA34A6D7EA34A6D7EA34A6D7EA349486D7E91B6FCA249
6066 -819138800001A249C87EA24982010E157FA2011E82011C153FA2013C820138151FA20178
6067 -82170F13FC00034C7ED80FFF4B7EB500F0010FB512F8A33D417DC044>65
6068 -D<B712FCEEFF8017F00001903980000FF86C6CC7EA03FE707E701380EF7FC0EF3FE0A2EF
6069 -1FF0A218F8A3170F171FA318F0A2EF3FE0177F18C0EFFF804C1300EE03FCEE0FF8EE7FE0
6070 -91B6C7FC17E091C7EA07FCEE01FE933800FF80EF7FC0EF3FE0EF1FF018F8170F18FC1707
6071 -A218FEA718FC170FA2EF1FF818F0173FEF7FE0EFFFC00403138048486C90380FFE00B85A
6072 -17E094C7FC373E7DBD40>I<DB3FF01306912603FFFE130E020F9038FF801E913A3FF007
6073 -E03E9139FF8000F8D903FEC7EA7C7ED907F8EC1EFE4948140FD93FE0140749481403495A
6074 -91C812014848150012034848167E5B000F173EA24848161EA2123F5B180E127FA3491600
6075 -12FFAC127F7F180EA2123FA27F001F171E181C6C7EA20007173C6D16386C6C1678000117
6076 -706C6C16F06EEC01E06D6C15C06D6C1403D90FF0EC07806D6CEC1F00D903FE143E902600
6077 -FF8013F891393FF007F0020FB512C0020391C7FC9138003FF037427BBF42>I<B712FCEE
6078 -FF8017E000019039C0001FF86C6C48EB03FEEE00FF717E717EEF0FE084717E717E170184
6079 -717EA21980187F19C0A3F03FE0A519F0AB19E0A5F07FC0A21980A218FF19004D5AA24D5A
6080 -6017074D5A4D5AEF7FC04DC7FCEE03FE48486CEB1FF8B85A178004FCC8FC3C3E7DBD45>
6081 -I<B912E0A300019038C000016C6C48EB001FEF0FF01703A217011700A31870A41838161C
6082 -A41800A2163CA2167C16FC150391B5FCA3EC80031500167C163CA2161CA21807A3180E93
6083 -C7FCA4181E181CA2183CA2187CA218F8170117031707171F48486CEB01FFB912F0A3383E
6084 -7DBD3E>I<B91280A300019038C000036C6C48EB007FEF1FC0170F1707A21703A31701A4
6085 -EF00E0A21638A31800A31678A216F81501150791B5FCA3EC8007150115001678A21638A6
6086 -93C8FCAF3801FFE0B612F0A3333E7DBD3B>I<DB3FE0130C912603FFFE131C021F9038FF
6087 -803C913A7FF00FC07C9139FF0001F0D903FC90380078FC4948143DD91FE0141F4948140F
6088 -4948140701FF15034890C8FC491501485A000716005B000F177C5B001F173CA2485AA218
6089 -1C127FA25B95C7FC12FFAB041FB512F0127FA26D9139000FFE00EF03FC123FA27F121FA2
6090 -6C7EA212077F12036C7E7F6C7F6D6C14076D7E6D6C140FD907F8141ED903FEEC3C7C9026
6091 -00FF80EBF83C913A7FF007F01C021FB5EAC00C020391C8FC9138003FF03C427BBF47>I<
6092 -B6D8C01FB512F8A3000101E0C7383FFC0026007F80EC0FF0B3A691B7FCA30280C7120FB3
6093 -A92601FFE0EC3FFCB6D8C01FB512F8A33D3E7DBD44>I<B612F0A3C6EBF000EB3FC0B3B3
6094 -B2EBFFF0B612F0A31C3E7EBD21>I<011FB512FCA3D9000713006E5A1401B3B3A6123FEA
6095 -7F80EAFFC0A44A5A1380D87F005B007C130700385C003C495A6C495A6C495A2603E07EC7
6096 -FC3800FFF8EB3FC026407CBD2F>I<B600C090387FFFFCA3000101E0C7000F138026007F
6097 -80913807FE0018F818E0604D5A4DC7FC173E5F5F4C5A4C5A4C5A4C5A4CC8FC163E5E5E4B
6098 -5A4B5AED07804B7E151F4B7E4B7E15FF913881EFF8913883C7FCEC878791388F03FE9138
6099 -9E01FF14BCDAF8007F4A6D7E5C4A6D7E4A6D7EA2707E707EA2707E707EA2707F717E8417
6100 -3F717E717EA2717E848419802601FFE04A13C0B600C090B6FCA3403E7DBD47>I<B612F8
6101 -A3000101E0C9FC38007F80B3B0EF0380A517071800A45FA35FA25F5F5F4C5A160748486C
6102 -133FB8FCA3313E7DBD39>I<B500C093383FFFF0A300016D93387FF800D8007F18E0D977
6103 -F016EFA3D973F8ED01CFA2D971FCED038FA3D970FEED070FA26E150E80A26E6C141CA36E
6104 -6C1438A26E6C1470A36E6C14E0A26E6CEB01C0A36E6CEB0380A36E6CEB0700A2037F130E
6105 -A36F6C5AA26F6C5AA36F6C5AA25FED07F0A2923803F9C0A36FB45AA26F90C7FCA213F848
6106 -6C147ED807FFEF3FF8B500F8013C011FB512F0A34C3E7DBD53>I<B56C91B512F88080D8
6107 -007F030713006EEC01FC6E6E5A1870EB77FCEB73FEA2EB71FF01707FA26E7E6E7EA26E7E
6108 -6E7EA26E7E6E7EA26E7E6E7FA26F7E6F7EA26F7E6F7EA26F7E6F7EA26F7E6F1380A2EE7F
6109 -C0EE3FE0A2EE1FF0EE0FF8A2EE07FCEE03FEA2EE01FF7013F0A2177F173FA2171F170FA2
6110 -170701F81503487ED807FF1501B500F81400A218703D3E7DBD44>I<ED7FE0913807FFFE
6111 -91391FC03F8091397E0007E04948EB03F8D907F0EB00FE4948147F49486E7E49486E7E49
6112 -C86C7E01FE6F7E00018349150300038348486F7EA248486F7EA2001F188049167F003F18
6113 -C0A3007F18E049163FA300FF18F0AC007F18E06D167FA4003F18C0A26C6CEEFF80A36C6C
6114 -4B1300A26C6C4B5A00035F6D150700015F6C6C4B5A6D5E6D6C4A5A6D6C4A5A6D6C4AC7FC
6115 -6D6C14FED901FCEB03F8D9007FEB0FE091391FC03F80912607FFFEC8FC9138007FE03C42
6116 -7BBF47>I<B712F8EEFF8017E000019039C0003FF86C6C48EB07FCEE01FE707EEF7F80EF
6117 -3FC018E0A2EF1FF0A218F8A818F0A2EF3FE0A218C0EF7F80EFFF004C5AEE07FCEE3FF091
6118 -B612C04CC7FC0280C9FCB3A73801FFE0B612C0A3353E7DBD3E>I<ED7FE0913807FFFE91
6119 -391FC03F8091397F000FE0D901FCEB03F8D907F0EB00FE4948147F49486E7E49486E7E49
6120 -C86C7E498248486F7E49150300038348486F7EA2000F834981001F1880A24848EE7FC0A3
6121 -007F18E0A249163FA200FF18F0AC007F18E0A26D167FA3003F18C0A26C6CEEFF80A3000F
6122 -18006D5D0007DA0F805B6C6C90393FE003FCED70706C6C496C485A6C6C48486C485A017F
6123 -D9800E5BD93F819038061FC0D91FC19038073F80D90FE14AC7FCD907F1EB03FE902601FD
6124 -C013F8903A007EE007E091271FF03FC013180207B5FC9139007FE1E0DB00011438837113
6125 -78A2706C13F0EFFF0318FFA27113E0A37113C0711380711300715AEF01F83D527BBF47>
6126 -I<B712C016FCEEFF800001D9C00013E06C6C48EB1FF0EE07FCEE01FE707E84717EA2717E
6127 -A284A760177F606017FF95C7FCEE01FCEE07F8EE1FE0EEFF8091B500FCC8FC16F0913880
6128 -01FCED003FEE1FC0707E707E83160383160183A383A484A4F0C004190EA28218E0057F13
6129 -1E2601FFE0161CB600C0EB3FF094381FF83805071370CA3801FFE09438003F803F407DBD
6130 -43>I<D907FC130C90391FFF801C017FEBF03C3901FC03F83A03F0007E7CD807C0EB1FFC
6131 -4848130F001F140748C71203003E1401007E1400A2007C157C12FCA2163CA36C151CA27E
6132 -A26C6C14007F7FEA3FF8EBFF806C13F86CEBFF806C14F06C14FC6C14FF6C15C0013F14E0
6133 -010714F0EB007F020713F89138007FFC150FED07FE15031501ED00FFA200E0157FA3163F
6134 -A27EA3163E7E167E6C157C6C15FC6C15F86D13016DEB03F06DEB07E0D8F9FCEB0FC03AF0
6135 -7F803F8090391FFFFE00D8E00713F839C0007FC028427BBF33>I<003FB91280A3903AF0
6136 -007FE001018090393FC0003F48C7ED1FC0007E1707127C00781703A300701701A548EF00
6137 -E0A5C81600B3B14B7E4B7E0107B612FEA33B3D7DBC42>I<B600C090B512F8A3000101E0
6138 -C70007130026007F80EC01FC715A1870B3B3A4013F16F06E5DA21701011F5E80010F1503
6139 -6E4A5A010793C7FC6D6C5C6D6C141E6D6C5C027F14F86E6C485A91390FF00FE00203B512
6140 -80020049C8FCED1FF03D407DBD44>I<B691380FFFFEA3000301E0020113E06C01809138
6141 -007F806CEF3F00017F163E181C6E153C013F1638A26E1578011F1670A26D6C5DA26E1401
6142 -01075EA26E140301035EA26D6C4AC7FCA2806D150EA26F131E027F141CA26F133C023F14
6143 -38A26E6C5BA26F13F0020F5CA2EDF80102075CA26E6C485AA2EDFE07020191C8FCA26F5A
6144 -6E130EA2ED7F9CA216DCED3FF8A36F5AA36F5AA26F5AA36F5A3F407EBD44>I<B500FE01
6145 -7FB5D88007B5FCA3000301C0010101E0C713F86C90C849EC3FE07148EC0F807E7215006E
6146 -143F017F190E84A26D6C60A24D7E6D6C60A2EFE7F86D6C60A2933801C3FC6E18F0010761
6147 -04037F6E0281140101036104077F17006D6C4D5AA2040EEB7F806D6C4DC7FCA24CEB3FC0
6148 -DA7F80160EA24CEB1FE003C0161E023F171C047814F0DBE070010F133C021F173804F014
6149 -F84C1307DA0FF05EA2DBF1C0EB03FCDA07F95EA2DBFB80EB01FEDA03FF6F5AA293C8FCA2
6150 -6E5FA24B157F020094C8FCA24B81037C153EA20378151E0338151C58407EBD5D>I<007F
6151 -B5D8C003B512E0A3C649C7EBFC00D93FF8EC3FE06D48EC1F806D6C92C7FC171E6D6C141C
6152 -6D6C143C5F6D6C14706D6D13F04C5ADA7FC05B023F13036F485ADA1FF090C8FC020F5BED
6153 -F81E913807FC1C163C6E6C5A913801FF7016F06E5B6F5AA26F7E6F7EA28282153FED3BFE
6154 -ED71FF15F103E07F913801C07F0203804B6C7EEC07004A6D7E020E6D7E5C023C6D7E0238
6155 -6D7E14784A6D7E4A6D7F130149486E7E4A6E7E130749C86C7E496F7E497ED9FFC04A7E00
6156 -076DEC7FFFB500FC0103B512FEA33F3E7EBD44>I<B66C0103B51280A3000101F0C8EBF8
6157 -006C6C48ED3FC0725A013F041EC7FC6D7E606D6C15386D6C1578606D6C5D6E14016D5E6D
6158 -6D1303606E6C49C8FC6E6C5B170E6E6C131E171C6E6C5B6E6C137817706E6C13F06F5B6E
6159 -13016EEB83C05FED7FC7DB3FE7C9FC16EFED1FFE5E150F6F5AB3A4ED1FFC020FB512FCA3
6160 -413E7FBD44>I<003FB712F8A391C7EA1FF013F801E0EC3FE00180EC7FC090C8FC003EED
6161 -FF80A2003C4A1300007C4A5A12784B5A4B5AA200704A5AA24B5A4B5AA2C8485A4A90C7FC
6162 -A24A5A4A5AA24A5AA24A5A4A5AA24A5A4A5AA24990C8FCA2495A4948141CA2495A495AA2
6163 -495A495A173C495AA24890C8FC485A1778485A484815F8A24848140116034848140F4848
6164 -143FED01FFB8FCA32E3E7BBD38>I<EAFFFCA4EAF000B3B3B3B3ABEAFFFCA40E5B77C319>
6165 -I<486C13C00003130101001380481303000EEB070048130E0018130C0038131C00301318
6166 -0070133800601330A300E01370481360A400CFEB678039FFC07FE001E013F0A3007F133F
6167 -A2003F131F01C013E0390F0007801C1C73BE2D>I<EAFFFCA4EA003CB3B3B3B3ABEAFFFC
6168 -A40E5B7FC319>I<EB0FF8EBFFFE3903F01F8039078007E0000F6D7E9038E001F8D81FF0
6169 -7F6E7EA3157F6C5AEA0380C8FCA4EC1FFF0103B5FC90381FF87FEB7F803801FC00EA07F8
6170 -EA0FE0485A485AA248C7FCEE038012FEA315FFA3007F5BEC03BF3B3F80071F8700261FC0
6171 -0E13CF3A07F03C0FFE3A01FFF807FC3A003FC001F0292A7DA82D>97
6172 -D<EA01FC12FFA3120712031201B1EC03FC91381FFF8091387C07E09039FDE001F09039FF
6173 -C000FC4A137E91C77E49158049141F17C0EE0FE0A217F0A2160717F8AA17F0A2160FA217
6174 -E0161F17C06D1580EE3F006D5C6E13FE9039F3C001F89039F1E003F09039E0780FC09026
6175 -C03FFFC7FCC7EA07F82D407EBE33>I<49B4FC010F13E090383F00F8017C131E4848131F
6176 -4848137F0007ECFF80485A5B121FA24848EB7F00151C007F91C7FCA290C9FC5AAB6C7EA3
6177 -003FEC01C07F001F140316806C6C13076C6C14000003140E6C6C131E6C6C137890383F01
6178 -F090380FFFC0D901FEC7FC222A7DA828>I<ED01FC15FFA3150715031501B114FF010713
6179 -E190381F80F990387E003D49131FD803F81307485A49130348481301121F123F5B127FA2
6180 -90C7FCA25AAA7E7FA2123FA26C7E000F14037F000714076C6C497E6C6C497ED8007C0179
6181 -13F890383F01F190380FFFC1903A01FE01FC002D407DBE33>I<EB01FE90380FFFC09038
6182 -3F03F09038FC01F848486C7E4848137E48487F000F158049131F001F15C04848130FA212
6183 -7F16E090C7FCA25AA290B6FCA290C9FCA67EA27F123F16E06C7E1501000F15C06C6C1303
6184 -6DEB07806C6C1400C66C131E017E5B90381F80F8903807FFE0010090C7FC232A7EA828>
6185 -I<EC1FC0EC7FF8903801F83C903807E07E90380FC0FFEB1FC1EB3F811401137FEC00FE01
6186 -FE137C1500AEB6FCA3C648C7FCB3AE487E007F13FFA320407EBF1C>I<167C903903F801
6187 -FF903A1FFF078F8090397E0FDE1F9038F803F83803F001A23B07E000FC0600000F6EC7FC
6188 -49137E001F147FA8000F147E6D13FE00075C6C6C485AA23901F803E03903FE0FC026071F
6189 -FFC8FCEB03F80006CAFC120EA3120FA27F7F6CB512E015FE6C6E7E6C15E06C810003813A
6190 -0FC0001FFC48C7EA01FE003E140048157E825A82A46C5D007C153E007E157E6C5D6C6C49
6191 -5A6C6C495AD803F0EB0FC0D800FE017FC7FC90383FFFFC010313C0293D7EA82D>I<EA01
6192 -FC12FFA3120712031201B1EC01FE913807FFC091381E07E091387803F09138E001F8D9FD
6193 -C07F148001FF6D7E91C7FCA25BA25BB3A6486C497EB5D8F87F13FCA32E3F7DBE33>I<EA
6194 -01E0EA07F8A2487EA46C5AA2EA01E0C8FCACEA01FC127FA3120712031201B3AC487EB512
6195 -F0A3143E7DBD1A>I<1478EB01FEA2EB03FFA4EB01FEA2EB00781400AC147FEB7FFFA313
6196 -017F147FB3B3A5123E127F38FF807E14FEA214FCEB81F8EA7F01387C03F0381E07C0380F
6197 -FF803801FC00185185BD1C>I<EA01FC12FFA3120712031201B292B51280A392383FFC00
6198 -16E0168093C7FC153C5D5D4A5AEC07C04A5A4AC8FC143E147F4A7E13FD9038FFDFC0EC9F
6199 -E0140F496C7E01FC7F496C7E1401816E7E81826F7E151F826F7EA282486C14FEB539F07F
6200 -FFE0A32B3F7EBE30>I<EA01FC12FFA3120712031201B3B3B1487EB512F8A3153F7DBE1A>
6201 -I<2701F801FE14FF00FF902707FFC00313E0913B1E07E00F03F0913B7803F03C01F80007
6202 -903BE001F87000FC2603F9C06D487F000101805C01FBD900FF147F91C75B13FF4992C7FC
6203 -A2495CB3A6486C496CECFF80B5D8F87FD9FC3F13FEA347287DA74C>I<3901F801FE00FF
6204 -903807FFC091381E07E091387803F000079038E001F82603F9C07F0001138001FB6D7E91
6205 -C7FC13FF5BA25BB3A6486C497EB5D8F87F13FCA32E287DA733>I<14FF010713E090381F
6206 -81F890387E007E01F8131F4848EB0F804848EB07C04848EB03E0000F15F04848EB01F8A2
6207 -003F15FCA248C812FEA44815FFA96C15FEA36C6CEB01FCA3001F15F86C6CEB03F0A26C6C
6208 -EB07E06C6CEB0FC06C6CEB1F80D8007EEB7E0090383F81FC90380FFFF0010090C7FC282A
6209 -7EA82D>I<3901FC03FC00FF90381FFF8091387C0FE09039FDE003F03A03FFC001FC6C49
6210 -6C7E91C7127F49EC3F805BEE1FC017E0A2EE0FF0A3EE07F8AAEE0FF0A4EE1FE0A2EE3FC0
6211 -6D1580EE7F007F6E13FE9138C001F89039FDE007F09039FC780FC0DA3FFFC7FCEC07F891
6212 -C9FCAD487EB512F8A32D3A7EA733>I<02FF131C0107EBC03C90381F80F090397F00387C
6213 -01FC131CD803F8130E4848EB0FFC150748481303121F485A1501485AA448C7FCAA6C7EA3
6214 -6C7EA2001F14036C7E15076C6C130F6C7E6C6C133DD8007E137990383F81F190380FFFC1
6215 -903801FE0190C7FCAD4B7E92B512F8A32D3A7DA730>I<3901F807E000FFEB1FF8EC787C
6216 -ECE1FE3807F9C100031381EA01FB1401EC00FC01FF1330491300A35BB3A5487EB512FEA3
6217 -1F287EA724>I<90383FC0603901FFF8E03807C03F381F000F003E1307003C1303127C00
6218 -78130112F81400A27E7E7E6D1300EA7FF8EBFFC06C13F86C13FE6C7F6C1480000114C0D8
6219 -003F13E0010313F0EB001FEC0FF800E01303A214017E1400A27E15F07E14016C14E06CEB
6220 -03C0903880078039F3E01F0038E0FFFC38C01FE01D2A7DA824>I<131CA6133CA4137CA2
6221 -13FCA2120112031207001FB512C0B6FCA2D801FCC7FCB3A215E0A912009038FE01C0A2EB
6222 -7F03013F138090381F8700EB07FEEB01F81B397EB723>I<D801FC14FE00FF147FA30007
6223 -14030003140100011400B3A51501A31503120015076DEB06FF017E010E13806D4913FC90
6224 -381FC078903807FFE00100903880FE002E297DA733>I<B539E00FFFE0A32707FE000313
6225 -006C48EB00FC5E00015D7F00005DA26D13016D5CA26D6C485AA2ECC007011F91C7FCA290
6226 -380FE00EA2ECF01E0107131CA26D6C5AA2ECFC7801011370A2ECFEF001005BA2EC7FC0A3
6227 -6E5AA26EC8FCA3140E2B287EA630>I<B53BC3FFFE03FFF8A3290FFE003FE00013C06C48
6228 -6D48EB3F806C4817006D010F141E00016F131C15076D163C00004A6C1338A2017F5E4B7E
6229 -151DD93F805DED3DFC1538D91FC04A5AED78FE9238707E03D90FE0017F5BEDE03F02F014
6230 -0701070387C7FC9138F1C01F02F9148F010315CE9138FB800F02FF14DE6D15FCED00076D
6231 -5DA24A1303027E5CA2027C1301023C5C023813003D287EA642>I<B539F01FFFE0A30003
6232 -D9C00F1300C690388007F8D97F0013E002805BD93FC05B011F49C7FC90380FE00EECF01E
6233 -6D6C5A01035B6D6C5A6E5AEB00FF6E5A6E5A81141F814A7E81147BECF1FC903801E1FEEC
6234 -C0FF01037F49486C7ED90F007F011E6D7E013E130F496D7E01FC80486C80000F4A7EB539
6235 -803FFFF8A32D277FA630>I<B539E00FFFE0A32707FE000313006C48EB01FC6F5A00015D
6236 -7F00005DA2017F495AA2EC8003013F5CA26D6C48C7FCA26E5A010F130EA26D6C5AA2ECF8
6237 -3C01031338A26D6C5AA2ECFEF001005BA2EC7FC0A36E5AA36EC8FCA2140EA2141E141C14
6238 -3C1438A2147800181370127EB45BA2495AA248485AD87E07C9FCEA780EEA3C3CEA1FF8EA
6239 -07E02B3A7EA630>I<001FB61280A2EBE0000180140049485A001E495A121C4A5A003C49
6240 -5A141F00385C4A5A147F5D4AC7FCC6485AA2495A495A130F5C495A90393FC00380A2EB7F
6241 -80EBFF005A5B484813071207491400485A48485BA248485B4848137F00FF495A90B6FCA2
6242 -21277EA628>I<B812F0A22C0280982D>I E
6243 -%EndDVIPSBitmapFont
6244 -%DVIPSBitmapFont: Fm cmbx12 20.736 9
6245 -/Fm 9 123 df<92380FFFE04AB67E020F15F0027F15FE49B87E4917E0010F17F8013F83
6246 -49D9C01F14FF9027FFFC0001814801E06D6C80480180021F804890C86C8048486F804848
6247 -6F8001FF6F804801C06E8002F081486D18806E816E18C0B5821BE06E81A37214F0A56C5B
6248 -A36C5B6C5B6C5B000313C0C690C9FC90CA15E060A34E14C0A21B80601B0060626295B55A
6249 -5F624D5C624D5C4D91C7FC614D5B4D13F04D5B6194B55A4C49C8FC4C5B4C5B4C13E04C5B
6250 -604C90C9FCEE7FFC4C5A4B5B4B5B4B0180EC0FF04B90C8FC4B5A4B5A4B48ED1FE0EDFFE0
6251 -4A5B4A5B4A90C9FC4A48163F4A5ADA3FF017C05D4A48167F4A5A4990CA12FFD903FC1607
6252 -49BAFC5B4919805B5B90BBFC5A5A5A5A481A005A5ABCFCA462A44C7176F061>50
6253 -D<92383FFFF80207B612E0027F15FC49B87E010717E0011F83499026F0007F13FC4948C7
6254 -000F7F90B502036D7E486E6D806F6D80727F486E6E7F8486727FA28684A26C5C72806C5C
6255 -6D90C8FC6D5AEB0FF8EB03E090CAFCA70507B6FC041FB7FC0303B8FC157F0203B9FC021F
6256 -ECFE0391B612800103ECF800010F14C04991C7FC017F13FC90B512F04814C0485C4891C8
6257 -FC485B5A485B5C5A5CA2B5FC5CA360A36E5DA26C5F6E5D187E6C6D846E4A48806C6D4A48
6258 -14FC6C6ED90FF0ECFFFC6C02E090263FE07F14FE00019139FC03FFC06C91B6487E013F4B
6259 -487E010F4B1307010303F01301D9003F0280D9003F13FC020101F8CBFC57507ACE5E>97
6260 -D<903801FFFCB6FCA8C67E131F7FB3ADF0FFFC050FEBFFE0057F14FE0403B77E040F16E0
6261 -043F16F84CD9007F13FE9226FDFFF001077F92B500C001018094C86C13E004FC6F7F4C6F
6262 -7F04E06F7F4C6F7F5E747F93C915804B7014C0A27414E0A21DF087A21DF8A31DFC87A41D
6263 -FEAF1DFCA4631DF8A31DF098B5FC1DE0A25014C0A26F1980501400705D705F704B5B505B
6264 -704B5B04FC4B5BDBE7FE92B55A9226C3FF8001035C038101E0011F49C7FC9226807FFC90
6265 -B55A4B6CB712F04A010F16C04A010393C8FC4A010015F84A023F14C090C9000301F0C9FC
6266 -5F797AF76C>I<97380FFFE00607B6FCA8F00003190086B3AD93383FFF800307B512F803
6267 -3F14FF4AB712C0020716F0021F16FC027F9039FE007FFE91B500F0EB0FFF010302800101
6268 -90B5FC4949C87E49498149498149498149498190B548814884484A8192CAFC5AA2485BA2
6269 -5A5C5AA35A5CA4B5FCAF7EA4807EA37EA2807EA26C7F616C6E5D6C606C80616D6D5D6D6D
6270 -5D6D6D92B67E6D6D4A15FC010301FF0207EDFFFE6D02C0EB3FFE6D6C9039FC01FFF86E90
6271 -B65A020F16C002031600DA007F14FC030F14E09226007FFEC749C7FC5F797AF76C>100
6272 -D<EB01FCEB07FF011F13C0497F497F90B57EA24880A24880A76C5CA26C5CA26D5B6D5B6D
6273 -5B010790C8FCEB01FC90CAFCB2903801FFFC007FB5FCA8C67E131F7FB3B3B3A5B81280A8
6274 -297979F835>105 D<903801FFFCB6FCA8C67E131F7FB3B3B3B3B3ABB812C0A82A7879F7
6275 -35>108 D<902601FFF891380FFFE0B692B512FE05036E7E050F15E0053F15F84D819327
6276 -01FFF01F7F4CD900077FDC07FC6D80C66CDA0FF06D80011FDA1FC07F6D4A48824CC8FC04
6277 -7E6F7F5EEDF9F85E03FB707F5E15FF5EA25EA293C9FCA45DB3B3A6B8D8E003B81280A861
6278 -4E79CD6C>110 D<902601FFFCEC7FFEB6020FB512F0057F14FE4CB712C0040716F0041F
6279 -82047F16FE93B5C66C7F92B500F0010F14C0C66C0380010380011F4AC76C806D4A6E8004
6280 -F06F7F4C6F7F4C6F7F4C8193C915804B7014C0861DE0A27414F0A27414F8A47513FCA575
6281 -13FEAF5113FCA598B512F8A31DF0621DE0621DC0621D806F5E701800704B5B505B704B5B
6282 -7092B55A04FC4A5C704A5C706C010F5C05E0013F49C7FC9227FE7FFC01B55A70B712F004
6283 -0F16C0040393C8FC040015F8053F14C0050301F0C9FC94CCFCB3A6B812E0A85F6F7ACD6C
6284 ->112 D<0007BA12FC1AFEA503E0C714FC4AC74814F84801F04A14F05C02804A14E091C8
6285 -4814C04D14805B494B14004D5B4992B55AA24C5C494A5C615E4C5C001F4B5C5B4C91C7FC
6286 -4C5B93B55AA24B5CC8485C4B5CA24B5C4B5C4B91C8FCA24B5B92B55AA24A5C4A5C4A4A14
6287 -FFA24A5C4A5C4A91C8FC614A4915FE91B55A495CA2495C494A14035E5B495C4991C81207
6288 -A24949ED0FFC90B55A484A151FA2484A153F484A157F484A15FF1803484A140F4891C812
6289 -3F48490207B5FC91B9FCBB12F8A57E484D7BCC56>122 D E
6290 -%EndDVIPSBitmapFont
6291 -end
6292 -%%EndProlog
6293 -%%BeginSetup
6294 -%%Feature: *Resolution 600dpi
6295 -TeXDict begin
6296 -%%PaperSize: A4
6297 -
6298 -%%EndSetup
6299 -%%Page: 1 1
6300 -1 0 bop 150 1318 a Fm(bzip2)64 b(and)g(libbzip2)p 150
6301 -1418 3600 34 v 2010 1515 a Fl(a)31 b(program)f(and)g(library)e(for)i
6302 -(data)h(compression)2198 1623 y(cop)m(yrigh)m(t)f(\(C\))h(1996-2000)j
6303 -(Julian)28 b(Sew)m(ard)2605 1731 y(v)m(ersion)i(1.0)h(of)g(21)g(Marc)m
6304 -(h)g(2000)150 5091 y Fk(Julian)46 b(Sew)l(ard)p 150 5141
6305 -3600 17 v eop
6306 -%%Page: 1 2
6307 -1 1 bop 3705 -116 a Fl(1)150 299 y(This)24 b(program,)j
6308 -Fj(bzip2)p Fl(,)e(and)g(asso)s(ciated)i(library)c Fj(libbzip2)p
6309 -Fl(,)i(are)h(Cop)m(yrigh)m(t)g(\(C\))g(1996-2000)j(Julian)150
6310 -408 y(R)h(Sew)m(ard.)40 b(All)29 b(righ)m(ts)h(reserv)m(ed.)150
6311 -565 y(Redistribution)f(and)i(use)h(in)f(source)h(and)g(binary)e(forms,)
6312 -j(with)e(or)h(without)f(mo)s(di\014cation,)g(are)i(p)s(er-)150
6313 -675 y(mitted)d(pro)m(vided)f(that)i(the)f(follo)m(wing)f(conditions)g
6314 -(are)i(met:)225 832 y Fi(\017)60 b Fl(Redistributions)26
6315 -b(of)k(source)g(co)s(de)g(m)m(ust)g(retain)f(the)h(ab)s(o)m(v)m(e)h
6316 -(cop)m(yrigh)m(t)g(notice,)f(this)f(list)f(of)i(con-)330
6317 -941 y(ditions)e(and)i(the)h(follo)m(wing)e(disclaimer.)225
6318 -1076 y Fi(\017)60 b Fl(The)33 b(origin)f(of)h(this)f(soft)m(w)m(are)j
6319 -(m)m(ust)e(not)h(b)s(e)e(misrepresen)m(ted;)i(y)m(ou)g(m)m(ust)f(not)g
6320 -(claim)g(that)h(y)m(ou)330 1185 y(wrote)d(the)h(original)d(soft)m(w)m
6321 -(are.)44 b(If)31 b(y)m(ou)g(use)g(this)f(soft)m(w)m(are)i(in)e(a)h(pro)
6322 -s(duct,)g(an)f(ac)m(kno)m(wledgmen)m(t)330 1295 y(in)f(the)i(pro)s
6323 -(duct)e(do)s(cumen)m(tation)h(w)m(ould)f(b)s(e)h(appreciated)g(but)g
6324 -(is)f(not)i(required.)225 1429 y Fi(\017)60 b Fl(Altered)21
6325 -b(source)g(v)m(ersions)f(m)m(ust)h(b)s(e)f(plainly)e(mark)m(ed)j(as)g
6326 -(suc)m(h,)i(and)d(m)m(ust)h(not)g(b)s(e)f(misrepresen)m(ted)330
6327 -1539 y(as)31 b(b)s(eing)e(the)h(original)f(soft)m(w)m(are.)225
6328 -1674 y Fi(\017)60 b Fl(The)27 b(name)h(of)f(the)h(author)f(ma)m(y)h
6329 -(not)g(b)s(e)f(used)g(to)h(endorse)f(or)h(promote)g(pro)s(ducts)e
6330 -(deriv)m(ed)g(from)330 1783 y(this)j(soft)m(w)m(are)j(without)d(sp)s
6331 -(eci\014c)h(prior)e(written)i(p)s(ermission.)150 1965
6332 -y(THIS)37 b(SOFTW)-10 b(ARE)38 b(IS)f(PR)m(O)m(VIDED)i(BY)g(THE)f(A)m
6333 -(UTHOR)g(\\AS)g(IS")g(AND)h(ANY)f(EXPRESS)150 2074 y(OR)31
6334 -b(IMPLIED)h(W)-10 b(ARRANTIES,)31 b(INCLUDING,)i(BUT)f(NOT)f(LIMITED)g
6335 -(TO,)h(THE)f(IMPLIED)150 2184 y(W)-10 b(ARRANTIES)27
6336 -b(OF)h(MER)m(CHANT)-8 b(ABILITY)28 b(AND)g(FITNESS)f(F)m(OR)g(A)h(P)-8
6337 -b(AR)g(TICULAR)28 b(PUR-)150 2294 y(POSE)37 b(ARE)g(DISCLAIMED.)h(IN)f
6338 -(NO)h(EVENT)f(SHALL)g(THE)g(A)m(UTHOR)h(BE)g(LIABLE)g(F)m(OR)150
6339 -2403 y(ANY)56 b(DIRECT,)f(INDIRECT,)h(INCIDENT)-8 b(AL,)56
6340 -b(SPECIAL,)e(EXEMPLAR)-8 b(Y,)57 b(OR)e(CONSE-)150 2513
6341 -y(QUENTIAL)48 b(D)m(AMA)m(GES)i(\(INCLUDING,)g(BUT)f(NOT)f(LIMITED)g
6342 -(TO,)g(PR)m(OCUREMENT)150 2622 y(OF)35 b(SUBSTITUTE)e(GOODS)i(OR)f(SER)
6343 --10 b(VICES;)34 b(LOSS)f(OF)i(USE,)g(D)m(A)-8 b(T)g(A,)36
6344 -b(OR)f(PR)m(OFITS;)f(OR)150 2732 y(BUSINESS)28 b(INTERR)m(UPTION\))g
6345 -(HO)m(WEVER)i(CA)m(USED)f(AND)g(ON)g(ANY)g(THEOR)-8 b(Y)29
6346 -b(OF)g(LIA-)150 2842 y(BILITY,)36 b(WHETHER)g(IN)g(CONTRA)m(CT,)g
6347 -(STRICT)e(LIABILITY,)i(OR)g(TOR)-8 b(T)35 b(\(INCLUDING)150
6348 -2951 y(NEGLIGENCE)45 b(OR)g(OTHER)-10 b(WISE\))44 b(ARISING)h(IN)g(ANY)
6349 -h(W)-10 b(A)i(Y)46 b(OUT)e(OF)i(THE)e(USE)h(OF)150 3061
6350 -y(THIS)29 b(SOFTW)-10 b(ARE,)31 b(EVEN)f(IF)g(AD)m(VISED)i(OF)e(THE)g
6351 -(POSSIBILITY)e(OF)j(SUCH)f(D)m(AMA)m(GE.)150 3218 y(Julian)e(Sew)m
6352 -(ard,)i(Cam)m(bridge,)g(UK.)150 3374 y Fj(jseward@acm.org)150
6353 -3531 y(http://sourceware.cygnus)o(.com)o(/bzi)o(p2)150
6354 -3688 y(http://www.cacheprof.org)150 3845 y(http://www.muraroa.demon)o
6355 -(.co.)o(uk)150 4002 y(bzip2)p Fl(/)p Fj(libbzip2)d Fl(v)m(ersion)j(1.0)
6356 -i(of)e(21)h(Marc)m(h)g(2000.)150 4159 y(P)-8 b(A)g(TENTS:)40
6357 -b(T)-8 b(o)40 b(the)g(b)s(est)g(of)g(m)m(y)g(kno)m(wledge,)j
6358 -Fj(bzip2)38 b Fl(do)s(es)i(not)g(use)g(an)m(y)g(paten)m(ted)h
6359 -(algorithms.)150 4268 y(Ho)m(w)m(ev)m(er,)33 b(I)e(do)f(not)h(ha)m(v)m
6360 -(e)h(the)f(resources)g(a)m(v)-5 b(ailable)30 b(to)h(carry)g(out)g(a)g
6361 -(full)d(paten)m(t)k(searc)m(h.)42 b(Therefore)150 4378
6362 -y(I)30 b(cannot)h(giv)m(e)g(an)m(y)g(guaran)m(tee)h(of)e(the)h(ab)s(o)m
6363 -(v)m(e)g(statemen)m(t.)p eop
6364 -%%Page: 2 3
6365 -2 2 bop 150 -116 a Fl(Chapter)30 b(1:)41 b(In)m(tro)s(duction)2591
6366 -b(2)150 299 y Fh(1)80 b(In)l(tro)t(duction)150 555 y
6367 -Fj(bzip2)20 b Fl(compresses)h(\014les)f(using)g(the)h(Burro)m
6368 -(ws-Wheeler)g(blo)s(c)m(k-sorting)f(text)j(compression)d(algorithm,)150
6369 -665 y(and)33 b(Hu\013man)g(co)s(ding.)50 b(Compression)32
6370 -b(is)h(generally)g(considerably)f(b)s(etter)i(than)f(that)h(ac)m(hiev)m
6371 -(ed)h(b)m(y)150 775 y(more)f(con)m(v)m(en)m(tional)g(LZ77/LZ78-based)g
6372 -(compressors,)g(and)f(approac)m(hes)h(the)f(p)s(erformance)g(of)h(the)
6373 -150 884 y(PPM)c(family)f(of)i(statistical)f(compressors.)150
6374 -1041 y Fj(bzip2)k Fl(is)h(built)e(on)i(top)h(of)g Fj(libbzip2)p
6375 -Fl(,)e(a)i(\015exible)e(library)f(for)i(handling)e(compressed)i(data)i
6376 -(in)d(the)150 1151 y Fj(bzip2)c Fl(format.)43 b(This)30
6377 -b(man)m(ual)g(describ)s(es)g(b)s(oth)g(ho)m(w)i(to)g(use)f(the)g
6378 -(program)g(and)g(ho)m(w)g(to)h(w)m(ork)f(with)150 1260
6379 -y(the)d(library)d(in)m(terface.)41 b(Most)28 b(of)g(the)g(man)m(ual)f
6380 -(is)g(dev)m(oted)i(to)f(this)f(library)-8 b(,)26 b(not)i(the)g
6381 -(program,)g(whic)m(h)150 1370 y(is)h(go)s(o)s(d)i(news)e(if)h(y)m(our)g
6382 -(in)m(terest)h(is)e(only)g(in)h(the)g(program.)150 1527
6383 -y(Chapter)24 b(2)g(describ)s(es)f(ho)m(w)h(to)h(use)f
6384 -Fj(bzip2)p Fl(;)h(this)e(is)g(the)i(only)e(part)h(y)m(ou)h(need)f(to)h
6385 -(read)f(if)f(y)m(ou)h(just)g(w)m(an)m(t)150 1636 y(to)35
6386 -b(kno)m(w)f(ho)m(w)g(to)g(op)s(erate)h(the)f(program.)51
6387 -b(Chapter)34 b(3)g(describ)s(es)e(the)i(programming)f(in)m(terfaces)h
6388 -(in)150 1746 y(detail,)23 b(and)d(Chapter)h(4)h(records)f(some)h
6389 -(miscellaneous)e(notes)i(whic)m(h)e(I)h(though)m(t)h(ough)m(t)g(to)g(b)
6390 -s(e)f(recorded)150 1855 y(somewhere.)p eop
6391 -%%Page: 3 4
6392 -3 3 bop 150 -116 a Fl(Chapter)30 b(2:)41 b(Ho)m(w)31
6393 -b(to)g(use)f Fj(bzip2)2375 b Fl(3)150 299 y Fh(2)80 b(Ho)l(w)53
6394 -b(to)g(use)g Fg(bzip2)150 566 y Fl(This)29 b(c)m(hapter)i(con)m(tains)f
6395 -(a)h(cop)m(y)g(of)g(the)f Fj(bzip2)f Fl(man)h(page,)h(and)f(nothing)g
6396 -(else.)390 818 y Ff(NAME)570 1004 y Fj(bzip2)p Fl(,)f
6397 -Fj(bunzip2)g Fl(-)h(a)h(blo)s(c)m(k-sorting)f(\014le)f(compressor,)i
6398 -(v1.0)570 1136 y Fj(bzcat)e Fl(-)i(decompresses)f(\014les)f(to)i
6399 -(stdout)570 1267 y Fj(bzip2recover)c Fl(-)k(reco)m(v)m(ers)h(data)f
6400 -(from)f(damaged)g(bzip2)g(\014les)390 1519 y Ff(SYNOPSIS)570
6401 -1706 y Fj(bzip2)f Fl([)h(-cdfkqstvzVL123456789)35 b(])c([)g
6402 -(\014lenames)e(...)41 b(])570 1837 y Fj(bunzip2)28 b
6403 -Fl([)j(-fkvsVL)f(])h([)f(\014lenames)g(...)41 b(])570
6404 -1968 y Fj(bzcat)29 b Fl([)h(-s)h(])g([)f(\014lenames)g(...)41
6405 -b(])570 2100 y Fj(bzip2recover)27 b Fl(\014lename)390
6406 -2352 y Ff(DESCRIPTION)390 2538 y Fj(bzip2)i Fl(compresses)i(\014les)f
6407 -(using)f(the)i(Burro)m(ws-Wheeler)g(blo)s(c)m(k)f(sorting)g(text)i
6408 -(compres-)390 2642 y(sion)40 b(algorithm,)j(and)d(Hu\013man)h(co)s
6409 -(ding.)71 b(Compression)40 b(is)g(generally)g(considerably)390
6410 -2746 y(b)s(etter)25 b(than)g(that)h(ac)m(hiev)m(ed)g(b)m(y)f(more)g
6411 -(con)m(v)m(en)m(tional)h(LZ77/LZ78-based)g(compressors,)390
6412 -2850 y(and)k(approac)m(hes)h(the)f(p)s(erformance)g(of)h(the)f(PPM)g
6413 -(family)f(of)i(statistical)f(compressors.)390 3001 y(The)e
6414 -(command-line)e(options)i(are)h(delib)s(erately)d(v)m(ery)i(similar)e
6415 -(to)j(those)g(of)f(GNU)h Fj(gzip)p Fl(,)390 3104 y(but)h(they)g(are)h
6416 -(not)g(iden)m(tical.)390 3255 y Fj(bzip2)f Fl(exp)s(ects)h(a)g(list)f
6417 -(of)h(\014le)f(names)h(to)h(accompan)m(y)h(the)e(command-line)e
6418 -(\015ags.)43 b(Eac)m(h)390 3359 y(\014le)e(is)h(replaced)g(b)m(y)g(a)h
6419 -(compressed)f(v)m(ersion)g(of)g(itself,)i(with)e(the)g(name)g
6420 -Fj(original_)390 3463 y(name.bz2)p Fl(.)49 b(Eac)m(h)34
6421 -b(compressed)g(\014le)f(has)g(the)h(same)g(mo)s(di\014cation)e(date,)k
6422 -(p)s(ermissions,)390 3567 y(and,)24 b(when)f(p)s(ossible,)f(o)m
6423 -(wnership)f(as)j(the)f(corresp)s(onding)f(original,)h(so)g(that)h
6424 -(these)g(prop-)390 3671 y(erties)34 b(can)g(b)s(e)f(correctly)i
6425 -(restored)f(at)g(decompression)f(time.)51 b(File)34 b(name)g(handling)d
6426 -(is)390 3774 y(naiv)m(e)26 b(in)f(the)i(sense)f(that)h(there)f(is)f(no)
6427 -i(mec)m(hanism)e(for)h(preserving)f(original)f(\014le)i(names,)390
6428 -3878 y(p)s(ermissions,)37 b(o)m(wnerships)f(or)h(dates)i(in)d
6429 -(\014lesystems)h(whic)m(h)g(lac)m(k)h(these)g(concepts,)j(or)390
6430 -3982 y(ha)m(v)m(e)32 b(serious)d(\014le)g(name)i(length)f
6431 -(restrictions,)f(suc)m(h)h(as)h(MS-DOS.)390 4133 y Fj(bzip2)26
6432 -b Fl(and)h Fj(bunzip2)e Fl(will)f(b)m(y)k(default)e(not)i(o)m(v)m
6433 -(erwrite)g(existing)e(\014les.)38 b(If)27 b(y)m(ou)h(w)m(an)m(t)g(this)
6434 -390 4237 y(to)j(happ)s(en,)e(sp)s(ecify)g(the)i Fj(-f)e
6435 -Fl(\015ag.)390 4388 y(If)34 b(no)h(\014le)f(names)g(are)i(sp)s
6436 -(eci\014ed,)e Fj(bzip2)f Fl(compresses)i(from)f(standard)g(input)f(to)j
6437 -(stan-)390 4491 y(dard)c(output.)49 b(In)32 b(this)g(case,)k
6438 -Fj(bzip2)31 b Fl(will)g(decline)h(to)i(write)e(compressed)h(output)g
6439 -(to)h(a)390 4595 y(terminal,)29 b(as)i(this)e(w)m(ould)g(b)s(e)h(en)m
6440 -(tirely)f(incomprehensible)e(and)j(therefore)h(p)s(oin)m(tless.)390
6441 -4746 y Fj(bunzip2)36 b Fl(\(or)j Fj(bzip2)29 b(-d)p Fl(\))37
6442 -b(decompresses)i(all)e(sp)s(eci\014ed)f(\014les.)63 b(Files)37
6443 -b(whic)m(h)g(w)m(ere)i(not)390 4850 y(created)e(b)m(y)f
6444 -Fj(bzip2)f Fl(will)e(b)s(e)i(detected)j(and)d(ignored,)i(and)e(a)i(w)m
6445 -(arning)d(issued.)56 b Fj(bzip2)390 4954 y Fl(attempts)31
6446 -b(to)f(guess)g(the)g(\014lename)f(for)h(the)g(decompressed)f(\014le)g
6447 -(from)h(that)g(of)g(the)g(com-)390 5058 y(pressed)f(\014le)h(as)h
6448 -(follo)m(ws:)570 5209 y Fj(filename.bz2)57 b Fl(b)s(ecomes)31
6449 -b Fj(filename)570 5340 y(filename.bz)58 b Fl(b)s(ecomes)30
6450 -b Fj(filename)p eop
6451 -%%Page: 4 5
6452 -4 4 bop 150 -116 a Fl(Chapter)30 b(2:)41 b(Ho)m(w)31
6453 -b(to)g(use)f Fj(bzip2)2375 b Fl(4)570 299 y Fj(filename.tbz2)27
6454 -b Fl(b)s(ecomes)j Fj(filename.tar)570 470 y(filename.tbz)57
6455 -b Fl(b)s(ecomes)31 b Fj(filename.tar)570 641 y(anyothername)57
6456 -b Fl(b)s(ecomes)31 b Fj(anyothername.out)390 859 y Fl(If)j(the)h
6457 -(\014le)e(do)s(es)i(not)f(end)g(in)f(one)i(of)g(the)g(recognised)f
6458 -(endings,)g Fj(.bz2)p Fl(,)h Fj(.bz)p Fl(,)g Fj(.tbz2)e
6459 -Fl(or)390 963 y Fj(.tbz)p Fl(,)h Fj(bzip2)f Fl(complains)f(that)j(it)e
6460 -(cannot)i(guess)f(the)g(name)h(of)f(the)g(original)e(\014le,)j(and)390
6461 -1067 y(uses)30 b(the)g(original)f(name)h(with)g Fj(.out)f
6462 -Fl(app)s(ended.)390 1218 y(As)j(with)f(compression,)h(supplying)c(no)k
6463 -(\014lenames)f(causes)i(decompression)e(from)h(stan-)390
6464 -1321 y(dard)d(input)g(to)i(standard)e(output.)390 1472
6465 -y Fj(bunzip2)k Fl(will)g(correctly)j(decompress)e(a)i(\014le)e(whic)m
6466 -(h)g(is)h(the)g(concatenation)i(of)e(t)m(w)m(o)i(or)390
6467 -1576 y(more)j(compressed)f(\014les.)67 b(The)39 b(result)g(is)g(the)g
6468 -(concatenation)i(of)f(the)g(corresp)s(onding)390 1680
6469 -y(uncompressed)c(\014les.)59 b(In)m(tegrit)m(y)38 b(testing)f(\()p
6470 -Fj(-t)p Fl(\))g(of)g(concatenated)i(compressed)e(\014les)f(is)390
6471 -1784 y(also)30 b(supp)s(orted.)390 1935 y(Y)-8 b(ou)40
6472 -b(can)g(also)f(compress)g(or)g(decompress)g(\014les)g(to)h(the)f
6473 -(standard)g(output)g(b)m(y)g(giving)390 2039 y(the)30
6474 -b Fj(-c)g Fl(\015ag.)40 b(Multiple)28 b(\014les)h(ma)m(y)i(b)s(e)e
6475 -(compressed)h(and)f(decompressed)h(lik)m(e)f(this.)39
6476 -b(The)390 2142 y(resulting)31 b(outputs)i(are)h(fed)f(sequen)m(tially)f
6477 -(to)i(stdout.)49 b(Compression)32 b(of)h(m)m(ultiple)e(\014les)390
6478 -2246 y(in)24 b(this)g(manner)h(generates)h(a)g(stream)f(con)m(taining)g
6479 -(m)m(ultiple)e(compressed)i(\014le)f(represen-)390 2350
6480 -y(tations.)58 b(Suc)m(h)36 b(a)g(stream)g(can)h(b)s(e)e(decompressed)h
6481 -(correctly)h(only)e(b)m(y)h Fj(bzip2)e Fl(v)m(ersion)390
6482 -2454 y(0.9.0)g(or)e(later.)47 b(Earlier)30 b(v)m(ersions)i(of)g
6483 -Fj(bzip2)f Fl(will)f(stop)i(after)h(decompressing)e(the)i(\014rst)390
6484 -2558 y(\014le)c(in)h(the)g(stream.)390 2709 y Fj(bzcat)f
6485 -Fl(\(or)i Fj(bzip2)e(-dc)p Fl(\))g(decompresses)i(all)e(sp)s(eci\014ed)
6486 -g(\014les)g(to)i(the)g(standard)e(output.)390 2860 y
6487 -Fj(bzip2)f Fl(will)g(read)i(argumen)m(ts)g(from)f(the)h(en)m(vironmen)m
6488 -(t)g(v)-5 b(ariables)28 b Fj(BZIP2)h Fl(and)g Fj(BZIP)p
6489 -Fl(,)g(in)390 2963 y(that)24 b(order,)g(and)f(will)e(pro)s(cess)i(them)
6490 -g(b)s(efore)g(an)m(y)h(argumen)m(ts)f(read)h(from)f(the)g(command)390
6491 -3067 y(line.)39 b(This)29 b(giv)m(es)h(a)h(con)m(v)m(enien)m(t)h(w)m(a)
6492 -m(y)f(to)g(supply)d(default)i(argumen)m(ts.)390 3218
6493 -y(Compression)h(is)h(alw)m(a)m(ys)i(p)s(erformed,)e(ev)m(en)h(if)f(the)
6494 -h(compressed)g(\014le)f(is)g(sligh)m(tly)f(larger)390
6495 -3322 y(than)26 b(the)g(original.)38 b(Files)25 b(of)h(less)g(than)g(ab)
6496 -s(out)g(one)g(h)m(undred)e(b)m(ytes)j(tend)f(to)h(get)g(larger,)390
6497 -3426 y(since)34 b(the)g(compression)f(mec)m(hanism)h(has)f(a)i(constan)
6498 -m(t)g(o)m(v)m(erhead)h(in)d(the)h(region)g(of)g(50)390
6499 -3529 y(b)m(ytes.)54 b(Random)34 b(data)h(\(including)d(the)i(output)h
6500 -(of)f(most)h(\014le)f(compressors\))h(is)e(co)s(ded)390
6501 -3633 y(at)e(ab)s(out)f(8.05)i(bits)d(p)s(er)h(b)m(yte,)h(giving)e(an)h
6502 -(expansion)g(of)g(around)g(0.5\045.)390 3784 y(As)h(a)g(self-c)m(hec)m
6503 -(k)h(for)e(y)m(our)h(protection,)g Fj(bzip2)f Fl(uses)g(32-bit)h(CR)m
6504 -(Cs)f(to)i(mak)m(e)f(sure)f(that)390 3888 y(the)45 b(decompressed)f(v)m
6505 -(ersion)g(of)g(a)h(\014le)e(is)h(iden)m(tical)f(to)i(the)g(original.)81
6506 -b(This)43 b(guards)390 3992 y(against)i(corruption)e(of)h(the)h
6507 -(compressed)f(data,)49 b(and)44 b(against)h(undetected)g(bugs)e(in)390
6508 -4096 y Fj(bzip2)35 b Fl(\(hop)s(efully)e(v)m(ery)k(unlik)m(ely\).)56
6509 -b(The)36 b(c)m(hances)h(of)f(data)h(corruption)e(going)h(unde-)390
6510 -4199 y(tected)g(is)e(microscopic,)h(ab)s(out)f(one)h(c)m(hance)g(in)f
6511 -(four)g(billion)d(for)j(eac)m(h)i(\014le)d(pro)s(cessed.)390
6512 -4303 y(Be)38 b(a)m(w)m(are,)k(though,)d(that)f(the)g(c)m(hec)m(k)i(o)s
6513 -(ccurs)d(up)s(on)f(decompression,)j(so)f(it)f(can)h(only)390
6514 -4407 y(tell)28 b(y)m(ou)g(that)i(something)d(is)h(wrong.)40
6515 -b(It)28 b(can't)i(help)d(y)m(ou)i(reco)m(v)m(er)h(the)e(original)f
6516 -(uncom-)390 4511 y(pressed)h(data.)41 b(Y)-8 b(ou)30
6517 -b(can)f(use)g Fj(bzip2recover)d Fl(to)k(try)f(to)h(reco)m(v)m(er)h
6518 -(data)f(from)e(damaged)390 4614 y(\014les.)390 4766 y(Return)22
6519 -b(v)-5 b(alues:)37 b(0)23 b(for)g(a)g(normal)f(exit,)j(1)e(for)g(en)m
6520 -(vironmen)m(tal)f(problems)f(\(\014le)i(not)g(found,)390
6521 -4869 y(in)m(v)-5 b(alid)30 b(\015ags,)k(I/O)f(errors,)g(&c\),)h(2)f(to)
6522 -g(indicate)f(a)h(corrupt)f(compressed)h(\014le,)f(3)i(for)e(an)390
6523 -4973 y(in)m(ternal)d(consistency)h(error)g(\(eg,)i(bug\))e(whic)m(h)f
6524 -(caused)i Fj(bzip2)e Fl(to)i(panic.)390 5304 y Ff(OPTIONS)p
6525 -eop
6526 -%%Page: 5 6
6527 -5 5 bop 150 -116 a Fl(Chapter)30 b(2:)41 b(Ho)m(w)31
6528 -b(to)g(use)f Fj(bzip2)2375 b Fl(5)390 299 y Fj(-c)30
6529 -b(--stdout)870 403 y Fl(Compress)f(or)i(decompress)f(to)h(standard)e
6530 -(output.)390 557 y Fj(-d)h(--decompress)870 661 y Fl(F)-8
6531 -b(orce)44 b(decompression.)77 b Fj(bzip2)p Fl(,)44 b
6532 -Fj(bunzip2)d Fl(and)h Fj(bzcat)f Fl(are)i(really)f(the)870
6533 -764 y(same)27 b(program,)h(and)e(the)i(decision)d(ab)s(out)i(what)g
6534 -(actions)g(to)h(tak)m(e)g(is)e(done)870 868 y(on)k(the)h(basis)e(of)i
6535 -(whic)m(h)e(name)h(is)g(used.)40 b(This)28 b(\015ag)j(o)m(v)m(errides)f
6536 -(that)h(mec)m(h-)870 972 y(anism,)e(and)h(forces)h(bzip2)e(to)i
6537 -(decompress.)390 1126 y Fj(-z)f(--compress)870 1230 y
6538 -Fl(The)39 b(complemen)m(t)h(to)g Fj(-d)p Fl(:)59 b(forces)40
6539 -b(compression,)h(regardless)d(of)i(the)g(in-)870 1334
6540 -y(v)m(ok)-5 b(ation)31 b(name.)390 1488 y Fj(-t)f(--test)8
6541 -b Fl(Chec)m(k)33 b(in)m(tegrit)m(y)j(of)f(the)g(sp)s(eci\014ed)e
6542 -(\014le\(s\),)k(but)d(don't)h(decompress)g(them.)870
6543 -1591 y(This)40 b(really)g(p)s(erforms)g(a)i(trial)e(decompression)h
6544 -(and)g(thro)m(ws)g(a)m(w)m(a)m(y)j(the)870 1695 y(result.)390
6545 -1849 y Fj(-f)30 b(--force)870 1953 y Fl(F)-8 b(orce)31
6546 -b(o)m(v)m(erwrite)f(of)g(output)f(\014les.)40 b(Normally)-8
6547 -b(,)29 b Fj(bzip2)f Fl(will)f(not)j(o)m(v)m(erwrite)870
6548 -2057 y(existing)e(output)g(\014les.)39 b(Also)28 b(forces)h
6549 -Fj(bzip2)e Fl(to)i(break)g(hard)e(links)f(to)k(\014les,)870
6550 -2161 y(whic)m(h)f(it)h(otherwise)g(w)m(ouldn't)f(do.)390
6551 -2315 y Fj(-k)h(--keep)8 b Fl(Keep)24 b(\(don't)i(delete\))h(input)d
6552 -(\014les)g(during)g(compression)h(or)h(decompression.)390
6553 -2469 y Fj(-s)k(--small)870 2573 y Fl(Reduce)23 b(memory)f(usage,)j(for)
6554 -d(compression,)h(decompression)f(and)g(testing.)870 2676
6555 -y(Files)f(are)i(decompressed)e(and)h(tested)h(using)e(a)h(mo)s
6556 -(di\014ed)e(algorithm)h(whic)m(h)870 2780 y(only)30 b(requires)g(2.5)j
6557 -(b)m(ytes)f(p)s(er)e(blo)s(c)m(k)h(b)m(yte.)44 b(This)30
6558 -b(means)h(an)m(y)h(\014le)e(can)i(b)s(e)870 2884 y(decompressed)d(in)f
6559 -(2300k)j(of)e(memory)-8 b(,)30 b(alb)s(eit)e(at)i(ab)s(out)f(half)g
6560 -(the)g(normal)870 2988 y(sp)s(eed.)870 3117 y(During)42
6561 -b(compression,)k Fj(-s)d Fl(selects)h(a)g(blo)s(c)m(k)g(size)f(of)h
6562 -(200k,)k(whic)m(h)42 b(lim-)870 3220 y(its)33 b(memory)g(use)g(to)h
6563 -(around)e(the)i(same)f(\014gure,)h(at)g(the)g(exp)s(ense)f(of)g(y)m
6564 -(our)870 3324 y(compression)g(ratio.)50 b(In)33 b(short,)i(if)d(y)m
6565 -(our)i(mac)m(hine)f(is)g(lo)m(w)g(on)h(memory)f(\(8)870
6566 -3428 y(megab)m(ytes)42 b(or)e(less\),)j(use)d(-s)g(for)g(ev)m
6567 -(erything.)71 b(See)40 b(MEMOR)-8 b(Y)41 b(MAN-)870 3532
6568 -y(A)m(GEMENT)31 b(b)s(elo)m(w.)390 3686 y Fj(-q)f(--quiet)870
6569 -3790 y Fl(Suppress)j(non-essen)m(tial)j(w)m(arning)e(messages.)58
6570 -b(Messages)38 b(p)s(ertaining)33 b(to)870 3893 y(I/O)d(errors)g(and)g
6571 -(other)h(critical)e(ev)m(en)m(ts)j(will)27 b(not)k(b)s(e)f(suppressed.)
6572 -390 4047 y Fj(-v)g(--verbose)870 4151 y Fl(V)-8 b(erb)s(ose)28
6573 -b(mo)s(de)f({)i(sho)m(w)e(the)h(compression)f(ratio)h(for)f(eac)m(h)i
6574 -(\014le)e(pro)s(cessed.)870 4255 y(F)-8 b(urther)30 b
6575 -Fj(-v)p Fl('s)g(increase)g(the)g(v)m(erb)s(osit)m(y)g(lev)m(el,)h(sp)s
6576 -(ewing)d(out)j(lots)f(of)g(infor-)870 4359 y(mation)g(whic)m(h)f(is)h
6577 -(primarily)d(of)j(in)m(terest)h(for)f(diagnostic)g(purp)s(oses.)390
6578 -4513 y Fj(-L)g(--license)e(-V)h(--version)870 4617 y
6579 -Fl(Displa)m(y)h(the)g(soft)m(w)m(are)i(v)m(ersion,)e(license)f(terms)i
6580 -(and)e(conditions.)390 4771 y Fj(-1)h(to)g(-9)72 b Fl(Set)35
6581 -b(the)g(blo)s(c)m(k)f(size)h(to)g(100)h(k,)g(200)g(k)f(..)53
6582 -b(900)36 b(k)f(when)f(compressing.)53 b(Has)870 4875
6583 -y(no)41 b(e\013ect)h(when)d(decompressing.)71 b(See)41
6584 -b(MEMOR)-8 b(Y)41 b(MANA)m(GEMENT)870 4978 y(b)s(elo)m(w.)390
6585 -5132 y Fj(--)324 b Fl(T)-8 b(reats)25 b(all)e(subsequen)m(t)g(argumen)m
6586 -(ts)i(as)f(\014le)g(names,)h(ev)m(en)g(if)e(they)i(start)f(with)870
6587 -5236 y(a)32 b(dash.)43 b(This)29 b(is)h(so)i(y)m(ou)g(can)f(handle)f
6588 -(\014les)g(with)g(names)i(b)s(eginning)c(with)870 5340
6589 -y(a)j(dash,)f(for)g(example:)40 b Fj(bzip2)29 b(--)h(-myfilename)p
6590 -Fl(.)p eop
6591 -%%Page: 6 7
6592 -6 6 bop 150 -116 a Fl(Chapter)30 b(2:)41 b(Ho)m(w)31
6593 -b(to)g(use)f Fj(bzip2)2375 b Fl(6)390 299 y Fj(--repetitive-fast)390
6594 -427 y(--repetitive-best)870 530 y Fl(These)34 b(\015ags)g(are)h
6595 -(redundan)m(t)e(in)g(v)m(ersions)g(0.9.5)j(and)e(ab)s(o)m(v)m(e.)53
6596 -b(They)34 b(pro-)870 634 y(vided)h(some)i(coarse)g(con)m(trol)g(o)m(v)m
6597 -(er)g(the)g(b)s(eha)m(viour)e(of)h(the)g(sorting)g(algo-)870
6598 -738 y(rithm)h(in)h(earlier)g(v)m(ersions,)j(whic)m(h)d(w)m(as)h
6599 -(sometimes)h(useful.)65 b(0.9.5)41 b(and)870 842 y(ab)s(o)m(v)m(e)34
6600 -b(ha)m(v)m(e)g(an)f(impro)m(v)m(ed)g(algorithm)f(whic)m(h)f(renders)h
6601 -(these)h(\015ags)h(irrel-)870 946 y(ev)-5 b(an)m(t.)390
6602 -1190 y Ff(MEMOR)-10 b(Y)40 b(MANA)m(GEMENT)390 1377 y
6603 -Fj(bzip2)25 b Fl(compresses)i(large)g(\014les)e(in)g(blo)s(c)m(ks.)39
6604 -b(The)26 b(blo)s(c)m(k)h(size)f(a\013ects)i(b)s(oth)e(the)h(compres-)
6605 -390 1481 y(sion)39 b(ratio)g(ac)m(hiev)m(ed,)k(and)d(the)f(amoun)m(t)i
6606 -(of)e(memory)h(needed)f(for)h(compression)f(and)390 1585
6607 -y(decompression.)59 b(The)36 b(\015ags)h Fj(-1)f Fl(through)h
6608 -Fj(-9)f Fl(sp)s(ecify)f(the)i(blo)s(c)m(k)g(size)f(to)i(b)s(e)e
6609 -(100,000)390 1688 y(b)m(ytes)29 b(through)e(900,000)k(b)m(ytes)d(\(the)
6610 -h(default\))e(resp)s(ectiv)m(ely)-8 b(.)40 b(A)m(t)29
6611 -b(decompression)e(time,)390 1792 y(the)32 b(blo)s(c)m(k)g(size)g(used)g
6612 -(for)g(compression)f(is)g(read)h(from)g(the)g(header)g(of)h(the)f
6613 -(compressed)390 1896 y(\014le,)j(and)f Fj(bunzip2)e Fl(then)i(allo)s
6614 -(cates)h(itself)e(just)h(enough)g(memory)g(to)i(decompress)e(the)390
6615 -2000 y(\014le.)39 b(Since)29 b(blo)s(c)m(k)g(sizes)g(are)h(stored)f(in)
6616 -f(compressed)h(\014les,)g(it)g(follo)m(ws)f(that)i(the)g(\015ags)g
6617 -Fj(-1)390 2103 y Fl(to)h Fj(-9)f Fl(are)h(irrelev)-5
6618 -b(an)m(t)29 b(to)i(and)f(so)h(ignored)e(during)f(decompression.)390
6619 -2255 y(Compression)h(and)g(decompression)h(requiremen)m(ts,)f(in)g(b)m
6620 -(ytes,)j(can)e(b)s(e)g(estimated)h(as:)869 2406 y Fj(Compression:)140
6621 -b(400k)46 b(+)i(\()f(8)h(x)f(block)f(size)h(\))869 2613
6622 -y(Decompression:)d(100k)i(+)i(\()f(4)h(x)f(block)f(size)h(\),)g(or)1585
6623 -2717 y(100k)f(+)i(\()f(2.5)g(x)g(block)g(size)f(\))390
6624 -2868 y Fl(Larger)29 b(blo)s(c)m(k)f(sizes)h(giv)m(e)g(rapidly)d
6625 -(diminishing)e(marginal)k(returns.)39 b(Most)29 b(of)g(the)g(com-)390
6626 -2972 y(pression)d(comes)j(from)f(the)g(\014rst)g(t)m(w)m(o)h(or)f
6627 -(three)h(h)m(undred)d(k)i(of)g(blo)s(c)m(k)g(size,)g(a)h(fact)g(w)m
6628 -(orth)390 3075 y(b)s(earing)j(in)f(mind)g(when)h(using)f
6629 -Fj(bzip2)h Fl(on)g(small)g(mac)m(hines.)47 b(It)33 b(is)f(also)h(imp)s
6630 -(ortan)m(t)f(to)390 3179 y(appreciate)j(that)h(the)f(decompression)f
6631 -(memory)h(requiremen)m(t)f(is)h(set)g(at)h(compression)390
6632 -3283 y(time)30 b(b)m(y)g(the)h(c)m(hoice)g(of)g(blo)s(c)m(k)f(size.)390
6633 -3434 y(F)-8 b(or)45 b(\014les)f(compressed)g(with)g(the)g(default)g
6634 -(900k)i(blo)s(c)m(k)e(size,)49 b Fj(bunzip2)42 b Fl(will)g(require)390
6635 -3538 y(ab)s(out)29 b(3700)j(kb)m(ytes)e(to)h(decompress.)40
6636 -b(T)-8 b(o)30 b(supp)s(ort)e(decompression)h(of)h(an)m(y)g(\014le)f(on)
6637 -g(a)i(4)390 3642 y(megab)m(yte)h(mac)m(hine,)d Fj(bunzip2)f
6638 -Fl(has)i(an)g(option)f(to)i(decompress)e(using)g(appro)m(ximately)390
6639 -3745 y(half)k(this)g(amoun)m(t)i(of)f(memory)-8 b(,)36
6640 -b(ab)s(out)e(2300)i(kb)m(ytes.)53 b(Decompression)34
6641 -b(sp)s(eed)g(is)f(also)390 3849 y(halv)m(ed,)i(so)f(y)m(ou)h(should)d
6642 -(use)h(this)g(option)h(only)f(where)h(necessary)-8 b(.)53
6643 -b(The)33 b(relev)-5 b(an)m(t)35 b(\015ag)390 3953 y(is)29
6644 -b Fj(-s)p Fl(.)390 4104 y(In)34 b(general,)i(try)f(and)f(use)g(the)h
6645 -(largest)h(blo)s(c)m(k)e(size)h(memory)f(constrain)m(ts)h(allo)m(w,)h
6646 -(since)390 4208 y(that)45 b(maximises)f(the)h(compression)f(ac)m(hiev)m
6647 -(ed.)85 b(Compression)43 b(and)h(decompression)390 4311
6648 -y(sp)s(eed)30 b(are)g(virtually)e(una\013ected)j(b)m(y)f(blo)s(c)m(k)g
6649 -(size.)390 4463 y(Another)25 b(signi\014can)m(t)f(p)s(oin)m(t)g
6650 -(applies)f(to)j(\014les)e(whic)m(h)g(\014t)h(in)e(a)j(single)d(blo)s(c)
6651 -m(k)i({)g(that)h(means)390 4566 y(most)g(\014les)g(y)m(ou'd)g(encoun)m
6652 -(ter)h(using)d(a)j(large)f(blo)s(c)m(k)g(size.)39 b(The)25
6653 -b(amoun)m(t)i(of)f(real)g(memory)390 4670 y(touc)m(hed)38
6654 -b(is)e(prop)s(ortional)f(to)j(the)f(size)g(of)h(the)f(\014le,)h(since)f
6655 -(the)g(\014le)g(is)f(smaller)g(than)h(a)390 4774 y(blo)s(c)m(k.)49
6656 -b(F)-8 b(or)35 b(example,)f(compressing)e(a)i(\014le)e(20,000)k(b)m
6657 -(ytes)e(long)f(with)f(the)i(\015ag)g Fj(-9)f Fl(will)390
6658 -4878 y(cause)28 b(the)f(compressor)g(to)h(allo)s(cate)f(around)f(7600k)
6659 -j(of)e(memory)-8 b(,)28 b(but)f(only)f(touc)m(h)i(400k)390
6660 -4981 y Fj(+)h Fl(20000)j(*)e(8)g(=)f(560)i(kb)m(ytes)f(of)g(it.)40
6661 -b(Similarly)-8 b(,)26 b(the)k(decompressor)f(will)e(allo)s(cate)j
6662 -(3700k)390 5085 y(but)g(only)f(touc)m(h)i(100k)h Fj(+)e
6663 -Fl(20000)i(*)f(4)g(=)f(180)i(kb)m(ytes.)390 5236 y(Here)41
6664 -b(is)f(a)i(table)f(whic)m(h)e(summarises)g(the)j(maxim)m(um)d(memory)i
6665 -(usage)h(for)e(di\013eren)m(t)390 5340 y(blo)s(c)m(k)25
6666 -b(sizes.)38 b(Also)25 b(recorded)g(is)f(the)i(total)g(compressed)e
6667 -(size)h(for)g(14)h(\014les)e(of)i(the)f(Calgary)p eop
6668 -%%Page: 7 8
6669 -7 7 bop 150 -116 a Fl(Chapter)30 b(2:)41 b(Ho)m(w)31
6670 -b(to)g(use)f Fj(bzip2)2375 b Fl(7)390 299 y(T)-8 b(ext)38
6671 -b(Compression)d(Corpus)h(totalling)h(3,141,622)k(b)m(ytes.)61
6672 -b(This)36 b(column)g(giv)m(es)i(some)390 403 y(feel)23
6673 -b(for)f(ho)m(w)h(compression)f(v)-5 b(aries)23 b(with)e(blo)s(c)m(k)i
6674 -(size.)38 b(These)23 b(\014gures)f(tend)g(to)i(understate)390
6675 -506 y(the)g(adv)-5 b(an)m(tage)26 b(of)e(larger)f(blo)s(c)m(k)h(sizes)f
6676 -(for)h(larger)f(\014les,)h(since)g(the)g(Corpus)e(is)h(dominated)390
6677 -610 y(b)m(y)30 b(smaller)f(\014les.)1107 761 y Fj(Compress)141
6678 -b(Decompress)g(Decompress)f(Corpus)773 865 y(Flag)238
6679 -b(usage)285 b(usage)332 b(-s)48 b(usage)237 b(Size)821
6680 -1073 y(-1)286 b(1200k)332 b(500k)429 b(350k)285 b(914704)821
6681 -1176 y(-2)h(2000k)332 b(900k)429 b(600k)285 b(877703)821
6682 -1280 y(-3)h(2800k)f(1300k)428 b(850k)285 b(860338)821
6683 -1384 y(-4)h(3600k)f(1700k)380 b(1100k)285 b(846899)821
6684 -1488 y(-5)h(4400k)f(2100k)380 b(1350k)285 b(845160)821
6685 -1591 y(-6)h(5200k)f(2500k)380 b(1600k)285 b(838626)821
6686 -1695 y(-7)h(6100k)f(2900k)380 b(1850k)285 b(834096)821
6687 -1799 y(-8)h(6800k)f(3300k)380 b(2100k)285 b(828642)821
6688 -1903 y(-9)h(7600k)f(3700k)380 b(2350k)285 b(828642)390
6689 -2147 y Ff(RECO)m(VERING)37 b(D)m(A)-10 b(T)g(A)40 b(FR)m(OM)h(D)m(AMA)m
6690 -(GED)e(FILES)390 2333 y Fj(bzip2)25 b Fl(compresses)h(\014les)g(in)f
6691 -(blo)s(c)m(ks,)h(usually)e(900kb)m(ytes)29 b(long.)39
6692 -b(Eac)m(h)27 b(blo)s(c)m(k)e(is)h(handled)390 2437 y(indep)s(enden)m
6693 -(tly)-8 b(.)47 b(If)32 b(a)i(media)e(or)h(transmission)e(error)i
6694 -(causes)h(a)f(m)m(ulti-blo)s(c)m(k)f Fj(.bz2)g Fl(\014le)390
6695 -2541 y(to)k(b)s(ecome)h(damaged,)g(it)e(ma)m(y)i(b)s(e)e(p)s(ossible)e
6696 -(to)k(reco)m(v)m(er)g(data)f(from)g(the)f(undamaged)390
6697 -2645 y(blo)s(c)m(ks)30 b(in)f(the)h(\014le.)390 2796
6698 -y(The)j(compressed)h(represen)m(tation)f(of)h(eac)m(h)h(blo)s(c)m(k)e
6699 -(is)g(delimited)e(b)m(y)j(a)g(48-bit)g(pattern,)390 2900
6700 -y(whic)m(h)27 b(mak)m(es)j(it)e(p)s(ossible)e(to)j(\014nd)e(the)i(blo)s
6701 -(c)m(k)f(b)s(oundaries)e(with)i(reasonable)g(certain)m(t)m(y)-8
6702 -b(.)390 3003 y(Eac)m(h)34 b(blo)s(c)m(k)f(also)g(carries)g(its)g(o)m
6703 -(wn)g(32-bit)g(CR)m(C,)h(so)f(damaged)h(blo)s(c)m(ks)f(can)g(b)s(e)g
6704 -(distin-)390 3107 y(guished)c(from)h(undamaged)g(ones.)390
6705 -3258 y Fj(bzip2recover)37 b Fl(is)j(a)h(simple)e(program)h(whose)g
6706 -(purp)s(ose)f(is)h(to)i(searc)m(h)f(for)f(blo)s(c)m(ks)g(in)390
6707 -3362 y Fj(.bz2)34 b Fl(\014les,)i(and)f(write)f(eac)m(h)j(blo)s(c)m(k)d
6708 -(out)i(in)m(to)f(its)g(o)m(wn)g Fj(.bz2)f Fl(\014le.)55
6709 -b(Y)-8 b(ou)36 b(can)f(then)g(use)390 3466 y Fj(bzip2)29
6710 -b(-t)c Fl(to)i(test)f(the)g(in)m(tegrit)m(y)g(of)g(the)g(resulting)e
6711 -(\014les,)i(and)f(decompress)h(those)g(whic)m(h)390 3569
6712 -y(are)31 b(undamaged.)390 3721 y Fj(bzip2recover)41 b
6713 -Fl(tak)m(es)46 b(a)f(single)e(argumen)m(t,)49 b(the)44
6714 -b(name)h(of)g(the)f(damaged)h(\014le,)j(and)390 3824
6715 -y(writes)33 b(a)i(n)m(um)m(b)s(er)d(of)j(\014les)e Fj(rec0001file.bz2)p
6716 -Fl(,)e Fj(rec0002file.bz2)p Fl(,)g(etc,)36 b(con)m(taining)390
6717 -3928 y(the)42 b(extracted)g(blo)s(c)m(ks.)74 b(The)41
6718 -b(output)g(\014lenames)f(are)i(designed)e(so)i(that)g(the)g(use)f(of)
6719 -390 4032 y(wildcards)30 b(in)h(subsequen)m(t)h(pro)s(cessing)f({)i(for)
6720 -g(example,)g Fj(bzip2)c(-dc)g(rec*file.bz2)e(>)390 4136
6721 -y(recovered_data)f Fl({)31 b(lists)e(the)i(\014les)e(in)g(the)i
6722 -(correct)g(order.)390 4287 y Fj(bzip2recover)38 b Fl(should)i(b)s(e)g
6723 -(of)i(most)g(use)f(dealing)f(with)g(large)i Fj(.bz2)e
6724 -Fl(\014les,)k(as)d(these)390 4390 y(will)29 b(con)m(tain)j(man)m(y)g
6725 -(blo)s(c)m(ks.)45 b(It)32 b(is)f(clearly)g(futile)f(to)i(use)g(it)f(on)
6726 -h(damaged)g(single-blo)s(c)m(k)390 4494 y(\014les,)g(since)f(a)h
6727 -(damaged)h(blo)s(c)m(k)e(cannot)i(b)s(e)e(reco)m(v)m(ered.)47
6728 -b(If)32 b(y)m(ou)g(wish)e(to)j(minimise)c(an)m(y)390
6729 -4598 y(p)s(oten)m(tial)36 b(data)i(loss)e(through)g(media)h(or)f
6730 -(transmission)f(errors,)j(y)m(ou)f(migh)m(t)g(consider)390
6731 -4702 y(compressing)29 b(with)g(a)i(smaller)e(blo)s(c)m(k)h(size.)390
6732 -4946 y Ff(PERF)m(ORMANCE)39 b(NOTES)390 5132 y Fl(The)f(sorting)f
6733 -(phase)h(of)h(compression)e(gathers)i(together)h(similar)35
6734 -b(strings)i(in)g(the)i(\014le.)390 5236 y(Because)54
6735 -b(of)f(this,)58 b(\014les)52 b(con)m(taining)g(v)m(ery)h(long)g(runs)e
6736 -(of)i(rep)s(eated)g(sym)m(b)s(ols,)58 b(lik)m(e)390 5340
6737 -y Fj(")p Fl(aabaabaabaab)e(...)p Fj(")g Fl(\(rep)s(eated)g(sev)m(eral)f
6738 -(h)m(undred)e(times\))i(ma)m(y)h(compress)f(more)p eop
6739 -%%Page: 8 9
6740 -8 8 bop 150 -116 a Fl(Chapter)30 b(2:)41 b(Ho)m(w)31
6741 -b(to)g(use)f Fj(bzip2)2375 b Fl(8)390 299 y(slo)m(wly)33
6742 -b(than)g(normal.)50 b(V)-8 b(ersions)33 b(0.9.5)i(and)f(ab)s(o)m(v)m(e)
6743 -h(fare)e(m)m(uc)m(h)h(b)s(etter)g(than)f(previous)390
6744 -403 y(v)m(ersions)i(in)g(this)f(resp)s(ect.)57 b(The)35
6745 -b(ratio)h(b)s(et)m(w)m(een)h(w)m(orst-case)g(and)e(a)m(v)m(erage-case)
6746 -40 b(com-)390 506 y(pression)e(time)h(is)f(in)g(the)h(region)g(of)h
6747 -(10:1.)69 b(F)-8 b(or)40 b(previous)e(v)m(ersions,)j(this)d(\014gure)h
6748 -(w)m(as)390 610 y(more)f(lik)m(e)g(100:1.)66 b(Y)-8 b(ou)38
6749 -b(can)h(use)e(the)i Fj(-vvvv)d Fl(option)i(to)h(monitor)e(progress)h
6750 -(in)f(great)390 714 y(detail,)30 b(if)f(y)m(ou)i(w)m(an)m(t.)390
6751 -865 y(Decompression)f(sp)s(eed)g(is)f(una\013ected)i(b)m(y)f(these)h
6752 -(phenomena.)390 1016 y Fj(bzip2)i Fl(usually)g(allo)s(cates)i(sev)m
6753 -(eral)f(megab)m(ytes)j(of)d(memory)h(to)g(op)s(erate)h(in,)e(and)g
6754 -(then)390 1120 y(c)m(harges)k(all)d(o)m(v)m(er)j(it)f(in)e(a)i(fairly)e
6755 -(random)h(fashion.)59 b(This)34 b(means)j(that)g(p)s(erformance,)390
6756 -1224 y(b)s(oth)27 b(for)h(compressing)f(and)g(decompressing,)h(is)f
6757 -(largely)g(determined)g(b)m(y)h(the)g(sp)s(eed)f(at)390
6758 -1327 y(whic)m(h)35 b(y)m(our)h(mac)m(hine)g(can)g(service)g(cac)m(he)i
6759 -(misses.)57 b(Because)37 b(of)g(this,)f(small)f(c)m(hanges)390
6760 -1431 y(to)f(the)f(co)s(de)h(to)f(reduce)g(the)h(miss)d(rate)j(ha)m(v)m
6761 -(e)h(b)s(een)d(observ)m(ed)h(to)h(giv)m(e)g(disprop)s(ortion-)390
6762 -1535 y(ately)i(large)f(p)s(erformance)f(impro)m(v)m(emen)m(ts.)56
6763 -b(I)35 b(imagine)f Fj(bzip2)g Fl(will)e(p)s(erform)i(b)s(est)h(on)390
6764 -1639 y(mac)m(hines)30 b(with)f(v)m(ery)i(large)f(cac)m(hes.)390
6765 -1885 y Ff(CA)-14 b(VEA)k(TS)390 2072 y Fl(I/O)38 b(error)g(messages)h
6766 -(are)f(not)h(as)f(helpful)e(as)i(they)g(could)f(b)s(e.)64
6767 -b Fj(bzip2)37 b Fl(tries)g(hard)g(to)390 2176 y(detect)29
6768 -b(I/O)e(errors)g(and)f(exit)i(cleanly)-8 b(,)27 b(but)g(the)h(details)e
6769 -(of)h(what)h(the)f(problem)f(is)g(some-)390 2280 y(times)k(seem)h
6770 -(rather)f(misleading.)390 2431 y(This)j(man)m(ual)g(page)i(p)s(ertains)
6771 -e(to)i(v)m(ersion)f(1.0)i(of)e Fj(bzip2)p Fl(.)51 b(Compressed)34
6772 -b(data)h(created)390 2534 y(b)m(y)25 b(this)e(v)m(ersion)i(is)e(en)m
6773 -(tirely)h(forw)m(ards)h(and)f(bac)m(kw)m(ards)h(compatible)f(with)f
6774 -(the)i(previous)390 2638 y(public)18 b(releases,)24 b(v)m(ersions)c
6775 -(0.1pl2,)k(0.9.0)e(and)f(0.9.5,)k(but)20 b(with)g(the)h(follo)m(wing)e
6776 -(exception:)390 2742 y(0.9.0)43 b(and)e(ab)s(o)m(v)m(e)h(can)g
6777 -(correctly)f(decompress)g(m)m(ultiple)e(concatenated)k(compressed)390
6778 -2846 y(\014les.)c(0.1pl2)30 b(cannot)g(do)f(this;)f(it)h(will)e(stop)i
6779 -(after)h(decompressing)e(just)g(the)i(\014rst)e(\014le)g(in)390
6780 -2949 y(the)j(stream.)390 3100 y Fj(bzip2recover)20 b
6781 -Fl(uses)k(32-bit)g(in)m(tegers)f(to)i(represen)m(t)f(bit)e(p)s
6782 -(ositions)g(in)g(compressed)i(\014les,)390 3204 y(so)j(it)f(cannot)i
6783 -(handle)d(compressed)i(\014les)f(more)h(than)f(512)i(megab)m(ytes)h
6784 -(long.)39 b(This)25 b(could)390 3308 y(easily)30 b(b)s(e)f(\014xed.)390
6785 -3555 y Ff(A)m(UTHOR)390 3741 y Fl(Julian)f(Sew)m(ard,)i
6786 -Fj(jseward@acm.org)p Fl(.)390 3892 y(The)24 b(ideas)f(em)m(b)s(o)s
6787 -(died)f(in)h Fj(bzip2)f Fl(are)j(due)e(to)i(\(at)g(least\))g(the)f
6788 -(follo)m(wing)e(p)s(eople:)37 b(Mic)m(hael)390 3996 y(Burro)m(ws)48
6789 -b(and)g(Da)m(vid)h(Wheeler)f(\(for)h(the)g(blo)s(c)m(k)f(sorting)g
6790 -(transformation\),)53 b(Da)m(vid)390 4100 y(Wheeler)45
6791 -b(\(again,)50 b(for)45 b(the)g(Hu\013man)g(co)s(der\),)k(P)m(eter)d(F)
6792 --8 b(en)m(wic)m(k)46 b(\(for)g(the)f(structured)390 4204
6793 -y(co)s(ding)26 b(mo)s(del)g(in)f(the)i(original)e Fj(bzip)p
6794 -Fl(,)i(and)f(man)m(y)h(re\014nemen)m(ts\),)h(and)e(Alistair)f
6795 -(Mo\013at,)390 4307 y(Radford)34 b(Neal)h(and)f(Ian)h(Witten)g(\(for)f
6796 -(the)h(arithmetic)g(co)s(der)f(in)g(the)h(original)d
6797 -Fj(bzip)p Fl(\).)390 4411 y(I)41 b(am)g(m)m(uc)m(h)h(indebted)e(for)h
6798 -(their)f(help,)j(supp)s(ort)c(and)i(advice.)74 b(See)41
6799 -b(the)h(man)m(ual)e(in)390 4515 y(the)28 b(source)g(distribution)23
6800 -b(for)28 b(p)s(oin)m(ters)e(to)j(sources)e(of)h(do)s(cumen)m(tation.)40
6801 -b(Christian)25 b(v)m(on)390 4619 y(Ro)s(ques)31 b(encouraged)h(me)g(to)
6802 -g(lo)s(ok)f(for)h(faster)g(sorting)f(algorithms,)f(so)i(as)g(to)g(sp)s
6803 -(eed)f(up)390 4723 y(compression.)47 b(Bela)34 b(Lubkin)c(encouraged)k
6804 -(me)f(to)g(impro)m(v)m(e)g(the)g(w)m(orst-case)i(compres-)390
6805 -4826 y(sion)25 b(p)s(erformance.)38 b(Man)m(y)26 b(p)s(eople)f(sen)m(t)
6806 -h(patc)m(hes,)h(help)s(ed)d(with)g(p)s(ortabilit)m(y)f(problems,)390
6807 -4930 y(len)m(t)30 b(mac)m(hines,)g(ga)m(v)m(e)j(advice)d(and)g(w)m(ere)
6808 -h(generally)f(helpful.)p eop
6809 -%%Page: 9 10
6810 -9 9 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
6811 -b(with)g Fj(libbzip2)1927 b Fl(9)150 299 y Fh(3)80 b(Programming)53
6812 -b(with)h Fg(libbzip2)150 568 y Fl(This)29 b(c)m(hapter)i(describ)s(es)d
6813 -(the)j(programming)e(in)m(terface)i(to)g Fj(libbzip2)p
6814 -Fl(.)150 725 y(F)-8 b(or)36 b(general)e(bac)m(kground)h(information,)f
6815 -(particularly)f(ab)s(out)h(memory)h(use)f(and)g(p)s(erformance)g(as-)
6816 -150 834 y(p)s(ects,)d(y)m(ou'd)f(b)s(e)g(w)m(ell)f(advised)g(to)j(read)
6817 -e(Chapter)g(2)g(as)h(w)m(ell.)150 1124 y Fk(3.1)68 b(T)-11
6818 -b(op-lev)l(el)46 b(structure)150 1316 y Fj(libbzip2)33
6819 -b Fl(is)i(a)h(\015exible)e(library)f(for)j(compressing)f(and)g
6820 -(decompressing)f(data)j(in)d(the)i Fj(bzip2)e Fl(data)150
6821 -1426 y(format.)39 b(Although)24 b(pac)m(k)-5 b(aged)26
6822 -b(as)e(a)h(single)e(en)m(tit)m(y)-8 b(,)27 b(it)d(helps)f(to)i(regard)g
6823 -(the)g(library)d(as)i(three)h(separate)150 1535 y(parts:)40
6824 -b(the)31 b(lo)m(w)f(lev)m(el)g(in)m(terface,)h(and)f(the)h(high)e(lev)m
6825 -(el)h(in)m(terface,)h(and)f(some)h(utilit)m(y)d(functions.)150
6826 -1692 y(The)38 b(structure)g(of)g Fj(libbzip2)p Fl('s)e(in)m(terfaces)j
6827 -(is)e(similar)f(to)j(that)g(of)g(Jean-loup)e(Gailly's)g(and)h(Mark)150
6828 -1802 y(Adler's)29 b(excellen)m(t)i Fj(zlib)e Fl(library)-8
6829 -b(.)150 1959 y(All)29 b(externally)g(visible)f(sym)m(b)s(ols)h(ha)m(v)m
6830 -(e)i(names)f(b)s(eginning)e Fj(BZ2_)p Fl(.)39 b(This)29
6831 -b(is)g(new)h(in)f(v)m(ersion)h(1.0.)41 b(The)150 2068
6832 -y(in)m(ten)m(tion)30 b(is)f(to)i(minimise)d(p)s(ollution)f(of)k(the)f
6833 -(namespaces)h(of)g(library)d(clien)m(ts.)150 2321 y Ff(3.1.1)63
6834 -b(Lo)m(w-lev)m(el)39 b(summary)150 2514 y Fl(This)21
6835 -b(in)m(terface)h(pro)m(vides)g(services)g(for)g(compressing)f(and)h
6836 -(decompressing)f(data)i(in)e(memory)-8 b(.)38 b(There's)150
6837 -2623 y(no)43 b(pro)m(vision)e(for)h(dealing)g(with)f(\014les,)k
6838 -(streams)e(or)g(an)m(y)g(other)g(I/O)g(mec)m(hanisms,)i(just)e(straigh)
6839 -m(t)150 2733 y(memory-to-memory)25 b(w)m(ork.)38 b(In)23
6840 -b(fact,)k(this)22 b(part)i(of)f(the)h(library)d(can)j(b)s(e)f(compiled)
6841 -f(without)h(inclusion)150 2843 y(of)31 b Fj(stdio.h)p
6842 -Fl(,)d(whic)m(h)h(ma)m(y)i(b)s(e)f(helpful)d(for)k(em)m(b)s(edded)e
6843 -(applications.)150 2999 y(The)h(lo)m(w-lev)m(el)g(part)g(of)h(the)f
6844 -(library)e(has)i(no)h(global)e(v)-5 b(ariables)29 b(and)h(is)g
6845 -(therefore)g(thread-safe.)150 3156 y(Six)d(routines)g(mak)m(e)j(up)d
6846 -(the)i(lo)m(w)f(lev)m(el)g(in)m(terface:)41 b Fj(BZ2_bzCompressInit)p
6847 -Fl(,)24 b Fj(BZ2_bzCompress)p Fl(,)h(and)150 3266 y Fj
6848 -(BZ2_bzCompressEnd)h Fl(for)k(compression,)f(and)h(a)h(corresp)s
6849 -(onding)d(trio)i Fj(BZ2_bzDecompressInit)p Fl(,)150 3375
6850 -y Fj(BZ2_bzDecompress)37 b Fl(and)j Fj(BZ2_bzDecompressEnd)c
6851 -Fl(for)42 b(decompression.)72 b(The)41 b Fj(*Init)e Fl(functions)150
6852 -3485 y(allo)s(cate)44 b(memory)g(for)f(compression/decompression)f(and)
6853 -h(do)h(other)g(initialisations,)f(whilst)f(the)150 3595
6854 -y Fj(*End)29 b Fl(functions)g(close)i(do)m(wn)f(op)s(erations)f(and)h
6855 -(release)h(memory)-8 b(.)150 3751 y(The)36 b(real)f(w)m(ork)i(is)e
6856 -(done)h(b)m(y)g Fj(BZ2_bzCompress)c Fl(and)j Fj(BZ2_bzDecompress)p
6857 -Fl(.)54 b(These)36 b(compress)g(and)150 3861 y(decompress)30
6858 -b(data)h(from)f(a)h(user-supplied)c(input)i(bu\013er)g(to)i(a)g
6859 -(user-supplied)c(output)j(bu\013er.)40 b(These)150 3971
6860 -y(bu\013ers)32 b(can)i(b)s(e)e(an)m(y)i(size;)g(arbitrary)e(quan)m
6861 -(tities)h(of)g(data)h(are)g(handled)d(b)m(y)i(making)f(rep)s(eated)i
6862 -(calls)150 4080 y(to)f(these)f(functions.)44 b(This)30
6863 -b(is)h(a)h(\015exible)e(mec)m(hanism)i(allo)m(wing)e(a)i(consumer-pull)
6864 -e(st)m(yle)i(of)g(activit)m(y)-8 b(,)150 4190 y(or)30
6865 -b(pro)s(ducer-push,)e(or)i(a)h(mixture)e(of)i(b)s(oth.)150
6866 -4443 y Ff(3.1.2)63 b(High-lev)m(el)41 b(summary)150 4635
6867 -y Fl(This)d(in)m(terface)j(pro)m(vides)e(some)h(handy)f(wrapp)s(ers)f
6868 -(around)h(the)i(lo)m(w-lev)m(el)f(in)m(terface)g(to)h(facilitate)150
6869 -4745 y(reading)26 b(and)g(writing)f Fj(bzip2)g Fl(format)i(\014les)f
6870 -(\()p Fj(.bz2)g Fl(\014les\).)38 b(The)27 b(routines)e(pro)m(vide)h(ho)
6871 -s(oks)h(to)g(facilitate)150 4854 y(reading)43 b(\014les)f(in)h(whic)m
6872 -(h)f(the)i Fj(bzip2)f Fl(data)h(stream)g(is)f(em)m(b)s(edded)f(within)g
6873 -(some)i(larger-scale)g(\014le)150 4964 y(structure,)30
6874 -b(or)h(where)e(there)i(are)g(m)m(ultiple)d Fj(bzip2)h
6875 -Fl(data)i(streams)f(concatenated)j(end-to-end.)150 5121
6876 -y(F)-8 b(or)31 b(reading)f(\014les,)f Fj(BZ2_bzReadOpen)p
6877 -Fl(,)e Fj(BZ2_bzRead)p Fl(,)h Fj(BZ2_bzReadClose)e Fl(and)150
6878 -5230 y Fj(BZ2_bzReadGetUnused)19 b Fl(are)25 b(supplied.)36
6879 -b(F)-8 b(or)25 b(writing)d(\014les,)j Fj(BZ2_bzWriteOpen)p
6880 -Fl(,)d Fj(BZ2_bzWrite)g Fl(and)150 5340 y Fj(BZ2_bzWriteFinish)k
6881 -Fl(are)k(a)m(v)-5 b(ailable.)p eop
6882 -%%Page: 10 11
6883 -10 10 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
6884 -b(with)g Fj(libbzip2)1881 b Fl(10)150 299 y(As)24 b(with)f(the)h(lo)m
6885 -(w-lev)m(el)h(library)-8 b(,)23 b(no)h(global)g(v)-5
6886 -b(ariables)23 b(are)h(used)g(so)g(the)h(library)c(is)j(p)s(er)f(se)h
6887 -(thread-safe.)150 408 y(Ho)m(w)m(ev)m(er,)32 b(if)c(I/O)h(errors)g(o)s
6888 -(ccur)g(whilst)e(reading)i(or)g(writing)e(the)j(underlying)c
6889 -(compressed)j(\014les,)g(y)m(ou)150 518 y(ma)m(y)j(ha)m(v)m(e)g(to)g
6890 -(consult)e Fj(errno)g Fl(to)h(determine)g(the)g(cause)g(of)h(the)f
6891 -(error.)42 b(In)30 b(that)i(case,)h(y)m(ou'd)e(need)g(a)150
6892 -628 y(C)f(library)e(whic)m(h)h(correctly)i(supp)s(orts)d
6893 -Fj(errno)h Fl(in)g(a)i(m)m(ultithreaded)e(en)m(vironmen)m(t.)150
6894 -784 y(T)-8 b(o)56 b(mak)m(e)g(the)g(library)d(a)j(little)e(simpler)f
6895 -(and)i(more)h(p)s(ortable,)61 b Fj(BZ2_bzReadOpen)51
6896 -b Fl(and)k Fj(BZ2_)150 894 y(bzWriteOpen)34 b Fl(require)j(y)m(ou)g(to)
6897 -i(pass)e(them)g(\014le)g(handles)f(\()p Fj(FILE*)p Fl(s\))g(whic)m(h)h
6898 -(ha)m(v)m(e)h(previously)e(b)s(een)150 1004 y(op)s(ened)41
6899 -b(for)g(reading)f(or)h(writing)f(resp)s(ectiv)m(ely)-8
6900 -b(.)73 b(That)41 b(a)m(v)m(oids)h(p)s(ortabilit)m(y)d(problems)g(asso)s
6901 -(ciated)150 1113 y(with)j(\014le)h(op)s(erations)g(and)g(\014le)g
6902 -(attributes,)j(whilst)c(not)i(b)s(eing)e(m)m(uc)m(h)h(of)h(an)g(imp)s
6903 -(osition)c(on)k(the)150 1223 y(programmer.)150 1474 y
6904 -Ff(3.1.3)63 b(Utilit)m(y)40 b(functions)h(summary)150
6905 -1666 y Fl(F)-8 b(or)45 b(v)m(ery)g(simple)d(needs,)48
6906 -b Fj(BZ2_bzBuffToBuffCompres)o(s)38 b Fl(and)44 b Fj
6907 -(BZ2_bzBuffToBuffDecompres)o(s)150 1776 y Fl(are)29 b(pro)m(vided.)38
6908 -b(These)28 b(compress)g(data)h(in)e(memory)h(from)g(one)h(bu\013er)e
6909 -(to)i(another)f(bu\013er)g(in)f(a)h(single)150 1885 y(function)38
6910 -b(call.)67 b(Y)-8 b(ou)40 b(should)d(assess)j(whether)f(these)h
6911 -(functions)d(ful\014ll)f(y)m(our)k(memory-to-memory)150
6912 -1995 y(compression/decompression)26 b(requiremen)m(ts)h(b)s(efore)g(in)
6913 -m(v)m(esting)g(e\013ort)i(in)d(understanding)f(the)j(more)150
6914 -2105 y(general)i(but)g(more)h(complex)f(lo)m(w-lev)m(el)g(in)m
6915 -(terface.)150 2261 y(Y)-8 b(oshiok)j(a)47 b(Tsuneo)e(\()p
6916 -Fj(QWF00133@niftyserve.or.jp)40 b Fl(/)46 b Fj
6917 -(tsuneo-y@is.aist-nara.ac.)o(jp)p Fl(\))40 b(has)150
6918 -2371 y(con)m(tributed)f(some)h(functions)e(to)j(giv)m(e)f(b)s(etter)g
6919 -Fj(zlib)f Fl(compatibilit)m(y)-8 b(.)67 b(These)40 b(functions)e(are)i
6920 -Fj(BZ2_)150 2481 y(bzopen)p Fl(,)e Fj(BZ2_bzread)p Fl(,)f
6921 -Fj(BZ2_bzwrite)p Fl(,)g Fj(BZ2_bzflush)p Fl(,)g Fj(BZ2_bzclose)p
6922 -Fl(,)f Fj(BZ2_bzerror)f Fl(and)i Fj(BZ2_)150 2590 y(bzlibVersion)p
6923 -Fl(.)49 b(Y)-8 b(ou)35 b(ma)m(y)g(\014nd)e(these)i(functions)d(more)j
6924 -(con)m(v)m(enien)m(t)g(for)f(simple)f(\014le)g(reading)h(and)150
6925 -2700 y(writing,)c(than)h(those)h(in)e(the)i(high-lev)m(el)e(in)m
6926 -(terface.)45 b(These)31 b(functions)f(are)i(not)g(\(y)m(et\))h
6927 -(o\016cially)d(part)150 2809 y(of)k(the)g(library)-8
6928 -b(,)33 b(and)g(are)h(minimally)c(do)s(cumen)m(ted)k(here.)51
6929 -b(If)33 b(they)h(break,)h(y)m(ou)f(get)h(to)g(k)m(eep)f(all)f(the)150
6930 -2919 y(pieces.)40 b(I)31 b(hop)s(e)e(to)i(do)s(cumen)m(t)g(them)f(prop)
6931 -s(erly)e(when)h(time)i(p)s(ermits.)150 3076 y(Y)-8 b(oshiok)j(a)27
6932 -b(also)g(con)m(tributed)f(mo)s(di\014cations)f(to)i(allo)m(w)f(the)h
6933 -(library)e(to)i(b)s(e)f(built)f(as)i(a)g(Windo)m(ws)f(DLL.)150
6934 -3362 y Fk(3.2)68 b(Error)45 b(handling)150 3554 y Fl(The)23
6935 -b(library)f(is)h(designed)g(to)i(reco)m(v)m(er)g(cleanly)f(in)e(all)h
6936 -(situations,)h(including)d(the)j(w)m(orst-case)i(situation)150
6937 -3664 y(of)j(decompressing)e(random)g(data.)41 b(I'm)28
6938 -b(not)h(100\045)g(sure)f(that)h(it)f(can)h(alw)m(a)m(ys)g(do)f(this,)g
6939 -(so)g(y)m(ou)h(migh)m(t)150 3774 y(w)m(an)m(t)i(to)g(add)e(a)i(signal)d
6940 -(handler)g(to)j(catc)m(h)h(segmen)m(tation)f(violations)e(during)f
6941 -(decompression)h(if)g(y)m(ou)150 3883 y(are)g(feeling)f(esp)s(ecially)f
6942 -(paranoid.)39 b(I)28 b(w)m(ould)g(b)s(e)g(in)m(terested)h(in)e(hearing)
6943 -h(more)h(ab)s(out)f(the)h(robustness)150 3993 y(of)i(the)f(library)e
6944 -(to)j(corrupted)f(compressed)g(data.)150 4150 y(V)-8
6945 -b(ersion)39 b(1.0)h(is)f(m)m(uc)m(h)g(more)h(robust)e(in)g(this)g(resp)
6946 -s(ect)i(than)f(0.9.0)i(or)e(0.9.5.)70 b(In)m(v)m(estigations)39
6947 -b(with)150 4259 y(Chec)m(k)m(er)21 b(\(a)g(to)s(ol)g(for)f(detecting)h
6948 -(problems)d(with)h(memory)h(managemen)m(t,)k(similar)18
6949 -b(to)j(Purify\))e(indicate)150 4369 y(that,)40 b(at)e(least)f(for)g
6950 -(the)h(few)e(\014les)h(I)g(tested,)j(all)c(single-bit)f(errors)i(in)e
6951 -(the)j(decompressed)f(data)h(are)150 4478 y(caugh)m(t)c(prop)s(erly)-8
6952 -b(,)31 b(with)g(no)i(segmen)m(tation)h(faults,)e(no)g(reads)h(of)g
6953 -(uninitialised)27 b(data)34 b(and)e(no)g(out)h(of)150
6954 -4588 y(range)f(reads)g(or)f(writes.)44 b(So)32 b(it's)f(certainly)g(m)m
6955 -(uc)m(h)h(impro)m(v)m(ed,)g(although)f(I)g(w)m(ouldn't)g(claim)g(it)g
6956 -(to)i(b)s(e)150 4698 y(totally)d(b)s(om)m(bpro)s(of.)150
6957 -4854 y(The)25 b(\014le)g Fj(bzlib.h)f Fl(con)m(tains)i(all)f
6958 -(de\014nitions)e(needed)i(to)i(use)e(the)h(library)-8
6959 -b(.)37 b(In)26 b(particular,)f(y)m(ou)h(should)150 4964
6960 -y(de\014nitely)i(not)j(include)d Fj(bzlib_private.h)p
6961 -Fl(.)150 5121 y(In)39 b Fj(bzlib.h)p Fl(,)h(the)g(v)-5
6962 -b(arious)39 b(return)f(v)-5 b(alues)39 b(are)h(de\014ned.)68
6963 -b(The)39 b(follo)m(wing)f(list)h(is)f(not)i(in)m(tended)f(as)150
6964 -5230 y(an)c(exhaustiv)m(e)h(description)d(of)i(the)h(circumstances)f
6965 -(in)f(whic)m(h)g(a)i(giv)m(en)f(v)-5 b(alue)35 b(ma)m(y)h(b)s(e)e
6966 -(returned)h({)150 5340 y(those)h(descriptions)d(are)j(giv)m(en)f
6967 -(later.)56 b(Rather,)37 b(it)d(is)h(in)m(tended)f(to)i(con)m(v)m(ey)h
6968 -(the)e(rough)g(meaning)g(of)p eop
6969 -%%Page: 11 12
6970 -11 11 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
6971 -b(with)g Fj(libbzip2)1881 b Fl(11)150 299 y(eac)m(h)38
6972 -b(return)d(v)-5 b(alue.)59 b(The)36 b(\014rst)g(\014v)m(e)g(actions)h
6973 -(are)g(normal)f(and)f(not)i(in)m(tended)f(to)h(denote)g(an)f(error)150
6974 -408 y(situation.)150 592 y Fj(BZ_OK)180 b Fl(The)30 b(requested)g
6975 -(action)h(w)m(as)g(completed)f(successfully)-8 b(.)150
6976 -756 y Fj(BZ_RUN_OK)150 866 y(BZ_FLUSH_OK)150 975 y(BZ_FINISH_OK)630
6977 -1085 y Fl(In)24 b Fj(BZ2_bzCompress)p Fl(,)e(the)i(requested)g
6978 -(\015ush/\014nish/nothing-sp)s(ecial)c(action)k(w)m(as)h(com-)630
6979 -1194 y(pleted)30 b(successfully)-8 b(.)150 1358 y Fj(BZ_STREAM_END)630
6980 -1468 y Fl(Compression)38 b(of)j(data)f(w)m(as)h(completed,)h(or)f(the)f
6981 -(logical)f(stream)i(end)e(w)m(as)i(detected)630 1577
6982 -y(during)28 b(decompression.)150 1761 y(The)i(follo)m(wing)f(return)g
6983 -(v)-5 b(alues)30 b(indicate)f(an)h(error)g(of)h(some)g(kind.)150
6984 -1945 y Fj(BZ_CONFIG_ERROR)630 2055 y Fl(Indicates)48
6985 -b(that)h(the)g(library)e(has)h(b)s(een)g(improp)s(erly)d(compiled)j(on)
6986 -g(y)m(our)h(platform)630 2164 y({)j(a)g(ma)5 b(jor)51
6987 -b(con\014guration)g(error.)104 b(Sp)s(eci\014cally)-8
6988 -b(,)55 b(it)c(means)g(that)h Fj(sizeof\(char\))p Fl(,)630
6989 -2274 y Fj(sizeof\(short\))44 b Fl(and)i Fj(sizeof\(int\))f
6990 -Fl(are)j(not)f(1,)52 b(2)c(and)f(4)h(resp)s(ectiv)m(ely)-8
6991 -b(,)51 b(as)d(they)630 2384 y(should)27 b(b)s(e.)40 b(Note)30
6992 -b(that)g(the)f(library)e(should)g(still)g(w)m(ork)i(prop)s(erly)e(on)i
6993 -(64-bit)g(platforms)630 2493 y(whic)m(h)d(follo)m(w)h(the)g(LP64)h
6994 -(programming)e(mo)s(del)h({)g(that)h(is,)g(where)e Fj(sizeof\(long\))f
6995 -Fl(and)630 2603 y Fj(sizeof\(void*\))e Fl(are)k(8.)40
6996 -b(Under)25 b(LP64,)j Fj(sizeof\(int\))c Fl(is)h(still)f(4,)k(so)f
6997 -Fj(libbzip2)p Fl(,)e(whic)m(h)630 2712 y(do)s(esn't)30
6998 -b(use)g(the)h Fj(long)e Fl(t)m(yp)s(e,)i(is)e(OK.)150
6999 -2876 y Fj(BZ_SEQUENCE_ERROR)630 2986 y Fl(When)43 b(using)f(the)i
7000 -(library)-8 b(,)45 b(it)e(is)f(imp)s(ortan)m(t)h(to)h(call)e(the)i
7001 -(functions)e(in)g(the)i(correct)630 3095 y(sequence)28
7002 -b(and)f(with)f(data)j(structures)e(\(bu\013ers)f(etc\))j(in)e(the)g
7003 -(correct)i(states.)41 b Fj(libbzip2)630 3205 y Fl(c)m(hec)m(ks)26
7004 -b(as)e(m)m(uc)m(h)h(as)f(it)g(can)g(to)h(ensure)f(this)f(is)g(happ)s
7005 -(ening,)h(and)f(returns)g Fj(BZ_SEQUENCE_)630 3314 y(ERROR)36
7006 -b Fl(if)h(not.)62 b(Co)s(de)37 b(whic)m(h)g(complies)f(precisely)g
7007 -(with)h(the)g(function)g(seman)m(tics,)j(as)630 3424
7008 -y(detailed)d(b)s(elo)m(w,)i(should)d(nev)m(er)i(receiv)m(e)h(this)d(v)
7009 --5 b(alue;)41 b(suc)m(h)d(an)g(ev)m(en)m(t)h(denotes)f(buggy)630
7010 -3534 y(co)s(de)31 b(whic)m(h)e(y)m(ou)h(should)f(in)m(v)m(estigate.)150
7011 -3697 y Fj(BZ_PARAM_ERROR)630 3807 y Fl(Returned)43 b(when)f(a)i
7012 -(parameter)g(to)h(a)f(function)e(call)h(is)f(out)i(of)g(range)g(or)g
7013 -(otherwise)630 3917 y(manifestly)34 b(incorrect.)57 b(As)36
7014 -b(with)e Fj(BZ_SEQUENCE_ERROR)p Fl(,)f(this)i(denotes)h(a)g(bug)f(in)g
7015 -(the)630 4026 y(clien)m(t)23 b(co)s(de.)39 b(The)22 b(distinction)f(b)s
7016 -(et)m(w)m(een)j Fj(BZ_PARAM_ERROR)c Fl(and)j Fj(BZ_SEQUENCE_ERROR)630
7017 -4136 y Fl(is)29 b(a)i(bit)f(hazy)-8 b(,)31 b(but)f(still)e(w)m(orth)i
7018 -(making.)150 4300 y Fj(BZ_MEM_ERROR)630 4409 y Fl(Returned)g(when)f(a)i
7019 -(request)f(to)i(allo)s(cate)f(memory)f(failed.)40 b(Note)31
7020 -b(that)g(the)g(quan)m(tit)m(y)g(of)630 4519 y(memory)21
7021 -b(needed)g(to)i(decompress)e(a)g(stream)h(cannot)g(b)s(e)f(determined)f
7022 -(un)m(til)g(the)h(stream's)630 4628 y(header)29 b(has)g(b)s(een)g
7023 -(read.)40 b(So)29 b Fj(BZ2_bzDecompress)c Fl(and)j Fj(BZ2_bzRead)f
7024 -Fl(ma)m(y)j(return)e Fj(BZ_)630 4738 y(MEM_ERROR)d Fl(ev)m(en)k(though)
7025 -e(some)h(of)g(the)g(compressed)g(data)g(has)g(b)s(een)f(read.)39
7026 -b(The)28 b(same)630 4847 y(is)38 b(not)i(true)f(for)g(compression;)k
7027 -(once)d Fj(BZ2_bzCompressInit)34 b Fl(or)39 b Fj(BZ2_bzWriteOpen)630
7028 -4957 y Fl(ha)m(v)m(e)32 b(successfully)c(completed,)j
7029 -Fj(BZ_MEM_ERROR)c Fl(cannot)k(o)s(ccur.)150 5121 y Fj(BZ_DATA_ERROR)630
7030 -5230 y Fl(Returned)h(when)g(a)h(data)g(in)m(tegrit)m(y)g(error)g(is)e
7031 -(detected)k(during)30 b(decompression.)47 b(Most)630
7032 -5340 y(imp)s(ortan)m(tly)-8 b(,)31 b(this)f(means)i(when)f(stored)g
7033 -(and)g(computed)h(CR)m(Cs)f(for)g(the)h(data)g(do)g(not)p
7034 -eop
7035 -%%Page: 12 13
7036 -12 12 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
7037 -b(with)g Fj(libbzip2)1881 b Fl(12)630 299 y(matc)m(h.)41
7038 -b(This)28 b(v)-5 b(alue)29 b(is)f(also)i(returned)e(up)s(on)g
7039 -(detection)i(of)g(an)m(y)g(other)f(anomaly)h(in)e(the)630
7040 -408 y(compressed)i(data.)150 560 y Fj(BZ_DATA_ERROR_MAGIC)630
7041 -670 y Fl(As)k(a)g(sp)s(ecial)f(case)i(of)f Fj(BZ_DATA_ERROR)p
7042 -Fl(,)d(it)i(is)g(sometimes)h(useful)e(to)j(kno)m(w)f(when)f(the)630
7043 -779 y(compressed)d(stream)h(do)s(es)f(not)g(start)h(with)e(the)i
7044 -(correct)h(magic)e(b)m(ytes)h(\()p Fj('B')f('Z')f('h')p
7045 -Fl(\).)150 931 y Fj(BZ_IO_ERROR)630 1040 y Fl(Returned)k(b)m(y)h
7046 -Fj(BZ2_bzRead)d Fl(and)i Fj(BZ2_bzWrite)e Fl(when)i(there)h(is)f(an)g
7047 -(error)h(reading)f(or)630 1150 y(writing)28 b(in)h(the)h(compressed)g
7048 -(\014le,)f(and)h(b)m(y)g Fj(BZ2_bzReadOpen)c Fl(and)j
7049 -Fj(BZ2_bzWriteOpen)630 1259 y Fl(for)i(attempts)i(to)f(use)f(a)h
7050 -(\014le)e(for)i(whic)m(h)e(the)h(error)g(indicator)g(\(viz,)g
7051 -Fj(ferror\(f\))p Fl(\))f(is)g(set.)630 1369 y(On)h(receipt)g(of)h
7052 -Fj(BZ_IO_ERROR)p Fl(,)e(the)h(caller)h(should)d(consult)i
7053 -Fj(errno)g Fl(and/or)g Fj(perror)f Fl(to)630 1479 y(acquire)g(op)s
7054 -(erating-system)g(sp)s(eci\014c)f(information)g(ab)s(out)h(the)h
7055 -(problem.)150 1630 y Fj(BZ_UNEXPECTED_EOF)630 1740 y
7056 -Fl(Returned)36 b(b)m(y)g Fj(BZ2_bzRead)e Fl(when)i(the)h(compressed)f
7057 -(\014le)g(\014nishes)e(b)s(efore)j(the)f(logical)630
7058 -1849 y(end)30 b(of)g(stream)h(is)e(detected.)150 2001
7059 -y Fj(BZ_OUTBUFF_FULL)630 2110 y Fl(Returned)g(b)m(y)i
7060 -Fj(BZ2_bzBuffToBuffCompres)o(s)24 b Fl(and)30 b Fj
7061 -(BZ2_bzBuffToBuffDecompres)o(s)630 2220 y Fl(to)h(indicate)f(that)h
7062 -(the)f(output)g(data)h(will)d(not)i(\014t)h(in)m(to)f(the)h(output)f
7063 -(bu\013er)f(pro)m(vided.)150 2492 y Fk(3.3)68 b(Lo)l(w-lev)l(el)47
7064 -b(in)l(terface)150 2766 y Ff(3.3.1)63 b Fe(BZ2_bzCompressInit)390
7065 -2953 y Fj(typedef)533 3057 y(struct)46 b({)676 3161 y(char)h(*next_in;)
7066 -676 3264 y(unsigned)f(int)h(avail_in;)676 3368 y(unsigned)f(int)h
7067 -(total_in_lo32;)676 3472 y(unsigned)f(int)h(total_in_hi32;)676
7068 -3680 y(char)g(*next_out;)676 3783 y(unsigned)f(int)h(avail_out;)676
7069 -3887 y(unsigned)f(int)h(total_out_lo32;)676 3991 y(unsigned)f(int)h
7070 -(total_out_hi32;)676 4198 y(void)g(*state;)676 4406 y(void)g
7071 -(*\(*bzalloc\)\(void)c(*,int,int\);)676 4510 y(void)k
7072 -(\(*bzfree\)\(void)d(*,void)i(*\);)676 4614 y(void)h(*opaque;)533
7073 -4717 y(})533 4821 y(bz_stream;)390 5029 y(int)g(BZ2_bzCompressInit)c
7074 -(\()k(bz_stream)e(*strm,)1583 5132 y(int)i(blockSize100k,)1583
7075 -5236 y(int)g(verbosity,)1583 5340 y(int)g(workFactor)e(\);)p
7076 -eop
7077 -%%Page: 13 14
7078 -13 13 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
7079 -b(with)g Fj(libbzip2)1881 b Fl(13)150 456 y(Prepares)32
7080 -b(for)h(compression.)47 b(The)32 b Fj(bz_stream)e Fl(structure)j(holds)
7081 -e(all)h(data)h(p)s(ertaining)e(to)i(the)g(com-)150 565
7082 -y(pression)i(activit)m(y)-8 b(.)62 b(A)37 b Fj(bz_stream)e
7083 -Fl(structure)h(should)f(b)s(e)i(allo)s(cated)g(and)f(initialised)e
7084 -(prior)h(to)j(the)150 675 y(call.)67 b(The)39 b(\014elds)e(of)j
7085 -Fj(bz_stream)d Fl(comprise)h(the)i(en)m(tiret)m(y)g(of)f(the)h
7086 -(user-visible)c(data.)68 b Fj(state)38 b Fl(is)h(a)150
7087 -784 y(p)s(oin)m(ter)29 b(to)i(the)g(priv)-5 b(ate)30
7088 -b(data)h(structures)f(required)e(for)i(compression.)150
7089 -941 y(Custom)37 b(memory)g(allo)s(cators)g(are)h(supp)s(orted,)f(via)g
7090 -(\014elds)f Fj(bzalloc)p Fl(,)h Fj(bzfree)p Fl(,)g(and)g
7091 -Fj(opaque)p Fl(.)59 b(The)150 1051 y(v)-5 b(alue)32 b
7092 -Fj(opaque)e Fl(is)i(passed)f(to)i(as)g(the)f(\014rst)g(argumen)m(t)h
7093 -(to)g(all)e(calls)g(to)i Fj(bzalloc)d Fl(and)i Fj(bzfree)p
7094 -Fl(,)f(but)h(is)150 1160 y(otherwise)d(ignored)g(b)m(y)h(the)g(library)
7095 --8 b(.)38 b(The)29 b(call)h Fj(bzalloc)e(\()i(opaque,)e(n,)i(m)g(\))g
7096 -Fl(is)e(exp)s(ected)j(to)f(return)150 1270 y(a)g(p)s(oin)m(ter)e
7097 -Fj(p)h Fl(to)h Fj(n)g(*)g(m)f Fl(b)m(ytes)h(of)g(memory)-8
7098 -b(,)30 b(and)e Fj(bzfree)h(\()h(opaque,)f(p)h(\))f Fl(should)e(free)i
7099 -(that)h(memory)-8 b(.)150 1427 y(If)33 b(y)m(ou)g(don't)h(w)m(an)m(t)g
7100 -(to)g(use)f(a)g(custom)h(memory)f(allo)s(cator,)h(set)g
7101 -Fj(bzalloc)p Fl(,)e Fj(bzfree)g Fl(and)h Fj(opaque)e
7102 -Fl(to)150 1537 y Fj(NULL)p Fl(,)e(and)h(the)h(library)d(will)f(then)k
7103 -(use)f(the)g(standard)g Fj(malloc)p Fl(/)p Fj(free)e
7104 -Fl(routines.)150 1693 y(Before)39 b(calling)d Fj(BZ2_bzCompressInit)p
7105 -Fl(,)f(\014elds)h Fj(bzalloc)p Fl(,)h Fj(bzfree)f Fl(and)h
7106 -Fj(opaque)f Fl(should)g(b)s(e)h(\014lled)150 1803 y(appropriately)-8
7107 -b(,)35 b(as)h(just)f(describ)s(ed.)53 b(Up)s(on)34 b(return,)i(the)g
7108 -(in)m(ternal)e(state)i(will)d(ha)m(v)m(e)j(b)s(een)f(allo)s(cated)150
7109 -1913 y(and)43 b(initialised,)g(and)g Fj(total_in_lo32)p
7110 -Fl(,)h Fj(total_in_hi32)p Fl(,)f Fj(total_out_lo32)d
7111 -Fl(and)j Fj(total_out_)150 2022 y(hi32)37 b Fl(will)f(ha)m(v)m(e)j(b)s
7112 -(een)f(set)h(to)g(zero.)65 b(These)38 b(four)g(\014elds)e(are)j(used)f
7113 -(b)m(y)g(the)g(library)e(to)j(inform)e(the)150 2132 y(caller)j(of)g
7114 -(the)h(total)g(amoun)m(t)g(of)g(data)g(passed)f(in)m(to)g(and)g(out)g
7115 -(of)h(the)g(library)-8 b(,)41 b(resp)s(ectiv)m(ely)-8
7116 -b(.)70 b(Y)-8 b(ou)150 2241 y(should)34 b(not)j(try)f(to)h(c)m(hange)g
7117 -(them.)58 b(As)36 b(of)h(v)m(ersion)f(1.0,)j(64-bit)d(coun)m(ts)h(are)f
7118 -(main)m(tained,)h(ev)m(en)g(on)150 2351 y(32-bit)i(platforms,)h(using)d
7119 -(the)i Fj(_hi32)e Fl(\014elds)g(to)j(store)f(the)g(upp)s(er)d(32)k
7120 -(bits)d(of)i(the)g(coun)m(t.)66 b(So,)41 b(for)150 2460
7121 -y(example,)30 b(the)h(total)g(amoun)m(t)g(of)f(data)h(in)f(is)f
7122 -Fj(\(total_in_hi32)d(<<)k(32\))g(+)g(total_in_lo32)p
7123 -Fl(.)150 2617 y(P)m(arameter)g Fj(blockSize100k)25 b
7124 -Fl(sp)s(eci\014es)i(the)h(blo)s(c)m(k)g(size)h(to)g(b)s(e)f(used)f(for)
7125 -h(compression.)40 b(It)28 b(should)f(b)s(e)150 2727 y(a)k(v)-5
7126 -b(alue)30 b(b)s(et)m(w)m(een)i(1)f(and)f(9)h(inclusiv)m(e,)e(and)h(the)
7127 -h(actual)g(blo)s(c)m(k)f(size)g(used)g(is)g(100000)j(x)e(this)e
7128 -(\014gure.)42 b(9)150 2836 y(giv)m(es)31 b(the)f(b)s(est)g(compression)
7129 -g(but)f(tak)m(es)j(most)f(memory)-8 b(.)150 2993 y(P)m(arameter)29
7130 -b Fj(verbosity)c Fl(should)h(b)s(e)h(set)i(to)f(a)h(n)m(um)m(b)s(er)d
7131 -(b)s(et)m(w)m(een)j(0)f(and)f(4)h(inclusiv)m(e.)38 b(0)28
7132 -b(is)f(silen)m(t,)h(and)150 3103 y(greater)j(n)m(um)m(b)s(ers)c(giv)m
7133 -(e)j(increasingly)d(v)m(erb)s(ose)j(monitoring/debugging)d(output.)40
7134 -b(If)29 b(the)g(library)e(has)150 3212 y(b)s(een)j(compiled)e(with)i
7135 -Fj(-DBZ_NO_STDIO)p Fl(,)d(no)j(suc)m(h)g(output)g(will)e(app)s(ear)h
7136 -(for)h(an)m(y)h(v)m(erb)s(osit)m(y)f(setting.)150 3369
7137 -y(P)m(arameter)35 b Fj(workFactor)d Fl(con)m(trols)i(ho)m(w)g(the)g
7138 -(compression)f(phase)h(b)s(eha)m(v)m(es)g(when)f(presen)m(ted)h(with)
7139 -150 3479 y(w)m(orst)40 b(case,)j(highly)37 b(rep)s(etitiv)m(e,)k(input)
7140 -d(data.)68 b(If)39 b(compression)g(runs)e(in)m(to)j(di\016culties)d
7141 -(caused)i(b)m(y)150 3588 y(rep)s(etitiv)m(e)34 b(data,)j(the)e(library)
7142 -d(switc)m(hes)j(from)f(the)h(standard)f(sorting)g(algorithm)g(to)i(a)f
7143 -(fallbac)m(k)f(al-)150 3698 y(gorithm.)47 b(The)32 b(fallbac)m(k)g(is)g
7144 -(slo)m(w)m(er)g(than)h(the)f(standard)g(algorithm)g(b)m(y)g(p)s(erhaps)
7145 -f(a)i(factor)h(of)e(three,)150 3808 y(but)e(alw)m(a)m(ys)h(b)s(eha)m(v)
7146 -m(es)f(reasonably)-8 b(,)31 b(no)f(matter)h(ho)m(w)g(bad)f(the)g
7147 -(input.)150 3965 y(Lo)m(w)m(er)25 b(v)-5 b(alues)24 b(of)h
7148 -Fj(workFactor)d Fl(reduce)i(the)h(amoun)m(t)g(of)g(e\013ort)g(the)g
7149 -(standard)f(algorithm)f(will)f(exp)s(end)150 4074 y(b)s(efore)j
7150 -(resorting)h(to)g(the)g(fallbac)m(k.)39 b(Y)-8 b(ou)27
7151 -b(should)c(set)k(this)e(parameter)h(carefully;)g(to)s(o)h(lo)m(w,)g
7152 -(and)e(man)m(y)150 4184 y(inputs)32 b(will)f(b)s(e)i(handled)f(b)m(y)i
7153 -(the)g(fallbac)m(k)g(algorithm)f(and)g(so)h(compress)g(rather)g(slo)m
7154 -(wly)-8 b(,)34 b(to)s(o)h(high,)150 4293 y(and)24 b(y)m(our)h(a)m(v)m
7155 -(erage-to-w)m(orst)30 b(case)c(compression)e(times)h(can)g(b)s(ecome)g
7156 -(v)m(ery)h(large.)39 b(The)24 b(default)g(v)-5 b(alue)150
7157 -4403 y(of)31 b(30)g(giv)m(es)f(reasonable)h(b)s(eha)m(viour)e(o)m(v)m
7158 -(er)i(a)g(wide)e(range)i(of)f(circumstances.)150 4560
7159 -y(Allo)m(w)m(able)h(v)-5 b(alues)31 b(range)i(from)e(0)i(to)f(250)h
7160 -(inclusiv)m(e.)44 b(0)32 b(is)f(a)h(sp)s(ecial)f(case,)i(equiv)-5
7161 -b(alen)m(t)32 b(to)g(using)f(the)150 4669 y(default)f(v)-5
7162 -b(alue)29 b(of)i(30.)150 4826 y(Note)38 b(that)f(the)g(compressed)f
7163 -(output)g(generated)h(is)f(the)g(same)h(regardless)f(of)h(whether)f(or)
7164 -g(not)h(the)150 4936 y(fallbac)m(k)30 b(algorithm)f(is)h(used.)150
7165 -5093 y(Be)23 b(a)m(w)m(are)h(also)f(that)g(this)f(parameter)h(ma)m(y)g
7166 -(disapp)s(ear)e(en)m(tirely)h(in)f(future)h(v)m(ersions)g(of)h(the)g
7167 -(library)-8 b(.)36 b(In)150 5202 y(principle)20 b(it)j(should)e(b)s(e)h
7168 -(p)s(ossible)f(to)j(devise)f(a)g(go)s(o)s(d)g(w)m(a)m(y)i(to)f
7169 -(automatically)f(c)m(ho)s(ose)h(whic)m(h)e(algorithm)150
7170 -5312 y(to)31 b(use.)41 b(Suc)m(h)29 b(a)i(mec)m(hanism)f(w)m(ould)f
7171 -(render)g(the)i(parameter)g(obsolete.)p eop
7172 -%%Page: 14 15
7173 -14 14 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
7174 -b(with)g Fj(libbzip2)1881 b Fl(14)150 299 y(P)m(ossible)29
7175 -b(return)h(v)-5 b(alues:)572 450 y Fj(BZ_CONFIG_ERROR)663
7176 -554 y Fl(if)29 b(the)i(library)d(has)i(b)s(een)f(mis-compiled)572
7177 -657 y Fj(BZ_PARAM_ERROR)663 761 y Fl(if)g Fj(strm)g Fl(is)h
7178 -Fj(NULL)663 865 y Fl(or)g Fj(blockSize)e(<)i Fl(1)h(or)f
7179 -Fj(blockSize)e(>)i Fl(9)663 969 y(or)g Fj(verbosity)e(<)i
7180 -Fl(0)h(or)f Fj(verbosity)e(>)i Fl(4)663 1073 y(or)g Fj(workFactor)e(<)i
7181 -Fl(0)g(or)h Fj(workFactor)c(>)j Fl(250)572 1176 y Fj(BZ_MEM_ERROR)663
7182 -1280 y Fl(if)f(not)i(enough)f(memory)g(is)f(a)m(v)-5
7183 -b(ailable)572 1384 y Fj(BZ_OK)663 1488 y Fl(otherwise)150
7184 -1645 y(Allo)m(w)m(able)30 b(next)g(actions:)572 1796
7185 -y Fj(BZ2_bzCompress)663 1899 y Fl(if)f Fj(BZ_OK)g Fl(is)g(returned)572
7186 -2003 y(no)h(sp)s(eci\014c)f(action)i(needed)f(in)f(case)i(of)g(error)
7187 -150 2255 y Ff(3.3.2)63 b Fe(BZ2_bzCompress)533 2441 y
7188 -Fj(int)47 b(BZ2_bzCompress)d(\()j(bz_stream)f(*strm,)g(int)h(action)f
7189 -(\);)150 2598 y Fl(Pro)m(vides)28 b(more)g(input)f(and/or)h(output)g
7190 -(bu\013er)g(space)h(for)f(the)h(library)-8 b(.)38 b(The)28
7191 -b(caller)g(main)m(tains)f(input)150 2708 y(and)j(output)g(bu\013ers,)f
7192 -(and)h(calls)g Fj(BZ2_bzCompress)c Fl(to)31 b(transfer)f(data)h(b)s(et)
7193 -m(w)m(een)g(them.)150 2865 y(Before)j(eac)m(h)g(call)e(to)i
7194 -Fj(BZ2_bzCompress)p Fl(,)c Fj(next_in)h Fl(should)g(p)s(oin)m(t)h(at)h
7195 -(the)g(data)h(to)g(b)s(e)e(compressed,)150 2974 y(and)41
7196 -b Fj(avail_in)f Fl(should)g(indicate)h(ho)m(w)h(man)m(y)f(b)m(ytes)i
7197 -(the)f(library)d(ma)m(y)k(read.)75 b Fj(BZ2_bzCompress)150
7198 -3084 y Fl(up)s(dates)29 b Fj(next_in)p Fl(,)g Fj(avail_in)f
7199 -Fl(and)i Fj(total_in)e Fl(to)j(re\015ect)g(the)g(n)m(um)m(b)s(er)e(of)h
7200 -(b)m(ytes)h(it)f(has)g(read.)150 3241 y(Similarly)-8
7201 -b(,)27 b Fj(next_out)h Fl(should)g(p)s(oin)m(t)h(to)i(a)f(bu\013er)f
7202 -(in)g(whic)m(h)g(the)h(compressed)g(data)h(is)e(to)i(b)s(e)e(placed,)
7203 -150 3350 y(with)i Fj(avail_out)f Fl(indicating)h(ho)m(w)h(m)m(uc)m(h)h
7204 -(output)f(space)h(is)f(a)m(v)-5 b(ailable.)46 b Fj(BZ2_bzCompress)29
7205 -b Fl(up)s(dates)150 3460 y Fj(next_out)p Fl(,)f Fj(avail_out)g
7206 -Fl(and)i Fj(total_out)e Fl(to)j(re\015ect)g(the)f(n)m(um)m(b)s(er)g(of)
7207 -g(b)m(ytes)h(output.)150 3617 y(Y)-8 b(ou)40 b(ma)m(y)g(pro)m(vide)e
7208 -(and)h(remo)m(v)m(e)i(as)f(little)e(or)h(as)h(m)m(uc)m(h)f(data)h(as)g
7209 -(y)m(ou)f(lik)m(e)g(on)g(eac)m(h)i(call)e(of)g Fj(BZ2_)150
7210 -3726 y(bzCompress)p Fl(.)48 b(In)33 b(the)h(limit,)f(it)h(is)f
7211 -(acceptable)h(to)h(supply)c(and)j(remo)m(v)m(e)h(data)g(one)f(b)m(yte)g
7212 -(at)h(a)f(time,)150 3836 y(although)28 b(this)f(w)m(ould)g(b)s(e)h
7213 -(terribly)e(ine\016cien)m(t.)39 b(Y)-8 b(ou)29 b(should)e(alw)m(a)m(ys)
7214 -h(ensure)g(that)h(at)g(least)g(one)f(b)m(yte)150 3946
7215 -y(of)j(output)f(space)g(is)g(a)m(v)-5 b(ailable)30 b(at)h(eac)m(h)g
7216 -(call.)150 4102 y(A)38 b(second)h(purp)s(ose)d(of)j Fj(BZ2_bzCompress)
7217 -34 b Fl(is)j(to)i(request)f(a)h(c)m(hange)g(of)g(mo)s(de)e(of)i(the)f
7218 -(compressed)150 4212 y(stream.)150 4369 y(Conceptually)-8
7219 -b(,)24 b(a)g(compressed)g(stream)g(can)f(b)s(e)g(in)g(one)h(of)f(four)g
7220 -(states:)39 b(IDLE,)24 b(R)m(UNNING,)h(FLUSH-)150 4478
7221 -y(ING)37 b(and)g(FINISHING.)g(Before)i(initialisation)33
7222 -b(\()p Fj(BZ2_bzCompressInit)p Fl(\))g(and)j(after)i(termination)150
7223 -4588 y(\()p Fj(BZ2_bzCompressEnd)p Fl(\),)27 b(a)j(stream)h(is)f
7224 -(regarded)g(as)g(IDLE.)150 4745 y(Up)s(on)35 b(initialisation)e(\()p
7225 -Fj(BZ2_bzCompressInit)p Fl(\),)h(the)i(stream)h(is)e(placed)h(in)e(the)
7226 -j(R)m(UNNING)g(state.)150 4854 y(Subsequen)m(t)j(calls)g(to)i
7227 -Fj(BZ2_bzCompress)37 b Fl(should)j(pass)g Fj(BZ_RUN)g
7228 -Fl(as)h(the)g(requested)h(action;)47 b(other)150 4964
7229 -y(actions)31 b(are)f(illegal)f(and)h(will)d(result)j(in)f
7230 -Fj(BZ_SEQUENCE_ERROR)p Fl(.)150 5121 y(A)m(t)38 b(some)f(p)s(oin)m(t,)h
7231 -(the)f(calling)e(program)i(will)d(ha)m(v)m(e)k(pro)m(vided)e(all)f(the)
7232 -i(input)e(data)j(it)e(w)m(an)m(ts)i(to.)61 b(It)150 5230
7233 -y(will)28 b(then)h(w)m(an)m(t)i(to)g(\014nish)d(up)h({)i(in)d
7234 -(e\013ect,)k(asking)e(the)g(library)e(to)j(pro)s(cess)f(an)m(y)g(data)h
7235 -(it)f(migh)m(t)g(ha)m(v)m(e)150 5340 y(bu\013ered)25
7236 -b(in)m(ternally)-8 b(.)38 b(In)25 b(this)g(state,)k Fj(BZ2_bzCompress)
7237 -22 b Fl(will)i(no)i(longer)g(attempt)h(to)g(read)f(data)h(from)p
7238 -eop
7239 -%%Page: 15 16
7240 -15 15 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
7241 -b(with)g Fj(libbzip2)1881 b Fl(15)150 299 y Fj(next_in)p
7242 -Fl(,)33 b(but)g(it)h(will)d(w)m(an)m(t)k(to)g(write)e(data)h(to)h
7243 -Fj(next_out)p Fl(.)49 b(Because)36 b(the)e(output)f(bu\013er)g
7244 -(supplied)150 408 y(b)m(y)e(the)h(user)e(can)i(b)s(e)f(arbitrarily)d
7245 -(small,)j(the)g(\014nishing-up)d(op)s(eration)i(cannot)i(necessarily)e
7246 -(b)s(e)h(done)150 518 y(with)e(a)i(single)e(call)h(of)g
7247 -Fj(BZ2_bzCompress)p Fl(.)150 675 y(Instead,)47 b(the)d(calling)f
7248 -(program)g(passes)h Fj(BZ_FINISH)d Fl(as)j(an)g(action)g(to)h
7249 -Fj(BZ2_bzCompress)p Fl(.)77 b(This)150 784 y(c)m(hanges)30
7250 -b(the)f(stream's)g(state)h(to)f(FINISHING.)g(An)m(y)g(remaining)e
7251 -(input)g(\(ie,)i Fj(next_in[0)f(..)i(avail_)150 894 y(in-1])p
7252 -Fl(\))36 b(is)f(compressed)i(and)f(transferred)g(to)h(the)g(output)g
7253 -(bu\013er.)58 b(T)-8 b(o)38 b(do)e(this,)i Fj(BZ2_bzCompress)150
7254 -1004 y Fl(m)m(ust)h(b)s(e)f(called)g(rep)s(eatedly)h(un)m(til)e(all)h
7255 -(the)h(output)f(has)h(b)s(een)f(consumed.)66 b(A)m(t)40
7256 -b(that)g(p)s(oin)m(t,)g Fj(BZ2_)150 1113 y(bzCompress)h
7257 -Fl(returns)h Fj(BZ_STREAM_END)p Fl(,)i(and)f(the)h(stream's)g(state)h
7258 -(is)d(set)j(bac)m(k)f(to)g(IDLE.)g Fj(BZ2_)150 1223 y(bzCompressEnd)27
7259 -b Fl(should)h(then)i(b)s(e)g(called.)150 1380 y(Just)25
7260 -b(to)i(mak)m(e)g(sure)e(the)i(calling)d(program)i(do)s(es)g(not)g(c)m
7261 -(heat,)i(the)f(library)c(mak)m(es)k(a)f(note)h(of)f Fj(avail_in)150
7262 -1489 y Fl(at)g(the)g(time)f(of)g(the)g(\014rst)g(call)g(to)h
7263 -Fj(BZ2_bzCompress)21 b Fl(whic)m(h)j(has)h Fj(BZ_FINISH)e
7264 -Fl(as)i(an)h(action)f(\(ie,)i(at)f(the)150 1599 y(time)d(the)h(program)
7265 -g(has)f(announced)g(its)h(in)m(ten)m(tion)f(to)h(not)g(supply)e(an)m(y)
7266 -i(more)g(input\).)37 b(By)24 b(comparing)150 1708 y(this)k(v)-5
7267 -b(alue)28 b(with)g(that)h(of)h Fj(avail_in)c Fl(o)m(v)m(er)k(subsequen)
7268 -m(t)f(calls)f(to)h Fj(BZ2_bzCompress)p Fl(,)d(the)j(library)e(can)150
7269 -1818 y(detect)33 b(an)m(y)e(attempts)i(to)f(slip)d(in)h(more)h(data)h
7270 -(to)h(compress.)43 b(An)m(y)31 b(calls)g(for)g(whic)m(h)f(this)g(is)h
7271 -(detected)150 1928 y(will)j(return)h Fj(BZ_SEQUENCE_ERROR)p
7272 -Fl(.)55 b(This)34 b(indicates)i(a)h(programming)e(mistak)m(e)i(whic)m
7273 -(h)e(should)g(b)s(e)150 2037 y(corrected.)150 2194 y(Instead)i(of)g
7274 -(asking)f(to)h(\014nish,)f(the)h(calling)f(program)g(ma)m(y)h(ask)g
7275 -Fj(BZ2_bzCompress)c Fl(to)38 b(tak)m(e)g(all)e(the)150
7276 -2304 y(remaining)j(input,)i(compress)f(it)g(and)g(terminate)h(the)g
7277 -(curren)m(t)f(\(Burro)m(ws-Wheeler\))h(compression)150
7278 -2413 y(blo)s(c)m(k.)e(This)26 b(could)h(b)s(e)g(useful)f(for)h(error)h
7279 -(con)m(trol)g(purp)s(oses.)38 b(The)27 b(mec)m(hanism)g(is)g(analogous)
7280 -h(to)g(that)150 2523 y(for)35 b(\014nishing:)46 b(call)35
7281 -b Fj(BZ2_bzCompress)c Fl(with)i(an)i(action)g(of)g Fj(BZ_FLUSH)p
7282 -Fl(,)g(remo)m(v)m(e)h(output)f(data,)i(and)150 2632 y(p)s(ersist)h
7283 -(with)g(the)i Fj(BZ_FLUSH)e Fl(action)i(un)m(til)e(the)i(v)-5
7284 -b(alue)39 b Fj(BZ_RUN)f Fl(is)h(returned.)68 b(As)39
7285 -b(with)g(\014nishing,)150 2742 y Fj(BZ2_bzCompress)23
7286 -b Fl(detects)28 b(an)m(y)f(attempt)h(to)f(pro)m(vide)f(more)h(input)e
7287 -(data)i(once)g(the)g(\015ush)e(has)i(b)s(egun.)150 2899
7288 -y(Once)j(the)h(\015ush)e(is)g(complete,)i(the)g(stream)f(returns)g(to)h
7289 -(the)f(normal)g(R)m(UNNING)h(state.)150 3056 y(This)f(all)h(sounds)g
7290 -(prett)m(y)h(complex,)h(but)e(isn't)g(really)-8 b(.)45
7291 -b(Here's)33 b(a)f(table)g(whic)m(h)f(sho)m(ws)h(whic)m(h)f(actions)150
7292 -3165 y(are)e(allo)m(w)m(able)f(in)f(eac)m(h)j(state,)g(what)f(action)g
7293 -(will)c(b)s(e)j(tak)m(en,)j(what)d(the)h(next)f(state)i(is,)e(and)g
7294 -(what)h(the)150 3275 y(non-error)h(return)f(v)-5 b(alues)29
7295 -b(are.)41 b(Note)32 b(that)e(y)m(ou)h(can't)g(explicitly)d(ask)i(what)g
7296 -(state)i(the)e(stream)h(is)e(in,)150 3384 y(but)h(nor)g(do)g(y)m(ou)h
7297 -(need)f(to)h({)g(it)e(can)i(b)s(e)f(inferred)e(from)i(the)h(v)-5
7298 -b(alues)29 b(returned)h(b)m(y)g Fj(BZ2_bzCompress)p Fl(.)390
7299 -3535 y(IDLE/)p Fj(any)572 3639 y Fl(Illegal.)60 b(IDLE)30
7300 -b(state)i(only)d(exists)h(after)h Fj(BZ2_bzCompressEnd)26
7301 -b Fl(or)572 3743 y(b)s(efore)k Fj(BZ2_bzCompressInit)p
7302 -Fl(.)572 3847 y(Return)f(v)-5 b(alue)30 b(=)g Fj(BZ_SEQUENCE_ERROR)390
7303 -4054 y Fl(R)m(UNNING/)p Fj(BZ_RUN)572 4158 y Fl(Compress)f(from)h
7304 -Fj(next_in)f Fl(to)i Fj(next_out)d Fl(as)i(m)m(uc)m(h)h(as)f(p)s
7305 -(ossible.)572 4262 y(Next)h(state)h(=)e(R)m(UNNING)572
7306 -4366 y(Return)f(v)-5 b(alue)30 b(=)g Fj(BZ_RUN_OK)390
7307 -4573 y Fl(R)m(UNNING/)p Fj(BZ_FLUSH)572 4677 y Fl(Remem)m(b)s(er)g
7308 -(curren)m(t)g(v)-5 b(alue)30 b(of)g Fj(next_in)p Fl(.)59
7309 -b(Compress)30 b(from)g Fj(next_in)572 4781 y Fl(to)h
7310 -Fj(next_out)d Fl(as)j(m)m(uc)m(h)f(as)h(p)s(ossible,)d(but)i(do)g(not)g
7311 -(accept)i(an)m(y)f(more)f(input.)572 4885 y(Next)h(state)h(=)e
7312 -(FLUSHING)572 4988 y(Return)f(v)-5 b(alue)30 b(=)g Fj(BZ_FLUSH_OK)390
7313 -5196 y Fl(R)m(UNNING/)p Fj(BZ_FINISH)572 5300 y Fl(Remem)m(b)s(er)g
7314 -(curren)m(t)g(v)-5 b(alue)30 b(of)g Fj(next_in)p Fl(.)59
7315 -b(Compress)30 b(from)g Fj(next_in)p eop
7316 -%%Page: 16 17
7317 -16 16 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
7318 -b(with)g Fj(libbzip2)1881 b Fl(16)572 299 y(to)31 b Fj(next_out)d
7319 -Fl(as)j(m)m(uc)m(h)f(as)h(p)s(ossible,)d(but)i(do)g(not)g(accept)i(an)m
7320 -(y)f(more)f(input.)572 403 y(Next)h(state)h(=)e(FINISHING)572
7321 -506 y(Return)f(v)-5 b(alue)30 b(=)g Fj(BZ_FINISH_OK)390
7322 -714 y Fl(FLUSHING/)p Fj(BZ_FLUSH)572 818 y Fl(Compress)f(from)h
7323 -Fj(next_in)f Fl(to)i Fj(next_out)d Fl(as)i(m)m(uc)m(h)h(as)f(p)s
7324 -(ossible,)572 922 y(but)f(do)i(not)f(accept)i(an)m(y)f(more)f(input.)
7325 -572 1025 y(If)g(all)f(the)i(existing)e(input)f(has)i(b)s(een)g(used)g
7326 -(up)f(and)h(all)f(compressed)572 1129 y(output)h(has)g(b)s(een)g(remo)m
7327 -(v)m(ed)663 1233 y(Next)h(state)h(=)e(R)m(UNNING;)i(Return)d(v)-5
7328 -b(alue)30 b(=)g Fj(BZ_RUN_OK)572 1337 y Fl(else)663 1440
7329 -y(Next)h(state)h(=)e(FLUSHING;)h(Return)e(v)-5 b(alue)30
7330 -b(=)g Fj(BZ_FLUSH_OK)390 1648 y Fl(FLUSHING/other)572
7331 -1752 y(Illegal.)572 1856 y(Return)f(v)-5 b(alue)30 b(=)g
7332 -Fj(BZ_SEQUENCE_ERROR)390 2063 y Fl(FINISHING/)p Fj(BZ_FINISH)572
7333 -2167 y Fl(Compress)f(from)h Fj(next_in)f Fl(to)i Fj(next_out)d
7334 -Fl(as)i(m)m(uc)m(h)h(as)f(p)s(ossible,)572 2271 y(but)f(to)j(not)e
7335 -(accept)i(an)m(y)f(more)f(input.)572 2374 y(If)g(all)f(the)i(existing)e
7336 -(input)f(has)i(b)s(een)g(used)g(up)f(and)h(all)f(compressed)572
7337 -2478 y(output)h(has)g(b)s(een)g(remo)m(v)m(ed)663 2582
7338 -y(Next)h(state)h(=)e(IDLE;)g(Return)g(v)-5 b(alue)30
7339 -b(=)g Fj(BZ_STREAM_END)572 2686 y Fl(else)663 2790 y(Next)h(state)h(=)e
7340 -(FINISHING;)g(Return)g(v)-5 b(alue)30 b(=)g Fj(BZ_FINISHING)390
7341 -2997 y Fl(FINISHING/other)572 3101 y(Illegal.)572 3205
7342 -y(Return)f(v)-5 b(alue)30 b(=)g Fj(BZ_SEQUENCE_ERROR)150
7343 -3361 y Fl(That)24 b(still)f(lo)s(oks)g(complicated?)39
7344 -b(W)-8 b(ell,)25 b(fair)f(enough.)38 b(The)24 b(usual)f(sequence)i(of)f
7345 -(calls)g(for)g(compressing)150 3471 y(a)31 b(load)f(of)g(data)h(is:)225
7346 -3628 y Fi(\017)60 b Fl(Get)31 b(started)g(with)e Fj(BZ2_bzCompressInit)
7347 -p Fl(.)225 3774 y Fi(\017)60 b Fl(Sho)m(v)m(el)38 b(data)h(in)e(and)g
7348 -(shlurp)e(out)k(its)e(compressed)h(form)g(using)e(zero)j(or)f(more)h
7349 -(calls)e(of)h Fj(BZ2_)330 3884 y(bzCompress)28 b Fl(with)h(action)h(=)g
7350 -Fj(BZ_RUN)p Fl(.)225 4030 y Fi(\017)60 b Fl(Finish)23
7351 -b(up.)38 b(Rep)s(eatedly)25 b(call)f Fj(BZ2_bzCompress)e
7352 -Fl(with)i(action)h(=)g Fj(BZ_FINISH)p Fl(,)f(cop)m(ying)h(out)h(the)330
7353 -4139 y(compressed)k(output,)g(un)m(til)f Fj(BZ_STREAM_END)e
7354 -Fl(is)i(returned.)225 4285 y Fi(\017)60 b Fl(Close)30
7355 -b(up)f(and)h(go)h(home.)41 b(Call)29 b Fj(BZ2_bzCompressEnd)p
7356 -Fl(.)150 4478 y(If)23 b(the)h(data)h(y)m(ou)f(w)m(an)m(t)h(to)f
7357 -(compress)g(\014ts)f(in)m(to)h(y)m(our)g(input)e(bu\013er)h(all)f(at)j
7358 -(once,)h(y)m(ou)e(can)g(skip)f(the)h(calls)150 4588 y(of)37
7359 -b Fj(BZ2_bzCompress)26 b(\()k(...,)f(BZ_RUN)g(\))36 b
7360 -Fl(and)g(just)g(do)h(the)g Fj(BZ2_bzCompress)26 b(\()k(...,)f
7361 -(BZ_FINISH)150 4698 y(\))h Fl(calls.)150 4854 y(All)36
7362 -b(required)g(memory)h(is)f(allo)s(cated)i(b)m(y)f Fj
7363 -(BZ2_bzCompressInit)p Fl(.)56 b(The)37 b(compression)g(library)e(can)
7364 -150 4964 y(accept)g(an)m(y)f(data)h(at)g(all)d(\(ob)m(viously\).)51
7365 -b(So)34 b(y)m(ou)g(shouldn't)e(get)j(an)m(y)f(error)f(return)g(v)-5
7366 -b(alues)33 b(from)h(the)150 5074 y Fj(BZ2_bzCompress)29
7367 -b Fl(calls.)46 b(If)32 b(y)m(ou)h(do,)g(they)g(will)d(b)s(e)i
7368 -Fj(BZ_SEQUENCE_ERROR)p Fl(,)d(and)j(indicate)f(a)i(bug)f(in)150
7369 -5183 y(y)m(our)e(programming.)150 5340 y(T)-8 b(rivial)28
7370 -b(other)j(p)s(ossible)d(return)h(v)-5 b(alues:)p eop
7371 -%%Page: 17 18
7372 -17 17 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
7373 -b(with)g Fj(libbzip2)1881 b Fl(17)572 299 y Fj(BZ_PARAM_ERROR)663
7374 -403 y Fl(if)29 b Fj(strm)g Fl(is)h Fj(NULL)p Fl(,)f(or)i
7375 -Fj(strm->s)d Fl(is)h Fj(NULL)150 652 y Ff(3.3.3)63 b
7376 -Fe(BZ2_bzCompressEnd)390 839 y Fj(int)47 b(BZ2_bzCompressEnd)c(\()k
7377 -(bz_stream)f(*strm)g(\);)150 996 y Fl(Releases)31 b(all)e(memory)h
7378 -(asso)s(ciated)h(with)e(a)i(compression)e(stream.)150
7379 -1153 y(P)m(ossible)g(return)h(v)-5 b(alues:)481 1304
7380 -y Fj(BZ_PARAM_ERROR)117 b Fl(if)30 b Fj(strm)f Fl(is)g
7381 -Fj(NULL)g Fl(or)i Fj(strm->s)d Fl(is)i Fj(NULL)481 1408
7382 -y(BZ_OK)120 b Fl(otherwise)150 1657 y Ff(3.3.4)63 b Fe
7383 -(BZ2_bzDecompressInit)390 1844 y Fj(int)47 b(BZ2_bzDecompressInit)42
7384 -b(\()48 b(bz_stream)d(*strm,)h(int)h(verbosity,)e(int)i(small)f(\);)150
7385 -2001 y Fl(Prepares)30 b(for)f(decompression.)40 b(As)29
7386 -b(with)g Fj(BZ2_bzCompressInit)p Fl(,)c(a)31 b Fj(bz_stream)c
7387 -Fl(record)j(should)e(b)s(e)150 2110 y(allo)s(cated)c(and)f(initialised)
7388 -e(b)s(efore)i(the)i(call.)38 b(Fields)22 b Fj(bzalloc)p
7389 -Fl(,)i Fj(bzfree)e Fl(and)i Fj(opaque)e Fl(should)g(b)s(e)h(set)i(if)
7390 -150 2220 y(a)h(custom)f(memory)g(allo)s(cator)g(is)g(required,)f(or)h
7391 -(made)h Fj(NULL)e Fl(for)h(the)g(normal)f Fj(malloc)p
7392 -Fl(/)p Fj(free)f Fl(routines.)150 2330 y(Up)s(on)h(return,)h(the)g(in)m
7393 -(ternal)f(state)i(will)c(ha)m(v)m(e)k(b)s(een)f(initialised,)d(and)i
7394 -Fj(total_in)f Fl(and)h Fj(total_out)f Fl(will)150 2439
7395 -y(b)s(e)30 b(zero.)150 2596 y(F)-8 b(or)31 b(the)g(meaning)e(of)i
7396 -(parameter)g Fj(verbosity)p Fl(,)d(see)j Fj(BZ2_bzCompressInit)p
7397 -Fl(.)150 2753 y(If)e Fj(small)e Fl(is)h(nonzero,)i(the)f(library)e
7398 -(will)f(use)j(an)g(alternativ)m(e)h(decompression)e(algorithm)g(whic)m
7399 -(h)f(uses)150 2862 y(less)c(memory)g(but)g(at)h(the)g(cost)h(of)e
7400 -(decompressing)g(more)g(slo)m(wly)g(\(roughly)f(sp)s(eaking,)i(half)f
7401 -(the)h(sp)s(eed,)150 2972 y(but)34 b(the)i(maxim)m(um)d(memory)i
7402 -(requiremen)m(t)g(drops)e(to)j(around)e(2300k\).)57 b(See)35
7403 -b(Chapter)g(2)g(for)g(more)150 3082 y(information)29
7404 -b(on)h(memory)g(managemen)m(t.)150 3238 y(Note)40 b(that)f(the)f(amoun)
7405 -m(t)h(of)g(memory)f(needed)g(to)i(decompress)e(a)h(stream)f(cannot)h(b)
7406 -s(e)f(determined)150 3348 y(un)m(til)j(the)h(stream's)h(header)f(has)g
7407 -(b)s(een)g(read,)j(so)e(ev)m(en)g(if)e Fj(BZ2_bzDecompressInit)c
7408 -Fl(succeeds,)46 b(a)150 3458 y(subsequen)m(t)30 b Fj(BZ2_bzDecompress)c
7409 -Fl(could)j(fail)g(with)g Fj(BZ_MEM_ERROR)p Fl(.)150 3614
7410 -y(P)m(ossible)g(return)h(v)-5 b(alues:)572 3765 y Fj(BZ_CONFIG_ERROR)
7411 -663 3869 y Fl(if)29 b(the)i(library)d(has)i(b)s(een)f(mis-compiled)572
7412 -3973 y Fj(BZ_PARAM_ERROR)663 4077 y Fl(if)g Fj(\(small)46
7413 -b(!=)h(0)h(&&)f(small)f(!=)h(1\))663 4181 y Fl(or)30
7414 -b Fj(\(verbosity)45 b(<)j(0)f(||)g(verbosity)e(>)j(4\))572
7415 -4284 y(BZ_MEM_ERROR)663 4388 y Fl(if)29 b(insu\016cien)m(t)g(memory)h
7416 -(is)f(a)m(v)-5 b(ailable)150 4545 y(Allo)m(w)m(able)30
7417 -b(next)g(actions:)572 4696 y Fj(BZ2_bzDecompress)663
7418 -4800 y Fl(if)f Fj(BZ_OK)g Fl(w)m(as)i(returned)572 4904
7419 -y(no)f(sp)s(eci\014c)f(action)i(required)e(in)g(case)i(of)g(error)150
7420 -5153 y Ff(3.3.5)63 b Fe(BZ2_bzDecompress)390 5340 y Fj(int)47
7421 -b(BZ2_bzDecompress)c(\()48 b(bz_stream)d(*strm)h(\);)p
7422 -eop
7423 -%%Page: 18 19
7424 -18 18 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
7425 -b(with)g Fj(libbzip2)1881 b Fl(18)150 299 y(Pro)m(vides)24
7426 -b(more)g(input)f(and/out)h(output)g(bu\013er)g(space)h(for)f(the)g
7427 -(library)-8 b(.)37 b(The)24 b(caller)g(main)m(tains)f(input)150
7428 -408 y(and)30 b(output)g(bu\013ers,)f(and)h(uses)g Fj(BZ2_bzDecompress)c
7429 -Fl(to)31 b(transfer)f(data)h(b)s(et)m(w)m(een)g(them.)150
7430 -565 y(Before)g(eac)m(h)g(call)f(to)g Fj(BZ2_bzDecompress)p
7431 -Fl(,)c Fj(next_in)i Fl(should)h(p)s(oin)m(t)g(at)h(the)h(compressed)e
7432 -(data,)j(and)150 675 y Fj(avail_in)h Fl(should)h(indicate)h(ho)m(w)h
7433 -(man)m(y)f(b)m(ytes)i(the)e(library)f(ma)m(y)i(read.)56
7434 -b Fj(BZ2_bzDecompress)32 b Fl(up-)150 784 y(dates)f Fj(next_in)p
7435 -Fl(,)e Fj(avail_in)f Fl(and)h Fj(total_in)g Fl(to)i(re\015ect)g(the)f
7436 -(n)m(um)m(b)s(er)f(of)i(b)m(ytes)g(it)f(has)g(read.)150
7437 -941 y(Similarly)-8 b(,)37 b Fj(next_out)f Fl(should)g(p)s(oin)m(t)i(to)
7438 -g(a)h(bu\013er)e(in)g(whic)m(h)g(the)i(uncompressed)e(output)g(is)h(to)
7439 -h(b)s(e)150 1051 y(placed,)d(with)e Fj(avail_out)f Fl(indicating)g(ho)m
7440 -(w)i(m)m(uc)m(h)g(output)g(space)h(is)e(a)m(v)-5 b(ailable.)55
7441 -b Fj(BZ2_bzCompress)150 1160 y Fl(up)s(dates)29 b Fj(next_out)p
7442 -Fl(,)g Fj(avail_out)f Fl(and)h Fj(total_out)f Fl(to)j(re\015ect)g(the)g
7443 -(n)m(um)m(b)s(er)e(of)h(b)m(ytes)h(output.)150 1317 y(Y)-8
7444 -b(ou)40 b(ma)m(y)g(pro)m(vide)e(and)h(remo)m(v)m(e)i(as)f(little)e(or)h
7445 -(as)h(m)m(uc)m(h)f(data)h(as)g(y)m(ou)f(lik)m(e)g(on)g(eac)m(h)i(call)e
7446 -(of)g Fj(BZ2_)150 1427 y(bzDecompress)p Fl(.)e(In)27
7447 -b(the)i(limit,)d(it)i(is)f(acceptable)j(to)f(supply)d(and)h(remo)m(v)m
7448 -(e)j(data)f(one)f(b)m(yte)h(at)g(a)g(time,)150 1537 y(although)f(this)f
7449 -(w)m(ould)g(b)s(e)h(terribly)e(ine\016cien)m(t.)39 b(Y)-8
7450 -b(ou)29 b(should)e(alw)m(a)m(ys)h(ensure)g(that)h(at)g(least)g(one)f(b)
7451 -m(yte)150 1646 y(of)j(output)f(space)g(is)g(a)m(v)-5
7452 -b(ailable)30 b(at)h(eac)m(h)g(call.)150 1803 y(Use)g(of)f
7453 -Fj(BZ2_bzDecompress)c Fl(is)k(simpler)e(than)i Fj(BZ2_bzCompress)p
7454 -Fl(.)150 1960 y(Y)-8 b(ou)31 b(should)d(pro)m(vide)h(input)f(and)i
7455 -(remo)m(v)m(e)i(output)d(as)i(describ)s(ed)d(ab)s(o)m(v)m(e,)k(and)d
7456 -(rep)s(eatedly)h(call)f Fj(BZ2_)150 2069 y(bzDecompress)35
7457 -b Fl(un)m(til)i Fj(BZ_STREAM_END)e Fl(is)j(returned.)64
7458 -b(App)s(earance)39 b(of)g Fj(BZ_STREAM_END)c Fl(denotes)150
7459 -2179 y(that)47 b Fj(BZ2_bzDecompress)42 b Fl(has)k(detected)h(the)f
7460 -(logical)g(end)g(of)g(the)h(compressed)e(stream.)89 b
7461 -Fj(BZ2_)150 2289 y(bzDecompress)28 b Fl(will)g(not)j(pro)s(duce)f
7462 -Fj(BZ_STREAM_END)d Fl(un)m(til)j(all)f(output)i(data)h(has)e(b)s(een)h
7463 -(placed)f(in)m(to)150 2398 y(the)36 b(output)g(bu\013er,)h(so)g(once)g
7464 -Fj(BZ_STREAM_END)32 b Fl(app)s(ears,)38 b(y)m(ou)e(are)h(guaran)m(teed)
7465 -g(to)g(ha)m(v)m(e)h(a)m(v)-5 b(ailable)150 2508 y(all)29
7466 -b(the)i(decompressed)f(output,)g(and)g Fj(BZ2_bzDecompressEnd)25
7467 -b Fl(can)31 b(safely)f(b)s(e)f(called.)150 2665 y(If)40
7468 -b(case)h(of)f(an)h(error)e(return)h(v)-5 b(alue,)42 b(y)m(ou)f(should)d
7469 -(call)h Fj(BZ2_bzDecompressEnd)c Fl(to)41 b(clean)f(up)g(and)150
7470 -2774 y(release)31 b(memory)-8 b(.)150 2931 y(P)m(ossible)29
7471 -b(return)h(v)-5 b(alues:)572 3082 y Fj(BZ_PARAM_ERROR)663
7472 -3186 y Fl(if)29 b Fj(strm)g Fl(is)h Fj(NULL)f Fl(or)h
7473 -Fj(strm->s)f Fl(is)g Fj(NULL)663 3290 y Fl(or)h Fj(strm->avail_out)44
7474 -b(<)j(1)572 3393 y(BZ_DATA_ERROR)663 3497 y Fl(if)29
7475 -b(a)i(data)g(in)m(tegrit)m(y)f(error)g(is)g(detected)h(in)e(the)i
7476 -(compressed)f(stream)572 3601 y Fj(BZ_DATA_ERROR_MAGIC)663
7477 -3705 y Fl(if)f(the)i(compressed)f(stream)g(do)s(esn't)h(b)s(egin)e
7478 -(with)g(the)h(righ)m(t)g(magic)h(b)m(ytes)572 3808 y
7479 -Fj(BZ_MEM_ERROR)663 3912 y Fl(if)e(there)i(w)m(asn't)f(enough)h(memory)
7480 -f(a)m(v)-5 b(ailable)572 4016 y Fj(BZ_STREAM_END)663
7481 -4120 y Fl(if)29 b(the)i(logical)e(end)h(of)h(the)f(data)h(stream)g(w)m
7482 -(as)g(detected)g(and)f(all)663 4224 y(output)g(in)f(has)h(b)s(een)g
7483 -(consumed,)f(eg)j Fj(s->avail_out)44 b(>)k(0)572 4327
7484 -y(BZ_OK)663 4431 y Fl(otherwise)150 4588 y(Allo)m(w)m(able)30
7485 -b(next)g(actions:)572 4739 y Fj(BZ2_bzDecompress)663
7486 -4843 y Fl(if)f Fj(BZ_OK)g Fl(w)m(as)i(returned)572 4946
7487 -y Fj(BZ2_bzDecompressEnd)663 5050 y Fl(otherwise)p eop
7488 -%%Page: 19 20
7489 -19 19 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
7490 -b(with)g Fj(libbzip2)1881 b Fl(19)150 299 y Ff(3.3.6)63
7491 -b Fe(BZ2_bzDecompressEnd)390 486 y Fj(int)47 b(BZ2_bzDecompressEnd)42
7492 -b(\()48 b(bz_stream)d(*strm)i(\);)150 643 y Fl(Releases)31
7493 -b(all)e(memory)h(asso)s(ciated)h(with)e(a)i(decompression)e(stream.)150
7494 -799 y(P)m(ossible)g(return)h(v)-5 b(alues:)572 950 y
7495 -Fj(BZ_PARAM_ERROR)663 1054 y Fl(if)29 b Fj(strm)g Fl(is)h
7496 -Fj(NULL)f Fl(or)h Fj(strm->s)f Fl(is)g Fj(NULL)572 1158
7497 -y(BZ_OK)663 1262 y Fl(otherwise)150 1419 y(Allo)m(w)m(able)h(next)g
7498 -(actions:)572 1570 y(None.)150 1857 y Fk(3.4)68 b(High-lev)l(el)47
7499 -b(in)l(terface)150 2050 y Fl(This)35 b(in)m(terface)j(pro)m(vides)d
7500 -(functions)h(for)g(reading)g(and)h(writing)e Fj(bzip2)g
7501 -Fl(format)i(\014les.)59 b(First,)39 b(some)150 2159 y(general)30
7502 -b(p)s(oin)m(ts.)225 2316 y Fi(\017)60 b Fl(All)35 b(of)h(the)g
7503 -(functions)e(tak)m(e)k(an)e Fj(int*)f Fl(\014rst)g(argumen)m(t,)j
7504 -Fj(bzerror)p Fl(.)56 b(After)36 b(eac)m(h)h(call,)g Fj(bzerror)330
7505 -2426 y Fl(should)23 b(b)s(e)i(consulted)g(\014rst)g(to)h(determine)e
7506 -(the)i(outcome)h(of)e(the)h(call.)38 b(If)25 b Fj(bzerror)f
7507 -Fl(is)g Fj(BZ_OK)p Fl(,)i(the)330 2535 y(call)35 b(completed)g
7508 -(successfully)-8 b(,)36 b(and)f(only)g(then)g(should)f(the)h(return)g
7509 -(v)-5 b(alue)35 b(of)h(the)f(function)g(\(if)330 2645
7510 -y(an)m(y\))30 b(b)s(e)f(consulted.)39 b(If)29 b Fj(bzerror)e
7511 -Fl(is)h Fj(BZ_IO_ERROR)p Fl(,)f(there)i(w)m(as)h(an)f(error)g
7512 -(reading/writing)e(the)330 2754 y(underlying)32 b(compressed)j(\014le,)
7513 -h(and)f(y)m(ou)h(should)d(then)i(consult)g Fj(errno)p
7514 -Fl(/)p Fj(perror)e Fl(to)j(determine)330 2864 y(the)i(cause)g(of)g(the)
7515 -g(di\016cult)m(y)-8 b(.)61 b Fj(bzerror)36 b Fl(ma)m(y)i(also)g(b)s(e)f
7516 -(set)h(to)g(v)-5 b(arious)37 b(other)h(v)-5 b(alues;)41
7517 -b(precise)330 2974 y(details)29 b(are)i(giv)m(en)g(on)f(a)h(p)s
7518 -(er-function)d(basis)h(b)s(elo)m(w.)225 3111 y Fi(\017)60
7519 -b Fl(If)40 b Fj(bzerror)f Fl(indicates)g(an)i(error)f(\(ie,)j(an)m
7520 -(ything)d(except)h Fj(BZ_OK)f Fl(and)g Fj(BZ_STREAM_END)p
7521 -Fl(\),)g(y)m(ou)330 3220 y(should)56 b(immediately)h(call)g
7522 -Fj(BZ2_bzReadClose)e Fl(\(or)j Fj(BZ2_bzWriteClose)p
7523 -Fl(,)j(dep)s(ending)56 b(on)330 3330 y(whether)50 b(y)m(ou)g(are)h
7524 -(attempting)g(to)g(read)f(or)g(to)i(write\))d(to)j(free)e(up)f(all)h
7525 -(resources)g(asso)s(ci-)330 3439 y(ated)33 b(with)e(the)i(stream.)47
7526 -b(Once)32 b(an)h(error)f(has)g(b)s(een)g(indicated,)f(b)s(eha)m(viour)g
7527 -(of)i(all)e(calls)h(except)330 3549 y Fj(BZ2_bzReadClose)46
7528 -b Fl(\()p Fj(BZ2_bzWriteClose)p Fl(\))h(is)j(unde\014ned.)99
7529 -b(The)50 b(implication)e(is)i(that)h(\(1\))330 3659 y
7530 -Fj(bzerror)44 b Fl(should)g(b)s(e)h(c)m(hec)m(k)m(ed)j(after)e(eac)m(h)
7531 -h(call,)i(and)c(\(2\))i(if)e Fj(bzerror)f Fl(indicates)g(an)i(error,)
7532 -330 3768 y Fj(BZ2_bzReadClose)26 b Fl(\()p Fj(BZ2_bzWriteClose)p
7533 -Fl(\))h(should)h(then)i(b)s(e)g(called)g(to)h(clean)f(up.)225
7534 -3905 y Fi(\017)60 b Fl(The)33 b Fj(FILE*)f Fl(argumen)m(ts)h(passed)g
7535 -(to)h Fj(BZ2_bzReadOpen)p Fl(/)p Fj(BZ2_bzWriteOp)o(en)27
7536 -b Fl(should)32 b(b)s(e)g(set)i(to)330 4015 y(binary)23
7537 -b(mo)s(de.)38 b(Most)26 b(Unix)d(systems)i(will)d(do)i(this)g(b)m(y)g
7538 -(default,)i(but)e(other)g(platforms,)h(including)330
7539 -4124 y(Windo)m(ws)20 b(and)g(Mac,)k(will)19 b(not.)38
7540 -b(If)20 b(y)m(ou)h(omit)g(this,)h(y)m(ou)f(ma)m(y)h(encoun)m(ter)f
7541 -(problems)e(when)h(mo)m(ving)330 4234 y(co)s(de)31 b(to)g(new)f
7542 -(platforms.)225 4371 y Fi(\017)60 b Fl(Memory)23 b(allo)s(cation)f
7543 -(requests)h(are)g(handled)e(b)m(y)i Fj(malloc)p Fl(/)p
7544 -Fj(free)p Fl(.)36 b(A)m(t)23 b(presen)m(t)g(there)g(is)f(no)h(facilit)m
7545 -(y)330 4481 y(for)40 b(user-de\014ned)e(memory)i(allo)s(cators)g(in)f
7546 -(the)h(\014le)g(I/O)g(functions)e(\(could)i(easily)f(b)s(e)g(added,)330
7547 -4590 y(though\).)150 4842 y Ff(3.4.1)63 b Fe(BZ2_bzReadOpen)533
7548 -5029 y Fj(typedef)46 b(void)h(BZFILE;)533 5236 y(BZFILE)f
7549 -(*BZ2_bzReadOpen)e(\()j(int)g(*bzerror,)f(FILE)g(*f,)1726
7550 -5340 y(int)h(small,)f(int)h(verbosity,)p eop
7551 -%%Page: 20 21
7552 -20 20 bop 150 -116 a Fl(Chapter)30 b(3:)h(Programming)e(with)g
7553 -Fj(libbzip2)1891 b Fl(20)1726 299 y Fj(void)47 b(*unused,)f(int)g
7554 -(nUnused)g(\);)150 456 y Fl(Prepare)29 b(to)g(read)g(compressed)f(data)
7555 -i(from)e(\014le)g(handle)f Fj(f)p Fl(.)40 b Fj(f)29 b
7556 -Fl(should)d(refer)j(to)h(a)f(\014le)f(whic)m(h)f(has)i(b)s(een)150
7557 -565 y(op)s(ened)h(for)h(reading,)f(and)h(for)f(whic)m(h)g(the)h(error)g
7558 -(indicator)e(\()p Fj(ferror\(f\))p Fl(\)is)f(not)k(set.)42
7559 -b(If)31 b Fj(small)e Fl(is)h(1,)150 675 y(the)h(library)d(will)f(try)j
7560 -(to)i(decompress)e(using)f(less)g(memory)-8 b(,)31 b(at)g(the)g(exp)s
7561 -(ense)f(of)g(sp)s(eed.)150 832 y(F)-8 b(or)39 b(reasons)f(explained)f
7562 -(b)s(elo)m(w,)j Fj(BZ2_bzRead)35 b Fl(will)h(decompress)i(the)g
7563 -Fj(nUnused)e Fl(b)m(ytes)j(starting)f(at)150 941 y Fj(unused)p
7564 -Fl(,)k(b)s(efore)e(starting)h(to)g(read)g(from)f(the)h(\014le)f
7565 -Fj(f)p Fl(.)71 b(A)m(t)42 b(most)f Fj(BZ_MAX_UNUSED)c
7566 -Fl(b)m(ytes)k(ma)m(y)h(b)s(e)150 1051 y(supplied)32 b(lik)m(e)k(this.)
7567 -55 b(If)36 b(this)e(facilit)m(y)h(is)g(not)h(required,)g(y)m(ou)g
7568 -(should)e(pass)h Fj(NULL)g Fl(and)g Fj(0)g Fl(for)h Fj(unused)150
7569 -1160 y Fl(and)30 b(n)p Fj(Unused)e Fl(resp)s(ectiv)m(ely)-8
7570 -b(.)150 1317 y(F)g(or)31 b(the)g(meaning)e(of)i(parameters)g
7571 -Fj(small)e Fl(and)g Fj(verbosity)p Fl(,)f(see)j Fj
7572 -(BZ2_bzDecompressInit)p Fl(.)150 1474 y(The)k(amoun)m(t)g(of)g(memory)g
7573 -(needed)g(to)g(decompress)g(a)h(\014le)e(cannot)h(b)s(e)g(determined)e
7574 -(un)m(til)h(the)h(\014le's)150 1584 y(header)22 b(has)f(b)s(een)g
7575 -(read.)38 b(So)22 b(it)f(is)g(p)s(ossible)e(that)k Fj(BZ2_bzReadOpen)17
7576 -b Fl(returns)k Fj(BZ_OK)f Fl(but)h(a)i(subsequen)m(t)150
7577 -1693 y(call)30 b(of)g Fj(BZ2_bzRead)e Fl(will)f(return)j
7578 -Fj(BZ_MEM_ERROR)p Fl(.)150 1850 y(P)m(ossible)f(assignmen)m(ts)h(to)h
7579 -Fj(bzerror)p Fl(:)572 2001 y Fj(BZ_CONFIG_ERROR)663 2105
7580 -y Fl(if)e(the)i(library)d(has)i(b)s(een)f(mis-compiled)572
7581 -2209 y Fj(BZ_PARAM_ERROR)663 2313 y Fl(if)g Fj(f)h Fl(is)g
7582 -Fj(NULL)663 2416 y Fl(or)g Fj(small)f Fl(is)g(neither)h
7583 -Fj(0)g Fl(nor)g Fj(1)663 2520 y Fl(or)g Fj(\(unused)46
7584 -b(==)h(NULL)g(&&)g(nUnused)f(!=)h(0\))663 2624 y Fl(or)30
7585 -b Fj(\(unused)46 b(!=)h(NULL)g(&&)g(!\(0)g(<=)g(nUnused)f(<=)h
7586 -(BZ_MAX_UNUSED\)\))572 2728 y(BZ_IO_ERROR)663 2831 y
7587 -Fl(if)29 b Fj(ferror\(f\))f Fl(is)h(nonzero)572 2935
7588 -y Fj(BZ_MEM_ERROR)663 3039 y Fl(if)g(insu\016cien)m(t)g(memory)h(is)f
7589 -(a)m(v)-5 b(ailable)572 3143 y Fj(BZ_OK)663 3247 y Fl(otherwise.)150
7590 -3403 y(P)m(ossible)29 b(return)h(v)-5 b(alues:)572 3554
7591 -y(P)m(oin)m(ter)31 b(to)g(an)f(abstract)h Fj(BZFILE)663
7592 -3658 y Fl(if)e Fj(bzerror)f Fl(is)i Fj(BZ_OK)572 3762
7593 -y(NULL)663 3866 y Fl(otherwise)150 4023 y(Allo)m(w)m(able)g(next)g
7594 -(actions:)572 4174 y Fj(BZ2_bzRead)663 4277 y Fl(if)f
7595 -Fj(bzerror)f Fl(is)i Fj(BZ_OK)572 4381 y(BZ2_bzClose)663
7596 -4485 y Fl(otherwise)150 4887 y Ff(3.4.2)63 b Fe(BZ2_bzRead)533
7597 -5074 y Fj(int)47 b(BZ2_bzRead)e(\()j(int)e(*bzerror,)g(BZFILE)g(*b,)h
7598 -(void)f(*buf,)h(int)g(len)g(\);)150 5230 y Fl(Reads)35
7599 -b(up)f(to)h Fj(len)f Fl(\(uncompressed\))h(b)m(ytes)g(from)f(the)h
7600 -(compressed)g(\014le)f Fj(b)g Fl(in)m(to)h(the)g(bu\013er)f
7601 -Fj(buf)p Fl(.)53 b(If)150 5340 y(the)30 b(read)f(w)m(as)h(successful,)f
7602 -Fj(bzerror)e Fl(is)i(set)h(to)g Fj(BZ_OK)e Fl(and)h(the)h(n)m(um)m(b)s
7603 -(er)e(of)i(b)m(ytes)g(read)f(is)g(returned.)p eop
7604 -%%Page: 21 22
7605 -21 21 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
7606 -b(with)g Fj(libbzip2)1881 b Fl(21)150 299 y(If)33 b(the)g(logical)g
7607 -(end-of-stream)h(w)m(as)g(detected,)i Fj(bzerror)31 b
7608 -Fl(will)g(b)s(e)h(set)i(to)g Fj(BZ_STREAM_END)p Fl(,)d(and)i(the)150
7609 -408 y(n)m(um)m(b)s(er)c(of)i(b)m(ytes)f(read)h(is)e(returned.)40
7610 -b(All)29 b(other)h Fj(bzerror)f Fl(v)-5 b(alues)29 b(denote)i(an)g
7611 -(error.)150 565 y Fj(BZ2_bzRead)37 b Fl(will)f(supply)h
7612 -Fj(len)i Fl(b)m(ytes,)j(unless)c(the)i(logical)f(stream)h(end)e(is)h
7613 -(detected)i(or)e(an)g(error)150 675 y(o)s(ccurs.)75 b(Because)43
7614 -b(of)f(this,)i(it)d(is)g(p)s(ossible)e(to)k(detect)g(the)f(stream)g
7615 -(end)f(b)m(y)h(observing)f(when)g(the)150 784 y(n)m(um)m(b)s(er)29
7616 -b(of)h(b)m(ytes)g(returned)f(is)g(less)g(than)h(the)g(n)m(um)m(b)s(er)f
7617 -(requested.)40 b(Nev)m(ertheless,)31 b(this)e(is)g(regarded)150
7618 -894 y(as)38 b(inadvisable;)g(y)m(ou)g(should)d(instead)i(c)m(hec)m(k)i
7619 -Fj(bzerror)d Fl(after)i(ev)m(ery)g(call)e(and)h(w)m(atc)m(h)i(out)f
7620 -(for)f Fj(BZ_)150 1004 y(STREAM_END)p Fl(.)150 1160 y(In)m(ternally)-8
7621 -b(,)47 b Fj(BZ2_bzRead)41 b Fl(copies)j(data)g(from)g(the)g(compressed)
7622 -g(\014le)f(in)f(c)m(h)m(unks)i(of)g(size)g Fj(BZ_MAX_)150
7623 -1270 y(UNUSED)31 b Fl(b)m(ytes)i(b)s(efore)f(decompressing)f(it.)47
7624 -b(If)32 b(the)h(\014le)e(con)m(tains)i(more)g(b)m(ytes)g(than)f
7625 -(strictly)f(needed)150 1380 y(to)48 b(reac)m(h)f(the)g(logical)f
7626 -(end-of-stream,)52 b Fj(BZ2_bzRead)44 b Fl(will)g(almost)j(certainly)f
7627 -(read)h(some)g(of)g(the)150 1489 y(trailing)c(data)j(b)s(efore)e
7628 -(signalling)f Fj(BZ_SEQUENCE_END)p Fl(.)80 b(T)-8 b(o)46
7629 -b(collect)f(the)g(read)g(but)g(un)m(used)e(data)150 1599
7630 -y(once)29 b Fj(BZ_SEQUENCE_END)24 b Fl(has)k(app)s(eared,)g(call)f
7631 -Fj(BZ2_bzReadGetUnused)c Fl(immediately)j(b)s(efore)i
7632 -Fj(BZ2_)150 1708 y(bzReadClose)p Fl(.)150 1865 y(P)m(ossible)h
7633 -(assignmen)m(ts)h(to)h Fj(bzerror)p Fl(:)572 2016 y Fj(BZ_PARAM_ERROR)
7634 -663 2120 y Fl(if)e Fj(b)h Fl(is)g Fj(NULL)f Fl(or)h Fj(buf)g
7635 -Fl(is)f Fj(NULL)g Fl(or)i Fj(len)46 b(<)i(0)572 2224
7636 -y(BZ_SEQUENCE_ERROR)663 2328 y Fl(if)29 b Fj(b)h Fl(w)m(as)h(op)s(ened)
7637 -e(with)h Fj(BZ2_bzWriteOpen)572 2431 y(BZ_IO_ERROR)663
7638 -2535 y Fl(if)f(there)i(is)e(an)h(error)g(reading)g(from)g(the)g
7639 -(compressed)g(\014le)572 2639 y Fj(BZ_UNEXPECTED_EOF)663
7640 -2743 y Fl(if)f(the)i(compressed)f(\014le)f(ended)h(b)s(efore)g(the)g
7641 -(logical)g(end-of-stream)h(w)m(as)g(detected)572 2847
7642 -y Fj(BZ_DATA_ERROR)663 2950 y Fl(if)e(a)i(data)g(in)m(tegrit)m(y)f
7643 -(error)g(w)m(as)h(detected)h(in)d(the)h(compressed)g(stream)572
7644 -3054 y Fj(BZ_DATA_ERROR_MAGIC)663 3158 y Fl(if)f(the)i(stream)f(do)s
7645 -(es)g(not)h(b)s(egin)e(with)g(the)i(requisite)e(header)h(b)m(ytes)h
7646 -(\(ie,)f(is)g(not)663 3262 y(a)g Fj(bzip2)f Fl(data)i(\014le\).)61
7647 -b(This)28 b(is)i(really)f(a)i(sp)s(ecial)e(case)i(of)g
7648 -Fj(BZ_DATA_ERROR)p Fl(.)572 3365 y Fj(BZ_MEM_ERROR)663
7649 -3469 y Fl(if)e(insu\016cien)m(t)g(memory)h(w)m(as)h(a)m(v)-5
7650 -b(ailable)572 3573 y Fj(BZ_STREAM_END)663 3677 y Fl(if)29
7651 -b(the)i(logical)e(end)h(of)h(stream)f(w)m(as)h(detected.)572
7652 -3781 y Fj(BZ_OK)663 3884 y Fl(otherwise.)150 4041 y(P)m(ossible)e
7653 -(return)h(v)-5 b(alues:)572 4192 y(n)m(um)m(b)s(er)29
7654 -b(of)h(b)m(ytes)h(read)663 4296 y(if)e Fj(bzerror)f Fl(is)i
7655 -Fj(BZ_OK)f Fl(or)h Fj(BZ_STREAM_END)572 4400 y Fl(unde\014ned)663
7656 -4503 y(otherwise)150 4660 y(Allo)m(w)m(able)g(next)g(actions:)572
7657 -4811 y(collect)h(data)g(from)f Fj(buf)p Fl(,)f(then)h
7658 -Fj(BZ2_bzRead)e Fl(or)i Fj(BZ2_bzReadClose)663 4915 y
7659 -Fl(if)f Fj(bzerror)f Fl(is)i Fj(BZ_OK)572 5019 y Fl(collect)h(data)g
7660 -(from)f Fj(buf)p Fl(,)f(then)h Fj(BZ2_bzReadClose)d Fl(or)j
7661 -Fj(BZ2_bzReadGetUnused)663 5123 y Fl(if)f Fj(bzerror)f
7662 -Fl(is)i Fj(BZ_SEQUENCE_END)572 5226 y(BZ2_bzReadClose)663
7663 -5330 y Fl(otherwise)p eop
7664 -%%Page: 22 23
7665 -22 22 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
7666 -b(with)g Fj(libbzip2)1881 b Fl(22)150 299 y Ff(3.4.3)63
7667 -b Fe(BZ2_bzReadGetUnused)533 486 y Fj(void)47 b(BZ2_bzReadGetUnused)42
7668 -b(\()48 b(int*)e(bzerror,)g(BZFILE)g(*b,)1822 589 y(void**)g(unused,)g
7669 -(int*)g(nUnused)g(\);)150 746 y Fl(Returns)36 b(data)i(whic)m(h)d(w)m
7670 -(as)j(read)f(from)f(the)h(compressed)g(\014le)f(but)g(w)m(as)h(not)h
7671 -(needed)e(to)i(get)g(to)g(the)150 856 y(logical)k(end-of-stream.)78
7672 -b Fj(*unused)41 b Fl(is)h(set)h(to)g(the)g(address)f(of)g(the)h(data,)k
7673 -(and)42 b Fj(*nUnused)e Fl(to)k(the)150 965 y(n)m(um)m(b)s(er)29
7674 -b(of)i(b)m(ytes.)41 b Fj(*nUnused)28 b Fl(will)g(b)s(e)h(set)i(to)g(a)g
7675 -(v)-5 b(alue)30 b(b)s(et)m(w)m(een)h Fj(0)f Fl(and)g
7676 -Fj(BZ_MAX_UNUSED)d Fl(inclusiv)m(e.)150 1122 y(This)d(function)h(ma)m
7677 -(y)h(only)g(b)s(e)f(called)g(once)i Fj(BZ2_bzRead)c Fl(has)j(signalled)
7678 -e Fj(BZ_STREAM_END)e Fl(but)j(b)s(efore)150 1232 y Fj(BZ2_bzReadClose)p
7679 -Fl(.)150 1389 y(P)m(ossible)k(assignmen)m(ts)h(to)h Fj(bzerror)p
7680 -Fl(:)572 1540 y Fj(BZ_PARAM_ERROR)663 1644 y Fl(if)e
7681 -Fj(b)h Fl(is)g Fj(NULL)663 1747 y Fl(or)g Fj(unused)f
7682 -Fl(is)g Fj(NULL)g Fl(or)i Fj(nUnused)d Fl(is)i Fj(NULL)572
7683 -1851 y(BZ_SEQUENCE_ERROR)663 1955 y Fl(if)f Fj(BZ_STREAM_END)e
7684 -Fl(has)j(not)h(b)s(een)e(signalled)663 2059 y(or)h(if)f
7685 -Fj(b)h Fl(w)m(as)h(op)s(ened)f(with)f Fj(BZ2_bzWriteOpen)542
7686 -2162 y(BZ_OK)663 2266 y Fl(otherwise)150 2423 y(Allo)m(w)m(able)h(next)
7687 -g(actions:)572 2574 y Fj(BZ2_bzReadClose)150 2882 y Ff(3.4.4)63
7688 -b Fe(BZ2_bzReadClose)533 3068 y Fj(void)47 b(BZ2_bzReadClose)c(\()48
7689 -b(int)f(*bzerror,)e(BZFILE)h(*b)h(\);)150 3225 y Fl(Releases)36
7690 -b(all)e(memory)h(p)s(ertaining)e(to)i(the)h(compressed)f(\014le)f
7691 -Fj(b)p Fl(.)54 b Fj(BZ2_bzReadClose)31 b Fl(do)s(es)k(not)h(call)150
7692 -3335 y Fj(fclose)c Fl(on)h(the)h(underlying)d(\014le)h(handle,)h(so)h
7693 -(y)m(ou)g(should)e(do)h(that)h(y)m(ourself)f(if)g(appropriate.)49
7694 -b Fj(BZ2_)150 3445 y(bzReadClose)27 b Fl(should)i(b)s(e)g(called)h(to)h
7695 -(clean)f(up)g(after)h(all)e(error)h(situations.)150 3601
7696 -y(P)m(ossible)f(assignmen)m(ts)h(to)h Fj(bzerror)p Fl(:)572
7697 -3752 y Fj(BZ_SEQUENCE_ERROR)663 3856 y Fl(if)e Fj(b)h
7698 -Fl(w)m(as)h(op)s(ened)e(with)h Fj(BZ2_bzOpenWrite)572
7699 -3960 y(BZ_OK)663 4064 y Fl(otherwise)150 4221 y(Allo)m(w)m(able)g(next)
7700 -g(actions:)572 4372 y(none)150 4679 y Ff(3.4.5)63 b Fe(BZ2_bzWriteOpen)
7701 -533 4866 y Fj(BZFILE)46 b(*BZ2_bzWriteOpen)e(\()j(int)g(*bzerror,)e
7702 -(FILE)i(*f,)1774 4970 y(int)g(blockSize100k,)d(int)j(verbosity,)1774
7703 -5074 y(int)g(workFactor)e(\);)150 5230 y Fl(Prepare)33
7704 -b(to)g(write)f(compressed)h(data)h(to)f(\014le)f(handle)g
7705 -Fj(f)p Fl(.)47 b Fj(f)33 b Fl(should)e(refer)i(to)g(a)g(\014le)f(whic)m
7706 -(h)g(has)h(b)s(een)150 5340 y(op)s(ened)d(for)g(writing,)e(and)i(for)g
7707 -(whic)m(h)f(the)i(error)f(indicator)f(\()p Fj(ferror\(f\))p
7708 -Fl(\)is)f(not)i(set.)p eop
7709 -%%Page: 23 24
7710 -23 23 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
7711 -b(with)g Fj(libbzip2)1881 b Fl(23)150 299 y(F)-8 b(or)31
7712 -b(the)g(meaning)e(of)i(parameters)g Fj(blockSize100k)p
7713 -Fl(,)c Fj(verbosity)g Fl(and)j Fj(workFactor)p Fl(,)e(see)150
7714 -408 y Fj(BZ2_bzCompressInit)p Fl(.)150 565 y(All)d(required)f(memory)i
7715 -(is)f(allo)s(cated)i(at)g(this)e(stage,)j(so)f(if)e(the)h(call)g
7716 -(completes)g(successfully)-8 b(,)26 b Fj(BZ_MEM_)150
7717 -675 y(ERROR)j Fl(cannot)i(b)s(e)f(signalled)e(b)m(y)i(a)h(subsequen)m
7718 -(t)f(call)f(to)i Fj(BZ2_bzWrite)p Fl(.)150 832 y(P)m(ossible)e
7719 -(assignmen)m(ts)h(to)h Fj(bzerror)p Fl(:)572 983 y Fj(BZ_CONFIG_ERROR)
7720 -663 1087 y Fl(if)e(the)i(library)d(has)i(b)s(een)f(mis-compiled)572
7721 -1190 y Fj(BZ_PARAM_ERROR)663 1294 y Fl(if)g Fj(f)h Fl(is)g
7722 -Fj(NULL)663 1398 y Fl(or)g Fj(blockSize100k)44 b(<)k(1)30
7723 -b Fl(or)g Fj(blockSize100k)44 b(>)k(9)572 1502 y(BZ_IO_ERROR)663
7724 -1605 y Fl(if)29 b Fj(ferror\(f\))f Fl(is)h(nonzero)572
7725 -1709 y Fj(BZ_MEM_ERROR)663 1813 y Fl(if)g(insu\016cien)m(t)g(memory)h
7726 -(is)f(a)m(v)-5 b(ailable)572 1917 y Fj(BZ_OK)663 2021
7727 -y Fl(otherwise)150 2177 y(P)m(ossible)29 b(return)h(v)-5
7728 -b(alues:)572 2328 y(P)m(oin)m(ter)31 b(to)g(an)f(abstract)h
7729 -Fj(BZFILE)663 2432 y Fl(if)e Fj(bzerror)f Fl(is)i Fj(BZ_OK)572
7730 -2536 y(NULL)663 2640 y Fl(otherwise)150 2797 y(Allo)m(w)m(able)g(next)g
7731 -(actions:)572 2948 y Fj(BZ2_bzWrite)663 3051 y Fl(if)f
7732 -Fj(bzerror)f Fl(is)i Fj(BZ_OK)604 3155 y Fl(\(y)m(ou)25
7733 -b(could)e(go)h(directly)f(to)h Fj(BZ2_bzWriteClose)p
7734 -Fl(,)c(but)j(this)g(w)m(ould)g(b)s(e)g(prett)m(y)h(p)s(oin)m(tless\))
7735 -572 3259 y Fj(BZ2_bzWriteClose)663 3363 y Fl(otherwise)150
7736 -3639 y Ff(3.4.6)63 b Fe(BZ2_bzWrite)533 3826 y Fj(void)47
7737 -b(BZ2_bzWrite)e(\()i(int)g(*bzerror,)e(BZFILE)h(*b,)h(void)g(*buf,)f
7738 -(int)h(len)g(\);)150 3983 y Fl(Absorbs)26 b Fj(len)g
7739 -Fl(b)m(ytes)i(from)e(the)i(bu\013er)e Fj(buf)p Fl(,)h(ev)m(en)m(tually)
7740 -g(to)h(b)s(e)e(compressed)h(and)f(written)g(to)i(the)g(\014le.)150
7741 -4140 y(P)m(ossible)h(assignmen)m(ts)h(to)h Fj(bzerror)p
7742 -Fl(:)572 4291 y Fj(BZ_PARAM_ERROR)663 4395 y Fl(if)e
7743 -Fj(b)h Fl(is)g Fj(NULL)f Fl(or)h Fj(buf)g Fl(is)f Fj(NULL)g
7744 -Fl(or)i Fj(len)46 b(<)i(0)572 4498 y(BZ_SEQUENCE_ERROR)663
7745 -4602 y Fl(if)29 b(b)h(w)m(as)h(op)s(ened)e(with)g Fj(BZ2_bzReadOpen)572
7746 -4706 y(BZ_IO_ERROR)663 4810 y Fl(if)g(there)i(is)e(an)h(error)g
7747 -(writing)f(the)h(compressed)g(\014le.)572 4914 y Fj(BZ_OK)663
7748 -5017 y Fl(otherwise)150 5294 y Ff(3.4.7)63 b Fe(BZ2_bzWriteClose)p
7749 -eop
7750 -%%Page: 24 25
7751 -24 24 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
7752 -b(with)g Fj(libbzip2)1881 b Fl(24)533 299 y Fj(void)47
7753 -b(BZ2_bzWriteClose)c(\()48 b(int)f(*bzerror,)e(BZFILE*)h(f,)1679
7754 -403 y(int)h(abandon,)1679 506 y(unsigned)e(int*)i(nbytes_in,)1679
7755 -610 y(unsigned)e(int*)i(nbytes_out)e(\);)533 818 y(void)i
7756 -(BZ2_bzWriteClose64)c(\()k(int)g(*bzerror,)e(BZFILE*)h(f,)1774
7757 -922 y(int)h(abandon,)1774 1025 y(unsigned)f(int*)g(nbytes_in_lo32,)1774
7758 -1129 y(unsigned)g(int*)g(nbytes_in_hi32,)1774 1233 y(unsigned)g(int*)g
7759 -(nbytes_out_lo32,)1774 1337 y(unsigned)g(int*)g(nbytes_out_hi32)e(\);)
7760 -150 1493 y Fl(Compresses)39 b(and)g(\015ushes)g(to)h(the)g(compressed)g
7761 -(\014le)f(all)f(data)j(so)f(far)g(supplied)c(b)m(y)k
7762 -Fj(BZ2_bzWrite)p Fl(.)150 1603 y(The)27 b(logical)g(end-of-stream)h
7763 -(mark)m(ers)g(are)g(also)f(written,)h(so)f(subsequen)m(t)g(calls)g(to)h
7764 -Fj(BZ2_bzWrite)d Fl(are)150 1713 y(illegal.)50 b(All)33
7765 -b(memory)h(asso)s(ciated)g(with)f(the)i(compressed)e(\014le)h
7766 -Fj(b)f Fl(is)g(released.)52 b Fj(fflush)33 b Fl(is)g(called)g(on)150
7767 -1822 y(the)e(compressed)f(\014le,)f(but)h(it)g(is)f(not)i
7768 -Fj(fclose)p Fl('d.)150 1979 y(If)i Fj(BZ2_bzWriteClose)c
7769 -Fl(is)k(called)f(to)j(clean)e(up)f(after)i(an)g(error,)g(the)g(only)e
7770 -(action)i(is)f(to)h(release)g(the)150 2089 y(memory)-8
7771 -b(.)42 b(The)30 b(library)e(records)j(the)g(error)f(co)s(des)h(issued)e
7772 -(b)m(y)h(previous)f(calls,)i(so)f(this)g(situation)g(will)150
7773 -2198 y(b)s(e)c(detected)h(automatically)-8 b(.)40 b(There)26
7774 -b(is)g(no)g(attempt)h(to)h(complete)e(the)h(compression)f(op)s
7775 -(eration,)g(nor)150 2308 y(to)32 b Fj(fflush)d Fl(the)i(compressed)g
7776 -(\014le.)42 b(Y)-8 b(ou)32 b(can)f(force)h(this)e(b)s(eha)m(viour)g(to)
7777 -h(happ)s(en)f(ev)m(en)i(in)d(the)j(case)g(of)150 2417
7778 -y(no)e(error,)g(b)m(y)h(passing)e(a)i(nonzero)f(v)-5
7779 -b(alue)30 b(to)h Fj(abandon)p Fl(.)150 2574 y(If)j Fj(nbytes_in)d
7780 -Fl(is)j(non-n)m(ull,)f Fj(*nbytes_in)e Fl(will)h(b)s(e)h(set)i(to)g(b)s
7781 -(e)f(the)g(total)h(v)m(olume)f(of)g(uncompressed)150
7782 -2684 y(data)k(handled.)60 b(Similarly)-8 b(,)35 b Fj(nbytes_out)g
7783 -Fl(will)g(b)s(e)h(set)i(to)g(the)g(total)g(v)m(olume)f(of)g(compressed)
7784 -g(data)150 2793 y(written.)h(F)-8 b(or)27 b(compatibilit)m(y)d(with)h
7785 -(older)g(v)m(ersions)h(of)g(the)g(library)-8 b(,)25 b
7786 -Fj(BZ2_bzWriteClose)d Fl(only)j(yields)150 2903 y(the)40
7787 -b(lo)m(w)m(er)g(32)h(bits)d(of)i(these)h(coun)m(ts.)69
7788 -b(Use)40 b Fj(BZ2_bzWriteClose64)35 b Fl(if)k(y)m(ou)h(w)m(an)m(t)h
7789 -(the)f(full)d(64)k(bit)150 3013 y(coun)m(ts.)g(These)30
7790 -b(t)m(w)m(o)i(functions)d(are)i(otherwise)f(absolutely)f(iden)m(tical.)
7791 -150 3169 y(P)m(ossible)g(assignmen)m(ts)h(to)h Fj(bzerror)p
7792 -Fl(:)572 3320 y Fj(BZ_SEQUENCE_ERROR)663 3424 y Fl(if)e
7793 -Fj(b)h Fl(w)m(as)h(op)s(ened)e(with)h Fj(BZ2_bzReadOpen)572
7794 -3528 y(BZ_IO_ERROR)663 3632 y Fl(if)f(there)i(is)e(an)h(error)g
7795 -(writing)f(the)h(compressed)g(\014le)572 3736 y Fj(BZ_OK)663
7796 -3839 y Fl(otherwise)150 4161 y Ff(3.4.8)63 b(Handling)41
7797 -b(em)m(b)s(edded)g(compressed)h(data)e(streams)150 4354
7798 -y Fl(The)i(high-lev)m(el)g(library)f(facilitates)h(use)h(of)g
7799 -Fj(bzip2)e Fl(data)j(streams)f(whic)m(h)f(form)g(some)i(part)e(of)i(a)
7800 -150 4463 y(surrounding,)27 b(larger)j(data)h(stream.)225
7801 -4620 y Fi(\017)60 b Fl(F)-8 b(or)22 b(writing,)f(the)g(library)e(tak)m
7802 -(es)k(an)e(op)s(en)f(\014le)g(handle,)i(writes)e(compressed)h(data)h
7803 -(to)g(it,)g Fj(fflush)p Fl(es)330 4730 y(it)34 b(but)f(do)s(es)h(not)h
7804 -Fj(fclose)d Fl(it.)52 b(The)34 b(calling)f(application)g(can)h(write)g
7805 -(its)f(o)m(wn)i(data)g(b)s(efore)f(and)330 4839 y(after)d(the)f
7806 -(compressed)h(data)g(stream,)g(using)d(that)j(same)g(\014le)f(handle.)
7807 -225 5011 y Fi(\017)60 b Fl(Reading)34 b(is)f(more)i(complex,)g(and)f
7808 -(the)h(facilities)d(are)j(not)g(as)g(general)f(as)h(they)f(could)g(b)s
7809 -(e)g(since)330 5121 y(generalit)m(y)e(is)f(hard)f(to)j(reconcile)e
7810 -(with)f(e\016ciency)-8 b(.)46 b Fj(BZ2_bzRead)29 b Fl(reads)i(from)g
7811 -(the)h(compressed)330 5230 y(\014le)39 b(in)g(blo)s(c)m(ks)g(of)h(size)
7812 -g Fj(BZ_MAX_UNUSED)c Fl(b)m(ytes,)44 b(and)39 b(in)g(doing)g(so)h
7813 -(probably)e(will)f(o)m(v)m(ersho)s(ot)330 5340 y(the)i(logical)g(end)f
7814 -(of)h(compressed)f(stream.)67 b(T)-8 b(o)40 b(reco)m(v)m(er)g(this)e
7815 -(data)i(once)f(decompression)f(has)p eop
7816 -%%Page: 25 26
7817 -25 25 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
7818 -b(with)g Fj(libbzip2)1881 b Fl(25)330 299 y(ended,)28
7819 -b(call)g Fj(BZ2_bzReadGetUnused)23 b Fl(after)29 b(the)g(last)f(call)g
7820 -(of)g Fj(BZ2_bzRead)e Fl(\(the)j(one)g(returning)330
7821 -408 y Fj(BZ_STREAM_END)p Fl(\))e(but)j(b)s(efore)g(calling)f
7822 -Fj(BZ2_bzReadClose)p Fl(.)150 596 y(This)51 b(mec)m(hanism)g(mak)m(es)j
7823 -(it)e(easy)h(to)g(decompress)f(m)m(ultiple)e Fj(bzip2)i
7824 -Fl(streams)g(placed)g(end-to-)150 706 y(end.)90 b(As)48
7825 -b(the)f(end)f(of)i(one)f(stream,)52 b(when)46 b Fj(BZ2_bzRead)f
7826 -Fl(returns)h Fj(BZ_STREAM_END)p Fl(,)i(call)e Fj(BZ2_)150
7827 -816 y(bzReadGetUnused)36 b Fl(to)41 b(collect)g(the)g(un)m(used)e(data)
7828 -i(\(cop)m(y)g(it)f(in)m(to)g(y)m(our)h(o)m(wn)f(bu\013er)f
7829 -(somewhere\).)150 925 y(That)25 b(data)g(forms)f(the)h(start)h(of)e
7830 -(the)h(next)g(compressed)g(stream.)39 b(T)-8 b(o)25 b(start)h
7831 -(uncompressing)c(that)k(next)150 1035 y(stream,)40 b(call)d
7832 -Fj(BZ2_bzReadOpen)d Fl(again,)40 b(feeding)d(in)g(the)h(un)m(used)e
7833 -(data)j(via)e(the)h Fj(unused)p Fl(/)p Fj(nUnused)150
7834 -1144 y Fl(parameters.)54 b(Keep)34 b(doing)g(this)f(un)m(til)g
7835 -Fj(BZ_STREAM_END)e Fl(return)j(coincides)f(with)h(the)g(ph)m(ysical)g
7836 -(end)150 1254 y(of)d(\014le)e(\()p Fj(feof\(f\))p Fl(\).)39
7837 -b(In)30 b(this)f(situation)h Fj(BZ2_bzReadGetUnused)25
7838 -b Fl(will)i(of)k(course)g(return)e(no)h(data.)150 1411
7839 -y(This)c(should)f(giv)m(e)j(some)g(feel)f(for)g(ho)m(w)h(the)g
7840 -(high-lev)m(el)e(in)m(terface)i(can)f(b)s(e)g(used.)39
7841 -b(If)27 b(y)m(ou)h(require)e(extra)150 1520 y(\015exibilit)m(y)-8
7842 -b(,)28 b(y)m(ou'll)i(ha)m(v)m(e)h(to)g(bite)f(the)h(bullet)d(and)i(get)
7843 -i(to)f(grips)e(with)g(the)h(lo)m(w-lev)m(el)h(in)m(terface.)150
7844 -1779 y Ff(3.4.9)63 b(Standard)40 b(\014le-reading/writing)j(co)s(de)150
7845 -1972 y Fl(Here's)31 b(ho)m(w)f(y)m(ou'd)h(write)e(data)j(to)f(a)f
7846 -(compressed)g(\014le:)390 2330 y Fj(FILE*)142 b(f;)390
7847 -2434 y(BZFILE*)46 b(b;)390 2538 y(int)238 b(nBuf;)390
7848 -2642 y(char)190 b(buf[)46 b(/*)i(whatever)d(size)i(you)g(like)f(*/)i
7849 -(];)390 2746 y(int)238 b(bzerror;)390 2849 y(int)g(nWritten;)390
7850 -3057 y(f)47 b(=)h(fopen)e(\()i("myfile.bz2",)c("w")j(\);)390
7851 -3161 y(if)g(\(!f\))g({)533 3264 y(/*)g(handle)f(error)h(*/)390
7852 -3368 y(})390 3472 y(b)g(=)h(BZ2_bzWriteOpen)c(\()j(&bzerror,)e(f,)i(9)h
7853 -(\);)390 3576 y(if)f(\(bzerror)f(!=)h(BZ_OK\))f({)533
7854 -3680 y(BZ2_bzWriteClose)e(\()j(b)g(\);)533 3783 y(/*)g(handle)f(error)h
7855 -(*/)390 3887 y(})390 4095 y(while)f(\()i(/*)f(condition)e(*/)i(\))h({)
7856 -533 4198 y(/*)f(get)g(data)g(to)g(write)f(into)h(buf,)g(and)g(set)g
7857 -(nBuf)f(appropriately)e(*/)533 4302 y(nWritten)i(=)h(BZ2_bzWrite)e(\()i
7858 -(&bzerror,)f(b,)h(buf,)f(nBuf)h(\);)533 4406 y(if)g(\(bzerror)f(==)h
7859 -(BZ_IO_ERROR\))e({)676 4510 y(BZ2_bzWriteClose)f(\()j(&bzerror,)e(b)j
7860 -(\);)676 4614 y(/*)g(handle)e(error)g(*/)533 4717 y(})390
7861 -4821 y(})390 5029 y(BZ2_bzWriteClose)d(\()48 b(&bzerror,)d(b)j(\);)390
7862 -5132 y(if)f(\(bzerror)f(==)h(BZ_IO_ERROR\))d({)533 5236
7863 -y(/*)j(handle)f(error)h(*/)390 5340 y(})p eop
7864 -%%Page: 26 27
7865 -26 26 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
7866 -b(with)g Fj(libbzip2)1881 b Fl(26)150 299 y(And)29 b(to)j(read)e(from)g
7867 -(a)h(compressed)f(\014le:)390 450 y Fj(FILE*)142 b(f;)390
7868 -554 y(BZFILE*)46 b(b;)390 657 y(int)238 b(nBuf;)390 761
7869 -y(char)190 b(buf[)46 b(/*)i(whatever)d(size)i(you)g(like)f(*/)i(];)390
7870 -865 y(int)238 b(bzerror;)390 969 y(int)g(nWritten;)390
7871 -1176 y(f)47 b(=)h(fopen)e(\()i("myfile.bz2",)c("r")j(\);)390
7872 -1280 y(if)g(\(!f\))g({)533 1384 y(/*)g(handle)f(error)h(*/)390
7873 -1488 y(})390 1591 y(b)g(=)h(BZ2_bzReadOpen)c(\()j(&bzerror,)f(f,)h(0,)g
7874 -(NULL,)f(0)i(\);)390 1695 y(if)f(\(bzerror)f(!=)h(BZ_OK\))f({)533
7875 -1799 y(BZ2_bzReadClose)e(\()j(&bzerror,)f(b)h(\);)533
7876 -1903 y(/*)g(handle)f(error)h(*/)390 2007 y(})390 2214
7877 -y(bzerror)f(=)h(BZ_OK;)390 2318 y(while)f(\(bzerror)g(==)h(BZ_OK)f(&&)i
7878 -(/*)f(arbitrary)e(other)h(conditions)f(*/\))i({)533 2422
7879 -y(nBuf)g(=)g(BZ2_bzRead)e(\()j(&bzerror,)d(b,)i(buf,)g(/*)g(size)g(of)g
7880 -(buf)g(*/)g(\);)533 2525 y(if)g(\(bzerror)f(==)h(BZ_OK\))f({)676
7881 -2629 y(/*)i(do)f(something)e(with)i(buf[0)f(..)h(nBuf-1])f(*/)533
7882 -2733 y(})390 2837 y(})390 2941 y(if)h(\(bzerror)f(!=)h(BZ_STREAM_END\))
7883 -d({)533 3044 y(BZ2_bzReadClose)g(\()j(&bzerror,)f(b)h(\);)533
7884 -3148 y(/*)g(handle)f(error)h(*/)390 3252 y(})g(else)g({)533
7885 -3356 y(BZ2_bzReadClose)d(\()j(&bzerror)f(\);)390 3459
7886 -y(})150 3753 y Fk(3.5)68 b(Utilit)l(y)47 b(functions)150
7887 -4045 y Ff(3.5.1)63 b Fe(BZ2_bzBuffToBuffCompress)533
7888 -4232 y Fj(int)47 b(BZ2_bzBuffToBuffCompress\()41 b(char*)428
7889 -b(dest,)1965 4335 y(unsigned)46 b(int*)g(destLen,)1965
7890 -4439 y(char*)428 b(source,)1965 4543 y(unsigned)46 b(int)94
7891 -b(sourceLen,)1965 4647 y(int)524 b(blockSize100k,)1965
7892 -4751 y(int)g(verbosity,)1965 4854 y(int)g(workFactor)45
7893 -b(\);)150 5011 y Fl(A)m(ttempts)33 b(to)g(compress)f(the)g(data)h(in)e
7894 -Fj(source[0)d(..)i(sourceLen-1])e Fl(in)m(to)k(the)h(destination)e
7895 -(bu\013er,)150 5121 y Fj(dest[0)e(..)g(*destLen-1])p
7896 -Fl(.)37 b(If)26 b(the)g(destination)g(bu\013er)f(is)h(big)f(enough,)j
7897 -Fj(*destLen)c Fl(is)h(set)i(to)g(the)g(size)150 5230
7898 -y(of)i(the)f(compressed)h(data,)g(and)f Fj(BZ_OK)f Fl(is)h(returned.)39
7899 -b(If)28 b(the)h(compressed)f(data)h(w)m(on't)g(\014t,)g
7900 -Fj(*destLen)150 5340 y Fl(is)g(unc)m(hanged,)i(and)e
7901 -Fj(BZ_OUTBUFF_FULL)e Fl(is)i(returned.)p eop
7902 -%%Page: 27 28
7903 -27 27 bop 150 -116 a Fl(Chapter)30 b(3:)h(Programming)e(with)g
7904 -Fj(libbzip2)1891 b Fl(27)150 299 y(Compression)22 b(in)g(this)h(manner)
7905 -g(is)g(a)h(one-shot)g(ev)m(en)m(t,)j(done)c(with)g(a)h(single)e(call)h
7906 -(to)i(this)d(function.)37 b(The)150 408 y(resulting)25
7907 -b(compressed)i(data)i(is)d(a)i(complete)f Fj(bzip2)f
7908 -Fl(format)i(data)g(stream.)40 b(There)27 b(is)f(no)i(mec)m(hanism)150
7909 -518 y(for)23 b(making)g(additional)e(calls)i(to)h(pro)m(vide)f(extra)h
7910 -(input)e(data.)39 b(If)23 b(y)m(ou)h(w)m(an)m(t)g(that)g(kind)e(of)h
7911 -(mec)m(hanism,)150 628 y(use)30 b(the)h(lo)m(w-lev)m(el)f(in)m
7912 -(terface.)150 784 y(F)-8 b(or)31 b(the)g(meaning)e(of)i(parameters)g
7913 -Fj(blockSize100k)p Fl(,)c Fj(verbosity)g Fl(and)j Fj(workFactor)p
7914 -Fl(,)150 894 y(see)h Fj(BZ2_bzCompressInit)p Fl(.)150
7915 -1051 y(T)-8 b(o)27 b(guaran)m(tee)h(that)e(the)h(compressed)f(data)h
7916 -(will)d(\014t)i(in)f(its)g(bu\013er,)i(allo)s(cate)f(an)g(output)g
7917 -(bu\013er)g(of)g(size)150 1160 y(1\045)31 b(larger)f(than)g(the)g
7918 -(uncompressed)f(data,)j(plus)c(six)h(h)m(undred)g(extra)i(b)m(ytes.)150
7919 -1317 y Fj(BZ2_bzBuffToBuffDecompre)o(ss)25 b Fl(will)k(not)j(write)e
7920 -(data)j(at)f(or)f(b)s(ey)m(ond)g Fj(dest[*destLen])p
7921 -Fl(,)d(ev)m(en)k(in)150 1427 y(case)f(of)g(bu\013er)e(o)m(v)m(er\015o)m
7922 -(w.)150 1584 y(P)m(ossible)g(return)h(v)-5 b(alues:)572
7923 -1735 y Fj(BZ_CONFIG_ERROR)663 1839 y Fl(if)29 b(the)i(library)d(has)i
7924 -(b)s(een)f(mis-compiled)572 1942 y Fj(BZ_PARAM_ERROR)663
7925 -2046 y Fl(if)g Fj(dest)g Fl(is)h Fj(NULL)f Fl(or)h Fj(destLen)f
7926 -Fl(is)g Fj(NULL)663 2150 y Fl(or)h Fj(blockSize100k)44
7927 -b(<)k(1)30 b Fl(or)g Fj(blockSize100k)44 b(>)k(9)663
7928 -2254 y Fl(or)30 b Fj(verbosity)45 b(<)j(0)30 b Fl(or)g
7929 -Fj(verbosity)45 b(>)j(4)663 2357 y Fl(or)30 b Fj(workFactor)45
7930 -b(<)j(0)30 b Fl(or)g Fj(workFactor)45 b(>)i(250)572 2461
7931 -y(BZ_MEM_ERROR)663 2565 y Fl(if)29 b(insu\016cien)m(t)g(memory)h(is)f
7932 -(a)m(v)-5 b(ailable)572 2669 y Fj(BZ_OUTBUFF_FULL)663
7933 -2773 y Fl(if)29 b(the)i(size)f(of)g(the)h(compressed)f(data)h(exceeds)g
7934 -Fj(*destLen)572 2876 y(BZ_OK)663 2980 y Fl(otherwise)150
7935 -3349 y Ff(3.5.2)63 b Fe(BZ2_bzBuffToBuffDecompress)533
7936 -3536 y Fj(int)47 b(BZ2_bzBuffToBuffDecompres)o(s)42 b(\()47
7937 -b(char*)428 b(dest,)2108 3640 y(unsigned)46 b(int*)g(destLen,)2108
7938 -3744 y(char*)428 b(source,)2108 3848 y(unsigned)46 b(int)94
7939 -b(sourceLen,)2108 3951 y(int)524 b(small,)2108 4055 y(int)g(verbosity)
7940 -46 b(\);)150 4212 y Fl(A)m(ttempts)24 b(to)g(decompress)f(the)g(data)g
7941 -(in)f Fj(source[0)28 b(..)i(sourceLen-1])20 b Fl(in)m(to)j(the)g
7942 -(destination)f(bu\013er,)150 4322 y Fj(dest[0)29 b(..)g(*destLen-1])p
7943 -Fl(.)37 b(If)26 b(the)g(destination)g(bu\013er)f(is)h(big)f(enough,)j
7944 -Fj(*destLen)c Fl(is)h(set)i(to)g(the)g(size)150 4431
7945 -y(of)21 b(the)g(uncompressed)e(data,)24 b(and)c Fj(BZ_OK)f
7946 -Fl(is)h(returned.)36 b(If)20 b(the)h(compressed)g(data)g(w)m(on't)h
7947 -(\014t,)g Fj(*destLen)150 4541 y Fl(is)29 b(unc)m(hanged,)i(and)e
7948 -Fj(BZ_OUTBUFF_FULL)e Fl(is)i(returned.)150 4698 y Fj(source)g
7949 -Fl(is)g(assumed)h(to)h(hold)e(a)i(complete)f Fj(bzip2)f
7950 -Fl(format)i(data)g(stream.)150 4807 y Fj(BZ2_bzBuffToBuffDecompre)o(ss)
7951 -22 b Fl(tries)28 b(to)i(decompress)e(the)h(en)m(tiret)m(y)g(of)g(the)f
7952 -(stream)h(in)m(to)g(the)f(out-)150 4917 y(put)i(bu\013er.)150
7953 -5074 y(F)-8 b(or)31 b(the)g(meaning)e(of)i(parameters)g
7954 -Fj(small)e Fl(and)g Fj(verbosity)p Fl(,)f(see)j Fj
7955 -(BZ2_bzDecompressInit)p Fl(.)150 5230 y(Because)j(the)f(compression)e
7956 -(ratio)i(of)g(the)g(compressed)f(data)h(cannot)g(b)s(e)f(kno)m(wn)g(in)
7957 -g(adv)-5 b(ance,)34 b(there)150 5340 y(is)d(no)h(easy)g(w)m(a)m(y)h(to)
7958 -f(guaran)m(tee)i(that)e(the)g(output)f(bu\013er)g(will)e(b)s(e)i(big)g
7959 -(enough.)45 b(Y)-8 b(ou)32 b(ma)m(y)h(of)f(course)p eop
7960 -%%Page: 28 29
7961 -28 28 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
7962 -b(with)g Fj(libbzip2)1881 b Fl(28)150 299 y(mak)m(e)36
7963 -b(arrangemen)m(ts)f(in)e(y)m(our)i(co)s(de)g(to)g(record)g(the)g(size)f
7964 -(of)h(the)g(uncompressed)f(data,)i(but)e(suc)m(h)h(a)150
7965 -408 y(mec)m(hanism)30 b(is)f(b)s(ey)m(ond)h(the)g(scop)s(e)h(of)f(this)
7966 -g(library)-8 b(.)150 565 y Fj(BZ2_bzBuffToBuffDecompre)o(ss)25
7967 -b Fl(will)k(not)j(write)e(data)j(at)f(or)f(b)s(ey)m(ond)g
7968 -Fj(dest[*destLen])p Fl(,)d(ev)m(en)k(in)150 675 y(case)f(of)g(bu\013er)
7969 -e(o)m(v)m(er\015o)m(w.)150 832 y(P)m(ossible)g(return)h(v)-5
7970 -b(alues:)572 983 y Fj(BZ_CONFIG_ERROR)663 1087 y Fl(if)29
7971 -b(the)i(library)d(has)i(b)s(een)f(mis-compiled)572 1190
7972 -y Fj(BZ_PARAM_ERROR)663 1294 y Fl(if)g Fj(dest)g Fl(is)h
7973 -Fj(NULL)f Fl(or)h Fj(destLen)f Fl(is)g Fj(NULL)663 1398
7974 -y Fl(or)h Fj(small)46 b(!=)i(0)f(&&)g(small)g(!=)g(1)663
7975 -1502 y Fl(or)30 b Fj(verbosity)45 b(<)j(0)30 b Fl(or)g
7976 -Fj(verbosity)45 b(>)j(4)572 1605 y(BZ_MEM_ERROR)663 1709
7977 -y Fl(if)29 b(insu\016cien)m(t)g(memory)h(is)f(a)m(v)-5
7978 -b(ailable)572 1813 y Fj(BZ_OUTBUFF_FULL)663 1917 y Fl(if)29
7979 -b(the)i(size)f(of)g(the)h(compressed)f(data)h(exceeds)g
7980 -Fj(*destLen)572 2021 y(BZ_DATA_ERROR)663 2124 y Fl(if)e(a)i(data)g(in)m
7981 -(tegrit)m(y)f(error)g(w)m(as)h(detected)h(in)d(the)h(compressed)g(data)
7982 -572 2228 y Fj(BZ_DATA_ERROR_MAGIC)663 2332 y Fl(if)f(the)i(compressed)f
7983 -(data)h(do)s(esn't)f(b)s(egin)f(with)g(the)i(righ)m(t)e(magic)i(b)m
7984 -(ytes)572 2436 y Fj(BZ_UNEXPECTED_EOF)663 2539 y Fl(if)e(the)i
7985 -(compressed)f(data)h(ends)e(unexp)s(ectedly)572 2643
7986 -y Fj(BZ_OK)663 2747 y Fl(otherwise)150 3116 y Fk(3.6)68
7987 -b Fd(zlib)43 b Fk(compatibilit)l(y)k(functions)150 3308
7988 -y Fl(Y)-8 b(oshiok)j(a)33 b(Tsuneo)e(has)h(con)m(tributed)g(some)g
7989 -(functions)f(to)i(giv)m(e)g(b)s(etter)f Fj(zlib)f Fl(compatibilit)m(y)
7990 --8 b(.)45 b(These)150 3418 y(functions)36 b(are)i Fj(BZ2_bzopen)p
7991 -Fl(,)e Fj(BZ2_bzread)p Fl(,)h Fj(BZ2_bzwrite)p Fl(,)f
7992 -Fj(BZ2_bzflush)p Fl(,)h Fj(BZ2_bzclose)p Fl(,)f Fj(BZ2_)150
7993 -3527 y(bzerror)23 b Fl(and)h Fj(BZ2_bzlibVersion)p Fl(.)34
7994 -b(These)25 b(functions)e(are)j(not)f(\(y)m(et\))h(o\016cially)e(part)h
7995 -(of)g(the)g(library)-8 b(.)150 3637 y(If)30 b(they)g(break,)h(y)m(ou)g
7996 -(get)g(to)g(k)m(eep)g(all)f(the)g(pieces.)41 b(Nev)m(ertheless,)31
7997 -b(I)f(think)f(they)i(w)m(ork)f(ok.)390 3788 y Fj(typedef)46
7998 -b(void)g(BZFILE;)390 3995 y(const)g(char)h(*)g(BZ2_bzlibVersion)d(\()j
7999 -(void)g(\);)150 4152 y Fl(Returns)29 b(a)i(string)f(indicating)e(the)i
8000 -(library)e(v)m(ersion.)390 4303 y Fj(BZFILE)46 b(*)i(BZ2_bzopen)92
8001 -b(\()48 b(const)e(char)h(*path,)f(const)g(char)h(*mode)f(\);)390
8002 -4407 y(BZFILE)g(*)i(BZ2_bzdopen)c(\()k(int)381 b(fd,)190
8003 -b(const)46 b(char)h(*mode)f(\);)150 4564 y Fl(Op)s(ens)19
8004 -b(a)j Fj(.bz2)e Fl(\014le)g(for)g(reading)g(or)h(writing,)g(using)f
8005 -(either)g(its)h(name)g(or)g(a)g(pre-existing)f(\014le)g(descriptor.)150
8006 -4674 y(Analogous)30 b(to)i Fj(fopen)c Fl(and)i Fj(fdopen)p
8007 -Fl(.)390 4825 y Fj(int)47 b(BZ2_bzread)93 b(\()47 b(BZFILE*)f(b,)h
8008 -(void*)f(buf,)h(int)g(len)g(\);)390 4928 y(int)g(BZ2_bzwrite)e(\()i
8009 -(BZFILE*)f(b,)h(void*)f(buf,)h(int)g(len)g(\);)150 5085
8010 -y Fl(Reads/writes)30 b(data)h(from/to)g(a)g(previously)d(op)s(ened)i
8011 -Fj(BZFILE)p Fl(.)39 b(Analogous)30 b(to)h Fj(fread)e
8012 -Fl(and)h Fj(fwrite)p Fl(.)390 5236 y Fj(int)95 b(BZ2_bzflush)44
8013 -b(\()k(BZFILE*)e(b)h(\);)390 5340 y(void)g(BZ2_bzclose)d(\()k(BZFILE*)e
8014 -(b)h(\);)p eop
8015 -%%Page: 29 30
8016 -29 29 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
8017 -b(with)g Fj(libbzip2)1881 b Fl(29)150 299 y(Flushes/closes)27
8018 -b(a)h Fj(BZFILE)p Fl(.)39 b Fj(BZ2_bzflush)24 b Fl(do)s(esn't)k
8019 -(actually)f(do)h(an)m(ything.)39 b(Analogous)28 b(to)h
8020 -Fj(fflush)150 408 y Fl(and)h Fj(fclose)p Fl(.)390 559
8021 -y Fj(const)46 b(char)h(*)g(BZ2_bzerror)e(\()j(BZFILE)e(*b,)h(int)g
8022 -(*errnum)e(\))150 716 y Fl(Returns)31 b(a)i(string)e(describing)f(the)i
8023 -(more)g(recen)m(t)h(error)f(status)h(of)f Fj(b)p Fl(,)g(and)g(also)g
8024 -(sets)h Fj(*errnum)d Fl(to)j(its)150 826 y(n)m(umerical)c(v)-5
8025 -b(alue.)150 1242 y Fk(3.7)68 b(Using)46 b(the)f(library)g(in)g(a)g
8026 -Fd(stdio)p Fk(-free)f(en)l(vironmen)l(t)150 1615 y Ff(3.7.1)63
8027 -b(Getting)40 b(rid)h(of)g Fe(stdio)150 1807 y Fl(In)i(a)g(deeply)g(em)m
8028 -(b)s(edded)f(application,)j(y)m(ou)f(migh)m(t)f(w)m(an)m(t)h(to)g(use)f
8029 -(just)g(the)h(memory-to-memory)150 1917 y(functions.)39
8030 -b(Y)-8 b(ou)30 b(can)f(do)g(this)g(con)m(v)m(enien)m(tly)g(b)m(y)g
8031 -(compiling)e(the)j(library)d(with)h(prepro)s(cessor)g(sym)m(b)s(ol)150
8032 -2026 y Fj(BZ_NO_STDIO)35 b Fl(de\014ned.)63 b(Doing)39
8033 -b(this)e(giv)m(es)h(y)m(ou)h(a)f(library)e(con)m(taining)i(only)f(the)i
8034 -(follo)m(wing)e(eigh)m(t)150 2136 y(functions:)150 2293
8035 -y Fj(BZ2_bzCompressInit)p Fl(,)26 b Fj(BZ2_bzCompress)p
8036 -Fl(,)g Fj(BZ2_bzCompressEnd)150 2402 y(BZ2_bzDecompressInit)p
8037 -Fl(,)f Fj(BZ2_bzDecompress)p Fl(,)h Fj(BZ2_bzDecompressEnd)150
8038 -2512 y(BZ2_bzBuffToBuffCompress)o Fl(,)f Fj(BZ2_bzBuffToBuffDecompre)o
8039 -(ss)150 2669 y Fl(When)30 b(compiled)f(lik)m(e)h(this,)f(all)g
8040 -(functions)g(will)f(ignore)i Fj(verbosity)e Fl(settings.)150
8041 -3006 y Ff(3.7.2)63 b(Critical)40 b(error)h(handling)150
8042 -3199 y Fj(libbzip2)20 b Fl(con)m(tains)j(a)g(n)m(um)m(b)s(er)f(of)g(in)
8043 -m(ternal)g(assertion)g(c)m(hec)m(ks)i(whic)m(h)d(should,)i(needless)f
8044 -(to)h(sa)m(y)-8 b(,)26 b(nev)m(er)150 3308 y(b)s(e)g(activ)-5
8045 -b(ated.)40 b(Nev)m(ertheless,)28 b(if)d(an)i(assertion)f(should)e
8046 -(fail,)i(b)s(eha)m(viour)f(dep)s(ends)f(on)j(whether)e(or)i(not)150
8047 -3418 y(the)k(library)d(w)m(as)i(compiled)f(with)g Fj(BZ_NO_STDIO)e
8048 -Fl(set.)150 3575 y(F)-8 b(or)31 b(a)g(normal)e(compile,)h(an)g
8049 -(assertion)g(failure)f(yields)f(the)j(message)533 3726
8050 -y Fj(bzip2/libbzip2:)44 b(internal)h(error)i(number)f(N.)533
8051 -3829 y(This)h(is)g(a)g(bug)g(in)h(bzip2/libbzip2,)43
8052 -b(1.0)k(of)g(21-Mar-2000.)533 3933 y(Please)f(report)g(it)i(to)f(me)g
8053 -(at:)g(jseward@acm.org.)91 b(If)47 b(this)g(happened)533
8054 -4037 y(when)g(you)g(were)f(using)h(some)f(program)g(which)h(uses)f
8055 -(libbzip2)g(as)h(a)533 4141 y(component,)e(you)i(should)f(also)h
8056 -(report)f(this)h(bug)f(to)i(the)f(author\(s\))533 4244
8057 -y(of)g(that)g(program.)93 b(Please)46 b(make)h(an)g(effort)f(to)h
8058 -(report)g(this)f(bug;)533 4348 y(timely)g(and)h(accurate)f(bug)h
8059 -(reports)e(eventually)g(lead)i(to)g(higher)533 4452 y(quality)f
8060 -(software.)93 b(Thanks.)h(Julian)46 b(Seward,)f(21)j(March)e(2000.)150
8061 -4609 y Fl(where)30 b Fj(N)g Fl(is)f(some)i(error)f(co)s(de)h(n)m(um)m
8062 -(b)s(er.)39 b Fj(exit\(3\))28 b Fl(is)i(then)g(called.)150
8063 -4766 y(F)-8 b(or)31 b(a)g Fj(stdio)p Fl(-free)e(library)-8
8064 -b(,)29 b(assertion)h(failures)e(result)i(in)f(a)i(call)e(to)i(a)g
8065 -(function)e(declared)h(as:)533 4917 y Fj(extern)46 b(void)h
8066 -(bz_internal_error)c(\()k(int)g(errcode)f(\);)150 5074
8067 -y Fl(The)30 b(relev)-5 b(an)m(t)31 b(co)s(de)f(is)g(passed)f(as)i(a)g
8068 -(parameter.)41 b(Y)-8 b(ou)31 b(should)d(supply)g(suc)m(h)i(a)h
8069 -(function.)150 5230 y(In)g(either)g(case,)j(once)e(an)g(assertion)g
8070 -(failure)e(has)h(o)s(ccurred,)h(an)m(y)g Fj(bz_stream)e
8071 -Fl(records)h(in)m(v)m(olv)m(ed)h(can)150 5340 y(b)s(e)e(regarded)g(as)h
8072 -(in)m(v)-5 b(alid.)38 b(Y)-8 b(ou)31 b(should)d(not)j(attempt)g(to)g
8073 -(resume)f(normal)g(op)s(eration)f(with)g(them.)p eop
8074 -%%Page: 30 31
8075 -30 30 bop 150 -116 a Fl(Chapter)30 b(3:)41 b(Programming)29
8076 -b(with)g Fj(libbzip2)1881 b Fl(30)150 299 y(Y)-8 b(ou)22
8077 -b(ma)m(y)-8 b(,)25 b(of)d(course,)h(c)m(hange)g(critical)e(error)g
8078 -(handling)e(to)j(suit)f(y)m(our)g(needs.)38 b(As)21 b(I)h(said)e(ab)s
8079 -(o)m(v)m(e,)25 b(critical)150 408 y(errors)30 b(indicate)g(bugs)g(in)g
8080 -(the)h(library)d(and)i(should)f(not)i(o)s(ccur.)42 b(All)29
8081 -b Fj(")p Fl(normal)p Fj(")h Fl(error)g(situations)g(are)150
8082 -518 y(indicated)f(via)h(error)g(return)f(co)s(des)i(from)f(functions,)f
8083 -(and)g(can)i(b)s(e)f(reco)m(v)m(ered)i(from.)150 798
8084 -y Fk(3.8)68 b(Making)45 b(a)g(Windo)l(ws)h(DLL)150 990
8085 -y Fl(Ev)m(erything)30 b(related)g(to)h(Windo)m(ws)f(has)g(b)s(een)f
8086 -(con)m(tributed)h(b)m(y)g(Y)-8 b(oshiok)j(a)31 b(Tsuneo)150
8087 -1100 y(\()p Fj(QWF00133@niftyserve.or.jp)46 b Fl(/)52
8088 -b Fj(tsuneo-y@is.aist-nara.ac.j)o(p)p Fl(\),)g(so)h(y)m(ou)f(should)f
8089 -(send)150 1210 y(y)m(our)30 b(queries)g(to)h(him)e(\(but)h(p)s(erhaps)e
8090 -(Cc:)41 b(me,)31 b Fj(jseward@acm.org)p Fl(\).)150 1366
8091 -y(My)43 b(v)-5 b(ague)44 b(understanding)d(of)i(what)g(to)h(do)f(is:)65
8092 -b(using)41 b(Visual)h(C)p Fj(++)g Fl(5.0,)48 b(op)s(en)42
8093 -b(the)h(pro)5 b(ject)44 b(\014le)150 1476 y Fj(libbz2.dsp)p
8094 -Fl(,)28 b(and)i(build.)37 b(That's)31 b(all.)150 1633
8095 -y(If)41 b(y)m(ou)g(can't)h(op)s(en)e(the)h(pro)5 b(ject)42
8096 -b(\014le)e(for)h(some)g(reason,)j(mak)m(e)e(a)g(new)e(one,)k(naming)c
8097 -(these)i(\014les:)150 1742 y Fj(blocksort.c)p Fl(,)28
8098 -b Fj(bzlib.c)p Fl(,)g Fj(compress.c)p Fl(,)g Fj(crctable.c)p
8099 -Fl(,)g Fj(decompress.c)p Fl(,)f Fj(huffman.c)p Fl(,)150
8100 -1852 y Fj(randtable.c)32 b Fl(and)j Fj(libbz2.def)p Fl(.)53
8101 -b(Y)-8 b(ou)36 b(will)d(also)i(need)g(to)h(name)g(the)g(header)f
8102 -(\014les)f Fj(bzlib.h)g Fl(and)150 1962 y Fj(bzlib_private.h)p
8103 -Fl(.)150 2118 y(If)c(y)m(ou)h(don't)f(use)g(V)m(C)p Fj(++)p
8104 -Fl(,)g(y)m(ou)h(ma)m(y)g(need)f(to)h(de\014ne)f(the)h(propro)s(cessor)e
8105 -(sym)m(b)s(ol)g Fj(_WIN32)p Fl(.)150 2275 y(Finally)-8
8106 -b(,)28 b Fj(dlltest.c)e Fl(is)h(a)i(sample)f(program)g(using)g(the)g
8107 -(DLL.)h(It)g(has)f(a)h(pro)5 b(ject)29 b(\014le,)g Fj(dlltest.dsp)p
8108 -Fl(.)150 2432 y(If)h(y)m(ou)h(just)e(w)m(an)m(t)j(a)e(mak)m(e\014le)h
8109 -(for)f(Visual)f(C,)h(ha)m(v)m(e)i(a)e(lo)s(ok)g(at)i
8110 -Fj(makefile.msc)p Fl(.)150 2589 y(Be)k(a)m(w)m(are)g(that)g(if)e(y)m
8111 -(ou)h(compile)f Fj(bzip2)g Fl(itself)g(on)h(Win32,)h(y)m(ou)g(m)m(ust)f
8112 -(set)g Fj(BZ_UNIX)e Fl(to)j(0)f(and)g Fj(BZ_)150 2698
8113 -y(LCCWIN32)27 b Fl(to)j(1,)g(in)f(the)g(\014le)g Fj(bzip2.c)p
8114 -Fl(,)e(b)s(efore)i(compiling.)39 b(Otherwise)28 b(the)h(resulting)f
8115 -(binary)f(w)m(on't)150 2808 y(w)m(ork)j(correctly)-8
8116 -b(.)150 2965 y(I)30 b(ha)m(v)m(en't)i(tried)d(an)m(y)i(of)g(this)e
8117 -(stu\013)h(m)m(yself,)g(but)g(it)f(all)h(lo)s(oks)g(plausible.)p
8118 -eop
8119 -%%Page: 31 32
8120 -31 31 bop 150 -116 a Fl(Chapter)30 b(4:)41 b(Miscellanea)2586
8121 -b(31)150 299 y Fh(4)80 b(Miscellanea)150 583 y Fl(These)30
8122 -b(are)h(just)f(some)g(random)g(though)m(ts)h(of)f(mine.)40
8123 -b(Y)-8 b(our)30 b(mileage)h(ma)m(y)g(v)-5 b(ary)d(.)150
8124 -884 y Fk(4.1)68 b(Limitations)47 b(of)e(the)g(compressed)g(\014le)h
8125 -(format)150 1077 y Fj(bzip2-1.0)p Fl(,)e Fj(0.9.5)e Fl(and)g
8126 -Fj(0.9.0)g Fl(use)h(exactly)h(the)f(same)h(\014le)e(format)i(as)f(the)h
8127 -(previous)d(v)m(ersion,)150 1186 y Fj(bzip2-0.1)p Fl(.)75
8128 -b(This)41 b(decision)g(w)m(as)i(made)g(in)e(the)i(in)m(terests)g(of)g
8129 -(stabilit)m(y)-8 b(.)77 b(Creating)42 b(y)m(et)i(another)150
8130 -1296 y(incompatible)21 b(compressed)i(\014le)f(format)i(w)m(ould)e
8131 -(create)i(further)e(confusion)g(and)h(disruption)d(for)j(users.)150
8132 -1453 y(Nev)m(ertheless,)31 b(this)e(is)g(not)h(a)g(painless)e
8133 -(decision.)39 b(Dev)m(elopmen)m(t)31 b(w)m(ork)f(since)f(the)h(release)
8134 -h(of)f Fj(bzip2-)150 1562 y(0.1)19 b Fl(in)g(August)i(1997)h(has)e(sho)
8135 -m(wn)f(complexities)h(in)f(the)h(\014le)g(format)g(whic)m(h)f(slo)m(w)h
8136 -(do)m(wn)g(decompression)150 1672 y(and,)30 b(in)f(retrosp)s(ect,)i
8137 -(are)g(unnecessary)-8 b(.)40 b(These)31 b(are:)225 1829
8138 -y Fi(\017)60 b Fl(The)20 b(run-length)g(enco)s(der,)i(whic)m(h)e(is)g
8139 -(the)h(\014rst)f(of)h(the)g(compression)f(transformations,)i(is)e(en)m
8140 -(tirely)330 1938 y(irrelev)-5 b(an)m(t.)63 b(The)38 b(original)e(purp)s
8141 -(ose)g(w)m(as)j(to)g(protect)g(the)f(sorting)g(algorithm)f(from)g(the)i
8142 -(v)m(ery)330 2048 y(w)m(orst)h(case)h(input:)58 b(a)41
8143 -b(string)e(of)h(rep)s(eated)g(sym)m(b)s(ols.)68 b(But)40
8144 -b(algorithm)f(steps)h(Q6a)h(and)e(Q6b)330 2157 y(in)30
8145 -b(the)i(original)e(Burro)m(ws-Wheeler)i(tec)m(hnical)g(rep)s(ort)f
8146 -(\(SR)m(C-124\))i(sho)m(w)f(ho)m(w)g(rep)s(eats)g(can)g(b)s(e)330
8147 -2267 y(handled)c(without)i(di\016cult)m(y)f(in)g(blo)s(c)m(k)h
8148 -(sorting.)225 2409 y Fi(\017)60 b Fl(The)30 b(randomisation)e(mec)m
8149 -(hanism)i(do)s(esn't)g(really)f(need)h(to)g(b)s(e)g(there.)41
8150 -b(Udi)29 b(Man)m(b)s(er)h(and)f(Gene)330 2518 y(My)m(ers)j(published)c
8151 -(a)33 b(su\016x)e(arra)m(y)h(construction)f(algorithm)g(a)h(few)g(y)m
8152 -(ears)h(bac)m(k,)g(whic)m(h)d(can)j(b)s(e)330 2628 y(emplo)m(y)m(ed)27
8153 -b(to)h(sort)g(an)m(y)f(blo)s(c)m(k,)h(no)f(matter)h(ho)m(w)f(rep)s
8154 -(etitiv)m(e,)h(in)d(O\(N)j(log)f(N\))h(time.)39 b(Subsequen)m(t)330
8155 -2737 y(w)m(ork)25 b(b)m(y)f(Kunihik)m(o)f(Sadak)-5 b(ane)24
8156 -b(has)h(pro)s(duced)e(a)i(deriv)-5 b(ativ)m(e)24 b(O\(N)h(\(log)g(N\))p
8157 -Fj(^)p Fl(2\))h(algorithm)d(whic)m(h)330 2847 y(usually)28
8158 -b(outp)s(erforms)h(the)i(Man)m(b)s(er-My)m(ers)g(algorithm.)330
8159 -2988 y(I)g(could)g(ha)m(v)m(e)i(c)m(hanged)f(to)g(Sadak)-5
8160 -b(ane's)32 b(algorithm,)f(but)g(I)g(\014nd)f(it)h(to)h(b)s(e)f(slo)m(w)
8161 -m(er)h(than)f Fj(bzip2)p Fl('s)330 3098 y(existing)38
8162 -b(algorithm)g(for)h(most)h(inputs,)f(and)g(the)g(randomisation)f(mec)m
8163 -(hanism)g(protects)i(ade-)330 3208 y(quately)34 b(against)f(bad)g
8164 -(cases.)52 b(I)33 b(didn't)f(think)g(it)i(w)m(as)g(a)g(go)s(o)s(d)f
8165 -(tradeo\013)i(to)f(mak)m(e.)51 b(P)m(artly)34 b(this)330
8166 -3317 y(is)39 b(due)h(to)h(the)f(fact)h(that)g(I)f(w)m(as)g(not)h(\015o)
8167 -s(o)s(ded)e(with)g(email)g(complain)m(ts)g(ab)s(out)h
8168 -Fj(bzip2-0.1)p Fl('s)330 3427 y(p)s(erformance)30 b(on)g(rep)s(etitiv)m
8169 -(e)g(data,)h(so)g(p)s(erhaps)d(it)i(isn't)g(a)h(problem)d(for)j(real)f
8170 -(inputs.)330 3568 y(Probably)i(the)h(b)s(est)g(long-term)g(solution,)g
8171 -(and)g(the)g(one)h(I)f(ha)m(v)m(e)h(incorp)s(orated)e(in)m(to)i(0.9.5)h
8172 -(and)330 3678 y(ab)s(o)m(v)m(e,)42 b(is)c(to)h(use)f(the)h(existing)f
8173 -(sorting)g(algorithm)f(initially)-8 b(,)38 b(and)g(fall)f(bac)m(k)i(to)
8174 -h(a)f(O\(N)f(\(log)330 3787 y(N\))p Fj(^)p Fl(2\))31
8175 -b(algorithm)f(if)f(the)i(standard)e(algorithm)h(gets)h(in)m(to)f
8176 -(di\016culties.)225 3929 y Fi(\017)60 b Fl(The)31 b(compressed)f
8177 -(\014le)g(format)i(w)m(as)f(nev)m(er)h(designed)d(to)j(b)s(e)f(handled)
8178 -e(b)m(y)i(a)g(library)-8 b(,)29 b(and)i(I)g(ha)m(v)m(e)330
8179 -4039 y(had)d(to)i(jump)e(though)g(some)i(ho)s(ops)e(to)i(pro)s(duce)e
8180 -(an)h(e\016cien)m(t)g(implemen)m(tation)f(of)h(decompres-)330
8181 -4148 y(sion.)38 b(It's)26 b(a)h(bit)e(hairy)-8 b(.)38
8182 -b(T)-8 b(ry)26 b(passing)f Fj(decompress.c)d Fl(through)k(the)g(C)f
8183 -(prepro)s(cessor)g(and)h(y)m(ou'll)330 4258 y(see)32
8184 -b(what)g(I)f(mean.)45 b(Muc)m(h)32 b(of)g(this)e(complexit)m(y)i(could)
8185 -f(ha)m(v)m(e)i(b)s(een)e(a)m(v)m(oided)h(if)e(the)i(compressed)330
8186 -4367 y(size)e(of)h(eac)m(h)g(blo)s(c)m(k)f(of)h(data)g(w)m(as)g
8187 -(recorded)f(in)f(the)h(data)h(stream.)225 4509 y Fi(\017)60
8188 -b Fl(An)30 b(Adler-32)g(c)m(hec)m(ksum,)i(rather)e(than)g(a)h(CR)m(C32)
8189 -g(c)m(hec)m(ksum,)g(w)m(ould)e(b)s(e)h(faster)h(to)g(compute.)150
8190 -4698 y(It)e(w)m(ould)f(b)s(e)g(fair)g(to)h(sa)m(y)h(that)g(the)f
8191 -Fj(bzip2)e Fl(format)i(w)m(as)h(frozen)f(b)s(efore)f(I)h(prop)s(erly)d
8192 -(and)j(fully)d(under-)150 4807 y(sto)s(o)s(d)k(the)h(p)s(erformance)e
8193 -(consequences)i(of)g(doing)e(so.)150 4964 y(Impro)m(v)m(emen)m(ts)d
8194 -(whic)m(h)e(I)i(w)m(as)g(able)f(to)h(incorp)s(orate)f(in)m(to)g(0.9.0,)
8195 -k(despite)24 b(using)g(the)i(same)g(\014le)e(format,)150
8196 -5074 y(are:)225 5230 y Fi(\017)60 b Fl(Single)30 b(arra)m(y)i(implemen)
8197 -m(tation)e(of)h(the)h(in)m(v)m(erse)f(BWT.)h(This)e(signi\014can)m(tly)
8198 -f(sp)s(eeds)i(up)f(decom-)330 5340 y(pression,)f(presumably)f(b)s
8199 -(ecause)i(it)g(reduces)g(the)h(n)m(um)m(b)s(er)e(of)i(cac)m(he)h
8200 -(misses.)p eop
8201 -%%Page: 32 33
8202 -32 32 bop 150 -116 a Fl(Chapter)30 b(4:)41 b(Miscellanea)2586
8203 -b(32)225 299 y Fi(\017)60 b Fl(F)-8 b(aster)27 b(in)m(v)m(erse)e(MTF)h
8204 -(transform)f(for)g(large)h(MTF)f(v)-5 b(alues.)39 b(The)25
8205 -b(new)g(implemen)m(tation)f(is)g(based)330 408 y(on)30
8206 -b(the)h(notion)f(of)g(sliding)e(blo)s(c)m(ks)h(of)i(v)-5
8207 -b(alues.)225 544 y Fi(\017)60 b Fj(bzip2-0.9.0)24 b Fl(no)m(w)k(reads)f
8208 -(and)f(writes)h(\014les)f(with)g Fj(fread)g Fl(and)h
8209 -Fj(fwrite)p Fl(;)f(v)m(ersion)h(0.1)i(used)d Fj(putc)330
8210 -653 y Fl(and)k Fj(getc)p Fl(.)39 b(Duh!)h(W)-8 b(ell,)31
8211 -b(y)m(ou)f(liv)m(e)g(and)g(learn.)150 836 y(F)-8 b(urther)30
8212 -b(ahead,)g(it)f(w)m(ould)g(b)s(e)g(nice)h(to)g(b)s(e)g(able)f(to)i(do)e
8213 -(random)g(access)j(in)m(to)d(\014les.)40 b(This)28 b(will)f(require)150
8214 -945 y(some)k(careful)e(design)h(of)g(compressed)g(\014le)g(formats.)150
8215 -1227 y Fk(4.2)68 b(P)l(ortabilit)l(y)47 b(issues)150
8216 -1419 y Fl(After)36 b(some)g(consideration,)g(I)f(ha)m(v)m(e)i(decided)d
8217 -(not)i(to)g(use)g(GNU)g Fj(autoconf)d Fl(to)j(con\014gure)g(0.9.5)h(or)
8218 -150 1529 y(1.0.)150 1686 y Fj(autoconf)p Fl(,)31 b(admirable)g(and)h(w)
8219 -m(onderful)f(though)i(it)f(is,)h(mainly)d(assists)j(with)e(p)s
8220 -(ortabilit)m(y)g(problems)150 1795 y(b)s(et)m(w)m(een)f(Unix-lik)m(e)d
8221 -(platforms.)40 b(But)29 b Fj(bzip2)f Fl(do)s(esn't)h(ha)m(v)m(e)h(m)m
8222 -(uc)m(h)f(in)f(the)h(w)m(a)m(y)h(of)g(p)s(ortabilit)m(y)d(prob-)150
8223 -1905 y(lems)35 b(on)h(Unix;)j(most)d(of)g(the)h(di\016culties)d(app)s
8224 -(ear)h(when)g(p)s(orting)g(to)i(the)f(Mac,)j(or)d(to)h(Microsoft's)150
8225 -2015 y(op)s(erating)26 b(systems.)40 b Fj(autoconf)25
8226 -b Fl(do)s(esn't)h(help)g(in)f(those)j(cases,)h(and)d(brings)f(in)g(a)j
8227 -(whole)e(load)g(of)h(new)150 2124 y(complexit)m(y)-8
8228 -b(.)150 2281 y(Most)28 b(p)s(eople)f(should)f(b)s(e)h(able)g(to)h
8229 -(compile)e(the)i(library)d(and)i(program)h(under)e(Unix)g(straigh)m(t)i
8230 -(out-of-)150 2391 y(the-b)s(o)m(x,)j(so)g(to)g(sp)s(eak,)f(esp)s
8231 -(ecially)f(if)g(y)m(ou)i(ha)m(v)m(e)g(a)g(v)m(ersion)f(of)g(GNU)h(C)f
8232 -(a)m(v)-5 b(ailable.)150 2547 y(There)32 b(are)h(a)g(couple)f(of)h
8233 -Fj(__inline__)d Fl(directiv)m(es)i(in)f(the)i(co)s(de.)48
8234 -b(GNU)33 b(C)f(\()p Fj(gcc)p Fl(\))g(should)f(b)s(e)h(able)g(to)150
8235 -2657 y(handle)24 b(them.)39 b(If)25 b(y)m(ou're)i(not)e(using)g(GNU)h
8236 -(C,)f(y)m(our)h(C)f(compiler)f(shouldn't)g(see)i(them)f(at)i(all.)38
8237 -b(If)25 b(y)m(our)150 2767 y(compiler)k(do)s(es,)i(for)g(some)g
8238 -(reason,)h(see)f(them)g(and)f(do)s(esn't)h(lik)m(e)f(them,)i(just)e
8239 -Fj(#define)f(__inline__)150 2876 y Fl(to)37 b(b)s(e)f
8240 -Fj(/*)30 b(*/)p Fl(.)58 b(One)36 b(easy)h(w)m(a)m(y)g(to)h(do)e(this)f
8241 -(is)h(to)h(compile)e(with)g(the)i(\015ag)g Fj(-D__inline__=)p
8242 -Fl(,)d(whic)m(h)150 2986 y(should)28 b(b)s(e)i(understo)s(o)s(d)f(b)m
8243 -(y)h(most)h(Unix)e(compilers.)150 3143 y(If)35 b(y)m(ou)g(still)e(ha)m
8244 -(v)m(e)j(di\016culties,)e(try)h(compiling)e(with)g(the)j(macro)f
8245 -Fj(BZ_STRICT_ANSI)c Fl(de\014ned.)54 b(This)150 3252
8246 -y(should)28 b(enable)i(y)m(ou)h(to)g(build)d(the)i(library)e(in)h(a)i
8247 -(strictly)f(ANSI)g(complian)m(t)f(en)m(vironmen)m(t.)41
8248 -b(Building)150 3362 y(the)25 b(program)f(itself)f(lik)m(e)g(this)h(is)f
8249 -(dangerous)h(and)g(not)g(supp)s(orted,)g(since)g(y)m(ou)h(remo)m(v)m(e)
8250 -g Fj(bzip2)p Fl('s)e(c)m(hec)m(ks)150 3471 y(against)30
8251 -b(compressing)f(directories,)g(sym)m(b)s(olic)g(links,)f(devices,)i
8252 -(and)f(other)h(not-really-a-\014le)g(en)m(tities.)150
8253 -3581 y(This)f(could)g(cause)i(\014lesystem)f(corruption!)150
8254 -3738 y(One)e(other)i(thing:)39 b(if)27 b(y)m(ou)j(create)g(a)f
8255 -Fj(bzip2)f Fl(binary)f(for)i(public)d(distribution,)g(please)i(try)h
8256 -(and)g(link)d(it)150 3847 y(statically)g(\()p Fj(gcc)k(-s)p
8257 -Fl(\).)39 b(This)25 b(a)m(v)m(oids)i(all)f(sorts)h(of)g(library-v)m
8258 -(ersion)d(issues)h(that)i(others)g(ma)m(y)g(encoun)m(ter)150
8259 -3957 y(later)j(on.)150 4114 y(If)f(y)m(ou)g(build)e Fj(bzip2)h
8260 -Fl(on)h(Win32,)h(y)m(ou)f(m)m(ust)g(set)h Fj(BZ_UNIX)e
8261 -Fl(to)i(0)f(and)g Fj(BZ_LCCWIN32)d Fl(to)k(1,)g(in)e(the)i(\014le)150
8262 -4223 y Fj(bzip2.c)p Fl(,)f(b)s(efore)h(compiling.)38
8263 -b(Otherwise)29 b(the)i(resulting)d(binary)h(w)m(on't)i(w)m(ork)f
8264 -(correctly)-8 b(.)150 4505 y Fk(4.3)68 b(Rep)t(orting)46
8265 -b(bugs)150 4698 y Fl(I)25 b(tried)f(prett)m(y)i(hard)e(to)i(mak)m(e)g
8266 -(sure)f Fj(bzip2)e Fl(is)i(bug)f(free,)j(b)s(oth)d(b)m(y)h(design)f
8267 -(and)h(b)m(y)g(testing.)39 b(Hop)s(efully)150 4807 y(y)m(ou'll)29
8268 -b(nev)m(er)i(need)f(to)h(read)g(this)e(section)h(for)h(real.)150
8269 -4964 y(Nev)m(ertheless,)36 b(if)c Fj(bzip2)h Fl(dies)g(with)f(a)i
8270 -(segmen)m(tation)h(fault,)g(a)f(bus)f(error)g(or)h(an)g(in)m(ternal)e
8271 -(assertion)150 5074 y(failure,)i(it)h(will)d(ask)j(y)m(ou)g(to)g(email)
8272 -f(me)h(a)g(bug)f(rep)s(ort.)54 b(Exp)s(erience)33 b(with)h(v)m(ersion)g
8273 -(0.1)i(sho)m(ws)e(that)150 5183 y(almost)c(all)g(these)h(problems)d
8274 -(can)j(b)s(e)f(traced)h(to)g(either)f(compiler)e(bugs)i(or)g(hardw)m
8275 -(are)g(problems.)225 5340 y Fi(\017)60 b Fl(Recompile)22
8276 -b(the)h(program)g(with)f(no)h(optimisation,)g(and)f(see)i(if)e(it)g(w)m
8277 -(orks.)39 b(And/or)22 b(try)h(a)g(di\013eren)m(t)p eop
8278 -%%Page: 33 34
8279 -33 33 bop 150 -116 a Fl(Chapter)30 b(4:)41 b(Miscellanea)2586
8280 -b(33)330 299 y(compiler.)77 b(I)43 b(heard)f(all)g(sorts)h(of)h
8281 -(stories)e(ab)s(out)h(v)-5 b(arious)42 b(\015a)m(v)m(ours)h(of)h(GNU)f
8282 -(C)g(\(and)g(other)330 408 y(compilers\))20 b(generating)i(bad)e(co)s
8283 -(de)i(for)f Fj(bzip2)p Fl(,)h(and)f(I'v)m(e)h(run)e(across)i(t)m(w)m(o)
8284 -g(suc)m(h)f(examples)g(m)m(yself.)330 606 y(2.7.X)35
8285 -b(v)m(ersions)e(of)g(GNU)h(C)f(are)h(kno)m(wn)f(to)h(generate)h(bad)d
8286 -(co)s(de)i(from)f(time)g(to)h(time,)g(at)g(high)330 716
8287 -y(optimisation)20 b(lev)m(els.)37 b(If)21 b(y)m(ou)g(get)i(problems,)e
8288 -(try)g(using)f(the)i(\015ags)f Fj(-O2)f(-fomit-frame-pointer)330
8289 -825 y(-fno-strength-reduce)p Fl(.)35 b(Y)-8 b(ou)31 b(should)d(sp)s
8290 -(eci\014cally)h Fc(not)j Fl(use)e Fj(-funroll-loops)p
8291 -Fl(.)330 1023 y(Y)-8 b(ou)38 b(ma)m(y)g(notice)g(that)g(the)g(Mak)m
8292 -(e\014le)g(runs)e(six)g(tests)i(as)g(part)f(of)h(the)g(build)c(pro)s
8293 -(cess.)62 b(If)37 b(the)330 1132 y(program)43 b(passes)g(all)f(of)h
8294 -(these,)k(it's)c(a)h(prett)m(y)f(go)s(o)s(d)g(\(but)g(not)g(100\045\))i
8295 -(indication)c(that)j(the)330 1242 y(compiler)29 b(has)h(done)g(its)g
8296 -(job)g(correctly)-8 b(.)225 1440 y Fi(\017)60 b Fl(If)33
8297 -b Fj(bzip2)f Fl(crashes)i(randomly)-8 b(,)33 b(and)g(the)h(crashes)g
8298 -(are)g(not)g(rep)s(eatable,)g(y)m(ou)g(ma)m(y)g(ha)m(v)m(e)h(a)f
8299 -(\015aky)330 1549 y(memory)k(subsystem.)64 b Fj(bzip2)37
8300 -b Fl(really)g(hammers)h(y)m(our)g(memory)g(hierarc)m(h)m(y)-8
8301 -b(,)41 b(and)d(if)f(it's)h(a)h(bit)330 1659 y(marginal,)33
8302 -b(y)m(ou)h(ma)m(y)g(get)h(these)f(problems.)49 b(Ditto)34
8303 -b(if)f(y)m(our)h(disk)e(or)h(I/O)h(subsystem)e(is)h(slo)m(wly)330
8304 -1768 y(failing.)39 b(Y)-8 b(up,)30 b(this)f(really)g(do)s(es)h(happ)s
8305 -(en.)330 1966 y(T)-8 b(ry)28 b(using)f(a)i(di\013eren)m(t)f(mac)m(hine)
8306 -g(of)h(the)g(same)f(t)m(yp)s(e,)i(and)e(see)h(if)e(y)m(ou)i(can)g(rep)s
8307 -(eat)g(the)f(problem.)225 2163 y Fi(\017)60 b Fl(This)21
8308 -b(isn't)i(really)f(a)h(bug,)i(but)d(...)39 b(If)23 b
8309 -Fj(bzip2)f Fl(tells)g(y)m(ou)h(y)m(our)h(\014le)e(is)g(corrupted)h(on)g
8310 -(decompression,)330 2273 y(and)29 b(y)m(ou)g(obtained)f(the)i(\014le)e
8311 -(via)h(FTP)-8 b(,)29 b(there)h(is)e(a)h(p)s(ossibilit)m(y)d(that)k(y)m
8312 -(ou)f(forgot)h(to)g(tell)e(FTP)h(to)330 2383 y(do)23
8313 -b(a)g(binary)e(mo)s(de)i(transfer.)38 b(That)23 b(absolutely)f(will)e
8314 -(cause)j(the)h(\014le)e(to)h(b)s(e)g(non-decompressible.)330
8315 -2492 y(Y)-8 b(ou'll)30 b(ha)m(v)m(e)h(to)g(transfer)f(it)g(again.)150
8316 -2737 y(If)i(y)m(ou'v)m(e)h(incorp)s(orated)e Fj(libbzip2)f
8317 -Fl(in)m(to)i(y)m(our)g(o)m(wn)g(program)g(and)g(are)g(getting)h
8318 -(problems,)e(please,)150 2847 y(please,)d(please,)h(c)m(hec)m(k)g(that)
8319 -f(the)g(parameters)g(y)m(ou)g(are)g(passing)f(in)f(calls)h(to)h(the)g
8320 -(library)-8 b(,)26 b(are)j(correct,)150 2956 y(and)e(in)f(accordance)k
8321 -(with)c(what)i(the)g(do)s(cumen)m(tation)f(sa)m(ys)h(is)f(allo)m(w)m
8322 -(able.)39 b(I)28 b(ha)m(v)m(e)h(tried)e(to)h(mak)m(e)h(the)150
8323 -3066 y(library)f(robust)i(against)g(suc)m(h)g(problems,)f(but)h(I'm)g
8324 -(sure)g(I)g(ha)m(v)m(en't)h(succeeded.)150 3223 y(Finally)-8
8325 -b(,)32 b(if)g(the)h(ab)s(o)m(v)m(e)i(commen)m(ts)e(don't)g(help,)g(y)m
8326 -(ou'll)f(ha)m(v)m(e)i(to)g(send)e(me)h(a)g(bug)g(rep)s(ort.)48
8327 -b(No)m(w,)34 b(it's)150 3332 y(just)c(amazing)g(ho)m(w)h(man)m(y)f(p)s
8328 -(eople)g(will)d(send)j(me)g(a)h(bug)f(rep)s(ort)g(sa)m(ying)g
8329 -(something)g(lik)m(e)481 3483 y(bzip2)f(crashed)h(with)f(segmen)m
8330 -(tation)j(fault)e(on)g(m)m(y)g(mac)m(hine)150 3640 y(and)h(absolutely)f
8331 -(nothing)h(else.)44 b(Needless)32 b(to)g(sa)m(y)-8 b(,)33
8332 -b(a)f(suc)m(h)f(a)h(rep)s(ort)f(is)g Fc(totally)-8 b(,)32
8333 -b(utterly)-8 b(,)32 b(completely)150 3750 y(and)40 b(comprehensiv)m
8334 -(ely)g(100\045)h(useless;)46 b(a)41 b(w)m(aste)g(of)g(y)m(our)g(time,)i
8335 -(m)m(y)e(time,)i(and)e(net)g(bandwidth)p Fl(.)150 3859
8336 -y(With)31 b(no)h(details)f(at)i(all,)e(there's)h(no)g(w)m(a)m(y)h(I)f
8337 -(can)g(p)s(ossibly)d(b)s(egin)h(to)j(\014gure)e(out)i(what)e(the)i
8338 -(problem)150 3969 y(is.)150 4126 y(The)d(rules)e(of)i(the)g(game)h
8339 -(are:)41 b(facts,)32 b(facts,)f(facts.)41 b(Don't)31
8340 -b(omit)f(them)g(b)s(ecause)g Fj(")p Fl(oh,)g(they)g(w)m(on't)h(b)s(e)
8341 -150 4235 y(relev)-5 b(an)m(t)p Fj(")p Fl(.)41 b(A)m(t)31
8342 -b(the)g(bare)f(minim)m(um:)481 4386 y(Mac)m(hine)h(t)m(yp)s(e.)61
8343 -b(Op)s(erating)29 b(system)h(v)m(ersion.)481 4490 y(Exact)h(v)m(ersion)
8344 -f(of)h Fj(bzip2)e Fl(\(do)h Fj(bzip2)47 b(-V)p Fl(\).)481
8345 -4594 y(Exact)31 b(v)m(ersion)f(of)h(the)f(compiler)f(used.)481
8346 -4698 y(Flags)i(passed)e(to)j(the)e(compiler.)150 4854
8347 -y(Ho)m(w)m(ev)m(er,)i(the)d(most)h(imp)s(ortan)m(t)f(single)f(thing)g
8348 -(that)i(will)d(help)h(me)h(is)f(the)i(\014le)e(that)i(y)m(ou)g(w)m(ere)
8349 -g(trying)150 4964 y(to)f(compress)f(or)g(decompress)g(at)h(the)f(time)g
8350 -(the)g(problem)f(happ)s(ened.)38 b(Without)28 b(that,)h(m)m(y)g(abilit)
8351 -m(y)d(to)150 5074 y(do)k(an)m(ything)g(more)h(than)f(sp)s(eculate)g(ab)
8352 -s(out)g(the)g(cause,)i(is)d(limited.)150 5230 y(Please)34
8353 -b(remem)m(b)s(er)f(that)h(I)f(connect)i(to)f(the)g(In)m(ternet)g(with)e
8354 -(a)i(mo)s(dem,)g(so)f(y)m(ou)h(should)e(con)m(tact)k(me)150
8355 -5340 y(b)s(efore)30 b(mailing)e(me)j(h)m(uge)f(\014les.)p
8356 -eop
8357 -%%Page: 34 35
8358 -34 34 bop 150 -116 a Fl(Chapter)30 b(4:)41 b(Miscellanea)2586
8359 -b(34)150 299 y Fk(4.4)68 b(Did)45 b(y)l(ou)g(get)h(the)f(righ)l(t)h
8360 -(pac)l(k)-7 b(age?)150 491 y Fj(bzip2)34 b Fl(is)h(a)h(resource)g(hog.)
8361 -56 b(It)36 b(soaks)g(up)f(large)g(amoun)m(ts)h(of)g(CPU)f(cycles)h(and)
8362 -f(memory)-8 b(.)57 b(Also,)36 b(it)150 601 y(giv)m(es)26
8363 -b(v)m(ery)h(large)f(latencies.)39 b(In)25 b(the)h(w)m(orst)g(case,)i(y)
8364 -m(ou)f(can)f(feed)g(man)m(y)g(megab)m(ytes)h(of)f(uncompressed)150
8365 -711 y(data)45 b(in)m(to)e(the)i(library)c(b)s(efore)j(getting)g(an)m(y)
8366 -g(compressed)g(output,)j(so)d(this)f(probably)f(rules)h(out)150
8367 -820 y(applications)29 b(requiring)e(in)m(teractiv)m(e)32
8368 -b(b)s(eha)m(viour.)150 977 y(These)38 b(aren't)h(faults)e(of)h(m)m(y)g
8369 -(implemen)m(tation,)h(I)f(hop)s(e,)i(but)d(more)h(an)g(in)m(trinsic)e
8370 -(prop)s(ert)m(y)h(of)i(the)150 1087 y(Burro)m(ws-Wheeler)30
8371 -b(transform)g(\(unfortunately\).)40 b(Ma)m(yb)s(e)31
8372 -b(this)e(isn't)h(what)g(y)m(ou)h(w)m(an)m(t.)150 1244
8373 -y(If)h(y)m(ou)h(w)m(an)m(t)g(a)g(compressor)g(and/or)f(library)e(whic)m
8374 -(h)h(is)h(faster,)i(uses)e(less)g(memory)g(but)g(gets)h(prett)m(y)150
8375 -1353 y(go)s(o)s(d)e(compression,)g(and)g(has)h(minimal)c(latency)-8
8376 -b(,)33 b(consider)e(Jean-loup)f(Gailly's)g(and)h(Mark)h(Adler's)150
8377 -1463 y(w)m(ork,)f Fj(zlib-1.1.2)c Fl(and)j Fj(gzip-1.2.4)p
8378 -Fl(.)38 b(Lo)s(ok)31 b(for)f(them)g(at)150 1620 y Fj
8379 -(http://www.cdrom.com/pub)o(/inf)o(ozip)o(/zl)o(ib)24
8380 -b Fl(and)30 b Fj(http://www.gzip.org)25 b Fl(resp)s(ectiv)m(ely)-8
8381 -b(.)150 1776 y(F)g(or)32 b(something)f(faster)i(and)e(ligh)m(ter)f
8382 -(still,)h(y)m(ou)g(migh)m(t)h(try)f(Markus)h(F)g(X)f(J)h(Ob)s(erh)m
8383 -(umer's)d Fj(LZO)i Fl(real-)150 1886 y(time)f
8384 -(compression/decompression)f(library)-8 b(,)28 b(at)150
8385 -1996 y Fj(http://wildsau.idv.uni-l)o(inz.)o(ac.a)o(t/m)o(fx/l)o(zo.h)o
8386 -(tml)o Fl(.)150 2152 y(If)38 b(y)m(ou)h(w)m(an)m(t)g(to)h(use)e(the)g
8387 -Fj(bzip2)g Fl(algorithms)f(to)i(compress)f(small)g(blo)s(c)m(ks)f(of)i
8388 -(data,)j(64k)d(b)m(ytes)g(or)150 2262 y(smaller,)i(for)e(example)g(on)h
8389 -(an)f(on-the-\015y)h(disk)e(compressor,)k(y)m(ou'd)e(b)s(e)f(w)m(ell)g
8390 -(advised)f(not)i(to)g(use)150 2372 y(this)i(library)-8
8391 -b(.)77 b(Instead,)47 b(I'v)m(e)d(made)f(a)h(sp)s(ecial)e(library)f
8392 -(tuned)h(for)h(that)h(kind)d(of)j(use.)79 b(It's)43 b(part)150
8393 -2481 y(of)d Fj(e2compr-0.40)p Fl(,)f(an)g(on-the-\015y)h(disk)e
8394 -(compressor)h(for)h(the)f(Lin)m(ux)f Fj(ext2)h Fl(\014lesystem.)67
8395 -b(Lo)s(ok)40 b(at)150 2591 y Fj(http://www.netspace.net.)o(au/~)o(reit)
8396 -o(er/)o(e2co)o(mpr)p Fl(.)150 2880 y Fk(4.5)68 b(T)-11
8397 -b(esting)150 3072 y Fl(A)30 b(record)h(of)f(the)h(tests)g(I'v)m(e)g
8398 -(done.)150 3229 y(First,)f(some)h(data)g(sets:)225 3386
8399 -y Fi(\017)60 b Fl(B:)32 b(a)f(directory)f(con)m(taining)h(6001)i
8400 -(\014les,)d(one)h(for)g(ev)m(ery)h(length)e(in)g(the)h(range)g(0)h(to)f
8401 -(6000)i(b)m(ytes.)330 3496 y(The)d(\014les)f(con)m(tain)i(random)e(lo)m
8402 -(w)m(ercase)j(letters.)41 b(18.7)32 b(megab)m(ytes.)225
8403 -3633 y Fi(\017)60 b Fl(H:)36 b(m)m(y)f(home)h(directory)f(tree.)56
8404 -b(Do)s(cumen)m(ts,)38 b(source)d(co)s(de,)i(mail)d(\014les,)i
8405 -(compressed)f(data.)57 b(H)330 3743 y(con)m(tains)39
8406 -b(B,)h(and)f(also)g(a)g(directory)g(of)g(\014les)f(designed)g(as)i(b)s
8407 -(oundary)d(cases)j(for)f(the)g(sorting;)330 3853 y(mostly)30
8408 -b(v)m(ery)h(rep)s(etitiv)m(e,)f(nast)m(y)h(\014les.)39
8409 -b(565)32 b(megab)m(ytes.)225 3990 y Fi(\017)60 b Fl(A:)43
8410 -b(directory)f(tree)i(holding)d(v)-5 b(arious)41 b(applications)g(built)
8411 -g(from)h(source:)66 b Fj(egcs)p Fl(,)45 b Fj(gcc-2.8.1)p
8412 -Fl(,)330 4100 y(KDE,)31 b(GTK,)f(Octa)m(v)m(e,)j(etc.)41
8413 -b(2200)33 b(megab)m(ytes.)150 4285 y(The)i(tests)g(conducted)g(are)h
8414 -(as)f(follo)m(ws.)54 b(Eac)m(h)36 b(test)g(means)f(compressing)f(\(a)h
8415 -(cop)m(y)h(of)7 b(\))36 b(eac)m(h)g(\014le)e(in)150 4394
8416 -y(the)d(data)g(set,)g(decompressing)e(it)h(and)g(comparing)f(it)h
8417 -(against)h(the)g(original.)150 4551 y(First,)26 b(a)g(bunc)m(h)f(of)h
8418 -(tests)h(with)d(blo)s(c)m(k)h(sizes)h(and)f(in)m(ternal)g(bu\013er)f
8419 -(sizes)i(set)g(v)m(ery)g(small,)g(to)g(detect)i(an)m(y)150
8420 -4661 y(problems)g(with)g(the)i(blo)s(c)m(king)f(and)g(bu\013ering)e
8421 -(mec)m(hanisms.)40 b(This)28 b(required)g(mo)s(difying)f(the)j(source)
8422 -150 4770 y(co)s(de)h(so)f(as)h(to)g(try)f(to)h(break)g(it.)199
8423 -4927 y(1.)61 b(Data)32 b(set)f(H,)g(with)e(bu\013er)g(size)h(of)h(1)g
8424 -(b)m(yte,)g(and)f(blo)s(c)m(k)g(size)g(of)g(23)i(b)m(ytes.)199
8425 -5065 y(2.)61 b(Data)32 b(set)f(B,)g(bu\013er)e(sizes)h(1)h(b)m(yte,)g
8426 -(blo)s(c)m(k)f(size)g(1)h(b)m(yte.)199 5202 y(3.)61 b(As)30
8427 -b(\(2\))i(but)d(small-mo)s(de)g(decompression.)199 5340
8428 -y(4.)61 b(As)30 b(\(2\))i(with)d(blo)s(c)m(k)h(size)g(2)h(b)m(ytes.)p
8429 -eop
8430 -%%Page: 35 36
8431 -35 35 bop 150 -116 a Fl(Chapter)30 b(4:)41 b(Miscellanea)2586
8432 -b(35)199 299 y(5.)61 b(As)30 b(\(2\))i(with)d(blo)s(c)m(k)h(size)g(3)h
8433 -(b)m(ytes.)199 431 y(6.)61 b(As)30 b(\(2\))i(with)d(blo)s(c)m(k)h(size)
8434 -g(4)h(b)m(ytes.)199 564 y(7.)61 b(As)30 b(\(2\))i(with)d(blo)s(c)m(k)h
8435 -(size)g(5)h(b)m(ytes.)199 697 y(8.)61 b(As)30 b(\(2\))i(with)d(blo)s(c)
8436 -m(k)h(size)g(6)h(b)m(ytes)g(and)e(small-mo)s(de)g(decompression.)199
8437 -829 y(9.)61 b(H)30 b(with)g(bu\013er)f(size)h(of)h(1)f(b)m(yte,)i(but)d
8438 -(normal)h(blo)s(c)m(k)g(size)g(\(up)f(to)j(900000)h(b)m(ytes\).)150
8439 -1009 y(Then)c(some)i(tests)g(with)e(unmo)s(di\014ed)f(source)i(co)s
8440 -(de.)199 1166 y(1.)61 b(H,)31 b(all)e(settings)h(normal.)199
8441 -1299 y(2.)61 b(As)30 b(\(1\),)i(with)d(small-mo)s(de)g(decompress.)199
8442 -1431 y(3.)61 b(H,)31 b(compress)f(with)f(\015ag)i Fj(-1)p
8443 -Fl(.)199 1564 y(4.)61 b(H,)31 b(compress)f(with)f(\015ag)i
8444 -Fj(-s)p Fl(,)f(decompress)g(with)f(\015ag)i Fj(-s)p Fl(.)199
8445 -1697 y(5.)61 b(F)-8 b(orw)m(ards)33 b(compatibilit)m(y:)45
8446 -b(H,)33 b Fj(bzip2-0.1pl2)d Fl(compressing,)j Fj(bzip2-0.9.5)d
8447 -Fl(decompressing,)330 1806 y(all)f(settings)i(normal.)199
8448 -1939 y(6.)61 b(Bac)m(kw)m(ards)23 b(compatibilit)m(y:)35
8449 -b(H,)23 b Fj(bzip2-0.9.5)c Fl(compressing,)k Fj(bzip2-0.1pl2)c
8450 -Fl(decompressing,)330 2048 y(all)29 b(settings)i(normal.)199
8451 -2181 y(7.)61 b(Bigger)31 b(tests:)41 b(A,)31 b(all)e(settings)i
8452 -(normal.)199 2314 y(8.)61 b(As)30 b(\(7\),)i(using)d(the)i(fallbac)m(k)
8453 -e(\(Sadak)-5 b(ane-lik)m(e\))31 b(sorting)f(algorithm.)199
8454 -2446 y(9.)61 b(As)30 b(\(8\),)i(compress)e(with)f(\015ag)i
8455 -Fj(-1)p Fl(,)f(decompress)g(with)f(\015ag)i Fj(-s)p Fl(.)154
8456 -2579 y(10.)61 b(H,)31 b(using)e(the)h(fallbac)m(k)g(sorting)g
8457 -(algorithm.)154 2711 y(11.)61 b(F)-8 b(orw)m(ards)33
8458 -b(compatibilit)m(y:)45 b(A,)33 b Fj(bzip2-0.1pl2)d Fl(compressing,)j
8459 -Fj(bzip2-0.9.5)d Fl(decompressing,)330 2821 y(all)f(settings)i(normal.)
8460 -154 2954 y(12.)61 b(Bac)m(kw)m(ards)23 b(compatibilit)m(y:)35
8461 -b(A,)23 b Fj(bzip2-0.9.5)c Fl(compressing,)k Fj(bzip2-0.1pl2)c
8462 -Fl(decompressing,)330 3063 y(all)29 b(settings)i(normal.)154
8463 -3196 y(13.)61 b(Misc)39 b(test:)58 b(ab)s(out)39 b(400)h(megab)m(ytes)h
8464 -(of)e Fj(.tar)f Fl(\014les)f(with)h Fj(bzip2)f Fl(compiled)h(with)f
8465 -(Chec)m(k)m(er)j(\(a)330 3305 y(memory)30 b(access)i(error)e(detector,)
8466 -i(lik)m(e)e(Purify\).)154 3438 y(14.)61 b(Misc)30 b(tests)h(to)g(mak)m
8467 -(e)h(sure)d(it)h(builds)e(and)h(runs)g(ok)i(on)f(non-Lin)m(ux/x86)g
8468 -(platforms.)150 3618 y(These)35 b(tests)h(w)m(ere)f(conducted)g(on)g(a)
8469 -h(225)g(MHz)g(IDT)f(WinChip)d(mac)m(hine,)k(running)d(Lin)m(ux)g
8470 -(2.0.36.)150 3728 y(They)d(represen)m(t)g(nearly)g(a)h(w)m(eek)g(of)f
8471 -(con)m(tin)m(uous)g(computation.)41 b(All)29 b(tests)i(completed)f
8472 -(successfully)-8 b(.)150 4003 y Fk(4.6)68 b(F)-11 b(urther)44
8473 -b(reading)150 4196 y Fj(bzip2)28 b Fl(is)h(not)h(researc)m(h)g(w)m
8474 -(ork,)g(in)e(the)i(sense)g(that)g(it)f(do)s(esn't)g(presen)m(t)h(an)m
8475 -(y)g(new)f(ideas.)40 b(Rather,)30 b(it's)150 4306 y(an)g(engineering)f
8476 -(exercise)i(based)f(on)g(existing)g(ideas.)150 4463 y(F)-8
8477 -b(our)31 b(do)s(cumen)m(ts)f(describ)s(e)e(essen)m(tially)i(all)f(the)i
8478 -(ideas)e(b)s(ehind)f Fj(bzip2)p Fl(:)390 4614 y Fj(Michael)46
8479 -b(Burrows)g(and)h(D.)g(J.)g(Wheeler:)485 4717 y("A)h(block-sorting)c
8480 -(lossless)h(data)i(compression)e(algorithm")533 4821
8481 -y(10th)i(May)g(1994.)533 4925 y(Digital)f(SRC)h(Research)e(Report)i
8482 -(124.)533 5029 y(ftp://ftp.digital.com/pub)o(/DEC)o(/SR)o(C/re)o(sear)o
8483 -(ch-)o(repo)o(rts/)o(SRC)o(-124)o(.ps.)o(gz)533 5132
8484 -y(If)g(you)g(have)g(trouble)f(finding)g(it,)g(try)h(searching)f(at)h
8485 -(the)533 5236 y(New)g(Zealand)f(Digital)g(Library,)f
8486 -(http://www.nzdl.org.)p eop
8487 -%%Page: 36 37
8488 -36 36 bop 150 -116 a Fl(Chapter)30 b(4:)41 b(Miscellanea)2586
8489 -b(36)390 299 y Fj(Daniel)46 b(S.)h(Hirschberg)e(and)i(Debra)g(A.)g
8490 -(LeLewer)485 403 y("Efficient)e(Decoding)h(of)h(Prefix)f(Codes")533
8491 -506 y(Communications)e(of)j(the)g(ACM,)g(April)f(1990,)h(Vol)f(33,)h
8492 -(Number)f(4.)533 610 y(You)h(might)f(be)i(able)e(to)h(get)g(an)h
8493 -(electronic)d(copy)h(of)h(this)676 714 y(from)g(the)g(ACM)g(Digital)f
8494 -(Library.)390 922 y(David)g(J.)i(Wheeler)533 1025 y(Program)e(bred3.c)g
8495 -(and)h(accompanying)d(document)i(bred3.ps.)533 1129 y(This)h(contains)e
8496 -(the)i(idea)g(behind)f(the)h(multi-table)e(Huffman)533
8497 -1233 y(coding)h(scheme.)533 1337 y(ftp://ftp.cl.cam.ac.uk/us)o(ers/)o
8498 -(djw)o(3/)390 1544 y(Jon)h(L.)g(Bentley)f(and)h(Robert)f(Sedgewick)485
8499 -1648 y("Fast)h(Algorithms)e(for)i(Sorting)f(and)g(Searching)g(Strings")
8500 -533 1752 y(Available)f(from)i(Sedgewick's)e(web)i(page,)533
8501 -1856 y(www.cs.princeton.edu/~rs)150 2012 y Fl(The)29
8502 -b(follo)m(wing)f(pap)s(er)g(giv)m(es)h(v)-5 b(aluable)28
8503 -b(additional)g(insigh)m(ts)f(in)m(to)j(the)f(algorithm,)g(but)g(is)f
8504 -(not)i(imme-)150 2122 y(diately)g(the)g(basis)f(of)i(an)m(y)g(co)s(de)f
8505 -(used)g(in)f(bzip2.)390 2273 y Fj(Peter)46 b(Fenwick:)533
8506 -2377 y(Block)h(Sorting)e(Text)i(Compression)533 2481
8507 -y(Proceedings)e(of)i(the)g(19th)g(Australasian)d(Computer)i(Science)f
8508 -(Conference,)629 2584 y(Melbourne,)g(Australia.)92 b(Jan)47
8509 -b(31)g(-)h(Feb)f(2,)g(1996.)533 2688 y(ftp://ftp.cs.auckland.ac.)o
8510 -(nz/p)o(ub/)o(pete)o(r-f/)o(ACS)o(C96p)o(aper)o(.ps)150
8511 -2845 y Fl(Kunihik)m(o)28 b(Sadak)-5 b(ane's)31 b(sorting)e(algorithm,)h
8512 -(men)m(tioned)g(ab)s(o)m(v)m(e,)i(is)d(a)m(v)-5 b(ailable)30
8513 -b(from:)390 2996 y Fj(http://naomi.is.s.u-toky)o(o.ac)o(.jp/)o(~sa)o
8514 -(da/p)o(aper)o(s/S)o(ada9)o(8b.p)o(s.g)o(z)150 3153 y
8515 -Fl(The)41 b(Man)m(b)s(er-My)m(ers)g(su\016x)g(arra)m(y)g(construction)g
8516 -(algorithm)f(is)g(describ)s(ed)f(in)h(a)i(pap)s(er)e(a)m(v)-5
8517 -b(ailable)150 3262 y(from:)390 3413 y Fj(http://www.cs.arizona.ed)o
8518 -(u/pe)o(ople)o(/ge)o(ne/P)o(APER)o(S/s)o(uffi)o(x.ps)150
8519 -3570 y Fl(Finally)d(,)33 b(the)h(follo)m(wing)e(pap)s(er)h(do)s(cumen)m
8520 -(ts)g(some)h(recen)m(t)h(in)m(v)m(estigations)e(I)h(made)f(in)m(to)h
8521 -(the)g(p)s(erfor-)150 3680 y(mance)d(of)f(sorting)g(algorithms:)390
8522 -3831 y Fj(Julian)46 b(Seward:)533 3935 y(On)h(the)g(Performance)e(of)i
8523 -(BWT)g(Sorting)f(Algorithms)533 4038 y(Proceedings)f(of)i(the)g(IEEE)g
8524 -(Data)f(Compression)f(Conference)g(2000)629 4142 y(Snowbird,)g(Utah.)94
8525 -b(28-30)46 b(March)h(2000.)p eop
8526 -%%Page: -1 38
8527 --1 37 bop 3725 -116 a Fl(i)150 299 y Fh(T)-13 b(able)54
8528 -b(of)g(Con)l(ten)l(ts)150 641 y Fk(1)135 b(In)l(tro)t(duction)15
8529 -b Fb(.)20 b(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f
8530 -(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)60
8531 -b Fk(2)150 911 y(2)135 b(Ho)l(w)45 b(to)h(use)f Fd(bzip2)31
8532 -b Fb(.)19 b(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g
8533 -(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)78 b Fk(3)1047
8534 -1048 y Fl(NAME)20 b Fa(.)c(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
8535 -(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
8536 -h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)50 b Fl(3)1047
8537 -1157 y(SYNOPSIS)21 b Fa(.)13 b(.)i(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
8538 -(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
8539 -g(.)g(.)g(.)g(.)h(.)f(.)g(.)50 b Fl(3)1047 1267 y(DESCRIPTION)10
8540 -b Fa(.)j(.)i(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)
8541 -g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)40
8542 -b Fl(3)1047 1377 y(OPTIONS)16 b Fa(.)d(.)i(.)g(.)g(.)g(.)g(.)g(.)g(.)g
8543 -(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
8544 -g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)45 b Fl(4)1047
8545 -1486 y(MEMOR)-8 b(Y)31 b(MANA)m(GEMENT)14 b Fa(.)j(.)e(.)g(.)g(.)g(.)g
8546 -(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)44
8547 -b Fl(6)1047 1596 y(RECO)m(VERING)30 b(D)m(A)-8 b(T)g(A)32
8548 -b(FR)m(OM)f(D)m(AMA)m(GED)i(FILES)1256 1705 y Fa(.)15
8549 -b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
8550 -(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
8551 -g(.)g(.)g(.)g(.)g(.)g(.)57 b Fl(7)1047 1815 y(PERF)m(ORMANCE)30
8552 -b(NOTES)9 b Fa(.)14 b(.)h(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
8553 -(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)38 b Fl(7)1047 1924
8554 -y(CA)-10 b(VEA)i(TS)10 b Fa(.)15 b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
8555 -(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
8556 -h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)40 b Fl(8)1047 2034
8557 -y(A)m(UTHOR)23 b Fa(.)15 b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
8558 -(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
8559 -g(.)g(.)g(.)g(.)g(.)g(.)g(.)53 b Fl(8)150 2276 y Fk(3)135
8560 -b(Programming)46 b(with)f Fd(libbzip2)29 b Fb(.)16 b(.)j(.)h(.)f(.)h(.)
8561 -f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)74 b Fk(9)449
8562 -2413 y Fl(3.1)92 b(T)-8 b(op-lev)m(el)30 b(structure)24
8563 -b Fa(.)15 b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h
8564 -(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
8565 -g(.)g(.)g(.)g(.)54 b Fl(9)748 2523 y(3.1.1)93 b(Lo)m(w-lev)m(el)30
8566 -b(summary)23 b Fa(.)15 b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
8567 -g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)53
8568 -b Fl(9)748 2633 y(3.1.2)93 b(High-lev)m(el)29 b(summary)12
8569 -b Fa(.)i(.)h(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
8570 -g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)41 b
8571 -Fl(9)748 2742 y(3.1.3)93 b(Utilit)m(y)29 b(functions)g(summary)12
8572 -b Fa(.)h(.)j(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
8573 -g(.)g(.)g(.)g(.)g(.)41 b Fl(10)449 2852 y(3.2)92 b(Error)29
8574 -b(handling)18 b Fa(.)13 b(.)i(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f
8575 -(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
8576 -g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)48 b Fl(10)449
8577 -2961 y(3.3)92 b(Lo)m(w-lev)m(el)31 b(in)m(terface)d Fa(.)15
8578 -b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g
8579 -(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
8580 -g(.)57 b Fl(12)748 3071 y(3.3.1)93 b Fj(BZ2_bzCompressInit)21
8581 -b Fa(.)9 b(.)15 b(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g
8582 -(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)50 b Fl(12)748
8583 -3181 y(3.3.2)93 b Fj(BZ2_bzCompress)9 b Fa(.)h(.)15 b(.)g(.)g(.)g(.)g
8584 -(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
8585 -g(.)g(.)g(.)g(.)g(.)g(.)g(.)38 b Fl(14)748 3290 y(3.3.3)93
8586 -b Fj(BZ2_bzCompressEnd)23 b Fa(.)10 b(.)15 b(.)g(.)g(.)g(.)g(.)g(.)g(.)
8587 -g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g
8588 -(.)52 b Fl(17)748 3400 y(3.3.4)93 b Fj(BZ2_bzDecompressInit)16
8589 -b Fa(.)9 b(.)15 b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h
8590 -(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)45 b Fl(17)748 3509
8591 -y(3.3.5)93 b Fj(BZ2_bzDecompress)21 b Fa(.)15 b(.)g(.)g(.)g(.)g(.)g(.)g
8592 -(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
8593 -g(.)g(.)g(.)55 b Fl(17)748 3619 y(3.3.6)93 b Fj(BZ2_bzDecompressEnd)18
8594 -b Fa(.)10 b(.)15 b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
8595 -(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)48 b Fl(19)449
8596 -3729 y(3.4)92 b(High-lev)m(el)30 b(in)m(terface)16 b
8597 -Fa(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h
8598 -(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
8599 -g(.)g(.)45 b Fl(19)748 3838 y(3.4.1)93 b Fj(BZ2_bzReadOpen)9
8600 -b Fa(.)h(.)15 b(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g
8601 -(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)38
8602 -b Fl(19)748 3948 y(3.4.2)93 b Fj(BZ2_bzRead)18 b Fa(.)12
8603 -b(.)j(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
8604 -(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)47
8605 -b Fl(20)748 4057 y(3.4.3)93 b Fj(BZ2_bzReadGetUnused)18
8606 -b Fa(.)10 b(.)15 b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
8607 -(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)48 b Fl(22)748
8608 -4167 y(3.4.4)93 b Fj(BZ2_bzReadClose)23 b Fa(.)15 b(.)g(.)g(.)g(.)g(.)g
8609 -(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
8610 -g(.)g(.)g(.)g(.)g(.)57 b Fl(22)748 4276 y(3.4.5)93 b
8611 -Fj(BZ2_bzWriteOpen)23 b Fa(.)15 b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
8612 -(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
8613 -g(.)57 b Fl(22)748 4386 y(3.4.6)93 b Fj(BZ2_bzWrite)16
8614 -b Fa(.)11 b(.)k(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g
8615 -(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
8616 -45 b Fl(23)748 4496 y(3.4.7)93 b Fj(BZ2_bzWriteClose)21
8617 -b Fa(.)15 b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
8618 -(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)55 b Fl(23)748
8619 -4605 y(3.4.8)93 b(Handling)28 b(em)m(b)s(edded)h(compressed)h(data)h
8620 -(streams)17 b Fa(.)f(.)f(.)g(.)46 b Fl(24)748 4715 y(3.4.9)93
8621 -b(Standard)29 b(\014le-reading/writing)e(co)s(de)22 b
8622 -Fa(.)16 b(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)52
8623 -b Fl(25)449 4824 y(3.5)92 b(Utilit)m(y)29 b(functions)f
8624 -Fa(.)15 b(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
8625 -(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
8626 -g(.)g(.)g(.)g(.)g(.)59 b Fl(26)748 4934 y(3.5.1)93 b
8627 -Fj(BZ2_bzBuffToBuffCompres)o(s)22 b Fa(.)15 b(.)g(.)g(.)g(.)g(.)g(.)g
8628 -(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)57 b Fl(26)748
8629 -5044 y(3.5.2)93 b Fj(BZ2_bzBuffToBuffDecompr)o(ess)17
8630 -b Fa(.)e(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
8631 -53 b Fl(27)449 5153 y(3.6)92 b Fj(zlib)29 b Fl(compatibilit)m(y)g
8632 -(functions)23 b Fa(.)13 b(.)i(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h
8633 -(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)52
8634 -b Fl(28)449 5263 y(3.7)92 b(Using)30 b(the)g(library)e(in)h(a)i
8635 -Fj(stdio)p Fl(-free)e(en)m(vironmen)m(t)23 b Fa(.)15
8636 -b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)52 b Fl(29)p
8637 -eop
8638 -%%Page: -2 39
8639 --2 38 bop 3699 -116 a Fl(ii)748 83 y(3.7.1)93 b(Getting)31
8640 -b(rid)d(of)j Fj(stdio)20 b Fa(.)13 b(.)i(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
8641 -g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)49
8642 -b Fl(29)748 193 y(3.7.2)93 b(Critical)28 b(error)i(handling)22
8643 -b Fa(.)15 b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
8644 -(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)54 b Fl(29)449 302
8645 -y(3.8)92 b(Making)30 b(a)h(Windo)m(ws)e(DLL)15 b Fa(.)h(.)f(.)g(.)g(.)g
8646 -(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
8647 -g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)44 b Fl(30)150 545
8648 -y Fk(4)135 b(Miscellanea)11 b Fb(.)21 b(.)f(.)f(.)h(.)f(.)g(.)h(.)f(.)h
8649 -(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)
8650 -h(.)f(.)g(.)h(.)56 b Fk(31)449 682 y Fl(4.1)92 b(Limitations)29
8651 -b(of)h(the)h(compressed)f(\014le)f(format)9 b Fa(.)15
8652 -b(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)38
8653 -b Fl(31)449 791 y(4.2)92 b(P)m(ortabilit)m(y)30 b(issues)14
8654 -b Fa(.)f(.)j(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
8655 -g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
8656 -(.)g(.)h(.)f(.)g(.)43 b Fl(32)449 901 y(4.3)92 b(Rep)s(orting)29
8657 -b(bugs)f Fa(.)15 b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
8658 -(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
8659 -g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)58 b Fl(32)449 1010 y(4.4)92
8660 -b(Did)29 b(y)m(ou)i(get)h(the)e(righ)m(t)g(pac)m(k)-5
8661 -b(age?)22 b Fa(.)17 b(.)e(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h
8662 -(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)51
8663 -b Fl(34)449 1120 y(4.5)92 b(T)-8 b(esting)16 b Fa(.)f(.)g(.)g(.)g(.)g
8664 -(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
8665 -g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g
8666 -(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)45 b Fl(34)449 1230 y(4.6)92
8667 -b(F)-8 b(urther)30 b(reading)22 b Fa(.)14 b(.)h(.)g(.)h(.)f(.)g(.)g(.)g
8668 -(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)
8669 -g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)51
8670 -b Fl(35)p eop
8671 -%%Trailer
8672 -end
8673 -userdict /end-hook known{end-hook}if
8674 -%%EOF
8675 diff -Nru bzip2-1.0.1/manual.texi bzip2-1.0.1.new/manual.texi
8676 --- bzip2-1.0.1/manual.texi     Sat Jun 24 20:13:27 2000
8677 +++ bzip2-1.0.1.new/manual.texi Thu Jan  1 01:00:00 1970
8678 @@ -1,2215 +0,0 @@
8679 -\input texinfo  @c                                  -*- Texinfo -*-
8680 -@setfilename bzip2.info
8681 -
8682 -@ignore
8683 -This file documents bzip2 version 1.0, and associated library
8684 -libbzip2, written by Julian Seward (jseward@acm.org).
8685 -
8686 -Copyright (C) 1996-2000 Julian R Seward
8687 -
8688 -Permission is granted to make and distribute verbatim copies of
8689 -this manual provided the copyright notice and this permission notice
8690 -are preserved on all copies.
8691 -
8692 -Permission is granted to copy and distribute translations of this manual
8693 -into another language, under the above conditions for verbatim copies.
8694 -@end ignore
8695 -
8696 -@ifinfo
8697 -@format
8698 -START-INFO-DIR-ENTRY
8699 -* Bzip2: (bzip2).              A program and library for data compression.
8700 -END-INFO-DIR-ENTRY
8701 -@end format
8702 -
8703 -@end ifinfo
8704 -
8705 -@iftex
8706 -@c @finalout
8707 -@settitle bzip2 and libbzip2
8708 -@titlepage
8709 -@title bzip2 and libbzip2
8710 -@subtitle a program and library for data compression
8711 -@subtitle copyright (C) 1996-2000 Julian Seward
8712 -@subtitle version 1.0 of 21 March 2000
8713 -@author Julian Seward
8714 -
8715 -@end titlepage
8716 -
8717 -@parindent 0mm
8718 -@parskip 2mm
8719 -
8720 -@end iftex
8721 -@node Top, Overview, (dir), (dir)
8722 -
8723 -This program, @code{bzip2}, 
8724 -and associated library @code{libbzip2}, are
8725 -Copyright (C) 1996-2000 Julian R Seward.  All rights reserved.
8726 -
8727 -Redistribution and use in source and binary forms, with or without
8728 -modification, are permitted provided that the following conditions
8729 -are met:
8730 -@itemize @bullet
8731 -@item
8732 -   Redistributions of source code must retain the above copyright
8733 -   notice, this list of conditions and the following disclaimer.
8734 -@item
8735 -   The origin of this software must not be misrepresented; you must 
8736 -   not claim that you wrote the original software.  If you use this 
8737 -   software in a product, an acknowledgment in the product 
8738 -   documentation would be appreciated but is not required.
8739 -@item
8740 -   Altered source versions must be plainly marked as such, and must
8741 -   not be misrepresented as being the original software.
8742 -@item
8743 -   The name of the author may not be used to endorse or promote 
8744 -   products derived from this software without specific prior written 
8745 -   permission.
8746 -@end itemize
8747 -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
8748 -OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
8749 -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
8750 -ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
8751 -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
8752 -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
8753 -GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
8754 -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
8755 -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
8756 -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
8757 -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8758 -
8759 -Julian Seward, Cambridge, UK.
8760 -
8761 -@code{jseward@@acm.org}
8762 -
8763 -@code{http://sourceware.cygnus.com/bzip2}
8764 -
8765 -@code{http://www.cacheprof.org}
8766 -
8767 -@code{http://www.muraroa.demon.co.uk}
8768 -
8769 -@code{bzip2}/@code{libbzip2} version 1.0 of 21 March 2000.
8770 -
8771 -PATENTS: To the best of my knowledge, @code{bzip2} does not use any patented
8772 -algorithms.  However, I do not have the resources available to carry out
8773 -a full patent search.  Therefore I cannot give any guarantee of the
8774 -above statement.
8775 -
8776 -
8777 -
8778 -
8779 -
8780 -
8781 -
8782 -@node Overview, Implementation, Top, Top
8783 -@chapter Introduction
8784 -
8785 -@code{bzip2}  compresses  files  using the Burrows-Wheeler 
8786 -block-sorting text compression algorithm,  and  Huffman  coding.
8787 -Compression  is  generally  considerably  better than that
8788 -achieved by more conventional LZ77/LZ78-based compressors,
8789 -and  approaches  the performance of the PPM family of statistical compressors.
8790 -
8791 -@code{bzip2} is built on top of @code{libbzip2}, a flexible library
8792 -for handling compressed data in the @code{bzip2} format.  This manual
8793 -describes both how to use the program and 
8794 -how to work with the library interface.  Most of the
8795 -manual is devoted to this library, not the program, 
8796 -which is good news if your interest is only in the program.
8797 -
8798 -Chapter 2 describes how to use @code{bzip2}; this is the only part 
8799 -you need to read if you just want to know how to operate the program.
8800 -Chapter 3 describes the programming interfaces in detail, and
8801 -Chapter 4 records some miscellaneous notes which I thought
8802 -ought to be recorded somewhere.
8803 -
8804 -
8805 -@chapter How to use @code{bzip2}
8806 -
8807 -This chapter contains a copy of the @code{bzip2} man page,
8808 -and nothing else.
8809 -
8810 -@quotation
8811 -
8812 -@unnumberedsubsubsec NAME
8813 -@itemize
8814 -@item @code{bzip2}, @code{bunzip2}
8815 -- a block-sorting file compressor, v1.0
8816 -@item @code{bzcat} 
8817 -- decompresses files to stdout
8818 -@item @code{bzip2recover}
8819 -- recovers data from damaged bzip2 files
8820 -@end itemize
8821 -
8822 -@unnumberedsubsubsec SYNOPSIS
8823 -@itemize
8824 -@item @code{bzip2} [ -cdfkqstvzVL123456789 ] [ filenames ...  ]
8825 -@item @code{bunzip2} [ -fkvsVL ] [ filenames ...  ]
8826 -@item @code{bzcat} [ -s ] [ filenames ...  ]
8827 -@item @code{bzip2recover} filename
8828 -@end itemize
8829 -
8830 -@unnumberedsubsubsec DESCRIPTION
8831 -
8832 -@code{bzip2} compresses files using the Burrows-Wheeler block sorting
8833 -text compression algorithm, and Huffman coding.  Compression is
8834 -generally considerably better than that achieved by more conventional
8835 -LZ77/LZ78-based compressors, and approaches the performance of the PPM
8836 -family of statistical compressors.
8837 -
8838 -The command-line options are deliberately very similar to those of GNU
8839 -@code{gzip}, but they are not identical.
8840 -
8841 -@code{bzip2} expects a list of file names to accompany the command-line
8842 -flags.  Each file is replaced by a compressed version of itself, with
8843 -the name @code{original_name.bz2}.  Each compressed file has the same
8844 -modification date, permissions, and, when possible, ownership as the
8845 -corresponding original, so that these properties can be correctly
8846 -restored at decompression time.  File name handling is naive in the
8847 -sense that there is no mechanism for preserving original file names,
8848 -permissions, ownerships or dates in filesystems which lack these
8849 -concepts, or have serious file name length restrictions, such as MS-DOS.
8850 -
8851 -@code{bzip2} and @code{bunzip2} will by default not overwrite existing
8852 -files.  If you want this to happen, specify the @code{-f} flag.
8853 -
8854 -If no file names are specified, @code{bzip2} compresses from standard
8855 -input to standard output.  In this case, @code{bzip2} will decline to
8856 -write compressed output to a terminal, as this would be entirely
8857 -incomprehensible and therefore pointless.
8858 -
8859 -@code{bunzip2} (or @code{bzip2 -d}) decompresses all
8860 -specified files.  Files which were not created by @code{bzip2}
8861 -will be detected and ignored, and a warning issued.  
8862 -@code{bzip2} attempts to guess the filename for the decompressed file 
8863 -from that of the compressed file as follows:
8864 -@itemize
8865 -@item @code{filename.bz2 } becomes @code{filename}
8866 -@item @code{filename.bz  } becomes @code{filename}
8867 -@item @code{filename.tbz2} becomes @code{filename.tar}
8868 -@item @code{filename.tbz } becomes @code{filename.tar}
8869 -@item @code{anyothername } becomes @code{anyothername.out}
8870 -@end itemize
8871 -If the file does not end in one of the recognised endings, 
8872 -@code{.bz2}, @code{.bz}, 
8873 -@code{.tbz2} or @code{.tbz}, @code{bzip2} complains that it cannot
8874 -guess the name of the original file, and uses the original name
8875 -with @code{.out} appended.
8876 -
8877 -As with compression, supplying no
8878 -filenames causes decompression from standard input to standard output.
8879 -
8880 -@code{bunzip2} will correctly decompress a file which is the
8881 -concatenation of two or more compressed files.  The result is the
8882 -concatenation of the corresponding uncompressed files.  Integrity
8883 -testing (@code{-t}) of concatenated compressed files is also supported.
8884 -
8885 -You can also compress or decompress files to the standard output by
8886 -giving the @code{-c} flag.  Multiple files may be compressed and
8887 -decompressed like this.  The resulting outputs are fed sequentially to
8888 -stdout.  Compression of multiple files in this manner generates a stream
8889 -containing multiple compressed file representations.  Such a stream
8890 -can be decompressed correctly only by @code{bzip2} version 0.9.0 or
8891 -later.  Earlier versions of @code{bzip2} will stop after decompressing
8892 -the first file in the stream.
8893 -
8894 -@code{bzcat} (or @code{bzip2 -dc}) decompresses all specified files to
8895 -the standard output.
8896 -
8897 -@code{bzip2} will read arguments from the environment variables
8898 -@code{BZIP2} and @code{BZIP}, in that order, and will process them
8899 -before any arguments read from the command line.  This gives a 
8900 -convenient way to supply default arguments.
8901 -
8902 -Compression is always performed, even if the compressed file is slightly
8903 -larger than the original.  Files of less than about one hundred bytes
8904 -tend to get larger, since the compression mechanism has a constant
8905 -overhead in the region of 50 bytes.  Random data (including the output
8906 -of most file compressors) is coded at about 8.05 bits per byte, giving
8907 -an expansion of around 0.5%.
8908 -
8909 -As a self-check for your protection, @code{bzip2} uses 32-bit CRCs to
8910 -make sure that the decompressed version of a file is identical to the
8911 -original.  This guards against corruption of the compressed data, and
8912 -against undetected bugs in @code{bzip2} (hopefully very unlikely).  The
8913 -chances of data corruption going undetected is microscopic, about one
8914 -chance in four billion for each file processed.  Be aware, though, that
8915 -the check occurs upon decompression, so it can only tell you that
8916 -something is wrong.  It can't help you recover the original uncompressed
8917 -data.  You can use @code{bzip2recover} to try to recover data from
8918 -damaged files.
8919 -
8920 -Return values: 0 for a normal exit, 1 for environmental problems (file
8921 -not found, invalid flags, I/O errors, &c), 2 to indicate a corrupt
8922 -compressed file, 3 for an internal consistency error (eg, bug) which
8923 -caused @code{bzip2} to panic.
8924 -
8925 -
8926 -@unnumberedsubsubsec OPTIONS
8927 -@table @code
8928 -@item -c  --stdout
8929 -Compress or decompress to standard output.
8930 -@item -d  --decompress
8931 -Force decompression.  @code{bzip2}, @code{bunzip2} and @code{bzcat} are
8932 -really the same program, and the decision about what actions to take is
8933 -done on the basis of which name is used.  This flag overrides that
8934 -mechanism, and forces bzip2 to decompress.
8935 -@item -z --compress
8936 -The complement to @code{-d}: forces compression, regardless of the
8937 -invokation name.
8938 -@item -t --test
8939 -Check integrity of the specified file(s), but don't decompress them.
8940 -This really performs a trial decompression and throws away the result.
8941 -@item -f --force
8942 -Force overwrite of output files.  Normally, @code{bzip2} will not overwrite
8943 -existing output files.  Also forces @code{bzip2} to break hard links
8944 -to files, which it otherwise wouldn't do.
8945 -@item -k --keep
8946 -Keep (don't delete) input files during compression
8947 -or decompression.
8948 -@item -s --small
8949 -Reduce memory usage, for compression, decompression and testing.  Files
8950 -are decompressed and tested using a modified algorithm which only
8951 -requires 2.5 bytes per block byte.  This means any file can be
8952 -decompressed in 2300k of memory, albeit at about half the normal speed.
8953 -
8954 -During compression, @code{-s} selects a block size of 200k, which limits
8955 -memory use to around the same figure, at the expense of your compression
8956 -ratio.  In short, if your machine is low on memory (8 megabytes or
8957 -less), use -s for everything.  See MEMORY MANAGEMENT below.
8958 -@item -q --quiet
8959 -Suppress non-essential warning messages.  Messages pertaining to
8960 -I/O errors and other critical events will not be suppressed.
8961 -@item -v --verbose
8962 -Verbose mode -- show the compression ratio for each file processed.
8963 -Further @code{-v}'s increase the verbosity level, spewing out lots of
8964 -information which is primarily of interest for diagnostic purposes.
8965 -@item -L --license -V --version
8966 -Display the software version, license terms and conditions.
8967 -@item -1 to -9
8968 -Set the block size to 100 k, 200 k ..  900 k when compressing.  Has no
8969 -effect when decompressing.  See MEMORY MANAGEMENT below.
8970 -@item --
8971 -Treats all subsequent arguments as file names, even if they start
8972 -with a dash.  This is so you can handle files with names beginning
8973 -with a dash, for example: @code{bzip2 -- -myfilename}.
8974 -@item --repetitive-fast 
8975 -@item --repetitive-best
8976 -These flags are redundant in versions 0.9.5 and above.  They provided
8977 -some coarse control over the behaviour of the sorting algorithm in
8978 -earlier versions, which was sometimes useful.  0.9.5 and above have an
8979 -improved algorithm which renders these flags irrelevant.
8980 -@end table
8981 -
8982 -
8983 -@unnumberedsubsubsec MEMORY MANAGEMENT
8984 -
8985 -@code{bzip2} compresses large files in blocks.  The block size affects
8986 -both the compression ratio achieved, and the amount of memory needed for
8987 -compression and decompression.  The flags @code{-1} through @code{-9}
8988 -specify the block size to be 100,000 bytes through 900,000 bytes (the
8989 -default) respectively.  At decompression time, the block size used for
8990 -compression is read from the header of the compressed file, and
8991 -@code{bunzip2} then allocates itself just enough memory to decompress
8992 -the file.  Since block sizes are stored in compressed files, it follows
8993 -that the flags @code{-1} to @code{-9} are irrelevant to and so ignored
8994 -during decompression.
8995 -
8996 -Compression and decompression requirements, in bytes, can be estimated
8997 -as:
8998 -@example
8999 -     Compression:   400k + ( 8 x block size )
9000 -
9001 -     Decompression: 100k + ( 4 x block size ), or
9002 -                    100k + ( 2.5 x block size )
9003 -@end example
9004 -Larger block sizes give rapidly diminishing marginal returns.  Most of
9005 -the compression comes from the first two or three hundred k of block
9006 -size, a fact worth bearing in mind when using @code{bzip2} on small machines.
9007 -It is also important to appreciate that the decompression memory
9008 -requirement is set at compression time by the choice of block size.
9009 -
9010 -For files compressed with the default 900k block size, @code{bunzip2}
9011 -will require about 3700 kbytes to decompress.  To support decompression
9012 -of any file on a 4 megabyte machine, @code{bunzip2} has an option to
9013 -decompress using approximately half this amount of memory, about 2300
9014 -kbytes.  Decompression speed is also halved, so you should use this
9015 -option only where necessary.  The relevant flag is @code{-s}.
9016 -
9017 -In general, try and use the largest block size memory constraints allow,
9018 -since that maximises the compression achieved.  Compression and
9019 -decompression speed are virtually unaffected by block size.
9020 -
9021 -Another significant point applies to files which fit in a single block
9022 --- that means most files you'd encounter using a large block size.  The
9023 -amount of real memory touched is proportional to the size of the file,
9024 -since the file is smaller than a block.  For example, compressing a file
9025 -20,000 bytes long with the flag @code{-9} will cause the compressor to
9026 -allocate around 7600k of memory, but only touch 400k + 20000 * 8 = 560
9027 -kbytes of it.  Similarly, the decompressor will allocate 3700k but only
9028 -touch 100k + 20000 * 4 = 180 kbytes.
9029 -
9030 -Here is a table which summarises the maximum memory usage for different
9031 -block sizes.  Also recorded is the total compressed size for 14 files of
9032 -the Calgary Text Compression Corpus totalling 3,141,622 bytes.  This
9033 -column gives some feel for how compression varies with block size.
9034 -These figures tend to understate the advantage of larger block sizes for
9035 -larger files, since the Corpus is dominated by smaller files.
9036 -@example
9037 -          Compress   Decompress   Decompress   Corpus
9038 -   Flag     usage      usage       -s usage     Size
9039 -
9040 -    -1      1200k       500k         350k      914704
9041 -    -2      2000k       900k         600k      877703
9042 -    -3      2800k      1300k         850k      860338
9043 -    -4      3600k      1700k        1100k      846899
9044 -    -5      4400k      2100k        1350k      845160
9045 -    -6      5200k      2500k        1600k      838626
9046 -    -7      6100k      2900k        1850k      834096
9047 -    -8      6800k      3300k        2100k      828642
9048 -    -9      7600k      3700k        2350k      828642
9049 -@end example
9050 -
9051 -@unnumberedsubsubsec RECOVERING DATA FROM DAMAGED FILES
9052 -
9053 -@code{bzip2} compresses files in blocks, usually 900kbytes long.  Each
9054 -block is handled independently.  If a media or transmission error causes
9055 -a multi-block @code{.bz2} file to become damaged, it may be possible to
9056 -recover data from the undamaged blocks in the file.
9057 -
9058 -The compressed representation of each block is delimited by a 48-bit
9059 -pattern, which makes it possible to find the block boundaries with
9060 -reasonable certainty.  Each block also carries its own 32-bit CRC, so
9061 -damaged blocks can be distinguished from undamaged ones.
9062 -
9063 -@code{bzip2recover} is a simple program whose purpose is to search for
9064 -blocks in @code{.bz2} files, and write each block out into its own
9065 -@code{.bz2} file.  You can then use @code{bzip2 -t} to test the
9066 -integrity of the resulting files, and decompress those which are
9067 -undamaged.
9068 -
9069 -@code{bzip2recover} 
9070 -takes a single argument, the name of the damaged file, 
9071 -and writes a number of files @code{rec0001file.bz2},
9072 -       @code{rec0002file.bz2}, etc, containing the  extracted  blocks.
9073 -       The  output  filenames  are  designed  so  that the use of
9074 -       wildcards in subsequent processing -- for example,  
9075 -@code{bzip2 -dc  rec*file.bz2 > recovered_data} -- lists the files in
9076 -       the correct order.
9077 -
9078 -@code{bzip2recover} should be of most use dealing with large @code{.bz2}
9079 -       files,  as  these will contain many blocks.  It is clearly
9080 -       futile to use it on damaged single-block  files,  since  a
9081 -       damaged  block  cannot  be recovered.  If you wish to minimise 
9082 -any potential data loss through media  or  transmission errors, 
9083 -you might consider compressing with a smaller
9084 -       block size.
9085 -
9086 -
9087 -@unnumberedsubsubsec PERFORMANCE NOTES
9088 -
9089 -The sorting phase of compression gathers together similar strings in the
9090 -file.  Because of this, files containing very long runs of repeated
9091 -symbols, like "aabaabaabaab ..."  (repeated several hundred times) may
9092 -compress more slowly than normal.  Versions 0.9.5 and above fare much
9093 -better than previous versions in this respect.  The ratio between
9094 -worst-case and average-case compression time is in the region of 10:1.
9095 -For previous versions, this figure was more like 100:1.  You can use the
9096 -@code{-vvvv} option to monitor progress in great detail, if you want.
9097 -
9098 -Decompression speed is unaffected by these phenomena.
9099 -
9100 -@code{bzip2} usually allocates several megabytes of memory to operate
9101 -in, and then charges all over it in a fairly random fashion.  This means
9102 -that performance, both for compressing and decompressing, is largely
9103 -determined by the speed at which your machine can service cache misses.
9104 -Because of this, small changes to the code to reduce the miss rate have
9105 -been observed to give disproportionately large performance improvements.
9106 -I imagine @code{bzip2} will perform best on machines with very large
9107 -caches.
9108 -
9109 -
9110 -@unnumberedsubsubsec CAVEATS
9111 -
9112 -I/O error messages are not as helpful as they could be.  @code{bzip2}
9113 -tries hard to detect I/O errors and exit cleanly, but the details of
9114 -what the problem is sometimes seem rather misleading.
9115 -
9116 -This manual page pertains to version 1.0 of @code{bzip2}.  Compressed
9117 -data created by this version is entirely forwards and backwards
9118 -compatible with the previous public releases, versions 0.1pl2, 0.9.0 and
9119 -0.9.5, but with the following exception: 0.9.0 and above can correctly
9120 -decompress multiple concatenated compressed files.  0.1pl2 cannot do
9121 -this; it will stop after decompressing just the first file in the
9122 -stream.
9123 -
9124 -@code{bzip2recover} uses 32-bit integers to represent bit positions in
9125 -compressed files, so it cannot handle compressed files more than 512
9126 -megabytes long.  This could easily be fixed.
9127 -
9128 -
9129 -@unnumberedsubsubsec AUTHOR
9130 -Julian Seward, @code{jseward@@acm.org}.
9131 -
9132 -The ideas embodied in @code{bzip2} are due to (at least) the following
9133 -people: Michael Burrows and David Wheeler (for the block sorting
9134 -transformation), David Wheeler (again, for the Huffman coder), Peter
9135 -Fenwick (for the structured coding model in the original @code{bzip},
9136 -and many refinements), and Alistair Moffat, Radford Neal and Ian Witten
9137 -(for the arithmetic coder in the original @code{bzip}).  I am much
9138 -indebted for their help, support and advice.  See the manual in the
9139 -source distribution for pointers to sources of documentation.  Christian
9140 -von Roques encouraged me to look for faster sorting algorithms, so as to
9141 -speed up compression.  Bela Lubkin encouraged me to improve the
9142 -worst-case compression performance.  Many people sent patches, helped
9143 -with portability problems, lent machines, gave advice and were generally
9144 -helpful.
9145 -
9146 -@end quotation
9147 -
9148 -
9149 -
9150 -
9151 -@chapter Programming with @code{libbzip2}
9152 -
9153 -This chapter describes the programming interface to @code{libbzip2}.
9154 -
9155 -For general background information, particularly about memory
9156 -use and performance aspects, you'd be well advised to read Chapter 2
9157 -as well.
9158 -
9159 -@section Top-level structure
9160 -
9161 -@code{libbzip2} is a flexible library for compressing and decompressing
9162 -data in the @code{bzip2} data format.  Although packaged as a single
9163 -entity, it helps to regard the library as three separate parts: the low
9164 -level interface, and the high level interface, and some utility
9165 -functions.
9166 -
9167 -The structure of @code{libbzip2}'s interfaces is similar to
9168 -that of Jean-loup Gailly's and Mark Adler's excellent @code{zlib} 
9169 -library.
9170 -
9171 -All externally visible symbols have names beginning @code{BZ2_}.
9172 -This is new in version 1.0.  The intention is to minimise pollution
9173 -of the namespaces of library clients.
9174 -
9175 -@subsection Low-level summary
9176 -
9177 -This interface provides services for compressing and decompressing
9178 -data in memory.  There's no provision for dealing with files, streams
9179 -or any other I/O mechanisms, just straight memory-to-memory work.
9180 -In fact, this part of the library can be compiled without inclusion
9181 -of @code{stdio.h}, which may be helpful for embedded applications.
9182 -
9183 -The low-level part of the library has no global variables and
9184 -is therefore thread-safe.
9185 -
9186 -Six routines make up the low level interface: 
9187 -@code{BZ2_bzCompressInit}, @code{BZ2_bzCompress}, and @* @code{BZ2_bzCompressEnd}
9188 -for compression,
9189 -and a corresponding trio @code{BZ2_bzDecompressInit}, @* @code{BZ2_bzDecompress}
9190 -and @code{BZ2_bzDecompressEnd} for decompression.  
9191 -The @code{*Init} functions allocate
9192 -memory for compression/decompression and do other
9193 -initialisations, whilst the @code{*End} functions close down operations
9194 -and release memory.
9195 -
9196 -The real work is done by @code{BZ2_bzCompress} and @code{BZ2_bzDecompress}.  
9197 -These compress and decompress data from a user-supplied input buffer
9198 -to a user-supplied output buffer.  These buffers can be any size;
9199 -arbitrary quantities of data are handled by making repeated calls
9200 -to these functions.  This is a flexible mechanism allowing a 
9201 -consumer-pull style of activity, or producer-push, or a mixture of
9202 -both.
9203 -
9204 -
9205 -
9206 -@subsection High-level summary
9207 -
9208 -This interface provides some handy wrappers around the low-level
9209 -interface to facilitate reading and writing @code{bzip2} format
9210 -files (@code{.bz2} files).  The routines provide hooks to facilitate
9211 -reading files in which the @code{bzip2} data stream is embedded 
9212 -within some larger-scale file structure, or where there are
9213 -multiple @code{bzip2} data streams concatenated end-to-end.
9214 -
9215 -For reading files, @code{BZ2_bzReadOpen}, @code{BZ2_bzRead},
9216 -@code{BZ2_bzReadClose} and @* @code{BZ2_bzReadGetUnused} are supplied.  For
9217 -writing files, @code{BZ2_bzWriteOpen}, @code{BZ2_bzWrite} and
9218 -@code{BZ2_bzWriteFinish} are available.
9219 -
9220 -As with the low-level library, no global variables are used
9221 -so the library is per se thread-safe.  However, if I/O errors
9222 -occur whilst reading or writing the underlying compressed files,
9223 -you may have to consult @code{errno} to determine the cause of
9224 -the error.  In that case, you'd need a C library which correctly
9225 -supports @code{errno} in a multithreaded environment.
9226 -
9227 -To make the library a little simpler and more portable,
9228 -@code{BZ2_bzReadOpen} and @code{BZ2_bzWriteOpen} require you to pass them file
9229 -handles (@code{FILE*}s) which have previously been opened for reading or
9230 -writing respectively.  That avoids portability problems associated with
9231 -file operations and file attributes, whilst not being much of an
9232 -imposition on the programmer.
9233 -
9234 -
9235 -
9236 -@subsection Utility functions summary
9237 -For very simple needs, @code{BZ2_bzBuffToBuffCompress} and
9238 -@code{BZ2_bzBuffToBuffDecompress} are provided.  These compress
9239 -data in memory from one buffer to another buffer in a single
9240 -function call.  You should assess whether these functions
9241 -fulfill your memory-to-memory compression/decompression
9242 -requirements before investing effort in understanding the more
9243 -general but more complex low-level interface.
9244 -
9245 -Yoshioka Tsuneo (@code{QWF00133@@niftyserve.or.jp} /
9246 -@code{tsuneo-y@@is.aist-nara.ac.jp}) has contributed some functions to
9247 -give better @code{zlib} compatibility.  These functions are
9248 -@code{BZ2_bzopen}, @code{BZ2_bzread}, @code{BZ2_bzwrite}, @code{BZ2_bzflush},
9249 -@code{BZ2_bzclose},
9250 -@code{BZ2_bzerror} and @code{BZ2_bzlibVersion}.  You may find these functions
9251 -more convenient for simple file reading and writing, than those in the
9252 -high-level interface.  These functions are not (yet) officially part of
9253 -the library, and are minimally documented here.  If they break, you
9254 -get to keep all the pieces.  I hope to document them properly when time
9255 -permits.
9256 -
9257 -Yoshioka also contributed modifications to allow the library to be
9258 -built as a Windows DLL.
9259 -
9260 -
9261 -@section Error handling
9262 -
9263 -The library is designed to recover cleanly in all situations, including
9264 -the worst-case situation of decompressing random data.  I'm not 
9265 -100% sure that it can always do this, so you might want to add
9266 -a signal handler to catch segmentation violations during decompression
9267 -if you are feeling especially paranoid.  I would be interested in
9268 -hearing more about the robustness of the library to corrupted
9269 -compressed data.
9270 -
9271 -Version 1.0 is much more robust in this respect than
9272 -0.9.0 or 0.9.5.  Investigations with Checker (a tool for 
9273 -detecting problems with memory management, similar to Purify)
9274 -indicate that, at least for the few files I tested, all single-bit
9275 -errors in the decompressed data are caught properly, with no
9276 -segmentation faults, no reads of uninitialised data and no 
9277 -out of range reads or writes.  So it's certainly much improved,
9278 -although I wouldn't claim it to be totally bombproof.
9279 -
9280 -The file @code{bzlib.h} contains all definitions needed to use
9281 -the library.  In particular, you should definitely not include
9282 -@code{bzlib_private.h}.
9283 -
9284 -In @code{bzlib.h}, the various return values are defined.  The following
9285 -list is not intended as an exhaustive description of the circumstances 
9286 -in which a given value may be returned -- those descriptions are given
9287 -later.  Rather, it is intended to convey the rough meaning of each
9288 -return value.  The first five actions are normal and not intended to 
9289 -denote an error situation.
9290 -@table @code
9291 -@item BZ_OK
9292 -The requested action was completed successfully.
9293 -@item BZ_RUN_OK
9294 -@itemx BZ_FLUSH_OK
9295 -@itemx BZ_FINISH_OK
9296 -In @code{BZ2_bzCompress}, the requested flush/finish/nothing-special action
9297 -was completed successfully.
9298 -@item BZ_STREAM_END
9299 -Compression of data was completed, or the logical stream end was
9300 -detected during decompression.
9301 -@end table
9302 -
9303 -The following return values indicate an error of some kind.
9304 -@table @code
9305 -@item BZ_CONFIG_ERROR
9306 -Indicates that the library has been improperly compiled on your
9307 -platform -- a major configuration error.  Specifically, it means
9308 -that @code{sizeof(char)}, @code{sizeof(short)} and @code{sizeof(int)}
9309 -are not 1, 2 and 4 respectively, as they should be.  Note that the 
9310 -library should still work properly on 64-bit platforms which follow
9311 -the LP64 programming model -- that is, where @code{sizeof(long)}
9312 -and @code{sizeof(void*)} are 8.  Under LP64, @code{sizeof(int)} is
9313 -still 4, so @code{libbzip2}, which doesn't use the @code{long} type,
9314 -is OK.
9315 -@item BZ_SEQUENCE_ERROR
9316 -When using the library, it is important to call the functions in the
9317 -correct sequence and with data structures (buffers etc) in the correct
9318 -states.  @code{libbzip2} checks as much as it can to ensure this is
9319 -happening, and returns @code{BZ_SEQUENCE_ERROR} if not.  Code which
9320 -complies precisely with the function semantics, as detailed below,
9321 -should never receive this value; such an event denotes buggy code
9322 -which you should investigate.
9323 -@item BZ_PARAM_ERROR
9324 -Returned when a parameter to a function call is out of range 
9325 -or otherwise manifestly incorrect.  As with @code{BZ_SEQUENCE_ERROR},
9326 -this denotes a bug in the client code.  The distinction between
9327 -@code{BZ_PARAM_ERROR} and @code{BZ_SEQUENCE_ERROR} is a bit hazy, but still worth
9328 -making.
9329 -@item BZ_MEM_ERROR
9330 -Returned when a request to allocate memory failed.  Note that the
9331 -quantity of memory needed to decompress a stream cannot be determined
9332 -until the stream's header has been read.  So @code{BZ2_bzDecompress} and
9333 -@code{BZ2_bzRead} may return @code{BZ_MEM_ERROR} even though some of
9334 -the compressed data has been read.  The same is not true for
9335 -compression; once @code{BZ2_bzCompressInit} or @code{BZ2_bzWriteOpen} have
9336 -successfully completed, @code{BZ_MEM_ERROR} cannot occur.
9337 -@item BZ_DATA_ERROR
9338 -Returned when a data integrity error is detected during decompression.
9339 -Most importantly, this means when stored and computed CRCs for the
9340 -data do not match.  This value is also returned upon detection of any
9341 -other anomaly in the compressed data.
9342 -@item BZ_DATA_ERROR_MAGIC
9343 -As a special case of @code{BZ_DATA_ERROR}, it is sometimes useful to
9344 -know when the compressed stream does not start with the correct
9345 -magic bytes (@code{'B' 'Z' 'h'}).  
9346 -@item BZ_IO_ERROR
9347 -Returned by @code{BZ2_bzRead} and @code{BZ2_bzWrite} when there is an error
9348 -reading or writing in the compressed file, and by @code{BZ2_bzReadOpen}
9349 -and @code{BZ2_bzWriteOpen} for attempts to use a file for which the
9350 -error indicator (viz, @code{ferror(f)}) is set.
9351 -On receipt of @code{BZ_IO_ERROR}, the caller should consult
9352 -@code{errno} and/or @code{perror} to acquire operating-system
9353 -specific information about the problem.
9354 -@item BZ_UNEXPECTED_EOF
9355 -Returned by @code{BZ2_bzRead} when the compressed file finishes
9356 -before the logical end of stream is detected.
9357 -@item BZ_OUTBUFF_FULL
9358 -Returned by @code{BZ2_bzBuffToBuffCompress} and
9359 -@code{BZ2_bzBuffToBuffDecompress} to indicate that the output data
9360 -will not fit into the output buffer provided.
9361 -@end table
9362 -
9363 -
9364 -
9365 -@section Low-level interface
9366 -
9367 -@subsection @code{BZ2_bzCompressInit}
9368 -@example
9369 -typedef 
9370 -   struct @{
9371 -      char *next_in;
9372 -      unsigned int avail_in;
9373 -      unsigned int total_in_lo32;
9374 -      unsigned int total_in_hi32;
9375 -
9376 -      char *next_out;
9377 -      unsigned int avail_out;
9378 -      unsigned int total_out_lo32;
9379 -      unsigned int total_out_hi32;
9380 -
9381 -      void *state;
9382 -
9383 -      void *(*bzalloc)(void *,int,int);
9384 -      void (*bzfree)(void *,void *);
9385 -      void *opaque;
9386 -   @} 
9387 -   bz_stream;
9388 -
9389 -int BZ2_bzCompressInit ( bz_stream *strm, 
9390 -                         int blockSize100k, 
9391 -                         int verbosity,
9392 -                         int workFactor );
9393 -
9394 -@end example
9395 -
9396 -Prepares for compression.  The @code{bz_stream} structure
9397 -holds all data pertaining to the compression activity.  
9398 -A @code{bz_stream} structure should be allocated and initialised
9399 -prior to the call.
9400 -The fields of @code{bz_stream}
9401 -comprise the entirety of the user-visible data.  @code{state}
9402 -is a pointer to the private data structures required for compression.
9403 -
9404 -Custom memory allocators are supported, via fields @code{bzalloc}, 
9405 -@code{bzfree},
9406 -and @code{opaque}.  The value 
9407 -@code{opaque} is passed to as the first argument to
9408 -all calls to @code{bzalloc} and @code{bzfree}, but is 
9409 -otherwise ignored by the library.
9410 -The call @code{bzalloc ( opaque, n, m )} is expected to return a 
9411 -pointer @code{p} to
9412 -@code{n * m} bytes of memory, and @code{bzfree ( opaque, p )} 
9413 -should free
9414 -that memory.
9415 -
9416 -If you don't want to use a custom memory allocator, set @code{bzalloc}, 
9417 -@code{bzfree} and
9418 -@code{opaque} to @code{NULL}, 
9419 -and the library will then use the standard @code{malloc}/@code{free}
9420 -routines.
9421 -
9422 -Before calling @code{BZ2_bzCompressInit}, fields @code{bzalloc}, 
9423 -@code{bzfree} and @code{opaque} should
9424 -be filled appropriately, as just described.  Upon return, the internal
9425 -state will have been allocated and initialised, and @code{total_in_lo32}, 
9426 -@code{total_in_hi32}, @code{total_out_lo32} and 
9427 -@code{total_out_hi32} will have been set to zero.  
9428 -These four fields are used by the library
9429 -to inform the caller of the total amount of data passed into and out of
9430 -the library, respectively.  You should not try to change them.
9431 -As of version 1.0, 64-bit counts are maintained, even on 32-bit
9432 -platforms, using the @code{_hi32} fields to store the upper 32 bits
9433 -of the count.  So, for example, the total amount of data in
9434 -is @code{(total_in_hi32 << 32) + total_in_lo32}.
9435 -
9436 -Parameter @code{blockSize100k} specifies the block size to be used for
9437 -compression.  It should be a value between 1 and 9 inclusive, and the
9438 -actual block size used is 100000 x this figure.  9 gives the best
9439 -compression but takes most memory.
9440 -
9441 -Parameter @code{verbosity} should be set to a number between 0 and 4
9442 -inclusive.  0 is silent, and greater numbers give increasingly verbose
9443 -monitoring/debugging output.  If the library has been compiled with
9444 -@code{-DBZ_NO_STDIO}, no such output will appear for any verbosity
9445 -setting.
9446 -
9447 -Parameter @code{workFactor} controls how the compression phase behaves
9448 -when presented with worst case, highly repetitive, input data.  If
9449 -compression runs into difficulties caused by repetitive data, the
9450 -library switches from the standard sorting algorithm to a fallback
9451 -algorithm.  The fallback is slower than the standard algorithm by
9452 -perhaps a factor of three, but always behaves reasonably, no matter how
9453 -bad the input.
9454 -
9455 -Lower values of @code{workFactor} reduce the amount of effort the
9456 -standard algorithm will expend before resorting to the fallback.  You
9457 -should set this parameter carefully; too low, and many inputs will be
9458 -handled by the fallback algorithm and so compress rather slowly, too
9459 -high, and your average-to-worst case compression times can become very
9460 -large.  The default value of 30 gives reasonable behaviour over a wide
9461 -range of circumstances.
9462 -
9463 -Allowable values range from 0 to 250 inclusive.  0 is a special case,
9464 -equivalent to using the default value of 30.
9465 -
9466 -Note that the compressed output generated is the same regardless of
9467 -whether or not the fallback algorithm is used.
9468 -
9469 -Be aware also that this parameter may disappear entirely in future
9470 -versions of the library.  In principle it should be possible to devise a
9471 -good way to automatically choose which algorithm to use.  Such a
9472 -mechanism would render the parameter obsolete.
9473 -
9474 -Possible return values:
9475 -@display
9476 -      @code{BZ_CONFIG_ERROR}
9477 -         if the library has been mis-compiled
9478 -      @code{BZ_PARAM_ERROR} 
9479 -         if @code{strm} is @code{NULL} 
9480 -         or @code{blockSize} < 1 or @code{blockSize} > 9
9481 -         or @code{verbosity} < 0 or @code{verbosity} > 4
9482 -         or @code{workFactor} < 0 or @code{workFactor} > 250
9483 -      @code{BZ_MEM_ERROR} 
9484 -         if not enough memory is available
9485 -      @code{BZ_OK} 
9486 -         otherwise
9487 -@end display
9488 -Allowable next actions:
9489 -@display
9490 -      @code{BZ2_bzCompress} 
9491 -         if @code{BZ_OK} is returned
9492 -      no specific action needed in case of error
9493 -@end display
9494 -
9495 -@subsection @code{BZ2_bzCompress}
9496 -@example
9497 -   int BZ2_bzCompress ( bz_stream *strm, int action );
9498 -@end example
9499 -Provides more input and/or output buffer space for the library.  The
9500 -caller maintains input and output buffers, and calls @code{BZ2_bzCompress} to
9501 -transfer data between them.
9502 -
9503 -Before each call to @code{BZ2_bzCompress}, @code{next_in} should point at
9504 -the data to be compressed, and @code{avail_in} should indicate how many
9505 -bytes the library may read.  @code{BZ2_bzCompress} updates @code{next_in},
9506 -@code{avail_in} and @code{total_in} to reflect the number of bytes it
9507 -has read.
9508 -
9509 -Similarly, @code{next_out} should point to a buffer in which the
9510 -compressed data is to be placed, with @code{avail_out} indicating how
9511 -much output space is available.  @code{BZ2_bzCompress} updates
9512 -@code{next_out}, @code{avail_out} and @code{total_out} to reflect the
9513 -number of bytes output.
9514 -
9515 -You may provide and remove as little or as much data as you like on each
9516 -call of @code{BZ2_bzCompress}.  In the limit, it is acceptable to supply and
9517 -remove data one byte at a time, although this would be terribly
9518 -inefficient.  You should always ensure that at least one byte of output
9519 -space is available at each call.
9520 -
9521 -A second purpose of @code{BZ2_bzCompress} is to request a change of mode of the
9522 -compressed stream.  
9523 -
9524 -Conceptually, a compressed stream can be in one of four states: IDLE,
9525 -RUNNING, FLUSHING and FINISHING.  Before initialisation
9526 -(@code{BZ2_bzCompressInit}) and after termination (@code{BZ2_bzCompressEnd}), a
9527 -stream is regarded as IDLE.
9528 -
9529 -Upon initialisation (@code{BZ2_bzCompressInit}), the stream is placed in the
9530 -RUNNING state.  Subsequent calls to @code{BZ2_bzCompress} should pass
9531 -@code{BZ_RUN} as the requested action; other actions are illegal and
9532 -will result in @code{BZ_SEQUENCE_ERROR}.
9533 -
9534 -At some point, the calling program will have provided all the input data
9535 -it wants to.  It will then want to finish up -- in effect, asking the
9536 -library to process any data it might have buffered internally.  In this
9537 -state, @code{BZ2_bzCompress} will no longer attempt to read data from
9538 -@code{next_in}, but it will want to write data to @code{next_out}.
9539 -Because the output buffer supplied by the user can be arbitrarily small,
9540 -the finishing-up operation cannot necessarily be done with a single call
9541 -of @code{BZ2_bzCompress}.
9542 -
9543 -Instead, the calling program passes @code{BZ_FINISH} as an action to
9544 -@code{BZ2_bzCompress}.  This changes the stream's state to FINISHING.  Any
9545 -remaining input (ie, @code{next_in[0 .. avail_in-1]}) is compressed and
9546 -transferred to the output buffer.  To do this, @code{BZ2_bzCompress} must be
9547 -called repeatedly until all the output has been consumed.  At that
9548 -point, @code{BZ2_bzCompress} returns @code{BZ_STREAM_END}, and the stream's
9549 -state is set back to IDLE.  @code{BZ2_bzCompressEnd} should then be
9550 -called.
9551 -
9552 -Just to make sure the calling program does not cheat, the library makes
9553 -a note of @code{avail_in} at the time of the first call to
9554 -@code{BZ2_bzCompress} which has @code{BZ_FINISH} as an action (ie, at the
9555 -time the program has announced its intention to not supply any more
9556 -input).  By comparing this value with that of @code{avail_in} over
9557 -subsequent calls to @code{BZ2_bzCompress}, the library can detect any
9558 -attempts to slip in more data to compress.  Any calls for which this is
9559 -detected will return @code{BZ_SEQUENCE_ERROR}.  This indicates a
9560 -programming mistake which should be corrected.
9561 -
9562 -Instead of asking to finish, the calling program may ask
9563 -@code{BZ2_bzCompress} to take all the remaining input, compress it and
9564 -terminate the current (Burrows-Wheeler) compression block.  This could
9565 -be useful for error control purposes.  The mechanism is analogous to
9566 -that for finishing: call @code{BZ2_bzCompress} with an action of
9567 -@code{BZ_FLUSH}, remove output data, and persist with the
9568 -@code{BZ_FLUSH} action until the value @code{BZ_RUN} is returned.  As
9569 -with finishing, @code{BZ2_bzCompress} detects any attempt to provide more
9570 -input data once the flush has begun.
9571 -
9572 -Once the flush is complete, the stream returns to the normal RUNNING
9573 -state.
9574 -
9575 -This all sounds pretty complex, but isn't really.  Here's a table
9576 -which shows which actions are allowable in each state, what action
9577 -will be taken, what the next state is, and what the non-error return
9578 -values are.  Note that you can't explicitly ask what state the
9579 -stream is in, but nor do you need to -- it can be inferred from the
9580 -values returned by @code{BZ2_bzCompress}.
9581 -@display
9582 -IDLE/@code{any}           
9583 -      Illegal.  IDLE state only exists after @code{BZ2_bzCompressEnd} or
9584 -      before @code{BZ2_bzCompressInit}.
9585 -      Return value = @code{BZ_SEQUENCE_ERROR}
9586 -
9587 -RUNNING/@code{BZ_RUN}     
9588 -      Compress from @code{next_in} to @code{next_out} as much as possible.
9589 -      Next state = RUNNING
9590 -      Return value = @code{BZ_RUN_OK}
9591 -
9592 -RUNNING/@code{BZ_FLUSH}   
9593 -      Remember current value of @code{next_in}.  Compress from @code{next_in}
9594 -      to @code{next_out} as much as possible, but do not accept any more input.  
9595 -      Next state = FLUSHING
9596 -      Return value = @code{BZ_FLUSH_OK}
9597 -
9598 -RUNNING/@code{BZ_FINISH}  
9599 -      Remember current value of @code{next_in}.  Compress from @code{next_in}
9600 -      to @code{next_out} as much as possible, but do not accept any more input.
9601 -      Next state = FINISHING
9602 -      Return value = @code{BZ_FINISH_OK}
9603 -
9604 -FLUSHING/@code{BZ_FLUSH}  
9605 -      Compress from @code{next_in} to @code{next_out} as much as possible, 
9606 -      but do not accept any more input.  
9607 -      If all the existing input has been used up and all compressed
9608 -      output has been removed
9609 -         Next state = RUNNING; Return value = @code{BZ_RUN_OK}
9610 -      else
9611 -         Next state = FLUSHING; Return value = @code{BZ_FLUSH_OK}
9612 -
9613 -FLUSHING/other     
9614 -      Illegal.
9615 -      Return value = @code{BZ_SEQUENCE_ERROR}
9616 -
9617 -FINISHING/@code{BZ_FINISH}  
9618 -      Compress from @code{next_in} to @code{next_out} as much as possible,
9619 -      but to not accept any more input.  
9620 -      If all the existing input has been used up and all compressed
9621 -      output has been removed
9622 -         Next state = IDLE; Return value = @code{BZ_STREAM_END}
9623 -      else
9624 -         Next state = FINISHING; Return value = @code{BZ_FINISHING}
9625 -
9626 -FINISHING/other
9627 -      Illegal.
9628 -      Return value = @code{BZ_SEQUENCE_ERROR}
9629 -@end display
9630 -
9631 -That still looks complicated?  Well, fair enough.  The usual sequence
9632 -of calls for compressing a load of data is:
9633 -@itemize @bullet
9634 -@item Get started with @code{BZ2_bzCompressInit}.
9635 -@item Shovel data in and shlurp out its compressed form using zero or more
9636 -calls of @code{BZ2_bzCompress} with action = @code{BZ_RUN}.
9637 -@item Finish up.  
9638 -Repeatedly call @code{BZ2_bzCompress} with action = @code{BZ_FINISH}, 
9639 -copying out the compressed output, until @code{BZ_STREAM_END} is returned.
9640 -@item Close up and go home.  Call @code{BZ2_bzCompressEnd}.
9641 -@end itemize
9642 -If the data you want to compress fits into your input buffer all
9643 -at once, you can skip the calls of @code{BZ2_bzCompress ( ..., BZ_RUN )} and 
9644 -just do the @code{BZ2_bzCompress ( ..., BZ_FINISH )} calls.
9645 -
9646 -All required memory is allocated by @code{BZ2_bzCompressInit}.  The
9647 -compression library can accept any data at all (obviously).  So you
9648 -shouldn't get any error return values from the @code{BZ2_bzCompress} calls.
9649 -If you do, they will be @code{BZ_SEQUENCE_ERROR}, and indicate a bug in
9650 -your programming.
9651 -
9652 -Trivial other possible return values:
9653 -@display
9654 -      @code{BZ_PARAM_ERROR}   
9655 -         if @code{strm} is @code{NULL}, or @code{strm->s} is @code{NULL}
9656 -@end display
9657 -
9658 -@subsection @code{BZ2_bzCompressEnd}
9659 -@example
9660 -int BZ2_bzCompressEnd ( bz_stream *strm );
9661 -@end example
9662 -Releases all memory associated with a compression stream.
9663 -
9664 -Possible return values:
9665 -@display
9666 -   @code{BZ_PARAM_ERROR}    if @code{strm} is @code{NULL} or @code{strm->s} is @code{NULL}
9667 -   @code{BZ_OK}    otherwise
9668 -@end display
9669 -
9670 -
9671 -@subsection @code{BZ2_bzDecompressInit}
9672 -@example
9673 -int BZ2_bzDecompressInit ( bz_stream *strm, int verbosity, int small );
9674 -@end example
9675 -Prepares for decompression.  As with @code{BZ2_bzCompressInit}, a
9676 -@code{bz_stream} record should be allocated and initialised before the
9677 -call.  Fields @code{bzalloc}, @code{bzfree} and @code{opaque} should be
9678 -set if a custom memory allocator is required, or made @code{NULL} for
9679 -the normal @code{malloc}/@code{free} routines.  Upon return, the internal
9680 -state will have been initialised, and @code{total_in} and
9681 -@code{total_out} will be zero.
9682 -
9683 -For the meaning of parameter @code{verbosity}, see @code{BZ2_bzCompressInit}.
9684 -
9685 -If @code{small} is nonzero, the library will use an alternative
9686 -decompression algorithm which uses less memory but at the cost of
9687 -decompressing more slowly (roughly speaking, half the speed, but the
9688 -maximum memory requirement drops to around 2300k).  See Chapter 2 for
9689 -more information on memory management.
9690 -
9691 -Note that the amount of memory needed to decompress
9692 -a stream cannot be determined until the stream's header has been read,
9693 -so even if @code{BZ2_bzDecompressInit} succeeds, a subsequent
9694 -@code{BZ2_bzDecompress} could fail with @code{BZ_MEM_ERROR}.
9695 -
9696 -Possible return values:
9697 -@display
9698 -      @code{BZ_CONFIG_ERROR}
9699 -         if the library has been mis-compiled
9700 -      @code{BZ_PARAM_ERROR}
9701 -         if @code{(small != 0 && small != 1)}
9702 -         or @code{(verbosity < 0 || verbosity > 4)}
9703 -      @code{BZ_MEM_ERROR}
9704 -         if insufficient memory is available
9705 -@end display
9706 -
9707 -Allowable next actions:
9708 -@display
9709 -      @code{BZ2_bzDecompress}
9710 -         if @code{BZ_OK} was returned
9711 -      no specific action required in case of error
9712 -@end display
9713 -
9714
9715 -
9716 -@subsection @code{BZ2_bzDecompress}
9717 -@example
9718 -int BZ2_bzDecompress ( bz_stream *strm );
9719 -@end example
9720 -Provides more input and/out output buffer space for the library.  The
9721 -caller maintains input and output buffers, and uses @code{BZ2_bzDecompress}
9722 -to transfer data between them.
9723 -
9724 -Before each call to @code{BZ2_bzDecompress}, @code{next_in} 
9725 -should point at the compressed data,
9726 -and @code{avail_in} should indicate how many bytes the library
9727 -may read.  @code{BZ2_bzDecompress} updates @code{next_in}, @code{avail_in} 
9728 -and @code{total_in}
9729 -to reflect the number of bytes it has read.
9730 -
9731 -Similarly, @code{next_out} should point to a buffer in which the uncompressed
9732 -output is to be placed, with @code{avail_out} indicating how much output space
9733 -is available.  @code{BZ2_bzCompress} updates @code{next_out},
9734 -@code{avail_out} and @code{total_out} to reflect
9735 -the number of bytes output.
9736 -
9737 -You may provide and remove as little or as much data as you like on
9738 -each call of @code{BZ2_bzDecompress}.  
9739 -In the limit, it is acceptable to
9740 -supply and remove data one byte at a time, although this would be
9741 -terribly inefficient.  You should always ensure that at least one
9742 -byte of output space is available at each call.
9743 -
9744 -Use of @code{BZ2_bzDecompress} is simpler than @code{BZ2_bzCompress}.
9745 -
9746 -You should provide input and remove output as described above, and
9747 -repeatedly call @code{BZ2_bzDecompress} until @code{BZ_STREAM_END} is
9748 -returned.  Appearance of @code{BZ_STREAM_END} denotes that
9749 -@code{BZ2_bzDecompress} has detected the logical end of the compressed
9750 -stream.  @code{BZ2_bzDecompress} will not produce @code{BZ_STREAM_END} until
9751 -all output data has been placed into the output buffer, so once
9752 -@code{BZ_STREAM_END} appears, you are guaranteed to have available all
9753 -the decompressed output, and @code{BZ2_bzDecompressEnd} can safely be
9754 -called.
9755 -
9756 -If case of an error return value, you should call @code{BZ2_bzDecompressEnd}
9757 -to clean up and release memory.
9758 -
9759 -Possible return values:
9760 -@display
9761 -      @code{BZ_PARAM_ERROR}
9762 -         if @code{strm} is @code{NULL} or @code{strm->s} is @code{NULL}
9763 -         or @code{strm->avail_out < 1}
9764 -      @code{BZ_DATA_ERROR}
9765 -         if a data integrity error is detected in the compressed stream
9766 -      @code{BZ_DATA_ERROR_MAGIC}
9767 -         if the compressed stream doesn't begin with the right magic bytes
9768 -      @code{BZ_MEM_ERROR}
9769 -         if there wasn't enough memory available
9770 -      @code{BZ_STREAM_END}
9771 -         if the logical end of the data stream was detected and all
9772 -         output in has been consumed, eg @code{s->avail_out > 0}
9773 -      @code{BZ_OK}
9774 -         otherwise
9775 -@end display
9776 -Allowable next actions:
9777 -@display
9778 -      @code{BZ2_bzDecompress}
9779 -         if @code{BZ_OK} was returned
9780 -      @code{BZ2_bzDecompressEnd}
9781 -         otherwise
9782 -@end display
9783 -
9784 -
9785 -@subsection @code{BZ2_bzDecompressEnd}
9786 -@example
9787 -int BZ2_bzDecompressEnd ( bz_stream *strm );
9788 -@end example
9789 -Releases all memory associated with a decompression stream.
9790 -
9791 -Possible return values:
9792 -@display
9793 -      @code{BZ_PARAM_ERROR}
9794 -         if @code{strm} is @code{NULL} or @code{strm->s} is @code{NULL}
9795 -      @code{BZ_OK}
9796 -         otherwise
9797 -@end display
9798 -
9799 -Allowable next actions:
9800 -@display
9801 -      None.
9802 -@end display
9803 -
9804 -
9805 -@section High-level interface
9806 -
9807 -This interface provides functions for reading and writing 
9808 -@code{bzip2} format files.  First, some general points.
9809 -
9810 -@itemize @bullet
9811 -@item All of the functions take an @code{int*} first argument,
9812 -  @code{bzerror}.
9813 -  After each call, @code{bzerror} should be consulted first to determine
9814 -  the outcome of the call.  If @code{bzerror} is @code{BZ_OK}, 
9815 -  the call completed
9816 -  successfully, and only then should the return value of the function
9817 -  (if any) be consulted.  If @code{bzerror} is @code{BZ_IO_ERROR}, 
9818 -  there was an error
9819 -  reading/writing the underlying compressed file, and you should
9820 -  then consult @code{errno}/@code{perror} to determine the 
9821 -  cause of the difficulty.
9822 -  @code{bzerror} may also be set to various other values; precise details are
9823 -  given on a per-function basis below.
9824 -@item If @code{bzerror} indicates an error 
9825 -  (ie, anything except @code{BZ_OK} and @code{BZ_STREAM_END}),
9826 -  you should immediately call @code{BZ2_bzReadClose} (or @code{BZ2_bzWriteClose},
9827 -  depending on whether you are attempting to read or to write)
9828 -  to free up all resources associated
9829 -  with the stream.  Once an error has been indicated, behaviour of all calls
9830 -  except @code{BZ2_bzReadClose} (@code{BZ2_bzWriteClose}) is undefined.  
9831 -  The implication is that (1) @code{bzerror} should
9832 -  be checked after each call, and (2) if @code{bzerror} indicates an error, 
9833 -  @code{BZ2_bzReadClose} (@code{BZ2_bzWriteClose}) should then be called to clean up.
9834 -@item The @code{FILE*} arguments passed to
9835 -   @code{BZ2_bzReadOpen}/@code{BZ2_bzWriteOpen}  
9836 -  should be set to binary mode.
9837 -  Most Unix systems will do this by default, but other platforms,
9838 -  including Windows and Mac, will not.  If you omit this, you may
9839 -  encounter problems when moving code to new platforms.
9840 -@item Memory allocation requests are handled by
9841 -  @code{malloc}/@code{free}.  
9842 -  At present
9843 -  there is no facility for user-defined memory allocators in the file I/O
9844 -  functions (could easily be added, though).
9845 -@end itemize
9846 -
9847 -
9848 -
9849 -@subsection @code{BZ2_bzReadOpen}
9850 -@example
9851 -   typedef void BZFILE;
9852 -
9853 -   BZFILE *BZ2_bzReadOpen ( int *bzerror, FILE *f, 
9854 -                            int small, int verbosity,
9855 -                            void *unused, int nUnused );
9856 -@end example
9857 -Prepare to read compressed data from file handle @code{f}.  @code{f}
9858 -should refer to a file which has been opened for reading, and for which
9859 -the error indicator (@code{ferror(f)})is not set.  If @code{small} is 1,
9860 -the library will try to decompress using less memory, at the expense of
9861 -speed.
9862 -
9863 -For reasons explained below, @code{BZ2_bzRead} will decompress the
9864 -@code{nUnused} bytes starting at @code{unused}, before starting to read
9865 -from the file @code{f}.  At most @code{BZ_MAX_UNUSED} bytes may be
9866 -supplied like this.  If this facility is not required, you should pass
9867 -@code{NULL} and @code{0} for @code{unused} and n@code{Unused}
9868 -respectively.
9869 -
9870 -For the meaning of parameters @code{small} and @code{verbosity},
9871 -see @code{BZ2_bzDecompressInit}.
9872 -
9873 -The amount of memory needed to decompress a file cannot be determined
9874 -until the file's header has been read.  So it is possible that
9875 -@code{BZ2_bzReadOpen} returns @code{BZ_OK} but a subsequent call of
9876 -@code{BZ2_bzRead} will return @code{BZ_MEM_ERROR}.
9877 -
9878 -Possible assignments to @code{bzerror}:
9879 -@display
9880 -      @code{BZ_CONFIG_ERROR}
9881 -         if the library has been mis-compiled
9882 -      @code{BZ_PARAM_ERROR}
9883 -         if @code{f} is @code{NULL} 
9884 -         or @code{small} is neither @code{0} nor @code{1}                 
9885 -         or @code{(unused == NULL && nUnused != 0)}
9886 -         or @code{(unused != NULL && !(0 <= nUnused <= BZ_MAX_UNUSED))}
9887 -      @code{BZ_IO_ERROR}    
9888 -         if @code{ferror(f)} is nonzero
9889 -      @code{BZ_MEM_ERROR}   
9890 -         if insufficient memory is available
9891 -      @code{BZ_OK}
9892 -         otherwise.
9893 -@end display
9894 -
9895 -Possible return values:
9896 -@display
9897 -      Pointer to an abstract @code{BZFILE}        
9898 -         if @code{bzerror} is @code{BZ_OK}   
9899 -      @code{NULL}
9900 -         otherwise
9901 -@end display
9902 -
9903 -Allowable next actions:
9904 -@display
9905 -      @code{BZ2_bzRead}
9906 -         if @code{bzerror} is @code{BZ_OK}   
9907 -      @code{BZ2_bzClose} 
9908 -         otherwise
9909 -@end display
9910 -
9911 -
9912 -@subsection @code{BZ2_bzRead}
9913 -@example
9914 -   int BZ2_bzRead ( int *bzerror, BZFILE *b, void *buf, int len );
9915 -@end example
9916 -Reads up to @code{len} (uncompressed) bytes from the compressed file 
9917 -@code{b} into
9918 -the buffer @code{buf}.  If the read was successful, 
9919 -@code{bzerror} is set to @code{BZ_OK}
9920 -and the number of bytes read is returned.  If the logical end-of-stream
9921 -was detected, @code{bzerror} will be set to @code{BZ_STREAM_END}, 
9922 -and the number
9923 -of bytes read is returned.  All other @code{bzerror} values denote an error.
9924 -
9925 -@code{BZ2_bzRead} will supply @code{len} bytes,
9926 -unless the logical stream end is detected
9927 -or an error occurs.  Because of this, it is possible to detect the 
9928 -stream end by observing when the number of bytes returned is 
9929 -less than the number
9930 -requested.  Nevertheless, this is regarded as inadvisable; you should
9931 -instead check @code{bzerror} after every call and watch out for
9932 -@code{BZ_STREAM_END}.
9933 -
9934 -Internally, @code{BZ2_bzRead} copies data from the compressed file in chunks
9935 -of size @code{BZ_MAX_UNUSED} bytes
9936 -before decompressing it.  If the file contains more bytes than strictly
9937 -needed to reach the logical end-of-stream, @code{BZ2_bzRead} will almost certainly
9938 -read some of the trailing data before signalling @code{BZ_SEQUENCE_END}.
9939 -To collect the read but unused data once @code{BZ_SEQUENCE_END} has 
9940 -appeared, call @code{BZ2_bzReadGetUnused} immediately before @code{BZ2_bzReadClose}.
9941 -
9942 -Possible assignments to @code{bzerror}:
9943 -@display
9944 -      @code{BZ_PARAM_ERROR}
9945 -         if @code{b} is @code{NULL} or @code{buf} is @code{NULL} or @code{len < 0}
9946 -      @code{BZ_SEQUENCE_ERROR} 
9947 -         if @code{b} was opened with @code{BZ2_bzWriteOpen}
9948 -      @code{BZ_IO_ERROR} 
9949 -         if there is an error reading from the compressed file
9950 -      @code{BZ_UNEXPECTED_EOF} 
9951 -         if the compressed file ended before the logical end-of-stream was detected
9952 -      @code{BZ_DATA_ERROR} 
9953 -         if a data integrity error was detected in the compressed stream
9954 -      @code{BZ_DATA_ERROR_MAGIC}
9955 -         if the stream does not begin with the requisite header bytes (ie, is not 
9956 -         a @code{bzip2} data file).  This is really a special case of @code{BZ_DATA_ERROR}.
9957 -      @code{BZ_MEM_ERROR} 
9958 -         if insufficient memory was available
9959 -      @code{BZ_STREAM_END} 
9960 -         if the logical end of stream was detected.
9961 -      @code{BZ_OK}
9962 -         otherwise.
9963 -@end display
9964 -
9965 -Possible return values:
9966 -@display
9967 -      number of bytes read
9968 -         if @code{bzerror} is @code{BZ_OK} or @code{BZ_STREAM_END}
9969 -      undefined
9970 -         otherwise
9971 -@end display
9972 -
9973 -Allowable next actions:
9974 -@display
9975 -      collect data from @code{buf}, then @code{BZ2_bzRead} or @code{BZ2_bzReadClose}
9976 -         if @code{bzerror} is @code{BZ_OK} 
9977 -      collect data from @code{buf}, then @code{BZ2_bzReadClose} or @code{BZ2_bzReadGetUnused} 
9978 -         if @code{bzerror} is @code{BZ_SEQUENCE_END}   
9979 -      @code{BZ2_bzReadClose} 
9980 -         otherwise
9981 -@end display
9982 -
9983 -
9984 -
9985 -@subsection @code{BZ2_bzReadGetUnused}
9986 -@example
9987 -   void BZ2_bzReadGetUnused ( int* bzerror, BZFILE *b, 
9988 -                              void** unused, int* nUnused );
9989 -@end example
9990 -Returns data which was read from the compressed file but was not needed
9991 -to get to the logical end-of-stream.  @code{*unused} is set to the address
9992 -of the data, and @code{*nUnused} to the number of bytes.  @code{*nUnused} will
9993 -be set to a value between @code{0} and @code{BZ_MAX_UNUSED} inclusive.
9994 -
9995 -This function may only be called once @code{BZ2_bzRead} has signalled 
9996 -@code{BZ_STREAM_END} but before @code{BZ2_bzReadClose}.
9997 -
9998 -Possible assignments to @code{bzerror}:
9999 -@display
10000 -      @code{BZ_PARAM_ERROR} 
10001 -         if @code{b} is @code{NULL} 
10002 -         or @code{unused} is @code{NULL} or @code{nUnused} is @code{NULL}
10003 -      @code{BZ_SEQUENCE_ERROR} 
10004 -         if @code{BZ_STREAM_END} has not been signalled
10005 -         or if @code{b} was opened with @code{BZ2_bzWriteOpen}
10006 -     @code{BZ_OK}
10007 -         otherwise
10008 -@end display
10009 -
10010 -Allowable next actions:
10011 -@display 
10012 -      @code{BZ2_bzReadClose}
10013 -@end display
10014 -
10015 -
10016 -@subsection @code{BZ2_bzReadClose}
10017 -@example
10018 -   void BZ2_bzReadClose ( int *bzerror, BZFILE *b );
10019 -@end example
10020 -Releases all memory pertaining to the compressed file @code{b}.  
10021 -@code{BZ2_bzReadClose} does not call @code{fclose} on the underlying file
10022 -handle, so you should do that yourself if appropriate.
10023 -@code{BZ2_bzReadClose} should be called to clean up after all error
10024 -situations.
10025 -
10026 -Possible assignments to @code{bzerror}:
10027 -@display
10028 -      @code{BZ_SEQUENCE_ERROR} 
10029 -         if @code{b} was opened with @code{BZ2_bzOpenWrite} 
10030 -      @code{BZ_OK} 
10031 -         otherwise
10032 -@end display
10033 -
10034 -Allowable next actions:
10035 -@display
10036 -      none
10037 -@end display
10038 -
10039 -
10040 -
10041 -@subsection @code{BZ2_bzWriteOpen}
10042 -@example
10043 -   BZFILE *BZ2_bzWriteOpen ( int *bzerror, FILE *f, 
10044 -                             int blockSize100k, int verbosity,
10045 -                             int workFactor );
10046 -@end example
10047 -Prepare to write compressed data to file handle @code{f}.  
10048 -@code{f} should refer to
10049 -a file which has been opened for writing, and for which the error
10050 -indicator (@code{ferror(f)})is not set.  
10051 -
10052 -For the meaning of parameters @code{blockSize100k},
10053 -@code{verbosity} and @code{workFactor}, see
10054 -@* @code{BZ2_bzCompressInit}.
10055 -
10056 -All required memory is allocated at this stage, so if the call
10057 -completes successfully, @code{BZ_MEM_ERROR} cannot be signalled by a
10058 -subsequent call to @code{BZ2_bzWrite}.
10059 -
10060 -Possible assignments to @code{bzerror}:
10061 -@display 
10062 -      @code{BZ_CONFIG_ERROR}
10063 -         if the library has been mis-compiled
10064 -      @code{BZ_PARAM_ERROR} 
10065 -         if @code{f} is @code{NULL} 
10066 -         or @code{blockSize100k < 1} or @code{blockSize100k > 9}
10067 -      @code{BZ_IO_ERROR} 
10068 -         if @code{ferror(f)} is nonzero
10069 -      @code{BZ_MEM_ERROR} 
10070 -         if insufficient memory is available
10071 -      @code{BZ_OK} 
10072 -         otherwise
10073 -@end display
10074 -
10075 -Possible return values:
10076 -@display
10077 -      Pointer to an abstract @code{BZFILE}  
10078 -         if @code{bzerror} is @code{BZ_OK}   
10079 -      @code{NULL} 
10080 -         otherwise
10081 -@end display
10082 -
10083 -Allowable next actions:
10084 -@display
10085 -      @code{BZ2_bzWrite} 
10086 -         if @code{bzerror} is @code{BZ_OK} 
10087 -         (you could go directly to @code{BZ2_bzWriteClose}, but this would be pretty pointless)
10088 -      @code{BZ2_bzWriteClose} 
10089 -         otherwise
10090 -@end display
10091 -
10092 -
10093 -
10094 -@subsection @code{BZ2_bzWrite}
10095 -@example
10096 -   void BZ2_bzWrite ( int *bzerror, BZFILE *b, void *buf, int len );
10097 -@end example
10098 -Absorbs @code{len} bytes from the buffer @code{buf}, eventually to be
10099 -compressed and written to the file.
10100 -
10101 -Possible assignments to @code{bzerror}:
10102 -@display
10103 -      @code{BZ_PARAM_ERROR} 
10104 -         if @code{b} is @code{NULL} or @code{buf} is @code{NULL} or @code{len < 0}
10105 -      @code{BZ_SEQUENCE_ERROR} 
10106 -         if b was opened with @code{BZ2_bzReadOpen}
10107 -      @code{BZ_IO_ERROR} 
10108 -         if there is an error writing the compressed file.
10109 -      @code{BZ_OK} 
10110 -         otherwise
10111 -@end display
10112 -
10113 -
10114 -
10115 -
10116 -@subsection @code{BZ2_bzWriteClose}
10117 -@example
10118 -   void BZ2_bzWriteClose ( int *bzerror, BZFILE* f,
10119 -                           int abandon,
10120 -                           unsigned int* nbytes_in,
10121 -                           unsigned int* nbytes_out );
10122 -
10123 -   void BZ2_bzWriteClose64 ( int *bzerror, BZFILE* f,
10124 -                             int abandon,
10125 -                             unsigned int* nbytes_in_lo32,
10126 -                             unsigned int* nbytes_in_hi32,
10127 -                             unsigned int* nbytes_out_lo32,
10128 -                             unsigned int* nbytes_out_hi32 );
10129 -@end example
10130 -
10131 -Compresses and flushes to the compressed file all data so far supplied
10132 -by @code{BZ2_bzWrite}.  The logical end-of-stream markers are also written, so
10133 -subsequent calls to @code{BZ2_bzWrite} are illegal.  All memory associated 
10134 -with the compressed file @code{b} is released.  
10135 -@code{fflush} is called on the
10136 -compressed file, but it is not @code{fclose}'d.
10137 -
10138 -If @code{BZ2_bzWriteClose} is called to clean up after an error, the only
10139 -action is to release the memory.  The library records the error codes
10140 -issued by previous calls, so this situation will be detected
10141 -automatically.  There is no attempt to complete the compression
10142 -operation, nor to @code{fflush} the compressed file.  You can force this
10143 -behaviour to happen even in the case of no error, by passing a nonzero
10144 -value to @code{abandon}.
10145 -
10146 -If @code{nbytes_in} is non-null, @code{*nbytes_in} will be set to be the
10147 -total volume of uncompressed data handled.  Similarly, @code{nbytes_out}
10148 -will be set to the total volume of compressed data written.  For 
10149 -compatibility with older versions of the library, @code{BZ2_bzWriteClose}
10150 -only yields the lower 32 bits of these counts.  Use
10151 -@code{BZ2_bzWriteClose64} if you want the full 64 bit counts.  These
10152 -two functions are otherwise absolutely identical.
10153 -
10154 -
10155 -Possible assignments to @code{bzerror}:
10156 -@display
10157 -      @code{BZ_SEQUENCE_ERROR} 
10158 -         if @code{b} was opened with @code{BZ2_bzReadOpen}
10159 -      @code{BZ_IO_ERROR} 
10160 -         if there is an error writing the compressed file
10161 -      @code{BZ_OK} 
10162 -         otherwise
10163 -@end display
10164 -
10165 -@subsection Handling embedded compressed data streams
10166 -
10167 -The high-level library facilitates use of
10168 -@code{bzip2} data streams which form some part of a surrounding, larger
10169 -data stream.
10170 -@itemize @bullet
10171 -@item For writing, the library takes an open file handle, writes
10172 -compressed data to it, @code{fflush}es it but does not @code{fclose} it.
10173 -The calling application can write its own data before and after the
10174 -compressed data stream, using that same file handle.
10175 -@item Reading is more complex, and the facilities are not as general
10176 -as they could be since generality is hard to reconcile with efficiency.
10177 -@code{BZ2_bzRead} reads from the compressed file in blocks of size
10178 -@code{BZ_MAX_UNUSED} bytes, and in doing so probably will overshoot
10179 -the logical end of compressed stream.
10180 -To recover this data once decompression has
10181 -ended, call @code{BZ2_bzReadGetUnused} after the last call of @code{BZ2_bzRead}
10182 -(the one returning @code{BZ_STREAM_END}) but before calling
10183 -@code{BZ2_bzReadClose}.
10184 -@end itemize
10185 -
10186 -This mechanism makes it easy to decompress multiple @code{bzip2}
10187 -streams placed end-to-end.  As the end of one stream, when @code{BZ2_bzRead}
10188 -returns @code{BZ_STREAM_END}, call @code{BZ2_bzReadGetUnused} to collect the
10189 -unused data (copy it into your own buffer somewhere).  
10190 -That data forms the start of the next compressed stream.
10191 -To start uncompressing that next stream, call @code{BZ2_bzReadOpen} again,
10192 -feeding in the unused data via the @code{unused}/@code{nUnused}
10193 -parameters.
10194 -Keep doing this until @code{BZ_STREAM_END} return coincides with the
10195 -physical end of file (@code{feof(f)}).  In this situation
10196 -@code{BZ2_bzReadGetUnused}
10197 -will of course return no data.
10198 -
10199 -This should give some feel for how the high-level interface can be used.
10200 -If you require extra flexibility, you'll have to bite the bullet and get
10201 -to grips with the low-level interface.
10202 -
10203 -@subsection Standard file-reading/writing code
10204 -Here's how you'd write data to a compressed file:
10205 -@example @code
10206 -FILE*   f;
10207 -BZFILE* b;
10208 -int     nBuf;
10209 -char    buf[ /* whatever size you like */ ];
10210 -int     bzerror;
10211 -int     nWritten;
10212 -
10213 -f = fopen ( "myfile.bz2", "w" );
10214 -if (!f) @{
10215 -   /* handle error */
10216 -@}
10217 -b = BZ2_bzWriteOpen ( &bzerror, f, 9 );
10218 -if (bzerror != BZ_OK) @{
10219 -   BZ2_bzWriteClose ( b );
10220 -   /* handle error */
10221 -@}
10222 -
10223 -while ( /* condition */ ) @{
10224 -   /* get data to write into buf, and set nBuf appropriately */
10225 -   nWritten = BZ2_bzWrite ( &bzerror, b, buf, nBuf );
10226 -   if (bzerror == BZ_IO_ERROR) @{ 
10227 -      BZ2_bzWriteClose ( &bzerror, b );
10228 -      /* handle error */
10229 -   @}
10230 -@}
10231 -
10232 -BZ2_bzWriteClose ( &bzerror, b );
10233 -if (bzerror == BZ_IO_ERROR) @{
10234 -   /* handle error */
10235 -@}
10236 -@end example
10237 -And to read from a compressed file:
10238 -@example
10239 -FILE*   f;
10240 -BZFILE* b;
10241 -int     nBuf;
10242 -char    buf[ /* whatever size you like */ ];
10243 -int     bzerror;
10244 -int     nWritten;
10245 -
10246 -f = fopen ( "myfile.bz2", "r" );
10247 -if (!f) @{
10248 -   /* handle error */
10249 -@}
10250 -b = BZ2_bzReadOpen ( &bzerror, f, 0, NULL, 0 );
10251 -if (bzerror != BZ_OK) @{
10252 -   BZ2_bzReadClose ( &bzerror, b );
10253 -   /* handle error */
10254 -@}
10255 -
10256 -bzerror = BZ_OK;
10257 -while (bzerror == BZ_OK && /* arbitrary other conditions */) @{
10258 -   nBuf = BZ2_bzRead ( &bzerror, b, buf, /* size of buf */ );
10259 -   if (bzerror == BZ_OK) @{
10260 -      /* do something with buf[0 .. nBuf-1] */
10261 -   @}
10262 -@}
10263 -if (bzerror != BZ_STREAM_END) @{
10264 -   BZ2_bzReadClose ( &bzerror, b );
10265 -   /* handle error */
10266 -@} else @{
10267 -   BZ2_bzReadClose ( &bzerror );
10268 -@}
10269 -@end example
10270 -
10271 -
10272 -
10273 -@section Utility functions
10274 -@subsection @code{BZ2_bzBuffToBuffCompress}
10275 -@example
10276 -   int BZ2_bzBuffToBuffCompress( char*         dest,
10277 -                                 unsigned int* destLen,
10278 -                                 char*         source,
10279 -                                 unsigned int  sourceLen,
10280 -                                 int           blockSize100k,
10281 -                                 int           verbosity,
10282 -                                 int           workFactor );
10283 -@end example
10284 -Attempts to compress the data in @code{source[0 .. sourceLen-1]}
10285 -into the destination buffer, @code{dest[0 .. *destLen-1]}.
10286 -If the destination buffer is big enough, @code{*destLen} is
10287 -set to the size of the compressed data, and @code{BZ_OK} is
10288 -returned.  If the compressed data won't fit, @code{*destLen}
10289 -is unchanged, and @code{BZ_OUTBUFF_FULL} is returned.
10290 -
10291 -Compression in this manner is a one-shot event, done with a single call
10292 -to this function.  The resulting compressed data is a complete
10293 -@code{bzip2} format data stream.  There is no mechanism for making
10294 -additional calls to provide extra input data.  If you want that kind of
10295 -mechanism, use the low-level interface.
10296 -
10297 -For the meaning of parameters @code{blockSize100k}, @code{verbosity}
10298 -and @code{workFactor}, @* see @code{BZ2_bzCompressInit}.
10299 -
10300 -To guarantee that the compressed data will fit in its buffer, allocate
10301 -an output buffer of size 1% larger than the uncompressed data, plus
10302 -six hundred extra bytes.
10303 -
10304 -@code{BZ2_bzBuffToBuffDecompress} will not write data at or
10305 -beyond @code{dest[*destLen]}, even in case of buffer overflow.
10306 -
10307 -Possible return values:
10308 -@display
10309 -      @code{BZ_CONFIG_ERROR}
10310 -         if the library has been mis-compiled
10311 -      @code{BZ_PARAM_ERROR} 
10312 -         if @code{dest} is @code{NULL} or @code{destLen} is @code{NULL}
10313 -         or @code{blockSize100k < 1} or @code{blockSize100k > 9}
10314 -         or @code{verbosity < 0} or @code{verbosity > 4} 
10315 -         or @code{workFactor < 0} or @code{workFactor > 250}
10316 -      @code{BZ_MEM_ERROR}
10317 -         if insufficient memory is available 
10318 -      @code{BZ_OUTBUFF_FULL}
10319 -         if the size of the compressed data exceeds @code{*destLen}
10320 -      @code{BZ_OK} 
10321 -         otherwise
10322 -@end display
10323 -
10324 -
10325 -
10326 -@subsection @code{BZ2_bzBuffToBuffDecompress}
10327 -@example
10328 -   int BZ2_bzBuffToBuffDecompress ( char*         dest,
10329 -                                    unsigned int* destLen,
10330 -                                    char*         source,
10331 -                                    unsigned int  sourceLen,
10332 -                                    int           small,
10333 -                                    int           verbosity );
10334 -@end example
10335 -Attempts to decompress the data in @code{source[0 .. sourceLen-1]}
10336 -into the destination buffer, @code{dest[0 .. *destLen-1]}.
10337 -If the destination buffer is big enough, @code{*destLen} is
10338 -set to the size of the uncompressed data, and @code{BZ_OK} is
10339 -returned.  If the compressed data won't fit, @code{*destLen}
10340 -is unchanged, and @code{BZ_OUTBUFF_FULL} is returned.
10341 -
10342 -@code{source} is assumed to hold a complete @code{bzip2} format
10343 -data stream.  @* @code{BZ2_bzBuffToBuffDecompress} tries to decompress
10344 -the entirety of the stream into the output buffer.
10345 -
10346 -For the meaning of parameters @code{small} and @code{verbosity},
10347 -see @code{BZ2_bzDecompressInit}.
10348 -
10349 -Because the compression ratio of the compressed data cannot be known in
10350 -advance, there is no easy way to guarantee that the output buffer will
10351 -be big enough.  You may of course make arrangements in your code to
10352 -record the size of the uncompressed data, but such a mechanism is beyond
10353 -the scope of this library.
10354 -
10355 -@code{BZ2_bzBuffToBuffDecompress} will not write data at or
10356 -beyond @code{dest[*destLen]}, even in case of buffer overflow.
10357 -
10358 -Possible return values:
10359 -@display
10360 -      @code{BZ_CONFIG_ERROR}
10361 -         if the library has been mis-compiled
10362 -      @code{BZ_PARAM_ERROR} 
10363 -         if @code{dest} is @code{NULL} or @code{destLen} is @code{NULL}
10364 -         or @code{small != 0 && small != 1}
10365 -         or @code{verbosity < 0} or @code{verbosity > 4} 
10366 -      @code{BZ_MEM_ERROR}
10367 -         if insufficient memory is available 
10368 -      @code{BZ_OUTBUFF_FULL}
10369 -         if the size of the compressed data exceeds @code{*destLen}
10370 -      @code{BZ_DATA_ERROR}
10371 -         if a data integrity error was detected in the compressed data
10372 -      @code{BZ_DATA_ERROR_MAGIC}
10373 -         if the compressed data doesn't begin with the right magic bytes
10374 -      @code{BZ_UNEXPECTED_EOF}
10375 -         if the compressed data ends unexpectedly
10376 -      @code{BZ_OK} 
10377 -         otherwise
10378 -@end display
10379 -
10380 -
10381 -
10382 -@section @code{zlib} compatibility functions
10383 -Yoshioka Tsuneo has contributed some functions to
10384 -give better @code{zlib} compatibility.  These functions are
10385 -@code{BZ2_bzopen}, @code{BZ2_bzread}, @code{BZ2_bzwrite}, @code{BZ2_bzflush},
10386 -@code{BZ2_bzclose},
10387 -@code{BZ2_bzerror} and @code{BZ2_bzlibVersion}.
10388 -These functions are not (yet) officially part of
10389 -the library.  If they break, you get to keep all the pieces.
10390 -Nevertheless, I think they work ok.
10391 -@example
10392 -typedef void BZFILE;
10393 -
10394 -const char * BZ2_bzlibVersion ( void );
10395 -@end example
10396 -Returns a string indicating the library version.
10397 -@example
10398 -BZFILE * BZ2_bzopen  ( const char *path, const char *mode );
10399 -BZFILE * BZ2_bzdopen ( int        fd,    const char *mode );
10400 -@end example
10401 -Opens a @code{.bz2} file for reading or writing, using either its name
10402 -or a pre-existing file descriptor. 
10403 -Analogous to @code{fopen} and @code{fdopen}.
10404 -@example         
10405 -int BZ2_bzread  ( BZFILE* b, void* buf, int len );
10406 -int BZ2_bzwrite ( BZFILE* b, void* buf, int len );
10407 -@end example
10408 -Reads/writes data from/to a previously opened @code{BZFILE}.
10409 -Analogous to @code{fread} and @code{fwrite}.
10410 -@example
10411 -int  BZ2_bzflush ( BZFILE* b );
10412 -void BZ2_bzclose ( BZFILE* b );
10413 -@end example
10414 -Flushes/closes a @code{BZFILE}.  @code{BZ2_bzflush} doesn't actually do
10415 -anything.  Analogous to @code{fflush} and @code{fclose}.
10416 -
10417 -@example 
10418 -const char * BZ2_bzerror ( BZFILE *b, int *errnum )
10419 -@end example
10420 -Returns a string describing the more recent error status of
10421 -@code{b}, and also sets @code{*errnum} to its numerical value.
10422 -
10423 -
10424 -@section Using the library in a @code{stdio}-free environment
10425 -
10426 -@subsection Getting rid of @code{stdio}
10427 -
10428 -In a deeply embedded application, you might want to use just
10429 -the memory-to-memory functions.  You can do this conveniently
10430 -by compiling the library with preprocessor symbol @code{BZ_NO_STDIO}
10431 -defined.  Doing this gives you a library containing only the following
10432 -eight functions:
10433 -
10434 -@code{BZ2_bzCompressInit}, @code{BZ2_bzCompress}, @code{BZ2_bzCompressEnd} @*
10435 -@code{BZ2_bzDecompressInit}, @code{BZ2_bzDecompress}, @code{BZ2_bzDecompressEnd} @*
10436 -@code{BZ2_bzBuffToBuffCompress}, @code{BZ2_bzBuffToBuffDecompress}
10437 -
10438 -When compiled like this, all functions will ignore @code{verbosity}
10439 -settings.
10440 -
10441 -@subsection Critical error handling
10442 -@code{libbzip2} contains a number of internal assertion checks which
10443 -should, needless to say, never be activated.  Nevertheless, if an
10444 -assertion should fail, behaviour depends on whether or not the library
10445 -was compiled with @code{BZ_NO_STDIO} set.
10446 -
10447 -For a normal compile, an assertion failure yields the message
10448 -@example
10449 -   bzip2/libbzip2: internal error number N.
10450 -   This is a bug in bzip2/libbzip2, 1.0 of 21-Mar-2000.
10451 -   Please report it to me at: jseward@@acm.org.  If this happened
10452 -   when you were using some program which uses libbzip2 as a
10453 -   component, you should also report this bug to the author(s)
10454 -   of that program.  Please make an effort to report this bug;
10455 -   timely and accurate bug reports eventually lead to higher
10456 -   quality software.  Thanks.  Julian Seward, 21 March 2000.
10457 -@end example
10458 -where @code{N} is some error code number.  @code{exit(3)}
10459 -is then called.
10460 -
10461 -For a @code{stdio}-free library, assertion failures result
10462 -in a call to a function declared as:
10463 -@example
10464 -   extern void bz_internal_error ( int errcode );
10465 -@end example
10466 -The relevant code is passed as a parameter.  You should supply
10467 -such a function.
10468 -
10469 -In either case, once an assertion failure has occurred, any 
10470 -@code{bz_stream} records involved can be regarded as invalid.
10471 -You should not attempt to resume normal operation with them.
10472 -
10473 -You may, of course, change critical error handling to suit
10474 -your needs.  As I said above, critical errors indicate bugs
10475 -in the library and should not occur.  All "normal" error
10476 -situations are indicated via error return codes from functions,
10477 -and can be recovered from.
10478 -
10479 -
10480 -@section Making a Windows DLL
10481 -Everything related to Windows has been contributed by Yoshioka Tsuneo
10482 -@* (@code{QWF00133@@niftyserve.or.jp} /
10483 -@code{tsuneo-y@@is.aist-nara.ac.jp}), so you should send your queries to
10484 -him (but perhaps Cc: me, @code{jseward@@acm.org}).
10485 -
10486 -My vague understanding of what to do is: using Visual C++ 5.0,
10487 -open the project file @code{libbz2.dsp}, and build.  That's all.
10488 -
10489 -If you can't
10490 -open the project file for some reason, make a new one, naming these files:
10491 -@code{blocksort.c}, @code{bzlib.c}, @code{compress.c}, 
10492 -@code{crctable.c}, @code{decompress.c}, @code{huffman.c}, @*
10493 -@code{randtable.c} and @code{libbz2.def}.  You will also need
10494 -to name the header files @code{bzlib.h} and @code{bzlib_private.h}.
10495 -
10496 -If you don't use VC++, you may need to define the proprocessor symbol
10497 -@code{_WIN32}. 
10498 -
10499 -Finally, @code{dlltest.c} is a sample program using the DLL.  It has a
10500 -project file, @code{dlltest.dsp}.
10501 -
10502 -If you just want a makefile for Visual C, have a look at
10503 -@code{makefile.msc}.
10504 -
10505 -Be aware that if you compile @code{bzip2} itself on Win32, you must set
10506 -@code{BZ_UNIX} to 0 and @code{BZ_LCCWIN32} to 1, in the file
10507 -@code{bzip2.c}, before compiling.  Otherwise the resulting binary won't
10508 -work correctly.
10509 -
10510 -I haven't tried any of this stuff myself, but it all looks plausible.
10511 -
10512 -
10513 -
10514 -@chapter Miscellanea
10515 -
10516 -These are just some random thoughts of mine.  Your mileage may
10517 -vary.
10518 -
10519 -@section Limitations of the compressed file format
10520 -@code{bzip2-1.0}, @code{0.9.5} and @code{0.9.0}
10521 -use exactly the same file format as the previous
10522 -version, @code{bzip2-0.1}.  This decision was made in the interests of
10523 -stability.  Creating yet another incompatible compressed file format
10524 -would create further confusion and disruption for users.
10525 -
10526 -Nevertheless, this is not a painless decision.  Development
10527 -work since the release of @code{bzip2-0.1} in August 1997
10528 -has shown complexities in the file format which slow down
10529 -decompression and, in retrospect, are unnecessary.  These are:
10530 -@itemize @bullet
10531 -@item The run-length encoder, which is the first of the 
10532 -      compression transformations, is entirely irrelevant.
10533 -      The original purpose was to protect the sorting algorithm
10534 -      from the very worst case input: a string of repeated
10535 -      symbols.  But algorithm steps Q6a and Q6b in the original
10536 -      Burrows-Wheeler technical report (SRC-124) show how
10537 -      repeats can be handled without difficulty in block
10538 -      sorting.
10539 -@item The randomisation mechanism doesn't really need to be
10540 -      there.  Udi Manber and Gene Myers published a suffix
10541 -      array construction algorithm a few years back, which
10542 -      can be employed to sort any block, no matter how 
10543 -      repetitive, in O(N log N) time.  Subsequent work by
10544 -      Kunihiko Sadakane has produced a derivative O(N (log N)^2) 
10545 -      algorithm which usually outperforms the Manber-Myers
10546 -      algorithm.
10547 -
10548 -      I could have changed to Sadakane's algorithm, but I find
10549 -      it to be slower than @code{bzip2}'s existing algorithm for
10550 -      most inputs, and the randomisation mechanism protects
10551 -      adequately against bad cases.  I didn't think it was
10552 -      a good tradeoff to make.  Partly this is due to the fact
10553 -      that I was not flooded with email complaints about
10554 -      @code{bzip2-0.1}'s performance on repetitive data, so
10555 -      perhaps it isn't a problem for real inputs.
10556 -
10557 -      Probably the best long-term solution,
10558 -      and the one I have incorporated into 0.9.5 and above,
10559 -      is to use the existing sorting
10560 -      algorithm initially, and fall back to a O(N (log N)^2)
10561 -      algorithm if the standard algorithm gets into difficulties.
10562 -@item The compressed file format was never designed to be
10563 -      handled by a library, and I have had to jump though
10564 -      some hoops to produce an efficient implementation of
10565 -      decompression.  It's a bit hairy.  Try passing
10566 -      @code{decompress.c} through the C preprocessor 
10567 -      and you'll see what I mean.  Much of this complexity
10568 -      could have been avoided if the compressed size of
10569 -      each block of data was recorded in the data stream.
10570 -@item An Adler-32 checksum, rather than a CRC32 checksum,
10571 -      would be faster to compute.
10572 -@end itemize
10573 -It would be fair to say that the @code{bzip2} format was frozen
10574 -before I properly and fully understood the performance
10575 -consequences of doing so.
10576 -
10577 -Improvements which I was able to incorporate into
10578 -0.9.0, despite using the same file format, are:
10579 -@itemize @bullet
10580 -@item Single array implementation of the inverse BWT.  This
10581 -      significantly speeds up decompression, presumably
10582 -      because it reduces the number of cache misses.
10583 -@item Faster inverse MTF transform for large MTF values.  The
10584 -      new implementation is based on the notion of sliding blocks
10585 -      of values.
10586 -@item @code{bzip2-0.9.0} now reads and writes files with @code{fread}
10587 -      and @code{fwrite}; version 0.1 used @code{putc} and @code{getc}.
10588 -      Duh!  Well, you live and learn.
10589 -
10590 -@end itemize
10591 -Further ahead, it would be nice 
10592 -to be able to do random access into files.  This will 
10593 -require some careful design of compressed file formats.
10594 -
10595 -
10596 -
10597 -@section Portability issues
10598 -After some consideration, I have decided not to use
10599 -GNU @code{autoconf} to configure 0.9.5 or 1.0.
10600 -
10601 -@code{autoconf}, admirable and wonderful though it is, 
10602 -mainly assists with portability problems between Unix-like
10603 -platforms.  But @code{bzip2} doesn't have much in the way
10604 -of portability problems on Unix; most of the difficulties appear
10605 -when porting to the Mac, or to Microsoft's operating systems.
10606 -@code{autoconf} doesn't help in those cases, and brings in a 
10607 -whole load of new complexity.
10608 -
10609 -Most people should be able to compile the library and program
10610 -under Unix straight out-of-the-box, so to speak, especially 
10611 -if you have a version of GNU C available.
10612 -
10613 -There are a couple of @code{__inline__} directives in the code.  GNU C
10614 -(@code{gcc}) should be able to handle them.  If you're not using
10615 -GNU C, your C compiler shouldn't see them at all.
10616 -If your compiler does, for some reason, see them and doesn't
10617 -like them, just @code{#define} @code{__inline__} to be @code{/* */}.  One
10618 -easy way to do this is to compile with the flag @code{-D__inline__=}, 
10619 -which should be understood by most Unix compilers.
10620 -
10621 -If you still have difficulties, try compiling with the macro
10622 -@code{BZ_STRICT_ANSI} defined.  This should enable you to build the
10623 -library in a strictly ANSI compliant environment.  Building the program
10624 -itself like this is dangerous and not supported, since you remove
10625 -@code{bzip2}'s checks against compressing directories, symbolic links,
10626 -devices, and other not-really-a-file entities.  This could cause
10627 -filesystem corruption!
10628 -
10629 -One other thing: if you create a @code{bzip2} binary for public
10630 -distribution, please try and link it statically (@code{gcc -s}).  This
10631 -avoids all sorts of library-version issues that others may encounter
10632 -later on.
10633 -
10634 -If you build @code{bzip2} on Win32, you must set @code{BZ_UNIX} to 0 and
10635 -@code{BZ_LCCWIN32} to 1, in the file @code{bzip2.c}, before compiling.
10636 -Otherwise the resulting binary won't work correctly.
10637 -
10638 -
10639 -
10640 -@section Reporting bugs
10641 -I tried pretty hard to make sure @code{bzip2} is
10642 -bug free, both by design and by testing.  Hopefully
10643 -you'll never need to read this section for real.
10644 -
10645 -Nevertheless, if @code{bzip2} dies with a segmentation
10646 -fault, a bus error or an internal assertion failure, it
10647 -will ask you to email me a bug report.  Experience with
10648 -version 0.1 shows that almost all these problems can
10649 -be traced to either compiler bugs or hardware problems.
10650 -@itemize @bullet
10651 -@item
10652 -Recompile the program with no optimisation, and see if it
10653 -works.  And/or try a different compiler.
10654 -I heard all sorts of stories about various flavours
10655 -of GNU C (and other compilers) generating bad code for
10656 -@code{bzip2}, and I've run across two such examples myself.
10657 -
10658 -2.7.X versions of GNU C are known to generate bad code from
10659 -time to time, at high optimisation levels.  
10660 -If you get problems, try using the flags
10661 -@code{-O2} @code{-fomit-frame-pointer} @code{-fno-strength-reduce}.
10662 -You should specifically @emph{not} use @code{-funroll-loops}.
10663 -
10664 -You may notice that the Makefile runs six tests as part of
10665 -the build process.  If the program passes all of these, it's
10666 -a pretty good (but not 100%) indication that the compiler has
10667 -done its job correctly.
10668 -@item
10669 -If @code{bzip2} crashes randomly, and the crashes are not
10670 -repeatable, you may have a flaky memory subsystem.  @code{bzip2}
10671 -really hammers your memory hierarchy, and if it's a bit marginal,
10672 -you may get these problems.  Ditto if your disk or I/O subsystem
10673 -is slowly failing.  Yup, this really does happen.
10674 -
10675 -Try using a different machine of the same type, and see if
10676 -you can repeat the problem.
10677 -@item This isn't really a bug, but ... If @code{bzip2} tells
10678 -you your file is corrupted on decompression, and you
10679 -obtained the file via FTP, there is a possibility that you
10680 -forgot to tell FTP to do a binary mode transfer.  That absolutely
10681 -will cause the file to be non-decompressible.  You'll have to transfer
10682 -it again.
10683 -@end itemize
10684 -
10685 -If you've incorporated @code{libbzip2} into your own program
10686 -and are getting problems, please, please, please, check that the 
10687 -parameters you are passing in calls to the library, are
10688 -correct, and in accordance with what the documentation says
10689 -is allowable.  I have tried to make the library robust against
10690 -such problems, but I'm sure I haven't succeeded.
10691 -
10692 -Finally, if the above comments don't help, you'll have to send
10693 -me a bug report.  Now, it's just amazing how many people will 
10694 -send me a bug report saying something like
10695 -@display
10696 -   bzip2 crashed with segmentation fault on my machine
10697 -@end display
10698 -and absolutely nothing else.  Needless to say, a such a report
10699 -is @emph{totally, utterly, completely and comprehensively 100% useless; 
10700 -a waste of your time, my time, and net bandwidth}.
10701 -With no details at all, there's no way I can possibly begin
10702 -to figure out what the problem is.
10703 -
10704 -The rules of the game are: facts, facts, facts.  Don't omit
10705 -them because "oh, they won't be relevant".  At the bare 
10706 -minimum:
10707 -@display
10708 -   Machine type.  Operating system version.  
10709 -   Exact version of @code{bzip2} (do @code{bzip2 -V}).  
10710 -   Exact version of the compiler used.  
10711 -   Flags passed to the compiler.
10712 -@end display
10713 -However, the most important single thing that will help me is
10714 -the file that you were trying to compress or decompress at the
10715 -time the problem happened.  Without that, my ability to do anything
10716 -more than speculate about the cause, is limited.
10717 -
10718 -Please remember that I connect to the Internet with a modem, so
10719 -you should contact me before mailing me huge files.
10720 -
10721 -
10722 -@section Did you get the right package?
10723 -
10724 -@code{bzip2} is a resource hog.  It soaks up large amounts of CPU cycles
10725 -and memory.  Also, it gives very large latencies.  In the worst case, you
10726 -can feed many megabytes of uncompressed data into the library before
10727 -getting any compressed output, so this probably rules out applications
10728 -requiring interactive behaviour.
10729 -
10730 -These aren't faults of my implementation, I hope, but more
10731 -an intrinsic property of the Burrows-Wheeler transform (unfortunately).  
10732 -Maybe this isn't what you want.
10733 -
10734 -If you want a compressor and/or library which is faster, uses less
10735 -memory but gets pretty good compression, and has minimal latency,
10736 -consider Jean-loup
10737 -Gailly's and Mark Adler's work, @code{zlib-1.1.2} and
10738 -@code{gzip-1.2.4}.  Look for them at
10739 -
10740 -@code{http://www.cdrom.com/pub/infozip/zlib} and
10741 -@code{http://www.gzip.org} respectively.
10742 -
10743 -For something faster and lighter still, you might try Markus F X J
10744 -Oberhumer's @code{LZO} real-time compression/decompression library, at
10745 -@* @code{http://wildsau.idv.uni-linz.ac.at/mfx/lzo.html}.
10746 -
10747 -If you want to use the @code{bzip2} algorithms to compress small blocks
10748 -of data, 64k bytes or smaller, for example on an on-the-fly disk
10749 -compressor, you'd be well advised not to use this library.  Instead,
10750 -I've made a special library tuned for that kind of use.  It's part of
10751 -@code{e2compr-0.40}, an on-the-fly disk compressor for the Linux
10752 -@code{ext2} filesystem.  Look at
10753 -@code{http://www.netspace.net.au/~reiter/e2compr}.
10754 -
10755 -
10756 -
10757 -@section Testing
10758 -
10759 -A record of the tests I've done.
10760 -
10761 -First, some data sets:
10762 -@itemize @bullet
10763 -@item B: a directory containing 6001 files, one for every length in the
10764 -      range 0 to 6000 bytes.  The files contain random lowercase
10765 -      letters.  18.7 megabytes.
10766 -@item H: my home directory tree.  Documents, source code, mail files,
10767 -      compressed data.  H contains B, and also a directory of 
10768 -      files designed as boundary cases for the sorting; mostly very
10769 -      repetitive, nasty files.  565 megabytes.
10770 -@item A: directory tree holding various applications built from source:
10771 -      @code{egcs}, @code{gcc-2.8.1}, KDE, GTK, Octave, etc.
10772 -      2200 megabytes.
10773 -@end itemize
10774 -The tests conducted are as follows.  Each test means compressing 
10775 -(a copy of) each file in the data set, decompressing it and
10776 -comparing it against the original.
10777 -
10778 -First, a bunch of tests with block sizes and internal buffer
10779 -sizes set very small, 
10780 -to detect any problems with the
10781 -blocking and buffering mechanisms.  
10782 -This required modifying the source code so as to try to 
10783 -break it.
10784 -@enumerate
10785 -@item Data set H, with
10786 -      buffer size of 1 byte, and block size of 23 bytes.
10787 -@item Data set B, buffer sizes 1 byte, block size 1 byte.
10788 -@item As (2) but small-mode decompression.
10789 -@item As (2) with block size 2 bytes.
10790 -@item As (2) with block size 3 bytes.
10791 -@item As (2) with block size 4 bytes.
10792 -@item As (2) with block size 5 bytes.
10793 -@item As (2) with block size 6 bytes and small-mode decompression.
10794 -@item H with buffer size of 1 byte, but normal block
10795 -      size (up to 900000 bytes).
10796 -@end enumerate
10797 -Then some tests with unmodified source code.
10798 -@enumerate
10799 -@item H, all settings normal.
10800 -@item As (1), with small-mode decompress.
10801 -@item H, compress with flag @code{-1}.
10802 -@item H, compress with flag @code{-s}, decompress with flag @code{-s}.
10803 -@item Forwards compatibility: H, @code{bzip2-0.1pl2} compressing,
10804 -      @code{bzip2-0.9.5} decompressing, all settings normal.
10805 -@item Backwards compatibility:  H, @code{bzip2-0.9.5} compressing,
10806 -      @code{bzip2-0.1pl2} decompressing, all settings normal.
10807 -@item Bigger tests: A, all settings normal.
10808 -@item As (7), using the fallback (Sadakane-like) sorting algorithm.
10809 -@item As (8), compress with flag @code{-1}, decompress with flag
10810 -      @code{-s}.
10811 -@item H, using the fallback sorting algorithm.
10812 -@item Forwards compatibility: A, @code{bzip2-0.1pl2} compressing,
10813 -      @code{bzip2-0.9.5} decompressing, all settings normal.
10814 -@item Backwards compatibility:  A, @code{bzip2-0.9.5} compressing,
10815 -      @code{bzip2-0.1pl2} decompressing, all settings normal.
10816 -@item Misc test: about 400 megabytes of @code{.tar} files with
10817 -      @code{bzip2} compiled with Checker (a memory access error
10818 -       detector, like Purify).
10819 -@item Misc tests to make sure it builds and runs ok on non-Linux/x86
10820 -      platforms.
10821 -@end enumerate
10822 -These tests were conducted on a 225 MHz IDT WinChip machine, running
10823 -Linux 2.0.36.  They represent nearly a week of continuous computation.
10824 -All tests completed successfully.
10825 -
10826 -
10827 -@section Further reading
10828 -@code{bzip2} is not research work, in the sense that it doesn't present
10829 -any new ideas.  Rather, it's an engineering exercise based on existing
10830 -ideas.
10831 -
10832 -Four documents describe essentially all the ideas behind @code{bzip2}:
10833 -@example
10834 -Michael Burrows and D. J. Wheeler:
10835 -  "A block-sorting lossless data compression algorithm"
10836 -   10th May 1994. 
10837 -   Digital SRC Research Report 124.
10838 -   ftp://ftp.digital.com/pub/DEC/SRC/research-reports/SRC-124.ps.gz
10839 -   If you have trouble finding it, try searching at the
10840 -   New Zealand Digital Library, http://www.nzdl.org.
10841 -
10842 -Daniel S. Hirschberg and Debra A. LeLewer
10843 -  "Efficient Decoding of Prefix Codes"
10844 -   Communications of the ACM, April 1990, Vol 33, Number 4.
10845 -   You might be able to get an electronic copy of this
10846 -      from the ACM Digital Library.
10847 -
10848 -David J. Wheeler
10849 -   Program bred3.c and accompanying document bred3.ps.
10850 -   This contains the idea behind the multi-table Huffman
10851 -   coding scheme.
10852 -   ftp://ftp.cl.cam.ac.uk/users/djw3/
10853 -
10854 -Jon L. Bentley and Robert Sedgewick
10855 -  "Fast Algorithms for Sorting and Searching Strings"
10856 -   Available from Sedgewick's web page,
10857 -   www.cs.princeton.edu/~rs
10858 -@end example
10859 -The following paper gives valuable additional insights into the
10860 -algorithm, but is not immediately the basis of any code
10861 -used in bzip2.
10862 -@example
10863 -Peter Fenwick:
10864 -   Block Sorting Text Compression
10865 -   Proceedings of the 19th Australasian Computer Science Conference,
10866 -     Melbourne, Australia.  Jan 31 - Feb 2, 1996.
10867 -   ftp://ftp.cs.auckland.ac.nz/pub/peter-f/ACSC96paper.ps
10868 -@end example
10869 -Kunihiko Sadakane's sorting algorithm, mentioned above,
10870 -is available from:
10871 -@example
10872 -http://naomi.is.s.u-tokyo.ac.jp/~sada/papers/Sada98b.ps.gz
10873 -@end example
10874 -The Manber-Myers suffix array construction
10875 -algorithm is described in a paper
10876 -available from:
10877 -@example
10878 -http://www.cs.arizona.edu/people/gene/PAPERS/suffix.ps
10879 -@end example
10880 -Finally, the following paper documents some recent investigations
10881 -I made into the performance of sorting algorithms:
10882 -@example
10883 -Julian Seward:
10884 -   On the Performance of BWT Sorting Algorithms
10885 -   Proceedings of the IEEE Data Compression Conference 2000
10886 -     Snowbird, Utah.  28-30 March 2000.
10887 -@end example
10888 -
10889 -
10890 -@contents
10891 -
10892 -@bye
10893 -
10894 diff -Nru bzip2-1.0.1/manual_1.html bzip2-1.0.1.new/manual_1.html
10895 --- bzip2-1.0.1/manual_1.html   Sat Jun 24 20:13:27 2000
10896 +++ bzip2-1.0.1.new/manual_1.html       Thu Jan  1 01:00:00 1970
10897 @@ -1,47 +0,0 @@
10898 -<HTML>
10899 -<HEAD>
10900 -<!-- This HTML file has been created by texi2html 1.54
10901 -     from manual.texi on 23 March 2000 -->
10902 -
10903 -<TITLE>bzip2 and libbzip2 - Introduction</TITLE>
10904 -<link href="manual_2.html" rel=Next>
10905 -<link href="manual_toc.html" rel=ToC>
10906 -
10907 -</HEAD>
10908 -<BODY>
10909 -<p>Go to the first, previous, <A HREF="manual_2.html">next</A>, <A HREF="manual_4.html">last</A> section, <A HREF="manual_toc.html">table of contents</A>.
10910 -<P><HR><P>
10911 -
10912 -
10913 -<H1><A NAME="SEC1" HREF="manual_toc.html#TOC1">Introduction</A></H1>
10914 -
10915 -<P>
10916 -<CODE>bzip2</CODE>  compresses  files  using the Burrows-Wheeler 
10917 -block-sorting text compression algorithm,  and  Huffman  coding.
10918 -Compression  is  generally  considerably  better than that
10919 -achieved by more conventional LZ77/LZ78-based compressors,
10920 -and  approaches  the performance of the PPM family of statistical compressors.
10921 -
10922 -</P>
10923 -<P>
10924 -<CODE>bzip2</CODE> is built on top of <CODE>libbzip2</CODE>, a flexible library
10925 -for handling compressed data in the <CODE>bzip2</CODE> format.  This manual
10926 -describes both how to use the program and 
10927 -how to work with the library interface.  Most of the
10928 -manual is devoted to this library, not the program, 
10929 -which is good news if your interest is only in the program.
10930 -
10931 -</P>
10932 -<P>
10933 -Chapter 2 describes how to use <CODE>bzip2</CODE>; this is the only part 
10934 -you need to read if you just want to know how to operate the program.
10935 -Chapter 3 describes the programming interfaces in detail, and
10936 -Chapter 4 records some miscellaneous notes which I thought
10937 -ought to be recorded somewhere.
10938 -
10939 -</P>
10940 -
10941 -<P><HR><P>
10942 -<p>Go to the first, previous, <A HREF="manual_2.html">next</A>, <A HREF="manual_4.html">last</A> section, <A HREF="manual_toc.html">table of contents</A>.
10943 -</BODY>
10944 -</HTML>
10945 diff -Nru bzip2-1.0.1/manual_2.html bzip2-1.0.1.new/manual_2.html
10946 --- bzip2-1.0.1/manual_2.html   Sat Jun 24 20:13:27 2000
10947 +++ bzip2-1.0.1.new/manual_2.html       Thu Jan  1 01:00:00 1970
10948 @@ -1,484 +0,0 @@
10949 -<HTML>
10950 -<HEAD>
10951 -<!-- This HTML file has been created by texi2html 1.54
10952 -     from manual.texi on 23 March 2000 -->
10953 -
10954 -<TITLE>bzip2 and libbzip2 - How to use bzip2</TITLE>
10955 -<link href="manual_3.html" rel=Next>
10956 -<link href="manual_1.html" rel=Previous>
10957 -<link href="manual_toc.html" rel=ToC>
10958 -
10959 -</HEAD>
10960 -<BODY>
10961 -<p>Go to the <A HREF="manual_1.html">first</A>, <A HREF="manual_1.html">previous</A>, <A HREF="manual_3.html">next</A>, <A HREF="manual_4.html">last</A> section, <A HREF="manual_toc.html">table of contents</A>.
10962 -<P><HR><P>
10963 -
10964 -
10965 -<H1><A NAME="SEC2" HREF="manual_toc.html#TOC2">How to use <CODE>bzip2</CODE></A></H1>
10966 -
10967 -<P>
10968 -This chapter contains a copy of the <CODE>bzip2</CODE> man page,
10969 -and nothing else.
10970 -
10971 -</P>
10972 -
10973 -<BLOCKQUOTE>
10974 -
10975 -
10976 -
10977 -<H4><A NAME="SEC3" HREF="manual_toc.html#TOC3">NAME</A></H4>
10978 -
10979 -<UL>
10980 -<LI><CODE>bzip2</CODE>, <CODE>bunzip2</CODE>
10981 -
10982 -- a block-sorting file compressor, v1.0
10983 -<LI><CODE>bzcat</CODE>
10984 -
10985 -- decompresses files to stdout
10986 -<LI><CODE>bzip2recover</CODE>
10987 -
10988 -- recovers data from damaged bzip2 files
10989 -</UL>
10990 -
10991 -
10992 -
10993 -<H4><A NAME="SEC4" HREF="manual_toc.html#TOC4">SYNOPSIS</A></H4>
10994 -
10995 -<UL>
10996 -<LI><CODE>bzip2</CODE> [ -cdfkqstvzVL123456789 ] [ filenames ...  ]
10997 -
10998 -<LI><CODE>bunzip2</CODE> [ -fkvsVL ] [ filenames ...  ]
10999 -
11000 -<LI><CODE>bzcat</CODE> [ -s ] [ filenames ...  ]
11001 -
11002 -<LI><CODE>bzip2recover</CODE> filename
11003 -
11004 -</UL>
11005 -
11006 -
11007 -
11008 -<H4><A NAME="SEC5" HREF="manual_toc.html#TOC5">DESCRIPTION</A></H4>
11009 -
11010 -<P>
11011 -<CODE>bzip2</CODE> compresses files using the Burrows-Wheeler block sorting
11012 -text compression algorithm, and Huffman coding.  Compression is
11013 -generally considerably better than that achieved by more conventional
11014 -LZ77/LZ78-based compressors, and approaches the performance of the PPM
11015 -family of statistical compressors.
11016 -
11017 -</P>
11018 -<P>
11019 -The command-line options are deliberately very similar to those of GNU
11020 -<CODE>gzip</CODE>, but they are not identical.
11021 -
11022 -</P>
11023 -<P>
11024 -<CODE>bzip2</CODE> expects a list of file names to accompany the command-line
11025 -flags.  Each file is replaced by a compressed version of itself, with
11026 -the name <CODE>original_name.bz2</CODE>.  Each compressed file has the same
11027 -modification date, permissions, and, when possible, ownership as the
11028 -corresponding original, so that these properties can be correctly
11029 -restored at decompression time.  File name handling is naive in the
11030 -sense that there is no mechanism for preserving original file names,
11031 -permissions, ownerships or dates in filesystems which lack these
11032 -concepts, or have serious file name length restrictions, such as MS-DOS.
11033 -
11034 -</P>
11035 -<P>
11036 -<CODE>bzip2</CODE> and <CODE>bunzip2</CODE> will by default not overwrite existing
11037 -files.  If you want this to happen, specify the <CODE>-f</CODE> flag.
11038 -
11039 -</P>
11040 -<P>
11041 -If no file names are specified, <CODE>bzip2</CODE> compresses from standard
11042 -input to standard output.  In this case, <CODE>bzip2</CODE> will decline to
11043 -write compressed output to a terminal, as this would be entirely
11044 -incomprehensible and therefore pointless.
11045 -
11046 -</P>
11047 -<P>
11048 -<CODE>bunzip2</CODE> (or <CODE>bzip2 -d</CODE>) decompresses all
11049 -specified files.  Files which were not created by <CODE>bzip2</CODE>
11050 -will be detected and ignored, and a warning issued.  
11051 -<CODE>bzip2</CODE> attempts to guess the filename for the decompressed file 
11052 -from that of the compressed file as follows:
11053 -
11054 -<UL>
11055 -<LI><CODE>filename.bz2 </CODE> becomes <CODE>filename</CODE>
11056 -
11057 -<LI><CODE>filename.bz  </CODE> becomes <CODE>filename</CODE>
11058 -
11059 -<LI><CODE>filename.tbz2</CODE> becomes <CODE>filename.tar</CODE>
11060 -
11061 -<LI><CODE>filename.tbz </CODE> becomes <CODE>filename.tar</CODE>
11062 -
11063 -<LI><CODE>anyothername </CODE> becomes <CODE>anyothername.out</CODE>
11064 -
11065 -</UL>
11066 -
11067 -<P>
11068 -If the file does not end in one of the recognised endings, 
11069 -<CODE>.bz2</CODE>, <CODE>.bz</CODE>, 
11070 -<CODE>.tbz2</CODE> or <CODE>.tbz</CODE>, <CODE>bzip2</CODE> complains that it cannot
11071 -guess the name of the original file, and uses the original name
11072 -with <CODE>.out</CODE> appended.
11073 -
11074 -</P>
11075 -<P>
11076 -As with compression, supplying no
11077 -filenames causes decompression from standard input to standard output.
11078 -
11079 -</P>
11080 -<P>
11081 -<CODE>bunzip2</CODE> will correctly decompress a file which is the
11082 -concatenation of two or more compressed files.  The result is the
11083 -concatenation of the corresponding uncompressed files.  Integrity
11084 -testing (<CODE>-t</CODE>) of concatenated compressed files is also supported.
11085 -
11086 -</P>
11087 -<P>
11088 -You can also compress or decompress files to the standard output by
11089 -giving the <CODE>-c</CODE> flag.  Multiple files may be compressed and
11090 -decompressed like this.  The resulting outputs are fed sequentially to
11091 -stdout.  Compression of multiple files in this manner generates a stream
11092 -containing multiple compressed file representations.  Such a stream
11093 -can be decompressed correctly only by <CODE>bzip2</CODE> version 0.9.0 or
11094 -later.  Earlier versions of <CODE>bzip2</CODE> will stop after decompressing
11095 -the first file in the stream.
11096 -
11097 -</P>
11098 -<P>
11099 -<CODE>bzcat</CODE> (or <CODE>bzip2 -dc</CODE>) decompresses all specified files to
11100 -the standard output.
11101 -
11102 -</P>
11103 -<P>
11104 -<CODE>bzip2</CODE> will read arguments from the environment variables
11105 -<CODE>BZIP2</CODE> and <CODE>BZIP</CODE>, in that order, and will process them
11106 -before any arguments read from the command line.  This gives a 
11107 -convenient way to supply default arguments.
11108 -
11109 -</P>
11110 -<P>
11111 -Compression is always performed, even if the compressed file is slightly
11112 -larger than the original.  Files of less than about one hundred bytes
11113 -tend to get larger, since the compression mechanism has a constant
11114 -overhead in the region of 50 bytes.  Random data (including the output
11115 -of most file compressors) is coded at about 8.05 bits per byte, giving
11116 -an expansion of around 0.5%.
11117 -
11118 -</P>
11119 -<P>
11120 -As a self-check for your protection, <CODE>bzip2</CODE> uses 32-bit CRCs to
11121 -make sure that the decompressed version of a file is identical to the
11122 -original.  This guards against corruption of the compressed data, and
11123 -against undetected bugs in <CODE>bzip2</CODE> (hopefully very unlikely).  The
11124 -chances of data corruption going undetected is microscopic, about one
11125 -chance in four billion for each file processed.  Be aware, though, that
11126 -the check occurs upon decompression, so it can only tell you that
11127 -something is wrong.  It can't help you recover the original uncompressed
11128 -data.  You can use <CODE>bzip2recover</CODE> to try to recover data from
11129 -damaged files.
11130 -
11131 -</P>
11132 -<P>
11133 -Return values: 0 for a normal exit, 1 for environmental problems (file
11134 -not found, invalid flags, I/O errors, &#38;c), 2 to indicate a corrupt
11135 -compressed file, 3 for an internal consistency error (eg, bug) which
11136 -caused <CODE>bzip2</CODE> to panic.
11137 -
11138 -</P>
11139 -
11140 -
11141 -
11142 -<H4><A NAME="SEC6" HREF="manual_toc.html#TOC6">OPTIONS</A></H4>
11143 -<DL COMPACT>
11144 -
11145 -<DT><CODE>-c  --stdout</CODE>
11146 -<DD>
11147 -Compress or decompress to standard output.
11148 -<DT><CODE>-d  --decompress</CODE>
11149 -<DD>
11150 -Force decompression.  <CODE>bzip2</CODE>, <CODE>bunzip2</CODE> and <CODE>bzcat</CODE> are
11151 -really the same program, and the decision about what actions to take is
11152 -done on the basis of which name is used.  This flag overrides that
11153 -mechanism, and forces bzip2 to decompress.
11154 -<DT><CODE>-z --compress</CODE>
11155 -<DD>
11156 -The complement to <CODE>-d</CODE>: forces compression, regardless of the
11157 -invokation name.
11158 -<DT><CODE>-t --test</CODE>
11159 -<DD>
11160 -Check integrity of the specified file(s), but don't decompress them.
11161 -This really performs a trial decompression and throws away the result.
11162 -<DT><CODE>-f --force</CODE>
11163 -<DD>
11164 -Force overwrite of output files.  Normally, <CODE>bzip2</CODE> will not overwrite
11165 -existing output files.  Also forces <CODE>bzip2</CODE> to break hard links
11166 -to files, which it otherwise wouldn't do.
11167 -<DT><CODE>-k --keep</CODE>
11168 -<DD>
11169 -Keep (don't delete) input files during compression
11170 -or decompression.
11171 -<DT><CODE>-s --small</CODE>
11172 -<DD>
11173 -Reduce memory usage, for compression, decompression and testing.  Files
11174 -are decompressed and tested using a modified algorithm which only
11175 -requires 2.5 bytes per block byte.  This means any file can be
11176 -decompressed in 2300k of memory, albeit at about half the normal speed.
11177 -
11178 -During compression, <CODE>-s</CODE> selects a block size of 200k, which limits
11179 -memory use to around the same figure, at the expense of your compression
11180 -ratio.  In short, if your machine is low on memory (8 megabytes or
11181 -less), use -s for everything.  See MEMORY MANAGEMENT below.
11182 -<DT><CODE>-q --quiet</CODE>
11183 -<DD>
11184 -Suppress non-essential warning messages.  Messages pertaining to
11185 -I/O errors and other critical events will not be suppressed.
11186 -<DT><CODE>-v --verbose</CODE>
11187 -<DD>
11188 -Verbose mode -- show the compression ratio for each file processed.
11189 -Further <CODE>-v</CODE>'s increase the verbosity level, spewing out lots of
11190 -information which is primarily of interest for diagnostic purposes.
11191 -<DT><CODE>-L --license -V --version</CODE>
11192 -<DD>
11193 -Display the software version, license terms and conditions.
11194 -<DT><CODE>-1 to -9</CODE>
11195 -<DD>
11196 -Set the block size to 100 k, 200 k ..  900 k when compressing.  Has no
11197 -effect when decompressing.  See MEMORY MANAGEMENT below.
11198 -<DT><CODE>--</CODE>
11199 -<DD>
11200 -Treats all subsequent arguments as file names, even if they start
11201 -with a dash.  This is so you can handle files with names beginning
11202 -with a dash, for example: <CODE>bzip2 -- -myfilename</CODE>.
11203 -<DT><CODE>--repetitive-fast</CODE>
11204 -<DD>
11205 -<DT><CODE>--repetitive-best</CODE>
11206 -<DD>
11207 -These flags are redundant in versions 0.9.5 and above.  They provided
11208 -some coarse control over the behaviour of the sorting algorithm in
11209 -earlier versions, which was sometimes useful.  0.9.5 and above have an
11210 -improved algorithm which renders these flags irrelevant.
11211 -</DL>
11212 -
11213 -
11214 -
11215 -<H4><A NAME="SEC7" HREF="manual_toc.html#TOC7">MEMORY MANAGEMENT</A></H4>
11216 -
11217 -<P>
11218 -<CODE>bzip2</CODE> compresses large files in blocks.  The block size affects
11219 -both the compression ratio achieved, and the amount of memory needed for
11220 -compression and decompression.  The flags <CODE>-1</CODE> through <CODE>-9</CODE>
11221 -specify the block size to be 100,000 bytes through 900,000 bytes (the
11222 -default) respectively.  At decompression time, the block size used for
11223 -compression is read from the header of the compressed file, and
11224 -<CODE>bunzip2</CODE> then allocates itself just enough memory to decompress
11225 -the file.  Since block sizes are stored in compressed files, it follows
11226 -that the flags <CODE>-1</CODE> to <CODE>-9</CODE> are irrelevant to and so ignored
11227 -during decompression.
11228 -
11229 -</P>
11230 -<P>
11231 -Compression and decompression requirements, in bytes, can be estimated
11232 -as:
11233 -
11234 -<PRE>
11235 -     Compression:   400k + ( 8 x block size )
11236 -
11237 -     Decompression: 100k + ( 4 x block size ), or
11238 -                    100k + ( 2.5 x block size )
11239 -</PRE>
11240 -
11241 -<P>
11242 -Larger block sizes give rapidly diminishing marginal returns.  Most of
11243 -the compression comes from the first two or three hundred k of block
11244 -size, a fact worth bearing in mind when using <CODE>bzip2</CODE> on small machines.
11245 -It is also important to appreciate that the decompression memory
11246 -requirement is set at compression time by the choice of block size.
11247 -
11248 -</P>
11249 -<P>
11250 -For files compressed with the default 900k block size, <CODE>bunzip2</CODE>
11251 -will require about 3700 kbytes to decompress.  To support decompression
11252 -of any file on a 4 megabyte machine, <CODE>bunzip2</CODE> has an option to
11253 -decompress using approximately half this amount of memory, about 2300
11254 -kbytes.  Decompression speed is also halved, so you should use this
11255 -option only where necessary.  The relevant flag is <CODE>-s</CODE>.
11256 -
11257 -</P>
11258 -<P>
11259 -In general, try and use the largest block size memory constraints allow,
11260 -since that maximises the compression achieved.  Compression and
11261 -decompression speed are virtually unaffected by block size.
11262 -
11263 -</P>
11264 -<P>
11265 -Another significant point applies to files which fit in a single block
11266 --- that means most files you'd encounter using a large block size.  The
11267 -amount of real memory touched is proportional to the size of the file,
11268 -since the file is smaller than a block.  For example, compressing a file
11269 -20,000 bytes long with the flag <CODE>-9</CODE> will cause the compressor to
11270 -allocate around 7600k of memory, but only touch 400k + 20000 * 8 = 560
11271 -kbytes of it.  Similarly, the decompressor will allocate 3700k but only
11272 -touch 100k + 20000 * 4 = 180 kbytes.
11273 -
11274 -</P>
11275 -<P>
11276 -Here is a table which summarises the maximum memory usage for different
11277 -block sizes.  Also recorded is the total compressed size for 14 files of
11278 -the Calgary Text Compression Corpus totalling 3,141,622 bytes.  This
11279 -column gives some feel for how compression varies with block size.
11280 -These figures tend to understate the advantage of larger block sizes for
11281 -larger files, since the Corpus is dominated by smaller files.
11282 -
11283 -<PRE>
11284 -          Compress   Decompress   Decompress   Corpus
11285 -   Flag     usage      usage       -s usage     Size
11286 -
11287 -    -1      1200k       500k         350k      914704
11288 -    -2      2000k       900k         600k      877703
11289 -    -3      2800k      1300k         850k      860338
11290 -    -4      3600k      1700k        1100k      846899
11291 -    -5      4400k      2100k        1350k      845160
11292 -    -6      5200k      2500k        1600k      838626
11293 -    -7      6100k      2900k        1850k      834096
11294 -    -8      6800k      3300k        2100k      828642
11295 -    -9      7600k      3700k        2350k      828642
11296 -</PRE>
11297 -
11298 -
11299 -
11300 -<H4><A NAME="SEC8" HREF="manual_toc.html#TOC8">RECOVERING DATA FROM DAMAGED FILES</A></H4>
11301 -
11302 -<P>
11303 -<CODE>bzip2</CODE> compresses files in blocks, usually 900kbytes long.  Each
11304 -block is handled independently.  If a media or transmission error causes
11305 -a multi-block <CODE>.bz2</CODE> file to become damaged, it may be possible to
11306 -recover data from the undamaged blocks in the file.
11307 -
11308 -</P>
11309 -<P>
11310 -The compressed representation of each block is delimited by a 48-bit
11311 -pattern, which makes it possible to find the block boundaries with
11312 -reasonable certainty.  Each block also carries its own 32-bit CRC, so
11313 -damaged blocks can be distinguished from undamaged ones.
11314 -
11315 -</P>
11316 -<P>
11317 -<CODE>bzip2recover</CODE> is a simple program whose purpose is to search for
11318 -blocks in <CODE>.bz2</CODE> files, and write each block out into its own
11319 -<CODE>.bz2</CODE> file.  You can then use <CODE>bzip2 -t</CODE> to test the
11320 -integrity of the resulting files, and decompress those which are
11321 -undamaged.
11322 -
11323 -</P>
11324 -<P>
11325 -<CODE>bzip2recover</CODE> 
11326 -takes a single argument, the name of the damaged file, 
11327 -and writes a number of files <CODE>rec0001file.bz2</CODE>,
11328 -       <CODE>rec0002file.bz2</CODE>, etc, containing the  extracted  blocks.
11329 -       The  output  filenames  are  designed  so  that the use of
11330 -       wildcards in subsequent processing -- for example,  
11331 -<CODE>bzip2 -dc  rec*file.bz2 &#62; recovered_data</CODE> -- lists the files in
11332 -       the correct order.
11333 -
11334 -</P>
11335 -<P>
11336 -<CODE>bzip2recover</CODE> should be of most use dealing with large <CODE>.bz2</CODE>
11337 -       files,  as  these will contain many blocks.  It is clearly
11338 -       futile to use it on damaged single-block  files,  since  a
11339 -       damaged  block  cannot  be recovered.  If you wish to minimise 
11340 -any potential data loss through media  or  transmission errors, 
11341 -you might consider compressing with a smaller
11342 -       block size.
11343 -
11344 -</P>
11345 -
11346 -
11347 -
11348 -<H4><A NAME="SEC9" HREF="manual_toc.html#TOC9">PERFORMANCE NOTES</A></H4>
11349 -
11350 -<P>
11351 -The sorting phase of compression gathers together similar strings in the
11352 -file.  Because of this, files containing very long runs of repeated
11353 -symbols, like "aabaabaabaab ..."  (repeated several hundred times) may
11354 -compress more slowly than normal.  Versions 0.9.5 and above fare much
11355 -better than previous versions in this respect.  The ratio between
11356 -worst-case and average-case compression time is in the region of 10:1.
11357 -For previous versions, this figure was more like 100:1.  You can use the
11358 -<CODE>-vvvv</CODE> option to monitor progress in great detail, if you want.
11359 -
11360 -</P>
11361 -<P>
11362 -Decompression speed is unaffected by these phenomena.
11363 -
11364 -</P>
11365 -<P>
11366 -<CODE>bzip2</CODE> usually allocates several megabytes of memory to operate
11367 -in, and then charges all over it in a fairly random fashion.  This means
11368 -that performance, both for compressing and decompressing, is largely
11369 -determined by the speed at which your machine can service cache misses.
11370 -Because of this, small changes to the code to reduce the miss rate have
11371 -been observed to give disproportionately large performance improvements.
11372 -I imagine <CODE>bzip2</CODE> will perform best on machines with very large
11373 -caches.
11374 -
11375 -</P>
11376 -
11377 -
11378 -
11379 -<H4><A NAME="SEC10" HREF="manual_toc.html#TOC10">CAVEATS</A></H4>
11380 -
11381 -<P>
11382 -I/O error messages are not as helpful as they could be.  <CODE>bzip2</CODE>
11383 -tries hard to detect I/O errors and exit cleanly, but the details of
11384 -what the problem is sometimes seem rather misleading.
11385 -
11386 -</P>
11387 -<P>
11388 -This manual page pertains to version 1.0 of <CODE>bzip2</CODE>.  Compressed
11389 -data created by this version is entirely forwards and backwards
11390 -compatible with the previous public releases, versions 0.1pl2, 0.9.0 and
11391 -0.9.5, but with the following exception: 0.9.0 and above can correctly
11392 -decompress multiple concatenated compressed files.  0.1pl2 cannot do
11393 -this; it will stop after decompressing just the first file in the
11394 -stream.
11395 -
11396 -</P>
11397 -<P>
11398 -<CODE>bzip2recover</CODE> uses 32-bit integers to represent bit positions in
11399 -compressed files, so it cannot handle compressed files more than 512
11400 -megabytes long.  This could easily be fixed.
11401 -
11402 -</P>
11403 -
11404 -
11405 -
11406 -<H4><A NAME="SEC11" HREF="manual_toc.html#TOC11">AUTHOR</A></H4>
11407 -<P>
11408 -Julian Seward, <CODE>jseward@acm.org</CODE>.
11409 -
11410 -</P>
11411 -<P>
11412 -The ideas embodied in <CODE>bzip2</CODE> are due to (at least) the following
11413 -people: Michael Burrows and David Wheeler (for the block sorting
11414 -transformation), David Wheeler (again, for the Huffman coder), Peter
11415 -Fenwick (for the structured coding model in the original <CODE>bzip</CODE>,
11416 -and many refinements), and Alistair Moffat, Radford Neal and Ian Witten
11417 -(for the arithmetic coder in the original <CODE>bzip</CODE>).  I am much
11418 -indebted for their help, support and advice.  See the manual in the
11419 -source distribution for pointers to sources of documentation.  Christian
11420 -von Roques encouraged me to look for faster sorting algorithms, so as to
11421 -speed up compression.  Bela Lubkin encouraged me to improve the
11422 -worst-case compression performance.  Many people sent patches, helped
11423 -with portability problems, lent machines, gave advice and were generally
11424 -helpful.
11425 -
11426 -</P>
11427 -</BLOCKQUOTE>
11428 -
11429 -<P><HR><P>
11430 -<p>Go to the <A HREF="manual_1.html">first</A>, <A HREF="manual_1.html">previous</A>, <A HREF="manual_3.html">next</A>, <A HREF="manual_4.html">last</A> section, <A HREF="manual_toc.html">table of contents</A>.
11431 -</BODY>
11432 -</HTML>
11433 diff -Nru bzip2-1.0.1/manual_3.html bzip2-1.0.1.new/manual_3.html
11434 --- bzip2-1.0.1/manual_3.html   Sat Jun 24 20:13:27 2000
11435 +++ bzip2-1.0.1.new/manual_3.html       Thu Jan  1 01:00:00 1970
11436 @@ -1,1773 +0,0 @@
11437 -<HTML>
11438 -<HEAD>
11439 -<!-- This HTML file has been created by texi2html 1.54
11440 -     from manual.texi on 23 March 2000 -->
11441 -
11442 -<TITLE>bzip2 and libbzip2 - Programming with libbzip2</TITLE>
11443 -<link href="manual_4.html" rel=Next>
11444 -<link href="manual_2.html" rel=Previous>
11445 -<link href="manual_toc.html" rel=ToC>
11446 -
11447 -</HEAD>
11448 -<BODY>
11449 -<p>Go to the <A HREF="manual_1.html">first</A>, <A HREF="manual_2.html">previous</A>, <A HREF="manual_4.html">next</A>, <A HREF="manual_4.html">last</A> section, <A HREF="manual_toc.html">table of contents</A>.
11450 -<P><HR><P>
11451 -
11452 -
11453 -<H1><A NAME="SEC12" HREF="manual_toc.html#TOC12">Programming with <CODE>libbzip2</CODE></A></H1>
11454 -
11455 -<P>
11456 -This chapter describes the programming interface to <CODE>libbzip2</CODE>.
11457 -
11458 -</P>
11459 -<P>
11460 -For general background information, particularly about memory
11461 -use and performance aspects, you'd be well advised to read Chapter 2
11462 -as well.
11463 -
11464 -</P>
11465 -
11466 -
11467 -<H2><A NAME="SEC13" HREF="manual_toc.html#TOC13">Top-level structure</A></H2>
11468 -
11469 -<P>
11470 -<CODE>libbzip2</CODE> is a flexible library for compressing and decompressing
11471 -data in the <CODE>bzip2</CODE> data format.  Although packaged as a single
11472 -entity, it helps to regard the library as three separate parts: the low
11473 -level interface, and the high level interface, and some utility
11474 -functions.
11475 -
11476 -</P>
11477 -<P>
11478 -The structure of <CODE>libbzip2</CODE>'s interfaces is similar to
11479 -that of Jean-loup Gailly's and Mark Adler's excellent <CODE>zlib</CODE> 
11480 -library.
11481 -
11482 -</P>
11483 -<P>
11484 -All externally visible symbols have names beginning <CODE>BZ2_</CODE>.
11485 -This is new in version 1.0.  The intention is to minimise pollution
11486 -of the namespaces of library clients.
11487 -
11488 -</P>
11489 -
11490 -
11491 -<H3><A NAME="SEC14" HREF="manual_toc.html#TOC14">Low-level summary</A></H3>
11492 -
11493 -<P>
11494 -This interface provides services for compressing and decompressing
11495 -data in memory.  There's no provision for dealing with files, streams
11496 -or any other I/O mechanisms, just straight memory-to-memory work.
11497 -In fact, this part of the library can be compiled without inclusion
11498 -of <CODE>stdio.h</CODE>, which may be helpful for embedded applications.
11499 -
11500 -</P>
11501 -<P>
11502 -The low-level part of the library has no global variables and
11503 -is therefore thread-safe.
11504 -
11505 -</P>
11506 -<P>
11507 -Six routines make up the low level interface: 
11508 -<CODE>BZ2_bzCompressInit</CODE>, <CODE>BZ2_bzCompress</CODE>, and <BR> <CODE>BZ2_bzCompressEnd</CODE>
11509 -for compression,
11510 -and a corresponding trio <CODE>BZ2_bzDecompressInit</CODE>, <BR> <CODE>BZ2_bzDecompress</CODE>
11511 -and <CODE>BZ2_bzDecompressEnd</CODE> for decompression.  
11512 -The <CODE>*Init</CODE> functions allocate
11513 -memory for compression/decompression and do other
11514 -initialisations, whilst the <CODE>*End</CODE> functions close down operations
11515 -and release memory.
11516 -
11517 -</P>
11518 -<P>
11519 -The real work is done by <CODE>BZ2_bzCompress</CODE> and <CODE>BZ2_bzDecompress</CODE>.  
11520 -These compress and decompress data from a user-supplied input buffer
11521 -to a user-supplied output buffer.  These buffers can be any size;
11522 -arbitrary quantities of data are handled by making repeated calls
11523 -to these functions.  This is a flexible mechanism allowing a 
11524 -consumer-pull style of activity, or producer-push, or a mixture of
11525 -both.
11526 -
11527 -</P>
11528 -
11529 -
11530 -
11531 -<H3><A NAME="SEC15" HREF="manual_toc.html#TOC15">High-level summary</A></H3>
11532 -
11533 -<P>
11534 -This interface provides some handy wrappers around the low-level
11535 -interface to facilitate reading and writing <CODE>bzip2</CODE> format
11536 -files (<CODE>.bz2</CODE> files).  The routines provide hooks to facilitate
11537 -reading files in which the <CODE>bzip2</CODE> data stream is embedded 
11538 -within some larger-scale file structure, or where there are
11539 -multiple <CODE>bzip2</CODE> data streams concatenated end-to-end.
11540 -
11541 -</P>
11542 -<P>
11543 -For reading files, <CODE>BZ2_bzReadOpen</CODE>, <CODE>BZ2_bzRead</CODE>,
11544 -<CODE>BZ2_bzReadClose</CODE> and <BR> <CODE>BZ2_bzReadGetUnused</CODE> are supplied.  For
11545 -writing files, <CODE>BZ2_bzWriteOpen</CODE>, <CODE>BZ2_bzWrite</CODE> and
11546 -<CODE>BZ2_bzWriteFinish</CODE> are available.
11547 -
11548 -</P>
11549 -<P>
11550 -As with the low-level library, no global variables are used
11551 -so the library is per se thread-safe.  However, if I/O errors
11552 -occur whilst reading or writing the underlying compressed files,
11553 -you may have to consult <CODE>errno</CODE> to determine the cause of
11554 -the error.  In that case, you'd need a C library which correctly
11555 -supports <CODE>errno</CODE> in a multithreaded environment.
11556 -
11557 -</P>
11558 -<P>
11559 -To make the library a little simpler and more portable,
11560 -<CODE>BZ2_bzReadOpen</CODE> and <CODE>BZ2_bzWriteOpen</CODE> require you to pass them file
11561 -handles (<CODE>FILE*</CODE>s) which have previously been opened for reading or
11562 -writing respectively.  That avoids portability problems associated with
11563 -file operations and file attributes, whilst not being much of an
11564 -imposition on the programmer.
11565 -
11566 -</P>
11567 -
11568 -
11569 -
11570 -<H3><A NAME="SEC16" HREF="manual_toc.html#TOC16">Utility functions summary</A></H3>
11571 -<P>
11572 -For very simple needs, <CODE>BZ2_bzBuffToBuffCompress</CODE> and
11573 -<CODE>BZ2_bzBuffToBuffDecompress</CODE> are provided.  These compress
11574 -data in memory from one buffer to another buffer in a single
11575 -function call.  You should assess whether these functions
11576 -fulfill your memory-to-memory compression/decompression
11577 -requirements before investing effort in understanding the more
11578 -general but more complex low-level interface.
11579 -
11580 -</P>
11581 -<P>
11582 -Yoshioka Tsuneo (<CODE>QWF00133@niftyserve.or.jp</CODE> /
11583 -<CODE>tsuneo-y@is.aist-nara.ac.jp</CODE>) has contributed some functions to
11584 -give better <CODE>zlib</CODE> compatibility.  These functions are
11585 -<CODE>BZ2_bzopen</CODE>, <CODE>BZ2_bzread</CODE>, <CODE>BZ2_bzwrite</CODE>, <CODE>BZ2_bzflush</CODE>,
11586 -<CODE>BZ2_bzclose</CODE>,
11587 -<CODE>BZ2_bzerror</CODE> and <CODE>BZ2_bzlibVersion</CODE>.  You may find these functions
11588 -more convenient for simple file reading and writing, than those in the
11589 -high-level interface.  These functions are not (yet) officially part of
11590 -the library, and are minimally documented here.  If they break, you
11591 -get to keep all the pieces.  I hope to document them properly when time
11592 -permits.
11593 -
11594 -</P>
11595 -<P>
11596 -Yoshioka also contributed modifications to allow the library to be
11597 -built as a Windows DLL.
11598 -
11599 -</P>
11600 -
11601 -
11602 -
11603 -<H2><A NAME="SEC17" HREF="manual_toc.html#TOC17">Error handling</A></H2>
11604 -
11605 -<P>
11606 -The library is designed to recover cleanly in all situations, including
11607 -the worst-case situation of decompressing random data.  I'm not 
11608 -100% sure that it can always do this, so you might want to add
11609 -a signal handler to catch segmentation violations during decompression
11610 -if you are feeling especially paranoid.  I would be interested in
11611 -hearing more about the robustness of the library to corrupted
11612 -compressed data.
11613 -
11614 -</P>
11615 -<P>
11616 -Version 1.0 is much more robust in this respect than
11617 -0.9.0 or 0.9.5.  Investigations with Checker (a tool for 
11618 -detecting problems with memory management, similar to Purify)
11619 -indicate that, at least for the few files I tested, all single-bit
11620 -errors in the decompressed data are caught properly, with no
11621 -segmentation faults, no reads of uninitialised data and no 
11622 -out of range reads or writes.  So it's certainly much improved,
11623 -although I wouldn't claim it to be totally bombproof.
11624 -
11625 -</P>
11626 -<P>
11627 -The file <CODE>bzlib.h</CODE> contains all definitions needed to use
11628 -the library.  In particular, you should definitely not include
11629 -<CODE>bzlib_private.h</CODE>.
11630 -
11631 -</P>
11632 -<P>
11633 -In <CODE>bzlib.h</CODE>, the various return values are defined.  The following
11634 -list is not intended as an exhaustive description of the circumstances 
11635 -in which a given value may be returned -- those descriptions are given
11636 -later.  Rather, it is intended to convey the rough meaning of each
11637 -return value.  The first five actions are normal and not intended to 
11638 -denote an error situation.
11639 -<DL COMPACT>
11640 -
11641 -<DT><CODE>BZ_OK</CODE>
11642 -<DD>
11643 -The requested action was completed successfully.
11644 -<DT><CODE>BZ_RUN_OK</CODE>
11645 -<DD>
11646 -<DT><CODE>BZ_FLUSH_OK</CODE>
11647 -<DD>
11648 -<DT><CODE>BZ_FINISH_OK</CODE>
11649 -<DD>
11650 -In <CODE>BZ2_bzCompress</CODE>, the requested flush/finish/nothing-special action
11651 -was completed successfully.
11652 -<DT><CODE>BZ_STREAM_END</CODE>
11653 -<DD>
11654 -Compression of data was completed, or the logical stream end was
11655 -detected during decompression.
11656 -</DL>
11657 -
11658 -<P>
11659 -The following return values indicate an error of some kind.
11660 -<DL COMPACT>
11661 -
11662 -<DT><CODE>BZ_CONFIG_ERROR</CODE>
11663 -<DD>
11664 -Indicates that the library has been improperly compiled on your
11665 -platform -- a major configuration error.  Specifically, it means
11666 -that <CODE>sizeof(char)</CODE>, <CODE>sizeof(short)</CODE> and <CODE>sizeof(int)</CODE>
11667 -are not 1, 2 and 4 respectively, as they should be.  Note that the 
11668 -library should still work properly on 64-bit platforms which follow
11669 -the LP64 programming model -- that is, where <CODE>sizeof(long)</CODE>
11670 -and <CODE>sizeof(void*)</CODE> are 8.  Under LP64, <CODE>sizeof(int)</CODE> is
11671 -still 4, so <CODE>libbzip2</CODE>, which doesn't use the <CODE>long</CODE> type,
11672 -is OK.
11673 -<DT><CODE>BZ_SEQUENCE_ERROR</CODE>
11674 -<DD>
11675 -When using the library, it is important to call the functions in the
11676 -correct sequence and with data structures (buffers etc) in the correct
11677 -states.  <CODE>libbzip2</CODE> checks as much as it can to ensure this is
11678 -happening, and returns <CODE>BZ_SEQUENCE_ERROR</CODE> if not.  Code which
11679 -complies precisely with the function semantics, as detailed below,
11680 -should never receive this value; such an event denotes buggy code
11681 -which you should investigate.
11682 -<DT><CODE>BZ_PARAM_ERROR</CODE>
11683 -<DD>
11684 -Returned when a parameter to a function call is out of range 
11685 -or otherwise manifestly incorrect.  As with <CODE>BZ_SEQUENCE_ERROR</CODE>,
11686 -this denotes a bug in the client code.  The distinction between
11687 -<CODE>BZ_PARAM_ERROR</CODE> and <CODE>BZ_SEQUENCE_ERROR</CODE> is a bit hazy, but still worth
11688 -making.
11689 -<DT><CODE>BZ_MEM_ERROR</CODE>
11690 -<DD>
11691 -Returned when a request to allocate memory failed.  Note that the
11692 -quantity of memory needed to decompress a stream cannot be determined
11693 -until the stream's header has been read.  So <CODE>BZ2_bzDecompress</CODE> and
11694 -<CODE>BZ2_bzRead</CODE> may return <CODE>BZ_MEM_ERROR</CODE> even though some of
11695 -the compressed data has been read.  The same is not true for
11696 -compression; once <CODE>BZ2_bzCompressInit</CODE> or <CODE>BZ2_bzWriteOpen</CODE> have
11697 -successfully completed, <CODE>BZ_MEM_ERROR</CODE> cannot occur.
11698 -<DT><CODE>BZ_DATA_ERROR</CODE>
11699 -<DD>
11700 -Returned when a data integrity error is detected during decompression.
11701 -Most importantly, this means when stored and computed CRCs for the
11702 -data do not match.  This value is also returned upon detection of any
11703 -other anomaly in the compressed data.
11704 -<DT><CODE>BZ_DATA_ERROR_MAGIC</CODE>
11705 -<DD>
11706 -As a special case of <CODE>BZ_DATA_ERROR</CODE>, it is sometimes useful to
11707 -know when the compressed stream does not start with the correct
11708 -magic bytes (<CODE>'B' 'Z' 'h'</CODE>).  
11709 -<DT><CODE>BZ_IO_ERROR</CODE>
11710 -<DD>
11711 -Returned by <CODE>BZ2_bzRead</CODE> and <CODE>BZ2_bzWrite</CODE> when there is an error
11712 -reading or writing in the compressed file, and by <CODE>BZ2_bzReadOpen</CODE>
11713 -and <CODE>BZ2_bzWriteOpen</CODE> for attempts to use a file for which the
11714 -error indicator (viz, <CODE>ferror(f)</CODE>) is set.
11715 -On receipt of <CODE>BZ_IO_ERROR</CODE>, the caller should consult
11716 -<CODE>errno</CODE> and/or <CODE>perror</CODE> to acquire operating-system
11717 -specific information about the problem.
11718 -<DT><CODE>BZ_UNEXPECTED_EOF</CODE>
11719 -<DD>
11720 -Returned by <CODE>BZ2_bzRead</CODE> when the compressed file finishes
11721 -before the logical end of stream is detected.
11722 -<DT><CODE>BZ_OUTBUFF_FULL</CODE>
11723 -<DD>
11724 -Returned by <CODE>BZ2_bzBuffToBuffCompress</CODE> and
11725 -<CODE>BZ2_bzBuffToBuffDecompress</CODE> to indicate that the output data
11726 -will not fit into the output buffer provided.
11727 -</DL>
11728 -
11729 -
11730 -
11731 -<H2><A NAME="SEC18" HREF="manual_toc.html#TOC18">Low-level interface</A></H2>
11732 -
11733 -
11734 -
11735 -<H3><A NAME="SEC19" HREF="manual_toc.html#TOC19"><CODE>BZ2_bzCompressInit</CODE></A></H3>
11736 -
11737 -<PRE>
11738 -typedef 
11739 -   struct {
11740 -      char *next_in;
11741 -      unsigned int avail_in;
11742 -      unsigned int total_in_lo32;
11743 -      unsigned int total_in_hi32;
11744 -
11745 -      char *next_out;
11746 -      unsigned int avail_out;
11747 -      unsigned int total_out_lo32;
11748 -      unsigned int total_out_hi32;
11749 -
11750 -      void *state;
11751 -
11752 -      void *(*bzalloc)(void *,int,int);
11753 -      void (*bzfree)(void *,void *);
11754 -      void *opaque;
11755 -   } 
11756 -   bz_stream;
11757 -
11758 -int BZ2_bzCompressInit ( bz_stream *strm, 
11759 -                         int blockSize100k, 
11760 -                         int verbosity,
11761 -                         int workFactor );
11762 -
11763 -</PRE>
11764 -
11765 -<P>
11766 -Prepares for compression.  The <CODE>bz_stream</CODE> structure
11767 -holds all data pertaining to the compression activity.  
11768 -A <CODE>bz_stream</CODE> structure should be allocated and initialised
11769 -prior to the call.
11770 -The fields of <CODE>bz_stream</CODE>
11771 -comprise the entirety of the user-visible data.  <CODE>state</CODE>
11772 -is a pointer to the private data structures required for compression.
11773 -
11774 -</P>
11775 -<P>
11776 -Custom memory allocators are supported, via fields <CODE>bzalloc</CODE>, 
11777 -<CODE>bzfree</CODE>,
11778 -and <CODE>opaque</CODE>.  The value 
11779 -<CODE>opaque</CODE> is passed to as the first argument to
11780 -all calls to <CODE>bzalloc</CODE> and <CODE>bzfree</CODE>, but is 
11781 -otherwise ignored by the library.
11782 -The call <CODE>bzalloc ( opaque, n, m )</CODE> is expected to return a 
11783 -pointer <CODE>p</CODE> to
11784 -<CODE>n * m</CODE> bytes of memory, and <CODE>bzfree ( opaque, p )</CODE> 
11785 -should free
11786 -that memory.
11787 -
11788 -</P>
11789 -<P>
11790 -If you don't want to use a custom memory allocator, set <CODE>bzalloc</CODE>, 
11791 -<CODE>bzfree</CODE> and
11792 -<CODE>opaque</CODE> to <CODE>NULL</CODE>, 
11793 -and the library will then use the standard <CODE>malloc</CODE>/<CODE>free</CODE>
11794 -routines.
11795 -
11796 -</P>
11797 -<P>
11798 -Before calling <CODE>BZ2_bzCompressInit</CODE>, fields <CODE>bzalloc</CODE>, 
11799 -<CODE>bzfree</CODE> and <CODE>opaque</CODE> should
11800 -be filled appropriately, as just described.  Upon return, the internal
11801 -state will have been allocated and initialised, and <CODE>total_in_lo32</CODE>, 
11802 -<CODE>total_in_hi32</CODE>, <CODE>total_out_lo32</CODE> and 
11803 -<CODE>total_out_hi32</CODE> will have been set to zero.  
11804 -These four fields are used by the library
11805 -to inform the caller of the total amount of data passed into and out of
11806 -the library, respectively.  You should not try to change them.
11807 -As of version 1.0, 64-bit counts are maintained, even on 32-bit
11808 -platforms, using the <CODE>_hi32</CODE> fields to store the upper 32 bits
11809 -of the count.  So, for example, the total amount of data in
11810 -is <CODE>(total_in_hi32 &#60;&#60; 32) + total_in_lo32</CODE>.
11811 -
11812 -</P>
11813 -<P>
11814 -Parameter <CODE>blockSize100k</CODE> specifies the block size to be used for
11815 -compression.  It should be a value between 1 and 9 inclusive, and the
11816 -actual block size used is 100000 x this figure.  9 gives the best
11817 -compression but takes most memory.
11818 -
11819 -</P>
11820 -<P>
11821 -Parameter <CODE>verbosity</CODE> should be set to a number between 0 and 4
11822 -inclusive.  0 is silent, and greater numbers give increasingly verbose
11823 -monitoring/debugging output.  If the library has been compiled with
11824 -<CODE>-DBZ_NO_STDIO</CODE>, no such output will appear for any verbosity
11825 -setting.
11826 -
11827 -</P>
11828 -<P>
11829 -Parameter <CODE>workFactor</CODE> controls how the compression phase behaves
11830 -when presented with worst case, highly repetitive, input data.  If
11831 -compression runs into difficulties caused by repetitive data, the
11832 -library switches from the standard sorting algorithm to a fallback
11833 -algorithm.  The fallback is slower than the standard algorithm by
11834 -perhaps a factor of three, but always behaves reasonably, no matter how
11835 -bad the input.
11836 -
11837 -</P>
11838 -<P>
11839 -Lower values of <CODE>workFactor</CODE> reduce the amount of effort the
11840 -standard algorithm will expend before resorting to the fallback.  You
11841 -should set this parameter carefully; too low, and many inputs will be
11842 -handled by the fallback algorithm and so compress rather slowly, too
11843 -high, and your average-to-worst case compression times can become very
11844 -large.  The default value of 30 gives reasonable behaviour over a wide
11845 -range of circumstances.
11846 -
11847 -</P>
11848 -<P>
11849 -Allowable values range from 0 to 250 inclusive.  0 is a special case,
11850 -equivalent to using the default value of 30.
11851 -
11852 -</P>
11853 -<P>
11854 -Note that the compressed output generated is the same regardless of
11855 -whether or not the fallback algorithm is used.
11856 -
11857 -</P>
11858 -<P>
11859 -Be aware also that this parameter may disappear entirely in future
11860 -versions of the library.  In principle it should be possible to devise a
11861 -good way to automatically choose which algorithm to use.  Such a
11862 -mechanism would render the parameter obsolete.
11863 -
11864 -</P>
11865 -<P>
11866 -Possible return values:
11867 -
11868 -<PRE>
11869 -      <CODE>BZ_CONFIG_ERROR</CODE>
11870 -         if the library has been mis-compiled
11871 -      <CODE>BZ_PARAM_ERROR</CODE> 
11872 -         if <CODE>strm</CODE> is <CODE>NULL</CODE> 
11873 -         or <CODE>blockSize</CODE> &#60; 1 or <CODE>blockSize</CODE> &#62; 9
11874 -         or <CODE>verbosity</CODE> &#60; 0 or <CODE>verbosity</CODE> &#62; 4
11875 -         or <CODE>workFactor</CODE> &#60; 0 or <CODE>workFactor</CODE> &#62; 250
11876 -      <CODE>BZ_MEM_ERROR</CODE> 
11877 -         if not enough memory is available
11878 -      <CODE>BZ_OK</CODE> 
11879 -         otherwise
11880 -</PRE>
11881 -
11882 -<P>
11883 -Allowable next actions:
11884 -
11885 -<PRE>
11886 -      <CODE>BZ2_bzCompress</CODE> 
11887 -         if <CODE>BZ_OK</CODE> is returned
11888 -      no specific action needed in case of error
11889 -</PRE>
11890 -
11891 -
11892 -
11893 -<H3><A NAME="SEC20" HREF="manual_toc.html#TOC20"><CODE>BZ2_bzCompress</CODE></A></H3>
11894 -
11895 -<PRE>
11896 -   int BZ2_bzCompress ( bz_stream *strm, int action );
11897 -</PRE>
11898 -
11899 -<P>
11900 -Provides more input and/or output buffer space for the library.  The
11901 -caller maintains input and output buffers, and calls <CODE>BZ2_bzCompress</CODE> to
11902 -transfer data between them.
11903 -
11904 -</P>
11905 -<P>
11906 -Before each call to <CODE>BZ2_bzCompress</CODE>, <CODE>next_in</CODE> should point at
11907 -the data to be compressed, and <CODE>avail_in</CODE> should indicate how many
11908 -bytes the library may read.  <CODE>BZ2_bzCompress</CODE> updates <CODE>next_in</CODE>,
11909 -<CODE>avail_in</CODE> and <CODE>total_in</CODE> to reflect the number of bytes it
11910 -has read.
11911 -
11912 -</P>
11913 -<P>
11914 -Similarly, <CODE>next_out</CODE> should point to a buffer in which the
11915 -compressed data is to be placed, with <CODE>avail_out</CODE> indicating how
11916 -much output space is available.  <CODE>BZ2_bzCompress</CODE> updates
11917 -<CODE>next_out</CODE>, <CODE>avail_out</CODE> and <CODE>total_out</CODE> to reflect the
11918 -number of bytes output.
11919 -
11920 -</P>
11921 -<P>
11922 -You may provide and remove as little or as much data as you like on each
11923 -call of <CODE>BZ2_bzCompress</CODE>.  In the limit, it is acceptable to supply and
11924 -remove data one byte at a time, although this would be terribly
11925 -inefficient.  You should always ensure that at least one byte of output
11926 -space is available at each call.
11927 -
11928 -</P>
11929 -<P>
11930 -A second purpose of <CODE>BZ2_bzCompress</CODE> is to request a change of mode of the
11931 -compressed stream.  
11932 -
11933 -</P>
11934 -<P>
11935 -Conceptually, a compressed stream can be in one of four states: IDLE,
11936 -RUNNING, FLUSHING and FINISHING.  Before initialisation
11937 -(<CODE>BZ2_bzCompressInit</CODE>) and after termination (<CODE>BZ2_bzCompressEnd</CODE>), a
11938 -stream is regarded as IDLE.
11939 -
11940 -</P>
11941 -<P>
11942 -Upon initialisation (<CODE>BZ2_bzCompressInit</CODE>), the stream is placed in the
11943 -RUNNING state.  Subsequent calls to <CODE>BZ2_bzCompress</CODE> should pass
11944 -<CODE>BZ_RUN</CODE> as the requested action; other actions are illegal and
11945 -will result in <CODE>BZ_SEQUENCE_ERROR</CODE>.
11946 -
11947 -</P>
11948 -<P>
11949 -At some point, the calling program will have provided all the input data
11950 -it wants to.  It will then want to finish up -- in effect, asking the
11951 -library to process any data it might have buffered internally.  In this
11952 -state, <CODE>BZ2_bzCompress</CODE> will no longer attempt to read data from
11953 -<CODE>next_in</CODE>, but it will want to write data to <CODE>next_out</CODE>.
11954 -Because the output buffer supplied by the user can be arbitrarily small,
11955 -the finishing-up operation cannot necessarily be done with a single call
11956 -of <CODE>BZ2_bzCompress</CODE>.
11957 -
11958 -</P>
11959 -<P>
11960 -Instead, the calling program passes <CODE>BZ_FINISH</CODE> as an action to
11961 -<CODE>BZ2_bzCompress</CODE>.  This changes the stream's state to FINISHING.  Any
11962 -remaining input (ie, <CODE>next_in[0 .. avail_in-1]</CODE>) is compressed and
11963 -transferred to the output buffer.  To do this, <CODE>BZ2_bzCompress</CODE> must be
11964 -called repeatedly until all the output has been consumed.  At that
11965 -point, <CODE>BZ2_bzCompress</CODE> returns <CODE>BZ_STREAM_END</CODE>, and the stream's
11966 -state is set back to IDLE.  <CODE>BZ2_bzCompressEnd</CODE> should then be
11967 -called.
11968 -
11969 -</P>
11970 -<P>
11971 -Just to make sure the calling program does not cheat, the library makes
11972 -a note of <CODE>avail_in</CODE> at the time of the first call to
11973 -<CODE>BZ2_bzCompress</CODE> which has <CODE>BZ_FINISH</CODE> as an action (ie, at the
11974 -time the program has announced its intention to not supply any more
11975 -input).  By comparing this value with that of <CODE>avail_in</CODE> over
11976 -subsequent calls to <CODE>BZ2_bzCompress</CODE>, the library can detect any
11977 -attempts to slip in more data to compress.  Any calls for which this is
11978 -detected will return <CODE>BZ_SEQUENCE_ERROR</CODE>.  This indicates a
11979 -programming mistake which should be corrected.
11980 -
11981 -</P>
11982 -<P>
11983 -Instead of asking to finish, the calling program may ask
11984 -<CODE>BZ2_bzCompress</CODE> to take all the remaining input, compress it and
11985 -terminate the current (Burrows-Wheeler) compression block.  This could
11986 -be useful for error control purposes.  The mechanism is analogous to
11987 -that for finishing: call <CODE>BZ2_bzCompress</CODE> with an action of
11988 -<CODE>BZ_FLUSH</CODE>, remove output data, and persist with the
11989 -<CODE>BZ_FLUSH</CODE> action until the value <CODE>BZ_RUN</CODE> is returned.  As
11990 -with finishing, <CODE>BZ2_bzCompress</CODE> detects any attempt to provide more
11991 -input data once the flush has begun.
11992 -
11993 -</P>
11994 -<P>
11995 -Once the flush is complete, the stream returns to the normal RUNNING
11996 -state.
11997 -
11998 -</P>
11999 -<P>
12000 -This all sounds pretty complex, but isn't really.  Here's a table
12001 -which shows which actions are allowable in each state, what action
12002 -will be taken, what the next state is, and what the non-error return
12003 -values are.  Note that you can't explicitly ask what state the
12004 -stream is in, but nor do you need to -- it can be inferred from the
12005 -values returned by <CODE>BZ2_bzCompress</CODE>.
12006 -
12007 -<PRE>
12008 -IDLE/<CODE>any</CODE>           
12009 -      Illegal.  IDLE state only exists after <CODE>BZ2_bzCompressEnd</CODE> or
12010 -      before <CODE>BZ2_bzCompressInit</CODE>.
12011 -      Return value = <CODE>BZ_SEQUENCE_ERROR</CODE>
12012 -
12013 -RUNNING/<CODE>BZ_RUN</CODE>     
12014 -      Compress from <CODE>next_in</CODE> to <CODE>next_out</CODE> as much as possible.
12015 -      Next state = RUNNING
12016 -      Return value = <CODE>BZ_RUN_OK</CODE>
12017 -
12018 -RUNNING/<CODE>BZ_FLUSH</CODE>   
12019 -      Remember current value of <CODE>next_in</CODE>.  Compress from <CODE>next_in</CODE>
12020 -      to <CODE>next_out</CODE> as much as possible, but do not accept any more input.  
12021 -      Next state = FLUSHING
12022 -      Return value = <CODE>BZ_FLUSH_OK</CODE>
12023 -
12024 -RUNNING/<CODE>BZ_FINISH</CODE>  
12025 -      Remember current value of <CODE>next_in</CODE>.  Compress from <CODE>next_in</CODE>
12026 -      to <CODE>next_out</CODE> as much as possible, but do not accept any more input.
12027 -      Next state = FINISHING
12028 -      Return value = <CODE>BZ_FINISH_OK</CODE>
12029 -
12030 -FLUSHING/<CODE>BZ_FLUSH</CODE>  
12031 -      Compress from <CODE>next_in</CODE> to <CODE>next_out</CODE> as much as possible, 
12032 -      but do not accept any more input.  
12033 -      If all the existing input has been used up and all compressed
12034 -      output has been removed
12035 -         Next state = RUNNING; Return value = <CODE>BZ_RUN_OK</CODE>
12036 -      else
12037 -         Next state = FLUSHING; Return value = <CODE>BZ_FLUSH_OK</CODE>
12038 -
12039 -FLUSHING/other     
12040 -      Illegal.
12041 -      Return value = <CODE>BZ_SEQUENCE_ERROR</CODE>
12042 -
12043 -FINISHING/<CODE>BZ_FINISH</CODE>  
12044 -      Compress from <CODE>next_in</CODE> to <CODE>next_out</CODE> as much as possible,
12045 -      but to not accept any more input.  
12046 -      If all the existing input has been used up and all compressed
12047 -      output has been removed
12048 -         Next state = IDLE; Return value = <CODE>BZ_STREAM_END</CODE>
12049 -      else
12050 -         Next state = FINISHING; Return value = <CODE>BZ_FINISHING</CODE>
12051 -
12052 -FINISHING/other
12053 -      Illegal.
12054 -      Return value = <CODE>BZ_SEQUENCE_ERROR</CODE>
12055 -</PRE>
12056 -
12057 -<P>
12058 -That still looks complicated?  Well, fair enough.  The usual sequence
12059 -of calls for compressing a load of data is:
12060 -
12061 -<UL>
12062 -<LI>Get started with <CODE>BZ2_bzCompressInit</CODE>.
12063 -
12064 -<LI>Shovel data in and shlurp out its compressed form using zero or more
12065 -
12066 -calls of <CODE>BZ2_bzCompress</CODE> with action = <CODE>BZ_RUN</CODE>.
12067 -<LI>Finish up.
12068 -
12069 -Repeatedly call <CODE>BZ2_bzCompress</CODE> with action = <CODE>BZ_FINISH</CODE>, 
12070 -copying out the compressed output, until <CODE>BZ_STREAM_END</CODE> is returned.
12071 -<LI>Close up and go home.  Call <CODE>BZ2_bzCompressEnd</CODE>.
12072 -
12073 -</UL>
12074 -
12075 -<P>
12076 -If the data you want to compress fits into your input buffer all
12077 -at once, you can skip the calls of <CODE>BZ2_bzCompress ( ..., BZ_RUN )</CODE> and 
12078 -just do the <CODE>BZ2_bzCompress ( ..., BZ_FINISH )</CODE> calls.
12079 -
12080 -</P>
12081 -<P>
12082 -All required memory is allocated by <CODE>BZ2_bzCompressInit</CODE>.  The
12083 -compression library can accept any data at all (obviously).  So you
12084 -shouldn't get any error return values from the <CODE>BZ2_bzCompress</CODE> calls.
12085 -If you do, they will be <CODE>BZ_SEQUENCE_ERROR</CODE>, and indicate a bug in
12086 -your programming.
12087 -
12088 -</P>
12089 -<P>
12090 -Trivial other possible return values:
12091 -
12092 -<PRE>
12093 -      <CODE>BZ_PARAM_ERROR</CODE>   
12094 -         if <CODE>strm</CODE> is <CODE>NULL</CODE>, or <CODE>strm-&#62;s</CODE> is <CODE>NULL</CODE>
12095 -</PRE>
12096 -
12097 -
12098 -
12099 -<H3><A NAME="SEC21" HREF="manual_toc.html#TOC21"><CODE>BZ2_bzCompressEnd</CODE></A></H3>
12100 -
12101 -<PRE>
12102 -int BZ2_bzCompressEnd ( bz_stream *strm );
12103 -</PRE>
12104 -
12105 -<P>
12106 -Releases all memory associated with a compression stream.
12107 -
12108 -</P>
12109 -<P>
12110 -Possible return values:
12111 -
12112 -<PRE>
12113 -   <CODE>BZ_PARAM_ERROR</CODE>    if <CODE>strm</CODE> is <CODE>NULL</CODE> or <CODE>strm-&#62;s</CODE> is <CODE>NULL</CODE>
12114 -   <CODE>BZ_OK</CODE>    otherwise
12115 -</PRE>
12116 -
12117 -
12118 -
12119 -<H3><A NAME="SEC22" HREF="manual_toc.html#TOC22"><CODE>BZ2_bzDecompressInit</CODE></A></H3>
12120 -
12121 -<PRE>
12122 -int BZ2_bzDecompressInit ( bz_stream *strm, int verbosity, int small );
12123 -</PRE>
12124 -
12125 -<P>
12126 -Prepares for decompression.  As with <CODE>BZ2_bzCompressInit</CODE>, a
12127 -<CODE>bz_stream</CODE> record should be allocated and initialised before the
12128 -call.  Fields <CODE>bzalloc</CODE>, <CODE>bzfree</CODE> and <CODE>opaque</CODE> should be
12129 -set if a custom memory allocator is required, or made <CODE>NULL</CODE> for
12130 -the normal <CODE>malloc</CODE>/<CODE>free</CODE> routines.  Upon return, the internal
12131 -state will have been initialised, and <CODE>total_in</CODE> and
12132 -<CODE>total_out</CODE> will be zero.
12133 -
12134 -</P>
12135 -<P>
12136 -For the meaning of parameter <CODE>verbosity</CODE>, see <CODE>BZ2_bzCompressInit</CODE>.
12137 -
12138 -</P>
12139 -<P>
12140 -If <CODE>small</CODE> is nonzero, the library will use an alternative
12141 -decompression algorithm which uses less memory but at the cost of
12142 -decompressing more slowly (roughly speaking, half the speed, but the
12143 -maximum memory requirement drops to around 2300k).  See Chapter 2 for
12144 -more information on memory management.
12145 -
12146 -</P>
12147 -<P>
12148 -Note that the amount of memory needed to decompress
12149 -a stream cannot be determined until the stream's header has been read,
12150 -so even if <CODE>BZ2_bzDecompressInit</CODE> succeeds, a subsequent
12151 -<CODE>BZ2_bzDecompress</CODE> could fail with <CODE>BZ_MEM_ERROR</CODE>.
12152 -
12153 -</P>
12154 -<P>
12155 -Possible return values:
12156 -
12157 -<PRE>
12158 -      <CODE>BZ_CONFIG_ERROR</CODE>
12159 -         if the library has been mis-compiled
12160 -      <CODE>BZ_PARAM_ERROR</CODE>
12161 -         if <CODE>(small != 0 &#38;&#38; small != 1)</CODE>
12162 -         or <CODE>(verbosity &#60; 0 || verbosity &#62; 4)</CODE>
12163 -      <CODE>BZ_MEM_ERROR</CODE>
12164 -         if insufficient memory is available
12165 -</PRE>
12166 -
12167 -<P>
12168 -Allowable next actions:
12169 -
12170 -<PRE>
12171 -      <CODE>BZ2_bzDecompress</CODE>
12172 -         if <CODE>BZ_OK</CODE> was returned
12173 -      no specific action required in case of error
12174 -</PRE>
12175 -
12176 -<P>
12177
12178 -
12179 -</P>
12180 -
12181 -
12182 -<H3><A NAME="SEC23" HREF="manual_toc.html#TOC23"><CODE>BZ2_bzDecompress</CODE></A></H3>
12183 -
12184 -<PRE>
12185 -int BZ2_bzDecompress ( bz_stream *strm );
12186 -</PRE>
12187 -
12188 -<P>
12189 -Provides more input and/out output buffer space for the library.  The
12190 -caller maintains input and output buffers, and uses <CODE>BZ2_bzDecompress</CODE>
12191 -to transfer data between them.
12192 -
12193 -</P>
12194 -<P>
12195 -Before each call to <CODE>BZ2_bzDecompress</CODE>, <CODE>next_in</CODE> 
12196 -should point at the compressed data,
12197 -and <CODE>avail_in</CODE> should indicate how many bytes the library
12198 -may read.  <CODE>BZ2_bzDecompress</CODE> updates <CODE>next_in</CODE>, <CODE>avail_in</CODE> 
12199 -and <CODE>total_in</CODE>
12200 -to reflect the number of bytes it has read.
12201 -
12202 -</P>
12203 -<P>
12204 -Similarly, <CODE>next_out</CODE> should point to a buffer in which the uncompressed
12205 -output is to be placed, with <CODE>avail_out</CODE> indicating how much output space
12206 -is available.  <CODE>BZ2_bzCompress</CODE> updates <CODE>next_out</CODE>,
12207 -<CODE>avail_out</CODE> and <CODE>total_out</CODE> to reflect
12208 -the number of bytes output.
12209 -
12210 -</P>
12211 -<P>
12212 -You may provide and remove as little or as much data as you like on
12213 -each call of <CODE>BZ2_bzDecompress</CODE>.  
12214 -In the limit, it is acceptable to
12215 -supply and remove data one byte at a time, although this would be
12216 -terribly inefficient.  You should always ensure that at least one
12217 -byte of output space is available at each call.
12218 -
12219 -</P>
12220 -<P>
12221 -Use of <CODE>BZ2_bzDecompress</CODE> is simpler than <CODE>BZ2_bzCompress</CODE>.
12222 -
12223 -</P>
12224 -<P>
12225 -You should provide input and remove output as described above, and
12226 -repeatedly call <CODE>BZ2_bzDecompress</CODE> until <CODE>BZ_STREAM_END</CODE> is
12227 -returned.  Appearance of <CODE>BZ_STREAM_END</CODE> denotes that
12228 -<CODE>BZ2_bzDecompress</CODE> has detected the logical end of the compressed
12229 -stream.  <CODE>BZ2_bzDecompress</CODE> will not produce <CODE>BZ_STREAM_END</CODE> until
12230 -all output data has been placed into the output buffer, so once
12231 -<CODE>BZ_STREAM_END</CODE> appears, you are guaranteed to have available all
12232 -the decompressed output, and <CODE>BZ2_bzDecompressEnd</CODE> can safely be
12233 -called.
12234 -
12235 -</P>
12236 -<P>
12237 -If case of an error return value, you should call <CODE>BZ2_bzDecompressEnd</CODE>
12238 -to clean up and release memory.
12239 -
12240 -</P>
12241 -<P>
12242 -Possible return values:
12243 -
12244 -<PRE>
12245 -      <CODE>BZ_PARAM_ERROR</CODE>
12246 -         if <CODE>strm</CODE> is <CODE>NULL</CODE> or <CODE>strm-&#62;s</CODE> is <CODE>NULL</CODE>
12247 -         or <CODE>strm-&#62;avail_out &#60; 1</CODE>
12248 -      <CODE>BZ_DATA_ERROR</CODE>
12249 -         if a data integrity error is detected in the compressed stream
12250 -      <CODE>BZ_DATA_ERROR_MAGIC</CODE>
12251 -         if the compressed stream doesn't begin with the right magic bytes
12252 -      <CODE>BZ_MEM_ERROR</CODE>
12253 -         if there wasn't enough memory available
12254 -      <CODE>BZ_STREAM_END</CODE>
12255 -         if the logical end of the data stream was detected and all
12256 -         output in has been consumed, eg <CODE>s-&#62;avail_out &#62; 0</CODE>
12257 -      <CODE>BZ_OK</CODE>
12258 -         otherwise
12259 -</PRE>
12260 -
12261 -<P>
12262 -Allowable next actions:
12263 -
12264 -<PRE>
12265 -      <CODE>BZ2_bzDecompress</CODE>
12266 -         if <CODE>BZ_OK</CODE> was returned
12267 -      <CODE>BZ2_bzDecompressEnd</CODE>
12268 -         otherwise
12269 -</PRE>
12270 -
12271 -
12272 -
12273 -<H3><A NAME="SEC24" HREF="manual_toc.html#TOC24"><CODE>BZ2_bzDecompressEnd</CODE></A></H3>
12274 -
12275 -<PRE>
12276 -int BZ2_bzDecompressEnd ( bz_stream *strm );
12277 -</PRE>
12278 -
12279 -<P>
12280 -Releases all memory associated with a decompression stream.
12281 -
12282 -</P>
12283 -<P>
12284 -Possible return values:
12285 -
12286 -<PRE>
12287 -      <CODE>BZ_PARAM_ERROR</CODE>
12288 -         if <CODE>strm</CODE> is <CODE>NULL</CODE> or <CODE>strm-&#62;s</CODE> is <CODE>NULL</CODE>
12289 -      <CODE>BZ_OK</CODE>
12290 -         otherwise
12291 -</PRE>
12292 -
12293 -<P>
12294 -Allowable next actions:
12295 -
12296 -<PRE>
12297 -      None.
12298 -</PRE>
12299 -
12300 -
12301 -
12302 -<H2><A NAME="SEC25" HREF="manual_toc.html#TOC25">High-level interface</A></H2>
12303 -
12304 -<P>
12305 -This interface provides functions for reading and writing 
12306 -<CODE>bzip2</CODE> format files.  First, some general points.
12307 -
12308 -</P>
12309 -
12310 -<UL>
12311 -<LI>All of the functions take an <CODE>int*</CODE> first argument,
12312 -
12313 -  <CODE>bzerror</CODE>.
12314 -  After each call, <CODE>bzerror</CODE> should be consulted first to determine
12315 -  the outcome of the call.  If <CODE>bzerror</CODE> is <CODE>BZ_OK</CODE>, 
12316 -  the call completed
12317 -  successfully, and only then should the return value of the function
12318 -  (if any) be consulted.  If <CODE>bzerror</CODE> is <CODE>BZ_IO_ERROR</CODE>, 
12319 -  there was an error
12320 -  reading/writing the underlying compressed file, and you should
12321 -  then consult <CODE>errno</CODE>/<CODE>perror</CODE> to determine the 
12322 -  cause of the difficulty.
12323 -  <CODE>bzerror</CODE> may also be set to various other values; precise details are
12324 -  given on a per-function basis below.
12325 -<LI>If <CODE>bzerror</CODE> indicates an error
12326 -
12327 -  (ie, anything except <CODE>BZ_OK</CODE> and <CODE>BZ_STREAM_END</CODE>),
12328 -  you should immediately call <CODE>BZ2_bzReadClose</CODE> (or <CODE>BZ2_bzWriteClose</CODE>,
12329 -  depending on whether you are attempting to read or to write)
12330 -  to free up all resources associated
12331 -  with the stream.  Once an error has been indicated, behaviour of all calls
12332 -  except <CODE>BZ2_bzReadClose</CODE> (<CODE>BZ2_bzWriteClose</CODE>) is undefined.  
12333 -  The implication is that (1) <CODE>bzerror</CODE> should
12334 -  be checked after each call, and (2) if <CODE>bzerror</CODE> indicates an error, 
12335 -  <CODE>BZ2_bzReadClose</CODE> (<CODE>BZ2_bzWriteClose</CODE>) should then be called to clean up.
12336 -<LI>The <CODE>FILE*</CODE> arguments passed to
12337 -
12338 -   <CODE>BZ2_bzReadOpen</CODE>/<CODE>BZ2_bzWriteOpen</CODE>  
12339 -  should be set to binary mode.
12340 -  Most Unix systems will do this by default, but other platforms,
12341 -  including Windows and Mac, will not.  If you omit this, you may
12342 -  encounter problems when moving code to new platforms.
12343 -<LI>Memory allocation requests are handled by
12344 -
12345 -  <CODE>malloc</CODE>/<CODE>free</CODE>.  
12346 -  At present
12347 -  there is no facility for user-defined memory allocators in the file I/O
12348 -  functions (could easily be added, though).
12349 -</UL>
12350 -
12351 -
12352 -
12353 -<H3><A NAME="SEC26" HREF="manual_toc.html#TOC26"><CODE>BZ2_bzReadOpen</CODE></A></H3>
12354 -
12355 -<PRE>
12356 -   typedef void BZFILE;
12357 -
12358 -   BZFILE *BZ2_bzReadOpen ( int *bzerror, FILE *f, 
12359 -                            int small, int verbosity,
12360 -                            void *unused, int nUnused );
12361 -</PRE>
12362 -
12363 -<P>
12364 -Prepare to read compressed data from file handle <CODE>f</CODE>.  <CODE>f</CODE>
12365 -should refer to a file which has been opened for reading, and for which
12366 -the error indicator (<CODE>ferror(f)</CODE>)is not set.  If <CODE>small</CODE> is 1,
12367 -the library will try to decompress using less memory, at the expense of
12368 -speed.
12369 -
12370 -</P>
12371 -<P>
12372 -For reasons explained below, <CODE>BZ2_bzRead</CODE> will decompress the
12373 -<CODE>nUnused</CODE> bytes starting at <CODE>unused</CODE>, before starting to read
12374 -from the file <CODE>f</CODE>.  At most <CODE>BZ_MAX_UNUSED</CODE> bytes may be
12375 -supplied like this.  If this facility is not required, you should pass
12376 -<CODE>NULL</CODE> and <CODE>0</CODE> for <CODE>unused</CODE> and n<CODE>Unused</CODE>
12377 -respectively.
12378 -
12379 -</P>
12380 -<P>
12381 -For the meaning of parameters <CODE>small</CODE> and <CODE>verbosity</CODE>,
12382 -see <CODE>BZ2_bzDecompressInit</CODE>.
12383 -
12384 -</P>
12385 -<P>
12386 -The amount of memory needed to decompress a file cannot be determined
12387 -until the file's header has been read.  So it is possible that
12388 -<CODE>BZ2_bzReadOpen</CODE> returns <CODE>BZ_OK</CODE> but a subsequent call of
12389 -<CODE>BZ2_bzRead</CODE> will return <CODE>BZ_MEM_ERROR</CODE>.
12390 -
12391 -</P>
12392 -<P>
12393 -Possible assignments to <CODE>bzerror</CODE>:
12394 -
12395 -<PRE>
12396 -      <CODE>BZ_CONFIG_ERROR</CODE>
12397 -         if the library has been mis-compiled
12398 -      <CODE>BZ_PARAM_ERROR</CODE>
12399 -         if <CODE>f</CODE> is <CODE>NULL</CODE> 
12400 -         or <CODE>small</CODE> is neither <CODE>0</CODE> nor <CODE>1</CODE>                 
12401 -         or <CODE>(unused == NULL &#38;&#38; nUnused != 0)</CODE>
12402 -         or <CODE>(unused != NULL &#38;&#38; !(0 &#60;= nUnused &#60;= BZ_MAX_UNUSED))</CODE>
12403 -      <CODE>BZ_IO_ERROR</CODE>    
12404 -         if <CODE>ferror(f)</CODE> is nonzero
12405 -      <CODE>BZ_MEM_ERROR</CODE>   
12406 -         if insufficient memory is available
12407 -      <CODE>BZ_OK</CODE>
12408 -         otherwise.
12409 -</PRE>
12410 -
12411 -<P>
12412 -Possible return values:
12413 -
12414 -<PRE>
12415 -      Pointer to an abstract <CODE>BZFILE</CODE>        
12416 -         if <CODE>bzerror</CODE> is <CODE>BZ_OK</CODE>   
12417 -      <CODE>NULL</CODE>
12418 -         otherwise
12419 -</PRE>
12420 -
12421 -<P>
12422 -Allowable next actions:
12423 -
12424 -<PRE>
12425 -      <CODE>BZ2_bzRead</CODE>
12426 -         if <CODE>bzerror</CODE> is <CODE>BZ_OK</CODE>   
12427 -      <CODE>BZ2_bzClose</CODE> 
12428 -         otherwise
12429 -</PRE>
12430 -
12431 -
12432 -
12433 -<H3><A NAME="SEC27" HREF="manual_toc.html#TOC27"><CODE>BZ2_bzRead</CODE></A></H3>
12434 -
12435 -<PRE>
12436 -   int BZ2_bzRead ( int *bzerror, BZFILE *b, void *buf, int len );
12437 -</PRE>
12438 -
12439 -<P>
12440 -Reads up to <CODE>len</CODE> (uncompressed) bytes from the compressed file 
12441 -<CODE>b</CODE> into
12442 -the buffer <CODE>buf</CODE>.  If the read was successful, 
12443 -<CODE>bzerror</CODE> is set to <CODE>BZ_OK</CODE>
12444 -and the number of bytes read is returned.  If the logical end-of-stream
12445 -was detected, <CODE>bzerror</CODE> will be set to <CODE>BZ_STREAM_END</CODE>, 
12446 -and the number
12447 -of bytes read is returned.  All other <CODE>bzerror</CODE> values denote an error.
12448 -
12449 -</P>
12450 -<P>
12451 -<CODE>BZ2_bzRead</CODE> will supply <CODE>len</CODE> bytes,
12452 -unless the logical stream end is detected
12453 -or an error occurs.  Because of this, it is possible to detect the 
12454 -stream end by observing when the number of bytes returned is 
12455 -less than the number
12456 -requested.  Nevertheless, this is regarded as inadvisable; you should
12457 -instead check <CODE>bzerror</CODE> after every call and watch out for
12458 -<CODE>BZ_STREAM_END</CODE>.
12459 -
12460 -</P>
12461 -<P>
12462 -Internally, <CODE>BZ2_bzRead</CODE> copies data from the compressed file in chunks
12463 -of size <CODE>BZ_MAX_UNUSED</CODE> bytes
12464 -before decompressing it.  If the file contains more bytes than strictly
12465 -needed to reach the logical end-of-stream, <CODE>BZ2_bzRead</CODE> will almost certainly
12466 -read some of the trailing data before signalling <CODE>BZ_SEQUENCE_END</CODE>.
12467 -To collect the read but unused data once <CODE>BZ_SEQUENCE_END</CODE> has 
12468 -appeared, call <CODE>BZ2_bzReadGetUnused</CODE> immediately before <CODE>BZ2_bzReadClose</CODE>.
12469 -
12470 -</P>
12471 -<P>
12472 -Possible assignments to <CODE>bzerror</CODE>:
12473 -
12474 -<PRE>
12475 -      <CODE>BZ_PARAM_ERROR</CODE>
12476 -         if <CODE>b</CODE> is <CODE>NULL</CODE> or <CODE>buf</CODE> is <CODE>NULL</CODE> or <CODE>len &#60; 0</CODE>
12477 -      <CODE>BZ_SEQUENCE_ERROR</CODE> 
12478 -         if <CODE>b</CODE> was opened with <CODE>BZ2_bzWriteOpen</CODE>
12479 -      <CODE>BZ_IO_ERROR</CODE> 
12480 -         if there is an error reading from the compressed file
12481 -      <CODE>BZ_UNEXPECTED_EOF</CODE> 
12482 -         if the compressed file ended before the logical end-of-stream was detected
12483 -      <CODE>BZ_DATA_ERROR</CODE> 
12484 -         if a data integrity error was detected in the compressed stream
12485 -      <CODE>BZ_DATA_ERROR_MAGIC</CODE>
12486 -         if the stream does not begin with the requisite header bytes (ie, is not 
12487 -         a <CODE>bzip2</CODE> data file).  This is really a special case of <CODE>BZ_DATA_ERROR</CODE>.
12488 -      <CODE>BZ_MEM_ERROR</CODE> 
12489 -         if insufficient memory was available
12490 -      <CODE>BZ_STREAM_END</CODE> 
12491 -         if the logical end of stream was detected.
12492 -      <CODE>BZ_OK</CODE>
12493 -         otherwise.
12494 -</PRE>
12495 -
12496 -<P>
12497 -Possible return values:
12498 -
12499 -<PRE>
12500 -      number of bytes read
12501 -         if <CODE>bzerror</CODE> is <CODE>BZ_OK</CODE> or <CODE>BZ_STREAM_END</CODE>
12502 -      undefined
12503 -         otherwise
12504 -</PRE>
12505 -
12506 -<P>
12507 -Allowable next actions:
12508 -
12509 -<PRE>
12510 -      collect data from <CODE>buf</CODE>, then <CODE>BZ2_bzRead</CODE> or <CODE>BZ2_bzReadClose</CODE>
12511 -         if <CODE>bzerror</CODE> is <CODE>BZ_OK</CODE> 
12512 -      collect data from <CODE>buf</CODE>, then <CODE>BZ2_bzReadClose</CODE> or <CODE>BZ2_bzReadGetUnused</CODE> 
12513 -         if <CODE>bzerror</CODE> is <CODE>BZ_SEQUENCE_END</CODE>   
12514 -      <CODE>BZ2_bzReadClose</CODE> 
12515 -         otherwise
12516 -</PRE>
12517 -
12518 -
12519 -
12520 -<H3><A NAME="SEC28" HREF="manual_toc.html#TOC28"><CODE>BZ2_bzReadGetUnused</CODE></A></H3>
12521 -
12522 -<PRE>
12523 -   void BZ2_bzReadGetUnused ( int* bzerror, BZFILE *b, 
12524 -                              void** unused, int* nUnused );
12525 -</PRE>
12526 -
12527 -<P>
12528 -Returns data which was read from the compressed file but was not needed
12529 -to get to the logical end-of-stream.  <CODE>*unused</CODE> is set to the address
12530 -of the data, and <CODE>*nUnused</CODE> to the number of bytes.  <CODE>*nUnused</CODE> will
12531 -be set to a value between <CODE>0</CODE> and <CODE>BZ_MAX_UNUSED</CODE> inclusive.
12532 -
12533 -</P>
12534 -<P>
12535 -This function may only be called once <CODE>BZ2_bzRead</CODE> has signalled 
12536 -<CODE>BZ_STREAM_END</CODE> but before <CODE>BZ2_bzReadClose</CODE>.
12537 -
12538 -</P>
12539 -<P>
12540 -Possible assignments to <CODE>bzerror</CODE>:
12541 -
12542 -<PRE>
12543 -      <CODE>BZ_PARAM_ERROR</CODE> 
12544 -         if <CODE>b</CODE> is <CODE>NULL</CODE> 
12545 -         or <CODE>unused</CODE> is <CODE>NULL</CODE> or <CODE>nUnused</CODE> is <CODE>NULL</CODE>
12546 -      <CODE>BZ_SEQUENCE_ERROR</CODE> 
12547 -         if <CODE>BZ_STREAM_END</CODE> has not been signalled
12548 -         or if <CODE>b</CODE> was opened with <CODE>BZ2_bzWriteOpen</CODE>
12549 -     <CODE>BZ_OK</CODE>
12550 -         otherwise
12551 -</PRE>
12552 -
12553 -<P>
12554 -Allowable next actions:
12555 -
12556 -<PRE>
12557 -      <CODE>BZ2_bzReadClose</CODE>
12558 -</PRE>
12559 -
12560 -
12561 -
12562 -<H3><A NAME="SEC29" HREF="manual_toc.html#TOC29"><CODE>BZ2_bzReadClose</CODE></A></H3>
12563 -
12564 -<PRE>
12565 -   void BZ2_bzReadClose ( int *bzerror, BZFILE *b );
12566 -</PRE>
12567 -
12568 -<P>
12569 -Releases all memory pertaining to the compressed file <CODE>b</CODE>.  
12570 -<CODE>BZ2_bzReadClose</CODE> does not call <CODE>fclose</CODE> on the underlying file
12571 -handle, so you should do that yourself if appropriate.
12572 -<CODE>BZ2_bzReadClose</CODE> should be called to clean up after all error
12573 -situations.
12574 -
12575 -</P>
12576 -<P>
12577 -Possible assignments to <CODE>bzerror</CODE>:
12578 -
12579 -<PRE>
12580 -      <CODE>BZ_SEQUENCE_ERROR</CODE> 
12581 -         if <CODE>b</CODE> was opened with <CODE>BZ2_bzOpenWrite</CODE> 
12582 -      <CODE>BZ_OK</CODE> 
12583 -         otherwise
12584 -</PRE>
12585 -
12586 -<P>
12587 -Allowable next actions:
12588 -
12589 -<PRE>
12590 -      none
12591 -</PRE>
12592 -
12593 -
12594 -
12595 -<H3><A NAME="SEC30" HREF="manual_toc.html#TOC30"><CODE>BZ2_bzWriteOpen</CODE></A></H3>
12596 -
12597 -<PRE>
12598 -   BZFILE *BZ2_bzWriteOpen ( int *bzerror, FILE *f, 
12599 -                             int blockSize100k, int verbosity,
12600 -                             int workFactor );
12601 -</PRE>
12602 -
12603 -<P>
12604 -Prepare to write compressed data to file handle <CODE>f</CODE>.  
12605 -<CODE>f</CODE> should refer to
12606 -a file which has been opened for writing, and for which the error
12607 -indicator (<CODE>ferror(f)</CODE>)is not set.  
12608 -
12609 -</P>
12610 -<P>
12611 -For the meaning of parameters <CODE>blockSize100k</CODE>,
12612 -<CODE>verbosity</CODE> and <CODE>workFactor</CODE>, see
12613 -<BR> <CODE>BZ2_bzCompressInit</CODE>.
12614 -
12615 -</P>
12616 -<P>
12617 -All required memory is allocated at this stage, so if the call
12618 -completes successfully, <CODE>BZ_MEM_ERROR</CODE> cannot be signalled by a
12619 -subsequent call to <CODE>BZ2_bzWrite</CODE>.
12620 -
12621 -</P>
12622 -<P>
12623 -Possible assignments to <CODE>bzerror</CODE>:
12624 -
12625 -<PRE>
12626 -      <CODE>BZ_CONFIG_ERROR</CODE>
12627 -         if the library has been mis-compiled
12628 -      <CODE>BZ_PARAM_ERROR</CODE> 
12629 -         if <CODE>f</CODE> is <CODE>NULL</CODE> 
12630 -         or <CODE>blockSize100k &#60; 1</CODE> or <CODE>blockSize100k &#62; 9</CODE>
12631 -      <CODE>BZ_IO_ERROR</CODE> 
12632 -         if <CODE>ferror(f)</CODE> is nonzero
12633 -      <CODE>BZ_MEM_ERROR</CODE> 
12634 -         if insufficient memory is available
12635 -      <CODE>BZ_OK</CODE> 
12636 -         otherwise
12637 -</PRE>
12638 -
12639 -<P>
12640 -Possible return values:
12641 -
12642 -<PRE>
12643 -      Pointer to an abstract <CODE>BZFILE</CODE>  
12644 -         if <CODE>bzerror</CODE> is <CODE>BZ_OK</CODE>   
12645 -      <CODE>NULL</CODE> 
12646 -         otherwise
12647 -</PRE>
12648 -
12649 -<P>
12650 -Allowable next actions:
12651 -
12652 -<PRE>
12653 -      <CODE>BZ2_bzWrite</CODE> 
12654 -         if <CODE>bzerror</CODE> is <CODE>BZ_OK</CODE> 
12655 -         (you could go directly to <CODE>BZ2_bzWriteClose</CODE>, but this would be pretty pointless)
12656 -      <CODE>BZ2_bzWriteClose</CODE> 
12657 -         otherwise
12658 -</PRE>
12659 -
12660 -
12661 -
12662 -<H3><A NAME="SEC31" HREF="manual_toc.html#TOC31"><CODE>BZ2_bzWrite</CODE></A></H3>
12663 -
12664 -<PRE>
12665 -   void BZ2_bzWrite ( int *bzerror, BZFILE *b, void *buf, int len );
12666 -</PRE>
12667 -
12668 -<P>
12669 -Absorbs <CODE>len</CODE> bytes from the buffer <CODE>buf</CODE>, eventually to be
12670 -compressed and written to the file.
12671 -
12672 -</P>
12673 -<P>
12674 -Possible assignments to <CODE>bzerror</CODE>:
12675 -
12676 -<PRE>
12677 -      <CODE>BZ_PARAM_ERROR</CODE> 
12678 -         if <CODE>b</CODE> is <CODE>NULL</CODE> or <CODE>buf</CODE> is <CODE>NULL</CODE> or <CODE>len &#60; 0</CODE>
12679 -      <CODE>BZ_SEQUENCE_ERROR</CODE> 
12680 -         if b was opened with <CODE>BZ2_bzReadOpen</CODE>
12681 -      <CODE>BZ_IO_ERROR</CODE> 
12682 -         if there is an error writing the compressed file.
12683 -      <CODE>BZ_OK</CODE> 
12684 -         otherwise
12685 -</PRE>
12686 -
12687 -
12688 -
12689 -<H3><A NAME="SEC32" HREF="manual_toc.html#TOC32"><CODE>BZ2_bzWriteClose</CODE></A></H3>
12690 -
12691 -<PRE>
12692 -   void BZ2_bzWriteClose ( int *bzerror, BZFILE* f,
12693 -                           int abandon,
12694 -                           unsigned int* nbytes_in,
12695 -                           unsigned int* nbytes_out );
12696 -
12697 -   void BZ2_bzWriteClose64 ( int *bzerror, BZFILE* f,
12698 -                             int abandon,
12699 -                             unsigned int* nbytes_in_lo32,
12700 -                             unsigned int* nbytes_in_hi32,
12701 -                             unsigned int* nbytes_out_lo32,
12702 -                             unsigned int* nbytes_out_hi32 );
12703 -</PRE>
12704 -
12705 -<P>
12706 -Compresses and flushes to the compressed file all data so far supplied
12707 -by <CODE>BZ2_bzWrite</CODE>.  The logical end-of-stream markers are also written, so
12708 -subsequent calls to <CODE>BZ2_bzWrite</CODE> are illegal.  All memory associated 
12709 -with the compressed file <CODE>b</CODE> is released.  
12710 -<CODE>fflush</CODE> is called on the
12711 -compressed file, but it is not <CODE>fclose</CODE>'d.
12712 -
12713 -</P>
12714 -<P>
12715 -If <CODE>BZ2_bzWriteClose</CODE> is called to clean up after an error, the only
12716 -action is to release the memory.  The library records the error codes
12717 -issued by previous calls, so this situation will be detected
12718 -automatically.  There is no attempt to complete the compression
12719 -operation, nor to <CODE>fflush</CODE> the compressed file.  You can force this
12720 -behaviour to happen even in the case of no error, by passing a nonzero
12721 -value to <CODE>abandon</CODE>.
12722 -
12723 -</P>
12724 -<P>
12725 -If <CODE>nbytes_in</CODE> is non-null, <CODE>*nbytes_in</CODE> will be set to be the
12726 -total volume of uncompressed data handled.  Similarly, <CODE>nbytes_out</CODE>
12727 -will be set to the total volume of compressed data written.  For 
12728 -compatibility with older versions of the library, <CODE>BZ2_bzWriteClose</CODE>
12729 -only yields the lower 32 bits of these counts.  Use
12730 -<CODE>BZ2_bzWriteClose64</CODE> if you want the full 64 bit counts.  These
12731 -two functions are otherwise absolutely identical.
12732 -
12733 -</P>
12734 -
12735 -<P>
12736 -Possible assignments to <CODE>bzerror</CODE>:
12737 -
12738 -<PRE>
12739 -      <CODE>BZ_SEQUENCE_ERROR</CODE> 
12740 -         if <CODE>b</CODE> was opened with <CODE>BZ2_bzReadOpen</CODE>
12741 -      <CODE>BZ_IO_ERROR</CODE> 
12742 -         if there is an error writing the compressed file
12743 -      <CODE>BZ_OK</CODE> 
12744 -         otherwise
12745 -</PRE>
12746 -
12747 -
12748 -
12749 -<H3><A NAME="SEC33" HREF="manual_toc.html#TOC33">Handling embedded compressed data streams</A></H3>
12750 -
12751 -<P>
12752 -The high-level library facilitates use of
12753 -<CODE>bzip2</CODE> data streams which form some part of a surrounding, larger
12754 -data stream.
12755 -
12756 -<UL>
12757 -<LI>For writing, the library takes an open file handle, writes
12758 -
12759 -compressed data to it, <CODE>fflush</CODE>es it but does not <CODE>fclose</CODE> it.
12760 -The calling application can write its own data before and after the
12761 -compressed data stream, using that same file handle.
12762 -<LI>Reading is more complex, and the facilities are not as general
12763 -
12764 -as they could be since generality is hard to reconcile with efficiency.
12765 -<CODE>BZ2_bzRead</CODE> reads from the compressed file in blocks of size
12766 -<CODE>BZ_MAX_UNUSED</CODE> bytes, and in doing so probably will overshoot
12767 -the logical end of compressed stream.
12768 -To recover this data once decompression has
12769 -ended, call <CODE>BZ2_bzReadGetUnused</CODE> after the last call of <CODE>BZ2_bzRead</CODE>
12770 -(the one returning <CODE>BZ_STREAM_END</CODE>) but before calling
12771 -<CODE>BZ2_bzReadClose</CODE>.
12772 -</UL>
12773 -
12774 -<P>
12775 -This mechanism makes it easy to decompress multiple <CODE>bzip2</CODE>
12776 -streams placed end-to-end.  As the end of one stream, when <CODE>BZ2_bzRead</CODE>
12777 -returns <CODE>BZ_STREAM_END</CODE>, call <CODE>BZ2_bzReadGetUnused</CODE> to collect the
12778 -unused data (copy it into your own buffer somewhere).  
12779 -That data forms the start of the next compressed stream.
12780 -To start uncompressing that next stream, call <CODE>BZ2_bzReadOpen</CODE> again,
12781 -feeding in the unused data via the <CODE>unused</CODE>/<CODE>nUnused</CODE>
12782 -parameters.
12783 -Keep doing this until <CODE>BZ_STREAM_END</CODE> return coincides with the
12784 -physical end of file (<CODE>feof(f)</CODE>).  In this situation
12785 -<CODE>BZ2_bzReadGetUnused</CODE>
12786 -will of course return no data.
12787 -
12788 -</P>
12789 -<P>
12790 -This should give some feel for how the high-level interface can be used.
12791 -If you require extra flexibility, you'll have to bite the bullet and get
12792 -to grips with the low-level interface.
12793 -
12794 -</P>
12795 -
12796 -
12797 -<H3><A NAME="SEC34" HREF="manual_toc.html#TOC34">Standard file-reading/writing code</A></H3>
12798 -<P>
12799 -Here's how you'd write data to a compressed file:
12800 -
12801 -<PRE>
12802 -FILE*   f;
12803 -BZFILE* b;
12804 -int     nBuf;
12805 -char    buf[ /* whatever size you like */ ];
12806 -int     bzerror;
12807 -int     nWritten;
12808 -
12809 -f = fopen ( "myfile.bz2", "w" );
12810 -if (!f) {
12811 -   /* handle error */
12812 -}
12813 -b = BZ2_bzWriteOpen ( &#38;bzerror, f, 9 );
12814 -if (bzerror != BZ_OK) {
12815 -   BZ2_bzWriteClose ( b );
12816 -   /* handle error */
12817 -}
12818 -
12819 -while ( /* condition */ ) {
12820 -   /* get data to write into buf, and set nBuf appropriately */
12821 -   nWritten = BZ2_bzWrite ( &#38;bzerror, b, buf, nBuf );
12822 -   if (bzerror == BZ_IO_ERROR) { 
12823 -      BZ2_bzWriteClose ( &#38;bzerror, b );
12824 -      /* handle error */
12825 -   }
12826 -}
12827 -
12828 -BZ2_bzWriteClose ( &#38;bzerror, b );
12829 -if (bzerror == BZ_IO_ERROR) {
12830 -   /* handle error */
12831 -}
12832 -</PRE>
12833 -
12834 -<P>
12835 -And to read from a compressed file:
12836 -
12837 -<PRE>
12838 -FILE*   f;
12839 -BZFILE* b;
12840 -int     nBuf;
12841 -char    buf[ /* whatever size you like */ ];
12842 -int     bzerror;
12843 -int     nWritten;
12844 -
12845 -f = fopen ( "myfile.bz2", "r" );
12846 -if (!f) {
12847 -   /* handle error */
12848 -}
12849 -b = BZ2_bzReadOpen ( &#38;bzerror, f, 0, NULL, 0 );
12850 -if (bzerror != BZ_OK) {
12851 -   BZ2_bzReadClose ( &#38;bzerror, b );
12852 -   /* handle error */
12853 -}
12854 -
12855 -bzerror = BZ_OK;
12856 -while (bzerror == BZ_OK &#38;&#38; /* arbitrary other conditions */) {
12857 -   nBuf = BZ2_bzRead ( &#38;bzerror, b, buf, /* size of buf */ );
12858 -   if (bzerror == BZ_OK) {
12859 -      /* do something with buf[0 .. nBuf-1] */
12860 -   }
12861 -}
12862 -if (bzerror != BZ_STREAM_END) {
12863 -   BZ2_bzReadClose ( &#38;bzerror, b );
12864 -   /* handle error */
12865 -} else {
12866 -   BZ2_bzReadClose ( &#38;bzerror );
12867 -}
12868 -</PRE>
12869 -
12870 -
12871 -
12872 -<H2><A NAME="SEC35" HREF="manual_toc.html#TOC35">Utility functions</A></H2>
12873 -
12874 -
12875 -<H3><A NAME="SEC36" HREF="manual_toc.html#TOC36"><CODE>BZ2_bzBuffToBuffCompress</CODE></A></H3>
12876 -
12877 -<PRE>
12878 -   int BZ2_bzBuffToBuffCompress( char*         dest,
12879 -                                 unsigned int* destLen,
12880 -                                 char*         source,
12881 -                                 unsigned int  sourceLen,
12882 -                                 int           blockSize100k,
12883 -                                 int           verbosity,
12884 -                                 int           workFactor );
12885 -</PRE>
12886 -
12887 -<P>
12888 -Attempts to compress the data in <CODE>source[0 .. sourceLen-1]</CODE>
12889 -into the destination buffer, <CODE>dest[0 .. *destLen-1]</CODE>.
12890 -If the destination buffer is big enough, <CODE>*destLen</CODE> is
12891 -set to the size of the compressed data, and <CODE>BZ_OK</CODE> is
12892 -returned.  If the compressed data won't fit, <CODE>*destLen</CODE>
12893 -is unchanged, and <CODE>BZ_OUTBUFF_FULL</CODE> is returned.
12894 -
12895 -</P>
12896 -<P>
12897 -Compression in this manner is a one-shot event, done with a single call
12898 -to this function.  The resulting compressed data is a complete
12899 -<CODE>bzip2</CODE> format data stream.  There is no mechanism for making
12900 -additional calls to provide extra input data.  If you want that kind of
12901 -mechanism, use the low-level interface.
12902 -
12903 -</P>
12904 -<P>
12905 -For the meaning of parameters <CODE>blockSize100k</CODE>, <CODE>verbosity</CODE>
12906 -and <CODE>workFactor</CODE>, <BR> see <CODE>BZ2_bzCompressInit</CODE>.
12907 -
12908 -</P>
12909 -<P>
12910 -To guarantee that the compressed data will fit in its buffer, allocate
12911 -an output buffer of size 1% larger than the uncompressed data, plus
12912 -six hundred extra bytes.
12913 -
12914 -</P>
12915 -<P>
12916 -<CODE>BZ2_bzBuffToBuffDecompress</CODE> will not write data at or
12917 -beyond <CODE>dest[*destLen]</CODE>, even in case of buffer overflow.
12918 -
12919 -</P>
12920 -<P>
12921 -Possible return values:
12922 -
12923 -<PRE>
12924 -      <CODE>BZ_CONFIG_ERROR</CODE>
12925 -         if the library has been mis-compiled
12926 -      <CODE>BZ_PARAM_ERROR</CODE> 
12927 -         if <CODE>dest</CODE> is <CODE>NULL</CODE> or <CODE>destLen</CODE> is <CODE>NULL</CODE>
12928 -         or <CODE>blockSize100k &#60; 1</CODE> or <CODE>blockSize100k &#62; 9</CODE>
12929 -         or <CODE>verbosity &#60; 0</CODE> or <CODE>verbosity &#62; 4</CODE> 
12930 -         or <CODE>workFactor &#60; 0</CODE> or <CODE>workFactor &#62; 250</CODE>
12931 -      <CODE>BZ_MEM_ERROR</CODE>
12932 -         if insufficient memory is available 
12933 -      <CODE>BZ_OUTBUFF_FULL</CODE>
12934 -         if the size of the compressed data exceeds <CODE>*destLen</CODE>
12935 -      <CODE>BZ_OK</CODE> 
12936 -         otherwise
12937 -</PRE>
12938 -
12939 -
12940 -
12941 -<H3><A NAME="SEC37" HREF="manual_toc.html#TOC37"><CODE>BZ2_bzBuffToBuffDecompress</CODE></A></H3>
12942 -
12943 -<PRE>
12944 -   int BZ2_bzBuffToBuffDecompress ( char*         dest,
12945 -                                    unsigned int* destLen,
12946 -                                    char*         source,
12947 -                                    unsigned int  sourceLen,
12948 -                                    int           small,
12949 -                                    int           verbosity );
12950 -</PRE>
12951 -
12952 -<P>
12953 -Attempts to decompress the data in <CODE>source[0 .. sourceLen-1]</CODE>
12954 -into the destination buffer, <CODE>dest[0 .. *destLen-1]</CODE>.
12955 -If the destination buffer is big enough, <CODE>*destLen</CODE> is
12956 -set to the size of the uncompressed data, and <CODE>BZ_OK</CODE> is
12957 -returned.  If the compressed data won't fit, <CODE>*destLen</CODE>
12958 -is unchanged, and <CODE>BZ_OUTBUFF_FULL</CODE> is returned.
12959 -
12960 -</P>
12961 -<P>
12962 -<CODE>source</CODE> is assumed to hold a complete <CODE>bzip2</CODE> format
12963 -data stream.  <BR> <CODE>BZ2_bzBuffToBuffDecompress</CODE> tries to decompress
12964 -the entirety of the stream into the output buffer.
12965 -
12966 -</P>
12967 -<P>
12968 -For the meaning of parameters <CODE>small</CODE> and <CODE>verbosity</CODE>,
12969 -see <CODE>BZ2_bzDecompressInit</CODE>.
12970 -
12971 -</P>
12972 -<P>
12973 -Because the compression ratio of the compressed data cannot be known in
12974 -advance, there is no easy way to guarantee that the output buffer will
12975 -be big enough.  You may of course make arrangements in your code to
12976 -record the size of the uncompressed data, but such a mechanism is beyond
12977 -the scope of this library.
12978 -
12979 -</P>
12980 -<P>
12981 -<CODE>BZ2_bzBuffToBuffDecompress</CODE> will not write data at or
12982 -beyond <CODE>dest[*destLen]</CODE>, even in case of buffer overflow.
12983 -
12984 -</P>
12985 -<P>
12986 -Possible return values:
12987 -
12988 -<PRE>
12989 -      <CODE>BZ_CONFIG_ERROR</CODE>
12990 -         if the library has been mis-compiled
12991 -      <CODE>BZ_PARAM_ERROR</CODE> 
12992 -         if <CODE>dest</CODE> is <CODE>NULL</CODE> or <CODE>destLen</CODE> is <CODE>NULL</CODE>
12993 -         or <CODE>small != 0 &#38;&#38; small != 1</CODE>
12994 -         or <CODE>verbosity &#60; 0</CODE> or <CODE>verbosity &#62; 4</CODE> 
12995 -      <CODE>BZ_MEM_ERROR</CODE>
12996 -         if insufficient memory is available 
12997 -      <CODE>BZ_OUTBUFF_FULL</CODE>
12998 -         if the size of the compressed data exceeds <CODE>*destLen</CODE>
12999 -      <CODE>BZ_DATA_ERROR</CODE>
13000 -         if a data integrity error was detected in the compressed data
13001 -      <CODE>BZ_DATA_ERROR_MAGIC</CODE>
13002 -         if the compressed data doesn't begin with the right magic bytes
13003 -      <CODE>BZ_UNEXPECTED_EOF</CODE>
13004 -         if the compressed data ends unexpectedly
13005 -      <CODE>BZ_OK</CODE> 
13006 -         otherwise
13007 -</PRE>
13008 -
13009 -
13010 -
13011 -<H2><A NAME="SEC38" HREF="manual_toc.html#TOC38"><CODE>zlib</CODE> compatibility functions</A></H2>
13012 -<P>
13013 -Yoshioka Tsuneo has contributed some functions to
13014 -give better <CODE>zlib</CODE> compatibility.  These functions are
13015 -<CODE>BZ2_bzopen</CODE>, <CODE>BZ2_bzread</CODE>, <CODE>BZ2_bzwrite</CODE>, <CODE>BZ2_bzflush</CODE>,
13016 -<CODE>BZ2_bzclose</CODE>,
13017 -<CODE>BZ2_bzerror</CODE> and <CODE>BZ2_bzlibVersion</CODE>.
13018 -These functions are not (yet) officially part of
13019 -the library.  If they break, you get to keep all the pieces.
13020 -Nevertheless, I think they work ok.
13021 -
13022 -<PRE>
13023 -typedef void BZFILE;
13024 -
13025 -const char * BZ2_bzlibVersion ( void );
13026 -</PRE>
13027 -
13028 -<P>
13029 -Returns a string indicating the library version.
13030 -
13031 -<PRE>
13032 -BZFILE * BZ2_bzopen  ( const char *path, const char *mode );
13033 -BZFILE * BZ2_bzdopen ( int        fd,    const char *mode );
13034 -</PRE>
13035 -
13036 -<P>
13037 -Opens a <CODE>.bz2</CODE> file for reading or writing, using either its name
13038 -or a pre-existing file descriptor. 
13039 -Analogous to <CODE>fopen</CODE> and <CODE>fdopen</CODE>.
13040 -
13041 -<PRE>
13042 -int BZ2_bzread  ( BZFILE* b, void* buf, int len );
13043 -int BZ2_bzwrite ( BZFILE* b, void* buf, int len );
13044 -</PRE>
13045 -
13046 -<P>
13047 -Reads/writes data from/to a previously opened <CODE>BZFILE</CODE>.
13048 -Analogous to <CODE>fread</CODE> and <CODE>fwrite</CODE>.
13049 -
13050 -<PRE>
13051 -int  BZ2_bzflush ( BZFILE* b );
13052 -void BZ2_bzclose ( BZFILE* b );
13053 -</PRE>
13054 -
13055 -<P>
13056 -Flushes/closes a <CODE>BZFILE</CODE>.  <CODE>BZ2_bzflush</CODE> doesn't actually do
13057 -anything.  Analogous to <CODE>fflush</CODE> and <CODE>fclose</CODE>.
13058 -
13059 -</P>
13060 -
13061 -<PRE>
13062 -const char * BZ2_bzerror ( BZFILE *b, int *errnum )
13063 -</PRE>
13064 -
13065 -<P>
13066 -Returns a string describing the more recent error status of
13067 -<CODE>b</CODE>, and also sets <CODE>*errnum</CODE> to its numerical value.
13068 -
13069 -</P>
13070 -
13071 -
13072 -
13073 -<H2><A NAME="SEC39" HREF="manual_toc.html#TOC39">Using the library in a <CODE>stdio</CODE>-free environment</A></H2>
13074 -
13075 -
13076 -
13077 -<H3><A NAME="SEC40" HREF="manual_toc.html#TOC40">Getting rid of <CODE>stdio</CODE></A></H3>
13078 -
13079 -<P>
13080 -In a deeply embedded application, you might want to use just
13081 -the memory-to-memory functions.  You can do this conveniently
13082 -by compiling the library with preprocessor symbol <CODE>BZ_NO_STDIO</CODE>
13083 -defined.  Doing this gives you a library containing only the following
13084 -eight functions:
13085 -
13086 -</P>
13087 -<P>
13088 -<CODE>BZ2_bzCompressInit</CODE>, <CODE>BZ2_bzCompress</CODE>, <CODE>BZ2_bzCompressEnd</CODE> <BR>
13089 -<CODE>BZ2_bzDecompressInit</CODE>, <CODE>BZ2_bzDecompress</CODE>, <CODE>BZ2_bzDecompressEnd</CODE> <BR>
13090 -<CODE>BZ2_bzBuffToBuffCompress</CODE>, <CODE>BZ2_bzBuffToBuffDecompress</CODE>
13091 -
13092 -</P>
13093 -<P>
13094 -When compiled like this, all functions will ignore <CODE>verbosity</CODE>
13095 -settings.
13096 -
13097 -</P>
13098 -
13099 -
13100 -<H3><A NAME="SEC41" HREF="manual_toc.html#TOC41">Critical error handling</A></H3>
13101 -<P>
13102 -<CODE>libbzip2</CODE> contains a number of internal assertion checks which
13103 -should, needless to say, never be activated.  Nevertheless, if an
13104 -assertion should fail, behaviour depends on whether or not the library
13105 -was compiled with <CODE>BZ_NO_STDIO</CODE> set.
13106 -
13107 -</P>
13108 -<P>
13109 -For a normal compile, an assertion failure yields the message
13110 -
13111 -<PRE>
13112 -   bzip2/libbzip2: internal error number N.
13113 -   This is a bug in bzip2/libbzip2, 1.0 of 21-Mar-2000.
13114 -   Please report it to me at: jseward@acm.org.  If this happened
13115 -   when you were using some program which uses libbzip2 as a
13116 -   component, you should also report this bug to the author(s)
13117 -   of that program.  Please make an effort to report this bug;
13118 -   timely and accurate bug reports eventually lead to higher
13119 -   quality software.  Thanks.  Julian Seward, 21 March 2000.
13120 -</PRE>
13121 -
13122 -<P>
13123 -where <CODE>N</CODE> is some error code number.  <CODE>exit(3)</CODE>
13124 -is then called.
13125 -
13126 -</P>
13127 -<P>
13128 -For a <CODE>stdio</CODE>-free library, assertion failures result
13129 -in a call to a function declared as:
13130 -
13131 -<PRE>
13132 -   extern void bz_internal_error ( int errcode );
13133 -</PRE>
13134 -
13135 -<P>
13136 -The relevant code is passed as a parameter.  You should supply
13137 -such a function.
13138 -
13139 -</P>
13140 -<P>
13141 -In either case, once an assertion failure has occurred, any 
13142 -<CODE>bz_stream</CODE> records involved can be regarded as invalid.
13143 -You should not attempt to resume normal operation with them.
13144 -
13145 -</P>
13146 -<P>
13147 -You may, of course, change critical error handling to suit
13148 -your needs.  As I said above, critical errors indicate bugs
13149 -in the library and should not occur.  All "normal" error
13150 -situations are indicated via error return codes from functions,
13151 -and can be recovered from.
13152 -
13153 -</P>
13154 -
13155 -
13156 -
13157 -<H2><A NAME="SEC42" HREF="manual_toc.html#TOC42">Making a Windows DLL</A></H2>
13158 -<P>
13159 -Everything related to Windows has been contributed by Yoshioka Tsuneo
13160 -<BR> (<CODE>QWF00133@niftyserve.or.jp</CODE> /
13161 -<CODE>tsuneo-y@is.aist-nara.ac.jp</CODE>), so you should send your queries to
13162 -him (but perhaps Cc: me, <CODE>jseward@acm.org</CODE>).
13163 -
13164 -</P>
13165 -<P>
13166 -My vague understanding of what to do is: using Visual C++ 5.0,
13167 -open the project file <CODE>libbz2.dsp</CODE>, and build.  That's all.
13168 -
13169 -</P>
13170 -<P>
13171 -If you can't
13172 -open the project file for some reason, make a new one, naming these files:
13173 -<CODE>blocksort.c</CODE>, <CODE>bzlib.c</CODE>, <CODE>compress.c</CODE>, 
13174 -<CODE>crctable.c</CODE>, <CODE>decompress.c</CODE>, <CODE>huffman.c</CODE>, <BR>
13175 -<CODE>randtable.c</CODE> and <CODE>libbz2.def</CODE>.  You will also need
13176 -to name the header files <CODE>bzlib.h</CODE> and <CODE>bzlib_private.h</CODE>.
13177 -
13178 -</P>
13179 -<P>
13180 -If you don't use VC++, you may need to define the proprocessor symbol
13181 -<CODE>_WIN32</CODE>. 
13182 -
13183 -</P>
13184 -<P>
13185 -Finally, <CODE>dlltest.c</CODE> is a sample program using the DLL.  It has a
13186 -project file, <CODE>dlltest.dsp</CODE>.
13187 -
13188 -</P>
13189 -<P>
13190 -If you just want a makefile for Visual C, have a look at
13191 -<CODE>makefile.msc</CODE>.
13192 -
13193 -</P>
13194 -<P>
13195 -Be aware that if you compile <CODE>bzip2</CODE> itself on Win32, you must set
13196 -<CODE>BZ_UNIX</CODE> to 0 and <CODE>BZ_LCCWIN32</CODE> to 1, in the file
13197 -<CODE>bzip2.c</CODE>, before compiling.  Otherwise the resulting binary won't
13198 -work correctly.
13199 -
13200 -</P>
13201 -<P>
13202 -I haven't tried any of this stuff myself, but it all looks plausible.
13203 -
13204 -</P>
13205 -
13206 -<P><HR><P>
13207 -<p>Go to the <A HREF="manual_1.html">first</A>, <A HREF="manual_2.html">previous</A>, <A HREF="manual_4.html">next</A>, <A HREF="manual_4.html">last</A> section, <A HREF="manual_toc.html">table of contents</A>.
13208 -</BODY>
13209 -</HTML>
13210 diff -Nru bzip2-1.0.1/manual_4.html bzip2-1.0.1.new/manual_4.html
13211 --- bzip2-1.0.1/manual_4.html   Sat Jun 24 20:13:27 2000
13212 +++ bzip2-1.0.1.new/manual_4.html       Thu Jan  1 01:00:00 1970
13213 @@ -1,528 +0,0 @@
13214 -<HTML>
13215 -<HEAD>
13216 -<!-- This HTML file has been created by texi2html 1.54
13217 -     from manual.texi on 23 March 2000 -->
13218 -
13219 -<TITLE>bzip2 and libbzip2 - Miscellanea</TITLE>
13220 -<link href="manual_3.html" rel=Previous>
13221 -<link href="manual_toc.html" rel=ToC>
13222 -
13223 -</HEAD>
13224 -<BODY>
13225 -<p>Go to the <A HREF="manual_1.html">first</A>, <A HREF="manual_3.html">previous</A>, next, last section, <A HREF="manual_toc.html">table of contents</A>.
13226 -<P><HR><P>
13227 -
13228 -
13229 -<H1><A NAME="SEC43" HREF="manual_toc.html#TOC43">Miscellanea</A></H1>
13230 -
13231 -<P>
13232 -These are just some random thoughts of mine.  Your mileage may
13233 -vary.
13234 -
13235 -</P>
13236 -
13237 -
13238 -<H2><A NAME="SEC44" HREF="manual_toc.html#TOC44">Limitations of the compressed file format</A></H2>
13239 -<P>
13240 -<CODE>bzip2-1.0</CODE>, <CODE>0.9.5</CODE> and <CODE>0.9.0</CODE>
13241 -use exactly the same file format as the previous
13242 -version, <CODE>bzip2-0.1</CODE>.  This decision was made in the interests of
13243 -stability.  Creating yet another incompatible compressed file format
13244 -would create further confusion and disruption for users.
13245 -
13246 -</P>
13247 -<P>
13248 -Nevertheless, this is not a painless decision.  Development
13249 -work since the release of <CODE>bzip2-0.1</CODE> in August 1997
13250 -has shown complexities in the file format which slow down
13251 -decompression and, in retrospect, are unnecessary.  These are:
13252 -
13253 -<UL>
13254 -<LI>The run-length encoder, which is the first of the
13255 -
13256 -      compression transformations, is entirely irrelevant.
13257 -      The original purpose was to protect the sorting algorithm
13258 -      from the very worst case input: a string of repeated
13259 -      symbols.  But algorithm steps Q6a and Q6b in the original
13260 -      Burrows-Wheeler technical report (SRC-124) show how
13261 -      repeats can be handled without difficulty in block
13262 -      sorting.
13263 -<LI>The randomisation mechanism doesn't really need to be
13264 -
13265 -      there.  Udi Manber and Gene Myers published a suffix
13266 -      array construction algorithm a few years back, which
13267 -      can be employed to sort any block, no matter how 
13268 -      repetitive, in O(N log N) time.  Subsequent work by
13269 -      Kunihiko Sadakane has produced a derivative O(N (log N)^2) 
13270 -      algorithm which usually outperforms the Manber-Myers
13271 -      algorithm.
13272 -
13273 -      I could have changed to Sadakane's algorithm, but I find
13274 -      it to be slower than <CODE>bzip2</CODE>'s existing algorithm for
13275 -      most inputs, and the randomisation mechanism protects
13276 -      adequately against bad cases.  I didn't think it was
13277 -      a good tradeoff to make.  Partly this is due to the fact
13278 -      that I was not flooded with email complaints about
13279 -      <CODE>bzip2-0.1</CODE>'s performance on repetitive data, so
13280 -      perhaps it isn't a problem for real inputs.
13281 -
13282 -      Probably the best long-term solution,
13283 -      and the one I have incorporated into 0.9.5 and above,
13284 -      is to use the existing sorting
13285 -      algorithm initially, and fall back to a O(N (log N)^2)
13286 -      algorithm if the standard algorithm gets into difficulties.
13287 -<LI>The compressed file format was never designed to be
13288 -
13289 -      handled by a library, and I have had to jump though
13290 -      some hoops to produce an efficient implementation of
13291 -      decompression.  It's a bit hairy.  Try passing
13292 -      <CODE>decompress.c</CODE> through the C preprocessor 
13293 -      and you'll see what I mean.  Much of this complexity
13294 -      could have been avoided if the compressed size of
13295 -      each block of data was recorded in the data stream.
13296 -<LI>An Adler-32 checksum, rather than a CRC32 checksum,
13297 -
13298 -      would be faster to compute.
13299 -</UL>
13300 -
13301 -<P>
13302 -It would be fair to say that the <CODE>bzip2</CODE> format was frozen
13303 -before I properly and fully understood the performance
13304 -consequences of doing so.
13305 -
13306 -</P>
13307 -<P>
13308 -Improvements which I was able to incorporate into
13309 -0.9.0, despite using the same file format, are:
13310 -
13311 -<UL>
13312 -<LI>Single array implementation of the inverse BWT.  This
13313 -
13314 -      significantly speeds up decompression, presumably
13315 -      because it reduces the number of cache misses.
13316 -<LI>Faster inverse MTF transform for large MTF values.  The
13317 -
13318 -      new implementation is based on the notion of sliding blocks
13319 -      of values.
13320 -<LI><CODE>bzip2-0.9.0</CODE> now reads and writes files with <CODE>fread</CODE>
13321 -
13322 -      and <CODE>fwrite</CODE>; version 0.1 used <CODE>putc</CODE> and <CODE>getc</CODE>.
13323 -      Duh!  Well, you live and learn.
13324 -
13325 -</UL>
13326 -
13327 -<P>
13328 -Further ahead, it would be nice 
13329 -to be able to do random access into files.  This will 
13330 -require some careful design of compressed file formats.
13331 -
13332 -</P>
13333 -
13334 -
13335 -
13336 -<H2><A NAME="SEC45" HREF="manual_toc.html#TOC45">Portability issues</A></H2>
13337 -<P>
13338 -After some consideration, I have decided not to use
13339 -GNU <CODE>autoconf</CODE> to configure 0.9.5 or 1.0.
13340 -
13341 -</P>
13342 -<P>
13343 -<CODE>autoconf</CODE>, admirable and wonderful though it is, 
13344 -mainly assists with portability problems between Unix-like
13345 -platforms.  But <CODE>bzip2</CODE> doesn't have much in the way
13346 -of portability problems on Unix; most of the difficulties appear
13347 -when porting to the Mac, or to Microsoft's operating systems.
13348 -<CODE>autoconf</CODE> doesn't help in those cases, and brings in a 
13349 -whole load of new complexity.
13350 -
13351 -</P>
13352 -<P>
13353 -Most people should be able to compile the library and program
13354 -under Unix straight out-of-the-box, so to speak, especially 
13355 -if you have a version of GNU C available.
13356 -
13357 -</P>
13358 -<P>
13359 -There are a couple of <CODE>__inline__</CODE> directives in the code.  GNU C
13360 -(<CODE>gcc</CODE>) should be able to handle them.  If you're not using
13361 -GNU C, your C compiler shouldn't see them at all.
13362 -If your compiler does, for some reason, see them and doesn't
13363 -like them, just <CODE>#define</CODE> <CODE>__inline__</CODE> to be <CODE>/* */</CODE>.  One
13364 -easy way to do this is to compile with the flag <CODE>-D__inline__=</CODE>, 
13365 -which should be understood by most Unix compilers.
13366 -
13367 -</P>
13368 -<P>
13369 -If you still have difficulties, try compiling with the macro
13370 -<CODE>BZ_STRICT_ANSI</CODE> defined.  This should enable you to build the
13371 -library in a strictly ANSI compliant environment.  Building the program
13372 -itself like this is dangerous and not supported, since you remove
13373 -<CODE>bzip2</CODE>'s checks against compressing directories, symbolic links,
13374 -devices, and other not-really-a-file entities.  This could cause
13375 -filesystem corruption!
13376 -
13377 -</P>
13378 -<P>
13379 -One other thing: if you create a <CODE>bzip2</CODE> binary for public
13380 -distribution, please try and link it statically (<CODE>gcc -s</CODE>).  This
13381 -avoids all sorts of library-version issues that others may encounter
13382 -later on.
13383 -
13384 -</P>
13385 -<P>
13386 -If you build <CODE>bzip2</CODE> on Win32, you must set <CODE>BZ_UNIX</CODE> to 0 and
13387 -<CODE>BZ_LCCWIN32</CODE> to 1, in the file <CODE>bzip2.c</CODE>, before compiling.
13388 -Otherwise the resulting binary won't work correctly.
13389 -
13390 -</P>
13391 -
13392 -
13393 -
13394 -<H2><A NAME="SEC46" HREF="manual_toc.html#TOC46">Reporting bugs</A></H2>
13395 -<P>
13396 -I tried pretty hard to make sure <CODE>bzip2</CODE> is
13397 -bug free, both by design and by testing.  Hopefully
13398 -you'll never need to read this section for real.
13399 -
13400 -</P>
13401 -<P>
13402 -Nevertheless, if <CODE>bzip2</CODE> dies with a segmentation
13403 -fault, a bus error or an internal assertion failure, it
13404 -will ask you to email me a bug report.  Experience with
13405 -version 0.1 shows that almost all these problems can
13406 -be traced to either compiler bugs or hardware problems.
13407 -
13408 -<UL>
13409 -<LI>
13410 -
13411 -Recompile the program with no optimisation, and see if it
13412 -works.  And/or try a different compiler.
13413 -I heard all sorts of stories about various flavours
13414 -of GNU C (and other compilers) generating bad code for
13415 -<CODE>bzip2</CODE>, and I've run across two such examples myself.
13416 -
13417 -2.7.X versions of GNU C are known to generate bad code from
13418 -time to time, at high optimisation levels.  
13419 -If you get problems, try using the flags
13420 -<CODE>-O2</CODE> <CODE>-fomit-frame-pointer</CODE> <CODE>-fno-strength-reduce</CODE>.
13421 -You should specifically <EM>not</EM> use <CODE>-funroll-loops</CODE>.
13422 -
13423 -You may notice that the Makefile runs six tests as part of
13424 -the build process.  If the program passes all of these, it's
13425 -a pretty good (but not 100%) indication that the compiler has
13426 -done its job correctly.
13427 -<LI>
13428 -
13429 -If <CODE>bzip2</CODE> crashes randomly, and the crashes are not
13430 -repeatable, you may have a flaky memory subsystem.  <CODE>bzip2</CODE>
13431 -really hammers your memory hierarchy, and if it's a bit marginal,
13432 -you may get these problems.  Ditto if your disk or I/O subsystem
13433 -is slowly failing.  Yup, this really does happen.
13434 -
13435 -Try using a different machine of the same type, and see if
13436 -you can repeat the problem.
13437 -<LI>This isn't really a bug, but ... If <CODE>bzip2</CODE> tells
13438 -
13439 -you your file is corrupted on decompression, and you
13440 -obtained the file via FTP, there is a possibility that you
13441 -forgot to tell FTP to do a binary mode transfer.  That absolutely
13442 -will cause the file to be non-decompressible.  You'll have to transfer
13443 -it again.
13444 -</UL>
13445 -
13446 -<P>
13447 -If you've incorporated <CODE>libbzip2</CODE> into your own program
13448 -and are getting problems, please, please, please, check that the 
13449 -parameters you are passing in calls to the library, are
13450 -correct, and in accordance with what the documentation says
13451 -is allowable.  I have tried to make the library robust against
13452 -such problems, but I'm sure I haven't succeeded.
13453 -
13454 -</P>
13455 -<P>
13456 -Finally, if the above comments don't help, you'll have to send
13457 -me a bug report.  Now, it's just amazing how many people will 
13458 -send me a bug report saying something like
13459 -
13460 -<PRE>
13461 -   bzip2 crashed with segmentation fault on my machine
13462 -</PRE>
13463 -
13464 -<P>
13465 -and absolutely nothing else.  Needless to say, a such a report
13466 -is <EM>totally, utterly, completely and comprehensively 100% useless; 
13467 -a waste of your time, my time, and net bandwidth</EM>.
13468 -With no details at all, there's no way I can possibly begin
13469 -to figure out what the problem is.
13470 -
13471 -</P>
13472 -<P>
13473 -The rules of the game are: facts, facts, facts.  Don't omit
13474 -them because "oh, they won't be relevant".  At the bare 
13475 -minimum:
13476 -
13477 -<PRE>
13478 -   Machine type.  Operating system version.  
13479 -   Exact version of <CODE>bzip2</CODE> (do <CODE>bzip2 -V</CODE>).  
13480 -   Exact version of the compiler used.  
13481 -   Flags passed to the compiler.
13482 -</PRE>
13483 -
13484 -<P>
13485 -However, the most important single thing that will help me is
13486 -the file that you were trying to compress or decompress at the
13487 -time the problem happened.  Without that, my ability to do anything
13488 -more than speculate about the cause, is limited.
13489 -
13490 -</P>
13491 -<P>
13492 -Please remember that I connect to the Internet with a modem, so
13493 -you should contact me before mailing me huge files.
13494 -
13495 -</P>
13496 -
13497 -
13498 -
13499 -<H2><A NAME="SEC47" HREF="manual_toc.html#TOC47">Did you get the right package?</A></H2>
13500 -
13501 -<P>
13502 -<CODE>bzip2</CODE> is a resource hog.  It soaks up large amounts of CPU cycles
13503 -and memory.  Also, it gives very large latencies.  In the worst case, you
13504 -can feed many megabytes of uncompressed data into the library before
13505 -getting any compressed output, so this probably rules out applications
13506 -requiring interactive behaviour.
13507 -
13508 -</P>
13509 -<P>
13510 -These aren't faults of my implementation, I hope, but more
13511 -an intrinsic property of the Burrows-Wheeler transform (unfortunately).  
13512 -Maybe this isn't what you want.
13513 -
13514 -</P>
13515 -<P>
13516 -If you want a compressor and/or library which is faster, uses less
13517 -memory but gets pretty good compression, and has minimal latency,
13518 -consider Jean-loup
13519 -Gailly's and Mark Adler's work, <CODE>zlib-1.1.2</CODE> and
13520 -<CODE>gzip-1.2.4</CODE>.  Look for them at
13521 -
13522 -</P>
13523 -<P>
13524 -<CODE>http://www.cdrom.com/pub/infozip/zlib</CODE> and
13525 -<CODE>http://www.gzip.org</CODE> respectively.
13526 -
13527 -</P>
13528 -<P>
13529 -For something faster and lighter still, you might try Markus F X J
13530 -Oberhumer's <CODE>LZO</CODE> real-time compression/decompression library, at
13531 -<BR> <CODE>http://wildsau.idv.uni-linz.ac.at/mfx/lzo.html</CODE>.
13532 -
13533 -</P>
13534 -<P>
13535 -If you want to use the <CODE>bzip2</CODE> algorithms to compress small blocks
13536 -of data, 64k bytes or smaller, for example on an on-the-fly disk
13537 -compressor, you'd be well advised not to use this library.  Instead,
13538 -I've made a special library tuned for that kind of use.  It's part of
13539 -<CODE>e2compr-0.40</CODE>, an on-the-fly disk compressor for the Linux
13540 -<CODE>ext2</CODE> filesystem.  Look at
13541 -<CODE>http://www.netspace.net.au/~reiter/e2compr</CODE>.
13542 -
13543 -</P>
13544 -
13545 -
13546 -
13547 -<H2><A NAME="SEC48" HREF="manual_toc.html#TOC48">Testing</A></H2>
13548 -
13549 -<P>
13550 -A record of the tests I've done.
13551 -
13552 -</P>
13553 -<P>
13554 -First, some data sets:
13555 -
13556 -<UL>
13557 -<LI>B: a directory containing 6001 files, one for every length in the
13558 -
13559 -      range 0 to 6000 bytes.  The files contain random lowercase
13560 -      letters.  18.7 megabytes.
13561 -<LI>H: my home directory tree.  Documents, source code, mail files,
13562 -
13563 -      compressed data.  H contains B, and also a directory of 
13564 -      files designed as boundary cases for the sorting; mostly very
13565 -      repetitive, nasty files.  565 megabytes.
13566 -<LI>A: directory tree holding various applications built from source:
13567 -
13568 -      <CODE>egcs</CODE>, <CODE>gcc-2.8.1</CODE>, KDE, GTK, Octave, etc.
13569 -      2200 megabytes.
13570 -</UL>
13571 -
13572 -<P>
13573 -The tests conducted are as follows.  Each test means compressing 
13574 -(a copy of) each file in the data set, decompressing it and
13575 -comparing it against the original.
13576 -
13577 -</P>
13578 -<P>
13579 -First, a bunch of tests with block sizes and internal buffer
13580 -sizes set very small, 
13581 -to detect any problems with the
13582 -blocking and buffering mechanisms.  
13583 -This required modifying the source code so as to try to 
13584 -break it.
13585 -
13586 -<OL>
13587 -<LI>Data set H, with
13588 -
13589 -      buffer size of 1 byte, and block size of 23 bytes.
13590 -<LI>Data set B, buffer sizes 1 byte, block size 1 byte.
13591 -
13592 -<LI>As (2) but small-mode decompression.
13593 -
13594 -<LI>As (2) with block size 2 bytes.
13595 -
13596 -<LI>As (2) with block size 3 bytes.
13597 -
13598 -<LI>As (2) with block size 4 bytes.
13599 -
13600 -<LI>As (2) with block size 5 bytes.
13601 -
13602 -<LI>As (2) with block size 6 bytes and small-mode decompression.
13603 -
13604 -<LI>H with buffer size of 1 byte, but normal block
13605 -
13606 -      size (up to 900000 bytes).
13607 -</OL>
13608 -
13609 -<P>
13610 -Then some tests with unmodified source code.
13611 -
13612 -<OL>
13613 -<LI>H, all settings normal.
13614 -
13615 -<LI>As (1), with small-mode decompress.
13616 -
13617 -<LI>H, compress with flag <CODE>-1</CODE>.
13618 -
13619 -<LI>H, compress with flag <CODE>-s</CODE>, decompress with flag <CODE>-s</CODE>.
13620 -
13621 -<LI>Forwards compatibility: H, <CODE>bzip2-0.1pl2</CODE> compressing,
13622 -
13623 -      <CODE>bzip2-0.9.5</CODE> decompressing, all settings normal.
13624 -<LI>Backwards compatibility:  H, <CODE>bzip2-0.9.5</CODE> compressing,
13625 -
13626 -      <CODE>bzip2-0.1pl2</CODE> decompressing, all settings normal.
13627 -<LI>Bigger tests: A, all settings normal.
13628 -
13629 -<LI>As (7), using the fallback (Sadakane-like) sorting algorithm.
13630 -
13631 -<LI>As (8), compress with flag <CODE>-1</CODE>, decompress with flag
13632 -
13633 -      <CODE>-s</CODE>.
13634 -<LI>H, using the fallback sorting algorithm.
13635 -
13636 -<LI>Forwards compatibility: A, <CODE>bzip2-0.1pl2</CODE> compressing,
13637 -
13638 -      <CODE>bzip2-0.9.5</CODE> decompressing, all settings normal.
13639 -<LI>Backwards compatibility:  A, <CODE>bzip2-0.9.5</CODE> compressing,
13640 -
13641 -      <CODE>bzip2-0.1pl2</CODE> decompressing, all settings normal.
13642 -<LI>Misc test: about 400 megabytes of <CODE>.tar</CODE> files with
13643 -
13644 -      <CODE>bzip2</CODE> compiled with Checker (a memory access error
13645 -       detector, like Purify).
13646 -<LI>Misc tests to make sure it builds and runs ok on non-Linux/x86
13647 -
13648 -      platforms.
13649 -</OL>
13650 -
13651 -<P>
13652 -These tests were conducted on a 225 MHz IDT WinChip machine, running
13653 -Linux 2.0.36.  They represent nearly a week of continuous computation.
13654 -All tests completed successfully.
13655 -
13656 -</P>
13657 -
13658 -
13659 -
13660 -<H2><A NAME="SEC49" HREF="manual_toc.html#TOC49">Further reading</A></H2>
13661 -<P>
13662 -<CODE>bzip2</CODE> is not research work, in the sense that it doesn't present
13663 -any new ideas.  Rather, it's an engineering exercise based on existing
13664 -ideas.
13665 -
13666 -</P>
13667 -<P>
13668 -Four documents describe essentially all the ideas behind <CODE>bzip2</CODE>:
13669 -
13670 -<PRE>
13671 -Michael Burrows and D. J. Wheeler:
13672 -  "A block-sorting lossless data compression algorithm"
13673 -   10th May 1994. 
13674 -   Digital SRC Research Report 124.
13675 -   ftp://ftp.digital.com/pub/DEC/SRC/research-reports/SRC-124.ps.gz
13676 -   If you have trouble finding it, try searching at the
13677 -   New Zealand Digital Library, http://www.nzdl.org.
13678 -
13679 -Daniel S. Hirschberg and Debra A. LeLewer
13680 -  "Efficient Decoding of Prefix Codes"
13681 -   Communications of the ACM, April 1990, Vol 33, Number 4.
13682 -   You might be able to get an electronic copy of this
13683 -      from the ACM Digital Library.
13684 -
13685 -David J. Wheeler
13686 -   Program bred3.c and accompanying document bred3.ps.
13687 -   This contains the idea behind the multi-table Huffman
13688 -   coding scheme.
13689 -   ftp://ftp.cl.cam.ac.uk/users/djw3/
13690 -
13691 -Jon L. Bentley and Robert Sedgewick
13692 -  "Fast Algorithms for Sorting and Searching Strings"
13693 -   Available from Sedgewick's web page,
13694 -   www.cs.princeton.edu/~rs
13695 -</PRE>
13696 -
13697 -<P>
13698 -The following paper gives valuable additional insights into the
13699 -algorithm, but is not immediately the basis of any code
13700 -used in bzip2.
13701 -
13702 -<PRE>
13703 -Peter Fenwick:
13704 -   Block Sorting Text Compression
13705 -   Proceedings of the 19th Australasian Computer Science Conference,
13706 -     Melbourne, Australia.  Jan 31 - Feb 2, 1996.
13707 -   ftp://ftp.cs.auckland.ac.nz/pub/peter-f/ACSC96paper.ps
13708 -</PRE>
13709 -
13710 -<P>
13711 -Kunihiko Sadakane's sorting algorithm, mentioned above,
13712 -is available from:
13713 -
13714 -<PRE>
13715 -http://naomi.is.s.u-tokyo.ac.jp/~sada/papers/Sada98b.ps.gz
13716 -</PRE>
13717 -
13718 -<P>
13719 -The Manber-Myers suffix array construction
13720 -algorithm is described in a paper
13721 -available from:
13722 -
13723 -<PRE>
13724 -http://www.cs.arizona.edu/people/gene/PAPERS/suffix.ps
13725 -</PRE>
13726 -
13727 -<P>
13728 -Finally, the following paper documents some recent investigations
13729 -I made into the performance of sorting algorithms:
13730 -
13731 -<PRE>
13732 -Julian Seward:
13733 -   On the Performance of BWT Sorting Algorithms
13734 -   Proceedings of the IEEE Data Compression Conference 2000
13735 -     Snowbird, Utah.  28-30 March 2000.
13736 -</PRE>
13737 -
13738 -<P><HR><P>
13739 -<p>Go to the <A HREF="manual_1.html">first</A>, <A HREF="manual_3.html">previous</A>, next, last section, <A HREF="manual_toc.html">table of contents</A>.
13740 -</BODY>
13741 -</HTML>
13742 diff -Nru bzip2-1.0.1/manual_toc.html bzip2-1.0.1.new/manual_toc.html
13743 --- bzip2-1.0.1/manual_toc.html Sat Jun 24 20:13:27 2000
13744 +++ bzip2-1.0.1.new/manual_toc.html     Thu Jan  1 01:00:00 1970
13745 @@ -1,173 +0,0 @@
13746 -<HTML>
13747 -<HEAD>
13748 -<!-- This HTML file has been created by texi2html 1.54
13749 -     from manual.texi on 23 March 2000 -->
13750 -
13751 -<TITLE>bzip2 and libbzip2 - Table of Contents</TITLE>
13752 -
13753 -</HEAD>
13754 -<BODY>
13755 -<H1>bzip2 and libbzip2</H1>
13756 -<H2>a program and library for data compression</H2>
13757 -<H2>copyright (C) 1996-2000 Julian Seward</H2>
13758 -<H2>version 1.0 of 21 March 2000</H2>
13759 -<ADDRESS>Julian Seward</ADDRESS>
13760 -<P>
13761 -<P><HR><P>
13762 -
13763 -<P>
13764 -This program, <CODE>bzip2</CODE>, 
13765 -and associated library <CODE>libbzip2</CODE>, are
13766 -Copyright (C) 1996-2000 Julian R Seward.  All rights reserved.
13767 -
13768 -</P>
13769 -<P>
13770 -Redistribution and use in source and binary forms, with or without
13771 -modification, are permitted provided that the following conditions
13772 -are met:
13773 -
13774 -<UL>
13775 -<LI>
13776 -
13777 -   Redistributions of source code must retain the above copyright
13778 -   notice, this list of conditions and the following disclaimer.
13779 -<LI>
13780 -
13781 -   The origin of this software must not be misrepresented; you must 
13782 -   not claim that you wrote the original software.  If you use this 
13783 -   software in a product, an acknowledgment in the product 
13784 -   documentation would be appreciated but is not required.
13785 -<LI>
13786 -
13787 -   Altered source versions must be plainly marked as such, and must
13788 -   not be misrepresented as being the original software.
13789 -<LI>
13790 -
13791 -   The name of the author may not be used to endorse or promote 
13792 -   products derived from this software without specific prior written 
13793 -   permission.
13794 -</UL>
13795 -
13796 -<P>
13797 -THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS
13798 -OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
13799 -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
13800 -ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
13801 -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
13802 -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
13803 -GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
13804 -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
13805 -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
13806 -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
13807 -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13808 -
13809 -</P>
13810 -<P>
13811 -Julian Seward, Cambridge, UK.
13812 -
13813 -</P>
13814 -<P>
13815 -<CODE>jseward@acm.org</CODE>
13816 -
13817 -</P>
13818 -<P>
13819 -<CODE>http://sourceware.cygnus.com/bzip2</CODE>
13820 -
13821 -</P>
13822 -<P>
13823 -<CODE>http://www.cacheprof.org</CODE>
13824 -
13825 -</P>
13826 -<P>
13827 -<CODE>http://www.muraroa.demon.co.uk</CODE>
13828 -
13829 -</P>
13830 -<P>
13831 -<CODE>bzip2</CODE>/<CODE>libbzip2</CODE> version 1.0 of 21 March 2000.
13832 -
13833 -</P>
13834 -<P>
13835 -PATENTS: To the best of my knowledge, <CODE>bzip2</CODE> does not use any patented
13836 -algorithms.  However, I do not have the resources available to carry out
13837 -a full patent search.  Therefore I cannot give any guarantee of the
13838 -above statement.
13839 -
13840 -</P>
13841 -
13842 -<UL>
13843 -<LI><A NAME="TOC1" HREF="manual_1.html#SEC1">Introduction</A>
13844 -<LI><A NAME="TOC2" HREF="manual_2.html#SEC2">How to use <CODE>bzip2</CODE></A>
13845 -<UL>
13846 -<UL>
13847 -<UL>
13848 -<LI><A NAME="TOC3" HREF="manual_2.html#SEC3">NAME</A>
13849 -<LI><A NAME="TOC4" HREF="manual_2.html#SEC4">SYNOPSIS</A>
13850 -<LI><A NAME="TOC5" HREF="manual_2.html#SEC5">DESCRIPTION</A>
13851 -<LI><A NAME="TOC6" HREF="manual_2.html#SEC6">OPTIONS</A>
13852 -<LI><A NAME="TOC7" HREF="manual_2.html#SEC7">MEMORY MANAGEMENT</A>
13853 -<LI><A NAME="TOC8" HREF="manual_2.html#SEC8">RECOVERING DATA FROM DAMAGED FILES</A>
13854 -<LI><A NAME="TOC9" HREF="manual_2.html#SEC9">PERFORMANCE NOTES</A>
13855 -<LI><A NAME="TOC10" HREF="manual_2.html#SEC10">CAVEATS</A>
13856 -<LI><A NAME="TOC11" HREF="manual_2.html#SEC11">AUTHOR</A>
13857 -</UL>
13858 -</UL>
13859 -</UL>
13860 -<LI><A NAME="TOC12" HREF="manual_3.html#SEC12">Programming with <CODE>libbzip2</CODE></A>
13861 -<UL>
13862 -<LI><A NAME="TOC13" HREF="manual_3.html#SEC13">Top-level structure</A>
13863 -<UL>
13864 -<LI><A NAME="TOC14" HREF="manual_3.html#SEC14">Low-level summary</A>
13865 -<LI><A NAME="TOC15" HREF="manual_3.html#SEC15">High-level summary</A>
13866 -<LI><A NAME="TOC16" HREF="manual_3.html#SEC16">Utility functions summary</A>
13867 -</UL>
13868 -<LI><A NAME="TOC17" HREF="manual_3.html#SEC17">Error handling</A>
13869 -<LI><A NAME="TOC18" HREF="manual_3.html#SEC18">Low-level interface</A>
13870 -<UL>
13871 -<LI><A NAME="TOC19" HREF="manual_3.html#SEC19"><CODE>BZ2_bzCompressInit</CODE></A>
13872 -<LI><A NAME="TOC20" HREF="manual_3.html#SEC20"><CODE>BZ2_bzCompress</CODE></A>
13873 -<LI><A NAME="TOC21" HREF="manual_3.html#SEC21"><CODE>BZ2_bzCompressEnd</CODE></A>
13874 -<LI><A NAME="TOC22" HREF="manual_3.html#SEC22"><CODE>BZ2_bzDecompressInit</CODE></A>
13875 -<LI><A NAME="TOC23" HREF="manual_3.html#SEC23"><CODE>BZ2_bzDecompress</CODE></A>
13876 -<LI><A NAME="TOC24" HREF="manual_3.html#SEC24"><CODE>BZ2_bzDecompressEnd</CODE></A>
13877 -</UL>
13878 -<LI><A NAME="TOC25" HREF="manual_3.html#SEC25">High-level interface</A>
13879 -<UL>
13880 -<LI><A NAME="TOC26" HREF="manual_3.html#SEC26"><CODE>BZ2_bzReadOpen</CODE></A>
13881 -<LI><A NAME="TOC27" HREF="manual_3.html#SEC27"><CODE>BZ2_bzRead</CODE></A>
13882 -<LI><A NAME="TOC28" HREF="manual_3.html#SEC28"><CODE>BZ2_bzReadGetUnused</CODE></A>
13883 -<LI><A NAME="TOC29" HREF="manual_3.html#SEC29"><CODE>BZ2_bzReadClose</CODE></A>
13884 -<LI><A NAME="TOC30" HREF="manual_3.html#SEC30"><CODE>BZ2_bzWriteOpen</CODE></A>
13885 -<LI><A NAME="TOC31" HREF="manual_3.html#SEC31"><CODE>BZ2_bzWrite</CODE></A>
13886 -<LI><A NAME="TOC32" HREF="manual_3.html#SEC32"><CODE>BZ2_bzWriteClose</CODE></A>
13887 -<LI><A NAME="TOC33" HREF="manual_3.html#SEC33">Handling embedded compressed data streams</A>
13888 -<LI><A NAME="TOC34" HREF="manual_3.html#SEC34">Standard file-reading/writing code</A>
13889 -</UL>
13890 -<LI><A NAME="TOC35" HREF="manual_3.html#SEC35">Utility functions</A>
13891 -<UL>
13892 -<LI><A NAME="TOC36" HREF="manual_3.html#SEC36"><CODE>BZ2_bzBuffToBuffCompress</CODE></A>
13893 -<LI><A NAME="TOC37" HREF="manual_3.html#SEC37"><CODE>BZ2_bzBuffToBuffDecompress</CODE></A>
13894 -</UL>
13895 -<LI><A NAME="TOC38" HREF="manual_3.html#SEC38"><CODE>zlib</CODE> compatibility functions</A>
13896 -<LI><A NAME="TOC39" HREF="manual_3.html#SEC39">Using the library in a <CODE>stdio</CODE>-free environment</A>
13897 -<UL>
13898 -<LI><A NAME="TOC40" HREF="manual_3.html#SEC40">Getting rid of <CODE>stdio</CODE></A>
13899 -<LI><A NAME="TOC41" HREF="manual_3.html#SEC41">Critical error handling</A>
13900 -</UL>
13901 -<LI><A NAME="TOC42" HREF="manual_3.html#SEC42">Making a Windows DLL</A>
13902 -</UL>
13903 -<LI><A NAME="TOC43" HREF="manual_4.html#SEC43">Miscellanea</A>
13904 -<UL>
13905 -<LI><A NAME="TOC44" HREF="manual_4.html#SEC44">Limitations of the compressed file format</A>
13906 -<LI><A NAME="TOC45" HREF="manual_4.html#SEC45">Portability issues</A>
13907 -<LI><A NAME="TOC46" HREF="manual_4.html#SEC46">Reporting bugs</A>
13908 -<LI><A NAME="TOC47" HREF="manual_4.html#SEC47">Did you get the right package?</A>
13909 -<LI><A NAME="TOC48" HREF="manual_4.html#SEC48">Testing</A>
13910 -<LI><A NAME="TOC49" HREF="manual_4.html#SEC49">Further reading</A>
13911 -</UL>
13912 -</UL>
13913 -<P><HR><P>
13914 -This document was generated on 23 March 2000 using the
13915 -<A HREF="http://wwwcn.cern.ch/dci/texi2html/">texi2html</A>
13916 -translator version 1.51a.</P>
13917 -</BODY>
13918 -</HTML>
13919 diff -Nru bzip2-1.0.1/randtable.c bzip2-1.0.1.new/randtable.c
13920 --- bzip2-1.0.1/randtable.c     Sat Jun 24 20:13:27 2000
13921 +++ bzip2-1.0.1.new/randtable.c Sat Jun 24 20:13:06 2000
13922 @@ -58,6 +58,10 @@
13923    For more information on these sources, see the manual.
13924  --*/
13925  
13926 +#ifdef HAVE_CONFIG_H
13927 +#include <config.h>
13928 +#endif
13929 +
13930  
13931  #include "bzlib_private.h"
13932  
13933 diff -Nru bzip2-1.0.1/spewG.c bzip2-1.0.1.new/spewG.c
13934 --- bzip2-1.0.1/spewG.c Sat Jun 24 20:13:27 2000
13935 +++ bzip2-1.0.1.new/spewG.c     Sat Jun 24 20:13:06 2000
13936 @@ -9,7 +9,10 @@
13937     (but is otherwise harmless).
13938  */
13939  
13940 -#define _FILE_OFFSET_BITS 64
13941 +#ifdef HAVE_CONFIG_H
13942 +#include <config.h>
13943 +#endif
13944 +
13945  
13946  #include <stdio.h>
13947  #include <stdlib.h>
13948 diff -Nru bzip2-1.0.1/stamp-h.in bzip2-1.0.1.new/stamp-h.in
13949 --- bzip2-1.0.1/stamp-h.in      Thu Jan  1 01:00:00 1970
13950 +++ bzip2-1.0.1.new/stamp-h.in  Sat Jun 24 20:13:06 2000
13951 @@ -0,0 +1 @@
13952 +timestamp
13953 diff -Nru bzip2-1.0.1/unzcrash.c bzip2-1.0.1.new/unzcrash.c
13954 --- bzip2-1.0.1/unzcrash.c      Sat Jun 24 20:13:27 2000
13955 +++ bzip2-1.0.1.new/unzcrash.c  Sat Jun 24 20:13:06 2000
13956 @@ -13,6 +13,12 @@
13957     many hours.
13958  */
13959  
13960 +#ifdef HAVE_CONFIG_H
13961 +#include <config.h>
13962 +#endif
13963 +
13964 +
13965 +
13966  #include <stdio.h>
13967  #include <assert.h>
13968  #include "bzlib.h"
This page took 1.260858 seconds and 3 git commands to generate.