aboutsummaryrefslogtreecommitdiff
path: root/src/sq/sq_prepare.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sq/sq_prepare.c')
-rw-r--r--src/sq/sq_prepare.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/sq/sq_prepare.c b/src/sq/sq_prepare.c
index 3df4b80bc..5d232fd17 100644
--- a/src/sq/sq_prepare.c
+++ b/src/sq/sq_prepare.c
@@ -34,8 +34,8 @@
34 * @return initialized struct 34 * @return initialized struct
35 */ 35 */
36struct GNUNET_SQ_PrepareStatement 36struct GNUNET_SQ_PrepareStatement
37GNUNET_SQ_make_prepare(const char *sql, 37GNUNET_SQ_make_prepare (const char *sql,
38 sqlite3_stmt **pstmt) 38 sqlite3_stmt **pstmt)
39{ 39{
40 struct GNUNET_SQ_PrepareStatement ps = { 40 struct GNUNET_SQ_PrepareStatement ps = {
41 .sql = sql, 41 .sql = sql,
@@ -56,29 +56,29 @@ GNUNET_SQ_make_prepare(const char *sql,
56 * @return #GNUNET_OK on success 56 * @return #GNUNET_OK on success
57 */ 57 */
58int 58int
59GNUNET_SQ_prepare(sqlite3 *dbh, 59GNUNET_SQ_prepare (sqlite3 *dbh,
60 const struct GNUNET_SQ_PrepareStatement *ps) 60 const struct GNUNET_SQ_PrepareStatement *ps)
61{ 61{
62 for (unsigned int i = 0; NULL != ps[i].sql; i++) 62 for (unsigned int i = 0; NULL != ps[i].sql; i++)
63 { 63 {
64 const char *epos = NULL; 64 const char *epos = NULL;
65 int ret; 65 int ret;
66 66
67 if (SQLITE_OK != 67 if (SQLITE_OK !=
68 (ret = sqlite3_prepare_v2(dbh, 68 (ret = sqlite3_prepare_v2 (dbh,
69 ps[i].sql, 69 ps[i].sql,
70 strlen(ps[i].sql), 70 strlen (ps[i].sql),
71 ps[i].pstmt, 71 ps[i].pstmt,
72 &epos))) 72 &epos)))
73 { 73 {
74 GNUNET_log(GNUNET_ERROR_TYPE_ERROR, 74 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
75 "Failed to prepare SQL `%s': error %d at %s\n", 75 "Failed to prepare SQL `%s': error %d at %s\n",
76 ps[i].sql, 76 ps[i].sql,
77 ret, 77 ret,
78 epos); 78 epos);
79 return GNUNET_SYSERR; 79 return GNUNET_SYSERR;
80 }
81 } 80 }
81 }
82 return GNUNET_OK; 82 return GNUNET_OK;
83} 83}
84 84