gwenhywfar  5.11.1beta
msg.h
Go to the documentation of this file.
1 /****************************************************************************
2  * This file is part of the project Gwenhywfar.
3  * Gwenhywfar (c) by 2023 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 
10 #ifndef GWEN_MSG_MSG_H
11 #define GWEN_MSG_MSG_H
12 
13 
14 #include <gwenhywfar/list.h>
15 #include <gwenhywfar/inherit.h>
16 #include <gwenhywfar/buffer.h>
17 #include <gwenhywfar/db.h>
18 
19 
20 
21 #define GWEN_MSG_FLAGS_PAYLOADINFO_SET 0x80000000u
22 
23 
24 
25 typedef struct GWEN_MSG GWEN_MSG;
28 
29 
30 
31 GWENHYWFAR_API GWEN_MSG *GWEN_Msg_new(uint32_t bufferSize);
32 GWENHYWFAR_API GWEN_MSG *GWEN_Msg_fromBytes(const uint8_t *ptr, uint32_t len);
33 
37 
40 
43 GWENHYWFAR_API const uint8_t *GWEN_Msg_GetConstBuffer(const GWEN_MSG *msg);
48 GWENHYWFAR_API int GWEN_Msg_AddBytes(GWEN_MSG *msg, const uint8_t *bufferPtr, uint32_t bufferLen);
53 
54 
62 
65 
68 
73 GWENHYWFAR_API void GWEN_Msg_SetFlags(GWEN_MSG *msg, uint32_t f);
74 GWENHYWFAR_API void GWEN_Msg_AddFlags(GWEN_MSG *msg, uint32_t f);
75 GWENHYWFAR_API void GWEN_Msg_DelFlags(GWEN_MSG *msg, uint32_t f);
76 
77 
78 GWENHYWFAR_API uint64_t GWEN_Msg_GetUint64At(const GWEN_MSG *msg, int offs, uint64_t defaultValue);
79 GWENHYWFAR_API uint32_t GWEN_Msg_GetUint32At(const GWEN_MSG *msg, int offs, uint32_t defaultValue);
80 GWENHYWFAR_API uint16_t GWEN_Msg_GetUint16At(const GWEN_MSG *msg, int offs, uint16_t defaultValue);
81 GWENHYWFAR_API uint8_t GWEN_Msg_GetUint8At(const GWEN_MSG *msg, int offs, uint8_t defaultValue);
82 
83 
85 
86 
87 #endif
88 
89 
struct GWEN_DB_NODE GWEN_DB_NODE
Definition: db.h:228
struct GWEN_BUFFER GWEN_BUFFER
A dynamically resizeable text buffer.
Definition: buffer.h:38
#define GWENHYWFAR_API
Definition: gwenhywfarapi.h:67
#define GWEN_INHERIT_FUNCTION_LIB_DEFS(t, decl)
Definition: inherit.h:125
#define GWEN_LIST_FUNCTION_LIB_DEFS(t, pr, decl)
Definition: list1.h:348
GWENHYWFAR_API void GWEN_Msg_SetBytesInBuffer(GWEN_MSG *msg, uint32_t i)
GWENHYWFAR_API uint8_t * GWEN_Msg_GetBuffer(GWEN_MSG *msg)
GWENHYWFAR_API int GWEN_Msg_RewindCurrentPos(GWEN_MSG *msg)
GWENHYWFAR_API int GWEN_Msg_AddBytes(GWEN_MSG *msg, const uint8_t *bufferPtr, uint32_t bufferLen)
GWENHYWFAR_API int GWEN_Msg_ReadNextByte(GWEN_MSG *msg)
GWENHYWFAR_API uint32_t GWEN_Msg_GetCurrentPos(const GWEN_MSG *msg)
GWENHYWFAR_API int GWEN_Msg_IncCurrentPos(GWEN_MSG *msg, uint32_t i)
GWENHYWFAR_API uint64_t GWEN_Msg_GetUint64At(const GWEN_MSG *msg, int offs, uint64_t defaultValue)
GWENHYWFAR_API uint32_t GWEN_Msg_GetParsedPayloadSize(const GWEN_MSG *msg)
GWENHYWFAR_API void GWEN_Msg_SetDbParsedInfo(GWEN_MSG *msg, GWEN_DB_NODE *db)
GWENHYWFAR_API uint16_t GWEN_Msg_GetUint16At(const GWEN_MSG *msg, int offs, uint16_t defaultValue)
GWENHYWFAR_API void GWEN_Msg_Dump(const GWEN_MSG *msg, GWEN_BUFFER *buf)
GWENHYWFAR_API uint32_t GWEN_Msg_GetFlags(const GWEN_MSG *msg)
GWENHYWFAR_API GWEN_MSG * GWEN_Msg_dup(const GWEN_MSG *srcMsg)
GWENHYWFAR_API int GWEN_Msg_AddByte(GWEN_MSG *msg, uint8_t b)
GWENHYWFAR_API uint32_t GWEN_Msg_GetMaxSize(const GWEN_MSG *msg)
GWENHYWFAR_API GWEN_MSG * GWEN_Msg_fromBytes(const uint8_t *ptr, uint32_t len)
GWENHYWFAR_API GWEN_DB_NODE * GWEN_Msg_GetDbParsedInfo(const GWEN_MSG *msg)
GWENHYWFAR_API int GWEN_Msg_GetGroupId(const GWEN_MSG *msg)
GWENHYWFAR_API uint8_t GWEN_Msg_GetUint8At(const GWEN_MSG *msg, int offs, uint8_t defaultValue)
GWENHYWFAR_API uint32_t GWEN_Msg_GetParsedPayloadOffset(const GWEN_MSG *msg)
GWENHYWFAR_API GWEN_MSG * GWEN_Msg_new(uint32_t bufferSize)
GWENHYWFAR_API const uint8_t * GWEN_Msg_GetConstBuffer(const GWEN_MSG *msg)
GWENHYWFAR_API uint32_t GWEN_Msg_GetUint32At(const GWEN_MSG *msg, int offs, uint32_t defaultValue)
GWENHYWFAR_API void GWEN_Msg_SetGroupId(GWEN_MSG *msg, int groupId)
GWENHYWFAR_API void GWEN_Msg_DelFlags(GWEN_MSG *msg, uint32_t f)
struct GWEN_MSG GWEN_MSG
Definition: msg.h:25
GWENHYWFAR_API int GWEN_Msg_GetRemainingBytes(const GWEN_MSG *msg)
GWENHYWFAR_API void GWEN_Msg_free(GWEN_MSG *msg)
GWENHYWFAR_API void GWEN_Msg_AddFlags(GWEN_MSG *msg, uint32_t f)
GWENHYWFAR_API void GWEN_Msg_Attach(GWEN_MSG *msg)
GWENHYWFAR_API void GWEN_Msg_SetParsedPayloadOffset(GWEN_MSG *msg, uint32_t v)
GWENHYWFAR_API uint32_t GWEN_Msg_GetBytesInBuffer(const GWEN_MSG *msg)
GWENHYWFAR_API void GWEN_Msg_SetFlags(GWEN_MSG *msg, uint32_t f)
GWENHYWFAR_API void GWEN_Msg_SetParsedPayloadSize(GWEN_MSG *msg, uint32_t v)