gwenhywfar 5.12.0
configmgr.c File Reference
#include "configmgr_p.h"
#include <gwenhywfar/gwenhywfar.h>
#include <gwenhywfar/misc.h>
#include <gwenhywfar/url.h>
#include <gwenhywfar/debug.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include <errno.h>
#include <ctype.h>
Include dependency graph for configmgr.c:

Go to the source code of this file.

Macros

#define DISABLE_DEBUGLOG

Functions

int GWEN_ConfigMgr_DeleteGroup (GWEN_CONFIGMGR *mgr, const char *groupName, const char *subGroupName)
GWEN_CONFIGMGRGWEN_ConfigMgr_Factory (const char *url)
void GWEN_ConfigMgr_free (GWEN_CONFIGMGR *mgr)
int GWEN_ConfigMgr_GetGroup (GWEN_CONFIGMGR *mgr, const char *groupName, const char *subGroupName, GWEN_DB_NODE **pDb)
int GWEN_ConfigMgr_GetUniqueId (GWEN_CONFIGMGR *mgr, const char *groupName, char *buffer, uint32_t bufferLen)
int GWEN_ConfigMgr_HasGroup (GWEN_CONFIGMGR *mgr, const char *groupName, const char *subGroupName)
int GWEN_ConfigMgr_ListGroups (GWEN_CONFIGMGR *mgr, GWEN_STRINGLIST *sl)
int GWEN_ConfigMgr_ListSubGroups (GWEN_CONFIGMGR *mgr, const char *groupName, GWEN_STRINGLIST *sl)
int GWEN_ConfigMgr_LockGroup (GWEN_CONFIGMGR *mgr, const char *groupName, const char *subGroupName)
int GWEN_ConfigMgr_MkUniqueIdFromId (GWEN_CONFIGMGR *mgr, const char *groupName, uint32_t uid, int doCheck, char *buffer, uint32_t bufferLen)
int GWEN_ConfigMgr_ModuleFini (void)
int GWEN_ConfigMgr_ModuleInit (void)
GWEN_CONFIGMGRGWEN_ConfigMgr_new (const char *url)
GWEN_CONFIGMGRGWEN_ConfigMgr_Plugin_Factory (GWEN_PLUGIN *pl, const char *url)
void GWENHYWFAR_CB GWEN_ConfigMgr_Plugin_FreeData (GWEN_UNUSED void *bp, void *p)
GWEN_PLUGINGWEN_ConfigMgr_Plugin_new (GWEN_PLUGIN_MANAGER *pm, const char *name, const char *fileName)
void GWEN_ConfigMgr_Plugin_SetFactoryFn (GWEN_PLUGIN *pl, GWEN_CONFIGMGR_PLUGIN_FACTORYFN f)
GWEN_CONFIGMGR_DELETEGROUP_FN GWEN_ConfigMgr_SetDeleteGroupFn (GWEN_CONFIGMGR *mgr, GWEN_CONFIGMGR_DELETEGROUP_FN f)
GWEN_CONFIGMGR_GETGROUP_FN GWEN_ConfigMgr_SetGetGroupFn (GWEN_CONFIGMGR *mgr, GWEN_CONFIGMGR_GETGROUP_FN f)
GWEN_CONFIGMGR_GETUNIQUEID_FN GWEN_ConfigMgr_SetGetUniqueIdFn (GWEN_CONFIGMGR *mgr, GWEN_CONFIGMGR_GETUNIQUEID_FN f)
int GWEN_ConfigMgr_SetGroup (GWEN_CONFIGMGR *mgr, const char *groupName, const char *subGroupName, GWEN_DB_NODE *db)
GWEN_CONFIGMGR_HASGROUP_FN GWEN_ConfigMgr_SetHasGroupFn (GWEN_CONFIGMGR *mgr, GWEN_CONFIGMGR_HASGROUP_FN f)
GWEN_CONFIGMGR_LISTGROUPS_FN GWEN_ConfigMgr_SetListGroupsFn (GWEN_CONFIGMGR *mgr, GWEN_CONFIGMGR_LISTGROUPS_FN f)
GWEN_CONFIGMGR_LISTSUBGROUPS_FN GWEN_ConfigMgr_SetListSubGroupsFn (GWEN_CONFIGMGR *mgr, GWEN_CONFIGMGR_LISTSUBGROUPS_FN f)
GWEN_CONFIGMGR_LOCKGROUP_FN GWEN_ConfigMgr_SetLockGroupFn (GWEN_CONFIGMGR *mgr, GWEN_CONFIGMGR_LOCKGROUP_FN f)
GWEN_CONFIGMGR_MKUNIQUEIDFROMID_FN GWEN_ConfigMgr_SetMkUniqueIdFromIdFn (GWEN_CONFIGMGR *mgr, GWEN_CONFIGMGR_MKUNIQUEIDFROMID_FN f)
GWEN_CONFIGMGR_SETGROUP_FN GWEN_ConfigMgr_SetSetGroupFn (GWEN_CONFIGMGR *mgr, GWEN_CONFIGMGR_SETGROUP_FN f)
GWEN_CONFIGMGR_UNLOCKGROUP_FN GWEN_ConfigMgr_SetUnlockGroupFn (GWEN_CONFIGMGR *mgr, GWEN_CONFIGMGR_UNLOCKGROUP_FN f)
int GWEN_ConfigMgr_UnlockGroup (GWEN_CONFIGMGR *mgr, const char *groupName, const char *subGroupName)

Macro Definition Documentation

◆ DISABLE_DEBUGLOG

#define DISABLE_DEBUGLOG

Definition at line 30 of file configmgr.c.

Function Documentation

◆ GWEN_ConfigMgr_DeleteGroup()

int GWEN_ConfigMgr_DeleteGroup ( GWEN_CONFIGMGR * mgr,
const char * groupName,
const char * subGroupName )

Definition at line 384 of file configmgr.c.

References GWEN_ERROR_NOT_IMPLEMENTED.

◆ GWEN_ConfigMgr_Factory()

GWEN_CONFIGMGR * GWEN_ConfigMgr_Factory ( const char * url)

Creates a GWEN_CONFIGMGR object. The given URL is inspected for the protocol part which is used to lookup the plugin responsible. A generic file based configuration manager might have the URL "dir://home/martin/testconfig" which means that all files of the configuration manager reside below the folder "/home/martin/testconfig". Other plugins might have another URL scheme, however, the protocol part always specifies the plugin (in this case "dir").

Definition at line 483 of file configmgr.c.

References DBG_ERROR, DBG_INFO, GWEN_ConfigMgr_Plugin_Factory(), GWEN_CONFIGMGR_PLUGIN_NAME, GWEN_LOGDOMAIN, GWEN_PluginManager_FindPluginManager(), GWEN_PluginManager_GetPlugin(), GWEN_Url_free(), GWEN_Url_fromString(), GWEN_Url_GetProtocol(), and NULL.

Here is the call graph for this function:

◆ GWEN_ConfigMgr_free()

void GWEN_ConfigMgr_free ( GWEN_CONFIGMGR * mgr)

Definition at line 135 of file configmgr.c.

References GWEN_FREE_OBJECT, and GWEN_INHERIT_FINI.

Referenced by GWEN_ConfigMgrDir_new().

Here is the caller graph for this function:

◆ GWEN_ConfigMgr_GetGroup()

int GWEN_ConfigMgr_GetGroup ( GWEN_CONFIGMGR * mgr,
const char * groupName,
const char * subGroupName,
GWEN_DB_NODE ** pDb )

Definition at line 287 of file configmgr.c.

References GWEN_ERROR_NOT_IMPLEMENTED.

◆ GWEN_ConfigMgr_GetUniqueId()

int GWEN_ConfigMgr_GetUniqueId ( GWEN_CONFIGMGR * mgr,
const char * groupName,
char * buffer,
uint32_t bufferLen )

Definition at line 354 of file configmgr.c.

References GWEN_ERROR_NOT_IMPLEMENTED.

◆ GWEN_ConfigMgr_HasGroup()

int GWEN_ConfigMgr_HasGroup ( GWEN_CONFIGMGR * mgr,
const char * groupName,
const char * subGroupName )

Definition at line 315 of file configmgr.c.

References GWEN_ERROR_NOT_IMPLEMENTED.

◆ GWEN_ConfigMgr_ListGroups()

int GWEN_ConfigMgr_ListGroups ( GWEN_CONFIGMGR * mgr,
GWEN_STRINGLIST * sl )

Definition at line 397 of file configmgr.c.

References GWEN_ERROR_NOT_IMPLEMENTED.

◆ GWEN_ConfigMgr_ListSubGroups()

int GWEN_ConfigMgr_ListSubGroups ( GWEN_CONFIGMGR * mgr,
const char * groupName,
GWEN_STRINGLIST * sl )

Definition at line 408 of file configmgr.c.

References GWEN_ERROR_NOT_IMPLEMENTED.

◆ GWEN_ConfigMgr_LockGroup()

int GWEN_ConfigMgr_LockGroup ( GWEN_CONFIGMGR * mgr,
const char * groupName,
const char * subGroupName )

Definition at line 328 of file configmgr.c.

References GWEN_ERROR_NOT_IMPLEMENTED.

◆ GWEN_ConfigMgr_MkUniqueIdFromId()

int GWEN_ConfigMgr_MkUniqueIdFromId ( GWEN_CONFIGMGR * mgr,
const char * groupName,
uint32_t uid,
int doCheck,
char * buffer,
uint32_t bufferLen )

Create an id which is unique inside the given group derived from the given id.

Returns
0 if okay, error code otherwise
Parameters
mgrpointer to config mgr object
groupNamename of the group within the id is unique
doCheckif !=0 the derived unique id MUST NOT exist
bufferbuffer to receive the generated unique id
bufferLensize of the buffer pointed to by "buffer" above

Definition at line 368 of file configmgr.c.

References GWEN_ERROR_NOT_IMPLEMENTED.

◆ GWEN_ConfigMgr_ModuleFini()

int GWEN_ConfigMgr_ModuleFini ( void )

Definition at line 96 of file configmgr.c.

References DBG_ERROR, GWEN_CONFIGMGR_PLUGIN_NAME, GWEN_LOGDOMAIN, GWEN_PluginManager_FindPluginManager(), GWEN_PluginManager_free(), and GWEN_PluginManager_Unregister().

Referenced by GWEN_Fini().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_ConfigMgr_ModuleInit()

◆ GWEN_ConfigMgr_new()

GWEN_CONFIGMGR * GWEN_ConfigMgr_new ( const char * url)

Definition at line 120 of file configmgr.c.

References GWEN_INHERIT_INIT, and GWEN_NEW_OBJECT.

Referenced by GWEN_ConfigMgrDir_new().

Here is the caller graph for this function:

◆ GWEN_ConfigMgr_Plugin_Factory()

GWEN_CONFIGMGR * GWEN_ConfigMgr_Plugin_Factory ( GWEN_PLUGIN * pl,
const char * url )

Definition at line 468 of file configmgr.c.

References GWEN_INHERIT_GETDATA.

Referenced by GWEN_ConfigMgr_Factory().

Here is the caller graph for this function:

◆ GWEN_ConfigMgr_Plugin_FreeData()

void GWENHYWFAR_CB GWEN_ConfigMgr_Plugin_FreeData ( GWEN_UNUSED void * bp,
void * p )

Definition at line 444 of file configmgr.c.

References GWEN_FREE_OBJECT, GWEN_UNUSED, and GWENHYWFAR_CB.

Referenced by GWEN_ConfigMgr_Plugin_new().

Here is the caller graph for this function:

◆ GWEN_ConfigMgr_Plugin_new()

GWEN_PLUGIN * GWEN_ConfigMgr_Plugin_new ( GWEN_PLUGIN_MANAGER * pm,
const char * name,
const char * fileName )

Definition at line 427 of file configmgr.c.

References GWEN_ConfigMgr_Plugin_FreeData(), GWEN_INHERIT_SETDATA, GWEN_NEW_OBJECT, and GWEN_Plugin_new().

Referenced by configmgr_dir_factory().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_ConfigMgr_Plugin_SetFactoryFn()

void GWEN_ConfigMgr_Plugin_SetFactoryFn ( GWEN_PLUGIN * pl,
GWEN_CONFIGMGR_PLUGIN_FACTORYFN f )

Definition at line 454 of file configmgr.c.

References GWEN_INHERIT_GETDATA.

Referenced by configmgr_dir_factory().

Here is the caller graph for this function:

◆ GWEN_ConfigMgr_SetDeleteGroupFn()

GWEN_CONFIGMGR_DELETEGROUP_FN GWEN_ConfigMgr_SetDeleteGroupFn ( GWEN_CONFIGMGR * mgr,
GWEN_CONFIGMGR_DELETEGROUP_FN f )

Definition at line 245 of file configmgr.c.

Referenced by GWEN_ConfigMgrDir_Factory().

Here is the caller graph for this function:

◆ GWEN_ConfigMgr_SetGetGroupFn()

GWEN_CONFIGMGR_GETGROUP_FN GWEN_ConfigMgr_SetGetGroupFn ( GWEN_CONFIGMGR * mgr,
GWEN_CONFIGMGR_GETGROUP_FN f )

Definition at line 146 of file configmgr.c.

Referenced by GWEN_ConfigMgrDir_Factory().

Here is the caller graph for this function:

◆ GWEN_ConfigMgr_SetGetUniqueIdFn()

GWEN_CONFIGMGR_GETUNIQUEID_FN GWEN_ConfigMgr_SetGetUniqueIdFn ( GWEN_CONFIGMGR * mgr,
GWEN_CONFIGMGR_GETUNIQUEID_FN f )

Definition at line 217 of file configmgr.c.

Referenced by GWEN_ConfigMgrDir_Factory().

Here is the caller graph for this function:

◆ GWEN_ConfigMgr_SetGroup()

int GWEN_ConfigMgr_SetGroup ( GWEN_CONFIGMGR * mgr,
const char * groupName,
const char * subGroupName,
GWEN_DB_NODE * db )

Definition at line 301 of file configmgr.c.

References GWEN_ERROR_NOT_IMPLEMENTED.

◆ GWEN_ConfigMgr_SetHasGroupFn()

GWEN_CONFIGMGR_HASGROUP_FN GWEN_ConfigMgr_SetHasGroupFn ( GWEN_CONFIGMGR * mgr,
GWEN_CONFIGMGR_HASGROUP_FN f )

Definition at line 174 of file configmgr.c.

Referenced by GWEN_ConfigMgrDir_Factory().

Here is the caller graph for this function:

◆ GWEN_ConfigMgr_SetListGroupsFn()

GWEN_CONFIGMGR_LISTGROUPS_FN GWEN_ConfigMgr_SetListGroupsFn ( GWEN_CONFIGMGR * mgr,
GWEN_CONFIGMGR_LISTGROUPS_FN f )

Definition at line 259 of file configmgr.c.

Referenced by GWEN_ConfigMgrDir_Factory().

Here is the caller graph for this function:

◆ GWEN_ConfigMgr_SetListSubGroupsFn()

GWEN_CONFIGMGR_LISTSUBGROUPS_FN GWEN_ConfigMgr_SetListSubGroupsFn ( GWEN_CONFIGMGR * mgr,
GWEN_CONFIGMGR_LISTSUBGROUPS_FN f )

Definition at line 273 of file configmgr.c.

Referenced by GWEN_ConfigMgrDir_Factory().

Here is the caller graph for this function:

◆ GWEN_ConfigMgr_SetLockGroupFn()

GWEN_CONFIGMGR_LOCKGROUP_FN GWEN_ConfigMgr_SetLockGroupFn ( GWEN_CONFIGMGR * mgr,
GWEN_CONFIGMGR_LOCKGROUP_FN f )

Definition at line 189 of file configmgr.c.

Referenced by GWEN_ConfigMgrDir_Factory().

Here is the caller graph for this function:

◆ GWEN_ConfigMgr_SetMkUniqueIdFromIdFn()

GWEN_CONFIGMGR_MKUNIQUEIDFROMID_FN GWEN_ConfigMgr_SetMkUniqueIdFromIdFn ( GWEN_CONFIGMGR * mgr,
GWEN_CONFIGMGR_MKUNIQUEIDFROMID_FN f )

Definition at line 231 of file configmgr.c.

Referenced by GWEN_ConfigMgrDir_Factory().

Here is the caller graph for this function:

◆ GWEN_ConfigMgr_SetSetGroupFn()

GWEN_CONFIGMGR_SETGROUP_FN GWEN_ConfigMgr_SetSetGroupFn ( GWEN_CONFIGMGR * mgr,
GWEN_CONFIGMGR_SETGROUP_FN f )

Definition at line 160 of file configmgr.c.

Referenced by GWEN_ConfigMgrDir_Factory().

Here is the caller graph for this function:

◆ GWEN_ConfigMgr_SetUnlockGroupFn()

GWEN_CONFIGMGR_UNLOCKGROUP_FN GWEN_ConfigMgr_SetUnlockGroupFn ( GWEN_CONFIGMGR * mgr,
GWEN_CONFIGMGR_UNLOCKGROUP_FN f )

Definition at line 203 of file configmgr.c.

Referenced by GWEN_ConfigMgrDir_Factory().

Here is the caller graph for this function:

◆ GWEN_ConfigMgr_UnlockGroup()

int GWEN_ConfigMgr_UnlockGroup ( GWEN_CONFIGMGR * mgr,
const char * groupName,
const char * subGroupName )

Definition at line 341 of file configmgr.c.

References GWEN_ERROR_NOT_IMPLEMENTED.