blob: f41b6b28fb88a0909c4d418b2c2b47a77c772b6e (
plain)
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
|
'\" te
.\" Copyright (c) 2006, Sun Microsystems, Inc.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH STOI 9F "Jan 16, 2006"
.SH NAME
stoi, numtos \- convert between an integer and a decimal string
.SH SYNOPSIS
.nf
#include <sys/ddi.h>
\fBint\fR \fBstoi\fR(\fBchar\fR \fI**str\fR);
.fi
.LP
.nf
\fBvoid\fR \fBnumtos\fR(\fBunsigned long\fR \fInum\fR, \fBchar *\fR\fIs\fR);
.fi
.SH INTERFACE LEVEL
illumos DDI specific (illumos DDI).
.SH PARAMETERS
.ne 2
.na
\fB\fIstr\fR\fR
.ad
.RS 7n
Pointer to a character string to be converted.
.RE
.sp
.ne 2
.na
\fB\fInum\fR\fR
.ad
.RS 7n
Decimal number to be converted to a character string.
.RE
.sp
.ne 2
.na
\fB\fIs\fR\fR
.ad
.RS 7n
Character buffer to hold converted decimal number.
.RE
.SH DESCRIPTION
.SS "\fBstoi()\fR"
The \fBstoi()\fR function returns the integer value of a string of decimal
numeric characters beginning at \fI**str\fR. No overflow checking is done.
\fI*str\fR is updated to point at the last character examined.
.SS "\fBnumtos()\fR"
The \fBnumtos()\fR function converts a \fBlong\fR into a null-terminated
character string. No bounds checking is done. The caller must ensure there is
enough space to hold the result.
.SH RETURN VALUES
The \fBstoi()\fR function returns the integer value of the string \fIstr\fR.
.SH CONTEXT
The \fBstoi()\fR function can be called from user, interrupt, or kernel
context.
.SH SEE ALSO
\fIWriting Device Drivers\fR
.SH NOTES
The \fBstoi()\fR function handles only positive integers; it does not handle
leading minus signs.
|