X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/1f2f436a38f7ae2d39a943ad2898d8fed4ed2e58..6465356a983ac139f81d3b7913cdb548477c346c:/stdlib/FreeBSD/atol.3?ds=sidebyside diff --git a/stdlib/FreeBSD/atol.3 b/stdlib/FreeBSD/atol.3 index 68bf942..2c21151 100644 --- a/stdlib/FreeBSD/atol.3 +++ b/stdlib/FreeBSD/atol.3 @@ -36,7 +36,8 @@ .Dt ATOL 3 .Os .Sh NAME -.Nm atol , atoll +.Nm atol , atoll , +.Nm atol_l , atoll_l .Nd convert .Tn ASCII string to @@ -49,14 +50,19 @@ integer .Sh SYNOPSIS .In stdlib.h .Ft long -.Fn atol "const char *nptr" +.Fn atol "const char *str" .Ft "long long" -.Fn atoll "const char *nptr" +.Fn atoll "const char *str" +.In xlocale.h +.Ft long +.Fn atol_l "const char *str" "locale_t loc" +.Ft "long long" +.Fn atoll_l "const char *str" "locale_t loc" .Sh DESCRIPTION The .Fn atol function converts the initial portion of the string pointed to by -.Fa nptr +.Fa str to .Vt long integer @@ -64,12 +70,12 @@ representation. .Pp It is equivalent to: .Pp -.Dl "strtol(nptr, (char **)NULL, 10);" +.Dl "strtol(str, (char **)NULL, 10);" .Pp The .Fn atoll function converts the initial portion of the string pointed to by -.Fa nptr +.Fa str to .Vt "long long" integer @@ -77,8 +83,28 @@ representation. .Pp It is equivalent to: .Pp -.Dl "strtoll(nptr, (char **)NULL, 10);" -.Sh COMPATIBILITY +.Dl "strtoll(str, (char **)NULL, 10);" +.Pp +While the +.Fn atol +and +.Fn atoll +functions use the current locale, the +.Fn atol_l +and +.Fn atoll_l +functions may be passed locales directly. See +.Xr xlocale 3 +for more information. +.Sh IMPLEMENTATION NOTES +The +.Fn atol , +.Fn atoll , +.Fn atol_l , +and +.Fn atoll_l +functions are thread-safe and async-cancel-safe. +.Pp The .Fx implementations of the @@ -121,7 +147,8 @@ on an error. .Xr atoi 3 , .Xr strtod 3 , .Xr strtol 3 , -.Xr strtoul 3 +.Xr strtoul 3 , +.Xr xlocale 3 .Sh STANDARDS The .Fn atol