2014-05-11 18:15:55 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2014-06-18 21:10:45 +00:00
|
|
|
[ $# != 0 ] && {
|
|
|
|
echo "Usage: $0"
|
2014-05-11 18:15:55 +00:00
|
|
|
echo
|
2014-06-18 21:10:45 +00:00
|
|
|
echo "Read binary data from standard input and write it as a comma separated"
|
|
|
|
echo "list of hexadecimal byte values to standard ouput. The output is usable"
|
|
|
|
echo "as a C array initializer. It is terminated with a comma so it can be"
|
|
|
|
echo "continued e.g. for zero termination."
|
2014-05-11 18:15:55 +00:00
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
echo "/* Autogenerated with $0 */"
|
|
|
|
od -v -A n -t x1 | sed 's/ *\(..\) */0x\1,/g'
|