From e46463da2382b77d7db0677ef613fff597d776f4 Mon Sep 17 00:00:00 2001 From: vms Date: Mon, 10 May 2021 18:02:36 +0300 Subject: [PATCH] move to sdk 0.6.3 --- Cargo.toml | 10 ++-- src/{wit_generator.rs => it_generator.rs} | 60 +++++++++++------------ src/sqlite3_connector/import_functions.rs | 10 ++-- src/test.rs | 20 ++++---- 4 files changed, 50 insertions(+), 50 deletions(-) rename src/{wit_generator.rs => it_generator.rs} (94%) diff --git a/Cargo.toml b/Cargo.toml index 855cf3b..1c67f83 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "fce-sqlite-connector" +name = "marine-sqlite-connector" version = "0.4.0" license = "Apache-2.0/MIT" authors = [ @@ -23,19 +23,19 @@ categories = ["api-bindings", "database"] keywords = ["database"] [lib] -name = "fce_sqlite_connector" +name = "marine_sqlite_connector" path = "src/lib.rs" [[bin]] -name = "wit_generator" -path = "src/wit_generator.rs" +name = "it_generator" +path = "src/it_generator.rs" [[bin]] name = "test" path = "src/test.rs" [dependencies] -fluence = "0.6.1" +fluence = "0.6.3" [dev-dependencies] temporary = "0.6" diff --git a/src/wit_generator.rs b/src/it_generator.rs similarity index 94% rename from src/wit_generator.rs rename to src/it_generator.rs index b882bac..3b2fc90 100644 --- a/src/wit_generator.rs +++ b/src/it_generator.rs @@ -3,18 +3,18 @@ extern crate fluence; -use fluence::fce; +use fluence::marine; pub fn main() {} -#[fce] +#[marine] #[derive(Default)] pub struct DBOpenDescriptor { pub ret_code: i32, pub db_handle: u32, } -#[fce] +#[marine] #[derive(Default)] pub struct DBPrepareDescriptor { pub ret_code: i32, @@ -22,7 +22,7 @@ pub struct DBPrepareDescriptor { pub tail: u32, } -#[fce] +#[marine] #[derive(Default)] pub struct DBExecDescriptor { pub ret_code: i32, @@ -37,13 +37,13 @@ pub struct DBExecDescriptor { const char *zVfs /* Name of VFS module to use */ ); */ -#[fce] +#[marine] pub fn sqlite3_open_v2(filename: String, flags: i32, vfs: String) -> DBOpenDescriptor { <_>::default() } // SQLITE_API int sqlite3_close(sqlite3*); -#[fce] +#[marine] pub fn sqlite3_close(db_handle: u32) -> i32 { <_>::default() } @@ -57,7 +57,7 @@ pub fn sqlite3_close(db_handle: u32) -> i32 { const char **pzTail /* OUT: Pointer to unused portion of zSql */ ); */ -#[fce] +#[marine] pub fn sqlite3_prepare_v2(db_handle: u32, sql: String) -> DBPrepareDescriptor { <_>::default() } @@ -71,7 +71,7 @@ pub fn sqlite3_prepare_v2(db_handle: u32, sql: String) -> DBPrepareDescriptor { char **errmsg /* Error msg written here */ ); */ -#[fce] +#[marine] pub fn sqlite3_exec( db_handle: u32, sql: String, @@ -82,133 +82,133 @@ pub fn sqlite3_exec( } // SQLITE_API int sqlite3_libversion_number(void); -#[fce] +#[marine] pub fn sqlite3_libversion_number() -> i32 { <_>::default() } // SQLITE_API int sqlite3_changes(sqlite3*); -#[fce] +#[marine] pub fn sqlite3_changes(db_handle: u32) -> i32 { <_>::default() } // SQLITE_API int sqlite3_total_changes(sqlite3*); -#[fce] +#[marine] pub fn sqlite3_total_changes(db_handle: u32) -> i32 { <_>::default() } // SQLITE_API int sqlite3_busy_timeout(sqlite3*, int ms); -#[fce] +#[marine] pub fn sqlite3_busy_timeout(db_handle: u32, ms: u32) -> i32 { <_>::default() } // SQLITE_API const char *sqlite3_errmsg(sqlite3*); -#[fce] +#[marine] pub fn sqlite3_errmsg(db_handle: u32) -> String { <_>::default() } // SQLITE_API int sqlite3_errcode(sqlite3 *db); -#[fce] +#[marine] pub fn sqlite3_errcode(db: u32) -> i32 { <_>::default() } // SQLITE_API int sqlite3_column_type(sqlite3_stmt*, int iCol); -#[fce] +#[marine] pub fn sqlite3_column_type(stmt_handle: u32, icol: u32) -> i32 { <_>::default() } // SQLITE_API const char *sqlite3_column_name(sqlite3_stmt*, int N); -#[fce] +#[marine] pub fn sqlite3_column_name(stmt_handle: u32, N: u32) -> String { <_>::default() } // SQLITE_API int sqlite3_step(sqlite3_stmt*); -#[fce] +#[marine] pub fn sqlite3_step(stmt_handle: u32) -> i32 { <_>::default() } // SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt); -#[fce] +#[marine] pub fn sqlite3_reset(stmt_handle: u32) -> i32 { <_>::default() } // SQLITE_API int sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*)); -#[fce] +#[marine] pub fn sqlite3_bind_blob(stmt_handle: u32, pos: i32, blob: Vec, xDel: i32) -> i32 { <_>::default() } // SQLITE_API int sqlite3_bind_double(sqlite3_stmt*, int, double); -#[fce] +#[marine] pub fn sqlite3_bind_double(stmt_handle: u32, pos: i32, value: f64) -> i32 { <_>::default() } // SQLITE_API int sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64); -#[fce] +#[marine] pub fn sqlite3_bind_int64(stmt_handle: u32, pos: i32, value: i64) -> i32 { <_>::default() } // SQLITE_API int sqlite3_bind_null(sqlite3_stmt*, int); -#[fce] +#[marine] pub fn sqlite3_bind_null(stmt_handle: u32, pos: i32) -> i32 { <_>::default() } // SQLITE_API int sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*)); -#[fce] +#[marine] pub fn sqlite3_bind_text(stmt_handle: u32, pos: i32, text: String, xDel: i32) -> i32 { <_>::default() } // SQLITE_API int sqlite3_column_count(sqlite3_stmt *pStmt) -#[fce] +#[marine] pub fn sqlite3_column_count(stmt_handle: u32) -> i32 { <_>::default() } // SQLITE_API const void *sqlite3_column_blob(sqlite3_stmt*, int iCol); -#[fce] +#[marine] pub fn sqlite3_column_blob(stmt_handle: u32, icol: i32) -> Vec { <_>::default() } // SQLITE_API double sqlite3_column_double(sqlite3_stmt*, int iCol); -#[fce] +#[marine] pub fn sqlite3_column_double(stmt_handle: u32, icol: i32) -> f64 { <_>::default() } // SQLITE_API sqlite3_int64 sqlite3_column_int64(sqlite3_stmt*, int iCol); -#[fce] +#[marine] pub fn sqlite3_column_int64(stmt_handle: u32, icol: u32) -> i64 { <_>::default() } // SQLITE_API const unsigned char *sqlite3_column_text(sqlite3_stmt*, int iCol); -#[fce] +#[marine] pub fn sqlite3_column_text(stmt_handle: u32, icol: u32) -> String { <_>::default() } // SQLITE_API int sqlite3_column_bytes(sqlite3_stmt*, int iCol); -#[fce] +#[marine] pub fn sqlite3_column_bytes(stmt_handle: u32, icol: u32) -> i32 { <_>::default() } // SQLITE_API int sqlite3_finalize(sqlite3_stmt *pStmt); -#[fce] +#[marine] pub fn sqlite3_finalize(stmt_handle: u32) -> i32 { <_>::default() } diff --git a/src/sqlite3_connector/import_functions.rs b/src/sqlite3_connector/import_functions.rs index 21c9861..de61159 100644 --- a/src/sqlite3_connector/import_functions.rs +++ b/src/sqlite3_connector/import_functions.rs @@ -1,18 +1,18 @@ extern crate fluence; -use self::fluence::fce; +use self::fluence::marine; pub(crate) type Sqlite3DbHandle = u32; pub(crate) type Sqlite3StmtHandle = u32; -#[fce] +#[marine] #[derive(Clone, Debug)] pub struct DBOpenDescriptor { pub ret_code: i32, pub db_handle: u32, } -#[fce] +#[marine] #[derive(Clone, Debug)] pub struct DBPrepareDescriptor { pub ret_code: i32, @@ -20,14 +20,14 @@ pub struct DBPrepareDescriptor { pub tail: u32, } -#[fce] +#[marine] #[derive(Clone, Debug)] pub struct DBExecDescriptor { pub ret_code: i32, pub err_msg: String, } -#[fce] +#[marine] #[link(wasm_import_module = "sqlite3")] extern "C" { /* diff --git a/src/test.rs b/src/test.rs index 0806139..46af4c1 100644 --- a/src/test.rs +++ b/src/test.rs @@ -1,14 +1,14 @@ extern crate fluence; -extern crate fce_sqlite_connector; +extern crate marine_sqlite_connector; -use fluence::fce; -use fce_sqlite_connector::State; +use fluence::marine; +use marine_sqlite_connector::State; pub fn main() {} -#[fce] +#[marine] pub fn test1() { - let connection = fce_sqlite_connector::open(":memory:").unwrap(); + let connection = marine_sqlite_connector::open(":memory:").unwrap(); connection .execute( @@ -30,9 +30,9 @@ pub fn test1() { .unwrap(); } -#[fce] +#[marine] pub fn test2() { - let connection = fce_sqlite_connector::open(":memory:").unwrap(); + let connection = marine_sqlite_connector::open(":memory:").unwrap(); println!("connection id = {}\n", connection.as_raw()); connection @@ -56,11 +56,11 @@ pub fn test2() { println!("age = {}", statement.read::(1).unwrap()); } } -#[fce] +#[marine] pub fn test3() { - use fce_sqlite_connector::Value; + use marine_sqlite_connector::Value; - let connection = fce_sqlite_connector::open(":memory:").unwrap(); + let connection = marine_sqlite_connector::open(":memory:").unwrap(); connection .execute(