GitXplorerGitXplorer
e

datapack

public
3 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
93ef38db21ddd6fcc5f2fb974c12f45f6233b2f0

short documentation about samples

eext committed 11 years ago
Unverified
a4523e65c7b5ee83898898c1050b8ffc3fbcaad5

build: easier rule for deps

eext committed 11 years ago
Unverified
ea008e31b9d206fb031bbf92b3fd1fe819f83bec

build: need subdir-objects

eext committed 11 years ago
Unverified
863f6ecb234b53fe475d0a43d0c7fe419e4a31d4

build: include pak.h in dist

eext committed 11 years ago
Unverified
7a8e20069c3b3789b5dc2fa2a7985109be9c1b9f

pack: remove debug print

eext committed 11 years ago
Unverified
ce52e51461f27920c587d3d6299e8055a2a0bf2f

fix tests

eext committed 11 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.