1 /* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 #ifndef RELATIONAL_STORE_EXT_H 16 #define RELATIONAL_STORE_EXT_H 17 18 #define SQLITE3_HW_EXPORT_SYMBOLS 19 20 // using the "sqlite3sym.h" in OHOS 21 #ifndef USE_SQLITE_SYMBOLS 22 #include "sqlite3.h" 23 #else 24 #include "sqlite3sym.h" 25 #endif 26 27 // We extend the original purpose of the "sqlite3ext.h". 28 struct sqlite3_api_routines_relational { 29 int (*open)(const char *, sqlite3 **); 30 int (*open16)(const void *, sqlite3 **); 31 int (*open_v2)(const char *, sqlite3 **, int, const char *); 32 }; 33 34 extern const struct sqlite3_api_routines_relational *sqlite3_export_relational_symbols; 35 36 #ifdef sqlite3_open 37 #undef sqlite3_open 38 #endif 39 #define sqlite3_open sqlite3_export_relational_symbols->open 40 41 #ifdef sqlite3_open16 42 #undef sqlite3_open16 43 #endif 44 #define sqlite3_open16 sqlite3_export_relational_symbols->open16 45 46 #ifdef sqlite3_open_v2 47 #undef sqlite3_open_v2 48 #endif 49 #define sqlite3_open_v2 sqlite3_export_relational_symbols->open_v2 50 #endif // RELATIONAL_STORE_EXT_H