pike.git / lib / modules / ADT.pmod / Stack.pike

version» Context lines:

pike.git/lib/modules/ADT.pmod/Stack.pike:70:    } else {    ptr -= val;    }    } else {    if (ptr > 0) {    ptr--;    }    }   }    + //! Pops entries from the stack until the specified @[depth] is + //! reached. The popped entries are not actually freed, only the + //! stack pointer is moved. + void pop_to(int depth) + { +  if ((ptr < depth) || (depth < 0)) { +  error("Stack underflow.\n"); +  } +  ptr = depth; + } +    //! Pops and returns entry @[val] from the stack, counting   //! from the top. If no value is given the top element is   //! popped and returned. All popped entries are freed from   //! the stack.   mixed pop(void|int val)   {    mixed ret;       if (val) {    if (ptr <= 0) {