• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_EXTRA_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     int (*is_support_binlog)(const char*);
33 };
34 
35 extern const struct sqlite3_api_routines_relational *sqlite3_export_relational_symbols;
36 
37 #ifdef sqlite3_open
38 #undef sqlite3_open
39 #endif
40 #define sqlite3_open                 sqlite3_export_relational_symbols->open
41 
42 #ifdef sqlite3_open16
43 #undef sqlite3_open16
44 #endif
45 #define sqlite3_open16               sqlite3_export_relational_symbols->open16
46 
47 #ifdef sqlite3_open_v2
48 #undef sqlite3_open_v2
49 #endif
50 #define sqlite3_open_v2               sqlite3_export_relational_symbols->open_v2
51 
52 #ifdef sqlite3_is_support_binlog
53 #undef sqlite3_is_support_binlog
54 #endif
55 #define sqlite3_is_support_binlog     sqlite3_export_relational_symbols->is_support_binlog
56 #endif // RELATIONAL_STORE_EXT_H