--- genisovh-0.1.orig/dvh.h
+++ genisovh-0.1/dvh.h
@@ -1,14 +1,18 @@
-#ifndef _SYS_DVH_H
-#define _SYS_DVH_H
-
 /*
+ * Copyright: (C) 2002 by Florian Lohoff <flo@rfc822.org>
+ *            (C) 2004 by Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, Version 2, as published by the
+ * Free Software Foundation.
+ *
  * Format for volume header information
  *
  * The volume header is a block located at the beginning of all disk
  * media (sector 0).  It contains information pertaining to physical
  * device parameters and logical partition information.
  *
- * The volume header is manipulated by disk formatters/verifiers, 
+ * The volume header is manipulated by disk formatters/verifiers,
  * partition builders (e.g. fx, dvhtool, and mkfs), and disk drivers.
  *
  * Previous versions of IRIX wrote a copy of the volume header is
@@ -33,6 +37,11 @@
  * and other tables is user defined when the device is formatted.
  */
 
+#ifndef _SYS_DVH_H
+#define _SYS_DVH_H
+
+#include <stdint.h>
+
 /*
  * device parameters are in the volume header to determine mapping
  * from logical block numbers to physical device addresses
@@ -40,38 +49,38 @@
  * Linux doesn't care ...
  */
 struct device_parameters {
-	unsigned char	dp_skew;	/* spiral addressing skew */
-	unsigned char	dp_gap1;	/* words of 0 before header */
-	unsigned char	dp_gap2;	/* words of 0 between hdr and data */
-	unsigned char	dp_spares_cyl;	/* This is for drives (such as SCSI
+	uint8_t dp_skew;	/* spiral addressing skew */
+	uint8_t dp_gap1;	/* words of 0 before header */
+	uint8_t dp_gap2;	/* words of 0 between hdr and data */
+	uint8_t dp_spares_cyl;	/* This is for drives (such as SCSI
 		that support zone oriented sparing, where the zone is larger
 		than one track.  It gets subracteded from the cylinder size
 		( dp_trks0 * dp_sec) when doing partition size calculations */
-	unsigned short	dp_cyls;	/* number of usable cylinders (i.e.,
+	uint16_t dp_cyls;	/* number of usable cylinders (i.e.,
 		doesn't include cylinders reserved by the drive for badblocks,
 		etc.). For drives with variable geometry, this number may be
 		decreased so that:
 		dp_cyls * ((dp_heads * dp_trks0) - dp_spares_cyl) <= actualcapacity
 		This happens on SCSI drives such as the Wren IV and Toshiba 156
 		Also see dp_cylshi below */
-	unsigned short	dp_shd0;	/* starting head vol 0 */
-	unsigned short	dp_trks0;	/* number of tracks / cylinder vol 0*/
-	unsigned char	dp_ctq_depth;	/* Depth of CTQ queue */
-	unsigned char	dp_cylshi;	/* high byte of 24 bits of cylinder count */
-	unsigned short	dp_unused;	/* not used */
-	unsigned short	dp_secs;	/* number of sectors/track */
-	unsigned short	dp_secbytes;	/* length of sector in bytes */
-	unsigned short	dp_interleave;	/* sector interleave */
-	int	dp_flags;		/* controller characteristics */
-	int	dp_datarate;		/* bytes/sec for kernel stats */
-	int	dp_nretries;		/* max num retries on data error */
-	int	dp_mspw;		/* ms per word to xfer, for iostat */
-	unsigned short dp_xgap1;	/* Gap 1 for xylogics controllers */
-	unsigned short dp_xsync;    /* sync delay for xylogics controllers */
-	unsigned short dp_xrdly;    /* read delay for xylogics controllers */
-	unsigned short dp_xgap2;    /* gap 2 for xylogics controllers */
-	unsigned short dp_xrgate;   /* read gate for xylogics controllers */
-	unsigned short dp_xwcont;   /* write continuation for xylogics */
+	uint16_t dp_shd0;	/* starting head vol 0 */
+	uint16_t dp_trks0;	/* number of tracks / cylinder vol 0*/
+	uint8_t dp_ctq_depth;	/* Depth of CTQ queue */
+	uint8_t dp_cylshi;	/* high byte of 24 bits of cylinder count */
+	uint16_t dp_unused;	/* not used */
+	uint16_t dp_secs;	/* number of sectors/track */
+	uint16_t dp_secbytes;	/* length of sector in bytes */
+	uint16_t dp_interleave;	/* sector interleave */
+	int32_t dp_flags;		/* controller characteristics */
+	int32_t dp_datarate;		/* bytes/sec for kernel stats */
+	int32_t dp_nretries;		/* max num retries on data error */
+	int32_t dp_mspw;		/* ms per word to xfer, for iostat */
+	uint16_t dp_xgap1;	/* Gap 1 for xylogics controllers */
+	uint16_t dp_xsync;    /* sync delay for xylogics controllers */
+	uint16_t dp_xrdly;    /* read delay for xylogics controllers */
+	uint16_t dp_xgap2;    /* gap 2 for xylogics controllers */
+	uint16_t dp_xrgate;   /* read gate for xylogics controllers */
+	uint16_t dp_xwcont;   /* write continuation for xylogics */
 };
 
 /*
@@ -93,9 +102,9 @@
 #define VDNAMESIZE	8
 
 struct volume_directory {
-	char	vd_name[VDNAMESIZE];	/* name */
-	int	vd_lbn;			/* logical block number */
-	int	vd_nbytes;		/* file length in bytes */
+	int8_t  vd_name[VDNAMESIZE];	/* name */
+	int32_t vd_lbn;			/* logical block number */
+	int32_t vd_nbytes;		/* file length in bytes */
 };
 
 /*
@@ -107,9 +116,9 @@
  * NOTE: pt_firstlbn SHOULD BE CYLINDER ALIGNED
  */
 struct partition_table {		/* one per logical partition */
-	int	pt_nblks;		/* # of logical blks in partition */
-	int	pt_firstlbn;		/* first lbn of partition */
-	int	pt_type;		/* use of partition */
+	int32_t pt_nblks;		/* # of logical blks in partition */
+	int32_t pt_firstlbn;		/* first lbn of partition */
+	int32_t pt_type;		/* use of partition */
 };
 
 #define	PTYPE_VOLHDR	0		/* partition is volume header */
@@ -148,15 +157,15 @@
 #define NOT_BOOTABLE    0x80;
 
 struct volume_header {
-	int vh_magic;				/* identifies volume header */
-	short vh_rootpt;			/* root partition number */
-	short vh_swappt;			/* swap partition number */
-	char vh_bootfile[BFNAMESIZE];		/* name of file to boot */
-	struct device_parameters vh_dp;		/* device parameters */
-	struct volume_directory vh_vd[NVDIR];	/* other vol hdr contents */
-	struct partition_table vh_pt[NPARTAB];	/* device partition layout */
-	int vh_csum;				/* volume header checksum */
-	int vh_fill;	/* fill out to 512 bytes */
+	int32_t vh_magic; /* identifies volume header */
+	int16_t vh_rootpt; /* root partition number */
+	int16_t vh_swappt; /* swap partition number */
+	int8_t vh_bootfile[BFNAMESIZE]; /* name of file to boot */
+	struct device_parameters vh_dp; /* device parameters */
+	struct volume_directory vh_vd[NVDIR]; /* other vol hdr contents */
+	struct partition_table vh_pt[NPARTAB]; /* device partition layout */
+	int32_t vh_csum; /* volume header checksum */
+	int32_t vh_fill; /* fill out to 512 bytes */
 };
 
 #endif /* _SYS_DVH_H */
