Skip to content

Add ignore_methods to bindgen #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 13, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/bin/bindgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ fn parse_args(args: &[String]) -> ParseResult {
options.ignore_functions = true;
ix += 1;
}
"-ignore-methods" => {
options.ignore_methods = true;
ix += 1;
}
"-no-bitfield-methods" => {
options.gen_bitfield_methods = false;
ix += 1;
Expand Down
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ pub struct BindgenOptions {
pub links: Vec<(String, LinkType)>,
pub emit_ast: bool,
pub ignore_functions: bool,
pub ignore_methods: bool,
pub gen_bitfield_methods: bool,
pub fail_on_unknown_type: bool,
pub enable_cxx_namespaces: bool,
Expand Down Expand Up @@ -190,6 +191,7 @@ impl Default for BindgenOptions {
links: vec![],
emit_ast: false,
ignore_functions: false,
ignore_methods: false,
gen_bitfield_methods: true,
fail_on_unknown_type: true,
rename_types: true,
Expand Down Expand Up @@ -322,6 +324,7 @@ fn parse_headers(options: &BindgenOptions, logger: &Logger) -> Result<ModuleMap,
class_constants: options.class_constants,
namespaced_constants: options.namespaced_constants,
ignore_functions: options.ignore_functions,
ignore_methods: options.ignore_methods,
fail_on_unknown_type: options.fail_on_unknown_type,
enable_cxx_namespaces: options.enable_cxx_namespaces,
override_enum_ty: str_to_ikind(&options.override_enum_ty),
Expand Down
3 changes: 2 additions & 1 deletion src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pub struct ClangParserOptions {
pub emit_ast: bool,
pub fail_on_unknown_type: bool,
pub ignore_functions: bool,
pub ignore_methods: bool,
pub enable_cxx_namespaces: bool,
pub class_constants: bool,
pub namespaced_constants: bool,
Expand Down Expand Up @@ -1023,7 +1024,7 @@ fn visit_composite(cursor: &Cursor, parent: &Cursor,
vi.is_static = cursor.method_is_static();
vi.is_const = cursor.cur_type().is_const();

if ctx.options.ignore_functions {
if ctx.options.ignore_methods {
return CXChildVisit_Continue;
}

Expand Down