VFSCANF(3POSIX)

πŸ’– vfscanf, vscanf, vsscanf β€” the POSIX girlies πŸ’–

okay bestie, welcome to VFSCANF(3POSIX) from the POSIX Programmer's Manual, brought to you by IEEE/The Open Group, 2017. it's giving "read the room, then read the input" ✨


🌸 PROLOG 🌸

bestie, real talk before we start. 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 on Linux behavior), or the interface may not be implemented on Linux.

so like… check your local manpage too, okay? don't come for me πŸ’…


✨ NAME ✨

vfscanf, vscanf, vsscanf β€” format input of a stdarg argument list 🫢


πŸŽ€ SYNOPSIS πŸŽ€

#include <stdarg.h>
#include <stdio.h>

int vfscanf(FILE *restrict stream, const char *restrict format,
    va_list arg);
int vscanf(const char *restrict format, va_list arg);
int vsscanf(const char *restrict s, const char *restrict format,
    va_list arg);

look at those restrict qualifiers, they ate πŸ’…


πŸ¦‹ 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? not intentional, bestie. this volume of POSIX.1‐2017 defers to the ISO C standard, periodt.

now the actual tea β˜•:

vscanf(), vfscanf(), and vsscanf() shall be equivalent to the scanf(), fscanf(), and sscanf() functions respectively β€” except that instead of being called with a variable number of arguments, they are called with an argument list as defined in the <stdarg.h> header. no cap.

and here's the important bit, so listen up πŸ”₯:

  • These functions shall not invoke the va_end macro.
  • As these functions invoke the va_arg macro, the value of ap after the return is unspecified.

so like, don't go poking at ap afterwards expecting it to make sense, she's in her post-return era and nobody knows what's going on there 😭


⭐ RETURN VALUE ⭐

Refer to fscanf(). that's it, that's the section. go read the fscanf() page, bestie 🫢


🌈 ERRORS 🌈

Refer to fscanf(). again. same energy, same page, iykyk πŸ’œ

The following sections are informative. (translation: the vibes are informational only, they're not requirements πŸ’…)


πŸ’– EXAMPLES πŸ’–

None.

not me giving you zero examples… but like, that's literally what it says πŸ™ˆ


πŸ’… APPLICATION USAGE πŸ’…

okay this one actually matters, so pay attention:

Applications using these functions should call va_end(ap) afterwards to clean up.

clean up after yourself, main character. leave no mess 🧹✨


πŸ“ RATIONALE πŸ“

None.

the rationale is on a break, she said "not today" πŸ’€


🧚 FUTURE DIRECTIONS 🧚

None.

the future is unwritten, bestie, and this page is not about to speculate 🌸


πŸ‘‘ SEE ALSO πŸ‘‘

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

go read those, they're the supporting cast and they understood the assignment πŸŽ€


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, hope it slayed 🫢 this came to you from IEEE/The Open Group, 2017 β€” VFSCANF(3POSIX), signing off πŸ’–βœ¨πŸŽ€