First public contribution.
2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
16 * <<strncmp>>---character string compare
21 * int strncmp(const char *<[a]>, const char * <[b]>, size_t <[length]>);
24 * int strncmp(<[a]>, <[b]>, <[length]>)
28 * <<strncmp>> compares up to <[length]> characters
29 * from the string at <[a]> to the string at <[b]>.
31 * If <<*<[a]>>> sorts lexicographically after <<*<[b]>>>,
32 * <<strncmp>> returns a number greater than zero. If the two
33 * strings are equivalent, <<strncmp>> returns zero. If <<*<[a]>>>
34 * sorts lexicographically before <<*<[b]>>>, <<strncmp>> returns a
35 * number less than zero.
37 * <<strncmp>> is ANSI C.
38 * <<strncmp>> requires no supporting OS subroutines.
50 Compare some characters of two strings.
51 Compares the first num characters of string1 to the first num characters of string2.
52 The comparison is performed character by character.
53 If a character that is not equal in both strings is found the function ends
54 and returns a value that determines which of them was greater.
55 @return a value indicating the lexicographical relation between the strings.
56 @param s1 Null-terminated string to compare
57 @param s2 Null-terminated string to compare.
58 @param n Maximum number of characters to compare.
61 strncmp (const char *s1, const char *s2, size_t n)
63 const unsigned char* p1 = (const unsigned char*)s1;
64 const unsigned char* p2 = (const unsigned char*)s2;