summaryrefslogtreecommitdiff
path: root/src/runtime/c/gu/dump.h
blob: 7d6f10a772ba46a44c2c1a3b8fa0ebd4355a8d4d (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
#ifndef GU_DUMP_H_
#define GU_DUMP_H_

#include <gu/defs.h>
#include <gu/yaml.h>
#include <gu/type.h>
#include <gu/map.h>

typedef struct GuDump GuDump;

struct GuDump {
	GuPool* pool;
	GuYaml* yaml;
	GuMap* data;
	GuTypeMap* dumpers;
	bool print_address;
};

typedef void (*GuDumpFn)(GuFn* self, GuType* type, const void* value, GuDump* ctx);

GuDump*
gu_new_dump(GuWriter* wtr, GuTypeTable* dumpers, GuExn* err, GuPool* pool);

void
gu_dump(GuType* type, const void* value, GuDump* ctx);

void
gu_dump_stderr(GuType* type, const void* value, GuExn* err);

extern GuTypeTable
gu_dump_table;


#endif // GU_DUMP_H_