#!/usr/bin/perl
#
# $Id: encapsulate.pl,v 1.1 2003/07/06 22:42:15 nygren Exp $
#

my $infile = $ARGV[0] or die "Usage: $0 infile structname";
my $structname = $ARGV[1] or die "Usage: $0 infile structname";;
open INF, "<$infile" or die "Unable to open $infile";

print "/* This file was autogenerated from $infile.  DO NOT EDIT !!!! */\n\n";
print "char *$structname = \n";
for my $x (<INF>) {
    chomp $x;
    $x =~ s/\\/\\\\/g;
    $x =~ s/"/\\"/g;
    print qq(   "$x\\n"\n);
}
print "   ;\n";

close INF;
