MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / shellPreparePrintf

Function shellPreparePrintf

modules/dasSQLITE/sqlite/shell.c:21854–21875  ·  view source on GitHub ↗

** Create a prepared statement using printf-style arguments for the SQL. ** ** This routine is could be marked "static". But it is not always used, ** depending on compile-time options. By omitting the "static", we avoid ** nuisance compiler warnings about "defined but not used". */

Source from the content-addressed store, hash-verified

21852** nuisance compiler warnings about "defined but not used".
21853*/
21854void shellPreparePrintf(
21855 sqlite3 *db,
21856 int *pRc,
21857 sqlite3_stmt **ppStmt,
21858 const char *zFmt,
21859 ...
21860){
21861 *ppStmt = 0;
21862 if( *pRc==SQLITE_OK ){
21863 va_list ap;
21864 char *z;
21865 va_start(ap, zFmt);
21866 z = sqlite3_vmprintf(zFmt, ap);
21867 va_end(ap);
21868 if( z==0 ){
21869 *pRc = SQLITE_NOMEM;
21870 }else{
21871 shellPrepare(db, pRc, z, ppStmt);
21872 sqlite3_free(z);
21873 }
21874 }
21875}
21876
21877/* Finalize the prepared statement created using shellPreparePrintf().
21878**

Callers 3

arCheckEntriesFunction · 0.85
arListCommandFunction · 0.85
arExtractCommandFunction · 0.85

Calls 1

shellPrepareFunction · 0.85

Tested by

no test coverage detected