From 7e586f4d4929261775e13e060ee4f9740c5e4d41 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Wed, 9 Mar 2022 09:18:20 +0000 Subject: [PATCH] more TDB --- source/libs/tdb/src/db/tdbPage.c | 10 ++++++++++ source/libs/tdb/src/inc/tdbPage.h | 3 +++ 2 files changed, 13 insertions(+) diff --git a/source/libs/tdb/src/db/tdbPage.c b/source/libs/tdb/src/db/tdbPage.c index 6c92e3b933..fddd77034d 100644 --- a/source/libs/tdb/src/db/tdbPage.c +++ b/source/libs/tdb/src/db/tdbPage.c @@ -15,6 +15,16 @@ #include "tdbInt.h" +int tdbPageCreate(int pageSize, SPage **ppPage, void *(*xMalloc)(void *, size_t), void *arg) { + // TODO + return 0; +} + +int tdbPageDestroy(SPage *pPage, void (*xFree)(void *)) { + // TODO + return 0; +} + int tdbPageInsertCell(SPage *pPage, int idx, SCell *pCell, int szCell) { // TODO return 0; diff --git a/source/libs/tdb/src/inc/tdbPage.h b/source/libs/tdb/src/inc/tdbPage.h index 2e6a80acbc..403f193c4e 100644 --- a/source/libs/tdb/src/inc/tdbPage.h +++ b/source/libs/tdb/src/inc/tdbPage.h @@ -39,6 +39,7 @@ struct SPage { pthread_spinlock_t lock; u8 *pData; SPgid pgid; + int pageSize; // Fields used by SPCache TDB_PCACHE_PAGE @@ -95,6 +96,8 @@ struct SPage { #endif // APIs +int tdbPageCreate(int pageSize, SPage **ppPage, void *(*xMalloc)(void *, size_t), void *arg); +int tdbPageDestroy(SPage *pPage, void (*xFree)(void *)); int tdbPageInsertCell(SPage *pPage, int idx, SCell *pCell, int szCell); int tdbPageDropCell(SPage *pPage, int idx); -- GitLab