|
json-gen-c
0.1.5
json-gen-c generate C code for json manipulation
|
Generate a Go source file (.go) with native encoding/json-compatible structs and type-safe enums from the parsed schema. The output is a single self-contained Go file using only the standard library. More...
#include "gencode/gencode.h"#include "struct/struct_parse.h"#include "utils/hash_map.h"#include "utils/sstr.h"#include <ctype.h>#include <stdio.h>#include <string.h>
Classes | |
| struct | go_emit_ctx |
| struct | dep_emit_ctx |
Functions | |
| int | gencode_go (struct hash_map *struct_map, struct hash_map *enum_map, struct hash_map *oneof_map, const char *package_name, sstr_t output) |
| generate a Go source file (.go) with native encoding/json-compatible structs and enums. | |
Generate a Go source file (.go) with native encoding/json-compatible structs and type-safe enums from the parsed schema. The output is a single self-contained Go file using only the standard library.
| int gencode_go | ( | struct hash_map * | struct_map, |
| struct hash_map * | enum_map, | ||
| struct hash_map * | oneof_map, | ||
| const char * | package_name, | ||
| sstr_t | output | ||
| ) |
generate a Go source file (.go) with native encoding/json-compatible structs and enums.
| struct_map | parsed struct definitions. |
| enum_map | parsed enum definitions. |
| oneof_map | parsed oneof (tagged union) definitions. |
| package_name | Go package name to use. |
| output | the output Go source content. |