mcSTcellGet — Get a pointer to the data buffer of a sparse-table cell
#include <memcom.h> const void* mcSTcellGet(int dsid, int row_index, mcInt64 column_index);
mcSTcellGet
returns, for the sparse-table
dataset identified by dsid
, a pointer to a buffer
containing the data of the cell identified by the row index
row_index
and the column index
column_index
. If the cell is empty, NULL is
returned.
For reasons of performance, the pointer returned points to MemCom's internal cell data buffer. This buffer is managed solely by MemCom. Hence, applications may not modify cell buffer data nor may they free or re-allocate the cell buffer. The returned pointer's validity is guaranteed only as long as no further MemCom calls are made.
Ignoring this may lead to corrupted data structures and unpredictable behaviour. Applications needing to modify cell data or requiring access to the cell data for a longer time, should instead copy the cell data to their own buffer with mcSTcellGetArray or use mcSTcellGetCopy.
dsid (input)
Dataset identifier.
row_index (input)
Index of the row, starting at 1.
column_index (input)
Index of the column whose data is requested. Column indices start at 1.
If no error occurred and the cell is not empty, a pointer to the buffer containing the cell data is returned. The data type of the elements in the buffer can be obtained by calling mcSTcolAttributes. The number of data elements in the buffer can be obtained by calling mcSTcellNumElements, and for fixed-size columns also by calling mcSTcolAttributes. The length of the buffer in bytes can be determined by calling mcSTcellSize.
For columns of type "K" (character strings), the data in the buffer whose pointer is returned, is terminated by a NUL-character. The string length is always smaller than the number of data elements and the number of bytes of the cell buffer.
If no error occurred and the cell is empty, NULL is returned.
In case of errors (because of an invalid
dsid
, row_index
, or
column_index
argument), NULL is also returned,
and the MemCom error number can be
obtained by calling mcErrStatus.