Appends chain with a single byte. Takes the single arg as the char to append, returns either E_OK if successful but E_MEMORY if not. The latter is a fatal condition. Returns: E_OK

Return TypeFunction nameArguments
hzEcodehzChain::AddByte(const char,)

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

Function Logic:

0:START 1:unknown 2:mx mx 3:unknown 4:mx 5:mx 6:curBlk 7:unknown 8:items 9:unknown 10:newBlk items items curBlk mx 11:curBlk items items 12:Return E_OK

Function body:

hzEcode hzChain::AddByte (const char C)
{
   //  Appends chain with a single byte. Takes the single arg as the char to append, returns either E_OK if successful but E_MEMORY
   //  if not. The latter is a fatal condition.
   //  
   //  Arguments: 1) C Char to add
   //  
   //  Returns: E_OK
   _hzfunc("hzChain::AddByte") ;
   //  Place char C on the end of the chain. Must detect physical end of 
   //  the current block and add new block
   _zblk*  curBlk ;        //  Working block pointer
   _zblk*  newBlk ;        //  Working block pointer
   if (!mx)
       { mx = new _chain() ; mx->m_Test = mx ; }
   if (!mx->m_Begin)
       mx->m_Begin = mx->m_End = _zblk_alloc() ;
   curBlk = (_zblk*) mx->m_End ;
   if (!curBlk)
       Fatal("Chain %p has no end block\n", this) ;
   if (curBlk->m_nUsage == ZBLKSIZE)
   {
       //  Out of space - make new block
       newBlk = _zblk_alloc() ;
       newBlk->Prev(curBlk) ;
       curBlk->Next(newBlk) ;
       mx->m_End = curBlk = newBlk ;
   }
   curBlk->m_Data[curBlk->m_nUsage] = C ;
   curBlk->m_nUsage++ ;
   mx->m_nSize++ ;
   return E_OK ;
}