1: #include "../h/rt.h"
   2: 
   3: /*
   4:  * cvpos - convert position to strictly positive position
   5:  *  given string or list length.
   6:  */
   7: 
   8: cvpos(pos, len)
   9: long pos;
  10: register int len;
  11:    {
  12:    DclSave
  13:    register int p;
  14: 
  15:    /*
  16:     * Fail if the position isn't in the range of an int. (?)
  17:     */
  18:    if ((long)(p = pos) != pos)
  19:       fail();
  20:    /*
  21:     * Fail if the position is off either end of the string.
  22:     */
  23:    if (p < -len || p > len + 1)
  24:       fail();
  25:    /*
  26:     * If the position is greater than zero, just return it.  Otherwise,
  27:     *  convert the zero/negative position.
  28:     */
  29:    if (pos > 0)
  30:       return (p);
  31:    return (len + p + 1);
  32:    }

Defined functions

cvpos defined in line 8; used 1 times
Last modified: 1984-11-18
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 659
Valid CSS Valid XHTML 1.0 Strict