summaryrefslogtreecommitdiff
path: root/src/stdio/vfprintf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stdio/vfprintf.c')
-rw-r--r--src/stdio/vfprintf.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/stdio/vfprintf.c b/src/stdio/vfprintf.c
new file mode 100644
index 00000000..c6a35edc
--- /dev/null
+++ b/src/stdio/vfprintf.c
@@ -0,0 +1,30 @@
+#include <stdio.h>
+#include "stdarg.h"
+#include "nonstd/io.h"
+#include "nonstd/internal.h"
+
+/** write formatted output to a file stream **/
+int vfprintf(FILE * restrict stream, const char * restrict format, va_list arg)
+{
+ int ret = 0;
+ struct io_options opt = {0};
+ opt.fnname = "vfprintf";
+ opt.stream = stream;
+ ret = __printf(&opt, format, arg);
+ /*
+ RETURN_SUCCESS(the number of characters written);
+ RETURN_FAILURE(an error occured);
+ */
+ return ret;
+}
+
+/***
+is equivalent to FUNCTION(fprintf), but with a TYPEDEF(va_list)
+argument instead of variadic arguments. The argument ARGUMENT(arg) must be
+initialized with FUNCTION(va_start) prior to calling THIS(). The THIS()
+function does not call FUNCTION(va_end), so the calling function is
+responsible for this.
+***/
+/*
+STDC(1)
+*/