#ifndef EXT4_H_
#define EXT4_H_
-#include "ext4_config.h"
-#include "ext4_types.h"
-#include "ext4_blockdev.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
#include <stdint.h>
#include <stddef.h>
#else
#include <unistd.h>
+ #include <fcntl.h>
#endif
+#include "ext4_config.h"
+#include "ext4_types.h"
+#include "ext4_blockdev.h"
+
/********************************OS LOCK INFERFACE***************************/
/**@brief OS dependent lock interface.*/
* @return standard error code */
int ext4_umount(const char *mount_point);
+
+/**@brief Journal recovery.
+ * @param mount_point mount point
+ * @warning Must be called after @ref ext4_mount
+ * @return standard error code */
+int ext4_recover(const char *mount_point);
+
/**@brief Some of the filesystem stats.*/
struct ext4_mount_stats {
uint32_t inodes_count;
* @param ret_ino the inode id of the path
* @param ext4_inode buffer
* @return standard error code*/
-int ext4_fill_raw_inode(const char *path,
- uint32_t *ret_ino,
+int ext4_fill_raw_inode(const char *path, uint32_t *ret_ino,
struct ext4_inode *inode);
/**@brief File truncate function.
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.
* @param d directory handle*/
void ext4_dir_entry_rewind(ext4_dir *d);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* EXT4_H_ */
/**