File format.
authorgkostka <kostka.grzegorz@gmail.com>
Mon, 7 Oct 2013 20:23:08 +0000 (20:23 +0000)
committergkostka <kostka.grzegorz@gmail.com>
Mon, 7 Oct 2013 20:23:08 +0000 (20:23 +0000)
src/ext4.h

index 28f8b9aad067a6bda400ab7ed6f02b4cfc10d4b4..dedeeb121d8485c4c452e84ea91fd1d54b4afd26 100644 (file)
 /**@brief      OS dependent lock interface.*/\r
 struct ext4_lock {\r
 \r
-       /**@brief       Lock access to mountpoint*/\r
-       void (*lock)(void);\r
+    /**@brief  Lock access to mountpoint*/\r
+    void (*lock)(void);\r
 \r
-       /**@brief       Unlock access to mountpoint*/\r
-       void (*unlock)(void);\r
+    /**@brief  Unlock access to mountpoint*/\r
+    void (*unlock)(void);\r
 };\r
 \r
 \r
@@ -104,52 +104,52 @@ struct ext4_lock {
 /**@brief      File descriptor*/\r
 typedef struct ext4_file {\r
 \r
-       /**@brief       Pountpoint handle.*/\r
-       struct ext4_mountpoint *mp;\r
+    /**@brief  Pountpoint handle.*/\r
+    struct ext4_mountpoint *mp;\r
 \r
-       /**@brief       File inode id*/\r
-       uint32_t inode;\r
+    /**@brief  File inode id*/\r
+    uint32_t inode;\r
 \r
-       /**@brief       Open flags.*/\r
-       uint32_t flags;\r
+    /**@brief  Open flags.*/\r
+    uint32_t flags;\r
 \r
-       /**@brief       File size.*/\r
-       uint64_t fsize;\r
+    /**@brief  File size.*/\r
+    uint64_t fsize;\r
 \r
-       /**@brief       File position*/\r
-       uint64_t fpos;\r
+    /**@brief  File position*/\r
+    uint64_t fpos;\r
 }ext4_file;\r
 \r
 /*****************************DIRECTORY DESCRIPTOR******************************/\r
 /**@brief      Directory entry types. Copy from ext4_types.h*/\r
 enum  {\r
-       EXT4_DIRENTRY_UNKNOWN = 0,\r
-       EXT4_DIRENTRY_REG_FILE,\r
-       EXT4_DIRENTRY_DIR,\r
-       EXT4_DIRENTRY_CHRDEV,\r
-       EXT4_DIRENTRY_BLKDEV,\r
-       EXT4_DIRENTRY_FIFO,\r
-       EXT4_DIRENTRY_SOCK,\r
-       EXT4_DIRENTRY_SYMLINK\r
+    EXT4_DIRENTRY_UNKNOWN = 0,\r
+    EXT4_DIRENTRY_REG_FILE,\r
+    EXT4_DIRENTRY_DIR,\r
+    EXT4_DIRENTRY_CHRDEV,\r
+    EXT4_DIRENTRY_BLKDEV,\r
+    EXT4_DIRENTRY_FIFO,\r
+    EXT4_DIRENTRY_SOCK,\r
+    EXT4_DIRENTRY_SYMLINK\r
 };\r
 \r
 /**@brief      Directory entry descriptor. Copy from ext4_types.h*/\r
 typedef struct {\r
-       uint32_t inode;\r
-       uint16_t entry_length;\r
-       uint8_t  name_length;\r
-       union {\r
-               uint8_t name_length_high;\r
-               uint8_t inode_type;\r
-       };\r
-       uint8_t name[255];\r
+    uint32_t inode;\r
+    uint16_t entry_length;\r
+    uint8_t  name_length;\r
+    union {\r
+        uint8_t name_length_high;\r
+        uint8_t inode_type;\r
+    };\r
+    uint8_t name[255];\r
 }ext4_direntry;\r
 \r
 typedef struct  {\r
-       /**@brief       File descriptor*/\r
-       ext4_file               f;\r
-       /**@brief       Current direntry.*/\r
-       ext4_direntry   de;\r
+    /**@brief  File descriptor*/\r
+    ext4_file          f;\r
+    /**@brief  Current direntry.*/\r
+    ext4_direntry      de;\r
 }ext4_dir;\r
 \r
 /********************************MOUNT OPERATIONS*****************************/\r
@@ -164,7 +164,7 @@ typedef struct  {
  * @param      dev_name register name\r
  * @param      standard error code*/\r
 int    ext4_device_register(struct ext4_blockdev *bd, struct ext4_bcache *bc,\r
-                         const char *dev_name);\r
+        const char *dev_name);\r
 \r
 /**@brief      Mount a block device with EXT4 partition to the mountpoint.\r
  * @param      dev_name block device name (@ref ext4_device_register)\r
@@ -183,7 +183,7 @@ int ext4_umount(char *mount_point);
 /********************************FILE OPERATIONS******************************/\r
 \r
 /**@brief      */\r
-int    ext4_fremove(const char *path);\r
+int        ext4_fremove(const char *path);\r
 \r
 /**@brief      File open function.\r
  * @param      filename, (has to start from mountpoint)\r
@@ -198,9 +198,9 @@ int ext4_fremove(const char *path);
  *  |---------------------------------------------------------------|\r
  *  |   r+ or rb+ or r+b        O_RDWR                              |\r
  *  |---------------------------------------------------------------|\r
- *  |   w+ or wb+ or w+b               O_RDWR|O_CREAT|O_TRUNC              |\r
+ *  |   w+ or wb+ or w+b        O_RDWR|O_CREAT|O_TRUNC              |\r
  *  |---------------------------------------------------------------|\r
- *  |   a+ or ab+ or a+b               O_RDWR|O_CREAT|O_APPEND             |\r
+ *  |   a+ or ab+ or a+b      O_RDWR|O_CREAT|O_APPEND               |\r
  *  |---------------------------------------------------------------|\r
  *\r
  * @return     standard error code*/\r