[ADD/FIX/WIP] "Fix" concurrency, prepare XEP-0421

I'll need to break down my commits more...
This commit is contained in:
LDA 2024-07-18 15:50:19 +02:00
commit 63c1bc819e
14 changed files with 356 additions and 162 deletions

View file

@ -4,6 +4,8 @@
#include <Cytoplasm/Str.h>
#include <Cytoplasm/Log.h>
#include <string.h>
XMLElement *
XMLCreateTag(char *name)
{
@ -43,8 +45,10 @@ XMLCreateText(char *data)
elem->data = StrDuplicate(data);
return elem;
}
void
XMLAddAttr(XMLElement *element, char *key, char *val)
{
@ -52,12 +56,12 @@ XMLAddAttr(XMLElement *element, char *key, char *val)
{
return;
}
if (element->type != XML_ELEMENT_TAG)
if (element->type != XML_ELEMENT_TAG || !element->attrs)
{
return;
}
HashMapSet(element->attrs, key, StrDuplicate(val));
Free(HashMapSet(element->attrs, key, StrDuplicate(val)));
}
void
XMLAddChild(XMLElement *element, XMLElement *child)