mtext_push_prop(3m17n)

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

πŸ’– mtext_push_prop β€” from the m17n library (yes, that m17n, 3m17n girlies rise) πŸ’–

okay bestie, sit down, we're doing text properties today and honestly? it's giving sorcery. this one lives in the m17n manual, section 3, and it's about pushing a property onto a chunk of your M-text. let's GO πŸ¦‹


✨ NAME ✨

mtext_push_prop -

(yeah the description is literally just a dash, she's mysterious like that πŸ’…)


✨ SYNOPSIS ✨

int mtext_push_prop (MText * mt, int from, int to, MSymbol key, void *
val)

✨ DESCRIPTION ✨

@brief Push a text property. like, push it onto the pile, no cap.

The mtext_push_prop() function pushes a text property whose key is key and value is val to the characters between from (inclusive, babe) and to (exclusive, don't forget) in M-text mt.

So with this function, this:

                    FROM                    TO
M-text: |<------------|-------- MT ---------|------------>|
PROP  :  <------------------ OLD_VAL -------------------->

becomes THIS ✨:

                    FROM                    TO
M-text: |<------------|-------- MT ---------|------------>|
PROP  :  <------------------- OLD_VAL ------------------->
PROP  :               <-------- VAL ------->

see how VAL just slides in on top of OLD_VAL?? she's layered. she's stacked. main character energy fr fr. πŸ‘‘

ngl this is a push, not a put β€” the old value is still down there underneath, bestie. if you wanted to replace it outright that's a different function (see below πŸ‘€).

🌸 Return value 🌸

If the operation was successful, mtext_push_prop() returns 0. πŸŽ‰

Otherwise it returns -1 and assigns an error code to the external variable #merror_code. 😭 (check it, she'll tell you what went wrong)


🌈 Errors 🌈

  • MERROR_RANGE
  • MERROR_SYMBOL

that's the vibe check, and if you fail it you get one of these two. πŸ™ˆ


πŸŽ€ See Also πŸŽ€

  • mtext_put_prop()
  • mtext_put_prop_values()
  • mtext_get_prop()
  • mtext_get_prop_values()
  • mtext_pop_prop()
  • mtext_prop_range()

iykyk, these are the whole property friend group, go say hi. 🫢


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 that's the whole page, you ate it, I'm so proud. πŸ’– Version 1.8.4, dated Mon Sep 25 2023 β€” that's the tea, mwah, see you in the next manpage bestie 🧚🌸✨

πŸ“¦ where this page comes from