CHCKSM - compute a checksum using add with carry.

Alternate Entry Name: CHK.SM

Usage:

B:
   checksum = chcksm( array, count [, awcc, initial] );
C:
   int chcksm(void *array, int count [, int awcc,
              int initial] );

Where:

array
points to the vector to be checksummed.
count
is the number of words to checksum. This is usually the number of words in "array".
awcc
is the number of trailing adds with carries of zero to do. The possible values of "awcc" are listed below, along with descriptions of the sort of applications for each value. If no "awcc" is specified, the default is zero.
0
is used for object decks
1
is used for file system control blocks, and hstar files
2
is used for all but the last chunk when you checksum something by chunks. It may also be used to prepare a Multics-style checksum.
initial
is the starting value of the checksum. The default is zero.

Description:

CHCKSM is used to compute system-compatible checksums.

At times it is not possible to hold the entire item to be checksummed in memory. In this case, you should checksum the file in chunks, using the checksum from one chunk as the "initial" value for the next. When using this chunk checksumming method, you should specify the value of two for "awcc" for all chunks but the last.

Copyright © 1996, Thinkage Ltd.