gwenhywfar 5.14.1
xml.c File Reference
#include "xml_p.h"
#include "xmlctx_l.h"
#include "i18n_l.h"
#include <gwenhywfar/debug.h>
#include <gwenhywfar/misc.h>
#include <gwenhywfar/text.h>
#include <gwenhywfar/path.h>
#include <gwenhywfar/fastbuffer.h>
#include <gwenhywfar/syncio_file.h>
#include <gwenhywfar/syncio_memory.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include <ctype.h>
#include <sys/types.h>
#include <errno.h>
#include "xmlrw.c"
#include "xmlglobalize.c"
Include dependency graph for xml.c:

Go to the source code of this file.

Macros

#define DISABLE_DEBUGLOG
#define GWEN_XML_BUFFERSIZE   512

Functions

int GWEN_XML_AddNameSpace (GWEN_STRINGLIST2 *sl, const char *prefix, const char *name)
const char * GWEN_XML_FindNameSpace (GWEN_STRINGLIST2 *sl, const char *prefix, const char *name)
const char * GWEN_XML_FindNameSpaceByName (GWEN_STRINGLIST2 *sl, const char *s)
const char * GWEN_XML_FindNameSpaceByPrefix (GWEN_STRINGLIST2 *sl, const char *s)
int GWEN_XMLNode__CheckAndSetNameSpace (GWEN_XMLNODE *n, const char *prefix, const char *nspace)
int GWEN_XMLNode__CheckNameSpaceDecls1 (GWEN_XMLNODE *n, GWEN_STRINGLIST2 *sl, const char *currentNameSpace)
int GWEN_XMLNode__CheckNameSpaceDecls3 (GWEN_XMLNODE *n)
int GWEN_XMLNode__SetNameSpaces (GWEN_XMLNODE *n, const char *prefix, const char *nspace)
void GWEN_XMLNode__SetProperty (GWEN_XMLNODE *n, const char *name, const char *value, int doInsert)
void GWEN_XMLNode_AddChild (GWEN_XMLNODE *n, GWEN_XMLNODE *child)
void GWEN_XMLNode_AddChildrenOnly (GWEN_XMLNODE *n, GWEN_XMLNODE *nn, int copythem)
void GWEN_XMLNode_AddHeader (GWEN_XMLNODE *n, GWEN_XMLNODE *nh)
void GWEN_XMLNode_AddNameSpace (GWEN_XMLNODE *n, const GWEN_XMLNODE_NAMESPACE *ns)
void GWEN_XMLNode_ClearHeaders (GWEN_XMLNODE *n)
void GWEN_XMLNode_CopyProperties (GWEN_XMLNODE *tn, const GWEN_XMLNODE *sn, int overwrite)
void GWEN_XMLNode_DecUsage (GWEN_XMLNODE *n)
void GWEN_XMLNode_DelHeader (GWEN_XMLNODE *n, GWEN_XMLNODE *nh)
void GWEN_XMLNode_Dump (const GWEN_XMLNODE *n, int ind)
GWEN_XMLNODEGWEN_XMLNode_dup (const GWEN_XMLNODE *n)
int GWEN_XMLNode_ExpandProperties (const GWEN_XMLNODE *n, GWEN_DB_NODE *dbVars)
GWEN_XMLNODEGWEN_XMLNode_FindFirstTag (const GWEN_XMLNODE *n, const char *tname, const char *pname, const char *pvalue)
GWEN_XMLNODE_NAMESPACEGWEN_XMLNode_FindNameSpaceByName (const GWEN_XMLNODE *n, const char *s)
GWEN_XMLNODE_NAMESPACEGWEN_XMLNode_FindNameSpaceByUrl (const GWEN_XMLNODE *n, const char *s)
GWEN_XMLNODEGWEN_XMLNode_FindNextTag (const GWEN_XMLNODE *n, const char *tname, const char *pname, const char *pvalue)
GWEN_XMLNODEGWEN_XMLNode_FindNode (const GWEN_XMLNODE *node, GWEN_XMLNODE_TYPE t, const char *data)
GWEN_XMLNODEGWEN_XMLNode_FindTag (const GWEN_XMLNODE *n, const char *tname, const char *pname, const char *pvalue)
void GWEN_XMLNode_free (GWEN_XMLNODE *n)
void GWEN_XMLNode_freeAll (GWEN_XMLNODE *n)
const char * GWEN_XMLNode_GetCharValue (const GWEN_XMLNODE *n, const char *name, const char *defValue)
const char * GWEN_XMLNode_GetCharValueByPath (GWEN_XMLNODE *n, const char *name, const char *defValue)
GWEN_XMLNODEGWEN_XMLNode_GetChild (const GWEN_XMLNODE *n)
const char * GWEN_XMLNode_GetData (const GWEN_XMLNODE *n)
GWEN_XMLNODEGWEN_XMLNode_GetFirstData (const GWEN_XMLNODE *n)
GWEN_XMLNODEGWEN_XMLNode_GetFirstOfType (const GWEN_XMLNODE *n, GWEN_XMLNODE_TYPE t)
GWEN_XMLPROPERTYGWEN_XMLNode_GetFirstProperty (const GWEN_XMLNODE *n)
GWEN_XMLNODEGWEN_XMLNode_GetFirstTag (const GWEN_XMLNODE *n)
GWEN_XMLNODEGWEN_XMLNode_GetHeader (const GWEN_XMLNODE *n)
int GWEN_XMLNode_GetIntProperty (const GWEN_XMLNODE *n, const char *name, int defaultValue)
int GWEN_XMLNode_GetIntValue (const GWEN_XMLNODE *n, const char *name, int defValue)
int GWEN_XMLNode_GetIntValueByPath (GWEN_XMLNODE *n, const char *name, int defValue)
const char * GWEN_XMLNode_GetLocalizedCharValue (const GWEN_XMLNODE *n, const char *name, const char *defValue)
const char * GWEN_XMLNode_GetNamespace (const GWEN_XMLNODE *n)
GWEN_XMLNODE_NAMESPACE_LISTGWEN_XMLNode_GetNameSpaces (const GWEN_XMLNODE *n)
GWEN_XMLNODEGWEN_XMLNode_GetNextData (const GWEN_XMLNODE *n)
GWEN_XMLNODEGWEN_XMLNode_GetNextOfType (const GWEN_XMLNODE *n, GWEN_XMLNODE_TYPE t)
GWEN_XMLPROPERTYGWEN_XMLNode_GetNextProperty (const GWEN_XMLNODE *n, const GWEN_XMLPROPERTY *pr)
GWEN_XMLNODEGWEN_XMLNode_GetNextTag (const GWEN_XMLNODE *n)
GWEN_XMLNODEGWEN_XMLNode_GetNodeByXPath (GWEN_XMLNODE *n, const char *path, uint32_t flags)
GWEN_XMLNODEGWEN_XMLNode_GetParent (const GWEN_XMLNODE *n)
const char * GWEN_XMLNode_GetProperty (const GWEN_XMLNODE *n, const char *name, const char *defaultValue)
GWEN_XMLNODE_TYPE GWEN_XMLNode_GetType (const GWEN_XMLNODE *n)
uint32_t GWEN_XMLNode_GetUsage (const GWEN_XMLNODE *n)
int GWEN_XMLNode_GetXPath (const GWEN_XMLNODE *n1, const GWEN_XMLNODE *n2, GWEN_BUFFER *nbuf)
void * GWEN_XMLNode_HandlePath (const char *entry, void *data, int idx, uint32_t flags)
void GWEN_XMLNode_IncUsage (GWEN_XMLNODE *n)
int GWEN_XMLNode_IsChildOf (const GWEN_XMLNODE *parent, const GWEN_XMLNODE *child)
GWEN_XMLNODE_NAMESPACEGWEN_XMLNode_NameSpace_dup (const GWEN_XMLNODE_NAMESPACE *ns)
void GWEN_XMLNode_NameSpace_free (GWEN_XMLNODE_NAMESPACE *ns)
const char * GWEN_XMLNode_NameSpace_GetName (const GWEN_XMLNODE_NAMESPACE *ns)
const char * GWEN_XMLNode_NameSpace_GetUrl (const GWEN_XMLNODE_NAMESPACE *ns)
GWEN_XMLNODE_NAMESPACEGWEN_XMLNode_NameSpace_new (const char *name, const char *url)
GWEN_XMLNODEGWEN_XMLNode_new (GWEN_XMLNODE_TYPE t, const char *data)
GWEN_XMLNODEGWEN_XMLNode_Next (const GWEN_XMLNODE *n)
int GWEN_XMLNode_NormalizeNameSpaces (GWEN_XMLNODE *n)
int GWEN_XMLNode_Path_Dive (GWEN_XMLNODE_PATH *np, GWEN_XMLNODE *n)
void GWEN_XMLNode_Path_Dump (GWEN_XMLNODE_PATH *np)
GWEN_XMLNODE_PATHGWEN_XMLNode_Path_dup (const GWEN_XMLNODE_PATH *np)
void GWEN_XMLNode_Path_free (GWEN_XMLNODE_PATH *np)
GWEN_XMLNODE_PATHGWEN_XMLNode_Path_new (void)
GWEN_XMLNODEGWEN_XMLNode_Path_Surface (GWEN_XMLNODE_PATH *np)
void GWEN_XMLNode_RemoveChildren (GWEN_XMLNODE *n)
void GWEN_XMLNode_SetCharValue (GWEN_XMLNODE *n, const char *name, const char *value)
int GWEN_XMLNode_SetCharValueByPath (GWEN_XMLNODE *n, uint32_t flags, const char *name, const char *value)
void GWEN_XMLNode_SetData (GWEN_XMLNODE *n, const char *data)
void GWEN_XMLNode_SetIntProperty (GWEN_XMLNODE *n, const char *name, int value)
void GWEN_XMLNode_SetIntValue (GWEN_XMLNODE *n, const char *name, int value)
int GWEN_XMLNode_SetIntValueByPath (GWEN_XMLNODE *n, uint32_t flags, const char *name, int value)
void GWEN_XMLNode_SetNamespace (GWEN_XMLNODE *n, const char *s)
void GWEN_XMLNode_SetProperty (GWEN_XMLNODE *n, const char *name, const char *value)
int GWEN_XMLNode_StripNamespaces (GWEN_XMLNODE *n)
void GWEN_XMLNode_UnlinkChild (GWEN_XMLNODE *n, GWEN_XMLNODE *child)
void GWEN_XMLProperty_add (GWEN_XMLPROPERTY *p, GWEN_XMLPROPERTY **head)
void GWEN_XMLProperty_del (GWEN_XMLPROPERTY *p, GWEN_XMLPROPERTY **head)
GWEN_XMLPROPERTYGWEN_XMLProperty_dup (const GWEN_XMLPROPERTY *p)
void GWEN_XMLProperty_free (GWEN_XMLPROPERTY *p)
void GWEN_XMLProperty_freeAll (GWEN_XMLPROPERTY *p)
const char * GWEN_XMLProperty_GetName (const GWEN_XMLPROPERTY *pr)
const char * GWEN_XMLProperty_GetValue (const GWEN_XMLPROPERTY *pr)
void GWEN_XMLProperty_insert (GWEN_XMLPROPERTY *p, GWEN_XMLPROPERTY **head)
GWEN_XMLPROPERTYGWEN_XMLProperty_new (const char *name, const char *value)

Macro Definition Documentation

◆ DISABLE_DEBUGLOG

#define DISABLE_DEBUGLOG

Definition at line 29 of file xml.c.

◆ GWEN_XML_BUFFERSIZE

#define GWEN_XML_BUFFERSIZE   512

Definition at line 60 of file xml.c.

Referenced by GWEN_XML__ReadAllFromIo(), and GWEN_XMLContext_ReadFromIo().

Function Documentation

◆ GWEN_XML_AddNameSpace()

int GWEN_XML_AddNameSpace ( GWEN_STRINGLIST2 * sl,
const char * prefix,
const char * name )

Definition at line 1424 of file xml.c.

References GWEN_Buffer_AppendByte(), GWEN_Buffer_AppendString(), GWEN_Buffer_free(), GWEN_Buffer_GetStart(), GWEN_Buffer_new(), GWEN_StringList2_AppendString(), and GWEN_StringList2_IntertMode_NoDouble.

Referenced by GWEN_XMLNode__CheckNameSpaceDecls1().

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

◆ GWEN_XML_FindNameSpace()

const char * GWEN_XML_FindNameSpace ( GWEN_STRINGLIST2 * sl,
const char * prefix,
const char * name )

◆ GWEN_XML_FindNameSpaceByName()

const char * GWEN_XML_FindNameSpaceByName ( GWEN_STRINGLIST2 * sl,
const char * s )

Definition at line 1471 of file xml.c.

References GWEN_StringList2_First(), GWEN_StringList2Iterator_Data(), GWEN_StringList2Iterator_free(), and GWEN_StringList2Iterator_Next().

Referenced by GWEN_XMLNode__CheckNameSpaceDecls1().

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

◆ GWEN_XML_FindNameSpaceByPrefix()

const char * GWEN_XML_FindNameSpaceByPrefix ( GWEN_STRINGLIST2 * sl,
const char * s )

Definition at line 1444 of file xml.c.

References GWEN_StringList2_First(), GWEN_StringList2Iterator_Data(), GWEN_StringList2Iterator_free(), and GWEN_StringList2Iterator_Next().

Here is the call graph for this function:

◆ GWEN_XMLNode__CheckAndSetNameSpace()

int GWEN_XMLNode__CheckAndSetNameSpace ( GWEN_XMLNODE * n,
const char * prefix,
const char * nspace )

Definition at line 1652 of file xml.c.

References DBG_DEBUG, GWEN_Buffer_AppendByte(), GWEN_Buffer_AppendString(), GWEN_Buffer_free(), GWEN_Buffer_GetStart(), GWEN_Buffer_new(), GWEN_LOGDOMAIN, GWEN_XMLNode__SetProperty(), and GWEN_XMLNode_GetProperty().

Referenced by GWEN_XMLNode__SetNameSpaces().

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

◆ GWEN_XMLNode__CheckNameSpaceDecls1()

◆ GWEN_XMLNode__CheckNameSpaceDecls3()

int GWEN_XMLNode__CheckNameSpaceDecls3 ( GWEN_XMLNODE * n)

◆ GWEN_XMLNode__SetNameSpaces()

int GWEN_XMLNode__SetNameSpaces ( GWEN_XMLNODE * n,
const char * prefix,
const char * nspace )

Definition at line 1729 of file xml.c.

References GWEN_XMLNode__CheckAndSetNameSpace(), GWEN_XMLNode__SetNameSpaces(), GWEN_XMLNode_GetFirstTag(), and GWEN_XMLNode_GetNextTag().

Referenced by GWEN_XMLNode__CheckNameSpaceDecls3(), and GWEN_XMLNode__SetNameSpaces().

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

◆ GWEN_XMLNode__SetProperty()

void GWEN_XMLNode__SetProperty ( GWEN_XMLNODE * n,
const char * name,
const char * value,
int doInsert )

Definition at line 290 of file xml.c.

References GWEN_Memory_dealloc(), GWEN_Memory_strdup(), GWEN_XMLProperty_add(), GWEN_XMLProperty_insert(), and GWEN_XMLProperty_new().

Referenced by GWEN_XMLNode__CheckAndSetNameSpace(), GWEN_XMLNode_SetIntProperty(), and GWEN_XMLNode_SetProperty().

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

◆ GWEN_XMLNode_AddChild()

void GWEN_XMLNode_AddChild ( GWEN_XMLNODE * n,
GWEN_XMLNODE * child )

Adds a node as a child to another one. This function does not make deep copies. Instead it takes over ownership of the new child.

Parameters
nnode to which the new node is to be added (i.e. the node which becomes the parent of the second argument)
childchild which is to be added (this function takes over ownership of that node, so you MUST NOT free the node yourself)

Definition at line 423 of file xml.c.

References GWEN_XMLNode_List_Add().

Referenced by _exportDbToXml(), _moveSubTagsUpOneLevel(), _writeCommandList2ToXml(), _writeFileList2ToXml(), _writeIdsFromFile2ListToXml(), _writeSubCommandListToXml(), addDefinitions(), GWB_BuildCmd_List2_WriteXml(), GWB_BuildCmd_List_WriteXml(), GWB_BuildCmd_toXml(), GWB_BuildCtx_toXml(), GWB_BuildCtx_WriteToXmlFile(), GWB_Context_toXml(), GWB_File_List2_WriteXml(), GWB_KeyValuePair_List_WriteXml(), GWB_Project_toXml(), GWB_Target_toXml(), GWB_Utils_WriteBuildFileList(), GWB_Utils_WriteContextTreeToFile(), GWB_Utils_WriteInstallFileList(), GWB_Utils_WriteProjectFileList(), GWB_Utils_WriteProjectInfoToFile(), GWB_Utils_WriteProjectToFile(), GWEN_DBIO_XmlDb__ExportGroup(), GWEN_DBIO_XmlDb__ExportVar(), GWEN_MsgEngine__ListElement(), GWEN_MsgEngine__ListGroup(), GWEN_MsgEngine_AddDefinitions(), GWEN_Param_List_WriteValuesToXml(), GWEN_Param_List_WriteXml(), GWEN_Param_WriteXml(), GWEN_XmlCtxStore_AddData(), GWEN_XmlCtxStore_StartTag(), GWEN_XMLNode_AddChildrenOnly(), GWEN_XMLNode_dup(), GWEN_XMLNode_HandlePath(), GWEN_XMLNode_SetCharValue(), GWEN_XMLNode_SetCharValueByPath(), and main().

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

◆ GWEN_XMLNode_AddChildrenOnly()

void GWEN_XMLNode_AddChildrenOnly ( GWEN_XMLNODE * n,
GWEN_XMLNODE * nn,
int copythem )

Adds the children of the second argument as new children to the first one.

Parameters
nnode which is to become parent of the second argument's children
nnnode whose children are to be moved.
copythemif 0 then the children will be moved (leaving the node of the second argument without children), otherwise deep copies will be made and the node from the second argument will not be altered. co

Definition at line 432 of file xml.c.

References GWEN_XMLNode_AddChild(), GWEN_XMLNode_dup(), GWEN_XMLNode_GetChild(), GWEN_XMLNode_Next(), and GWEN_XMLNode_UnlinkChild().

Here is the call graph for this function:

◆ GWEN_XMLNode_AddHeader()

void GWEN_XMLNode_AddHeader ( GWEN_XMLNODE * root,
GWEN_XMLNODE * nh )

Adds a node as a header to the given root node.

Definition at line 1331 of file xml.c.

References GWEN_XMLNode_List_Add().

Referenced by GWEN_DBIO_XmlDb_Export(), GWEN_XmlCtxStore_StartTag(), GWEN_XMLNode_dup(), and main().

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

◆ GWEN_XMLNode_AddNameSpace()

void GWEN_XMLNode_AddNameSpace ( GWEN_XMLNODE * n,
const GWEN_XMLNODE_NAMESPACE * ns )

Definition at line 1407 of file xml.c.

References GWEN_XMLNode_NameSpace_dup(), and GWEN_XMLNode_NameSpace_List_Add().

Referenced by GWEN_XmlCtxStore_AddAttr().

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

◆ GWEN_XMLNode_ClearHeaders()

void GWEN_XMLNode_ClearHeaders ( GWEN_XMLNODE * root)

Clears the given root nodes' list of headers. All the tags in the header list are also freed.

Definition at line 1349 of file xml.c.

References GWEN_XMLNode_List_Clear().

Here is the call graph for this function:

◆ GWEN_XMLNode_CopyProperties()

void GWEN_XMLNode_CopyProperties ( GWEN_XMLNODE * tn,
const GWEN_XMLNODE * sn,
int overwrite )

This function copies the properties/attributes of one tag/element to another one.

Parameters
tndestination node (must be a tag/element)
snsource node (must be a tag/element)
overwriteif !=0 then existing properties/attributes in the destination node will be overwritten.

Definition at line 588 of file xml.c.

References GWEN_Memory_dealloc(), GWEN_Memory_strdup(), GWEN_XMLProperty_add(), and GWEN_XMLProperty_dup().

Referenced by GWEN_MsgEngine__ListGroup().

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

◆ GWEN_XMLNode_DecUsage()

void GWEN_XMLNode_DecUsage ( GWEN_XMLNODE * n)

Definition at line 350 of file xml.c.

References DBG_WARN, and GWEN_LOGDOMAIN.

◆ GWEN_XMLNode_DelHeader()

void GWEN_XMLNode_DelHeader ( GWEN_XMLNODE * root,
GWEN_XMLNODE * nh )

Removes a node from the given root nodes' header list. The header node is just removed from the list, not freed !

Definition at line 1340 of file xml.c.

References GWEN_XMLNode_List_Del().

Here is the call graph for this function:

◆ GWEN_XMLNode_Dump()

void GWEN_XMLNode_Dump ( const GWEN_XMLNODE * n,
int ind )

Dumps the content of the given XML node and all its children.

Definition at line 472 of file xml.c.

References DBG_ERROR, GWEN_LOGDOMAIN, GWEN_XMLNode_Dump(), GWEN_XMLNode_GetChild(), GWEN_XMLNode_Next(), GWEN_XMLNodeTypeComment, GWEN_XMLNodeTypeData, and GWEN_XMLNodeTypeTag.

Referenced by _groupReadElement(), GWB_ParseOption(), GWEN_MsgEngine__ReadGroup(), GWEN_MsgEngine__ReadValue(), GWEN_MsgEngine__WriteGroup(), GWEN_Widget_ReadXml(), GWEN_XMLNode_Dump(), and GWEN_XMLNode_Path_Dump().

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

◆ GWEN_XMLNode_dup()

◆ GWEN_XMLNode_ExpandProperties()

int GWEN_XMLNode_ExpandProperties ( const GWEN_XMLNODE * tn,
GWEN_DB_NODE * dbVars )

Expand values of the properties in the given XML node.

If a property contains something like "$(variableName)" then a variable with that name is looked up in the given dbVars and inserted instead of the variable name spec. Internally calls GWEN_DB_ReplaceVars().

Definition at line 634 of file xml.c.

References DBG_ERROR, GWEN_Buffer_free(), GWEN_Buffer_GetStart(), GWEN_Buffer_new(), GWEN_Buffer_Reset(), GWEN_DB_ReplaceVars(), GWEN_LOGDOMAIN, GWEN_Memory_dealloc(), and GWEN_Memory_strdup().

Referenced by _parseArg(), _parseBuildCommand(), _parseDefine(), _parseDefines(), _parseDep(), _parseIncludes(), _parseLib(), _parseLibraries(), _parseProg(), _parseUsedTargets(), _parseWriteFile(), GWB_ParseCheckFunctions(), GWB_ParseCheckHeaders(), GWB_ParseOption(), GWB_Parser_ParseSourcesOrHeaders(), and GWB_ParseTarget().

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

◆ GWEN_XMLNode_FindFirstTag()

GWEN_XMLNODE * GWEN_XMLNode_FindFirstTag ( const GWEN_XMLNODE * n,
const char * tname,
const char * pname,
const char * pvalue )

Searches for the first matching tag/element below the given one. Lets say you have the following XML file:

<DEVICES>
<DEVICE id="dev1" />
<DEVICE id="dev2" />
</DEVICES>

If you are looking for a device called "dev2" then you should call this function like this:

tag=GWEN_XMLNode_FindFirstTag(root, "DEVICE", "id", "dev2");
GWEN_XMLNODE * GWEN_XMLNode_FindFirstTag(const GWEN_XMLNODE *n, const char *tname, const char *pname, const char *pvalue)
Definition xml.c:776
Returns
pointer to the tag/element if found, 0 otherwise
Parameters
ntag/element below which to search
tnametag/element name (e.g. if the tag is "<TESTTAG>" then the tag name is "TESTTAG"). Wildcards (like "*") are allowed.
pnamename of the property/attribute to check (if 0 then no property/attribute comparison takes place). No wildcards allowed.
pvalueoptional value of the property/attribute to compare against, wildcards allowed.

Definition at line 776 of file xml.c.

References GWEN_XMLNode_FindTag(), and GWEN_XMLNode_GetFirstTag().

Referenced by _addCommands(), _getLocalizedLongDescrByFormat(), _getLocalOrMainPluginNode(), _getLongDescrByFormat(), _handleXmlForEvery(), _parseAndSetBuildMessage(), _parseBuildCmd(), _parseDep(), _parseIfNotVarHasValue(), _parseIfNotVarMatches(), _parseIfVarHasValue(), _parseIfVarMatches(), _parseProg(), _parseSubCmd(), _readArgs(), _readBuildFileList(), _readBuildMessage(), _readCommandsFromXml(), _readDepFile(), _readFileIdsFromXml(), _readFilesFromXml(), _readFromFile(), _readMainSettingsFromXml(), _readPluginDescriptionFromFile(), _readSettingsFromXml(), _readSubCommandListFromXml(), _setupOutFiles(), _setupTargetLinkSpec(), get_function_name(), get_function_name2(), get_property(), get_typedef(), GWB_BuildCmd_fromXml(), GWB_BuildCtx_fromXml(), GWB_BuildCtx_ReadFromXmlFile(), GWB_File_List2_ReadXml(), GWB_GenericBuilder_Factory(), GWB_ParseOption(), GWB_Parser_ReadBuildFile(), GWB_Parser_ReadBuildTree(), GWB_Parser_ReadNamedXmlDataIntoBufferAndExpand(), GWB_Utils_ReadFileList2(), GWB_Utils_ReadInstallFileList(), GWB_Utils_ReadProjectInfoFromFile(), GWEN_DBIO__XmlDb_ImportVar(), GWEN_DBIO_XmlDb_Import(), GWEN_Dialog__ReadXmlWidget(), GWEN_Dialog_ReadXmlFile(), GWEN_MsgEngine__GetGroup(), GWEN_Param_List_ReadValuesFromXml(), GWEN_Param_List_ReadXml(), GWEN_Param_ReadXml(), GWEN_XMLNode_GetCharValue(), GWEN_XMLNode_GetLocalizedCharValue(), GWEN_XMLNode_GetXPath(), GWEN_XMLNode_HandlePath(), Typemaker2_Group_readXml(), Typemaker2_Member_readXml(), Typemaker2_Type_readXml(), Typemaker2_TypeManager_LoadType(), Typemaker2_TypeManager_LoadTypeFile(), Typemaker2_TypeManager_LoadTypeFile2(), Typemaker2_TypeManager_LoadTypeFileNoLookup(), Typemaker2_VirtualFn_readXml(), write_apidoc_c(), write_apidocrec_c(), write_c_enums(), write_code_file_c(), write_code_files_c(), write_code_setget_c(), write_files(), write_h_enums(), write_h_funcs(), write_h_setget_c(), write_ha_file_c(), write_ha_files_c(), write_hl_file_c(), write_hl_files_c(), and write_hp_files_c().

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

◆ GWEN_XMLNode_FindNameSpaceByName()

GWEN_XMLNODE_NAMESPACE * GWEN_XMLNode_FindNameSpaceByName ( const GWEN_XMLNODE * n,
const char * s )

Definition at line 1365 of file xml.c.

References GWEN_XMLNode_NameSpace_GetName(), GWEN_XMLNode_NameSpace_List_First(), GWEN_XMLNode_NameSpace_List_Next(), and NULL.

Here is the call graph for this function:

◆ GWEN_XMLNode_FindNameSpaceByUrl()

GWEN_XMLNODE_NAMESPACE * GWEN_XMLNode_FindNameSpaceByUrl ( const GWEN_XMLNODE * n,
const char * s )

Definition at line 1386 of file xml.c.

References GWEN_XMLNode_NameSpace_GetUrl(), GWEN_XMLNode_NameSpace_List_First(), GWEN_XMLNode_NameSpace_List_Next(), and NULL.

Here is the call graph for this function:

◆ GWEN_XMLNode_FindNextTag()

◆ GWEN_XMLNode_FindNode()

GWEN_XMLNODE * GWEN_XMLNode_FindNode ( const GWEN_XMLNODE * n,
GWEN_XMLNODE_TYPE t,
const char * data )

This is a very primitive function. It looks for a node of the given type and data matching the given one (case-insensitive) below the given node (i.e. if a node is returned it will be a child of the given one).

Definition at line 543 of file xml.c.

References DBG_DEBUG, GWEN_LOGDOMAIN, GWEN_XMLNode_GetChild(), and GWEN_XMLNode_Next().

Referenced by addDefinitions(), and GWEN_MsgEngine_AddDefinitions().

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

◆ GWEN_XMLNode_FindTag()

GWEN_XMLNODE * GWEN_XMLNode_FindTag ( const GWEN_XMLNODE * n,
const char * tname,
const char * pname,
const char * pvalue )

Definition at line 743 of file xml.c.

References GWEN_Text_ComparePattern(), GWEN_XMLNode_GetNextTag(), and GWEN_XMLNode_GetProperty().

Referenced by GWEN_XMLNode_FindFirstTag(), and GWEN_XMLNode_FindNextTag().

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

◆ GWEN_XMLNode_free()

◆ GWEN_XMLNode_freeAll()

void GWEN_XMLNode_freeAll ( GWEN_XMLNODE * n)

Free the given node and all nodes besides this one. Hmm, this function should not be public, I think I will move it to xml_p.h.

Definition at line 175 of file xml.c.

References GWEN_XMLNode_free(), and GWEN_XMLNode_List_Next().

Here is the call graph for this function:

◆ GWEN_XMLNode_GetCharValue()

const char * GWEN_XMLNode_GetCharValue ( const GWEN_XMLNODE * n,
const char * name,
const char * defValue )

Reads a char value. If no name is given (i.e. name is NULL or empty) then the data returned is that from the first data node below the given node. Otherwise a node with the given name is searched below the given node and its first data node's data is returned.

Parameters
nNode which is expected to contain a node of the specified name
namename of the node below n to be looked up
defValuedefault value to return if the tag did not exist

Definition at line 812 of file xml.c.

References GWEN_XMLNode_FindFirstTag(), GWEN_XMLNode_FindNextTag(), and GWEN_XMLNode_GetFirstData().

Referenced by _readFilesFromXml(), GWB_BuildCmd_fromXml(), GWB_BuildCtx_fromXml(), GWB_BuildSubCmd_fromXml(), GWB_File_fromXml(), GWB_MkDist(), GWB_ParseOption(), GWB_Utils_ReadInstallFileList(), GWEN_Crypt_Token_Context_ReadXml(), GWEN_Crypt_Token_KeyInfo_ReadXml(), GWEN_Param_List_ReadValuesFromXml(), GWEN_Param_ReadXml(), GWEN_PluginDescription_fromXml(), GWEN_XMLNode_GetIntValue(), Typemaker2_Code_ReadXml(), Typemaker2_Inline_fromXml(), Typemaker2_Member_readXml(), Typemaker2_Type_readXml(), and Typemaker2_VirtualFn_readXml().

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

◆ GWEN_XMLNode_GetCharValueByPath()

const char * GWEN_XMLNode_GetCharValueByPath ( GWEN_XMLNODE * n,
const char * path,
const char * defValue )

Return the string value of an element below the given one, specified by an XPath.

Parameters
nNode which is expected to contain the specified path
pathXPath to lookup below the node n
defValuedefault value to return if the tag did not exist

Definition at line 981 of file xml.c.

References GWEN_XMLNode_GetFirstData(), and GWEN_XMLNode_GetNodeByXPath().

Referenced by _getCharValueByPath(), and GWEN_XMLNode_GetIntValueByPath().

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

◆ GWEN_XMLNode_GetChild()

GWEN_XMLNODE * GWEN_XMLNode_GetChild ( const GWEN_XMLNODE * n)

INTERNAL. Descends in the XML tree to the first GWEN_XMLNODE below the given node. The returned node may be a tag/element node, or a property/attribute node, or a data node. You will probably prefer to use GWEN_XMLNode_GetFirstTag() instead of this function.

Returns
The first children tag/element, or NULL if none exists.

Definition at line 409 of file xml.c.

References GWEN_XMLNode_List_First().

Referenced by _readFileList(), addDefinitions(), GWEN_MsgEngine__findInValues(), GWEN_MsgEngine__ListGroup(), GWEN_MsgEngine__ReadGroup(), GWEN_MsgEngine__ShowGroup(), GWEN_MsgEngine__WriteGroup(), GWEN_MsgEngine_AddDefinitions(), GWEN_MsgEngine_FindNodeByProperty(), GWEN_MsgEngine_FindNodeByPropertyStrictProto(), GWEN_XMLNode__WriteTagToStream(), GWEN_XMLNode_AddChildrenOnly(), GWEN_XMLNode_Dump(), GWEN_XMLNode_FindNode(), GWEN_XMLNode_GetFirstOfType(), and GWEN_XMLNode_WriteToStream().

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

◆ GWEN_XMLNode_GetData()

const char * GWEN_XMLNode_GetData ( const GWEN_XMLNODE * n)

Returns the character data of the given node.

Definition at line 370 of file xml.c.

Referenced by _findTagForClosingTagAndcloseAndMoveSubTags(), _handleChildren_fromDb(), _handleChildren_toDb(), _handleChildren_toDb(), _parseChildNodes(), _parseChildNodes(), _parseChildNodes(), _parseChildNodes(), _parseChildNodes(), _parseChildNodes(), _readArgsLoop(), _readBuildFileList(), _readFileListFromTagNode(), _readFilesFromDataNode(), _readXmlDataIntoBufferAndExpand(), addDefinitions(), get_struct_node(), get_struct_property(), GWB_Parser_ParseWellKnownElements(), GWB_Parser_ReadXmlDataIntoBufferAndExpand(), GWEN_DBIO__XmlDb_ImportGroup(), GWEN_DBIO__XmlDb_ImportVar(), GWEN_DBIO__XmlDb_ReadDataTags(), GWEN_MsgEngine__findInValues(), GWEN_MsgEngine__GetGroup(), GWEN_MsgEngine__GetInline(), GWEN_MsgEngine__ListGroup(), GWEN_MsgEngine__ReadGroup(), GWEN_MsgEngine__ShowGroup(), GWEN_MsgEngine__WriteGroup(), GWEN_MsgEngine_AddDefinitions(), GWEN_MsgEngine_CreateMessageFromNode(), GWEN_MsgEngine_FindNodeByProperty(), GWEN_MsgEngine_FindNodeByPropertyStrictProto(), GWEN_StringList2_fromXml(), GWEN_XmlCtxStore_AddAttr(), GWEN_XmlCtxStore_EndTag(), GWEN_XmlCtxStore_StartTag(), GWEN_XMLGL__GetNameSpaceByPrefix(), GWEN_XMLNode_GetXPath(), GWEN_XMLNode_WriteToStream(), Typemaker2_Header_readXml(), Typemaker2_Type_readMembersAndGroupsXml(), write_apidocrec_c(), write_c_enums(), write_code_constrec_c(), write_code_duprec_c(), write_code_freeElems_c(), write_code_fromdbrec_c(), write_code_setget_c(), write_code_todbrec_c(), write_h_enums(), write_h_header(), write_h_setget_c(), and write_hp_group_c().

Here is the caller graph for this function:

◆ GWEN_XMLNode_GetFirstData()

GWEN_XMLNODE * GWEN_XMLNode_GetFirstData ( const GWEN_XMLNODE * n)

Descends in the XML tree to the first children data node below the given node.

Different from GWEN_XMLNode_GetChild() this function only looks for another data node and not for a (more general) node.

Returns
The first children data node, or NULL if none exists.

Definition at line 724 of file xml.c.

References GWEN_XMLNode_GetFirstOfType(), and GWEN_XMLNodeTypeData.

Referenced by _readBuildFileList(), _readXmlDataIntoBufferAndExpand(), GWB_Parser_ReadXmlDataIntoBufferAndExpand(), GWEN_DBIO__XmlDb_ReadDataTags(), GWEN_MsgEngine__GetInline(), GWEN_StringList2_fromXml(), GWEN_XMLNode_GetCharValue(), GWEN_XMLNode_GetCharValueByPath(), GWEN_XMLNode_GetLocalizedCharValue(), Typemaker2_Header_readXml(), write_c_enums(), write_h_enums(), and write_h_header().

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

◆ GWEN_XMLNode_GetFirstOfType()

GWEN_XMLNODE * GWEN_XMLNode_GetFirstOfType ( const GWEN_XMLNODE * n,
GWEN_XMLNODE_TYPE t )

Definition at line 674 of file xml.c.

References GWEN_XMLNode_GetChild(), and GWEN_XMLNode_Next().

Referenced by GWEN_XMLNode_GetFirstData(), and GWEN_XMLNode_GetFirstTag().

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

◆ GWEN_XMLNode_GetFirstProperty()

GWEN_XMLPROPERTY * GWEN_XMLNode_GetFirstProperty ( const GWEN_XMLNODE * n)

Definition at line 1045 of file xml.c.

◆ GWEN_XMLNode_GetFirstTag()

◆ GWEN_XMLNode_GetHeader()

GWEN_XMLNODE * GWEN_XMLNode_GetHeader ( const GWEN_XMLNODE * n)

Returns the first header tag of the given node. Use GWEN_XMLNode_Next to get the next header tag.

Definition at line 1323 of file xml.c.

References GWEN_XMLNode_List_First().

Referenced by GWEN_XMLNode_WriteToStream().

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

◆ GWEN_XMLNode_GetIntProperty()

int GWEN_XMLNode_GetIntProperty ( const GWEN_XMLNODE * n,
const char * name,
int defaultValue )

◆ GWEN_XMLNode_GetIntValue()

int GWEN_XMLNode_GetIntValue ( const GWEN_XMLNODE * n,
const char * name,
int defValue )

Internally calls GWEN_XMLNode_GetCharValue and interpretes the data as an integer which is then returned.

Parameters
nNode which is expected to contain a node of the specified name
namename of the node below n to be looked up
defValuedefault value to return if the tag did not exist

Definition at line 923 of file xml.c.

References GWEN_XMLNode_GetCharValue().

Referenced by GWB_BuildCmd_fromXml(), GWB_BuildSubCmd_fromXml(), GWB_MkDist(), GWEN_Crypt_Token_Context_ReadXml(), GWEN_Crypt_Token_KeyInfo_ReadXml(), GWEN_Param_ReadXml(), Typemaker2_Define_ReadXml(), Typemaker2_Signal_ReadXml(), Typemaker2_Slot_ReadXml(), and Typemaker2_Type_readXml().

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

◆ GWEN_XMLNode_GetIntValueByPath()

int GWEN_XMLNode_GetIntValueByPath ( GWEN_XMLNODE * n,
const char * name,
int defValue )

Return the integer value of an element below the given one, specified by an XPath.

Parameters
nNode which is expected to contain the specified path
pathXPath to lookup below the node n
defValuedefault value to return if the tag did not exist

Definition at line 1025 of file xml.c.

References GWEN_XMLNode_GetCharValueByPath(), and NULL.

Here is the call graph for this function:

◆ GWEN_XMLNode_GetLocalizedCharValue()

const char * GWEN_XMLNode_GetLocalizedCharValue ( const GWEN_XMLNODE * n,
const char * name,
const char * defValue )

This function does the same as GWEN_XMLNode_GetCharValue, but it looks for an element with the attribute "lang" which matches the currently selected locale (e.g. "lang=de" for Germany). If there is no localized version of the given element then the first element of that name is used (withouth "lang" attribute). Therefore XML documents used with this function should contain unlocalized elements along with localized ones to provide a fallback.

Parameters
nNode which is expected to contain a node of the specified name
namename of the node below n to be looked up
defValuedefault value to return if the tag did not exist

Definition at line 846 of file xml.c.

References DBG_DEBUG, GWEN_I18N_GetCurrentLocaleList(), GWEN_LOGDOMAIN, GWEN_StringList_FirstEntry(), GWEN_StringListEntry_Data(), GWEN_StringListEntry_Next(), GWEN_XMLNode_FindFirstTag(), GWEN_XMLNode_FindNextTag(), and GWEN_XMLNode_GetFirstData().

Here is the call graph for this function:

◆ GWEN_XMLNode_GetNamespace()

const char * GWEN_XMLNode_GetNamespace ( const GWEN_XMLNODE * n)

Definition at line 389 of file xml.c.

◆ GWEN_XMLNode_GetNameSpaces()

GWEN_XMLNODE_NAMESPACE_LIST * GWEN_XMLNode_GetNameSpaces ( const GWEN_XMLNODE * n)

Definition at line 1357 of file xml.c.

◆ GWEN_XMLNode_GetNextData()

GWEN_XMLNODE * GWEN_XMLNode_GetNextData ( const GWEN_XMLNODE * n)

Iterates on the same level in the XML tree from the given data node to the next one on the same level (i.e. the returned element has the same parent node as the given element). An XML element may have multiple data nodes as children, and you use this function to iterate through all of them.

Different from GWEN_XMLNode_Next() this function only looks for another data node and not for a (more general) node.

Returns
The next data node on the same level, or NULL if no more data node exists.

Definition at line 731 of file xml.c.

References GWEN_XMLNode_GetNextOfType(), GWEN_XMLNode_Next(), and GWEN_XMLNodeTypeData.

Referenced by GWEN_DBIO__XmlDb_ReadDataTags().

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

◆ GWEN_XMLNode_GetNextOfType()

GWEN_XMLNODE * GWEN_XMLNode_GetNextOfType ( const GWEN_XMLNODE * n,
GWEN_XMLNODE_TYPE t )

Definition at line 691 of file xml.c.

References GWEN_XMLNode_Next().

Referenced by GWEN_XMLNode_GetNextData(), and GWEN_XMLNode_GetNextTag().

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

◆ GWEN_XMLNode_GetNextProperty()

GWEN_XMLPROPERTY * GWEN_XMLNode_GetNextProperty ( const GWEN_XMLNODE * n,
const GWEN_XMLPROPERTY * pr )

Definition at line 1053 of file xml.c.

◆ GWEN_XMLNode_GetNextTag()

GWEN_XMLNODE * GWEN_XMLNode_GetNextTag ( const GWEN_XMLNODE * n)

Iterates on the same level in the XML tree from the given tag (in XML notation they are called elements) to the next one on the same level (i.e. the returned element has the same parent node as the given element).

Different from GWEN_XMLNode_Next() this function only looks for another tag/element and not for a (more general) node. You will probably prefer this function instead of GWEN_XMLNode_Next().

Returns
The next tag/element on the same level, or NULL if no more element exists.

Definition at line 712 of file xml.c.

References GWEN_XMLNode_GetNextOfType(), GWEN_XMLNode_Next(), and GWEN_XMLNodeTypeTag.

Referenced by _handleChildren_fromDb(), _handleChildren_toDb(), _handleChildren_toDb(), _parseChildNodes(), _parseChildNodes(), _parseChildNodes(), _parseChildNodes(), _parseChildNodes(), _parseChildNodes(), _readArgsLoop(), GWEN_DBIO__XmlDb_ImportGroup(), GWEN_MsgEngine__GetGroup(), GWEN_StringList2_fromXml(), GWEN_XMLNode__CheckNameSpaceDecls1(), GWEN_XMLNode__CheckNameSpaceDecls3(), GWEN_XMLNode__SetNameSpaces(), GWEN_XMLNode_FindNextTag(), GWEN_XMLNode_FindTag(), Typemaker2_Type_readMembersAndGroupsXml(), write_apidocrec_c(), write_code_constrec_c(), write_code_duprec_c(), write_code_freeElems_c(), write_code_fromdbrec_c(), write_code_setget_c(), write_code_todbrec_c(), write_h_setget_c(), write_h_struct_c(), write_ha_file_c(), write_hl_file_c(), and write_hp_group_c().

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

◆ GWEN_XMLNode_GetNodeByXPath()

GWEN_XMLNODE * GWEN_XMLNode_GetNodeByXPath ( GWEN_XMLNODE * n,
const char * path,
uint32_t flags )

Locates a tag by its XPath. Currently attributes are not allowed, and the flag GWEN_PATH_FLAGS_VARIABLE is not supported. Supported types of XPaths are:

  • /element[1]/element[2]
  • ../../element[5]

and so on. As you can see index numbers are supported. You should not use this function to create a node but rather for node lookups.

Definition at line 1311 of file xml.c.

References GWEN_Path_HandleWithIdx(), and GWEN_XMLNode_HandlePath().

Referenced by _getCharValueByPath(), _handleXmlEnter(), _handleXmlIfNotPathExists(), _handleXmlIfPathExists(), _setCharValueByPath(), _xmlCreateAndEnterElement(), GWEN_XMLNode_GetCharValueByPath(), and GWEN_XMLNode_SetCharValueByPath().

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

◆ GWEN_XMLNode_GetParent()

GWEN_XMLNODE * GWEN_XMLNode_GetParent ( const GWEN_XMLNODE * n)

◆ GWEN_XMLNode_GetProperty()

const char * GWEN_XMLNode_GetProperty ( const GWEN_XMLNODE * n,
const char * name,
const char * defaultValue )

Returns the value of the given property/attribute (or the default value if the property/attribute does not exist or is empty).

Parameters
nnode (must be a tag/element)
namename of the property/attribute
defaultValuedefault value to be returned if no value could be retrieved

Definition at line 239 of file xml.c.

Referenced by _addCommands(), _convertAndSetCharValue(), _convertAndSetCharValue(), _dbEnter(), _dbForEvery(), _dbIfCharDataMatches(), _dbIfHasCharData(), _dbIfNotCharDataMatches(), _dbIfNotHasCharData(), _dbIfNotPathExists(), _dbIfPathExists(), _getAndCheckRequiredGwenVersion(), _getCharValueByPath(), _getLocalizedLongDescrByFormat(), _getLongDescrByFormat(), _groupReadElement(), _handleDbCreateAndEnterGroup(), _handleDbCreateAndEnterGroup(), _handleDbCreateAndEnterTempGroup(), _handleDbCreateAndEnterTempGroup(), _handleDbSetCharValue_internal(), _handleDbSetCharValue_internal(), _handleXmlEnter(), _handleXmlEnter(), _handleXmlForEvery(), _handleXmlForEvery(), _handleXmlIfCharDataMatches(), _handleXmlIfCharDataMatches(), _handleXmlIfHasCharData(), _handleXmlIfHasCharData(), _handleXmlIfNotCharDataMatches(), _handleXmlIfNotCharDataMatches(), _handleXmlIfNotHasCharData(), _handleXmlIfNotHasCharData(), _handleXmlIfNotPathExists(), _handleXmlIfNotPathExists(), _handleXmlIfPathExists(), _handleXmlIfPathExists(), _parseArg(), _parseBuildCmd(), _parseBuildCommand(), _parseDefine(), _parseDefines(), _parseDep(), _parseI18n(), _parseIfNotVarMatches(), _parseIfVarMatches(), _parseIncludes(), _parseLib(), _parseOutFile(), _parseProg(), _parseSetVar(), _parseSubCmd(), _parseVersions(), _parseWriteFile(), _readArgsIncludes(), _readArgsInputFiles(), _readArgsOutputFiles(), _readFileListFromTagNode(), _readModifyWriteFile(), _readPluginDescriptionFromFile(), _readSubCmd(), _readTarget(), _setProjectVersionFromProjectAttributes(), _varHasValue(), _xmlCreateAndEnterElement(), _xmlSetCharValue(), get_function_name(), get_function_name2(), get_property(), get_struct_property(), GWB_GBuilderDescr_new(), GWB_GenericBuilder_new(), GWB_ParseOption(), GWB_ParseProject(), GWB_Parser_ParseSourcesOrHeaders(), GWEN_Crypt_Token_PluginManager_GetPluginDescrs(), GWEN_DBIO__XmlDb_ImportGroup(), GWEN_DBIO__XmlDb_ImportVar(), GWEN_Dialog_ReadXml(), GWEN_MsgEngine__findInValues(), GWEN_MsgEngine__GetGroup(), GWEN_MsgEngine__GetInline(), GWEN_MsgEngine__ListElement(), GWEN_MsgEngine__ListGroup(), GWEN_MsgEngine__ReadGroup(), GWEN_MsgEngine__ReadValue(), GWEN_MsgEngine__SearchForValue(), GWEN_MsgEngine__ShowElement(), GWEN_MsgEngine__ShowGroup(), GWEN_MsgEngine__TransformValue(), GWEN_MsgEngine__WriteElement(), GWEN_MsgEngine__WriteGroup(), GWEN_MsgEngine__WriteValue(), GWEN_MsgEngine_FindNodeByProperty(), GWEN_MsgEngine_FindNodeByPropertyStrictProto(), GWEN_MsgEngine_GetHighestTrustLevel(), GWEN_MsgEngine_ReadMessage(), GWEN_MsgEngine_SearchForProperty(), GWEN_Param_List_ReadValuesFromXml(), GWEN_PluginDescription_fromXml(), GWEN_Widget_ReadXml(), GWEN_XMLNode__CheckAndSetNameSpace(), GWEN_XMLNode_FindTag(), GWEN_XMLNode_NormalizeNameSpaces(), GWEN_XMLNode_WriteToStream(), Typemaker2_Code_ReadXml(), Typemaker2_Define_ReadXml(), Typemaker2_Enum_ReadXml(), Typemaker2_Group_readXml(), Typemaker2_Header_readXml(), Typemaker2_Inline_fromXml(), Typemaker2_Item_ReadXml(), Typemaker2_Member_readXml(), Typemaker2_Signal_ReadXml(), Typemaker2_Slot_ReadXml(), Typemaker2_Type_readXml(), Typemaker2_TypeManager_LoadType(), Typemaker2_VirtualFn_readXml(), write_apidoc_c(), write_apidocrec_c(), write_c_enums(), write_code_constrec_c(), write_code_dupArg_c(), write_code_dupList_c(), write_code_duprec_c(), write_code_freeElem_c(), write_code_fromdbArg_c(), write_code_fromdbrec_c(), write_code_setget_c(), write_code_todbArg_c(), write_code_todbrec_c(), write_h_elem_c(), write_h_enums(), write_h_func_c(), write_h_funcs(), write_h_header(), and write_h_setget_c().

Here is the caller graph for this function:

◆ GWEN_XMLNode_GetType()

◆ GWEN_XMLNode_GetUsage()

uint32_t GWEN_XMLNode_GetUsage ( const GWEN_XMLNODE * n)

Definition at line 362 of file xml.c.

◆ GWEN_XMLNode_GetXPath()

◆ GWEN_XMLNode_HandlePath()

◆ GWEN_XMLNode_IncUsage()

void GWEN_XMLNode_IncUsage ( GWEN_XMLNODE * n)

Definition at line 342 of file xml.c.

◆ GWEN_XMLNode_IsChildOf()

int GWEN_XMLNode_IsChildOf ( const GWEN_XMLNODE * parent,
const GWEN_XMLNODE * child )

Checks whether the second node is a child of the first one.

Returns
0 if statement is not true, !=0 otherwise

Definition at line 1079 of file xml.c.

Referenced by GWEN_XMLNode_GetXPath().

Here is the caller graph for this function:

◆ GWEN_XMLNode_NameSpace_dup()

GWEN_XMLNODE_NAMESPACE * GWEN_XMLNode_NameSpace_dup ( const GWEN_XMLNODE_NAMESPACE * ns)

Definition at line 2021 of file xml.c.

References GWEN_XMLNode_NameSpace_new().

Referenced by GWEN_XMLNode_AddNameSpace(), and GWEN_XMLNode_dup().

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

◆ GWEN_XMLNode_NameSpace_free()

void GWEN_XMLNode_NameSpace_free ( GWEN_XMLNODE_NAMESPACE * ns)

Definition at line 2009 of file xml.c.

References GWEN_FREE_OBJECT, and GWEN_LIST_FINI.

Referenced by GWEN_XmlCtxStore_AddAttr().

Here is the caller graph for this function:

◆ GWEN_XMLNode_NameSpace_GetName()

const char * GWEN_XMLNode_NameSpace_GetName ( const GWEN_XMLNODE_NAMESPACE * ns)

Definition at line 2032 of file xml.c.

Referenced by GWEN_XMLGL__GetNameSpaceByPrefix(), GWEN_XMLGL__TranslateName(), GWEN_XMLNode__WriteNamespacesToStream(), and GWEN_XMLNode_FindNameSpaceByName().

Here is the caller graph for this function:

◆ GWEN_XMLNode_NameSpace_GetUrl()

const char * GWEN_XMLNode_NameSpace_GetUrl ( const GWEN_XMLNODE_NAMESPACE * ns)

◆ GWEN_XMLNode_NameSpace_new()

GWEN_XMLNODE_NAMESPACE * GWEN_XMLNode_NameSpace_new ( const char * name,
const char * url )

Definition at line 1991 of file xml.c.

References GWEN_LIST_INIT, GWEN_Memory_strdup(), and GWEN_NEW_OBJECT.

Referenced by GWEN_XmlCtxStore_AddAttr(), GWEN_XMLGL__SampleNameSpaces(), and GWEN_XMLNode_NameSpace_dup().

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

◆ GWEN_XMLNode_new()

GWEN_XMLNODE * GWEN_XMLNode_new ( GWEN_XMLNODE_TYPE t,
const char * data )

Definition at line 144 of file xml.c.

References GWEN_LIST_INIT, GWEN_Memory_strdup(), GWEN_NEW_OBJECT, GWEN_XMLNode_List_new(), and GWEN_XMLNode_NameSpace_List_new().

Referenced by _exportDbToXml(), _readBuildFileList(), _readFromFile(), _readPluginDescriptionFromFile(), _writeCommandList2ToXml(), _writeFileList2ToXml(), _writeIdsFromFile2ListToXml(), _writeSubCommandListToXml(), GWB_BuildCmd_List2_WriteXml(), GWB_BuildCmd_List_WriteXml(), GWB_BuildCmd_toXml(), GWB_BuildCtx_ReadFromXmlFile(), GWB_BuildCtx_toXml(), GWB_BuildCtx_WriteToXmlFile(), GWB_Context_toXml(), GWB_File_List2_WriteXml(), GWB_GenericBuilder_Factory(), GWB_KeyValuePair_List_WriteXml(), GWB_Parser_ReadBuildFile(), GWB_Project_toXml(), GWB_Target_toXml(), GWB_Utils_ReadFileList2(), GWB_Utils_ReadInstallFileList(), GWB_Utils_ReadProjectInfoFromFile(), GWB_Utils_WriteBuildFileList(), GWB_Utils_WriteContextTreeToFile(), GWB_Utils_WriteInstallFileList(), GWB_Utils_WriteProjectFileList(), GWB_Utils_WriteProjectInfoToFile(), GWB_Utils_WriteProjectToFile(), GWEN_DBIO_XmlDb__ExportGroup(), GWEN_DBIO_XmlDb__ExportVar(), GWEN_DBIO_XmlDb_Export(), GWEN_DBIO_XmlDb_Import(), GWEN_Dialog_ReadXmlFile(), GWEN_Param_List_WriteValuesToXml(), GWEN_Param_List_WriteXml(), GWEN_Param_WriteXml(), GWEN_XmlCtxStore_AddData(), GWEN_XmlCtxStore_StartTag(), GWEN_XMLNode_dup(), GWEN_XMLNode_fromString(), GWEN_XMLNode_HandlePath(), GWEN_XMLNode_SetCharValue(), GWEN_XMLNode_SetCharValueByPath(), main(), Typemaker2_TypeManager_LoadType(), Typemaker2_TypeManager_LoadTypeFile(), Typemaker2_TypeManager_LoadTypeFile2(), and Typemaker2_TypeManager_LoadTypeFileNoLookup().

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

◆ GWEN_XMLNode_Next()

GWEN_XMLNODE * GWEN_XMLNode_Next ( const GWEN_XMLNODE * n)

INTERNAL. Iterates on the same level in the XML tree from the given node to the next one on the same level (i.e. the returned node has the same parent node as the given element). The returned node may be a tag/element node, or a property/attribute node, or a data node. You will probably prefer to use GWEN_XMLNode_GetNextTag() instead of this function.

Returns
The next node on the same level, or NULL if no more element exists.

Definition at line 465 of file xml.c.

References GWEN_XMLNode_List_Next().

Referenced by _readFileList(), addDefinitions(), GWEN_MsgEngine__findInValues(), GWEN_MsgEngine__ListGroup(), GWEN_MsgEngine__ReadGroup(), GWEN_MsgEngine__ShowGroup(), GWEN_MsgEngine__WriteGroup(), GWEN_MsgEngine_AddDefinitions(), GWEN_MsgEngine_FindNodeByProperty(), GWEN_MsgEngine_FindNodeByPropertyStrictProto(), GWEN_XMLNode__WriteTagToStream(), GWEN_XMLNode_AddChildrenOnly(), GWEN_XMLNode_Dump(), GWEN_XMLNode_dup(), GWEN_XMLNode_FindNode(), GWEN_XMLNode_GetFirstOfType(), GWEN_XMLNode_GetNextData(), GWEN_XMLNode_GetNextOfType(), GWEN_XMLNode_GetNextTag(), and GWEN_XMLNode_WriteToStream().

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

◆ GWEN_XMLNode_NormalizeNameSpaces()

int GWEN_XMLNode_NormalizeNameSpaces ( GWEN_XMLNODE * n)

This function removes unnecessary namespaces from the given node and all nodes below.

Definition at line 1808 of file xml.c.

References DBG_INFO, GWEN_LOGDOMAIN, GWEN_StringList2_free(), GWEN_StringList2_new(), GWEN_XMLNode__CheckNameSpaceDecls1(), GWEN_XMLNode__CheckNameSpaceDecls3(), and GWEN_XMLNode_GetProperty().

Here is the call graph for this function:

◆ GWEN_XMLNode_Path_Dive()

int GWEN_XMLNode_Path_Dive ( GWEN_XMLNODE_PATH * np,
GWEN_XMLNODE * n )

Adds a node to the path.

Definition at line 1935 of file xml.c.

References DBG_DEBUG, DBG_ERROR, and GWEN_LOGDOMAIN.

Referenced by GWEN_MsgEngine__WriteGroup(), and GWEN_MsgEngine_CreateMessageFromNode().

Here is the caller graph for this function:

◆ GWEN_XMLNode_Path_Dump()

void GWEN_XMLNode_Path_Dump ( GWEN_XMLNODE_PATH * np)

Dumps the contents of all XML nodes in the path.

Definition at line 1968 of file xml.c.

References DBG_NOTICE, GWEN_LOGDOMAIN, and GWEN_XMLNode_Dump().

Here is the call graph for this function:

◆ GWEN_XMLNode_Path_dup()

GWEN_XMLNODE_PATH * GWEN_XMLNode_Path_dup ( const GWEN_XMLNODE_PATH * np)

Definition at line 1913 of file xml.c.

References GWEN_NEW_OBJECT.

Referenced by GWEN_MsgEngine__WriteElement(), and GWEN_MsgEngine_GetGroup().

Here is the caller graph for this function:

◆ GWEN_XMLNode_Path_free()

void GWEN_XMLNode_Path_free ( GWEN_XMLNODE_PATH * np)

Definition at line 1928 of file xml.c.

References GWEN_FREE_OBJECT.

Referenced by GWEN_MsgEngine__WriteElement(), GWEN_MsgEngine_CreateMessageFromNode(), and GWEN_MsgEngine_GetGroup().

Here is the caller graph for this function:

◆ GWEN_XMLNode_Path_new()

GWEN_XMLNODE_PATH * GWEN_XMLNode_Path_new ( void )

Definition at line 1903 of file xml.c.

References GWEN_NEW_OBJECT.

Referenced by GWEN_MsgEngine_CreateMessageFromNode().

Here is the caller graph for this function:

◆ GWEN_XMLNode_Path_Surface()

GWEN_XMLNODE * GWEN_XMLNode_Path_Surface ( GWEN_XMLNODE_PATH * np)

Removes and returns the last added node (or 0 if that would bring us beyond the root).

Definition at line 1956 of file xml.c.

References DBG_DEBUG, and GWEN_LOGDOMAIN.

Referenced by GWEN_MsgEngine__SearchForValue(), GWEN_MsgEngine__WriteGroup(), and GWEN_MsgEngine_GetGroup().

Here is the caller graph for this function:

◆ GWEN_XMLNode_RemoveChildren()

void GWEN_XMLNode_RemoveChildren ( GWEN_XMLNODE * n)

Unlinks and frees all children of the given node.

Definition at line 580 of file xml.c.

References GWEN_XMLNode_List_Clear().

Referenced by GWEN_MsgEngine_ListMessage().

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

◆ GWEN_XMLNode_SetCharValue()

◆ GWEN_XMLNode_SetCharValueByPath()

int GWEN_XMLNode_SetCharValueByPath ( GWEN_XMLNODE * n,
uint32_t flags,
const char * name,
const char * value )

Definition at line 953 of file xml.c.

References DBG_ERROR, GWEN_ERROR_INVALID, GWEN_LOGDOMAIN, GWEN_XML_PATH_FLAGS_OVERWRITE_VALUES, GWEN_XMLNode_AddChild(), GWEN_XMLNode_GetNodeByXPath(), GWEN_XMLNode_List_Clear(), GWEN_XMLNode_new(), and GWEN_XMLNodeTypeData.

Referenced by _setCharValueByPath(), and GWEN_XMLNode_SetIntValueByPath().

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

◆ GWEN_XMLNode_SetData()

void GWEN_XMLNode_SetData ( GWEN_XMLNODE * n,
const char * data )

Set the character data of the given node to the given value. This function will create a deep copy of the character data.

Definition at line 377 of file xml.c.

References GWEN_Memory_dealloc(), and GWEN_Memory_strdup().

Here is the call graph for this function:

◆ GWEN_XMLNode_SetIntProperty()

void GWEN_XMLNode_SetIntProperty ( GWEN_XMLNODE * n,
const char * name,
int value )

Same as GWEN_XMLNode_SetProperty, but for integer values.

Definition at line 330 of file xml.c.

References GWEN_XMLNode__SetProperty().

Referenced by _writeFileList2ToXml(), _writeIdsFromFile2ListToXml(), and GWB_File_toXml().

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

◆ GWEN_XMLNode_SetIntValue()

void GWEN_XMLNode_SetIntValue ( GWEN_XMLNODE * n,
const char * name,
int value )

◆ GWEN_XMLNode_SetIntValueByPath()

int GWEN_XMLNode_SetIntValueByPath ( GWEN_XMLNODE * n,
uint32_t flags,
const char * name,
int value )

Definition at line 1003 of file xml.c.

References DBG_INFO, GWEN_LOGDOMAIN, and GWEN_XMLNode_SetCharValueByPath().

Here is the call graph for this function:

◆ GWEN_XMLNode_SetNamespace()

void GWEN_XMLNode_SetNamespace ( GWEN_XMLNODE * n,
const char * s )

Definition at line 397 of file xml.c.

References GWEN_Memory_dealloc(), GWEN_Memory_strdup(), and NULL.

Here is the call graph for this function:

◆ GWEN_XMLNode_SetProperty()

void GWEN_XMLNode_SetProperty ( GWEN_XMLNODE * n,
const char * name,
const char * value )

Sets the value of a property/attribute. This property/attribute will be created if it does not exist and overwritten if it does.

Parameters
nnode (must be a tag/element)
namename of the property/attribute
valuenew value of the property/attribute

Definition at line 322 of file xml.c.

References GWEN_XMLNode__SetProperty().

Referenced by _setCharValueByPath(), GWEN_DBIO_XmlDb__ExportGroup(), GWEN_DBIO_XmlDb__ExportVar(), GWEN_DBIO_XmlDb_Export(), GWEN_MsgEngine__ListElement(), GWEN_MsgEngine__ListGroup(), GWEN_Param_List_WriteValuesToXml(), GWEN_XmlCtxStore_AddAttr(), main(), Typemaker2_Code_WriteXml(), Typemaker2_Define_WriteXml(), Typemaker2_Enum_WriteXml(), Typemaker2_Item_WriteXml(), Typemaker2_Signal_WriteXml(), and Typemaker2_Slot_WriteXml().

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

◆ GWEN_XMLNode_StripNamespaces()

int GWEN_XMLNode_StripNamespaces ( GWEN_XMLNODE * n)

Definition at line 1832 of file xml.c.

References DBG_DEBUG, GWEN_LOGDOMAIN, GWEN_Memory_malloc(), GWEN_Memory_strdup(), GWEN_XMLNode_List_First(), GWEN_XMLNode_List_Next(), GWEN_XMLNode_StripNamespaces(), and GWEN_XMLNodeTypeTag.

Referenced by GWEN_XMLNode_StripNamespaces().

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

◆ GWEN_XMLNode_UnlinkChild()

void GWEN_XMLNode_UnlinkChild ( GWEN_XMLNODE * n,
GWEN_XMLNODE * child )

Unlinks the given child node from its parent without freeing it. This function relinquishes the ownership of the child to the caller who thereby becomes responsible for freeing this node.

Parameters
nnode which is suspected to be the parent of the second argument
childnode which is to be unlinked

Definition at line 570 of file xml.c.

References GWEN_XMLNode_List_Del().

Referenced by _moveSubTagsUpOneLevel(), _readFromFile(), GWB_GenericBuilder_Factory(), GWB_Parser_ReadBuildFile(), GWB_Utils_ReadProjectInfoFromFile(), and GWEN_XMLNode_AddChildrenOnly().

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

◆ GWEN_XMLProperty_add()

void GWEN_XMLProperty_add ( GWEN_XMLPROPERTY * p,
GWEN_XMLPROPERTY ** head )

Definition at line 111 of file xml.c.

References GWEN_LIST_ADD.

Referenced by GWEN_XMLNode__SetProperty(), GWEN_XMLNode_CopyProperties(), and GWEN_XMLNode_dup().

Here is the caller graph for this function:

◆ GWEN_XMLProperty_del()

void GWEN_XMLProperty_del ( GWEN_XMLPROPERTY * p,
GWEN_XMLPROPERTY ** head )

Definition at line 124 of file xml.c.

References GWEN_LIST_DEL.

Referenced by GWEN_XMLNode__CheckNameSpaceDecls1(), and GWEN_XMLNode__CheckNameSpaceDecls3().

Here is the caller graph for this function:

◆ GWEN_XMLProperty_dup()

GWEN_XMLPROPERTY * GWEN_XMLProperty_dup ( const GWEN_XMLPROPERTY * p)

Definition at line 98 of file xml.c.

References GWEN_XMLProperty_new().

Referenced by GWEN_XMLNode_CopyProperties(), and GWEN_XMLNode_dup().

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

◆ GWEN_XMLProperty_free()

void GWEN_XMLProperty_free ( GWEN_XMLPROPERTY * p)

Definition at line 86 of file xml.c.

References GWEN_FREE_OBJECT, and GWEN_Memory_dealloc().

Referenced by GWEN_XMLNode__CheckNameSpaceDecls1(), GWEN_XMLNode__CheckNameSpaceDecls3(), and GWEN_XMLProperty_freeAll().

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

◆ GWEN_XMLProperty_freeAll()

void GWEN_XMLProperty_freeAll ( GWEN_XMLPROPERTY * p)

Definition at line 130 of file xml.c.

References GWEN_XMLProperty_free().

Referenced by GWEN_XMLNode_free().

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

◆ GWEN_XMLProperty_GetName()

const char * GWEN_XMLProperty_GetName ( const GWEN_XMLPROPERTY * pr)

Definition at line 1063 of file xml.c.

◆ GWEN_XMLProperty_GetValue()

const char * GWEN_XMLProperty_GetValue ( const GWEN_XMLPROPERTY * pr)

Definition at line 1071 of file xml.c.

◆ GWEN_XMLProperty_insert()

void GWEN_XMLProperty_insert ( GWEN_XMLPROPERTY * p,
GWEN_XMLPROPERTY ** head )

Definition at line 118 of file xml.c.

References GWEN_LIST_INSERT.

Referenced by GWEN_XMLNode__SetProperty().

Here is the caller graph for this function:

◆ GWEN_XMLProperty_new()

GWEN_XMLPROPERTY * GWEN_XMLProperty_new ( const char * name,
const char * value )

Definition at line 72 of file xml.c.

References GWEN_Memory_strdup(), GWEN_NEW_OBJECT, and GWEN_XMLProperty_new().

Referenced by GWEN_XMLNode__SetProperty(), GWEN_XMLProperty_dup(), and GWEN_XMLProperty_new().

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