blob: d7f897656dfafea04080d182856c2d202f587f17 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
#ifndef COMET_FORMAT_H
#define COMET_FORMAT_H
#include <stdint.h>
#include <stdbool.h>
typedef int format_mark_t;
typedef struct {
char *string;
format_mark_t mark;
} format_pair_t;
typedef struct {
format_pair_t *parts;
size_t length;
} format_t;
typedef struct {
format_pair_t option;
const format_pair_t *prefixes;
const 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_option_t *options);
void format_free(format_t *format);
#endif
|