xref: /haiku/headers/build/os/kernel/fs_attr.h (revision 699b4bbab949b0f38f396cfadb5d34f9c4425bfe)
1 /*
2  * Copyright 2002-2009, Haiku Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _FS_ATTR_H
6 #define	_FS_ATTR_H
7 
8 
9 #include <OS.h>
10 #include <dirent.h>
11 
12 
13 typedef struct attr_info {
14 	uint32	type;
15 	off_t	size;
16 } attr_info;
17 
18 
19 #ifdef  __cplusplus
20 extern "C" {
21 #endif
22 
23 
24 /* Since libroot_build is also used on Haiku and linked against the real
25  * libroot which also has the fs*attr functions, these must be shadowed. */
26 #define fs_read_attr		build_fs_read_attr
27 #define fs_write_attr		build_fs_write_attr
28 #define fs_remove_attr		build_fs_remove_attr
29 #define fs_stat_attr		build_fs_stat_attr
30 #define fs_open_attr		build_fs_open_attr
31 #define fs_fopen_attr		build_fs_fopen_attr
32 #define fs_close_attr		build_fs_close_attr
33 #define fs_open_attr_dir	build_fs_open_attr_dir
34 #define fs_fopen_attr_dir	build_fs_fopen_attr_dir
35 #define fs_close_attr_dir	build_fs_close_attr_dir
36 #define fs_read_attr_dir	build_fs_read_attr_dir
37 #define fs_rewind_attr_dir	build_fs_rewind_attr_dir
38 
39 
40 extern ssize_t	fs_read_attr(int fd, const char *attribute, uint32 type,
41 					off_t pos, void *buffer, size_t readBytes);
42 extern ssize_t	fs_write_attr(int fd, const char *attribute, uint32 type,
43 					off_t pos, const void *buffer, size_t readBytes);
44 extern int		fs_remove_attr(int fd, const char *attribute);
45 extern int		fs_stat_attr(int fd, const char *attribute,
46 					struct attr_info *attrInfo);
47 
48 extern int		fs_open_attr(const char *path, const char *attribute,
49 					uint32 type, int openMode);
50 extern int		fs_fopen_attr(int fd, const char *attribute, uint32 type,
51 					int openMode);
52 extern int		fs_close_attr(int fd);
53 
54 extern DIR		*fs_open_attr_dir(const char *path);
55 extern DIR		*fs_fopen_attr_dir(int fd);
56 extern int		fs_close_attr_dir(DIR *dir);
57 extern struct dirent *fs_read_attr_dir(DIR *dir);
58 extern void		fs_rewind_attr_dir(DIR *dir);
59 
60 #ifdef  __cplusplus
61 }
62 #endif
63 
64 #endif	/* _FS_ATTR_H */
65