MCPcopy Create free account
hub / github.com/audacity/audacity / idxAppendText

Function idxAppendText

lib-src/sqlite/shell.c:9132–9158  ·  view source on GitHub ↗

** This function is a no-op if *pRc is set to anything other than ** SQLITE_OK when it is called. ** ** If *pRc is initially set to SQLITE_OK, then the text specified by ** the printf() style arguments is appended to zIn and the result returned ** in a buffer allocated by sqlite3_malloc(). sqlite3_free() is called on ** zIn before returning. */

Source from the content-addressed store, hash-verified

9130** zIn before returning.
9131*/
9132static char *idxAppendText(int *pRc, char *zIn, const char *zFmt, ...){
9133 va_list ap;
9134 char *zAppend = 0;
9135 char *zRet = 0;
9136 int nIn = zIn ? STRLEN(zIn) : 0;
9137 int nAppend = 0;
9138 va_start(ap, zFmt);
9139 if( *pRc==SQLITE_OK ){
9140 zAppend = sqlite3_vmprintf(zFmt, ap);
9141 if( zAppend ){
9142 nAppend = STRLEN(zAppend);
9143 zRet = (char*)sqlite3_malloc(nIn + nAppend + 1);
9144 }
9145 if( zAppend && zRet ){
9146 if( nIn ) memcpy(zRet, zIn, nIn);
9147 memcpy(&zRet[nIn], zAppend, nAppend+1);
9148 }else{
9149 sqlite3_free(zRet);
9150 zRet = 0;
9151 *pRc = SQLITE_NOMEM;
9152 }
9153 sqlite3_free(zAppend);
9154 sqlite3_free(zIn);
9155 }
9156 va_end(ap);
9157 return zRet;
9158}
9159
9160/*
9161** Return true if zId must be quoted in order to use it as an SQL

Callers 6

idxAppendColDefnFunction · 0.85
idxFindIndexesFunction · 0.85
idxProcessOneTriggerFunction · 0.85
idxCreateVtabSchemaFunction · 0.85
idxPopulateOneStat1Function · 0.85
sqlite3_expert_analyzeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected