gwenhywfar 5.10.1
Functions
xmlctx.c File Reference
#include "xmlctx_p.h"
#include "gwenhywfar/debug.h"
#include "gwenhywfar/misc.h"
#include "gwenhywfar/text.h"
#include "gwenhywfar/path.h"
#include "i18n_l.h"
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include <ctype.h>
Include dependency graph for xmlctx.c:

Go to the source code of this file.

Functions

static GWEN_XMLNODE_findTagForClosingTagAndcloseAndMoveSubTags (GWEN_XML_CONTEXT *ctx, GWEN_XMLNODE *currNode, const char *tagName)
 
static void _moveSubTagsUpOneLevel (GWEN_XMLNODE *currNode)
 
int GWEN_XmlCtx_AddAttr (GWEN_XML_CONTEXT *ctx, const char *attrName, const char *attrData)
 
int GWEN_XmlCtx_AddComment (GWEN_XML_CONTEXT *ctx, const char *data)
 
int GWEN_XmlCtx_AddData (GWEN_XML_CONTEXT *ctx, const char *data)
 
void GWEN_XmlCtx_Attach (GWEN_XML_CONTEXT *ctx)
 
int GWEN_XmlCtx_DecDepth (GWEN_XML_CONTEXT *ctx)
 
int GWEN_XmlCtx_EndTag (GWEN_XML_CONTEXT *ctx, int closing)
 
void GWEN_XmlCtx_free (GWEN_XML_CONTEXT *ctx)
 
GWEN_XMLNODEGWEN_XmlCtx_GetCurrentHeader (const GWEN_XML_CONTEXT *ctx)
 
GWEN_XMLNODEGWEN_XmlCtx_GetCurrentNode (const GWEN_XML_CONTEXT *ctx)
 
int GWEN_XmlCtx_GetDepth (const GWEN_XML_CONTEXT *ctx)
 
const char * GWEN_XmlCtx_GetEncoding (const GWEN_XML_CONTEXT *ctx)
 
uint32_t GWEN_XmlCtx_GetFinishedElement (const GWEN_XML_CONTEXT *ctx)
 
uint32_t GWEN_XmlCtx_GetFlags (const GWEN_XML_CONTEXT *ctx)
 
void GWEN_XmlCtx_IncDepth (GWEN_XML_CONTEXT *ctx)
 
void GWEN_XmlCtx_IncFinishedElement (GWEN_XML_CONTEXT *ctx)
 
GWEN_XML_CONTEXTGWEN_XmlCtx_new (uint32_t flags)
 
void GWEN_XmlCtx_ResetFinishedElement (GWEN_XML_CONTEXT *ctx)
 
GWEN_XMLCTX_ADDATTR_FN GWEN_XmlCtx_SetAddAttrFn (GWEN_XML_CONTEXT *ctx, GWEN_XMLCTX_ADDATTR_FN f)
 
GWEN_XMLCTX_ADDCOMMENT_FN GWEN_XmlCtx_SetAddCommentFn (GWEN_XML_CONTEXT *ctx, GWEN_XMLCTX_ADDCOMMENT_FN f)
 
GWEN_XMLCTX_ADDDATA_FN GWEN_XmlCtx_SetAddDataFn (GWEN_XML_CONTEXT *ctx, GWEN_XMLCTX_ADDDATA_FN f)
 
void GWEN_XmlCtx_SetCurrentHeader (GWEN_XML_CONTEXT *ctx, GWEN_XMLNODE *n)
 
void GWEN_XmlCtx_SetCurrentNode (GWEN_XML_CONTEXT *ctx, GWEN_XMLNODE *n)
 
void GWEN_XmlCtx_SetDepth (GWEN_XML_CONTEXT *ctx, int i)
 
void GWEN_XmlCtx_SetEncoding (GWEN_XML_CONTEXT *ctx, const char *encoding)
 
GWEN_XMLCTX_ENDTAG_FN GWEN_XmlCtx_SetEndTagFn (GWEN_XML_CONTEXT *ctx, GWEN_XMLCTX_ENDTAG_FN f)
 
void GWEN_XmlCtx_SetFlags (GWEN_XML_CONTEXT *ctx, uint32_t f)
 
GWEN_XMLCTX_STARTTAG_FN GWEN_XmlCtx_SetStartTagFn (GWEN_XML_CONTEXT *ctx, GWEN_XMLCTX_STARTTAG_FN f)
 
int GWEN_XmlCtx_StartTag (GWEN_XML_CONTEXT *ctx, const char *tagName)
 
int GWEN_XmlCtxStore_AddAttr (GWEN_XML_CONTEXT *ctx, const char *attrName, const char *attrData)
 
int GWEN_XmlCtxStore_AddComment (GWEN_UNUSED GWEN_XML_CONTEXT *ctx, GWEN_UNUSED const char *data)
 
int GWEN_XmlCtxStore_AddData (GWEN_XML_CONTEXT *ctx, const char *data)
 
int GWEN_XmlCtxStore_EndTag (GWEN_XML_CONTEXT *ctx, int closing)
 
GWEN_XML_CONTEXTGWEN_XmlCtxStore_new (GWEN_XMLNODE *n, uint32_t flags)
 
int GWEN_XmlCtxStore_StartTag (GWEN_XML_CONTEXT *ctx, const char *tagName)
 

Function Documentation

◆ _findTagForClosingTagAndcloseAndMoveSubTags()

GWEN_XMLNODE * _findTagForClosingTagAndcloseAndMoveSubTags ( GWEN_XML_CONTEXT ctx,
GWEN_XMLNODE currNode,
const char *  tagName 
)
static

Definition at line 483 of file xmlctx.c.

References _moveSubTagsUpOneLevel(), DBG_INFO, GWEN_LOGDOMAIN, GWEN_XML_FLAGS_SGML, GWEN_XmlCtx_DecDepth(), GWEN_XmlCtx_GetFlags(), GWEN_XmlCtx_SetCurrentNode(), GWEN_XMLNode_GetData(), GWEN_XMLNode_GetParent(), and NULL.

Referenced by GWEN_XmlCtxStore_StartTag().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _moveSubTagsUpOneLevel()

void _moveSubTagsUpOneLevel ( GWEN_XMLNODE currNode)
static

Definition at line 517 of file xmlctx.c.

References GWEN_XMLNode_AddChild(), GWEN_XMLNode_GetFirstTag(), GWEN_XMLNode_GetParent(), and GWEN_XMLNode_UnlinkChild().

Referenced by _findTagForClosingTagAndcloseAndMoveSubTags().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_XmlCtx_AddAttr()

int GWEN_XmlCtx_AddAttr ( GWEN_XML_CONTEXT ctx,
const char *  attrName,
const char *  attrData 
)

Definition at line 363 of file xmlctx.c.

References DBG_INFO, and GWEN_LOGDOMAIN.

Referenced by GWEN_XML__ReadTag().

Here is the caller graph for this function:

◆ GWEN_XmlCtx_AddComment()

int GWEN_XmlCtx_AddComment ( GWEN_XML_CONTEXT ctx,
const char *  data 
)

Definition at line 349 of file xmlctx.c.

References DBG_INFO, and GWEN_LOGDOMAIN.

Referenced by GWEN_XML__ReadTag().

Here is the caller graph for this function:

◆ GWEN_XmlCtx_AddData()

int GWEN_XmlCtx_AddData ( GWEN_XML_CONTEXT ctx,
const char *  data 
)

Definition at line 335 of file xmlctx.c.

References DBG_INFO, and GWEN_LOGDOMAIN.

Referenced by GWEN_XML__ReadData().

Here is the caller graph for this function:

◆ GWEN_XmlCtx_Attach()

void GWEN_XmlCtx_Attach ( GWEN_XML_CONTEXT ctx)

Definition at line 99 of file xmlctx.c.

◆ GWEN_XmlCtx_DecDepth()

int GWEN_XmlCtx_DecDepth ( GWEN_XML_CONTEXT ctx)

Definition at line 174 of file xmlctx.c.

Referenced by _findTagForClosingTagAndcloseAndMoveSubTags(), GWEN_XmlCtxStore_EndTag(), GWEN_XmlCtxStore_StartTag(), and HtmlCtx_EndTag().

Here is the caller graph for this function:

◆ GWEN_XmlCtx_EndTag()

int GWEN_XmlCtx_EndTag ( GWEN_XML_CONTEXT ctx,
int  closing 
)

Definition at line 321 of file xmlctx.c.

References DBG_INFO, and GWEN_LOGDOMAIN.

Referenced by GWEN_XML__ReadTag().

Here is the caller graph for this function:

◆ GWEN_XmlCtx_free()

void GWEN_XmlCtx_free ( GWEN_XML_CONTEXT ctx)

◆ GWEN_XmlCtx_GetCurrentHeader()

GWEN_XMLNODE * GWEN_XmlCtx_GetCurrentHeader ( const GWEN_XML_CONTEXT ctx)

Definition at line 233 of file xmlctx.c.

Referenced by GWEN_XmlCtxStore_AddAttr(), and GWEN_XmlCtxStore_EndTag().

Here is the caller graph for this function:

◆ GWEN_XmlCtx_GetCurrentNode()

GWEN_XMLNODE * GWEN_XmlCtx_GetCurrentNode ( const GWEN_XML_CONTEXT ctx)

Definition at line 217 of file xmlctx.c.

Referenced by GWEN_XmlCtxStore_AddAttr(), GWEN_XmlCtxStore_AddData(), GWEN_XmlCtxStore_EndTag(), and GWEN_XmlCtxStore_StartTag().

Here is the caller graph for this function:

◆ GWEN_XmlCtx_GetDepth()

int GWEN_XmlCtx_GetDepth ( const GWEN_XML_CONTEXT ctx)

Definition at line 150 of file xmlctx.c.

Referenced by GWEN_XML_ReadFromFastBuffer().

Here is the caller graph for this function:

◆ GWEN_XmlCtx_GetEncoding()

const char * GWEN_XmlCtx_GetEncoding ( const GWEN_XML_CONTEXT ctx)

Definition at line 124 of file xmlctx.c.

Referenced by GWEN_XML__ReadData(), GWEN_XML__ReadTag(), and GWEN_XMLNode_WriteToStream().

Here is the caller graph for this function:

◆ GWEN_XmlCtx_GetFinishedElement()

uint32_t GWEN_XmlCtx_GetFinishedElement ( const GWEN_XML_CONTEXT ctx)

Definition at line 185 of file xmlctx.c.

Referenced by GWEN_XML_ReadFromFastBuffer().

Here is the caller graph for this function:

◆ GWEN_XmlCtx_GetFlags()

uint32_t GWEN_XmlCtx_GetFlags ( const GWEN_XML_CONTEXT ctx)

◆ GWEN_XmlCtx_IncDepth()

void GWEN_XmlCtx_IncDepth ( GWEN_XML_CONTEXT ctx)

Definition at line 166 of file xmlctx.c.

Referenced by GWEN_XmlCtxStore_StartTag(), HtmlGroup_Box_StartTag(), HtmlGroup_Table_StartTag(), HtmlGroup_TableRow_StartTag(), and HtmlGroup_UnorderedList_StartTag().

Here is the caller graph for this function:

◆ GWEN_XmlCtx_IncFinishedElement()

void GWEN_XmlCtx_IncFinishedElement ( GWEN_XML_CONTEXT ctx)

Definition at line 193 of file xmlctx.c.

Referenced by GWEN_XmlCtxStore_EndTag(), and GWEN_XmlCtxStore_StartTag().

Here is the caller graph for this function:

◆ GWEN_XmlCtx_new()

GWEN_XML_CONTEXT * GWEN_XmlCtx_new ( uint32_t  flags)

Definition at line 66 of file xmlctx.c.

References GWEN_INHERIT_INIT, and GWEN_NEW_OBJECT.

Referenced by GWEN_XmlCtxStore_new(), and HtmlCtx_new().

Here is the caller graph for this function:

◆ GWEN_XmlCtx_ResetFinishedElement()

void GWEN_XmlCtx_ResetFinishedElement ( GWEN_XML_CONTEXT ctx)

Definition at line 201 of file xmlctx.c.

Referenced by GWEN_XML_ReadFromFastBuffer().

Here is the caller graph for this function:

◆ GWEN_XmlCtx_SetAddAttrFn()

GWEN_XMLCTX_ADDATTR_FN GWEN_XmlCtx_SetAddAttrFn ( GWEN_XML_CONTEXT ctx,
GWEN_XMLCTX_ADDATTR_FN  f 
)

Definition at line 280 of file xmlctx.c.

Referenced by GWEN_XmlCtxStore_new(), and HtmlCtx_new().

Here is the caller graph for this function:

◆ GWEN_XmlCtx_SetAddCommentFn()

GWEN_XMLCTX_ADDCOMMENT_FN GWEN_XmlCtx_SetAddCommentFn ( GWEN_XML_CONTEXT ctx,
GWEN_XMLCTX_ADDCOMMENT_FN  f 
)

Definition at line 293 of file xmlctx.c.

Referenced by GWEN_XmlCtxStore_new(), and HtmlCtx_new().

Here is the caller graph for this function:

◆ GWEN_XmlCtx_SetAddDataFn()

GWEN_XMLCTX_ADDDATA_FN GWEN_XmlCtx_SetAddDataFn ( GWEN_XML_CONTEXT ctx,
GWEN_XMLCTX_ADDDATA_FN  f 
)

Definition at line 267 of file xmlctx.c.

Referenced by GWEN_XmlCtxStore_new(), and HtmlCtx_new().

Here is the caller graph for this function:

◆ GWEN_XmlCtx_SetCurrentHeader()

void GWEN_XmlCtx_SetCurrentHeader ( GWEN_XML_CONTEXT ctx,
GWEN_XMLNODE n 
)

Definition at line 225 of file xmlctx.c.

Referenced by GWEN_XmlCtxStore_EndTag(), and GWEN_XmlCtxStore_StartTag().

Here is the caller graph for this function:

◆ GWEN_XmlCtx_SetCurrentNode()

void GWEN_XmlCtx_SetCurrentNode ( GWEN_XML_CONTEXT ctx,
GWEN_XMLNODE n 
)

Definition at line 209 of file xmlctx.c.

Referenced by _findTagForClosingTagAndcloseAndMoveSubTags(), GWEN_XmlCtxStore_EndTag(), GWEN_XmlCtxStore_new(), and GWEN_XmlCtxStore_StartTag().

Here is the caller graph for this function:

◆ GWEN_XmlCtx_SetDepth()

void GWEN_XmlCtx_SetDepth ( GWEN_XML_CONTEXT ctx,
int  i 
)

Definition at line 158 of file xmlctx.c.

◆ GWEN_XmlCtx_SetEncoding()

void GWEN_XmlCtx_SetEncoding ( GWEN_XML_CONTEXT ctx,
const char *  encoding 
)

Definition at line 132 of file xmlctx.c.

References NULL.

Referenced by GWEN_XmlCtxStore_AddAttr(), and GWEN_XMLNode_WriteToStream().

Here is the caller graph for this function:

◆ GWEN_XmlCtx_SetEndTagFn()

GWEN_XMLCTX_ENDTAG_FN GWEN_XmlCtx_SetEndTagFn ( GWEN_XML_CONTEXT ctx,
GWEN_XMLCTX_ENDTAG_FN  f 
)

Definition at line 254 of file xmlctx.c.

Referenced by GWEN_XmlCtxStore_new(), and HtmlCtx_new().

Here is the caller graph for this function:

◆ GWEN_XmlCtx_SetFlags()

void GWEN_XmlCtx_SetFlags ( GWEN_XML_CONTEXT ctx,
uint32_t  f 
)

Definition at line 116 of file xmlctx.c.

◆ GWEN_XmlCtx_SetStartTagFn()

GWEN_XMLCTX_STARTTAG_FN GWEN_XmlCtx_SetStartTagFn ( GWEN_XML_CONTEXT ctx,
GWEN_XMLCTX_STARTTAG_FN  f 
)

Definition at line 241 of file xmlctx.c.

Referenced by GWEN_XmlCtxStore_new(), and HtmlCtx_new().

Here is the caller graph for this function:

◆ GWEN_XmlCtx_StartTag()

int GWEN_XmlCtx_StartTag ( GWEN_XML_CONTEXT ctx,
const char *  tagName 
)

Definition at line 307 of file xmlctx.c.

References DBG_INFO, and GWEN_LOGDOMAIN.

Referenced by GWEN_XML__ReadTag().

Here is the caller graph for this function:

◆ GWEN_XmlCtxStore_AddAttr()

int GWEN_XmlCtxStore_AddAttr ( GWEN_XML_CONTEXT ctx,
const char *  attrName,
const char *  attrData 
)

◆ GWEN_XmlCtxStore_AddComment()

int GWEN_XmlCtxStore_AddComment ( GWEN_UNUSED GWEN_XML_CONTEXT ctx,
GWEN_UNUSED const char *  data 
)

Definition at line 666 of file xmlctx.c.

Referenced by GWEN_XmlCtxStore_new().

Here is the caller graph for this function:

◆ GWEN_XmlCtxStore_AddData()

int GWEN_XmlCtxStore_AddData ( GWEN_XML_CONTEXT ctx,
const char *  data 
)

◆ GWEN_XmlCtxStore_EndTag()

int GWEN_XmlCtxStore_EndTag ( GWEN_XML_CONTEXT ctx,
int  closing 
)

◆ GWEN_XmlCtxStore_new()

GWEN_XML_CONTEXT * GWEN_XmlCtxStore_new ( GWEN_XMLNODE n,
uint32_t  flags 
)

◆ GWEN_XmlCtxStore_StartTag()

int GWEN_XmlCtxStore_StartTag ( GWEN_XML_CONTEXT ctx,
const char *  tagName 
)