Lines Matching refs:sqlite3_file
1188 ** An [sqlite3_file] object represents an open file in the
1196 typedef struct sqlite3_file sqlite3_file;
1197 struct sqlite3_file {
1205 ** [sqlite3_file] object (or, more commonly, a subclass of the
1206 ** [sqlite3_file] object) with a pointer to an instance of this object.
1208 ** against the open file represented by the [sqlite3_file] object.
1210 ** If the [sqlite3_vfs.xOpen] method sets the sqlite3_file.pMethods element
1214 ** is for the [sqlite3_vfs.xOpen] to set the sqlite3_file.pMethods element
1294 int (*xClose)(sqlite3_file*);
1295 int (*xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst);
1296 int (*xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst);
1297 int (*xTruncate)(sqlite3_file*, sqlite3_int64 size);
1298 int (*xSync)(sqlite3_file*, int flags);
1299 int (*xFileSize)(sqlite3_file*, sqlite3_int64 *pSize);
1300 int (*xLock)(sqlite3_file*, int);
1301 int (*xUnlock)(sqlite3_file*, int);
1302 int (*xCheckReservedLock)(sqlite3_file*, int *pResOut);
1303 int (*xFileControl)(sqlite3_file*, int op, void *pArg);
1304 int (*xSectorSize)(sqlite3_file*);
1305 int (*xDeviceCharacteristics)(sqlite3_file*);
1307 int (*xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**);
1308 int (*xShmLock)(sqlite3_file*, int offset, int n, int flags);
1309 void (*xShmBarrier)(sqlite3_file*);
1310 int (*xShmUnmap)(sqlite3_file*, int deleteFlag);
1312 int (*xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp);
1313 int (*xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p);
1352 ** to the [sqlite3_file] object associated with a particular database
1429 ** file control is sent to the open [sqlite3_file] object corresponding
1528 ** The szOsFile field is the size of the subclassed [sqlite3_file]
1558 ** the [sqlite3_file] can safely store a pointer to the
1617 ** to hold the [sqlite3_file] structure passed as the third
1620 ** the xOpen method must set the sqlite3_file.pMethods to either
1622 ** this even if the open fails. SQLite expects that the sqlite3_file.pMethods
1674 int szOsFile; /* Size of subclassed sqlite3_file */
1679 int (*xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*,
6510 ** a pointer to the underlying [sqlite3_file] object to be written into
9344 SQLITE_PRIVATE sqlite3_file *sqlite3PagerFile(Pager*);
9351 SQLITE_PRIVATE int sqlite3SectorSize(sqlite3_file *);
9781 ** Functions for accessing sqlite3_file methods
9783 SQLITE_PRIVATE int sqlite3OsClose(sqlite3_file*);
9784 SQLITE_PRIVATE int sqlite3OsRead(sqlite3_file*, void*, int amt, i64 offset);
9785 SQLITE_PRIVATE int sqlite3OsWrite(sqlite3_file*, const void*, int amt, i64 offset);
9786 SQLITE_PRIVATE int sqlite3OsTruncate(sqlite3_file*, i64 size);
9787 SQLITE_PRIVATE int sqlite3OsSync(sqlite3_file*, int);
9788 SQLITE_PRIVATE int sqlite3OsFileSize(sqlite3_file*, i64 *pSize);
9789 SQLITE_PRIVATE int sqlite3OsLock(sqlite3_file*, int);
9790 SQLITE_PRIVATE int sqlite3OsUnlock(sqlite3_file*, int);
9791 SQLITE_PRIVATE int sqlite3OsCheckReservedLock(sqlite3_file *id, int *pResOut);
9792 SQLITE_PRIVATE int sqlite3OsFileControl(sqlite3_file*,int,void*);
9793 SQLITE_PRIVATE void sqlite3OsFileControlHint(sqlite3_file*,int,void*);
9795 SQLITE_PRIVATE int sqlite3OsSectorSize(sqlite3_file *id);
9796 SQLITE_PRIVATE int sqlite3OsDeviceCharacteristics(sqlite3_file *id);
9797 SQLITE_PRIVATE int sqlite3OsShmMap(sqlite3_file *,int,int,int,void volatile **);
9798 SQLITE_PRIVATE int sqlite3OsShmLock(sqlite3_file *id, int, int, int);
9799 SQLITE_PRIVATE void sqlite3OsShmBarrier(sqlite3_file *id);
9800 SQLITE_PRIVATE int sqlite3OsShmUnmap(sqlite3_file *id, int);
9801 SQLITE_PRIVATE int sqlite3OsFetch(sqlite3_file *id, i64, int, void **);
9802 SQLITE_PRIVATE int sqlite3OsUnfetch(sqlite3_file *, i64, void *);
9808 SQLITE_PRIVATE int sqlite3OsOpen(sqlite3_vfs *, const char *, sqlite3_file*, int, int *);
9826 SQLITE_PRIVATE int sqlite3OsOpenMalloc(sqlite3_vfs *, const char *, sqlite3_file **, int,int*);
9827 SQLITE_PRIVATE int sqlite3OsCloseFree(sqlite3_file *);
12488 SQLITE_PRIVATE int sqlite3JournalOpen(sqlite3_vfs *, const char *, sqlite3_file *, int, int);
12490 SQLITE_PRIVATE int sqlite3JournalCreate(sqlite3_file *);
12491 SQLITE_PRIVATE int sqlite3JournalExists(sqlite3_file *p);
12497 SQLITE_PRIVATE void sqlite3MemJournalOpen(sqlite3_file *);
12499 SQLITE_PRIVATE int sqlite3IsMemJournal(sqlite3_file *);
15152 ** of the sqlite3_file object. This is mostly just syntactic sugar. All
15156 SQLITE_PRIVATE int sqlite3OsClose(sqlite3_file *pId){
15164 SQLITE_PRIVATE int sqlite3OsRead(sqlite3_file *id, void *pBuf, int amt, i64 offset){
15168 SQLITE_PRIVATE int sqlite3OsWrite(sqlite3_file *id, const void *pBuf, int amt, i64 offset){
15172 SQLITE_PRIVATE int sqlite3OsTruncate(sqlite3_file *id, i64 size){
15175 SQLITE_PRIVATE int sqlite3OsSync(sqlite3_file *id, int flags){
15179 SQLITE_PRIVATE int sqlite3OsFileSize(sqlite3_file *id, i64 *pSize){
15183 SQLITE_PRIVATE int sqlite3OsLock(sqlite3_file *id, int lockType){
15187 SQLITE_PRIVATE int sqlite3OsUnlock(sqlite3_file *id, int lockType){
15190 SQLITE_PRIVATE int sqlite3OsCheckReservedLock(sqlite3_file *id, int *pResOut){
15203 SQLITE_PRIVATE int sqlite3OsFileControl(sqlite3_file *id, int op, void *pArg){
15207 SQLITE_PRIVATE void sqlite3OsFileControlHint(sqlite3_file *id, int op, void *pArg){
15211 SQLITE_PRIVATE int sqlite3OsSectorSize(sqlite3_file *id){
15212 int (*xSectorSize)(sqlite3_file*) = id->pMethods->xSectorSize;
15215 SQLITE_PRIVATE int sqlite3OsDeviceCharacteristics(sqlite3_file *id){
15218 SQLITE_PRIVATE int sqlite3OsShmLock(sqlite3_file *id, int offset, int n, int flags){
15221 SQLITE_PRIVATE void sqlite3OsShmBarrier(sqlite3_file *id){
15224 SQLITE_PRIVATE int sqlite3OsShmUnmap(sqlite3_file *id, int deleteFlag){
15228 sqlite3_file *id, /* Database file handle */
15240 SQLITE_PRIVATE int sqlite3OsFetch(sqlite3_file *id, i64 iOff, int iAmt, void **pp){
15244 SQLITE_PRIVATE int sqlite3OsUnfetch(sqlite3_file *id, i64 iOff, void *p){
15249 SQLITE_PRIVATE int sqlite3OsFetch(sqlite3_file *id, i64 iOff, int iAmt, void **pp){
15253 SQLITE_PRIVATE int sqlite3OsUnfetch(sqlite3_file *id, i64 iOff, void *p){
15265 sqlite3_file *pFile,
15344 sqlite3_file **ppFile,
15349 sqlite3_file *pFile;
15350 pFile = (sqlite3_file *)sqlite3MallocZero(pVfs->szOsFile);
15361 SQLITE_PRIVATE int sqlite3OsCloseFree(sqlite3_file *pFile){
22924 ** * sqlite3_file methods not associated with locking.
23096 ** The unixFile structure is subclass of sqlite3_file specific to the unix
24074 ** The sqlite3_file structure for POSIX is no longer just an integer file
24446 static int unixCheckReservedLock(sqlite3_file *id, int *pResOut){
24557 static int unixLock(sqlite3_file *id, int eFileLock){
24804 static int posixUnlock(sqlite3_file *id, int eFileLock, int handleNFSUnlock){
24969 static int unixUnlock(sqlite3_file *id, int eFileLock){
24987 static int closeUnixFile(sqlite3_file *id){
25013 static int unixClose(sqlite3_file *id){
25058 static int nolockCheckReservedLock(sqlite3_file *NotUsed, int *pResOut){
25063 static int nolockLock(sqlite3_file *NotUsed, int NotUsed2){
25067 static int nolockUnlock(sqlite3_file *NotUsed, int NotUsed2){
25075 static int nolockClose(sqlite3_file *id) {
25120 static int dotlockCheckReservedLock(sqlite3_file *id, int *pResOut) {
25171 static int dotlockLock(sqlite3_file *id, int eFileLock) {
25221 static int dotlockUnlock(sqlite3_file *id, int eFileLock) {
25266 static int dotlockClose(sqlite3_file *id) {
25316 static int flockCheckReservedLock(sqlite3_file *id, int *pResOut){
25391 ** lock states in the sqlite3_file structure, but all locks SHARED or
25398 static int flockLock(sqlite3_file *id, int eFileLock) {
25442 static int flockUnlock(sqlite3_file *id, int eFileLock) {
25476 static int flockClose(sqlite3_file *id) {
25508 static int semCheckReservedLock(sqlite3_file *id, int *pResOut) {
25569 ** lock states in the sqlite3_file structure, but all locks SHARED or
25576 static int semLock(sqlite3_file *id, int eFileLock) {
25610 static int semUnlock(sqlite3_file *id, int eFileLock) {
25647 static int semClose(sqlite3_file *id) {
25752 static int afpCheckReservedLock(sqlite3_file *id, int *pResOut){
25822 static int afpLock(sqlite3_file *id, int eFileLock){
26004 static int afpUnlock(sqlite3_file *id, int eFileLock) {
26107 static int afpClose(sqlite3_file *id) {
26150 static int nfsUnlock(sqlite3_file *id, int eFileLock){
26164 **************** Non-locking sqlite3_file methods *****************************
26167 ** sqlite3_file object other than the locking methods. The locking
26240 sqlite3_file *id,
26353 sqlite3_file *id,
26611 static int unixSync(sqlite3_file *id, int flags){
26660 static int unixTruncate(sqlite3_file *id, i64 nByte){
26708 static int unixFileSize(sqlite3_file *id, i64 *pSize){
26737 static int proxyFileControl(sqlite3_file*,int,void*);
26827 static int unixFileControl(sqlite3_file *id, int op, void *pArg){
26913 static int unixSectorSize(sqlite3_file *NotUsed){
26925 static int unixSectorSize(sqlite3_file *id){
27012 static int unixDeviceCharacteristics(sqlite3_file *id){
27388 sqlite3_file *fd, /* Handle open on database file */
27515 sqlite3_file *fd, /* Database file holding the shared memory */
27627 sqlite3_file *fd /* Database file holding the shared memory */
27642 sqlite3_file *fd, /* The underlying database file */
27868 static int unixFetch(sqlite3_file *fd, i64 iOff, int nAmt, void **pp){
27899 static int unixUnfetch(sqlite3_file *fd, i64 iOff, void *p){
27922 ** Here ends the implementation of all sqlite3_file methods.
27924 ********************** End sqlite3_file Methods *******************************
28069 static int proxyClose(sqlite3_file*);
28070 static int proxyLock(sqlite3_file*, int);
28071 static int proxyUnlock(sqlite3_file*, int);
28072 static int proxyCheckReservedLock(sqlite3_file*, int*);
28220 sqlite3_file *pId, /* Write to the unixFile structure here */
28637 sqlite3_file *pFile, /* The file descriptor to be filled in */
29548 rc = fillInUnixFile(&dummyVfs, fd, (sqlite3_file*)pNew, path, 0);
29683 rc = conchFile->pMethod->xLock((sqlite3_file*)conchFile, lockType);
29734 rc = conchFile->pMethod->xLock((sqlite3_file*)conchFile, SHARED_LOCK);
29737 rc = conchFile->pMethod->xLock((sqlite3_file*)conchFile, lockType);
29860 rc = conchFile->pMethod->xLock((sqlite3_file*)conchFile, EXCLUSIVE_LOCK);
29875 rc = unixWrite((sqlite3_file *)conchFile, writeBuffer, writeSize, 0);
29908 conchFile->pMethod->xUnlock((sqlite3_file*)conchFile, SHARED_LOCK);
29959 conchFile->pMethod->xUnlock((sqlite3_file*)conchFile, NO_LOCK);
29983 rc = conchFile->pMethod->xUnlock((sqlite3_file*)conchFile, NO_LOCK);
30057 rc=lockProxy->pMethod->xClose((sqlite3_file *)lockProxy);
30175 pCtx->conchFile->pMethod->xClose((sqlite3_file *)pCtx->conchFile);
30192 static int proxyFileControl(sqlite3_file *id, int op, void *pArg){
30262 static int proxyCheckReservedLock(sqlite3_file *id, int *pResOut) {
30269 return proxy->pMethod->xCheckReservedLock((sqlite3_file*)proxy, pResOut);
30301 static int proxyLock(sqlite3_file *id, int eFileLock) {
30308 rc = proxy->pMethod->xLock((sqlite3_file*)proxy, eFileLock);
30325 static int proxyUnlock(sqlite3_file *id, int eFileLock) {
30332 rc = proxy->pMethod->xUnlock((sqlite3_file*)proxy, eFileLock);
30344 static int proxyClose(sqlite3_file *id) {
30353 rc = lockProxy->pMethod->xUnlock((sqlite3_file*)lockProxy, NO_LOCK);
30355 rc = lockProxy->pMethod->xClose((sqlite3_file*)lockProxy);
30365 rc = conchFile->pMethod->xClose((sqlite3_file*)conchFile);
30846 ** The winFile structure is a subclass of sqlite3_file* specific to the win32
32812 static int winClose(sqlite3_file *id){
32863 sqlite3_file *id, /* File to read from */
32937 sqlite3_file *id, /* File to write into */
33039 static int winTruncate(sqlite3_file *id, sqlite3_int64 nByte){
33095 static int winSync(sqlite3_file *id, int flags){
33159 static int winFileSize(sqlite3_file *id, sqlite3_int64 *pSize){
33319 static int winLock(sqlite3_file *id, int locktype){
33449 static int winCheckReservedLock(sqlite3_file *id, int *pResOut){
33485 static int winUnlock(sqlite3_file *id, int locktype){
33540 static int winFileControl(sqlite3_file *id, int op, void *pArg){
33643 static int winSectorSize(sqlite3_file *id){
33651 static int winDeviceCharacteristics(sqlite3_file *id){
33818 static int winOpen(sqlite3_vfs*,const char*,sqlite3_file*,int,int*);
33849 winClose((sqlite3_file *)&p->hFile);
33926 (sqlite3_file*)&pShmNode->hFile, /* File handle here */
33937 rc = winTruncate((sqlite3_file *)&pShmNode->hFile, 0);
33987 sqlite3_file *fd, /* Database holding shared memory */
34028 sqlite3_file *fd, /* Database file holding the shared memory */
34137 sqlite3_file *fd /* Database holding the shared memory */
34165 sqlite3_file *fd, /* Handle open on database file */
34197 rc = winFileSize((sqlite3_file *)&pShmNode->hFile, &sz);
34212 rc = winTruncate((sqlite3_file *)&pShmNode->hFile, nByte);
34365 rc = winFileSize((sqlite3_file*)pFd, &nMap);
34450 static int winFetch(sqlite3_file *fd, i64 iOff, int nAmt, void **pp){
34491 static int winUnfetch(sqlite3_file *fd, i64 iOff, void *p){
34525 ** Here ends the implementation of all sqlite3_file methods.
34527 ********************** End sqlite3_file Methods *******************************
34532 ** sqlite3_file for win32.
34701 sqlite3_file *id, /* Write the SQLite file handle here */
38272 SQLITE_PRIVATE int sqlite3WalOpen(sqlite3_vfs*, sqlite3_file*, const char *, int, i64, Wal**);
38460 ** associated file-descriptor is returned. FILEHANDLEID() takes an sqlite3_file
38981 sqlite3_file *fd; /* File descriptor for database */
38982 sqlite3_file *jfd; /* File descriptor for main journal */
38983 sqlite3_file *sjfd; /* File descriptor for sub-journal */
39121 ** The argument to this macro is a file descriptor (type sqlite3_file*).
39375 static int read32bits(sqlite3_file *fd, i64 offset, u32 *pRes){
39394 static int write32bits(sqlite3_file *fd, i64 offset, u32 val){
39559 static int readMasterJournal(sqlite3_file *pJrnl, char *zMaster, u32 nMaster){
40477 sqlite3_file *jfd; /* The file descriptor for the journal file */
40733 sqlite3_file *pMaster; /* Malloc'd master-journal file descriptor */
40734 sqlite3_file *pJournal; /* Malloc'd child-journal file descriptor */
40744 pMaster = (sqlite3_file *)sqlite3MallocZero(pVfs->szOsFile * 2);
40745 pJournal = (sqlite3_file *)(((u8 *)pMaster) + pVfs->szOsFile);
40876 SQLITE_PRIVATE int sqlite3SectorSize(sqlite3_file *pFile){
41712 sqlite3_file *fd = pPager->fd;
41836 sqlite3_file *pFile, /* Write the file descriptor here */
42944 pPager->fd = (sqlite3_file*)(pPtr += ROUND8(pcacheSize));
42945 pPager->sjfd = (sqlite3_file*)(pPtr += ROUND8(pVfs->szOsFile));
42946 pPager->jfd = (sqlite3_file*)(pPtr += journalFileSize);
44884 SQLITE_PRIVATE sqlite3_file *sqlite3PagerFile(Pager *pPager){
45909 sqlite3_file *pDbFd; /* File handle for the database file */
45910 sqlite3_file *pWalFd; /* File handle for WAL file */
46751 sqlite3_file *pDbFd, /* The open database file */
46784 pRet->pWalFd = (sqlite3_file *)&pRet[1];
48147 sqlite3_file *pFd; /* The WAL file to which we write */
53613 sqlite3_file *fd;
58343 static int backupTruncateFile(sqlite3_file *pFile, i64 iSize){
58510 sqlite3_file * const pFile = sqlite3PagerFile(pDestPager);
58738 sqlite3_file *pFd; /* File descriptor for database pTo */
61770 sqlite3_file *pMaster = 0;
72277 sqlite3_file *pTemp1; /* PMA file 1 */
72291 sqlite3_file *pFile; /* File iterator is reading from */
72311 sqlite3_file *pFile; /* File to write to */
72707 static int vdbeSorterOpenTempFile(sqlite3 *db, sqlite3_file **ppFile){
72793 sqlite3_file *pFile, /* File to write to */
73019 sqlite3_file *pTemp2 = 0; /* Second temp file to use */
73105 sqlite3_file *pTmp = pSorter->pTemp1;
73226 ** This file implements a special kind of sqlite3_file object used
73230 ** The distinctive characteristic of this sqlite3_file is that the
73244 ** A JournalFile object is a subclass of sqlite3_file used by
73254 sqlite3_file *pReal; /* The "real" underlying file descriptor */
73266 sqlite3_file *pReal = (sqlite3_file *)&p[1];
73290 static int jrnlClose(sqlite3_file *pJfd){
73303 sqlite3_file *pJfd, /* The journal file from which to read */
73324 sqlite3_file *pJfd, /* The journal file into which to write */
73350 static int jrnlTruncate(sqlite3_file *pJfd, sqlite_int64 size){
73364 static int jrnlSync(sqlite3_file *pJfd, int flags){
73378 static int jrnlFileSize(sqlite3_file *pJfd, sqlite_int64 *pSize){
73390 ** Table of methods for JournalFile sqlite3_file object.
73418 sqlite3_file *pJfd, /* Preallocated, blank file handle */
73444 SQLITE_PRIVATE int sqlite3JournalCreate(sqlite3_file *p){
73457 SQLITE_PRIVATE int sqlite3JournalExists(sqlite3_file *p){
73528 ** This subclass is a subclass of sqlite3_file. Each open memory-journal
73543 sqlite3_file *pJfd, /* The journal file from which to read */
73588 sqlite3_file *pJfd, /* The journal file into which to write */
73637 static int memjrnlTruncate(sqlite3_file *pJfd, sqlite_int64 size){
73655 static int memjrnlClose(sqlite3_file *pJfd){
73669 static int memjrnlSync(sqlite3_file *NotUsed, int NotUsed2){
73677 static int memjrnlFileSize(sqlite3_file *pJfd, sqlite_int64 *pSize){
73684 ** Table of methods for MemJournal sqlite3_file object.
73711 SQLITE_PRIVATE void sqlite3MemJournalOpen(sqlite3_file *pJfd){
73722 SQLITE_PRIVATE int sqlite3IsMemJournal(sqlite3_file *pJfd){
94288 sqlite3_file *pFile = sqlite3PagerFile(pPager);
94301 sqlite3_file *pFile = sqlite3PagerFile(pPager);
117778 sqlite3_file *fd;
117785 *(sqlite3_file**)pArg = fd;