Shell: readline() API function
This issue requires #13 to be implemented.
Introduce a readline()
function for user interaction from within a shell command.
The footprint of the function should probably look like
unsigned int readline(BaseSequentialStream* stream, char* buffer, size_t n, char* prompt);
Where stream
is the input stream (known by the individual shell commands via argument), buffer
is a buffer to store the input to with maximum size n
and prompt
is an optional prompt string (may be NULL
).
The function shall read characters until a newline character is detected and return the number of characters read (equal to strlen(buffer)
).
The exact behavior of the function in case the user input exceeds n
needs yet to be defined.