Lines Matching refs:pFile

6393 static int apndClose(sqlite3_file *pFile){
6394 pFile = ORIGFILE(pFile);
6395 return pFile->pMethods->xClose(pFile);
6402 sqlite3_file *pFile,
6407 ApndFile *paf = (ApndFile *)pFile;
6408 pFile = ORIGFILE(pFile);
6409 return pFile->pMethods->xRead(pFile, zBuf, iAmt, paf->iPgOne+iOfst);
6419 sqlite3_file *pFile,
6426 assert(pFile == ORIGFILE(paf));
6433 if( SQLITE_OK==(rc = pFile->pMethods->xWrite
6434 (pFile, a, APND_MARK_SIZE, iWriteEnd)) ){
6444 sqlite3_file *pFile,
6449 ApndFile *paf = (ApndFile *)pFile;
6452 pFile = ORIGFILE(pFile);
6455 int rc = apndWriteMark(paf, pFile, iWriteEnd);
6458 return pFile->pMethods->xWrite(pFile, zBuf, iAmt, paf->iPgOne+iOfst);
6464 static int apndTruncate(sqlite3_file *pFile, sqlite_int64 size){
6465 ApndFile *paf = (ApndFile *)pFile;
6466 pFile = ORIGFILE(pFile);
6468 if( SQLITE_OK!=apndWriteMark(paf, pFile, size) ) return SQLITE_IOERR;
6470 return pFile->pMethods->xTruncate(pFile, paf->iMark+APND_MARK_SIZE);
6476 static int apndSync(sqlite3_file *pFile, int flags){
6477 pFile = ORIGFILE(pFile);
6478 return pFile->pMethods->xSync(pFile, flags);
6485 static int apndFileSize(sqlite3_file *pFile, sqlite_int64 *pSize){
6486 ApndFile *paf = (ApndFile *)pFile;
6494 static int apndLock(sqlite3_file *pFile, int eLock){
6495 pFile = ORIGFILE(pFile);
6496 return pFile->pMethods->xLock(pFile, eLock);
6502 static int apndUnlock(sqlite3_file *pFile, int eLock){
6503 pFile = ORIGFILE(pFile);
6504 return pFile->pMethods->xUnlock(pFile, eLock);
6510 static int apndCheckReservedLock(sqlite3_file *pFile, int *pResOut){
6511 pFile = ORIGFILE(pFile);
6512 return pFile->pMethods->xCheckReservedLock(pFile, pResOut);
6518 static int apndFileControl(sqlite3_file *pFile, int op, void *pArg){
6519 ApndFile *paf = (ApndFile *)pFile;
6521 pFile = ORIGFILE(pFile);
6523 rc = pFile->pMethods->xFileControl(pFile, op, pArg);
6533 static int apndSectorSize(sqlite3_file *pFile){
6534 pFile = ORIGFILE(pFile);
6535 return pFile->pMethods->xSectorSize(pFile);
6541 static int apndDeviceCharacteristics(sqlite3_file *pFile){
6542 pFile = ORIGFILE(pFile);
6543 return pFile->pMethods->xDeviceCharacteristics(pFile);
6548 sqlite3_file *pFile,
6554 pFile = ORIGFILE(pFile);
6555 return pFile->pMethods->xShmMap(pFile,iPg,pgsz,bExtend,pp);
6559 static int apndShmLock(sqlite3_file *pFile, int offset, int n, int flags){
6560 pFile = ORIGFILE(pFile);
6561 return pFile->pMethods->xShmLock(pFile,offset,n,flags);
6565 static void apndShmBarrier(sqlite3_file *pFile){
6566 pFile = ORIGFILE(pFile);
6567 pFile->pMethods->xShmBarrier(pFile);
6571 static int apndShmUnmap(sqlite3_file *pFile, int deleteFlag){
6572 pFile = ORIGFILE(pFile);
6573 return pFile->pMethods->xShmUnmap(pFile,deleteFlag);
6578 sqlite3_file *pFile,
6583 ApndFile *p = (ApndFile *)pFile;
6587 pFile = ORIGFILE(pFile);
6588 return pFile->pMethods->xFetch(pFile, iOfst+p->iPgOne, iAmt, pp);
6592 static int apndUnfetch(sqlite3_file *pFile, sqlite3_int64 iOfst, void *pPage){
6593 ApndFile *p = (ApndFile *)pFile;
6594 pFile = ORIGFILE(pFile);
6595 return pFile->pMethods->xUnfetch(pFile, iOfst+p->iPgOne, pPage);
6607 static sqlite3_int64 apndReadMark(sqlite3_int64 sz, sqlite3_file *pFile){
6614 rc = pFile->pMethods->xRead(pFile, a, APND_MARK_SIZE, sz-APND_MARK_SIZE);
6632 static int apndIsAppendvfsDatabase(sqlite3_int64 sz, sqlite3_file *pFile){
6635 sqlite3_int64 iMark = apndReadMark(sz, pFile);
6641 rc = pFile->pMethods->xRead(pFile, zHdr, sizeof(zHdr), iMark);
6657 static int apndIsOrdinaryDatabaseFile(sqlite3_int64 sz, sqlite3_file *pFile){
6659 if( apndIsAppendvfsDatabase(sz, pFile) /* rule 2 */
6661 || SQLITE_OK!=pFile->pMethods->xRead(pFile, zHdr, sizeof(zHdr), 0)
6676 sqlite3_file *pFile,
6680 ApndFile *pApndFile = (ApndFile*)pFile;
6681 sqlite3_file *pBaseFile = ORIGFILE(pFile);
6690 return pBaseVfs->xOpen(pBaseVfs, zName, pFile, flags, pOutFlags);
6693 pFile->pMethods = &apnd_io_methods;
6704 pFile->pMethods = 0;
6714 pApndFile->iPgOne = apndReadMark(sz, pFile);
6722 pFile->pMethods = 0;
7118 FILE *pFile; /* Zip file */
7305 if( pCsr->pFile ){
7306 fclose(pCsr->pFile);
7307 pCsr->pFile = 0;
7355 ** Read nRead bytes of data from offset iOff of file pFile into buffer
7365 FILE *pFile, /* Read from this file */
7372 fseek(pFile, (long)iOff, SEEK_SET);
7373 n = fread(aRead, 1, nRead, pFile);
7635 ** then pFile is a file-handle open on a zip file. In either case, this
7647 FILE *pFile, /* If aBlob==0, read from this file */
7657 rc = zipfileReadData(pFile, aRead, ZIPFILE_CDS_FIXED_SZ, iOff, pzErr);
7685 pFile, aRead, nExtra+nFile, iOff+ZIPFILE_CDS_FIXED_SZ, pzErr
7707 if( pFile ){
7708 rc = zipfileReadData(pFile, aRead, szFix, pNew->cds.iOffset, pzErr);
7745 if( pCsr->pFile ){
7754 rc = zipfileGetEntry(pTab, 0, 0, pCsr->pFile, pCsr->iNextOff, &p);
7919 FILE *pFile = pCsr->pFile;
7920 if( pFile==0 ){
7921 pFile = ((ZipfileTab*)(pCsr->base.pVtab))->pWriteFd;
7923 rc = zipfileReadData(pFile, aBuf, sz, pCsr->pCurrent->iDataOff,
7970 ** containing an entire zip archive image. Or, if aBlob is NULL, then pFile
7982 FILE *pFile, /* Read from this file if aBlob==0 */
7993 fseek(pFile, 0, SEEK_END);
7994 szFile = (i64)ftell(pFile);
8000 rc = zipfileReadData(pFile, aRead, nRead, iOff, &pTab->base.zErrMsg);
8126 pCsr->pFile = fopen(zFile, "rb");
8127 if( pCsr->pFile==0 ){
8131 rc = zipfileReadEOCD(pTab, 0, 0, pCsr->pFile, &pCsr->eocd);
26540 sqlite3_file * pFile = 0;
26545 SQLITE_FCNTL_FILE_POINTER, &pFile)
26548 rc = pFile->pMethods->xFileSize(pFile, &nSize);
26560 rc = pFile->pMethods->xRead(pFile, buf, nBuf, nPos);