Fchksum, Fchksum32 - compute checksum for fielded buffer
#include <stdio.h> #include "fml.h" long Fchksum(FBFR *fbfr) #include "fml32.h" long Fchksum32(FBFR32 *fbfr)
For extra-reliable I/O, a checksum may be calculated using Fchksum() and stored in a fielded buffer being written out. fbfr is a pointer to a fielded buffer. The stored checksum may be inspected by the receiving process to verify that the entire buffer was received.
Fchksum32 is used with 32-bit FML.
On success, Fchksum returns the check sum. This function returns -1 on error and sets Ferror to indicate the error condition.
Under the following conditions, Fchksum() fails and sets Ferror to: