diff --git a/Cargo.lock b/Cargo.lock index 4397377..adf9b17 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -53,18 +53,18 @@ dependencies = [ ] [[package]] -name = "oleclient" +name = "oaclt" version = "0.0.0" dependencies = [ "derive_more", "duplicate", - "oleclient_macros", + "oaclt_macros", "thiserror", "windows", ] [[package]] -name = "oleclient_macros" +name = "oaclt_macros" version = "0.0.0" dependencies = [ "itertools", diff --git a/Cargo.toml b/Cargo.toml index 9c33b1c..2a83053 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,3 +1,3 @@ [workspace] -members = ["crates/oleclient", "crates/oleclient_macros"] +members = ["crates/oaclt", "crates/oaclt_macros"] resolver = "2" diff --git a/README.md b/README.md index 8387fb2..7de21bd 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ -# OleClient +# oaclt -OLE Automation client. +An **O**LE **A**utomation **cl**ien**t** for Rust. diff --git a/crates/oleclient/Cargo.toml b/crates/oaclt/Cargo.toml similarity index 83% rename from crates/oleclient/Cargo.toml rename to crates/oaclt/Cargo.toml index 6592416..bca4e57 100644 --- a/crates/oleclient/Cargo.toml +++ b/crates/oaclt/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "oleclient" +name = "oaclt" version = "0.0.0" edition = "2021" license = "MIT OR Apache-2.0" @@ -9,7 +9,7 @@ rust-version = "1.73.0" [dependencies] derive_more = "0.99.17" duplicate = "1.0.0" -oleclient_macros = { path = "../oleclient_macros" } +oaclt_macros = { path = "../oaclt_macros" } thiserror = "1.0.49" [dependencies.windows] diff --git a/crates/oleclient/src/lib.rs b/crates/oaclt/src/lib.rs similarity index 99% rename from crates/oleclient/src/lib.rs rename to crates/oaclt/src/lib.rs index 0782dd4..016c6c6 100644 --- a/crates/oleclient/src/lib.rs +++ b/crates/oaclt/src/lib.rs @@ -29,7 +29,7 @@ use windows::{ }, }; -pub use oleclient_macros::{new, TryFrom_Out}; +pub use oaclt_macros::{new, TryFrom_Out}; pub fn init_apartment(dwcoinit: Coinit) -> windows::core::Result { unsafe { diff --git a/crates/oleclient_macros/Cargo.toml b/crates/oaclt_macros/Cargo.toml similarity index 89% rename from crates/oleclient_macros/Cargo.toml rename to crates/oaclt_macros/Cargo.toml index 83f3912..ec0fafa 100644 --- a/crates/oleclient_macros/Cargo.toml +++ b/crates/oaclt_macros/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "oleclient_macros" +name = "oaclt_macros" version = "0.0.0" edition = "2021" license = "MIT OR Apache-2.0" diff --git a/crates/oleclient_macros/src/lib.rs b/crates/oaclt_macros/src/lib.rs similarity index 84% rename from crates/oleclient_macros/src/lib.rs rename to crates/oaclt_macros/src/lib.rs index a36687e..8a7b26e 100644 --- a/crates/oleclient_macros/src/lib.rs +++ b/crates/oaclt_macros/src/lib.rs @@ -5,7 +5,7 @@ use syn::{ parse_macro_input, DeriveInput, LitStr, Meta, MetaList, Token, }; -#[proc_macro_derive(new, attributes(oleclient))] +#[proc_macro_derive(new, attributes(oaclt))] pub fn derive_new(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let input = parse_macro_input!(input as DeriveInput); return derive_new(input) @@ -20,22 +20,22 @@ pub fn derive_new(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let AttrVal(prog_id) = attrs .iter() .flat_map(|attr| match &attr.meta { - Meta::List(MetaList { path, .. }) if path.is_ident("oleclient") => { + Meta::List(MetaList { path, .. }) if path.is_ident("oaclt") => { Some(attr.parse_args::()) } _ => None, }) .exactly_one() .map_err(|_| { - syn::Error::new(proc_macro2::Span::call_site(), "missing `#[oleclient(…)]`") + syn::Error::new(proc_macro2::Span::call_site(), "missing `#[oaclt(…)]`") })??; let (impl_generics, ty_generics, where_clause) = input.generics.split_for_impl(); Ok(quote! { impl #impl_generics #ident #ty_generics #where_clause { - #vis fn new() -> ::oleclient::Result { - let disp = ::oleclient::idispatch_from_prog_id(::windows::core::w!(#prog_id))?; + #vis fn new() -> ::oaclt::Result { + let disp = ::oaclt::idispatch_from_prog_id(::windows::core::w!(#prog_id))?; Ok(::std::convert::From::from(disp)) } } @@ -73,12 +73,12 @@ pub fn derive_try_from_out(input: proc_macro::TokenStream) -> proc_macro::TokenS let (impl_generics, ty_generics, where_clause) = input.generics.split_for_impl(); Ok(quote! { - impl #impl_generics ::std::convert::TryFrom<::oleclient::Out> for #ident #ty_generics + impl #impl_generics ::std::convert::TryFrom<::oaclt::Out> for #ident #ty_generics #where_clause { - type Error = ::oleclient::Error; + type Error = ::oaclt::Error; - fn try_from(out: ::oleclient::Out) -> ::oleclient::Result { + fn try_from(out: ::oaclt::Out) -> ::oaclt::Result { let disp = out.into_idispatch()?; Ok(Self::from(disp)) }