We now use bin2h.pl to build stubify.h

committer: mfx <mfx> 968866969 +0000
This commit is contained in:
Markus F.X.J. Oberhumer
2000-09-13 17:42:49 +00:00
parent 9da2c2d087
commit de0f0c92be
5 changed files with 18 additions and 5 deletions
+12
View File
@@ -34,6 +34,9 @@ $ifile = shift || die;
$ident = shift || die;
$ofile = shift || die;
$opt_q = "";
$opt_q = shift if ($#ARGV >= 0);
open(INFILE,$ifile) || die "$ifile\n";
binmode(INFILE);
open(OUTFILE,">$ofile") || die "$ofile\n";
@@ -50,6 +53,7 @@ select(OUTFILE);
$o = $ofile;
$o =~ s/.*[\/\\]//;
if ($opt_q ne "-q") {
print <<"EOF";
/* $o -- created from $ifile, $n bytes
@@ -79,6 +83,7 @@ print <<"EOF";
EOF
}
printf("unsigned char %s[%d] = {", $ident, $n);
for ($i = 0; $i < $n; $i++) {
@@ -89,6 +94,13 @@ for ($i = 0; $i < $n; $i++) {
printf("%3d", ord(substr($data, $i, 1)));
print "," if ($i != $n - 1);
}
while (($i % 16) != 0) {
$i++;
print " ";
}
printf(" /* 0x%4x */", $i - 16);
print "\n};\n";
close(OUTFILE) || die;