Lines Matching refs:sqlite3_file

1129 ** An [sqlite3_file] object represents an open file in the 
1137 typedef struct sqlite3_file sqlite3_file;
1138 struct sqlite3_file {
1146 ** [sqlite3_file] object (or, more commonly, a subclass of the
1147 ** [sqlite3_file] object) with a pointer to an instance of this object.
1149 ** against the open file represented by the [sqlite3_file] object.
1151 ** If the [sqlite3_vfs.xOpen] method sets the sqlite3_file.pMethods element
1155 ** is for the [sqlite3_vfs.xOpen] to set the sqlite3_file.pMethods element
1235 int (*xClose)(sqlite3_file*);
1236 int (*xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst);
1237 int (*xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst);
1238 int (*xTruncate)(sqlite3_file*, sqlite3_int64 size);
1239 int (*xSync)(sqlite3_file*, int flags);
1240 int (*xFileSize)(sqlite3_file*, sqlite3_int64 *pSize);
1241 int (*xLock)(sqlite3_file*, int);
1242 int (*xUnlock)(sqlite3_file*, int);
1243 int (*xCheckReservedLock)(sqlite3_file*, int *pResOut);
1244 int (*xFileControl)(sqlite3_file*, int op, void *pArg);
1245 int (*xSectorSize)(sqlite3_file*);
1246 int (*xDeviceCharacteristics)(sqlite3_file*);
1248 int (*xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**);
1249 int (*xShmLock)(sqlite3_file*, int offset, int n, int flags);
1250 void (*xShmBarrier)(sqlite3_file*);
1251 int (*xShmUnmap)(sqlite3_file*, int deleteFlag);
1290 ** to the [sqlite3_file] object associated with a particular database
1367 ** file control is sent to the open [sqlite3_file] object corresponding
1431 ** The szOsFile field is the size of the subclassed [sqlite3_file]
1461 ** the [sqlite3_file] can safely store a pointer to the
1520 ** to hold the [sqlite3_file] structure passed as the third
1523 ** the xOpen method must set the sqlite3_file.pMethods to either
1525 ** this even if the open fails. SQLite expects that the sqlite3_file.pMethods
1577 int szOsFile; /* Size of subclassed sqlite3_file */
1582 int (*xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*,
6274 ** a pointer to the underlying [sqlite3_file] object to be written into
9004 SQLITE_PRIVATE sqlite3_file *sqlite3PagerFile(Pager*);
9459 ** Functions for accessing sqlite3_file methods
9461 SQLITE_PRIVATE int sqlite3OsClose(sqlite3_file*);
9462 SQLITE_PRIVATE int sqlite3OsRead(sqlite3_file*, void*, int amt, i64 offset);
9463 SQLITE_PRIVATE int sqlite3OsWrite(sqlite3_file*, const void*, int amt, i64 offset);
9464 SQLITE_PRIVATE int sqlite3OsTruncate(sqlite3_file*, i64 size);
9465 SQLITE_PRIVATE int sqlite3OsSync(sqlite3_file*, int);
9466 SQLITE_PRIVATE int sqlite3OsFileSize(sqlite3_file*, i64 *pSize);
9467 SQLITE_PRIVATE int sqlite3OsLock(sqlite3_file*, int);
9468 SQLITE_PRIVATE int sqlite3OsUnlock(sqlite3_file*, int);
9469 SQLITE_PRIVATE int sqlite3OsCheckReservedLock(sqlite3_file *id, int *pResOut);
9470 SQLITE_PRIVATE int sqlite3OsFileControl(sqlite3_file*,int,void*);
9471 SQLITE_PRIVATE void sqlite3OsFileControlHint(sqlite3_file*,int,void*);
9473 SQLITE_PRIVATE int sqlite3OsSectorSize(sqlite3_file *id);
9474 SQLITE_PRIVATE int sqlite3OsDeviceCharacteristics(sqlite3_file *id);
9475 SQLITE_PRIVATE int sqlite3OsShmMap(sqlite3_file *,int,int,int,void volatile **);
9476 SQLITE_PRIVATE int sqlite3OsShmLock(sqlite3_file *id, int, int, int);
9477 SQLITE_PRIVATE void sqlite3OsShmBarrier(sqlite3_file *id);
9478 SQLITE_PRIVATE int sqlite3OsShmUnmap(sqlite3_file *id, int);
9484 SQLITE_PRIVATE int sqlite3OsOpen(sqlite3_vfs *, const char *, sqlite3_file*, int, int *);
9502 SQLITE_PRIVATE int sqlite3OsOpenMalloc(sqlite3_vfs *, const char *, sqlite3_file **, int,int*);
9503 SQLITE_PRIVATE int sqlite3OsCloseFree(sqlite3_file *);
12089 SQLITE_PRIVATE int sqlite3JournalOpen(sqlite3_vfs *, const char *, sqlite3_file *, int, int);
12091 SQLITE_PRIVATE int sqlite3JournalCreate(sqlite3_file *);
12096 SQLITE_PRIVATE void sqlite3MemJournalOpen(sqlite3_file *);
12098 SQLITE_PRIVATE int sqlite3IsMemJournal(sqlite3_file *);
14726 ** of the sqlite3_file object. This is mostly just syntactic sugar. All
14730 SQLITE_PRIVATE int sqlite3OsClose(sqlite3_file *pId){
14738 SQLITE_PRIVATE int sqlite3OsRead(sqlite3_file *id, void *pBuf, int amt, i64 offset){
14742 SQLITE_PRIVATE int sqlite3OsWrite(sqlite3_file *id, const void *pBuf, int amt, i64 offset){
14746 SQLITE_PRIVATE int sqlite3OsTruncate(sqlite3_file *id, i64 size){
14749 SQLITE_PRIVATE int sqlite3OsSync(sqlite3_file *id, int flags){
14753 SQLITE_PRIVATE int sqlite3OsFileSize(sqlite3_file *id, i64 *pSize){
14757 SQLITE_PRIVATE int sqlite3OsLock(sqlite3_file *id, int lockType){
14761 SQLITE_PRIVATE int sqlite3OsUnlock(sqlite3_file *id, int lockType){
14764 SQLITE_PRIVATE int sqlite3OsCheckReservedLock(sqlite3_file *id, int *pResOut){
14777 SQLITE_PRIVATE int sqlite3OsFileControl(sqlite3_file *id, int op, void *pArg){
14781 SQLITE_PRIVATE void sqlite3OsFileControlHint(sqlite3_file *id, int op, void *pArg){
14785 SQLITE_PRIVATE int sqlite3OsSectorSize(sqlite3_file *id){
14786 int (*xSectorSize)(sqlite3_file*) = id->pMethods->xSectorSize;
14789 SQLITE_PRIVATE int sqlite3OsDeviceCharacteristics(sqlite3_file *id){
14792 SQLITE_PRIVATE int sqlite3OsShmLock(sqlite3_file *id, int offset, int n, int flags){
14795 SQLITE_PRIVATE void sqlite3OsShmBarrier(sqlite3_file *id){
14798 SQLITE_PRIVATE int sqlite3OsShmUnmap(sqlite3_file *id, int deleteFlag){
14802 sqlite3_file *id, /* Database file handle */
14819 sqlite3_file *pFile,
14898 sqlite3_file **ppFile,
14903 sqlite3_file *pFile;
14904 pFile = (sqlite3_file *)sqlite3MallocZero(pVfs->szOsFile);
14915 SQLITE_PRIVATE int sqlite3OsCloseFree(sqlite3_file *pFile){
22945 ** The os2File structure is subclass of sqlite3_file specific for the OS/2
22976 static int os2Close( sqlite3_file *id ){
23004 sqlite3_file *id, /* File to read from */
23035 sqlite3_file *id, /* File to write into */
23066 static int os2Truncate( sqlite3_file *id, i64 nByte ){
23098 static int os2Sync( sqlite3_file *id, int flags ){
23121 static int os2FileSize( sqlite3_file *id, sqlite3_int64 *pSize ){
23198 static int os2Lock( sqlite3_file *id, int locktype ){
23335 static int os2CheckReservedLock( sqlite3_file *id, int *pOut ){
23381 static int os2Unlock( sqlite3_file *id, int locktype ){
23437 static int os2FileControl(sqlite3_file *id, int op, void *pArg){
23473 static int os2SectorSize(sqlite3_file *id){
23481 static int os2DeviceCharacteristics(sqlite3_file *id){
23948 sqlite3_file *id, /* Handle open on database file */
24040 sqlite3_file *id, /* The underlying database file */
24088 sqlite3_file *id, /* Database file holding the shared memory */
24206 sqlite3_file *id /* Database file holding the shared memory */
24223 ** sqlite3_file for os2.
24343 sqlite3_file *id, /* Write the SQLite file handle here */
24846 ** * sqlite3_file methods not associated with locking.
25011 ** The unixFile structure is subclass of sqlite3_file specific to the unix
25954 ** The sqlite3_file structure for POSIX is no longer just an integer file
26283 static int unixCheckReservedLock(sqlite3_file *id, int *pResOut){
26394 static int unixLock(sqlite3_file *id, int eFileLock){
26641 static int posixUnlock(sqlite3_file *id, int eFileLock, int handleNFSUnlock){
26806 static int unixUnlock(sqlite3_file *id, int eFileLock){
26820 static int closeUnixFile(sqlite3_file *id){
26845 static int unixClose(sqlite3_file *id){
26889 static int nolockCheckReservedLock(sqlite3_file *NotUsed, int *pResOut){
26894 static int nolockLock(sqlite3_file *NotUsed, int NotUsed2){
26898 static int nolockUnlock(sqlite3_file *NotUsed, int NotUsed2){
26906 static int nolockClose(sqlite3_file *id) {
26951 static int dotlockCheckReservedLock(sqlite3_file *id, int *pResOut) {
27002 static int dotlockLock(sqlite3_file *id, int eFileLock) {
27052 static int dotlockUnlock(sqlite3_file *id, int eFileLock) {
27097 static int dotlockClose(sqlite3_file *id) {
27147 static int flockCheckReservedLock(sqlite3_file *id, int *pResOut){
27222 ** lock states in the sqlite3_file structure, but all locks SHARED or
27229 static int flockLock(sqlite3_file *id, int eFileLock) {
27273 static int flockUnlock(sqlite3_file *id, int eFileLock) {
27307 static int flockClose(sqlite3_file *id) {
27337 static int semCheckReservedLock(sqlite3_file *id, int *pResOut) {
27398 ** lock states in the sqlite3_file structure, but all locks SHARED or
27405 static int semLock(sqlite3_file *id, int eFileLock) {
27439 static int semUnlock(sqlite3_file *id, int eFileLock) {
27476 static int semClose(sqlite3_file *id) {
27581 static int afpCheckReservedLock(sqlite3_file *id, int *pResOut){
27651 static int afpLock(sqlite3_file *id, int eFileLock){
27833 static int afpUnlock(sqlite3_file *id, int eFileLock) {
27936 static int afpClose(sqlite3_file *id) {
27979 static int nfsUnlock(sqlite3_file *id, int eFileLock){
27993 **************** Non-locking sqlite3_file methods *****************************
27996 ** sqlite3_file object other than the locking methods. The locking
28067 sqlite3_file *id,
28146 sqlite3_file *id,
28390 static int unixSync(sqlite3_file *id, int flags){
28439 static int unixTruncate(sqlite3_file *id, i64 nByte){
28479 static int unixFileSize(sqlite3_file *id, i64 *pSize){
28508 static int proxyFileControl(sqlite3_file*,int,void*);
28584 static int unixFileControl(sqlite3_file *id, int op, void *pArg){
28649 static int unixSectorSize(sqlite3_file *pFile){
28667 static int unixDeviceCharacteristics(sqlite3_file *id){
29044 sqlite3_file *fd, /* Handle open on database file */
29155 sqlite3_file *fd, /* Database file holding the shared memory */
29267 sqlite3_file *fd /* Database file holding the shared memory */
29282 sqlite3_file *fd, /* The underlying database file */
29332 ** Here ends the implementation of all sqlite3_file methods.
29334 ********************** End sqlite3_file Methods *******************************
29477 static int proxyClose(sqlite3_file*);
29478 static int proxyLock(sqlite3_file*, int);
29479 static int proxyUnlock(sqlite3_file*, int);
29480 static int proxyCheckReservedLock(sqlite3_file*, int*);
29628 sqlite3_file *pId, /* Write to the unixFile structure here */
30044 sqlite3_file *pFile, /* The file descriptor to be filled in */
30957 rc = fillInUnixFile(&dummyVfs, fd, (sqlite3_file*)pNew, path, 0);
31092 rc = conchFile->pMethod->xLock((sqlite3_file*)conchFile, lockType);
31143 rc = conchFile->pMethod->xLock((sqlite3_file*)conchFile, SHARED_LOCK);
31146 rc = conchFile->pMethod->xLock((sqlite3_file*)conchFile, lockType);
31269 rc = conchFile->pMethod->xLock((sqlite3_file*)conchFile, EXCLUSIVE_LOCK);
31284 rc = unixWrite((sqlite3_file *)conchFile, writeBuffer, writeSize, 0);
31317 conchFile->pMethod->xUnlock((sqlite3_file*)conchFile, SHARED_LOCK);
31368 conchFile->pMethod->xUnlock((sqlite3_file*)conchFile, NO_LOCK);
31392 rc = conchFile->pMethod->xUnlock((sqlite3_file*)conchFile, NO_LOCK);
31466 rc=lockProxy->pMethod->xClose((sqlite3_file *)lockProxy);
31584 pCtx->conchFile->pMethod->xClose((sqlite3_file *)pCtx->conchFile);
31601 static int proxyFileControl(sqlite3_file *id, int op, void *pArg){
31671 static int proxyCheckReservedLock(sqlite3_file *id, int *pResOut) {
31678 return proxy->pMethod->xCheckReservedLock((sqlite3_file*)proxy, pResOut);
31710 static int proxyLock(sqlite3_file *id, int eFileLock) {
31717 rc = proxy->pMethod->xLock((sqlite3_file*)proxy, eFileLock);
31734 static int proxyUnlock(sqlite3_file *id, int eFileLock) {
31741 rc = proxy->pMethod->xUnlock((sqlite3_file*)proxy, eFileLock);
31753 static int proxyClose(sqlite3_file *id) {
31762 rc = lockProxy->pMethod->xUnlock((sqlite3_file*)lockProxy, NO_LOCK);
31764 rc = lockProxy->pMethod->xClose((sqlite3_file*)lockProxy);
31774 rc = conchFile->pMethod->xClose((sqlite3_file*)conchFile);
32178 ** The winFile structure is a subclass of sqlite3_file* specific to the win32
33718 static int winClose(sqlite3_file *id){
33757 sqlite3_file *id, /* File to read from */
33795 sqlite3_file *id, /* File to write into */
33849 static int winTruncate(sqlite3_file *id, sqlite3_int64 nByte){
33893 static int winSync(sqlite3_file *id, int flags){
33954 static int winFileSize(sqlite3_file *id, sqlite3_int64 *pSize){
34061 static int winLock(sqlite3_file *id, int locktype){
34187 static int winCheckReservedLock(sqlite3_file *id, int *pResOut){
34220 static int winUnlock(sqlite3_file *id, int locktype){
34270 static int winFileControl(sqlite3_file *id, int op, void *pArg){
34341 static int winSectorSize(sqlite3_file *id){
34349 static int winDeviceCharacteristics(sqlite3_file *id){
34521 static int winOpen(sqlite3_vfs*,const char*,sqlite3_file*,int,int*);
34552 winClose((sqlite3_file *)&p->hFile);
34631 (sqlite3_file*)&pShmNode->hFile, /* File handle here */
34642 rc = winTruncate((sqlite3_file *)&pShmNode->hFile, 0);
34692 sqlite3_file *fd, /* Database holding shared memory */
34733 sqlite3_file *fd, /* Database file holding the shared memory */
34842 sqlite3_file *fd /* Database holding the shared memory */
34870 sqlite3_file *fd, /* Handle open on database file */
34902 rc = winFileSize((sqlite3_file *)&pShmNode->hFile, &sz);
34917 rc = winTruncate((sqlite3_file *)&pShmNode->hFile, nByte);
34990 ** Here ends the implementation of all sqlite3_file methods.
34992 ********************** End sqlite3_file Methods *******************************
34997 ** sqlite3_file for win32.
35127 sqlite3_file *id, /* Write the SQLite file handle here */
38380 SQLITE_PRIVATE int sqlite3WalOpen(sqlite3_vfs*, sqlite3_file*, const char *, int, i64, Wal**);
38567 ** associated file-descriptor is returned. FILEHANDLEID() takes an sqlite3_file
39088 sqlite3_file *fd; /* File descriptor for database */
39089 sqlite3_file *jfd; /* File descriptor for main journal */
39090 sqlite3_file *sjfd; /* File descriptor for sub-journal */
39204 ** The argument to this macro is a file descriptor (type sqlite3_file*).
39458 static int read32bits(sqlite3_file *fd, i64 offset, u32 *pRes){
39477 static int write32bits(sqlite3_file *fd, i64 offset, u32 val){
39642 static int readMasterJournal(sqlite3_file *pJrnl, char *zMaster, u32 nMaster){
40547 sqlite3_file *jfd; /* The file descriptor for the journal file */
40803 sqlite3_file *pMaster; /* Malloc'd master-journal file descriptor */
40804 sqlite3_file *pJournal; /* Malloc'd child-journal file descriptor */
40814 pMaster = (sqlite3_file *)sqlite3MallocZero(pVfs->szOsFile * 2);
40815 pJournal = (sqlite3_file *)(((u8 *)pMaster) + pVfs->szOsFile);
41851 sqlite3_file *pFile, /* Write the file descriptor here */
42854 pPager->fd = (sqlite3_file*)(pPtr += ROUND8(pcacheSize));
42855 pPager->sjfd = (sqlite3_file*)(pPtr += ROUND8(pVfs->szOsFile));
42856 pPager->jfd = (sqlite3_file*)(pPtr += journalFileSize);
44737 SQLITE_PRIVATE sqlite3_file *sqlite3PagerFile(Pager *pPager){
45758 sqlite3_file *pDbFd; /* File handle for the database file */
45759 sqlite3_file *pWalFd; /* File handle for WAL file */
46598 sqlite3_file *pDbFd, /* The open database file */
46631 pRet->pWalFd = (sqlite3_file *)&pRet[1];
47989 sqlite3_file *pFd; /* The WAL file to which we write */
53329 sqlite3_file *fd;
57948 static int backupTruncateFile(sqlite3_file *pFile, i64 iSize){
58108 sqlite3_file * const pFile = sqlite3PagerFile(pDestPager);
58319 sqlite3_file *pFd; /* File descriptor for database pTo */
61356 sqlite3_file *pMaster = 0;
71761 sqlite3_file *pTemp1; /* PMA file 1 */
71775 sqlite3_file *pFile; /* File iterator is reading from */
71867 sqlite3_file *pFile, /* File to write to */
71894 sqlite3_file *pFile, /* File to read from */
72109 static int vdbeSorterOpenTempFile(sqlite3 *db, sqlite3_file **ppFile){
72346 sqlite3_file *pTemp2 = 0; /* Second temp file to use */
72431 sqlite3_file *pTmp = pSorter->pTemp1;
72554 ** This file implements a special kind of sqlite3_file object used
72558 ** The distinctive characteristic of this sqlite3_file is that the
72572 ** A JournalFile object is a subclass of sqlite3_file used by
72582 sqlite3_file *pReal; /* The "real" underlying file descriptor */
72594 sqlite3_file *pReal = (sqlite3_file *)&p[1];
72610 static int jrnlClose(sqlite3_file *pJfd){
72623 sqlite3_file *pJfd, /* The journal file from which to read */
72644 sqlite3_file *pJfd, /* The journal file into which to write */
72670 static int jrnlTruncate(sqlite3_file *pJfd, sqlite_int64 size){
72684 static int jrnlSync(sqlite3_file *pJfd, int flags){
72698 static int jrnlFileSize(sqlite3_file *pJfd, sqlite_int64 *pSize){
72710 ** Table of methods for JournalFile sqlite3_file object.
72738 sqlite3_file *pJfd, /* Preallocated, blank file handle */
72764 SQLITE_PRIVATE int sqlite3JournalCreate(sqlite3_file *p){
72838 ** This subclass is a subclass of sqlite3_file. Each open memory-journal
72853 sqlite3_file *pJfd, /* The journal file from which to read */
72898 sqlite3_file *pJfd, /* The journal file into which to write */
72947 static int memjrnlTruncate(sqlite3_file *pJfd, sqlite_int64 size){
72965 static int memjrnlClose(sqlite3_file *pJfd){
72979 static int memjrnlSync(sqlite3_file *NotUsed, int NotUsed2){
72987 static int memjrnlFileSize(sqlite3_file *pJfd, sqlite_int64 *pSize){
72994 ** Table of methods for MemJournal sqlite3_file object.
73019 SQLITE_PRIVATE void sqlite3MemJournalOpen(sqlite3_file *pJfd){
73030 SQLITE_PRIVATE int sqlite3IsMemJournal(sqlite3_file *pJfd){
92903 sqlite3_file *pFile = sqlite3PagerFile(pPager);
92916 sqlite3_file *pFile = sqlite3PagerFile(pPager);
115177 sqlite3_file *fd;
115184 *(sqlite3_file**)pArg = fd;