Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/acristoffers/very-simple-resource-dumper

Creates a .c and .h files to embed resource files into the executable
https://github.com/acristoffers/very-simple-resource-dumper

Last synced: about 2 months ago
JSON representation

Creates a .c and .h files to embed resource files into the executable

Awesome Lists containing this project

README

        

Very Simple Resource Dumper
===========================

Dumps one .c and one .h files that can be used to compile resources into the binary executable.

It has a very simple api. Only one method:

const char* getResource(const char* resource, unsigned long long *size);

Generate the .h file with:

vsrd --header -o file_name.h

generate the .c file with

vsrd input.crs -o output.c

Include the .h and compile/link with the .c to use the files like:

unsigned long long resSize;
const char* logo = getResource("/imgs/logo.png", &resSize);
// use logo

The file describing the resources for this could look like:

! /imgs ;
@ logo.png : path_to_file_in_disk/logo_file_name.png ;

See the test folder for more info.

The tool recurser.py can be used to traverse a directory
The tool is meant to be called, without arguments, from the root the directory containing the resources
It will generate a resources.src file containing all the files in all subdirectories using relative paths