File: bin2c

package info (click to toggle)
eperl 2.2.16-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 608 kB
  • sloc: ansic: 1,692; perl: 252; makefile: 139; sh: 10
file content (9 lines) | stat: -rwxr-xr-x 251 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
#!/usr/bin/perl
# SPDX-License-Identifier: 0BSD
print "#include \"eperl.h\"\n";
print "const uint8_t ${ARGV[0]}[] = {\n\t";
while(read(STDIN, $_, 1) == 1) {
	print ord.",";
}
print "\n};\n";
print "const size_t ${ARGV[0]}_size = ".(tell STDIN).";\n";