man pages section 9: DDI and DKI Kernel Functions

Exit Print View

Updated: July 2014
 
 

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

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 for Oracle Solaris 11.2

Notes

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