mtext_duplicate(3m17n)

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

πŸ’– mtext_duplicate β€” the m17n Library's lil copy-paste bestie πŸ’–

okay so bestie, this is mtext_duplicate(3m17n) from The m17n Library, and she's here to slice you a fresh copy of some text. no cap. πŸŽ€


✨ SYNOPSIS ✨

MText* mtext_duplicate (MText * mt, int from, int to)

πŸ¦‹ DESCRIPTION πŸ¦‹

so the whole vibe of mtext_duplicate() is: you have an M-text, you want a new M-text that's just a piece of it. boom. that's the function. πŸ’…

it creates a copy of a sub-text of the M-text mt, starting at from (inclusive, so yes bestie, that index is invited to the party) and ending at to (exclusive, so that index is NOT β€” it's giving "you're not on the list" energy 😭).

and here's the part that's actually iconic: the new copy inherits all the text properties of mt. every last one. it's giving nepo baby but make it text properties, and honestly? we love that for it. πŸ‘‘

oh and also β€” super important β€” mt itself is not modified. we are copying, not mutating. your original stays exactly how you left it. periodt. 🫢


🌸 RETURN VALUE 🌸

  • if everything went slay and the operation was successful, mtext_duplicate() returns a pointer to the created M-text. ✨
  • if an error got detected, it returns NULL and assigns an error code to the external variable merror_code. so like, check that variable, bestie, it's literally telling you what went wrong. πŸ’€

πŸ™ˆ ERRORS πŸ™ˆ

  • MERROR_RANGE

πŸ”₯ SEE ALSO πŸ”₯

  • mtext_dup()

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, and honestly? she ate. go duplicate something. mwah πŸ’‹

πŸ“¦ where this page comes from