summaryrefslogtreecommitdiff
path: root/util/err-ins.pl
blob: 31b70df8d0e28e329bbb1b15ae69a6337ee357c3 (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
29
30
31
32
33
#!/usr/local/bin/perl
#
# tack error codes onto the end of a file
#

open(ERR,$ARGV[0]) || die "unable to open error file '$ARGV[0]':$!\n";
@err=<ERR>;
close(ERR);

open(IN,$ARGV[1]) || die "unable to open header file '$ARGV[1]':$!\n";

@out="";
while (<IN>)
	{
	push(@out,$_);
	last if /BEGIN ERROR CODES/;
	}
close(IN);

open(OUT,">$ARGV[1]") || die "unable to open header file '$ARGV[1]':$1\n";
print OUT @out;
print OUT @err;
print OUT <<"EOF";
 
#ifdef  __cplusplus
}
#endif
#endif

EOF
close(OUT);