diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/libbb.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/include/libbb.h b/include/libbb.h index 9aba71949..46180c5aa 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -1639,9 +1639,9 @@ enum { | |||
1639 | * buffer[0] is used as a counter of buffered chars and must be 0 | 1639 | * buffer[0] is used as a counter of buffered chars and must be 0 |
1640 | * on first call. | 1640 | * on first call. |
1641 | * timeout: | 1641 | * timeout: |
1642 | * -2: do not poll for input; | 1642 | * -2: do not poll(-1) for input - read() it, return on EAGAIN at once |
1643 | * -1: poll(-1) (i.e. block); | 1643 | * -1: poll(-1) (i.e. block even on NONBLOCKed fd) |
1644 | * >=0: poll for TIMEOUT milliseconds, return -1/EAGAIN on timeout | 1644 | * >=0: poll() for TIMEOUT milliseconds, return -1/EAGAIN on timeout |
1645 | */ | 1645 | */ |
1646 | int64_t read_key(int fd, char *buffer, int timeout) FAST_FUNC; | 1646 | int64_t read_key(int fd, char *buffer, int timeout) FAST_FUNC; |
1647 | void read_key_ungets(char *buffer, const char *str, unsigned len) FAST_FUNC; | 1647 | void read_key_ungets(char *buffer, const char *str, unsigned len) FAST_FUNC; |
@@ -1657,6 +1657,7 @@ unsigned size_from_HISTFILESIZE(const char *hp) FAST_FUNC; | |||
1657 | # endif | 1657 | # endif |
1658 | typedef struct line_input_t { | 1658 | typedef struct line_input_t { |
1659 | int flags; | 1659 | int flags; |
1660 | int timeout; | ||
1660 | const char *path_lookup; | 1661 | const char *path_lookup; |
1661 | # if MAX_HISTORY | 1662 | # if MAX_HISTORY |
1662 | int cnt_history; | 1663 | int cnt_history; |
@@ -1692,7 +1693,7 @@ line_input_t *new_line_input_t(int flags) FAST_FUNC; | |||
1692 | * 0 on ctrl-C (the line entered is still returned in 'command'), | 1693 | * 0 on ctrl-C (the line entered is still returned in 'command'), |
1693 | * >0 length of input string, including terminating '\n' | 1694 | * >0 length of input string, including terminating '\n' |
1694 | */ | 1695 | */ |
1695 | int read_line_input(line_input_t *st, const char *prompt, char *command, int maxsize, int timeout) FAST_FUNC; | 1696 | int read_line_input(line_input_t *st, const char *prompt, char *command, int maxsize) FAST_FUNC; |
1696 | void show_history(const line_input_t *st) FAST_FUNC; | 1697 | void show_history(const line_input_t *st) FAST_FUNC; |
1697 | # if ENABLE_FEATURE_EDITING_SAVE_ON_EXIT | 1698 | # if ENABLE_FEATURE_EDITING_SAVE_ON_EXIT |
1698 | void save_history(line_input_t *st); | 1699 | void save_history(line_input_t *st); |
@@ -1700,7 +1701,7 @@ void save_history(line_input_t *st); | |||
1700 | #else | 1701 | #else |
1701 | #define MAX_HISTORY 0 | 1702 | #define MAX_HISTORY 0 |
1702 | int read_line_input(const char* prompt, char* command, int maxsize) FAST_FUNC; | 1703 | int read_line_input(const char* prompt, char* command, int maxsize) FAST_FUNC; |
1703 | #define read_line_input(state, prompt, command, maxsize, timeout) \ | 1704 | #define read_line_input(state, prompt, command, maxsize) \ |
1704 | read_line_input(prompt, command, maxsize) | 1705 | read_line_input(prompt, command, maxsize) |
1705 | #endif | 1706 | #endif |
1706 | 1707 | ||