summaryrefslogtreecommitdiff
path: root/firmware/libc/include/stdio.h
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2010-05-06 21:04:40 +0000
committerThomas Martitz <kugel@rockbox.org>2010-05-06 21:04:40 +0000
commit50a6ca39ad4ed01922aa4f755f0ca579788226cf (patch)
treec7881b015b220558167310345b162324c96be15a /firmware/libc/include/stdio.h
parentadb506df14aded06ed6e9ebf8540e6fd383ffd6a (diff)
downloadrockbox-50a6ca39ad4ed01922aa4f755f0ca579788226cf.zip
rockbox-50a6ca39ad4ed01922aa4f755f0ca579788226cf.tar.gz
rockbox-50a6ca39ad4ed01922aa4f755f0ca579788226cf.tar.bz2
rockbox-50a6ca39ad4ed01922aa4f755f0ca579788226cf.tar.xz
Move c/h files implementing/defining standard library stuff into a new libc directory, also standard'ify some parts of the code base (almost entirely #include fixes).
This is to a) to cleanup firmware/common and firmware/include a bit, but also b) for Rockbox as an application which should use the host system's c library and headers, separating makes it easy to exclude our files from the build. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25850 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/libc/include/stdio.h')
-rw-r--r--firmware/libc/include/stdio.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/firmware/libc/include/stdio.h b/firmware/libc/include/stdio.h
new file mode 100644
index 0000000..d9a6dce
--- /dev/null
+++ b/firmware/libc/include/stdio.h
@@ -0,0 +1,60 @@
+#ifndef _STDIO_H_
+#define _STDIO_H_
+
+#include <_ansi.h>
+
+#define __need_size_t
+#include <stddef.h>
+
+#define __need___va_list
+#include <stdarg.h>
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+#define EOF (-1)
+
+#ifndef SEEK_SET
+#define SEEK_SET 0 /* set file offset to offset */
+#endif
+#ifndef SEEK_CUR
+#define SEEK_CUR 1 /* set file offset to current plus offset */
+#endif
+#ifndef SEEK_END
+#define SEEK_END 2 /* set file offset to EOF plus offset */
+#endif
+
+#define TMP_MAX 26
+
+#ifdef __GNUC__
+#define __VALIST __gnuc_va_list
+#else
+#define __VALIST char*
+#endif
+
+int vsnprintf (char *buf, size_t size, const char *fmt, __VALIST ap);
+
+int sprintf (char *buf, const char *fmt, ...) ATTRIBUTE_PRINTF(2, 3);
+
+int snprintf (char *buf, size_t size, const char *fmt, ...)
+ ATTRIBUTE_PRINTF(3, 4);
+
+/* callback function is called for every output character (byte) with userp and
+ * should return 0 when ch is a char other than '\0' that should stop printing */
+int vuprintf(int (*push)(void *userp, unsigned char data),
+ void *userp, const char *fmt, __VALIST ap);
+
+int sscanf(const char *s, const char *fmt, ...)
+ ATTRIBUTE_SCANF(2, 3);
+
+#ifdef SIMULATOR
+typedef void FILE;
+int vfprintf(FILE *stream, const char *format, __VALIST ap);
+#ifdef WIN32
+#define FILENAME_MAX 260 /* ugly hard-coded value of a limit that is set
+ in file.h */
+#endif
+#endif
+
+#endif /* _STDIO_H_ */