Formatted String Printing Functions

Formatted String Printing Functions

char *sqlite3_mprintf(const char*,...);
char *sqlite3_vmprintf(const char*, va_list);
char *sqlite3_snprintf(int,char*,const char*, ...);
char *sqlite3_vsnprintf(int,char*,const char*, va_list);

These routines are work-alikes of the "printf()" family of functions from the standard C library. These routines understand most of the common K&R formatting options, plus some additional non-standard formats, detailed below. Note that some of the more obscure formatting options from recent C-library standards are omitted from this implementation.

The sqlite3_mprintf() and sqlite3_vmprintf() routines write their results into memory obtained from sqlite3_malloc()- The strings returned by these two routines should be released by sqlite3_free(). Both routines return a NULL pointer if sqlite3_malloc(