[Libburn] Disc and drive status

Tiago Cogumbreiro cogumbreiro@linus.uac.pt
Mon, 08 Dec 2003 21:25:07 -0100


--=-u2k/F2F+VivN3N1hYoH5
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi again, this is my patched disc and drive status.
Changelog:
+ LIBBURN_BUSY_NO was changed to BURN_DRIVE_IDLE
+ LIBBURN_BUSY_ namespace was changed to BURN_DRIVE_
+ LIBBURN_STATUS_NO_DISC was changed to BURN_DISC_EMPTY
+ LIBBURN_STATUS_ namespace was changed to BURN_DISC_
+ Put the BURN_DRIVE_ enums near the other enums, not in between the
funcs
+ libburn_drive_get_status was changed to burn_get_disc_status
+ libburn_drive_get_progress was changed to burn_get_drive_status
+ Updated burn_get_drive_status comments

Tiago Cogumbreiro

--=-u2k/F2F+VivN3N1hYoH5
Content-Disposition: attachment; filename=disc_drive_status.diff
Content-Type: text/x-patch; name=disc_drive_status.diff; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

? libburn/.libburn.h.swp
Index: libburn/async.c
===================================================================
RCS file: /cvs/burn/burn/libburn/async.c,v
retrieving revision 1.9
diff -p -u -r1.9 async.c
--- libburn/async.c	2 Dec 2003 02:53:48 -0000	1.9
+++ libburn/async.c	8 Dec 2003 22:19:21 -0000
@@ -74,7 +74,7 @@ static void add_worker(struct drive *d, 
 	workers = a;
 
 	if (d)
-		d->busy = LIBBURN_BUSY_SPAWNING;
+		d->busy = BURN_DRIVE_SPAWNING;
 
 	if (pthread_create(&a->thread, NULL, f, a)) {
 		free(a);
Index: libburn/drive.c
===================================================================
RCS file: /cvs/burn/burn/libburn/drive.c,v
retrieving revision 1.233
diff -p -u -r1.233 drive.c
--- libburn/drive.c	8 Dec 2003 20:18:27 -0000	1.233
+++ libburn/drive.c	8 Dec 2003 22:19:22 -0000
@@ -62,7 +62,7 @@ enum libburn_grab libburn_drive_grab(str
 		libburn_print(1, "low level drive grab failed\n");
 		return LIBBURN_GRAB_FAIL;
 	}
-	d->busy = LIBBURN_BUSY_GRABBING;
+	d->busy = BURN_DRIVE_GRABBING;
 
 	if (le)
 		d->load(d);
@@ -73,7 +73,7 @@ enum libburn_grab libburn_drive_grab(str
 		d->read_disc_info(d);
 	} else
 		d->read_toc(d);
-	d->busy = LIBBURN_BUSY_NO;
+	d->busy = BURN_DRIVE_IDLE;
 	return LIBBURN_GRAB_OK;
 }
 
@@ -90,7 +90,7 @@ struct drive *libburn_drive_register(str
 	d->alba = 0;
 	d->rlba = 0;
 	d->cancel = 0;
-	d->busy = LIBBURN_BUSY_NO;
+	d->busy = BURN_DRIVE_IDLE;
 	d->toc_entries = 0;
 	d->toc_entry = NULL;
 /* remove mediacatalog from drive plz */
@@ -111,7 +111,7 @@ void libburn_drive_release(struct drive 
 
 	d->release(d);
 
-	d->status = LIBBURN_STATUS_UNREADY;
+	d->status = BURN_DISC_UNREADY;
 	d->released = 1;
 	if (d->toc_entry)
 		free(d->toc_entry);
@@ -149,10 +149,10 @@ void libburn_erase_disc_sync(struct driv
 	libburn_print(1, "erasing drive %s %s\n", d->idata->vendor,
 		      d->idata->product);
 
-	if (d->status != LIBBURN_STATUS_FULL)
+	if (d->status != BURN_DISC_FULL)
 		return;
 	d->cancel = 0;
-	d->busy = LIBBURN_BUSY_ERASING;
+	d->busy = BURN_DRIVE_ERASING;
 	d->erase(d, fast);
 	/* reset the progress */
 	d->progress.session = 0;
@@ -172,22 +172,22 @@ void libburn_erase_disc_sync(struct driv
 		usleep(1000);
 	
 	d->progress.current_sector = 0x10000;
-	d->busy = LIBBURN_BUSY_NO;
+	d->busy = BURN_DRIVE_IDLE;
 }
 
-enum libburn_drive_status libburn_drive_get_status(struct drive *d)
+enum burn_disc_status burn_get_disc_status(struct drive *d)
 {
 	assert(!d->released);
 	return d->status;
 }
 
-int libburn_drive_get_progress(struct drive *d, struct libburn_progress *p)
+enum burn_drive_status burn_get_drive_status(struct drive *d, struct libburn_progress *p)
 {
 	if (p) {
 		memcpy(p, &(d->progress), sizeof(struct libburn_progress));
 		/* TODO: add mutex */
 	}
-	return d->busy != LIBBURN_BUSY_NO;
+	return d->busy != BURN_DRIVE_IDLE;
 }
 
 void libburn_drive_cancel(struct drive *d)
Index: libburn/libburn.h
===================================================================
RCS file: /cvs/burn/burn/libburn/libburn.h,v
retrieving revision 1.158
diff -p -u -r1.158 libburn.h
--- libburn/libburn.h	8 Dec 2003 20:18:27 -0000	1.158
+++ libburn/libburn.h	8 Dec 2003 22:19:27 -0000
@@ -158,16 +158,16 @@ enum libburn_block_types
 };
 
 /** Possible status' of the drive in regard to the disc in it. */
-enum libburn_drive_status
+enum burn_disc_status
 {
 	/** The current status is not yet known */
-	LIBBURN_STATUS_UNREADY,
+	BURN_DISC_UNREADY,
 	/** The drive holds a blank disc */
-	LIBBURN_STATUS_BLANK,
+	BURN_DISC_BLANK,
 	/** There is no disc at all in the drive */
-	LIBBURN_STATUS_NO_DISC,
+	BURN_DISC_EMPTY,
 	/** There is a disc with data on it in the drive */
-	LIBBURN_STATUS_FULL
+	BURN_DISC_FULL
 };
 
 /** Possible types of messages form the library. */
@@ -209,6 +209,30 @@ enum libburn_source_status
 	LIBBURN_SOURCE_SUCKS
 };
 
+
+/** Possible busy states for a drive */
+enum burn_drive_status
+{
+	/** The drive is not in an operation */
+	BURN_DRIVE_IDLE,
+	/** The library is spawning the processes to handle a pending
+	    operation (A read/write/etc is about to start but hasn't quite
+	    yet) */
+	BURN_DRIVE_SPAWNING,
+	/** The drive is reading data from a disc */
+	BURN_DRIVE_READING,
+	/** The drive is writing data to a disc */
+	BURN_DRIVE_WRITING,
+	/** The drive is writing Lead-In */
+	BURN_DRIVE_WRITING_LEADIN,
+	/** The drive is writing Lead-Out */
+	BURN_DRIVE_WRITING_LEADOUT,
+	/** The drive is erasing a disc */
+	BURN_DRIVE_ERASING,
+	/** The drive is being grabbed */
+	BURN_DRIVE_GRABBING
+};
+
 /** Data source for tracks */
 struct libburn_source {
 	/** Reference count for the data source. Should be 1 when a new source
@@ -397,29 +421,6 @@ struct libburn_read_opts
 
 };
 
-/** Possible busy states for a drive */
-enum libburn_drive_busy
-{
-	/** The drive is not in an operation */
-	LIBBURN_BUSY_NO,
-	/** The library is spawning the processes to handle a pending
-	    operation (A read/write/etc is about to start but hasn't quite
-	    yet) */
-	LIBBURN_BUSY_SPAWNING,
-	/** The drive is reading data from a disc */
-	LIBBURN_BUSY_READING,
-	/** The drive is writing data to a disc */
-	LIBBURN_BUSY_WRITING,
-	/** The drive is writing Lead-In */
-	LIBBURN_BUSY_WRITING_LEADIN,
-	/** The drive is writing Lead-Out */
-	LIBBURN_BUSY_WRITING_LEADOUT,
-	/** The drive is erasing a disc */
-	LIBBURN_BUSY_ERASING,
-	/** The drive is being grabbed */
-	LIBBURN_BUSY_GRABBING
-};
-
 /** Operation progress report. All values are 0 based indices. 
  * */
 struct libburn_progress {
@@ -501,7 +502,7 @@ int libburn_drive_scan(struct libburn_dr
 enum libburn_grab libburn_drive_grab(struct drive *drive, int load);
 
 /** Release a drive. This should not be done until the drive is no longer
-	busy (see libburn_drive_get_progress).
+	busy (see burn_get_drive_status).
 	@param drive The drive to release.
 	@param eject Nonzero to make the drive eject the disc in it.
 */
@@ -521,15 +522,14 @@ int libburn_drive_get_block_types(struct
     @param drive The drive to query for a disc.
     @return The status of the drive, or what kind of disc is in it.
 */
-enum libburn_drive_status libburn_drive_get_status(struct drive *drive);
+enum burn_disc_status burn_get_disc_status(struct drive *drive);
 
-/** Returns the progress of a drive.
+/** Returns the progress and status of a drive.
     @param drive The drive to query busy state for.
     @param p Returns the progress of the operation, NULL if you don't care
-    @return The busy state of the drive. Nonzero indicates an operation is in
-            progress. Zero indicates the drive is idle.
+    @return the current status of the drive. See also burn_drive_status.
 */
-int libburn_drive_get_progress(struct drive *drive, struct libburn_progress *p);
+enum burn_drive_status burn_get_drive_status(struct drive *drive, struct libburn_progress *p);
 
 struct libburn_write_opts *libburn_write_opts_new();
 void libburn_write_opts_free(struct libburn_write_opts *opts);
@@ -539,7 +539,7 @@ void libburn_read_opts_free(struct libbu
 
 /** Erase a disc in the drive. The drive must be grabbed successfully BEFORE
     calling this functions. Always ensure that the drive reports a status of
-    LIBBURN_STATUS_FULL before calling this function. An erase operation is not
+    BURN_DISC_FULL before calling this function. An erase operation is not
     cancellable, as control of the operation is passed wholly to the drive and
     there is no way to interrupt it safely.
     @param drive The drive with which to erase a disc.
@@ -550,7 +550,7 @@ void libburn_erase_disc(struct drive *dr
 
 /** Read a disc from the drive and write it to an fd pair. The drive must be
     grabbed successfully BEFORE calling this function. Always ensure that the
-    drive reports a status of LIBBURN_STATUS_FULL before calling this function.
+    drive reports a status of BURN_DISC_FULL before calling this function.
     @param drive The drive from which to read a disc.
     @param o The options for the read operation.
 */
@@ -558,7 +558,7 @@ void libburn_read_disc(struct drive *dri
 
 /** Write a disc in the drive. The drive must be grabbed successfully BEFORE
     calling this function. Always ensure that the drive reports a status of
-    LIBBURN_STATUS_BLANK or LIBBURN_STATUS_FULL (to append a new session to the
+    BURN_DISC_BLANK or LIBBURN_STATUS_FULL (to append a new session to the
     disc) before calling this function.
     @param drive The drive with the disc to write to.
     @param disc The struct disc * that described the disc to be created
@@ -568,14 +568,14 @@ void libburn_write_disc(struct drive *dr
 			struct libburn_write_opts *o);
 
 /** Cancel an operation on a drive.
-    This will only work when the drive's busy state is LIBBURN_BUSY_READING or
-    LIBBURN_BUSY_WRITING.
+    This will only work when the drive's busy state is BURN_DRIVE_READING or
+    BURN_DRIVE_WRITING.
     @param drive The drive on which to cancel the current operation.
 */
 void libburn_drive_cancel(struct drive *drive);
 
 /** Returns the TOC for the disc in the drive. The drive's status must be
-    LIBBURN_STATUS_FULL.
+    BURN_DISC_FULL.
     The TOC will not be fully complete (with audio indices, for example) until
     after the entire disc has been read. So, if you are ripping a cd, you
     should call libburn_drive_read_disc before getting the toc with this
@@ -591,7 +591,7 @@ void libburn_drive_cancel(struct drive *
 struct toc *libburn_drive_get_toc(struct drive *drive);
 
 /** Creates a TOC for the disc in the drive. The drive's status must be
-    LIBBURN_STATUS_BLANK or this will assert.
+    BURN_DISC_BLANK or this will assert.
     @param drive The drive on which to create the TOC.
     @return The drive's new toc. The TOC will need to be filled out before
             the libburn_drive_write_* functions can be used to write the disc.
Index: libburn/mmc.c
===================================================================
RCS file: /cvs/burn/burn/libburn/mmc.c,v
retrieving revision 1.117
diff -p -u -r1.117 mmc.c
--- libburn/mmc.c	6 Dec 2003 01:37:40 -0000	1.117
+++ libburn/mmc.c	8 Dec 2003 22:19:28 -0000
@@ -131,7 +131,7 @@ void mmc_read_toc(struct drive *d)
 	d->issue_command(d, &c);
 
 	if (c.error) {
-		d->busy = LIBBURN_BUSY_NO;
+		d->busy = BURN_DRIVE_IDLE;
 		return;
 	}
 
@@ -200,7 +200,7 @@ void mmc_read_toc(struct drive *d)
 			d->disc->session[tdata[0] - 1]->leadout_entry = 
                                                             &d->toc_entry[i];
 	}
-	d->status = LIBBURN_STATUS_FULL;
+	d->status = BURN_DISC_FULL;
 	toc_find_modes(d);
 }
 
@@ -219,7 +219,7 @@ void mmc_read_disc_info(struct drive *d)
 	d->issue_command(d, &c);
 
 	if (c.error) {
-		d->busy = LIBBURN_BUSY_NO;
+		d->busy = BURN_DRIVE_IDLE;
 		return;
 	}
 
@@ -230,7 +230,7 @@ void mmc_read_disc_info(struct drive *d)
 		d->toc_entries = 0;
 		d->start_lba = libburn_msf_to_lba(data[17], data[18], data[19]);
 		d->end_lba = libburn_msf_to_lba(data[21], data[22], data[23]);
-		d->status = LIBBURN_STATUS_BLANK;
+		d->status = BURN_DISC_BLANK;
 		spc_try_write_modes(d);
 		break;
 	case 1:
@@ -286,7 +286,7 @@ printf("reading %d from %d\n", len, star
 	len >>= 8;
 	c.opcode[6] = len & 0xFF;
 	req = 0xF8;
-	if (d->busy == LIBBURN_BUSY_GRABBING ||
+	if (d->busy == BURN_DRIVE_GRABBING ||
 	    o->protected_audio ||
 	    o->report_recovered_errors)
 		req |= 2;
@@ -295,7 +295,7 @@ printf("reading %d from %d\n", len, star
 /* always read the subcode, throw it away later, since we don't know
    what we're really reading
 */
-	if (d->busy == LIBBURN_BUSY_GRABBING || (o->subcodes_audio)
+	if (d->busy == BURN_DRIVE_GRABBING || (o->subcodes_audio)
 	    || (o->subcodes_data))
 		c.opcode[10] = 1;
 
Index: libburn/read.c
===================================================================
RCS file: /cvs/burn/burn/libburn/read.c,v
retrieving revision 1.9
diff -p -u -r1.9 read.c
--- libburn/read.c	2 Dec 2003 03:04:16 -0000	1.9
+++ libburn/read.c	8 Dec 2003 22:19:29 -0000
@@ -50,7 +50,7 @@ drive, or only store a subset of the _op
 	d->send_parameters(d, o);
 
 	d->cancel = 0;
-	d->busy = LIBBURN_BUSY_READING;
+	d->busy = BURN_DRIVE_READING;
 	d->currsession = 0;
 /*	drive_lba = 232000;
 	d->currtrack = 18;
@@ -88,7 +88,7 @@ printf("track ends at %d\n", d->track_en
 
 		if ((d->cancel) || (drive_lba == LAST_SESSION_END(d))) {
 			libburn_print(1, "finished or cancelled\n");
-			d->busy = LIBBURN_BUSY_NO;
+			d->busy = BURN_DRIVE_IDLE;
 			if (!d->cancel)
 				d->toc->complete = 1;
 			return;
Index: libburn/sg.c
===================================================================
RCS file: /cvs/burn/burn/libburn/sg.c,v
retrieving revision 1.107
diff -p -u -r1.107 sg.c
--- libburn/sg.c	5 Dec 2003 02:50:51 -0000	1.107
+++ libburn/sg.c	8 Dec 2003 22:19:31 -0000
@@ -105,7 +105,7 @@ static void enumerate_common(char *fname
 	out.issue_command = sg_issue_command;
 	out.getcaps = spc_getcaps;
 	out.released = 1;
-	out.status = LIBBURN_STATUS_UNREADY;
+	out.status = BURN_DISC_UNREADY;
 
 	out.eject = sbc_eject;
 	out.load = sbc_load;
@@ -302,7 +302,7 @@ enum response scsi_error(struct drive *d
 		libburn_print(12, "Medium not present in %s %s\n",
 			      d->idata->vendor, d->idata->product);
 
-		d->status = LIBBURN_STATUS_NO_DISC;
+		d->status = BURN_DISC_EMPTY;
 		return FAIL;
 	}
 	libburn_print(1, "unknown failure\n");
Index: libburn/transport.h
===================================================================
RCS file: /cvs/burn/burn/libburn/transport.h,v
retrieving revision 1.89
diff -p -u -r1.89 transport.h
--- libburn/transport.h	7 Dec 2003 03:38:15 -0000	1.89
+++ libburn/transport.h	8 Dec 2003 22:19:33 -0000
@@ -91,7 +91,7 @@ unsigned char mediacatalog[13];
 	char *devname;
 	int fd;
 
-	enum libburn_drive_status status;
+	enum burn_disc_status status;
 	volatile int released;
 	int nwa;  /* next writeable address */
 	int alba; /* absolute lba */
Index: libburn/write.c
===================================================================
RCS file: /cvs/burn/burn/libburn/write.c,v
retrieving revision 1.27
diff -p -u -r1.27 write.c
--- libburn/write.c	8 Dec 2003 20:18:27 -0000	1.27
+++ libburn/write.c	8 Dec 2003 22:19:34 -0000
@@ -176,7 +176,7 @@ void libburn_write_leadin(struct drive *
                           int first)
 {
 	int count;
-	d->busy = LIBBURN_BUSY_WRITING_LEADIN;
+	d->busy = BURN_DRIVE_WRITING_LEADIN;
 
 	printf(first?"    first leadin\n":"    leadin\n");
 
@@ -191,7 +191,7 @@ void libburn_write_leadin(struct drive *
 		sector_toc(d, s->track[0]->mode);
 		count--;
 	}
-	d->busy = LIBBURN_BUSY_WRITING;
+	d->busy = BURN_DRIVE_WRITING;
 }
 
 void libburn_write_leadout(struct drive *d, const struct libburn_write_opts *o,
@@ -199,7 +199,7 @@ void libburn_write_leadout(struct drive 
                            int mode)
 {
 	int count;
-	d->busy = LIBBURN_BUSY_WRITING_LEADOUT;
+	d->busy = BURN_DRIVE_WRITING_LEADOUT;
 /* XXX pass the lead out mode? */
 	d->rlba = -150;
 	printf(first?"    first leadout\n":"    leadout\n");
@@ -211,7 +211,7 @@ void libburn_write_leadout(struct drive 
 		sector_lout(d, control, mode);
 		count--;
 	}
-	d->busy = LIBBURN_BUSY_WRITING;
+	d->busy = BURN_DRIVE_WRITING;
 }
 
 void libburn_write_session(struct drive *d, const struct libburn_write_opts *o,
@@ -338,7 +338,7 @@ void libburn_write_disc_sync(struct driv
 	d->progress.current_sector = 0;
 
 /*libburn_create_cue_sheet(d, disc->session[0]);*/
-	d->busy = LIBBURN_BUSY_WRITING;
+	d->busy = BURN_DRIVE_WRITING;
 
 	d->send_write_parameters(d, o);
 	for (i = 0; i < disc->sessions; i++) {
@@ -363,5 +363,5 @@ void libburn_write_disc_sync(struct driv
 	sleep(1);
 
 	printf("done\n");
-	d->busy = LIBBURN_BUSY_NO;
+	d->busy = BURN_DRIVE_IDLE;
 }
Index: test/blank.c
===================================================================
RCS file: /cvs/burn/burn/test/blank.c,v
retrieving revision 1.15
diff -p -u -r1.15 blank.c
--- test/blank.c	7 Dec 2003 03:40:04 -0000	1.15
+++ test/blank.c	8 Dec 2003 22:19:34 -0000
@@ -13,7 +13,7 @@ static unsigned int n_drives;
 
 static void blank_disc(struct drive *drive)
 {
-	enum libburn_drive_status s;
+	enum burn_disc_status s;
 	struct libburn_progress p;
 
 	if (libburn_drive_grab(drive, 1) != LIBBURN_GRAB_OK) {
@@ -21,14 +21,14 @@ static void blank_disc(struct drive *dri
 		return;
 	}
 
-	while (libburn_drive_get_progress(drive, NULL)) {
+	while (burn_get_drive_status(drive, NULL)) {
 		usleep(1000);
 	}
 
-	while ((s = libburn_drive_get_status(drive)) == LIBBURN_STATUS_UNREADY)
+	while ((s = burn_get_disc_status(drive)) == BURN_DISC_UNREADY)
 		usleep(1000);
 	printf("%d\n", s);
-	if (s != LIBBURN_STATUS_FULL) {
+	if (s != BURN_DISC_FULL) {
 		libburn_drive_release(drive, 0);
 		fprintf(stderr, "No disc found!\n");
 		return;
@@ -37,7 +37,7 @@ static void blank_disc(struct drive *dri
 	fprintf(stderr, "Blanking disc...");
 	libburn_erase_disc(drive, 1);
 
-	while (libburn_drive_get_progress(drive, &p)) {
+	while (burn_get_drive_status(drive, &p)) {
 		printf("%d\n", p.current_sector);
 		usleep(1000);
 	}
Index: test/burniso.c
===================================================================
RCS file: /cvs/burn/burn/test/burniso.c,v
retrieving revision 1.38
diff -p -u -r1.38 burniso.c
--- test/burniso.c	8 Dec 2003 20:18:27 -0000	1.38
+++ test/burniso.c	8 Dec 2003 22:19:35 -0000
@@ -20,7 +20,7 @@ void burn_iso(struct drive *drive, const
 	struct disc *disc;
 	struct session *session;
 	struct libburn_write_opts *o;
-	enum libburn_drive_status s;
+	enum burn_disc_status s;
 	struct track *tr;
 	struct libburn_progress p;
 
@@ -43,13 +43,13 @@ void burn_iso(struct drive *drive, const
 		printf("Unable to open the drive!\n");
 		return;
 	}
-	while (libburn_drive_get_progress(drive, NULL))
+	while (burn_get_drive_status(drive, NULL))
 		usleep(1000);
 
-	while ((s = libburn_drive_get_status(drive)) == LIBBURN_STATUS_UNREADY)
+	while ((s = burn_get_disc_status(drive)) == BURN_DISC_UNREADY)
 		usleep(1000);
 
-	if (s != LIBBURN_STATUS_BLANK) {
+	if (s != BURN_DISC_BLANK) {
 		libburn_drive_release(drive, 0);
 		printf("put a blank in the drive, corky\n");
 		return;
@@ -65,7 +65,7 @@ void burn_iso(struct drive *drive, const
 	libburn_write_disc(drive, disc, o);
 	libburn_write_opts_free(o);
 
-	while (libburn_drive_get_progress(drive, &p)) {
+	while (burn_get_drive_status(drive, &p)) {
 		printf("S: %d/%d ", p.session, p.sessions);
 		printf("T: %d/%d ", p.track, p.tracks);
 		printf("L: %d: %d/%d\n", p.start_sector, p.current_sector, p.sectors);
Index: test/master.c
===================================================================
RCS file: /cvs/burn/burn/test/master.c,v
retrieving revision 1.11
diff -p -u -r1.11 master.c
--- test/master.c	4 Dec 2003 23:58:57 -0000	1.11
+++ test/master.c	8 Dec 2003 22:19:35 -0000
@@ -16,19 +16,19 @@ static unsigned int n_drives;
 void burn_files(struct drive *drive, struct disc *disc)
 {
 	struct libburn_write_opts *o;
-	enum libburn_drive_status s;
+	enum burn_disc_status s;
 
 	if (libburn_drive_grab(drive, 1) != LIBBURN_GRAB_OK) {
 		printf("Unable to open the drive!\n");
 		return;
 	}
-	while (libburn_drive_get_progress(drive, NULL))
+	while (burn_get_drive_status(drive, NULL))
 		usleep(1000);
 
-	while ((s = libburn_drive_get_status(drive)) == LIBBURN_STATUS_UNREADY)
+	while ((s = burn_get_disc_status(drive)) == BURN_DISC_UNREADY)
 		usleep(1000);
 
-	if (s != LIBBURN_STATUS_BLANK) {
+	if (s != BURN_DISC_BLANK) {
 		libburn_drive_release(drive, 0);
 		printf("put a blank in the drive, corky\n");
 		return;
@@ -43,7 +43,7 @@ void burn_files(struct drive *drive, str
 	libburn_write_disc(drive, disc, o);
 	libburn_write_opts_free(o);
 
-	while (libburn_drive_get_progress(drive, NULL)) {
+	while (burn_get_drive_status(drive, NULL)) {
 		sleep(1);
 	}
 	printf("\n");
Index: test/poll.c
===================================================================
RCS file: /cvs/burn/burn/test/poll.c,v
retrieving revision 1.5
diff -p -u -r1.5 poll.c
--- test/poll.c	4 Dec 2003 23:47:53 -0000	1.5
+++ test/poll.c	8 Dec 2003 22:19:35 -0000
@@ -13,7 +13,7 @@ static unsigned int n_drives;
 
 static void poll_drive(int d)
 {
-	enum libburn_drive_status s;
+	enum burn_disc_status s;
 
 	fprintf(stderr, "polling disc in %s - %s:\n",
 		drives[d].vendor, drives[d].product);
@@ -23,11 +23,11 @@ static void poll_drive(int d)
 		return;
 	}
 
-	while (libburn_drive_get_progress(drives[d].drive, NULL))
+	while (burn_get_drive_status(drives[d].drive, NULL))
 		usleep(1000);
 
-	while ((s = libburn_drive_get_status(drives[d].drive))
-	       == LIBBURN_STATUS_UNREADY)
+	while ((s = burn_get_disc_status(drives[d].drive))
+	       == BURN_DISC_UNREADY)
 		usleep(1000);
 
 	while (1) {
Index: test/rip.c
===================================================================
RCS file: /cvs/burn/burn/test/rip.c,v
retrieving revision 1.8
diff -p -u -r1.8 rip.c
--- test/rip.c	7 Dec 2003 03:45:21 -0000	1.8
+++ test/rip.c	8 Dec 2003 22:19:35 -0000
@@ -41,7 +41,7 @@ int main()
 		return EXIT_FAILURE;
 	}
 
-	while (libburn_drive_get_progress(drive, NULL))
+	while (burn_get_drive_status(drive, NULL))
 		usleep(1000);
 
 
Index: test/toc.c
===================================================================
RCS file: /cvs/burn/burn/test/toc.c,v
retrieving revision 1.21
diff -p -u -r1.21 toc.c
--- test/toc.c	4 Dec 2003 23:47:53 -0000	1.21
+++ test/toc.c	8 Dec 2003 22:19:36 -0000
@@ -17,7 +17,7 @@ static void show_tocs()
 	struct disc *disc;
 	unsigned int i, j, k;
 	struct toc_entry *e;
-	enum libburn_drive_status s;
+	enum burn_disc_status s;
 
 	for (i = 0; i < n_drives; ++i) {
 		fprintf(stderr, "TOC for disc in %s - %s:\n",
@@ -28,13 +28,13 @@ static void show_tocs()
 			continue;
 		}
 
-		while (libburn_drive_get_progress(drives[i].drive, NULL))
+		while (burn_get_drive_status(drives[i].drive, NULL))
 			usleep(1000);
 
-		while ((s = libburn_drive_get_status(drives[i].drive))
-		       == LIBBURN_STATUS_UNREADY)
+		while ((s = burn_get_disc_status(drives[i].drive))
+		       == BURN_DISC_UNREADY)
 			usleep(1000);
-		if (s != LIBBURN_STATUS_FULL) {
+		if (s != BURN_DISC_FULL) {
 			libburn_drive_release(drives[i].drive, 0);
 			fprintf(stderr, "No disc found!\n");
 			continue;

--=-u2k/F2F+VivN3N1hYoH5--