aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/check-libxl-api-rules
diff options
context:
space:
mode:
Diffstat (limited to 'tools/libxl/check-libxl-api-rules')
-rwxr-xr-xtools/libxl/check-libxl-api-rules23
1 files changed, 23 insertions, 0 deletions
diff --git a/tools/libxl/check-libxl-api-rules b/tools/libxl/check-libxl-api-rules
new file mode 100755
index 0000000000..18ff39ca5f
--- /dev/null
+++ b/tools/libxl/check-libxl-api-rules
@@ -0,0 +1,23 @@
+#!/usr/bin/perl -w
+use strict;
+our $needed=0;
+our $speclineoffset=0;
+our $specfile;
+while (<>) {
+ if (m/^\# (\d+) \"(.*)\"$/) {
+ $speclineoffset = $1 - $. -1;
+ $specfile = $2;
+ }
+ my $file = defined($specfile) ? $specfile : $ARGV;
+ my $line = $speclineoffset + $.;
+ if (m/libxl_asyncop_how[^;]/) {
+ $needed=1;
+ }
+ if (m/LIBXL_EXTERNAL_CALLERS_ONLY/) {
+ $needed=0;
+ }
+ next unless $needed;
+ if (m/\;/) {
+ die "$file:$line:missing LIBXL_EXTERNAL_CALLERS_ONLY";
+ }
+}