VWriteData


 
Name
  VWriteData - writes the data to a 3DVIEWNIX data file.
 
Synopsis
  VWriteData(data, size, items, fp, items_written)
  char *data;
  int size, items, *items_written;
  FILE *fp;
 
Description
  VWriteData writes a string of bytes into an array from the specified
file pointer. VWriteData assumes that fp points to the beginning of the
data part, and that the data in the file follows the big endian format
for short (size 2) and integer (size 4) values. VWriteData converts
from the format the machine supports to the big endian format while
writing out the data. VWriteData returns the items written to the
items_written parameter.
 
Return Value
  0 - work successfully.
  2 - read error.
  5 - improper seeks.
 
Parameters
  data - the array where the function puts the string.
  size - size of each data item. Valid items are 1, 2 & 4.
  items- the number of items to be written.
  fp - a pointer to the input data file.
  items_written - returns the number of items written by VWriteData.
 
Side Effects
  VWriteData writes only 1,2 or 4 byte integer data. This will be expanded
to handle floating point data.
 
Entry Condition
   If the fp, data, or items_written is NULL, or items is zero, or size is
not 1, 2 or 4, VWriteData prints an error message to the standard error
stream, produces a core dump file, and exits from the current process.
 
Related Functions
VGetHeaderLength, VCloseData, VReadData, VSeekData.