Filter

Allow/Block

  • kinds
    • file
    • function
    • type
    • var
    • item
  • allowlist_*
    • recursively
  • blocklist_*

CodegenConfig

  • with_codegen_config
    • functions
      • ignore_functions
    • types
    • vars
    • methods
      • ignore_methods
    • constructors
    • destructors

Examples

extern crate bindgen;
bindgen::builder()
    .header_contents("wrapper.h", "#include <time.h>")
    .allowlist_function("time");
/* automatically generated by rust-bindgen 0.69.4 */

pub type time_t = ::std::os::raw::c_long;
extern "C" {
    pub fn time(arg1: *mut time_t) -> time_t;
}

extern crate bindgen;
bindgen::builder()
    .header_contents("wrapper.h", "#include <getopt.h>")
    .with_codegen_config(bindgen::CodegenConfig::VARS);
/* automatically generated by rust-bindgen 0.69.4 */

pub const no_argument: u32 = 0;
pub const required_argument: u32 = 1;
pub const optional_argument: u32 = 2;
extern "C" {
    pub static mut optarg: *mut ::std::os::raw::c_char;
}
extern "C" {
    pub static mut optind: ::std::os::raw::c_int;
}
extern "C" {
    pub static mut opterr: ::std::os::raw::c_int;
}
extern "C" {
    pub static mut optopt: ::std::os::raw::c_int;
}
extern "C" {
    pub static mut optreset: ::std::os::raw::c_int;
}

References