]> git.saurik.com Git - apple/libc.git/blame - stdlib/FreeBSD/atof.3.patch
Libc-763.13.tar.gz
[apple/libc.git] / stdlib / FreeBSD / atof.3.patch
CommitLineData
1f2f436a
A
1--- atof.3.orig 2010-02-08 16:26:10.000000000 -0800
2+++ atof.3 2010-02-13 20:58:26.000000000 -0800
3@@ -36,7 +36,8 @@
3d9156a7
A
4 .Dt ATOF 3
5 .Os
6 .Sh NAME
7-.Nm atof
8+.Nm atof ,
9+.Nm atof_l
10 .Nd convert
11 .Tn ASCII
12 string to double
1f2f436a 13@@ -45,33 +46,50 @@ string to double
224c7076 14 .Sh SYNOPSIS
3d9156a7
A
15 .In stdlib.h
16 .Ft double
224c7076
A
17-.Fn atof "const char *nptr"
18+.Fn atof "const char *str"
3d9156a7
A
19+.In xlocale.h
20+.Ft double
224c7076 21+.Fn atof_l "const char *str" "locale_t loc"
3d9156a7
A
22 .Sh DESCRIPTION
23 The
24 .Fn atof
224c7076
A
25 function converts the initial portion of the string pointed to by
26-.Fa nptr
27+.Fa str
28 to
29 .Vt double
30 representation.
31 .Pp
32 It is equivalent to:
33 .Bd -literal -offset indent
34-strtod(nptr, (char **)NULL);
35+strtod(str, (char **)NULL);
36 .Ed
37 .Pp
3d9156a7
A
38 The decimal point
39 character is defined in the program's locale (category
40 .Dv LC_NUMERIC ) .
41+.Pp
42+While the
43+.Fn atof
44+function uses the current locale, the
45+.Fn atof_l
46+function may be passed a locale directly. See
47+.Xr xlocale 3
48+for more information.
49 .Sh IMPLEMENTATION NOTES
50 The
51 .Fn atof
1f2f436a
A
52-function is not thread-safe and also not async-cancel-safe.
53+and
54+.Fn atof_l
55+functions are thread-safe and async-cancel-safe.
56 .Pp
57 The
58 .Fn atof
59-function has been deprecated by
60+and
61+.Fn atof_l
62+functions have been deprecated by
63 .Fn strtod
64+and
65+.Fn strtod_l
66 and should not be used in new code.
67 .Sh ERRORS
68 The function
69@@ -84,7 +102,8 @@ on an error.
3d9156a7
A
70 .Xr atol 3 ,
71 .Xr strtod 3 ,
72 .Xr strtol 3 ,
73-.Xr strtoul 3
74+.Xr strtoul 3 ,
75+.Xr xlocale 3
76 .Sh STANDARDS
77 The
78 .Fn atof