aboutsummaryrefslogtreecommitdiffstats
path: root/src/wrap/sqlite/codec_c_interface.h
blob: 1d8c8706fb8ec2490e617762d34e8742dfd3b102 (plain)
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
/*
 * Encryption codec class C interface
 * (C) 2010 Olivier de Gaalon
 *
 * Distributed under the terms of the Botan license
 */

#ifndef _CODEC_C_INTERFACE_H_
#define _CODEC_C_INTERFACE_H_

#ifdef __cplusplus
typedef unsigned char Bool;
#endif

#ifdef __cplusplus
extern "C"
#endif
void InitializeBotan();

#ifdef __cplusplus
extern "C"
#endif
void* InitializeNewCodec(void *db);

#ifdef __cplusplus
extern "C"
#endif
void* InitializeFromOtherCodec(const void *otherCodec, void *db);

#ifdef __cplusplus
extern "C"
#endif
void GenerateWriteKey(void *codec, const char *userPassword, int passwordLength);

#ifdef __cplusplus
extern "C"
#endif
void DropWriteKey(void *codec);

#ifdef __cplusplus
extern "C"
#endif
void SetWriteIsRead(void *codec);

#ifdef __cplusplus
extern "C"
#endif
void SetReadIsWrite(void *codec);

#ifdef __cplusplus
extern "C"
#endif
unsigned char* Encrypt(void *codec, int page, unsigned char *data, Bool useWriteKey);

#ifdef __cplusplus
extern "C"
#endif
void Decrypt(void *codec, int page, unsigned char *data);

#ifdef __cplusplus
extern "C"
#endif
void SetPageSize(void *codec, int pageSize);

#ifdef __cplusplus
extern "C"
#endif
Bool HasReadKey(void *codec);

#ifdef __cplusplus
extern "C"
#endif
Bool HasWriteKey(void *codec);

#ifdef __cplusplus
extern "C"
#endif
void* GetDB(void *codec);

#ifdef __cplusplus
extern "C"
#endif
const char* GetAndResetError(void *codec);

#ifdef __cplusplus
extern "C"
#endif
void DeleteCodec(void *codec);

#endif