lua-users home
lua-l archive

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


Side remark. This thread showed me the existence of a "lzlib" library
for binding zlib with Lua [1].
When I looked at LuaForWindows distribution, it just happens that no
direct usage of zlib was included (there are however gzio and LuaZip).
I am not particularly surprised that  such a binding actually exists ;
 zlib is so common that someone would for sure have done the job.

Anyway.  A weak ago I have written a zlib binding as an example for
our modular book [2]. So I made a little comparison.
The APIs are quite different despite that the exported zlib features
are the same !
My version is much shorter (206 lines compared to 912) but lacks
":read"-like feature. Only ":add" and ":flush" are provided.
BTW, the author should consider replacing syntax like "data =
lua_tostring(L, 2); len = lua_strlen(L, 2); " by "data =
lua_tolstring(L, 2, &len); "

[1] https://github.com/LuaDist/lzlib/blob/master/lzlib.c
[2] http://lua-users.org/lists/lua-l/2011-09/msg00540.html