mtext_ncmp(3m17n)
π NAME π
mtext_ncmp β like, the name says it all bestie, no cap
β¨ SYNOPSIS β¨
int mtext_ncmp (MText * mt1, MText * mt2, int n)
πΈ DESCRIPTION πΈ
Okay so picture this: you've got two M-texts and you wanna compare their initial parts, character-by-character, like you're lining up two besties side by side and checking who's taller. That's literally what mtext_ncmp() does. π«Ά
It's basically mtext_cmp()'s sister β same energy, same vibe β except she stops early. Instead of comparing the whole thing, she compares at most n characters from the beginning. Periodt. That's the whole deal. π
π RETURN VALUE π
She hands you back one of three little numbers, and they mean exactly this:
1βmt1is greater thanmt20βmt1is equal tomt2-1βmt1is less thanmt2
So it's 1, 0, or -1 depending on whether mt1 is found greater than, equal to, or less than mt2. Simple. Iconic. No notes. π
π¦ SEE ALSO π¦
The whole friend group, go say hi:
mtext_cmp()mtext_casecmp()mtext_ncasecmp()mtext_compare()mtext_case_compare()
π COPYRIGHT π
Copyright (C) 2001 Information-technology Promotion Agency (IPA)
Copyright (C) 2001-2011 National Institute of Advanced Industrial Science and Technology (AIST)
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License <http://www.gnu.org/licenses/fdl.html>.
and that's the whole page, bestie β this was m17n Library, mtext_ncmp(3m17n), Version 1.8.4, dated Mon Sep 25 2023. stan a tiny n that saves you a whole comparison. mwah πβ¨
π¦ where this page comes from
- debian trixie: m17n-docs 1.8.4-1
- ubuntu noble: m17n-docs 1.8.4-1
- ubuntu questing: m17n-docs 1.8.4-1
- ubuntu resolute: m17n-docs 1.8.4-1build1
- ubuntu stonking: m17n-docs 1.8.4-1build1
- Copyright (C) 2001 Information-technology Promotion Agency (IPA)
- Copyright (C) 2001-2011 National Institute of Advanced Industrial Science and Technology (AIST)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms