2013-06-23 02:33:52 +00:00
|
|
|
typedef struct xmlparams_s
|
|
|
|
{
|
|
|
|
char val[256]; //FIXME: make pointer
|
|
|
|
struct xmlparams_s *next;
|
2015-04-27 06:19:33 +00:00
|
|
|
char name[128]; //FIXME: make variable sized
|
2013-06-23 02:33:52 +00:00
|
|
|
} xmlparams_t;
|
|
|
|
|
|
|
|
typedef struct subtree_s
|
|
|
|
{
|
|
|
|
char name[64]; //FIXME: make pointer to tail of structure
|
|
|
|
char xmlns[64]; //namespace of the element //FIXME: make pointer to tail of structure
|
|
|
|
char xmlns_dflt[64]; //default namespace of children //FIXME: make pointer to tail of structure
|
2013-07-13 12:14:32 +00:00
|
|
|
char *body;//[2048]; //FIXME: make pointer+variablesized
|
2013-06-23 02:33:52 +00:00
|
|
|
|
|
|
|
xmlparams_t *params;
|
|
|
|
|
|
|
|
struct subtree_s *child;
|
|
|
|
struct subtree_s *sibling;
|
|
|
|
} xmltree_t;
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-10-12 12:02:25 +00:00
|
|
|
const char *XML_GetParameter(xmltree_t *t, const char *paramname, const char *def);
|
|
|
|
void XML_AddParameter(xmltree_t *t, const char *paramname, const char *value);
|
|
|
|
void XML_AddParameteri(xmltree_t *t, const char *paramname, int value);
|
|
|
|
xmltree_t *XML_CreateNode(xmltree_t *parent, const char *name, const char *xmlns, const char *body);
|
|
|
|
char *XML_Markup(const char *s, char *d, int dlen);
|
2013-06-23 02:33:52 +00:00
|
|
|
void XML_Unmark(char *s);
|
2013-07-13 12:14:32 +00:00
|
|
|
char *XML_GenerateString(xmltree_t *root, qboolean readable);
|
2017-10-12 12:02:25 +00:00
|
|
|
xmltree_t *XML_Parse(const char *buffer, int *startpos, int maxpos, qboolean headeronly, const char *defaultnamespace);
|
2013-06-23 02:33:52 +00:00
|
|
|
void XML_Destroy(xmltree_t *t);
|
2017-10-12 12:02:25 +00:00
|
|
|
xmltree_t *XML_ChildOfTree(xmltree_t *t, const char *name, int childnum);
|
|
|
|
xmltree_t *XML_ChildOfTreeNS(xmltree_t *t, const char *xmlns, const char *name, int childnum);
|
|
|
|
const char *XML_GetChildBody(xmltree_t *t, const char *paramname, const char *def);
|
|
|
|
void XML_ConPrintTree(xmltree_t *t, const char *subconsole, int indent);
|
2013-07-13 12:14:32 +00:00
|
|
|
|
2017-10-12 12:02:25 +00:00
|
|
|
xmltree_t *XML_FromJSON(xmltree_t *t, const char *name, const char *json, int *jsonpos, int jsonlen);
|