diff --git a/src/runtime/experimental/api.rs b/src/runtime/experimental/api.rs index f3d5a75a11bb7875d8552c08f0741c6834e4eadf..bdcf40deb46f750359e13754152b86f3ca4608f9 100644 --- a/src/runtime/experimental/api.rs +++ b/src/runtime/experimental/api.rs @@ -222,22 +222,23 @@ fn api_new_test() { #[repr(C)] pub struct PortOp { - msgbuf: *mut u8, - buflen: usize, - msglen: usize, - optional: bool, + msgptr: *mut u8, // read if OUT, field written if IN, will point into buf + msglen: usize, // read if OUT, written if IN, won't exceed buf + port: Port, + optional: bool, // no meaning if } pub enum PortOpRs<'a> { In { msg_range: Option>, port: &'a InPort }, Out { msg: &'a [u8], port: &'a OutPort, optional: bool }, } -pub struct InPortOp<'a> { - msg_range: Option>, // written by sync - port: &'a InPort, -} -pub struct OutPortOp<'a> { - msg: &'a [u8], - port: &'a OutPort, - optional: bool, + +fn c_sync_set( + connected: &mut Connected, + inbuflen: usize, + inbuf: *mut u8, + opslen: usize, + ops: *mut PortOp, +) -> i32 { + todo!() }