1 /* 2 ** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved. 3 ** Distributed under the terms of the OpenBeOS License. 4 */ 5 #ifndef _STDIO_H_ 6 #define _STDIO_H_ 7 // must match the one of the real stdio.h 8 9 #include <stdarg.h> 10 11 #ifdef __cplusplus 12 extern "C" { 13 #endif 14 15 typedef struct FILE FILE; 16 // dummy definition of FILE 17 // In the boot loader, it really is a ConsoleNode 18 19 extern FILE *stdin; 20 extern FILE *stdout; 21 extern FILE *stderr; 22 23 #ifndef SEEK_SET 24 # define SEEK_SET 0 25 #endif 26 #ifndef SEEK_CUR 27 # define SEEK_CUR 1 28 #endif 29 #ifndef SEEK_END 30 # define SEEK_END 2 31 #endif 32 33 #define EOF -1 34 35 #define __PRINTFLIKE(a, b) 36 37 extern int printf(char const *format, ...) __PRINTFLIKE(1,2); 38 extern int fprintf(FILE *stream, char const *format, ...) __PRINTFLIKE(2,3); 39 extern int sprintf(char *str, char const *format, ...) __PRINTFLIKE(2,3); 40 extern int snprintf(char *str, size_t size, char const *format, ...) __PRINTFLIKE(3,4); 41 extern int asprintf(char **ret, char const *format, ...) __PRINTFLIKE(2,3); 42 extern int vprintf(char const *format, va_list ap); 43 extern int vfprintf(FILE *stream, char const *format, va_list ap); 44 extern int vsprintf(char *str, char const *format, va_list ap); 45 extern int vsnprintf(char *str, size_t size, char const *format, va_list ap); 46 extern int vasprintf(char **ret, char const *format, va_list ap); 47 48 // ToDo: not everything is or should be implemented here 49 extern int fgetc(FILE *); 50 extern char *fgets(char *, int, FILE *); 51 extern int fputc(int, FILE *); 52 extern int fputs(const char *, FILE*); 53 extern int getc(FILE *); 54 extern char *gets(char *); 55 extern int getw(FILE *); 56 extern int getchar(void); 57 extern int putc(int, FILE *); 58 extern int putchar(int); 59 extern int puts(const char *); 60 extern int putw(int, FILE *); 61 62 #ifdef __cplusplus 63 } 64 #endif 65 66 #endif /* _STDIO_H_ */ 67