File: encapsulate.pl

package info (click to toggle)
owl 2.2.2-4
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,208 kB
  • ctags: 3,600
  • sloc: ansic: 36,373; perl: 242; makefile: 93; sh: 43
file content (20 lines) | stat: -rw-r--r-- 509 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/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;