Grep routine - (nf)

utzoo!decvax!harpo!floyd!vax135!ariel!hou5f!npoiv!npois!houxm!houxa!houxi!houxz!ihnp4!ixn5c!inuxc!pur-ee!davy utzoo!decvax!harpo!floyd!vax135!ariel!hou5f!npoiv!npois!houxm!houxa!houxi!houxz!ihnp4!ixn5c!inuxc!pur-ee!davy
Wed Mar 9 22:26:39 AEST 1983

pur-ee!davy    Mar  9 22:16:00 1983

	Has anyone out there got a subroutine which performs the task
	which "grep" or (preferably) "egrep" does?  Basically, I want
	a subroutine which I can call like:

		grep(fd, pattern, begin, end)
		int fd;
		char *pattern;
		int *begin, *end;

		fd is a file descriptor to the file in question
		pattern is the regular expression
		begin is the byte position in the file at which to start
		end is the byte position in the file at which to end

	and the routine stores the beginning and ending byte positions
	of the matching string in begin and end when it finds it.
	I realize that this stuff could be swiped out of an editor source,
	or that grep itself could be modified, but if someone has already
	done this, I'm not going to reinvent the wheel.

	If you have a routine similar to what I want, or know of one, please
	mail me at:


Reach out and GREP someone,
--Dave Curry

More information about the Comp.lang.c mailing list