GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> ZFS / V0-0-2 > zlib_file_compress / rhel5-32


Interface   Data Structures   File List   Data Fields   Globals  

ZLIB_file_compress.h File Reference

ZLIB file compression utility library. More...


Functions

unsigned int ZLIB_fileCompressFromFile (int in, int out, unsigned int bufSize)
 Compress a file into an output file.
unsigned int ZLIB_fileCompressFromMem (void *inBuf, int out, unsigned int inSize, unsigned int bufSize)
 Compress a memory region into an output file.


Detailed Description

ZLIB file compression utility library.

Author:
D.L. Wood
This library provides a slightly higher level interface to the ZLIB compression utility than does the deflate() interface. One advantage is that the user does not need to worry about the details of the ZLIB stream structure. Another goal of this library is to minimize the amount of temporary buffer storage required to compress large files. This is particulary important when compressing one file into another. In cases where a file handle is needed as a function parameter, the user is resposible for opening (or creating) the handle before calling the function and for closing the handle after completion.

When compressing file data, the functions in this library prefix a 32-bit, big-endian word to the head of the output stream. This word contains the size in bytes of the original file. This is used by the zlib_file_inflate library functions. Following the 32-bit size word is the standard ZLIB compressed data stream.

On VxWorks platforms, the PBS/MBA facility must be initialized.


Function Documentation

unsigned int ZLIB_fileCompressFromFile ( int  in,
int  out,
unsigned int  bufSize 
)

Compress a file into an output file.

This function uses the ZLIB memory to memory inflation library to compress an input file to an output file. Temporary buffer storage of the streams is minimized. The in and out file handles must already have been opened. This function will not close the file handles, and may leave the file pointers at an offset within the file. The out file offset should point to the place where the compression record starts within the output file.

Parameters:
in The input file handle.
out The compressed output file handle.
bufSize The size in bytes to allocate for stream buffering.
Returns:
A ZLIB MSG code.

References ZLIB_fileCompressAlloc(), ZLIB_fileCompressError(), and ZLIB_fileCompressFree().

unsigned int ZLIB_fileCompressFromMem ( void *  inBuf,
int  out,
unsigned int  inSize,
unsigned int  bufSize 
)

Compress a memory region into an output file.

This function uses the ZLIB memory to memory inflation library to compress an input memory buffer to an output file. Temporary buffer storage of the streams is minimized. The in and out file handles must already have been opened. This function will not close the file handles, and may leave the file pointers at an offset within the file. The out file offset should point to the place where the compression record starts within the output file.

Parameters:
inBuf The input data memory buffer.
out The compressed output file handle.
inSize The number of bytes in the input buffer to compress.
bufSize The size in bytes to allocate for stream buffering.
Returns:
A ZLIB MSG code.

References ZLIB_fileCompressAlloc(), ZLIB_fileCompressError(), and ZLIB_fileCompressFree().


Generated on Tue Nov 29 20:48:57 2011 by  doxygen 1.5.8