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

Diff for /src/usr.bin/less/ifile.c between version 1.1.1.1 and 1.1.1.2

version 1.1.1.1, 1996/09/21 05:39:42 version 1.1.1.2, 2003/04/13 18:21:21
Line 1 
Line 1 
 /*  /*
  * 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 46 
Line 30 
         char *h_filename;               /* Name of the file */          char *h_filename;               /* Name of the file */
         void *h_filestate;              /* File state (used in ch.c) */          void *h_filestate;              /* File state (used in ch.c) */
         int h_index;                    /* Index within command line list */          int h_index;                    /* Index within command line list */
         int h_opened;                   /* Only need one bit */          int h_hold;                     /* Hold count */
           char h_opened;                  /* Has this ifile been opened? */
         struct scrpos h_scrpos;         /* Saved position within the file */          struct scrpos h_scrpos;         /* Saved position within the file */
 };  };
   
Line 60 
Line 45 
 /*  /*
  * Anchor for linked list.   * Anchor for linked list.
  */   */
 static struct ifile anchor = { &anchor, &anchor, 0 };  static struct ifile anchor = { &anchor, &anchor, NULL, NULL, 0, 0, '\0',
                                   { NULL_POSITION, 0 } };
 static int ifiles = 0;  static int ifiles = 0;
   
         static void          static void
Line 72 
Line 58 
                 p->h_index += incr;                  p->h_index += incr;
 }  }
   
   /*
    * Link an ifile into the ifile list.
    */
         static void          static void
 link_ifile(p, prev)  link_ifile(p, prev)
         struct ifile *p;          struct ifile *p;
Line 95 
Line 84 
         ifiles++;          ifiles++;
 }  }
   
   /*
    * Unlink an ifile from the ifile list.
    */
         static void          static void
 unlink_ifile(p)  unlink_ifile(p)
         struct ifile *p;          struct ifile *p;
Line 125 
Line 117 
         p->h_filename = save(filename);          p->h_filename = save(filename);
         p->h_scrpos.pos = NULL_POSITION;          p->h_scrpos.pos = NULL_POSITION;
         p->h_opened = 0;          p->h_opened = 0;
           p->h_hold = 0;
           p->h_filestate = NULL;
         link_ifile(p, prev);          link_ifile(p, prev);
         return (p);          return (p);
 }  }
Line 144 
Line 138 
          * If the ifile we're deleting is the currently open ifile,           * If the ifile we're deleting is the currently open ifile,
          * move off it.           * move off it.
          */           */
           unmark(h);
         if (h == curr_ifile)          if (h == curr_ifile)
                 curr_ifile = getoff_ifile(curr_ifile);                  curr_ifile = getoff_ifile(curr_ifile);
         p = int_ifile(h);          p = int_ifile(h);
Line 302 
Line 297 
         IFILE ifile;          IFILE ifile;
 {  {
         return (int_ifile(ifile)->h_opened);          return (int_ifile(ifile)->h_opened);
   }
   
           public void
   hold_ifile(ifile, incr)
           IFILE ifile;
           int incr;
   {
           int_ifile(ifile)->h_hold += incr;
   }
   
           public int
   held_ifile(ifile)
           IFILE ifile;
   {
           return (int_ifile(ifile)->h_hold);
 }  }
   
         public void *          public void *

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.1.1.2