TSP: The Transport Sample Protocol



Macsim Format Library
[Generic Reader Library]

Collaboration diagram for Macsim Format Library:The library is used to read a Macsim File by the Generic Reader. More...

Functions

int32_t load_char (char *data_var, void *raw_value, const uint32_t indice_data)
 oonvert string to char
int32_t load_double (char *data_var, void *raw_value, const uint32_t indice_data)
 oonvert string to double
int32_t load_float (char *data_var, void *raw_value, const uint32_t indice_data)
 oonvert string to float
int32_t load_int16 (char *data_var, void *raw_value, const uint32_t indice_data)
 oonvert string to int16
int32_t load_int32 (char *data_var, void *raw_value, const uint32_t indice_data)
 oonvert string to int32
int32_t load_int64 (char *data_var, void *raw_value, const uint32_t indice_data)
 oonvert string to int64
int32_t load_int8 (char *data_var, void *raw_value, const uint32_t indice_data)
 oonvert string to int8
int32_t load_type_raw (char *data_var, void *raw_value, const uint32_t indice_data)
 oonvert string to raw value
int32_t load_uchar (char *data_var, void *raw_value, const uint32_t indice_data)
 oonvert string to uchar
int32_t load_uint16 (char *data_var, void *raw_value, const uint32_t indice_data)
 oonvert string to uint16
int32_t load_uint32 (char *data_var, void *raw_value, const uint32_t indice_data)
 oonvert string to uint32
int32_t load_uint64 (char *data_var, void *raw_value, const uint32_t indice_data)
 oonvert string to uint64
int32_t load_uint8 (char *data_var, void *raw_value, const uint32_t indice_data)
 oonvert string to uint8
void macsim_close (FILE *fichier_macsim)
 close macsim file
int32_t macsim_createHandler (FmtHandler_T **fmtHandler)
 initialize the fmtHandler (for generic handler)
uint32_t macsim_dimension_data (char *dimension_var)
 calculate the dimension of a macsim's symbol
FILE * macsim_open (char *nom_fichier_macsim)
 open a macsim file
int32_t macsim_read (GenericReader_T *genreader, glu_item_t *item)
 Read the data contained in the file into a GLU item.
int32_t macsim_read_header (GenericReader_T *genreader, int32_t justcount)
 Read the MACSIM header.
TSP_datatype_t macsim_type_data (char *type_var)
 determine tsp data type.
int32_t read_data_file (FILE *fic, char *data_var)
 Read one data of macsim file.
char * str_strip (const char *string)
 extract the space from a string before and after.
void str_strip_inplace (char *tostrip)
 extract the space from a string before and after, in and out data in the same variable.


Detailed Description

The library is used to read a Macsim File by the Generic Reader.


Function Documentation

int32_t load_char ( char *  data_var,
void *  raw_value,
const uint32_t  indice_data 
)

oonvert string to char

Parameters:
[in] data_var string data
[in,out] raw_value contain the convert data
[in] indice_data indice in the array if the symbol is an array
Returns:
TSP_STATUS_OK if ok

int32_t load_double ( char *  data_var,
void *  raw_value,
const uint32_t  indice_data 
)

oonvert string to double

Parameters:
[in] data_var string data
[in,out] raw_value contain the convert data
[in] indice_data indice in the array if the symbol is an array
Returns:
TSP_STATUS_OK if ok

int32_t load_float ( char *  data_var,
void *  raw_value,
const uint32_t  indice_data 
)

oonvert string to float

Parameters:
[in] data_var string data
[in,out] raw_value contain the convert data
[in] indice_data indice in the array if the symbol is an array
Returns:
TSP_STATUS_OK if ok

int32_t load_int16 ( char *  data_var,
void *  raw_value,
const uint32_t  indice_data 
)

oonvert string to int16

Parameters:
[in] data_var string data
[in,out] raw_value contain the convert data
[in] indice_data indice in the array if the symbol is an array
Returns:
TSP_STATUS_OK if ok

int32_t load_int32 ( char *  data_var,
void *  raw_value,
const uint32_t  indice_data 
)

oonvert string to int32

Parameters:
[in] data_var string data
[in,out] raw_value contain the convert data
[in] indice_data indice in the array if the symbol is an array
Returns:
TSP_STATUS_OK if ok

int32_t load_int64 ( char *  data_var,
void *  raw_value,
const uint32_t  indice_data 
)

oonvert string to int64

Parameters:
[in] data_var string data
[in,out] raw_value contain the convert data
[in] indice_data indice in the array if the symbol is an array
Returns:
TSP_STATUS_OK if ok

int32_t load_int8 ( char *  data_var,
void *  raw_value,
const uint32_t  indice_data 
)

oonvert string to int8

Parameters:
[in] data_var string data
[in,out] raw_value contain the convert data
[in] indice_data indice in the array if the symbol is an array
Returns:
TSP_STATUS_OK if ok

int32_t load_type_raw ( char *  data_var,
void *  raw_value,
const uint32_t  indice_data 
)

oonvert string to raw value

Parameters:
[in] data_var string data
[in,out] raw_value contain the convert data
[in] indice_data indice in the array if the symbol is an array
Returns:
TSP_STATUS_OK if ok

int32_t load_uchar ( char *  data_var,
void *  raw_value,
const uint32_t  indice_data 
)

oonvert string to uchar

Parameters:
[in] data_var string data
[in,out] raw_value contain the convert data
[in] indice_data indice in the array if the symbol is an array
Returns:
TSP_STATUS_OK if ok

int32_t load_uint16 ( char *  data_var,
void *  raw_value,
const uint32_t  indice_data 
)

oonvert string to uint16

Parameters:
[in] data_var string data
[in,out] raw_value contain the convert data
[in] indice_data indice in the array if the symbol is an array
Returns:
TSP_STATUS_OK if ok

int32_t load_uint32 ( char *  data_var,
void *  raw_value,
const uint32_t  indice_data 
)

oonvert string to uint32

Parameters:
[in] data_var string data
[in,out] raw_value contain the convert data
[in] indice_data indice in the array if the symbol is an array
Returns:
TSP_STATUS_OK if ok

int32_t load_uint64 ( char *  data_var,
void *  raw_value,
const uint32_t  indice_data 
)

oonvert string to uint64

Parameters:
[in] data_var string data
[in,out] raw_value contain the convert data
[in] indice_data indice in the array if the symbol is an array
Returns:
TSP_STATUS_OK if ok

int32_t load_uint8 ( char *  data_var,
void *  raw_value,
const uint32_t  indice_data 
)

oonvert string to uint8

Parameters:
[in] data_var string data
[in,out] raw_value contain the convert data
[in] indice_data indice in the array if the symbol is an array
Returns:
TSP_STATUS_OK if ok

void macsim_close ( FILE *  fichier_macsim  ) 

close macsim file

Parameters:
[in] fichier_macsim the pointer file
Returns:
nothing

int32_t macsim_createHandler ( FmtHandler_T **  fmtHandler  ) 

initialize the fmtHandler (for generic handler)

Parameters:
[out] fmtHandler the fmtHandler to initialze
Returns:
TSP_STATUS_OK if OK

uint32_t macsim_dimension_data ( char *  dimension_var  ) 

calculate the dimension of a macsim's symbol

Parameters:
[in] dimension_var the string who contain the dimension
Returns:
the dimension

FILE* macsim_open ( char *  nom_fichier_macsim  ) 

open a macsim file

Parameters:
[in] nom_fichier_macsim the file name
Returns:
the pointer file

int32_t macsim_read ( GenericReader_T *  genreader,
glu_item_t item 
)

Read the data contained in the file into a GLU item.

Parameters:
[in] genreader the generic reader (contain data information (pointer file....)
[in,out] item the GLU item where the data will be put
Returns:
EOF if end of file

int32_t macsim_read_header ( GenericReader_T *  genreader,
int32_t  justcount 
)

Read the MACSIM header.

If justcount is 1 then only count the number of symbols of this macsim file.

Parameters:
[in] genreader the generic reader (contain data information (pointer file...)
[in] justcount indicate we just want to count the number of symbol in the file.
Returns:
TSP_STATUS_OK if OK

TSP_datatype_t macsim_type_data ( char *  type_var  ) 

determine tsp data type.

Parameters:
[in] type_var the data type extract from macsim file
Returns:
the tsp data type

int32_t read_data_file ( FILE *  fic,
char *  data_var 
)

Read one data of macsim file.

Parameters:
[in] fic the file pointer
[in,out] data_var contain the read data
Returns:
END_FILE_MACSIM if end of file END_SAMPLE_SET if end of MACSIM line END_SAMPLE_STREAM if end of read data

char* str_strip ( const char *  string  ) 

extract the space from a string before and after.

Parameters:
[in] string the string to modify
Returns:
the same string without the spaces

void str_strip_inplace ( char *  tostrip  ) 

extract the space from a string before and after, in and out data in the same variable.

Parameters:
[in] tostrip the string to modify

Framework Home Page.


Beware !! TSP wave is coming...