Translate a 32-bit unsigned string address, to a pointer to an (encoded) string

Return TypeFunction nameArguments
unsigned char*hzSMAR::Xlate(uint32_t,)

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

Function Logic:

0:START 1:unknown 2:items 3:unknown 4:items 5:Return 0 6:ssrAddr 7:slotNo items 8:unknown 9:Return (uchar*)m_Heap[slotNo] 10:unknown 11:items 12:Return 0 13:unknown 14:items 15:pBloc 16:unknown 17:items 18:unknown 19:items 20:Return 0 21:pSeg pSeg 22:Return (uchar*)pSeg

Function body:

unsigned char* hzSMAR::Xlate (uint32_t ssrAddr)
{
   //  Translate a 32-bit unsigned string address, to a pointer to an (encoded) string
   //  
   //  Argument: ssrAddr The address
   //  
   //  Returns: The encoded string OR
   //     NULL if not located
   _hzfunc("hzSMAR::Xlate") ;
   _smarBloc*  pBloc ;     //  Pointer to superblock
   uint32_t*   pSeg ;      //  Data segment
   uint32_t    blocNo ;    //  Offset within vector of blocks
   uint32_t    slotNo ;    //  String slot within block
   if (!this)
       hzexit(E_CORRUPT, "No instance") ;
   if (!ssrAddr)
   {
       threadLog("SMAR %u: CORRUPT: Should not be called to xlate NULL address\n", m_nCode) ;
       return 0;
   }
   slotNo = ssrAddr & SMAR_SLOT_MASK ;
   blocNo = (ssrAddr & SMAR_BLOC_MASK) >> 16;
   if (!blocNo)
       return (uchar*) m_Heap[slotNo] ;
   if (blocNo > m_Super.Count())
   {
       threadLog("CORRUPT: Cannot xlate address %u:%u. No such superblock (%u issued)\n", blocNo, slotNo, m_Super.Count()) ;
       return 0;
   }
   if (_hzGlobal_MT)
       m_lockSbloc.Lock() ;
       pBloc = m_Super[blocNo] ;
   if (_hzGlobal_MT)
       m_lockSbloc.Unlock() ;
   if (!pBloc)
   {
       threadLog("CORRUPT: No block found for address %u:%u. Total of %u superblocks issued)\n", blocNo, slotNo, m_Super.Count()) ;
       return 0;
   }
   pSeg = pBloc->m_Space ;
   pSeg += slotNo ;
   return (uchar*) pSeg ;
}