Subversion Repositories planix.SVN

Compare Revisions

Ignore whitespace Rev 117 → Rev 118

/ports/trunk/editors/rvi/Makefile
28,10 → 28,10
BINDIR = bin
DESTDIR = /usr/local
DEBUGFLAGS= -DTRACE -g
NONDEBUGFLAGS= -O
NONDEBUGFLAGS= -O0
DEB= $(NONDEBUGFLAGS) # or $(DEBUGFLAGS) to to debug
# this should be correct for any modern Unix
OPTIONS=-DLISPCODE -DCHDIR -DFASTTAG -DUSG3TTY -DVMUNIX -DBIGMEM -D_BSD_EXTENSION -DTRACE
OPTIONS=-DLISPCODE -DCHDIR -DFASTTAG -DUSG3TTY -DVMUNIX -DBIGMEM -D_BSD_EXTENSION -DTRACE -g -O0
# define to use ISO-8859-X character sets
#OPTIONS += -DISO
LDFLAGS=
46,7 → 46,7
ex_data.o ex_extern.o ex_get.o ex_io.o ex_put.o ex_re.o \
ex_set.o ex_subr.o ex_tagio.o ex_temp.o ex_tty.o ex_unix.o \
ex_v.o ex_vadj.o ex_vget.o ex_vmain.o ex_voper.o \
ex_vops.o ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o
ex_vops.o ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o mach.o
 
HDRS= ex.h ex_argv.h ex_re.h ex_temp.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h
SRC1= ex.c ex_addr.c ex_cmds.c ex_cmds2.c ex_cmdsub.c
/ports/trunk/editors/rvi/ex_cmds.c
787,7 → 787,7
nonzero();
if (seensemi)
addr1 = addr2;
getline(*addr1);
ex_getline(*addr1);
if (c == CTRL('k')) {
flush1();
destline--;
/ports/trunk/editors/rvi/ex_cmdsub.c
211,7 → 211,7
cp = genbuf;
*cp = 0;
for (a1 = addr1; a1 <= addr2; a1++) {
getline(*a1);
ex_getline(*a1);
cp1 = linebuf;
if (a1 != addr1 && c == 0) {
while (*cp1 == ' ' || *cp1 == '\t')
332,7 → 332,7
 
if (tad1 > addr2)
return (EOF);
getline(*tad1++);
ex_getline(*tad1++);
return (0);
}
 
344,7 → 344,7
 
if (tad1 > unddol)
return (EOF);
getline(*tad1++);
ex_getline(*tad1++);
tad1++;
return (0);
}
388,12 → 388,12
if (!kill)
getDOT();
strcpy(genbuf, linebuf);
getline(*unddol);
ex_getline(*unddol);
if (kill)
*pkill[1] = 0;
strcat(linebuf, gp);
putmark(unddol);
getline(dol[1]);
ex_getline(dol[1]);
if (kill)
strcLIN(pkill[0]);
strcpy(gp, linebuf);
839,7 → 839,7
if (addr1 > addr2)
return;
if (op == EOF && zhadpr) {
getline(*addr1);
ex_getline(*addr1);
putchar('\r' | QUOTE);
shudclob = 1;
} else if (znoclear == 0 && CL != NOSTR && !inopen) {
867,7 → 867,7
 
pofix();
for (addr = adr1; addr <= adr2; addr++) {
getline(*addr);
ex_getline(*addr);
pline(lineno(addr));
if (inopen)
putchar('\n' | QUOTE);
/ports/trunk/editors/rvi/ex_get.c
286,5 → 286,5
if (addr == zero)
lastin = 0;
else
getline(*addr), lastin = smunch(0, linebuf);
ex_getline(*addr), lastin = smunch(0, linebuf);
}
/ports/trunk/editors/rvi/ex_io.c
455,7 → 455,7
for (a=first; a<=last; a++) {
if (a==first+5 && last-first > 10)
a = last - 4;
getline(*a);
ex_getline(*a);
checkmodeline(linebuf);
}
}
729,7 → 729,7
nib = bsize;
fp = genbuf;
do {
getline(*a1++);
ex_getline(*a1++);
lp = linebuf;
for (;;) {
if (--nib < 0) {
/ports/trunk/editors/rvi/ex_put.c
4,14 → 4,14
* specifies the terms and conditions for redistribution.
*/
 
#if !defined(lint) && defined(DOSCCS)
static char *sccsid = "@(#)ex_put.c 7.9.1 (2.11BSD GTE) 12/9/94";
#endif
 
#include "ex.h"
#include "ex_tty.h"
#include "ex_vis.h"
 
 
#include "mach.h"
 
/*
* Terminal driving and line formatting routines.
* Basic motion optimizations are done here as well
238,6 → 238,8
 
flush1();
flush2();
 
fflush(stdout);
}
 
/*
1057,9 → 1059,9
*/
vcook()
{
 
tty.sg_flags &= ~RAW;
sTTY(1);
disable_raw();
// tty.sg_flags &= ~RAW;
// sTTY(1);
}
 
/*
1067,9 → 1069,10
*/
vraw()
{
enable_raw();
 
tty.sg_flags |= RAW;
sTTY(1);
// tty.sg_flags |= RAW;
// sTTY(1);
}
#endif
 
/ports/trunk/editors/rvi/ex_re.c
775,7 → 775,7
if (addr == zero)
return (0);
p1 = linebuf;
getline(*addr);
ex_getline(*addr);
locs = 0;
}
p2 = expbuf;
/ports/trunk/editors/rvi/ex_subr.c
169,7 → 169,7
getDOT()
{
 
getline(*dot);
ex_getline(*dot);
}
 
line *
/ports/trunk/editors/rvi/ex_temp.c
97,7 → 97,7
}
}
 
getline(tl)
ex_getline(tl)
line tl;
{
register char *bp, *lp;
561,7 → 561,7
}
CP(savelb,linebuf);
for (addr = addr1; addr <= addr2; addr++) {
getline(*addr);
ex_getline(*addr);
if (sp->rg_flags) {
if (addr == addr2)
*wcursor = 0;
/ports/trunk/editors/rvi/ex_tty.c
21,7 → 21,7
 
gettmode()
{
/*a XXX
/* a XXX
#ifndef USG3TTY
if (gtty(1, &tty) < 0)
return;
58,12 → 58,13
char **fkeys[10] = {
&F0, &F1, &F2, &F3, &F4, &F5, &F6, &F7, &F8, &F9
};
 
setterm(type)
char *type;
{
char *tgoto();
register int unknown;
char ltcbuf[TCBUFSIZE];
char ltcbuf[TCBUFSIZE+4096];
 
if (type[0] == 0)
type = "xx";
76,6 → 77,7
unknown++;
CP(ltcbuf, "xx|dumb:");
}
 
setsize();
aoftspace = tspace;
zap();
134,6 → 136,7
CA = 0, CM = 0;
}
costSR = cost(SR);
 
costAL = cost(AL);
costDP = cost(tgoto(DOWN_PARM, 10, 10));
costLP = cost(tgoto(LEFT_PARM, 10, 10));
208,6 → 211,7
sp = sstrs;
do {
string = tgetstr(namp, &aoftspace);
 
*(*sp++) = string;
namp += 2;
} while (*namp);
259,8 → 263,11
{
int countnum();
 
if (str == NULL || *str=='O') /* OOPS */
 
 
if (str == NULL || *str=='O'){ /* OOPS */
return 10000; /* infinity */
}
costnum = 0;
tputs(str, LINES, countnum);
return costnum;
/ports/trunk/editors/rvi/ex_tty.h
32,7 → 32,7
* before the capability to say 12 milliseconds per affected whatever
* (currently always line). Capabilities where this makes sense say P*.
*/
var char tspace[256]; /* Space for capability strings */
var char tspace[1024]; /* Space for capability strings */
var char *aoftspace; /* Address of tspace for relocation */
 
var char *AL; /* P* Add new blank line */
/ports/trunk/editors/rvi/ex_v.c
237,6 → 237,8
savevis();
Outchar = vputchar;
vmoving = 0;
 
enable_raw();
f = ostart();
if (initev == 0) {
vcontext(dot, c);
/ports/trunk/editors/rvi/ex_vadj.c
66,7 → 66,7
* and so its not worth optimizing.
*/
vdirty(vcline+1, WECHO);
getline(*tp);
ex_getline(*tp);
 
/*
* If we are opening at the top of the window, can try a window
657,7 → 657,7
if (l == vcline)
strcLIN(temp);
else
getline(*tp);
ex_getline(*tp);
 
/*
* Delete junk between displayed lines.
701,7 → 701,7
 
vcline = l;
for (; tp <= dol && Peekkey != ATTN; tp++) {
getline(*tp);
ex_getline(*tp);
if (p + vdepth() - 1 > WBOT)
break;
vopen(tp, p);
872,7 → 872,7
if (l == vcline)
strcLIN(temp);
else
getline(dot[l - vcline]);
ex_getline(dot[l - vcline]);
/*
* Be careful that a long line doesn't cause the
* screen to shoot up.
/ports/trunk/editors/rvi/ex_vget.c
592,7 → 592,7
fprintf(trace, "linebuf = '%s'\n", linebuf);
for (p=zero+1; p<=truedol; p++) {
fprintf(trace, "%o ", *p);
getline(*p);
ex_getline(*p);
fprintf(trace, "'%s'\n", linebuf);
}
fprintf(trace, "]\n");
/ports/trunk/editors/rvi/ex_voper.c
579,7 → 579,7
markDOT();
if (wcursor) {
vsave();
getline(*wdot);
ex_getline(*wdot);
if (wcursor > strend(linebuf))
wcursor = 0;
getDOT();
/ports/trunk/editors/rvi/ex_vops.c
462,7 → 462,7
*/
*cursor = 0;
strcpy(genbuf, linebuf);
getline(*wdot);
ex_getline(*wdot);
if (strlen(genbuf) + strlen(wcursor) > LBSIZE - 2) {
getDOT();
beep();
828,7 → 828,7
if (vpastwh(linebuf) >= cursor)
wcursor = 0;
else {
getline(*wdot);
ex_getline(*wdot);
wcursor = strend(linebuf);
getDOT();
}
/ports/trunk/editors/rvi/ex_vops3.c
282,7 → 282,7
register int cnt = 0;
 
addr--;
getline(*addr);
ex_getline(*addr);
for (cp = linebuf; *cp; cp++)
if (*cp == '(')
cnt++;
482,7 → 482,7
return (0);
}
wdot++;
getline(*wdot);
ex_getline(*wdot);
wcursor = linebuf;
return (1);
} else {
498,7 → 498,7
return (0);
}
wdot--;
getline(*wdot);
ex_getline(*wdot);
wcursor = linebuf[0] == 0 ? linebuf : strend(linebuf) - 1;
return (1);
}
517,7 → 517,7
addr -= dir;
break;
}
getline(*addr);
ex_getline(*addr);
if (linebuf[0] == '{' ||
#ifdef LISPCODE
value(LISP) && linebuf[0] == '(' ||
525,7 → 525,7
isa(svalue(SECTIONS))) {
if (c == ']' && f != vmove) {
addr--;
getline(*addr);
ex_getline(*addr);
}
break;
}
/ports/trunk/editors/rvi/ex_vwind.c
182,7 → 182,7
{
register line *top;
 
getline(*addr);
ex_getline(*addr);
if (state != VISUAL)
top = addr;
else switch (where) {
189,17 → 189,17
 
case '^':
addr = vback(addr, basWLINES - vdepth());
getline(*addr);
ex_getline(*addr);
/* fall into ... */
 
case '-':
top = vback(addr, basWLINES - vdepth());
getline(*addr);
ex_getline(*addr);
break;
 
case '.':
top = vback(addr, basWLINES / 2 - vdepth());
getline(*addr);
ex_getline(*addr);
break;
 
default:
314,7 → 314,7
 
if (cnt > 0)
for (; tp > one; tp--) {
getline(tp[-1]);
ex_getline(tp[-1]);
d = vdepth();
if (d > cnt)
break;
335,7 → 335,7
j = 0;
while (cnt > 0) {
cnt--;
getline(tp[cnt]);
ex_getline(tp[cnt]);
j += vdepth();
}
if (tp > dot)
/ports/trunk/editors/rvi/mach.c
0,0 → 1,31
/*
* Copyright (c) 2019 The PLANIX Project,
* All rights reserved.
*
* The Berkeley software License Agreement specifies the terms
* and conditions for redistribution.
*
*/
 
#include <stdlib.h>
#include <termios.h>
#include <unistd.h>
 
struct termios orig_termios;
 
void
disable_raw()
{
tcsetattr(STDIN_FILENO, TCSAFLUSH, &orig_termios);
}
 
void
enable_raw()
{
tcgetattr(STDIN_FILENO, &orig_termios);
atexit(disable_raw);
struct termios raw = orig_termios;
raw.c_iflag &= ~(IXON);
raw.c_lflag &= ~(ECHO | ICANON | ISIG);
tcsetattr(STDIN_FILENO, TCSAFLUSH, &raw);
}