X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=include%2Fstdio.h;h=73dc05bdb602a4e1b6a9eccf330e9b63a74527a7;hb=fc61bc79c53923d3bcc8ac325f9688af6a9c2f64;hp=08842e33f24b255672882f981741ea605d624a7c;hpb=aaf47e40df03711ae8cfccb1a89e0fd9ce20ea04;p=cc65 diff --git a/include/stdio.h b/include/stdio.h index 08842e33f..73dc05bdb 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -1,15 +1,15 @@ /*****************************************************************************/ /* */ -/* stdio.h */ +/* stdio.h */ /* */ -/* Input/output */ +/* Input/output */ /* */ /* */ /* */ -/* (C) 1998-2004 Ullrich von Bassewitz */ -/* Römerstraße 52 */ -/* D-70794 Filderstadt */ -/* EMail: uz@cc65.org */ +/* (C) 1998-2011, Ullrich von Bassewitz */ +/* Roemerstrasse 52 */ +/* D-70794 Filderstadt */ +/* EMail: uz@cc65.org */ /* */ /* */ /* This software is provided 'as-is', without any expressed or implied */ @@ -38,12 +38,8 @@ -#ifndef _STDDEF_H -# include -#endif -#ifndef _STDARG_H -# include -#endif +#include +#include @@ -57,31 +53,35 @@ extern FILE* stdout; extern FILE* stderr; /* Standard defines */ -#define _IOFBF 0 -#define _IOLBF 1 -#define _IONBF 2 -#define BUFSIZ 256 -#define EOF -1 -#define FOPEN_MAX 8 -#define SEEK_CUR 0 -#define SEEK_END 1 -#define SEEK_SET 2 -#define TMP_MAX 256 +#define _IOFBF 0 +#define _IOLBF 1 +#define _IONBF 2 +#define BUFSIZ 256 +#define EOF -1 +#define FOPEN_MAX 8 +#define SEEK_CUR 0 +#define SEEK_END 1 +#define SEEK_SET 2 +#define TMP_MAX 256 /* Standard defines that are platform dependent */ -#if defined(__ATARI__) -# define FILENAME_MAX 12 +#if defined(__APPLE2__) +# define FILENAME_MAX (64+1) +#elif defined(__ATARI__) +# define FILENAME_MAX (12+1) #elif defined(__LUNIX__) -# define FILENAME_MAX 80 +# define FILENAME_MAX (80+1) +#elif defined(__TELESTRAT__) +# define FILENAME_MAX (50+1) #else -# define FILENAME_MAX 16 +# define FILENAME_MAX (16+1) #endif -#define L_tmpnam (FILENAME_MAX + 1) +#define L_tmpnam FILENAME_MAX /*****************************************************************************/ -/* Code */ +/* Code */ /*****************************************************************************/ @@ -106,7 +106,7 @@ int __fastcall__ fsetpos (FILE* f, const fpos_t* pos); long __fastcall__ ftell (FILE* f); int __fastcall__ fseek (FILE* f, long offset, int whence); void __fastcall__ rewind (FILE *f); -int __fastcall__ getchar (void); +int getchar (void); char* __fastcall__ gets (char* s); void __fastcall__ perror (const char* s); int printf (const char* format, ...); @@ -114,13 +114,14 @@ int __fastcall__ putchar (int c); int __fastcall__ puts (const char* s); int __fastcall__ remove (const char* name); int __fastcall__ rename (const char* oldname, const char* newname); +int snprintf (char* buf, size_t size, const char* format, ...); int sprintf (char* buf, const char* format, ...); int __fastcall__ ungetc (int c, FILE* f); int __fastcall__ vfprintf (FILE* f, const char* format, va_list ap); int __fastcall__ vprintf (const char* format, va_list ap); +int __fastcall__ vsnprintf (char* buf, size_t size, const char* format, va_list ap); int __fastcall__ vsprintf (char* buf, const char* format, va_list ap); -/* Not available or testing: */ int scanf (const char* format, ...); int fscanf (FILE* f, const char* format, ...); int sscanf (const char* s, const char* format, ...); @@ -129,24 +130,16 @@ int __fastcall__ vsscanf (const char* s, const char* format, va_list ap); int __fastcall__ vfscanf (FILE* f, const char* format, va_list ap); #if __CC65_STD__ == __CC65_STD_CC65__ -FILE* __fastcall__ fdopen (int fd, const char* mode); /* Unix */ -int __fastcall__ fileno (FILE* f); /* Unix */ +FILE* __fastcall__ fdopen (int fd, const char* mode); /* Unix */ +int __fastcall__ fileno (FILE* f); /* Unix */ #endif -void __fastcall__ _poserror (const char* msg); /* cc65 */ +void __fastcall__ _poserror (const char* msg); /* cc65 */ /* Masking macros for some functions */ -#define getc(f) fgetc (f) /* ANSI */ -#define putc(c, f) fputc (c, f) /* ANSI */ - -/* Non-standard function like macros */ -#if __CC65_STD__ == __CC65_STD_CC65__ -#define flushall() /* Unix */ -#endif +#define getc(f) fgetc (f) /* ANSI */ +#define putc(c, f) fputc (c, f) /* ANSI */ /* End of stdio.h */ #endif - - -