lua-users home
lua-l archive

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


string.unpack is a power tool to process the binary data. Sometimes, we use userdata as a string (binary data) buffer. I think if string.unpack support userdata as parameter would be better for this case.

And, if the userdata is a C struct, we can simply use string.unpack to extract the data from the C struct, otherwise we should copy it (by lua_pushlstring) to a string first.