home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
nlsnps.zip
/
nlsCompare.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1996-09-03
|
476b
|
22 lines
#define INCL_DOSNLS
#include <os2.h>
#include "nls.h"
int nlsCompare(PUCHAR psz1, PUCHAR psz2)
{ while (1)
{ UCHAR uc1 = *psz1++, uc2 = *psz2++;
if (uc1 != uc2)
{ int iDiff = (UINT)nlsCollate(uc1) - (UINT)nlsCollate(uc2);
if (iDiff != 0) return iDiff;
}
else
{ if (uc1 == 0) return 0;
else if (nlsIsDBCS(uc1))
{ int iDiff = (UINT)*psz1++ - (UINT)*psz2++;
if (iDiff != 0) return iDiff;
}
}
}
}