6960a73f58
TDE is a simple, public domain, multi-file/multi-window binary and text file editor written for IBM PCs and close compatibles running DOS, Win32 (console) or Linux. TDE is suitable for editing batch files, binary files, text files, and various computer language source code files (with configurable syntax highlighting). The only limit on the number and size of files that TDE can handle is the amount of memory. Likewise, the only limit on the number of windows is the amount of memory. There is no preset maximum number of files or windows that may be open at any one time.
75 lines
1.6 KiB
Text
75 lines
1.6 KiB
Text
$NetBSD: patch-ac,v 1.1.1.1 2005/11/20 17:25:42 bencollver Exp $
|
|
|
|
--- unix/console.c.orig 2003-12-05 16:47:02.000000000 -0800
|
|
+++ unix/console.c
|
|
@@ -64,8 +64,10 @@
|
|
#include "tdefunc.h"
|
|
#include "keys.h"
|
|
#include <sys/ioctl.h>
|
|
+#ifdef __LINUX__
|
|
#include <linux/kd.h>
|
|
#include <sys/io.h>
|
|
+#endif
|
|
|
|
|
|
#if defined( PC_CHARS )
|
|
@@ -114,6 +116,7 @@ char *term;
|
|
page( 1 );
|
|
video_config( cfg );
|
|
|
|
+#ifdef __LINUX__
|
|
if (!xterm && cfg->color) {
|
|
if (ioperm( 0x3c0, 0x1b, TRUE ) == 0) {
|
|
port_access = TRUE;
|
|
@@ -122,6 +125,7 @@ char *term;
|
|
outb( 0x04, 0x3c0 ); /* 9-bit chars, blink mode off */
|
|
}
|
|
}
|
|
+#endif
|
|
}
|
|
|
|
|
|
@@ -329,6 +333,7 @@ static int kbReadShiftState( void )
|
|
int arg = 6; /* TIOCLINUX function #6 */
|
|
int shift;
|
|
|
|
+#ifdef __LINUX__
|
|
if (ioctl( 0, TIOCLINUX, &arg ) != -1) {
|
|
shift = 0;
|
|
if (arg & 1)
|
|
@@ -338,6 +343,7 @@ int shift;
|
|
if (arg & (2 | 8))
|
|
shift |= _ALT;
|
|
} else
|
|
+#endif
|
|
shift = ERROR;
|
|
return( shift );
|
|
}
|
|
@@ -522,9 +528,13 @@ int capslock_active( void )
|
|
{
|
|
int kbled;
|
|
|
|
+#ifdef __LINUX__
|
|
if (ioctl( 0, KDGKBLED, &kbled ) == -1)
|
|
kbled = 0;
|
|
return( kbled & LED_CAP );
|
|
+#else
|
|
+ return( 0 );
|
|
+#endif
|
|
}
|
|
|
|
|
|
@@ -846,11 +856,13 @@ void set_cursor_size( int csize )
|
|
*/
|
|
void set_overscan_color( int color )
|
|
{
|
|
+#ifdef __LINUX__
|
|
if (port_access) {
|
|
inb( 0x3da ); /* switch flip-flop to index mode */
|
|
outb( 0x31, 0x3c0 ); /* display enable, register 0x11 */
|
|
outb( color, 0x3c0 ); /* overscan color */
|
|
}
|
|
+#endif
|
|
}
|
|
|
|
|