mconv_ungetc(3m17n)

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

πŸ’– mconv_ungetc β€” the m17n Library, bestie edition πŸ’–

okay so welcome to the m17n Library corner of the man pages, section 3m17n, and today's main character is mconv_ungetc. no cap, she's a little icon. πŸŽ€


✨ NAME ✨

mconv_ungetc β€” and yeah, the official description slot is literally just a dash. empty. void. a mystery. the manpage said "mconv_ungetc -" and nothing else, so we're all just living with that. iykyk. 🫢


🌸 SYNOPSIS 🌸

int mconv_ungetc (MConverter * converter, int c)

look at her. two args. returns an int. clean. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so the whole vibe here is: push a character back into a code converter. that's it, that's the function.

mconv_ungetc() pushes the character c back into the code converter converter. and like β€” not just one, bestie. any number of characters can be pushed back. go off, stack them, the limit does not exist. πŸ”₯

the order is the spicy part: the lastly pushed back character is the firstly read one by the subsequent mconv_getc() call. so it's giving very much a stack situation, last in first out, no notes. ✨

and here's the thing you need to know: the characters pushed back are registered only in converter. they are not written to the input source. so don't be out here thinking you're editing your actual file or stream β€” you're not. it's all happening inside the converter's own little world. 🧚

lastly, the internal status of converter is updated appropriately. she keeps herself tidy. queen behavior. πŸ‘‘


πŸ’œ RETURN VALUE πŸ’œ

  • if the operation was a slay (successful) β€” mconv_ungetc() returns c. the character comes right back to you. 🫢
  • if not β€” it returns EOF and assigns an error code to the external variable merror_code.
so like, check merror_code if you get an EOF, fr fr. don't just assume. 😭

πŸ“ ERRORS πŸ“

the possible error codes are:

  • MERROR_CODING
  • MERROR_CHAR

that's the list. exactly two. periodt. πŸ’…


🌈 SEE ALSO 🌈

  • mconv_getc()
  • mconv_putc()
  • mconv_gets()

the whole squad. go read them too, they're all iconic in their own way. πŸ’–


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 page!! Version 1.8.4, dated Mon Sep 25 2023 β€” yeah she's been around a minute but she still ate. πŸ’…βœ¨ mwah, go push some characters back, bestie. πŸŽ€πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from