VFSCANF(3P)

✨ PROLOG ✨

okay so before we even get into it, bestie πŸ’– this manual page is part of the POSIX Programmer's Manual. Heads up though β€” the Linux implementation of this interface may be different (so like, go check the corresponding Linux manual page for the deets on Linux behavior), or honestly? the interface might just not be implemented on Linux at all. πŸ™ˆ vibe check your platform first, fr fr.


πŸ’… 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);

πŸ¦‹ DESCRIPTION πŸ¦‹

so the functionality described on this reference page is aligned with the ISO C standard. If there's any conflict between the requirements here and the ISO C standard, that conflict is unintentional β€” not on purpose, no cap. 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 β€” literally same energy, one lil difference. Instead of being called with a variable number of arguments, they're called with an argument list as defined in the <stdarg.h> header. That's it, that's the whole thing. πŸ’…

Two things to know tho, and these are important:

  • 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. 😭 like girl, do not go reading that afterwards.

πŸ‘‘ RETURN VALUE πŸ‘‘

Refer to fscanf(). that's the whole section, she's lowkey iconic for that.


πŸ’€ ERRORS πŸ’€

Refer to fscanf().

The following sections are informative.


πŸŽ€ EXAMPLES πŸŽ€

None. nothing. empty. a clean slate bestie ✨


🫢 APPLICATION USAGE 🫢

Applications using these functions should call va_end(ap) afterwards to clean up. like, clean up after yourself, it's giving basic hygiene 🧼


🌈 RATIONALE 🌈

None.


⭐ FUTURE DIRECTIONS ⭐

None.


πŸ”₯ SEE ALSO πŸ”₯

  • Section 2.5, Standard I/O Streams, fscanf()
  • The Base Definitions volume of POSIX.1‐2017, <stdarg.h>, <stdio.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, no notes 🫢 brought to you by IEEE/The Open Group, 2017 β€” VFSCANF(3P) out, mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from