le_cfg_interface.h
Go to the documentation of this file.
19 * Any other access permissions (read access for any other tree, or write access to any tree at all)22 * Trees are created automatically the first time that they are accessed by an app or a component.23 * The apps tree will be named the same as the name of the app. It is possible for apps to be given30 * Apps are able to search over the tree for data, although it's generally expected that the location70 * Apps must explicitly give permissions to other apps before they can access their Config Tree data.72 * Each transaction is only able to iterate over one tree at a time, each tree that you want to read106 * functions, and Commit the transaction. If a write transaction is canceled instead of committed,121 * Transactions must not be kept open for extended periods of time. If a transaction is kept open123 * cancel the transaction and drop the connection to the offending client (most likely causing the127 * | --------------------------| ------------------------------------------------------------------|134 * To move around within the Tree you can move directly to a specific node(leaf or stem) and then139 * | ----------------------------| -------------------------------------------------------------------------------|142 * | @c le_cfg_GoToFirstChild() | Moves to the first node from the current location (moves down the Tree) |143 * | @c le_cfg_GoToNextSibling() | Moves to the next node on the same level as the current node (moves laterally) |147 * The Config tree also contains functions to help you identify your current location in the tree,148 * what node you are currently pointing at, and what type of data is contained in the current node.151 * | ------------------------| ------------------------------------------------------------------------------- |154 * | @c le_cfg_GetNodeName() | Gets the name of the node where you are in the Tree (does not include the path) |168 * To perform a read from a Tree, we need to open a transaction, move to the node that you want to234 * Each data type has it's own set function, to write a value to a node within the Tree. Before you247 * To perform a write to a Tree, we need to open a transaction, move to the node that you want to302 * @note Creating write transactions creates a temporary working copy of the tree for use within the303 * transaction. All read transactions running in the meantime see the committed state, without any326 * Because quick read/write functions don't get created within a transaction, there is no option to382 * @warning Because each quick function is independent, there's no guarantee of consistency between404 //--------------------------------------------------------------------------------------------------408 //--------------------------------------------------------------------------------------------------411 //--------------------------------------------------------------------------------------------------414 * Connect the current client thread to the service providing this API. Block until the service is417 * For each thread that wants to use this API, either ConnectService or TryConnectService must be418 * called before any other functions in this API. Normally, ConnectService is automatically called423 //--------------------------------------------------------------------------------------------------429 //--------------------------------------------------------------------------------------------------432 * Try to connect the current client thread to the service providing this API. Return with an error435 * For each thread that wants to use this API, either ConnectService or TryConnectService must be436 * called before any other functions in this API. Normally, ConnectService is automatically called445 * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).448 //--------------------------------------------------------------------------------------------------454 //--------------------------------------------------------------------------------------------------458 * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants461 //--------------------------------------------------------------------------------------------------468 //--------------------------------------------------------------------------------------------------474 * longer a connection to the service, and the functions in this API can't be used. For details, see479 //--------------------------------------------------------------------------------------------------486 //--------------------------------------------------------------------------------------------------490 //--------------------------------------------------------------------------------------------------493 //--------------------------------------------------------------------------------------------------497 //--------------------------------------------------------------------------------------------------500 //--------------------------------------------------------------------------------------------------504 //--------------------------------------------------------------------------------------------------507 //--------------------------------------------------------------------------------------------------511 //--------------------------------------------------------------------------------------------------514 //--------------------------------------------------------------------------------------------------522 * @note A tree transaction is global to that tree; a long-held read transaction will block other527 //--------------------------------------------------------------------------------------------------534 //--------------------------------------------------------------------------------------------------548 //--------------------------------------------------------------------------------------------------555 //--------------------------------------------------------------------------------------------------562 //--------------------------------------------------------------------------------------------------569 //--------------------------------------------------------------------------------------------------571 * Closes and frees the given iterator object. If the iterator is a write iterator, the transaction572 * will be canceled. If the iterator is a read iterator, the transaction will be closed. No data is577 //--------------------------------------------------------------------------------------------------584 //--------------------------------------------------------------------------------------------------593 //--------------------------------------------------------------------------------------------------602 //--------------------------------------------------------------------------------------------------611 //--------------------------------------------------------------------------------------------------618 //--------------------------------------------------------------------------------------------------624 * children of this node are not written to, then this node will not persist even if the iterator is632 //--------------------------------------------------------------------------------------------------639 //--------------------------------------------------------------------------------------------------663 //--------------------------------------------------------------------------------------------------670 //--------------------------------------------------------------------------------------------------703 //--------------------------------------------------------------------------------------------------717 //--------------------------------------------------------------------------------------------------723 //--------------------------------------------------------------------------------------------------733 //--------------------------------------------------------------------------------------------------740 //--------------------------------------------------------------------------------------------------754 //--------------------------------------------------------------------------------------------------761 //--------------------------------------------------------------------------------------------------772 //--------------------------------------------------------------------------------------------------776 //--------------------------------------------------------------------------------------------------783 //--------------------------------------------------------------------------------------------------792 //--------------------------------------------------------------------------------------------------802 //--------------------------------------------------------------------------------------------------813 //--------------------------------------------------------------------------------------------------823 //--------------------------------------------------------------------------------------------------832 //--------------------------------------------------------------------------------------------------842 //--------------------------------------------------------------------------------------------------848 //--------------------------------------------------------------------------------------------------858 //--------------------------------------------------------------------------------------------------870 //--------------------------------------------------------------------------------------------------888 //--------------------------------------------------------------------------------------------------895 //--------------------------------------------------------------------------------------------------907 //--------------------------------------------------------------------------------------------------924 //--------------------------------------------------------------------------------------------------944 //--------------------------------------------------------------------------------------------------953 //--------------------------------------------------------------------------------------------------967 //--------------------------------------------------------------------------------------------------980 //--------------------------------------------------------------------------------------------------993 //--------------------------------------------------------------------------------------------------1000 //--------------------------------------------------------------------------------------------------1012 //--------------------------------------------------------------------------------------------------1023 //--------------------------------------------------------------------------------------------------1036 //--------------------------------------------------------------------------------------------------1045 //--------------------------------------------------------------------------------------------------1057 //--------------------------------------------------------------------------------------------------1067 //--------------------------------------------------------------------------------------------------1080 //--------------------------------------------------------------------------------------------------1087 //--------------------------------------------------------------------------------------------------1099 //--------------------------------------------------------------------------------------------------1101 * Deletes the node specified by the path. If the node doesn't exist, nothing happens. All child1104 //--------------------------------------------------------------------------------------------------1111 //--------------------------------------------------------------------------------------------------1113 * Clears the current value of a node. If the node doesn't currently exist then it is created as a1116 //--------------------------------------------------------------------------------------------------1123 //--------------------------------------------------------------------------------------------------1131 //--------------------------------------------------------------------------------------------------1144 //--------------------------------------------------------------------------------------------------1148 //--------------------------------------------------------------------------------------------------1157 //--------------------------------------------------------------------------------------------------1166 //--------------------------------------------------------------------------------------------------1182 //--------------------------------------------------------------------------------------------------1186 //--------------------------------------------------------------------------------------------------1197 //--------------------------------------------------------------------------------------------------1200 * value, then it will be rounded and returned as an integer. Otherwise If the underlying value is1205 //--------------------------------------------------------------------------------------------------1214 //--------------------------------------------------------------------------------------------------1218 //--------------------------------------------------------------------------------------------------1227 //--------------------------------------------------------------------------------------------------1237 //--------------------------------------------------------------------------------------------------1246 //--------------------------------------------------------------------------------------------------1252 //--------------------------------------------------------------------------------------------------1261 //--------------------------------------------------------------------------------------------------1268 //--------------------------------------------------------------------------------------------------1277 //--------------------------------------------------------------------------------------------------1281 //--------------------------------------------------------------------------------------------------void le_cfg_DisconnectService(void)double le_cfg_QuickGetFloat(const char *LE_NONNULL path, double defaultValue)le_result_t le_cfg_GetString(le_cfg_IteratorRef_t iteratorRef, const char *LE_NONNULL path, char *value, size_t valueSize, const char *LE_NONNULL defaultValue)le_cfg_IteratorRef_t le_cfg_CreateWriteTxn(const char *LE_NONNULL basePath)void le_cfg_QuickSetBinary(const char *LE_NONNULL path, const uint8_t *valuePtr, size_t valueSize)le_result_t le_cfg_GoToNextSibling(le_cfg_IteratorRef_t iteratorRef)le_cfg_nodeType_t le_cfg_GetNodeType(le_cfg_IteratorRef_t iteratorRef, const char *LE_NONNULL path)le_result_t le_cfg_GetNodeName(le_cfg_IteratorRef_t iteratorRef, const char *LE_NONNULL path, char *name, size_t nameSize)void(* le_cfg_DisconnectHandler_t)(void *)Definition: le_cfg_interface.h:409void le_cfg_QuickSetInt(const char *LE_NONNULL path, int32_t value)void le_cfg_GoToNode(le_cfg_IteratorRef_t iteratorRef, const char *LE_NONNULL newPath)le_result_t le_cfg_QuickGetBinary(const char *LE_NONNULL path, uint8_t *valuePtr, size_t *valueSizePtr, const uint8_t *defaultValuePtr, size_t defaultValueSize)void le_cfg_QuickSetBool(const char *LE_NONNULL path, bool value)void le_cfg_ConnectService(void)le_result_t le_cfg_QuickGetString(const char *LE_NONNULL path, char *value, size_t valueSize, const char *LE_NONNULL defaultValue)void le_cfg_QuickSetEmpty(const char *LE_NONNULL path)bool le_cfg_QuickGetBool(const char *LE_NONNULL path, bool defaultValue)double le_cfg_GetFloat(le_cfg_IteratorRef_t iteratorRef, const char *LE_NONNULL path, double defaultValue)void le_cfg_SetBinary(le_cfg_IteratorRef_t iteratorRef, const char *LE_NONNULL path, const uint8_t *valuePtr, size_t valueSize)LE_FULL_API void le_cfg_SetServerDisconnectHandler(le_cfg_DisconnectHandler_t disconnectHandler, void *contextPtr)void le_cfg_SetEmpty(le_cfg_IteratorRef_t iteratorRef, const char *LE_NONNULL path)void le_cfg_CommitTxn(le_cfg_IteratorRef_t iteratorRef)bool le_cfg_NodeExists(le_cfg_IteratorRef_t iteratorRef, const char *LE_NONNULL path)le_result_t le_cfg_GetBinary(le_cfg_IteratorRef_t iteratorRef, const char *LE_NONNULL path, uint8_t *valuePtr, size_t *valueSizePtr, const uint8_t *defaultValuePtr, size_t defaultValueSize)le_result_t le_cfg_TryConnectService(void)le_cfg_ChangeHandlerRef_t le_cfg_AddChangeHandler(const char *LE_NONNULL newPath, le_cfg_ChangeHandlerFunc_t handlerPtr, void *contextPtr)void le_cfg_SetInt(le_cfg_IteratorRef_t iteratorRef, const char *LE_NONNULL path, int32_t value)void le_cfg_QuickSetFloat(const char *LE_NONNULL path, double value)void le_cfg_CancelTxn(le_cfg_IteratorRef_t iteratorRef)void le_cfg_SetFloat(le_cfg_IteratorRef_t iteratorRef, const char *LE_NONNULL path, double value)bool le_cfg_IsEmpty(le_cfg_IteratorRef_t iteratorRef, const char *LE_NONNULL path)void le_cfg_DeleteNode(le_cfg_IteratorRef_t iteratorRef, const char *LE_NONNULL path)le_result_t le_cfg_GoToFirstChild(le_cfg_IteratorRef_t iteratorRef)le_cfg_IteratorRef_t le_cfg_CreateReadTxn(const char *LE_NONNULL basePath)void le_cfg_QuickDeleteNode(const char *LE_NONNULL path)void le_cfg_QuickSetString(const char *LE_NONNULL path, const char *LE_NONNULL value)void le_cfg_SetString(le_cfg_IteratorRef_t iteratorRef, const char *LE_NONNULL path, const char *LE_NONNULL value)le_result_t le_cfg_GetPath(le_cfg_IteratorRef_t iteratorRef, const char *LE_NONNULL path, char *pathBuffer, size_t pathBufferSize)void le_cfg_RemoveChangeHandler(le_cfg_ChangeHandlerRef_t handlerRef)bool le_cfg_GetBool(le_cfg_IteratorRef_t iteratorRef, const char *LE_NONNULL path, bool defaultValue)le_result_t le_cfg_GoToParent(le_cfg_IteratorRef_t iteratorRef)int32_t le_cfg_GetInt(le_cfg_IteratorRef_t iteratorRef, const char *LE_NONNULL path, int32_t defaultValue)void le_cfg_SetBool(le_cfg_IteratorRef_t iteratorRef, const char *LE_NONNULL path, bool value)int32_t le_cfg_QuickGetInt(const char *LE_NONNULL path, int32_t defaultValue)