m17nDatabase(3m17n)
β¨ 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
TAG0isMchar_table, the data is of the chartable type and provides information about each character. in this case,TAG1specifies the type of the information and must beMsymbol,Minteger,Mstring,Mtext, orMplist.TAG2andTAG3can be any symbols. so many options, we love range π - If
TAG0isMcharset, the data is of the charset type and provides a decode/encode mapping table for a charset. in this case,TAG1must be a symbol representing a charset.TAG2andTAG3can be any symbols. - If
TAG0is neitherMchar_tablenorMcharset, the data is of the plist type. go read the documentation of themdatabase_load()function for the details, i'm not doing that part for you bestie π. in this case,TAG1,TAG2, andTAG3can 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 π
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
- 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