2004-12-21 20:05:31 +00:00
|
|
|
static __attribute__((used)) char* rcsid = "$CVSHeader$";
|
|
|
|
/*
|
|
|
|
*
|
2006-09-15 14:55:39 +00:00
|
|
|
* (c) 2004 Laurent Vivier <Laurent@lvivier.info>
|
2004-12-21 20:05:31 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* See http://developer.apple.com/technotes/tn/tn1189.html
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include "partition.h"
|
|
|
|
#include "libemile.h"
|
|
|
|
|
2006-10-15 21:51:27 +00:00
|
|
|
int emile_is_apple_driver(emile_map_t *map)
|
|
|
|
{
|
|
|
|
return strncmp(map->partition.PartType,
|
|
|
|
APPLE_DRIVER, strlen(APPLE_DRIVER)) == 0;
|
|
|
|
}
|
|
|
|
|
2004-12-21 20:05:31 +00:00
|
|
|
int emile_map_has_apple_driver(emile_map_t *map)
|
|
|
|
{
|
|
|
|
int block, size, type, part;
|
|
|
|
int i;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
for (i = 0; i < emile_map_get_driver_number(map); i++)
|
|
|
|
{
|
|
|
|
emile_map_get_driver_info(map, i, &block, &size, &type);
|
|
|
|
|
|
|
|
part = emile_map_seek_driver_partition(map, block);
|
|
|
|
|
|
|
|
ret = emile_map_read(map, part);
|
|
|
|
if (ret == -1)
|
|
|
|
return -1;
|
|
|
|
|
2006-10-15 21:51:27 +00:00
|
|
|
if (emile_is_apple_driver(map))
|
2004-12-21 20:05:31 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|