diff options
| -rw-r--r-- | Cargo.toml | 3 | ||||
| -rw-r--r-- | src/cocoa_bridge.rs | 1 | ||||
| -rw-r--r-- | src/lib.rs | 2 | ||||
| -rw-r--r-- | src/parser.rs | 1 |
4 files changed, 7 insertions, 0 deletions
@@ -5,3 +5,6 @@ version = "0.0.1" [dependencies] cocoa = "0.18.0" combine = "3.4.0" + +[lib] +crate-type = ["staticlib"] diff --git a/src/cocoa_bridge.rs b/src/cocoa_bridge.rs index df144f1..d4749f0 100644 --- a/src/cocoa_bridge.rs +++ b/src/cocoa_bridge.rs @@ -44,6 +44,7 @@ pub struct KeyActionResult { pub kind: MapKind, } +#[no_mangle] pub extern "C" fn run_key_action( trigger: &[HeadphoneButton] ) -> Option<KeyActionResult> { @@ -7,3 +7,5 @@ mod cocoa_bridge; mod parser; use parser::{HeadphoneButton, MapGroup, MapKind}; + +pub use cocoa_bridge::run_key_action; diff --git a/src/parser.rs b/src/parser.rs index d5cd860..c6c8cce 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -13,6 +13,7 @@ use combine::parser::char::{ use combine::parser::repeat::take_until; use combine::stream::state::{SourcePosition, State}; +#[repr(C)] #[derive(Debug, Hash, Eq, PartialEq)] pub enum HeadphoneButton { Play, |
