mtext_from_data(3m17n)
π mtext_from_data π
okay bestie, welcome to the mtext_from_data(3m17n) page β yes it's a manual page from The m17n Library, and yes we're gonna make it make sense. sit down, grab a boba, let's go β¨
β¨ NAME β¨
mtext_from_data β like the name says, you're making an M-text out of some data π«Ά
πΈ SYNOPSIS πΈ
MText* mtext_from_data (const void * data, int nitems, enum MTextFormat
format)
π¦ DESCRIPTION π¦
okay so the whole vibe here is: you have data, you want an M-text, and this function is gonna allocate a brand new M-text with the data you specified. iconic. π
The mtext_from_data() function allocates a new M-text whose character sequence is specified by array data of nitems elements. and format? that tells it what format data is in, bestie, so don't get it wrong π
here's the breakdown, no cap:
- When
formatis eitherMTEXT_FORMAT_US_ASCIIorMTEXT_FORMAT_UTF_8, the contents ofdatamust be of the typeunsigned char, andnitemscounts by byte. - When
formatis eitherMTEXT_FORMAT_UTF_16LEorMTEXT_FORMAT_UTF_16BE, the contents ofdatamust be of the typeunsigned short, andnitemscounts by unsigned short. - When
formatis eitherMTEXT_FORMAT_UTF_32LEorMTEXT_FORMAT_UTF_32BE, the contents ofdatamust be of the typeunsigned, andnitemscounts by unsigned.
β οΈ okay important: the character sequence of the M-text is not modifiable. and the contents of data must not be modified while the M-text is alive. fr fr, hands off π₯
and about cleanup β the allocated M-text will not be freed unless you explicitly do it yourself with the m17n_object_unref() function. and even in that case, data is not freed. so like. just so you know. π
β RETURN VALUE β
- If the operation was successful,
mtext_from_data()returns a pointer to the allocated M-text. slay β¨ - Otherwise it returns
NULLand assigns an error code to the external variablemerror_code. π
π ERRORS π
MERROR_MTEXT
π 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 β main character energy from the m17n crew, we love to see it π
π¦ 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