xref: /plan9/sys/src/cmd/gs/src/stdio_.h (revision 593dc095aefb2a85c828727bbfa9da139a49bdf4)
1 /* Copyright (C) 1992, 1993, 1994, 1998 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: stdio_.h,v 1.10 2003/12/09 04:04:08 giles Exp $ */
18 /* Generic substitute for stdio.h */
19 
20 #ifndef stdio__INCLUDED
21 #  define stdio__INCLUDED
22 
23 /*
24  * This is here primarily because we must include std.h before
25  * any file that includes sys/types.h.
26  */
27 #include "std.h"
28 #include <stdio.h>
29 
30 #ifdef VMS
31 /* VMS prior to 7.0 doesn't have the unlink system call.  Use delete instead. */
32 #  ifdef __DECC
33 #    include <unixio.h>
34 #  endif
35 #  if ( __VMS_VER < 70000000 )
36 #    define unlink(fname) delete(fname)
37 #  endif
38 #else
39 #if !defined(const)
40 /*
41  * Other systems may or may not declare unlink in stdio.h;
42  * if they do, the declaration will be compatible with this one, as long
43  * as const has not been disabled by defining it to be the empty string.
44  */
45 int unlink(const char *);
46 #endif
47 
48 #endif
49 
50 /*
51  * Plan 9 has a system function called sclose, which interferes with the
52  * procedure defined in stream.h.  The following makes the system sclose
53  * inaccessible, but avoids the name clash.
54  */
55 #ifdef Plan9
56 #  undef sclose
57 #  define sclose(s) Sclose(s)
58 #endif
59 
60 /* Patch a couple of things possibly missing from stdio.h. */
61 #ifndef SEEK_SET
62 #  define SEEK_SET 0
63 #endif
64 #ifndef SEEK_CUR
65 #  define SEEK_CUR 1
66 #endif
67 #ifndef SEEK_END
68 #  define SEEK_END 2
69 #endif
70 
71 #if defined(_MSC_VER)
72 #  define fdopen(handle,mode) _fdopen(handle,mode)
73 #  define fileno(file) _fileno(file)
74 #endif
75 
76 #endif /* stdio__INCLUDED */
77