diff options
| author | Teddy Wing | 2018-08-26 10:17:24 +0200 |
|---|---|---|
| committer | Teddy Wing | 2018-08-26 10:17:24 +0200 |
| commit | 2a02c11a3a33e9f8f77dcdda17a963c1ef782bf3 (patch) | |
| tree | 5d088cad435dbe8031b9738d99b92d95eb9aea4b /src/cocoa_bridge.rs | |
| parent | f9f50f67005617e352eff23468b5798f3c0d647c (diff) | |
| download | dome-key-map-2a02c11a3a33e9f8f77dcdda17a963c1ef782bf3.tar.bz2 | |
c_run_key_action(): Get the C code to actually print something out
Ensure that the C code can really print something sent from the Rust
code. Our action string wasn't getting printed out, so I wanted to see
it working with a test string. Need to figure out what I have to do to
get it to work for real now.
Diffstat (limited to 'src/cocoa_bridge.rs')
| -rw-r--r-- | src/cocoa_bridge.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cocoa_bridge.rs b/src/cocoa_bridge.rs index 1f0b693..f33a739 100644 --- a/src/cocoa_bridge.rs +++ b/src/cocoa_bridge.rs @@ -1,4 +1,4 @@ -use std::ffi::CString; +use std::ffi::{CStr, CString}; use std::ptr; use std::slice; @@ -69,7 +69,7 @@ pub extern "C" fn c_run_key_action( match k.action { Some(a) => { CKeyActionResult { - action: a.as_ptr(), + action: CStr::from_bytes_with_nul(b"test?\n\0").unwrap().as_ptr(), kind: &k.kind, } }, |
