lua-users home
lua-l archive

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


>lua_dump is not documented (and I can assume what a ChunkWriter is, but I
>can only hope that I don't interpret it wrong -- well OK I can analyze the
>code, but documentation would be nice).

Sorry about the lack of documentation.
A writer function, of type lua_Chunkwriter, is a function

	int writer (lua_State *L, const void* p, size_t sz, void* ud);

that is supposed to "write" sz byte starting at p. The pointer ud is used
to keep any state that is needed, for instance, a FILE* if you're writing
to a file.

For an example of use, see writer in luac.c or in str_dump in lstrlib.c.
--lhf