#ifndef WEB_DOM_H #define WEB_DOM_H #include struct elem { char *ns, *name, *content; int n_attrs, size_attrs; char **attr_names, **attr_vals; }; struct elem *elem_init(char *ns, char *name, int size_attrs); void elem_free(struct elem *e); void elem_add_attr(struct elem *e, char *name, char *val); void elem_add_attr_double(struct elem *e, char *name, double val); void append_elemv(char *sel, int elemc, struct elem **elemv); char *dom_elem_get_content(char *sel); void dom_elem_set_content(char *sel, char *str); void dom_elem_set_value(char *sel, char *str); bool dom_elem_has_class(char *sel, char *class); void dom_elem_add_class(char *sel, char *class); void dom_elem_remove_class(char *sel, char *class); void dom_elem_toggle_class(char *sel, char *class); void dom_elem_set_uniq_class(char *sel, char *class, char *sel_set); void dom_elem_scroll_to_bottom(char *sel); #endif