strton(3)

strton3

Convert string to long integer

Usage

$1$2long strton(char* s, char** e)long strton(char* s, char** e)long strton(char* s, char** e)long strton(char* s, char** e)long strton(char* s, char** e)long strton(char* s, char** e)long strton(char* s, char** e)long strton(char* s, char** e)

Overview

strton converts the nul-terminated string s to a long integer. If e not 0 then *e is set to point to the first unrecognized character in s. Leading spaces in s are ignored.

A number is composed of sign-base-number-suffix. All but number are optional. sign may be + or -. base may be:

0x

for hexadecimal;

0

for octal, or

nn#

for base 2 nn 36.

For bases greater than 10 the additional digits are take from the set [a-zA-Z]. The suffix multiplies the converted number and may be:

b

block (512)

g

giga (1024 * 1024 * 1024)

k

kilo (1024)

m

mega (1024 * 1024)

Releases

Unchanged in 135 releases since Mac OS X 10.4.

  1. 10.4–26.5

From ksh 42 in macOS 26.5. Parsed by carta from the page's man source.