MeatAxe  2.4
Programs for working with modular representations
File I/O

Detailed Description

Data Structures

class  MtxFile_t
 MeatAxe data file object. More...
 

Functions

int MfIsValid (const MtxFile_t *file)
 Check a File Object. More...
 
MtxFile_tMfOpen (const char *name)
 Open a File for Reading.
 
MtxFile_tMfCreate (const char *name, int field, int nor, int noc)
 Open a File for Writing. More...
 
int MfClose (MtxFile_t *file)
 Close a File.
 
int MfReadRows (MtxFile_t *f, PTR buf, int nrows)
 Read row vectors from a file. More...
 
int MfReadLong (MtxFile_t *f, long *buf, int count)
 Read long integers from a file. More...
 
int MfWriteRows (MtxFile_t *f, PTR buf, int nrows)
 Write row vectors to a file. More...
 
int MfWriteLong (MtxFile_t *f, const long *buf, int count)
 Write long integers to a file. More...
 

Function Documentation

MtxFile_t* MfCreate ( const char *  name,
int  field,
int  nor,
int  noc 
)

Open a File for Writing.

This functions creates a new file or truncates an existing file. The file is opened for writing, and a MeatAxe file header is written to the file.

int MfIsValid ( const MtxFile_t file)

Check a File Object.

This function checks if the argument points to a valid MtxFile_t structure.

Parameters
filePointer to the file.
Returns
1 if file points to a valid file object, 0 otherwise.
int MfReadLong ( MtxFile_t f,
long *  buf,
int  count 
)

Read long integers from a file.

This function reads |count| long integers from a data file into a buffer. If necessary, the data is converted from machine independent format into the format needed by the platform. See |SysReadLong()| for details.

Parameters
fPointer to the file.
bufData buffer.
countNumber of integers to read.
Returns
Number of integers that were actually read. Any value other than |count| indicates an error.
int MfReadRows ( MtxFile_t f,
PTR  buf,
int  nrows 
)

Read row vectors from a file.

This function reads nrows rows from a data file into a buffer. Unlike FfReadRows(), this function changes the current row size to the appropriate value, which is stored in the MtxFile_t object.

Parameters
fPointer to the file.
bufData buffer.
nrowsNumber of rows to read.
Returns
Number of rows that were actually read. Any value other than count indicates an error.
int MfWriteLong ( MtxFile_t f,
const long *  buf,
int  count 
)

Write long integers to a file.

This function writes |count| long integers from buffer into a data file. If necessary, the data is converted from machine independent format into the format needed by the platform. See |SysWriteLong()| for details.

Parameters
fPointer to the file.
bufData buffer.
countNumber of integers to write.
Returns
Number of integers that were actually written. Any value other than count indicates an error.
int MfWriteRows ( MtxFile_t f,
PTR  buf,
int  nrows 
)

Write row vectors to a file.

This function writes |nrows| rows from a data file into a buffer. Unlike |FfWriteRows()|, this function changes the current row size to the appropriate value, which is stored in the |MtxFile_t| object.

Parameters
fPointer to the file.
bufData buffer.
nrowsNumber of rows to write.
Returns
Number of rows that were actually written. Any value other than count indicates an error.

MeatAxe 2.4 documentation, generated on Wed Jan 7 2015 08:38:36