| OLD | NEW |
| 1 #! /usr/bin/perl | 1 #! /usr/bin/perl |
| 2 | 2 |
| 3 # Copyright (C) 2010-2011 Google Inc. All rights reserved. | 3 # Copyright (C) 2010-2011 Google Inc. All rights reserved. |
| 4 # | 4 # |
| 5 # Redistribution and use in source and binary forms, with or without | 5 # Redistribution and use in source and binary forms, with or without |
| 6 # modification, are permitted provided that the following conditions are | 6 # modification, are permitted provided that the following conditions are |
| 7 # met: | 7 # met: |
| 8 # | 8 # |
| 9 # # Redistributions of source code must retain the above copyright | 9 # # Redistributions of source code must retain the above copyright |
| 10 # notice, this list of conditions and the following disclaimer. | 10 # notice, this list of conditions and the following disclaimer. |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 open($input, '<', $fname) or die "Can't open file for read: $fname $!"; | 36 open($input, '<', $fname) or die "Can't open file for read: $fname $!"; |
| 37 $/ = undef; | 37 $/ = undef; |
| 38 $text = <$input>; | 38 $text = <$input>; |
| 39 close($input); | 39 close($input); |
| 40 | 40 |
| 41 $text = join(', ', map('0x' . unpack("H*", $_), split(undef, $text))); | 41 $text = join(', ', map('0x' . unpack("H*", $_), split(undef, $text))); |
| 42 | 42 |
| 43 open($output, '>', $output) or die "Can't open file for write: $output $!"; | 43 open($output, '>', $output) or die "Can't open file for write: $output $!"; |
| 44 print $output "const unsigned char $varname\[\] = {\n$text\n};\n"; | 44 print $output "const unsigned char $varname\[\] = {\n$text\n};\n"; |
| 45 close($output); | 45 close($output); |
| OLD | NEW |