Commit | Line | Data |
---|---|---|
eb1102fc NIS |
1 | /* nostdio.h |
2 | * | |
cfc85103 | 3 | * Copyright (C) 1996, 2000, 2001, 2005, by Larry Wall and others |
eb1102fc NIS |
4 | * |
5 | * You may distribute under the terms of either the GNU General Public | |
6 | * License or the Artistic License, as specified in the README file. | |
7 | * | |
8 | */ | |
9 | ||
76ced9ad NIS |
10 | /* |
11 | * Strong denial of stdio - make all stdio calls (we can think of) errors | |
12 | */ | |
d1be9408 | 13 | /* This is a 1st attempt to stop other include files pulling |
760ac839 LW |
14 | in real <stdio.h>. |
15 | A more ambitious set of possible symbols can be found in | |
16 | sfio.h (inside an _cplusplus gard). | |
76ced9ad | 17 | It is completely pointless as we have already included it ourselves. |
760ac839 | 18 | */ |
2b8f4455 | 19 | |
d8d253f0 | 20 | #if !defined(_STDIO_H) && !defined(FILE) && !defined(_STDIO_INCLUDED) && !defined(__STDIO_LOADED) |
760ac839 LW |
21 | #define _STDIO_H |
22 | #define _STDIO_INCLUDED | |
d8d253f0 | 23 | #define __STDIO_LOADED |
760ac839 LW |
24 | struct _FILE; |
25 | #define FILE struct _FILE | |
26 | #endif | |
27 | ||
28 | #define _CANNOT "CANNOT" | |
29 | ||
760ac839 | 30 | #undef clearerr |
2b8f4455 JH |
31 | #undef fclose |
32 | #undef fdopen | |
760ac839 LW |
33 | #undef feof |
34 | #undef ferror | |
2b8f4455 JH |
35 | #undef fflush |
36 | #undef fgetc | |
37 | #undef fgetpos | |
38 | #undef fgets | |
760ac839 | 39 | #undef fileno |
400e04b6 | 40 | #undef flockfile |
76ced9ad | 41 | #undef fopen |
2b8f4455 | 42 | #undef fprintf |
76ced9ad NIS |
43 | #undef fputc |
44 | #undef fputs | |
76ced9ad | 45 | #undef fread |
2b8f4455 JH |
46 | #undef freopen |
47 | #undef fscanf | |
76ced9ad NIS |
48 | #undef fseek |
49 | #undef fsetpos | |
50 | #undef ftell | |
400e04b6 JH |
51 | #undef ftrylockfile |
52 | #undef funlockfile | |
2b8f4455 JH |
53 | #undef fwrite |
54 | #undef getc | |
55 | #undef getc_unlocked | |
76ced9ad | 56 | #undef getw |
2b8f4455 JH |
57 | #undef pclose |
58 | #undef popen | |
59 | #undef putc | |
60 | #undef putc_unlocked | |
76ced9ad | 61 | #undef putw |
2b8f4455 | 62 | #undef rewind |
76ced9ad NIS |
63 | #undef setbuf |
64 | #undef setvbuf | |
2b8f4455 JH |
65 | #undef stderr |
66 | #undef stdin | |
67 | #undef stdout | |
68 | #undef tmpfile | |
69 | #undef ungetc | |
70 | #undef vfprintf | |
f2b1176c | 71 | #undef printf |
2b8f4455 | 72 | |
76ced9ad | 73 | #define fprintf _CANNOT _fprintf_ |
f2b1176c | 74 | #define printf _CANNOT _printf_ |
76ced9ad NIS |
75 | #define stdin _CANNOT _stdin_ |
76 | #define stdout _CANNOT _stdout_ | |
77 | #define stderr _CANNOT _stderr_ | |
2b8f4455 | 78 | #ifndef OS2 |
76ced9ad | 79 | #define tmpfile() _CANNOT _tmpfile_ |
2b8f4455 | 80 | #endif |
76ced9ad NIS |
81 | #define fclose(f) _CANNOT _fclose_ |
82 | #define fflush(f) _CANNOT _fflush_ | |
83 | #define fopen(p,m) _CANNOT _fopen_ | |
84 | #define freopen(p,m,f) _CANNOT _freopen_ | |
85 | #define setbuf(f,b) _CANNOT _setbuf_ | |
86 | #define setvbuf(f,b,x,s) _CANNOT _setvbuf_ | |
87 | #define fscanf _CANNOT _fscanf_ | |
88 | #define vfprintf(f,fmt,a) _CANNOT _vfprintf_ | |
89 | #define fgetc(f) _CANNOT _fgetc_ | |
90 | #define fgets(s,n,f) _CANNOT _fgets_ | |
91 | #define fputc(c,f) _CANNOT _fputc_ | |
92 | #define fputs(s,f) _CANNOT _fputs_ | |
93 | #define getc(f) _CANNOT _getc_ | |
94 | #define putc(c,f) _CANNOT _putc_ | |
2b8f4455 | 95 | #ifndef OS2 |
76ced9ad | 96 | #define ungetc(c,f) _CANNOT _ungetc_ |
2b8f4455 | 97 | #endif |
76ced9ad NIS |
98 | #define fread(b,s,c,f) _CANNOT _fread_ |
99 | #define fwrite(b,s,c,f) _CANNOT _fwrite_ | |
100 | #define fgetpos(f,p) _CANNOT _fgetpos_ | |
101 | #define fseek(f,o,w) _CANNOT _fseek_ | |
102 | #define fsetpos(f,p) _CANNOT _fsetpos_ | |
103 | #define ftell(f) _CANNOT _ftell_ | |
104 | #define rewind(f) _CANNOT _rewind_ | |
105 | #define clearerr(f) _CANNOT _clearerr_ | |
106 | #define feof(f) _CANNOT _feof_ | |
107 | #define ferror(f) _CANNOT _ferror_ | |
108 | #define __filbuf(f) _CANNOT __filbuf_ | |
109 | #define __flsbuf(c,f) _CANNOT __flsbuf_ | |
110 | #define _filbuf(f) _CANNOT _filbuf_ | |
111 | #define _flsbuf(c,f) _CANNOT _flsbuf_ | |
112 | #define fdopen(fd,p) _CANNOT _fdopen_ | |
113 | #define fileno(f) _CANNOT _fileno_ | |
cf2782cd | 114 | #if defined(SFIO_VERSION) && SFIO_VERSION < 20000101L |
76ced9ad NIS |
115 | #define flockfile(f) _CANNOT _flockfile_ |
116 | #define ftrylockfile(f) _CANNOT _ftrylockfile_ | |
117 | #define funlockfile(f) _CANNOT _funlockfile_ | |
118 | #endif | |
119 | #define getc_unlocked(f) _CANNOT _getc_unlocked_ | |
120 | #define putc_unlocked(c,f) _CANNOT _putc_unlocked_ | |
121 | #define popen(c,m) _CANNOT _popen_ | |
122 | #define getw(f) _CANNOT _getw_ | |
123 | #define putw(v,f) _CANNOT _putw_ | |
2b8f4455 | 124 | #ifndef OS2 |
76ced9ad | 125 | #define pclose(f) _CANNOT _pclose_ |
2b8f4455 | 126 | #endif |
e9a8c099 MHM |
127 | |
128 | /* | |
129 | * Local variables: | |
130 | * c-indentation-style: bsd | |
131 | * c-basic-offset: 4 | |
14d04a33 | 132 | * indent-tabs-mode: nil |
e9a8c099 MHM |
133 | * End: |
134 | * | |
14d04a33 | 135 | * ex: set ts=8 sts=4 sw=4 et: |
e9a8c099 | 136 | */ |