#! /usr/bin/perl
# flaneth - flash and ethernet - dartboard mod
# version 0.1 date 2008-11-09
# Copyright (C) 2007-2008 Stefan Schuermans <stefan@schuermans.info>
# Copyleft: GNU public license V2 - http://www.gnu.org/copyleft/gpl.html
# a BlinkenArea project - http://www.blinkenarea.org/
use strict;
my $VERSION="version 0.1 date 2008-11-09";
die( "usage: $0 <http_dir> <http_content.inc>\n" ) if( @ARGV < 2 );
my $dir = @ARGV[0];
my $output = @ARGV[1];
# maximum
# usage: $m = max( $a, $b )
sub max
{
my $a = shift;
my $b = shift;
return $a > $b ? $a : $b;
}
# convert a character to a string
# usage: $txt = chr2str( $ascii_code, $cnt )
sub chr2str
{
my $ascii_code = shift;
my $cnt = shift;
my $txt = "";
for( ; $cnt > 0; $cnt-- ) {
$txt .= pack( "C", $ascii_code );
}
return $txt;
}
# c string escaping