Subversion Repositories planix.SVN

Rev

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

Rev 108 Rev 113
Line 10... Line 10...
10
 
10
 
11
#include "ex.h"
11
#include "ex.h"
12
#include "ex_re.h"
12
#include "ex_re.h"
13
#include "ex_tty.h"
13
#include "ex_tty.h"
14
#include "ex_vis.h"
14
#include "ex_vis.h"
-
 
15
 
-
 
16
void
-
 
17
save(line *a1, line *a2);
-
 
18
void qcount(int c);
-
 
19
void
-
 
20
netchange(int i);
-
 
21
void
-
 
22
killcnt(int cnt);
15
 
23
 
16
/*
24
/*
17
 * Random routines, in alphabetical order.
25
 * Random routines, in alphabetical order.
18
 */
26
 */
19
 
27
 
Line 137... Line 145...
137
	cp = vpastwh(genbuf);
145
	cp = vpastwh(genbuf);
138
	if (*cp == 0 && i == indent && linebuf[0] == 0) {
146
	if (*cp == 0 && i == indent && linebuf[0] == 0) {
139
		genbuf[0] = 0;
147
		genbuf[0] = 0;
140
		return (i);
148
		return (i);
141
	}
149
	}
142
	CP(genindent(i), cp);
150
	strcpy(genindent(i), cp);
143
	return (i);
151
	return (i);
144
}
152
}
145
 
153
 
146
filioerr(cp)
154
filioerr(cp)
147
	char *cp;
155
	char *cp;
Line 242... Line 250...
242
{
250
{
243
 
251
 
244
	killcnt(addr2 - addr1 + 1);
252
	killcnt(addr2 - addr1 + 1);
245
}
253
}
246
 
254
 
-
 
255
void
247
killcnt(cnt)
256
killcnt(cnt)
248
	register int cnt;
257
	register int cnt;
249
{
258
{
250
 
259
 
251
	if (inopen) {
260
	if (inopen) {
Line 343... Line 352...
343
		}
352
		}
344
	return (str);
353
	return (str);
345
}
354
}
346
 
355
 
347
/*VARARGS2*/
356
/*VARARGS2*/
-
 
357
void
348
merror(seekpt, i)
358
merror(seekpt, i)
349
#ifdef VMUNIX
359
#ifdef VMUNIX
350
	char *seekpt;
360
	char *seekpt;
351
#else
361
#else
352
# ifdef lint
362
# ifdef lint
Line 388... Line 398...
388
#ifdef VMUNIX
398
#ifdef VMUNIX
389
	strcpy(linebuf, seekpt);
399
	strcpy(linebuf, seekpt);
390
#else
400
#else
391
	lseek(erfile, (long) seekpt, 0);
401
	lseek(erfile, (long) seekpt, 0);
392
	if (read(erfile, linebuf, 128) < 2)
402
	if (read(erfile, linebuf, 128) < 2)
393
		CP(linebuf, "ERROR");
403
		strcpy(linebuf, "ERROR");
394
#endif
404
#endif
395
}
405
}
396
 
406
 
397
morelines()
407
morelines()
398
{
408
{
Line 433... Line 443...
433
{
443
{
434
 
444
 
435
	netchange(lineDOL() - cnt);
445
	netchange(lineDOL() - cnt);
436
}
446
}
437
 
447
 
-
 
448
void
438
netchange(i)
449
netchange(i)
439
	register int i;
450
	register int i;
440
{
451
{
441
	register char *cp;
452
	register char *cp;
442
 
453
 
Line 484... Line 495...
484
{
495
{
485
 
496
 
486
	return (i == 1 ? "" : "s");
497
	return (i == 1 ? "" : "s");
487
}
498
}
488
 
499
 
489
int	qcount();
-
 
490
short	vcntcol;
500
short	vcntcol;
491
 
501
 
492
qcolumn(lim, gp)
502
qcolumn(lim, gp)
493
	register char *lim, *gp;
503
	register char *lim, *gp;
494
{
504
{
495
	register int x;
505
	register int x;
496
	int (*OO)();
506
	void (*OO)();
497
 
507
 
498
	OO = Outchar;
508
	OO = Outchar;
499
	Outchar = qcount;
509
	Outchar = qcount;
500
	vcntcol = 0;
510
	vcntcol = 0;
501
	if (lim != NULL)
511
	if (lim != NULL)
Line 508... Line 518...
508
			putchar(*gp++);
518
			putchar(*gp++);
509
	Outchar = OO;
519
	Outchar = OO;
510
	return (vcntcol);
520
	return (vcntcol);
511
}
521
}
512
 
522
 
513
int
523
void
514
qcount(c)
524
qcount(c)
515
	int c;
525
	int c;
516
{
526
{
517
 
527
 
518
	if (c == '\t') {
528
	if (c == '\t') {
Line 520... Line 530...
520
		return;
530
		return;
521
	}
531
	}
522
	vcntcol++;
532
	vcntcol++;
523
}
533
}
524
 
534
 
-
 
535
void
525
reverse(a1, a2)
536
reverse(a1, a2)
526
	register line *a1, *a2;
537
	register line *a1, *a2;
527
{
538
{
528
	register line t;
539
	register line t;
529
 
540
 
Line 534... Line 545...
534
		*a2 = *a1;
545
		*a2 = *a1;
535
		*a1++ = t;
546
		*a1++ = t;
536
	}
547
	}
537
}
548
}
538
 
549
 
-
 
550
void
539
save(a1, a2)
551
save(a1, a2)
540
	line *a1;
552
	line *a1;
541
	register line *a2;
553
	register line *a2;
542
{
554
{
543
	register int more;
555
	register int more;
Line 608... Line 620...
608
	}
620
	}
609
	return (wh);
621
	return (wh);
610
}
622
}
611
 
623
 
612
/*VARARGS2*/
624
/*VARARGS2*/
-
 
625
void
613
smerror(seekpt, cp)
626
smerror(seekpt, cp)
614
#ifdef lint
627
#ifdef lint
615
	char *seekpt;
628
	char *seekpt;
616
#else
629
#else
617
	int seekpt;
630
	int seekpt;
Line 643... Line 656...
643
 
656
 
644
strcLIN(dp)
657
strcLIN(dp)
645
	char *dp;
658
	char *dp;
646
{
659
{
647
 
660
 
648
	CP(linebuf, dp);
661
	strcpy(linebuf, dp);
649
}
662
}
650
 
663
 
651
syserror()
664
syserror()
652
{
665
{
653
 
666
 
Line 678... Line 691...
678
char *
691
char *
679
vfindcol(i)
692
vfindcol(i)
680
	int i;
693
	int i;
681
{
694
{
682
	register char *cp;
695
	register char *cp;
683
	register int (*OO)() = Outchar;
696
	register void (*OO)() = Outchar;
684
 
697
 
685
	Outchar = qcount;
698
	Outchar = qcount;
686
	ignore(qcolumn(linebuf - 1, NOSTR));
699
	ignore(qcolumn(linebuf - 1, NOSTR));
687
	for (cp = linebuf; *cp && vcntcol < i; cp++)
700
	for (cp = linebuf; *cp && vcntcol < i; cp++)
688
		putchar(*cp);
701
		putchar(*cp);