#! /bin/sh

#================================================================
# objtoc
# dump binary data as C source code
#================================================================


# set variables
LANG=C ; export LANG
LC_ALL=C ; export LC_ALL
PATH="$PATH:/usr/local/bin:.:.." ; export PATH
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib:.:..:../.." ; export LD_LIBRARY_PATH

# dump data
cat |
od -A n -v -t x1 |
sed -e '1 i\
const unsigned char myobj[] = {
s/\([0-9a-f][0-9a-f]\) */0x\1,/g
$ s/,$//
$ a\
};
/^ / s/^/ /
'


# exit normally
exit 0



# END OF FILE
