mmmmh
This commit is contained in:
parent
82aee127b0
commit
a92b119549
99 changed files with 6922 additions and 5723 deletions
31
xml.h
Normal file
31
xml.h
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#pragma once
|
||||
|
||||
#include "str.h"
|
||||
#include "arena.h"
|
||||
|
||||
typedef struct xmlattr_t {
|
||||
strview_t key;
|
||||
strview_t value;
|
||||
struct xmlattr_t *next;
|
||||
} xmlattr_t;
|
||||
|
||||
typedef struct xmltag_t {
|
||||
strview_t key;
|
||||
xmlattr_t *attributes;
|
||||
strview_t content;
|
||||
struct xmltag_t *child;
|
||||
struct xmltag_t *tail;
|
||||
struct xmltag_t *next;
|
||||
} xmltag_t;
|
||||
|
||||
typedef struct {
|
||||
str_t text;
|
||||
xmltag_t *root;
|
||||
xmltag_t *tail;
|
||||
} xml_t;
|
||||
|
||||
xml_t xmlParse(arena_t *arena, strview_t filename);
|
||||
xml_t xmlParseStr(arena_t *arena, str_t xmlstr);
|
||||
|
||||
xmltag_t *xmlGetTag(xmltag_t *parent, strview_t key, bool recursive);
|
||||
strview_t xmlGetAttribute(xmltag_t *tag, strview_t key);
|
||||
Loading…
Add table
Add a link
Reference in a new issue