]>
Commit | Line | Data |
---|---|---|
1c2facd1 RW |
1 | /* |
2 | * Copyright (c) 2018 Rafael Zalamena <rzalamena@gmail.com> | |
3 | * | |
4 | * This program is free software; you can redistribute it and/or modify it | |
5 | * under the terms of the GNU General Public License as published by the Free | |
6 | * Software Foundation; either version 2 of the License, or (at your option) | |
7 | * any later version. | |
8 | * | |
9 | * This program is distributed in the hope that it will be useful, but WITHOUT | |
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |
12 | * more details. | |
13 | * | |
14 | * You should have received a copy of the GNU General Public License along | |
15 | * with this program; see the file COPYING; if not, write to the Free Software | |
16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
17 | */ | |
18 | ||
19 | /* | |
20 | * Copyright (c) 2016 Rafael Zalamena <rzalamena@gmail.com> | |
21 | * | |
22 | * Permission to use, copy, modify, and/or distribute this software for any | |
23 | * purpose with or without fee is hereby granted, provided that the above | |
24 | * copyright notice and this permission notice appear in all copies. | |
25 | * | |
26 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
27 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
28 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
29 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
30 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
31 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
32 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
33 | */ | |
34 | ||
35 | #ifndef _FRR_DB_H_ | |
36 | #define _FRR_DB_H_ | |
37 | #ifdef HAVE_SQLITE3 | |
38 | ||
39 | #include <sqlite3.h> | |
40 | ||
5e244469 RW |
41 | #ifdef __cplusplus |
42 | extern "C" { | |
43 | #endif | |
44 | ||
1c2facd1 RW |
45 | extern int db_init(const char *path_fmt, ...); |
46 | extern int db_close(void); | |
47 | extern int db_bindf(struct sqlite3_stmt *ss, const char *fmt, ...); | |
48 | extern struct sqlite3_stmt *db_prepare_len(const char *stmt, int stmtlen); | |
49 | extern struct sqlite3_stmt *db_prepare(const char *stmt); | |
50 | extern int db_run(struct sqlite3_stmt *ss); | |
51 | extern int db_loadf(struct sqlite3_stmt *ss, const char *fmt, ...); | |
52 | extern void db_finalize(struct sqlite3_stmt **ss); | |
53 | extern int db_execute(const char *stmt_fmt, ...); | |
54 | ||
5e244469 RW |
55 | #ifdef __cplusplus |
56 | } | |
57 | #endif | |
58 | ||
1c2facd1 RW |
59 | #endif /* HAVE_SQLITE3 */ |
60 | #endif /* _FRR_DB_H_ */ |