Subversion Repositories planix.SVN

Compare Revisions

Ignore whitespace Rev 112 → Rev 113

/ports/trunk/editors/rvi/Makefile
28,7 → 28,7
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
35,11 → 35,11
# define to use ISO-8859-X character sets
#OPTIONS += -DISO
LDFLAGS=
TERMLIB = -ltermlib
TERMLIB = -ltermcap
 
# That's it.
 
CFLAGS= $(OPTIONS) $(DEB) -DUSG3TTY -DVMUNIX
CFLAGS= $(OPTIONS) $(DEB) -DUSG3TTY -DVMUNIX -g
INCLUDE=/usr/include
OBJS= ex.o ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o \
ex_data.o ex_extern.o ex_get.o ex_io.o ex_put.o ex_re.o \
/ports/trunk/editors/rvi/ex.c
88,6 → 88,8
register int ac;
register char *av[];
{
 
#ifndef VMUNIX
char *erpath = EXSTRINGS;
#endif
110,6 → 112,8
mallopt(M_MMAP_THRESHOLD, 0);
#endif
 
 
/*
* Immediately grab the tty modes so that we wont
* get messed up if an interrupt comes in quickly.
227,7 → 231,7
ac--, av++;
itag = 1;
/* BUG: should check for too long tag. */
CP(lasttag, av[0]);
strcpy(lasttag, av[0]);
}
break;
 
292,7 → 296,7
filioerr(EXRECOVER);
exit(1);
}
CP(savedfile, *av++), ac--;
strcpy(savedfile, *av++), ac--;
}
 
/*
312,7 → 316,7
intty = isatty(0);
value(PROMPT) = intty;
if (cp = getenv("SHELL"))
CP(shell, cp);
strcpy(shell, cp);
if (fast || !intty)
setterm("dumb");
else {
/ports/trunk/editors/rvi/ex.h
282,7 → 282,9
/*
* Macros
*/
#define CP(a, b) (ignore(strcpy(a, b)))
/*#define CP(a, b) (ignore(strcpy(a, b)))*/
#define CP(a,b) error error error
 
/*
* FIXUNDO: do we want to mung undo vars?
* Usually yes unless in a macro or global.
371,11 → 373,11
#define NOSTR (char *) 0
#define NOLINE (line *) 0
 
extern int (*Outchar)();
extern void (*Outchar)(int);
extern int (*Pline)();
extern int (*Putchar)();
extern void (*Putchar)(short);
void (*oldhup)();
int (*setlist())();
void (*setlist())();
int (*setnorm())();
int (*setnorm())();
int (*setnumb())();
405,7 → 407,7
char *vpastwh();
char *vskipwh();
void put();
int putreg();
void putreg();
int YANKreg();
int delete();
int execl();
414,7 → 416,7
int getsub();
int gettty();
int join();
int listchar();
void listchar(short);
off_t lseek();
void normchar(short);
int normline();
425,13 → 427,13
void onsusp();
int putch();
int shift();
int termchar();
int vfilter();
void termchar();
void vfilter();
#ifdef CBREAK
void vintr();
#endif
int vputch();
int vshftop();
void vshftop();
int yank();
 
int tgets(char *, int cnt, int fd);
/ports/trunk/editors/rvi/ex_cmds2.c
16,8 → 16,7
 
extern bool pflag, nflag; /* mjm: extern; also in ex_cmds.c */
extern int poffset; /* mjm: extern; also in ex_cmds.c */
void
vcontin(bool ask);
void vcontin(bool ask);
void resetflav();
void setflav();
void error0();
253,8 → 252,8
morargc = argc;
isalt = (strcmp(altfile, args)==0) + 1;
if (savedfile[0])
CP(altfile, savedfile);
CP(savedfile, args);
strcpy(altfile, savedfile);
strcpy(savedfile, args);
argc--;
args = argv ? *++argv : strend(args) + 1;
}
481,8 → 480,7
* Continue after a : command from open/visual.
*/
void
vcontin(ask)
bool ask;
vcontin(bool ask)
{
 
if (vcnt > 0)
/ports/trunk/editors/rvi/ex_cmdsub.c
462,7 → 462,7
}
if (cp + strlen(dp = vpastwh(linebuf)) >= &genbuf[LBSIZE - 2])
error("Line too long|Result line after shift would be too long");
CP(cp, dp);
strcpy(cp, dp);
strcLIN(genbuf);
putmark(addr);
}
518,7 → 518,7
/*
* Loop once for each file in tags "path".
*/
CP(tagfbuf, svalue(TAGS));
strcpy(tagfbuf, svalue(TAGS));
fne = tagfbuf - 1;
while (fne) {
fn = ++fne;
1256,14 → 1256,14
/* Check is a bit conservative, we charge for dname even if reusing src */
if (msnext - mapspace + strlen(dest) + strlen(src) + strlen(dname) + 3 > MAXCHARMACS)
error("Too much macro text");
CP(msnext, src);
strcpy(msnext, src);
mp[slot].cap = msnext;
msnext += strlen(src) + 1; /* plus 1 for null on the end */
CP(msnext, dest);
strcpy(msnext, dest);
mp[slot].mapto = msnext;
msnext += strlen(dest) + 1;
if (dname) {
CP(msnext, dname);
strcpy(msnext, dname);
mp[slot].descr = msnext;
msnext += strlen(dname) + 1;
} else {
/ports/trunk/editors/rvi/ex_get.c
228,7 → 228,7
for (; c > 0; c--)
*cp++ = ' ';
}
CP(cp, genbuf);
strcpy(cp, genbuf);
if (linebuf[0] == '.' && linebuf[1] == 0)
return (EOF);
return (0);
261,7 → 261,7
 
default:
cp--;
CP(ocp, cp);
strcpy(ocp, cp);
return (col);
}
}
/ports/trunk/editors/rvi/ex_io.c
56,7 → 56,7
if (endcmd(d)) {
if (savedfile[0] == 0 && comm != 'f')
error("No file|No current filename");
CP(file, savedfile);
strcpy(file, savedfile);
wasalt = (isalt > 0) ? isalt-1 : 0;
isalt = 0;
oldadot = altdot;
83,9 → 83,9
case 'e':
if (savedfile[0]) {
altdot = lineDOT();
CP(altfile, savedfile);
strcpy(altfile, savedfile);
}
CP(savedfile, file);
strcpy(savedfile, file);
break;
 
default:
92,7 → 92,7
if (file[0]) {
if (c != 'E')
altdot = lineDOT();
CP(altfile, file);
strcpy(altfile, file);
}
break;
}
148,7 → 148,7
}
if (skipend())
return (0);
CP(genbuf, "echo "); cp = &genbuf[5];
strcpy(genbuf, "echo "); cp = &genbuf[5];
for (;;) {
c = getchar();
if (endcmd(c)) {
314,7 → 314,7
if (strlen(str) > FNSIZE - 4)
error("Filename too long");
samef:
CP(file, str);
strcpy(file, str);
}
 
/*
553,7 → 553,7
saddr2=addr2;
addr1=one;
addr2=dol;
CP(file, savedfile);
strcpy(file, savedfile);
if (inopen) {
vclrech(0);
splitw++;
/ports/trunk/editors/rvi/ex_put.c
28,8 → 28,8
* During open/visual, outchar and putchar will be set to
* routines in the file ex_vput.c (vputchar, vinschar, etc.).
*/
int (*Outchar)() = termchar;
int (*Putchar)() = normchar;
void (*Outchar)() = termchar;
void (*Putchar)(short) = normchar;
int (*Pline)() = normline;
void
pstop();
37,12 → 37,13
pstart();
void slobber(int c);
void normchar(short c);
void listchar(short c);
 
int (*
void (*
setlist(t))()
bool t;
{
register int (*P)();
register void (*P)();
 
listf = t;
P = Putchar;
66,8 → 67,8
* Format c for list mode; leave things in common
* with normal print mode to be done by normchar.
*/
listchar(c)
register short c;
void
listchar(short c)
{
 
c &= (TRIM|QUOTE);
100,8 → 101,7
* Format c for printing.
*/
void
normchar(c)
register short c;
normchar(short c)
{
register char *colp;
 
223,6 → 223,7
* Otherwise flush into next level of buffering when
* small buffer fills or at a newline.
*/
void
termchar(c)
int c;
{
861,7 → 862,7
lprintf(cp, dp)
char *cp, *dp;
{
register int (*P)();
register void (*P)();
 
P = setlist(1);
printf(cp, dp);
/ports/trunk/editors/rvi/ex_re.c
289,7 → 289,7
char orhsbuf[RHSSIZE];
 
rp = rhsbuf;
CP(orhsbuf, rp);
strcpy(orhsbuf, rp);
for (;;) {
c = getchar();
if (c == seof)
/ports/trunk/editors/rvi/ex_set.c
145,7 → 145,7
error("Can't change type of terminal from within open/visual");
setterm(optname);
} else {
CP(op->osvalue, optname);
strcpy(op->osvalue, optname);
op->odefault = 1;
}
break;
/ports/trunk/editors/rvi/ex_subr.c
13,6 → 13,14
#include "ex_tty.h"
#include "ex_vis.h"
 
void
save(line *a1, line *a2);
void qcount(int c);
void
netchange(int i);
void
killcnt(int cnt);
 
/*
* Random routines, in alphabetical order.
*/
139,7 → 147,7
genbuf[0] = 0;
return (i);
}
CP(genindent(i), cp);
strcpy(genindent(i), cp);
return (i);
}
 
244,6 → 252,7
killcnt(addr2 - addr1 + 1);
}
 
void
killcnt(cnt)
register int cnt;
{
345,6 → 354,7
}
 
/*VARARGS2*/
void
merror(seekpt, i)
#ifdef VMUNIX
char *seekpt;
390,7 → 400,7
#else
lseek(erfile, (long) seekpt, 0);
if (read(erfile, linebuf, 128) < 2)
CP(linebuf, "ERROR");
strcpy(linebuf, "ERROR");
#endif
}
 
435,6 → 445,7
netchange(lineDOL() - cnt);
}
 
void
netchange(i)
register int i;
{
486,7 → 497,6
return (i == 1 ? "" : "s");
}
 
int qcount();
short vcntcol;
 
qcolumn(lim, gp)
493,7 → 503,7
register char *lim, *gp;
{
register int x;
int (*OO)();
void (*OO)();
 
OO = Outchar;
Outchar = qcount;
510,7 → 520,7
return (vcntcol);
}
 
int
void
qcount(c)
int c;
{
522,6 → 532,7
vcntcol++;
}
 
void
reverse(a1, a2)
register line *a1, *a2;
{
536,6 → 547,7
}
}
 
void
save(a1, a2)
line *a1;
register line *a2;
610,6 → 622,7
}
 
/*VARARGS2*/
void
smerror(seekpt, cp)
#ifdef lint
char *seekpt;
645,7 → 658,7
char *dp;
{
 
CP(linebuf, dp);
strcpy(linebuf, dp);
}
 
syserror()
680,7 → 693,7
int i;
{
register char *cp;
register int (*OO)() = Outchar;
register void (*OO)() = Outchar;
 
Outchar = qcount;
ignore(qcolumn(linebuf - 1, NOSTR));
/ports/trunk/editors/rvi/ex_temp.c
13,6 → 13,9
#include "ex_vis.h"
#include "ex_tty.h"
 
void rbflush();
void blkio(short , char * , int (*f)());
 
/*
* Editor temporary file routines.
* Very similar to those of ed, except uses 2 input buffers.
26,6 → 29,7
short tfile = -1;
short rfile = -1;
 
void
fileinit()
{
register char *p;
44,7 → 48,7
iblock = -1;
iblock2 = -1;
oblock = -1;
CP(tfname, svalue(DIRECTORY));
strcpy(tfname, svalue(DIRECTORY));
if (stat(tfname, &stbuf)) {
dumbness:
if (setexit() == 0)
206,10 → 210,12
int stilinc; /* up to here not written yet */
#endif
 
/*void
blkio(b, buf, iofcn)
short b;
char *buf;
int (*iofcn)();
int (*iofcn)(); */
void blkio(short b, char *buf , int (*iofcn)())
{
 
#ifdef VMUNIX
255,6 → 261,7
* Synchronize the state of the temporary file in case
* a crash occurs.
*/
void
synctmp()
{
register int cnt;
371,7 → 378,7
{
 
if (rfile == -1) {
CP(rfname, tfname);
strcpy(rfname, tfname);
*(strend(rfname) - 7) = 'R';
rfile = creat(rfname, 0600);
if (rfile < 0)
455,6 → 462,7
 
int getREG();
 
void
putreg(c)
char c;
{
559,7 → 567,7
rblock = 0;
rnleft = 0;
}
CP(savelb,linebuf);
strcpy(savelb,linebuf);
for (addr = addr1; addr <= addr2; addr++) {
getline(*addr);
if (sp->rg_flags) {
572,7 → 580,7
}
rbflush();
killed();
CP(linebuf,savelb);
strcpy(linebuf,savelb);
}
 
kshift()
610,6 → 618,7
*rbufcp = 0;
}
 
void
rbflush()
{
register struct strreg *sp = strp;
/ports/trunk/editors/rvi/ex_tty.c
74,7 → 74,7
#endif
if (tgetent(ltcbuf, type) != 1) {
unknown++;
CP(ltcbuf, "xx|dumb:");
strcpy(ltcbuf, "xx|dumb:");
}
setsize();
aoftspace = tspace;
140,7 → 140,7
costRP = cost(tgoto(RIGHT_PARM, 10, 10));
PC = xPC ? xPC[0] : 0;
aoftspace = tspace;
CP(ttytype, longname(ltcbuf, type));
strcpy(ttytype, longname(ltcbuf, type));
/* proper strings to change tty type */
termreset();
gettmode();
/ports/trunk/editors/rvi/ex_unix.c
29,7 → 29,7
char printub, puxb[UXBSIZE + sizeof (int)];
 
printub = 0;
CP(puxb, uxb);
strcpy(puxb, uxb);
c = getchar();
if (c == '\n' || c == EOF)
error("Incomplete shell escape command@- use 'shell' to get a shell");
/ports/trunk/editors/rvi/ex_v.c
13,6 → 13,11
#include "ex_tty.h"
#include "ex_vis.h"
 
void vsetsiz(int size);
void
savevis();
 
 
/*
* Entry points to open and visual from command mode processor.
* The open/visual code breaks down roughly as follows:
179,9 → 184,20
netchHAD(Vlines);
}
 
 
/*
#define _RESEARCH_SOURCE
#include <libv.h>
#include <stdlib.h>
#include <unistd.h>
#include <termios.h>
*/
 
 
/*
* Enter visual mode
*/
void
vop()
{
register int c;
280,6 → 296,7
* at some point, and then quit from the visual and undo
* you get the old file back. Somewhat weird.
*/
void
savevis()
{
 
427,6 → 444,7
* Set the size of the screen to size lines, to take effect the
* next time the screen is redrawn.
*/
void
vsetsiz(size)
int size;
{
/ports/trunk/editors/rvi/ex_vadj.c
12,6 → 12,20
#include "ex_tty.h"
#include "ex_vis.h"
 
void
sethard();
void vreplace(int l, int cnt, int newcnt);
void vsync1(int p);
void vdirty(int base, int i);
void vdellin(int p, int cnt, int l);
void vredraw(int p);
void vscrap();
void
vscroll(int cnt);
void
vmoveitup(int cnt, bool doclr);
 
 
/*
* Routines to deal with management of logical versus physical
* display, opening and redisplaying lines on the screen, and
406,9 → 420,15
* If doclr is true, do a clear eol if the terminal
* has standout (to prevent it from scrolling up)
*/
/*
void
vmoveitup(cnt, doclr)
register int cnt;
bool doclr;
*/
 
void
vmoveitup(int cnt, bool doclr)
{
 
if (cnt == 0)
439,6 → 459,7
/*
* Scroll the screen up cnt lines logically.
*/
void
vscroll(cnt)
register int cnt;
{
471,6 → 492,7
/*
* Discard logical lines due to physical wandering off the screen.
*/
void
vscrap()
{
register int i, j;
521,6 → 543,7
* Repaint the screen, with cursor at curs, aftern an arbitrary change.
* Handle notification on large changes.
*/
void
vrepaint(curs)
char *curs;
{
611,6 → 634,7
* line after last won't completely fit. The routine vsync is
* more conservative and much less work on dumb terminals.
*/
void
vredraw(p)
register int p;
{
639,7 → 663,7
* search for first logical line affected by the redraw.
*/
vscrap();
CP(temp, linebuf);
strcpy(temp, linebuf);
l = 0;
tp = dot - vcline;
if (vcnt == 0)
732,6 → 756,7
* Do the real work in deleting cnt lines starting at line p from
* the display. First affected line is line l.
*/
void
vdellin(p, cnt, l)
int p, cnt, l;
{
831,6 → 856,7
* The guts of a sync. Similar to redraw but
* just less ambitous.
*/
void
vsync1(p)
register int p;
{
851,7 → 877,7
if (state == HARDOPEN || splitw)
return;
vscrap();
CP(temp, linebuf);
strcpy(temp, linebuf);
if (vcnt == 0)
LINE(0) = WTOP;
l = 0;
929,6 → 955,7
*
* Many boundary conditions here.
*/
void
vreplace(l, cnt, newcnt)
int l, cnt, newcnt;
{
1068,6 → 1095,7
* If we are in a scroll ^D within hardcopy open then all this
* is suppressed.
*/
void
sethard()
{
 
1088,6 → 1116,7
* as dirty so that they will be checked for correct
* display at next sync/redraw.
*/
void
vdirty(base, i)
register int base, i;
{
/ports/trunk/editors/rvi/ex_vget.c
12,6 → 12,21
#include "ex_tty.h"
#include "ex_vis.h"
 
void macpush(char *st , int canundo);
 
#ifdef BIT8
int addto(short *buf, char *str);
#else
void addto(char *buf, char *str);
#endif
 
 
 
void
setLAST();
void
addtext(char *cp);
 
/*
* Input routines for open/visual.
* We handle reading from the echo area here as well as notification on
256,6 → 271,7
* the purposes of repeat, so copy it from
* the working to the previous command buffer.
*/
void
setLAST()
{
 
265,7 → 281,7
lasthad = Xhadcnt;
lastcnt = Xcnt;
*lastcp = 0;
CP(lastcmd, workcmd);
strcpy(lastcmd, workcmd);
}
 
/*
273,6 → 289,7
* If the insertion buffer oveflows, then destroy
* the repeatability of the insert.
*/
void
addtext(cp)
char *cp;
{
314,8 → 331,12
*wp = c;
}
 
 
/* XXX what is this???:
#ifdef BIT8
int
#else
void
#endif
addto(buf, str)
#ifndef BIT8
324,6 → 345,15
register short *buf;
register char *str;
#endif
*/
 
#ifdef BIT8
int addto(short *buf, char *str)
#else
void addto(char *buf, char *str)
#endif
 
{
 
if ((buf[0] & (QUOTE|TRIM)) == OVERBUF)
521,6 → 551,7
* is false for, for example, pushing back lookahead from fastpeekkey(),
* since otherwise two fast escapes can clobber our undo.
*/
void
macpush(st, canundo)
char *st;
int canundo;
558,6 → 589,7
}
 
#ifdef TRACE
void
visdump(s)
char *s;
{
575,6 → 607,7
tvliny();
}
 
void
vudump(s)
char *s;
{
588,7 → 621,7
fprintf(trace, " undadot=%d, dot=%d, dol=%d, unddol=%d, truedol=%d\n",
lineno(undadot), lineno(dot), lineno(dol), lineno(unddol), lineno(truedol));
fprintf(trace, " [\n");
CP(savelb, linebuf);
strcpy(savelb, linebuf);
fprintf(trace, "linebuf = '%s'\n", linebuf);
for (p=zero+1; p<=truedol; p++) {
fprintf(trace, "%o ", *p);
596,7 → 629,7
fprintf(trace, "'%s'\n", linebuf);
}
fprintf(trace, "]\n");
CP(linebuf, savelb);
strcpy(linebuf, savelb);
}
#endif
 
/ports/trunk/editors/rvi/ex_vis.h
227,9 → 227,9
var bool HADUP; /* This insert line started with ^ then ^D */
var bool HADZERO; /* This insert line started with 0 then ^D */
#ifndef BIT8
var char INS[VBSIZE]; /* Last inserted text */
char INS[VBSIZE]; /* Last inserted text */
#else
var short INS[VBSIZE]; /* Last inserted text */
short INS[VBSIZE]; /* Last inserted text */
#endif
var int Vlines; /* Number of file lines "before" vi command */
var int Xcnt; /* External variable holding last cmd's count */
296,12 → 296,12
* Function types
*/
int beep();
int qcount();
int vchange();
int vdelete();
void qcount();
void vchange();
void vdelete();
int vgrabit();
int vinschar();
int vmove();
int vputchar();
void vinschar();
void vmove();
void vputchar();
int vshift();
int vyankit();
void vyankit();
/ports/trunk/editors/rvi/ex_vmain.c
8,10 → 8,18
static char *sccsid = "@(#)ex_vmain.c 7.7 (Berkeley) 6/7/85";
#endif
 
 
#include "ex.h"
#include "ex_tty.h"
#include "ex_vis.h"
 
 
 
 
void vzop();
void vsave();
 
 
#ifdef BIT8
short *ss_strcpy(dest, src)
short *dest;
77,6 → 85,7
 
#define forbid(a) { if (a) goto fonfon; }
 
void
vmain()
{
register int c, cnt, i;
91,7 → 100,8
line *addr;
int ind, nlput;
int shouldpo = 0;
int onumber, olist, (*OPline)(), (*OPutchar)();
int onumber, olist, (*OPline)();
void (*OPutchar)();
 
vch_mac = VC_NOTINMAC;
 
676,7 → 686,7
vundkind = VCHNG;
vmoving = 0;
#ifndef BIT8
CP(vutmp, linebuf);
strcpy(vutmp, linebuf);
#else
sc_strcpy(vutmp, linebuf);
#endif
1252,7 → 1262,9
* and addr2 surrounding cnt lines starting at dot.
*/
vremote(cnt, f, arg)
int cnt, (*f)(), arg;
int cnt;
void(*f)();
int arg;
{
register int oing = inglobal;
 
1271,11 → 1283,12
/*
* Save the current contents of linebuf, if it has changed.
*/
void
vsave()
{
char temp[LBSIZE];
 
CP(temp, linebuf);
strcpy(temp, linebuf);
if (FIXUNDO && vundkind == VCHNG || vundkind == VCAPU) {
/*
* If the undo state is saved in the temporary buffer
1316,6 → 1329,7
* Do a z operation.
* Code here is rather long, and very uninteresting.
*/
void
vzop(hadcnt, cnt, c)
bool hadcnt;
int cnt;
/ports/trunk/editors/rvi/ex_voper.c
15,6 → 15,8
#define blank() isspace(wcursor[0])
#define forbid(a) if (a) goto errlab;
 
void eend();
 
char vscandir[2] = { '/', 0 };
 
/*
27,6 → 29,7
* and if wcursor is zero, then the first non-blank location of the
* other line is implied.
*/
void
operate(c, cnt)
register int c, cnt;
{
619,9 → 622,9
if (!vglobp)
vscandir[0] = genbuf[0];
#ifndef BIT8
oglobp = globp; CP(vutmp, genbuf); globp = vutmp;
oglobp = globp; strcpy(vutmp, genbuf); globp = vutmp;
#else
oglobp = globp; CP((char*)vutmp, genbuf);
oglobp = globp; strcpy((char*)vutmp, genbuf);
globp = (char*)vutmp;
#endif
d = peekc;
794,6 → 797,7
* To end of word, with operator op and cnt more motions
* remaining after this.
*/
void
eend(op)
register int (*op)();
{
/ports/trunk/editors/rvi/ex_vops.c
12,6 → 12,16
#include "ex_tty.h"
#include "ex_vis.h"
 
 
void vshftop();
void vchange();
void vrep();
void vyankit();
void vfilter();
void vfilter();
void vshftop();
void vchange();
 
/*
* This file defines the operation sequences which interface the
* logical changes to the file buffer with the internal and external
37,6 → 47,7
char *vUA1, *vUA2;
char *vUD1, *vUD2;
 
void
vUndo()
{
 
48,7 → 59,7
return;
}
#ifndef BIT8
CP(vutmp, linebuf);
strcpy(vutmp, linebuf);
#else
sc_strcpy(vutmp, linebuf);
#endif
75,7 → 86,7
register char *cp;
char temp[LBSIZE];
bool savenote;
int (*OO)();
void (*OO)();
short oldhold = hold;
 
switch (vundkind) {
157,7 → 168,8
* Pseudo insert command.
*/
vcursat(cursor);
OO = Outchar; Outchar = vinschar; hold |= HOLDQIK;
OO = Outchar;
Outchar = vinschar; hold |= HOLDQIK;
vprepins();
temp[vUA2 - linebuf] = 0;
for (cp = &temp[vUA1 - linebuf]; *cp;)
185,6 → 197,7
* opposed to an ex command). This has nothing to do with being
* in open/visual mode as :s/foo/bar is not fromvis.
*/
void
vmacchng(fromvis)
bool fromvis;
{
220,7 → 233,7
vudump("before vmacchng hairy case");
#endif
savedot = dot; savedol = dol; savecursor = cursor;
CP(savelb, linebuf);
strcpy(savelb, linebuf);
nlines = dol - zero;
while ((line *) endcore - truedol < nlines)
morelines();
252,7 → 265,7
truedol -= nlines;
copyw(zero+1, truedol+1, nlines);
dot = savedot; dol = savedol ; cursor = savecursor;
CP(linebuf, savelb);
strcpy(linebuf, savelb);
vch_mac = VC_MANYCHANGE;
 
/* Arrange that no further undo saving happens within macro */
292,6 → 305,7
/*
* Move is simple, except for moving onto new lines in hardcopy open mode.
*/
void
vmove()
{
register int cnt;
369,6 → 383,7
* by vchange (although vchange may pass it back if it degenerates
* to a full line range delete.)
*/
void
vdelete(c)
char c;
{
406,7 → 421,7
i = vdcMID();
cp = cursor;
setDEL();
CP(cp, wcursor);
strcpy(cp, wcursor);
if (cp > linebuf && (cp[0] == 0 || c == '#'))
cp--;
if (state == HARDOPEN) {
429,6 → 444,7
* Across lines with both wcursor and wdot given, we delete
* and sync then append (but one operation for undo).
*/
void
vchange(c)
char c;
{
618,7 → 634,7
*/
cursor = cp;
setDEL();
CP(cursor, wcursor);
strcpy(cursor, wcursor);
if (state != HARDOPEN) {
vcursaft(cursor - 1);
doomed = i - cindent();
715,6 → 731,7
*/
char vshnam[2] = { 'x', 0 };
 
void
vshftop()
{
register line *addr;
738,6 → 755,7
*
* Filter portions of the buffer through unix commands.
*/
void
vfilter()
{
register line *addr;
877,6 → 895,7
* Replace a single character with the next input character.
* A funny kind of insert.
*/
void
vrep(cnt)
register int cnt;
{
898,7 → 917,7
ungetkey(c);
}
#ifndef BIT8
CP(vutmp, linebuf);
strcpy(vutmp, linebuf);
#else
sc_strcpy(vutmp, linebuf);
#endif
906,7 → 925,7
vundkind = VCHNG;
wcursor = cursor + cnt;
vUD1 = cursor; vUD2 = wcursor;
CP(cursor, wcursor);
strcpy(cursor, wcursor);
prepapp();
vappend('r', cnt, 0);
*lastcp++ = INS[0];
919,6 → 938,7
* Yanking to string registers occurs for free (essentially)
* in the routine xdw().
*/
void
vyankit()
{
register int cnt;
/ports/trunk/editors/rvi/ex_vops2.c
52,7 → 52,7
setLAST();
if (FIXUNDO)
#ifndef BIT8
vundkind = VCHNG, CP(vutmp, linebuf);
vundkind = VCHNG, strcpy(vutmp, linebuf);
#else
vundkind = VCHNG, sc_strcpy(vutmp, linebuf);
#endif
67,6 → 67,7
* in the VBSIZE buffer BUF. Used to save
* deleted text of part of line.
*/
void
takeout(BUF)
char *BUF;
{
127,6 → 128,7
bool gobbled;
char *ogcursor;
 
void
vappend(ch, cnt, indent)
int ch; /* mjm: char --> int */
int cnt, indent;
278,9 → 280,9
* in linebuf.
*/
cnt = vmaxrep(ch, cnt);
CP(gcursor + 1, cursor);
strcpy(gcursor + 1, cursor);
do {
CP(cursor, genbuf);
strcpy(cursor, genbuf);
if (cnt > 1) {
int oldhold = hold;
 
295,7 → 297,7
endim();
vUA2 = cursor;
if (escape != '\n')
CP(cursor, gcursor + 1);
strcpy(cursor, gcursor + 1);
 
/*
* If doomed characters remain, clobber them,
349,9 → 351,9
*gcursor = 0;
if (gcursor + strlen(linebuf) > &genbuf[LBSIZE - 2])
gcursor = genbuf;
CP(gcursor, linebuf);
strcpy(gcursor, linebuf);
} else {
CP(genbuf, gcursor + 1);
strcpy(genbuf, gcursor + 1);
gcursor = genbuf;
}
 
445,7 → 447,7
int x, y, iwhite, backsl=0;
char *iglobp;
char cstr[2];
int (*OO)() = Outchar;
void (*OO)() = Outchar;
 
/*
* Clear the output state and counters
912,7 → 914,7
len = strlen(cursor);
if (replen < len)
len = replen;
CP(cursor, cursor + len);
strcpy(cursor, cursor + len);
vUD2 += len;
}
len = strlen(linebuf);
/ports/trunk/editors/rvi/ex_vput.c
12,6 → 12,16
#include "ex_tty.h"
#include "ex_vis.h"
 
 
void enddm();
void godm();
void vnpins();
void vneedpos();
void vmaktop();
void vgoto();
void vclrech();
void vclreol();
 
/*
* Deal with the screen, clearing, cursor positioning, putting characters
* into the screen image, and deleting characters.
67,6 → 77,7
/*
* Clear to the end of the current physical line
*/
void
vclreol()
{
register int i, j;
115,6 → 126,7
* If work here is being held off, just remember, in
* heldech, if work needs to be done, don't do anything.
*/
void
vclrech(didphys)
bool didphys;
{
290,6 → 302,7
/*
* Move cursor to line y, column x, handling wraparound and scrolling.
*/
void
vgoto(y, x)
register int y, x;
{
486,6 → 499,7
}
}
 
void
vmaktop(p, cp)
register int p;
#ifndef BIT8
518,6 → 532,7
* for tabs) and code assumes this in several place
* to make life simpler.
*/
void
vinschar(c)
int c; /* mjm: char --> int */
{
754,6 → 769,7
* On a dumb terminal we may infact redisplay the rest of the
* screen here brute force to keep it pretty.
*/
void
vneedpos(cnt)
int cnt;
{
766,6 → 782,7
vnpins(1);
}
 
void
vnpins(dosync)
int dosync;
{
783,7 → 800,7
e = vglitchup(vcline, d);
vigoto(e, 0); vclreol();
if (dosync) {
int (*Ooutchar)() = Outchar;
void (*Ooutchar)() = Outchar;
Outchar = vputchar;
vsync(e + 1);
Outchar = Ooutchar;
1084,6 → 1101,7
* is the same as that which goes into insert
* mode, then we are in delete mode already.
*/
void
godm()
{
 
1103,6 → 1121,7
* if we just moved over to delete space from part of
* a tab (above).
*/
void
enddm()
{
 
1147,6 → 1166,7
* you can erase overstrikes with some work. CRT's which do underlining
* implicitly which has to be erased (like CONCEPTS) are also handled.
*/
void
vputchar(c)
register int c;
{
1378,6 → 1398,7
* Delete display positions stcol through endcol.
* Amount of use of special terminal features here is limited.
*/
void
physdc(stcol, endcol)
int stcol, endcol;
{
1480,6 → 1501,7
trubble = 0, techoin = 0;
}
 
void
tvliny()
{
register int i;
/ports/trunk/editors/rvi/ex_vwind.c
12,6 → 12,10
#include "ex_tty.h"
#include "ex_vis.h"
 
void vshow();
void vup();
void vdown();
 
/*
* Routines to adjust the window, showing specified lines
* in certain positions on the screen, and scrolling in both
78,6 → 82,7
* If scroll, then we MUST use a scroll.
* Otherwise clear and redraw if motion is far.
*/
void
vup(cnt, ind, scroll)
register int cnt, ind;
bool scroll;
127,6 → 132,7
/*
* Like vup, but scrolling down.
*/
void
vdown(cnt, ind, scroll)
register int cnt, ind;
bool scroll;
237,6 → 243,7
* (and call us recursively). Eventually, we clear the screen
* (or its open mode equivalent) and redraw.
*/
void
vshow(addr, top)
line *addr, *top;
{