Lines Matching refs:p
137 #define REALVFS(p) (((VfslogVfs *)(p))->pVfs) argument
171 static void (*vfslogDlSym(sqlite3_vfs *pVfs, void *p, const char*zSym))(void);
259 VfslogFile *p = (VfslogFile *)pFile; in vfslogClose() local
262 if( p->pReal->pMethods ){ in vfslogClose()
263 rc = p->pReal->pMethods->xClose(p->pReal); in vfslogClose()
266 vfslog_call(p->pVfslog, OS_CLOSE, p->iFileId, t, rc, 0, 0); in vfslogClose()
281 VfslogFile *p = (VfslogFile *)pFile; in vfslogRead() local
283 rc = p->pReal->pMethods->xRead(p->pReal, zBuf, iAmt, iOfst); in vfslogRead()
285 vfslog_call(p->pVfslog, OS_READ, p->iFileId, t, rc, iAmt, (int)iOfst); in vfslogRead()
300 VfslogFile *p = (VfslogFile *)pFile; in vfslogWrite() local
302 rc = p->pReal->pMethods->xWrite(p->pReal, z, iAmt, iOfst); in vfslogWrite()
304 vfslog_call(p->pVfslog, OS_WRITE, p->iFileId, t, rc, iAmt, (int)iOfst); in vfslogWrite()
314 VfslogFile *p = (VfslogFile *)pFile; in vfslogTruncate() local
316 rc = p->pReal->pMethods->xTruncate(p->pReal, size); in vfslogTruncate()
318 vfslog_call(p->pVfslog, OS_TRUNCATE, p->iFileId, t, rc, 0, (int)size); in vfslogTruncate()
328 VfslogFile *p = (VfslogFile *)pFile; in vfslogSync() local
330 rc = p->pReal->pMethods->xSync(p->pReal, flags); in vfslogSync()
332 vfslog_call(p->pVfslog, OS_SYNC, p->iFileId, t, rc, flags, 0); in vfslogSync()
342 VfslogFile *p = (VfslogFile *)pFile; in vfslogFileSize() local
344 rc = p->pReal->pMethods->xFileSize(p->pReal, pSize); in vfslogFileSize()
346 vfslog_call(p->pVfslog, OS_FILESIZE, p->iFileId, t, rc, 0, (int)*pSize); in vfslogFileSize()
356 VfslogFile *p = (VfslogFile *)pFile; in vfslogLock() local
358 rc = p->pReal->pMethods->xLock(p->pReal, eLock); in vfslogLock()
360 vfslog_call(p->pVfslog, OS_LOCK, p->iFileId, t, rc, eLock, 0); in vfslogLock()
370 VfslogFile *p = (VfslogFile *)pFile; in vfslogUnlock() local
372 rc = p->pReal->pMethods->xUnlock(p->pReal, eLock); in vfslogUnlock()
374 vfslog_call(p->pVfslog, OS_UNLOCK, p->iFileId, t, rc, eLock, 0); in vfslogUnlock()
384 VfslogFile *p = (VfslogFile *)pFile; in vfslogCheckReservedLock() local
386 rc = p->pReal->pMethods->xCheckReservedLock(p->pReal, pResOut); in vfslogCheckReservedLock()
388 vfslog_call(p->pVfslog, OS_CHECKRESERVEDLOCK, p->iFileId, t, rc, *pResOut, 0); in vfslogCheckReservedLock()
396 VfslogFile *p = (VfslogFile *)pFile; in vfslogFileControl() local
397 int rc = p->pReal->pMethods->xFileControl(p->pReal, op, pArg); in vfslogFileControl()
410 VfslogFile *p = (VfslogFile *)pFile; in vfslogSectorSize() local
412 rc = p->pReal->pMethods->xSectorSize(p->pReal); in vfslogSectorSize()
414 vfslog_call(p->pVfslog, OS_SECTORSIZE, p->iFileId, t, rc, 0, 0); in vfslogSectorSize()
424 VfslogFile *p = (VfslogFile *)pFile; in vfslogDeviceCharacteristics() local
426 rc = p->pReal->pMethods->xDeviceCharacteristics(p->pReal); in vfslogDeviceCharacteristics()
428 vfslog_call(p->pVfslog, OS_DEVCHAR, p->iFileId, t, rc, 0, 0); in vfslogDeviceCharacteristics()
435 VfslogFile *p = (VfslogFile *)pFile; in vfslogShmLock() local
437 rc = p->pReal->pMethods->xShmLock(p->pReal, ofst, n, flags); in vfslogShmLock()
439 vfslog_call(p->pVfslog, OS_SHMLOCK, p->iFileId, t, rc, 0, 0); in vfslogShmLock()
451 VfslogFile *p = (VfslogFile *)pFile; in vfslogShmMap() local
453 rc = p->pReal->pMethods->xShmMap(p->pReal, iRegion, szRegion, isWrite, pp); in vfslogShmMap()
455 vfslog_call(p->pVfslog, OS_SHMMAP, p->iFileId, t, rc, 0, 0); in vfslogShmMap()
460 VfslogFile *p = (VfslogFile *)pFile; in vfslogShmBarrier() local
462 p->pReal->pMethods->xShmBarrier(p->pReal); in vfslogShmBarrier()
464 vfslog_call(p->pVfslog, OS_SHMBARRIER, p->iFileId, t, SQLITE_OK, 0, 0); in vfslogShmBarrier()
469 VfslogFile *p = (VfslogFile *)pFile; in vfslogShmUnmap() local
471 rc = p->pReal->pMethods->xShmUnmap(p->pReal, deleteFlag); in vfslogShmUnmap()
473 vfslog_call(p->pVfslog, OS_SHMUNMAP, p->iFileId, t, rc, 0, 0); in vfslogShmUnmap()
490 VfslogFile *p = (VfslogFile *)pFile; in vfslogOpen() local
494 p->pReal = (sqlite3_file *)&p[1]; in vfslogOpen()
495 p->pVfslog = pVfs; in vfslogOpen()
496 p->iFileId = ++pLog->iNextFileId; in vfslogOpen()
499 rc = REALVFS(pVfs)->xOpen(REALVFS(pVfs), zName, p->pReal, flags, pOutFlags); in vfslogOpen()
502 vfslog_call(pVfs, OS_OPEN, p->iFileId, t, rc, 0, 0); in vfslogOpen()
576 static void (*vfslogDlSym(sqlite3_vfs *pVfs, void *p, const char *zSym))(void){ in vfslogDlSym() argument
577 return REALVFS(pVfs)->xDlSym(REALVFS(pVfs), p, zSym); in vfslogDlSym()
613 static int vfslogCurrentTimeInt64(sqlite3_vfs *pVfs, sqlite3_int64 *p){ in vfslogCurrentTimeInt64() argument
614 return REALVFS(pVfs)->xCurrentTimeInt64(REALVFS(pVfs), p); in vfslogCurrentTimeInt64()
617 static void vfslog_flush(VfslogVfs *p){ in vfslog_flush() argument
632 if( p->nBuf ){ in vfslog_flush()
633 p->pLog->pMethods->xWrite(p->pLog, p->aBuf, p->nBuf, p->iOffset); in vfslog_flush()
634 p->iOffset += p->nBuf; in vfslog_flush()
635 p->nBuf = 0; in vfslog_flush()
645 static void put32bits(unsigned char *p, unsigned int v){ in put32bits() argument
646 p[0] = v>>24; in put32bits()
647 p[1] = (unsigned char)(v>>16); in put32bits()
648 p[2] = (unsigned char)(v>>8); in put32bits()
649 p[3] = (unsigned char)v; in put32bits()
661 VfslogVfs *p = (VfslogVfs *)pVfs; in vfslog_call() local
663 if( (24+p->nBuf)>sizeof(p->aBuf) ){ in vfslog_call()
664 vfslog_flush(p); in vfslog_call()
666 zRec = (unsigned char *)&p->aBuf[p->nBuf]; in vfslog_call()
673 p->nBuf += 24; in vfslog_call()
677 VfslogVfs *p = (VfslogVfs *)pVfs; in vfslog_string() local
680 if( (4+nStr+p->nBuf)>sizeof(p->aBuf) ){ in vfslog_string()
681 vfslog_flush(p); in vfslog_string()
683 zRec = (unsigned char *)&p->aBuf[p->nBuf]; in vfslog_string()
688 p->nBuf += (4 + nStr); in vfslog_string()
691 static void vfslog_finalize(VfslogVfs *p){ in vfslog_finalize() argument
692 if( p->pLog->pMethods ){ in vfslog_finalize()
693 vfslog_flush(p); in vfslog_finalize()
694 p->pLog->pMethods->xClose(p->pLog); in vfslog_finalize()
696 sqlite3_free(p); in vfslog_finalize()
715 VfslogVfs *p; in sqlite3_vfslog_new() local
730 p = (VfslogVfs *)sqlite3_malloc(nByte); in sqlite3_vfslog_new()
731 memset(p, 0, nByte); in sqlite3_vfslog_new()
733 p->pVfs = pParent; in sqlite3_vfslog_new()
734 p->pLog = (sqlite3_file *)&p[1]; in sqlite3_vfslog_new()
735 memcpy(&p->base, &vfslog_vfs, sizeof(sqlite3_vfs)); in sqlite3_vfslog_new()
736 p->base.zName = &((char *)p->pLog)[pParent->szOsFile]; in sqlite3_vfslog_new()
737 p->base.szOsFile += pParent->szOsFile; in sqlite3_vfslog_new()
738 memcpy((char *)p->base.zName, zVfs, nVfs); in sqlite3_vfslog_new()
740 zFile = (char *)&p->base.zName[nVfs+1]; in sqlite3_vfslog_new()
745 rc = pParent->xOpen(pParent, zFile, p->pLog, flags, &flags); in sqlite3_vfslog_new()
747 memcpy(p->aBuf, "sqlite_ostrace1.....", 20); in sqlite3_vfslog_new()
748 p->iOffset = 0; in sqlite3_vfslog_new()
749 p->nBuf = 20; in sqlite3_vfslog_new()
750 rc = sqlite3_vfs_register((sqlite3_vfs *)p, 1); in sqlite3_vfslog_new()
753 vfslog_finalize(p); in sqlite3_vfslog_new()
830 static unsigned int get32bits(unsigned char *p){ in get32bits() argument
831 return (p[0]<<24) + (p[1]<<16) + (p[2]<<8) + p[3]; in get32bits()
872 VfslogVtab *p; in vlogConnect() local
880 p = sqlite3_malloc(nByte); in vlogConnect()
881 if( p==0 ) return SQLITE_NOMEM; in vlogConnect()
882 memset(p, 0, nByte); in vlogConnect()
884 p->pFd = (sqlite3_file *)&p[1]; in vlogConnect()
885 p->zFile = &((char *)p->pFd)[pVfs->szOsFile]; in vlogConnect()
889 sqlite3_free(p); in vlogConnect()
893 pVfs->xFullPathname(pVfs, zFile, pVfs->mxPathname, p->zFile); in vlogConnect()
897 rc = pVfs->xOpen(pVfs, p->zFile, p->pFd, flags, &flags); in vlogConnect()
900 p->pFd->pMethods->xFileSize(p->pFd, &p->nByte); in vlogConnect()
904 *ppVtab = &p->base; in vlogConnect()
906 sqlite3_free(p); in vlogConnect()
925 VfslogVtab *p = (VfslogVtab *)pVtab; in vlogDisconnect() local
926 if( p->pFd->pMethods ){ in vlogDisconnect()
927 p->pFd->pMethods->xClose(p->pFd); in vlogDisconnect()
928 p->pFd->pMethods = 0; in vlogDisconnect()
930 sqlite3_free(p); in vlogDisconnect()
951 VfslogCsr *p = (VfslogCsr *)pCursor; in vlogClose() local
953 for(i=0; i<p->nFile; i++){ in vlogClose()
954 sqlite3_free(p->azFile[i]); in vlogClose()
956 sqlite3_free(p->azFile); in vlogClose()
957 sqlite3_free(p->zTransient); in vlogClose()
958 sqlite3_free(p); in vlogClose()
967 VfslogVtab *p = (VfslogVtab *)pCursor->pVtab; in vlogNext() local
975 if( pCsr->iOffset+nRead<=p->nByte ){ in vlogNext()
977 rc = p->pFd->pMethods->xRead(p->pFd, pCsr->aBuf, nRead, pCsr->iOffset); in vlogNext()
984 rc = p->pFd->pMethods->xRead(p->pFd, buf, 4, pCsr->iOffset+nRead); in vlogNext()
989 rc = p->pFd->pMethods->xRead(p->pFd, zStr, nStr, pCsr->iOffset+nRead); in vlogNext()
1018 VfslogVtab *p = (VfslogVtab *)pCursor->pVtab; in vlogEof() local
1019 return (pCsr->iOffset>=p->nByte); in vlogEof()