wi_sqlite3_statement_t * wi_sqlite3_prepare_statement(wi_sqlite3_database_t *database, wi_string_t *query, ...) { wi_sqlite3_statement_t *statement; va_list ap; statement = wi_autorelease(wi_runtime_create_instance(_wi_sqlite3_statement_runtime_id, sizeof(wi_sqlite3_statement_t))); statement->query = wi_retain(query); wi_recursive_lock_lock(database->lock); if( #ifdef HAVE_SQLITE3_PREPARE_V2 sqlite3_prepare_v2 #else sqlite3_prepare #endif (database->database, wi_string_cstring(query), wi_string_length(query), &statement->statement, NULL) == SQLITE_OK) { va_start(ap, query); _wi_sqlite3_bind_statement(statement, ap); va_end(ap); } else { wi_error_set_sqlite3_error_with_description(database->database, wi_description(statement)); statement = NULL; } wi_recursive_lock_unlock(database->lock); return statement; }
wi_sqlite3_database_t * wi_sqlite3_open_database_with_path(wi_string_t *path) { wi_sqlite3_database_t *database; database = wi_autorelease(wi_runtime_create_instance(_wi_sqlite3_database_runtime_id, sizeof(wi_sqlite3_database_t))); database->lock = wi_recursive_lock_init(wi_recursive_lock_alloc()); if(sqlite3_open(wi_string_cstring(path), &database->database) == SQLITE_OK) { sqlite3_busy_handler(database->database, _wi_sqlite3_busy_handler, NULL); } else { if(database->database) { wi_error_set_sqlite3_error(database->database); sqlite3_close(database->database); database->database = NULL; } else { wi_error_set_errno(ENOMEM); } database = NULL; } return database; }
static wi_process_t * _wi_process_alloc(void) { return wi_runtime_create_instance(_wi_process_runtime_id, sizeof(wi_process_t)); }
wi_socket_t * wi_socket_alloc(void) { return wi_runtime_create_instance(_wi_socket_runtime_id, sizeof(wi_socket_t)); }
static wd_client_info_t * wd_client_info_alloc(void) { return wi_runtime_create_instance(wd_client_info_runtime_id, sizeof(wd_client_info_t)); }
static wi_error_t * _wi_error_alloc(void) { return wi_runtime_create_instance(_wi_error_runtime_id, sizeof(wi_error_t)); }
wi_settings_t * wi_settings_alloc(void) { return wi_runtime_create_instance(_wi_settings_runtime_id, sizeof(wi_settings_t)); }
static wi_thread_t * _wi_thread_alloc(void) { return wi_runtime_create_instance(_wi_thread_runtime_id, sizeof(wi_thread_t)); }
wi_recursive_lock_t * wi_recursive_lock_alloc(void) { return wi_runtime_create_instance(_wi_recursive_lock_runtime_id, sizeof(wi_recursive_lock_t)); }
wb_command_t * wb_command_alloc(void) { return wi_runtime_create_instance(wb_command_runtime_id, sizeof(wb_command_t)); }
static wd_tempban_t * wd_tempban_alloc(void) { return wi_runtime_create_instance(wd_tempban_runtime_id, sizeof(wd_tempban_t)); }
wi_array_t * wi_array_alloc(void) { return wi_runtime_create_instance(_wi_array_runtime_id, sizeof(wi_array_t)); }
wi_speed_calculator_t * wi_speed_calculator_alloc(void) { return wi_runtime_create_instance(_wi_speed_calculator_runtime_id, sizeof(wi_speed_calculator_t)); }
wr_chat_t * wr_chat_alloc(void) { return wi_runtime_create_instance(wr_chat_runtime_id, sizeof(wr_chat_t)); }
wi_x509_t * wi_x509_alloc(void) { return wi_runtime_create_instance(_wi_x509_runtime_id, sizeof(wi_x509_t)); }
wi_fsenumerator_t * wi_fsenumerator_alloc(void) { return wi_runtime_create_instance(_wi_fsenumerator_runtime_id, sizeof(wi_fsenumerator_t)); }
wi_cipher_t * wi_cipher_alloc(void) { return wi_runtime_create_instance(_wi_cipher_runtime_id, sizeof(wi_cipher_t)); }
wr_server_t * wr_server_alloc(void) { return wi_runtime_create_instance(wr_server_runtime_id, sizeof(wr_server_t)); }
wi_condition_lock_t * wi_condition_lock_alloc(void) { return wi_runtime_create_instance(_wi_condition_lock_runtime_id, sizeof(wi_condition_lock_t)); }
wi_config_t * wi_config_alloc(void) { return wi_runtime_create_instance(_wi_config_runtime_id, sizeof(wi_config_t)); }
wr_window_t * wr_window_alloc(void) { return wi_runtime_create_instance(wr_window_runtime_id, sizeof(wr_window_t)); }
wi_terminal_buffer_t * wi_terminal_buffer_alloc(void) { return wi_runtime_create_instance(_wi_terminal_buffer_runtime_id, sizeof(wi_terminal_buffer_t)); }
wi_p7_message_t * wi_p7_message_alloc(void) { return wi_runtime_create_instance(_wi_p7_message_runtime_id, sizeof(wi_p7_message_t)); }
wi_string_encoding_t * wi_string_encoding_alloc(void) { return wi_runtime_create_instance(_wi_string_encoding_runtime_id, sizeof(wi_string_encoding_t)); }
static wd_user_t * wd_user_alloc(void) { return wi_runtime_create_instance(wd_user_runtime_id, sizeof(wd_user_t)); }
wr_topic_t * wr_topic_alloc(void) { return wi_runtime_create_instance(wr_topic_runtime_id, sizeof(wr_topic_t)); }