gwenhywfar 5.12.0
request.h
Go to the documentation of this file.
1/****************************************************************************
2 * This file is part of the project Gwenhywfar.
3 * Gwenhywfar (c) by 2024 Martin Preuss, all rights reserved.
4 *
5 * The license for this file can be found in the file COPYING which you
6 * should have received along with this file.
7 ****************************************************************************/
8
9#ifndef GWEN_MSG_REQUEST_H
10#define GWEN_MSG_REQUEST_H
11
12
14#include <gwenhywfar/msg.h>
15#include <gwenhywfar/endpoint.h>
16#include <gwenhywfar/inherit.h>
17#include <gwenhywfar/tree2.h>
19
20
21#define GWEN_MSG_REQUEST_RESULT_NOT_HANDLED 0
22#define GWEN_MSG_REQUEST_RESULT_HANDLED 1
23
24#define GWEN_MSG_REQUEST_REASON_DONE 0
25#define GWEN_MSG_REQUEST_REASON_ABORTED 1
26#define GWEN_MSG_REQUEST_REASON_TIMEOUT 2
27#define GWEN_MSG_REQUEST_REASON_DISCONNECT 3
28
29#define GWEN_MSG_REQUEST_STATE_OPEN 0
30#define GWEN_MSG_REQUEST_STATE_DONE 1
31
32
33
35
38
41typedef void (*GWEN_MSG_REQUEST_ABORT_FN)(GWEN_MSG_REQUEST *rq, int reason);
42
43
46
49
52
55
58
62
65
68
70
73
76
77
80 uint32_t refMsgId);
81
82
86
87
88
91
94
98
99
100
101#endif
102
103
struct GWEN_MSG_ENDPOINT GWEN_MSG_ENDPOINT
Object which can send and receive messages (base class).
Definition endpoint.h:37
#define GWENHYWFAR_API
#define GWEN_INHERIT_FUNCTION_LIB_DEFS(t, decl)
Definition inherit.h:125
struct GWEN_MSG GWEN_MSG
Definition msg.h:24
GWENHYWFAR_API GWEN_MSG_REQUEST_ABORT_FN GWEN_MsgRequest_SetAbortFn(GWEN_MSG_REQUEST *rq, GWEN_MSG_REQUEST_ABORT_FN f)
GWENHYWFAR_API int GWEN_MsgRequest_GetRequestType(const GWEN_MSG_REQUEST *rq)
GWENHYWFAR_API void GWEN_MsgRequest_SetState(GWEN_MSG_REQUEST *rq, int i)
void(* GWEN_MSG_REQUEST_SUBREQUESTFINISHED_FN)(GWEN_MSG_REQUEST *rq, GWEN_MSG_REQUEST *subRq, int reason)
Definition request.h:40
GWENHYWFAR_API void * GWEN_MsgRequest_GetPrivateData(const GWEN_MSG_REQUEST *rq)
GWENHYWFAR_API GWEN_MSG_ENDPOINT * GWEN_MsgRequest_GetEndpoint(const GWEN_MSG_REQUEST *rq)
GWENHYWFAR_API void GWEN_MsgRequest_SetTimestamps(GWEN_MSG_REQUEST *rq, int expiresInSecs)
GWENHYWFAR_API GWEN_MSG_REQUEST_HANDLERESPONSE_FN GWEN_MsgRequest_SetHandleResponseFn(GWEN_MSG_REQUEST *rq, GWEN_MSG_REQUEST_HANDLERESPONSE_FN fn)
GWENHYWFAR_API void GWEN_MsgRequest_SetPrivateData(GWEN_MSG_REQUEST *rq, void *p)
GWENHYWFAR_API void GWEN_MsgRequest_SetRequestMsgId(GWEN_MSG_REQUEST *rq, uint32_t id)
GWENHYWFAR_API void GWEN_MsgRequest_SetRequestMsg(GWEN_MSG_REQUEST *rq, GWEN_MSG *msg)
GWENHYWFAR_API GWEN_MSG * GWEN_MsgRequest_GetFirstMsgFromList(const GWEN_MSG_REQUEST *rq)
GWENHYWFAR_API const GWEN_TIMESTAMP * GWEN_MsgRequest_GetCreatedAt(const GWEN_MSG_REQUEST *rq)
GWENHYWFAR_API GWEN_MSG_LIST * GWEN_MsgRequest_GetMsgList(const GWEN_MSG_REQUEST *rq)
int(* GWEN_MSG_REQUEST_HANDLERESPONSE_FN)(GWEN_MSG_REQUEST *rq, GWEN_MSG *msg)
Definition request.h:39
GWENHYWFAR_API void GWEN_MsgRequest_SetEndpoint(GWEN_MSG_REQUEST *rq, GWEN_MSG_ENDPOINT *ep)
GWENHYWFAR_API void GWEN_MsgRequest_SetCreatedAt(GWEN_MSG_REQUEST *rq, GWEN_TIMESTAMP *ts)
GWENHYWFAR_API GWEN_MSG_REQUEST * GWEN_MsgRequest_new()
GWENHYWFAR_API int GWEN_MsgRequest_GetResult(const GWEN_MSG_REQUEST *rq)
GWENHYWFAR_API void GWEN_MsgRequest_SubRequestFinished(GWEN_MSG_REQUEST *rq, GWEN_MSG_REQUEST *subRq, int reason)
GWENHYWFAR_API GWEN_MSG * GWEN_MsgRequest_GetRequestMsg(const GWEN_MSG_REQUEST *rq)
GWENHYWFAR_API void GWEN_MsgRequest_SetRequestType(GWEN_MSG_REQUEST *rq, int t)
GWENHYWFAR_API void GWEN_MsgRequest_Abort(GWEN_MSG_REQUEST *rq, int reason)
GWENHYWFAR_API void GWEN_MsgRequest_free(GWEN_MSG_REQUEST *rq)
GWENHYWFAR_API GWEN_MSG_REQUEST * GWEN_MsgRequest_Tree2_FindByEndpointAndMsgId(GWEN_MSG_REQUEST *rootRq, GWEN_MSG_ENDPOINT *ep, uint32_t refMsgId)
GWENHYWFAR_API void GWEN_MsgRequest_AddMsgToList(GWEN_MSG_REQUEST *rq, GWEN_MSG *msg)
GWENHYWFAR_API int GWEN_MsgRequest_GetState(const GWEN_MSG_REQUEST *rq)
GWENHYWFAR_API uint32_t GWEN_MsgRequest_GetRequestMsgId(const GWEN_MSG_REQUEST *rq)
GWENHYWFAR_API GWEN_MSG_REQUEST_SUBREQUESTFINISHED_FN GWEN_MsgRequest_SetSubRequestFinishedFn(GWEN_MSG_REQUEST *rq, GWEN_MSG_REQUEST_SUBREQUESTFINISHED_FN f)
GWENHYWFAR_API void GWEN_MsgRequest_SetResult(GWEN_MSG_REQUEST *rq, int result)
GWENHYWFAR_API int GWEN_MsgRequest_HandleResponse(GWEN_MSG_REQUEST *rq, GWEN_MSG *msg)
GWENHYWFAR_API void GWEN_MsgRequest_SetExpiresAt(GWEN_MSG_REQUEST *rq, GWEN_TIMESTAMP *ts)
GWENHYWFAR_API const GWEN_TIMESTAMP * GWEN_MsgRequest_GetExpiresAt(const GWEN_MSG_REQUEST *rq)
struct GWEN_MSG_REQUEST GWEN_MSG_REQUEST
Definition request.h:34
void(* GWEN_MSG_REQUEST_ABORT_FN)(GWEN_MSG_REQUEST *rq, int reason)
Definition request.h:41
struct GWEN_TIMESTAMP GWEN_TIMESTAMP
Definition timestamp.h:36
#define GWEN_TREE2_FUNCTION_LIB_DEFS(t, pr, decl)
Definition tree2.h:336