blob: 56edd34841971064ac48a0a3acae93ce5d7690aa (
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
|
#pragma once
#include <sqlite3.h>
#include "list.h"
/*
* This word into the dictionary
*/
typedef struct word {
int Id;
const unsigned char *Line;
} Word;
/*
* This is database connection.
*/
typedef struct data {
sqlite3 *db;
} Data;
/*
* create a new data struct from sqlite filename.
*/
Data* new_data(const char*);
void free_data(Data*);
/*
* Create the tables.
*/
void bootstrap(Data*);
/*
* insert line into database.
*/
void insert(Data*, char*, int);
/*
* Select all words.
*/
LIST* data_select(Data*, char*, int);
/*
* Print result code from sqlite.
*/
void print_result_code(int error);
|