Add map_get_blocksize()

This commit is contained in:
Laurent Vivier 2007-11-01 22:07:17 +00:00
parent 79f9107e45
commit eb9c17f5ad
3 changed files with 17 additions and 1 deletions

View File

@ -30,7 +30,7 @@ SOURCES = map_bootblock_get_type.c map_bootblock_is_valid.c \
map_set_bootinfo.c map_set_driver_info.c map_set_driver_number.c \
map_set_partition_name.c map_set_partition_type.c map_set_startup.c \
map_write.c map_block0_write.c map_read_sector.c \
map_write_sector.c
map_write_sector.c map_get_blocksize.c
HEADERS = libmap.h

View File

@ -121,11 +121,14 @@ struct Partition {
#define APPLE_PATCHES "Apple_Patches"
#define MAP_NAME_LEN 256
#define MAP_BLOCKSIZE 2048
typedef struct {
device_io_t *device;
int current;
struct DriverDescriptor drivers;
char filler1[MAP_BLOCKSIZE-512];
struct Partition partition;
char filler2[MAP_BLOCKSIZE-512];
} map_t;
enum {
@ -178,4 +181,5 @@ extern unsigned long map_get_driver_signature(map_t* map);
extern int map_block0_write(map_t *map);
extern int map_read_sector(map_t* map, off_t block, char *buffer, size_t nb);
extern int map_write_sector(map_t* map, off_t block, char *buffer, size_t nb);
extern int map_get_blocksize(map_t *map);
#endif

View File

@ -0,0 +1,12 @@
/*
*
* (c) 2007 Laurent Vivier <Laurent@lvivier.info>
*
*/
#include "libmap.h"
int map_get_blocksize(map_t *map)
{
return map->device->get_blocksize(map->device->data);
}