mtext_get_prop(3m17n)

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

✨ mtext_get_prop ✨

okay bestie, so this is a lil page from the m17n Library manual set, and it's all about mtext_get_prop β€” the function that goes digging for a text property and hands you back its value. it's giving "detective but make it a single character". πŸ’…


🌸 NAME 🌸

mtext_get_prop β€” grab the value of the topmost text property at some position, no cap


πŸŽ€ SYNOPSIS πŸŽ€

void* mtext_get_prop (MText * mt, int pos, MSymbol key)

πŸ’– DESCRIPTION πŸ’–

Get the value of the topmost text property. fr fr, that's the whole vibe.

The mtext_get_prop() function searches the character at pos in M-text mt for the text property whose key is key. like, it walks up to that one character, knocks on the door, and asks "hey do you have a property called key? and what's it holding?"


πŸ¦‹ RETURN VALUE πŸ¦‹

If a text property is found, mtext_get_prop() returns the value of the property. If the property has multiple values, it returns the topmost one. If no such property is found, it returns NULL without changing the external variable merror_code. so it's polite about it, it doesn't touch the error code when it's just a plain old not-found. 🫢

If an error is detected, mtext_get_prop() returns NULL and assigns an error code to the external variable merror_code.

Note πŸ‘‘ If NULL is returned without an error, there are two possibilities: - the character at pos does not have a property whose key is key, or - the character does have such a property and its value is NULL. If you need to distinguish these two cases, use the mtext_get_prop_values() function instead.

like, NULL is doing double duty here and it will NOT tell you which situation you're in. 😭 so if that distinction matters to you (and tbh it might!), go talk to mtext_get_prop_values() instead, she's got the receipts.


🌈 ERRORS 🌈

  • MERROR_RANGE
  • MERROR_SYMBOL

⭐ SEE ALSO ⭐

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

the whole property-prop friend group, honestly. 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>.


and that's the whole page, bestie!! 🧚 this was Version 1.8.4, dated Mon Sep 25 2023, and it lives under the mtext_get_prop(3m17n) name. mwah, go get your property values, ilysm πŸ’–βœ¨

πŸ“¦ where this page comes from