explain_strtoll_or_die(3)

πŸ“¦
version 1.4.D001 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu resolute

πŸ’– explain_strtoll_or_die(3) πŸ’–

okay bestie, so this is a page from the Library Functions Manual, and it's about explain_strtoll_or_die β€” yes the name is a whole sentence, we love that for her. Let's get into it 🫢


✨ NAME ✨

explain_strtoll_or_die β€” convert a string to a long integer and report errors πŸ’…


🌸 SYNOPSIS 🌸

#include <libexplain/strtoll.h>
long long explain_strtoll_or_die(const char *nptr, char **endptr, int
base);
long long explain_strtoll_on_error(const char *nptr, char **endptr, int
base))
not me noticing that second prototype has a lil extra ) at the end 😭 we're keeping it exactly as-is because that's literally what the page says, no cap.

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the tea, bestie. There are two functions on this page and they are sisters, not twins.

The explain_strtoll_or_die function is used to call the strtoll(3) system call. On failure an explanation will be printed to stderr, obtained from the explain_strtoll(3) function, and then the process terminates by calling exit(EXIT_FAILURE). yeah. it just ends it. dramatic, but iconic πŸ‘‘

The explain_strtoll_on_error function is used to call the strtoll(3) system call. On failure an explanation will be printed to stderr, obtained from the explain_strtoll(3) function, but still returns to the caller. so like, she tells you what went wrong and then stays. main character energy fr fr ✨


πŸŽ€ the arguments πŸŽ€

  • nptr β€” The nptr, exactly as to be passed to the strtoll(3) system call. no edits, no remix, straight through πŸ’«
  • endptr β€” The endptr, exactly as to be passed to the strtoll(3) system call. same vibe πŸ’«
  • base β€” The base, exactly as to be passed to the strtoll(3) system call. yes bestie, also straight through πŸ’«

⭐ RETURN VALUE ⭐

The explain_strtoll_or_die function only returns on success, see strtoll(3) for more information. On failure, prints an explanation and exits, it does not return. like, she's gone. she left the group chat. 😭

The explain_strtoll_on_error function always returns the value return by the wrapped strtoll(3) system call. (that's the wording on the page, we're keeping it verbatim, grammar who? πŸ™ˆ)


🌈 EXAMPLE 🌈

The explain_strtoll_or_die function is intended to be used in a fashion similar to the following example:

long long result = explain_strtoll_or_die(nptr, endptr, base);

look at her go πŸ₯Ή so clean, so simple, so slay.


πŸ‘‘ SEE ALSO πŸ‘‘


libexplain version 1.4 Copyright (C) 2009 Peter Miller


and that's the whole page bestie, we ate and left no crumbs πŸ“ this was explain_strtoll_or_die(3) from the Library Functions Manual β€” libexplain version 1.4, Copyright (C) 2009 Peter Miller β€” mwah, go convert some strings responsibly πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from