]>
git.saurik.com Git - minimal.git/blob - sqlite3.h
049521d9d14880a7a31e3215449ec4b83518996e
4 #define sqlcall(expr) \
7 if (_value == 0 || (_value >= 100 && _value < 200)) \
9 fprintf(stderr, "%s(%u): sqlcall(%u:%s): %s\n", __FILE__, __LINE__, _value, #expr, sqlite3_errmsg(database_)); \
13 int sqlite3_bind_string(sqlite3_stmt
*stmt
, int n
, const char *value
) {
15 return sqlite3_bind_null(stmt
, n
);
17 return sqlite3_bind_text(stmt
, n
, strdup(value
), -1, &free
);
20 int sqlite3_bind_boolean(sqlite3_stmt
*stmt
, int n
, bool value
) {
21 return sqlite3_bind_int(stmt
, n
, value
? 1 : 0);
24 char *sqlite3_column_string(sqlite3_stmt
*stmt
, int n
) {
25 const unsigned char *value
= sqlite3_column_text(stmt
, n
);
26 return value
== NULL
? NULL
: strdup((const char *) value
);
29 bool sqlite3_column_boolean(sqlite3_stmt
*stmt
, int n
) {
30 return sqlite3_column_int(stmt
, n
) != 0;