lua-users home
lua-l archive

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



Am 14.12.2012 um 13:20 schrieb Michal Kottman:

On 14 December 2012 12:50, Philipp Kraus <philipp.kraus@flashpixx.de> wrote:
That's nice and seems to be a good trial, but do you know if I can serialize / desialize on the C side?

Some libraries also have C API for serialization, like lua-bins [1], so you can call the serialization from C, not from Lua.


int luabins_save(lua_State * L, int index_from, int index_to);
int luabins_load(lua_State * L, const unsigned char * data, size_t len, int *count);

I have taken a look to luabins, it read the stack element by element, gets the value and convert it into
a byte sequence (uchar). I think I can portage this to my C++ code. 

Thanks for this hint

Phil