From e9a11deef01346dc75728f4debefcc694254e5f0 Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Tue, 2 Mar 2021 20:40:10 -0500 Subject: command history in shell --- src/user/include/libterm/readline.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/user/include') diff --git a/src/user/include/libterm/readline.h b/src/user/include/libterm/readline.h index b1d5b0a..fdfb408 100644 --- a/src/user/include/libterm/readline.h +++ b/src/user/include/libterm/readline.h @@ -3,8 +3,14 @@ #include +struct history; + +//returns zero if memory allocation failed or if max_entries was zero or one +struct history *new_history(uint32_t max_entries); + //returns length of string without null terminator //max_length doesn't include null terminator -uint32_t read_line(char *sz, uint32_t max_length, const char *prompt); +//pass null pointer in hist for no history +uint32_t read_line(char *sz, uint32_t max_length, const char *prompt, struct history *hist); #endif \ No newline at end of file -- cgit v1.2.3