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.
This commit is contained in:
@ -1,15 +1,17 @@
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
my $FILENAME = $ARGV[0];
|
||||
my $ARRAYNAME = $ARGV[0];
|
||||
print "static const char $ARRAYNAME\[\] = \"";
|
||||
|
||||
open FILE, $FILENAME or die "Cannot open $FILENAME";
|
||||
|
||||
my $ARRAYNAME = $ARGV[1];
|
||||
print "static const char $ARRAYNAME\[\] =";
|
||||
while (<FILE>) {
|
||||
s@\\@\\\\@g;
|
||||
s@"@\\"@g;
|
||||
chomp ($_);
|
||||
print "\n \"$_\\n\"";
|
||||
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";
|
||||
|
||||
print "\";\n";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user