Parsee/src/include/XEP393.h
LDA 61b248363d [ADD/WIP] Codenames, try to get codeblocks basics
Mostly focused on the LMDB support right now, sorry!
2024-08-10 09:52:11 +02:00

53 lines
1.3 KiB
C

#ifndef PARSEE_XEP393_H
#define PARSEE_XEP393_H
/*-*
* A basic XEP-0393 parser and XHTML-iser.
* --------
* Writren-By: LDA */
#include <Cytoplasm/Array.h>
typedef enum XEP393Type {
XEP393_ROOT,
XEP393_ITALIC,
XEP393_EMPH,
XEP393_SRKE,
XEP393_MONO,
XEP393_CODE,
XEP393_TEXT,
XEP393_QUOT,
XEP393_LINE,
XEP393_NL
} XEP393Type;
typedef struct XEP393Element {
struct XEP393Element *parent;
XEP393Type type;
char *text_data;
Array *children;
} XEP393Element;
/** Tries to decode a XEP-393 message into a formatted structure.
* --------
* Returns: A root XEP393Element[LA:HEAP] | NULL
* Modifies: NOTHING
* See-Also: https://xmpp.org/extensions/xep-0393.html, XEP393FreeElement */
extern XEP393Element * XEP393(char *message);
/** Frees an XEP-0393 {element}, alongside all it's children
* --------
* Returns: NOTHING
* Modifies: {element}
* See-Also: https://xmpp.org/extensions/xep-0393.html, XEP393 */
extern void XEP393FreeElement(XEP393Element *element);
/** Converts a XEP-0393 element to a XMLd string
* --------
* Returns: A string representing a XML'ified version of {xepd}[LA:HEAP]
* Modifies: NOTHING
* See-Also: https://xmpp.org/extensions/xep-0393.html, XEP393FreeElement, XEP393 */
extern char * XEP393ToXMLString(XEP393Element *xepd);
#endif