49 lines
1.5 KiB
C
49 lines
1.5 KiB
C
/****************************************************************************
|
|
* This file is part of the project AqHome.
|
|
* AqHome (c) by 2023 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.
|
|
****************************************************************************/
|
|
|
|
#ifndef AQHOME_URLHANDLER_H
|
|
#define AQHOME_URLHANDLER_H
|
|
|
|
#include <aqhome/api.h>
|
|
|
|
#include "aqhome/http/content.h"
|
|
|
|
#include <gwenhywfar/inherit.h>
|
|
#include <gwenhywfar/stringlist.h>
|
|
#include <gwenhywfar/endpoint.h>
|
|
#include <gwenhywfar/msg.h>
|
|
|
|
|
|
|
|
typedef struct AQH_URLHANDLER AQH_URLHANDLER;
|
|
GWEN_INHERIT_FUNCTION_LIB_DEFS(AQH_URLHANDLER, AQHOME_API)
|
|
GWEN_LIST_FUNCTION_LIB_DEFS(AQH_URLHANDLER, AQH_UrlHandler, AQHOME_API)
|
|
|
|
|
|
|
|
typedef GWEN_MSG*(*AQH_URLHANDLER_HANDLE_FN)(AQH_URLHANDLER *uh, GWEN_MSG_ENDPOINT *ep, const GWEN_MSG *msgReceived);
|
|
|
|
|
|
AQHOME_API AQH_URLHANDLER *AQH_UrlHandler_new(void);
|
|
AQHOME_API void AQH_UrlHandler_free(AQH_URLHANDLER *uh);
|
|
|
|
AQHOME_API AQH_HTTP_CONTENT *AQH_UrlHandler_GetContentProvider(const AQH_URLHANDLER *uh);
|
|
AQHOME_API void AQH_UrlHandler_SetContentProvider(AQH_URLHANDLER *uh, AQH_HTTP_CONTENT *cp);
|
|
|
|
AQHOME_API void AQH_UrlHandler_AddUrlPattern(AQH_URLHANDLER *uh, const char *s);
|
|
AQHOME_API int AQH_UrlHandler_UrlMatches(const AQH_URLHANDLER *uh, const char *s);
|
|
|
|
AQHOME_API GWEN_MSG *AQH_UrlHandler_HandleMessage(AQH_URLHANDLER *uh, GWEN_MSG_ENDPOINT *ep, const GWEN_MSG *msgReceived);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|