Tomato 1.28
[tomato.git] / release / src / router / openssl / util / err-ins.pl
blob31b70df8d0e28e329bbb1b15ae69a6337ee357c3
1 #!/usr/local/bin/perl
3 # tack error codes onto the end of a file
6 open(ERR,$ARGV[0]) || die "unable to open error file '$ARGV[0]':$!\n";
7 @err=<ERR>;
8 close(ERR);
10 open(IN,$ARGV[1]) || die "unable to open header file '$ARGV[1]':$!\n";
12 @out="";
13 while (<IN>)
15 push(@out,$_);
16 last if /BEGIN ERROR CODES/;
18 close(IN);
20 open(OUT,">$ARGV[1]") || die "unable to open header file '$ARGV[1]':$1\n";
21 print OUT @out;
22 print OUT @err;
23 print OUT <<"EOF";
25 #ifdef __cplusplus
27 #endif
28 #endif
30 EOF
31 close(OUT);