#!/usr/bin/perl

open INF, "<$ARGV[0]";

my $name = $ARGV[0];

if($ARGV[1] eq "-v")
{
    $name = $ARGV[2];
}
else
{
    # Use the input file name but fix some stuff
    $name =~ s/[.\/ ]/_/g;
}

seek INF, 0, 2;
my $sz = tell INF;
seek INF, 0, 0;

$sz++;

print "char $name\[$sz\] = ";

while(<INF>) {
    chomp;
    s/\\/\\\\/g;
    s/"/\\"/g;
    print "\"$_\\n\"\n";
}
print ";\n";
