]> git.sur5r.net Git - cc65/blob - include/stdio.h
Removed (pretty inconsistently used) tab chars from source code base.
[cc65] / include / stdio.h
1 /*****************************************************************************/
2 /*                                                                           */
3 /*                                  stdio.h                                  */
4 /*                                                                           */
5 /*                               Input/output                                */
6 /*                                                                           */
7 /*                                                                           */
8 /*                                                                           */
9 /* (C) 1998-2011, Ullrich von Bassewitz                                      */
10 /*                Roemerstrasse 52                                           */
11 /*                D-70794 Filderstadt                                        */
12 /* EMail:         uz@cc65.org                                                */
13 /*                                                                           */
14 /*                                                                           */
15 /* This software is provided 'as-is', without any expressed or implied       */
16 /* warranty.  In no event will the authors be held liable for any damages    */
17 /* arising from the use of this software.                                    */
18 /*                                                                           */
19 /* Permission is granted to anyone to use this software for any purpose,     */
20 /* including commercial applications, and to alter it and redistribute it    */
21 /* freely, subject to the following restrictions:                            */
22 /*                                                                           */
23 /* 1. The origin of this software must not be misrepresented; you must not   */
24 /*    claim that you wrote the original software. If you use this software   */
25 /*    in a product, an acknowledgment in the product documentation would be  */
26 /*    appreciated but is not required.                                       */
27 /* 2. Altered source versions must be plainly marked as such, and must not   */
28 /*    be misrepresented as being the original software.                      */
29 /* 3. This notice may not be removed or altered from any source              */
30 /*    distribution.                                                          */
31 /*                                                                           */
32 /*****************************************************************************/
33
34
35
36 #ifndef _STDIO_H
37 #define _STDIO_H
38
39
40
41 #ifndef _STDDEF_H
42 #  include <stddef.h>
43 #endif
44 #ifndef _STDARG_H
45 #  include <stdarg.h>
46 #endif
47
48
49
50 /* Types */
51 typedef struct _FILE FILE;
52 typedef unsigned long fpos_t;
53
54 /* Standard file descriptors */
55 extern FILE* stdin;
56 extern FILE* stdout;
57 extern FILE* stderr;
58
59 /* Standard defines */
60 #define _IOFBF          0
61 #define _IOLBF          1
62 #define _IONBF          2
63 #define BUFSIZ          256
64 #define EOF             -1
65 #define FOPEN_MAX       8
66 #define SEEK_CUR        0
67 #define SEEK_END        1
68 #define SEEK_SET        2
69 #define TMP_MAX         256
70
71 /* Standard defines that are platform dependent */
72 #if defined(__APPLE2__) || defined(__APPLE2ENH__)
73 #  define FILENAME_MAX  (64+1)
74 #elif defined(__ATARI__)
75 #  define FILENAME_MAX  (12+1)
76 #elif defined(__LUNIX__)
77 #  define FILENAME_MAX  (80+1)
78 #else
79 #  define FILENAME_MAX  (16+1)
80 #endif
81 #define L_tmpnam        FILENAME_MAX
82
83
84
85 /*****************************************************************************/
86 /*                                   Code                                    */
87 /*****************************************************************************/
88
89
90
91 /* Functions */
92 void __fastcall__ clearerr (FILE* f);
93 int __fastcall__ fclose (FILE* f);
94 int __fastcall__ feof (FILE* f);
95 int __fastcall__ ferror (FILE* f);
96 int __fastcall__ fflush (FILE* f);
97 int __fastcall__ fgetc (FILE* f);
98 char* __fastcall__ fgets (char* buf, size_t size, FILE* f);
99 FILE* __fastcall__ fopen (const char* name, const char* mode);
100 int fprintf (FILE* f, const char* format, ...);
101 int __fastcall__ fputc (int c, FILE* f);
102 int __fastcall__ fputs (const char* s, FILE* f);
103 size_t __fastcall__ fread (void* buf, size_t size, size_t count, FILE* f);
104 FILE* __fastcall__ freopen (const char* name, const char* mode, FILE* f);
105 size_t __fastcall__ fwrite (const void* buf, size_t size, size_t count, FILE* f);
106 int __fastcall__ fgetpos (FILE* f, fpos_t *pos);
107 int __fastcall__ fsetpos (FILE* f, const fpos_t* pos);
108 long __fastcall__ ftell (FILE* f);
109 int __fastcall__ fseek (FILE* f, long offset, int whence);
110 void __fastcall__ rewind (FILE *f);
111 int getchar (void);
112 char* __fastcall__ gets (char* s);
113 void __fastcall__ perror (const char* s);
114 int printf (const char* format, ...);
115 int __fastcall__ putchar (int c);
116 int __fastcall__ puts (const char* s);
117 int __fastcall__ remove (const char* name);
118 int __fastcall__ rename (const char* oldname, const char* newname);
119 int snprintf (char* buf, size_t size, const char* format, ...);
120 int sprintf (char* buf, const char* format, ...);
121 int __fastcall__ ungetc (int c, FILE* f);
122 int __fastcall__ vfprintf (FILE* f, const char* format, va_list ap);
123 int __fastcall__ vprintf (const char* format, va_list ap);
124 int __fastcall__ vsnprintf (char* buf, size_t size, const char* format, va_list ap);
125 int __fastcall__ vsprintf (char* buf, const char* format, va_list ap);
126
127 int scanf (const char* format, ...);
128 int fscanf (FILE* f, const char* format, ...);
129 int sscanf (const char* s, const char* format, ...);
130 int __fastcall__ vscanf (const char* format, va_list ap);
131 int __fastcall__ vsscanf (const char* s, const char* format, va_list ap);
132 int __fastcall__ vfscanf (FILE* f, const char* format, va_list ap);
133
134 #if __CC65_STD__ == __CC65_STD_CC65__
135 FILE* __fastcall__ fdopen (int fd, const char* mode);   /* Unix */
136 int __fastcall__ fileno (FILE* f);                      /* Unix */
137 #endif
138 void __fastcall__ _poserror (const char* msg);          /* cc65 */
139
140 /* Masking macros for some functions */
141 #define getc(f)         fgetc (f)               /* ANSI */
142 #define putc(c, f)      fputc (c, f)            /* ANSI */
143
144
145
146 /* End of stdio.h */
147 #endif
148
149
150