C to Lua data wrapper generator

Latest on Hackage:0.3

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow to host generated Haddocks.

BSD3 licensed by Tom Schouten
Maintained by
Gather C structs tagged with __attribute__((__packed__)) and enum
definitions into a Lua data structure. This allows conversion between
binary blobs and Lua tables using functions parse-bin.lua provides,
useful for C applications with an embedded Lua interpreter.

This tool is a thin wrapper around the awesome Language.C library:


( Instructions for Debian )

# Optionally add ~/.cabal/bin to your search path. This is where
# cabal will install Haskell binaries, including the updated version
# of cabal itself.

apt-get install cabal-install haskell-platform
cabal update
cabal install cabal-install
cabal install pretty-show
cabal install happy
cabal install language-c

tar xf packed_lua.tar.gz
cd packed_lua

# The 2 commands below also appear in the Makefile.

cabal configure
cabal build

# At this point the binary will be in the local directory:
# dist/build/packed-lua/packed-lua
# Optionally install it to ~/.cabal/bin using:

cabal install


Provide the (possibly prepocessed) C file as a first argument and
gather the Lua output on stdout, i.e:

packed_lua structs.c >sym.lua

comments powered byDisqus