explain_strcoll_or_die(3)
π explain_strcoll_or_die β like, the manual page, bestie π
okay so you're in explain_strcoll_or_die(3), which lives in the Library Functions Manual section, and honestly? it's giving "I compare strings in your current locale and I will tell you when it goes wrong." no cap. let's get into it π¦
β¨ NAME β¨
explain_strcoll_or_die β compare strings using current locale and report errors
like yes, that's literally the whole job. compare two strings. locale-aware. and if it breaks? it tells you. loudly. π
πΈ SYNOPSIS πΈ
#include <libexplain/strcoll.h>
int explain_strcoll_or_die(const char *s1, const char *s2);
int explain_strcoll_on_error(const char *s1, const char *s2);
two functions. two whole vibes. one of them ends you (the process, not you personally, bestie π«Ά) and the other one is the chill one. keep reading.
π DESCRIPTION π
so the explain_strcoll_or_die function is what you use to call the strcoll(3) system call. and when it fails? an explanation gets printed to stderr, which it grabs from the explain_strcoll(3) function, and then the process terminates by calling exit(EXIT_FAILURE). so likeβ¦ it really said "we're done here." π
the explain_strcoll_on_error function is also used to call the strcoll(3) system call. when it fails, an explanation gets printed to stderr too β also obtained from the explain_strcoll(3) function β but it still returns to the caller. so it's the "tell me what went wrong but don't kill me" option. main character energy but with mercy. β¨
s1β thes1, exactly as to be passed to thestrcoll(3)system call. no edits, no glow-ups, just hand it over as-is.s2β thes2, exactly as to be passed to thestrcoll(3)system call. same deal. π
β RETURN VALUE β
the explain_strcoll_or_die function only returns on success β see strcoll(3) for more information. on failure it prints an explanation and exits, so it does not return. like, at all. it's gone. it left the chat. π
the explain_strcoll_on_error function always returns the value returned by the wrapped strcoll(3) system call. every time. that's the whole point of it, bestie.
π EXAMPLE π
the explain_strcoll_or_die function is intended to be used in a fashion similar to the following example:
int result = explain_strcoll_or_die(s1, s2);
that's it. that's the example. iconic, honestly. one line. ate. π₯
π SEE ALSO π
strcoll(3)β compare two strings using the current localeexplain_strcoll(3)β explainstrcoll(3)errorsexit(2)β terminate the calling process
go read those if you want the full lore. iykyk. π¦
π COPYRIGHT π
libexplain version 1.4 Copyright (C) 2013 Peter Miller
okay so that's the whole page!! libexplain version 1.4, copyright 2013 Peter Miller, and yeah the date on this one is justβ¦ 2013 energy, periodt. go forth and compare strings responsibly bestie, and remember: if you pick the _or_die one, it means the die part. π
πβ¨
π¦ 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) 2013 Peter Miller
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms