os/ossrv/genericopenlibs/openenvcore/libc/src/strxfrm.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // Name        : strxfrm.cpp
    15 // Part of     : MRT
    16 // Implementation for wcpcpy API
    17 // Version     : 1.0
    18 //
    19 
    20 
    21  
    22 #include <string.h>
    23 #include <e32std.h>
    24 
    25 extern "C" {
    26 
    27 EXPORT_C
    28 size_t strxfrm(char *dest, const char *src, size_t n)
    29 {
    30 	TInt i;	
    31 	unsigned char temp;
    32 	if(n == 0 && dest == NULL)
    33 		return(strlen(src));
    34 	for(i = 0; src[i] != '\0' && i!= n; i++)	
    35 		{
    36 		temp = src[i];
    37 		dest[i] = (char) User :: Collate(temp);	
    38 		}
    39 	return i;			
    40 }
    41 
    42 } //extern "C"