mtext_put_prop(3m17n)

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

πŸ’– mtext_put_prop πŸ’–

okay bestie, welcome to the mtext_put_prop(3m17n) page from The m17n Library β€” yes we're doing text properties today and honestly it's giving main character energy ✨


✨ NAME ✨

mtext_put_prop β€” set a text property πŸŽ€


🌸 SYNOPSIS 🌸

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

πŸ¦‹ DESCRIPTION πŸ¦‹

@brief Set a text property.

so like. the mtext_put_prop() function sets a text property onto the characters between from (inclusive, she's in the club πŸ’…) and to (exclusive, sorry babe you're not on the list) inside the M-text mt. and key and val are literally just the key and the value of that text property. no cap.

so before, you've got this whole vibe going:

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

and then you call this function and it becomes:

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

periodt. the middle got carved out and replaced with your new VAL, and the OLD_VAL is still living its best life on either side 🫢 iconic behavior fr fr.


πŸ’œ Return value

if everything went slay, mtext_put_prop() returns 0. 🌟

if it did not go slay, it returns -1 and assigns an error code to the external variable merror_code. 😭 so go check that.


πŸ“ Errors

MERROR_RANGE, MERROR_SYMBOL


🌈 See Also

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

(go read those too, iykyk πŸ‘‘)


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 that πŸŽ€βœ¨ this was Version 1.8.4, dated Mon Sep 25 2023, and she's filed under mtext_put_prop(3m17n). go forth and set those properties bestie πŸ’–πŸ¦‹

πŸ“¦ where this page comes from