1 /* Copyright (C) 2001-2019 Artifex Software, Inc.
2    All Rights Reserved.
3 
4    This software is provided AS-IS with no warranty, either express or
5    implied.
6 
7    This software is distributed under license and may not be copied,
8    modified or distributed except as expressly authorized under the terms
9    of the license contained in the file LICENSE in this distribution.
10 
11    Refer to licensing information at http://www.artifex.com or contact
12    Artifex Software, Inc.,  1305 Grant Avenue - Suite 200, Novato,
13    CA 94945, U.S.A., +1(415)492-9861, for further information.
14 */
15 
16 
17 /* stdio redirection */
18 
19 #ifndef gsio_INCLUDED
20 #  define gsio_INCLUDED
21 
22 /*
23  * The library and interpreter must never use stdin/out/err directly.
24  * Make references to them illegal.
25  */
26 #undef stdin
27 #define stdin stdin_not_available
28 #undef stdout
29 #define stdout stdout_not_available
30 #undef stderr
31 #define stderr stderr_not_available
32 
33 /*
34  * Redefine all the relevant stdio functions to reference stdin/out/err
35  * explicitly, or to be illegal.
36  */
37 #undef fgetchar
38 #define fgetchar() Function._fgetchar_.unavailable
39 #undef fputchar
40 #define fputchar(c) Function._fputchar_.unavailable
41 #undef getchar
42 #define getchar() Function._getchar_.unavailable
43 #undef gets
44 #define gets Function._gets_.unavailable
45 /* We should do something about perror, but since many Unix systems */
46 /* don't provide the strerror function, we can't.  (No Artifex-maintained */
47 /* code uses perror.) */
48 #undef printf
49 #define printf Function._printf_.unavailable
50 #undef putchar
51 #define putchar(c) Function._putchar_.unavailable
52 #undef puts
53 #define puts(s) Function._putchar_.unavailable
54 #undef scanf
55 #define scanf Function._scanf_.unavailable
56 #undef vprintf
57 #define vprintf Function._vprintf_.unavailable
58 #undef vscanf
59 #define vscanf Function._vscanf_.unavailable
60 
61 #endif /* gsio_INCLUDED */
62