less -> more
[unix-history] / usr / src / usr.bin / more / input.c
index d68314c..a49b8e5 100644 (file)
@@ -3,15 +3,13 @@
  * Copyright (c) 1988 Regents of the University of California.
  * All rights reserved.
  *
  * 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
  * 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
  * 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
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)input.c    5.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)input.c    5.3 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #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.
  */
 
  * delimited by newlines; not processed with respect to screen width.
  */
 
-#include "less.h"
+#include <sys/types.h>
+#include <less.h>
 
 extern int squeeze;
 extern int sigs;
 extern char *line;
 
 
 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.
 /*
  * 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.
  */
  * 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)
 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))
        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.
  */
  * 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)
 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;
 
        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);
 
                ch_seek(curr_pos-1))
                return (NULL_POSITION);