|
UniRec
2.9.3
|
Data Structures | |
| struct | urcsv_t |
Functions | |
| urcsv_t * | urcsv_init (ur_template_t *tmplt, char delimiter) |
| void | urcsv_free (urcsv_t **urcsv) |
| char * | urcsv_header (urcsv_t *urcsv) |
| char * | urcsv_record (urcsv_t *urcsv, const void *rec) |
| int | urcsv_field (char *dst, uint32_t size, const void *rec, ur_field_type_t id, ur_template_t *tmplt) |
Functions to convert UniRec template and data into CSV-like representation
| struct urcsv_t |
Internal structure used by urcsv_init(), urcsv_free(), urcsv_header(), urcsv_record()
Definition at line 47 of file unirec2csv.h.
| Data Fields | ||
|---|---|---|
| char * | buffer |
Internal string buffer, allocated to buffer_size bytes |
| uint32_t | buffer_size |
Current size of allocated memory for buffer |
| char * | curpos |
Internal position in the buffer to write next string |
| char | delimiter |
Delimiter that is put between columns |
| uint32_t | free_space |
Current free bytes in the buffer |
| ur_template_t * | tmplt |
UniRec template associated with this conversion |
| int urcsv_field | ( | char * | dst, |
| uint32_t | size, | ||
| const void * | rec, | ||
| ur_field_type_t | id, | ||
| ur_template_t * | tmplt | ||
| ) |
Convert value of UniRec field to its string representation.
| [out] | dst | Pointer to memory where to store result (pointer is not moved) |
| [in] | size | Size of available memory for result |
| [in] | rec | UniRec record - value of the field is taken |
| [in] | id | UniRec field id |
| [in] | tmplt | UniRec template |
Definition at line 129 of file unirec2csv.c.
| void urcsv_free | ( | urcsv_t ** | urcsv | ) |
Destructor for urcsv_t
The funtion deallocates internal memory and urcsv, the pointer is set to NULL.
| [in,out] | urcsv | Address of pointer to structure allocated by urcsv_init(), it will be set to NULL. |
Definition at line 28 of file unirec2csv.c.
| char* urcsv_header | ( | urcsv_t * | urcsv | ) |
Create a header line
The funtion creates a text representation of header according to template
| [in,out] | urcsv | Pointer to structure allocated by urcsv_init(). |
Definition at line 37 of file unirec2csv.c.
| urcsv_t* urcsv_init | ( | ur_template_t * | tmplt, |
| char | delimiter | ||
| ) |
Constructor for urcsv_t
The function initializes struct for urcsv_header() and urcsv_record().
| [in] | tmplt | UniRec template that will be used to access fields of the records |
| [in] | delimiter | Delimiter that will be used to separate columns of output |
Definition at line 7 of file unirec2csv.c.
| char* urcsv_record | ( | urcsv_t * | urcsv, |
| const void * | rec | ||
| ) |
Create a record line
The funtion creates a text representation of UniRec record
| [in,out] | urcsv | Pointer to structure allocated by urcsv_init(). |
| [in] | rec | Pointer to data - UniRec message |
Definition at line 209 of file unirec2csv.c.
1.8.14