/********************************FILE OPEN FLAGS*****************************/
-#ifndef O_RDONLY
-#define O_RDONLY 00
-#endif
+#if CONFIG_HAVE_OWN_OFLAGS
-#ifndef O_WRONLY
-#define O_WRONLY 01
-#endif
+ #ifndef O_RDONLY
+ #define O_RDONLY 00
+ #endif
-#ifndef O_RDWR
-#define O_RDWR 02
-#endif
+ #ifndef O_WRONLY
+ #define O_WRONLY 01
+ #endif
-#ifndef O_CREAT
-#define O_CREAT 0100
-#endif
+ #ifndef O_RDWR
+ #define O_RDWR 02
+ #endif
-#ifndef O_EXCL
-#define O_EXCL 0200
-#endif
+ #ifndef O_CREAT
+ #define O_CREAT 0100
+ #endif
-#ifndef O_TRUNC
-#define O_TRUNC 01000
-#endif
+ #ifndef O_EXCL
+ #define O_EXCL 0200
+ #endif
-#ifndef O_APPEND
-#define O_APPEND 02000
-#endif
+ #ifndef O_TRUNC
+ #define O_TRUNC 01000
+ #endif
+
+ #ifndef O_APPEND
+ #define O_APPEND 02000
+ #endif
/********************************FILE SEEK FLAGS*****************************/
-#ifndef SEEK_SET
-#define SEEK_SET 0
-#endif
+ #ifndef SEEK_SET
+ #define SEEK_SET 0
+ #endif
-#ifndef SEEK_CUR
-#define SEEK_CUR 1
-#endif
+ #ifndef SEEK_CUR
+ #define SEEK_CUR 1
+ #endif
+
+ #ifndef SEEK_END
+ #define SEEK_END 2
+ #endif
-#ifndef SEEK_END
-#define SEEK_END 2
+#else
+ #include <unistd.h>
+ #include <fcntl.h>
#endif
/********************************OS LOCK INFERFACE***************************/
int ext4_readlink(const char *path, char *buf, size_t bufsize, size_t *rcnt);
+int ext4_setxattr(const char *path, const char *name, size_t name_len,
+ const void *data, size_t data_size, bool replace);
+int ext4_getxattr(const char *path, const char *name, size_t name_len,
+ void *buf, size_t buf_size, size_t *data_size);
+int ext4_listxattr(const char *path, char *list, size_t size, size_t *ret_size);
+int ext4_removexattr(const char *path, const char *name, size_t name_len);
+
+
/*********************************DIRECTORY OPERATION***********************/
/**@brief Recursive directory remove.
* @return directory entry id (NULL if no entry)*/
const ext4_direntry *ext4_dir_entry_next(ext4_dir *d);
+/**@brief Rewine directory entry offset.
+ * @param d directory handle*/
+void ext4_dir_entry_rewind(ext4_dir *d);
+
#endif /* EXT4_H_ */
/**