| OLD | NEW |
| 1 /* | 1 /* |
| 2 ** 2008 Jan 22 | 2 ** 2008 Jan 22 |
| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 int iDeviceChar; | 126 int iDeviceChar; |
| 127 int iSectorSize; | 127 int iSectorSize; |
| 128 }; | 128 }; |
| 129 struct DevsymGlobal g = {0, 0, 512}; | 129 struct DevsymGlobal g = {0, 0, 512}; |
| 130 | 130 |
| 131 /* | 131 /* |
| 132 ** Close an devsym-file. | 132 ** Close an devsym-file. |
| 133 */ | 133 */ |
| 134 static int devsymClose(sqlite3_file *pFile){ | 134 static int devsymClose(sqlite3_file *pFile){ |
| 135 devsym_file *p = (devsym_file *)pFile; | 135 devsym_file *p = (devsym_file *)pFile; |
| 136 return sqlite3OsClose(p->pReal); | 136 sqlite3OsClose(p->pReal); |
| 137 return SQLITE_OK; |
| 137 } | 138 } |
| 138 | 139 |
| 139 /* | 140 /* |
| 140 ** Read data from an devsym-file. | 141 ** Read data from an devsym-file. |
| 141 */ | 142 */ |
| 142 static int devsymRead( | 143 static int devsymRead( |
| 143 sqlite3_file *pFile, | 144 sqlite3_file *pFile, |
| 144 void *zBuf, | 145 void *zBuf, |
| 145 int iAmt, | 146 int iAmt, |
| 146 sqlite_int64 iOfst | 147 sqlite_int64 iOfst |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 }else{ | 389 }else{ |
| 389 g.iDeviceChar = 0; | 390 g.iDeviceChar = 0; |
| 390 } | 391 } |
| 391 if( iSectorSize>=0 ){ | 392 if( iSectorSize>=0 ){ |
| 392 g.iSectorSize = iSectorSize; | 393 g.iSectorSize = iSectorSize; |
| 393 }else{ | 394 }else{ |
| 394 g.iSectorSize = 512; | 395 g.iSectorSize = 512; |
| 395 } | 396 } |
| 396 } | 397 } |
| 397 | 398 |
| 399 void devsym_unregister(){ |
| 400 sqlite3_vfs_unregister(&devsym_vfs); |
| 401 g.pVfs = 0; |
| 402 g.iDeviceChar = 0; |
| 403 g.iSectorSize = 0; |
| 404 } |
| 405 |
| 398 #endif | 406 #endif |
| OLD | NEW |