#!/usr/bin/env bash

set -eu

cd $(dirname $0)

(
    sed -e '/automatically generated by rust-bindgen/,$d' src/bindings.rs
    bindgen                                     \
        --with-derive-default                   \
        --no-prepend-enum-name                  \
        wrapper.h
) > new-bindings.rs~

mv new-bindings.rs~ src/bindings.rs
