Subversion Repositories planix.SVN

Rev

Rev 113 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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