aboutsummaryrefslogtreecommitdiff
path: root/src/format.h
blob: 69d9fa8b9a542d794f720562c5637b8e39217dfc (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
#ifndef COMET_FORMAT_H
#define COMET_FORMAT_H

#include <stdint.h>
#include <stdbool.h>

typedef struct {
    char **parts;
    uint8_t *marks;
    size_t length;
} format_t;

typedef struct {
    const char *key;
    uint8_t mark;
} format_pair_t;

bool format_init(format_t *format, const char *string, char delim);

bool format_remark(format_t *format, const char *label, const format_pair_t *pairs);

void format_free(format_t *format);

#endif