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

Diff for /src/usr.bin/less/linenum.c between version 1.13 and 1.14

version 1.13, 2015/12/25 14:29:22 version 1.14, 2016/01/12 17:48:04
Line 44 
Line 44 
         struct linenum_info *prev;      /* Line to previous in the list */          struct linenum_info *prev;      /* Line to previous in the list */
         off_t pos;                      /* File position */          off_t pos;                      /* File position */
         off_t gap;                      /* Gap between prev and next */          off_t gap;                      /* Gap between prev and next */
         LINENUM line;                   /* Line number */          off_t line;                     /* Line number */
 };  };
 /*  /*
  * "gap" needs some explanation: the gap of any particular line number   * "gap" needs some explanation: the gap of any particular line number
Line 120 
Line 120 
  * FIRST character in the specified line.   * FIRST character in the specified line.
  */   */
 void  void
 add_lnum(LINENUM linenum, off_t pos)  add_lnum(off_t linenum, off_t pos)
 {  {
         struct linenum_info *p;          struct linenum_info *p;
         struct linenum_info *new;          struct linenum_info *new;
Line 202 
Line 202 
 static void  static void
 longish(void)  longish(void)
 {  {
         if (loopcount >= 0 && ++loopcount > 100) {          if (++loopcount > 100) {
                 loopcount = 0;                  loopcount = 0;
                 if (time(NULL) >= startime + LONGTIME) {                  if (time(NULL) >= startime + LONGTIME) {
                         ierror("Calculating line numbers", NULL);                          ierror("Calculating line numbers", NULL);
Line 231 
Line 231 
  * Find the line number associated with a given position.   * Find the line number associated with a given position.
  * Return 0 if we can't figure it out.   * Return 0 if we can't figure it out.
  */   */
 LINENUM  off_t
 find_linenum(off_t pos)  find_linenum(off_t pos)
 {  {
         struct linenum_info *p;          struct linenum_info *p;
         LINENUM linenum;          off_t linenum;
         off_t cpos;          off_t cpos;
   
         if (!linenums)          if (!linenums)
Line 340 
Line 340 
  * Return -1 if we can't figure it out.   * Return -1 if we can't figure it out.
  */   */
 off_t  off_t
 find_pos(LINENUM linenum)  find_pos(off_t linenum)
 {  {
         struct linenum_info *p;          struct linenum_info *p;
         off_t cpos;          off_t cpos;
         LINENUM clinenum;          off_t clinenum;
   
         if (linenum <= 1)          if (linenum <= 1)
                 /*                  /*
Line 411 
Line 411 
  * The argument "where" tells which line is to be considered   * The argument "where" tells which line is to be considered
  * the "current" line (e.g. TOP, BOTTOM, MIDDLE, etc).   * the "current" line (e.g. TOP, BOTTOM, MIDDLE, etc).
  */   */
 LINENUM  off_t
 currline(int where)  currline(int where)
 {  {
         off_t pos;          off_t pos;
         off_t len;          off_t len;
         LINENUM linenum;          off_t linenum;
   
         pos = position(where);          pos = position(where);
         len = ch_length();          len = ch_length();

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14