/* generated by gensqlitedebug.py - edit that not this */

#define DBMUTEX_ASSERT(x) do { } while(0)

/* This file generates alternate sqlite functions that help
   check code correctness.  See issue 551 where we want to
   verify the database mutex is held */

#if !defined(NDEBUG) && defined(SQLITE_DEBUG) && defined(APSW_DEBUG) && !(defined(_MSC_VER) && !defined(__clang__))

#undef DBMUTEX_ASSERT
#define DBMUTEX_ASSERT(x) do { assert(sqlite3_mutex_held(sqlite3_db_mutex((x)))); } while(0)

#define sqlite3_aggregate_context(one, two) ({                                        \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_context_db_handle((one)))));  \
    sqlite3_aggregate_context((one), (two));                                          \
})

#undef sqlite3_auto_extension
#define sqlite3_auto_extension *not used*

#define sqlite3_autovacuum_pages(one, two, three, four) ({    \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));       \
    sqlite3_autovacuum_pages((one), (two), (three), (four));  \
})

#define sqlite3_backup_init(one, two, three, four) ({                                                   \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)) && sqlite3_mutex_held(sqlite3_db_mutex(three)));  \
    sqlite3_backup_init((one), (two), (three), (four));                                                 \
})

#define sqlite3_backup_step(...) ({                                                                                           \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(self->dest->db)) && sqlite3_mutex_held(sqlite3_db_mutex(self->source->db)));  \
    sqlite3_backup_step(__VA_ARGS__);                                                                                         \
})

#undef sqlite3_bind_blob
#define sqlite3_bind_blob *not used*

#define sqlite3_bind_blob64(one, two, three, four, five) ({                   \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_db_handle((one)))));  \
    sqlite3_bind_blob64((one), (two), (three), (four), (five));               \
})

#define sqlite3_bind_double(one, two, three) ({                               \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_db_handle((one)))));  \
    sqlite3_bind_double((one), (two), (three));                               \
})

#undef sqlite3_bind_int
#define sqlite3_bind_int *not used*

#define sqlite3_bind_int64(one, two, three) ({                                \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_db_handle((one)))));  \
    sqlite3_bind_int64((one), (two), (three));                                \
})

#define sqlite3_bind_null(one, two) ({                                        \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_db_handle((one)))));  \
    sqlite3_bind_null((one), (two));                                          \
})

#undef sqlite3_bind_parameter_index
#define sqlite3_bind_parameter_index *not used*

#define sqlite3_bind_parameter_name(one, two) ({                              \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_db_handle((one)))));  \
    sqlite3_bind_parameter_name((one), (two));                                \
})

#define sqlite3_bind_pointer(one, two, three, four, five) ({                  \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_db_handle((one)))));  \
    sqlite3_bind_pointer((one), (two), (three), (four), (five));              \
})

#undef sqlite3_bind_text
#define sqlite3_bind_text *not used*

#undef sqlite3_bind_text16
#define sqlite3_bind_text16 *not used*

#define sqlite3_bind_text64(one, two, three, four, five, six) ({              \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_db_handle((one)))));  \
    sqlite3_bind_text64((one), (two), (three), (four), (five), (six));        \
})

#undef sqlite3_bind_value
#define sqlite3_bind_value *not used*

#undef sqlite3_bind_zeroblob
#define sqlite3_bind_zeroblob *not used*

#define sqlite3_bind_zeroblob64(one, two, three) ({                           \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_db_handle((one)))));  \
    sqlite3_bind_zeroblob64((one), (two), (three));                           \
})

#define sqlite3_blob_open(one, two, three, four, five, six, seven) ({          \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));                        \
    sqlite3_blob_open((one), (two), (three), (four), (five), (six), (seven));  \
})

#define sqlite3_blob_read(...) ({                                         \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(self->connection->db)));  \
    sqlite3_blob_read(__VA_ARGS__);                                       \
})

#define sqlite3_blob_reopen(...) ({                                       \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(self->connection->db)));  \
    sqlite3_blob_reopen(__VA_ARGS__);                                     \
})

#define sqlite3_blob_write(...) ({                                        \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(self->connection->db)));  \
    sqlite3_blob_write(__VA_ARGS__);                                      \
})

#define sqlite3_busy_handler(one, two, three) ({         \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));  \
    sqlite3_busy_handler((one), (two), (three));         \
})

#define sqlite3_busy_timeout(one, two) ({                \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));  \
    sqlite3_busy_timeout((one), (two));                  \
})

#undef sqlite3_cancel_auto_extension
#define sqlite3_cancel_auto_extension *not used*

#undef sqlite3_carray_bind
#define sqlite3_carray_bind *not used*

#define sqlite3_carray_bind_v2(one, two, three, four, five, six, seven) ({          \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_db_handle((one)))));        \
    sqlite3_carray_bind_v2((one), (two), (three), (four), (five), (six), (seven));  \
})

#undef sqlite3_changes
#define sqlite3_changes *not used*

#define sqlite3_clear_bindings(one) ({                                        \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_db_handle((one)))));  \
    sqlite3_clear_bindings((one));                                            \
})

#undef sqlite3_close_v2
#define sqlite3_close_v2 *not used*

#define sqlite3_collation_needed(one, two, three) ({     \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));  \
    sqlite3_collation_needed((one), (two), (three));     \
})

#undef sqlite3_collation_needed16
#define sqlite3_collation_needed16 *not used*

#define sqlite3_column_blob(one, two) ({                                      \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_db_handle((one)))));  \
    sqlite3_column_blob((one), (two));                                        \
})

#define sqlite3_column_bytes(one, two) ({                                     \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_db_handle((one)))));  \
    sqlite3_column_bytes((one), (two));                                       \
})

#undef sqlite3_column_bytes16
#define sqlite3_column_bytes16 *not used*

#define sqlite3_column_count(one) ({                                          \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_db_handle((one)))));  \
    sqlite3_column_count((one));                                              \
})

#ifdef SQLITE_ENABLE_COLUMN_METADATA
#define sqlite3_column_database_name(one, two) ({                             \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_db_handle((one)))));  \
    sqlite3_column_database_name((one), (two));                               \
})
#endif

#ifdef SQLITE_ENABLE_COLUMN_METADATA
#undef sqlite3_column_database_name16
#define sqlite3_column_database_name16 *not used*
#endif

#define sqlite3_column_decltype(one, two) ({                                  \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_db_handle((one)))));  \
    sqlite3_column_decltype((one), (two));                                    \
})

#undef sqlite3_column_decltype16
#define sqlite3_column_decltype16 *not used*

#define sqlite3_column_double(one, two) ({                                    \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_db_handle((one)))));  \
    sqlite3_column_double((one), (two));                                      \
})

#undef sqlite3_column_int
#define sqlite3_column_int *not used*

#define sqlite3_column_int64(one, two) ({                                     \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_db_handle((one)))));  \
    sqlite3_column_int64((one), (two));                                       \
})

#define sqlite3_column_name(one, two) ({                                      \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_db_handle((one)))));  \
    sqlite3_column_name((one), (two));                                        \
})

#undef sqlite3_column_name16
#define sqlite3_column_name16 *not used*

#ifdef SQLITE_ENABLE_COLUMN_METADATA
#define sqlite3_column_origin_name(one, two) ({                               \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_db_handle((one)))));  \
    sqlite3_column_origin_name((one), (two));                                 \
})
#endif

#ifdef SQLITE_ENABLE_COLUMN_METADATA
#undef sqlite3_column_origin_name16
#define sqlite3_column_origin_name16 *not used*
#endif

#ifdef SQLITE_ENABLE_COLUMN_METADATA
#define sqlite3_column_table_name(one, two) ({                                \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_db_handle((one)))));  \
    sqlite3_column_table_name((one), (two));                                  \
})
#endif

#ifdef SQLITE_ENABLE_COLUMN_METADATA
#undef sqlite3_column_table_name16
#define sqlite3_column_table_name16 *not used*
#endif

#define sqlite3_column_text(one, two) ({                                      \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_db_handle((one)))));  \
    sqlite3_column_text((one), (two));                                        \
})

#undef sqlite3_column_text16
#define sqlite3_column_text16 *not used*

#define sqlite3_column_type(one, two) ({                                      \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_db_handle((one)))));  \
    sqlite3_column_type((one), (two));                                        \
})

#define sqlite3_column_value(one, two) ({                                     \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_db_handle((one)))));  \
    sqlite3_column_value((one), (two));                                       \
})

#define sqlite3_commit_hook(one, two, three) ({          \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));  \
    sqlite3_commit_hook((one), (two), (three));          \
})

#undef sqlite3_compileoption_used
#define sqlite3_compileoption_used *not used*

#undef sqlite3_complete16
#define sqlite3_complete16 *not used*

#undef sqlite3_create_collation
#define sqlite3_create_collation *not used*

#undef sqlite3_create_collation16
#define sqlite3_create_collation16 *not used*

#define sqlite3_create_collation_v2(one, two, three, four, five, six) ({        \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));                         \
    sqlite3_create_collation_v2((one), (two), (three), (four), (five), (six));  \
})

#undef sqlite3_create_filename
#define sqlite3_create_filename *not used*

#undef sqlite3_create_function
#define sqlite3_create_function *not used*

#undef sqlite3_create_function16
#define sqlite3_create_function16 *not used*

#define sqlite3_create_function_v2(one, two, three, four, five, six, seven, eight, nine) ({              \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));                                                  \
    sqlite3_create_function_v2((one), (two), (three), (four), (five), (six), (seven), (eight), (nine));  \
})

#undef sqlite3_create_module
#define sqlite3_create_module *not used*

#define sqlite3_create_module_v2(one, two, three, four, five) ({      \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));               \
    sqlite3_create_module_v2((one), (two), (three), (four), (five));  \
})

#define sqlite3_create_window_function(one, two, three, four, five, six, seven, eight, nine, ten) ({                \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));                                                             \
    sqlite3_create_window_function((one), (two), (three), (four), (five), (six), (seven), (eight), (nine), (ten));  \
})

#define sqlite3_data_count(one) ({                                            \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_db_handle((one)))));  \
    sqlite3_data_count((one));                                                \
})

#undef sqlite3_database_file_object
#define sqlite3_database_file_object *not used*

#define sqlite3_db_cacheflush(one) ({                    \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));  \
    sqlite3_db_cacheflush((one));                        \
})

#define sqlite3_db_config(one, two, three, four) ({      \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));  \
    sqlite3_db_config((one), (two), (three), (four));    \
})

#define sqlite3_db_filename(one, two) ({                 \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));  \
    sqlite3_db_filename((one), (two));                   \
})

#define sqlite3_db_name(one, two) ({                     \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));  \
    sqlite3_db_name((one), (two));                       \
})

#define sqlite3_db_readonly(one, two) ({                 \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));  \
    sqlite3_db_readonly((one), (two));                   \
})

#define sqlite3_db_release_memory(one) ({                \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));  \
    sqlite3_db_release_memory((one));                    \
})

#undef sqlite3_db_status
#define sqlite3_db_status *not used*

#define sqlite3_db_status64(one, two, three, four, five) ({      \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));          \
    sqlite3_db_status64((one), (two), (three), (four), (five));  \
})

#define sqlite3_declare_vtab(one, two) ({                \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));  \
    sqlite3_declare_vtab((one), (two));                  \
})

#define sqlite3_deserialize(one, two, three, four, five, six) ({        \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));                 \
    sqlite3_deserialize((one), (two), (three), (four), (five), (six));  \
})

#define sqlite3_drop_modules(one, two) ({                \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));  \
    sqlite3_drop_modules((one), (two));                  \
})

#define sqlite3_enable_load_extension(one, two) ({       \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));  \
    sqlite3_enable_load_extension((one), (two));         \
})

#undef sqlite3_errcode
#define sqlite3_errcode *not used*

#define sqlite3_errmsg(one) ({                           \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));  \
    sqlite3_errmsg((one));                               \
})

#undef sqlite3_errmsg16
#define sqlite3_errmsg16 *not used*

#define sqlite3_error_offset(one) ({                     \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));  \
    sqlite3_error_offset((one));                         \
})

#define sqlite3_exec(one, two, three, four, five) ({      \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));   \
    sqlite3_exec((one), (two), (three), (four), (five));  \
})

#define sqlite3_expanded_sql(one) ({                                          \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_db_handle((one)))));  \
    sqlite3_expanded_sql((one));                                              \
})

#define sqlite3_extended_errcode(one) ({                 \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));  \
    sqlite3_extended_errcode((one));                     \
})

#define sqlite3_file_control(one, two, three, four) ({    \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));   \
    sqlite3_file_control((one), (two), (three), (four));  \
})

#undef sqlite3_filename_database
#define sqlite3_filename_database *not used*

#define sqlite3_finalize(one) ({                                              \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_db_handle((one)))));  \
    sqlite3_finalize((one));                                                  \
})

#undef sqlite3_free_filename
#define sqlite3_free_filename *not used*

#undef sqlite3_free_table
#define sqlite3_free_table *not used*

#undef sqlite3_get_auxdata
#define sqlite3_get_auxdata *not used*

#undef sqlite3_get_clientdata
#define sqlite3_get_clientdata *not used*

#undef sqlite3_get_table
#define sqlite3_get_table *not used*

#undef sqlite3_keyword_check
#define sqlite3_keyword_check *not used*

#undef sqlite3_libversion_number
#define sqlite3_libversion_number *not used*

#define sqlite3_load_extension(one, two, three, four) ({    \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));     \
    sqlite3_load_extension((one), (two), (three), (four));  \
})

#undef sqlite3_malloc
#define sqlite3_malloc *not used*

#undef sqlite3_msize
#define sqlite3_msize *not used*

#undef sqlite3_mutex_alloc
#define sqlite3_mutex_alloc *not used*

#undef sqlite3_mutex_enter
#define sqlite3_mutex_enter *not used*

#undef sqlite3_mutex_free
#define sqlite3_mutex_free *not used*

#undef sqlite3_mutex_notheld
#define sqlite3_mutex_notheld *not used*

#undef sqlite3_next_stmt
#define sqlite3_next_stmt *not used*

#undef sqlite3_normalized_sql
#define sqlite3_normalized_sql *not used*

#undef sqlite3_open
#define sqlite3_open *not used*

#undef sqlite3_open16
#define sqlite3_open16 *not used*

#undef sqlite3_os_end
#define sqlite3_os_end *not used*

#undef sqlite3_os_init
#define sqlite3_os_init *not used*

#define sqlite3_overload_function(one, two, three) ({    \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));  \
    sqlite3_overload_function((one), (two), (three));    \
})

#undef sqlite3_prepare
#define sqlite3_prepare *not used*

#undef sqlite3_prepare16
#define sqlite3_prepare16 *not used*

#undef sqlite3_prepare16_v2
#define sqlite3_prepare16_v2 *not used*

#undef sqlite3_prepare16_v3
#define sqlite3_prepare16_v3 *not used*

#undef sqlite3_prepare_v2
#define sqlite3_prepare_v2 *not used*

#define sqlite3_prepare_v3(one, two, three, four, five, six) ({        \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));                \
    sqlite3_prepare_v3((one), (two), (three), (four), (five), (six));  \
})

#define sqlite3_preupdate_blobwrite(one) ({              \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));  \
    sqlite3_preupdate_blobwrite((one));                  \
})

#define sqlite3_preupdate_count(one) ({                  \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));  \
    sqlite3_preupdate_count((one));                      \
})

#define sqlite3_preupdate_depth(one) ({                  \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));  \
    sqlite3_preupdate_depth((one));                      \
})

#define sqlite3_preupdate_hook(one, two, three) ({       \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));  \
    sqlite3_preupdate_hook((one), (two), (three));       \
})

#define sqlite3_preupdate_new(one, two, three) ({        \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));  \
    sqlite3_preupdate_new((one), (two), (three));        \
})

#define sqlite3_preupdate_old(one, two, three) ({        \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));  \
    sqlite3_preupdate_old((one), (two), (three));        \
})

#define sqlite3_progress_handler(one, two, three, four) ({    \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));       \
    sqlite3_progress_handler((one), (two), (three), (four));  \
})

#undef sqlite3_realloc
#define sqlite3_realloc *not used*

#undef sqlite3_realloc64
#define sqlite3_realloc64 *not used*

#define sqlite3_reset(one) ({                                                 \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_db_handle((one)))));  \
    sqlite3_reset((one));                                                     \
})

#undef sqlite3_reset_auto_extension
#define sqlite3_reset_auto_extension *not used*

#undef sqlite3_result_blob
#define sqlite3_result_blob *not used*

#define sqlite3_result_blob64(one, two, three, four) ({                               \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_context_db_handle((one)))));  \
    sqlite3_result_blob64((one), (two), (three), (four));                             \
})

#define sqlite3_result_double(one, two) ({                                            \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_context_db_handle((one)))));  \
    sqlite3_result_double((one), (two));                                              \
})

#define sqlite3_result_error(one, two, three) ({                                      \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_context_db_handle((one)))));  \
    sqlite3_result_error((one), (two), (three));                                      \
})

#undef sqlite3_result_error16
#define sqlite3_result_error16 *not used*

#define sqlite3_result_error_code(one, two) ({                                        \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_context_db_handle((one)))));  \
    sqlite3_result_error_code((one), (two));                                          \
})

#define sqlite3_result_error_nomem(one) ({                                            \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_context_db_handle((one)))));  \
    sqlite3_result_error_nomem((one));                                                \
})

#undef sqlite3_result_error_toobig
#define sqlite3_result_error_toobig *not used*

#undef sqlite3_result_int
#define sqlite3_result_int *not used*

#define sqlite3_result_int64(one, two) ({                                             \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_context_db_handle((one)))));  \
    sqlite3_result_int64((one), (two));                                               \
})

#define sqlite3_result_null(one) ({                                                   \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_context_db_handle((one)))));  \
    sqlite3_result_null((one));                                                       \
})

#define sqlite3_result_pointer(one, two, three, four) ({                              \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_context_db_handle((one)))));  \
    sqlite3_result_pointer((one), (two), (three), (four));                            \
})

#undef sqlite3_result_subtype
#define sqlite3_result_subtype *not used*

#undef sqlite3_result_text
#define sqlite3_result_text *not used*

#undef sqlite3_result_text16
#define sqlite3_result_text16 *not used*

#undef sqlite3_result_text16be
#define sqlite3_result_text16be *not used*

#undef sqlite3_result_text16le
#define sqlite3_result_text16le *not used*

#define sqlite3_result_text64(one, two, three, four, five) ({                         \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_context_db_handle((one)))));  \
    sqlite3_result_text64((one), (two), (three), (four), (five));                     \
})

#undef sqlite3_result_value
#define sqlite3_result_value *not used*

#undef sqlite3_result_zeroblob
#define sqlite3_result_zeroblob *not used*

#define sqlite3_result_zeroblob64(one, two) ({                                        \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_context_db_handle((one)))));  \
    sqlite3_result_zeroblob64((one), (two));                                          \
})

#define sqlite3_rollback_hook(one, two, three) ({        \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));  \
    sqlite3_rollback_hook((one), (two), (three));        \
})

#define sqlite3_serialize(one, two, three, four) ({      \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));  \
    sqlite3_serialize((one), (two), (three), (four));    \
})

#define sqlite3_set_authorizer(one, two, three) ({       \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));  \
    sqlite3_set_authorizer((one), (two), (three));       \
})

#undef sqlite3_set_auxdata
#define sqlite3_set_auxdata *not used*

#undef sqlite3_set_clientdata
#define sqlite3_set_clientdata *not used*

#undef sqlite3_set_errmsg
#define sqlite3_set_errmsg *not used*

#define sqlite3_set_last_insert_rowid(one, two) ({       \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));  \
    sqlite3_set_last_insert_rowid((one), (two));         \
})

#define sqlite3_setlk_timeout(one, two, three) ({        \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));  \
    sqlite3_setlk_timeout((one), (two), (three));        \
})

#undef sqlite3_snapshot_cmp
#define sqlite3_snapshot_cmp *not used*

#undef sqlite3_snapshot_free
#define sqlite3_snapshot_free *not used*

#undef sqlite3_snapshot_get
#define sqlite3_snapshot_get *not used*

#undef sqlite3_snapshot_open
#define sqlite3_snapshot_open *not used*

#undef sqlite3_snapshot_recover
#define sqlite3_snapshot_recover *not used*

#undef sqlite3_snprintf
#define sqlite3_snprintf *not used*

#define sqlite3_sql(one) ({                                                   \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_db_handle((one)))));  \
    sqlite3_sql((one));                                                       \
})

#undef sqlite3_status
#define sqlite3_status *not used*

#define sqlite3_step(one) ({                                                  \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_db_handle((one)))));  \
    sqlite3_step((one));                                                      \
})

#undef sqlite3_stmt_busy
#define sqlite3_stmt_busy *not used*

#define sqlite3_stmt_explain(one, two) ({                                     \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_db_handle((one)))));  \
    sqlite3_stmt_explain((one), (two));                                       \
})

#undef sqlite3_stmt_scanstatus
#define sqlite3_stmt_scanstatus *not used*

#undef sqlite3_stmt_scanstatus_reset
#define sqlite3_stmt_scanstatus_reset *not used*

#undef sqlite3_stmt_scanstatus_v2
#define sqlite3_stmt_scanstatus_v2 *not used*

#define sqlite3_stmt_status(one, two, three) ({                               \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_db_handle((one)))));  \
    sqlite3_stmt_status((one), (two), (three));                               \
})

#undef sqlite3_str_append
#define sqlite3_str_append *not used*

#undef sqlite3_str_appendall
#define sqlite3_str_appendall *not used*

#undef sqlite3_str_appendchar
#define sqlite3_str_appendchar *not used*

#undef sqlite3_str_appendf
#define sqlite3_str_appendf *not used*

#undef sqlite3_str_errcode
#define sqlite3_str_errcode *not used*

#undef sqlite3_str_finish
#define sqlite3_str_finish *not used*

#undef sqlite3_str_free
#define sqlite3_str_free *not used*

#undef sqlite3_str_length
#define sqlite3_str_length *not used*

#undef sqlite3_str_new
#define sqlite3_str_new *not used*

#undef sqlite3_str_reset
#define sqlite3_str_reset *not used*

#undef sqlite3_str_truncate
#define sqlite3_str_truncate *not used*

#undef sqlite3_str_value
#define sqlite3_str_value *not used*

#undef sqlite3_str_vappendf
#define sqlite3_str_vappendf *not used*

#define sqlite3_table_column_metadata(one, two, three, four, five, six, seven, eight, nine) ({              \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));                                                     \
    sqlite3_table_column_metadata((one), (two), (three), (four), (five), (six), (seven), (eight), (nine));  \
})

#undef sqlite3_test_control
#define sqlite3_test_control *not used*

#undef sqlite3_total_changes
#define sqlite3_total_changes *not used*

#define sqlite3_trace_v2(one, two, three, four) ({       \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));  \
    sqlite3_trace_v2((one), (two), (three), (four));     \
})

#define sqlite3_txn_state(one, two) ({                   \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));  \
    sqlite3_txn_state((one), (two));                     \
})

#undef sqlite3_unlock_notify
#define sqlite3_unlock_notify *not used*

#define sqlite3_update_hook(one, two, three) ({          \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));  \
    sqlite3_update_hook((one), (two), (three));          \
})

#define sqlite3_user_data(one) ({                                                     \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_context_db_handle((one)))));  \
    sqlite3_user_data((one));                                                         \
})

#undef sqlite3_value_bytes16
#define sqlite3_value_bytes16 *not used*

#undef sqlite3_value_dup
#define sqlite3_value_dup *not used*

#undef sqlite3_value_encoding
#define sqlite3_value_encoding *not used*

#undef sqlite3_value_free
#define sqlite3_value_free *not used*

#undef sqlite3_value_frombind
#define sqlite3_value_frombind *not used*

#undef sqlite3_value_int
#define sqlite3_value_int *not used*

#undef sqlite3_value_numeric_type
#define sqlite3_value_numeric_type *not used*

#undef sqlite3_value_subtype
#define sqlite3_value_subtype *not used*

#undef sqlite3_value_text16
#define sqlite3_value_text16 *not used*

#undef sqlite3_value_text16be
#define sqlite3_value_text16be *not used*

#undef sqlite3_value_text16le
#define sqlite3_value_text16le *not used*

#undef sqlite3_version
#define sqlite3_version *not used*

#undef sqlite3_vmprintf
#define sqlite3_vmprintf *not used*

#undef sqlite3_vsnprintf
#define sqlite3_vsnprintf *not used*

#define sqlite3_vtab_config(one, two, three) ({          \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));  \
    sqlite3_vtab_config((one), (two), (three));          \
})

#define sqlite3_vtab_nochange(one) ({                                                 \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(sqlite3_context_db_handle((one)))));  \
    sqlite3_vtab_nochange((one));                                                     \
})

#define sqlite3_vtab_on_conflict(one) ({                 \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));  \
    sqlite3_vtab_on_conflict((one));                     \
})

#define sqlite3_wal_autocheckpoint(one, two) ({          \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));  \
    sqlite3_wal_autocheckpoint((one), (two));            \
})

#undef sqlite3_wal_checkpoint
#define sqlite3_wal_checkpoint *not used*

#define sqlite3_wal_checkpoint_v2(one, two, three, four, five) ({      \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));                \
    sqlite3_wal_checkpoint_v2((one), (two), (three), (four), (five));  \
})

#define sqlite3_wal_hook(one, two, three) ({             \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));  \
    sqlite3_wal_hook((one), (two), (three));             \
})

#undef sqlite3_win32_set_directory
#define sqlite3_win32_set_directory *not used*

#undef sqlite3_win32_set_directory16
#define sqlite3_win32_set_directory16 *not used*

#undef sqlite3_win32_set_directory8
#define sqlite3_win32_set_directory8 *not used*

#undef sqlite3changeset_apply
#define sqlite3changeset_apply *not used*

#undef sqlite3changeset_apply_strm
#define sqlite3changeset_apply_strm *not used*

#define sqlite3session_create(one, two, three) ({        \
    assert (sqlite3_mutex_held(sqlite3_db_mutex(one)));  \
    sqlite3session_create((one), (two), (three));        \
})


#endif
