STATUS: work in progress io_eegtools Custom file-format for input-output of (EEG)-data. More...
#include <stdio.h>
#include "array.h"
Go to the source code of this file.
Functions | |
Array * | array_from_file (FILE *in) |
Read Array from file. | |
void | array_to_file (FILE *out, const Array *a) |
Write Array to disk. |
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 );
When writing an Array-struct to a file, the following convention is followed:
When writing an EEG-struct to a file, the following convention is followed:
Definition in file io_eegtools.h.
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 .
out | the file pointer to read from (opened read-binary "rb") |
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 .
out | the file pointer to write to (opened write-binary "wb") | |
a | the output array |
Definition at line 78 of file io_eegtools.c.