Module Name: othersrc Committed By: agc Date: Mon Jan 21 07:30:48 UTC 2019
Added Files: othersrc/external/bsd/file2c: Makefile file2c.1 file2c.sh Log Message: Add a new utility called file2c(1) to othersrc, which converts its input stream into individual bytes, suitable for inclusion as a C source file. This kind of utility is occasionally useful for embedding data in C-derived libraries and executables. The utility is similar in function, and arguments, to the utility written in C, and included in FreeBSD. This version of the utility just uses awk(1), and so is written as a simple shell script. Example usage: % echo 'Hello world' | file2c -sx 'static const char *text = {\n' '};\n' static const char *text = { 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0xa }; % To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 othersrc/external/bsd/file2c/Makefile \ othersrc/external/bsd/file2c/file2c.1 \ othersrc/external/bsd/file2c/file2c.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.