getconf: don't include xpg4 bits, gcc7 includes xpg6 bits for us
[unleashed.git] / share / man / man9f / ddi_strtoll.9f
blob8067a65bae4ac6af1f209b79565dc69a955b2358
1 .\"
2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 .\" permission to reproduce portions of its copyrighted documentation.
4 .\" Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
6 .\"
7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 .\" Group, have given us permission to reprint portions of their
9 .\" documentation.
10 .\"
11 .\" In the following statement, the phrase ``this text'' refers to portions
12 .\" of the system documentation.
13 .\"
14 .\" Portions of this text are reprinted and reproduced in electronic form
15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 .\" Standard for Information Technology -- Portable Operating System
17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 .\" Engineers, Inc and The Open Group.  In the event of any discrepancy
20 .\" between these versions and the original IEEE and The Open Group
21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 .\" document.  The original Standard can be obtained online at
23 .\" http://www.opengroup.org/unix/online.html.
24 .\"
25 .\" This notice shall appear on any product containing this material.
26 .\"
27 .\" The contents of this file are subject to the terms of the
28 .\" Common Development and Distribution License (the "License").
29 .\" You may not use this file except in compliance with the License.
30 .\"
31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32 .\" or http://www.opensolaris.org/os/licensing.
33 .\" See the License for the specific language governing permissions
34 .\" and limitations under the License.
35 .\"
36 .\" When distributing Covered Code, include this CDDL HEADER in each
37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38 .\" If applicable, add the following below this CDDL HEADER, with the
39 .\" fields enclosed by brackets "[]" replaced with your own identifying
40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
41 .\"
42 .\"
43 .\" Copyright (c) 2001, The IEEE and The Open Group.  All Rights Reserved.
44 .\" Portions Copyright (c) 2009, Sun Microsystems Inc. All Rights Reserved.
45 .\"
46 .TH DDI_STRTOLL 9F "Feb 25, 2009"
47 .SH NAME
48 ddi_strtoll, ddi_strtoull \- string conversion functions
49 .SH SYNOPSIS
50 .LP
51 .nf
52 #include <sys/ddi.h>
53 #include <sys/sunddi.h>
55 \fBint\fR \fBddi_strtoll\fR(\fBconst char *\fR\fIstr\fR, \fBchar **\fR\fIendptr\fR, \fBint\fR \fIbase\fR,
56      \fBlonglong_t *\fR\fIresult\fR);
57 .fi
59 .LP
60 .nf
61 \fBint\fR \fBddi_strtoull\fR(\fBconst char *\fR\fIstr\fR, \fBchar **\fR\fIendptr\fR, \fBint\fR \fIbase\fR,
62      \fBu_longlong_t *\fR\fIresult\fR);
63 .fi
65 .SH PARAMETERS
66 .sp
67 .ne 2
68 .na
69 \fB\fIstr\fR\fR
70 .ad
71 .RS 10n
72 pointer to a character string to be converted
73 .RE
75 .sp
76 .ne 2
77 .na
78 \fB\fIendptr\fR\fR
79 .ad
80 .RS 10n
81 post-conversion final string of unrecognized characters
82 .RE
84 .sp
85 .ne 2
86 .na
87 \fB\fIbase\fR\fR
88 .ad
89 .RS 10n
90 radix used for conversion
91 .RE
93 .sp
94 .ne 2
95 .na
96 \fB\fIresult\fR\fR
97 .ad
98 .RS 10n
99 pointer to variable which contains the converted value
102 .SH INTERFACE LEVEL
105 Solaris DDI specific (Solaris DDI)
106 .SH DESCRIPTION
109 The \fBddi_strtoll()\fR function converts the initial portion of the string
110 pointed to by \fIstr\fR to a type \fBlonglong_t\fR representation and stores
111 the converted value in \fIresult\fR.
114 The \fBddi_strtoull()\fR function converts the initial portion of the string
115 pointed to by \fIstr\fR to a type \fBu_longlong_t\fR representation and stores
116 the converted value in \fIresult\fR.
119 These functions first decomposes the input string into three parts:
120 .RS +4
123 An initial (possibly empty) sequence of white-space characters (" ", "\et",
124 "\en", "\er", "\ef")
126 .RS +4
129 A subject sequence interpreted as an integer represented in some radix
130 determined by the value of base
132 .RS +4
135 A final string of one or more unrecognized characters, including the
136 terminating null byte of the input string.
140 The \fBddi_strtoll()\fR function then attempts to convert the subject sequence
141 to an integer and returns the result. The \fBddi_strtoull()\fR function
142 attempts to convert the subject sequence to an unsigned integer and returns the
143 result.
146 If the value of base is 0, the expected form of the subject sequence is that of
147 a decimal constant, octal constant or hexadecimal constant, any of which may be
148 preceded by a plus ("+") or minus ("-") sign. A decimal constant begins with a
149 non-zero digit, and consists of a sequence of decimal digits. An octal constant
150 consists of the prefix 0 optionally followed by a sequence of the digits 0 to 7
151 only. A hexadecimal constant consists of the prefix 0x or 0X followed by a
152 sequence of the decimal digits and letters a (or A) to f (or F) with values 10
153 to 15 respectively.
156 If the value of base is between 2 and 36, the expected form of the subject
157 sequence is a sequence of letters and digits representing an integer with the
158 radix specified by base, optionally preceded by a plus or minus sign. The
159 letters from a (or A) to z (or Z) inclusive are ascribed the values 10 to 35
160 and only letters whose ascribed values are less than that of base are
161 permitted. If the value of base is 16, the characters 0x or 0X may optionally
162 precede the sequence of letters and digits, following the sign if present.
165 The subject sequence is defined as the longest initial subsequence of the input
166 string, starting with the first non-white-space character that is of the
167 expected form. The subject sequence contains no characters if the input string
168 is empty or consists entirely of white-space characters, or if the first
169 non-white-space character is other than a sign or a permissible letter or
170 digit.
173 If the subject sequence has the expected form and the value of base is 0, the
174 sequence of characters starting with the first digit is interpreted as an
175 integer constant. If the subject sequence has the expected form and the value
176 of base is between 2 and 36, it is used as the base for conversion, ascribing
177 to each letter its value as given above. If the subject sequence begins with a
178 minus sign, the value resulting from the conversion is negated. A pointer to
179 the final string is stored in the object pointed to by \fIendptr\fR, provided
180 that \fIendptr\fR is not a null pointer.
183 If the subject sequence is empty or does not have the expected form, no
184 conversion is performed and the value of \fIstr\fR is stored in the object
185 pointed to by \fIendptr\fR, provided that \fIendptr\fR is not a null pointer.
186 .SH RETURN VALUES
189 Upon successful completion, these functions return 0 and store the converted
190 value in \fIresult\fR. If no conversion is performed due to an invalid base,
191 these functions return \fBEINVAL\fR and the variable pointed by \fIresult\fR is
192 not changed.
193 .SH CONTEXT
196 These functions may be called from user, kernel or interrupt context.
197 .SH ATTRIBUTES
200 See \fBattributes\fR(5) for descriptions of the following attributes:
205 box;
206 c | c
207 l | l .
208 ATTRIBUTE TYPE  ATTRIBUTE VALUE
210 Interface Stability     Committed
213 .SH SEE ALSO
216 \fIWriting Device Drivers\fR