From cc60ad8bb9596cafe94f48de9ea030ce01e22404 Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Fri, 13 Sep 2002 23:40:10 +0000 Subject: 2002-09-14 Marcus Brinkmann * Makefile (SRCS): Add vcons-input.c. * vcons-input.c: New file. * vcons-scrollback.c (_cons_vcons_scrollback): New function. (cons_vcons_scrollback): Reimplement in terms of _cons_vcons_scrollback. * cons.h (cons_scroll_t): New type. (cons_vcons_scrollback): Update prototype. * priv.h (_cons_jump_down_at_input): New extern. (_cons_jump_down_at_output): Likewise. (_cons_vcons_scrollback): New prototype. * opts-std-startup.c (OPT_JUMP_DOWN_AT_INPUT): New macro. (OPT_JUMP_DOWN_AT_OUTPUT): Likewise. (_cons_jump_down_at_input): New variable. (_cons_jump_down_at_output): Likewise. (startup_options): Add new options --jump-down-at-input and --jump-down-at-output. (parse_startup_opt): Handle these new options. * file-changed.c (cons_S_file_changed): Support the jump down at output option. --- libcons/cons.h | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'libcons/cons.h') diff --git a/libcons/cons.h b/libcons/cons.h index 783aeb6a..67f4e45b 100644 --- a/libcons/cons.h +++ b/libcons/cons.h @@ -189,7 +189,7 @@ void cons_vcons_scroll (vcons_t vcons, int delta); void cons_vcons_update (vcons_t vcons); /* The user must define this function. Make the virtual console - VCONS, which is locked, beep audible. */ + VCONS, which is locked, beep audibly. */ void cons_vcons_beep (vcons_t vcons); /* The user must define this function. Make the virtual console @@ -218,8 +218,27 @@ void cons_vcons_remove (cons_t cons, vcons_list_t vcons_entry); be locked. */ error_t cons_switch (vcons_t vcons, int id, int delta, vcons_t *r_vcons); -/* Scroll back into the history of VCONS by DELTA lines. */ -int cons_vcons_scrollback (vcons_t vcons, int delta); +/* Enter SIZE bytes from the buffer BUF into the virtual console + VCONS. */ +error_t cons_vcons_input (vcons_t vcons, char *buf, size_t size); + +typedef enum + { + CONS_SCROLL_DELTA_LINES, CONS_SCROLL_DELTA_SCREENS, + CONS_SCROLL_ABSOLUTE_LINE, CONS_SCROLL_ABSOLUTE_PERCENTAGE + } cons_scroll_t; + +/* Scroll back into the history of VCONS. If TYPE is + CONS_SCROLL_DELTA_LINES, scroll up or down by VALUE lines. If TYPE + is CONS_SCROLL_DELTA_SCREENS, scroll up or down by VALUE multiples + of a screen height. If TYPE is CONS_SCROLL_ABSOLUTE_LINE, scroll to + line VALUE (where 0 is the lowest line). If TYPE is + CONS_SCROLL_ABSOLUTE_PERCENTAGE, scroll to the position determined + by VALUE, where 0 is the bottom and 1 is the top. + + The function returns the number of lines actually scrolled up or + down. */ +int cons_vcons_scrollback (vcons_t vcons, cons_scroll_t type, float value); extern const struct argp cons_startup_argp; -- cgit v1.2.3