summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index c28e3168..dabab152 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -188,6 +188,16 @@ impl Builder {
self
}
+ /// Whether to whitelist types recursively or not. Defaults to true.
+ ///
+ /// This can be used to get bindgen to generate _exactly_ the types you want
+ /// in your bindings, and then import other types manually via other means
+ /// (like `raw_line`).
+ pub fn whitelist_recursively(mut self, doit: bool) -> Self {
+ self.options.whitelist_recursively = doit;
+ self
+ }
+
/// Generate a C/C++ file that includes the header and has dummy uses of
/// every type defined in the header.
pub fn dummy_uses<T: Into<String>>(mut self, dummy_uses: T) -> Builder {
@@ -529,6 +539,9 @@ pub struct BindgenOptions {
/// Wether to keep documentation comments in the generated output. See the
/// documentation for more details.
pub generate_comments: bool,
+
+ /// Wether to whitelist types recursively. Defaults to true.
+ pub whitelist_recursively: bool,
}
impl BindgenOptions {
@@ -574,6 +587,7 @@ impl Default for BindgenOptions {
codegen_config: CodegenConfig::all(),
conservative_inline_namespaces: false,
generate_comments: true,
+ whitelist_recursively: true,
}
}
}