1dff6f3c1SIngo Weinhold/*
2dff6f3c1SIngo Weinhold * Copyright 2002-2009, Haiku Inc. All Rights Reserved.
3dff6f3c1SIngo Weinhold * Distributed under the terms of the MIT License.
4dff6f3c1SIngo Weinhold */
5338b8dc3SIngo Weinhold#ifndef _FS_ATTR_H
6338b8dc3SIngo Weinhold#define	_FS_ATTR_H
7338b8dc3SIngo Weinhold
8338b8dc3SIngo Weinhold
9338b8dc3SIngo Weinhold#include <OS.h>
10338b8dc3SIngo Weinhold#include <dirent.h>
11338b8dc3SIngo Weinhold
12338b8dc3SIngo Weinhold
13338b8dc3SIngo Weinholdtypedef struct attr_info {
14338b8dc3SIngo Weinhold	uint32	type;
15338b8dc3SIngo Weinhold	off_t	size;
16338b8dc3SIngo Weinhold} attr_info;
17338b8dc3SIngo Weinhold
18338b8dc3SIngo Weinhold
19338b8dc3SIngo Weinhold#ifdef  __cplusplus
20338b8dc3SIngo Weinholdextern "C" {
21338b8dc3SIngo Weinhold#endif
22338b8dc3SIngo Weinhold
23699b4bbaSAugustin Cavalier
24dff6f3c1SIngo Weinholdextern ssize_t	fs_read_attr(int fd, const char *attribute, uint32 type,
25dff6f3c1SIngo Weinhold					off_t pos, void *buffer, size_t readBytes);
26dff6f3c1SIngo Weinholdextern ssize_t	fs_write_attr(int fd, const char *attribute, uint32 type,
27dff6f3c1SIngo Weinhold					off_t pos, const void *buffer, size_t readBytes);
28338b8dc3SIngo Weinholdextern int		fs_remove_attr(int fd, const char *attribute);
29dff6f3c1SIngo Weinholdextern int		fs_stat_attr(int fd, const char *attribute,
30dff6f3c1SIngo Weinhold					struct attr_info *attrInfo);
31338b8dc3SIngo Weinhold
32dff6f3c1SIngo Weinholdextern int		fs_open_attr(const char *path, const char *attribute,
33dff6f3c1SIngo Weinhold					uint32 type, int openMode);
34dff6f3c1SIngo Weinholdextern int		fs_fopen_attr(int fd, const char *attribute, uint32 type,
35dff6f3c1SIngo Weinhold					int openMode);
36338b8dc3SIngo Weinholdextern int		fs_close_attr(int fd);
37338b8dc3SIngo Weinhold
38338b8dc3SIngo Weinholdextern DIR		*fs_open_attr_dir(const char *path);
39648f0d5fSAugustin Cavalierextern DIR		*fs_lopen_attr_dir(const char *path);
40338b8dc3SIngo Weinholdextern DIR		*fs_fopen_attr_dir(int fd);
41338b8dc3SIngo Weinholdextern int		fs_close_attr_dir(DIR *dir);
42338b8dc3SIngo Weinholdextern struct dirent *fs_read_attr_dir(DIR *dir);
43338b8dc3SIngo Weinholdextern void		fs_rewind_attr_dir(DIR *dir);
44338b8dc3SIngo Weinhold
45338b8dc3SIngo Weinhold#ifdef  __cplusplus
46338b8dc3SIngo Weinhold}
47338b8dc3SIngo Weinhold#endif
48338b8dc3SIngo Weinhold
49338b8dc3SIngo Weinhold#endif	/* _FS_ATTR_H */
50