m17nSymbol(3m17n)
β¨ m17nSymbol π (the m17n Library manual, section 3m17n)
okay bestie, sit DOWN because we're about to talk about symbols, and honestly? iconic behavior.
πΈ NAME πΈ
m17nSymbol_-_Sy β Symbol objects and API for them. that's it, that's the whole vibe. π
π SYNOPSIS π
π¦ Functions
MSymbol msymbol(const char *name)β grab yourself a symbol. π«ΆMSymbol msymbol_as_managing_key(const char *name)β make a managing key, the fancy kind.int msymbol_is_managing_key(MSymbol symbol)β is this symbol a managing key or not, we gotta know.MSymbol msymbol_exist(const char *name)β (no little blurb on this one in the original, it's mysterious, we respect that π)char * msymbol_name(MSymbol symbol)β (also no blurb, still ate tho)int msymbol_put(MSymbol symbol, MSymbol key, void *val)β set the value of a symbol property.void * msymbol_get(MSymbol symbol, MSymbol key)β get the value of a symbol property.int msymbol_put_func(MSymbol symbol, MSymbol key, M17NFunc func)β set the value (a function pointer) of a symbol property.M17NFunc msymbol_get_func(MSymbol symbol, MSymbol key)β get the value (a function pointer) of a symbol property.
π Variables
MSymbol Mnilβ symbol whose name is'nil'.MSymbol Mtβ symbol whose name is't'.MSymbol Mstringβ symbol whose name is'string'.MSymbol Msymbolβ symbol whose name is'symbol'.
π Detailed Description π
Symbol objects and API for them. periodt.
so like, the m17n library uses these little objects called symbols as unambiguous identifiers. think of them as the main characters of naming β no confusion, no drama, no "wait which one did you mean". Symbols are similar to atoms in the X library, but plot twist: a symbol can have zero or more symbol properties. and what's a symbol property, you ask? it's a key plus a value. the key is also a symbol (symbols all the way down, we love a self-referential queen π), and the value is literally anything that can be cast to (void *).
quick glossary moment, because the original is being cute about it:
'The symbol property that belongs to the symbol S and whose key is K'may be shortened to'K property of S'.
see? efficient. we stan.
Symbols are used mainly in these three ways, and bestie, these are the big three:
- As keys of symbol properties and other properties.
- To represent various objects, e.g. charsets, coding systems, fontsets.
- As arguments of the m17n library functions to control their behavior.
and now for the special one π§: there is a special kind of symbol called a managing key. the value of a property whose key is a managing key must be a managed object. like, no exceptions, that's the rule. see Managed Object for the detail.
π Variable Documentation π
MSymbol Mnil
Symbol whose name is 'nil'. the symbol Mnil has the name 'nil' and, in general, represents false or no. when coerced to 'int', its value is zero. and heads up β Mnil can't have any symbol property. at all. none. it's giving minimalist. π
MSymbol Mt
Symbol whose name is 't'. the symbol Mt has the name 't' and, in general, represents true or yes. the yes-girl of symbols fr fr. β¨
MSymbol Mstring
Symbol whose name is 'string'. the symbol Mstring has the name 'string' and is used as an argument of the functions mchar_define_property(), etc. (yes, the etc. is doing a lot of work there, that's what the original says, we don't make the rules π«Ά)
MSymbol Msymbol
Symbol whose name is 'symbol'. the symbol Msymbol has the name 'symbol' and is used as an argument of the functions mchar_define_property(), etc. name so nice they said it twice basically.
π Author π
Generated automatically by Doxygen for The m17n Library from the source code. so technically no human wrote this, which is lowkey wild.
π 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. go forth and symbol responsibly. π π¦πΈ
Version 1.8.4 β Mon Sep 25 2023 β m17nSymbol(3m17n). mwah, love u, bye! ππβ¨
π¦ 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