summaryrefslogtreecommitdiff
path: root/libcons/cons.h
diff options
context:
space:
mode:
authorMarcus Brinkmann <marcus@gnu.org>2002-09-13 23:40:10 +0000
committerMarcus Brinkmann <marcus@gnu.org>2002-09-13 23:40:10 +0000
commitcc60ad8bb9596cafe94f48de9ea030ce01e22404 (patch)
treeba7b74a5ab8d70d7505c514c6d63929a9bcaded3 /libcons/cons.h
parentfad9d77677aca4ce2fd11705f87adca9b0524ecf (diff)
2002-09-14 Marcus Brinkmann <marcus@gnu.org>
* 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.
Diffstat (limited to 'libcons/cons.h')
-rw-r--r--libcons/cons.h25
1 files changed, 22 insertions, 3 deletions
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;