Populate supplied chain with EDO value

Return TypeFunction nameArguments
hzEcodehzEdo::GetValue(hzChain&,)

Declared in file: hzDatabase.h
Defined in file : hdbObjRepos.cpp

Function Logic:

0:START 1:items 2:unknown 3:Return 0 4:pSlot 5:unknown 6:Return hzerr(E_CORRUPT,Illegal address %u:%u,m_addr/0xffff,m_addr%0xffff) 7:unknown 8:unknown 9:pSlot ( 10:( 11:( 12:nSize 13:pSlot 14:( 15:( 16:nSize 17:pSlot 18:nSize 19:unknown 20:items 21:Return E_OK

Function body:

hzEcode hzEdo::GetValue (hzChain& Z)
{
   //  Populate supplied chain with EDO value
   //  
   //  Argument: Z The target chain
   //  
   //  Returns: E_CORRUPT If the EDO address is illegal
   //     E_OK  Operation successful
   _hzfunc("hzEdo::GetValue") ;
   uchar*      pSlot ;     //  EDO slot
   uint32_t    nSize ;     //  EDO size
   uint32_t    nC ;        //  Char counter
   Z.Clear() ;
   if (!m_addr)
       return 0;
   pSlot = g_pSMAR_Edo->Xlate(m_addr) ;
   if (!pSlot)
       return hzerr(E_CORRUPT, "Illegal address %u:%u", m_addr/0xffff,m_addr%0xffff);
   if (pSlot[0]& 0x80)
   {
       if (pSlot[0]& 0x40)
           nSize = (((pSlot[0]& 0x3f)<<16)+(pSlot[1]<<8)+pSlot[2])+ 3;
       else
           nSize = (((pSlot[0]& 0x3f)<<8)+pSlot[1])+2;
   }
   else
       nSize = pSlot[0]+ 1;
   for (nC = 0; nC < nSize ; nC++)
   {
       Z.AddByte(pSlot[nC]) ;
   }
   return E_OK ;
}