Sun Microsystems, Inc.
spacerspacer
spacer   www.sun.com docs.sun.com | | |  
spacer
black dot
   
A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z
    
 
Kernel Functions for Driversstoi(9F)


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

 

stoi() 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

 

numtos() 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

 

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

CONTEXT

 

stoi() can be called from user or interrupt context.

SEE ALSO

 

Writing Device Drivers

NOTES

 

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


SunOS 5.9Go To TopLast Changed 3 Mar 1994

 
      
      
Copyright 2002 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.