1 /* gpgsql.h - SQLite helper functions.
2 * Copyright (C) 2015 g10 Code GmbH
4 * This file is part of GnuPG.
6 * GnuPG is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
11 * GnuPG is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see <https://www.gnu.org/licenses/>.
20 #ifndef GNUPG_GPGSQL_H
21 #define GNUPG_GPGSQL_H
27 GPGSQL_ARG_END = 0xdead001,
31 /* This takes two arguments: the blob as a void * and the length
32 of the blob as a long long. */
36 int gpgsql_exec_printf (sqlite3 *db,
37 int (*callback)(void*,int,char**,char**), void *cookie,
39 const char *sql, ...);
41 typedef int (*gpgsql_stepx_callback) (void *cookie,
42 /* number of columns. */
44 /* columns as text. */
48 /* The prepared statement so
49 * that it is possible to use
51 * sqlite3_column_blob(). */
52 sqlite3_stmt *statement);
54 int gpgsql_stepx (sqlite3 *db,
56 gpgsql_stepx_callback callback,
59 const char *sql, ...);
61 #endif /*GNUPG_GPGSQL_H*/