msgengine.c File Reference

#include <gwenhywfar/gwenhywfarapi.h>
#include <msgengine_p.h>
#include <gwenhywfar/xml.h>
#include <gwenhywfar/text.h>
#include <gwenhywfar/misc.h>
#include <gwenhywfar/path.h>
#include <gwenhywfar/debug.h>
#include <gwenhywfar/buffer.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include <ctype.h>
Include dependency graph for msgengine.c:

Go to the source code of this file.

Defines

#define DISABLE_DEBUGLOG

Functions

const char * GWEN_MsgEngine__findInValues (GWEN_MSGENGINE *e, GWEN_XMLNODE *node, GWEN_XMLNODE *dnode, const char *name, unsigned int *datasize)
GWEN_DB_NODEGWEN_MsgEngine__GetGlobalValues (GWEN_MSGENGINE *e)
GWEN_XMLNODEGWEN_MsgEngine__GetGroup (GWEN_MSGENGINE *e, GWEN_XMLNODE *node, const char *t, int version, const char *pvalue)
int GWEN_MsgEngine__GetInline (GWEN_MSGENGINE *e, GWEN_XMLNODE *node, GWEN_BUFFER *mbuf)
int GWEN_MsgEngine__IsBinTyp (GWEN_MSGENGINE *e, const char *type)
int GWEN_MsgEngine__IsCharTyp (GWEN_MSGENGINE *e, const char *type)
int GWEN_MsgEngine__IsIntTyp (GWEN_MSGENGINE *e, const char *type)
int GWEN_MsgEngine__ListElement (GWEN_UNUSED GWEN_MSGENGINE *e, const char *path, GWEN_XMLNODE *node, GWEN_STRINGLIST *sl, GWEN_XMLNODE *listNode, uint32_t flags)
int GWEN_MsgEngine__ListGroup (GWEN_MSGENGINE *e, const char *path, GWEN_XMLNODE *node, GWEN_XMLNODE *rnode, GWEN_STRINGLIST *sl, GWEN_XMLNODE *listNode, uint32_t flags)
int GWEN_MsgEngine__ReadGroup (GWEN_MSGENGINE *e, GWEN_BUFFER *msgbuf, GWEN_XMLNODE *node, GWEN_XMLNODE *rnode, GWEN_DB_NODE *gr, const char *delimiters, uint32_t flags)
int GWEN_MsgEngine__ReadValue (GWEN_MSGENGINE *e, GWEN_BUFFER *msgbuf, GWEN_XMLNODE *node, GWEN_XMLNODE *rnode, GWEN_BUFFER *vbuf, const char *delimiters, uint32_t flags)
const char * GWEN_MsgEngine__SearchForValue (GWEN_MSGENGINE *e, GWEN_XMLNODE *node, GWEN_XMLNODE_PATH *nodePath, const char *name, unsigned int *datasize)
int GWEN_MsgEngine__ShowElement (GWEN_UNUSED GWEN_MSGENGINE *e, const char *path, GWEN_XMLNODE *node, GWEN_STRINGLIST *sl, uint32_t flags)
int GWEN_MsgEngine__ShowGroup (GWEN_MSGENGINE *e, const char *path, GWEN_XMLNODE *node, GWEN_XMLNODE *rnode, GWEN_STRINGLIST *sl, uint32_t flags)
const char * GWEN_MsgEngine__TransformValue (GWEN_MSGENGINE *e, const char *pvalue, GWEN_XMLNODE *node, GWEN_XMLNODE *dnode, unsigned int *datasize)
int GWEN_MsgEngine__WriteElement (GWEN_MSGENGINE *e, GWEN_BUFFER *gbuf, GWEN_XMLNODE *node, GWEN_XMLNODE *rnode, GWEN_DB_NODE *gr, int loopNr, int isOptional, GWEN_XMLNODE_PATH *nodePath)
int GWEN_MsgEngine__WriteGroup (GWEN_MSGENGINE *e, GWEN_BUFFER *gbuf, GWEN_XMLNODE *node, GWEN_XMLNODE *rnode, GWEN_DB_NODE *gr, int groupIsOptional, GWEN_XMLNODE_PATH *nodePath)
int GWEN_MsgEngine__WriteValue (GWEN_MSGENGINE *e, GWEN_BUFFER *gbuf, GWEN_BUFFER *data, GWEN_XMLNODE *node)
int GWEN_MsgEngine_AddDefinitions (GWEN_MSGENGINE *e, GWEN_XMLNODE *node)
int GWEN_MsgEngine_AddTrustInfo (GWEN_MSGENGINE *e, const char *data, unsigned int size, const char *description, GWEN_MSGENGINE_TRUSTLEVEL trustLevel, unsigned int pos)
void GWEN_MsgEngine_Attach (GWEN_MSGENGINE *e)
int GWEN_MsgEngine_CreateMessage (GWEN_MSGENGINE *e, const char *msgName, int msgVersion, GWEN_BUFFER *gbuf, GWEN_DB_NODE *msgData)
int GWEN_MsgEngine_CreateMessageFromNode (GWEN_MSGENGINE *e, GWEN_XMLNODE *node, GWEN_BUFFER *gbuf, GWEN_DB_NODE *msgData)
GWEN_XMLNODEGWEN_MsgEngine_FindGroupByProperty (GWEN_MSGENGINE *e, const char *pname, int version, const char *pvalue)
GWEN_XMLNODEGWEN_MsgEngine_FindNodeByProperty (GWEN_MSGENGINE *e, const char *t, const char *pname, int version, const char *pvalue)
GWEN_XMLNODEGWEN_MsgEngine_FindNodeByPropertyStrictProto (GWEN_MSGENGINE *e, const char *t, const char *pname, int version, const char *pvalue)
void GWEN_MsgEngine_free (GWEN_MSGENGINE *e)
GWEN_MSGENGINE_BINTYPEREAD_PTR GWEN_MsgEngine_GetBinTypeReadFunction (GWEN_MSGENGINE *e)
GWEN_MSGENGINE_BINTYPEWRITE_PTR GWEN_MsgEngine_GetBinTypeWriteFunction (GWEN_MSGENGINE *e)
const char * GWEN_MsgEngine_GetCharsToEscape (GWEN_MSGENGINE *e)
GWEN_XMLNODEGWEN_MsgEngine_GetDefinitions (GWEN_MSGENGINE *e)
const char * GWEN_MsgEngine_GetDelimiters (GWEN_MSGENGINE *e)
char GWEN_MsgEngine_GetEscapeChar (GWEN_MSGENGINE *e)
GWEN_MSGENGINE_GETGLOBALVALUES_PTR GWEN_MsgEngine_GetGetGlobalValuesFunction (GWEN_MSGENGINE *e)
GWEN_XMLNODEGWEN_MsgEngine_GetGroup (GWEN_MSGENGINE *e, GWEN_XMLNODE *node, const GWEN_XMLNODE_PATH *nodePath, const char *t, int version, const char *pvalue)
int GWEN_MsgEngine_GetHighestTrustLevel (GWEN_XMLNODE *node, GWEN_XMLNODE *refnode)
void * GWEN_MsgEngine_GetInheritorData (const GWEN_MSGENGINE *e)
int GWEN_MsgEngine_GetIntValue (GWEN_MSGENGINE *e, const char *path, int defValue)
const char * GWEN_MsgEngine_GetMode (GWEN_MSGENGINE *e)
unsigned int GWEN_MsgEngine_GetProtocolVersion (GWEN_MSGENGINE *e)
GWEN_MSGENGINE_TYPECHECK_PTR GWEN_MsgEngine_GetTypeCheckFunction (GWEN_MSGENGINE *e)
GWEN_MSGENGINE_TYPEREAD_PTR GWEN_MsgEngine_GetTypeReadFunction (GWEN_MSGENGINE *e)
GWEN_MSGENGINE_TYPEWRITE_PTR GWEN_MsgEngine_GetTypeWriteFunction (GWEN_MSGENGINE *e)
const char * GWEN_MsgEngine_GetValue (GWEN_MSGENGINE *e, const char *path, const char *defValue)
GWEN_XMLNODEGWEN_MsgEngine_ListMessage (GWEN_MSGENGINE *e, const char *typ, const char *msgName, int msgVersion, uint32_t flags)
GWEN_MSGENGINEGWEN_MsgEngine_new ()
int GWEN_MsgEngine_ParseMessage (GWEN_MSGENGINE *e, GWEN_XMLNODE *group, GWEN_BUFFER *msgbuf, GWEN_DB_NODE *msgData, uint32_t flags)
int GWEN_MsgEngine_ReadMessage (GWEN_MSGENGINE *e, const char *gtype, GWEN_BUFFER *mbuf, GWEN_DB_NODE *gr, uint32_t flags)
const char * GWEN_MsgEngine_SearchForProperty (GWEN_XMLNODE *node, GWEN_XMLNODE *refnode, const char *name, int topDown)
void GWEN_MsgEngine_SetBinTypeReadFunction (GWEN_MSGENGINE *e, GWEN_MSGENGINE_BINTYPEREAD_PTR p)
void GWEN_MsgEngine_SetBinTypeWriteFunction (GWEN_MSGENGINE *e, GWEN_MSGENGINE_BINTYPEWRITE_PTR p)
void GWEN_MsgEngine_SetCharsToEscape (GWEN_MSGENGINE *e, const char *c)
void GWEN_MsgEngine_SetDefinitions (GWEN_MSGENGINE *e, GWEN_XMLNODE *n, int take)
void GWEN_MsgEngine_SetDelimiters (GWEN_MSGENGINE *e, const char *s)
void GWEN_MsgEngine_SetEscapeChar (GWEN_MSGENGINE *e, char c)
void GWEN_MsgEngine_SetFreeDataFunction (GWEN_MSGENGINE *e, GWEN_MSGENGINE_FREEDATA_PTR p)
void GWEN_MsgEngine_SetGetCharValueFunction (GWEN_MSGENGINE *e, GWEN_MSGENGINE_GETCHARVALUE_PTR p)
void GWEN_MsgEngine_SetGetGlobalValuesFunction (GWEN_MSGENGINE *e, GWEN_MSGENGINE_GETGLOBALVALUES_PTR p)
void GWEN_MsgEngine_SetGetIntValueFunction (GWEN_MSGENGINE *e, GWEN_MSGENGINE_GETINTVALUE_PTR p)
void GWEN_MsgEngine_SetInheritorData (GWEN_MSGENGINE *e, void *d)
int GWEN_MsgEngine_SetIntValue (GWEN_MSGENGINE *e, const char *path, int value)
void GWEN_MsgEngine_SetMode (GWEN_MSGENGINE *e, const char *mode)
void GWEN_MsgEngine_SetProtocolVersion (GWEN_MSGENGINE *e, unsigned int p)
void GWEN_MsgEngine_SetTypeCheckFunction (GWEN_MSGENGINE *e, GWEN_MSGENGINE_TYPECHECK_PTR p)
void GWEN_MsgEngine_SetTypeReadFunction (GWEN_MSGENGINE *e, GWEN_MSGENGINE_TYPEREAD_PTR p)
void GWEN_MsgEngine_SetTypeWriteFunction (GWEN_MSGENGINE *e, GWEN_MSGENGINE_TYPEWRITE_PTR p)
int GWEN_MsgEngine_SetValue (GWEN_MSGENGINE *e, const char *path, const char *value)
int GWEN_MsgEngine_ShowMessage (GWEN_MSGENGINE *e, const char *typ, const char *msgName, int msgVersion, uint32_t flags)
int GWEN_MsgEngine_SkipSegment (GWEN_UNUSED GWEN_MSGENGINE *e, GWEN_BUFFER *msgbuf, unsigned char escapeChar, unsigned char delimiter)
GWEN_MSGENGINE_TRUSTEDDATAGWEN_MsgEngine_TakeTrustInfo (GWEN_MSGENGINE *e)
int GWEN_MsgEngine_TrustedData_AddPos (GWEN_MSGENGINE_TRUSTEDDATA *td, unsigned int pos)
int GWEN_MsgEngine_TrustedData_CreateReplacements (GWEN_MSGENGINE_TRUSTEDDATA *td)
void GWEN_MsgEngine_TrustedData_free (GWEN_MSGENGINE_TRUSTEDDATA *td)
const char * GWEN_MsgEngine_TrustedData_GetData (GWEN_MSGENGINE_TRUSTEDDATA *td)
const char * GWEN_MsgEngine_TrustedData_GetDescription (GWEN_MSGENGINE_TRUSTEDDATA *td)
int GWEN_MsgEngine_TrustedData_GetFirstPos (GWEN_MSGENGINE_TRUSTEDDATA *td)
GWEN_MSGENGINE_TRUSTEDDATAGWEN_MsgEngine_TrustedData_GetNext (GWEN_MSGENGINE_TRUSTEDDATA *td)
int GWEN_MsgEngine_TrustedData_GetNextPos (GWEN_MSGENGINE_TRUSTEDDATA *td)
const char * GWEN_MsgEngine_TrustedData_GetReplacement (GWEN_MSGENGINE_TRUSTEDDATA *td)
unsigned int GWEN_MsgEngine_TrustedData_GetSize (GWEN_MSGENGINE_TRUSTEDDATA *td)
GWEN_MSGENGINE_TRUSTLEVEL GWEN_MsgEngine_TrustedData_GetTrustLevel (GWEN_MSGENGINE_TRUSTEDDATA *td)
GWEN_MSGENGINE_TRUSTEDDATAGWEN_MsgEngine_TrustedData_new (const char *data, unsigned int size, const char *description, GWEN_MSGENGINE_TRUSTLEVEL trustLevel)

Define Documentation

#define DISABLE_DEBUGLOG

Definition at line 32 of file msgengine.c.


Function Documentation

const char* GWEN_MsgEngine__findInValues ( GWEN_MSGENGINE e,
GWEN_XMLNODE node,
GWEN_XMLNODE dnode,
const char *  name,
unsigned int *  datasize 
)
GWEN_DB_NODE* GWEN_MsgEngine__GetGlobalValues ( GWEN_MSGENGINE e  ) 
GWEN_XMLNODE* GWEN_MsgEngine__GetGroup ( GWEN_MSGENGINE e,
GWEN_XMLNODE node,
const char *  t,
int  version,
const char *  pvalue 
)
int GWEN_MsgEngine__GetInline ( GWEN_MSGENGINE e,
GWEN_XMLNODE node,
GWEN_BUFFER mbuf 
)

Definition at line 644 of file msgengine.c.

References DBG_DEBUG, DBG_INFO, GWEN_Buffer_AppendString(), GWEN_LOGDOMAIN, GWEN_MsgEngine__IsBinTyp(), GWEN_Text_FromHexBuffer(), GWEN_XMLNode_GetData(), GWEN_XMLNode_GetFirstData(), and GWEN_XMLNode_GetProperty().

Referenced by GWEN_MsgEngine__WriteElement().

Here is the call graph for this function:

Here is the caller graph for this function:

int GWEN_MsgEngine__IsBinTyp ( GWEN_MSGENGINE e,
const char *  type 
)

Definition at line 627 of file msgengine.c.

References GWEN_DB_NodeType_Unknown, and GWEN_DB_NodeType_ValueBin.

Referenced by GWEN_MsgEngine__GetInline(), GWEN_MsgEngine__ReadGroup(), GWEN_MsgEngine__TransformValue(), and GWEN_MsgEngine__WriteElement().

Here is the caller graph for this function:

int GWEN_MsgEngine__IsCharTyp ( GWEN_MSGENGINE e,
const char *  type 
)

Definition at line 590 of file msgengine.c.

References GWEN_DB_NodeType_Unknown, and GWEN_DB_NodeType_ValueChar.

Referenced by GWEN_MsgEngine__TransformValue(), and GWEN_MsgEngine__WriteElement().

Here is the caller graph for this function:

int GWEN_MsgEngine__IsIntTyp ( GWEN_MSGENGINE e,
const char *  type 
)

Definition at line 610 of file msgengine.c.

References GWEN_DB_NodeType_Unknown, and GWEN_DB_NodeType_ValueInt.

Referenced by GWEN_MsgEngine__ReadGroup(), GWEN_MsgEngine__TransformValue(), and GWEN_MsgEngine__WriteElement().

Here is the caller graph for this function:

int GWEN_MsgEngine__ListElement ( GWEN_UNUSED GWEN_MSGENGINE e,
const char *  path,
GWEN_XMLNODE node,
GWEN_STRINGLIST sl,
GWEN_XMLNODE listNode,
uint32_t  flags 
)
int GWEN_MsgEngine__ListGroup ( GWEN_MSGENGINE e,
const char *  path,
GWEN_XMLNODE node,
GWEN_XMLNODE rnode,
GWEN_STRINGLIST sl,
GWEN_XMLNODE listNode,
uint32_t  flags 
)
int GWEN_MsgEngine__ReadGroup ( GWEN_MSGENGINE e,
GWEN_BUFFER msgbuf,
GWEN_XMLNODE node,
GWEN_XMLNODE rnode,
GWEN_DB_NODE gr,
const char *  delimiters,
uint32_t  flags 
)
int GWEN_MsgEngine__ReadValue ( GWEN_MSGENGINE e,
GWEN_BUFFER msgbuf,
GWEN_XMLNODE node,
GWEN_XMLNODE rnode,
GWEN_BUFFER vbuf,
const char *  delimiters,
uint32_t  flags 
)
const char* GWEN_MsgEngine__SearchForValue ( GWEN_MSGENGINE e,
GWEN_XMLNODE node,
GWEN_XMLNODE_PATH nodePath,
const char *  name,
unsigned int *  datasize 
)

Definition at line 1345 of file msgengine.c.

References DBG_DEBUG, DBG_WARN, GWEN_LOGDOMAIN, GWEN_MsgEngine__findInValues(), GWEN_XMLNode_GetProperty(), and GWEN_XMLNode_Path_Surface().

Referenced by GWEN_MsgEngine__WriteElement().

Here is the call graph for this function:

Here is the caller graph for this function:

int GWEN_MsgEngine__ShowElement ( GWEN_UNUSED GWEN_MSGENGINE e,
const char *  path,
GWEN_XMLNODE node,
GWEN_STRINGLIST sl,
uint32_t  flags 
)

Definition at line 2131 of file msgengine.c.

References DBG_ERROR, GWEN_LOGDOMAIN, GWEN_MSGENGINE_SHOW_FLAGS_NOSET, GWEN_StringList_FirstEntry(), GWEN_StringListEntry_Data(), GWEN_StringListEntry_Next(), and GWEN_XMLNode_GetProperty().

Referenced by GWEN_MsgEngine__ShowGroup().

Here is the call graph for this function:

Here is the caller graph for this function:

int GWEN_MsgEngine__ShowGroup ( GWEN_MSGENGINE e,
const char *  path,
GWEN_XMLNODE node,
GWEN_XMLNODE rnode,
GWEN_STRINGLIST sl,
uint32_t  flags 
)
const char* GWEN_MsgEngine__TransformValue ( GWEN_MSGENGINE e,
const char *  pvalue,
GWEN_XMLNODE node,
GWEN_XMLNODE dnode,
unsigned int *  datasize 
)
int GWEN_MsgEngine__WriteElement ( GWEN_MSGENGINE e,
GWEN_BUFFER gbuf,
GWEN_XMLNODE node,
GWEN_XMLNODE rnode,
GWEN_DB_NODE gr,
int  loopNr,
int  isOptional,
GWEN_XMLNODE_PATH nodePath 
)
int GWEN_MsgEngine__WriteGroup ( GWEN_MSGENGINE e,
GWEN_BUFFER gbuf,
GWEN_XMLNODE node,
GWEN_XMLNODE rnode,
GWEN_DB_NODE gr,
int  groupIsOptional,
GWEN_XMLNODE_PATH nodePath 
)
int GWEN_MsgEngine__WriteValue ( GWEN_MSGENGINE e,
GWEN_BUFFER gbuf,
GWEN_BUFFER data,
GWEN_XMLNODE node 
)
GWEN_XMLNODE* GWEN_MsgEngine_GetGroup ( GWEN_MSGENGINE e,
GWEN_XMLNODE node,
const GWEN_XMLNODE_PATH nodePath,
const char *  t,
int  version,
const char *  pvalue 
)

Definition at line 1576 of file msgengine.c.

References DBG_DEBUG, DBG_ERROR, GWEN_LOGDOMAIN, GWEN_MsgEngine__GetGroup(), GWEN_XMLNode_GetParent(), GWEN_XMLNode_Path_dup(), GWEN_XMLNode_Path_free(), and GWEN_XMLNode_Path_Surface().

Referenced by GWEN_MsgEngine__WriteGroup().

Here is the call graph for this function:

Here is the caller graph for this function:

int GWEN_MsgEngine_GetHighestTrustLevel ( GWEN_XMLNODE node,
GWEN_XMLNODE refnode 
)

Definition at line 1313 of file msgengine.c.

References GWEN_XMLNode_GetParent(), and GWEN_XMLNode_GetProperty().

Referenced by GWEN_MsgEngine__ReadValue().

Here is the call graph for this function:

Here is the caller graph for this function:

int GWEN_MsgEngine_SkipSegment ( GWEN_UNUSED GWEN_MSGENGINE e,
GWEN_BUFFER msgbuf,
unsigned char  escapeChar,
unsigned char  delimiter 
)

Definition at line 3486 of file msgengine.c.

References DBG_ERROR, DBG_INFO, GWEN_Buffer_GetBytesLeft(), GWEN_Buffer_GetPos(), GWEN_Buffer_GetUsedBytes(), GWEN_Buffer_IncrementPos(), GWEN_Buffer_ReadByte(), and GWEN_LOGDOMAIN.

Referenced by GWEN_MsgEngine_ReadMessage().

Here is the call graph for this function:

Here is the caller graph for this function:

Generated on Mon Jul 5 22:56:51 2010 for gwenhywfar by  doxygen 1.6.3