minput_get_variable(3m17n)

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

minput_get_variable πŸ’–

okay bestie, welcome to the minput_get_variable(3m17n) page β€” yes it lives in The m17n Library and no you don't have to be scared of it, I promise. sit down, grab a strawberry πŸ“, and let's get into it.


✨ NAME ✨

minput_get_variable β€” literally just. getting the tea on input method variables. that's it, that's the whole name 🫢


✨ SYNOPSIS ✨

MPlist* minput_get_variable (MSymbol language, MSymbol name, MSymbol variable)

three symbols walk into a function. no cap. πŸ’…


✨ DESCRIPTION ✨

@brief Get information about input method variable(s). (yes the original said @brief, we love a documentation-generator moment πŸ’€)

so. the way that minput_get_variable() works is it hands you back information about the variable variable of the input method that language and name are pointing at. and like, an input method variable is exactly what it sounds like β€” it controls the behavior of an input method. it's the little knob that decides how your IM acts. πŸ”₯

there are two kinds of variables, and this is the part where people get confused so pay attention bestie:

  • global β€” a global variable has a global definition, and its description and its value may be inherited by a local variable. iconic inheritance behavior, we love to see it πŸ‘‘
  • local β€” every input method defines a local variable, and that local variable has a local value. it may also declare a local variable that inherits the definition of a global variable of the same name. so it's like "I have my own thing but also I'm borrowing yours" energy fr fr.

here's the routing logic, and it's giving very clean if/else:

  • if language is #Mt and name is #Mnil, you get information about a global variable.
  • otherwise? information about a local variable. periodt.

and then:

  • if variable is #Mnil, you get information about all the variables. all of them. the whole group chat. 😭

the return value is a well-formed plist (that's a m17nPlist β€” see m17nPlist) shaped exactly like this:

((NAME DESCRIPTION STATUS VALUE [VALID-VALUE ...]) ...)

okay let's decode every single field because I refuse to let you skim:

  • NAME β€” a symbol representing the variable name. the name. the identifier. the whole point.
  • DESCRIPTION β€” an M-text describing the variable, or Mnil if the variable has no description. no description? valid. we've all been there πŸ™ˆ
  • STATUS β€” a symbol representing how the value got decided. and there are options:
    • Mnil β€” that's the default value
    • Mcustomized β€” the value got customized by a per-user customization file
    • Mconfigured β€” the value was set by the call of minput_config_variable()
    • and for a local variable only, it may also be Minherited β€” meaning the value was inherited from the corresponding global variable πŸ’–
  • VALUE β€” the initial value of the variable. but here's the twist: if the key of this element is Mt, then the variable has no initial value. otherwise, the key is Minteger, Msymbol, or Mtext, and the value is of the corresponding type. ✨
  • VALID-VALUEs (if any) β€” these specify which values the variable is actually allowed to have. they have the same type (i.e. the same key) as VALUE, except for the case where VALUE is an integer. in that case, VALID-VALUE may be a plist of two integers specifying the range of possible values. πŸ“
and if there's no VALID-VALUE? then the variable can have any value, as long as the type is the same as VALUE. free-spirited variable. main character energy. 🌈

one last thing: if variable is not Mnil, then the first element of the returned plist contains the information about variable. boom.


✨ RETURN VALUE ✨

if the requested information was found, you get a pointer to a non-empty plist. πŸŽ‰

but listen β€” the plist is kept in the library. so the caller must not modify it and must not free it. hands off. do not touch. I am so serious. 🚫

otherwise β€” meaning the specified input method doesn't exist, or the specified variable doesn't exist β€” you get NULL. and that's just how it is sometimes. πŸ’€


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!! πŸŽ€ this was Version 1.8.4, dated Mon Sep 25 2023 β€” yes she's a 2023 girlie and she still ate. go forth and query your variables, ily, bye!! πŸ’…βœ¨πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from