libtpccurveio
 All Data Structures Files Functions Variables Enumerations Enumerator Defines
Functions
csv.c File Reference
#include "decpoint.h"
#include "include/csv.h"
#include "include/dft.h"
#include "include/dftunit.h"
Include dependency graph for csv.c:

Go to the source code of this file.

Functions

void csvInit (CSV *csv)
void csvEmpty (CSV *csv)
int csvRead (CSV *csv, char *fname)
int csv2dft (CSV *csv, DFT *dft)
int csv2dft_a (CSV *csv, DFT *dft)
int csv2dft_b (CSV *csv, DFT *dft)

Function Documentation

int csv2dft ( CSV csv,
DFT dft 
)

Reads different CSV formats into DFT struct

Returns:
Returns 0 when successful, otherwise an error code.
Parameters:
csvPointer to CSV data to be converted
dftPointer to empty DFT struct which will be allocated and filled here

Definition at line 185 of file csv.c.

References CSV::col_nr, csv2dft_a(), csv2dft_b(), CSV_ERROR, CSV_INVALIDFORMAT, CSV_OK, CSV_TEST, and CSV::row_nr.

Referenced by dftRead().

Here is the call graph for this function:

int csv2dft_a ( CSV csv,
DFT dft 
)

Reads simple and Inveon type 1 data into DFT struct

Returns:
Returns 0 when successful, otherwise an error code.
Parameters:
csvPointer to CSV data to be converted
dftPointer to empty DFT struct which will be allocated and filled here

Definition at line 216 of file csv.c.

References DFT::_type, CSV::c, CSV_item::col, CSV::col_nr, CSV_item::content, CSV_ERROR, CSV_INVALIDFORMAT, CSV_NOTABLE, CSV_OK, CSV_OUTOFMEMORY, CSV_TEST, dftDelete(), dftEmpty(), dftFrametimes(), dftSetmem(), dftUnitToDFT(), DFT::frameNr, Voi::hemisphere, DFT::isweight, Voi::name, CSV::nr, Voi::place, CSV_item::row, CSV::row_nr, Voi::sw, DFT::timetype, DFT::timeunit, DFT::unit, DFT::voi, Voi::voiname, DFT::voiNr, DFT::w, DFT::x, and Voi::y.

Referenced by csv2dft().

Here is the call graph for this function:

int csv2dft_b ( CSV csv,
DFT dft 
)

Reads Inveon type 2 data into DFT struct

Returns:
Returns 0 when successful, otherwise an error code.
Parameters:
csvPointer to CSV data to be converted
dftPointer to empty DFT struct which will be allocated and filled here

Definition at line 375 of file csv.c.

References DFT::_type, CSV::c, CSV::col_nr, DFT::comments, CSV_item::content, CSV_ERROR, CSV_INVALIDFORMAT, CSV_OK, CSV_OUTOFMEMORY, CSV_TEST, dftEmpty(), dftSetmem(), dftUnitToDFT(), DFT::frameNr, Voi::hemisphere, DFT::isweight, Voi::name, CSV::nr, Voi::place, CSV::row_nr, Voi::size, DFT::studynr, DFT::timetype, DFT::timeunit, DFT::voi, Voi::voiname, DFT::voiNr, DFT::w, DFT::x, DFT::x1, DFT::x2, Voi::y, and Voi::y2.

Referenced by csv2dft().

Here is the call graph for this function:

void csvEmpty ( CSV csv)

Definition at line 61 of file csv.c.

References CSV::c, CSV::col_nr, CSV_item::content, CSV::nr, CSV::row_nr, and CSV::separator.

Referenced by dftRead().

void csvInit ( CSV csv)

Definition at line 53 of file csv.c.

References CSV::c, CSV::col_nr, CSV::nr, CSV::row_nr, and CSV::separator.

Referenced by dftRead().

int csvRead ( CSV csv,
char *  fname 
)