Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/megastep/bin2c
Convert binary files to C arrays for easy inclusion with your code.
https://github.com/megastep/bin2c
binary c
Last synced: about 2 months ago
JSON representation
Convert binary files to C arrays for easy inclusion with your code.
- Host: GitHub
- URL: https://github.com/megastep/bin2c
- Owner: megastep
- Created: 2013-10-21T23:41:04.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2020-02-27T13:37:44.000Z (almost 5 years ago)
- Last Synced: 2024-05-02T01:12:25.902Z (8 months ago)
- Topics: binary, c
- Language: C
- Size: 17.6 KB
- Stars: 25
- Watchers: 3
- Forks: 44
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
bin2c
=====Convert binary files to C arrays for easy inclusion within your existing code.
It sometimes makes sense to bypass the entire management of binary resources, especially for smaller or more sensitive data files.
The data becomes available as a single array (or optionally as a NSString) that can be parsed in memory any way you like.Building
========The project was created in Xcode 5 on Mac OS X but the C file should compile on pretty much any system with an ANSI C compiler.
It's also known to work on Gentoo with gcc 5.4.0.Usage
=====`bin2c [-i inputfile] [-o output.h] [-l line_len] [-t type] [-hs0] -a array_name`
-h: show a brief help message
-s: prepend the 'static' keyword to the generated variables
-0: when -t char, add a null-char at the end of the arrayIf no output file is specified, the C array will be sent on the standard output. Likewise, if no input file is given, data is read from the standard input.
- `array_name` is used to specify the name of the variable.
- `line_len` specifies how many bytes to put per line in the output (default 80).
- `type` can be either `char` (default, C array of unsigned char), or `nsstring` (Objective-C `NSString` object).License
=======Very liberal - do as you wish with it! Pull requests welcome.
Author
======Stephane Peter
Catloaf Software, LLChttp://github.com/megastep
http://www.catloafsoft.com/