Functions
ID #1047
What are parameters of function CRC32?
CRC32(*CSTRING, UNSIGNED, ULONG), ULONG, RAW, NAME('Cla$CRC32')
Parameters
- First - checked data block
- Second - length of data block, passed by address as first parameter. I.e. roughly speaking, first parameter is not CSTRING. Attribute RAW defines that only address of string must be passed without length as usually. By the way this prototype may be written in this form:
CRC32(*STRING, ULONG), ULONG, NAME('Cla$CRC32')
In this example compiler will pass length of data block without assistance.
- Third - initial value of control sum. It was done in ordre to calculate control sum for big data blocks passed to CRC32 sequentially by small blocks.
Example
Calc_CRC PROCEDURE(*STRING BigData, ULONG DataLen)
CRC_Code ULONG TmpBuff STRING(512)
CODE CRC_Code = 0 WHILE DataLen IF DataLen > 512 THEN Len# = 512 ELSE Len# = DataLen. TmpBuff = BigData[1:Len#] CRC_Code = CRC32(TmpBuff,Len#,CRC_Code) DataLen -= Len# END RETURN(CRC_Code)
Basically it was done for comfortable calculation of CRC-sum of file when it is impossible or inexpediently to read it to buffer entirely.
Tags: CRC32
Related entries:
- How to prevent running of Application Wizard creating new application?
- How to run application that will not be displayed in task bar?
- How correctly to return QUEUE from function and work with it in calling procedure?
- How to read from application environment variable?
- How to call WinAPI functions from Clarion applications?
Last update: 2007-07-15 19:48
Author: Oleg Rudenko
Revision: 1.0
You can comment on this entry