This commit is contained in:
Hongze Cheng 2022-02-09 02:50:28 +00:00
parent ca197e7113
commit 8d04fb6471
5 changed files with 30 additions and 9 deletions

View File

@ -23,10 +23,11 @@ extern "C" {
#endif
typedef struct STDb TDB;
typedef struct STDbEnv TENV;
int tdbCreate(TDB **ppDb);
int tdbDestroy(TDB *pDb);
int tdbOpen(TDB **pDb);
int tdbOpen(TDB **pDb, const char *fname, const char *dbname);
int tdbClose(TDB *pDb);
#ifdef __cplusplus

View File

@ -15,11 +15,6 @@
#include "tdbInt.h"
struct SBTree {
pgno_t root;
// TODO
};
struct SBtCursor {
// TODO
};

View File

@ -16,8 +16,8 @@
#include "tdbInt.h"
struct STDb {
// TODO
SBTree *pBt;
SBTree btree; // current access method
SPgFile *pPgFile; // backend page file this DB is using
};
int tdbCreate(TDB **ppDb) {
@ -41,7 +41,7 @@ int tdbDestroy(TDB *pDb) {
return 0;
}
int tdbOpen(TDB **pDb) {
int tdbOpen(TDB **pDb, const char *fname, const char *dbname) {
// TODO
return 0;
}

View File

@ -0,0 +1,21 @@
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "tdbInt.h"
struct STDbEnv {
TDB * dbList; // TDB list
SPgFile *pgFileList; // SPgFile list
};

View File

@ -32,6 +32,10 @@ int btreeCursorOpen(SBtCursor *pBtCur, SBTree *pBt);
int btreeCursorClose(SBtCursor *pBtCur);
int btreeCursorMoveTo(SBtCursor *pBtCur);
struct SBTree {
pgno_t root;
};
#ifdef __cplusplus
}
#endif