klib
[Ported from github.com/attractivechaos/klib] added block arena
Brought by drakestapleton
klib / knhx.h
| 1 | #ifndef KNHX_H_ |
| 2 | #define KNHX_H_ |
| 3 | |
| 4 | #define KNERR_MISSING_LEFT 0x01 |
| 5 | #define KNERR_MISSING_RGHT 0x02 |
| 6 | #define KNERR_BRACKET 0x04 |
| 7 | #define KNERR_COLON 0x08 |
| 8 | |
| 9 | typedef struct { |
| 10 | int parent, n; |
| 11 | int *child; |
| 12 | char *name; |
| 13 | double d; |
| 14 | } knhx1_t; |
| 15 | |
| 16 | #ifndef KSTRING_T |
| 17 | #define KSTRING_T kstring_t |
| 18 | typedef struct __kstring_t { |
| 19 | size_t l, m; |
| 20 | char *s; |
| 21 | } kstring_t; |
| 22 | #endif |
| 23 | |
| 24 | #ifdef __cplusplus |
| 25 | extern "C" { |
| 26 | #endif |
| 27 | |
| 28 | knhx1_t *kn_parse(const char *nhx, int *_n, int *_error); |
| 29 | void kn_format(const knhx1_t *node, int root, kstring_t *s); |
| 30 | |
| 31 | #ifdef __cplusplus |
| 32 | } |
| 33 | #endif |
| 34 | |
| 35 | #endif |