Add emile_is_apple_driver to test if a partition is an apple_driver

This commit is contained in:
Laurent Vivier 2006-10-15 21:51:27 +00:00
parent b8d426d278
commit bb5ad6ce4d
2 changed files with 8 additions and 2 deletions

View File

@ -15,6 +15,12 @@ static __attribute__((used)) char* rcsid = "$CVSHeader$";
#include "partition.h"
#include "libemile.h"
int emile_is_apple_driver(emile_map_t *map)
{
return strncmp(map->partition.PartType,
APPLE_DRIVER, strlen(APPLE_DRIVER)) == 0;
}
int emile_map_has_apple_driver(emile_map_t *map)
{
int block, size, type, part;
@ -31,8 +37,7 @@ int emile_map_has_apple_driver(emile_map_t *map)
if (ret == -1)
return -1;
if (strncmp(map->partition.PartType,
APPLE_DRIVER, strlen(APPLE_DRIVER)) == 0)
if (emile_is_apple_driver(map))
return 1;
}

View File

@ -119,6 +119,7 @@ extern int emile_scsi_get_dev(int fd, int* driver, int *disk, int *partition);
extern int emile_get_dev_name(char *s, int driver, int disk, int partition);
extern int emile_map_set_startup(char* dev_name, int partition);
extern int emile_scsi_get_rdev(char* dev_name, int* driver, int *disk, int *partition);
extern int emile_is_apple_driver(emile_map_t *map);
extern int emile_map_has_apple_driver(emile_map_t *map);
extern int emile_map_seek_driver_partition(emile_map_t *map, int start);
extern int emile_get_uncompressed_size(char *file);