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 between403 //--------------------------------------------------------------------------------------------------407 //--------------------------------------------------------------------------------------------------410 //--------------------------------------------------------------------------------------------------413 * Connect the current client thread to the service providing this API. Block until the service is416 * For each thread that wants to use this API, either ConnectService or TryConnectService must be417 * called before any other functions in this API. Normally, ConnectService is automatically called422 //--------------------------------------------------------------------------------------------------428 //--------------------------------------------------------------------------------------------------431 * Try to connect the current client thread to the service providing this API. Return with an error434 * For each thread that wants to use this API, either ConnectService or TryConnectService must be435 * called before any other functions in this API. Normally, ConnectService is automatically called444 * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).447 //--------------------------------------------------------------------------------------------------453 //--------------------------------------------------------------------------------------------------457 * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants460 //--------------------------------------------------------------------------------------------------467 //--------------------------------------------------------------------------------------------------473 * longer a connection to the service, and the functions in this API can't be used. For details, see478 //--------------------------------------------------------------------------------------------------485 //--------------------------------------------------------------------------------------------------489 //--------------------------------------------------------------------------------------------------492 //--------------------------------------------------------------------------------------------------496 //--------------------------------------------------------------------------------------------------499 //--------------------------------------------------------------------------------------------------503 //--------------------------------------------------------------------------------------------------506 //--------------------------------------------------------------------------------------------------510 //--------------------------------------------------------------------------------------------------513 //--------------------------------------------------------------------------------------------------517 //--------------------------------------------------------------------------------------------------520 //--------------------------------------------------------------------------------------------------524 //--------------------------------------------------------------------------------------------------528 //--------------------------------------------------------------------------------------------------532 //--------------------------------------------------------------------------------------------------553 //--------------------------------------------------------------------------------------------------557 //--------------------------------------------------------------------------------------------------561 //--------------------------------------------------------------------------------------------------565 //--------------------------------------------------------------------------------------------------567 (572 //--------------------------------------------------------------------------------------------------580 * @note A tree transaction is global to that tree; a long-held read transaction will block other585 //--------------------------------------------------------------------------------------------------592 //--------------------------------------------------------------------------------------------------606 //--------------------------------------------------------------------------------------------------613 //--------------------------------------------------------------------------------------------------620 //--------------------------------------------------------------------------------------------------627 //--------------------------------------------------------------------------------------------------629 * Closes and frees the given iterator object. If the iterator is a write iterator, the transaction630 * will be canceled. If the iterator is a read iterator, the transaction will be closed. No data is635 //--------------------------------------------------------------------------------------------------642 //--------------------------------------------------------------------------------------------------651 //--------------------------------------------------------------------------------------------------660 //--------------------------------------------------------------------------------------------------669 //--------------------------------------------------------------------------------------------------676 //--------------------------------------------------------------------------------------------------682 * children of this node are not written to, then this node will not persist even if the iterator is690 //--------------------------------------------------------------------------------------------------697 //--------------------------------------------------------------------------------------------------721 //--------------------------------------------------------------------------------------------------728 //--------------------------------------------------------------------------------------------------761 //--------------------------------------------------------------------------------------------------775 //--------------------------------------------------------------------------------------------------781 //--------------------------------------------------------------------------------------------------791 //--------------------------------------------------------------------------------------------------798 //--------------------------------------------------------------------------------------------------812 //--------------------------------------------------------------------------------------------------819 //--------------------------------------------------------------------------------------------------830 //--------------------------------------------------------------------------------------------------834 //--------------------------------------------------------------------------------------------------841 //--------------------------------------------------------------------------------------------------850 //--------------------------------------------------------------------------------------------------860 //--------------------------------------------------------------------------------------------------871 //--------------------------------------------------------------------------------------------------881 //--------------------------------------------------------------------------------------------------890 //--------------------------------------------------------------------------------------------------900 //--------------------------------------------------------------------------------------------------906 //--------------------------------------------------------------------------------------------------916 //--------------------------------------------------------------------------------------------------928 //--------------------------------------------------------------------------------------------------946 //--------------------------------------------------------------------------------------------------953 //--------------------------------------------------------------------------------------------------965 //--------------------------------------------------------------------------------------------------982 //--------------------------------------------------------------------------------------------------1002 //--------------------------------------------------------------------------------------------------1011 //--------------------------------------------------------------------------------------------------1025 //--------------------------------------------------------------------------------------------------1038 //--------------------------------------------------------------------------------------------------1051 //--------------------------------------------------------------------------------------------------1058 //--------------------------------------------------------------------------------------------------1070 //--------------------------------------------------------------------------------------------------1081 //--------------------------------------------------------------------------------------------------1094 //--------------------------------------------------------------------------------------------------1103 //--------------------------------------------------------------------------------------------------1115 //--------------------------------------------------------------------------------------------------1125 //--------------------------------------------------------------------------------------------------1138 //--------------------------------------------------------------------------------------------------1145 //--------------------------------------------------------------------------------------------------1157 //--------------------------------------------------------------------------------------------------1159 * Deletes the node specified by the path. If the node doesn't exist, nothing happens. All child1162 //--------------------------------------------------------------------------------------------------1169 //--------------------------------------------------------------------------------------------------1171 * Clears the current value of a node. If the node doesn't currently exist then it is created as a1174 //--------------------------------------------------------------------------------------------------1181 //--------------------------------------------------------------------------------------------------1189 //--------------------------------------------------------------------------------------------------1202 //--------------------------------------------------------------------------------------------------1206 //--------------------------------------------------------------------------------------------------1215 //--------------------------------------------------------------------------------------------------1224 //--------------------------------------------------------------------------------------------------1240 //--------------------------------------------------------------------------------------------------1244 //--------------------------------------------------------------------------------------------------1255 //--------------------------------------------------------------------------------------------------1258 * value, then it will be rounded and returned as an integer. Otherwise If the underlying value is1263 //--------------------------------------------------------------------------------------------------1272 //--------------------------------------------------------------------------------------------------1276 //--------------------------------------------------------------------------------------------------1285 //--------------------------------------------------------------------------------------------------1295 //--------------------------------------------------------------------------------------------------1304 //--------------------------------------------------------------------------------------------------1310 //--------------------------------------------------------------------------------------------------1319 //--------------------------------------------------------------------------------------------------1326 //--------------------------------------------------------------------------------------------------1335 //--------------------------------------------------------------------------------------------------1339 //--------------------------------------------------------------------------------------------------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)struct le_cfg_ChangeHandler * le_cfg_ChangeHandlerRef_tDefinition: le_cfg_interface.h:558le_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:408void 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)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)void(* le_cfg_ChangeHandlerFunc_t)(void *contextPtr)Definition: le_cfg_interface.h:567le_cfg_ChangeHandlerRef_t le_cfg_AddChangeHandler(const char *LE_NONNULL newPath, le_cfg_ChangeHandlerFunc_t handlerPtr, void *contextPtr)void le_cfg_SetServerDisconnectHandler(le_cfg_DisconnectHandler_t disconnectHandler, 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)Non-leaf node, this node is the parent of other nodes.Definition: le_cfg_interface.h:545int32_t le_cfg_QuickGetInt(const char *LE_NONNULL path, int32_t defaultValue)