|
gwenhywfar
5.10.1
|
#include "db_p.h"#include <gwenhywfar/misc.h>#include <gwenhywfar/debug.h>#include <gwenhywfar/path.h>#include <gwenhywfar/text.h>#include <gwenhywfar/dbio.h>#include <gwenhywfar/fslock.h>#include <gwenhywfar/fastbuffer.h>#include <gwenhywfar/syncio_file.h>#include <gwenhywfar/syncio_memory.h>#include <stdlib.h>#include <assert.h>#include <string.h>#include <errno.h>#include <ctype.h>#include <sys/types.h>#include "dbrw.c"
Go to the source code of this file.
Macros | |
| #define | DISABLE_DEBUGLOG |
| #define | GWEN_DB_NODE_FLAGS_GROUP 0x80000000 |
| #define | GWEN_DB_NODE_FLAGS_MASK_INTERNAL 0xf0000000 |
|
static |
| int GWENHYWFAR_CB _replaceVarsCb | ( | void * | cbPtr, |
| const char * | name, | ||
| int | index, | ||
| GWEN_UNUSED int | maxLen, | ||
| GWEN_BUFFER * | dstBuf | ||
| ) |
Definition at line 1965 of file db.c.
References DBG_INFO, GWEN_DB_WriteVarValueToBuffer(), and GWEN_LOGDOMAIN.

|
static |
Definition at line 2007 of file db.c.
References DBG_DEBUG, GWEN_Buffer_AppendString(), GWEN_DB_GetCharValue(), GWEN_DB_GetIntValue(), GWEN_DB_GetValueTypeByPath(), GWEN_DB_NodeType_Unknown, GWEN_DB_NodeType_ValueChar, GWEN_DB_NodeType_ValueInt, GWEN_ERROR_NO_DATA, GWEN_LOGDOMAIN, GWEN_Text_NumToString(), and NULL.
Referenced by GWEN_DB_WriteVarValueToBuffer().


| void GWEN_DB_ClearNode | ( | GWEN_DB_NODE * | n | ) |
Definition at line 852 of file db.c.
Referenced by GWEN_DB_ClearGroup(), GWEN_DB_GetGroup(), GWEN_DB_SetBinValue(), GWEN_DB_SetCharValue(), GWEN_DB_SetCharValueFromInt(), GWEN_DB_SetIntValue(), and GWEN_DB_SetPtrValue().

| void* GWEN_DB_count_cb | ( | GWEN_UNUSED GWEN_DB_NODE * | node, |
| void * | user_data | ||
| ) |
Definition at line 1688 of file db.c.
References NULL.
Referenced by GWEN_DB_Groups_Count(), GWEN_DB_Values_Count(), and GWEN_DB_Variables_Count().

| GWEN_DB_NODE* GWEN_DB_FindGroup | ( | GWEN_DB_NODE * | n, |
| const char * | name, | ||
| int | idx | ||
| ) |
Definition at line 650 of file db.c.
References DBG_ERROR, GWEN_DB_NodeType_Group, GWEN_LOGDOMAIN, and NULL.
Referenced by GWEN_DB_HandlePath().

| GWEN_DB_NODE* GWEN_DB_FindVar | ( | GWEN_DB_NODE * | n, |
| const char * | name, | ||
| int | idx | ||
| ) |
Definition at line 684 of file db.c.
References DBG_ERROR, GWEN_DB_NodeType_Group, GWEN_DB_NodeType_Var, GWEN_LOGDOMAIN, and NULL.
Referenced by GWEN_DB_GetVariableType(), and GWEN_DB_HandlePath().

| GWEN_DB_NODE* GWEN_DB_GetNode | ( | GWEN_DB_NODE * | n, |
| const char * | path, | ||
| uint32_t | flags | ||
| ) |
Definition at line 840 of file db.c.
References GWEN_DB_HandlePath(), and GWEN_Path_HandleWithIdx().
Referenced by GWEN_DB__ReadValues(), GWEN_DB_AddCharValue(), GWEN_DB_ClearGroup(), GWEN_DB_DeleteGroup(), GWEN_DB_DeleteVar(), GWEN_DB_GetGroup(), GWEN_DB_GetValue(), GWEN_DB_RemoveCharValue(), GWEN_DB_SetBinValue(), GWEN_DB_SetCharValue(), GWEN_DB_SetCharValueFromInt(), GWEN_DB_SetIntValue(), GWEN_DB_SetPtrValue(), and GWEN_DB_VariableExists().


| GWEN_DB_NODE* GWEN_DB_GetValue | ( | GWEN_DB_NODE * | n, |
| const char * | path, | ||
| int | idx | ||
| ) |
Definition at line 861 of file db.c.
References DBG_VERBOUS, GWEN_DB_GetNode(), GWEN_DB_NodeType_ValueChar, GWEN_DB_NodeType_ValueLast, GWEN_LOGDOMAIN, GWEN_PATH_FLAGS_NAMEMUSTEXIST, GWEN_PATH_FLAGS_PATHMUSTEXIST, GWEN_PATH_FLAGS_VARIABLE, and NULL.
Referenced by GWEN_DB_GetBinValue(), GWEN_DB_GetCharValue(), GWEN_DB_GetIntValue(), GWEN_DB_GetPtrValue(), GWEN_DB_GetValueTypeByPath(), and GWEN_DB_ValueExists().


| void* GWEN_DB_HandlePath | ( | const char * | entry, |
| void * | data, | ||
| int | idx, | ||
| uint32_t | flags | ||
| ) |
Definition at line 722 of file db.c.
References DBG_INFO, DBG_VERBOUS, GWEN_DB_FindGroup(), GWEN_DB_FindVar(), GWEN_DB_FLAGS_INSERT, GWEN_DB_Group_new(), GWEN_DB_Node_Append(), GWEN_DB_Node_Insert(), GWEN_DB_Var_new(), GWEN_LOGDOMAIN, GWEN_PATH_FLAGS_CREATE_GROUP, GWEN_PATH_FLAGS_CREATE_VAR, GWEN_PATH_FLAGS_LAST, GWEN_PATH_FLAGS_NAMEMUSTEXIST, GWEN_PATH_FLAGS_NAMEMUSTNOTEXIST, GWEN_PATH_FLAGS_PATHCREATE, GWEN_PATH_FLAGS_PATHMUSTEXIST, GWEN_PATH_FLAGS_PATHMUSTNOTEXIST, and GWEN_PATH_FLAGS_VARIABLE.
Referenced by GWEN_DB_GetNode().


| void GWEN_DB_Node_Append | ( | GWEN_DB_NODE * | parent, |
| GWEN_DB_NODE * | n | ||
| ) |
Definition at line 220 of file db.c.
References GWEN_DB_ModifyBranchFlagsUp(), GWEN_DB_Node_Append_UnDirty(), and GWEN_DB_NODE_FLAGS_DIRTY.
Referenced by GWEN_DB__ReadValues(), GWEN_DB_AddCharValue(), GWEN_DB_AddGroup(), GWEN_DB_AddGroupChildren(), GWEN_DB_HandlePath(), GWEN_DB_SetBinValue(), GWEN_DB_SetCharValue(), GWEN_DB_SetCharValueFromInt(), GWEN_DB_SetIntValue(), and GWEN_DB_SetPtrValue().


| void GWEN_DB_Node_Append_UnDirty | ( | GWEN_DB_NODE * | parent, |
| GWEN_DB_NODE * | n | ||
| ) |
Definition at line 205 of file db.c.
References NULL.
Referenced by GWEN_DB_Node_Append(), and GWEN_DB_Node_dup().

| GWEN_DB_NODE* GWEN_DB_Node_dup | ( | const GWEN_DB_NODE * | n | ) |
Definition at line 365 of file db.c.
References DBG_VERBOUS, DBG_WARN, GWEN_DB_Group_new(), GWEN_DB_Node_Append_UnDirty(), GWEN_DB_Node_free(), GWEN_DB_NodeType_Group, GWEN_DB_NodeType_ValueBin, GWEN_DB_NodeType_ValueChar, GWEN_DB_NodeType_ValueInt, GWEN_DB_NodeType_ValuePtr, GWEN_DB_NodeType_Var, GWEN_DB_ValueBin_new(), GWEN_DB_ValueChar_new(), GWEN_DB_ValueInt_new(), GWEN_DB_ValuePtr_new(), GWEN_DB_Var_new(), GWEN_LOGDOMAIN, and NULL.
Referenced by GWEN_DB_AddGroupChildren(), and GWEN_DB_Group_dup().


| void GWEN_DB_Node_free | ( | GWEN_DB_NODE * | n | ) |
Definition at line 290 of file db.c.
References DBG_VERBOUS, DBG_WARN, GWEN_DB_NODE_FLAGS_SAFE, GWEN_DB_NodeType_Group, GWEN_DB_NodeType_ValueBin, GWEN_DB_NodeType_ValueChar, GWEN_DB_NodeType_ValueInt, GWEN_DB_NodeType_ValuePtr, GWEN_DB_NodeType_Var, GWEN_FREE_OBJECT, GWEN_LIST_FINI, GWEN_LOGDOMAIN, GWEN_Memory_dealloc(), and NULL.
Referenced by GWEN_DB_DeleteGroup(), GWEN_DB_DeleteVar(), GWEN_DB_Group_free(), GWEN_DB_Node_dup(), and GWEN_DB_RemoveCharValue().


| void GWEN_DB_Node_Insert | ( | GWEN_DB_NODE * | parent, |
| GWEN_DB_NODE * | n | ||
| ) |
Definition at line 246 of file db.c.
References GWEN_DB_ModifyBranchFlagsUp(), GWEN_DB_NODE_FLAGS_DIRTY, and GWEN_DB_Node_InsertUnDirty().
Referenced by GWEN_DB_HandlePath(), GWEN_DB_InsertGroup(), GWEN_DB_SetBinValue(), GWEN_DB_SetCharValue(), GWEN_DB_SetCharValueFromInt(), GWEN_DB_SetIntValue(), and GWEN_DB_SetPtrValue().


| void GWEN_DB_Node_InsertUnDirty | ( | GWEN_DB_NODE * | parent, |
| GWEN_DB_NODE * | n | ||
| ) |
Definition at line 231 of file db.c.
References NULL.
Referenced by GWEN_DB_Node_Insert().

| GWEN_DB_NODE* GWEN_DB_Node_new | ( | GWEN_DB_NODE_TYPE | t | ) |
Definition at line 88 of file db.c.
References GWEN_LIST_INIT, and GWEN_NEW_OBJECT.
Referenced by GWEN_DB_Group_new(), GWEN_DB_ValueBin_new(), GWEN_DB_ValueChar_new(), GWEN_DB_ValueChar_newFromInt(), GWEN_DB_ValueInt_new(), GWEN_DB_ValuePtr_new(), and GWEN_DB_Var_new().

| void GWEN_DB_Node_Unlink | ( | GWEN_DB_NODE * | n | ) |
Definition at line 274 of file db.c.
References GWEN_DB_ModifyBranchFlagsUp(), GWEN_DB_NODE_FLAGS_DIRTY, and GWEN_DB_Node_Unlink_UnDirty().
Referenced by GWEN_DB_DeleteGroup(), GWEN_DB_DeleteVar(), GWEN_DB_RemoveCharValue(), and GWEN_DB_UnlinkGroup().


| void GWEN_DB_Node_Unlink_UnDirty | ( | GWEN_DB_NODE * | n | ) |
Definition at line 257 of file db.c.
References DBG_WARN, GWEN_LOGDOMAIN, and NULL.
Referenced by GWEN_DB_Node_Unlink().

| GWEN_DB_NODE* GWEN_DB_ValueBin_new | ( | const void * | data, |
| unsigned int | datasize | ||
| ) |
Definition at line 101 of file db.c.
References GWEN_DB_Node_new(), GWEN_DB_NodeType_ValueBin, and GWEN_Memory_malloc().
Referenced by GWEN_DB__ReadValues(), GWEN_DB_Node_dup(), and GWEN_DB_SetBinValue().


| GWEN_DB_NODE* GWEN_DB_ValueChar_new | ( | const char * | data | ) |
Definition at line 130 of file db.c.
References GWEN_DB_Node_new(), GWEN_DB_NodeType_ValueChar, and GWEN_Memory_strdup().
Referenced by GWEN_DB__ReadValues(), GWEN_DB_AddCharValue(), GWEN_DB_Node_dup(), and GWEN_DB_SetCharValue().


| GWEN_DB_NODE* GWEN_DB_ValueChar_newFromInt | ( | int | v | ) |
Definition at line 144 of file db.c.
References GWEN_DB_Node_new(), GWEN_DB_NodeType_ValueChar, and GWEN_Memory_strdup().
Referenced by GWEN_DB_SetCharValueFromInt().


| GWEN_DB_NODE* GWEN_DB_ValueInt_new | ( | int | data | ) |
Definition at line 119 of file db.c.
References GWEN_DB_Node_new(), and GWEN_DB_NodeType_ValueInt.
Referenced by GWEN_DB__ReadValues(), GWEN_DB_Node_dup(), and GWEN_DB_SetIntValue().


| GWEN_DB_NODE* GWEN_DB_ValuePtr_new | ( | void * | data | ) |
Definition at line 162 of file db.c.
References GWEN_DB_Node_new(), and GWEN_DB_NodeType_ValuePtr.
Referenced by GWEN_DB_Node_dup(), and GWEN_DB_SetPtrValue().


| GWEN_DB_NODE* GWEN_DB_Var_new | ( | const char * | name | ) |
Definition at line 189 of file db.c.
References GWEN_DB_Node_new(), GWEN_DB_NodeType_Var, and GWEN_Memory_strdup().
Referenced by GWEN_DB_HandlePath(), and GWEN_DB_Node_dup().


1.8.14