mconv_putc(3m17n)
π mconv_putc β the m17n library's little "put one character out there" moment π
okay bestie, so you're deep in the m17n manual (that's the man page section 3m17n, the library call corner of the docs) and you landed on mconv_putc. it's giving one character, one converter, one vibe. let's get into it π«Ά
β¨ SYNOPSIS β¨
int mconv_putc (MConverter * converter, int c)
that's it. two args. tiny function. main character energy, honestly. π
πΈ DESCRIPTION πΈ
okay so, mconv_putc() writes a character via a code converter. fr fr, here's the whole deal:
- the function writes the character
cto the buffer area or the stream that is currently bound to the code converterconverterβ whichever one it's attached to right now, no cap - the encoder of
converteris what actually encodes the character - the number of bytes that got actually written gets set into the
nbytesmember ofconverter(so go check that if you wanna know how much landed π) - and the internal status of
convertergets updated appropriately β it's keeping track, it's an icon
so like, it's not just yeeting a char into the void, it's doing the whole bookkeeping thing. very responsible of it. π
π₯ RETURN VALUE π₯
- if the operation was successful,
mconv_putc()returnscβ the character comes right back to you like a lil boomerang, slay β¨ - if an error is detected, it returns
EOFand assigns an error code to the external variablemerror_codeπ
not theEOFjump scare. always checkmerror_code, bestie, it's the receipts.
π ERRORS π
the error codes that can show up in merror_code are:
MERROR_CODINGMERROR_IOMERROR_CHAR
three of them. all iconic. all capable of ruining your afternoon. π
π¦ SEE ALSO π¦
go be nosy, the whole squad is here:
mconv_getc()mconv_ungetc()mconv_gets()
iykyk β putc, getc, ungetc, gets, the whole little friend group π«Ά
π 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 page, you're officially an mconv_putc() girlie now π
β¨ this was Version 1.8.4, dated Mon Sep 25 2023 β mwah, go write some characters, bye bestie! ππ¦π
π¦ 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