#include <stdio.h>
#include <curses.h>
-#include "../general.h"
+#include "../general/general.h"
#include "terminal.h"
#include "../telnet.ext"
+#include "../apilib/disp_asc.h"
+
#include "../ctlr/hostctlr.h"
#include "../ctlr/inbound.ext"
+#include "../ctlr/oia.h"
#include "../ctlr/options.ext"
#include "../ctlr/outbound.ext"
#include "../ctlr/screen.h"
-#include "../keyboard/map3270.ext"
+#include "../ascii/map3270.ext"
-#include "../system/globals.h"
+#include "../general/globals.h"
extern void EmptyTerminal();
static int terminalCursorAddress; /* where the cursor is on term */
static int screenInitd; /* the screen has been initialized */
static int screenStopped; /* the screen has been stopped */
-#if defined(SLOWSCREEN)
static int max_changes_before_poll; /* how many characters before looking */
/* at terminal and net again */
-#endif /* defined(SLOWSCREEN) */
static int needToRing; /* need to ring terinal bell */
static char *bellSequence = "\07"; /* bell sequence (may be replaced by
#endif /* defined(unix) */
-#if defined(SLOWSCREEN)
static int inHighlightMode = 0;
ScreenImage Terminal[MAXSCREENSIZE];
-#endif /* defined(SLOWSCREEN) */
/* Variables for transparent mode */
#if defined(unix)
static int savefd[2]; /* for storing fds during transcom */
extern int tin, tout; /* file descriptors */
#endif /* defined(unix) */
-
-
-#include "disp_asc.out"
-
\f
/*
init_screen()
{
bellwinup = 0;
-#if defined(SLOWSCREEN)
inHighlightMode = 0;
ClearArray(Terminal);
-#endif /* defined(SLOWSCREEN) */
}
/* NOTREACHED */
}
\f
-#if defined(SLOWSCREEN)
/* What is the screen address of the attribute byte for the terminal */
static int
return(LowestScreen()); /* unformatted screen... */
}
-#endif /* defined(SLOWSCREEN) */
\f
/*
* There are two algorithms for updating the screen.
*/
-#if defined(SLOWSCREEN)
#if defined(NOT43)
static int
#else /* defined(NOT43) */
columnsleft = NumberColumns;
}
SetHighlightMode(pointer); /* Turn on highlighting */
- while (!IsStartField(pointer) &&
- !TermIsStartField(pointer)) {
+ while ((!IsStartField(pointer)) &&
+ (!TermIsStartField(pointer))) {
c = GetHost(pointer);
DoCharacterAt(c,pointer); /* MACRO */
pointer = ScreenInc(pointer);
* the end of the screen.
*/
if (j > pointer) {
+ /*
+ * pointer is guaranteed to be higher than Highest...
+ */
+ pointer = Highest+1; /* We did the highest thing */
break;
}
} else {
EmptyTerminal(); /* move data along */
return;
}
-#endif /* defined(SLOWSCREEN) */
\f
#if defined(NOT43)
static int
FastScreen(); /* Recurse */
return;
} else if (fieldattr) { /* Should we display? */
- addch(disp_asc[p->data]); /* Display translated data */
+ /* Display translated data */
+ addch(disp_asc[GetTerminalPointer(p)]);
} else {
addch(' '); /* Display a blank */
}
} else {
if (fieldattr) { /* Should we display? */
/* Display translated data */
- *tmp++ = disp_asc[p->data];
+ *tmp++ = disp_asc[GetTerminalPointer(p)];
} else {
*tmp++ = ' ';
}
#endif /* defined(NOT43) */
(*TryToSend)() = FastScreen;
\f
+void
+ScreenOIA(oia)
+OIA *oia;
+{
+}
+
+
/* InitTerminal - called to initialize the screen, etc. */
void
extern char *tgetstr();
#endif /* defined(unix) */
-#if defined(SLOWSCREEN)
ClearArray(Terminal);
-#endif /* defined(SLOWSCREEN) */
terminalCursorAddress = SetBufferAddress(0,0);
#if defined(unix)
signal(SIGHUP, abort);
#endif
TryToSend = FastScreen;
-#if defined(unix) && defined(SLOWSCREEN)
+#if defined(unix)
ioctl(1, TIOCGETP, (char *) &ourttyb);
if ((ourttyb.sg_ospeed < 0) || (ourttyb.sg_ospeed > B9600)) {
max_changes_before_poll = 1920;
TryToSend = SlowScreen;
HaveInput = 1; /* get signals going */
}
-#endif /* defined(unix) && defined(SLOWSCREEN) */
+#endif /* defined(unix) */
setcommandmode();
/*
* By now, initscr() (in curses) has been called (from telnet.c),
screenInitd = 1;
screenStopped = 0; /* Not stopped */
}
- Initialized = 1;
}
if (screenInitd && !screenStopped) {
move(NumberLines-1, 1);
standend();
-#if defined(SLOWSCREEN)
inHighlightMode = 0;
-#endif /* defined(SLOWSCREEN) */
DoARefresh();
setcommandmode();
endwin();
{
outputPurge(); /* flush all data to terminal */
clear(); /* clear in curses */
-#if defined(SLOWSCREEN)
ClearArray(Terminal);
-#endif /* defined(SLOWSCREEN) */
Clear3270();
Lowest = HighestScreen()+1; /* everything in sync... */
Highest = LowestScreen()+1;
delwin(bellwin);
bellwin = 0;
bellwinup = 0;
- Lowest = MIN(Lowest, LINES/2);
- Highest = MAX(Highest, (LINES/2)+3);
-#if defined(SLOWSCREEN)
- memset(Terminal+LINES/2, 0, (sizeof Terminal[0])*(3*COLS));
-#endif /* defined(SLOWSCREEN) */
touchwin(stdscr);
DoARefresh();
}
DoTerminalOutput()
{
/* called just before a select to conserve IO to terminal */
- if (!Initialized) {
+ if (!(screenInitd||screenStopped)) {
return 1; /* No output if not initialized */
}
if ((Lowest <= Highest) || needToRing ||