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 read105 * functions, and Commit the transaction. If a write transaction is canceled instead of committed,120 * Transactions must not be kept open for extended periods of time. If a transaction is kept open122 * cancel the transaction and drop the connection to the offending client (most likely causing the126 * | --------------------------| ------------------------------------------------------------------|133 * To move around within the Tree you can move directly to a specific node(leaf or stem) and then138 * | ----------------------------| -------------------------------------------------------------------------------|141 * | @c le_cfg_GoToFirstChild() | Moves to the first node from the current location (moves down the Tree) |142 * | @c le_cfg_GoToNextSibling() | Moves to the next node on the same level as the current node (moves laterally) |146 * The Config tree also contains functions to help you identify your current location in the tree,147 * what node you are currently pointing at, and what type of data is contained in the current node.150 * | ------------------------| ------------------------------------------------------------------------------- |153 * | @c le_cfg_GetNodeName() | Gets the name of the node where you are in the Tree (does not include the path) |166 * To perform a read from a Tree, we need to open a transaction, move to the node that you want to232 * Each data type has it's own set function, to write a value to a node within the Tree. Before you244 * To perform a write to a Tree, we need to open a transaction, move to the node that you want to274 * @note Creating write transactions creates a temporary working copy of the tree for use within the275 * transaction. All read transactions running in the meantime see the committed state, without any298 * Because quick read/write functions don't get created within a transaction, there is no option to318 * @warning Because each quick function is independent, there's no guarantee of consistency between339 //--------------------------------------------------------------------------------------------------343 //--------------------------------------------------------------------------------------------------346 //--------------------------------------------------------------------------------------------------349 * Connect the current client thread to the service providing this API. Block until the service is352 * For each thread that wants to use this API, either ConnectService or TryConnectService must be353 * called before any other functions in this API. Normally, ConnectService is automatically called358 //--------------------------------------------------------------------------------------------------364 //--------------------------------------------------------------------------------------------------367 * Try to connect the current client thread to the service providing this API. Return with an error370 * For each thread that wants to use this API, either ConnectService or TryConnectService must be371 * called before any other functions in this API. Normally, ConnectService is automatically called380 * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).383 //--------------------------------------------------------------------------------------------------389 //--------------------------------------------------------------------------------------------------393 * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants396 //--------------------------------------------------------------------------------------------------403 //--------------------------------------------------------------------------------------------------409 * longer a connection to the service, and the functions in this API can't be used. For details, see414 //--------------------------------------------------------------------------------------------------421 //--------------------------------------------------------------------------------------------------425 //--------------------------------------------------------------------------------------------------428 //--------------------------------------------------------------------------------------------------432 //--------------------------------------------------------------------------------------------------435 //--------------------------------------------------------------------------------------------------439 //--------------------------------------------------------------------------------------------------442 //--------------------------------------------------------------------------------------------------446 //--------------------------------------------------------------------------------------------------449 //--------------------------------------------------------------------------------------------------453 //--------------------------------------------------------------------------------------------------457 //--------------------------------------------------------------------------------------------------461 //--------------------------------------------------------------------------------------------------482 //--------------------------------------------------------------------------------------------------486 //--------------------------------------------------------------------------------------------------490 //--------------------------------------------------------------------------------------------------494 //--------------------------------------------------------------------------------------------------496 (501 //--------------------------------------------------------------------------------------------------509 * @note A tree transaction is global to that tree; a long-held read transaction will block other514 //--------------------------------------------------------------------------------------------------521 //--------------------------------------------------------------------------------------------------535 //--------------------------------------------------------------------------------------------------542 //--------------------------------------------------------------------------------------------------549 //--------------------------------------------------------------------------------------------------556 //--------------------------------------------------------------------------------------------------558 * Closes and frees the given iterator object. If the iterator is a write iterator, the transaction559 * will be canceled. If the iterator is a read iterator, the transaction will be closed. No data is564 //--------------------------------------------------------------------------------------------------571 //--------------------------------------------------------------------------------------------------580 //--------------------------------------------------------------------------------------------------589 //--------------------------------------------------------------------------------------------------598 //--------------------------------------------------------------------------------------------------605 //--------------------------------------------------------------------------------------------------611 * children of this node are not written to, then this node will not persist even if the iterator is619 //--------------------------------------------------------------------------------------------------626 //--------------------------------------------------------------------------------------------------650 //--------------------------------------------------------------------------------------------------657 //--------------------------------------------------------------------------------------------------690 //--------------------------------------------------------------------------------------------------704 //--------------------------------------------------------------------------------------------------710 //--------------------------------------------------------------------------------------------------720 //--------------------------------------------------------------------------------------------------727 //--------------------------------------------------------------------------------------------------741 //--------------------------------------------------------------------------------------------------748 //--------------------------------------------------------------------------------------------------759 //--------------------------------------------------------------------------------------------------763 //--------------------------------------------------------------------------------------------------770 //--------------------------------------------------------------------------------------------------779 //--------------------------------------------------------------------------------------------------789 //--------------------------------------------------------------------------------------------------800 //--------------------------------------------------------------------------------------------------810 //--------------------------------------------------------------------------------------------------819 //--------------------------------------------------------------------------------------------------829 //--------------------------------------------------------------------------------------------------835 //--------------------------------------------------------------------------------------------------845 //--------------------------------------------------------------------------------------------------857 //--------------------------------------------------------------------------------------------------875 //--------------------------------------------------------------------------------------------------882 //--------------------------------------------------------------------------------------------------894 //--------------------------------------------------------------------------------------------------907 //--------------------------------------------------------------------------------------------------920 //--------------------------------------------------------------------------------------------------927 //--------------------------------------------------------------------------------------------------939 //--------------------------------------------------------------------------------------------------950 //--------------------------------------------------------------------------------------------------963 //--------------------------------------------------------------------------------------------------972 //--------------------------------------------------------------------------------------------------984 //--------------------------------------------------------------------------------------------------994 //--------------------------------------------------------------------------------------------------1007 //--------------------------------------------------------------------------------------------------1014 //--------------------------------------------------------------------------------------------------1026 //--------------------------------------------------------------------------------------------------1028 * Deletes the node specified by the path. If the node doesn't exist, nothing happens. All child1031 //--------------------------------------------------------------------------------------------------1038 //--------------------------------------------------------------------------------------------------1040 * Clears the current value of a node. If the node doesn't currently exist then it is created as a1043 //--------------------------------------------------------------------------------------------------1050 //--------------------------------------------------------------------------------------------------1058 //--------------------------------------------------------------------------------------------------1071 //--------------------------------------------------------------------------------------------------1075 //--------------------------------------------------------------------------------------------------1084 //--------------------------------------------------------------------------------------------------1087 * value, then it will be rounded and returned as an integer. Otherwise If the underlying value is1092 //--------------------------------------------------------------------------------------------------1101 //--------------------------------------------------------------------------------------------------1105 //--------------------------------------------------------------------------------------------------1114 //--------------------------------------------------------------------------------------------------1124 //--------------------------------------------------------------------------------------------------1133 //--------------------------------------------------------------------------------------------------1139 //--------------------------------------------------------------------------------------------------1148 //--------------------------------------------------------------------------------------------------1155 //--------------------------------------------------------------------------------------------------1164 //--------------------------------------------------------------------------------------------------1168 //--------------------------------------------------------------------------------------------------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)struct le_cfg_ChangeHandler * le_cfg_ChangeHandlerRef_tDefinition: le_cfg_interface.h:487le_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:344void 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)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_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_TryConnectService(void)void(* le_cfg_ChangeHandlerFunc_t)(void *contextPtr)Definition: le_cfg_interface.h:496le_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:474int32_t le_cfg_QuickGetInt(const char *LE_NONNULL path, int32_t defaultValue)