summaryrefslogtreecommitdiff
path: root/payloads/libpayload/include/stdio.h
diff options
context:
space:
mode:
authorPatrick Georgi <patrick.georgi@secunet.com>2011-02-14 19:25:27 +0000
committerPatrick Georgi <patrick.georgi@coresystems.de>2011-02-14 19:25:27 +0000
commitcd913bdf5c995fb3768aaaaeec364e7f5527e4e9 (patch)
treef929d9966f548530bbfb224ba50394dd4c28e80e /payloads/libpayload/include/stdio.h
parenta4a022c9418096ae7f6e8074dcd917ff68294e8e (diff)
Stub out FILE*, stdout/stdin/stderr and implement fprintf on these
- Add FILE* - Add stdout, stdin, stderr stubs - Add fprintf that redirects to printf for stdout and stderr and fails otherwise Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com> Acked-by: Stefan Reinauer <stefan.reinauer@coreboot.org> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6358 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'payloads/libpayload/include/stdio.h')
-rw-r--r--payloads/libpayload/include/stdio.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/payloads/libpayload/include/stdio.h b/payloads/libpayload/include/stdio.h
index 73af2d18e6..fb40a0dc7e 100644
--- a/payloads/libpayload/include/stdio.h
+++ b/payloads/libpayload/include/stdio.h
@@ -32,6 +32,15 @@
#include <stddef.h>
+struct _FILE {
+} _stdout, _stdin, _stderr;
+
+typedef struct _FILE FILE;
+
+FILE *stdout = &_stdout;
+FILE *stdin = &_stdin;
+FILE *stderr = &_stderr;
+
/**
* @defgroup printf Print functions
* @{
@@ -39,6 +48,7 @@
int snprintf(char *str, size_t size, const char *fmt, ...);
int sprintf(char *str, const char *fmt, ...);
int printf(const char *fmt, ...);
+int fprintf(FILE *file, const char *fmt, ...);
/** @} */
void perror(const char *s);
@@ -47,5 +57,4 @@ void perror(const char *s);
#define SEEK_CUR 1 /**< The seek offset is against the current position. */
#define SEEK_END 2 /**< The seek offset is against the end of the file. */
-
#endif