msymbol_put(3m17n)
β¨ NAME β¨
msymbol_put β bestie, this is the one that puts stuff π
(the official description is literally just a dash, so yeah, we're keeping it mysterious, iykyk)
Part of The m17n Library, btw π
π¦ SYNOPSIS π¦
int msymbol_put (MSymbol symbol, MSymbol key, void * val)
π DESCRIPTION π
Okay so, real talk: msymbol_put() sets the value of a symbol property. That's the whole gig.
Here's the tea, fr fr β it assigns val to the value of the symbol property that belongs to symbol and whose key is key. If that symbol property already has a value? Too bad, so sad, val overwrites the old one. It's giving replacement, not addition. π
β οΈ Lowkey important: bothsymbolandkeymust not beMnil. Like, don't even try it.
And now for the part that actually matters if you're doing memory management (main character energy tbh):
If key is a managing key, then val must be a managed object. In this case:
- the reference count of the old value, if it's not
NULL, gets decremented by one π» - and the reference count of
valgets incremented by one πΊ
That's it. That's the balance. π§
π RETURN VALUE π
- If everything went slay:
msymbol_put()returns0β¨ - If it did not go slay: it returns
-1π and assigns an error code to the external variablemerror_code
π ERRORS π
MERROR_SYMBOL
π«Ά SEE ALSO π«Ά
msymbol_get()
(the sibling, the counterpart, the other half of the duo π)
π 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>.
Okay bestie that's the whole page, go forth and set your symbol properties responsibly π
Version 1.8.4 β dated Mon Sep 25 2023 β and yeah, that's the vibe check, we're done here, mwah ππΈ
π¦ 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