GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> ZFS / dev > zlib_file_inflate / mv2304
Functions | |
unsigned int | ZLIB_fileInflateToFile (int in, int out, unsigned int bufSize) |
Inflate a file into an output file. | |
unsigned int | ZLIB_fileInflateToMem (int in, void *out, unsigned int outSize, unsigned int bufSize) |
Inflate a memory region into an output file. | |
unsigned int | ZLIB_fileInflateSizeof (int file, unsigned int *size) |
Determine amount of memory for file inflation. |
This library provides a slightly higher level interface to the ZLIB inflation utility than does the inflate() 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 inflate large files. This is particulary important when inflating 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 inflating file data, the functions in this library expect to find a 32-bit, big-endian word to the head of the input stream. This word contains the size in bytes of the original file. Following the 32-bit size word is the standard ZLIB compressed data stream. This format is produced by the zlib_file_compress library functions.
On VxWorks platforms, the PBS/MBA facility must be initialized.
unsigned int ZLIB_fileInflateSizeof | ( | int | file, | |
unsigned int * | size | |||
) |
Determine amount of memory for file inflation.
This function returns the size in bytes required for the output buffer to inflate a ZLIB file.
file | The file descriptor. | |
size | Holds memory size upon return. |
unsigned int ZLIB_fileInflateToFile | ( | int | in, | |
int | out, | |||
unsigned int | bufSize | |||
) |
Inflate a file into an output file.
This function uses the ZLIB memory to memory inflation library to inflate an input file to an output file. Temporary buffer storage of the streams can be minimized by providing a small value for bufSize. 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 in file offset should point to the place where the compression record starts within the input file.
in | The input file handle. | |
out | The inflated output file handle. | |
bufSize | The size in bytes to allocate for stream buffering. |
References ZLIB_fileInflateAlloc(), ZLIB_fileInflateError(), and ZLIB_fileInflateFree().
unsigned int ZLIB_fileInflateToMem | ( | int | in, | |
void * | out, | |||
unsigned int | outSize, | |||
unsigned int | bufSize | |||
) |
Inflate a memory region into an output file.
This function uses the ZLIB memory to memory inflation library to inflate an input file to an output memory buffer. Temporary buffer storage of the streams is minimized. The in file handle must already have been opened. This function will not close the file handle, and may leave the file pointer at an offset within the file. The in file offset should point to the place where the compression record starts within the input file.
in | The input file handle. | |
out | The inflated output memory buffer. | |
outSize | The size in bytes of the out buffer. | |
bufSize | The size in bytes to allocate for stream buffering. |
References ZLIB_fileInflateAlloc(), ZLIB_fileInflateError(), and ZLIB_fileInflateFree().