explain_strtoll_or_die(3)
π 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β Thenptr, exactly as to be passed to thestrtoll(3)system call. no edits, no remix, straight through π«endptrβ Theendptr, exactly as to be passed to thestrtoll(3)system call. same vibe π«baseβ Thebase, exactly as to be passed to thestrtoll(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 π
strtoll(3)β convert a string to a long integerexplain_strtoll(3)β explainstrtoll(3)errorsexit(2)β terminate the calling process
π COPYRIGHT π
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
- debian bookworm: libexplain-dev 1.4.D001-12+b1 Β· LGPL-3.0-or-later
- debian trixie: libexplain-dev 1.4.D001-16 Β· LGPL-3.0-or-later
- ubuntu jammy: libexplain-dev 1.4.D001-12 Β· LGPL-3.0-or-later
- ubuntu noble: libexplain-dev 1.4.D001-13 Β· LGPL-3.0-or-later
- ubuntu resolute: libexplain-dev 1.4.D001-16 Β· LGPL-3.0-or-later
- Copyright (C) 2009, 2011 Peter Miller
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms