forked from Tencent/sqlcipher
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsqlite3_wcdb.h
More file actions
102 lines (83 loc) · 2.72 KB
/
sqlite3_wcdb.h
File metadata and controls
102 lines (83 loc) · 2.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*
* Tencent is pleased to support the open source community by making
* WCDB available.
*
* Copyright (C) 2017 THL A29 Limited, a Tencent company.
* All rights reserved.
*
* Licensed under the BSD 3-Clause License (the "License"); you may not use
* this file except in compliance with the License. You may obtain a copy of
* the License at
*
* https://opensource.org/licenses/BSD-3-Clause
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef SQLITE3_WCDB_H
#define SQLITE3_WCDB_H
/*
* Make sure we can call this stuff from C++.
*/
#ifdef __cplusplus
extern "C" {
#endif
#ifdef SQLITE_WCDB
SQLITE_API int sqlite3_schema_info(
sqlite3 *db,
int *tableCount,
int *indexCount,
int *triggerCount
);
SQLITE_API int sqlite3_table_config(
sqlite3 *db,
const char *dbName,
const char *tableName,
int *pAutoIncrement,
int *pWithoutRowid,
const char **pIntegerPrimaryKey
);
SQLITE_API int sqlite3_table_config_auto_increment(
sqlite3 *db,
const char *tableName
);
#ifdef SQLITE_WCDB_LOCK_HOOK
/*
** Register handlers when lock state changed.
*/
SQLITE_API int sqlite3_lock_hook(void (*xWillLock)(void *pArg, const char* zPath, int eLock),
void (*xLockDidChange)(void *pArg, const char* zPath, int eLock),
void (*xWillShmLock)(void *pArg, const char* zPath, int flags, int mask),
void (*xShmLockDidChange)(void *pArg, const char* zPath, void* id, int sharedMask, int exclMask),
void *pArg);
#endif //SQLITE_WCDB_LOCK_HOOK
#ifdef SQLITE_WCDB_CHECKPOINT_HANDLER
/*
** Register a handler when checkpoint did happen.
*/
SQLITE_API void *sqlite3_wal_checkpoint_handler(sqlite3 *, void (*xCallback)(void*, sqlite3*, const char *), void*);
#endif // SQLITE_WCDB_CHECKPOINT_HANDLER
#ifdef SQLITE_WCDB_SUSPEND
/*
** Suspend a handler to interrupt and prevent all operations.
*/
void sqlite3_suspend(sqlite3 *db, int suspend);
/*
** Ignore suspend and interrupt
*/
void sqlite3_unimpeded(sqlite3 *db, int unimpeded);
#endif
void sqlite3_revertCommitOrder(sqlite3 *db);
void* sqlite3_getCipherContext(sqlite3 *db, const char* schema);
int sqlcipher_codec_ctx_get_reservesize(void *ctx);
void* sqlite3Codec(void *iCtx, void *data, unsigned int pgno, int mode);
int sqlcipher_find_db_index(sqlite3 *db, const char *zDb);
void sqlite3CodecGetKey(sqlite3* db, int nDb, void **zKey, int *nKey);
#endif // SQLITE_WCDB
#endif /* SQLITE3_WCDB_H */
#ifdef __cplusplus
}
#endif