X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/bfe13c81a3a7d825dd821a5abcda7de006e32696..bc258617f323d737755d6043c64ffea2c59b69d4:/usr/src/usr.bin/more/input.c diff --git a/usr/src/usr.bin/more/input.c b/usr/src/usr.bin/more/input.c index d68314c1f6..a49b8e5182 100644 --- a/usr/src/usr.bin/more/input.c +++ b/usr/src/usr.bin/more/input.c @@ -3,15 +3,13 @@ * Copyright (c) 1988 Regents of the University of California. * All rights reserved. * - * This code is derived from software contributed to Berkeley by - * Mark Nudleman. - * * Redistribution and use in source and binary forms are permitted * provided that the above copyright notice and this paragraph are * duplicated in all such forms and that any documentation, * advertising materials, and other materials related to such * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the + * by Mark Nudleman and the University of California, Berkeley. The + * name of Mark Nudleman or the * University may not be used to endorse or promote products derived * from this software without specific prior written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR @@ -20,7 +18,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)input.c 5.1 (Berkeley) %G%"; +static char sccsid[] = "@(#)input.c 5.3 (Berkeley) %G%"; #endif /* not lint */ /* @@ -33,12 +31,15 @@ static char sccsid[] = "@(#)input.c 5.1 (Berkeley) %G%"; * delimited by newlines; not processed with respect to screen width. */ -#include "less.h" +#include +#include extern int squeeze; extern int sigs; extern char *line; +off_t ch_tell(); + /* * Get the next line. * A "current" position is passed and a "new" position is returned. @@ -46,11 +47,11 @@ extern char *line; * a line. The new position is the position of the first character * of the NEXT line. The line obtained is the line starting at curr_pos. */ - public POSITION +off_t forw_line(curr_pos) - POSITION curr_pos; + off_t curr_pos; { - POSITION new_pos; + off_t new_pos; register int c; if (curr_pos == NULL_POSITION || ch_seek(curr_pos)) @@ -116,14 +117,14 @@ forw_line(curr_pos) * a line. The new position is the position of the first character * of the PREVIOUS line. The line obtained is the one starting at new_pos. */ - public POSITION +off_t back_line(curr_pos) - POSITION curr_pos; + off_t curr_pos; { - POSITION new_pos, begin_new_pos; + off_t new_pos, begin_new_pos; int c; - if (curr_pos == NULL_POSITION || curr_pos <= (POSITION)0 || + if (curr_pos == NULL_POSITION || curr_pos <= (off_t)0 || ch_seek(curr_pos-1)) return (NULL_POSITION);