mdatabase_define(3m17n)
β¨ mdatabase_define β¨ β from the m17n Library, bestie π
okay so before we even start, let me just say: this one is a manual page for mdatabase_define(3m17n), and yes it's a C library thing, and yes it's giving very much "systems programmer who also knows how to have fun". sit down, grab a strawberry π, and let's get into it.
πΈ NAME πΈ
mdatabase_define β bestie this is literally just the function name, no cap. that's the whole NAME section. slay.
π SYNOPSIS π
here's the whole vibe in code form, copy it exactly or the compiler will simply Not:
MDatabase* mdatabase_define (MSymbol tag0, MSymbol tag1, MSymbol tag2,
MSymbol tag3, void *(*)(MSymbol *, void *) loader, void * extra_info)
four tags, a loader function pointer, and some extra_info. the way that signature is iconic honestly. π¦
π DESCRIPTION π
so what this actually does: mdatabase_define() defines a data of the m17n database. like, you're registering a thing so the library knows it exists. it defines a data that has tags tag0 through tag3, plus additional information called extra_info. four tags, that's your whole identity bestie.
now. loader is a pointer to a function that loads the data from the database. and here's the tea: this function gets called from the mdatabase_load() function with the two arguments tags and extra_info. and tags there? that's the array of tag0 through tag3. so your four tags get bundled up into an array and handed over. cute. π
and if loader is NULL, the default loader of the m17n library is used. lowkey convenient. but β and this is important β in this case, extra_info must be a string specifying a filename that contains the data. must. not should. must. if you pass NULL loader and then hand it something that isn't a filename string, that's on you, not me. π
π RETURN VALUE π
- If the operation was successful,
mdatabase_define()returns a pointer to the defined data, which can be used as an argument tomdatabase_load(). periodt. you got your pointer, go use it. - Otherwise, it returns
NULL. and if you seeNULL, that's a vibe check failure, bestie. π
β SEE ALSO β
go read these too, iykyk:
mdatabase_load()mdatabase_define()
(yeah it references itself. main character energy fr fr. π )
π COPYRIGHT π
gotta give credit where credit is due, no plagiarism here:
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 page!! π«Ά this was Version 1.8.4, dated Mon Sep 25 2023, and it's part of the mdatabase_define(3m17n) manual. go define some data, bestie, you're gonna ate. πβ¨
π¦ 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