Displaying 4 results from an estimated 4 matches for "libnbd_sys".
2019 Jul 07
2
[libnbd PATCH] RFC: Add bindings for Rust language
...m ret);
+ pr " }\n";
+ in
+
+ generate_header CStyle;
+
+ pr "#[allow(unused_imports)]\n";
+ pr "use std::os::raw::{c_char, c_int, c_uint, c_void};\n";
+ pr "use std::os::unix::io::RawFd;\n";
+ pr "use std::ffi::CStr;\n";
+ pr "use libnbd_sys::*;\n";
+ pr "use libc;\n";
+ pr "\n";
+ pr "pub use super::nbd_error::*;\n";
+ pr "\n";
+
+ pr "pub struct Nbd {\n";
+ pr " handle: *mut nbd_handle,\n";
+ pr "}\n";
+ pr "\n";
+ pr "impl Nbd {\n&q...
2019 Jul 08
0
Re: [libnbd PATCH] RFC: Add bindings for Rust language
...Caml which can be unlimited in length, so this:
> + pr "#[allow(unused_imports)]\n";
> + pr "use std::os::raw::{c_char, c_int, c_uint, c_void};\n";
> + pr "use std::os::unix::io::RawFd;\n";
> + pr "use std::ffi::CStr;\n";
> + pr "use libnbd_sys::*;\n";
> + pr "use libc;\n";
> + pr "\n";
(etc)
can be written as:
pr "\
#[allow(unused_imports)]
use std::os::raw::{c_char, c_int, c_uint, c_void};
use std::os::unix::io::RawFd;
[...]
";
These are still C-like printf-like strings so you still need t...
2019 Aug 31
1
[PATCH libnbd] Add bindings for Rust language
Still not working, but I took the latest patch and:
- rebased it against libnbd 1.0
- fixed it so it handles new args and cbargs
The generator now runs without warnings.
This patch doesn't handle optargs at all. In C these are converted to
non-optional parameter. Rust doesn't (AFAIK) have optional or
labelled arguments unfortunately.
Rich.
2019 Jul 08
2
Re: [libnbd PATCH] RFC: Add bindings for Rust language
...ted in length, so this:
>
>> + pr "#[allow(unused_imports)]\n";
>> + pr "use std::os::raw::{c_char, c_int, c_uint, c_void};\n";
>> + pr "use std::os::unix::io::RawFd;\n";
>> + pr "use std::ffi::CStr;\n";
>> + pr "use libnbd_sys::*;\n";
>> + pr "use libc;\n";
>> + pr "\n";
>(etc)
>
>can be written as:
>
> pr "\
>#[allow(unused_imports)]
>use std::os::raw::{c_char, c_int, c_uint, c_void};
>use std::os::unix::io::RawFd;
>[...]
>";
This makes it...