From 0102df793c02c94eb48a16370610e0e28a5c3361 Mon Sep 17 00:00:00 2001 From: bpc2003 Date: Thu, 1 May 2025 12:23:37 -0400 Subject: Get started on xml encoding --- src/include/xml/xml.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/include/xml/xml.h (limited to 'src/include/xml/xml.h') diff --git a/src/include/xml/xml.h b/src/include/xml/xml.h new file mode 100644 index 0000000..c20f9d9 --- /dev/null +++ b/src/include/xml/xml.h @@ -0,0 +1,24 @@ +#ifndef XML_H +#define XML_H + +#include + +struct map { + char *tag; + void *payload; + size_t size; + size_t n; + struct map *attrs; + size_t n_attrs; +}; + +typedef struct map map_t; + +/* decode: decodes the provided xml statement into a map_t */ +map_t *decode(char *xml_str, int *len); + +/* encode: encodes the provided map_t into a xml statement */ +char *encode(map_t *map, int len); + + +#endif -- cgit v1.2.3