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 between408 //--------------------------------------------------------------------------------------------------412 //--------------------------------------------------------------------------------------------------415 //--------------------------------------------------------------------------------------------------418 * Connect the current client thread to the service providing this API. Block until the service is421 * For each thread that wants to use this API, either ConnectService or TryConnectService must be422 * called before any other functions in this API. Normally, ConnectService is automatically called427 //--------------------------------------------------------------------------------------------------433 //--------------------------------------------------------------------------------------------------436 * Try to connect the current client thread to the service providing this API. Return with an error439 * For each thread that wants to use this API, either ConnectService or TryConnectService must be440 * called before any other functions in this API. Normally, ConnectService is automatically called449 * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).452 //--------------------------------------------------------------------------------------------------458 //--------------------------------------------------------------------------------------------------462 * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants465 //--------------------------------------------------------------------------------------------------472 //--------------------------------------------------------------------------------------------------478 * longer a connection to the service, and the functions in this API can't be used. For details, see483 //--------------------------------------------------------------------------------------------------490 //--------------------------------------------------------------------------------------------------494 //--------------------------------------------------------------------------------------------------497 //--------------------------------------------------------------------------------------------------501 //--------------------------------------------------------------------------------------------------504 //--------------------------------------------------------------------------------------------------508 //--------------------------------------------------------------------------------------------------511 //--------------------------------------------------------------------------------------------------515 //--------------------------------------------------------------------------------------------------518 //--------------------------------------------------------------------------------------------------526 * @note A tree transaction is global to that tree; a long-held read transaction will block other531 //--------------------------------------------------------------------------------------------------538 //--------------------------------------------------------------------------------------------------552 //--------------------------------------------------------------------------------------------------559 //--------------------------------------------------------------------------------------------------566 //--------------------------------------------------------------------------------------------------573 //--------------------------------------------------------------------------------------------------575 * Closes and frees the given iterator object. If the iterator is a write iterator, the transaction576 * will be canceled. If the iterator is a read iterator, the transaction will be closed. No data is581 //--------------------------------------------------------------------------------------------------588 //--------------------------------------------------------------------------------------------------597 //--------------------------------------------------------------------------------------------------606 //--------------------------------------------------------------------------------------------------615 //--------------------------------------------------------------------------------------------------622 //--------------------------------------------------------------------------------------------------628 * children of this node are not written to, then this node will not persist even if the iterator is636 //--------------------------------------------------------------------------------------------------643 //--------------------------------------------------------------------------------------------------667 //--------------------------------------------------------------------------------------------------674 //--------------------------------------------------------------------------------------------------707 //--------------------------------------------------------------------------------------------------721 //--------------------------------------------------------------------------------------------------727 //--------------------------------------------------------------------------------------------------737 //--------------------------------------------------------------------------------------------------744 //--------------------------------------------------------------------------------------------------758 //--------------------------------------------------------------------------------------------------765 //--------------------------------------------------------------------------------------------------776 //--------------------------------------------------------------------------------------------------780 //--------------------------------------------------------------------------------------------------787 //--------------------------------------------------------------------------------------------------796 //--------------------------------------------------------------------------------------------------806 //--------------------------------------------------------------------------------------------------817 //--------------------------------------------------------------------------------------------------827 //--------------------------------------------------------------------------------------------------836 //--------------------------------------------------------------------------------------------------846 //--------------------------------------------------------------------------------------------------852 //--------------------------------------------------------------------------------------------------862 //--------------------------------------------------------------------------------------------------874 //--------------------------------------------------------------------------------------------------892 //--------------------------------------------------------------------------------------------------899 //--------------------------------------------------------------------------------------------------911 //--------------------------------------------------------------------------------------------------928 //--------------------------------------------------------------------------------------------------948 //--------------------------------------------------------------------------------------------------957 //--------------------------------------------------------------------------------------------------971 //--------------------------------------------------------------------------------------------------984 //--------------------------------------------------------------------------------------------------997 //--------------------------------------------------------------------------------------------------1004 //--------------------------------------------------------------------------------------------------1016 //--------------------------------------------------------------------------------------------------1027 //--------------------------------------------------------------------------------------------------1040 //--------------------------------------------------------------------------------------------------1049 //--------------------------------------------------------------------------------------------------1061 //--------------------------------------------------------------------------------------------------1071 //--------------------------------------------------------------------------------------------------1084 //--------------------------------------------------------------------------------------------------1091 //--------------------------------------------------------------------------------------------------1103 //--------------------------------------------------------------------------------------------------1105 * Deletes the node specified by the path. If the node doesn't exist, nothing happens. All child1108 //--------------------------------------------------------------------------------------------------1115 //--------------------------------------------------------------------------------------------------1117 * Clears the current value of a node. If the node doesn't currently exist then it is created as a1120 //--------------------------------------------------------------------------------------------------1127 //--------------------------------------------------------------------------------------------------1135 //--------------------------------------------------------------------------------------------------1148 //--------------------------------------------------------------------------------------------------1152 //--------------------------------------------------------------------------------------------------1161 //--------------------------------------------------------------------------------------------------1170 //--------------------------------------------------------------------------------------------------1186 //--------------------------------------------------------------------------------------------------1190 //--------------------------------------------------------------------------------------------------1201 //--------------------------------------------------------------------------------------------------1204 * value, then it will be rounded and returned as an integer. Otherwise If the underlying value is1209 //--------------------------------------------------------------------------------------------------1218 //--------------------------------------------------------------------------------------------------1222 //--------------------------------------------------------------------------------------------------1231 //--------------------------------------------------------------------------------------------------1241 //--------------------------------------------------------------------------------------------------1250 //--------------------------------------------------------------------------------------------------1256 //--------------------------------------------------------------------------------------------------1265 //--------------------------------------------------------------------------------------------------1272 //--------------------------------------------------------------------------------------------------1281 //--------------------------------------------------------------------------------------------------1285 //--------------------------------------------------------------------------------------------------int32_t le_cfg_QuickGetInt(const char *LE_NONNULL path, int32_t defaultValue)le_result_t le_cfg_GetNodeName(le_cfg_IteratorRef_t iteratorRef, const char *LE_NONNULL path, char *name, size_t nameSize)void le_cfg_QuickSetFloat(const char *LE_NONNULL path, double value)void le_cfg_QuickSetEmpty(const char *LE_NONNULL path)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_result_t le_cfg_GoToParent(le_cfg_IteratorRef_t iteratorRef)void le_cfg_QuickSetString(const char *LE_NONNULL path, const char *LE_NONNULL value)void le_cfg_GoToNode(le_cfg_IteratorRef_t iteratorRef, const char *LE_NONNULL newPath)struct le_cfg_ChangeHandler * le_cfg_ChangeHandlerRef_tDefinition: le_cfg_common.h:101void le_cfg_QuickDeleteNode(const char *LE_NONNULL path)bool le_cfg_QuickGetBool(const char *LE_NONNULL path, bool defaultValue)void(* le_cfg_ChangeHandlerFunc_t)(void *contextPtr)Definition: le_cfg_common.h:110void le_cfg_SetString(le_cfg_IteratorRef_t iteratorRef, const char *LE_NONNULL path, const char *LE_NONNULL value)void le_cfg_DisconnectService(void)void le_cfg_SetFloat(le_cfg_IteratorRef_t iteratorRef, const char *LE_NONNULL path, double value)le_cfg_IteratorRef_t le_cfg_CreateReadTxn(const char *LE_NONNULL basePath)void le_cfg_SetBool(le_cfg_IteratorRef_t iteratorRef, const char *LE_NONNULL path, bool value)int32_t le_cfg_GetInt(le_cfg_IteratorRef_t iteratorRef, const char *LE_NONNULL path, int32_t defaultValue)double le_cfg_QuickGetFloat(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)void le_cfg_RemoveChangeHandler(le_cfg_ChangeHandlerRef_t handlerRef)le_result_t le_cfg_QuickGetString(const char *LE_NONNULL path, char *value, size_t valueSize, const char *LE_NONNULL defaultValue)bool le_cfg_NodeExists(le_cfg_IteratorRef_t iteratorRef, const char *LE_NONNULL path)le_cfg_ChangeHandlerRef_t le_cfg_AddChangeHandler(const char *LE_NONNULL newPath, le_cfg_ChangeHandlerFunc_t handlerPtr, void *contextPtr)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)void le_cfg_SetInt(le_cfg_IteratorRef_t iteratorRef, const char *LE_NONNULL path, int32_t value)bool le_cfg_GetBool(le_cfg_IteratorRef_t iteratorRef, const char *LE_NONNULL path, bool defaultValue)le_result_t le_cfg_GoToNextSibling(le_cfg_IteratorRef_t iteratorRef)LE_FULL_API void le_cfg_SetServerDisconnectHandler(le_cfg_DisconnectHandler_t disconnectHandler, void *contextPtr)le_cfg_IteratorRef_t le_cfg_CreateWriteTxn(const char *LE_NONNULL basePath)void(* le_cfg_DisconnectHandler_t)(void *)Definition: le_cfg_interface.h:413le_result_t le_cfg_GoToFirstChild(le_cfg_IteratorRef_t iteratorRef)void le_cfg_QuickSetBinary(const char *LE_NONNULL path, const uint8_t *valuePtr, size_t valueSize)void le_cfg_CommitTxn(le_cfg_IteratorRef_t iteratorRef)le_result_t le_cfg_TryConnectService(void)bool le_cfg_IsEmpty(le_cfg_IteratorRef_t iteratorRef, const char *LE_NONNULL path)void le_cfg_QuickSetBool(const char *LE_NONNULL path, bool value)void le_cfg_ConnectService(void)void le_cfg_QuickSetInt(const char *LE_NONNULL path, int32_t value)void le_cfg_DeleteNode(le_cfg_IteratorRef_t iteratorRef, const char *LE_NONNULL path)double le_cfg_GetFloat(le_cfg_IteratorRef_t iteratorRef, const char *LE_NONNULL path, double defaultValue)le_result_t le_cfg_GetPath(le_cfg_IteratorRef_t iteratorRef, const char *LE_NONNULL path, char *pathBuffer, size_t pathBufferSize)void le_cfg_CancelTxn(le_cfg_IteratorRef_t iteratorRef)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_SetEmpty(le_cfg_IteratorRef_t iteratorRef, const char *LE_NONNULL path)le_cfg_nodeType_t le_cfg_GetNodeType(le_cfg_IteratorRef_t iteratorRef, const char *LE_NONNULL path)