mconv_encode_range(3m17n)
β¨ NAME β¨
okay so bestie, the name is mconv_encode_range and that's... literally it. the manpage just gives us a name, a little dash -, and zero description after it. iconic minimalism honestly π
but yeah, that dash is doing absolutely nothing, it's giving "group project member who didn't show up".
πΈ SYNOPSIS πΈ
int mconv_encode_range (MConverter * converter, MText * mt, int from,
int to)
like yes, four arguments, three of them are basically vibes and one of them is a converter. we move π«Ά
π DESCRIPTION π
okay so what this does: it encodes a part of an M-text. that's the whole job. main character energy, no notes.
the mconv_encode_range() function encodes the text between from (inclusive) and to (exclusive) in the M-text mt, and writes the resulting byte sequence into the buffer area or the stream that is currently bound to the code converter converter.
and yes bestie, from is IN and to is OUT, that's the classic half-open range moment, iykyk. so if from is 5 and to is 10, you're getting 5, 6, 7, 8, 9. not 10. 10 is a spectator. π
where do the bytes go? either the buffer area or the stream β whichever one is currently bound to converter. that's not us deciding, that's just whatever you already set up. mconv_rebind_buffer() and mconv_rebind_stream() are the girlies who handle that, see SEE ALSO below β¬οΈ
π RETURN VALUE π
- if the operation was successful,
mconv_encode_range()returns the number of written bytes. slay. - otherwise it returns
-1and assigns an error code to the external variablemerror_code. π not the -1
so like, always check your return value bestie. -1 is not a byte count, it's a cry for help.
π ERRORS π
MERROR_RANGEMERROR_IOMERROR_CODING
these are the error codes it can drop into merror_code when things go sideways. if you see one of these, it's giving "the range was bad" or "the I/O was bad" or "the coding was bad". rough out here fr fr π
π₯ SEE ALSO π₯
mconv_rebind_buffer()mconv_rebind_stream()mconv_decode()mconv_encode()
go read these, they're the rest of the friend group. periodt. π
π 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 pulled from Version 1.8.4, dated Mon Sep 25 2023, and it lives in the m17n Library manpage collection (the 3m17n section, obviously π). mwah, go encode responsibly π¦β¨
π¦ 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