#include <sqlite3.h>#include "TFile.h"#include "TKey.h"#include <cassert>#include <cerrno>#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_noroot.cc.
| #define _LARGE_FILE 1 |
Definition at line 36 of file tkeyvfs_noroot.cc.
| #define _LARGEFILE_SOURCE 1 |
Definition at line 38 of file tkeyvfs_noroot.cc.
| #define ArraySize | ( | X | ) | ((int)(sizeof(X) / sizeof(X[0]))) |
Definition at line 32 of file tkeyvfs_noroot.cc.
| #define MAX_PATHNAME 512 |
Definition at line 87 of file tkeyvfs_noroot.cc.
| #define MEMPAGE 2048 |
Definition at line 82 of file tkeyvfs_noroot.cc.
| #define O_BINARY 0 |
Definition at line 136 of file tkeyvfs_noroot.cc.
| #define O_LARGEFILE 0 |
Definition at line 126 of file tkeyvfs_noroot.cc.
| #define O_NOFOLLOW 0 |
Definition at line 133 of file tkeyvfs_noroot.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 216 of file tkeyvfs_noroot.cc.
| #define SQLITE_DEFAULT_SECTOR_SIZE 512 |
Definition at line 27 of file tkeyvfs_noroot.cc.
| #define SQLITE_FCNTL_CHUNK_SIZE 6 |
Definition at line 23 of file tkeyvfs_noroot.cc.
| #define SQLITE_FCNTL_DB_UNCHANGED 0xca093fa0 |
Definition at line 26 of file tkeyvfs_noroot.cc.
| #define SQLITE_FCNTL_SIZE_HINT 5 |
Definition at line 22 of file tkeyvfs_noroot.cc.
| #define SQLITE_FCNTL_SYNC_OMITTED 8 |
Definition at line 24 of file tkeyvfs_noroot.cc.
| #define SQLITE_OPEN_WAL 0x00080000 /* VFS only */ |
Definition at line 21 of file tkeyvfs_noroot.cc.
| #define SQLITE_TEMP_FILE_PREFIX "etilqs_" |
Definition at line 89 of file tkeyvfs_noroot.cc.
| #define TKEYVFS_TRACE 0 |
Definition at line 68 of file tkeyvfs_noroot.cc.
| #define unixLogError | ( | a, | |
| b, | |||
| c | |||
| ) | unixLogErrorAtLine(a, b, c, __LINE__) |
Definition at line 385 of file tkeyvfs_noroot.cc.
| #define UNIXVFS | ( | VFSNAME, | |
| FINDER | |||
| ) |
| #define UNUSED_PARAMETER | ( | x | ) | (void)(x) |
Definition at line 29 of file tkeyvfs_noroot.cc.
| #define UNUSED_PARAMETER2 | ( | x, | |
| y | |||
| ) | UNUSED_PARAMETER(x), UNUSED_PARAMETER(y) |
Definition at line 30 of file tkeyvfs_noroot.cc.
| typedef const sqlite3_io_methods*(* finder_type) (const char *, unixFile *) |
Definition at line 367 of file tkeyvfs_noroot.cc.
| typedef sqlite_int64 i64 |
Definition at line 34 of file tkeyvfs_noroot.cc.
Definition at line 119 of file tkeyvfs_noroot.cc.
|
static |
Definition at line 472 of file tkeyvfs_noroot.cc.
Definition at line 589 of file tkeyvfs_noroot.cc.
|
static |
Definition at line 997 of file tkeyvfs_noroot.cc.
|
static |
Definition at line 717 of file tkeyvfs_noroot.cc.
|
static |
Definition at line 356 of file tkeyvfs_noroot.cc.
|
static |
Definition at line 963 of file tkeyvfs_noroot.cc.
|
static |
Definition at line 980 of file tkeyvfs_noroot.cc.
|
static |
Definition at line 442 of file tkeyvfs_noroot.cc.
|
static |
Definition at line 413 of file tkeyvfs_noroot.cc.
|
static |
Definition at line 641 of file tkeyvfs_noroot.cc.
Definition at line 672 of file tkeyvfs_noroot.cc.
|
static |
Definition at line 208 of file tkeyvfs_noroot.cc.
|
static |
Definition at line 227 of file tkeyvfs_noroot.cc.
| int tkeyvfs_init | ( | void | ) |
Definition at line 1767 of file tkeyvfs_noroot.cc.
| int tkeyvfs_open_v2 | ( | const char * | filename, |
| sqlite3 ** | ppDb, | ||
| int | flags, | ||
| TFile * | rootFile | ||
| ) |
Definition at line 1836 of file tkeyvfs_noroot.cc.
|
static |
Definition at line 1329 of file tkeyvfs_noroot.cc.
|
static |
Definition at line 1569 of file tkeyvfs_noroot.cc.
|
static |
Definition at line 1614 of file tkeyvfs_noroot.cc.
|
static |
Definition at line 1299 of file tkeyvfs_noroot.cc.
|
static |
Definition at line 1132 of file tkeyvfs_noroot.cc.
|
static |
Definition at line 1480 of file tkeyvfs_noroot.cc.
|
static |
Definition at line 1434 of file tkeyvfs_noroot.cc.
|
static |
Definition at line 1413 of file tkeyvfs_noroot.cc.
|
static |
Definition at line 1017 of file tkeyvfs_noroot.cc.
|
static |
Definition at line 937 of file tkeyvfs_noroot.cc.
|
static |
Definition at line 1385 of file tkeyvfs_noroot.cc.
|
static |
Definition at line 1592 of file tkeyvfs_noroot.cc.
|
static |
Definition at line 1689 of file tkeyvfs_noroot.cc.
|
static |
Definition at line 548 of file tkeyvfs_noroot.cc.
|
static |
Definition at line 387 of file tkeyvfs_noroot.cc.
|
static |
Definition at line 1718 of file tkeyvfs_noroot.cc.
|
static |
Definition at line 1170 of file tkeyvfs_noroot.cc.
|
static |
Definition at line 1497 of file tkeyvfs_noroot.cc.
|
static |
Definition at line 736 of file tkeyvfs_noroot.cc.
|
static |
Definition at line 1116 of file tkeyvfs_noroot.cc.
|
static |
Definition at line 1637 of file tkeyvfs_noroot.cc.
|
static |
Definition at line 1550 of file tkeyvfs_noroot.cc.
|
static |
Definition at line 918 of file tkeyvfs_noroot.cc.
|
static |
Definition at line 836 of file tkeyvfs_noroot.cc.
|
static |
Definition at line 777 of file tkeyvfs_noroot.cc.
|
static |
|
static |
Definition at line 75 of file tkeyvfs_noroot.cc.
|
static |
Definition at line 363 of file tkeyvfs_noroot.cc.
|
static |
Definition at line 333 of file tkeyvfs_noroot.cc.
|
static |
Definition at line 193 of file tkeyvfs_noroot.cc.
1.8.11