| Return Type | Function name | Arguments |
|---|---|---|
| int | CstrCompare | (const char*,const char*,unsigned int,) |
Declared in file: hzTextproc.h
Defined in file : hzTextproc.cpp
Function Logic:
Function body:
int CstrCompare (const char* pA, const char* pB, unsigned int nMaxlen)
{
_hzfunc("CstrCompare") ;
uint32_t nCount ;
if (!pA || !pA[0])
{
if (!pB) return 0;
if (!pB[0]) return 0;
return *pB ;
}
if (!pB || !pB[0])
return *pA ;
if (!nMaxlen)
for (; *pA && *pB && *pA == *pB ; pA++, pB++) ;
else
for (nCount = 0; nCount < nMaxlen && *pA && *pB && *pA == *pB ; nCount++, pA++, pB++) ;
return *pA - *pB ;
}