changeset 568:559eb65d1289

*** empty log message ***
author kono
date Wed, 11 Jan 2006 18:30:24 +0900
parents 790ecb8900f0
children 1fcad06b264a
files tools/stdio.h.linuxzurus
diffstat 1 files changed, 130 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/stdio.h.linuxzurus	Wed Jan 11 18:30:24 2006 +0900
@@ -0,0 +1,130 @@
+#ifndef __micro_c__
+// #include "/usr/include/stdio.h"
+#include "/home/zaurus/develop/include/stdio.h"
+long long strtoll(const char *, char **, int);
+char *malloc(int);
+void * realloc(void *ptr, int size);
+#else
+
+// typedef int size_t;
+#define size_t int
+
+long long strtoll(const char *, char **, int);
+void * realloc(void *ptr, size_t size);
+
+#ifdef __APPLE__
+
+typedef	struct {
+	/* char	pad[96];	 */
+	char	pad[88];	
+} FILE;
+extern FILE __sF[];
+#define stdin   (&__sF[0])
+#define stdout  (&__sF[1])
+#define stderr  (&__sF[2])
+
+#else
+typedef	struct {
+	/* this is all wrong, but so what? */
+	/* char	pad[96];	 */
+	char	pad[148];	
+} FILE;
+#ifdef bsd
+extern FILE __sstdin;
+extern FILE __sstdout;
+extern FILE __sstderr;
+
+#define	stdin	(&__sstdin)
+#define	stdout	(&__sstdout)
+#define	stderr	(&__sstderr)
+#else
+/* new Linux */
+extern FILE *stdin;
+extern FILE *stdout;
+extern FILE *stderr;
+/*
+#define	stdin stdin
+#define	stdout stdout
+#define	stderr stderr
+ */
+#endif
+#endif
+
+#define	BUFSIZ	1024		/* size of buffer used by setbuf */
+#define	EOF	(-1)
+#define	NULL	0
+
+typedef int SIZE_T_;
+typedef /*long*/ int fpos_t;
+// typedef void *__gnuc_va_list;
+ 
+void	 clearerr(FILE *);
+int	 fclose(FILE *);
+int	 feof(FILE *);
+int	 ferror(FILE *);
+int	 fflush(FILE *);
+int	 fgetc(FILE *);
+int	 fgetpos(FILE *, fpos_t *);
+int	 fileno(FILE *);
+void	 flockfile();
+
+int	 fprintf(FILE *, const char *, ...);
+int	 fpurge();
+int	 fputc(int, FILE *);
+int	 fputs(const char *, FILE *);
+SIZE_T_	 fread(void *, size_t, size_t, FILE *);
+int	 fscanf(FILE *, const char *, ...);
+
+/* int	 fseek(FILE *, long int, int); */
+
+int	 fsetpos(FILE *, const fpos_t *);
+long	 ftell(FILE *);
+int	 ftrylockfile();
+void	 funlockfile();
+SIZE_T_	 fwrite(const void *, size_t, size_t, FILE *);
+int	 getc(FILE *);
+int	 getc_unlocked();
+int	 getchar(void);
+int	 getchar_unlocked();
+int	 getw(FILE *);
+int	 pclose(FILE *);
+void	 perror(const char *);
+int	 printf(const char *, ...);
+int	 putc(int, FILE *);
+int	 putc_unlocked();
+int	 putchar(int);
+int	 putchar_unlocked();
+int	 puts(const char *);
+int	 putw(int, FILE *);
+int	 remove(const char *);
+int	 rename (const char *, const char *);
+void	 rewind(FILE *);
+int	 scanf(const char *, ...);
+void	 setbuf(FILE *, char *);
+void	 setbuffer();
+int	 setlinebuf();
+int	 setvbuf(FILE *, char *, int, SIZE_T_);
+int	 snprintf();
+int	 sprintf(char *, const char *, ...);
+int	 sscanf(const char *, const char *, ...);
+int	 ungetc(int, FILE *);
+// int	 vfprintf(FILE *, const char *, __gnuc_va_list);
+int	 vfscanf();
+// int	 vprintf(const char *, __gnuc_va_list);
+int	 vscanf();
+int	 vsnprintf();
+// int	 vsprintf(char *, const char *, __gnuc_va_list);
+int	 vsscanf();
+char	*ctermid(char *);
+FILE	*fdopen(int, const char *);
+char	*fgetln();
+char	*fgets(char *, int, FILE *);
+FILE	*fopen(const char *, const char *);
+FILE	*freopen(const char *, const char *, FILE *);
+FILE	*funopen();
+char	*gets(char *);
+FILE	*popen(const char *, const char *);
+char	*tempnam(const char *, const char *);
+FILE	*tmpfile(void);
+char	*tmpnam(char *);
+#endif