1 /* 2 * Copyright 2002-2006, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _DEF_STORAGE_H 6 #define _DEF_STORAGE_H 7 8 9 #include <fcntl.h> 10 #include <sys/param.h> 11 #include <limits.h> 12 13 14 /* Limits */ 15 #define B_DEV_NAME_LENGTH 128 16 #define B_FILE_NAME_LENGTH NAME_MAX 17 #define B_PATH_NAME_LENGTH MAXPATHLEN 18 #define B_ATTR_NAME_LENGTH (B_FILE_NAME_LENGTH - 1) 19 #define B_MIME_TYPE_LENGTH (B_ATTR_NAME_LENGTH - 15) 20 #define B_MAX_SYMLINKS SYMLOOP_MAX 21 22 /* Open Modes */ 23 #define B_READ_ONLY O_RDONLY /* read only */ 24 #define B_WRITE_ONLY O_WRONLY /* write only */ 25 #define B_READ_WRITE O_RDWR /* read and write */ 26 27 #define B_FAIL_IF_EXISTS O_EXCL /* exclusive create */ 28 #define B_CREATE_FILE O_CREAT /* create the file */ 29 #define B_ERASE_FILE O_TRUNC /* erase the file's data */ 30 #define B_OPEN_AT_END O_APPEND /* point to the end of the data */ 31 32 /* Node Flavors */ 33 enum node_flavor { 34 B_FILE_NODE = 0x01, 35 B_SYMLINK_NODE = 0x02, 36 B_DIRECTORY_NODE = 0x04, 37 B_ANY_NODE = 0x07 38 }; 39 40 41 #endif /* _DEF_STORAGE_H */ 42