GitXplorerGitXplorer
e

datapack

public
3 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
cee63e8cc77cf62ac53080e13effea991dcb1e73

Create LICENSE

eext committed 8 years ago
Unverified
22d4a18c1efdf2a5af593ad47114b099d89df169

sudo

eext committed 9 years ago
Unverified
9718f70720bb8c4a451777f4909dafc929d13ba1

update readme with info about deb

eext committed 9 years ago
Unverified
dccdb84ea8220a0760d2228e0702ed726ef7be89

deb target and cleanup

eext committed 9 years ago
Unverified
aae435bc0e0ef61d96514adcd71c842c1b9021c6

pack: additional tests

eext committed 10 years ago
Unverified
b07af5a8ede3d244ec28bec06d37b4aca359b2b5

pack: check for presence of getopt.h

eext committed 10 years ago

README

The README file for this repository.

Simple test of compressing and storing datafiles inside executable or a loadable binary blob.

Features

  • Packs datafiles directly into executable or a binary blob.
  • Compression using zlib.
  • Allows users to override files (must be explicitly enabled.)
  • API to access files in-memory (entire file is loaded into memory.)
  • Supports FILE* for reading/writing (data is streamed).
  • Load files either using a hardcoded handle from a header or using filename.

Usage

  1. Create ando/or edit datafiles
  2. datapacker NAME:FILENAME.. to generate c-file.
  3. Build your app as usual and include generated c-file.
  4. Use unpack or unpack_filename to load the data into memory. unpack uses structure directly. unpack_filename uses a virtual filename to locate the struct.

Install

  1. ./configure
  2. make
  3. make install

Debian/Ubuntu

For apt-based distributions you can generate a .deb for easier installation:

  1. ./configure
  2. sudo make deb
  3. sudo dpkg -i datapack_*.deb

Using with automake

See Makefile.am for real example.

files.c: datapacker Makefile
	$(AM_V_GEN)./datapacker -f ${top_srcdir}/datafiles -s ${top_srcdir} -d $(DEPDIR)/files.data -o files.c -e files.h

-include ./$(DEPDIR)/files.data

where datafiles is a list of files to pack.