summaryrefslogtreecommitdiff
path: root/misc/dt
diff options
context:
space:
mode:
authorfredb <fredb@pkgsrc.org>2002-02-11 18:30:21 +0000
committerfredb <fredb@pkgsrc.org>2002-02-11 18:30:21 +0000
commitf5134e1564e12674b1f2f944755e2055e18bdcf8 (patch)
treea9f9da864111257c2019435ffdc3416691acc043 /misc/dt
parenta4a82e30d9e5dac46032d5b63bc9de449229449d (diff)
downloadpkgsrc-f5134e1564e12674b1f2f944755e2055e18bdcf8.tar.gz
Programs that follow Digital's recommendations will follow ESC(0 -- to
load the DEC Special Graphics (VT line draw) characters into graphics set GS0 -- with lock shift 0, aka LS0, aka SO, aka ^0 -- to then enable GS0. Since GS0 is the default, the full procedure is really only necessary when displaying line draw and alphanumeric characters on the same line. With the last patch to enable line draw characters, ESC(0 was always taken to mean ASCII SI (shift in), and ^0 was always taken to to mean SO (shift out), so for programs that did the right thing (e.g. "pstree"), "dt" was simply setting, then unsetting, the alternate character set attribute, causing the desired line draw characters never to be displayed. To deal with that, introduce a layer of abstraction, such that ESC(0 and friends now only set per-VT variables, rather than directly set the attribute. Initialize these variables so that SO and SI, taken alone, will do the expected thing, and extend the state machine so that a changed GS0 will become active at the next carriage return, or immediately if an LS0 was already seen on that line (all very much like a real VT). Bump version to dt-1.1.7nb2.
Diffstat (limited to 'misc/dt')
-rw-r--r--misc/dt/Makefile4
-rw-r--r--misc/dt/distinfo6
-rw-r--r--misc/dt/patches/patch-ac32
-rw-r--r--misc/dt/patches/patch-ad130
4 files changed, 145 insertions, 27 deletions
diff --git a/misc/dt/Makefile b/misc/dt/Makefile
index ab3c61e0aff..031fe0fa235 100644
--- a/misc/dt/Makefile
+++ b/misc/dt/Makefile
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.13 2002/02/10 22:49:53 fredb Exp $
+# $NetBSD: Makefile,v 1.14 2002/02/11 18:30:21 fredb Exp $
#
DISTNAME= dt-1.1.7
-PKGREVISION= 1
+PKGREVISION= 2
CATEGORIES= misc
MASTER_SITES= ${MASTER_SITE_LOCAL}
diff --git a/misc/dt/distinfo b/misc/dt/distinfo
index 2e8452d186c..2a742b53be3 100644
--- a/misc/dt/distinfo
+++ b/misc/dt/distinfo
@@ -1,8 +1,8 @@
-$NetBSD: distinfo,v 1.4 2002/02/11 18:24:55 fredb Exp $
+$NetBSD: distinfo,v 1.5 2002/02/11 18:30:22 fredb Exp $
SHA1 (dt-1.1.7.tar.gz) = 024c3137185dd93ced163e82227f53cfb79b993e
Size (dt-1.1.7.tar.gz) = 119975 bytes
SHA1 (patch-aa) = 9877c123f2f7f13ece91b40a70fb490524e53f18
SHA1 (patch-ab) = 9d9971e5eaf8c7e8d7206d4174dfa4ccc8baae46
-SHA1 (patch-ac) = c97b65485e053588b36acb0b1f97ad5bc56cdf74
-SHA1 (patch-ad) = 9e59b43fe53c9873e7e71c9ffe00c21e4a178c6b
+SHA1 (patch-ac) = 2dfde914d866b3ad5ded30be4252d2675984ce74
+SHA1 (patch-ad) = 68320e1b2bda509cd940cf531d19ec8511ceca91
diff --git a/misc/dt/patches/patch-ac b/misc/dt/patches/patch-ac
index 21f5c9ea6c5..18b8acd9fc8 100644
--- a/misc/dt/patches/patch-ac
+++ b/misc/dt/patches/patch-ac
@@ -1,7 +1,7 @@
-$NetBSD: patch-ac,v 1.2 2002/02/11 18:24:55 fredb Exp $
+$NetBSD: patch-ac,v 1.3 2002/02/11 18:30:22 fredb Exp $
---- vt.h.orig Sun Jun 9 07:32:33 1996
-+++ vt.h Thu Feb 7 09:12:59 2002
+--- vt.h.orig Mon Feb 11 11:13:44 2002
++++ vt.h
@@ -5,7 +5,7 @@
*/
@@ -15,7 +15,31 @@ $NetBSD: patch-ac,v 1.2 2002/02/11 18:24:55 fredb Exp $
#define T_REVERSE 0x04
#define T_SELECTED 0x08
#define T_INSERT 0x10
-+#define T_G0 0x20
++#define T_LINEDRAW 0x20
/* Cursor types */
#define C_BLOCK 0x01
+@@ -49,6 +50,10 @@
+ #define SETBG(x,c) ((x) = ((x) & 0x0F) | ((c) << 4))
+ #define SETCOLOR(x,f,b) ((x) = (f) | ((b) << 4))
+
++/* Character sets */
++#define S_ASCII 0x00 /* ASCII Graphics (normal) */
++#define S_LINEDRAW 0x01 /* DEC Special Graphics */
++
+ struct vt_s {
+ /* Scrollback information */
+ int line[VT_POOLSIZE]; /* Lines in the scrollback pool */
+@@ -87,6 +92,12 @@
+ int pars[VT_MAXPARS]; /* VT100 parameters */
+ int ques; /* If ? in VT100 string */
+ u_int tab_stop[5]; /* Bit field for tab stops */
++
++ /* Graphics set information */
++ int gset0; /* Character set loaded into GS0 */
++ int gset0changed; /* GS0 loaded, but not active */
++ int gset0mapped; /* GS0 loaded and active */
++ int gset1; /* Character set loaded into GS1 */
+ };
+
+ extern struct vt_s vt[VT_MAXVT];
diff --git a/misc/dt/patches/patch-ad b/misc/dt/patches/patch-ad
index 1291486cf5a..41f564b5bd6 100644
--- a/misc/dt/patches/patch-ad
+++ b/misc/dt/patches/patch-ad
@@ -1,37 +1,131 @@
-$NetBSD: patch-ad,v 1.1 2002/02/10 22:49:55 fredb Exp $
+$NetBSD: patch-ad,v 1.2 2002/02/11 18:30:23 fredb Exp $
--- vt.c.orig Fri May 24 10:13:52 1996
-+++ vt.c Thu Feb 7 09:12:59 2002
++++ vt.c
@@ -748,6 +748,9 @@
register int line, i;
if (v->state == ESnormal && ch >= ' ' && ch < 256) {
-+ if ( (v->attr & T_G0) && ch >= 'a' && ch <= 'z')
++ if ( (v->attr & T_LINEDRAW) && ch >= 'a' && ch <= 'z')
+ ch -= 95;
+
if (v->hanging_cursor) {
v->x = 0;
movecursordown(v);
-@@ -800,8 +803,10 @@
+@@ -796,13 +799,38 @@
+ v->hanging_cursor = 0; /* XXX Is this right? */
+ return;
+ case 13:
++ /*
++ * This is a hack! Do what I mean: after setting GS0,
++ * activate GS0 for next line, but don't just activate
++ * GS0 for every new line.
++ */
++ if (v->gset0changed) {
++ if (v->gset0 == S_ASCII)
++ v->attr &= ~T_LINEDRAW;
++ else
++ v->attr |= T_LINEDRAW;
++ v->gset0changed = 0;
++ v->gset0mapped = 0;
++ }
+ v->x = 0; /* Carriage return (^M) */
v->hanging_cursor = 0;
return;
case 14:
-+ v->attr |= T_G0;
- return; /* Alternate font (^N) */
+- return; /* Alternate font (^N) */
++ if (v->gset1 == S_ASCII)
++ v->attr &= ~T_LINEDRAW;
++ else
++ v->attr |= T_LINEDRAW;
++ return; /* Lock Shift 1 (^N) */
++ v->gset0changed = 0;
++ v->gset0mapped = 0;
case 15:
-+ v->attr &= ~T_G0;
- return; /* Normal font (^O) */
+- return; /* Normal font (^O) */
++ if (v->gset0 == S_ASCII)
++ v->attr &= ~T_LINEDRAW;
++ else
++ v->attr |= T_LINEDRAW;
++ v->gset0changed = 1; /* to clear map bit at EOL */
++ v->gset0mapped = 1;
++ return; /* Lock Shift 0 (^O) */
case 24: /* (^X) */
case 26:
-@@ -1071,9 +1076,11 @@
+ v->state = ESnormal; /* (^Z) */
+@@ -1070,36 +1098,38 @@
+ break;
case ESsetG0:
if (ch == '0') {
- /* Set graphics character set */
-+ v->attr |= T_G0;
- } else
- if (ch == 'B') {
- /* Set normal character set */
-+ v->attr &= ~T_G0;
- } else
- if (ch == 'U') {
- /* Set null character set */
+- /* Set graphics character set */
+- } else
+- if (ch == 'B') {
+- /* Set normal character set */
+- } else
+- if (ch == 'U') {
+- /* Set null character set */
+- } else
+- if (ch == 'K') {
+- /* Set user-defined character
+- * set */
+- }
+- /* If currently G0, then make active set */
++ v->gset0 = S_LINEDRAW;
++ if (v->gset0mapped)
++ /*
++ * Activate immediately. We'll still mark it
++ * changed, so the mapped bit will get cleared
++ * for the next line.
++ */
++ v->attr |= T_LINEDRAW;
++ v->gset0changed = 1;
++ } else if (ch == 'B') {
++ v->gset0 = S_ASCII;
++ if (v->gset0mapped)
++ /*
++ * Activate immediately. We'll still mark it
++ * changed, so the mapped bit will get cleared
++ * for the next line.
++ */
++ v->attr &= ~T_LINEDRAW;
++ v->gset0changed = 1;
++ }
+ v->state = ESnormal;
+ break;
++ /*
++ * Not very useful. Typically, G1 would be changed to one
++ * of the other character sets, which we don't support.
++ */
+ case ESsetG1:
+ if (ch == '0') {
+- /* Set graphics character set */
+- } else
+- if (ch == 'B') {
+- /* Set normal character set */
+- } else
+- if (ch == 'U') {
+- /* Set null character set */
+- } else
+- if (ch == 'K') {
+- /* Set user-defined character
+- * set */
+- }
+- /* If currently G1, then make active set */
++ v->gset1 = S_LINEDRAW;
++ } else if (ch == 'B') {
++ v->gset1 = S_ASCII;
++ }
+ v->state = ESnormal;
+ break;
+ default:
+@@ -1187,6 +1217,10 @@
+ v->tab_stop[3] = 0x01010101;
+ v->tab_stop[4] = 0x01010101;
+ v->copying = 0;
++ v->gset0 = S_ASCII;
++ v->gset0changed = 0;
++ v->gset0mapped = 0;
++ v->gset1 = S_LINEDRAW;
+ }
+ }
+