mirror of
				https://github.com/eledio-devices/thirdparty-littlefs.git
				synced 2025-10-31 08:42:40 +01:00 
			
		
		
		
	WIP Initial branch for exploring B-trees
This commit is contained in:
		
							
								
								
									
										36
									
								
								lfs.h
									
									
									
									
									
								
							
							
						
						
									
										36
									
								
								lfs.h
									
									
									
									
									
								
							| @@ -88,32 +88,34 @@ enum lfs_error { | |||||||
| // File types | // File types | ||||||
| enum lfs_type { | enum lfs_type { | ||||||
|     // file types |     // file types | ||||||
|     LFS_TYPE_REG            = 0x001, |     LFS_TYPE_REG            = 0x004, | ||||||
|     LFS_TYPE_DIR            = 0x002, |     LFS_TYPE_DIR            = 0x005, | ||||||
|  |  | ||||||
|     // internally used types |     // internally used types | ||||||
|     LFS_TYPE_USER           = 0x100, |     LFS_TYPE_USER           = 0x100, | ||||||
|     LFS_TYPE_SUPERBLOCK     = 0x011, |     LFS_TYPE_SUPERBLOCK     = 0x002, | ||||||
|     LFS_TYPE_ROOT           = 0x010, |     LFS_TYPE_ROOT           = 0x003, | ||||||
|  |     LFS_TYPE_CHILD          = 0x001, | ||||||
|     LFS_TYPE_NAME           = 0x000, |     LFS_TYPE_NAME           = 0x000, | ||||||
|     LFS_TYPE_DELETE         = 0x030, |     LFS_TYPE_DELETE         = 0x060, | ||||||
|     LFS_TYPE_STRUCT         = 0x040, |     LFS_TYPE_STRUCT         = 0x020, | ||||||
|     LFS_TYPE_GLOBALS        = 0x080, |     LFS_TYPE_GLOBALS        = 0x0e0, | ||||||
|     LFS_TYPE_TAIL           = 0x0c0, |     LFS_TYPE_TAIL           = 0x080, | ||||||
|     LFS_TYPE_SOFTTAIL       = 0x0c0, |     LFS_TYPE_SOFTTAIL       = 0x080, | ||||||
|     LFS_TYPE_HARDTAIL       = 0x0c1, |     LFS_TYPE_HARDTAIL       = 0x081, | ||||||
|     LFS_TYPE_CRC            = 0x0f0, |     LFS_TYPE_CRC            = 0x0a0, | ||||||
|  |  | ||||||
|     LFS_TYPE_DIRSTRUCT      = 0x040, |     LFS_TYPE_DIRSTRUCT      = 0x020, | ||||||
|     LFS_TYPE_INLINESTRUCT   = 0x041, |     LFS_TYPE_INLINESTRUCT   = 0x021, | ||||||
|     LFS_TYPE_CTZSTRUCT      = 0x042, |     LFS_TYPE_CTZSTRUCT      = 0x022, | ||||||
|  |  | ||||||
|     // internal chip sources |     // internal chip sources | ||||||
|     LFS_FROM_REGION         = 0x000, |     LFS_FROM_REGION         = 0x000, | ||||||
|     LFS_FROM_DISK           = 0x200, |     LFS_FROM_DISK           = 0x200, | ||||||
|     LFS_FROM_MOVE           = 0x050, |     LFS_FROM_MOVE           = 0x040, | ||||||
|     LFS_FROM_ATTRS          = 0x060, |     LFS_FROM_COMPACT        = 0x041, | ||||||
|     LFS_FROM_SUPERBLOCK     = 0x070, |     LFS_FROM_SPLIT          = 0x042, | ||||||
|  |     LFS_FROM_ATTRS          = 0x043, | ||||||
| }; | }; | ||||||
|  |  | ||||||
| // File open flags | // File open flags | ||||||
|   | |||||||
| @@ -4,18 +4,19 @@ import struct | |||||||
| import binascii | import binascii | ||||||
|  |  | ||||||
| TYPES = { | TYPES = { | ||||||
|     (0x1ff, 0x001): 'reg', |     (0x1ff, 0x004): 'reg', | ||||||
|     (0x1ff, 0x002): 'dir', |     (0x1ff, 0x005): 'dir', | ||||||
|     (0x1ff, 0x011): 'superblock', |     (0x1ff, 0x002): 'superblock', | ||||||
|     (0x1ff, 0x010): 'root', |     (0x1ff, 0x003): 'root', | ||||||
|     (0x1ff, 0x030): 'delete', |     (0x1ff, 0x001): 'child', | ||||||
|     (0x1f0, 0x080): 'globals', |     (0x1ff, 0x060): 'delete', | ||||||
|     (0x1ff, 0x0c0): 'tail soft', |     (0x1f0, 0x0e0): 'globals', | ||||||
|     (0x1ff, 0x0c1): 'tail hard', |     (0x1ff, 0x080): 'tail soft', | ||||||
|     (0x1f0, 0x0f0): 'crc', |     (0x1ff, 0x081): 'tail hard', | ||||||
|     (0x1ff, 0x040): 'struct dir', |     (0x1f0, 0x0a0): 'crc', | ||||||
|     (0x1ff, 0x041): 'struct inline', |     (0x1ff, 0x020): 'struct dir', | ||||||
|     (0x1ff, 0x042): 'struct ctz', |     (0x1ff, 0x021): 'struct inline', | ||||||
|  |     (0x1ff, 0x022): 'struct ctz', | ||||||
|     (0x100, 0x100): 'attr', |     (0x100, 0x100): 'attr', | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user