Displaying 2 results from an estimated 2 matches for "ret_rs_type".
Did you mean:
get_os_type
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 07
2
[libnbd PATCH] RFC: Add bindings for Rust language
...s: c_uint,\n" n
+ | UInt32 n -> pri (); pr "%s: u32,\n" n
+ | UInt64 n -> pri (); pr "%s: u64,\n" n
+ );
+ ) args;
+ pr_indent (indent - 1); pr ")"
+
+let generate_rust_sys_lib_rs () =
+ let print_extern (name, {args; ret; _ }) =
+ let ret_rs_type =
+ match ret with
+ | RBool
+ | RErr
+ | RFd
+ | RInt -> "c_int"
+ | RConstString -> "*const c_char"
+ | RInt64 -> "i64"
+ | RString -> "*mut c_char"
+ in
+
+ (* TODO: print shortdesc and longdesc *)...