summaryrefslogtreecommitdiffstats
path: root/web/server/h2o/libh2o/deps/klib/knhx.h
blob: dbad7dd9443c91a1093b0311adef752792287d2f (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
32
33
34
35
#ifndef KNHX_H_
#define KNHX_H_

#define KNERR_MISSING_LEFT   0x01
#define KNERR_MISSING_RGHT   0x02
#define KNERR_BRACKET        0x04
#define KNERR_COLON          0x08

typedef struct {
	int parent, n;
	int *child;
	char *name;
	double d;
} knhx1_t;

#ifndef KSTRING_T
#define KSTRING_T kstring_t
typedef struct __kstring_t {
	size_t l, m;
	char *s;
} kstring_t;
#endif

#ifdef __cplusplus
extern "C" {
#endif

	knhx1_t *kn_parse(const char *nhx, int *_n, int *_error);
	void kn_format(const knhx1_t *node, int root, kstring_t *s);

#ifdef __cplusplus
}
#endif

#endif