X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/7e74e688ea6f791e3fdbd20b67550185a9f8cc8f..19003317a2ac426232f6cdd7cb093f66c52d5942:/usr/src/usr.bin/tn3270/sys_curses/termout.c diff --git a/usr/src/usr.bin/tn3270/sys_curses/termout.c b/usr/src/usr.bin/tn3270/sys_curses/termout.c index e0fdc1eef4..33509612b8 100644 --- a/usr/src/usr.bin/tn3270/sys_curses/termout.c +++ b/usr/src/usr.bin/tn3270/sys_curses/termout.c @@ -51,19 +51,19 @@ extern void EmptyTerminal(); terminalCursorAddress:UnLocked? CursorAddress: HighestScreen()) -static int terminalCursorAddress = 0; /* where the cursor is on term */ -static int screenInitd = 0; /* the screen has been initialized */ -static int screenStopped = 1; /* the screen has been stopped */ +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 = 0; /* need to ring terinal bell */ +static int needToRing; /* need to ring terinal bell */ static char *bellSequence = "\07"; /* bell sequence (may be replaced by * VB during initialization) */ -static WINDOW *bellwin; /* The window the bell message is in */ +static WINDOW *bellwin = 0; /* The window the bell message is in */ int bellwinup = 0; /* Are we up with it or not */ #if defined(unix) @@ -86,6 +86,23 @@ extern int tin, tout; /* file descriptors */ #include "disp_asc.out" + +/* + * init_screen() + * + * Initialize variables used by screen. + */ + +void +init_screen() +{ + bellwinup = 0; +#if defined(SLOWSCREEN) + inHighlightMode = 0; +#endif /* defined(SLOWSCREEN) */ +} + + /* OurExitString - designed to keep us from going through infinite recursion */ static void @@ -572,10 +589,10 @@ void #endif /* defined(NOT43) */ (*TryToSend)() = FastScreen; -/* StartScreen - called to initialize the screen, etc. */ +/* InitTerminal - called to initialize the screen, etc. */ void -StartScreen() +InitTerminal() { #if defined(unix) struct sgttyb ourttyb; @@ -583,6 +600,7 @@ StartScreen() 2400, 4800, 9600 }; #endif + InitMapping(); /* Go do mapping file (MAP3270) first */ if (!screenInitd) { /* not initialized */ #if defined(unix) char KSEbuffer[2050]; @@ -591,26 +609,10 @@ StartScreen() extern char *tgetstr(); #endif /* defined(unix) */ - bzero((char *)Host, sizeof Host); - - bzero(Orders, sizeof Orders); - Orders[ORDER_SF] = Orders[ORDER_SBA] = Orders[ORDER_IC] - = Orders[ORDER_PT] = Orders[ORDER_RA] = Orders[ORDER_EUA] - = Orders[ORDER_YALE] = 1; - - DeleteAllFields(); #if defined(SLOWSCREEN) bzero((char *)Terminal, sizeof Terminal); #endif /* defined(SLOWSCREEN) */ - Lowest = HighestScreen()+1; - Highest = LowestScreen()-1; - terminalCursorAddress = - CursorAddress = - BufferAddress = SetBufferAddress(0,0); - UnLocked = 1; - Initialized = 1; - OutputClock = 1; - TransparentClock = -1; + terminalCursorAddress = SetBufferAddress(0,0); #if defined(unix) signal(SIGHUP, abort); #endif @@ -660,6 +662,7 @@ StartScreen() screenInitd = 1; screenStopped = 0; /* Not stopped */ } + Initialized = 1; } @@ -797,15 +800,17 @@ int DoTerminalOutput() { /* called just before a select to conserve IO to terminal */ - if (Initialized && - ((Lowest <= Highest) || needToRing || - (terminalCursorAddress != CorrectTerminalCursor()))) { + if (!Initialized) { + return 1; /* No output if not initialized */ + } + if ((Lowest <= Highest) || needToRing || + (terminalCursorAddress != CorrectTerminalCursor())) { (*TryToSend)(); } if (Lowest > Highest) { - return(1); /* no more output now */ + return 1; /* no more output now */ } else { - return(0); /* more output for future */ + return 0; /* more output for future */ } }