Subversion Repositories planix.SVN

Rev

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

Rev 108 Rev 113
Line 5... Line 5...
5
 */
5
 */
6
 
6
 
7
#if	!defined(lint) && defined(DOSCCS)
7
#if	!defined(lint) && defined(DOSCCS)
8
static char *sccsid = "@(#)ex_vmain.c	7.7 (Berkeley) 6/7/85";
8
static char *sccsid = "@(#)ex_vmain.c	7.7 (Berkeley) 6/7/85";
9
#endif
9
#endif
-
 
10
 
10
 
11
 
11
#include "ex.h"
12
#include "ex.h"
12
#include "ex_tty.h"
13
#include "ex_tty.h"
13
#include "ex_vis.h"
14
#include "ex_vis.h"
-
 
15
 
-
 
16
 
-
 
17
 
-
 
18
 
-
 
19
void vzop();
-
 
20
void vsave();
-
 
21
 
14
 
22
 
15
#ifdef	BIT8
23
#ifdef	BIT8
16
short *ss_strcpy(dest, src)
24
short *ss_strcpy(dest, src)
17
short *dest;
25
short *dest;
18
const short *src;
26
const short *src;
Line 75... Line 83...
75
 * in the routine operate in ex_voperate.c.
83
 * in the routine operate in ex_voperate.c.
76
 */
84
 */
77
 
85
 
78
#define	forbid(a)	{ if (a) goto fonfon; }
86
#define	forbid(a)	{ if (a) goto fonfon; }
79
 
87
 
-
 
88
void
80
vmain()
89
vmain()
81
{
90
{
82
	register int c, cnt, i;
91
	register int c, cnt, i;
83
#ifndef	BIT8
92
#ifndef	BIT8
84
	char esave[TUBECOLS];
93
	char esave[TUBECOLS];
Line 89... Line 98...
89
#endif
98
#endif
90
	short d;
99
	short d;
91
	line *addr;
100
	line *addr;
92
	int ind, nlput;
101
	int ind, nlput;
93
	int shouldpo = 0;
102
	int shouldpo = 0;
94
	int onumber, olist, (*OPline)(), (*OPutchar)();
103
	int onumber, olist, (*OPline)();
-
 
104
     	void	(*OPutchar)();
95
 
105
 
96
	vch_mac = VC_NOTINMAC;
106
	vch_mac = VC_NOTINMAC;
97
 
107
 
98
	/*
108
	/*
99
	 * If we started as a vi command (on the command line)
109
	 * If we started as a vi command (on the command line)
Line 674... Line 684...
674
			doomed = c == 'R' ? 10000 : 0;
684
			doomed = c == 'R' ? 10000 : 0;
675
			if(FIXUNDO)
685
			if(FIXUNDO)
676
				vundkind = VCHNG;
686
				vundkind = VCHNG;
677
			vmoving = 0;
687
			vmoving = 0;
678
#ifndef	BIT8
688
#ifndef	BIT8
679
			CP(vutmp, linebuf);
689
			strcpy(vutmp, linebuf);
680
#else
690
#else
681
			sc_strcpy(vutmp, linebuf);
691
			sc_strcpy(vutmp, linebuf);
682
#endif
692
#endif
683
 
693
 
684
			/*
694
			/*
Line 1250... Line 1260...
1250
/*
1260
/*
1251
 * Execute function f with the address bounds addr1
1261
 * Execute function f with the address bounds addr1
1252
 * and addr2 surrounding cnt lines starting at dot.
1262
 * and addr2 surrounding cnt lines starting at dot.
1253
 */
1263
 */
1254
vremote(cnt, f, arg)
1264
vremote(cnt, f, arg)
-
 
1265
	int cnt;
1255
	int cnt, (*f)(), arg;
1266
	void(*f)();
-
 
1267
	int arg;
1256
{
1268
{
1257
	register int oing = inglobal;
1269
	register int oing = inglobal;
1258
 
1270
 
1259
	addr1 = dot;
1271
	addr1 = dot;
1260
	addr2 = dot + cnt - 1;
1272
	addr2 = dot + cnt - 1;
Line 1269... Line 1281...
1269
}
1281
}
1270
 
1282
 
1271
/*
1283
/*
1272
 * Save the current contents of linebuf, if it has changed.
1284
 * Save the current contents of linebuf, if it has changed.
1273
 */
1285
 */
-
 
1286
void
1274
vsave()
1287
vsave()
1275
{
1288
{
1276
	char temp[LBSIZE];
1289
	char temp[LBSIZE];
1277
 
1290
 
1278
	CP(temp, linebuf);
1291
	strcpy(temp, linebuf);
1279
	if (FIXUNDO && vundkind == VCHNG || vundkind == VCAPU) {
1292
	if (FIXUNDO && vundkind == VCHNG || vundkind == VCAPU) {
1280
		/*
1293
		/*
1281
		 * If the undo state is saved in the temporary buffer
1294
		 * If the undo state is saved in the temporary buffer
1282
		 * vutmp, then we sync this into the temp file so that
1295
		 * vutmp, then we sync this into the temp file so that
1283
		 * we will be able to undo even after we have moved off
1296
		 * we will be able to undo even after we have moved off
Line 1314... Line 1327...
1314
 
1327
 
1315
/*
1328
/*
1316
 * Do a z operation.
1329
 * Do a z operation.
1317
 * Code here is rather long, and very uninteresting.
1330
 * Code here is rather long, and very uninteresting.
1318
 */
1331
 */
-
 
1332
void
1319
vzop(hadcnt, cnt, c)
1333
vzop(hadcnt, cnt, c)
1320
	bool hadcnt;
1334
	bool hadcnt;
1321
	int cnt;
1335
	int cnt;
1322
	register int c;
1336
	register int c;
1323
{
1337
{