Assign the hzEmaddr to an email address held in a character string Note: This function will record an E_FORMAT error if the supplied cstr did not amount to an email address

Return TypeFunction nameArguments
hzEmaddr&hzEmaddr::operator=(const char*,)

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

Function Logic:

0:START 1:items 2:unknown 3:Return *this 4:unknown 5:items 6:Return *this 7:unknown 8:unknown 9:unknown 10:unknown 11:items 12:Return *this 13:m_addr 14:unknown 15:items 16:destCtl 17:unknown 18:items 19:destCtl nLhs destCtl nRhs destCtl 20:unknown 21:* 22:Return *this

Function body:

hzEmaddr& hzEmaddr::operator= (const char* cpStr)
{
   //  Assign the hzEmaddr to an email address held in a character string
   //  
   //  Argument: cpStr A null terminated string assumed to be an email address
   //  
   //  Returns: Reference to this email adress instance in all cases.
   //  
   //  Note: This function will record an E_FORMAT error if the supplied cstr did not amount to an email address
   _hzfunc("hzEmaddr::operator=(cstr)") ;
   _ema_space* destCtl ;       //  This email address space
   const char* i ;             //  Email iterator
   char*       j ;             //  Email iterator
   uint32_t    nLhs = 0;       //  LHS part of email address
   uint32_t    nRhs = 0;       //  RHS part of email address
   Clear() ;
   if (!cpStr || !cpStr[0])
       return *this ;
   if (!IsEmaddr(cpStr))
   {
       hzerr(E_FORMAT, "Cannot assign %s", cpStr) ;
       return *this ;
   }
   for (i = cpStr ; *i && *i != ''@'';nLhs++, i++) ;
   if (*i == ''@'')
       for (i++ ; *i ; nRhs++, i++) ;
   if (nLhs < 1|| nLhs > 192||nRhs< 1|| nRhs > 63)
   {
       hzerr(E_FORMAT, "Cannot assign %s", cpStr) ;
       return *this ;
   }
   //  m_addr = g_ssrInet.Alloc(nLhs + nRhs + 1 + EMA_FACTOR) ;
   m_addr = _emaAlloc(nLhs + nRhs + 1);
   if (!m_addr)
       hzexit(E_MEMORY, "Cannot assign %s", cpStr) ;
   destCtl = _emaXlate(m_addr) ;
   if (!destCtl)
       hzexit(E_CORRUPT, "Invalid address") ;
   //  Assign the value
   destCtl->m_copy = 1;
   destCtl->m_lhs = nLhs & 0xff;
   destCtl->m_rhs = nRhs & 0xff;
   for (j = destCtl->m_data, i = cpStr ; *i ; *j++ = _tolower(*i++)) ;
   *j = 0;
   return *this ;
}