update stuff

This commit is contained in:
alessandro bason 2025-06-15 11:32:55 +02:00
parent 6d36aa4442
commit 95d74c2ef4
13 changed files with 1196 additions and 48 deletions

View file

@ -60,6 +60,24 @@ i64 ini_as_int(inivalue_t *value);
double ini_as_num(inivalue_t *value);
bool ini_as_bool(inivalue_t *value);
typedef enum {
INI_PRETTY_COLOUR_KEY,
INI_PRETTY_COLOUR_VALUE,
INI_PRETTY_COLOUR_DIVIDER,
INI_PRETTY_COLOUR_TABLE,
INI_PRETTY_COLOUR__COUNT,
} ini_pretty_colours_e;
typedef struct ini_pretty_opts_t ini_pretty_opts_t;
struct ini_pretty_opts_t {
oshandle_t custom_target;
bool use_custom_colours;
os_log_colour_e colours[INI_PRETTY_COLOUR__COUNT];
};
void ini_pretty_print(ini_t *ini, const ini_pretty_opts_t *options);
// == JSON ===========================================
typedef enum jsontype_e {
@ -153,4 +171,29 @@ xml_t xml_parse_str(arena_t *arena, strview_t xmlstr);
xmltag_t *xml_get_tag(xmltag_t *parent, strview_t key, bool recursive);
strview_t xml_get_attribute(xmltag_t *tag, strview_t key);
#endif
// == HTML ===========================================
typedef struct htmltag_t htmltag_t;
struct htmltag_t {
str_t key;
xmlattr_t *attributes;
strview_t content;
htmltag_t *children;
htmltag_t *tail;
htmltag_t *next;
};
typedef struct html_t html_t;
struct html_t {
strview_t text;
htmltag_t *root;
htmltag_t *tail;
};
html_t html_parse(arena_t *arena, strview_t filename);
html_t html_parse_str(arena_t *arena, strview_t str);
htmltag_t *html_get_tag(htmltag_t *parent, strview_t key, bool recursive);
strview_t html_get_attribute(htmltag_t *tag, strview_t key);
#endif