aboutsummaryrefslogtreecommitdiff
path: root/console/console.h
diff options
context:
space:
mode:
authorMarcus Brinkmann <marcus@gnu.org>2002-06-12 14:38:39 +0000
committerMarcus Brinkmann <marcus@gnu.org>2002-06-12 14:38:39 +0000
commit693eb63d90f9036680e538bc84275a32f707f926 (patch)
treee4f6e1890526dee1e6a40c824dc1725480979479 /console/console.h
parent609a7d4a162f97ff3ea6d59cb7326fbaaa960fd4 (diff)
downloadhurd-693eb63d90f9036680e538bc84275a32f707f926.tar.gz
hurd-693eb63d90f9036680e538bc84275a32f707f926.tar.bz2
hurd-693eb63d90f9036680e538bc84275a32f707f926.zip
2002-06-12 Marcus Brinkmann <marcus@gnu.org>
* console.c: Include <argz.h>. Do not include "console.h", but inline it. New macro DEFAULT_ENCODING. (struct cons): De-const-ify member ENCODING. (mycons, cons): Remove global variables. (vcons_lookup): Use default encoding if CONS->encoding is not set. (new_node): Access CONS through VCONS. Adjust size of display node. (netfs_attempt_read): Truncate length to read before reading. (netfs_S_io_map): New function. (options): New global variable. (parse_opt): New function. (netfs_append_args): New function. (main): New variable CONS to hold console structure. Rediddle initialization to allocate memory for it, parse arguments, and create the root node in correct order. Also call display_init. * console.h: Rewritten with new meaning. It now describes the public interface of the console. * display.c: Include <assert.h>, <error.h>, <hurd.h>, <hurd/pager.h> and "console.h". (struct screen): Removed. (struct cursor): Remove members X, Y and status. (struct user_pager_info): New struct. (struct display): Remove member SCREEN, add new members USER, UPI, MEMOBJ and MEMOBJ_SIZE. (pager_bucket): New global variable. (display_get_filemap): New function. (pager_clear_user_data): Likewise. (pager_read_page): Likewise. (pager_write_page): Likewise. (pager_unlock_page): Likewise. (pager_report_extent): Likewise. (pager_dropweak): Likewise. (service_paging_requests): Likewise. (screen_init): Renamed to ... (user_create): ... this new function and changed to allocate memory object and map it for USER data in display structure. (screen_deinit): Renamed to ... (user_destroy): ... this new function and rewrote it. (MATRIX_POS): New macro. (screen_fill): Take DISPLAY argument instead SCREEN. Use MATRIX_POS. (screen_scroll_up): Likewise. (screen_scroll_down): Likewise. (screen_scroll_left): Likewise. (screen_scroll_right): Likewise. (handle_esc_bracket_hl): Take DISPLAY argument instead CURSOR. (handle_esc_bracket): Access screen and cursor fields correctly. (display_output_one): Likewise. (display_getsize): Likewise. (display_init): New function. (display_create): New variables width, height, lines. Call user_create, not screen_init. Call user_destroy, not screen_deinit. (display_destroy): Call user_destroy, not screen_deinit. (display_read): Reimplement using memory mapping. * display.h: New prototypes for display_init and display_get_filemap.
Diffstat (limited to 'console/console.h')
-rw-r--r--console/console.h57
1 files changed, 44 insertions, 13 deletions
diff --git a/console/console.h b/console/console.h
index 3642bfe4..27996955 100644
--- a/console/console.h
+++ b/console/console.h
@@ -1,4 +1,4 @@
-/* console.h -- Interfaces for the console server.
+/* console.h -- Public interface to the console server.
Copyright (C) 2002 Free Software Foundation, Inc.
Written by Marcus Brinkmann.
@@ -16,20 +16,51 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#ifndef CONSOLE_H
-#define CONSOLE_H
+#ifndef _HURD_CONSOLE_H
+#define _HURD_CONSOLE_H
-#include <hurd/netfs.h>
-#include <rwlock.h>
-#include <maptime.h>
+#include <sys/types.h>
-/* Handy source of time. */
-volatile struct mapped_time_value *console_maptime;
+struct cons_display
+{
+#define CONS_MAGIC 0x48555244 /* Hex for "HURD". */
+ u_int32_t magic; /* CONS_MAGIC, use to detect
+ endianess. */
+#define CONS_VERSION_MAJ 0x0
+#define CONS_VERSION_MAJ_SHIFT 16
+#define CONS_VERSION_AGE 0x0
+ u_int32_t version; /* Version of interface. Lower 16
+ bits define the age, upper 16 bits
+ the major version. */
+ struct
+ {
+ u_int32_t width; /* Width of screen matrix. */
+ u_int32_t lines; /* Length of whole matrix. */
+ u_int32_t cur_line; /* Beginning of visible area. */
+ u_int32_t scr_lines;/* Number of lines in scrollback buffer
+ preceeding CUR_LINE. */
+ u_int32_t height; /* Number of lines in visible area following
+ (and including) CUR_LINE. */
+ u_int32_t matrix; /* Index (in wchar_t) of the beginning of
+ screen matrix in this structure. */
+ } screen;
-/* A handle for a console device. */
-typedef struct cons *cons_t;
+ struct
+ {
+ u_int32_t col; /* Current column (x-position) of cursor. */
+ u_int32_t row; /* Current row (y-position) of cursor. */
-/* A handle for a virtual console device. */
-typedef struct vcons *vcons_t;
+#define CONS_CURSOR_INVISIBLE 0
+#define CONS_CURSOR_NORMAL 1
+#define CONS_CURSOR_VERY_VISIBLE 2
+ u_int32_t status; /* Visibility status of cursor. */
+ } cursor;
-#endif /* CONSOLE_H */
+ /* Don't use this, use ((wchar_t *) cons_display +
+ cons_display.screen.matrix) instead. This will make your client
+ upward compatible with future versions of this interface. */
+ wchar_t _matrix[0];
+};
+
+
+#endif /* _HURD_CONSOLE_H */