ext4: special inode creation support
[lwext4.git] / include / ext4_oflags.h
1 /*
2  * Copyright (c) 2015 Grzegorz Kostka (kostka.grzegorz@gmail.com)
3  * Copyright (c) 2015 Kaho Ng (ngkaho1234@gmail.com)
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  *
10  * - Redistributions of source code must retain the above copyright
11  *   notice, this list of conditions and the following disclaimer.
12  * - Redistributions in binary form must reproduce the above copyright
13  *   notice, this list of conditions and the following disclaimer in the
14  *   documentation and/or other materials provided with the distribution.
15  * - The name of the author may not be used to endorse or promote products
16  *   derived from this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28  */
29
30 /** @addtogroup lwext4
31  * @{
32  */
33 /**
34  * @file  ext4_oflags.h
35  * @brief File opening & seeking flags.
36  */
37 #ifndef EXT4_OFLAGS_H_
38 #define EXT4_OFLAGS_H_
39
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43
44 /********************************FILE OPEN FLAGS*****************************/
45
46 #if CONFIG_HAVE_OWN_OFLAGS
47
48  #ifndef O_RDONLY
49  #define O_RDONLY 00
50  #endif
51
52  #ifndef O_WRONLY
53  #define O_WRONLY 01
54  #endif
55
56  #ifndef O_RDWR
57  #define O_RDWR 02
58  #endif
59
60  #ifndef O_CREAT
61  #define O_CREAT 0100
62  #endif
63
64  #ifndef O_EXCL
65  #define O_EXCL 0200
66  #endif
67
68  #ifndef O_TRUNC
69  #define O_TRUNC 01000
70  #endif
71
72  #ifndef O_APPEND
73  #define O_APPEND 02000
74  #endif
75
76 /********************************FILE SEEK FLAGS*****************************/
77
78  #ifndef SEEK_SET
79  #define SEEK_SET 0
80  #endif
81
82  #ifndef SEEK_CUR
83  #define SEEK_CUR 1
84  #endif
85
86  #ifndef SEEK_END
87  #define SEEK_END 2
88  #endif
89
90 #else
91  #include <unistd.h>
92  #include <fcntl.h>
93 #endif
94
95 #ifdef __cplusplus
96 }
97 #endif
98
99 #endif /* EXT4_OFLAGS_H_ */
100
101 /**
102  * @}
103  */