[Top] [Prev] [Next] [Bottom]

Fchksum (3FML)

Fchksum (3FML)

Name

Fchksum, Fchksum32-compute checksum for fielded buffer

Synopsis

#include <stdio.h> 
#include "fml.h"
long
Fchksum(FBFR *fbfr)
#include "fml32.h"
long
Fchksum32(FBFR32 *fbfr)

Description

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.

Return Values

On success, Fchksum returns the checksum. This function returns -1 on error and sets Ferror to indicate the error condition.

Errors

Under the following conditions, Fchksum() fails and sets Ferror to:

[FALIGNERR]
"fielded buffer not aligned"
The buffer does not begin on the proper boundary.

[FNOTFLD]
"buffer not fielded"
The buffer is not a fielded buffer or has not been initialized by Finit().

See Also

Fintro(3)
Fread(3)
Fwrite(3)



[Top] [Prev] [Next] [Bottom]