libjapi  0.3.2
Universal JSON API Library
 All Data Structures Files Functions Variables Typedefs Macros Pages
japi_utils.h
Go to the documentation of this file.
1 
34 #ifndef __JAPI_UTILS_H__
35 #define __JAPI_UTILS_H__
36 
37 #include <json-c/json.h>
38 #include <stdbool.h>
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
59 int japi_get_value_as_str(json_object *jobj, const char *key, const char **val);
60 
76 int japi_get_value_as_bool(json_object *jobj, const char *key, bool *val);
77 
93 int japi_get_value_as_int(json_object *jobj, const char *key, int *val);
94 
110 int japi_get_value_as_int64(json_object *jobj, const char *key, long long int *val);
111 
127 int japi_get_value_as_double(json_object *jobj, const char *key, double *val);
128 
142 char* japi_get_jobj_as_ndstr(json_object *jobj);
143 
144 #ifdef __cplusplus
145 }
146 #endif
147 
148 #endif /* __JAPI_UTILS_H__ */
int japi_get_value_as_int64(json_object *jobj, const char *key, long long int *val)
Get int64 value from json key.
Definition: japi_utils.c:158
int japi_get_value_as_int(json_object *jobj, const char *key, int *val)
Get int value from json key.
Definition: japi_utils.c:123
char * japi_get_jobj_as_ndstr(json_object *jobj)
Returns a string with added newline.
Definition: japi_utils.c:229
int japi_get_value_as_bool(json_object *jobj, const char *key, bool *val)
Get boolean value from json key.
Definition: japi_utils.c:87
int japi_get_value_as_str(json_object *jobj, const char *key, const char **val)
Get string value from json key.
Definition: japi_utils.c:51
int japi_get_value_as_double(json_object *jobj, const char *key, double *val)
Get double value from json key.
Definition: japi_utils.c:194