From f2096385d03fe0e4950985ef5badf6c1e2ffd8cc Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Mon, 21 Feb 2022 07:49:22 +0000 Subject: [PATCH] more --- source/libs/tdb/CMakeLists.txt | 12 ++++++- source/libs/tdb/src/sqliteinc/sqliteInt.h | 41 +++++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/source/libs/tdb/CMakeLists.txt b/source/libs/tdb/CMakeLists.txt index 3cb5a65572..0da18652c2 100644 --- a/source/libs/tdb/CMakeLists.txt +++ b/source/libs/tdb/CMakeLists.txt @@ -1,4 +1,4 @@ - +# for tdb set(TDB_SUBDIRS "db") foreach(TDB_SUBDIR ${TDB_SUBDIRS}) aux_source_directory("src/${TDB_SUBDIR}" TDB_SRC) @@ -17,6 +17,16 @@ target_link_libraries( PUBLIC util ) +# for tdb_sqlite +add_library(tdb_sqlite "") +target_sources(tdb_sqlite + PRIVATE + "src/sqlite/pcache.c" + "src/sqlite/pcache1.c" +) +target_include_directories(tdb_sqlite PUBLIC "src/sqliteinc") + +# for test if(${BUILD_TEST}) add_subdirectory(test) endif(${BUILD_TEST}) diff --git a/source/libs/tdb/src/sqliteinc/sqliteInt.h b/source/libs/tdb/src/sqliteinc/sqliteInt.h index e69de29bb2..b0833db2fd 100644 --- a/source/libs/tdb/src/sqliteinc/sqliteInt.h +++ b/source/libs/tdb/src/sqliteinc/sqliteInt.h @@ -0,0 +1,41 @@ +/* +** 2001 September 15 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +************************************************************************* +** Internal interface definitions for SQLite. +** +*/ + +#include + +#ifndef SQLITEINT_H +#define SQLITEINT_H + +typedef int8_t i8; +typedef int16_t i16; +typedef int32_t i32; +typedef int64_t i64; +typedef uint8_t u8; +typedef uint16_t u16; +typedef uint32_t u32; +typedef uint64_t u64; + +typedef struct sqlite3_pcache_page { + void *pBuf; /* The content of the page */ + void *pExtra; /* Extra information associated with the page */ +} sqlite3_pcache_page; + +typedef u32 Pgno; + +typedef struct Pager Pager; + +#include "pcache.h" + +#endif /* SQLITEINT_H */