void
mac_nolabel(struct fdisk_context *cxt)
{
+ struct mac_partition *maclabel = (struct mac_partition *) cxt->firstsector;
+
maclabel->magic = 0;
partitions = 4;
fdisk_zeroize_firstsector(cxt);
static int
mac_probe_label(struct fdisk_context *cxt)
{
+ struct mac_partition *maclabel = (struct mac_partition *) cxt->firstsector;
+
/*
Conversion: only 16 bit should compared
e.g.: HFS Label is only 16bit long
return 1;
}
-static void mac_add_partition(struct fdisk_context *cxt, int partnum, int parttype)
+static void mac_add_partition(
+ struct fdisk_context *cxt __attribute__ ((__unused__)),
+ int partnum __attribute__ ((__unused__)),
+ int parttype __attribute__ ((__unused__)))
{
printf(_("\tSorry - this fdisk cannot handle Mac disk labels."
"\n\tIf you want to add DOS-type partitions, create"
* the terms of the GNU Public License.
*/
-typedef struct {
+struct mac_partition {
unsigned int magic; /* expect MAC_LABEL_MAGIC */
unsigned int fillbytes1[124];
unsigned int physical_volume_id;
unsigned int fillbytes2[124];
-} mac_partition;
+};
/* MAC magic number only 16bits, do I always know that there are 0200
* following? Problem, after magic the uint16_t res1; follows, I donnno know
#define MAC_LABEL_MAGIC_2_SWAPPED 0x00003505
#define MAC_LABEL_MAGIC_3_SWAPPED 0x0000d405
-/* fdisk.c */
-#define maclabel ((mac_partition *)cxt->firstsector)
-
/* fdiskmaclabel.c */
extern struct systypes mac_sys_types[];
extern void mac_nolabel(struct fdisk_context *cxt);