Functions

src/io_eegtools.h File Reference

STATUS: work in progress io_eegtools Custom file-format for input-output of (EEG)-data. More...

#include <stdio.h>
#include "array.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

Arrayarray_from_file (FILE *in)
 Read Array from file.
void array_to_file (FILE *out, const Array *a)
 Write Array to disk.

Detailed Description

STATUS: work in progress io_eegtools Custom file-format for input-output of (EEG)-data.

These IO functions can be used for loslessly saving Array-structs and EEG-structs to a file.

It is easy to write multiple arrays to the same file:

 FILE *out;
 out=fopen( NAMEOFFILE, "wb" );
 array_to_file( out, a );
 array_to_file( out, b );
 array_to_file( out, c );
 fclose( f );

and equally easy to read multiple arrays:

 FILE *in;
 in=fopen( NAMEOFFILE, "rb" );
 Array *a=array_from_file( in );
 Array *b=array_from_file( in );
 Array *c=array_from_file( in );
 fclose( f );

File Format for Arrays

When writing an Array-struct to a file, the following convention is followed:

File Format for EEG-data

When writing an EEG-struct to a file, the following convention is followed:

Definition in file io_eegtools.h.


Function Documentation

Array* array_from_file ( FILE *  in  ) 

Read Array from file.

The FILE* must be opened in read-binary "rb" mode.

The format of the array is described in File Format for Arrays .

Parameters:
out the file pointer to read from (opened read-binary "rb")
Returns:
the output array

Definition at line 37 of file io_eegtools.c.

void array_to_file ( FILE *  out,
const Array a 
)

Write Array to disk.

The FILE* must be opened in write-binary "wb" mode.

The format of the array is described in rawfileformat .

Parameters:
out the file pointer to write to (opened write-binary "wb")
a the output array

Definition at line 78 of file io_eegtools.c.