xref: /haiku/headers/build/os/storage/StorageDefs.h (revision 1d9d47fc72028bb71b5f232a877231e59cfe2438)
1 //----------------------------------------------------------------------
2 //  This software is part of the OpenBeOS distribution and is covered
3 //  by the OpenBeOS license.
4 //---------------------------------------------------------------------
5 /*!
6 	\file StorageDefs.h
7 	Miscellaneous Storage Kit definitions and includes.
8 */
9 
10 #ifndef _DEF_STORAGE_H
11 #define _DEF_STORAGE_H
12 
13 #include <fcntl.h>
14 #include <sys/param.h>
15 #include <limits.h>
16 
17 #ifdef USE_OPENBEOS_NAMESPACE
18 namespace OpenBeOS {
19 #endif // USE_OPENBEOS_NAMESPACE
20 
21 // Limits
22 #define B_DEV_NAME_LENGTH		128
23 #define B_FILE_NAME_LENGTH		NAME_MAX
24 #define B_PATH_NAME_LENGTH 		MAXPATHLEN
25 #define B_ATTR_NAME_LENGTH		(B_FILE_NAME_LENGTH-1)
26 #define B_MIME_TYPE_LENGTH		(B_ATTR_NAME_LENGTH - 15)
27 #define B_MAX_SYMLINKS			SYMLINK_MAX
28 
29 
30 // Open Modes
31 #define B_READ_ONLY 	O_RDONLY	// read only
32 #define B_WRITE_ONLY 	O_WRONLY 	// write only
33 #define B_READ_WRITE	O_RDWR   	// read and write
34 
35 #define	B_FAIL_IF_EXISTS	O_EXCL		// exclusive create
36 #define B_CREATE_FILE		O_CREAT		// create the file
37 #define B_ERASE_FILE		O_TRUNC		// erase the file's data
38 #define B_OPEN_AT_END	   	O_APPEND	// point to the end of the data
39 
40 
41 // Node Flavors
42 enum node_flavor {
43   B_FILE_NODE		= 0x01,
44   B_SYMLINK_NODE	= 0x02,
45   B_DIRECTORY_NODE	= 0x04,
46   B_ANY_NODE		= 0x07
47 };
48 
49 
50 
51 #ifdef USE_OPENBEOS_NAMESPACE
52 };		// namespace OpenBeOS
53 #endif	// USE_OPENBEOS_NAMESPACE
54 
55 
56 #endif // _DEF_STORAGE_H
57 
58 
59