modbusd
modbus master daemon
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
json.h
Go to the documentation of this file.
1 
7 #pragma once
8 
9 #include "json/cJSON.h"
10 
18 char * json_get_char (cJSON *inJson, const char *key);
19 
27 int json_get_int (cJSON *inJson, const char *key);
28 
29 
38 void json_set_int (cJSON *inJson, const char *key, int value);
39 
47 double json_get_double (cJSON *inJson, const char *key);
48 
57 void json_set_double (cJSON *inJson, const char *key, double value);
58 
66 long json_get_long (cJSON *inJson, const char *key);
67 
75 int file_to_json (const char *fname, cJSON **outJson);
76 
84 int json_to_file (const char *fname, cJSON *inJson);
double json_get_double(cJSON *inJson, const char *key)
Get double integer value via key from cJSON object.
Definition: json.c:26
long json_get_long(cJSON *inJson, const char *key)
Get long integer value via key from cJSON object.
Definition: json.c:36
void json_set_int(cJSON *inJson, const char *key, int value)
Set integer value via key to existed cJSON object.
Definition: json.c:21
int file_to_json(const char *fname, cJSON **outJson)
Load JSON file to cJSON object.
Definition: json.c:42
char * json_get_char(cJSON *inJson, const char *key)
Get char string via key from cJSON object.
Definition: json.c:11
void json_set_double(cJSON *inJson, const char *key, double value)
Set double integer value via key to existed cJSON object.
Definition: json.c:31
int json_get_int(cJSON *inJson, const char *key)
Get integer value via key from cJSON object.
Definition: json.c:16
int json_to_file(const char *fname, cJSON *inJson)
Save cJSON object to JSON file.
Definition: json.c:71
Definition: cJSON.h:47