"zhonghua dai" <[EMAIL PROTECTED]> writes:

> Who can tell me what's the function substdio_feed for?

It refills the buffer for the substdio argument.  It is called when
one of the input routines is called when there is no data left in the
buffer.

It's a bit confusing at first glance because DJB is using the n field
as both an offset to the bytes remaining in the buffer and to indicate
the size of the buffer.  In substdio_feed, if s->p is 0, then s->n
holds the size of the buffer.  This double duty is why the byte_copyr
is required at the end of substdio_feed, to ensure that the condition
will hold the next time substdio_feed is called.

Ian

Reply via email to