2010-11-18 20:26:40 +00:00
|
|
|
#!/usr/bin/perl -w
|
|
|
|
|
2013-11-07 12:54:54 +00:00
|
|
|
my $ARRAYNAME = $ARGV[0];
|
|
|
|
print "static const char $ARRAYNAME\[\] = \"";
|
2010-11-18 20:26:40 +00:00
|
|
|
|
2013-11-07 12:54:54 +00:00
|
|
|
for ($i = 1; $i <= $#ARGV; $i = $i + 1) {
|
|
|
|
my $FILENAME = $ARGV[$i];
|
|
|
|
open FILE, $FILENAME or die "Cannot open $FILENAME";
|
|
|
|
while (my $line = <FILE>) {
|
|
|
|
foreach my $c (split //, $line) {
|
|
|
|
printf ("\\x%02x", ord ($c));
|
|
|
|
}
|
|
|
|
}
|
2010-11-18 20:26:40 +00:00
|
|
|
}
|
2013-11-07 12:54:54 +00:00
|
|
|
|
|
|
|
print "\";\n";
|
|
|
|
|