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