lq-text: LQU_StealReadLineBuffer

API char * LQU_StealReadLineBuffer ()

Purpose

Returns the internal line buffer used by LQU_f­Read­Line, and also causes LQU_f­Read­Line to allocate a new buffer the next time it is called. In this way, you can read lines with LQU_f­Read­Line, and save any that you are interested in keeping by calling LQU_Steal­Read­Line­Buffer, without having to copy the data.

The buffer returned may be longer than necessary to contain the line that was last stored there by LQU_f­Read­Line by up to LQT_READLINE_SLOP bytes; use erealloc to shrink it if desired. The LQT_READLINE_SLOP constant is defined in freadln.c as 30 bytes.

Returns

a pointer to the buffer, or NULL if there isn't one yet.