gtk2/gdk/broadway/toarray.pl
Alexander Larsson 149b3af105 broadway: Use zlib compression for broadway buffers
This imports the MIT licensed js unzip from:
https://github.com/imaya/zlib.js

and uses it to decompress in js on the client side.
2013-11-07 14:09:53 +01:00

18 lines
374 B
Perl
Executable File

#!/usr/bin/perl -w
my $ARRAYNAME = $ARGV[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) {
printf ("\\x%02x", ord ($c));
}
}
}
print "\";\n";