diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/libbb.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h index 0b066d1bd..f990b0ebd 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -583,6 +583,42 @@ extern unsigned long long bb_makedev(unsigned int major, unsigned int minor); | |||
583 | #endif | 583 | #endif |
584 | 584 | ||
585 | 585 | ||
586 | #if ENABLE_FEATURE_COMMAND_EDITING | ||
587 | /* It's NOT just ENABLEd or disabled. It's a number: */ | ||
588 | #ifdef CONFIG_FEATURE_COMMAND_HISTORY | ||
589 | #define MAX_HISTORY (CONFIG_FEATURE_COMMAND_HISTORY + 0) | ||
590 | #else | ||
591 | #define MAX_HISTORY 0 | ||
592 | #endif | ||
593 | struct line_input_t { | ||
594 | int flags; | ||
595 | const char *path_lookup; | ||
596 | #if MAX_HISTORY | ||
597 | int cnt_history; | ||
598 | int cur_history; | ||
599 | USE_FEATURE_COMMAND_SAVEHISTORY(const char *hist_file;) | ||
600 | char *history[MAX_HISTORY + 1]; | ||
601 | #endif | ||
602 | }; | ||
603 | enum { | ||
604 | DO_HISTORY = 1 * (MAX_HISTORY > 0), | ||
605 | SAVE_HISTORY = 2 * (MAX_HISTORY > 0) * ENABLE_FEATURE_COMMAND_SAVEHISTORY, | ||
606 | TAB_COMPLETION = 4 * ENABLE_FEATURE_COMMAND_TAB_COMPLETION, | ||
607 | USERNAME_COMPLETION = 8 * ENABLE_FEATURE_COMMAND_USERNAME_COMPLETION, | ||
608 | VI_MODE = 0x10 * ENABLE_FEATURE_COMMAND_EDITING_VI, | ||
609 | WITH_PATH_LOOKUP = 0x20, | ||
610 | FOR_SHELL = DO_HISTORY | SAVE_HISTORY | TAB_COMPLETION | USERNAME_COMPLETION, | ||
611 | }; | ||
612 | typedef struct line_input_t line_input_t; | ||
613 | line_input_t *new_line_input_t(int flags); | ||
614 | int read_line_input(const char* prompt, char* command, int maxsize, line_input_t *state); | ||
615 | #else | ||
616 | int read_line_input(const char* prompt, char* command, int maxsize); | ||
617 | #define read_line_input(prompt, command, maxsize, state) \ | ||
618 | read_line_input(prompt, command, maxsize) | ||
619 | #endif | ||
620 | |||
621 | |||
586 | #ifndef COMM_LEN | 622 | #ifndef COMM_LEN |
587 | #ifdef TASK_COMM_LEN | 623 | #ifdef TASK_COMM_LEN |
588 | enum { COMM_LEN = TASK_COMM_LEN }; | 624 | enum { COMM_LEN = TASK_COMM_LEN }; |