"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "zlib/zlib/examples/zran.c" between
muscle7.61.zip and muscle7.62.zip

About: MUSCLE (Multi User Server Client Linking Environment) is a messaging server and networking API. The included server program ("muscled") lets its clients message each other, and/or store information in its serverside hierarchical database.

zran.c  (muscle7.61):zran.c  (muscle7.62)
skipping to change at line 30 skipping to change at line 30
the starting file offset and bit of that block, and the 32K bytes of the starting file offset and bit of that block, and the 32K bytes of
uncompressed data that precede that block. Also the uncompressed offset of uncompressed data that precede that block. Also the uncompressed offset of
that block is saved to provide a referece for locating a desired starting that block is saved to provide a referece for locating a desired starting
point in the uncompressed stream. build_index() works by decompressing the point in the uncompressed stream. build_index() works by decompressing the
input zlib or gzip stream a block at a time, and at the end of each block input zlib or gzip stream a block at a time, and at the end of each block
deciding if enough uncompressed data has gone by to justify the creation of deciding if enough uncompressed data has gone by to justify the creation of
a new access point. If so, that point is saved in a data structure that a new access point. If so, that point is saved in a data structure that
grows as needed to accommodate the points. grows as needed to accommodate the points.
To use the index, an offset in the uncompressed data is provided, for which To use the index, an offset in the uncompressed data is provided, for which
the latest accees point at or preceding that offset is located in the index. the latest access point at or preceding that offset is located in the index.
The input file is positioned to the specified location in the index, and if The input file is positioned to the specified location in the index, and if
necessary the first few bits of the compressed data is read from the file. necessary the first few bits of the compressed data is read from the file.
inflate is initialized with those bits and the 32K of uncompressed data, and inflate is initialized with those bits and the 32K of uncompressed data, and
the decompression then proceeds until the desired offset in the file is the decompression then proceeds until the desired offset in the file is
reached. Then the decompression continues to read the desired uncompressed reached. Then the decompression continues to read the desired uncompressed
data from the file. data from the file.
Another approach would be to generate the index on demand. In that case, Another approach would be to generate the index on demand. In that case,
requests for random access reads from the compressed data would try to use requests for random access reads from the compressed data would try to use
the index, but if a read far enough past the end of the index is required, the index, but if a read far enough past the end of the index is required,
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)