*** DRAFT ***

SQLite Requirement Matrix Details
mprintf.html

Index Summary Markup Original


R-23566-61685-32570-49548-46504-50893-18012-49598 tcl slt th3 src

The sqlite3_mprintf() and sqlite3_vmprintf() routines write their results into memory obtained from sqlite3_malloc().

th3/req1/malloc01.test:32

/* IMP: R-23566-61685 */
# EVIDENCE-OF: R-23566-61685 The sqlite3_mprintf() and
# sqlite3_vmprintf() routines write their results into memory obtained
# from sqlite3_malloc().

R-47066-28880-03512-24008-47345-51727-07971-11706 tcl slt th3 src

Both routines return a NULL pointer if sqlite3_malloc() is unable to allocate enough memory to hold the resulting string.

th3/req1/malloc01.test:50

/* IMP: R-47066-28880 */
# EVIDENCE-OF: R-47066-28880 Both routines return a NULL pointer if
# sqlite3_malloc() is unable to allocate enough memory to hold the
# resulting string.

R-36610-45292-54097-28024-65527-46641-42678-27744 tcl slt th3 src

The sqlite3_snprintf() routine is similar to "snprintf()" from the standard C library. The result is written into the buffer supplied as the second parameter whose size is given by the first parameter. Note that the order of the first two parameters is reversed from snprintf().

th3/req1/malloc01.test:81

/* IMP: R-36610-45292 */
# EVIDENCE-OF: R-36610-45292 The sqlite3_snprintf() routine is similar
# to "snprintf()" from the standard C library. The result is written
# into the buffer supplied as the second parameter whose size is given
# by the first parameter. Note that the order of the first two
# parameters is reversed from snprintf().

R-45725-33143-49569-42045-56416-09972-18063-04229 tcl slt th3 src

Note also that sqlite3_snprintf() returns a pointer to its buffer instead of the number of characters actually written into the buffer.

th3/req1/malloc01.test:108

/* IMP: R-45725-33143 */
# EVIDENCE-OF: R-45725-33143 Note also that sqlite3_snprintf() returns a
# pointer to its buffer instead of the number of characters actually
# written into the buffer.

R-09798-06276-54780-63214-14309-15802-32530-00850 tcl slt th3 src

As long as the buffer size is greater than zero, sqlite3_snprintf() guarantees that the buffer is always zero-terminated.

th3/req1/malloc01.test:90

/* IMP: R-09798-06276 */
# EVIDENCE-OF: R-09798-06276 As long as the buffer size is greater than
# zero, sqlite3_snprintf() guarantees that the buffer is always
# zero-terminated.

R-04304-33529-02265-14363-24121-34151-06311-12119 tcl slt th3 src

The first parameter "n" is the total size of the buffer, including space for the zero terminator.

th3/req1/malloc01.test:87

/* IMP: R-04304-33529 */
# EVIDENCE-OF: R-04304-33529 The first parameter "n" is the total size
# of the buffer, including space for the zero terminator.

R-34407-33329-56662-13063-42233-50984-46328-08443 tcl slt th3 src

The sqlite3_vsnprintf() routine is a varargs version of sqlite3_snprintf().

th3/req1/malloc01.test:100

/* IMP: R-34407-33329 */
# EVIDENCE-OF: R-34407-33329 The sqlite3_vsnprintf() routine is a
# varargs version of sqlite3_snprintf().

R-62351-41098-13416-45377-12823-43101-65354-24349 tcl slt th3 src

The %q option works like %s in that it substitutes a nul-terminated string from the argument list. But %q also doubles every '\'' character. %q is designed for use inside a string literal.

th3/req1/malloc01.test:115

/* IMP: R-62351-41098 */
# EVIDENCE-OF: R-62351-41098 The %q option works like %s in that it
# substitutes a nul-terminated string from the argument list. But %q
# also doubles every '\'' character. %q is designed for use inside a
# string literal.

R-26388-52100-18147-39797-05438-03656-60623-16408 tcl slt th3 src

The %Q option works like %q except it also adds single quotes around the outside of the total string. Additionally, if the parameter in the argument list is a NULL pointer, %Q substitutes the text "NULL" (without single quotes).

th3/req1/malloc01.test:126

/* IMP: R-26388-52100 */
# EVIDENCE-OF: R-26388-52100 The %Q option works like %q except it also
# adds single quotes around the outside of the total string.
# Additionally, if the parameter in the argument list is a NULL pointer,
# %Q substitutes the text "NULL" (without single quotes).

R-04837-64006-43032-20048-34043-15001-60399-59054 tcl slt th3 src

The "%w" formatting option is like "%q" except that it expects to be contained within double-quotes instead of single quotes, and it escapes the double-quote character instead of the single-quote character.

/* IMP: R-04837-64006 */
# EVIDENCE-OF: R-04837-64006 The "%w" formatting option is like "%q"
# except that it expects to be contained within double-quotes instead of
# single quotes, and it escapes the double-quote character instead of
# the single-quote character.

R-25815-04054-00806-27320-41776-02444-29917-59413 tcl slt th3 src

The "%z" formatting option works like "%s" but with the addition that after the string has been read and copied into the result, sqlite3_free() is called on the input string.

th3/req1/malloc01.test:142

/* IMP: R-25815-04054 */
# EVIDENCE-OF: R-25815-04054 The "%z" formatting option works like "%s"
# but with the addition that after the string has been read and copied
# into the result, sqlite3_free() is called on the input string.