version 1.1, 2005/02/21 07:07:13
|
version 1.2, 2005/02/25 08:00:17
|
|
|
#!/usr/bin/perl | #!/usr/bin/perl |
# hexify.pl | # hexify.pl |
# Takes a list of filenames on stdin and create a C data array for each one. | # Takes a list of filenames on stdin and create a C data array for each one. |
# Copyright Dan Kegel 2005 |
# Copyright Dan Kegel, Rizwan Kassim 2005 |
# Licensed under LGPL | # Licensed under LGPL |
| |
# no input record separator | # no input record separator |
|
|
$buffer =~ s/(.|\n)/'0x' . unpack('H2', $1).', '/ge; | $buffer =~ s/(.|\n)/'0x' . unpack('H2', $1).', '/ge; |
print "\t$buffer\n"; | print "\t$buffer\n"; |
} | } |
|
print "const static int size_$varname"." = sizeof(file_$varname);\n"; |
close FILE; | close FILE; |
| |
print "};\n\n"; | print "};\n\n"; |