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.
Merged Sourcehut build manifest
Write experimental Sourcehut build manifest (untested)
Ensure build under Stable Debian on Sourceforge, and any other minor fixup
Merged default down into develop
Merged rel/1 (1.3.0) into default
Added tag raw2c-1.3.0 for changeset 824a2ca0c245
Fix author name and copyright year
Merged develop into rel/1
Merged branch f/201804-compiler-warnings at revision 9698aed20a1f into develop
Remove apparently unfinished code because of unused variable "outputIsDir"
Resolve "maybe uninitialized" header
Fix some compiler warnings
Merged in i/1 (pull request #1)
bcd419d97c3e — David Duncan Ross Palmer i/1 3 years ago
65535 is the threshold
eaed55deaa23 — David Duncan Ross Palmer 3 years ago
English correction
2cf415d5410b — David Duncan Ross Palmer 3 years ago
Type checks, remove warnings
94b46b36946e — David Duncan Ross Palmer 3 years ago
Pass actual stats to fileSizeWarning
c94dbc4a9f4c — David Duncan Ross Palmer 3 years ago
Warn about files over 64KB
9250617205fc — David Duncan Ross Palmer 3 years ago
Create branch to address issue #1
Merged debian packaging
Merged default down into develop
Merged 1.2.2-1 tag into default
Added tag raw2c-1.2.2-1 for changeset 46266b39e4a8
Merged debian packaging
Switch to using regular C exit codes, rather than false for failure
Start abstracting file handles and directory handles.
Added binary assets for recursion; larger data set testing
Merged default down into develop
Merged rel/1 to default (1.2.2)

heads

default
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