Lines Matching refs:pFile

3853 static int apndClose(sqlite3_file *pFile){
3854 pFile = ORIGFILE(pFile);
3855 return pFile->pMethods->xClose(pFile);
3862 sqlite3_file *pFile,
3867 ApndFile *paf = (ApndFile *)pFile;
3868 pFile = ORIGFILE(pFile);
3869 return pFile->pMethods->xRead(pFile, zBuf, iAmt, paf->iPgOne+iOfst);
3879 sqlite3_file *pFile,
3886 assert(pFile == ORIGFILE(paf));
3893 if( SQLITE_OK==(rc = pFile->pMethods->xWrite
3894 (pFile, a, APND_MARK_SIZE, iWriteEnd)) ){
3904 sqlite3_file *pFile,
3909 ApndFile *paf = (ApndFile *)pFile;
3912 pFile = ORIGFILE(pFile);
3915 int rc = apndWriteMark(paf, pFile, iWriteEnd);
3918 return pFile->pMethods->xWrite(pFile, zBuf, iAmt, paf->iPgOne+iOfst);
3924 static int apndTruncate(sqlite3_file *pFile, sqlite_int64 size){
3925 ApndFile *paf = (ApndFile *)pFile;
3926 pFile = ORIGFILE(pFile);
3928 if( SQLITE_OK!=apndWriteMark(paf, pFile, size) ) return SQLITE_IOERR;
3930 return pFile->pMethods->xTruncate(pFile, paf->iMark+APND_MARK_SIZE);
3936 static int apndSync(sqlite3_file *pFile, int flags){
3937 pFile = ORIGFILE(pFile);
3938 return pFile->pMethods->xSync(pFile, flags);
3945 static int apndFileSize(sqlite3_file *pFile, sqlite_int64 *pSize){
3946 ApndFile *paf = (ApndFile *)pFile;
3954 static int apndLock(sqlite3_file *pFile, int eLock){
3955 pFile = ORIGFILE(pFile);
3956 return pFile->pMethods->xLock(pFile, eLock);
3962 static int apndUnlock(sqlite3_file *pFile, int eLock){
3963 pFile = ORIGFILE(pFile);
3964 return pFile->pMethods->xUnlock(pFile, eLock);
3970 static int apndCheckReservedLock(sqlite3_file *pFile, int *pResOut){
3971 pFile = ORIGFILE(pFile);
3972 return pFile->pMethods->xCheckReservedLock(pFile, pResOut);
3978 static int apndFileControl(sqlite3_file *pFile, int op, void *pArg){
3979 ApndFile *paf = (ApndFile *)pFile;
3981 pFile = ORIGFILE(pFile);
3983 rc = pFile->pMethods->xFileControl(pFile, op, pArg);
3993 static int apndSectorSize(sqlite3_file *pFile){
3994 pFile = ORIGFILE(pFile);
3995 return pFile->pMethods->xSectorSize(pFile);
4001 static int apndDeviceCharacteristics(sqlite3_file *pFile){
4002 pFile = ORIGFILE(pFile);
4003 return pFile->pMethods->xDeviceCharacteristics(pFile);
4008 sqlite3_file *pFile,
4014 pFile = ORIGFILE(pFile);
4015 return pFile->pMethods->xShmMap(pFile,iPg,pgsz,bExtend,pp);
4019 static int apndShmLock(sqlite3_file *pFile, int offset, int n, int flags){
4020 pFile = ORIGFILE(pFile);
4021 return pFile->pMethods->xShmLock(pFile,offset,n,flags);
4025 static void apndShmBarrier(sqlite3_file *pFile){
4026 pFile = ORIGFILE(pFile);
4027 pFile->pMethods->xShmBarrier(pFile);
4031 static int apndShmUnmap(sqlite3_file *pFile, int deleteFlag){
4032 pFile = ORIGFILE(pFile);
4033 return pFile->pMethods->xShmUnmap(pFile,deleteFlag);
4038 sqlite3_file *pFile,
4043 ApndFile *p = (ApndFile *)pFile;
4047 pFile = ORIGFILE(pFile);
4048 return pFile->pMethods->xFetch(pFile, iOfst+p->iPgOne, iAmt, pp);
4052 static int apndUnfetch(sqlite3_file *pFile, sqlite3_int64 iOfst, void *pPage){
4053 ApndFile *p = (ApndFile *)pFile;
4054 pFile = ORIGFILE(pFile);
4055 return pFile->pMethods->xUnfetch(pFile, iOfst+p->iPgOne, pPage);
4067 static sqlite3_int64 apndReadMark(sqlite3_int64 sz, sqlite3_file *pFile){
4074 rc = pFile->pMethods->xRead(pFile, a, APND_MARK_SIZE, sz-APND_MARK_SIZE);
4092 static int apndIsAppendvfsDatabase(sqlite3_int64 sz, sqlite3_file *pFile){
4095 sqlite3_int64 iMark = apndReadMark(sz, pFile);
4101 rc = pFile->pMethods->xRead(pFile, zHdr, sizeof(zHdr), iMark);
4117 static int apndIsOrdinaryDatabaseFile(sqlite3_int64 sz, sqlite3_file *pFile){
4119 if( apndIsAppendvfsDatabase(sz, pFile) /* rule 2 */
4121 || SQLITE_OK!=pFile->pMethods->xRead(pFile, zHdr, sizeof(zHdr), 0)
4136 sqlite3_file *pFile,
4140 ApndFile *pApndFile = (ApndFile*)pFile;
4141 sqlite3_file *pBaseFile = ORIGFILE(pFile);
4150 return pBaseVfs->xOpen(pBaseVfs, zName, pFile, flags, pOutFlags);
4153 pFile->pMethods = &apnd_io_methods;
4162 pFile->pMethods = 0;
4172 pApndFile->iPgOne = apndReadMark(sz, pFile);
4180 pFile->pMethods = 0;
6140 FILE *pFile; /* Zip file */
6327 if( pCsr->pFile ){
6328 fclose(pCsr->pFile);
6329 pCsr->pFile = 0;
6377 ** Read nRead bytes of data from offset iOff of file pFile into buffer
6387 FILE *pFile, /* Read from this file */
6394 fseek(pFile, (long)iOff, SEEK_SET);
6395 n = fread(aRead, 1, nRead, pFile);
6666 ** then pFile is a file-handle open on a zip file. In either case, this
6678 FILE *pFile, /* If aBlob==0, read from this file */
6688 rc = zipfileReadData(pFile, aRead, ZIPFILE_CDS_FIXED_SZ, iOff, pzErr);
6716 pFile, aRead, nExtra+nFile, iOff+ZIPFILE_CDS_FIXED_SZ, pzErr
6738 if( pFile ){
6739 rc = zipfileReadData(pFile, aRead, szFix, pNew->cds.iOffset, pzErr);
6776 if( pCsr->pFile ){
6785 rc = zipfileGetEntry(pTab, 0, 0, pCsr->pFile, pCsr->iNextOff, &p);
6950 FILE *pFile = pCsr->pFile;
6951 if( pFile==0 ){
6952 pFile = ((ZipfileTab*)(pCsr->base.pVtab))->pWriteFd;
6954 rc = zipfileReadData(pFile, aBuf, sz, pCsr->pCurrent->iDataOff,
7001 ** containing an entire zip archive image. Or, if aBlob is NULL, then pFile
7013 FILE *pFile, /* Read from this file if aBlob==0 */
7023 fseek(pFile, 0, SEEK_END);
7024 szFile = (i64)ftell(pFile);
7031 rc = zipfileReadData(pFile, aRead, nRead, iOff, &pTab->base.zErrMsg);
7152 pCsr->pFile = fopen(zFile, "rb");
7153 if( pCsr->pFile==0 ){
7157 rc = zipfileReadEOCD(pTab, 0, 0, pCsr->pFile, &pCsr->eocd);