Subject: Re: what's bytes()?
To: Olwe Bottorff <galanolwe@yahoo.com>
From: Dave Huang <khym@azeotrope.org>
List: netbsd-help
Date: 02/21/2006 15:05:30
On Tue, Feb 21, 2006 at 12:04:49PM -0800, Olwe Bottorff wrote:
> Thanks, I had accidentally deleted mine. Now, in
> usr.bin/tail/reverse.c I see a bytes(fp, off) in the
> reverse() function. What does that do and where is it?

In usr.bin/tail/read.c:

/*
 * bytes -- read bytes to an offset from the end and display.
 *
 * This is the function that reads to a byte offset from the end of the input,
 * storing the data in a wrap-around buffer which is then displayed.  If the
 * rflag is set, the data is displayed in lines in reverse order, and this
 * routine has the usual nastiness of trying to find the newlines.  Otherwise,
 * it is displayed from the character closest to the beginning of the input to
 * the end.
 *
 * Non-zero return means than a (non-fatal) error occurred.
 */

For functions that aren't part of NetBSD's libraries, grep is probably the
easiest way to find out where a function is defined. So if "man whatever"
doesn't return any info, try "grep whatever *.[ch]"