2 * Copyright 2007-2009, Ingo Weinhold, bonefish@cs.tu-berlin.de.
3 * Distributed under the terms of the MIT License.
9 #include "fssh_types.h"
13 #ifdef HAIKU_HOST_PLATFORM_64_BIT
14 # define FSSH_B_HAIKU_64_BIT 1
16 # define FSSH_B_HAIKU_32_BIT 1
20 #define FSSH_B_DEV_NAME_LENGTH 128
21 #define FSSH_B_FILE_NAME_LENGTH 256
22 #define FSSH_B_PATH_NAME_LENGTH 1024
23 #define FSSH_B_ATTR_NAME_LENGTH (FSSH_B_FILE_NAME_LENGTH-1)
24 #define FSSH_B_MIME_TYPE_LENGTH (FSSH_B_ATTR_NAME_LENGTH - 15)
25 #define FSSH_B_MAX_SYMLINKS 16
28 #define FSSH_B_READ_ONLY FSSH_O_RDONLY // read only
29 #define FSSH_B_WRITE_ONLY FSSH_O_WRONLY // write only
30 #define FSSH_B_READ_WRITE FSSH_O_RDWR // read and write
32 #define FSSH_B_FAIL_IF_EXISTS FSSH_O_EXCL // exclusive create
33 #define FSSH_B_CREATE_FILE FSSH_O_CREAT // create the file
34 #define FSSH_B_ERASE_FILE FSSH_O_TRUNC // erase the file's data
35 #define FSSH_B_OPEN_AT_END FSSH_O_APPEND // point to the end of the data
38 enum fssh_node_flavor
{
39 FSSH_B_FILE_NODE
= 0x01,
40 FSSH_B_SYMLINK_NODE
= 0x02,
41 FSSH_B_DIRECTORY_NODE
= 0x04,
42 FSSH_B_ANY_NODE
= 0x07
46 #if defined(__GNUC__) && __GNUC__ > 3
47 #define fssh_offsetof(type,member) __builtin_offsetof(type, member)
49 #define fssh_offsetof(type,member) ((size_t)&((type*)0)->member)
52 #define fssh_min_c(a,b) ((a)>(b)?(b):(a))
53 #define fssh_max_c(a,b) ((a)>(b)?(a):(b))
55 #define _FSSH_PACKED __attribute__((packed))
58 #endif // _FSSH_DEFS_H