Lines Matching defs:pFile
8926 static int apndClose(sqlite3_file *pFile){
8927 pFile = ORIGFILE(pFile);
8928 return pFile->pMethods->xClose(pFile);
8935 sqlite3_file *pFile,
8940 ApndFile *paf = (ApndFile *)pFile;
8941 pFile = ORIGFILE(pFile);
8942 return pFile->pMethods->xRead(pFile, zBuf, iAmt, paf->iPgOne+iOfst);
8952 sqlite3_file *pFile,
8959 assert(pFile == ORIGFILE(paf));
8966 if( SQLITE_OK==(rc = pFile->pMethods->xWrite
8967 (pFile, a, APND_MARK_SIZE, iWriteEnd)) ){
8977 sqlite3_file *pFile,
8982 ApndFile *paf = (ApndFile *)pFile;
8985 pFile = ORIGFILE(pFile);
8988 int rc = apndWriteMark(paf, pFile, iWriteEnd);
8991 return pFile->pMethods->xWrite(pFile, zBuf, iAmt, paf->iPgOne+iOfst);
8997 static int apndTruncate(sqlite3_file *pFile, sqlite_int64 size){
8998 ApndFile *paf = (ApndFile *)pFile;
8999 pFile = ORIGFILE(pFile);
9001 if( SQLITE_OK!=apndWriteMark(paf, pFile, size) ) return SQLITE_IOERR;
9003 return pFile->pMethods->xTruncate(pFile, paf->iMark+APND_MARK_SIZE);
9009 static int apndSync(sqlite3_file *pFile, int flags){
9010 pFile = ORIGFILE(pFile);
9011 return pFile->pMethods->xSync(pFile, flags);
9018 static int apndFileSize(sqlite3_file *pFile, sqlite_int64 *pSize){
9019 ApndFile *paf = (ApndFile *)pFile;
9027 static int apndLock(sqlite3_file *pFile, int eLock){
9028 pFile = ORIGFILE(pFile);
9029 return pFile->pMethods->xLock(pFile, eLock);
9035 static int apndUnlock(sqlite3_file *pFile, int eLock){
9036 pFile = ORIGFILE(pFile);
9037 return pFile->pMethods->xUnlock(pFile, eLock);
9043 static int apndCheckReservedLock(sqlite3_file *pFile, int *pResOut){
9044 pFile = ORIGFILE(pFile);
9045 return pFile->pMethods->xCheckReservedLock(pFile, pResOut);
9051 static int apndFileControl(sqlite3_file *pFile, int op, void *pArg){
9052 ApndFile *paf = (ApndFile *)pFile;
9054 pFile = ORIGFILE(pFile);
9056 rc = pFile->pMethods->xFileControl(pFile, op, pArg);
9066 static int apndSectorSize(sqlite3_file *pFile){
9067 pFile = ORIGFILE(pFile);
9068 return pFile->pMethods->xSectorSize(pFile);
9074 static int apndDeviceCharacteristics(sqlite3_file *pFile){
9075 pFile = ORIGFILE(pFile);
9076 return pFile->pMethods->xDeviceCharacteristics(pFile);
9081 sqlite3_file *pFile,
9087 pFile = ORIGFILE(pFile);
9088 return pFile->pMethods->xShmMap(pFile,iPg,pgsz,bExtend,pp);
9092 static int apndShmLock(sqlite3_file *pFile, int offset, int n, int flags){
9093 pFile = ORIGFILE(pFile);
9094 return pFile->pMethods->xShmLock(pFile,offset,n,flags);
9098 static void apndShmBarrier(sqlite3_file *pFile){
9099 pFile = ORIGFILE(pFile);
9100 pFile->pMethods->xShmBarrier(pFile);
9104 static int apndShmUnmap(sqlite3_file *pFile, int deleteFlag){
9105 pFile = ORIGFILE(pFile);
9106 return pFile->pMethods->xShmUnmap(pFile,deleteFlag);
9111 sqlite3_file *pFile,
9116 ApndFile *p = (ApndFile *)pFile;
9120 pFile = ORIGFILE(pFile);
9121 return pFile->pMethods->xFetch(pFile, iOfst+p->iPgOne, iAmt, pp);
9125 static int apndUnfetch(sqlite3_file *pFile, sqlite3_int64 iOfst, void *pPage){
9126 ApndFile *p = (ApndFile *)pFile;
9127 pFile = ORIGFILE(pFile);
9128 return pFile->pMethods->xUnfetch(pFile, iOfst+p->iPgOne, pPage);
9140 static sqlite3_int64 apndReadMark(sqlite3_int64 sz, sqlite3_file *pFile){
9147 rc = pFile->pMethods->xRead(pFile, a, APND_MARK_SIZE, sz-APND_MARK_SIZE);
9165 static int apndIsAppendvfsDatabase(sqlite3_int64 sz, sqlite3_file *pFile){
9168 sqlite3_int64 iMark = apndReadMark(sz, pFile);
9174 rc = pFile->pMethods->xRead(pFile, zHdr, sizeof(zHdr), iMark);
9190 static int apndIsOrdinaryDatabaseFile(sqlite3_int64 sz, sqlite3_file *pFile){
9192 if( apndIsAppendvfsDatabase(sz, pFile) /* rule 2 */
9194 || SQLITE_OK!=pFile->pMethods->xRead(pFile, zHdr, sizeof(zHdr), 0)
9209 sqlite3_file *pFile,
9213 ApndFile *pApndFile = (ApndFile*)pFile;
9214 sqlite3_file *pBaseFile = ORIGFILE(pFile);
9223 return pBaseVfs->xOpen(pBaseVfs, zName, pFile, flags, pOutFlags);
9226 pFile->pMethods = &apnd_io_methods;
9237 pFile->pMethods = 0;
9247 pApndFile->iPgOne = apndReadMark(sz, pFile);
9255 pFile->pMethods = 0;
9652 FILE *pFile; /* Zip file */
9840 if( pCsr->pFile ){
9841 fclose(pCsr->pFile);
9842 pCsr->pFile = 0;
9890 ** Read nRead bytes of data from offset iOff of file pFile into buffer
9900 FILE *pFile, /* Read from this file */
9907 fseek(pFile, (long)iOff, SEEK_SET);
9908 n = fread(aRead, 1, nRead, pFile);
10170 ** then pFile is a file-handle open on a zip file. In either case, this
10182 FILE *pFile, /* If aBlob==0, read from this file */
10193 rc = zipfileReadData(pFile, aRead, ZIPFILE_CDS_FIXED_SZ, iOff, pzErr);
10221 pFile, aRead, nExtra+nFile, iOff+ZIPFILE_CDS_FIXED_SZ, pzErr
10243 if( pFile ){
10244 rc = zipfileReadData(pFile, aRead, szFix, pNew->cds.iOffset, pzErr);
10281 if( pCsr->pFile ){
10290 rc = zipfileGetEntry(pTab, 0, 0, pCsr->pFile, pCsr->iNextOff, &p);
10455 FILE *pFile = pCsr->pFile;
10456 if( pFile==0 ){
10457 pFile = ((ZipfileTab*)(pCsr->base.pVtab))->pWriteFd;
10459 rc = zipfileReadData(pFile, aBuf, sz, pCsr->pCurrent->iDataOff,
10509 ** containing an entire zip archive image. Or, if aBlob is NULL, then pFile
10521 FILE *pFile, /* Read from this file if aBlob==0 */
10532 fseek(pFile, 0, SEEK_END);
10533 szFile = (i64)ftell(pFile);
10539 rc = zipfileReadData(pFile, aRead, nRead, iOff, &pTab->base.zErrMsg);
10668 pCsr->pFile = zFile ? fopen(zFile, "rb") : 0;
10669 if( pCsr->pFile==0 ){
10673 rc = zipfileReadEOCD(pTab, 0, 0, pCsr->pFile, &pCsr->eocd);
31055 sqlite3_file * pFile = 0;
31060 SQLITE_FCNTL_FILE_POINTER, &pFile)
31063 rc = pFile->pMethods->xFileSize(pFile, &nSize);
31075 rc = pFile->pMethods->xRead(pFile, buf, nBuf, nPos);