summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDenys Vlasenko2011-09-04 16:12:33 +0200
committerDenys Vlasenko2011-09-04 16:12:33 +0200
commitbede215cf105377a1127532d2d710924cb58cc39 (patch)
treed0227961b7eb002cb03653f2e69211e6cf13d598 /include
parent4840ae8a06298e987374fa3cc6d7e4969fd19344 (diff)
downloadbusybox-bede215cf105377a1127532d2d710924cb58cc39.zip
busybox-bede215cf105377a1127532d2d710924cb58cc39.tar.gz
lineedit: add support for history saving on exit
Based on the patch by Dennis Groenen <tj.groenen@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'include')
-rw-r--r--include/libbb.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 63d0419..91343a9 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -1421,6 +1421,12 @@ typedef struct line_input_t {
int cur_history;
int max_history; /* must never be <= 0 */
# if ENABLE_FEATURE_EDITING_SAVEHISTORY
+ /* meaning of this field depends on FEATURE_EDITING_SAVE_ON_EXIT:
+ * if !FEATURE_EDITING_SAVE_ON_EXIT: "how many lines are
+ * in on-disk history"
+ * if FEATURE_EDITING_SAVE_ON_EXIT: "how many in-memory lines are
+ * also in on-disk history (and thus need to be skipped on save)"
+ */
unsigned cnt_history_in_file;
const char *hist_file;
# endif
@@ -1446,6 +1452,9 @@ line_input_t *new_line_input_t(int flags) FAST_FUNC;
* >0 length of input string, including terminating '\n'
*/
int read_line_input(line_input_t *st, const char *prompt, char *command, int maxsize, int timeout) FAST_FUNC;
+# if ENABLE_FEATURE_EDITING_SAVE_ON_EXIT
+void save_history(line_input_t *st);
+# endif
#else
#define MAX_HISTORY 0
int read_line_input(const char* prompt, char* command, int maxsize) FAST_FUNC;