]> git.sur5r.net Git - cc65/blob - include/stdio.h
This commit was generated by cvs2svn to compensate for changes in r2,
[cc65] / include / stdio.h
1 /*
2  * stdio.h
3  *
4  * Ullrich von Bassewitz, 30.05.1998
5  *
6  */
7
8
9
10 #ifndef _STDIO_H
11 #define _STDIO_H
12
13
14
15 #ifndef _STDDEF_H
16 #  include <stddef.h>
17 #endif
18 #ifndef _STDARG_H
19 #  include <stdarg.h>
20 #endif
21
22
23
24 /* Types */
25 typedef struct _FILE FILE;
26 typedef unsigned long fpos_t;
27
28 /* Standard file descriptors */
29 extern FILE* stdin;
30 extern FILE* stdout;
31 extern FILE* stderr;
32
33 /* Standard defines */
34 #define _IOFBF          0
35 #define _IOLBF          1
36 #define _IONBF          2
37 #define BUFSIZ          256
38 #define EOF             -1
39 #define FILENAME_MAX    16
40 #define FOPEN_MAX       8
41 #define L_tmpnam        (FILENAME_MAX + 1)
42 #define SEEK_CUR        0
43 #define SEEK_END        1
44 #define SEEK_SET        2
45 #define TMP_MAX         256
46
47
48
49 /* Functions */
50 void __fastcall__ clearerr (FILE* f);
51 int fclose (FILE* f);
52 int __fastcall__ feof (FILE* f);
53 int __fastcall__ ferror (FILE* f);
54 int __fastcall__ fflush (FILE* f);
55 int fgetc (FILE* f);
56 char* fgets (char* buf, size_t size, FILE* f);
57 FILE* fopen (const char* name, const char* mode);
58 int fprintf (FILE* f, const char* format, ...);
59 int fputc (int c, FILE* f);
60 int fputs (const char* s, FILE* f);
61 size_t fread (void* buf, size_t size, size_t count, FILE* f);
62 FILE* freopen (const char* name, const char* mode, FILE* f);
63 size_t fwrite (const void* buf, size_t size, size_t count, FILE* f);
64 int getchar (void);
65 char* gets (char* s);
66 void perror (const char* s);
67 int printf (const char* format, ...);
68 int putchar (int c);
69 int puts (const char* s);
70 int remove (const char* name);
71 int rename (const char* old, const char* new);
72 int sprintf (char* buf, const char* format, ...);
73 int vfprintf (FILE* f, const char* format, va_list ap);
74 int vprintf (const char* format, va_list ap);
75 int vsprintf (char* buf, const char* format, va_list ap);
76
77 #ifndef __STRICT_ANSI__
78 FILE* fdopen (int fd, const char* mode);        /* Unix */
79 int __fastcall__ fileno (FILE* f);              /* Unix */
80 #endif
81
82
83 /* Masking macros for some functions */
84 #define getchar()       fgetc (stdin)           /* ANSI */
85 #define putchar(c)      fputc (c, stdout)       /* ANSI */
86 #define getc(f)         fgetc (f)               /* ANSI */
87 #define putc(c, f)      fputc (c, f)            /* ANSI */
88
89 /* Non-standard function like macros */
90 #ifndef __STRICT_ANSI__
91 #define flushall()                              /* Unix */
92 #define unlink(name)    remove (name)           /* Unix */
93 #endif
94
95
96
97 /* End of stdio.h */
98 #endif
99
100
101