xref: /titanic_50/usr/src/man/man9f/stoi.9f (revision cc31cba96d9862a1075a8ec47d6149e04c7ad62d)
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]
STOI 9F "Jan 16, 2006"
NAME
stoi, numtos - convert between an integer and a decimal string
SYNOPSIS

#include <sys/ddi.h>

int stoi(char **str);

void numtos(unsigned long num, char *s);
INTERFACE LEVEL

Solaris DDI specific (Solaris DDI).

PARAMETERS
str

Pointer to a character string to be converted.

num

Decimal number to be converted to a character string.

s

Character buffer to hold converted decimal number.

DESCRIPTION
"stoi()"

The stoi() function returns the integer value of a string of decimal numeric characters beginning at **str. No overflow checking is done. *str is updated to point at the last character examined.

"numtos()"

The numtos() function converts a long into a null-terminated character string. No bounds checking is done. The caller must ensure there is enough space to hold the result.

RETURN VALUES

The stoi() function returns the integer value of the string str.

CONTEXT

The stoi() function can be called from user, interrupt, or kernel context.

SEE ALSO

Writing Device Drivers

NOTES

The stoi() function handles only positive integers; it does not handle leading minus signs.