Subversion Repositories planix.SVN

Rev

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

Rev 113 Rev 115
Line 21... Line 21...
21
 */
21
 */
22
 
22
 
23
bool	endline = 1;
23
bool	endline = 1;
24
line	*tad1;
24
line	*tad1;
25
static	jnoop();
25
static	jnoop();
26
void addmac(char *src,char * dest,char * dname,struct maps *mp);
-
 
27
void somechange();
-
 
28
void zop2(int lines, int op);
-
 
29
void put();
-
 
30
void squish();
-
 
31
 
26
 
32
/*
27
/*
33
 * Append after line a lines returned by function f.
28
 * Append after line a lines returned by function f.
34
 * Be careful about intermediate states to avoid scramble
29
 * Be careful about intermediate states to avoid scramble
35
 * if an interrupt comes in.
30
 * if an interrupt comes in.
Line 183... Line 178...
183
 
178
 
184
/*
179
/*
185
 * Crush out the undo save area, moving the open/visual
180
 * Crush out the undo save area, moving the open/visual
186
 * save area down in its place.
181
 * save area down in its place.
187
 */
182
 */
188
void
-
 
189
squish()
183
squish()
190
{
184
{
191
	register line *a1 = dol + 1, *a2 = unddol + 1, *a3 = truedol + 1;
185
	register line *a1 = dol + 1, *a2 = unddol + 1, *a3 = truedol + 1;
192
 
186
 
193
	if(FIXUNDO) {
187
	if(FIXUNDO) {
Line 353... Line 347...
353
	getline(*tad1++);
347
	getline(*tad1++);
354
	tad1++;
348
	tad1++;
355
	return (0);
349
	return (0);
356
}
350
}
357
 
351
 
358
void
-
 
359
put()
352
put()
360
{
353
{
361
	register int cnt;
354
	register int cnt;
362
 
355
 
363
	if (!FIXUNDO)
356
	if (!FIXUNDO)
Line 460... Line 453...
460
			break;
453
			break;
461
#endif
454
#endif
462
		}
455
		}
463
		if (cp + strlen(dp = vpastwh(linebuf)) >= &genbuf[LBSIZE - 2])
456
		if (cp + strlen(dp = vpastwh(linebuf)) >= &genbuf[LBSIZE - 2])
464
			error("Line too long|Result line after shift would be too long");
457
			error("Line too long|Result line after shift would be too long");
465
		strcpy(cp, dp);
458
		CP(cp, dp);
466
		strcLIN(genbuf);
459
		strcLIN(genbuf);
467
		putmark(addr);
460
		putmark(addr);
468
	}
461
	}
469
	killed();
462
	killed();
470
}
463
}
471
 
464
 
472
/*
465
/*
473
 * Find a tag in the tags file.
466
 * Find a tag in the tags file.
474
 * Most work here is in parsing the tags file itself.
467
 * Most work here is in parsing the tags file itself.
475
 */
468
 */
476
void
-
 
477
tagfind(quick)
469
tagfind(quick)
478
	bool quick;
470
	bool quick;
479
{
471
{
480
	char cmdbuf[BUFSIZ];
472
	char cmdbuf[BUFSIZ];
481
	char filebuf[FNSIZE];
473
	char filebuf[FNSIZE];
Line 516... Line 508...
516
	clrstats();
508
	clrstats();
517
 
509
 
518
	/*
510
	/*
519
	 * Loop once for each file in tags "path".
511
	 * Loop once for each file in tags "path".
520
	 */
512
	 */
521
	strcpy(tagfbuf, svalue(TAGS));
513
	CP(tagfbuf, svalue(TAGS));
522
	fne = tagfbuf - 1;
514
	fne = tagfbuf - 1;
523
	while (fne) {
515
	while (fne) {
524
		fn = ++fne;
516
		fn = ++fne;
525
		while (*fne && *fne != ' ')
517
		while (*fne && *fne != ' ')
526
			fne++;
518
			fne++;
Line 784... Line 776...
784
	for (l = COLUMNS > 80 ? 40 : COLUMNS / 2; l > 0; l--)
776
	for (l = COLUMNS > 80 ? 40 : COLUMNS / 2; l > 0; l--)
785
		putchar('-');
777
		putchar('-');
786
	putnl();
778
	putnl();
787
}
779
}
788
 
780
 
789
void
-
 
790
zop2(lines, op)
781
zop2(lines, op)
791
	register int lines;
782
	register int lines;
792
	register int op;
783
	register int op;
793
{
784
{
794
	register line *split;
785
	register line *split;
Line 1042... Line 1033...
1042
 
1033
 
1043
/*
1034
/*
1044
 * Be (almost completely) sure there really
1035
 * Be (almost completely) sure there really
1045
 * was a change, before claiming to undo.
1036
 * was a change, before claiming to undo.
1046
 */
1037
 */
1047
void
-
 
1048
somechange()
1038
somechange()
1049
{
1039
{
1050
	register line *ip, *jp;
1040
	register line *ip, *jp;
1051
 
1041
 
1052
	switch (undkind) {
1042
	switch (undkind) {
Line 1080... Line 1070...
1080
 
1070
 
1081
/*
1071
/*
1082
 * Map command:
1072
 * Map command:
1083
 * map src dest
1073
 * map src dest
1084
 */
1074
 */
1085
void
-
 
1086
mapcmd(un, ab)
1075
mapcmd(un, ab)
1087
	int un;	/* true if this is unmap command */
1076
	int un;	/* true if this is unmap command */
1088
	int ab;	/* true if this is abbr command */
1077
	int ab;	/* true if this is abbr command */
1089
{
1078
{
1090
	char lhs[100], rhs[100];	/* max sizes resp. */
1079
	char lhs[100], rhs[100];	/* max sizes resp. */
Line 1177... Line 1166...
1177
 * chars "src" is mapped into "dest". If src is already mapped into something
1166
 * chars "src" is mapped into "dest". If src is already mapped into something
1178
 * this overrides the mapping. There is no recursion. Unmap is done by
1167
 * this overrides the mapping. There is no recursion. Unmap is done by
1179
 * using NOSTR for dest.  Dname is what to show in listings.  mp is
1168
 * using NOSTR for dest.  Dname is what to show in listings.  mp is
1180
 * the structure to affect (arrows, etc).
1169
 * the structure to affect (arrows, etc).
1181
 */
1170
 */
1182
void
-
 
1183
addmac(src,dest,dname,mp)
1171
addmac(src,dest,dname,mp)
1184
	register char *src, *dest, *dname;
1172
	register char *src, *dest, *dname;
1185
	register struct maps *mp;
1173
	register struct maps *mp;
1186
{
1174
{
1187
	register int slot, zer;
1175
	register int slot, zer;
Line 1254... Line 1242...
1254
	if (msnext == 0)	/* first time */
1242
	if (msnext == 0)	/* first time */
1255
		msnext = mapspace;
1243
		msnext = mapspace;
1256
	/* Check is a bit conservative, we charge for dname even if reusing src */
1244
	/* Check is a bit conservative, we charge for dname even if reusing src */
1257
	if (msnext - mapspace + strlen(dest) + strlen(src) + strlen(dname) + 3 > MAXCHARMACS)
1245
	if (msnext - mapspace + strlen(dest) + strlen(src) + strlen(dname) + 3 > MAXCHARMACS)
1258
		error("Too much macro text");
1246
		error("Too much macro text");
1259
	strcpy(msnext, src);
1247
	CP(msnext, src);
1260
	mp[slot].cap = msnext;
1248
	mp[slot].cap = msnext;
1261
	msnext += strlen(src) + 1;	/* plus 1 for null on the end */
1249
	msnext += strlen(src) + 1;	/* plus 1 for null on the end */
1262
	strcpy(msnext, dest);
1250
	CP(msnext, dest);
1263
	mp[slot].mapto = msnext;
1251
	mp[slot].mapto = msnext;
1264
	msnext += strlen(dest) + 1;
1252
	msnext += strlen(dest) + 1;
1265
	if (dname) {
1253
	if (dname) {
1266
		strcpy(msnext, dname);
1254
		CP(msnext, dname);
1267
		mp[slot].descr = msnext;
1255
		mp[slot].descr = msnext;
1268
		msnext += strlen(dname) + 1;
1256
		msnext += strlen(dname) + 1;
1269
	} else {
1257
	} else {
1270
		/* default descr to string user enters */
1258
		/* default descr to string user enters */
1271
		mp[slot].descr = src;
1259
		mp[slot].descr = src;