xref: /haiku/headers/private/fs_shell/fssh_fs_attr.h (revision 1a76488fc88584bf66b9751d7fb9b6527ac20d87)
1 /* File System attributes
2 **
3 ** Distributed under the terms of the MIT License.
4 */
5 #ifndef _FSSH_FS_ATTR_H
6 #define	_FSSH_FS_ATTR_H
7 
8 
9 #include "fssh_defs.h"
10 #include "fssh_dirent.h"
11 
12 
13 typedef struct fssh_attr_info {
14 	uint32_t	type;
15 	fssh_off_t	size;
16 } fssh_attr_info;
17 
18 
19 #ifdef  __cplusplus
20 extern "C" {
21 #endif
22 
23 extern fssh_ssize_t	fssh_fs_read_attr(int fd, const char *attribute,
24 							uint32_t type, fssh_off_t pos, void *buffer,
25 							fssh_size_t readBytes);
26 extern fssh_ssize_t	fssh_fs_write_attr(int fd, const char *attribute,
27 							uint32_t type, fssh_off_t pos, const void *buffer,
28 							fssh_size_t readBytes);
29 extern int			fssh_fs_remove_attr(int fd, const char *attribute);
30 extern int			fssh_fs_stat_attr(int fd, const char *attribute,
31 							struct fssh_attr_info *attrInfo);
32 
33 // ToDo: the following three functions are not part of the R5 API, and
34 // are only preliminary - they may change or be removed at any point
35 //extern int		fssh_fs_open_attr(const char *path, const char *attribute, uint32_t type, int openMode);
36 extern int			fssh_fs_open_attr(int fd, const char *attribute,
37 							uint32_t type, int openMode);
38 extern int			fssh_fs_close_attr(int fd);
39 
40 extern fssh_DIR		*fssh_fs_open_attr_dir(const char *path);
41 extern fssh_DIR		*fssh_fs_fopen_attr_dir(int fd);
42 extern int			fssh_fs_close_attr_dir(fssh_DIR *dir);
43 extern struct fssh_dirent *fssh_fs_read_attr_dir(fssh_DIR *dir);
44 extern void			fssh_fs_rewind_attr_dir(fssh_DIR *dir);
45 
46 #ifdef  __cplusplus
47 }
48 #endif
49 
50 #endif	/* _FSSH_FS_ATTR_H */
51