The ts_make_elem() function

The ts_make_elem() function makes an element from an array of values and nulls. Each array has one value for each column in the element.

Syntax

ts_tselem 
ts_make_elem(ts_tsdesc *tsdesc, 
              MI_DATUM   *values,
              mi_boolean *nulls, 
              mi_integer *off)
tsdesc
The descriptor for a time series returned by ts_open().
values
An array of data to be placed in the element. Data that is by value is placed in the array, and data that is by reference stores pointers.
nulls
Stores columns in the element that should be NULL.
off
For a regular time series, off contains the offset of the element on return. For an irregular time series, off is set to -1. This argument can be NULL.

Returns

An element and its offset. If tsdesc is a descriptor for a regular time series, the time stamp column in the element is set to NULL; if tsdesc is a descriptor for an irregular time series, the time stamp column is set to whatever was in values[0]. This element must be freed by the caller using ts_free_elem().