https://github.com/rxi/cembed
A small utility for embedding files in a C header
https://github.com/rxi/cembed
Last synced: 8 months ago
JSON representation
A small utility for embedding files in a C header
- Host: GitHub
- URL: https://github.com/rxi/cembed
- Owner: rxi
- License: mit
- Created: 2017-11-05T15:22:18.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-04-07T18:49:32.000Z (about 2 years ago)
- Last Synced: 2025-09-28T23:54:08.178Z (9 months ago)
- Language: C
- Size: 4.88 KB
- Stars: 120
- Watchers: 7
- Forks: 13
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-embedded-software - cembed - Small utility for embedding files in a C header. (Uncategorized / Embeddable Scripts and Languages)
README
# cembed
A small utility for embedding files in a C header
```
$ cat test.txt
hello world
$ cat test2.txt
goodbye world
$ cembed -t my_files test.txt test2.txt
static unsigned char test_txt[] = {
104,101,108,108,111,32,119,111,114,108,100,10
};
static unsigned char test2_txt[] = {
103,111,111,100,98,121,101,32,119,111,114,108,100,10
};
static struct { char *filename; unsigned char *data; int size; } my_files[] = {
{ "test.txt", test_txt, (int) sizeof(test_txt) },
{ "test2.txt", test2_txt, (int) sizeof(test2_txt) },
{ 0 }
};
```
## License
This project is free software; you can redistribute it and/or modify it under
the terms of the MIT license. See LICENSE for details.