[Libburn] libisofs status

Todd Kulesza todd@dropline.net
Thu, 29 Jan 2004 21:25:18 -0500


This is a multi-part message in MIME format.
--------------010609070305010208010602
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Ben Jansens wrote:
> What you see is what you get. Everything I've done is already in CVS thus
> far. Your work on this library is, of course, much encouraged. :)

Here's a start: the attached patch fixes the byte order functions in 
util.c and sets the initial volume_space_size to 18 in 
iso_target_layout().  Do you want me to create a ChangeLog to put 
details in?

Todd

--------------010609070305010208010602
Content-Type: text/x-patch;
 name="byte_order.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="byte_order.diff"

Index: libisofs/util.c
===================================================================
RCS file: /cvs/burn/burn/libisofs/util.c,v
retrieving revision 1.2
diff -p -u -r1.2 util.c
--- libisofs/util.c	3 Dec 2003 20:01:58 -0000	1.2
+++ libisofs/util.c	30 Jan 2004 02:15:17 -0000
@@ -131,7 +131,7 @@ iso_lsb(unsigned char *buf, int num, int
 	assert (bytes <= sizeof (int));
 
 	for (i = 0; i < bytes; ++i)
-		buf[i] = num << (sizeof (int)-1-i) >> (sizeof (int) - 1) << i;
+		buf[i] = (num >> (8 * i)) & 0xff;
 }
 
 void
@@ -142,20 +142,18 @@ iso_msb(unsigned char *buf, int num, int
 	assert (bytes <= sizeof (int));
 
 	for (i = 0; i < bytes; ++i)
-		buf[bytes - 1 - i] =
-			num << (sizeof (int)-1-i) >> (sizeof (int) - 1) << i;
+		buf[bytes - 1 - i] = (num >> (8 * i)) & 0xff;
 }
 
 void
 iso_bb(unsigned char *buf, int num, int bytes)
 {
 	int i;
-
+	
 	assert (bytes <= sizeof (int));
-
+	
 	for (i = 0; i < bytes; ++i)
-		buf[i] = buf[2 * bytes - 1 - i] =
-			num << (sizeof (int)-1-i) >> (sizeof (int) - 1) << i;
+		buf[i] = buf[2 * bytes - 1 - i] = (num >> (8 * i)) & 0xff;
 }
 
 void
Index: libisofs/writer.c
===================================================================
RCS file: /cvs/burn/burn/libisofs/writer.c,v
retrieving revision 1.14
diff -p -u -r1.14 writer.c
--- libisofs/writer.c	12 Dec 2003 23:01:06 -0000	1.14
+++ libisofs/writer.c	30 Jan 2004 02:15:17 -0000
@@ -112,7 +112,9 @@ iso_target_layout (struct iso_write_targ
 	/* volume descriptor terminator */
 	target->total_size += target->phys_sector_size;
 
-	target->volume_space_size = 0;
+	/* 16 logical blocks for the System Area plus at least 2 for
+	 * the Data Area (primary volume and volume terminator) */
+	target->volume_space_size = 18;
 	target->logical_block_size = 2048;
 	target->path_table_size = 0;
 	target->l_path_table_pos = 0;

--------------010609070305010208010602--