Creates a patch that can be applied with the DeltaMAXDecode function.
int DeltaMAXEncode( LPCTSTR szSource
, LPCTSTR szTarget
, LPCTSTR szDiff
, DELTAMAX_ENCODE_OPTIONS* pOptions );
The path and filename of the source file, i.e. the "old" file that the patch is intended to update.
The path and filename of the target file, i.e. the "new" file that the patch will be able to create from any copy of the source file.
The path and filename of the diff file, i.e. the patch data itself. After a successful encoding operation this file will contain the encoded differences between the source and target files.
Note: This file is generated by the encode operation based upon the data contained in the source and target files.
A pointer to a valid DELTAMAX_ENCODE_OPTIONS structure containing the settings for this encode operation.
Returns an integer value indicating success or failure of the encode operation. (0 indicates success, all other values correspond to a DeltaMAX error code.) See Error Codes for a list of possible error codes and their meanings.
This function creates an encoded differences file (.diff) based upon the data in a source file and a target file. The resulting diff can then be used with the DeltaMAXDecode function to recreate the target file from any copy of the source file.
You can receive progress information during the operation by defining OnProgress and/or OnMessage callback functions.
For best results, you should perform all encoding operations on a system with adequate physical memory installed, and with as few other programs running as possible.
The encoding engine is ultimately limited by the largest contiguous block of address space available to the process. Note that fragmentation of the virtual address space can reduce the amount of "usable" virtual memory. In order to achieve the best results with very large files, you should perform the encoding as early as possible in the life of your process.
In general, DeltaMAX needs memory for two things: source file indexing, and file I/O buffers.
The amount of memory needed for source file indexing is determined by (a) the size of the source file and (b) the nFootprintSize setting. Increasing the nFootprintSize setting reduces the memory needed for source file indexing, but may result in larger difference files. Note that you can do this automatically by setting bAutoIncreaseFootprintSize to TRUE.
The amount of memory used for file I/O buffers is determined in part by the memory settings (nMemoryMax, etc.) but is ultimately limited by the amount of free physical memory available on the system. DeltaMAX will automatically use as much currently unused memory as it can for file I/O buffers while leaving some memory free for the operating system and other programs. You can control the amount of physical memory left free for other programs with the nFreeMemoryMin setting.
For the best all-around performance, set nMemoryMax to 0, set nFootprintSize to 0, set bEnableMultiPass to TRUE, set nMultiPassThreshold to 0, and set nMultiPassMaxAdditionalPasses to 10. This will achieve the smallest diffs possible, given the amount of memory available on your system.
To build patches as quickly as possible, set bEnableMultiPass to FALSE, set nFootprintSize to 0, and set bAutoIncreaseFootprintSize to TRUE.
See Also: DELTAMAX_ENCODE_OPTIONS, DeltaMAXDecode