summaryrefslogtreecommitdiff
path: root/src/user/include/libterm/readline.h
diff options
context:
space:
mode:
authorBenji Dial <benji6283@gmail.com>2021-03-02 20:40:10 -0500
committerBenji Dial <benji6283@gmail.com>2021-03-02 20:40:10 -0500
commite9a11deef01346dc75728f4debefcc694254e5f0 (patch)
treea6e0160775178677823385652877f126a69aed49 /src/user/include/libterm/readline.h
parent1d69a46f5d9823bbf2e6211ca367b409d2d5f7a7 (diff)
downloadportland-os-e9a11deef01346dc75728f4debefcc694254e5f0.tar.gz
command history in shell
Diffstat (limited to 'src/user/include/libterm/readline.h')
-rw-r--r--src/user/include/libterm/readline.h8
1 files changed, 7 insertions, 1 deletions
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 <stdint.h>
+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