#ifndef WEB_DOM_H #define WEB_DOM_H #include struct dom_elem { char *ns, *name, *content; int n_attrs, size_attrs; char **attr_names, **attr_vals; }; struct dom_elem *dom_elem_init(char *ns, char *name, int size_attrs); 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_append_elemv(char *sel, int elemc, struct dom_elem **elemv); char *dom_get_content(char *sel); void dom_set_content(char *sel, char *str); void dom_set_value(char *sel, char *str); bool dom_has_class(char *sel, char *class); void dom_add_class(char *sel, char *class); void dom_remove_class(char *sel, char *class); void dom_toggle_class(char *sel, char *class); void dom_set_uniq_class(char *sel, char *class, char *sel_set); void dom_scroll_to_bottom(char *sel); #endif