|
|
Fchksum, Fchksum32(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.
For values of type FLD_PTR, the name of the pointer field (rather than the pointer or the data referenced by the pointer) is included in the checksum calculation.
Fchksum32() is used with 32-bit FML.
A thread in a multithreaded application may issue a call to Fchksum() or Fchksum32() while running in any context state, including TPINVALIDCONTEXT.
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:
The buffer does not begin on the proper boundary.
The buffer is not a fielded buffer or has not been initialized by Finit().
See Also
Introduction to FML Functions, Fread, Fread32(3fml), Fwrite, Fwrite32(3fml)
|
Copyright © 2001 BEA Systems, Inc. All rights reserved.
|