Main Page   Namespace List   Compound List   File List   Namespace Members   Compound Members   File Members  

ioc Namespace Reference

Declarations of the channel count type and counts I/O operations. More...


Functions

long write (FILE *fcnt, count_t **buffer, size_t buflen, int nbuf)
 Write the channel count series to disk. More...

void read (FILE *fcnt, count_t **buffer, size_t buflen, int nbuf, long addr)
 Read the channel count series from disk. More...


Detailed Description

Declarations of the channel count type and counts I/O operations.

Function Documentation

void read FILE *    fcnt,
count_t **    buffer,
size_t    buflen,
int    nbuf,
long    addr
 

Read the channel count series from disk.

Parameters:
fcnt  structure of the opened binary file of counts
buffer  array of nbuf pointers to channel count buffers
buflen  length of the channel buffer in units of counts (not bytes!)
nbuf  Number of buffers (e.g. number of active channels)
addr  Starting position in file (in bytes from beginning) where the counts should be read from.
The address is checked to be only the multiple of the size of the count_t type. All the rest possible non-synchronizations are not tested. The error is possible when not all the counts are successfully read.

The function uses the fseek() to set the file position to the given addr, and reads sequentially all nbuf channel buffers from disk into the respective buffer[iCounter].

long write FILE *    fcnt,
count_t **    buffer,
size_t    buflen,
int    nbuf
 

Write the channel count series to disk.

Parameters:
fcnt  structure of the opened binary file of counts
buffer  array of nbuf pointers to channel count buffers
buflen  length of the channel buffer in units of counts (not bytes!)
nbuf  Number of buffers (e.g. number of active channels)
Returns:
Starting position in file (in bytes from beginning) where the counts were written or (-1) on error
The function uses the fseek() to set the file position to the end of file (where it is, normally, set already), gets this current position to be returned on success, and writes sequentially all nbuf channel buffers to disk.


Generated on Wed Jan 16 00:40:06 2002 for MASS Software by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001