#include <sqlite3.h>#include "TFile.h"#include "TKey.h"#include <cassert>#include <cerrno>#include <cstddef>#include <cstdio>#include <cstdlib>#include <cstring>#include <dlfcn.h>#include <fcntl.h>#include <sys/stat.h>#include <sys/time.h>#include <sys/types.h>#include <time.h>#include <unistd.h>Go to the source code of this file.
Classes | |
| struct | unixFile |
| struct | unix_syscall |
| class | RootFileSentry |
Macros | |
| #define | SQLITE_OPEN_WAL 0x00080000 /* VFS only */ |
| #define | SQLITE_FCNTL_SIZE_HINT 5 |
| #define | SQLITE_FCNTL_CHUNK_SIZE 6 |
| #define | SQLITE_FCNTL_SYNC_OMITTED 8 |
| #define | SQLITE_FCNTL_DB_UNCHANGED 0xca093fa0 |
| #define | SQLITE_DEFAULT_SECTOR_SIZE 512 |
| #define | UNUSED_PARAMETER(x) (void)(x) |
| #define | UNUSED_PARAMETER2(x, y) UNUSED_PARAMETER(x), UNUSED_PARAMETER(y) |
| #define | ArraySize(X) ((int)(sizeof(X) / sizeof(X[0]))) |
| #define | _LARGE_FILE 1 |
| #define | _FILE_OFFSET_BITS 64 |
| #define | _LARGEFILE_SOURCE 1 |
| #define | TKEYVFS_TRACE 0 |
| #define | MEMPAGE 2048 |
| #define | MAX_PATHNAME 512 |
| #define | SQLITE_TEMP_FILE_PREFIX "etilqs_" |
| #define | O_LARGEFILE 0 |
| #define | O_NOFOLLOW 0 |
| #define | O_BINARY 0 |
| #define | SQLITE_CANTOPEN_BKPT sqlite3CantopenError(__LINE__) |
| #define | osOpen ((int (*)(const char*, int, ...))aSyscall[0].pCurrent) |
| #define | osClose ((int (*)(int))aSyscall[1].pCurrent) |
| #define | osAccess ((int (*)(const char*, int))aSyscall[2].pCurrent) |
| #define | osGetcwd ((char* (*)(char*, size_t))aSyscall[3].pCurrent) |
| #define | osStat ((int (*)(const char*, struct stat*))aSyscall[4].pCurrent) |
| #define | osFstat ((int (*)(int, struct stat*))aSyscall[5].pCurrent) |
| #define | osFtruncate ((int (*)(int, off_t))aSyscall[6].pCurrent) |
| #define | osFcntl ((int (*)(int, int, ...))aSyscall[7].pCurrent) |
| #define | osRead ((ssize_t(*)(int, void*, size_t))aSyscall[8].pCurrent) |
| #define | osPread ((ssize_t(*)(int, void*, size_t, off_t))aSyscall[9].pCurrent) |
| #define | osPread64 ((ssize_t(*)(int, void*, size_t, off_t))aSyscall[10].pCurrent) |
| #define | osWrite ((ssize_t(*)(int, const void*, size_t))aSyscall[11].pCurrent) |
| #define | osPwrite ((ssize_t(*)(int, const void*, size_t, off_t))aSyscall[12].pCurrent) |
| #define | osPwrite64 ((ssize_t(*)(int, const void*, size_t, off_t))aSyscall[13].pCurrent) |
| #define | osFchmod ((int (*)(int, mode_t))aSyscall[14].pCurrent) |
| #define | osFallocate ((int (*)(int, off_t, off_t))aSyscall[15].pCurrent) |
| #define | unixLogError(a, b, c) unixLogErrorAtLine(a, b, c, __LINE__) |
| #define | UNIXVFS(VFSNAME, FINDER) |
Typedefs | |
| typedef sqlite_int64 | i64 |
| typedef struct unixFile | unixFile |
| typedef const sqlite3_io_methods *(* | finder_type) (const char *, unixFile *) |
Functions | |
| static int | sqlite3CantopenError (int lineno) |
| static int | sqlite3Strlen30 (const char *z) |
| static const sqlite3_io_methods * | nolockIoFinderImpl (const char *z, unixFile *p) |
| static int | unixLogErrorAtLine (int errcode, const char *zFunc, const char *zPath, int iLine) |
| static int | robust_open (const char *z, int f, int m) |
| static void | robust_close (unixFile *pFile, int h, int lineno) |
| static int | unixGetTempname (int nBuf, char *zBuf) |
| static int | fcntlSizeHint (unixFile *pFile, i64 nByte) |
| static int | seekAndRead (unixFile *id, sqlite3_int64 offset, void *pBuf, int cnt) |
| static int | seekAndWrite (unixFile *id, i64 offset, const void *pBuf, int cnt) |
| static int | nolockClose (sqlite3_file *id) |
| static int | unixRead (sqlite3_file *id, void *pBuf, int amt, sqlite3_int64 offset) |
| static int | unixWrite (sqlite3_file *id, const void *pBuf, int amt, sqlite3_int64 offset) |
| static int | unixTruncate (sqlite3_file *id, i64 nByte) |
| static int | unixSync (sqlite3_file *id, int flags) |
| static int | unixFileSize (sqlite3_file *id, i64 *pSize) |
| static int | nolockLock (sqlite3_file *NotUsed, int NotUsed2) |
| static int | nolockUnlock (sqlite3_file *NotUsed, int NotUsed2) |
| static int | nolockCheckReservedLock (sqlite3_file *NotUsed, int *pResOut) |
| static int | unixFileControl (sqlite3_file *id, int op, void *pArg) |
| static int | unixSectorSize (sqlite3_file *NotUsed) |
| static int | unixDeviceCharacteristics (sqlite3_file *NotUsed) |
| static int | unixOpen (sqlite3_vfs *pVfs, const char *zPath, sqlite3_file *pFile, int flags, int *pOutFlags) |
| static int | unixDelete (sqlite3_vfs *NotUsed, const char *zPath, int dirSync) |
| static int | unixAccess (sqlite3_vfs *NotUsed, const char *zPath, int flags, int *pResOut) |
| static int | unixFullPathname (sqlite3_vfs *pVfs, const char *zPath, int nOut, char *zOut) |
| static void * | unixDlOpen (sqlite3_vfs *NotUsed, const char *zFilename) |
| static void | unixDlError (sqlite3_vfs *NotUsed, int nBuf, char *zBufOut) |
| static void | unixDlClose (sqlite3_vfs *NotUsed, void *pHandle) |
| static int | unixRandomness (sqlite3_vfs *NotUsed, int nBuf, char *zBuf) |
| static int | unixSleep (sqlite3_vfs *NotUsed, int microseconds) |
| static int | unixCurrentTime (sqlite3_vfs *NotUsed, double *prNow) |
| static int | unixGetLastError (sqlite3_vfs *NotUsed, int NotUsed2, char *NotUsed3) |
| static int | unixCurrentTimeInt64 (sqlite3_vfs *NotUsed, sqlite3_int64 *piNow) |
| static int | unixSetSystemCall (sqlite3_vfs *pNotUsed, const char *zName, sqlite3_syscall_ptr pNewFunc) |
| static sqlite3_syscall_ptr | unixGetSystemCall (sqlite3_vfs *pNotUsed, const char *zName) |
| static const char * | unixNextSystemCall (sqlite3_vfs *p, const char *zName) |
| static int | closeUnixFile (sqlite3_file *id) |
| int | tkeyvfs_init (void) |
| int | tkeyvfs_open_v2 (const char *filename, sqlite3 **ppDb, int flags, TFile *rootFile ) |
Variables | |
| static TFile * | gRootFile |
| static void(*)(void) | unixDlSym (sqlite3_vfs *NotUsed, void *p, const char *zSym) |
| static struct unix_syscall | aSyscall [] |
| static const sqlite3_io_methods | nolockIoMethods |
| static const sqlite3_io_methods *(*const | nolockIoFinder )(const char *, unixFile *p) |
| #define _FILE_OFFSET_BITS 64 |
Definition at line 37 of file tkeyvfs.cc.
| #define _LARGE_FILE 1 |
Definition at line 36 of file tkeyvfs.cc.
| #define _LARGEFILE_SOURCE 1 |
Definition at line 38 of file tkeyvfs.cc.
| #define ArraySize | ( | X | ) | ((int)(sizeof(X) / sizeof(X[0]))) |
Definition at line 32 of file tkeyvfs.cc.
| #define MAX_PATHNAME 512 |
Definition at line 88 of file tkeyvfs.cc.
| #define MEMPAGE 2048 |
Definition at line 83 of file tkeyvfs.cc.
| #define O_BINARY 0 |
Definition at line 137 of file tkeyvfs.cc.
| #define O_LARGEFILE 0 |
Definition at line 127 of file tkeyvfs.cc.
| #define O_NOFOLLOW 0 |
Definition at line 134 of file tkeyvfs.cc.
| #define osAccess ((int (*)(const char*, int))aSyscall[2].pCurrent) |
| #define osClose ((int (*)(int))aSyscall[1].pCurrent) |
| #define osFallocate ((int (*)(int, off_t, off_t))aSyscall[15].pCurrent) |
| #define osFchmod ((int (*)(int, mode_t))aSyscall[14].pCurrent) |
| #define osFcntl ((int (*)(int, int, ...))aSyscall[7].pCurrent) |
| #define osFstat ((int (*)(int, struct stat*))aSyscall[5].pCurrent) |
| #define osFtruncate ((int (*)(int, off_t))aSyscall[6].pCurrent) |
| #define osGetcwd ((char* (*)(char*, size_t))aSyscall[3].pCurrent) |
| #define osOpen ((int (*)(const char*, int, ...))aSyscall[0].pCurrent) |
| #define osPread ((ssize_t(*)(int, void*, size_t, off_t))aSyscall[9].pCurrent) |
| #define osPread64 ((ssize_t(*)(int, void*, size_t, off_t))aSyscall[10].pCurrent) |
| #define osPwrite ((ssize_t(*)(int, const void*, size_t, off_t))aSyscall[12].pCurrent) |
| #define osPwrite64 ((ssize_t(*)(int, const void*, size_t, off_t))aSyscall[13].pCurrent) |
| #define osRead ((ssize_t(*)(int, void*, size_t))aSyscall[8].pCurrent) |
| #define osStat ((int (*)(const char*, struct stat*))aSyscall[4].pCurrent) |
| #define osWrite ((ssize_t(*)(int, const void*, size_t))aSyscall[11].pCurrent) |
| #define SQLITE_CANTOPEN_BKPT sqlite3CantopenError(__LINE__) |
Definition at line 217 of file tkeyvfs.cc.
| #define SQLITE_DEFAULT_SECTOR_SIZE 512 |
Definition at line 27 of file tkeyvfs.cc.
| #define SQLITE_FCNTL_CHUNK_SIZE 6 |
Definition at line 23 of file tkeyvfs.cc.
| #define SQLITE_FCNTL_DB_UNCHANGED 0xca093fa0 |
Definition at line 26 of file tkeyvfs.cc.
| #define SQLITE_FCNTL_SIZE_HINT 5 |
Definition at line 22 of file tkeyvfs.cc.
| #define SQLITE_FCNTL_SYNC_OMITTED 8 |
Definition at line 24 of file tkeyvfs.cc.
| #define SQLITE_OPEN_WAL 0x00080000 /* VFS only */ |
Definition at line 21 of file tkeyvfs.cc.
| #define SQLITE_TEMP_FILE_PREFIX "etilqs_" |
Definition at line 90 of file tkeyvfs.cc.
| #define TKEYVFS_TRACE 0 |
Definition at line 69 of file tkeyvfs.cc.
| #define unixLogError | ( | a, | |
| b, | |||
| c | |||
| ) | unixLogErrorAtLine(a, b, c, __LINE__) |
Definition at line 386 of file tkeyvfs.cc.
| #define UNIXVFS | ( | VFSNAME, | |
| FINDER | |||
| ) |
| #define UNUSED_PARAMETER | ( | x | ) | (void)(x) |
Definition at line 29 of file tkeyvfs.cc.
| #define UNUSED_PARAMETER2 | ( | x, | |
| y | |||
| ) | UNUSED_PARAMETER(x), UNUSED_PARAMETER(y) |
Definition at line 30 of file tkeyvfs.cc.
| typedef const sqlite3_io_methods*(* finder_type) (const char *, unixFile *) |
Definition at line 368 of file tkeyvfs.cc.
| typedef sqlite_int64 i64 |
Definition at line 34 of file tkeyvfs.cc.
Definition at line 120 of file tkeyvfs.cc.
|
static |
Definition at line 473 of file tkeyvfs.cc.
Definition at line 590 of file tkeyvfs.cc.
|
static |
Definition at line 998 of file tkeyvfs.cc.
|
static |
Definition at line 718 of file tkeyvfs.cc.
|
static |
Definition at line 357 of file tkeyvfs.cc.
|
static |
Definition at line 964 of file tkeyvfs.cc.
|
static |
Definition at line 981 of file tkeyvfs.cc.
|
static |
Definition at line 443 of file tkeyvfs.cc.
|
static |
Definition at line 414 of file tkeyvfs.cc.
|
static |
Definition at line 642 of file tkeyvfs.cc.
Definition at line 673 of file tkeyvfs.cc.
|
static |
Definition at line 209 of file tkeyvfs.cc.
|
static |
Definition at line 228 of file tkeyvfs.cc.
| int tkeyvfs_init | ( | void | ) |
Definition at line 1768 of file tkeyvfs.cc.
| int tkeyvfs_open_v2 | ( | const char * | filename, |
| sqlite3 ** | ppDb, | ||
| int | flags, | ||
| TFile * | rootFile | ||
| ) |
Definition at line 1837 of file tkeyvfs.cc.
|
static |
Definition at line 1330 of file tkeyvfs.cc.
|
static |
Definition at line 1570 of file tkeyvfs.cc.
|
static |
Definition at line 1615 of file tkeyvfs.cc.
|
static |
Definition at line 1300 of file tkeyvfs.cc.
|
static |
Definition at line 1133 of file tkeyvfs.cc.
|
static |
Definition at line 1481 of file tkeyvfs.cc.
|
static |
Definition at line 1435 of file tkeyvfs.cc.
|
static |
Definition at line 1414 of file tkeyvfs.cc.
|
static |
Definition at line 1018 of file tkeyvfs.cc.
|
static |
Definition at line 938 of file tkeyvfs.cc.
|
static |
Definition at line 1386 of file tkeyvfs.cc.
|
static |
Definition at line 1593 of file tkeyvfs.cc.
|
static |
Definition at line 1690 of file tkeyvfs.cc.
|
static |
Definition at line 549 of file tkeyvfs.cc.
|
static |
Definition at line 388 of file tkeyvfs.cc.
|
static |
Definition at line 1719 of file tkeyvfs.cc.
|
static |
Definition at line 1171 of file tkeyvfs.cc.
|
static |
Definition at line 1498 of file tkeyvfs.cc.
|
static |
Definition at line 737 of file tkeyvfs.cc.
|
static |
Definition at line 1117 of file tkeyvfs.cc.
|
static |
Definition at line 1638 of file tkeyvfs.cc.
|
static |
Definition at line 1551 of file tkeyvfs.cc.
|
static |
Definition at line 919 of file tkeyvfs.cc.
|
static |
Definition at line 837 of file tkeyvfs.cc.
|
static |
Definition at line 778 of file tkeyvfs.cc.
|
static |
|
static |
Definition at line 76 of file tkeyvfs.cc.
|
static |
Definition at line 364 of file tkeyvfs.cc.
|
static |
Definition at line 334 of file tkeyvfs.cc.
|
static |
Definition at line 194 of file tkeyvfs.cc.
1.8.11