1 .\"----------------------------------------------------------------------------
2 .\" "THE BEER-WARE LICENSE" (Revision 42):
3 .\" <phk@FreeBSD.org> wrote this file. As long as you retain this notice, you
4 .\" can do whatever you want with this file. If we meet some day, and you think
5 .\" this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
6 .\" ---------------------------------------------------------------------------
15 .Nd convert file to c-source
23 utility reads a file from stdin and writes it to stdout, converting each
24 byte to its decimal representation on the fly.
28 is present, it is printed before the data; if the second
30 is present, it is printed after the data.
32 This program is used to embed binary or other files into C source files,
33 for instance as a char[].
36 .Bd -literal -offset indent
37 date | file2c 'const char date[] = {' ',0};'
41 .Bd -literal -offset indent
43 83,97,116,32,74,97,110,32,50,56,32,49,54,58,50,56,58,48,53,
44 32,80,83,84,32,49,57,57,53,10