The ts_row_to_elem() function
The ts_row_to_elem() function converts an MI_ROW structure into a new ts_tselem structure. The new element does not overwrite elements returned by any other time series API function.
Syntax
ts_tselem
ts_row_to_elem(ts_tsdesc *tsdesc,
MI_ROW *row,
mi_integer *offset_ptr)
- tsdesc
- The descriptor for a time series returned by ts_open().
- row
- A pointer to an MI_ROW structure. The row must have the same type as the subtype of the time series.
- offset_ptr
- If the time series is regular, the offset of the element in the
time series is returned in offset_ptr. In this case, column
0 (the time stamp column) must not be
NULL
. If the time series is irregular, -1 is returned in offset_ptr.The offset_ptr argument can be
NULL
. In this case, calendar computations are avoided and column 0 can beNULL
.
Returns
An element and its offset. If the
time series is regular, column 0 (the time stamp column) of the element
is NULL
.
The element must be freed by the caller using the ts_free_elem() procedure.