sstore_iter_free, sstore_iter_export, sstore_iter_type - Duplicate, free, or export an iterator
cc [ flag... ] file... -lsstore [ library... ] #include <libsstore.h> void sstore_iter_free(sstore_iter_t iter); sstore_iter_type_t sstore_iter_type(sstore_iter_t iter); sstore_err_t sstore_iter_export(sstore_handle_t hdl, sstore_iter_t iter, sstore_format_t fmt, void **bufp, size_t *bud_szp);
Handle to an iterator.
Handle to libsstore.
Format type of the export. The following formats are supported:
Pointer to an nvlist_t. See the libnvpair(3LIB) man page for information about nvlist format.
JavaScript Object Notation. See sstore.json(5) for information about the JSON format.
Comma Separated Values. For csv output, sstore must always be queried with a time range and a granularity, or step in seconds. See the sstore.csv(5) man page for information about the CSV format.
Address to store the starting address of the formatted result.
Address to store the size of the result in bufp.
sstore_iter_free() frees the iterator.
sstore_iter_type() returns the type of an iterator.
sstore_iter_export() formats the data in an iterator in the requested format. sstore_iter_export() stores the formatted data in bufp and the size of the formatted data in buf_szp. For information about the data format, see the sstore.json(5) and sstore.csv(5) man pages.
sstore_iter_type() returns an enumerated data type sstore_iter_type_t. Possible values for sstore_iter_type_t are:
SSTORE_ITER_TYPE_UNKNOWN
SSTORE_ITER_TYPE_DATA
SSTORE_ITER_TYPE_INFO
SSTORE_ITER_TYPE_COLLECTION
SSTORE_ITER_TYPE_NAMESPACE
Upon successful completion, sstore_iter_export() returns ESSTORE_OK. Otherwise, it returns an error code, which is also cached in the given libsstore handle.
The sstore_iter_export() function will fail if:
Some arguments are invalid.
The libsstore handle is invalid.
There is insufficient memory.
See sstore_info_read(3SSTORE) and sstore_data_read(3SSTORE) for examples.
See attributes(7) for descriptions of the following attributes:
|
libnvpair(3LIB), libsstore(3LIB), sstore_alloc(3SSTORE), sstore_err_action(3SSTORE), attributes(7)