1: # include   "../ingres.h"
   2: # include   "../access.h"
   3: 
   4: /*
   5: ** newlino finds a free line number which it returns and adjusts
   6: **	the next line counter (Nxtlino) by the length of the tuple (len).
   7: **	This routine is used to recover unused sections of the
   8: **	line number table (Acc_head->linetab).
   9: */
  10: 
  11: newlino(len)
  12: int len;
  13: {
  14:     register int    *lp, newlno, nextlno;
  15: 
  16:     nextlno = Acc_head->nxtlino;
  17:     lp = &Acc_head->linetab[0];
  18:     for (newlno = 0; newlno < nextlno; newlno++)
  19:     {
  20:         if (*lp == 0)
  21:         {
  22:             /* found a free line number */
  23:             *lp = Acc_head->linetab[-nextlno];
  24:             Acc_head->linetab[-nextlno] += len;
  25:             return (newlno);
  26:         }
  27:         lp--;
  28:     }
  29: 
  30:     /* no free line numbers. use nxtlino */
  31:     Acc_head->linetab[-(nextlno + 1)] = *lp + len;
  32:     Acc_head->nxtlino++;
  33:     return (nextlno);
  34: }

Defined functions

Last modified: 1995-02-04
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1785
Valid CSS Valid XHTML 1.0 Strict