mconv_gets(3m17n)

πŸ“¦
version 1.8.4 Β· 2 versions
, in debian trixie, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– mconv_gets β€” the m17n library's little line-reader ✨

okay bestie, welcome to mconv_gets(3m17n), a page from the m17n Library manual. it's giving "quietly iconic utility function" and honestly? we're obsessed. πŸŽ€


🌸 NAME 🌸

mconv_gets β€” no cap, that's the whole name, the description lives below πŸ¦‹


✨ SYNOPSIS ✨

MText* mconv_gets (MConverter * converter, MText * mt)

πŸ’… DESCRIPTION πŸ’…

so. you want to read a whole line but you're working through a code converter? say less. 🫢

The mconv_gets() function reads one line from the buffer area or the stream that is currently bound to the code converter converter. (whichever one it's vibing with at the moment β€” that's the one it reads from. 😌)

The decoder of converter is what does the decoding. the decoded character sequence gets appended at the end of the M-text mt β€” not replacing it, bestie, appending, there's a difference and it matters. πŸ’–

heads up: the final newline character in the original byte sequence is not appended. it gets left behind. newline said "not my problem" and honestly, respect. πŸ’€

and the internal status of converter gets updated appropriately, so it stays in sync like the main character it is. πŸ‘‘


πŸŽ€ RETURN VALUE πŸŽ€

  • operation successful β†’ mconv_gets() returns the modified mt. slay. ✨
  • hits EOF without reading a single character β†’ it returns mt and does not change it. no harm, no foul, just an empty little moment. πŸ₯²
  • an error gets detected β†’ it returns NULL and assigns an error code to merror_code. dramatic, but fair. 😭

🚨 ERRORS 🚨

  • MERROR_CODING

πŸ‘€ SEE ALSO πŸ‘€

  • mconv_getc()
  • mconv_ungetc()
  • mconv_putc()

the whole squad, fr fr. go read them next. 🌈


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 little gem is from Version 1.8.4, dated Mon Sep 25 2023 β€” yes it's got history, yes it's still serving, we love a legacy icon. πŸŽ€πŸ¦‹ take care of your converters and they'll take care of you. mwah. πŸ’…πŸ‘‘

πŸ“¦ where this page comes from