File: strtol.3

package info (click to toggle)
manpages-ja 0.5.0.0.20050315-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 18,620 kB
  • ctags: 4
  • sloc: sh: 12,675; perl: 157; makefile: 106
file content (130 lines) | stat: -rw-r--r-- 4,520 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
.\"WORD: base 
.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one.
.\" 
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date.  The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein.  The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\" 
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.\" References consulted:
.\"     Linux libc source code
.\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
.\"     386BSD man pages
.\" Modified Sun Jul 25 10:53:39 1993 by Rik Faith (faith@cs.unc.edu)
.\" Added correction due to nsd@bbc.com (Nick Duffek) - aeb, 950610
.\"
.\" Japanese Version Copyright (c) 1999 AKAMATSU, Kazuo
.\"         all rights reserved.
.\" Translated Thu Jan 9 21:00:00 JST 1999
.\"         by AKAMATSU, Kazuo
.\" Updated Sun Apr  8 JST 2001 by Kentaro Shirakata <argrath@ub32.org>
.\" Updated Sat Mar 23 JST 2002 by Kentaro Shirakata <argrath@ub32.org>
.\"
.TH STRTOL 3  2002-02-22 "GNU" "Linux Programmer's Manual"
.SH ̾
strtol, strtoll, strtoq \- ʸ long int Ѵ
.SH 
.nf
.B #include <stdlib.h>
.sp
.BI "long int"
.BI "strtol(const char *" nptr ", char **" endptr ", int " base );
.sp
.BI "long long int"
.BI "strtoll(const char *" nptr ", char **" endptr ", int " base );
.fi
.SH 
\fBstrtol()\fP ؿ \fInptr\fP ʸκǽʬ
\fIbase\fP Ȥlong int Ѵ롣
 \fIbase\fP  2  36 ޤǤ
뤤̤ʰ̣ 0 ()ǤʤФʤʤ
.PP
ʸƬˤϡǤդο (
.BR isspace (3)
) 򤬤äƤ褯ޤľˤ `+'  `-' 
äƤ褤 \fIbase\fP  0 ޤ 16 ξˤϡ `0x' ǤϤޤ
ʸ 16 ʿȤư롣ʳʸФ \fIbase\fP 
0 ξϡ `0' ǻϤޤʸ 8 ʿȤơ
ʳʸ 10 ʿȤư롣
.PP
ɽʸ long int Ѵ뤬Ф
ͭǤʤ줿ѴϽλ롣(11 ʿʾǤ `A' 
ʸʸ˴ؤ餺 10 ɽ `B'  11 ɽ
ʲƱͤˡ `Z'  35 ɽ)
.PP
\fIendptr\fP ̥ (NULL) Ǥʤϡǽ˸줿ʸ
\fBstrtol()\fP ˤä \fI*endptr\fP ¸Ƥ롣
ʸͭʿҤȤĤʤС \fBstrtol()\fP  \fInptr\fP
θͤ \fI*endptr\fP ( 0 ֤)
äˡ\fI*nptr\fP  `\\0' ʳǡᤵ줿 \fI**endptr\fP  `\\0'
ʤСʸΤͭäȤˤʤ롣
.PP
.B strtoll()
ؿ
.B strtol()
Ʊͤlong long int ֤ͤ
.SH ֤
Ѵ줿֤ͤ롣Сեˤ LONG_MAX ֤졢
եˤ LONG_MIN ֤롣Сե
եΤξˤ
ѿ \fIerrno\fP ˤ ERANGE ꤵ롣
.B strtoll()
ƱͤǤ뤬LONG_MIN  LONG_MAX  LLONG_MIN  LLONG_MAX 
֤롣
.SH 顼
.TP
.B EINVAL
(C99 ˤϤʤ)
.I base
бƤʤͤǤ롣
.TP
.B ERANGE
̤ͤϰϳǤ롣
.LP
ˤäƤϡѴԤʤä(ʤ0 ֤)
\fIerrno\fP  \fBEINVAL\fP ꤵ礬롣
.SH 
"C"ʳΥξ硢¾ʸ󤬼դ뤫⤷ʤ
(㤨СߤΥ 1000 ζڤʸбƤ뤫⤷ʤ)
.LP
BSD ˤϡ
.sp
.in +4n
.nf
.BI "quad_t"
.BI "strtoq(const char *" nptr ", char **" endptr ", int " base );
.sp
.in -4n
.fi
ȤƱͤĴؿ롣
ߤΥƥΥĹ˰¸ơδؿ
.B strtoll()

.B strtol()
Ȥʤ롣
.SH 
.B strtol()
 SVID 3, BSD 4.3, ISO 9899 (C99), POSIX ˽򤷤Ƥ롣
.B strtoll()
 ISO 9899 (C99)  POSIX 1003.1-2001 ˽򤷤Ƥ롣
.SH Ϣ
.BR atof (3),
.BR atoi (3),
.BR atol (3),
.BR strtod (3),
.BR strtoul (3)