LIBDF Structures: TDfCmp

Summary:

 

TDfCmp structure can be used in 2 cases within library LIBDF :

· Representation of the comparing context;
· Representation of the df-file content information.

 

And all fields of this structure have the same definite value independently on its usage at that.

 

Syntax:

 

struct TDfCmp

{

FILEPOS_T

nOldFileSize;

FILEPOS_T

nNewFileSize;

_TCHAR *

szOldFileName;

_TCHAR *

szNewFileName;

UINT32_T

dwOldFileAttr;

UINT32_T

dwNewFileAttr;

FILETIME_T

ftOldLastWriteTime;

FILETIME_T

ftNewLastWriteTime;

_TCHAR *

szOldVersionID;

_TCHAR *

szNewVersionID;

UINT32_T

nFlags;

MD5_T

md5Old;

MD5_T

md5New;

void *

lpInternal;

};

 

Fields:

 

nOldFileSize – size of an old file. "-1" value if old file was skipped.

nNewFileSize – size of a new file. "-1" value if new file was skipped.

 

szOldFileName – pointer on a null-terminated string - name of an old file. NULL if name of an old file was not set.

szNewFileName – pointer on a null-terminated string - name of a new file. NULL if name of a new file was not set.

If using function dfOpenCmpByNames to create context, then fields szOldFileName and szNewFileName are initialized only by names of files (without path).

If using function dfOpenCmpByHandles to create context, then fields szOldFileName and szNewFileName are set equal to NULL value

 

dwOldFileAttr – old file attributes.

dwNewFileAttr – new file attributes.

 

ftOldLastWriteTime – old file last modification date/time.

ftNewLastWriteTime – new file last modification date/time.

 

szOldVersionID – pointer on a null-terminated string, representing version ID of an old file.

szNewVersionID – pointer on a null-terminated string, representing version ID of a new file.

 

nFlags – flags field.

Free combination of the following flags:

 

DFHF_CHG_NAME

Set if file names are different.

DFHF_CHG_DATETIME

Set if last modification date/time of files is different.

DFHF_CHG_ATTR

Set if attributes of files are different.

DFHF_CHG_CONTENT

Set if content of files is different.

DFHF_OLD_MD5

Value of old file's MD5 was calculated and saved in the field md5Old.

DFHF_NEW_MD5

Value of new file's MD5 was calculated and saved in the field md5New.

DFHF_EXTRA_DATA

Flag of 'extra data' presence in df-file.

DFHF_TE

df-file was built without opportunity to recover content of a new file (DF_CNTUPD_NONE).

Such df-file cannot be applied.

 

 

md5Old – value of old file's MD5 if it was calculated (if the flag DFHF_OLD_MD5 is set in the flags field)

 

md5New – value of new file's MD5 if it was calculated (if the flag DFHF_NEW_MD5 is set in the flags field)

 

lpInternal - reserved for internal use. Must not be changed by user!

 

 

NOTE:

Values of fields ånOldFileSize, nNewFileSize, szOldFileName, szNewFileName, dwOldFileAttr, dwNewFileAttr, ftOldLastWriteTime, ftNewLastWriteTime, szOldVersionID, szNewVersionID are set during creation process of the comparing context (functions dfOpenCmpByNames and dfOpenCmpByHandles) and may be changed later on by user at any moment (for string values it is allowed to change both directly strings themselves and values of field-pointers).

Other fields must not be changed by user!

 

Flags field nFlags is set when calling function dfCompare and must not be changed by user.

 

Location and time for calculation of values md5Old and md5New is not exactly determined (it can be functions: dfCompare, dfBuildN or dfBuildH) and depends on the compared files and on parameters of called functions. And moreover values of md5Old è md5New can be left uncalculated at all, if it is not required for the task of df-file applying. To ensure calculation of values of md5Old and md5New it is necessary to utilize function dfBuildN and dfBuildH and set flags iForceOldMD5 and iForceNewMD5 of the TDfBldOptions structure.

 

Converted from CHM to HTML with chm2web Standard 2.75 (unicode)