mtext_data(3m17n)
β¨ mtext_data β¨
okay bestie, welcome to the m17n library manual, page mtext_data(3m17n) π this one is literally about peeking inside your M-text and finding out what its data is actually made of. no cap.
πΈ SYNOPSIS πΈ
void* mtext_data (MText * mt, enum MTextFormat * fmt, int * nunits, int
* pos_idx, int * unit_idx)
π¦ DESCRIPTION π¦
so likeβ¦ this function gets you info about the text data inside an M-text. iconic behavior honestly π
The mtext_data() function returns a pointer to the text data of M-text mt. that's the main character of this whole operation right there β¨
If fmt is not NULL, the format of the text data gets stored in it. if nunits is not NULL, the number of units of the text data gets stored in it. simple as that π
Now here's the lil plot twist β if pos_idx is not NULL and it points to a non-negative number, then what it points to is a character position. In that case, the return value is a pointer to the text data of a character at that position. got it? good π«Ά
Otherwise, if unit_idx is not NULL, it points to a unit position. In that case, the return value is a pointer to the text data of a character containing that unit. yes queen, character-level logic π§
The character position and unit position of the return value get stored in pos_idx and unit_idx respectively, if they are not NULL. very demure, very mindful of your pointers π
- If the format of the text data is
MTEXT_FORMAT_US_ASCIIorMTEXT_FORMAT_UTF_8, one unit isunsigned char. - If the format is
MTEXT_FORMAT_UTF_16LEorMTEXT_FORMAT_UTF_16BE, one unit isunsigned short. - If the format is
MTEXT_FORMAT_UTF_32LEorMTEXT_FORMAT_UTF_32BE, one unit isunsigned int.
lowkey important: the unit type totally depends on which format you're rocking, so vibe check your fmt before you go poking at units bestie π
π 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>.
and that's the whole page, bestie!! π this was Version 1.8.4, dated Mon Sep 25 2023, dropping as mtext_data(3m17n) β slay, periodt, go forth and read your text data πβ¨π¦
π¦ 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