Functions
sifio.c File Reference
#include "include/sif.h"
Include dependency graph for sifio.c:

Go to the source code of this file.

Functions

int sifRead (char *filename, SIF *data)
 
int sifWrite (SIF *data, char *filename)
 
void sifPrint (SIF *data)
 

Function Documentation

void sifPrint ( SIF data)

Prints to stdout the contents of SIF data structure.

Parameters
dataPointer to SIF struct

Definition at line 224 of file sifio.c.

References SIF::frameNr, SIF::isotope_name, SIF::prompts, SIF::randoms, SIF::scantime, SIF::trues, SIF::weights, SIF::x1, and SIF::x2.

int sifRead ( char *  filename,
SIF data 
)

Reads SIF file contents to the specified data structure. Weights are set to 1.

Returns
Returns 0 if ok, 1 invalid input, 2 failed to open file, 3 failed to allocate memory, 4 header parsing error, 5 wrong file type, 6 failed to allocate memory, 8 parse error, 9 wrong data format
Parameters
filenameSIF filename to be read
dataPointer to initiated SIF struct; any existing contents will be deleted

Definition at line 64 of file sifio.c.

References SIF::colNr, SIF::frameNr, SIF::isotope_name, SIF::prompts, SIF::randoms, SIF::scantime, SIF_TEST, sifEmpty(), siferrmsg, sifSetmem(), SIF::studynr, SIF::trues, SIF::version, SIF::weights, SIF::x1, and SIF::x2.

Referenced by imgReadAnalyze(), imgReadAnalyzeFrame(), and imgReadAnalyzeHeader().

Here is the call graph for this function:

int sifWrite ( SIF data,
char *  filename 
)

Write SIF data to a standard SIF file, emptying files old contents.

Returns
Returns 0 if successful, 1 invalid input, 2 failed to open file, 3 failed to write into file.
Parameters
dataPointer to SIF struct containing data to be written in file
filenameFilename for SIF; file is overwritten without backup

Definition at line 167 of file sifio.c.

References SIF::colNr, SIF::frameNr, SIF::isotope_name, SIF::prompts, SIF::randoms, SIF::scantime, SIF_TEST, siferrmsg, SIF::studynr, SIF::version, SIF::x1, and SIF::x2.