set -e
bindgen \
bindgen/wrapper.h \
-o src/bindings.rs \
--no-doc-comments \
--no-rustfmt-bindings \
--no-derive-debug \
--no-include-path-detection \
--default-enum-style moduleconsts \
--enable-function-attribute-detection \
--allowlist-function ".*?bt_.*" \
--allowlist-function "ctf_metadata_.*" \
--allowlist-function "ctf_msg_iter_.*" \
--allowlist-function "g_string_new" \
--allowlist-type ".*?bt_.*" \
--allowlist-type "ctf_metadata_.*" \
--allowlist-type "ctf_msg_iter_.*" \
--allowlist-var ".*?bt_.*" \
--allowlist-var "ctf_metadata_.*" \
--allowlist-var "ctf_msg_iter_.*" \
--no-copy "bt_plugin.*" \
--opaque-type FILE \
--blocklist-type FILE \
--raw-line "use libc::FILE;" \
--raw-line "pub use libc::size_t;" \
-- "$@"
rustfmt src/bindings.rs
exit 0