Lines Matching refs:sqlite3_file
1126 ** An [sqlite3_file] object represents an open file in the
1134 typedef struct sqlite3_file sqlite3_file;
1135 struct sqlite3_file {
1143 ** [sqlite3_file] object (or, more commonly, a subclass of the
1144 ** [sqlite3_file] object) with a pointer to an instance of this object.
1146 ** against the open file represented by the [sqlite3_file] object.
1148 ** If the [sqlite3_vfs.xOpen] method sets the sqlite3_file.pMethods element
1152 ** is for the [sqlite3_vfs.xOpen] to set the sqlite3_file.pMethods element
1232 int (*xClose)(sqlite3_file*);
1233 int (*xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst);
1234 int (*xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst);
1235 int (*xTruncate)(sqlite3_file*, sqlite3_int64 size);
1236 int (*xSync)(sqlite3_file*, int flags);
1237 int (*xFileSize)(sqlite3_file*, sqlite3_int64 *pSize);
1238 int (*xLock)(sqlite3_file*, int);
1239 int (*xUnlock)(sqlite3_file*, int);
1240 int (*xCheckReservedLock)(sqlite3_file*, int *pResOut);
1241 int (*xFileControl)(sqlite3_file*, int op, void *pArg);
1242 int (*xSectorSize)(sqlite3_file*);
1243 int (*xDeviceCharacteristics)(sqlite3_file*);
1245 int (*xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**);
1246 int (*xShmLock)(sqlite3_file*, int offset, int n, int flags);
1247 void (*xShmBarrier)(sqlite3_file*);
1248 int (*xShmUnmap)(sqlite3_file*, int deleteFlag);
1284 ** to the [sqlite3_file] object associated with a particular database
1367 ** The szOsFile field is the size of the subclassed [sqlite3_file]
1397 ** the [sqlite3_file] can safely store a pointer to the
1456 ** to hold the [sqlite3_file] structure passed as the third
1459 ** the xOpen method must set the sqlite3_file.pMethods to either
1461 ** this even if the open fails. SQLite expects that the sqlite3_file.pMethods
1513 int szOsFile; /* Size of subclassed sqlite3_file */
1518 int (*xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*,
6098 ** a pointer to the underlying [sqlite3_file] object to be written into
8746 SQLITE_PRIVATE sqlite3_file *sqlite3PagerFile(Pager*);
9175 ** Functions for accessing sqlite3_file methods
9177 SQLITE_PRIVATE int sqlite3OsClose(sqlite3_file*);
9178 SQLITE_PRIVATE int sqlite3OsRead(sqlite3_file*, void*, int amt, i64 offset);
9179 SQLITE_PRIVATE int sqlite3OsWrite(sqlite3_file*, const void*, int amt, i64 offset);
9180 SQLITE_PRIVATE int sqlite3OsTruncate(sqlite3_file*, i64 size);
9181 SQLITE_PRIVATE int sqlite3OsSync(sqlite3_file*, int);
9182 SQLITE_PRIVATE int sqlite3OsFileSize(sqlite3_file*, i64 *pSize);
9183 SQLITE_PRIVATE int sqlite3OsLock(sqlite3_file*, int);
9184 SQLITE_PRIVATE int sqlite3OsUnlock(sqlite3_file*, int);
9185 SQLITE_PRIVATE int sqlite3OsCheckReservedLock(sqlite3_file *id, int *pResOut);
9186 SQLITE_PRIVATE int sqlite3OsFileControl(sqlite3_file*,int,void*);
9188 SQLITE_PRIVATE int sqlite3OsSectorSize(sqlite3_file *id);
9189 SQLITE_PRIVATE int sqlite3OsDeviceCharacteristics(sqlite3_file *id);
9190 SQLITE_PRIVATE int sqlite3OsShmMap(sqlite3_file *,int,int,int,void volatile **);
9191 SQLITE_PRIVATE int sqlite3OsShmLock(sqlite3_file *id, int, int, int);
9192 SQLITE_PRIVATE void sqlite3OsShmBarrier(sqlite3_file *id);
9193 SQLITE_PRIVATE int sqlite3OsShmUnmap(sqlite3_file *id, int);
9198 SQLITE_PRIVATE int sqlite3OsOpen(sqlite3_vfs *, const char *, sqlite3_file*, int, int *);
9216 SQLITE_PRIVATE int sqlite3OsOpenMalloc(sqlite3_vfs *, const char *, sqlite3_file **, int,int*);
9217 SQLITE_PRIVATE int sqlite3OsCloseFree(sqlite3_file *);
11803 SQLITE_PRIVATE int sqlite3JournalOpen(sqlite3_vfs *, const char *, sqlite3_file *, int, int);
11805 SQLITE_PRIVATE int sqlite3JournalCreate(sqlite3_file *);
11810 SQLITE_PRIVATE void sqlite3MemJournalOpen(sqlite3_file *);
11812 SQLITE_PRIVATE int sqlite3IsMemJournal(sqlite3_file *);
14385 ** of the sqlite3_file object. This is mostly just syntactic sugar. All
14389 SQLITE_PRIVATE int sqlite3OsClose(sqlite3_file *pId){
14397 SQLITE_PRIVATE int sqlite3OsRead(sqlite3_file *id, void *pBuf, int amt, i64 offset){
14401 SQLITE_PRIVATE int sqlite3OsWrite(sqlite3_file *id, const void *pBuf, int amt, i64 offset){
14405 SQLITE_PRIVATE int sqlite3OsTruncate(sqlite3_file *id, i64 size){
14408 SQLITE_PRIVATE int sqlite3OsSync(sqlite3_file *id, int flags){
14412 SQLITE_PRIVATE int sqlite3OsFileSize(sqlite3_file *id, i64 *pSize){
14416 SQLITE_PRIVATE int sqlite3OsLock(sqlite3_file *id, int lockType){
14420 SQLITE_PRIVATE int sqlite3OsUnlock(sqlite3_file *id, int lockType){
14423 SQLITE_PRIVATE int sqlite3OsCheckReservedLock(sqlite3_file *id, int *pResOut){
14427 SQLITE_PRIVATE int sqlite3OsFileControl(sqlite3_file *id, int op, void *pArg){
14430 SQLITE_PRIVATE int sqlite3OsSectorSize(sqlite3_file *id){
14431 int (*xSectorSize)(sqlite3_file*) = id->pMethods->xSectorSize;
14434 SQLITE_PRIVATE int sqlite3OsDeviceCharacteristics(sqlite3_file *id){
14437 SQLITE_PRIVATE int sqlite3OsShmLock(sqlite3_file *id, int offset, int n, int flags){
14440 SQLITE_PRIVATE void sqlite3OsShmBarrier(sqlite3_file *id){
14443 SQLITE_PRIVATE int sqlite3OsShmUnmap(sqlite3_file *id, int deleteFlag){
14447 sqlite3_file *id, /* Database file handle */
14463 sqlite3_file *pFile,
14539 sqlite3_file **ppFile,
14544 sqlite3_file *pFile;
14545 pFile = (sqlite3_file *)sqlite3MallocZero(pVfs->szOsFile);
14556 SQLITE_PRIVATE int sqlite3OsCloseFree(sqlite3_file *pFile){
22510 ** The os2File structure is subclass of sqlite3_file specific for the OS/2
22541 static int os2Close( sqlite3_file *id ){
22569 sqlite3_file *id, /* File to read from */
22600 sqlite3_file *id, /* File to write into */
22631 static int os2Truncate( sqlite3_file *id, i64 nByte ){
22663 static int os2Sync( sqlite3_file *id, int flags ){
22686 static int os2FileSize( sqlite3_file *id, sqlite3_int64 *pSize ){
22763 static int os2Lock( sqlite3_file *id, int locktype ){
22900 static int os2CheckReservedLock( sqlite3_file *id, int *pOut ){
22946 static int os2Unlock( sqlite3_file *id, int locktype ){
23002 static int os2FileControl(sqlite3_file *id, int op, void *pArg){
23038 static int os2SectorSize(sqlite3_file *id){
23046 static int os2DeviceCharacteristics(sqlite3_file *id){
23513 sqlite3_file *id, /* Handle open on database file */
23605 sqlite3_file *id, /* The underlying database file */
23653 sqlite3_file *id, /* Database file holding the shared memory */
23771 sqlite3_file *id /* Database file holding the shared memory */
23788 ** sqlite3_file for os2.
23908 sqlite3_file *id, /* Write the SQLite file handle here */
24411 ** * sqlite3_file methods not associated with locking.
24575 ** The unixFile structure is subclass of sqlite3_file specific to the unix
25465 ** The sqlite3_file structure for POSIX is no longer just an integer file
25794 static int unixCheckReservedLock(sqlite3_file *id, int *pResOut){
25905 static int unixLock(sqlite3_file *id, int eFileLock){
26152 static int posixUnlock(sqlite3_file *id, int eFileLock, int handleNFSUnlock){
26330 static int unixUnlock(sqlite3_file *id, int eFileLock){
26344 static int closeUnixFile(sqlite3_file *id){
26369 static int unixClose(sqlite3_file *id){
26413 static int nolockCheckReservedLock(sqlite3_file *NotUsed, int *pResOut){
26418 static int nolockLock(sqlite3_file *NotUsed, int NotUsed2){
26422 static int nolockUnlock(sqlite3_file *NotUsed, int NotUsed2){
26430 static int nolockClose(sqlite3_file *id) {
26475 static int dotlockCheckReservedLock(sqlite3_file *id, int *pResOut) {
26526 static int dotlockLock(sqlite3_file *id, int eFileLock) {
26578 static int dotlockUnlock(sqlite3_file *id, int eFileLock) {
26620 static int dotlockClose(sqlite3_file *id) {
26670 static int flockCheckReservedLock(sqlite3_file *id, int *pResOut){
26745 ** lock states in the sqlite3_file structure, but all locks SHARED or
26752 static int flockLock(sqlite3_file *id, int eFileLock) {
26796 static int flockUnlock(sqlite3_file *id, int eFileLock) {
26830 static int flockClose(sqlite3_file *id) {
26860 static int semCheckReservedLock(sqlite3_file *id, int *pResOut) {
26921 ** lock states in the sqlite3_file structure, but all locks SHARED or
26928 static int semLock(sqlite3_file *id, int eFileLock) {
26962 static int semUnlock(sqlite3_file *id, int eFileLock) {
26999 static int semClose(sqlite3_file *id) {
27104 static int afpCheckReservedLock(sqlite3_file *id, int *pResOut){
27174 static int afpLock(sqlite3_file *id, int eFileLock){
27356 static int afpUnlock(sqlite3_file *id, int eFileLock) {
27459 static int afpClose(sqlite3_file *id) {
27502 static int nfsUnlock(sqlite3_file *id, int eFileLock){
27516 **************** Non-locking sqlite3_file methods *****************************
27519 ** sqlite3_file object other than the locking methods. The locking
27577 sqlite3_file *id,
27656 sqlite3_file *id,
27900 static int unixSync(sqlite3_file *id, int flags){
27949 static int unixTruncate(sqlite3_file *id, i64 nByte){
27989 static int unixFileSize(sqlite3_file *id, i64 *pSize){
28018 static int proxyFileControl(sqlite3_file*,int,void*);
28076 static int unixFileControl(sqlite3_file *id, int op, void *pArg){
28143 static int unixSectorSize(sqlite3_file *NotUsed){
28151 static int unixDeviceCharacteristics(sqlite3_file *NotUsed){
28519 sqlite3_file *fd, /* Handle open on database file */
28630 sqlite3_file *fd, /* Database file holding the shared memory */
28742 sqlite3_file *fd /* Database file holding the shared memory */
28757 sqlite3_file *fd, /* The underlying database file */
28807 ** Here ends the implementation of all sqlite3_file methods.
28809 ********************** End sqlite3_file Methods *******************************
28952 static int proxyClose(sqlite3_file*);
28953 static int proxyLock(sqlite3_file*, int);
28954 static int proxyUnlock(sqlite3_file*, int);
28955 static int proxyCheckReservedLock(sqlite3_file*, int*);
29104 sqlite3_file *pId, /* Write to the unixFile structure here */
29512 sqlite3_file *pFile, /* The file descriptor to be filled in */
30389 rc = fillInUnixFile(&dummyVfs, fd, 0, (sqlite3_file*)pNew, path, 0, 0, 0);
30525 rc = conchFile->pMethod->xLock((sqlite3_file*)conchFile, lockType);
30576 rc = conchFile->pMethod->xLock((sqlite3_file*)conchFile, SHARED_LOCK);
30579 rc = conchFile->pMethod->xLock((sqlite3_file*)conchFile, lockType);
30702 rc = conchFile->pMethod->xLock((sqlite3_file*)conchFile, EXCLUSIVE_LOCK);
30717 rc = unixWrite((sqlite3_file *)conchFile, writeBuffer, writeSize, 0);
30750 conchFile->pMethod->xUnlock((sqlite3_file*)conchFile, SHARED_LOCK);
30802 conchFile->pMethod->xUnlock((sqlite3_file*)conchFile, NO_LOCK);
30826 rc = conchFile->pMethod->xUnlock((sqlite3_file*)conchFile, NO_LOCK);
30900 rc=lockProxy->pMethod->xClose((sqlite3_file *)lockProxy);
31018 pCtx->conchFile->pMethod->xClose((sqlite3_file *)pCtx->conchFile);
31035 static int proxyFileControl(sqlite3_file *id, int op, void *pArg){
31105 static int proxyCheckReservedLock(sqlite3_file *id, int *pResOut) {
31112 return proxy->pMethod->xCheckReservedLock((sqlite3_file*)proxy, pResOut);
31144 static int proxyLock(sqlite3_file *id, int eFileLock) {
31151 rc = proxy->pMethod->xLock((sqlite3_file*)proxy, eFileLock);
31168 static int proxyUnlock(sqlite3_file *id, int eFileLock) {
31175 rc = proxy->pMethod->xUnlock((sqlite3_file*)proxy, eFileLock);
31187 static int proxyClose(sqlite3_file *id) {
31196 rc = lockProxy->pMethod->xUnlock((sqlite3_file*)lockProxy, NO_LOCK);
31198 rc = lockProxy->pMethod->xClose((sqlite3_file*)lockProxy);
31208 rc = conchFile->pMethod->xClose((sqlite3_file*)conchFile);
31657 ** The winFile structure is a subclass of sqlite3_file* specific to the win32
32639 static int winClose(sqlite3_file *id){
32677 sqlite3_file *id, /* File to read from */
32713 sqlite3_file *id, /* File to write into */
32765 static int winTruncate(sqlite3_file *id, sqlite3_int64 nByte){
32807 static int winSync(sqlite3_file *id, int flags){
32867 static int winFileSize(sqlite3_file *id, sqlite3_int64 *pSize){
32971 static int winLock(sqlite3_file *id, int locktype){
33094 static int winCheckReservedLock(sqlite3_file *id, int *pResOut){
33127 static int winUnlock(sqlite3_file *id, int locktype){
33160 static int winFileControl(sqlite3_file *id, int op, void *pArg){
33231 static int winSectorSize(sqlite3_file *id){
33239 static int winDeviceCharacteristics(sqlite3_file *id){
33410 static int winOpen(sqlite3_vfs*,const char*,sqlite3_file*,int,int*);
33441 winClose((sqlite3_file *)&p->hFile);
33518 (sqlite3_file*)&pShmNode->hFile, /* File handle here */
33530 rc = winTruncate((sqlite3_file *)&pShmNode->hFile, 0);
33579 sqlite3_file *fd, /* Database holding shared memory */
33620 sqlite3_file *fd, /* Database file holding the shared memory */
33729 sqlite3_file *fd /* Database holding the shared memory */
33757 sqlite3_file *fd, /* Handle open on database file */
33789 rc = winFileSize((sqlite3_file *)&pShmNode->hFile, &sz);
33803 rc = winTruncate((sqlite3_file *)&pShmNode->hFile, nByte);
33874 ** Here ends the implementation of all sqlite3_file methods.
33876 ********************** End sqlite3_file Methods *******************************
33881 ** sqlite3_file for win32.
34010 sqlite3_file *id, /* Write the SQLite file handle here */
37484 SQLITE_PRIVATE int sqlite3WalOpen(sqlite3_vfs*, sqlite3_file*, const char *, int, i64, Wal**);
37664 ** associated file-descriptor is returned. FILEHANDLEID() takes an sqlite3_file
38185 sqlite3_file *fd; /* File descriptor for database */
38186 sqlite3_file *jfd; /* File descriptor for main journal */
38187 sqlite3_file *sjfd; /* File descriptor for sub-journal */
38301 ** The argument to this macro is a file descriptor (type sqlite3_file*).
38555 static int read32bits(sqlite3_file *fd, i64 offset, u32 *pRes){
38574 static int write32bits(sqlite3_file *fd, i64 offset, u32 val){
38739 static int readMasterJournal(sqlite3_file *pJrnl, char *zMaster, u32 nMaster){
39644 sqlite3_file *jfd; /* The file descriptor for the journal file */
39900 sqlite3_file *pMaster; /* Malloc'd master-journal file descriptor */
39901 sqlite3_file *pJournal; /* Malloc'd child-journal file descriptor */
39911 pMaster = (sqlite3_file *)sqlite3MallocZero(pVfs->szOsFile * 2);
39912 pJournal = (sqlite3_file *)(((u8 *)pMaster) + pVfs->szOsFile);
40928 sqlite3_file *pFile, /* Write the file descriptor here */
41931 pPager->fd = (sqlite3_file*)(pPtr += ROUND8(pcacheSize));
41932 pPager->sjfd = (sqlite3_file*)(pPtr += ROUND8(pVfs->szOsFile));
41933 pPager->jfd = (sqlite3_file*)(pPtr += journalFileSize);
43783 SQLITE_PRIVATE sqlite3_file *sqlite3PagerFile(Pager *pPager){
44781 sqlite3_file *pDbFd; /* File handle for the database file */
44782 sqlite3_file *pWalFd; /* File handle for WAL file */
45615 sqlite3_file *pDbFd, /* The open database file */
45648 pRet->pWalFd = (sqlite3_file *)&pRet[1];
56746 static int backupTruncateFile(sqlite3_file *pFile, i64 iSize){
56906 sqlite3_file * const pFile = sqlite3PagerFile(pDestPager);
60128 sqlite3_file *pMaster = 0;
70379 sqlite3_file *pTemp1; /* PMA file 1 */
70394 sqlite3_file *pFile; /* File iterator is reading from */
70488 sqlite3_file *pFile, /* File to write to */
70515 sqlite3_file *pFile, /* File to read from */
70730 static int vdbeSorterOpenTempFile(sqlite3 *db, sqlite3_file **ppFile){
70967 sqlite3_file *pTemp2 = 0; /* Second temp file to use */
71052 sqlite3_file *pTmp = pSorter->pTemp1;
71175 ** This file implements a special kind of sqlite3_file object used
71179 ** The distinctive characteristic of this sqlite3_file is that the
71193 ** A JournalFile object is a subclass of sqlite3_file used by
71203 sqlite3_file *pReal; /* The "real" underlying file descriptor */
71215 sqlite3_file *pReal = (sqlite3_file *)&p[1];
71231 static int jrnlClose(sqlite3_file *pJfd){
71244 sqlite3_file *pJfd, /* The journal file from which to read */
71265 sqlite3_file *pJfd, /* The journal file into which to write */
71291 static int jrnlTruncate(sqlite3_file *pJfd, sqlite_int64 size){
71305 static int jrnlSync(sqlite3_file *pJfd, int flags){
71319 static int jrnlFileSize(sqlite3_file *pJfd, sqlite_int64 *pSize){
71331 ** Table of methods for JournalFile sqlite3_file object.
71359 sqlite3_file *pJfd, /* Preallocated, blank file handle */
71385 SQLITE_PRIVATE int sqlite3JournalCreate(sqlite3_file *p){
71459 ** This subclass is a subclass of sqlite3_file. Each open memory-journal
71474 sqlite3_file *pJfd, /* The journal file from which to read */
71519 sqlite3_file *pJfd, /* The journal file into which to write */
71568 static int memjrnlTruncate(sqlite3_file *pJfd, sqlite_int64 size){
71586 static int memjrnlClose(sqlite3_file *pJfd){
71600 static int memjrnlSync(sqlite3_file *NotUsed, int NotUsed2){
71608 static int memjrnlFileSize(sqlite3_file *pJfd, sqlite_int64 *pSize){
71615 ** Table of methods for MemJournal sqlite3_file object.
71640 SQLITE_PRIVATE void sqlite3MemJournalOpen(sqlite3_file *pJfd){
71651 SQLITE_PRIVATE int sqlite3IsMemJournal(sqlite3_file *pJfd){
90750 sqlite3_file *pFile = sqlite3PagerFile(pPager);
90763 sqlite3_file *pFile = sqlite3PagerFile(pPager);
112822 sqlite3_file *fd;
112829 *(sqlite3_file**)pArg = fd;