diff options
Diffstat (limited to '')
-rw-r--r-- | src/sqlite.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/sqlite.c b/src/sqlite.c index 7080928..f064280 100644 --- a/src/sqlite.c +++ b/src/sqlite.c @@ -11,6 +11,7 @@ #include <sqlite3.h> +#include <stddef.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -231,6 +232,19 @@ int sqlite_bind_text(sqlite3_stmt *stmt, int index, const char *value) return ret; } +int sqlite_bind_blob(sqlite3_stmt *stmt, int index, unsigned char *value, size_t nb) +{ + int ret = 0; + + ret = sqlite3_bind_blob64(stmt, index, value, nb, SQLITE_STATIC); + if (ret) { + sqlite_errno(ret, "sqlite3_bind_blob64"); + return ret; + } + + return ret; +} + int sqlite_exec_as_transaction(sqlite3 *db, const char *stmt) { static const char *const fmt = "BEGIN; %s COMMIT;"; |