This utility converts a binary file (or any file) into C code for inclusion into the source code of a program. Useful for embedding sounds or resources such as license information.
5e39b1e5cfc3 — Duncan Ross Palmer develop tip 1 year, 24 days ago
Merged Sourcehut build manifest
Write experimental Sourcehut build manifest (untested)
954192af8fb8 — Duncan Ross Palmer 1 year, 24 days ago
Ensure build under Stable Debian on Sourceforge, and any other minor fixup
db560d93d6a6 — Duncan Ross Palmer 2 years ago
Merged default down into develop
a4ab5a089968 — Duncan Ross Palmer default 2 years ago
Merged rel/1 (1.3.0) into default
76c8ba2db535 — Duncan Ross Palmer rel/1 2 years ago
Added tag raw2c-1.3.0 for changeset 824a2ca0c245
824a2ca0c245 — Duncan Ross Palmer raw2c-1.3.0 2 years ago
Fix author name and copyright year
ebf1ce917cdb — Duncan Ross Palmer 2 years ago
Merged develop into rel/1
0d77e7a6ad0e — Duncan Ross Palmer 2 years ago
Merged branch f/201804-compiler-warnings at revision 9698aed20a1f into develop

heads

tip
browse log
raw2c-1.3.0
browse .tar.gz

clone

read-only
https://hg.sr.ht/~m6kvm/raw2c
read/write
ssh://hg@hg.sr.ht/~m6kvm/raw2c
raw2c
Copyright (c) 2018, Duncan Ross Palmer (2E0EOL) and others,
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright notice,
      this list of conditions and the following disclaimer.

    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.

    * Neither the name of the Daybo Logic nor the names of its contributors
      may be used to endorse or promote products derived from this software
      without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

The raw2c program takes an image or other binary data file for input,
and generates ISO compliant C code and an optional header file for
inclusion with C code.

This utility is for small files only.  If you want to include large
resources with your program, you should consider RTTB (Run-Time TarBall),
which is available from https://bitbucket.org/2E0EOL/rttb

raw2c has been ported to the major operating systems, source code
is best for UNIX or UNIX based systems such as GNU.  For DOS or Win32,
prebuilt binaries are available from our website.  Our website will keep
the latest copies of the source too.  Please visit:
http://www.daybologic.co.uk/dev/raw2c/
to keep this tool up to date.

You can also retrieve the program from:
https://bitbucket.org/2E0EOL/raw2c/

SYNOPSIS:

$ raw2c --header=output.h input.bin output.c
  |              |        |         |
  |              |        |         \------------------- Generated C file
  |              |        |
  |              |        \----------------------------- Your binary
  |              |
  |              \-------------------------------------- Optional header
  |
  \----------------------------------------------------- Program

Program = The name of the program, raw2c or ./raw2c

--header
	Specify an optional header file, which will be populated with
	extern references to the symbols used (recommended).

input.bin
	Any binary or text file to read.

output.c
	The generated C file.

You can also specify -n to NULL terminate the data.

See COPYING for license terms and conditions.

Compiling DayboDep
==================
$ make check
$ sudp make install