lua-users home
lua-l archive

Re: Best practices for lua_Reader?

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


> Basically what I'm stumbling over is the fact that the callback can be
> called x many times, so I need to keep state. I presume that's what the
> second parameter (void* data) is good for?
Yes.
> My callback offers the complete buffer in the first read, simply because
> it's already in memory and I'm merely telling Lua where to find it.
So why not just use luaL_loadbuffer?
> PS: if you have any sources for more information or even sample
> implementation you can point to, I'd appreciate if you could include those.
Read lauxlib.c and my own ae:
	http://www.lua.org/source/5.2/lauxlib.c.html (at Load functions)
	http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/#ae

AltStyle によって変換されたページ (->オリジナル) /