projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
BSD 4_3_Reno release
[unix-history]
/
usr
/
src
/
usr.bin
/
ex
/
ex_vget.c
diff --git
a/usr/src/usr.bin/ex/ex_vget.c
b/usr/src/usr.bin/ex/ex_vget.c
index
0bc7647
..
2f8ecc3
100644
(file)
--- a/
usr/src/usr.bin/ex/ex_vget.c
+++ b/
usr/src/usr.bin/ex/ex_vget.c
@@
-5,7
+5,7
@@
*/
#ifndef lint
*/
#ifndef lint
-static char
sccsid[] = "@(#)ex_vget.c 5.1.1.1 (Berkeley) %G%
";
+static char
*sccsid = "@(#)ex_vget.c 6.13 (Berkeley) 9/11/89
";
#endif not lint
#include "ex.h"
#endif not lint
#include "ex.h"
@@
-26,8
+26,8
@@
ungetkey(c)
int c; /* mjm: char --> int */
{
int c; /* mjm: char --> int */
{
- if (Peekkey != ATTN)
- Peekkey = c;
+ if (Peek
_
key != ATTN)
+ Peek
_
key = c;
}
/*
}
/*
@@
-51,8
+51,8
@@
getkey()
peekbr()
{
peekbr()
{
- Peekkey = getbr();
- return (Peekkey == 0);
+ Peek
_
key = getbr();
+ return (Peek
_
key == 0);
}
short precbksl;
}
short precbksl;
@@
-74,7
+74,6
@@
getbr()
char ch;
register int c, d;
register char *colp;
char ch;
register int c, d;
register char *colp;
- int cnt;
#define BEEHIVE
#ifdef BEEHIVE
static char Peek2key;
#define BEEHIVE
#ifdef BEEHIVE
static char Peek2key;
@@
-82,9
+81,9
@@
getbr()
extern short slevel, ttyindes;
getATTN:
extern short slevel, ttyindes;
getATTN:
- if (Peekkey) {
- c = Peekkey;
- Peekkey = 0;
+ if (Peek
_
key) {
+ c = Peek
_
key;
+ Peek
_
key = 0;
return (c);
}
#ifdef BEEHIVE
return (c);
}
#ifdef BEEHIVE
@@
-115,7
+114,11
@@
again:
if (setjmp(readbuf))
goto getATTN;
doingread = 1;
if (setjmp(readbuf))
goto getATTN;
doingread = 1;
+#ifndef vms
c = read(slevel == 0 ? 0 : ttyindes, &ch, 1);
c = read(slevel == 0 ? 0 : ttyindes, &ch, 1);
+#else
+ c = vms_read(slevel == 0 ? 0 : ttyindes, &ch, 1);
+#endif
doingread = 0;
if (c != 1) {
if (errno == EINTR)
doingread = 0;
if (c != 1) {
if (errno == EINTR)
@@
-134,7
+137,7
@@
again:
Peek2key = 0;
break;
case 'q': /* f2 -> ^C */
Peek2key = 0;
break;
case 'q': /* f2 -> ^C */
- c = CTRL(
c
);
+ c = CTRL(
'c'
);
Peek2key = 0;
break;
case 'p': /* f1 -> esc */
Peek2key = 0;
break;
case 'p': /* f1 -> esc */
@@
-172,14
+175,14
@@
again:
}
if (precbksl == 2) {
if (!d) {
}
if (precbksl == 2) {
if (!d) {
- Peekkey = c;
+ Peek
_
key = c;
precbksl = 0;
c = '\\';
}
} else if (d)
c = d;
else {
precbksl = 0;
c = '\\';
}
} else if (d)
c = d;
else {
- Peekkey = c;
+ Peek
_
key = c;
precbksl = 0;
c = '\\';
}
precbksl = 0;
c = '\\';
}
@@
-213,8
+216,8
@@
getesc()
c = getkey();
switch (c) {
c = getkey();
switch (c) {
- case CTRL(
v
):
- case CTRL(
q
):
+ case CTRL(
'v'
):
+ case CTRL(
'q'
):
c = getkey();
return (c);
c = getkey();
return (c);
@@
-235,8
+238,8
@@
getesc()
peekkey()
{
peekkey()
{
- Peekkey = getkey();
- return (Peekkey);
+ Peek
_
key = getkey();
+ return (Peek
_
key);
}
/*
}
/*
@@
-257,7
+260,7
@@
readecho(c)
vclrech(0);
splitw++;
vgoto(WECHO, 0);
vclrech(0);
splitw++;
vgoto(WECHO, 0);
- putchar(c);
+
ex_
putchar(c);
vclreol();
vgoto(WECHO, 1);
cursor = linebuf; linebuf[0] = 0; genbuf[0] = c;
vclreol();
vgoto(WECHO, 1);
cursor = linebuf; linebuf[0] = 0; genbuf[0] = c;
@@
-269,21
+272,21
@@
readecho(c)
OP = Pline; Pline = normline;
ignore(vgetline(0, genbuf + 1, &waste, c));
if (Outchar == termchar)
OP = Pline; Pline = normline;
ignore(vgetline(0, genbuf + 1, &waste, c));
if (Outchar == termchar)
- putchar('\n');
+
ex_
putchar('\n');
vscrap();
Pline = OP;
vscrap();
Pline = OP;
- if (Peek
key != ATTN && Peekkey != QUIT && Peekkey != CTRL(h
)) {
+ if (Peek
_key != ATTN && Peek_key != QUIT && Peek_key != CTRL('h'
)) {
cursor = sc;
vclreol();
return (0);
}
blewit:
cursor = sc;
vclreol();
return (0);
}
blewit:
- OPeek = Peek
key==CTRL(h) ? 0 : Peekkey; Peek
key = 0;
+ OPeek = Peek
_key==CTRL('h') ? 0 : Peek_key; Peek_
key = 0;
splitw = 0;
vclean();
vshow(dot, NOLINE);
vnline(sc);
splitw = 0;
vclean();
vshow(dot, NOLINE);
vnline(sc);
- Peekkey = OPeek;
+ Peek
_
key = OPeek;
return (1);
}
return (1);
}
@@
-323,13
+326,13
@@
addtext(cp)
setDEL()
{
setDEL()
{
- setBUF(DEL);
+
ex_
setBUF(DEL);
}
/*
* Put text from cursor upto wcursor in BUF.
*/
}
/*
* Put text from cursor upto wcursor in BUF.
*/
-setBUF(BUF)
+
ex_
setBUF(BUF)
register char *BUF;
{
register int c;
register char *BUF;
{
register int c;
@@
-372,14
+375,14
@@
noteit(must)
if (WBOT == WECHO)
vmoveitup(1, 1);
vigoto(WECHO, 0);
if (WBOT == WECHO)
vmoveitup(1, 1);
vigoto(WECHO, 0);
- printf("%d %sline", notecnt, notesgn);
+
ex_
printf("%d %sline", notecnt, notesgn);
if (notecnt > 1)
if (notecnt > 1)
- putchar('s');
+
ex_
putchar('s');
if (*notenam) {
if (*notenam) {
- printf(" %s", notenam);
+
ex_
printf(" %s", notenam);
if (*(strend(notenam) - 1) != 'e')
if (*(strend(notenam) - 1) != 'e')
- putchar('e');
- putchar('d');
+
ex_
putchar('e');
+
ex_
putchar('d');
}
vclreol();
notecnt = 0;
}
vclreol();
notecnt = 0;
@@
-402,7
+405,7
@@
beep()
if (VB)
vputp(VB, 0);
else
if (VB)
vputp(VB, 0);
else
- vputc(CTRL(
g
));
+ vputc(CTRL(
'g'
));
}
/*
}
/*
@@
-636,7
+639,7
@@
vgetcnt()
fastpeekkey()
{
int trapalarm();
fastpeekkey()
{
int trapalarm();
-
int
(*Oint)();
+
void
(*Oint)();
register int c;
/*
register int c;
/*
@@
-652,31
+655,31
@@
fastpeekkey()
*/
#ifdef MDEBUG
if (trace)
*/
#ifdef MDEBUG
if (trace)
- fprintf(trace,"\nfastpeekkey: "
,c
);
+ fprintf(trace,"\nfastpeekkey: ");
#endif
Oint = signal(SIGINT, trapalarm);
#endif
Oint = signal(SIGINT, trapalarm);
- if (value(TIMEOUT) && inopen >= 0) {
- signal(SIGALRM, trapalarm);
+ CATCH
+ if (value(TIMEOUT) && inopen >= 0) {
+ signal(SIGALRM, trapalarm);
#ifdef MDEBUG
#ifdef MDEBUG
- alarm(10);
- if (trace)
- fprintf(trace, "set alarm ");
+
alarm(10);
+
if (trace)
+
fprintf(trace, "set alarm ");
#else
#else
- alarm(1);
+
alarm(1);
#endif
#endif
- }
- CATCH
+ }
c = peekkey();
c = peekkey();
+ alarm(0);
#ifdef MDEBUG
#ifdef MDEBUG
- if (trace)
-
fprintf(trace,"[OK]",c
);
+
if (trace)
+
fprintf(trace,"[OK]"
);
#endif
#endif
- alarm(0);
ONERR
c = 0;
#ifdef MDEBUG
ONERR
c = 0;
#ifdef MDEBUG
- if (trace)
-
fprintf(trace,"[TIMEOUT]",c
);
+
if (trace)
+
fprintf(trace,"[TIMEOUT]"
);
#endif
ENDCATCH
#ifdef MDEBUG
#endif
ENDCATCH
#ifdef MDEBUG