mtext_replace(3m17n)
β¨ NAME β¨
mtext_replace β bestie, this is the one that swaps out a chunk of one M-text for a chunk of another π (ngl the original manpage left this part blank, so we're all just vibing off the title)
πΈ SYNOPSIS πΈ
int mtext_replace (MText * mt1, int from1, int to1, MText * mt2, int
from2, int to2)
That's the whole function signature, character for character, no notes π
π¦ DESCRIPTION π¦
okay so picture this: you've got two M-texts and you want to do a little surgical swap. That's literally it.
The mtext_replace() function replaces sub-text of M-text mt1 between from1 (inclusive) and to1 (exclusive) with the sub-text of M-text mt2 between from2 (inclusive) and to2 (exclusive).
and the cutest part?? the new sub-text inherits text properties of the old sub-text. it's giving glow-up-by-association π β¨
lowkey important:fromis in,tois out. half-open ranges, bestie, we love a consistent boundary π«Ά
π RETURN VALUE π
- If the operation was successful,
mtext_replace()returns0. π slay. - Otherwise, it returns
-1and assigns an error code to the external variablemerror_code. π not the vibe, check the variable.
π ERRORS π
MERROR_MTEXTMERROR_RANGE
yep, those are the two. if you see either of these in merror_code, that's your culprit π΅οΈββοΈ
π SEE ALSO π
mtext_insert()
go read that one too, they're besties fr fr π
π 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 Version 1.8.4 of the m17n Library docs, dated Mon Sep 25 2023, and yeah, it's mtext_replace(3m17n) through and through. go forth and replace some sub-text πβ¨
π¦ 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