Function tskit::bindings::kastore_get [−][src]
pub unsafe extern "C" fn kastore_get(
self_: *mut kastore_t,
key: *const c_char,
key_len: size_t,
array: *mut *mut c_void,
array_len: *mut size_t,
type_: *mut c_int
) -> c_int
@brief Get the array for the specified key.
@rst
Queries the store for the specified key and stores pointers to the memory for
the corresponding array, the number of elements in this array and the type of
the array in the specified destination pointers. This is the most general form
of get
query in kastore, as non NULL-terminated strings can be used as
keys and the resulting array is returned in a generic pointer. When standard C
strings are used as keys and the type of the array is known, it is more
convenient to use the :ref:typed variants <sec_c_api_typed_get>
of this function.
The returned array points to memory that is internally managed by the store
and must not be freed or modified. The pointer is guaranteed to be valid
until :c:func:kastore_close
is called.
@endrst
@param self A pointer to a kastore object. @param key The key. @param key_len The length of the key. @param array The destination pointer for the array. @param array_len The destination pointer for the number of elements in the array. @param type The destination pointer for the type code of the array. @return Return 0 on success or a negative value on failure.