Return Type | Function name | Arguments |
---|---|---|
hzEmaddr& | hzEmaddr::operator= | (const char*,) |
Declared in file: hzEmaddr.h
Defined in file : hzEmaddr.cpp
Function Logic:
Function body:
hzEmaddr& hzEmaddr::operator= (const char* cpStr) { _hzfunc("hzEmaddr::operator=(cstr)") ; _ema_space* destCtl ; const char* i ; char* j ; uint32_t nLhs = 0; uint32_t nRhs = 0; 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) ; if (!m_addr) hzexit(E_MEMORY, "Cannot assign %s", cpStr) ; destCtl = (_ema_space*) g_ssrInet.Xlate(m_addr) ; 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 ; }