ustrnicmp(3)
π ustrnicmp(3) π
okay bestie, welcome to the Allegro manual β this is ustrnicmp, and she compares up to n letters of two strings while straight-up ignoring case. yes, ignoring. like she did not see that capital letter, it's not her problem. πΈ part of the Allegro game programming library, obviously. π
β¨ SYNOPSIS β¨
#include <allegro.h>
int ustrnicmp(const char *s1, const char *s2, int n);
like, that's it. that's the whole vibe. π«Ά
π¦ DESCRIPTION π¦
so what she does is: she compares up to n characters of s1 and s2, and she does it ignoring case. so 'A' and 'a'? same girl. besties. no drama. π
here's the moment everyone screenshots, fr fr:
if (ustrnicmp(prefix, long_string, ustrlen(prefix)) == 0) {
/* long_string starts with prefix (ignoring case) */
}
see what she did there?? iconic. prefix-checking behaviour. main character energy. β¨
π RETURN VALUE π
okay so the numbers, no cap:
- zero β the strings are equal, slay π
- a positive number β
s1comes afters2in the ASCII collating sequence - otherwise a negative number β because
s1comes befores2
so it's giving classic compare energy, just with the case-blindness turned all the way up. π
π SEE ALSO π
go read those too bestie, they're all in the same friend group π§
ngl the whole thing is from the Allegro manual, version 4.4.3 β so yeah, that's the version, that's the source, that's the era. periodt. π π¦ β π
π¦ where this page comes from
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms