OLD | NEW |
1 /* | 1 /* |
2 ** 2007 September 14 | 2 ** 2007 September 14 |
3 ** | 3 ** |
4 ** The author disclaims copyright to this source code. In place of | 4 ** The author disclaims copyright to this source code. In place of |
5 ** a legal notice, here is a blessing: | 5 ** a legal notice, here is a blessing: |
6 ** | 6 ** |
7 ** May you do good and not evil. | 7 ** May you do good and not evil. |
8 ** May you find forgiveness for yourself and forgive others. | 8 ** May you find forgiveness for yourself and forgive others. |
9 ** May you share freely, never taking more than you give. | 9 ** May you share freely, never taking more than you give. |
10 ** | 10 ** |
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 int *pOutFlags | 588 int *pOutFlags |
589 ){ | 589 ){ |
590 fs_vfs_t *pFsVfs = (fs_vfs_t *)pVfs; | 590 fs_vfs_t *pFsVfs = (fs_vfs_t *)pVfs; |
591 fs_file *p = (fs_file *)pFile; | 591 fs_file *p = (fs_file *)pFile; |
592 fs_real_file *pReal = 0; | 592 fs_real_file *pReal = 0; |
593 int eType; | 593 int eType; |
594 int nName; | 594 int nName; |
595 int rc = SQLITE_OK; | 595 int rc = SQLITE_OK; |
596 | 596 |
597 if( 0==(flags&(SQLITE_OPEN_MAIN_DB|SQLITE_OPEN_MAIN_JOURNAL)) ){ | 597 if( 0==(flags&(SQLITE_OPEN_MAIN_DB|SQLITE_OPEN_MAIN_JOURNAL)) ){ |
598 tmp_file *p = (tmp_file *)pFile; | 598 tmp_file *p2 = (tmp_file *)pFile; |
599 memset(p, 0, sizeof(*p)); | 599 memset(p2, 0, sizeof(*p2)); |
600 p->base.pMethods = &tmp_io_methods; | 600 p2->base.pMethods = &tmp_io_methods; |
601 return SQLITE_OK; | 601 return SQLITE_OK; |
602 } | 602 } |
603 | 603 |
604 eType = ((flags&(SQLITE_OPEN_MAIN_DB))?DATABASE_FILE:JOURNAL_FILE); | 604 eType = ((flags&(SQLITE_OPEN_MAIN_DB))?DATABASE_FILE:JOURNAL_FILE); |
605 p->base.pMethods = &fs_io_methods; | 605 p->base.pMethods = &fs_io_methods; |
606 p->eType = eType; | 606 p->eType = eType; |
607 | 607 |
608 assert(strlen("-journal")==8); | 608 assert(strlen("-journal")==8); |
609 nName = (int)strlen(zName)-((eType==JOURNAL_FILE)?8:0); | 609 nName = (int)strlen(zName)-((eType==JOURNAL_FILE)?8:0); |
610 pReal=pFsVfs->pFileList; | 610 pReal=pFsVfs->pFileList; |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
821 if( fs_vfs.pParent ) return SQLITE_OK; | 821 if( fs_vfs.pParent ) return SQLITE_OK; |
822 fs_vfs.pParent = sqlite3_vfs_find(0); | 822 fs_vfs.pParent = sqlite3_vfs_find(0); |
823 fs_vfs.base.mxPathname = fs_vfs.pParent->mxPathname; | 823 fs_vfs.base.mxPathname = fs_vfs.pParent->mxPathname; |
824 fs_vfs.base.szOsFile = MAX(sizeof(tmp_file), sizeof(fs_file)); | 824 fs_vfs.base.szOsFile = MAX(sizeof(tmp_file), sizeof(fs_file)); |
825 return sqlite3_vfs_register(&fs_vfs.base, 0); | 825 return sqlite3_vfs_register(&fs_vfs.base, 0); |
826 } | 826 } |
827 | 827 |
828 #ifdef SQLITE_TEST | 828 #ifdef SQLITE_TEST |
829 int SqlitetestOnefile_Init() {return fs_register();} | 829 int SqlitetestOnefile_Init() {return fs_register();} |
830 #endif | 830 #endif |
OLD | NEW |