From 9da6eef6cbcc4df9f9081acf756e0edb7d8d7e53 Mon Sep 17 00:00:00 2001 From: Gregory Minshall Date: Thu, 16 Jul 1987 19:29:58 -0800 Subject: [PATCH] Put up error messages (on 25th line) in dos environment. SCCS-vsn: usr.bin/tn3270/distribution/sys_dos/termout.c 1.11 --- .../tn3270/distribution/sys_dos/termout.c | 37 +++++++++++-------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/usr/src/usr.bin/tn3270/distribution/sys_dos/termout.c b/usr/src/usr.bin/tn3270/distribution/sys_dos/termout.c index f8659ad4e5..19f08cd72f 100644 --- a/usr/src/usr.bin/tn3270/distribution/sys_dos/termout.c +++ b/usr/src/usr.bin/tn3270/distribution/sys_dos/termout.c @@ -379,24 +379,24 @@ LocalClearScreen() int bellwinup = 0; /* If != 0, length of bell message */ static int - bellpos0 = 0; /* Where error message goes */ + bell_len = 0; /* Length of error message */ -static char bellstring[100];/* Where message goes */ - -#define BELL_SPACES 2 /* 2 spaces between border and bell */ - -#define BELL_HIGH_LOW(h,l) { \ - h = bellpos0+2*NumberColumns+bellwinup+BELL_SPACES*2; \ - l = bellpos0; \ - } void BellOff() { + ScreenBuffer a[100]; + int i; + if (bellwinup) { - BELL_HIGH_LOW(Highest,Lowest); - TryToSend(); + unsigned char blank = ' '; + + for (i = 0; i < bell_len; i++) { + a[i].attr = NORMAL; + a[i].data = ' '; + } } + scrwrite(a, bell_len, 24*80); /* XXX */ } @@ -406,14 +406,19 @@ char *s; { needToRing = 1; if (s) { - int len = strlen(s); + int i; + ScreenBuffer bellstring[100]; - if (len > sizeof bellstring-1) { + bell_len = strlen(s); + bellwinup = 1; + if (bell_len > sizeof bellstring-1) { OurExitString(stderr, "Bell string too long.", 1); } - memcpy(bellstring, s, len+1); - BELL_HIGH_LOW(Highest,Lowest); - TryToSend(); + for (i = 0; i < bell_len; i++) { + bellstring[i].attr = STANDOUT; + bellstring[i].data = s[i]; + } + scrwrite(bellstring, bell_len, 24*80); /* XXX */ } } -- 2.20.1