5 rizwank 1.1 # Licensed under LGPL
6
7 # no input record separator
8 undef $/;
9
10 foreach $file (@ARGV) {
11 open FILE, $file || die;
12 binmode FILE;
13
14 # munge filename into C variable name
15 $varname = $file;
16 $varname =~ s/\./_/;
17
18 print "const static char name_$varname"."[] = \"$file\";\n";
19 print "const static char file_$varname"."[] = {\n";
20 while (read(FILE, $buffer, 16)) {
21 $buffer =~ s/(.|\n)/'0x' . unpack('H2', $1).', '/ge;
22 print "\t$buffer\n";
23 }
24 close FILE;
25
|