]> git.proxmox.com Git - mirror_frr.git/blob - lib/db.h
Merge pull request #13649 from donaldsharp/unlock_the_node_or_else
[mirror_frr.git] / lib / db.h
1 // SPDX-License-Identifier: ISC AND GPL-2.0-or-later
2 /*
3 * Copyright (c) 2018 Rafael Zalamena <rzalamena@gmail.com>
4 */
5
6 /*
7 * Copyright (c) 2016 Rafael Zalamena <rzalamena@gmail.com>
8 */
9
10 #ifndef _FRR_DB_H_
11 #define _FRR_DB_H_
12 #ifdef HAVE_SQLITE3
13
14 #include "compiler.h"
15 #include <sqlite3.h>
16
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20
21 extern int db_init(const char *path_fmt, ...) PRINTFRR(1, 2);
22 extern int db_close(void);
23 /* WARNING: sqlite format string! not printf compatible! */
24 extern int db_bindf(struct sqlite3_stmt *ss, const char *fmt, ...);
25 extern struct sqlite3_stmt *db_prepare_len(const char *stmt, int stmtlen);
26 extern struct sqlite3_stmt *db_prepare(const char *stmt);
27 extern int db_run(struct sqlite3_stmt *ss);
28 /* WARNING: sqlite format string! not scanf compatible! */
29 extern int db_loadf(struct sqlite3_stmt *ss, const char *fmt, ...);
30 extern void db_finalize(struct sqlite3_stmt **ss);
31 extern int db_execute(const char *stmt_fmt, ...) PRINTFRR(1, 2);
32
33 #ifdef __cplusplus
34 }
35 #endif
36
37 #endif /* HAVE_SQLITE3 */
38 #endif /* _FRR_DB_H_ */