]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3p/strtoimax.3p
Import of man-pages 1.70
[thirdparty/man-pages.git] / man3p / strtoimax.3p
1 .\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved
2 .TH "STRTOIMAX" P 2003 "IEEE/The Open Group" "POSIX Programmer's Manual"
3 .\" strtoimax
4 .SH NAME
5 strtoimax, strtoumax \- convert string to integer type
6 .SH SYNOPSIS
7 .LP
8 \fB#include <inttypes.h>
9 .br
10 .sp
11 intmax_t strtoimax(const char *restrict\fP \fInptr\fP\fB, char **restrict\fP
12 \fIendptr\fP\fB,
13 .br
14 \ \ \ \ \ \ int\fP \fIbase\fP\fB);
15 .br
16 uintmax_t strtoumax(const char *restrict\fP \fInptr\fP\fB, char **restrict\fP
17 \fIendptr\fP\fB,
18 .br
19 \ \ \ \ \ \ int\fP \fIbase\fP\fB);
20 .br
21 \fP
22 .SH DESCRIPTION
23 .LP
24 These functions shall be equivalent to the \fIstrtol\fP(), \fIstrtoll\fP(),
25 \fIstrtoul\fP(), and \fIstrtoull\fP() functions, except that the initial
26 portion of the string shall be converted to
27 \fBintmax_t\fP and \fBuintmax_t\fP representation, respectively.
28 .SH RETURN VALUE
29 .LP
30 These functions shall return the converted value, if any.
31 .LP
32 If no conversion could be performed, zero shall be returned.
33 .LP
34 If the correct value is outside the range of representable values,
35 {INTMAX_MAX}, {INTMAX_MIN}, or {UINTMAX_MAX} shall be
36 returned (according to the return type and sign of the value, if any),
37 and \fIerrno\fP shall be set to [ERANGE].
38 .SH ERRORS
39 .LP
40 These functions shall fail if:
41 .TP 7
42 .B ERANGE
43 The value to be returned is not representable.
44 .sp
45 .LP
46 These functions may fail if:
47 .TP 7
48 .B EINVAL
49 The value of \fIbase\fP is not supported.
50 .sp
51 .LP
52 \fIThe following sections are informative.\fP
53 .SH EXAMPLES
54 .LP
55 None.
56 .SH APPLICATION USAGE
57 .LP
58 None.
59 .SH RATIONALE
60 .LP
61 None.
62 .SH FUTURE DIRECTIONS
63 .LP
64 None.
65 .SH SEE ALSO
66 .LP
67 \fIstrtol\fP() , \fIstrtoul\fP() , the Base Definitions volume of
68 IEEE\ Std\ 1003.1-2001, \fI<inttypes.h>\fP
69 .SH COPYRIGHT
70 Portions of this text are reprinted and reproduced in electronic form
71 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
72 -- Portable Operating System Interface (POSIX), The Open Group Base
73 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
74 Electrical and Electronics Engineers, Inc and The Open Group. In the
75 event of any discrepancy between this version and the original IEEE and
76 The Open Group Standard, the original IEEE and The Open Group Standard
77 is the referee document. The original Standard can be obtained online at
78 http://www.opengroup.org/unix/online.html .