aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Cargo.toml3
-rw-r--r--src/cocoa_bridge.rs1
-rw-r--r--src/lib.rs2
-rw-r--r--src/parser.rs1
4 files changed, 7 insertions, 0 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 851ed38..23af201 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -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> {
diff --git a/src/lib.rs b/src/lib.rs
index 7fb0b92..3127631 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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,