minput_list(3m17n)

πŸ’– NAME πŸ’–

minput_list β€” bestie, it's giving "list me the input methods" energy, and that's literally the whole vibe ✨


🌸 SYNOPSIS 🌸

MPlist* minput_list (MSymbol language)

πŸ¦‹ DESCRIPTION πŸ¦‹

@brief ok so the whole point: list available input methods. πŸ’…

The minput_list() function hands you back a list of all the input methods that are currently available and whose language is language. And if language is #Mnil? Then bestie, it's all of them β€” every single input method gets listed. No filter, no cap. πŸ‘‘

@par Return value:

The returned value is a plist, and it looks exactly like this:

((LANGUAGE-NAME INPUT-METHOD-NAME SANE) ...)

The third element, SANE, of each input method is #Mt if it can be successfully used, or #Mnil if it's got some problem β€” like, for example, a syntax error in the MIM file, an external module that isn't available, or an including input method that isn't available. 🫠 So SANE is basically the vibe check for each input method, and sometimes it does not pass.

✨ Example ✨

#include <stdio.h>
#include <string.h>
#include <m17n.h>

int
main (int argc, char **argv)
{
  MPlist *imlist, *pl;

  M17N_INIT();
  imlist = minput_list ((argc > 1) ? msymbol (argv[1]) : Mnil);
  for (pl = imlist; mplist_key (pl) != Mnil; pl = mplist_next (pl))
    {
      MPlist *p = mplist_value (pl);
      MSymbol lang, name, sane;

      lang = mplist_value (p);
      p = mplist_next (p);
      name = mplist_value (p);
      p = mplist_next (p);
      sane = mplist_value (p);

      printf ("%s %s %s0, msymbol_name (lang), msymbol_name (name),
          sane == Mt ? "ok" : "no");
    }

  m17n_object_unref (imlist);
  M17N_FINI();
  exit (0);
}

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 β€” every option, every symbol, every #Mnil accounted for. we ate and left zero crumbs. πŸ’…

Version 1.8.4 β€” Mon Sep 25 2023 β€” mwah, m17n library, you icon, you absolute legend 🫢✨

πŸ“¦ where this page comes from