Introduce json_object_from_fd

Also refactor json_object_from_file to use json_object_from_fd
internally.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
This commit is contained in:
Michael Heimpold
2014-07-21 23:15:45 +02:00
parent d4e81f9ec8
commit a7534dbb7e
2 changed files with 27 additions and 11 deletions

View File

@@ -31,6 +31,7 @@ extern "C" {
/* utility functions */
extern struct json_object* json_object_from_file(const char *filename);
extern struct json_object* json_object_from_fd(int fd);
extern int json_object_to_file(const char *filename, struct json_object *obj);
extern int json_object_to_file_ext(const char *filename, struct json_object *obj, int flags);
extern int json_parse_int64(const char *buf, int64_t *retval);