22 #include "verilog-parser/src/verilog_ast_common.h" 24 #ifndef VERIDOC_JSON_H 25 #define VERIDOC_JSON_H 32 typedef struct json_file_t{
100 json_object * toemit,
102 unsigned char as_list
108 typedef enum json_kvp_type_e{
116 typedef struct json_kvp_t{
ast_list * kvps
Key value pairs. Each value is a json_kvp.
Definition: veridoc-json.h:56
void json_emit_object(json_file *fh, json_object *toemit, char *varName, unsigned char as_list)
emits the supplied object into the supplied file, with an optional variable name. ...
Definition: veridoc-json.c:122
int integer
IFF type == INT.
Definition: veridoc-json.h:120
Value is a json_object.
Definition: veridoc-json.h:112
void json_close_file(json_file *tofree)
Frees the memory allocated to a json_file construct and closes the file.
Definition: veridoc-json.c:37
json_object * json_new_object()
Creates and returns a pointer to a new json object.
Definition: veridoc-json.c:61
json_file * json_new_file(char *path)
Creates a new json file handle.
Definition: veridoc-json.c:17
json_object * list
IFF type == LIST.
Definition: veridoc-json.h:122
char * string
IFF type == STR.
Definition: veridoc-json.h:121
FILE * fh
The open file handle.
Definition: veridoc-json.h:34
Stores a single <key,value> pair.
Definition: veridoc-json.h:116
void json_object_add_string(json_object *obj, char *key, char *value)
Adds a string and associated key to the supplied object.
Definition: veridoc-json.c:70
json_object * object
IFF type == OBJ.
Definition: veridoc-json.h:123
json_kvp * json_new_kvp(char *key, json_kvp_type type)
Creates and returns a new KVP object with the supplied key and datatype.
Definition: veridoc-json.c:48
json_kvp_type
Describes the type of object stored in a json_kvp.
Definition: veridoc-json.h:108
A holder for a new json object or collection of properties.
Definition: veridoc-json.h:55
void json_object_add_object(json_object *obj, char *key, json_object *value)
Adds a object and associated key to the supplied object.
Definition: veridoc-json.c:103
char * key
What sort of data type does the key point at?
Definition: veridoc-json.h:118
void json_object_add_int(json_object *obj, char *key, int value)
Adds an integer and associated key to the supplied object.
Definition: veridoc-json.c:81
Value is a string (char*)
Definition: veridoc-json.h:110
char * file_path
Output file path.
Definition: veridoc-json.h:33
A simple structure for helping to write out JSON encoded data.
Definition: veridoc-json.h:32
Value is an integer (int)
Definition: veridoc-json.h:109
void json_object_add_list(json_object *obj, char *key, json_object *list)
Adds a list and associated key to the supplied object.
Definition: veridoc-json.c:92
Value is a json_list.
Definition: veridoc-json.h:111