1BSON_ASCII_STRTOLL(3) libbson BSON_ASCII_STRTOLL(3)
2
3
4
6 int64_t
7 bson_ascii_strtoll (const char *str, char **endptr, int base);
8
10 • str: The string to convert.
11
12 • endptr: Address of the first invalid character of str, or null.
13
14 • base: The base to use for the conversion.
15
17 A portable version of strtoll().
18
19 Converts a string to a 64-bit signed integer according to the given
20 base, which must be 16, 10, or 8. Leading whitespace will be ignored.
21
22 If base is 0 is passed in, the base is inferred from the string's lead‐
23 ing characters. Base-16 numbers start with "0x" or "0X", base-8 numbers
24 start with "0", base-10 numbers start with a digit from 1 to 9.
25
26 If endptr is not NULL, it will be assigned the address of the first in‐
27 valid character of str, or its null terminating byte if the entire
28 string was valid.
29
30 If an invalid value is encountered, errno will be set to EINVAL and
31 zero will be returned. If the number is out of range, errno is set to
32 ERANGE and LLONG_MAX or LLONG_MIN is returned.
33
35 The result of the conversion.
36
38 MongoDB, Inc
39
41 2017-present, MongoDB, Inc
42
43
44
45
461.25.1 Nov 08, 2023 BSON_ASCII_STRTOLL(3)