mtext_search(3m17n)

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

πŸ’– NAME πŸ’–

mtext_search β€” okay so the official description here is literally just a dash, no cap, the manpage said "mtext_search -" and dipped. We move anyway. This is the M-text search function from the m17n Library, and she is that girl. πŸ’…


✨ SYNOPSIS ✨

int mtext_search (MText * mt1, int from, int to, MText * mt2)

Four args, one int, zero drama. πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

Bestie, listen. mtext_search() locates an M-text inside a specific range of another M-text. It's a find-in-range, but make it M-text. ✨

So what happens is: it searches for the first occurrence of the M-text mt2 inside the M-text mt1, but only in the region between from and to β€” and it does all of that while ignoring difference of the text properties. Yes, the properties are getting ignored. She said "I'm not looking at your properties today." 😭

And here's the direction tea πŸ“:

  • If from is less than to, the forward search starts from from.
  • Otherwise, the backward search starts from to.
So the range tells you where to look, and the ordering of from and to tells you which way to walk. Main character direction energy. 🧚

πŸ‘‘ RETURN VALUE πŸ‘‘

  • If mt2 is found in mt1, mtext_search() returns the position of the first occurrence. ✨
  • Otherwise it returns -1. Not found, not slaying, not today. πŸ’€
  • If mt2 is empty, it returns 0. Empty queen returns zero, iconic behavior honestly. πŸŽ€

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>. 🫢


Okay and that's the whole page, bestie!! 🌸 This was Version 1.8.4, dated Mon Sep 25 2023, and it's the mtext_search(3m17n) girl herself. Go find your substrings, periodt. πŸ’–βœ¨πŸ¦‹πŸ‘‘

πŸ“¦ where this page comes from