summaryrefslogtreecommitdiffstats
path: root/build-aux/rust-regen.sh
blob: 9508199fa779a820db9fc125beda3db6ddfa1ca9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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 "$@"