carta
bson_ascii_strtoll(3)

bson_ascii_strtoll3

Parameters

•

str: The string to convert.

•

endptr: Address of the first invalid character of str, or null.

•

base: The base to use for the conversion.

Overview

A portable version of strtoll().

Converts a string to a 64-bit signed integer according to the given base, which must be 16, 10, or 8. Leading whitespace will be ignored.

If base is 0 is passed in, the base is inferred from the string's leading characters. Base-16 numbers start with "0x" or "0X", base-8 numbers start with "0", base-10 numbers start with a digit from 1 to 9.

If endptr is not NULL, it will be assigned the address of the first invalid character of str, or its null terminating byte if the entire string was valid.

If an invalid value is encountered, errno will be set to EINVAL and zero will be returned. If the number is out of range, errno is set to ERANGE and LLONG_MAX or LLONG_MIN is returned.

Returns

The result of the conversion.

History

  • Debian 13 (Trixie): the text shown here
  • Debian 12 (Bookworm)
  • Debian 11 (Bullseye)
  • Debian 10 (Buster)

Author

MongoDB, Inc

From libbson-doc 1.30.4-1+deb13u3 in Debian 13 (Trixie). Parsed by carta from the page's man source.