os/ossrv/genericopenlibs/cstdlib/LCHAR/STRCOLL.C
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     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".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:
    15 * FUNCTION
    16 * <<strcoll>>---locale specific character string compare
    17 * INDEX
    18 * strcoll
    19 * ANSI_SYNOPSIS
    20 * #include <string.h>
    21 * int strcoll(const char *<[stra]>, const char * <[strb]>);
    22 * TRAD_SYNOPSIS
    23 * #include <string.h>
    24 * int strcoll(<[stra]>, <[strb]>)
    25 * char *<[stra]>;
    26 * char *<[strb]>;
    27 * <<strcoll>> compares the string pointed to by <[stra]> to
    28 * the string pointed to by <[strb]>, using an interpretation
    29 * appropriate to the current <<LC_COLLATE>> state.
    30 * RETURNS
    31 * If the first string is greater than the second string,
    32 * <<strcoll>> returns a number greater than zero.  If the two
    33 * strings are equivalent, <<strcoll>> returns zero.  If the first
    34 * string is less than the second string, <<strcoll>> returns a
    35 * number less than zero.
    36 * PORTABILITY
    37 * <<strcoll>> is ANSI C.
    38 * <<strcoll>> requires no supporting OS subroutines.
    39 * QUICKREF
    40 * strcoll ansi pure
    41 * 
    42 *
    43 */
    44 
    45 
    46 
    47 #include <string.h>
    48 
    49 /**
    50 Compares a to b character by character according to the character table 
    51 set by current locale.
    52 This function starts comparing the first character of each string. 
    53 If they are equal to each other continues with the following pair
    54 until the characters differ or until end of string is reached.
    55 @return a value indicating the lexicographical relation between the strings
    56 @param a Null-terminated string to compare. 
    57 @param b Null-terminated string to compare.
    58 */
    59 EXPORT_C int
    60 strcoll (const char *a, const char *b)
    61 {
    62   /* Since we don't yet support locales, this is easy! */
    63   return strcmp (a, b);
    64 }