OSDN Git Service

(split) Apply minor changes from v3.32 to v3.35 in the upstream.
[linuxjm/LDP_man-pages.git] / release / man3 / strtoul.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" References consulted:
24 .\"     Linux libc source code
25 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
26 .\"     386BSD man pages
27 .\" Modified Sun Jul 25 10:54:03 1993 by Rik Faith (faith@cs.unc.edu)
28 .\" Fixed typo, aeb, 950823
29 .\" 2002-02-22, joey, mihtjel: Added strtoull()
30 .\"
31 .\" Japanese Version Copyright (c) 1999 AKAMATSU, Kazuo
32 .\"                            and 2006 Akihiro MOTOKI
33 .\"         all rights reserved.
34 .\" Translated Thu Jan 31 18:00:00 JST 1999
35 .\"         by AKAMATSU, Kazuo
36 .\" Updated & Modified 2006-07-20,
37 .\"         Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.36
38 .\"
39 .\" WORD:       base            ´ð¿ô
40 .\"
41 .TH STRTOUL 3  2011-09-15 "GNU" "Linux Programmer's Manual"
42 .SH Ì¾Á°
43 strtoul, strtoull, strtouq \- Ê¸»úÎó¤ò unsigned long int ¤ËÊÑ´¹¤¹¤ë
44 .SH ½ñ¼°
45 .nf
46 .B #include <stdlib.h>
47 .sp
48 .BI "unsigned long int strtoul(const char *" nptr ", char **" endptr \
49 ", int " base );
50 .sp
51 .BI "unsigned long long int strtoull(const char *" nptr ", char **" endptr ,
52 .BI "                                int " base );
53 .fi
54 .sp
55 .in -4n
56 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
57 .RB ( feature_test_macros (7)
58 »²¾È):
59 .in
60 .sp
61 .ad l
62 .BR strtoull ():
63 .RS 4
64 XOPEN_SOURCE\ >=\ 600 || _BSD_SOURCE || _SVID_SOURCE || _ISOC99_SOURCE ||
65 _POSIX_C_SOURCE\ >=\ 200112L;
66 .br
67 or
68 .I cc\ -std=c99
69 .RE
70 .ad
71 .SH ÀâÌÀ
72 .BR strtoul ()
73 ´Ø¿ô¤Ï¡¢ \fInptr\fP ¤Îʸ»úÎó¤ÎºÇ½é¤ÎÉôʬ¤ò¡¢
74 \fIbase\fP ¤ò´ð¿ô¤È¤·¤Æ
75 .I "unsigned long int"
76 ¤ËÊÑ´¹¤¹¤ë¡£
77 ¤³¤Î \fIbase\fP ¤Ï 2 ¤«¤é 36 ¤Þ¤Ç¤ÎÃÍ
78 ¤¢¤ë¤¤¤ÏÆÃÊ̤ʰÕÌ£¤ò»ý¤ÄÃÍ 0 ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
79 .PP
80 ʸ»úÎó¤ÎÀèƬ¤Ë¤Ï¡¢Ç¤°Õ¤Î¿ô¤Î¶õÇò¤¬¤¢¤Ã¤Æ¤â¤è¤¯ (¶õÇò¤Ï
81 .BR ( isspace (3)
82 ¤ÇȽÄꤵ¤ì¤ë) ¡¢¤Þ¤¿¿ô»ú¤ÎľÁ°¤Ë¤Ï \(aq+\(aq ¤« \(aq\-\(aq ¤Î
83 Éä¹æ¤¬¤¢¤Ã¤Æ¤â¤è¤¤¡£
84 \fIbase\fP ¤¬ 0 ¤Þ¤¿¤Ï 16 ¤Î¾ì¹ç¤Ë¤Ï¡¢ Ê¸»úÎó¤ÎÀèƬ¤Ë "0x" ¤òÃÖ¤¯¤³¤È¤¬
85 ¤Ç¤­¡¢¤½¤Î¾ì¹ç¤Ë¤Ïʸ»úÎó¤Ï 16¿Ê¿ô¤È¤·¤Æ°·¤ï¤ì¤ë¡£
86 ¤³¤ì°Ê³°¤Îʸ»úÎó¤Ç \fIbase\fP ¤¬ 0 ¤Î¾ì¹ç¤Ï¡¢
87 ʸ»úÎ󤬠\(aq0\(aq ¤Ç»Ï¤Þ¤ë¤È¤­¤Ï 8¿Ê¿ô¤È¤·¤Æ¡¢
88 ¤½¤ì°Ê³°¤Î¤È¤­¤Ï 10¿Ê¿ô¤È¤·¤Æ°·¤ï¤ì¤ë¡£
89 .PP
90 ʸ»úÎó¤Î»Ä¤ê¤ÎÉôʬ¤Ï
91 .I "unsigned long int"
92 ¤ËÊÑ´¹¤µ¤ì¤ë¤¬¡¢´ð¿ô¤ËÂФ·¤Æ
93 Í­¸ú¤Ç¤Ê¤¤¿ô»ú¤¬¸½¤ì¤¿»þÅÀ¤ÇÊÑ´¹¤Ï½ªÎ»¤¹¤ë¡£(11¿Ê¿ô°Ê¾å¤Ç¤Ï \(aqA\(aq ¤Ï
94 Âçʸ»ú¡¦¾®Ê¸»ú¤Ë´Ø¤ï¤é¤º 10 ¤òɽ¤·¡¢ \(aqB\(aq ¤Ï 11 ¤òɽ¸½¤·,
95 °Ê²¼Æ±Íͤˡ¢ \(aqZ\(aq ¤Ï 35 ¤òɽ¤¹¡£)
96 .PP
97 \fIendptr\fP ¤¬¥Ì¥ëÃÍ (NULL) ¤Ç¤Ê¤¤¾ì¹ç¡¢
98 .BR strtoul ()
99 ¤ÏºÇ½é¤ËÉÔÀµ¤Êʸ»ú¤¬¸½¤ì¤¿¥¢¥É¥ì¥¹¤ò
100 \fI*endptr\fP ¤Ë³ÊǼ¤·¤Æ¤¤¤ë¡£
101 ʸ»úÎó¤ËÍ­¸ú¤Ê¿ô»ú¤¬¤Ò¤È¤Ä¤â¤Ê¤±¤ì¤Ð¡¢
102 .BR strtoul ()
103 ¤Ï \fInptr\fP
104 ¤Î¸µ¤ÎÃͤò \fI*endptr\fP ¤ËÂåÆþ¤¹¤ë(¤½¤·¤Æ 0 ¤òÊÖ¤¹)¡£
105 Æäˡ¢ \fI*nptr\fP ¤¬ \(aq\\0\(aq °Ê³°¤Ç¡¢ÊÖ¤µ¤ì¤¿ \fI**endptr\fP ¤¬
106 \(aq\\0\(aq ¤Ê¤é¤Ð¡¢Ê¸»úÎóÁ´ÂΤ¬Í­¸ú¤À¤Ã¤¿¤³¤È¤Ë¤Ê¤ë¡£
107 .PP
108 .BR strtoull ()
109 ´Ø¿ô¤Ï
110 .BR strtoul ()
111 ´Ø¿ô¤ÈƱÍͤÀ¤¬¡¢
112 .I "unsigned long long int"
113 ·¿¤ÎÃͤòÊÖ¤¹¡£
114 .SH ÊÖ¤êÃÍ
115 .BR strtoul ()
116 ´Ø¿ô¤ÏÊÑ´¹·ë²Ì¤òÊÖ¤¹¡£Ê¸»úÎ󤬥ޥ¤¥Ê¥¹Éä¹æ¤«¤é»Ï¤Þ¤Ã¤Æ¤¤¤¿¾ì
117 ¹ç¤Ï¡¢(Éä¹æȿžÁ°¤ÎÃͤ¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤·¤Æ¤¤¤Ê¤±¤ì¤Ð) ÊÑ´¹·ë²Ì¤òÉä¹æȿž¤·¤¿
118 Ãͤò unsigned ·¿¤ÇÊÖ¤¹¡£ÊÑ´¹¤Ç¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï
119 .B ULONG_MAX
120 ¤òÊÖ¤·¡¢
121 .I errno
122 ¤Ë
123 .B ERANGE
124 ¤òÀßÄꤹ¤ë¡£
125 .RB ( ULONG_MAX
126 ¤ò
127 .B ULLONG_MAX
128 ¤ÈÆɤßÂؤ¨¤ì¤Ð)
129 .BR strtoull ()
130 ¤Ï
131 .BR strtoul ()
132 ¤ÈÁ´¤¯Æ±¤¸¤Ç¤¢¤ë¡£
133 .SH ¥¨¥é¡¼
134 .TP
135 .B EINVAL
136 (C99 ¤Ë¤Ï¤Ê¤¤)
137 Í¿¤¨¤é¤ì¤¿
138 .I base
139 ¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤ÃͤǤ¢¤ë¡£
140 .TP
141 .B ERANGE
142 ʸ»úÎ󤬿ôÃͤÎɽ¸½Èϰϳ°¤Ç¤¢¤ë¡£
143 .LP
144 ¼ÂÁõ¤Ë¤è¤Ã¤Æ¤Ï¡¢Á´¤¯ÊÑ´¹¤¬¹Ô¤ï¤ì¤Ê¤«¤Ã¤¿¾ì¹ç(Á´¤¯¿ô»ú¤¬¸½¤ì¤º¡¢
145 0 ¤¬ÊÖ¤µ¤ì¤ë)¡¢\fIerrno\fP ¤Ë \fBEINVAL\fP ¤¬¥»¥Ã¥È¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£
146 .SH ½àµò
147 .BR strtoul ()
148 ¤Ï SVr4, C89, C99 ¤È POSIX-2001 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£
149 .BR strtoull ()
150 ¤Ï C99 ¤È POSIX.1-2001 ¤Ë½àµò¤·¤Æ¤¤¤ë¡£
151 .SH Ãí°Õ
152 .B strtoul ()
153 ¤«¤é¤ÏÀ®¸ù¡¢¼ºÇԤɤÁ¤é¤Î¾ì¹ç¤Ç¤â 0 ¤ä
154 .B ULONG_MAX
155 .RB ( strtoull ()
156 ¤Ç¤Ï
157 .BR ULLONG_MAX )
158 ¤¬ÊÖ¤ë²ÄǽÀ­¤¬¤¢¤ë¤Î¤Ç¡¢
159 ¥×¥í¥°¥é¥à¤Ï´Ø¿ô¤ò¸Æ¤Ó½Ð¤¹Á°¤Ë
160 .I errno
161 ¤ò 0 ¤ËÀßÄꤷ¡¢¸Æ¤Ó½Ð¤·¸å¤Ë
162 .I errno
163 ¤¬ 0 °Ê³°¤ÎÃͤ«¤É¤¦¤«¤ò³Îǧ¤·¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤É¤¦¤«¤òȽÃǤ¹¤ë
164 ɬÍפ¬¤¢¤ë¡£
165
166 "C" °Ê³°¤Î¥í¥±¡¼¥ë¤Î¾ì¹ç¡¢¤½¤Î¾¤Îʸ»úÎó¤â¼õ¤±ÉÕ¤±¤é¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£
167 (Î㤨¤Ð¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤Î 1000 Ëè¤Î¶èÀÚ¤êʸ»ú¤ËÂбþ¤·¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£)
168 .LP
169 BSD ¤Ë¤Ï¡¢
170 .sp
171 .in +4n
172 .nf
173 .BI "u_quad_t strtouq(const char *" nptr ", char **" endptr ", int " base );
174 .sp
175 .in -4n
176 .fi
177 ¤È¤¤¤¦´°Á´¤ËƱÍͤÎÄêµÁ¤ò»ý¤Ä´Ø¿ô¤¬¤¢¤ë¡£
178 »ÈÍÑÃæ¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Î¥ï¡¼¥ÉĹ¼¡Âè¤Ç¤¢¤ë¤¬¡¢¤³¤Î´Ø¿ô¤Ï
179 .BR strtoull ()
180 ¤ä
181 .BR stroul ()
182 ¤ÈÅù²Á¤Ê¾ì¹ç¤â¤¢¤ê¤¨¤ë¡£
183
184 Éé¤ÎÃͤâÀµÅö¤ÊÆþÎϤȤߤʤµ¤ì¡¢¥¨¥é¡¼¤â¤Ê¤¯¡¢
185 Âбþ¤¹¤ë
186 .I "unsigned long int"
187 ·¿¤ÎÃͤËÊÑ´¹¤µ¤ì¤ë¡£
188 .SH Îã
189 .BR strtol (3)
190 ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ÎÎã¤ò»²¾È¡£
191 ¤³¤Î¥Ú¡¼¥¸¤ÇÀâÌÀ¤·¤¿´Ø¿ô¤Î»ÈÍÑÊýË¡¤âƱÍͤǤ¢¤ë¡£
192 .SH ´ØÏ¢¹àÌÜ
193 .BR atof (3),
194 .BR atoi (3),
195 .BR atol (3),
196 .BR strtod (3),
197 .BR strtol (3)