backup: Wire up qemu full pull backup commands over QMP
[libvirt/ericb.git] / build-aux / prohibit-duplicate-header.pl
blob4a2ea656650373a842c14562d5fb70a751c5691d
1 #!/usr/bin/env perl
3 use strict;
5 my $file = " ";
6 my $ret = 0;
7 my %includes = ( );
8 my $lineno = 0;
10 while (<>) {
11 if (not $file eq $ARGV) {
12 %includes = ( );
13 $file = $ARGV;
14 $lineno = 0;
16 $lineno++;
17 if (/^# *include *[<"]([^>"]*\.h)[">]/) {
18 $includes{$1}++;
19 if ($includes{$1} == 2) {
20 $ret = 1;
21 print STDERR "$ARGV:$lineno: $_";
22 print STDERR "Do not include a header more than once per file\n";
26 exit $ret;