Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / usr.bin / file2c / file2c.1
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 .\" ---------------------------------------------------------------------------
7 .\"
8 .\" $FreeBSD: src/usr.bin/file2c/file2c.1,v 1.6.2.4 2001/08/16 13:16:48 ru Exp $
9 .\" $DragonFly: src/usr.bin/file2c/file2c.1,v 1.2 2003/06/17 04:29:26 dillon Exp $
10 .\"
11 .Dd January 28, 1995
12 .Dt FILE2C 1
13 .Os
14 .Sh NAME
15 .Nm file2c
16 .Nd convert file to c-source
17 .Sh SYNOPSIS
18 .Nm
19 .Op "string"
20 .Op "string"
21 .Sh DESCRIPTION
22 The
23 .Nm
24 utility reads a file from stdin and writes it to stdout, converting each
25 byte to its decimal representation on the fly.
26 .Pp
27 If the first
28 .Op string
29 is present, it is printed before the data; if the second
30 .Op string
31 is present, it is printed after the data.
32 .Pp
33 This program is used to embed binary or other files into C source files,
34 for instance as a char[].
35 .Sh EXAMPLES
36 The command:
37 .Bd -literal -offset indent
38 date | file2c 'const char date[] = {' ',0};'
39 .Ed
40 .Pp
41 will produce:
42 .Bd -literal -offset indent
43 const char date[] = {
44 83,97,116,32,74,97,110,32,50,56,32,49,54,58,50,56,58,48,53,
45 32,80,83,84,32,49,57,57,53,10
46 ,0};
47 .Ed