string/string.c
/*
 * Load data until buffer is full, the input blocks or an error occurs.
 */
Load data until buffer is full, the input blocks or an error occurs.
Load data until buffer is full the input blocks or an error occurs .
void
StringBuffer_ffill(StringBuffer* buffer, int fd)
{
	if (StringBuffer_length(buffer) == 0 || StringBuffer_unused(buffer) == 0)
	{
		return;
	}
	size_t nunused;
	size_t nread_total = 0;
	while ((nunused = StringBuffer_unused(buffer)) > 0)
	{
		ssize_t nread = StringBuffer_fdncat(buffer, fd, nunused % READ_SIZE_MAX);
		if (nread > 0)
			nread_total += (size_t)nread;
		else
			break;
	}
	STRING_BUFFER_FDBG(buffer, "total bytes read %zu", nread_total);
}
void StringBuffer_ffill ( StringBuffer * buffer , int fd ) { if ( StringBuffer_length ( buffer ) == 0 || StringBuffer_unused ( buffer ) == 0 ) { return ; } size_t nunused ; size_t nread_total = 0 ; while ( ( nunused = StringBuffer_unused ( buffer ) ) > 0 ) { ssize_t nread = StringBuffer_fdncat ( buffer , fd , nunused % READ_SIZE_MAX ) ; if ( nread > 0 ) nread_total += ( size_t ) nread ; else break ; } STRING_BUFFER_FDBG ( buffer , " " , nread_total ) ; }
Load data until buffer is full, the input blocks or an error occurs.
Load data until buffer is full the input blocks or an error occurs .
//		STRING_BUFFER_WARN(buffer, "buffer full"); /* read until buffer is full */