| Return Type | Function name | Arguments |
|---|---|---|
| int | CstrCompareW | (const char*,const char*,) |
Declared in file: hzTextproc.h
Defined in file : hzTextproc.cpp
Function Logic:
Function body:
int CstrCompareW (const char* a, const char* b)
{
const char* pA = a ;
const char* pB = b ;
uint32_t entA ;
uint32_t entB ;
uint32_t len ;
if (pA)
for (pA++ ; *pA && *pA <&eq; CHAR_SPACE ; pA++) ;
if (pB)
for (pB++ ; *pB && *pB <&eq; CHAR_SPACE ; pB++) ;
for (;;)
{
entA = entB = len = 0;
if (pA)
{
if (*pA && *pA <&eq; CHAR_SPACE)
{
for (pA++ ; *pA <&eq; CHAR_SPACE ; pA++) ;
entA = CHAR_SPACE ;
}
else
{
for (; *pA ;)
{
if (IsEntity(entA, len, pA))
pA += len ;
else if (IsUnicodeSeq(entA, len, pA))
pA += len ;
else
entA = *pA++ ;
if (IsAlphanum(entA))
{ entA = conv2lower(entA) ; break ; }
}
}
if (*pA == 0&& entA == CHAR_SPACE)
entA = 0;
}
if (pB)
{
if (*pB && *pB <&eq; CHAR_SPACE)
{
for (pB++ ; *pB && *pB <&eq; CHAR_SPACE ; pB++) ;
entB = CHAR_SPACE ;
}
else
{
for (; *pB ;)
{
if (IsEntity(entB, len, pB))
pB += len ;
else if (IsUnicodeSeq(entB, len, pB))
pB += len ;
else
entB = *pB++ ;
if (IsAlphanum(entB))
{ entB = conv2lower(entB) ; break ; }
}
}
if (*pB == 0&& entB == CHAR_SPACE)
entB = 0;
}
if (entA != entB)
return entA - entB ;
if (!entA)
break ;
}
return 0;
}