msymbol_put(3m17n)

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

✨ 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: both symbol and key must not be Mnil. 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 val gets incremented by one πŸ”Ί

That's it. That's the balance. 🧚


🌈 RETURN VALUE 🌈

  • If everything went slay: msymbol_put() returns 0 ✨
  • If it did not go slay: it returns -1 😭 and assigns an error code to the external variable merror_code

πŸ“ ERRORS πŸ“

  • MERROR_SYMBOL

🫢 SEE ALSO 🫢

  • msymbol_get()

(the sibling, the counterpart, the other half of the duo πŸ‘‘)


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 πŸ’‹πŸŒΈ

msymbol_put(3m17n) ⭐

πŸ“¦ where this page comes from