mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-14 20:51:07 +00:00
25 lines
503 B
Perl
Executable File
25 lines
503 B
Perl
Executable File
#!/usr/bin/env perl
|
|
|
|
use warnings;
|
|
|
|
my $ARRAYNAME = $ARGV[0];
|
|
my $first = 0;
|
|
print "static const char $ARRAYNAME\[\] = {";
|
|
|
|
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) {
|
|
if ($first == 1) {
|
|
printf (",\n");
|
|
}
|
|
printf ("0x%02x", ord ($c));
|
|
$first = 1;
|
|
}
|
|
}
|
|
}
|
|
|
|
print "};\n";
|
|
|