-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathformatter.h
43 lines (28 loc) · 1.18 KB
/
formatter.h
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
32
33
34
35
36
37
38
39
40
41
42
43
/*
* multihash - compute hashes on collections of files
* Copyright (c) 2016 Nicolas George <[email protected]>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*/
#include <stdint.h>
typedef struct Formatter Formatter;
int formatter_alloc(Formatter **rfmt);
void formatter_free(Formatter **rfmt);
void formatter_open(Formatter *fmt);
int formatter_close(Formatter *fmt);
void formatter_dict_open(Formatter *fmt);
void formatter_dict_close(Formatter *fmt);
void formatter_dict_item(Formatter *fmt, const char *key);
void formatter_array_open(Formatter *fmt);
void formatter_array_close(Formatter *fmt);
void formatter_array_item(Formatter *fmt);
void formatter_string(Formatter *fmt, const unsigned char *str);
void formatter_integer(Formatter *fmt, intmax_t x);
void formatter_bool(Formatter *fmt, int x);