aboutsummaryrefslogtreecommitdiff
path: root/src/format.h
diff options
context:
space:
mode:
authorFederico Angelilli <code@fedang.net>2024-11-19 01:13:47 +0100
committerFederico Angelilli <code@fedang.net>2024-11-19 01:13:47 +0100
commit0d088e48b5e4480fe2421bb90d601131bed35c8a (patch)
treed60c348cfa44fae7796e46a7e29492764a475fc8 /src/format.h
parent7a33c4e201783acb7d5bdd07bbccf921940b332c (diff)
Update format
Diffstat (limited to 'src/format.h')
-rw-r--r--src/format.h21
1 files changed, 13 insertions, 8 deletions
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 <stdint.h>
#include <stdbool.h>
+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);