GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> ZFS / dev > zlib_file_inflate / rad750
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <ZLIB/zlib.h>
#include <ZFS/ZLIB_msg.h>
#include <ZFS/ZLIB_file_inflate.h>
#include <PBS/BSWP.h>
#include <PBS/MBA.h>
#include <MSG/MSG_pubdefs.h>
Functions | |
static unsigned int | ZLIB_fileInflateError (int errCode, const char *func, const char *msg) |
static void * | ZLIB_fileInflateAlloc (void *opaque, unsigned int numItems, unsigned int size) |
static void | ZLIB_fileInflateFree (void *opaque, void *address) |
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. |
static void * ZLIB_fileInflateAlloc | ( | void * | opaque, | |
unsigned int | numItems, | |||
unsigned int | size | |||
) | [static] |
Memory allocation callback for ZLIB stream.
opaque | Ignored. | |
numItems | The number of items to allocate. | |
size | The size in bytes of each item. |
Referenced by ZLIB_fileInflateToFile(), and ZLIB_fileInflateToMem().
static unsigned int ZLIB_fileInflateError | ( | int | errCode, | |
const char * | func, | |||
const char * | msg | |||
) | [static] |
This function translates ZLIB native error codes into MSG codes.
errCode | The ZLIB error code. | |
func | The name of the function in which the error occurred. | |
msg | A message to print out in the MSG output. |
Referenced by ZLIB_fileInflateToFile(), and ZLIB_fileInflateToMem().
static void ZLIB_fileInflateFree | ( | void * | opaque, | |
void * | address | |||
) | [static] |
Memory release callback for ZLIB stream.
opaque | Ignored. | |
address | Pointer to memory to free. |
Referenced by ZLIB_fileInflateToFile(), and ZLIB_fileInflateToMem().
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().