mozglue/android/SQLiteBridge.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/mozglue/android/SQLiteBridge.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,33 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +#ifndef SQLiteBridge_h
     1.9 +#define SQLiteBridge_h
    1.10 +
    1.11 +#include "sqlite3.h"
    1.12 +
    1.13 +void setup_sqlite_functions(void *sqlite_handle);
    1.14 +
    1.15 +#define SQLITE_WRAPPER(name, return_type, args...) \
    1.16 +typedef return_type (*name ## _t)(args);  \
    1.17 +extern name ## _t f_ ## name;
    1.18 +
    1.19 +SQLITE_WRAPPER(sqlite3_open, int, const char*, sqlite3**)
    1.20 +SQLITE_WRAPPER(sqlite3_errmsg, const char*, sqlite3*)
    1.21 +SQLITE_WRAPPER(sqlite3_prepare_v2, int, sqlite3*, const char*, int, sqlite3_stmt**, const char**)
    1.22 +SQLITE_WRAPPER(sqlite3_bind_parameter_count, int, sqlite3_stmt*)
    1.23 +SQLITE_WRAPPER(sqlite3_bind_text, int, sqlite3_stmt*, int, const char*, int, void(*)(void*))
    1.24 +SQLITE_WRAPPER(sqlite3_step, int, sqlite3_stmt*)
    1.25 +SQLITE_WRAPPER(sqlite3_column_count, int, sqlite3_stmt*)
    1.26 +SQLITE_WRAPPER(sqlite3_finalize, int, sqlite3_stmt*)
    1.27 +SQLITE_WRAPPER(sqlite3_close, int, sqlite3*)
    1.28 +SQLITE_WRAPPER(sqlite3_column_name, const char*, sqlite3_stmt*, int)
    1.29 +SQLITE_WRAPPER(sqlite3_column_type, int, sqlite3_stmt*, int)
    1.30 +SQLITE_WRAPPER(sqlite3_column_blob, const void*, sqlite3_stmt*, int)
    1.31 +SQLITE_WRAPPER(sqlite3_column_bytes, int, sqlite3_stmt*, int)
    1.32 +SQLITE_WRAPPER(sqlite3_column_text, const unsigned char*, sqlite3_stmt*, int)
    1.33 +SQLITE_WRAPPER(sqlite3_changes, int, sqlite3*)
    1.34 +SQLITE_WRAPPER(sqlite3_last_insert_rowid, sqlite3_int64, sqlite3*)
    1.35 +
    1.36 +#endif /* SQLiteBridge_h */

mercurial