|
json-gen-c
0.1.5
json-gen-c generate C code for json manipulation
|
Generate MessagePack pack/unpack C code from parsed schema. More...
#include "gencode/gencode.h"#include <stdio.h>#include <stdlib.h>#include <string.h>#include "struct/struct_parse.h"#include "utils/hash_map.h"#include "utils/sstr.h"#include "utils/hash.h"#include "extra_codes_msgpack.inc"
Classes | |
| struct | mp_gen_struct_param |
| struct | mp_gen_oneof_param |
Macros | |
| #define | DEPENDENCY_HASH_MAP_BUCKET_SIZE 4096 |
| #define | WIRE_KEY(f) sstr_cstr((f)->json_name ? (f)->json_name : (f)->name) |
Functions | |
| int | gencode_msgpack_source (struct hash_map *struct_map, struct hash_map *enum_map, struct hash_map *oneof_map, sstr_t source, sstr_t header) |
| generate MessagePack pack/unpack codes. | |
Generate MessagePack pack/unpack C code from parsed schema.
Parallel to gencode.c (JSON) but emits binary MessagePack codec using the msgpack_codec.h/c embedded runtime.
| int gencode_msgpack_source | ( | struct hash_map * | struct_map, |
| struct hash_map * | enum_map, | ||
| struct hash_map * | oneof_map, | ||
| sstr_t | source, | ||
| sstr_t | header | ||
| ) |
generate MessagePack pack/unpack codes.
| struct_map | the hash map that store all structs parsed from struct defintion files. |
| enum_map | the hash map that store all enums parsed from enum definitions. |
| oneof_map | the hash map that store all oneof (tagged union) definitions. |
| source | the output source code. |
| header | the output header code. |