mchar_put_prop(3m17n)

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

✨ mchar_put_prop β€” the m17n Library's little "here, take this value" bestie ✨

okay so you found a page from the m17n Library manual (that's mchar_put_prop(3m17n), hi hiii 🫢) and honestly? it's giving "short but powerful". let's get into it.


🌸 NAME 🌸

mchar_put_prop β€” sets a character property's value, that's literally the whole job πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

int mchar_put_prop (int c, MSymbol key, void * val)

three args, one int back, no drama. iconic behavior fr fr ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

so basically: set the value of a character property. that's the vibe.

the mchar_put_prop() function goes looking through character c for the character property whose key is key, and once it finds that property, it assigns val to the value of the found property. boom. done. main character energy πŸ‘‘

think of it like: character c walks in, you hand it a key (key) and a lil gift (val), and it goes "oh that's my property" and drops the gift right in there. adorable. correct. no notes 🎁


⭐ RETURN VALUE ⭐

  • if the operation was successful, mchar_put_prop() returns 0 πŸŽ‰
  • otherwise, it returns -1 😭
like, that's it. zero means yay, negative one means nope. no in-between. binary queen.

πŸ’€ ERRORS πŸ’€

the error symbols you might bump into:

  • MERROR_SYMBOL
  • MERROR_DB
if one of these pops up, that's the universe telling you something went sideways. respect the error codes, bestie πŸ™ˆ

πŸ”₯ SEE ALSO πŸ”₯

go read these next, they're the friend group:

  • mchar_define_property()
  • mchar_get_prop()

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're officially educated πŸ§šπŸ’– this was Version 1.8.4, dated Mon Sep 25 2023, from the m17n Library, and yes bestie the copyright + GNU FDL notice is real and you should absolutely keep it if you're copying this doc around. slay, stay hydrated, go set some character properties πŸ’…βœ¨πŸŒˆ

πŸ“¦ where this page comes from