I came accross a small library for converting data to an from C structs for Lua, written by Roberto Ierusalimschy:
http://www.inf.puc-rio.br/~roberto/struct/ I plan to import it and to make it available to both lua(1) and lua(4) as follows: The source code will be imported into ${NETBSDSRCDIR}/sys/external/mit/struct unaltered and then be modified to compile on NetBSD. Then ${NETBSDSRCDIR}/sys/module/luastruct/ and ${NETBSDSRCDIR}/lib/lua/struct/ directories will be added with the respective Makefiles etc.
