Improved mqttlog daemaon: persistent registered devices.
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#include <gwenhywfar/pathmanager.h>
|
||||
#include <gwenhywfar/debug.h>
|
||||
#include <gwenhywfar/i18n.h>
|
||||
#include <gwenhywfar/stringlist.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -39,6 +40,7 @@ static void _finiPathManager(void);
|
||||
static void _initI18n(void);
|
||||
static void _definePath(const char *pathName, const char *pathValue);
|
||||
static GWEN_STRINGLIST *_getListOfMatchingFiles(const char *pathName, const char *subFolder, const char *mask);
|
||||
static GWEN_BUFFER *_getRuntimeFilePath(const char *pathName, const char *sFilename);
|
||||
|
||||
|
||||
|
||||
@@ -106,6 +108,13 @@ GWEN_STRINGLIST *AQH_GetListOfMatchingSysconfFiles(const char *subFolder, const
|
||||
|
||||
|
||||
|
||||
GWEN_BUFFER *AQH_GetRuntimeFilePath(const char *sFilename)
|
||||
{
|
||||
return _getRuntimeFilePath(AQHOME_PM_RTDATADIR, sFilename);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
GWEN_DB_NODE *AQH_LoadConfigFile(void)
|
||||
{
|
||||
@@ -263,3 +272,37 @@ GWEN_STRINGLIST *_getListOfMatchingFiles(const char *pathName, const char *subFo
|
||||
|
||||
|
||||
|
||||
GWEN_BUFFER *_getRuntimeFilePath(const char *pathName, const char *sFilename)
|
||||
{
|
||||
GWEN_STRINGLIST *sl;
|
||||
|
||||
sl=GWEN_PathManager_GetPaths(AQHOME_PM_LIBNAME, pathName);
|
||||
if (sl) {
|
||||
GWEN_STRINGLISTENTRY *se;
|
||||
|
||||
se=GWEN_StringList_FirstEntry(sl);
|
||||
if (se) {
|
||||
const char *s;
|
||||
|
||||
s=GWEN_StringListEntry_Data(se);
|
||||
if (s && *s) {
|
||||
GWEN_BUFFER *buf;
|
||||
|
||||
buf=GWEN_Buffer_new(0, 256, 0, 1);
|
||||
GWEN_Buffer_AppendString(buf, s);
|
||||
if (sFilename && *sFilename) {
|
||||
GWEN_Buffer_AppendByte(buf, GWEN_DIR_SEPARATOR);
|
||||
GWEN_Buffer_AppendString(buf, sFilename);
|
||||
}
|
||||
GWEN_StringList_free(sl);
|
||||
return buf;
|
||||
}
|
||||
}
|
||||
GWEN_StringList_free(sl);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include <gwenhywfar/stringlist.h>
|
||||
#include <gwenhywfar/db.h>
|
||||
#include <gwenhywfar/buffer.h>
|
||||
|
||||
|
||||
|
||||
@@ -27,6 +28,8 @@ AQHOME_API GWEN_STRINGLIST *AQH_GetListOfMatchingDataFiles(const char *subFolder
|
||||
AQHOME_API GWEN_STRINGLIST *AQH_GetListOfMatchingRuntimeDataFiles(const char *subFolder, const char *mask);
|
||||
AQHOME_API GWEN_STRINGLIST *AQH_GetListOfMatchingSysconfFiles(const char *subFolder, const char *mask);
|
||||
|
||||
AQHOME_API GWEN_BUFFER *AQH_GetRuntimeFilePath(const char *sFilename);
|
||||
|
||||
AQHOME_API GWEN_STRINGLIST *AQH_GetGlobalDataDirs(void);
|
||||
AQHOME_API GWEN_STRINGLIST *AQH_GetGlobalSysconfDirs(void);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user