summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/curses.h7
-rw-r--r--src/include/ipxe/console.h20
2 files changed, 23 insertions, 4 deletions
diff --git a/src/include/curses.h b/src/include/curses.h
index c472d695f..f16f9d7d0 100644
--- a/src/include/curses.h
+++ b/src/include/curses.h
@@ -3,6 +3,7 @@
#include <stdint.h>
#include <stdarg.h>
+#include <ipxe/console.h>
/** @file
*
@@ -105,12 +106,10 @@ typedef struct _curses_window {
} WINDOW;
extern WINDOW _stdscr;
-extern unsigned short _COLS;
-extern unsigned short _LINES;
#define stdscr ( &_stdscr )
-#define COLS _COLS
-#define LINES _LINES
+#define COLS console_width
+#define LINES console_height
#define MUCURSES_BITS( mask, shift ) (( mask ) << (shift))
#define CPAIR_SHIFT 8
diff --git a/src/include/ipxe/console.h b/src/include/ipxe/console.h
index 9c2620bc9..ab39cbfc1 100644
--- a/src/include/ipxe/console.h
+++ b/src/include/ipxe/console.h
@@ -159,7 +159,15 @@ struct console_driver {
*/
#define CONSOLE_EXPLICIT( console ) ( ( 2 * console + 1 ) != 2 )
+/** Default console width */
+#define CONSOLE_DEFAULT_WIDTH 80
+
+/** Default console height */
+#define CONSOLE_DEFAULT_HEIGHT 25
+
extern int console_usage;
+extern unsigned int console_width;
+extern unsigned int console_height;
/**
* Set console usage
@@ -175,6 +183,18 @@ console_set_usage ( int usage ) {
return old_usage;
}
+/**
+ * Set console size
+ *
+ * @v width Width, in characters
+ * @v height Height, in characters
+ */
+static inline __attribute__ (( always_inline )) void
+console_set_size ( unsigned int width, unsigned int height ) {
+ console_width = width;
+ console_height = height;
+}
+
extern int iskey ( void );
extern int getkey ( unsigned long timeout );
extern int console_configure ( struct console_configuration *config );