Update contrib.
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 * <<strcpy>>---copy string
21 * char *strcpy(char *<[dst]>, const char *<[src]>);
24 * char *strcpy(<[dst]>, <[src]>)
27 * <<strcpy>> copies the string pointed to by <[src]>
28 * (including the terminating null character) to the array
29 * pointed to by <[dst]>.
31 * This function returns the initial value of <[dst]>.
33 * <<strcpy>> is ANSI C.
34 * <<strcpy>> requires no supporting OS subroutines.
51 Copies the content pointed by src to dest stopping after the terminating null-character is copied.
52 dest should have enough memory space allocated to contain src string.
53 @return des is returned
54 @param s1 Destination string. Should be enough long to contain s2.
55 @param s2 Null-terminated string to copy.
58 strcpy (char *s1, const char *s2)
61 while ((*s1++ = *s2++)!=0);
66 Copy the wide-character string pointed to by s2 (including the terminating null
67 wide-character code) into the array pointed to by s1.
69 @param s1 wide-character string
70 @param s2 wide-character string
72 EXPORT_C wchar_t * wcscpy (wchar_t *s1, const wchar_t *s2)
76 while ((*s1++ = *s2++)!=L'\0')
83 Function shall return a pointer to a new string,
84 which is a duplicate of the string pointed to by str.
85 @return a pointer to a new string
88 EXPORT_C char * strdup (const char *str)
90 size_t len = strlen (str) + 1;
91 char *copy = (char *)malloc (len);
94 memcpy (copy, str, len);
99 EXPORT_C wchar_t * wcsdup (const wchar_t *str)
101 size_t len = wcslen(str) + 1;
104 len *= sizeof(wchar_t);
105 copy = (wchar_t *)malloc (len);
108 memcpy (copy, str, len);