#include <lzexpand.h> |
void LZDone(void) |
The LZDone function frees buffers that the LZStart function allocated for multiple-file copy operations.
This function has no parameters.
This function does not return a value.
Applications that copy multiple files should call LZStart before copying the files with the CopyLZFile function. LZStart allocates buffers for the file copy operations.
The following example uses LZDone to free buffers allocated by LZStart:
#define NUM_FILES 4
char *szSrc[NUM_FILES] =
{"readme.txt", "data.txt", "update.txt", "list.txt"};
char *szDest[NUM_FILES] =
{"readme.bak", "data.bak", "update.bak", "list.bak"};
OFSTRUCT ofStrSrc;
OFSTRUCT ofStrDest;
HFILE hfSrcFile, hfDstFile;
int i;
/* Allocate internal buffers for the CopyLZFile function. */
LZStart();
/* Open, copy, and then close the files. */
for (i = 0; i < NUM_FILES; i++) {
hfSrcFile = LZOpenFile(szSrc[i], &ofStrSrc, OF_READ);
hfDstFile = LZOpenFile(szDest[i], &ofStrDest, OF_CREATE);
CopyLZFile(hfSrcFile, hfDstFile);
LZClose(hfSrcFile);
LZClose(hfDstFile);
}
LZDone(); /* free the internal buffers */