lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Wow, it's been a while. Got distracted by various things, but now beta 2
is here. Comments, criticisms, bug reports, feature requests, and
patches are welcome.

	What is it?
A library for packing and unpacking binary data, not unlike lhf's lpack
or Roberto's struct library.

	What's changed since beta 1?
- IEEE 754 floating point support added, thanks to Peter Cawley (Corsix)
<lua@corsix.org> - floats and doubles (but not quads) are supported.
- Counted string support added (strings prefixed with their length as a
uint).
- Fixed a bug in the m format causing potential data loss with bitmasks
wider than 6 bytes
- Added some stuff to the documentation.

	Why use it?
- read and write support for signed and unsigned integers, fixed point
rationals, fixed-length, counted, null-terminated and null-padded
strings, skipping and padding, booleans, and bitmasks
- unpack/pack from/to strings, files, or anything that supports
file-like :read, :write (and optionally :seek) operations
- any type can be any byte-aligned width - 24-bit integers? booleans
stored as uint32_ts? 128-bit masks? No problem.
- supports naming, grouping and repetition of fields (and groups, nested
arbitrarily deep). You can specify the structure of the data in the
format string and get back a table with conveniently named fields (and
possibly subtables); and then you can unpack an array of 10,000 of them
just by putting "* 10000" on the end.
- written entirely in Lua, and thus very portable and easy to extend.

	Why NOT use it?
- written entirely in Lua, and thus slower and more memory-hungry than C
equivalents
- no support for bit-aligned fields (yet - planned for 1.1)

	What's planned for beta 3?
- Fixes for any bugs reported in beta 2

	What's planned for 1.1?
- Bit-aligned field support, for those of you who want to unpack TCP
headers with it :)

	Where is it?
The beta 2 package can be found in tar.bz2 format here:
    http://www.funkyhorror.net/toxicfrog/projects/vstruct-1.0b2.tar.bz2
The project is also available via public read-only git repository:
    git://orias.homeip.net/ben/lua/struct.git
This release is available from that repository from tag "v1.0b2actual".

Documentation and credits are in the README. Put it someplace in your
LUA_PATH which looks for "?/init.lua".

Enjoy.
	Ben Kelly