From 0d088e48b5e4480fe2421bb90d601131bed35c8a Mon Sep 17 00:00:00 2001 From: Federico Angelilli Date: Tue, 19 Nov 2024 01:13:47 +0100 Subject: Update format --- src/format.h | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'src/format.h') diff --git a/src/format.h b/src/format.h index 8f8eafc..e5173de 100644 --- a/src/format.h +++ b/src/format.h @@ -4,22 +4,27 @@ #include #include +typedef int format_mark_t; + typedef struct { - char **parts; - uint8_t *marks; + char *string; + format_mark_t mark; +} format_pair_t; + +typedef struct { + format_pair_t *parts; size_t length; } format_t; typedef struct { - const char *key; - uint8_t mark; - bool prefix; - bool postfix; -} format_pair_t; + format_pair_t option; + format_pair_t *prefixes; + format_pair_t *suffixes; +} format_option_t; bool format_init(format_t *format, const char *string, char delim); -int format_remark(format_t *format, const char *label, const format_pair_t *pairs); +int format_remark(format_t *format, const char *label, const format_option_t *options); void format_free(format_t *format); -- cgit v1.2.3