rust-bindgen
rust-bindgen copied to clipboard
Automatically generates Rust FFI bindings to C (and some C++) libraries.
### Input C/C++ Header The original header is linux kernel source header; linux/target_core_user.h. ```C++ #define ALIGN_SIZE 64 /* Should be enough for most CPUs */ typedef unsigned short __u16; typedef...
here is my input structure. ``` typedef struct { const char *base_path; /**< Mounting point. */ const char *partition_label; /**< Label of partition to use. */ uint8_t format_if_mount_failed:1; /**< Format...
This PR splits all the fields inside `BindgenOptions` struct into two new structs: - `inputs: BindgenInputs`: Which holds all the command line arguments and implements `Clone`. - `state: BindgenState`: Which...
Hi, _bindgen_ ignore template specialization for class (and struct) and select the first "working answer". For example : ``` c++ template class test; template class test { int foo; };...
I assume this is one of the template issues @emilio has mentioned before, but here it is for completeness. Input: ```c++ namespace { namespace { template < template < typename...
Right now we have various methods on `clang::Cursor` that return `Option`s just because (I think?) we call underlying clang functions that return null if the cursor is the "null cursor"...
This is a list of things we can't handle correctly in bindgen, and we're not expected to be able to in a while. ### Partial template specialization We can't get...
We generate glue for C++ classes with virtual tables (for example, CustomAutoRooter in rust-mozjs), but we don't generate methods that fetch the function pointer from the vtable and invoke it...
In rust you can't define variadic methods, at least as of right now. If that changes, we would be able to generate the convenience methods we use for the rest...
Probably pretty self-explanatory. header() and link() (and other functions) on bindgen take Into, even though the examples show them being used with paths (although not Path with a capital P)....