tcc_preprocess: add gcc-style include-depth flags
[tinycc/k1w1.git] / win32 / include / fcntl.h
blob32f4a90e8b88d1dea973678b63c123f56b23ef93
1 /*
2 * fcntl.h
4 * Access constants for _open. Note that the permissions constants are
5 * in sys/stat.h (ick).
7 * This code is part of the Mingw32 package.
9 * Contributors:
10 * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
12 * THIS SOFTWARE IS NOT COPYRIGHTED
14 * This source code is offered for use in the public domain. You may
15 * use, modify or distribute it freely.
17 * This code is distributed in the hope that it will be useful but
18 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
19 * DISCLAIMED. This includes but is not limited to warranties of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
22 * $Revision: 1.2 $
23 * $Author: bellard $
24 * $Date: 2005/04/17 13:14:29 $
28 #ifndef __STRICT_ANSI__
30 #ifndef _FCNTL_H_
31 #define _FCNTL_H_
33 /* All the headers include this file. */
34 #include <_mingw.h>
37 * It appears that fcntl.h should include io.h for compatibility...
39 #include <io.h>
41 /* Specifiy one of these flags to define the access mode. */
42 #define _O_RDONLY 0
43 #define _O_WRONLY 1
44 #define _O_RDWR 2
46 /* Mask for access mode bits in the _open flags. */
47 #define _O_ACCMODE (_O_RDONLY|_O_WRONLY|_O_RDWR)
49 #define _O_APPEND 0x0008 /* Writes will add to the end of the file. */
51 #define _O_RANDOM 0x0010
52 #define _O_SEQUENTIAL 0x0020
53 #define _O_TEMPORARY 0x0040 /* Make the file dissappear after closing.
54 * WARNING: Even if not created by _open! */
55 #define _O_NOINHERIT 0x0080
57 #define _O_CREAT 0x0100 /* Create the file if it does not exist. */
58 #define _O_TRUNC 0x0200 /* Truncate the file if it does exist. */
59 #define _O_EXCL 0x0400 /* Open only if the file does not exist. */
61 /* NOTE: Text is the default even if the given _O_TEXT bit is not on. */
62 #define _O_TEXT 0x4000 /* CR-LF in file becomes LF in memory. */
63 #define _O_BINARY 0x8000 /* Input and output is not translated. */
64 #define _O_RAW _O_BINARY
66 #ifndef _NO_OLDNAMES
68 /* POSIX/Non-ANSI names for increased portability */
69 #define O_RDONLY _O_RDONLY
70 #define O_WRONLY _O_WRONLY
71 #define O_RDWR _O_RDWR
72 #define O_ACCMODE _O_ACCMODE
73 #define O_APPEND _O_APPEND
74 #define O_CREAT _O_CREAT
75 #define O_TRUNC _O_TRUNC
76 #define O_EXCL _O_EXCL
77 #define O_TEXT _O_TEXT
78 #define O_BINARY _O_BINARY
79 #define O_TEMPORARY _O_TEMPORARY
80 #define O_NOINHERIT _O_NOINHERIT
81 #define O_SEQENTIAL _O_SEQUENTIAL
82 #define O_RANDOM _O_RANDOM
84 #endif /* Not _NO_OLDNAMES */
87 #ifndef RC_INVOKED
90 * This variable determines the default file mode.
91 * TODO: Which flags work?
93 #ifndef __DECLSPEC_SUPPORTED
95 #ifdef __MSVCRT__
96 extern unsigned int* __imp__fmode;
97 #define _fmode (*__imp__fmode)
98 #else
99 /* CRTDLL */
100 extern unsigned int* __imp__fmode_dll;
101 #define _fmode (*__imp__fmode_dll)
102 #endif
104 #else /* __DECLSPEC_SUPPORTED */
106 #ifdef __MSVCRT__
107 __MINGW_IMPORT unsigned int _fmode;
108 #else /* ! __MSVCRT__ */
109 __MINGW_IMPORT unsigned int _fmode_dll;
110 #define _fmode _fmode_dll
111 #endif /* ! __MSVCRT__ */
113 #endif /* __DECLSPEC_SUPPORTED */
116 #ifdef __cplusplus
117 extern "C" {
118 #endif
120 int _setmode (int, int);
122 #ifndef _NO_OLDNAMES
123 int setmode (int, int);
124 #endif /* Not _NO_OLDNAMES */
126 #ifdef __cplusplus
128 #endif
130 #endif /* Not RC_INVOKED */
132 #endif /* Not _FCNTL_H_ */
134 #endif /* Not __STRICT_ANSI__ */