Logo Search packages:      
Sourcecode: icu version File versions  Download package

U_STABLE int32_t U_EXPORT2 u_memcmp ( const UChar *  buf1,
const UChar *  buf2,
int32_t  count 
)

Compare the first count UChars of each buffer.

Parameters:
buf1 The first string to compare.
buf2 The second string to compare.
count The maximum number of UChars to compare.
Returns:
When buf1 < buf2, a negative number is returned. When buf1 == buf2, 0 is returned. When buf1 > buf2, a positive number is returned. ICU 2.0

Definition at line 1136 of file ustring.c.

                                                              {
    if(count > 0) {
        const UChar *limit = buf1 + count;
        int32_t result;

        while (buf1 < limit) {
            result = (int32_t)(uint16_t)*buf1 - (int32_t)(uint16_t)*buf2;
            if (result != 0) {
                return result;
            }
            buf1++;
            buf2++;
        }
    }
    return 0;
}


Generated by  Doxygen 1.6.0   Back to index