xref: /csrg-svn/contrib/ed/equal.c (revision 57710)
157683Sbostic /*-
257683Sbostic  * Copyright (c) 1992 The Regents of the University of California.
357683Sbostic  * All rights reserved.
457683Sbostic  *
557683Sbostic  * This code is derived from software contributed to Berkeley by
657683Sbostic  * Rodney Ruddock of the University of Guelph.
757683Sbostic  *
857683Sbostic  * %sccs.include.redist.c%
957683Sbostic  */
1057683Sbostic 
1157683Sbostic #ifndef lint
12*57710Sbostic static char sccsid[] = "@(#)equal.c	5.2 (Berkeley) 01/23/93";
1357683Sbostic #endif /* not lint */
1457683Sbostic 
15*57710Sbostic #include <sys/types.h>
16*57710Sbostic 
17*57710Sbostic #include <db.h>
18*57710Sbostic #include <regex.h>
19*57710Sbostic #include <setjmp.h>
20*57710Sbostic #include <stdio.h>
21*57710Sbostic 
2257683Sbostic #include "ed.h"
23*57710Sbostic #include "extern.h"
2457683Sbostic 
2557683Sbostic /*
2657683Sbostic  * Print out what the line number of the address given is; default to
2757683Sbostic  * end-of-buffer ($).
2857683Sbostic  */
2957683Sbostic void
3057683Sbostic equal(inputt, errnum)
31*57710Sbostic 	FILE *inputt;
32*57710Sbostic 	int *errnum;
3357683Sbostic {
34*57710Sbostic 	if (End_default)
35*57710Sbostic 		start = bottom;
36*57710Sbostic 	else
37*57710Sbostic 		start = End;
38*57710Sbostic 	start_default = End_default = 0;
3957683Sbostic 
40*57710Sbostic 	if (rol(inputt, errnum))
41*57710Sbostic 		return;
4257683Sbostic 
43*57710Sbostic 	(void)printf("%d\n", line_number(start));
44*57710Sbostic 	*errnum = 1;
45*57710Sbostic }
46