BSON_STRCASECMP(3)
β¨ BSON_STRCASECMP π
okay bestie, welcome to the libbson corner of the universe β specifically the bson_strcasecmp page, and honestly? it's giving "small but mighty." let's get into it π«Ά
πΈ SYNOPSIS
int
bson_strcasecmp (const char *s1, const char *s2);
that's it. that's the whole signature. two strings go in, an int comes out. no cap β¨
π PARAMETERS
s1β a string. literally just a string. that's the whole vibe πs2β another string. yes bestie, you need two of them π
π¦ DESCRIPTION
so bson_strcasecmp() is a portable version of strcasecmp(). like, it's the same energy but it works wherever libbson works, which is the whole point. portable icon behavior π
if you've ever been burned by strcasecmp() not existing on some random platform, this is your girl. she shows up, she does the comparison, she does not make it weird. π
β RETURNS
here's the tea, and it's a three-way split π:
- returns a negative integer if
s1sorts lexicographically befores2 - returns a positive integer if it sorts after
- returns
0if they're equivalent
and the key detail: all of this happens after translating both strings to lower case. so it's case-insensitive comparison, exactly like the name promised. iykyk π
ngl, the negative/positive thing isn't telling you how much smaller or bigger β it's just the direction. don't go reading extra meaning into the magnitude, bestie π
π AUTHOR
MongoDB, Inc β yes, that MongoDB. iconic of them, honestly. π§
π COPYRIGHT
2009-present, MongoDB, Inc. β a whole era of copyright, we love longevity ππΈ
and that's the whole page, bestie! short, sweet, and case-insensitive. this one's from libbson 2.5.6, dated Oct 09, 2026 β so go forth, compare those strings, and slay β¨πππ₯
π¦ 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