chiark / gitweb /
base64 encoder
[disorder] / scripts / text2c
... / ...
CommitLineData
1#! /usr/bin/perl -w
2my $class = "static";
3if($ARGV[0] eq '-extern') {
4 $class = "";
5 shift;
6}
7my $name = shift;
8push(@out, "/* autogenerated file, do not edit */\n\n");
9push(@out, "$class const char $name\[] = \n");
10while(<>) {
11 next if /arch-tag/;
12 s/[\\\"\?]/\\$&/g;
13 s/\n/\\n/g;
14 push(@out, " \"$_\"\n");
15}
16push(@out, ";\n");
17((print @out)
18 and (close STDOUT))
19 or die "$0: stdout: $!\n";