5 ReadLineAsync( _REG( a0
) AsyncFile
*file
, _REG( a1
) APTR buffer
, _REG( d0
) LONG bufSize
)
9 /* First read any data up to the LF or the buffer is full */
10 if( FGetsLenAsync( file
, buffer
, bufSize
, &len
) )
14 end
= ( ( UBYTE
* ) buffer
) + len
- 1;
20 /* We didn't reach EOF yet */
26 ptr
= ( UBYTE
* ) file
->af_Offset
;
28 if( count
= file
->af_BytesLeft
)
30 /* Scan for LF char in buffer */
31 for( i
= 0; ( i
< count
) && ( *ptr
!= '\n' ); ++i
, ++ptr
)
35 /* If i < count, then the loop above aborted
44 file
->af_BytesLeft
-= i
;
54 if( ReadAsync( file
, &ch
, 1 ) < 1 )
68 /* Overwrite last char with LF */