clua: C to Lua data wrapper generator

[ bsd3, language, program ] [ Propose Tags ] [ Report a vulnerability ]

Gather enums and packed struct definitions from a C file and generate a Lua table that can be used in conjunction with parse-bin.lua to convert between Lua tables and binary data.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1, 0.2, 0.3
Dependencies base (<5), bytestring, containers, haskell98, language-c, pretty, pretty-show [details]
License BSD-3-Clause
Author Tom Schouten
Maintainer tom@zwizwa.be
Category Language
Home page http://zwizwa.be/-/meta
Uploaded by TomSchouten at 2012-01-25T13:35:09Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Executables clua
Downloads 2584 total (9 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2016-12-25 [all 8 reports]

Readme for clua-0.1

[back to package description]
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:
http://hackage.haskell.org/package/language-c


BUILD

( 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



USAGE

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