mirror of
https://github.com/json-c/json-c.git
synced 2026-03-29 18:09:07 +08:00
Issue #161: add a json_object_to_fd() function.
This commit is contained in:
13
json_util.h
13
json_util.h
@@ -67,7 +67,18 @@ 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);
|
||||
|
||||
/**
|
||||
* Return the last error from json_object_to_file{,_ext} or
|
||||
* Convert the json_object to a string and write it to the file descriptor.
|
||||
* Handles partial writes and will keep writing until done, or an error
|
||||
* occurs.
|
||||
*
|
||||
* @param flags flags to pass to json_object_to_json_string_ext()
|
||||
* @return -1 if something fails. See json_util_get_last_err() for details.
|
||||
*/
|
||||
extern int json_object_to_fd(int fd, struct json_object *obj, int flags);
|
||||
|
||||
/**
|
||||
* Return the last error from json_object_to_file{,_ext},
|
||||
* json_object_to_fd() or
|
||||
* json_object_from_{file,fd}, or NULL if there is none.
|
||||
*/
|
||||
const char *json_util_get_last_err(void);
|
||||
|
||||
Reference in New Issue
Block a user