[BACK]Return to file2c.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / file2c

Annotation of src/usr.bin/file2c/file2c.1, Revision 1.5

1.1       downsj      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: .\"
1.5     ! aaron       8: .\" $Id: file2c.1,v 1.4 1999/06/05 01:21:24 aaron Exp $
1.1       downsj      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
                     22: .Nm file2c
                     23: utility reads a file from stdin and writes it to stdout, converting each
                     24: byte to its decimal representation on the fly.
                     25: .Pp
1.4       aaron      26: If the first
                     27: .Op string
                     28: is present, it is printed before the data. If the second
1.1       downsj     29: .Op string
                     30: is present, it is printed after the data.
                     31: .Pp
1.2       aaron      32: This program is used to embed binary or other files into C source files,
1.1       downsj     33: for instance as a char[].
                     34: .Sh EXAMPLE
                     35: The command:
                     36: .Bd -literal -offset indent
                     37: date | file2c 'const char date[] = {' ',0};'
                     38: .Ed
                     39: .Pp
                     40: will produce:
                     41: .Bd -literal -offset indent
                     42: const char date[] = {
                     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
                     45: ,0};
                     46: .Ed
                     47:
                     48: