This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add few missing #undefs and sort them.
[perl5.git] / fakesdio.h
1 /*
2  * This is "source level" stdio compatibility mode.
3  * We try and #define stdio functions in terms of PerlIO.
4  */
5 #define _CANNOT "CANNOT"
6 #undef FILE
7 #define FILE                    PerlIO
8 #undef clearerr
9 #undef fclose
10 #undef fdopen
11 #undef feof
12 #undef ferror
13 #undef fflush
14 #undef fgetc
15 #undef fgetpos
16 #undef fgets
17 #undef fileno
18 #undef fopen
19 #undef fprintf
20 #undef fputc
21 #undef fputs
22 #undef fread
23 #undef freopen
24 #undef fscanf
25 #undef fseek
26 #undef fsetpos
27 #undef ftell
28 #undef fwrite
29 #undef getc
30 #undef getc_unlocked
31 #undef getw
32 #undef pclose
33 #undef popen
34 #undef putc
35 #undef putc_unlocked
36 #undef putw
37 #undef rewind
38 #undef setbuf
39 #undef setvbuf
40 #undef stderr
41 #undef stdin
42 #undef stdout
43 #undef tmpfile
44 #undef ungetc
45 #undef vfprintf
46 #define fprintf                 PerlIO_printf
47 #define stdin                   PerlIO_stdin()
48 #define stdout                  PerlIO_stdout()
49 #define stderr                  PerlIO_stderr()
50 #define tmpfile()               PerlIO_tmpfile()
51 #define fclose(f)               PerlIO_close(f)
52 #define fflush(f)               PerlIO_flush(f)
53 #define fopen(p,m)              PerlIO_open(p,m)
54 #define vfprintf(f,fmt,a)       PerlIO_vprintf(f,fmt,a)
55 #define fgetc(f)                PerlIO_getc(f)
56 #define fputc(c,f)              PerlIO_putc(f,c)
57 #define fputs(s,f)              PerlIO_puts(f,s)
58 #define getc(f)                 PerlIO_getc(f)
59 #define getc_unlocked(f)        PerlIO_getc(f)
60 #define putc(c,f)               PerlIO_putc(f,c)
61 #define putc_unlocked(c,f)      PerlIO_putc(c,f)
62 #define ungetc(c,f)             PerlIO_ungetc(f,c)
63 #if 0
64 /* return values of read/write need work */
65 #define fread(b,s,c,f)          PerlIO_read(f,b,(s*c))
66 #define fwrite(b,s,c,f)         PerlIO_write(f,b,(s*c))
67 #else
68 #define fread(b,s,c,f)          _CANNOT fread
69 #define fwrite(b,s,c,f)         _CANNOT fwrite
70 #endif
71 #define fgetpos(f,p)            PerlIO_getpos(f,p)
72 #define fseek(f,o,w)            PerlIO_seek(f,o,w)
73 #define fsetpos(f,p)            PerlIO_setpos(f,p)
74 #define ftell(f)                PerlIO_tell(f)
75 #define rewind(f)               PerlIO_rewind(f)
76 #define clearerr(f)             PerlIO_clearerr(f)
77 #define feof(f)                 PerlIO_eof(f)
78 #define ferror(f)               PerlIO_error(f)
79 #define fdopen(fd,p)            PerlIO_fdopen(fd,p)
80 #define fileno(f)               PerlIO_fileno(f)
81 #define popen(c,m)              my_popen(c,m)
82 #define pclose(f)               my_pclose(f)
83
84 #define __filbuf(f)             _CANNOT __filbuf_
85 #define _filbuf(f)              _CANNOT _filbuf_
86 #define __flsbuf(c,f)           _CANNOT __flsbuf_
87 #define _flsbuf(c,f)            _CANNOT _flsbuf_
88 #define getw(f)                 _CANNOT _getw_
89 #define putw(v,f)               _CANNOT _putw_
90 #if SFIO_VERSION < 20000101L
91 #define flockfile(f)            _CANNOT _flockfile_
92 #define ftrylockfile(f)         _CANNOT _ftrylockfile_
93 #define funlockfile(f)          _CANNOT _funlockfile_
94 #endif
95 #define freopen(p,m,f)          _CANNOT _freopen_
96 #define setbuf(f,b)             _CANNOT _setbuf_
97 #define setvbuf(f,b,x,s)        _CANNOT _setvbuf_
98 #define fscanf                  _CANNOT _fscanf_
99 #define fgets(s,n,f)            _CANNOT _fgets_
100