Testing new API functions via --drive stdio:<path>

This commit is contained in:
Thomas Schmitt 2007-09-04 22:51:44 +00:00
parent 1c3a79629c
commit 7b0e98954b
2 changed files with 36 additions and 20 deletions

View File

@ -123,21 +123,28 @@ int libburner_aquire_by_adr(char *drive_adr)
int ret; int ret;
char libburn_drive_adr[BURN_DRIVE_ADR_LEN]; char libburn_drive_adr[BURN_DRIVE_ADR_LEN];
/* This tries to resolve links or alternative device files */ if (strncmp(drive_adr, "stdio:", 6) == 0) {
ret = burn_drive_convert_fs_adr(drive_adr, libburn_drive_adr); fprintf(stderr, "Aquiring standard i/o pseudo-drive '%s'\n",
if (ret<=0) { drive_adr + 6);
fprintf(stderr,"Address does not lead to a CD burner: '%s'\n", ret = burn_drive_grab_dummy(&drive_list, drive_adr + 6);
drive_adr); } else {
return ret; /* This tries to resolve links or alternative device files */
ret = burn_drive_convert_fs_adr(drive_adr, libburn_drive_adr);
if (ret<=0) {
fprintf(stderr,
"Address does not lead to a CD burner: '%s'\n",
drive_adr);
return 0;
}
fprintf(stderr,"Aquiring drive '%s' ...\n", libburn_drive_adr);
ret = burn_drive_scan_and_grab(&drive_list,
libburn_drive_adr, 1);
} }
printf("Aquiring drive '%s' ...\n",libburn_drive_adr);
ret = burn_drive_scan_and_grab(&drive_list,libburn_drive_adr,1);
if (ret <= 0) { if (ret <= 0) {
fprintf(stderr,"FAILURE with persistent drive address '%s'\n", fprintf(stderr,"FAILURE with persistent drive address '%s'\n",
libburn_drive_adr); libburn_drive_adr);
} else { } else {
printf("Done\n"); fprintf(stderr,"Done\n");
drive_is_grabbed = 1; drive_is_grabbed = 1;
} }
return ret; return ret;

View File

@ -108,22 +108,31 @@ int telltoc_aquire_drive(char *drive_adr, int *driveno, int silent_drive)
/** If the persistent drive address is known, then this approach is much /** If the persistent drive address is known, then this approach is much
more un-obtrusive to the systemwide livestock of drives. Only the more un-obtrusive to the systemwide livestock of drives. Only the
given drive device will be opened during this procedure. given drive device will be opened during this procedure.
Special drive addresses stdio:<path> direct output to a hard disk file
which will behave much like a DVD-RAM.
*/ */
int telltoc_aquire_by_adr(char *drive_adr) int telltoc_aquire_by_adr(char *drive_adr)
{ {
int ret; int ret;
char libburn_drive_adr[BURN_DRIVE_ADR_LEN]; char libburn_drive_adr[BURN_DRIVE_ADR_LEN];
/* This tries to resolve links or alternative device files */ if (strncmp(drive_adr, "stdio:", 6) == 0) {
ret = burn_drive_convert_fs_adr(drive_adr, libburn_drive_adr); fprintf(stderr, "Aquiring standard i/o pseudo-drive '%s'\n",
if (ret<=0) { drive_adr + 6);
fprintf(stderr,"Address does not lead to a CD burner: '%s'\n", ret = burn_drive_grab_dummy(&drive_list, drive_adr + 6);
drive_adr); } else {
return ret; /* This tries to resolve links or alternative device files */
ret = burn_drive_convert_fs_adr(drive_adr, libburn_drive_adr);
if (ret<=0) {
fprintf(stderr,
"Address does not lead to a CD burner: '%s'\n",
drive_adr);
return 0;
}
fprintf(stderr,"Aquiring drive '%s' ...\n", libburn_drive_adr);
ret = burn_drive_scan_and_grab(&drive_list,
libburn_drive_adr, 1);
} }
fprintf(stderr,"Aquiring drive '%s' ...\n",libburn_drive_adr);
ret = burn_drive_scan_and_grab(&drive_list,libburn_drive_adr,1);
if (ret <= 0) { if (ret <= 0) {
fprintf(stderr,"FAILURE with persistent drive address '%s'\n", fprintf(stderr,"FAILURE with persistent drive address '%s'\n",
libburn_drive_adr); libburn_drive_adr);
@ -242,7 +251,7 @@ int telltoc_media(struct burn_drive *drive)
printf("Media current: "); printf("Media current: ");
ret = burn_disc_get_profile(drive, &profile_no, profile_name); ret = burn_disc_get_profile(drive, &profile_no, profile_name);
if (profile_no > 0 && ret >0) { if (profile_no >= 0 && ret >0) {
if (profile_name[0]) if (profile_name[0])
printf("%s\n", profile_name); printf("%s\n", profile_name);
else else