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:
Alexander Larsson
2013-11-07 13:54:54 +01:00
parent 5ef114ba42
commit 149b3af105
5 changed files with 58 additions and 35 deletions

View File

@ -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";