Function wyrd_get_property
Defined in File properties.h
Function Documentation
-
wyrd_error_t wyrd_get_property(struct wyrd_handle *handle, char const *path, void *value, size_t *value_size)
Equivalent getter to wyrd_set_property_typed() above.
Pass the maximum value size in the last parameter, i.e. the size of the value buffer. On success, value_size is set to the actual amount of buffer used. On WYRD_ERR_OUT_OF_MEMORY, value_size is set to the amount of buffer needed to hold the full value.
A type is not provided. You can query the type with get_property_type() below.
Note that this function will always return the current value for a property. If you wish to examine change sets, see edits.h instead.
- Parameters
handle – [in] A handle to an opened resource.
path – [in] Path that names the property in question.
value – [out] A pointer to the value; how this is interpreted depends on
type
.value_size – [inout] When calling, the size of the output buffer provided in
value
. On success, the amount of output buffer consumed.
- Return values
WYRD_ERR_SUCCESS – On success.
WYRD_ERR_INVALID_VALUE – If any of the inpurt values are invalid, such as NULL pointers where there should not be any, etc.
WYRD_ERR_BAD_PROPERTY_TYPE – When a container property is requested; we do not yet have a generic mechanism for doing so.
WYRD_ERR_OUT_OF_MEMORY – If the output buffer size given by
value_size
is too small for the property value.