mplist_put(3m17n)
β¨ mplist_put β¨
ok so bestie, welcome to the mplist_put(3m17n) page π this one lives in The m17n Library and it's lowkey one of those functions that does exactly what it says on the tin. let's get into it π«Ά
πΈ NAME πΈ
mplist_put β the one where you set a property's value in a property list (yes, the original page literally just leaves the dash hanging there, no cap, so here we are π
)
π SYNOPSIS π
MPlist* mplist_put (MPlist * plist, MSymbol key, void * val)
π¦ DESCRIPTION π¦
okay so, main character behaviour: set the value of a property in a property list β¨
Here's the tea β β mplist_put() searches the property list plist from the beginning looking for a property whose key is key:
- If such a property is found, its value is changed to
value. π― - Otherwise, a brand new property whose key is
keyand value isvalueis appended at the end ofplist. π«Ά
heads up bestie π¨ β go read the documentation ofmplist_add()for the restriction onkeyandval. that restriction is not optional, it's giving rules-are-rules π
Also, important detail: if key is a managing key, then val must be a managed object. In that case:
- the reference count of the old value, if not
NULL, is decremented by one π - and the reference count of
valis incremented by one π₯
so yeah, refcounts are getting shuffled around, stay aware β¨
π RETURN VALUE π
- If the operation was successful,
mplist_put()returns a sublist ofplistwhose first element is the just modified or added one. slay. π - Otherwise, it returns
NULL. π
π 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>.
and that's the whole page, bestie π Version 1.8.4, dated Mon Sep 25 2023 β go forth and set those properties, you absolute icon πβ¨π¦
π¦ 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