summaryrefslogtreecommitdiff
path: root/console/display.h
diff options
context:
space:
mode:
Diffstat (limited to 'console/display.h')
-rw-r--r--console/display.h39
1 files changed, 38 insertions, 1 deletions
diff --git a/console/display.h b/console/display.h
index 0043fb3e..6762e1b7 100644
--- a/console/display.h
+++ b/console/display.h
@@ -26,9 +26,46 @@
struct display;
typedef struct display *display_t;
+/* Create a new virtual console display, with the system encoding
+ being ENCODING. */
error_t display_create (display_t *r_display, const char *encoding);
+
+/* Destroy the display DISPLAY. */
void display_destroy (display_t display);
-error_t display_output (display_t display, char **buffer, size_t *length);
+
+/* Return the dimensions of the display DISPLAY in *WINSIZE. */
void display_getsize (display_t display, struct winsize *winsize);
+/* Set the owner of the display DISPLAY to PID. The owner receives
+ the SIGWINCH signal when the terminal size changes. */
+error_t display_set_owner (display_t display, pid_t pid);
+
+/* Return the owner of the display DISPLAY in PID. If there is no
+ owner, return ENOTTY. */
+error_t display_get_owner (display_t display, pid_t *pid);
+
+/* Output DATALEN characters from the buffer DATA on display DISPLAY.
+ The DATA must be supplied in the system encoding configured for
+ DISPLAY. The function returns the amount of bytes written (might
+ be smaller than DATALEN) or -1 and the error number in errno. If
+ NONBLOCK is not zero, return with -1 and set errno to EWOULDBLOCK
+ if operation would block for a long time. */
+ssize_t display_output (display_t display, int nonblock, char *data,
+ size_t datalen);
+
+ssize_t display_read (display_t display, int nonblock, off_t off,
+ char *data, size_t len);
+
+/* Resume the output on the display DISPLAY. */
+void display_start_output (display_t display);
+
+/* Stop all output on the display DISPLAY. */
+void display_stop_output (display_t display);
+
+/* Return the number of pending output bytes for DISPLAY. */
+size_t display_pending_output (display_t display);
+
+/* Flush the output buffer, discarding all pending data. */
+void display_discard_output (display_t display);
+
#endif /* DISPLAY_H */