gwenhywfar  4.6.0beta
Macros | Functions
db.c File Reference
#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
 

Functions

int GWEN_DB_AddCharValue (GWEN_DB_NODE *n, const char *path, const char *val, int senseCase, int check)
 
int GWEN_DB_AddGroup (GWEN_DB_NODE *n, GWEN_DB_NODE *nn)
 
int GWEN_DB_AddGroupChildren (GWEN_DB_NODE *n, GWEN_DB_NODE *nn)
 
int GWEN_DB_ClearGroup (GWEN_DB_NODE *n, const char *path)
 
void GWEN_DB_ClearNode (GWEN_DB_NODE *n)
 
void * GWEN_DB_count_cb (GWEN_UNUSED GWEN_DB_NODE *node, void *user_data)
 
int GWEN_DB_DeleteGroup (GWEN_DB_NODE *n, const char *path)
 
int GWEN_DB_DeleteVar (GWEN_DB_NODE *n, const char *path)
 
void GWEN_DB_Dump (GWEN_DB_NODE *n, int insert)
 
GWEN_DB_NODEGWEN_DB_FindFirstGroup (GWEN_DB_NODE *n, const char *name)
 
GWEN_DB_NODEGWEN_DB_FindFirstVar (GWEN_DB_NODE *n, const char *name)
 
GWEN_DB_NODEGWEN_DB_FindGroup (GWEN_DB_NODE *n, const char *name, int idx)
 
GWEN_DB_NODEGWEN_DB_FindNextGroup (GWEN_DB_NODE *n, const char *name)
 
GWEN_DB_NODEGWEN_DB_FindNextVar (GWEN_DB_NODE *n, const char *name)
 
GWEN_DB_NODEGWEN_DB_FindVar (GWEN_DB_NODE *n, const char *name, int idx)
 
const void * GWEN_DB_GetBinValue (GWEN_DB_NODE *n, const char *path, int idx, const void *defVal, unsigned int defValSize, unsigned int *returnValueSize)
 
const void * GWEN_DB_GetBinValueFromNode (const GWEN_DB_NODE *n, unsigned int *size)
 
const char * GWEN_DB_GetCharValue (GWEN_DB_NODE *n, const char *path, int idx, const char *defVal)
 
const char * GWEN_DB_GetCharValueFromNode (const GWEN_DB_NODE *n)
 
GWEN_DB_NODEGWEN_DB_GetFirstGroup (GWEN_DB_NODE *n)
 
GWEN_DB_NODEGWEN_DB_GetFirstValue (GWEN_DB_NODE *n)
 
GWEN_DB_NODEGWEN_DB_GetFirstVar (GWEN_DB_NODE *n)
 
GWEN_DB_NODEGWEN_DB_GetGroup (GWEN_DB_NODE *n, uint32_t flags, const char *path)
 
int GWEN_DB_GetIntValue (GWEN_DB_NODE *n, const char *path, int idx, int defVal)
 
int GWEN_DB_GetIntValueFromNode (const GWEN_DB_NODE *n)
 
GWEN_DB_NODEGWEN_DB_GetNextGroup (GWEN_DB_NODE *n)
 
GWEN_DB_NODEGWEN_DB_GetNextValue (GWEN_DB_NODE *n)
 
GWEN_DB_NODEGWEN_DB_GetNextVar (GWEN_DB_NODE *n)
 
GWEN_DB_NODEGWEN_DB_GetNode (GWEN_DB_NODE *n, const char *path, uint32_t flags)
 
uint32_t GWEN_DB_GetNodeFlags (const GWEN_DB_NODE *n)
 
GWEN_DB_NODEGWEN_DB_GetParentGroup (GWEN_DB_NODE *n)
 
void * GWEN_DB_GetPtrValue (GWEN_DB_NODE *n, const char *path, int idx, void *defVal)
 
GWEN_DB_NODEGWEN_DB_GetValue (GWEN_DB_NODE *n, const char *path, int idx)
 
GWEN_DB_NODE_TYPE GWEN_DB_GetValueType (GWEN_DB_NODE *n)
 
GWEN_DB_NODE_TYPE GWEN_DB_GetValueTypeByPath (GWEN_DB_NODE *n, const char *path, unsigned int i)
 
GWEN_DB_NODE_TYPE GWEN_DB_GetVariableType (GWEN_DB_NODE *n, const char *p)
 
GWEN_DB_NODEGWEN_DB_Group_dup (const GWEN_DB_NODE *n)
 
void GWEN_DB_Group_free (GWEN_DB_NODE *n)
 
GWEN_DB_NODEGWEN_DB_Group_new (const char *name)
 
const char * GWEN_DB_GroupName (GWEN_DB_NODE *n)
 
void GWEN_DB_GroupRename (GWEN_DB_NODE *n, const char *newname)
 
unsigned int GWEN_DB_Groups_Count (const GWEN_DB_NODE *node)
 
void * GWEN_DB_Groups_Foreach (GWEN_DB_NODE *node, GWEN_DB_NODES_CB func, void *user_data)
 
void * GWEN_DB_HandlePath (const char *entry, void *data, int idx, uint32_t flags)
 
int GWEN_DB_InsertGroup (GWEN_DB_NODE *n, GWEN_DB_NODE *nn)
 
int GWEN_DB_IsGroup (const GWEN_DB_NODE *n)
 
int GWEN_DB_IsValue (const GWEN_DB_NODE *n)
 
int GWEN_DB_IsVariable (const GWEN_DB_NODE *n)
 
void GWEN_DB_ModifyBranchFlagsDown (GWEN_DB_NODE *n, uint32_t newflags, uint32_t mask)
 
void GWEN_DB_ModifyBranchFlagsUp (GWEN_DB_NODE *n, uint32_t newflags, uint32_t mask)
 
void GWEN_DB_Node_Append (GWEN_DB_NODE *parent, GWEN_DB_NODE *n)
 
void GWEN_DB_Node_Append_UnDirty (GWEN_DB_NODE *parent, GWEN_DB_NODE *n)
 
GWEN_DB_NODEGWEN_DB_Node_dup (const GWEN_DB_NODE *n)
 
void GWEN_DB_Node_free (GWEN_DB_NODE *n)
 
void GWEN_DB_Node_Insert (GWEN_DB_NODE *parent, GWEN_DB_NODE *n)
 
void GWEN_DB_Node_InsertUnDirty (GWEN_DB_NODE *parent, GWEN_DB_NODE *n)
 
GWEN_DB_NODEGWEN_DB_Node_new (GWEN_DB_NODE_TYPE t)
 
void GWEN_DB_Node_Unlink (GWEN_DB_NODE *n)
 
void GWEN_DB_Node_Unlink_UnDirty (GWEN_DB_NODE *n)
 
int GWEN_DB_RemoveCharValue (GWEN_DB_NODE *n, const char *path, const char *val, int senseCase)
 
int GWEN_DB_SetBinValue (GWEN_DB_NODE *n, uint32_t flags, const char *path, const void *val, unsigned int valSize)
 
int GWEN_DB_SetCharValue (GWEN_DB_NODE *n, uint32_t flags, const char *path, const char *val)
 
int GWEN_DB_SetCharValueInNode (GWEN_DB_NODE *n, const char *s)
 
int GWEN_DB_SetIntValue (GWEN_DB_NODE *n, uint32_t flags, const char *path, int val)
 
void GWEN_DB_SetNodeFlags (GWEN_DB_NODE *n, uint32_t flags)
 
int GWEN_DB_SetPtrValue (GWEN_DB_NODE *n, uint32_t flags, const char *path, void *val)
 
void GWEN_DB_UnlinkGroup (GWEN_DB_NODE *n)
 
GWEN_DB_NODEGWEN_DB_ValueBin_new (const void *data, unsigned int datasize)
 
GWEN_DB_NODEGWEN_DB_ValueChar_new (const char *data)
 
int GWEN_DB_ValueExists (GWEN_DB_NODE *n, const char *path, unsigned int i)
 
GWEN_DB_NODEGWEN_DB_ValueInt_new (int data)
 
GWEN_DB_NODEGWEN_DB_ValuePtr_new (void *data)
 
unsigned int GWEN_DB_Values_Count (const GWEN_DB_NODE *node)
 
void * GWEN_DB_Values_Foreach (GWEN_DB_NODE *node, GWEN_DB_NODES_CB func, void *user_data)
 
GWEN_DB_NODEGWEN_DB_Var_new (const char *name)
 
int GWEN_DB_VariableExists (GWEN_DB_NODE *n, const char *path)
 
const char * GWEN_DB_VariableName (GWEN_DB_NODE *n)
 
void GWEN_DB_VariableRename (GWEN_DB_NODE *n, const char *newname)
 
unsigned int GWEN_DB_Variables_Count (const GWEN_DB_NODE *node)
 
void * GWEN_DB_Variables_Foreach (GWEN_DB_NODE *node, GWEN_DB_NODES_CB func, void *user_data)
 

Macro Definition Documentation

#define DISABLE_DEBUGLOG

Definition at line 30 of file db.c.

#define GWEN_DB_NODE_FLAGS_GROUP   0x80000000

Definition at line 62 of file db.c.

#define GWEN_DB_NODE_FLAGS_MASK_INTERNAL   0xf0000000

Definition at line 61 of file db.c.

Function Documentation

void GWEN_DB_ClearNode ( GWEN_DB_NODE n)
void* GWEN_DB_count_cb ( GWEN_UNUSED GWEN_DB_NODE node,
void *  user_data 
)

Definition at line 1551 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 585 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 
)
GWEN_DB_NODE* GWEN_DB_GetNode ( GWEN_DB_NODE n,
const char *  path,
uint32_t  flags 
)
GWEN_DB_NODE* GWEN_DB_GetValue ( GWEN_DB_NODE n,
const char *  path,
int  idx 
)
void* GWEN_DB_HandlePath ( const char *  entry,
void *  data,
int  idx,
uint32_t  flags 
)
void GWEN_DB_Node_Append ( GWEN_DB_NODE parent,
GWEN_DB_NODE n 
)
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)
void GWEN_DB_Node_free ( GWEN_DB_NODE n)
void GWEN_DB_Node_Insert ( GWEN_DB_NODE parent,
GWEN_DB_NODE n 
)
void GWEN_DB_Node_InsertUnDirty ( GWEN_DB_NODE parent,
GWEN_DB_NODE n 
)

Definition at line 185 of file db.c.

References NULL.

Referenced by GWEN_DB_Node_Insert().

GWEN_DB_NODE* GWEN_DB_Node_new ( GWEN_DB_NODE_TYPE  t)
void GWEN_DB_Node_Unlink ( GWEN_DB_NODE n)
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 
)
GWEN_DB_NODE* GWEN_DB_ValueChar_new ( const char *  data)
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().