JSON utility functions

The JSON library provides functions for writing formatted JSON data to an output string, similar to the snprintf() family of functions. For simple cases, they require somewhat less code than using an encoder, though there is less you can do with these functions.

While it might seem as if using snprintf() would be just as easy, jsnprintf() and vjsnprintf() can be quite a bit simpler and more readable for generating JSON data. If a parameter to be substituted into a JSON string contains characters such as newlines and double quotes, these JSON library functions will encode them as per the JSON specification.