mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-14 05:15:11 +00:00
[ADD/MOD] XMPP->Matrix media bridge, small cleanup
This commit is contained in:
parent
4de7227ee7
commit
42d69226f0
14 changed files with 327 additions and 54 deletions
|
|
@ -5,7 +5,6 @@
|
|||
XMLElement *
|
||||
XMLDecode(Stream *stream, bool autofree)
|
||||
{
|
||||
/* TODO: Use the existing SAX parser to decode everything */
|
||||
#define push(x) ArrayAdd(stack, x)
|
||||
#define pop(x) ArrayDelete(stack, ArraySize(stack) - 1)
|
||||
#define peek(x) ArrayGet(stack, ArraySize(stack) - 1)
|
||||
|
|
@ -14,6 +13,7 @@ XMLDecode(Stream *stream, bool autofree)
|
|||
XMLElement *ret = NULL;
|
||||
XMLElement *top;
|
||||
char *key, *val;
|
||||
size_t i;
|
||||
|
||||
Array *stack;
|
||||
|
||||
|
|
@ -85,6 +85,15 @@ XMLDecode(Stream *stream, bool autofree)
|
|||
event = NULL;
|
||||
}
|
||||
XMLFreeEvent(event);
|
||||
for (i = 0; i < ArraySize(stack); i++)
|
||||
{
|
||||
XMLElement *e = ArrayGet(stack, i);
|
||||
if (e == ret)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
XMLFreeElement(e);
|
||||
}
|
||||
ArrayFree(stack);
|
||||
XMLFreeLexer(lexer);
|
||||
return ret;
|
||||
|
|
@ -158,8 +167,6 @@ XMLEncodeTag(Stream *stream, XMLElement *element)
|
|||
void
|
||||
XMLEncode(Stream *stream, XMLElement *element)
|
||||
{
|
||||
/* TODO: Write the entire XML element. This shouldn't be
|
||||
* too hard. */
|
||||
if (!stream || !element)
|
||||
{
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue