summaryrefslogtreecommitdiff
path: root/src/options.rs
AgeCommit message (Collapse)Author
2017-07-13Add the ability to dump preprocessed input headersNick Fitzgerald
This is useful when debugging bindgen, using C-Reduce on an input to bindgen, or for constructing portable test cases when filing issues against bindgen. Fixes #811
2017-06-21Auto merge of #741 - tmfink:feature-699-constified-enum-module, r=emiliobors-servo
Feature 699 constified enum module This is a work in progress for issue #699 that adds the `--constified-enum-module` option to bindgen. @emilio, could you give me some guidance on fixing the uses of the enum variant types? In the example below, `foo` should be replaced with `foo::Type`. I'm not sure of the proper way to rename `Item`s after the structures have been defined. My initial thought was to redefine the `CodeGenerator` trait to take a mutable reference to `item`, but that will not work because of the borrow checker. Thoughts? Todo: - [x] put constified enum variants in a `mod` - [x] ensure references to constified enum `foo` are changed to `foo::Type` - [x] handle `typedef` enums ----- Given the input header `tests/headers/constify-module-enums.h`: ~~~c // bindgen-flags: --constified-enum-module foo enum foo { THIS, SHOULD_BE, A_CONSTANT, }; struct bar { enum foo this_should_work; }; ~~~ `$ cargo run -- tests/headers/constify-module-enums.h --constified-enum-module foo --no-layout-tests` will output: ~~~rust /* automatically generated by rust-bindgen */ pub mod foo { pub type Type = ::std::os::raw::c_uint; pub const THIS: Type = 0; pub const SHOULD_BE: Type = 1; pub const A_CONSTANT: Type = 2; } #[repr(C)] #[derive(Debug, Copy)] pub struct bar { pub this_should_work: foo, } impl Clone for bar { fn clone(&self) -> Self { *self } } ~~~
2017-06-19switch defaults from generating unstable Rust to generating stable RustPierre-Antoine Rault
- changing the Builder::no_unstable_rust method to the Builder::unstable_rust method - changing the --no-unstable-rust flag to a --unstable-rust flag in src/options.rs - changing bindgen-flags header in the test headers to remove the --no-unstable-rust flag Fixes #757
2017-06-11Adds `--constified-enum-module` option per #699Travis Finkenauer
2017-05-03objc: Fix broken option handlingMikko Lehtonen
2017-04-28Clarify wording of command line helpTravis Finkenauer
2017-04-14Option to avoid generating layout testsDavid Hotham
2017-04-04options: Allow configuring destructors via CLI.Emilio Cobos Álvarez
2017-04-03options: Allow configuring the generation of constructors.Emilio Cobos Álvarez
2017-03-20options: Allow force-generating inline functions.Emilio Cobos Álvarez
2017-03-12options: Honor distrust-clang-mangling.Emilio Cobos Álvarez
2017-02-27Add command line flag for prepend_enum_nameth0rex
2017-02-19Add an option to distrust clang mangling.Emilio Cobos Álvarez
2017-02-15Graphviz implementationArtem Biryukov
2017-02-08Run `cargo fmt`Nick Fitzgerald
2017-02-08Auto merge of #480 - flier:impl-default, r=emiliobors-servo
Implement `Default` trait We need `Default` trait to handle so many auto generated fields when create new structure.
2017-02-08Auto merge of #463 - dengjeffrey:whitelist-binding-panic, r=emiliobors-servo
Added catch_unwind to catch panic at generator Fixes #50 - Adds a `catch_unwind` to catch panic at binding generation. - Prints out a more detailed message that points to the potential misuse of flags, when `generate()` fails. - Added false-by-default `verbose` option flag to specify whether detailed message should be printed for the time being - [x] Ran all test cases - [x] Verified that correct error messages appear when bindings fail to generate - [x] Verified use of verbose flag - [x] Considered changes made by `cargo fmt` r? @emilio
2017-02-08implement Default traitFlier Lu
2017-02-04Removed verbose option flag from builder, and kept it in optionsJeffrey Deng
2017-02-03Run `cargo fmt`Nick Fitzgerald
2017-02-02Added false-by-default verbose option flagJeffrey Deng
2017-01-31Add initial Objective C supportMikko Lehtonen
It parses interfaces and protocol but ignores base classes, and their methods which don’t have arguments, the method signature is currently ignored. Also you can pass objc class instances to C functions. Next steps are inheritance/base classes, method signatures, properties, categories. Then check with system headers what is missing.
2017-01-26ir: Allow whitelisting non-recursivelyv0.20.3Emilio Cobos Álvarez
Fixes #429
2017-01-26codegen: Add an option to skip comment generation.Emilio Cobos Álvarez
This is mostly a work around https://github.com/servo/rust-bindgen/issues/426, until we implement the proper fix.
2017-01-24Auto merge of #437 - emilio:constify-all-enums, r=fitzgenbors-servo
codegen: Respect original repr for bitfield-like enums, add a constifying variant. r? @fitzgen Fixes #430
2017-01-24Honor and expose the derive_debug option.Emilio Cobos Álvarez
Fixes #432
2017-01-24codegen: Respect original repr for bitfield-like enums, add a constifying ↵Emilio Cobos Álvarez
variant.
2017-01-23Unify under the `bindgen` name.Emilio Cobos Álvarez
2016-12-09Use a shared workspace for bindgen, libbindgen, and test_expectationsNick Fitzgerald
2016-12-06Add an API to decide what gets generated more granularly.Emilio Cobos Álvarez
2016-11-24Add a new disable-name-namespacing option.Emilio Cobos Álvarez
2016-11-15Add an option to emit our ir for debuggingNick Fitzgerald
Similar to our ability to emit the clang AST, this adds an option to emit our IR for debugging purposes.
2016-11-16Transition to libbindgen sub-crateJeff Waugh
- The root crate is the `bindgen` binary - Rust-ify the test suite, no more subprocesses! - Update Travis config to test both crates