This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Integrate mainline (in near desperate attempt to get Win32 to build...)
[perl5.git] / nostdio.h
1 /*
2  * Strong denial of stdio - make all stdio calls (we can think of) errors
3  */
4 /* This is an 1st attempt to stop other include files pulling
5    in real <stdio.h>.
6    A more ambitious set of possible symbols can be found in
7    sfio.h (inside an _cplusplus gard).
8    It is completely pointless as we have already included it ourselves.
9 */
10
11 #if !defined(_STDIO_H) && !defined(FILE) && !defined(_STDIO_INCLUDED) && !defined(__STDIO_LOADED)
12 #define _STDIO_H
13 #define _STDIO_INCLUDED
14 #define __STDIO_LOADED
15 struct _FILE;
16 #define FILE struct _FILE
17 #endif
18
19 #define _CANNOT "CANNOT"
20
21 #undef clearerr
22 #undef fclose
23 #undef fdopen
24 #undef feof
25 #undef ferror
26 #undef fflush
27 #undef fgetc
28 #undef fgetpos
29 #undef fgets
30 #undef fileno
31 #undef flockfile
32 #undef fopen
33 #undef fprintf
34 #undef fputc
35 #undef fputs
36 #undef fread
37 #undef freopen
38 #undef fscanf
39 #undef fseek
40 #undef fsetpos
41 #undef ftell
42 #undef ftrylockfile
43 #undef funlockfile
44 #undef fwrite
45 #undef getc
46 #undef getc_unlocked
47 #undef getw
48 #undef pclose
49 #undef popen
50 #undef putc
51 #undef putc_unlocked
52 #undef putw
53 #undef rewind
54 #undef setbuf
55 #undef setvbuf
56 #undef stderr
57 #undef stdin
58 #undef stdout
59 #undef tmpfile
60 #undef ungetc
61 #undef vfprintf
62
63 #define fprintf    _CANNOT _fprintf_
64 #define stdin      _CANNOT _stdin_
65 #define stdout     _CANNOT _stdout_
66 #define stderr     _CANNOT _stderr_
67 #ifndef OS2
68 #define tmpfile()  _CANNOT _tmpfile_
69 #endif
70 #define fclose(f)  _CANNOT _fclose_
71 #define fflush(f)  _CANNOT _fflush_
72 #define fopen(p,m)  _CANNOT _fopen_
73 #define freopen(p,m,f)  _CANNOT _freopen_
74 #define setbuf(f,b)  _CANNOT _setbuf_
75 #define setvbuf(f,b,x,s)  _CANNOT _setvbuf_
76 #define fscanf  _CANNOT _fscanf_
77 #define vfprintf(f,fmt,a)  _CANNOT _vfprintf_
78 #define fgetc(f)  _CANNOT _fgetc_
79 #define fgets(s,n,f)  _CANNOT _fgets_
80 #define fputc(c,f)  _CANNOT _fputc_
81 #define fputs(s,f)  _CANNOT _fputs_
82 #define getc(f)  _CANNOT _getc_
83 #define putc(c,f)  _CANNOT _putc_
84 #ifndef OS2
85 #define ungetc(c,f)  _CANNOT _ungetc_
86 #endif
87 #define fread(b,s,c,f)  _CANNOT _fread_
88 #define fwrite(b,s,c,f)  _CANNOT _fwrite_
89 #define fgetpos(f,p)  _CANNOT _fgetpos_
90 #define fseek(f,o,w)  _CANNOT _fseek_
91 #define fsetpos(f,p)  _CANNOT _fsetpos_
92 #define ftell(f)  _CANNOT _ftell_
93 #define rewind(f)  _CANNOT _rewind_
94 #define clearerr(f)  _CANNOT _clearerr_
95 #define feof(f)  _CANNOT _feof_
96 #define ferror(f)  _CANNOT _ferror_
97 #define __filbuf(f)  _CANNOT __filbuf_
98 #define __flsbuf(c,f)  _CANNOT __flsbuf_
99 #define _filbuf(f)  _CANNOT _filbuf_
100 #define _flsbuf(c,f)  _CANNOT _flsbuf_
101 #define fdopen(fd,p)  _CANNOT _fdopen_
102 #define fileno(f)  _CANNOT _fileno_
103 #if SFIO_VERSION < 20000101L
104 #define flockfile(f)  _CANNOT _flockfile_
105 #define ftrylockfile(f)  _CANNOT _ftrylockfile_
106 #define funlockfile(f)  _CANNOT _funlockfile_
107 #endif
108 #define getc_unlocked(f)  _CANNOT _getc_unlocked_
109 #define putc_unlocked(c,f)  _CANNOT _putc_unlocked_
110 #define popen(c,m)  _CANNOT _popen_
111 #define getw(f)  _CANNOT _getw_
112 #define putw(v,f)  _CANNOT _putw_
113 #ifndef OS2
114 #define pclose(f)  _CANNOT _pclose_
115 #endif