drone-micropython-core 0.1.1

MicroPython for Drone.
#[macro_export]
macro_rules! mp_io {
  ($rt:ty) => {
    #[doc(hidden)]
    #[no_mangle]
    pub unsafe extern "C" fn open(path: *const c_char, flags: c_char) -> c_int {
      <$rt as $crate::io::IoRt>::open(path, flags)
    }

    #[doc(hidden)]
    #[no_mangle]
    pub unsafe extern "C" fn read(
      fd: c_int,
      buf: *mut c_void,
      count: usize,
    ) -> isize {
      <$rt as $crate::io::IoRt>::read(fd, buf, count)
    }

    #[doc(hidden)]
    #[no_mangle]
    pub unsafe extern "C" fn write(
      fd: c_int,
      buf: *const c_void,
      count: usize,
    ) -> isize {
      <$rt as $crate::io::IoRt>::write(fd, buf, count)
    }

    #[doc(hidden)]
    #[no_mangle]
    pub unsafe extern "C" fn lseek(
      fd: c_int,
      offset: $crate::rt::off_t,
      whence: c_int,
    ) -> $crate::rt::off_t {
      <$rt as $crate::io::IoRt>::lseek(fd, offset, whence)
    }

    #[doc(hidden)]
    #[no_mangle]
    pub unsafe extern "C" fn fsync(fd: c_int) -> c_int {
      <$rt as $crate::io::IoRt>::fsync(fd)
    }

    #[doc(hidden)]
    #[no_mangle]
    pub unsafe extern "C" fn close(fd: c_int) -> c_int {
      <$rt as $crate::io::IoRt>::close(fd)
    }

    #[doc(hidden)]
    #[no_mangle]
    pub unsafe extern "C" fn mp_import_stat(
      path: *const c_char,
    ) -> $crate::rt::mp_import_stat_t {
      <$rt as $crate::io::IoRt>::mp_import_stat(path)
    }
  };
}