1#!/usr/bin/perl -w
2use strict;
3our $needed=0;
4our $speclineoffset=0;
5our $specfile;
6while (<>) {
7    if (m/^\# (\d+) \"(.*)\"$/) {
8        $speclineoffset = $1 - $. -1;
9        $specfile = $2;
10    }
11    my $file = defined($specfile) ? $specfile : $ARGV;
12    my $line = $speclineoffset + $.;
13    if (m/libxl_asyncop_how[^;]/) {
14        $needed=1;
15    }
16    if (m/LIBXL_EXTERNAL_CALLERS_ONLY/) {
17        $needed=0;
18    }
19    next unless $needed;
20    if (m/\;/) {
21        die "$file:$line:missing LIBXL_EXTERNAL_CALLERS_ONLY";
22    }
23}
24