Subversion Repositories planix.SVN

Rev

Rev 116 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 116 Rev 118
Line 19... Line 19...
19
/* short	ospeed = -1;	mjm: def also in tputs.c of termcap.a  */
19
/* short	ospeed = -1;	mjm: def also in tputs.c of termcap.a  */
20
short	o_speed = -1;
20
short	o_speed = -1;
21
 
21
 
22
gettmode()
22
gettmode()
23
{
23
{
24
/*a XXX
24
/* a XXX
25
#ifndef USG3TTY
25
#ifndef USG3TTY
26
	if (gtty(1, &tty) < 0)
26
	if (gtty(1, &tty) < 0)
27
		return;
27
		return;
28
	if (o_speed != tty.sg_ospeed)
28
	if (o_speed != tty.sg_ospeed)
29
		value(SLOWOPEN) = tty.sg_ospeed < B1200;
29
		value(SLOWOPEN) = tty.sg_ospeed < B1200;
Line 56... Line 56...
56
	&XB, &XN, &XT, &XX
56
	&XB, &XN, &XT, &XX
57
};
57
};
58
char **fkeys[10] = {
58
char **fkeys[10] = {
59
	&F0, &F1, &F2, &F3, &F4, &F5, &F6, &F7, &F8, &F9
59
	&F0, &F1, &F2, &F3, &F4, &F5, &F6, &F7, &F8, &F9
60
};
60
};
-
 
61
 
61
setterm(type)
62
setterm(type)
62
	char *type;
63
	char *type;
63
{
64
{
64
	char *tgoto();
65
	char *tgoto();
65
	register int unknown;
66
	register int unknown;
66
	char ltcbuf[TCBUFSIZE];
67
	char ltcbuf[TCBUFSIZE+4096];
67
 
68
 
68
	if (type[0] == 0)
69
	if (type[0] == 0)
69
		type = "xx";
70
		type = "xx";
70
	unknown = 0;
71
	unknown = 0;
71
	putpad(TE);
72
	putpad(TE);
Line 74... Line 75...
74
//#endif
75
//#endif
75
	if (tgetent(ltcbuf, type) != 1) {
76
	if (tgetent(ltcbuf, type) != 1) {
76
		unknown++;
77
		unknown++;
77
		CP(ltcbuf, "xx|dumb:");
78
		CP(ltcbuf, "xx|dumb:");
78
	}
79
	}
-
 
80
 
79
	setsize();
81
	setsize();
80
	aoftspace = tspace;
82
	aoftspace = tspace;
81
	zap();
83
	zap();
82
	/*
84
	/*
83
	 * Initialize keypad arrow keys.
85
	 * Initialize keypad arrow keys.
Line 107... Line 109...
107
	 * overrides any arrow key, but only for hackers (=new tty driver).
109
	 * overrides any arrow key, but only for hackers (=new tty driver).
108
	 */
110
	 */
109
	{
111
	{
110
		static char sc[2];
112
		static char sc[2];
111
		int i, fnd;
113
		int i, fnd;
112
 
114
 
113
		ioctl(0, TIOCGETD, &ldisc);
115
		ioctl(0, TIOCGETD, &ldisc);
114
		if (ldisc == NTTYDISC) {
116
		if (ldisc == NTTYDISC) {
115
			sc[0] = olttyc.t_suspc;
117
			sc[0] = olttyc.t_suspc;
116
			sc[1] = 0;
118
			sc[1] = 0;
117
			if (olttyc.t_suspc == CTRL('z')) {
119
			if (olttyc.t_suspc == CTRL('z')) {
Line 122... Line 124...
122
			} else
124
			} else
123
				addmac(sc, "\32", "susp", arrows);
125
				addmac(sc, "\32", "susp", arrows);
124
		}
126
		}
125
	}
127
	}
126
#endif
128
#endif
127
 
129
 
128
	if (CM != 0) {
130
	if (CM != 0) {
129
		if (tgoto(CM, 2, 2)[0] == 'O')	/* OOPS */
131
		if (tgoto(CM, 2, 2)[0] == 'O')	/* OOPS */
130
			CA = 0, CM = 0;
132
			CA = 0, CM = 0;
131
		else
133
		else
132
			CA = 1, costCM = cost(tgoto(CM, 8, 10));
134
			CA = 1, costCM = cost(tgoto(CM, 8, 10));
133
	} else {
135
	} else {
134
		CA = 0, CM = 0;
136
		CA = 0, CM = 0;
135
	}
137
	}
136
	costSR = cost(SR);
138
	costSR = cost(SR);
-
 
139
 
137
	costAL = cost(AL);
140
	costAL = cost(AL);
138
	costDP = cost(tgoto(DOWN_PARM, 10, 10));
141
	costDP = cost(tgoto(DOWN_PARM, 10, 10));
139
	costLP = cost(tgoto(LEFT_PARM, 10, 10));
142
	costLP = cost(tgoto(LEFT_PARM, 10, 10));
140
	costRP = cost(tgoto(RIGHT_PARM, 10, 10));
143
	costRP = cost(tgoto(RIGHT_PARM, 10, 10));
141
	PC = xPC ? xPC[0] : 0;
144
	PC = xPC ? xPC[0] : 0;
Line 206... Line 209...
206
	} while (*namp);
209
	} while (*namp);
207
	namp = "albcbtcdceclcmcrcsdcdldmdoedeik0k1k2k3k4k5k6k7k8k9hoicimipkdkekhklkrkskullndnlpcrcscsesfsosrtatetiupvbvsveALDLUPDOLERI";
210
	namp = "albcbtcdceclcmcrcsdcdldmdoedeik0k1k2k3k4k5k6k7k8k9hoicimipkdkekhklkrkskullndnlpcrcscsesfsosrtatetiupvbvsveALDLUPDOLERI";
208
	sp = sstrs;
211
	sp = sstrs;
209
	do {
212
	do {
210
		string = tgetstr(namp, &aoftspace);
213
		string = tgetstr(namp, &aoftspace);
-
 
214
 
211
		*(*sp++) = string;
215
		*(*sp++) = string;
212
		namp += 2;
216
		namp += 2;
213
	} while (*namp);
217
	} while (*namp);
214
}
218
}
215
 
219
 
Line 257... Line 261...
257
cost(str)
261
cost(str)
258
char *str;
262
char *str;
259
{
263
{
260
	int countnum();
264
	int countnum();
261
 
265
 
-
 
266
 
-
 
267
 
262
	if (str == NULL || *str=='O')	/* OOPS */
268
	if (str == NULL || *str=='O'){	/* OOPS */
263
		return 10000;	/* infinity */
269
		return 10000;	/* infinity */
-
 
270
	}
264
	costnum = 0;
271
	costnum = 0;
265
	tputs(str, LINES, countnum);
272
	tputs(str, LINES, countnum);
266
	return costnum;
273
	return costnum;
267
}
274
}
268
 
275