gwenhywfar
4.3.3
|
#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.
#define DISABLE_DEBUGLOG |
#define GWEN_DB_NODE_FLAGS_GROUP 0x80000000 |
#define GWEN_DB_NODE_FLAGS_MASK_INTERNAL 0xf0000000 |
void GWEN_DB_ClearNode | ( | GWEN_DB_NODE * | n | ) |
Definition at line 743 of file db.c.
Referenced by GWEN_DB_ClearGroup(), GWEN_DB_GetGroup(), GWEN_DB_SetBinValue(), GWEN_DB_SetCharValue(), GWEN_DB_SetIntValue(), and GWEN_DB_SetPtrValue().
void* GWEN_DB_count_cb | ( | GWEN_UNUSED GWEN_DB_NODE * | node, |
void * | user_data | ||
) |
Definition at line 1511 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 545 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 578 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 732 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_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 751 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 615 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 175 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_SetIntValue(), and GWEN_DB_SetPtrValue().
void GWEN_DB_Node_Append_UnDirty | ( | GWEN_DB_NODE * | parent, |
GWEN_DB_NODE * | n | ||
) |
Definition at line 161 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 274 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 240 of file db.c.
References DBG_VERBOUS, DBG_WARN, 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, and GWEN_Memory_dealloc().
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 199 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_SetIntValue(), and GWEN_DB_SetPtrValue().
void GWEN_DB_Node_InsertUnDirty | ( | GWEN_DB_NODE * | parent, |
GWEN_DB_NODE * | n | ||
) |
Definition at line 69 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_ValueInt_new(), GWEN_DB_ValuePtr_new(), and GWEN_DB_Var_new().
void GWEN_DB_Node_Unlink | ( | GWEN_DB_NODE * | n | ) |
Definition at line 225 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 209 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 81 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 108 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_ValueInt_new | ( | int | data | ) |
Definition at line 98 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 121 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 146 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().