created get_string_from_json_string function
This commit is contained in:
parent
885b99b7a8
commit
259a9e7c82
@ -158,6 +158,17 @@ char *get_string_from_json(struct json_object *json, char *string)
|
|||||||
struct json_object *object;
|
struct json_object *object;
|
||||||
json_object_object_get_ex(json, string, &object);
|
json_object_object_get_ex(json, string, &object);
|
||||||
|
|
||||||
|
return (char*) json_object_get_string(object);
|
||||||
|
}
|
||||||
|
|
||||||
|
char *get_string_from_json_string(char *json, char *string)
|
||||||
|
{
|
||||||
|
struct json_object *json_obj = json_tokener_parse(json);
|
||||||
|
char *returning = get_string_from_json(json_obj, string);
|
||||||
|
|
||||||
|
//DEALLOCATION
|
||||||
|
json_object_put(json_obj);
|
||||||
|
|
||||||
//GET STRINGS
|
//GET STRINGS
|
||||||
return returning;
|
return returning;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user