More work on aqhome-react.

This commit is contained in:
Martin Preuss
2024-03-09 01:23:06 +01:00
parent 605d78a2b7
commit a3efa18a61
28 changed files with 1661 additions and 61 deletions

View File

@@ -0,0 +1,86 @@
/****************************************************************************
* This file is part of the project AqHome.
* AqHome (c) by 2024 Martin Preuss, all rights reserved.
*
* The license for this file can be found in the file COPYING which you
* should have received along with this file.
****************************************************************************/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "./aqhome_react_p.h"
#include <gwenhywfar/misc.h>
#include <gwenhywfar/debug.h>
AQHOME_REACT *AqHomeReact_new()
{
AQHOME_REACT *aqh;
GWEN_NEW_OBJECT(AQHOME_REACT, aqh);
return aqh;
}
void AqHomeReact_free(AQHOME_REACT *aqh)
{
if (aqh) {
GWEN_MsgEndpoint_free(aqh->brokerEndpoint);
GWEN_DB_Group_free(aqh->dbArgs);
free(aqh->pidFile);
GWEN_FREE_OBJECT(aqh);
}
}
GWEN_MSG_ENDPOINT *AqHomeReact_GetBrokerEndpoint(const AQHOME_REACT *aqh)
{
return aqh?(aqh->brokerEndpoint):NULL;
}
GWEN_DB_NODE *AqHomeReact_GetDbArgs(const AQHOME_REACT *aqh)
{
return aqh?(aqh->dbArgs):NULL;
}
const char *AqHomeReact_GetPidFile(const AQHOME_REACT *aqh)
{
return aqh?aqh->pidFile:NULL;
}
void AqHomeReact_SetPidFile(AQHOME_REACT *aqh, const char *s)
{
if (aqh) {
free(aqh->pidFile);
aqh->pidFile=s?strdup(s):NULL;
}
}
int AqHomeReact_GetTimeout(const AQHOME_REACT *aqh)
{
return aqh?aqh->timeout:0;
}