Updated: October 28, 2024 |
Write JSON data to a character array, up to a given number of characters (varargs)
#include <sys/json.h>
int vjsnprintf(char *buffer, int len, const char *format, va_list args);
The vjsnprintf() function formats JSON data based on the format string and stores the result in buffer. The maximum number of characters written, including a terminating null character, is given by len.
The vjsnprintf() function is a “varargs” version of jsnprintf(). For details on what the format-specifier string can contain, including conversion specifiers, see jsnprintf().
The number of characters that were written to the output buffer or that would have been written had it been large enough, not including the terminating null character. -1 is returned if the format-specifier string is invalid.