fat12: add ls_callback function
Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
		@@ -4,16 +4,28 @@
 | 
			
		||||
#include <stdint.h>
 | 
			
		||||
 | 
			
		||||
struct fat12_partition;
 | 
			
		||||
struct fat12_dirent {
 | 
			
		||||
    char filename[256];
 | 
			
		||||
    uint32_t first_cluster;
 | 
			
		||||
    uint32_t size;
 | 
			
		||||
    uint32_t file_attributes;
 | 
			
		||||
    uint32_t ctime;
 | 
			
		||||
    uint32_t mtime;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct fat12_partition * fat12_alloc(void);
 | 
			
		||||
int fat12_open(struct fat12_partition *part, const char *filename);
 | 
			
		||||
int fat12_close(struct fat12_partition *part);
 | 
			
		||||
void fat12_free(struct fat12_partition **part);
 | 
			
		||||
 | 
			
		||||
int fat12_ls_foreach(struct fat12_partition *part, uint32_t dir_cluster, void *data, int (*callback)(void *data, const struct fat12_dirent *dirent));
 | 
			
		||||
 | 
			
		||||
void fat12_write_u8(void *ptr, uint8_t val);
 | 
			
		||||
uint8_t fat12_read_u8(void *ptr);
 | 
			
		||||
void fat12_write_u16(void *ptr, uint16_t val);
 | 
			
		||||
uint16_t fat12_read_u16(void *ptr);
 | 
			
		||||
void fat12_write_u32(void *ptr, uint32_t val);
 | 
			
		||||
uint32_t fat12_read_u32(void *ptr);
 | 
			
		||||
void fat12_set_cluster(void *fat, uint32_t cluster, uint32_t value);
 | 
			
		||||
uint32_t fat12_get_cluster(void *fat, uint32_t cluster);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user