[BACK]Return to position.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / less

Diff for /src/usr.bin/less/position.c between version 1.4 and 1.5

version 1.4, 2001/11/19 19:02:14 version 1.5, 2003/04/13 18:26:26
Line 1 
Line 1 
 /*      $OpenBSD$       */  
   
 /*  /*
  * Copyright (c) 1984,1985,1989,1994,1995  Mark Nudelman   * Copyright (C) 1984-2002  Mark Nudelman
  * All rights reserved.  
  *   *
  * Redistribution and use in source and binary forms, with or without   * You may distribute under the terms of either the GNU General Public
  * modification, are permitted provided that the following conditions   * License or the Less License, as specified in the README file.
  * are met:  
  * 1. Redistributions of source code must retain the above copyright  
  *    notice, this list of conditions and the following disclaimer.  
  * 2. Redistributions in binary form must reproduce the above copyright  
  *    notice in the documentation and/or other materials provided with  
  *    the distribution.  
  *   *
  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY   * For more information about less, or for information on how to
  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE   * contact the author, see the README file.
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR  
  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE  
  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR  
  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT  
  * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR  
  * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,  
  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE  
  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN  
  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  
  */   */
   
   
Line 58 
Line 40 
 position(where)  position(where)
         int where;          int where;
 {  {
         if (where >= table_size)  
                 where = BOTTOM;  
   
         switch (where)          switch (where)
         {          {
         case BOTTOM:          case BOTTOM:
Line 82 
Line 61 
 add_forw_pos(pos)  add_forw_pos(pos)
         POSITION pos;          POSITION pos;
 {  {
         int i;          register int i;
   
         /*          /*
          * Scroll the position table up.           * Scroll the position table up.
Line 99 
Line 78 
 add_back_pos(pos)  add_back_pos(pos)
         POSITION pos;          POSITION pos;
 {  {
         int i;          register int i;
   
         /*          /*
          * Scroll the position table down.           * Scroll the position table down.
Line 115 
Line 94 
         public void          public void
 pos_clear()  pos_clear()
 {  {
         int i;          register int i;
   
         for (i = 0;  i < sc_height;  i++)          for (i = 0;  i < sc_height;  i++)
                 table[i] = NULL_POSITION;                  table[i] = NULL_POSITION;
Line 157 
Line 136 
 onscreen(pos)  onscreen(pos)
         POSITION pos;          POSITION pos;
 {  {
         int i;          register int i;
   
         if (pos < table[0])          if (pos < table[0])
                 return (-1);                  return (-1);
Line 181 
Line 160 
         int s;          int s;
         int e;          int e;
 {  {
         int i;          register int i;
   
         for (i = s;  i <= e;  i++)          for (i = s;  i <= e;  i++)
                 if (table[i] != NULL_POSITION)                  if (table[i] != NULL_POSITION)
Line 201 
Line 180 
 get_scrpos(scrpos)  get_scrpos(scrpos)
         struct scrpos *scrpos;          struct scrpos *scrpos;
 {  {
         int i;          register int i;
   
         /*          /*
          * Find the first line on the screen which has something on it,           * Find the first line on the screen which has something on it,

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5