mtext_case_compare(3m17n)

πŸ“¦
version 1.8.4 Β· 2 versions
, in debian trixie, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ NAME ✨

mtext_case_compare β€” bestie, it compares two M-text regions and does NOT care about case πŸ’…


🌸 SYNOPSIS 🌸

int mtext_case_compare (MText * mt1, int from1, int to1, MText * mt2,
int from2, int to2)

πŸ’– DESCRIPTION πŸ’–

okay so mtext_case_compare() is the vibe-check function: it compares two M-texts, mt1 and mt2, character-by-character, and it ignores cases the whole time. like, uppercase who? never heard of her πŸ’€

the regions it actually compares are the stretch between from1 and to1 inside mt1, and the stretch between from2 and to2 inside mt2.

here's the rules of the region, no cap:

  • from1 and from2 are inclusive β€” they're in the squad 🫢
  • to1 and to2 are exclusive β€” they're NOT included, sorry bestie
  • if from1 equals to1 (or from2 equals to2), that means you've got an M-text of length zero. iconic, but empty ✨
  • and if you hand it an invalid region specification, it just treats it like both from1 and to1 (or from2 and to2) are 0. that's the rule, periodt.

⭐ RETURN VALUE ⭐

it returns one of three little guys:

  • 1 β€” if mt1 is found greater than mt2
  • 0 β€” if they're equal
  • -1 β€” if mt1 is found less than mt2

and the comparison itself? it's based on character codes. that's the whole tea β˜•


πŸ¦‹ SEE ALSO πŸ¦‹

your other faves, all in the same friend group:

  • mtext_cmp()
  • mtext_ncmp()
  • mtext_casecmp()
  • mtext_ncasecmp()
  • mtext_compare()

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 a wrap, bestie πŸŽ€ this was mtext_case_compare, straight outta the m17n Library, Version 1.8.4, dated Mon Sep 25 2023 β€” slay, ate, no crumbs, mwah πŸ’–βœ¨

πŸ“¦ where this page comes from