m17nDatabase(3m17n)

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

✨ m17nDatabase ✨ β€” bestie's guide to the m17n database πŸ—‚οΈπŸ’–

okay so this is a page from The m17n Library manual set, m17nDatabase(3m17n), and it's literally the whole vibe of "where does the library keep its stuff and how do I poke at it". sit down, hydrate, we're doing this 🫢


NAME πŸŽ€

m17nDatabase_-_Data β€” the m17n database, plus the API for it. that's it, that's the whole name, periodt.


SYNOPSIS 🌈

Typedefs πŸ¦‹

  • typedef struct MDatabase MDatabase β€” the type of a database object. yes queen, it's a struct and it's mysterious on purpose πŸ‘‘

Functions 🌸

  • MDatabase * mdatabase_find (MSymbol tag0, MSymbol tag1, MSymbol tag2, MSymbol tag3) β€” go look for a data in the database πŸ”
  • MPlist * mdatabase_list (MSymbol tag0, MSymbol tag1, MSymbol tag2, MSymbol tag3) β€” hand you back a data list of the m17n database πŸ“œ
  • MDatabase * mdatabase_define (MSymbol tag0, MSymbol tag1, MSymbol tag2, MSymbol tag3, void *(*loader)(MSymbol *, void *), void *extra_info) β€” define a data of the m17n database, aka you're adding your own ✍️
  • void * mdatabase_load (MDatabase *mdb) β€” load a data from the database πŸ“₯
  • MSymbol * mdatabase_tag (MDatabase *mdb) β€” get the tags of a data 🏷️

Variables πŸ“

  • char * mdatabase_dir

Detailed Description πŸ‘‘

The m17n database and the API for it. iconic honestly.

Directory for application specific data πŸ’…

So the m17n library is out here pulling all kinds of info from data in the m17n database, on demand, whenever it needs it. no cap. and bestie β€” your app can add and load its own original data to/from the m17n database too. how? you set the variable mdatabase_dir to an application-specific directory and store data in it. that's the whole move.

Users can overwrite those data by storing preferable data in the directory specified by the environment variable 'M17NDIR' β€” or, if that one isn't set, in the directory '~/.m17n.d'. choose your fighter πŸ₯Š

The tag system 🏷️✨

The m17n database contains multiple heterogeneous data, and each data is identified by four tags: TAG0, TAG1, TAG2, TAG3. each tag must be a symbol, no exceptions.

TAG0 specifies the type of data stored in the database, like this:

  • If TAG0 is Mchar_table, the data is of the chartable type and provides information about each character. in this case, TAG1 specifies the type of the information and must be Msymbol, Minteger, Mstring, Mtext, or Mplist. TAG2 and TAG3 can be any symbols. so many options, we love range πŸ’–
  • If TAG0 is Mcharset, the data is of the charset type and provides a decode/encode mapping table for a charset. in this case, TAG1 must be a symbol representing a charset. TAG2 and TAG3 can be any symbols.
  • If TAG0 is neither Mchar_table nor Mcharset, the data is of the plist type. go read the documentation of the mdatabase_load() function for the details, i'm not doing that part for you bestie πŸ“–. in this case, TAG1, TAG2, and TAG3 can be any symbols.

The notation <TAG0, TAG1, TAG2, TAG3> means a data with those tags. write that down ✍️

How you actually use it 🌱

Application programs first call the mdatabase_find() function to get a pointer to an object of the type MDatabase. that object holds information about the specified data. when it's successfully returned, the mdatabase_load() function loads the data. and the implementation of the structure MDatabase? concealed from application programs. she's private, she's mysterious, we respect her privacy πŸ™ˆ

If an application program wants to provide a data specific to the program, or a data overriding what's supplied by the m17n database, it must set this variable to a name of directory that contains the data files before it calls the macro M17N_INIT(). yes, before. order matters, don't play yourself ⏰

That directory may contain a file 'mdb.dir' which contains a list of data definitions in the format described in mdbDir(5). slay, cross-references πŸ“š

The default value is NULL.


Typedef Documentation 🧚

typedef struct MDatabase MDatabase πŸ‘‘

Type of database. <>

The type MDatabase is for a database object. Its internal structure is concealed from an application program. like i said β€” private queen, don't ask her for her secrets πŸ’…


Variable Documentation 🌿

char* mdatabase_dir πŸ’Ύ

(that's the application-specific directory variable from up top, she's the main character of this whole page fr fr)


Author ✨

Generated automatically by Doxygen for The m17n Library from the source code. so, like, a robot wrote it and i'm just translating it into vibes πŸ€–πŸ’–


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 that's the whole thing, every tag, every function signature, every directory, untouched. i promised i wouldn't drop a single detail and i did NOT 🫢

and that's a wrap bestie!! this was Version 1.8.4, dated Mon Sep 25 2023 β€” go forth and mdatabase_find() your dreams πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…

πŸ“¦ where this page comes from