lua-users home
lua-l archive

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


On 1/23/08, Wesley Smith <wesley.hoke@gmail.com> wrote:
Sorry for the quick follow up:

lua_Reader:
"The reader function used by lua_load. Every time it needs another
piece of the chunk, lua_load calls the reader, passing along its data
parameter. The reader must return a pointer to a block of memory with
a new piece of the chunk and set size to the block size. The block
must exist until the reader function is called again. To signal the
end of the chunk, the reader must return NULL. The reader function may
return pieces of any size greater than zero."

What is tripping me up is the the use of the word "block".  I
typically understand block to mean a piece of code like:

do
--stuff
end

Does block here mean something else?  I'm thinking it does, but am
having mental discombobulations right now.
thanks,
wes

In this context a block is just a sequence of bytes.  The reader can "stream" data by breaking it up into multiple blocks, or just return a single block for all of the data.

I don't think you should need to switch to using lua_load to improve your error messages. What exactly are you trying to do?

Max

--
Technical Director
Unknown Worlds Entertainment
http://www.unknownworlds.com