Increments the current chain iterator by the requested length. Will set the iterator to the end of the chain if the requested increment is too great.

Return TypeFunction nameArguments
uint32_thzChain::Iter::Advance(uint32_t,)

Declared in file: hzChain.h
Defined in file : hzChain.cpp

Function Logic:

0:START 1:unknown 2:Return 0 3:zp 4:unknown 5:Return 0 6:unknown 7:zp 8:nCan 9:unknown 10:nInc 11:nCan 12:m_nOset nAdv 13:unknown 14:unknown 15:m_nOset zp m_block 16:Return nAdv

Function body:

uint32_t hzChain::Iter::Advance (uint32_t nInc)
{
   //  Increments the current chain iterator by the requested length. Will set the iterator to the end of the chain if the requested
   //  increment is too great.
   //  
   //  Arguments: 1) nInc Number of bytes to advance
   //  
   //  Returns: Number of bytes advanced
   _hzfunc("hzChain::Iter::Advance") ;
   _zblk*      zp ;            //  Chain block pointer
   uint32_t    nCan ;          //  Advance possibible within current block
   uint32_t    nAdv = 0;       //  Number of chars actully advanced
   if (nInc < 0)
       return 0;
   zp = (_zblk*) m_block ;
   if (!zp)
       return 0;
   for (; nAdv < nInc ;)
   {
       nCan = zp->m_nUsage - m_nOset ;
       if ((nCan + nAdv) > nInc)
           nCan = nInc - nAdv ;
       m_nOset += nCan ;
       nAdv += nCan ;
       if (m_nOset == zp->m_nUsage)
       {
           if (!zp->Next())
               break ;
           m_nOset = 0;
           m_block = zp = zp->Next() ;
       }
   }
   return nAdv ;
}