mtext_insert(3m17n)

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

✨ mtext_insert ✨

okay bestie, so this is a page from the m17n Library (that's "multilingualization", the whole make-computers-speak-every-language situation) and the function we're stanning today is mtext_insert. πŸ’–


🌸 NAME 🌸

mtext_insert β€” literally the "put this text inside that other text" girlie 🫢


πŸŽ€ SYNOPSIS πŸŽ€

int mtext_insert (MText * mt1, int pos, MText * mt2, int from, int to)

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the vibe: you've got an M-text (mt1) and you want to shove a piece of a totally different M-text (mt2) into it. That's it, that's the whole job. πŸ’…

The mtext_insert() function inserts sub-text of M-text mt2 between from (inclusive, so it's invited to the party πŸŽ‰) and to (exclusive, so it's NOT 😭) into M-text mt1, at position pos.

As a result, mt1 is lengthen by (to - from). (yes, "lengthen", we don't make the rules, the original said it that way, so it stays πŸ’€)

On insertion, all the text properties of the sub-text of mt2 are inherited. Like, they come along with it. No cap. All of them. πŸ‘‘


⭐ RETURN VALUE ⭐

  • If the operation was successful, mtext_insert() returns 0. slay! πŸŽ€
  • Otherwise, it returns -1 and assigns an error code to the external variable merror_code. 😭

πŸ’€ ERRORS πŸ’€

  • MERROR_MTEXT
  • MERROR_RANGE
not me getting MERROR_RANGE because my from/to were doing too much πŸ™ˆ check your ranges bestie, for real.

πŸ‘‘ SEE ALSO πŸ‘‘

  • mtext_ins()

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 Version 1.8.4, dated Mon Sep 25 2023, from the mtext_insert(3m17n) era β€” go forth and insert your text with main character energy, periodt. πŸ¦‹βœ¨

πŸ“¦ where this page comes from