Add mxs_json_error_append

Using this function, more error object can be added to the error
array of an json error object.
This commit is contained in:
Johan Wikman
2017-10-02 12:33:20 +03:00
parent 438b4e0341
commit e41f60fd2e
3 changed files with 114 additions and 7 deletions

View File

@ -116,4 +116,15 @@ json_t* mxs_json_pointer(json_t* json, const char* json_ptr);
*/
json_t* mxs_json_error(const char* format, ...);
/**
* @brief Append error to existing JSON object.
*
* @param object Existing json error object, or NULL.
* @param format Format string
* @param ... Variable argument list
*
* @return The error added to 'errors' array of the JSON object.
*/
json_t* mxs_json_error_append(json_t* object, const char* format, ...);
MXS_END_DECLS