-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdiff.h
More file actions
72 lines (60 loc) · 1.5 KB
/
diff.h
File metadata and controls
72 lines (60 loc) · 1.5 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
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <stdio.h>
#include "sqlite3.h"
struct sqlite_value
{
int16_t type;
union {
int64_t iVal;
double dVal;
} data1;
const char* data2; //< Used for BLOB and TEXT
};
struct TableInfo {
const char* tableName;
uint8_t nCol;
int* PKs;
const char** columnNames;
};
struct Instruction {
struct TableInfo* table;
uint8_t iType;
struct sqlite_value* values; //< Array of values, old and new concatenated in UDPATE
int* valFlag; //< For UPDATE instrs, array of flags indicating whether the value has changed
};
typedef int (*InstrCallback)(const struct Instruction* instr, void* context);
typedef int (*TableCallback)(const struct TableInfo* table, void* context);
int sqlitediff_write_table(const struct TableInfo* table, void* context);
int sqlitediff_write_instruction(const struct Instruction* instr, void* context);
int slitediff_diff_prepared_callback(
sqlite3 *db,
const char* zTab,
TableCallback table_callback,
InstrCallback instr_callback,
void* context
);
/* Database B must be attached as 'aux' */
int sqlitediff_diff_prepared(
sqlite3 *db,
const char* zTab, /* name of table to diff, or NULL for all tables */
FILE* out /* Output stream */
);
int sqlitediff_diff(
const char* zDb1,
const char* zDb2,
const char* zTab,
FILE* out
);
int sqlitediff_diff_file(
const char* zDb1,
const char* zDb2,
const char* zTab,
const char* out
);
#ifdef __cplusplus
} // end extern "C"
#endif