diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2022-05-09 18:02:30 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2022-05-09 18:09:24 -0700 |
commit | c227fb7cc9e30d6a4330cdad34b0b2a53b014d93 (patch) | |
tree | 4d5f6f4bfcb15e67de4bb588334f3b7facf86aa4 /web/web_dom.h | |
parent | 9ba644fd849ef7664be009e00206bf5eb1b85762 (diff) | |
download | dartboat-c227fb7cc9e30d6a4330cdad34b0b2a53b014d93.tar.gz dartboat-c227fb7cc9e30d6a4330cdad34b0b2a53b014d93.tar.xz |
web: add support for child DOM elements and text nodes
Diffstat (limited to 'web/web_dom.h')
-rw-r--r-- | web/web_dom.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/web/web_dom.h b/web/web_dom.h index 41ac46d..e89b5ba 100644 --- a/web/web_dom.h +++ b/web/web_dom.h @@ -4,15 +4,19 @@ #include <stdbool.h> struct dom_elem { - char *ns, *name, *content; + char *type, *ns, *name, *content; int n_attrs, size_attrs; char **attr_names, **attr_vals; + int n_children, size_children; + struct dom_elem **children; }; struct dom_elem *dom_elem_init(char *ns, char *name, int size_attrs); +struct dom_elem *dom_text_init(char *content); void dom_elem_free(struct dom_elem *e); void dom_elem_add_attr(struct dom_elem *e, char *name, char *val); void dom_elem_add_attrd(struct dom_elem *e, char *name, double val); +void dom_elem_add_child(struct dom_elem *e, struct dom_elem *child); void dom_append_elemv(char *sel, int elemc, struct dom_elem **elemv); |