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

Function idxAuthCallback

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

Source from the content-addressed store, hash-verified

9552}
9553
9554static int idxAuthCallback(
9555 void *pCtx,
9556 int eOp,
9557 const char *z3,
9558 const char *z4,
9559 const char *zDb,
9560 const char *zTrigger
9561){
9562 int rc = SQLITE_OK;
9563 (void)z4;
9564 (void)zTrigger;
9565 if( eOp==SQLITE_INSERT || eOp==SQLITE_UPDATE || eOp==SQLITE_DELETE ){
9566 if( sqlite3_stricmp(zDb, "main")==0 ){
9567 sqlite3expert *p = (sqlite3expert*)pCtx;
9568 IdxTable *pTab;
9569 for(pTab=p->pTable; pTab; pTab=pTab->pNext){
9570 if( 0==sqlite3_stricmp(z3, pTab->zName) ) break;
9571 }
9572 if( pTab ){
9573 IdxWrite *pWrite;
9574 for(pWrite=p->pWrite; pWrite; pWrite=pWrite->pNext){
9575 if( pWrite->pTab==pTab && pWrite->eOp==eOp ) break;
9576 }
9577 if( pWrite==0 ){
9578 pWrite = idxMalloc(&rc, sizeof(IdxWrite));
9579 if( rc==SQLITE_OK ){
9580 pWrite->pTab = pTab;
9581 pWrite->eOp = eOp;
9582 pWrite->pNext = p->pWrite;
9583 p->pWrite = pWrite;
9584 }
9585 }
9586 }
9587 }
9588 }
9589 return rc;
9590}
9591
9592static int idxProcessOneTrigger(
9593 sqlite3expert *p,

Callers

nothing calls this directly

Calls 1

idxMallocFunction · 0.85

Tested by

no test coverage detected