Annotation of src/usr.bin/file2c/file2c.1, Revision 1.9
1.9 ! mpech 1: .\" $OpenBSD: file2c.1,v 1.8 2001/01/29 01:57:58 niklas Exp $
1.1 downsj 2: .\"----------------------------------------------------------------------------
3: .\" "THE BEER-WARE LICENSE" (Revision 42):
4: .\" <phk@freebsd.org> wrote this file. As long as you retain this notice, you
5: .\" can do whatever you want with this file. If we meet some day, and you think
6: .\" this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
7: .\" ---------------------------------------------------------------------------
8: .\"
9: .\"
1.5 aaron 10: .Dd January 28, 1995
1.1 downsj 11: .Dt FILE2C 1
12: .Os
13: .Sh NAME
14: .Nm file2c
1.3 aaron 15: .Nd convert file to c-source
1.1 downsj 16: .Sh SYNOPSIS
17: .Nm file2c
1.2 aaron 18: .Op Ar string
19: .Op Ar string
1.1 downsj 20: .Sh DESCRIPTION
21: The
1.6 aaron 22: .Nm
1.7 aaron 23: utility reads a file from the standard input and writes it to the standard
24: output, converting each
1.1 downsj 25: byte to its decimal representation on the fly.
26: .Pp
1.4 aaron 27: If the first
1.7 aaron 28: .Ar string
29: is present, it is printed before the data.
30: If the second
31: .Ar string
1.1 downsj 32: is present, it is printed after the data.
33: .Pp
1.2 aaron 34: This program is used to embed binary or other files into C source files,
1.7 aaron 35: for instance as a
36: .Li char[] .
37: .Sh EXAMPLES
1.1 downsj 38: The command:
39: .Bd -literal -offset indent
1.9 ! mpech 40: $ date | file2c 'const char date[] = {' ',0};'
1.1 downsj 41: .Ed
42: .Pp
43: will produce:
44: .Bd -literal -offset indent
45: const char date[] = {
46: 83,97,116,32,74,97,110,32,50,56,32,49,54,58,50,56,58,48,53,
47: 32,80,83,84,32,49,57,57,53,10
48: ,0};
49: .Ed
1.7 aaron 50: .Sh SEE ALSO
51: .Xr hexdump 1 ,
52: .Xr od 1