1*f07f0fb6SGarrett D'Amore.\" 2*f07f0fb6SGarrett D'Amore.\" This file and its contents are supplied under the terms of the 3*f07f0fb6SGarrett D'Amore.\" Common Development and Distribution License ("CDDL"), version 1.0. 4*f07f0fb6SGarrett D'Amore.\" You may only use this file in accordance with the terms of version 5*f07f0fb6SGarrett D'Amore.\" 1.0 of the CDDL. 6*f07f0fb6SGarrett D'Amore.\" 7*f07f0fb6SGarrett D'Amore.\" A full copy of the text of the CDDL should have accompanied this 8*f07f0fb6SGarrett D'Amore.\" source. A copy of the CDDL is also available via the Internet at 9*f07f0fb6SGarrett D'Amore.\" http://www.illumos.org/license/CDDL. 10*f07f0fb6SGarrett D'Amore.\" 11*f07f0fb6SGarrett D'Amore.\" 12*f07f0fb6SGarrett D'Amore.\" Copyright 2014 Garrett D'Amore <garrett@damore.org> 13*f07f0fb6SGarrett D'Amore.\" 14*f07f0fb6SGarrett D'Amore.Dd "Nov 4, 2014" 15*f07f0fb6SGarrett D'Amore.Dt WCSDUP 3C 16*f07f0fb6SGarrett D'Amore.Os 17*f07f0fb6SGarrett D'Amore.Sh NAME 18*f07f0fb6SGarrett D'Amore.Nm wcsdup 19*f07f0fb6SGarrett D'Amore.Nd duplicate wide-character string 20*f07f0fb6SGarrett D'Amore.Sh SYNOPSIS 21*f07f0fb6SGarrett D'Amore.In wchar.h 22*f07f0fb6SGarrett D'Amore. 23*f07f0fb6SGarrett D'Amore.Ft wchar_t 24*f07f0fb6SGarrett D'Amore.Fo wcsdup 25*f07f0fb6SGarrett D'Amore.Fa "const wchar_t *string" 26*f07f0fb6SGarrett D'Amore.Fc 27*f07f0fb6SGarrett D'Amore. 28*f07f0fb6SGarrett D'Amore.Sh DESCRIPTION 29*f07f0fb6SGarrett D'AmoreThe 30*f07f0fb6SGarrett D'Amore.Fn wcsdup 31*f07f0fb6SGarrett D'Amorefunction duplicates a wide-character 32*f07f0fb6SGarrett D'Amore.Fa string , 33*f07f0fb6SGarrett D'Amoreallocating sufficient memory to store the copy, and then 34*f07f0fb6SGarrett D'Amorecopying from 35*f07f0fb6SGarrett D'Amore.Fa string . 36*f07f0fb6SGarrett D'AmoreThe resulting copy is returned. It may be deallocated with 37*f07f0fb6SGarrett D'Amore.Xr free 3C 38*f07f0fb6SGarrett D'Amorewhen it is no longer needed. The 39*f07f0fb6SGarrett D'Amore.Fn wcsdup 40*f07f0fb6SGarrett D'Amorefunction is the wide-character equivalent of 41*f07f0fb6SGarrett D'Amore.Xr strdup 3C . 42*f07f0fb6SGarrett D'Amore.Sh RETURN VALUES 43*f07f0fb6SGarrett D'AmoreOn success, the function 44*f07f0fb6SGarrett D'Amore.Fn wcsdup 45*f07f0fb6SGarrett D'Amorereturns the newly allocated copy of the string; on failure it 46*f07f0fb6SGarrett D'Amorereturns 47*f07f0fb6SGarrett D'Amore.Dv NULL 48*f07f0fb6SGarrett D'Amoreand sets 49*f07f0fb6SGarrett D'Amore.Va errno . 50*f07f0fb6SGarrett D'Amore.Sh ERRORS 51*f07f0fb6SGarrett D'AmoreThe 52*f07f0fb6SGarrett D'Amore.Fn wcsdup 53*f07f0fb6SGarrett D'Amorefunction will fail if: 54*f07f0fb6SGarrett D'Amore.Bl -tag -width Er 55*f07f0fb6SGarrett D'Amore.It Er ENOMEM 56*f07f0fb6SGarrett D'AmoreInsufficient memory was available to create the copy. 57*f07f0fb6SGarrett D'Amore.El 58*f07f0fb6SGarrett D'Amore.Sh INTERFACE STABILITY 59*f07f0fb6SGarrett D'Amore.Sy Standard . 60*f07f0fb6SGarrett D'Amore.Sh MT-LEVEL 61*f07f0fb6SGarrett D'Amore.Sy MT-Safe . 62*f07f0fb6SGarrett D'Amore.Sh SEE ALSO 63*f07f0fb6SGarrett D'Amore.Xr free 3C , 64*f07f0fb6SGarrett D'Amore.Xr strdup 3C , 65*f07f0fb6SGarrett D'Amore.Xr wcslen 3C , 66*f07f0fb6SGarrett D'Amore.Xr wchar.h 3HEAD , 67*f07f0fb6SGarrett D'Amore.Xr locale 5 , 68*f07f0fb6SGarrett D'Amore.Xr standards 5 69*f07f0fb6SGarrett D'Amore.Sh STANDARDS 70*f07f0fb6SGarrett D'AmoreThe 71*f07f0fb6SGarrett D'Amore.Fn wcsdup 72*f07f0fb6SGarrett D'Amorefunction was introduced in 73*f07f0fb6SGarrett D'Amore.St -p1003.1-2008 . 74