/scripts/bin2c.c
/* * Unloved program to convert a binary on stdin to a C include on stdout * * Jan 1999 Matt Mackall < mpm@selenic.com > * * This software may be used and distributed according to the terms * of the GNU General Public License, incorporated herein by reference. */ /* *此函数用于将一个二进制文件转化为一个C字符串数组,如可将图像文件转化为一个字符数组形式 *运行例子如下: *cat bin2c | ./bin2c test *将得到如下结果: *const char test[] = "/x7f/x45/x4c/x46/x01/x01/x01/x00/x00/x00/x00/x00/x00/x00/x00/x00" "/x02/x00/x03/x00/x01/x00/x00/x00/x50/x83/x04/x08/x34/x00/x00/x00" "/xa8/x09/x00/x00/x00/x00/x00/x00/x34/x00/x20/x00/x08/x00/x28/x00" "/x1e/x00/x1b/x00/x06