1 /* File System attributes 2 ** 3 ** Distributed under the terms of the OpenBeOS 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 extern ssize_t fs_read_attr(int fd, const char *attribute, uint32 type, off_t pos, void *buffer, size_t readBytes); 24 extern ssize_t fs_write_attr(int fd, const char *attribute, uint32 type, off_t pos, const void *buffer, size_t readBytes); 25 extern int fs_remove_attr(int fd, const char *attribute); 26 extern int fs_stat_attr(int fd, const char *attribute, struct attr_info *attrInfo); 27 28 // ToDo: the following three functions are not part of the R5 API, and 29 // are only preliminary - they may change or be removed at any point 30 //extern int fs_open_attr(const char *path, const char *attribute, uint32 type, int openMode); 31 extern int fs_open_attr(int fd, const char *attribute, uint32 type, int openMode); 32 extern int fs_close_attr(int fd); 33 34 extern DIR *fs_open_attr_dir(const char *path); 35 extern DIR *fs_fopen_attr_dir(int fd); 36 extern int fs_close_attr_dir(DIR *dir); 37 extern struct dirent *fs_read_attr_dir(DIR *dir); 38 extern void fs_rewind_attr_dir(DIR *dir); 39 40 #ifdef __cplusplus 41 } 42 #endif 43 44 #endif /* _FS_ATTR_H */ 45