summaryrefslogtreecommitdiffstats
path: root/build-aux/rust-regen.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build-aux/rust-regen.sh')
-rwxr-xr-xbuild-aux/rust-regen.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/build-aux/rust-regen.sh b/build-aux/rust-regen.sh
new file mode 100755
index 0000000..9508199
--- /dev/null
+++ b/build-aux/rust-regen.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+#
+# Copyright (C) 2021-2023 Red Hat, Inc. All rights reserved.
+#
+# Authors: Christine Caulfield <ccaulfie@redhat.com>
+# Fabio M. Di Nitto <fabbione@kronosnet.org>
+#
+# This software licensed under GPL-2.0+
+#
+#
+# Regerate the FFI bindings in src/sys from the current headers
+#
+
+srcheader="$1"
+dstrs="$2"
+filter="$3"
+shift; shift; shift
+
+bindgen \
+ --no-prepend-enum-name \
+ --no-layout-tests \
+ --no-doc-comments \
+ --generate functions,types \
+ --fit-macro-constant-types \
+ --allowlist-var=$filter.* \
+ --allowlist-type=.* \
+ --allowlist-function=.* \
+ $srcheader -o $dstrs "$@"