BSON_ASCII_STRTOLL(3)
π BSON_ASCII_STRTOLL(3) β the libbson bestie guide π
okay so this is the libbson page for bson_ascii_strtoll, and it's basically the portable-queen version of strtoll(). Let's get into it, bestie. π«Ά
πΈ SYNOPSIS πΈ
int64_t
bson_ascii_strtoll (const char *str, char **endptr, int base);
π PARAMETERS π
strβ the string you're converting, periodt.endptrβ address of the first invalid character ofstr, or null. Yes, it's a pointer-to-pointer situation, iykyk.baseβ the base to use for the conversion.
β¨ DESCRIPTION β¨
It's a portable version of strtoll(). Iconic.
It 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 β not me ignoring your texts, just whitespace. π
If you pass in base as 0, the base is inferred from the string's leading characters. Here's the tea:
- Base-16 numbers start with
"0x"or"0X". - Base-8 numbers start with
"0". - Base-10 numbers start with a digit from
1to9.
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. So yeah, watch the range, bestie β that's the whole drama. π
π RETURNS π
The result of the conversion. Slay.
π«Ά AUTHOR π«Ά
MongoDB, Inc
π COPYRIGHT π
2009-present, MongoDB, Inc.
Source/version: libbson 2.5.6 Β· date: Oct 09, 2026 β that's the whole page, bestie, go forth and convert π
π¦ where this page comes from
- epel 10: libbson-devel 2.5.6-1.el10_3 Β· Apache-2.0 AND ISC AND MIT AND Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms