FGETWS(3P)

πŸ’– FGETWS(3P) β€” the POSIX Programmer's Manual, bestie edition πŸ’–

okay so this page lives in the POSIX Programmer's Manual, and I need you to hear me on this one thing before anything else: the Linux implementation of this interface may differ (so like, go consult the corresponding Linux manual page for details on Linux behavior, mwah), or honestly the interface might not even be implemented on Linux at all. vibe check first, always. 🫢


✨ PROLOG ✨

This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.


πŸŽ€ NAME πŸŽ€

fgetws β€” get a wide-character string from a stream πŸ’…


🌸 SYNOPSIS 🌸

#include <stdio.h>
#include <wchar.h>

wchar_t *fgetws(wchar_t *restrict ws, int n,
    FILE *restrict stream);

πŸ¦‹ DESCRIPTION πŸ¦‹

So the functionality described on this reference page is aligned with the ISO C standard. And like, any conflict between the requirements described here and the ISO C standard is unintentional β€” not me starting drama on purpose, I promise 😭. This volume of POSIX.1‐2017 defers to the ISO C standard, periodt.

The fgetws() function shall read characters from the stream, convert these to the corresponding wide-character codes, place them in the wchar_t array pointed to by ws, until n-1 characters are read, or a <newline> is read, converted, and transferred to ws, or an end-of-file condition is encountered. Then β€” and this is the iconic part β€” the wide-character string, ws, shall be terminated with a null wide-character code. πŸ’–

If an error occurs, the resulting value of the file position indicator for the stream is unspecified. so like, don't come for me, I don't know either πŸ™ˆ.

The fgetws() function may mark the last data access timestamp of the file associated with stream for update. The last data access timestamp shall be marked for update by the first successful execution of fgetwc(), fgetws(), fwscanf(), getwc(), getwchar(), vfwscanf(), vwscanf(), or wscanf() using stream that returns data not supplied by a prior call to ungetwc(). πŸ‘‘


⭐ RETURN VALUE ⭐

Upon successful completion, fgetws() shall return ws. slay. πŸŽ‰

If the end-of-file indicator for the stream is set, or if the stream is at end-of-file, the end-of-file indicator for the stream shall be set and fgetws() shall return a null pointer. πŸ’€

If a read error occurs, the error indicator for the stream shall be set, fgetws() shall return a null pointer, and shall set errno to indicate the error. yeah. it's giving "something went wrong bestie." 😭


πŸ’œ ERRORS πŸ’œ

Refer to fgetwc().

The following sections are informative. (translation: cute lore, not the rules 🧚)


🌈 EXAMPLES 🌈

None. literally none. we have no examples for you today. 😌


πŸ“ APPLICATION USAGE πŸ“

None. nothing. empty. iconic in its own way. ✨


🧚 RATIONALE 🧚

None. πŸ’…


🌟 FUTURE DIRECTIONS 🌟

None. the future is unwritten, bestie. πŸ¦‹


πŸ‘‘ SEE ALSO πŸ‘‘

  • Section 2.5, Standard I/O Streams, fopen(), fread()
  • The Base Definitions volume of POSIX.1‐2017, <stdio.h>, <wchar.h>

Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


and that's the whole page, bestie!! courtesy of IEEE/The Open Group, dated 2017, filed under FGETWS(3P) β€” go get that wide-character string, you absolute main character. πŸ’…βœ¨πŸ«Ά

πŸ“¦ where this page comes from