diff --git a/src/runtime/ffi.rs b/src/runtime/ffi.rs index 39dd2eb5dfbac74e050db218eaa4be8e52d6ab78..0bb643d3c31ba952769cadbf55b33d1376adc816 100644 --- a/src/runtime/ffi.rs +++ b/src/runtime/ffi.rs @@ -110,14 +110,20 @@ pub extern "C" fn connector_with_controller_id(controller_id: ControllerId) -> * /// # Safety /// TODO #[no_mangle] -pub unsafe extern "C" fn connector_configure(connector: *mut Connector, pdl: *mut c_char) -> c_int { +pub unsafe extern "C" fn connector_configure( + connector: *mut Connector, + pdl: *mut c_char, + main: *mut c_char, +) -> c_int { let mut b = Box::from_raw(connector); // unsafe! - let ret = as_rust_bytes(pdl, |pdl_bytes| match b.configure(pdl_bytes) { - Ok(()) => 0, - Err(e) => { - overwrite_last_error(format!("{:?}", e).as_bytes()); - -1 - } + let ret = as_rust_bytes(pdl, |pdl_bytes| { + as_rust_bytes(main, |main_bytes| match b.configure(pdl_bytes, main_bytes) { + Ok(()) => 0, + Err(e) => { + overwrite_last_error(format!("{:?}", e).as_bytes()); + -1 + } + }) }); Box::into_raw(b); // don't drop! ret