xref: /csrg-svn/contrib/ed/equal.c (revision 60663)
157683Sbostic /*-
2*60663Sbostic  * Copyright (c) 1992, 1993
3*60663Sbostic  *	The Regents of the University of California.  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*60663Sbostic static char sccsid[] = "@(#)equal.c	8.1 (Berkeley) 05/31/93";
1357683Sbostic #endif /* not lint */
1457683Sbostic 
1557710Sbostic #include <sys/types.h>
1657710Sbostic 
1757710Sbostic #include <regex.h>
1857710Sbostic #include <setjmp.h>
1957710Sbostic #include <stdio.h>
2057710Sbostic 
2158315Sbostic #ifdef DBI
2258315Sbostic #include <db.h>
2358315Sbostic #endif
2458315Sbostic 
2557683Sbostic #include "ed.h"
2657710Sbostic #include "extern.h"
2757683Sbostic 
2857683Sbostic /*
2957683Sbostic  * Print out what the line number of the address given is; default to
3057683Sbostic  * end-of-buffer ($).
3157683Sbostic  */
3257683Sbostic void
equal(inputt,errnum)3357683Sbostic equal(inputt, errnum)
3457710Sbostic 	FILE *inputt;
3557710Sbostic 	int *errnum;
3657683Sbostic {
3757710Sbostic 	if (End_default)
3858564Sralph 		Start = bottom;
3957710Sbostic 	else
4058564Sralph 		Start = End;
4158564Sralph 	Start_default = End_default = 0;
4257683Sbostic 
4357710Sbostic 	if (rol(inputt, errnum))
4457710Sbostic 		return;
4557683Sbostic 
4658564Sralph 	(void)printf("%d\n", line_number(Start));
4757710Sbostic 	*errnum = 1;
4857710Sbostic }
49