xref: /plan9/sys/src/cmd/gs/src/gsio.h (revision 593dc095aefb2a85c828727bbfa9da139a49bdf4)
1 /* Copyright (C) 1989, 1990, 1993, 1996, 1999, 2000 Aladdin Enterprises.  All rights reserved.
2 
3   This software is provided AS-IS with no warranty, either express or
4   implied.
5 
6   This software is distributed under license and may not be copied,
7   modified or distributed except as expressly authorized under the terms
8   of the license contained in the file LICENSE in this distribution.
9 
10   For more information about licensing, please refer to
11   http://www.ghostscript.com/licensing/. For information on
12   commercial licensing, go to http://www.artifex.com/licensing/ or
13   contact Artifex Software, Inc., 101 Lucas Valley Road #110,
14   San Rafael, CA  94903, U.S.A., +1(415)492-9861.
15 */
16 
17 /* $Id: gsio.h,v 1.8 2004/08/04 19:36:12 stefan Exp $ */
18 /* stdio redirection */
19 
20 #ifndef gsio_INCLUDED
21 #  define gsio_INCLUDED
22 
23 /*
24  * The library and interpreter must never use stdin/out/err directly.
25  * Make references to them illegal.
26  */
27 #undef stdin
28 #define stdin stdin_not_available
29 #undef stdout
30 #define stdout stdout_not_available
31 #undef stderr
32 #define stderr stderr_not_available
33 
34 /*
35  * Redefine all the relevant stdio functions to reference stdin/out/err
36  * explicitly, or to be illegal.
37  */
38 #undef fgetchar
39 #define fgetchar() Function._fgetchar_.unavailable
40 #undef fputchar
41 #define fputchar(c) Function._fputchar_.unavailable
42 #undef getchar
43 #define getchar() Function._getchar_.unavailable
44 #undef gets
45 #define gets Function._gets_.unavailable
46 /* We should do something about perror, but since many Unix systems */
47 /* don't provide the strerror function, we can't.  (No Aladdin-maintained */
48 /* code uses perror.) */
49 #undef printf
50 #define printf Function._printf_.unavailable
51 #undef putchar
52 #define putchar(c) Function._putchar_.unavailable
53 #undef puts
54 #define puts(s) Function._putchar_.unavailable
55 #undef scanf
56 #define scanf Function._scanf_.unavailable
57 #undef vprintf
58 #define vprintf Function._vprintf_.unavailable
59 #undef vscanf
60 #define vscanf Function._vscanf_.unavailable
61 
62 #endif /* gsio_INCLUDED */
63