10 #include "../config.h"
13 #include <sys/types.h>
95 #ifdef Libburn_do_no_immed_defaulT
113 if (d->
idata != NULL)
114 free((
void *) d->
idata);
116 if (d->
mdata != NULL) {
118 free((
void *) d->
mdata);
253 char *drive_adr = NULL, *off_adr = NULL;
260 strcpy(off_adr, path);
267 if(strcmp(off_adr, drive_adr) == 0) {
341 if (strcmp(adr,
"-") == 0)
343 if(strncmp(adr,
"/dev/fd/", 8) == 0) {
344 for (i = 8; adr[i]; i++)
345 if (!isdigit(adr[i]))
347 if (i> 8 && adr[i] == 0)
357 struct stat *stbuf_ret,
358 off_t *read_size_ret,
int flag)
360 int fd, is_rdwr = 1, ret, getfl_ret, st_ret, mask;
364 memset(&stbuf, 0,
sizeof(
struct stat));
367 st_ret = fstat(fd, &stbuf);
369 st_ret = stat(fname, &stbuf);
373 if (S_ISREG(stbuf.st_mode))
374 read_size = stbuf.st_size;
378 read_size / (off_t) 2048 >= (off_t) 0x7ffffff0)
379 read_size = (off_t) 0x7ffffff0 * (off_t) 2048;
382 if (is_rdwr && fd >= 0) {
383 getfl_ret = fcntl(fd, F_GETFL);
389 mask = O_RDWR | O_WRONLY | O_RDONLY;
391 if (getfl_ret == -1 || (getfl_ret & mask) != O_RDWR)
393 if ((flag & 1) && getfl_ret != -1 &&
394 (getfl_ret & mask) == O_RDONLY)
396 if ((flag & 2) && getfl_ret != -1 &&
397 (getfl_ret & mask) == O_WRONLY)
400 if (stat_ret != NULL)
402 if (stbuf_ret != NULL)
403 memcpy(stbuf_ret, &stbuf,
sizeof(
struct stat));
404 if (read_size_ret != NULL)
405 *read_size_ret = read_size;
414 int stat_ret = -1, is_rdwr, ret;
416 off_t read_size= 0, size= 0;
417 char fd_name[40], *name_pt = NULL;
420 sprintf(fd_name,
"/dev/fd/%d", d->
stdio_fd);
425 if (name_pt != NULL) {
431 read_size / 2048 - !(read_size % 2048);
433 if ((stat_ret == -1 || is_rdwr) && d->
devname[0]) {
451 if (stat_ret != -1 && S_ISREG(stbuf.st_mode) &&
454 if (stbuf.st_size / (off_t) 2048
460 !!(stbuf.st_size % 2048);
476 int ret, sose, signal_action_mem = -1;
483 "Drive is already grabbed by libburn", 0, 0);
492 errcode = d->
grab(d);
538 #define Libburn_ticket_62_re_register_is_possiblE 1
542 #ifdef Libburn_ticket_62_re_register_is_possiblE
568 #ifdef Libburn_ticket_62_re_register_is_possiblE
636 sprintf(msg,
"Unable to grab scanned drive %s", d->
devname);
676 if (d->
disc != NULL) {
700 "Drive is already released", 0, 0);
711 "Drive is busy on attempt to close", 0, 0);
772 int ret, signal_action_mem;
778 "Drive is not grabbed on burn_drive_re_assess()",
827 void burn_wait_all(
void)
853 int ret, was_error = 0;
856 ret = truncate(d->
devname, (off_t) 0);
861 "Cannot truncate disk file for pseudo blanking",
875 #ifdef Libburn_reset_progress_asynC
893 #ifdef Libburn_old_progress_looP
912 if (ret == -2 || ret > 0)
954 int ret, buf_secs, err, i, stages = 1, pbase, pfill, pseudo_sector;
962 #ifdef Libburn_reset_progress_asynC
976 stages = 1 + ((flag & 1) && size > 1024 * 1024);
985 #ifdef Libburn_old_progress_looP
999 if (ret == -2 || ret > 0)
1007 if(pseudo_sector == -2)
1009 if (pseudo_sector == -3)
1011 if (pseudo_sector >= 0)
1028 pbase = 0x8000 + 0x7fff * (stages == 1);
1029 pfill = 0xffff - pbase;
1031 num_bufs = size / buf_secs / 2048;
1032 if (num_bufs > 0x7fffffff) {
1039 "Writing %.f sectors of zeros to formatted media",
1040 (
double) num_bufs * (
double) buf_secs);
1051 for (i = 0; i < num_bufs; i++) {
1052 d->
nwa = i * buf_secs;
1059 + pfill * ((double) i / (
double) num_bufs);
1082 unsigned *bl_sas,
int *num_formats)
1105 int *type, off_t *size,
unsigned *tdp)
1127 "Drive is not grabbed on disc status inquiry",
1155 if (burn_builtin_triggered_action < 2 && burn_global_abort_level > 0)
1157 if (burn_builtin_triggered_action < 2 && burn_global_abort_level > 5) {
1179 int start,
int flag)
1181 #ifndef Libburn_force_stream_recordinG
1187 #ifdef Libburn_force_stream_recordinG
1195 if ((descr->
data[0] & 1) && (descr->
flags & 1))
1202 "Drive currently does not offer Stream Recording",
1211 "Stream Recording suppressed due to medium type",
1217 }
else if (recmode == -1) {
1235 "burn_drive_cancel() was called", 0, 0);
1249 for (tmp = str + len - 1; tmp >= str && (isspace(*tmp) || !*tmp); tmp--)
1252 for (tmp = str; tmp < str + len - 1 && *tmp; tmp++) {
1253 if (isspace(*tmp) && isspace(*(tmp + 1))) {
1254 for (tmp2 = tmp + 1; tmp2 < str + len && *tmp2; tmp2++)
1255 *(tmp2 - 1) = *tmp2;
1309 if (profile == 0x09)
1311 else if (profile == 0x0a)
1313 else if (profile == 0x10)
1315 else if (profile == 0x11)
1317 else if (profile == 0x12)
1322 for (i = 0x002D; i <= 0x002F; i++)
1326 !!(feat->
data[0] & 4);
1331 #ifdef Libburn_dummy_probe_write_modeS
1392 unsigned int *n_drives,
int flag)
1415 unsigned char scanned[32];
1435 for (i = 0; i < (int)
sizeof(scanned); i++)
1442 scanned[i / 8] |= (1 << (i % 8));
1454 *drives = calloc(count + 1,
1456 if (*drives == NULL) {
1460 "Out of virtual memory", 0, 0);
1463 for (i = 0; i <= (int) count; i++)
1464 (*drives)[i].drive = NULL;
1468 for (i = 0; i < (int) count; ++i) {
1469 if (scanned[i / 8] & (1 << (i % 8)))
1484 scanned[i / 8] |= 1 << (i % 8);
1486 if (*drives != NULL && *n_drives == 0) {
1487 free ((
char *) *drives);
1530 #ifndef Libburn_free_all_drives_on_infO
1537 if(drive_infos == NULL)
1540 #ifndef Libburn_free_all_drives_on_infO
1547 for (i = 0; drive_infos[i].
drive != NULL; i++)
1549 && new_drivetop >= 0) {
1556 for (i = 0; drive_infos[i].
drive != NULL; i++)
1569 free((
void *) drive_infos);
1571 #ifdef Libburn_free_all_drives_on_infO
1623 int min_usec,
int max_usec,
int timeout_sec,
1624 int min_percent,
int max_percent)
1633 if (timeout_sec >= 0)
1635 if (min_percent >= 0) {
1636 if (min_percent < 25 || min_percent > 100)
1640 if (max_percent >= 0) {
1641 if (max_percent < 25 || max_percent > 100)
1655 "Drive is busy on attempt to write random access",0,0);
1665 return (m * 60 + s) * 75 + f;
1670 *m = sectors / (60 * 75);
1671 *s = (sectors - *m * 60 * 75) / 75;
1672 *f = sectors - *m * 60 * 75 - *s * 75;
1706 new_item = calloc(1, strlen(device_address) + 1);
1707 if (new_item == NULL)
1709 strcpy(new_item, device_address);
1755 #define O_LARGEFILE 0
1783 int ret = -1, role = 0, fd;
1784 int is_rdwr = 0, stat_ret = -1;
1786 off_t size = ((off_t) (512 * 1024 * 1024 - 1) * (off_t) 2048);
1787 off_t read_size = -1;
1791 if (fname[0] != 0) {
1795 if (stat_ret == -1 || is_rdwr) {
1801 "Neither stdio-path nor its directory exist",
1804 }
else if (ret == -2) {
1808 "Failed to open device (a pseudo-drive)",
1812 if (fname[0] != 0) {
1816 else if (is_rdwr == 3 &&
1821 if (stat_ret != -1 && role == 2 && fd == -1 &&
1842 if (regd_d == NULL) {
1858 S_ISREG(stbuf.st_mode) && stbuf.st_size > 0 &&
1862 if (stbuf.st_size / (off_t) 2048
1868 !!(stbuf.st_size % 2048);
1881 if (read_size >= 0) {
1884 read_size / 2048 - !(read_size % 2048);
1892 if (*drive_infos == NULL)
1894 (*drive_infos)[0].drive = d;
1895 (*drive_infos)[1].drive = NULL;
1899 strcpy((*drive_infos)[0].vendor,
"YOYODYNE");
1900 strcpy((*drive_infos)[0].product,
"WARP DRIVE");
1901 strcpy((*drive_infos)[0].revision,
"FX01");
1903 strcpy((*drive_infos)[0].vendor,
"YOYODYNE");
1904 strcpy((*drive_infos)[0].product,
"BLACKHOLE");
1905 strcpy((*drive_infos)[0].revision,
"FX02");
1907 strcpy((*drive_infos)[0].vendor,
"YOYODYNE");
1908 strcpy((*drive_infos)[0].product,
"WARP DRIVE");
1909 strcpy((*drive_infos)[0].revision,
"FX03");
1911 strcpy((*drive_infos)[0].vendor,
"YOYODYNE");
1912 strcpy((*drive_infos)[0].product,
"WARP DRIVE");
1913 strcpy((*drive_infos)[0].revision,
"FX04");
1915 strcpy((*drive_infos)[0].vendor,
"FERENGI");
1916 strcpy((*drive_infos)[0].product,
"VAPORWARE");
1917 strcpy((*drive_infos)[0].revision,
"0000");
1922 if (ret <= 0 && d != NULL) {
1936 unsigned int n_drives;
1948 "Drive is already registered resp. scanned",
1953 if (strncmp(adr,
"stdio:", 6) == 0) {
1996 char *msg = NULL, *msgpt;
2003 sprintf(msg, fmt, arg);
2023 "Persistent drive address too long", 0, 0);
2050 #define BURN_DRIVE_MAX_LINK_DEPTH 20
2060 int ret, link_target_size = 4096;
2061 char *link_target = NULL, *msg = NULL, *link_adr = NULL, *adrpt;
2074 "burn_drive_resolve_link aborts because link too deep",
2078 (*recursion_count)++;
2079 ret = readlink(path, link_target, link_target_size);
2086 if (ret >= link_target_size - 1) {
2087 sprintf(msg,
"readlink( %s ) returns %d (too much)", path, ret);
2090 {ret = -1;
goto ex;}
2092 link_target[ret] = 0;
2093 adrpt = link_target;
2094 if (link_target[0] !=
'/') {
2095 strcpy(link_adr, path);
2096 if ((adrpt = strrchr(link_adr,
'/')) != NULL) {
2097 strcpy(adrpt + 1, link_target);
2100 adrpt = link_target;
2104 if (lstat(adrpt, &stbuf) == -1) {
2106 }
else if((stbuf.st_mode & S_IFMT) == S_IFLNK) {
2108 recursion_count, flag);
2116 sprintf(msg,
"burn_drive_convert_fs_adr( %s ) returns %d",
2132 char *fname = NULL, *msg = NULL;
2133 int ret = 0, first = 1, fname_size = 4096;
2145 ret = stat(fname, &stbuf);
2148 if(devno != stbuf.st_rdev)
2153 sprintf(msg,
"burn_drive_find_devno( 0x%lX ) found %s",
2154 (
long) devno, fname);
2157 { ret = 1;
goto ex;}
2173 int *bus_no,
int *host_no,
int *channel_no,
2174 int *target_no,
int *lun_no)
2182 for (i = 0; i <
drivetop + 1; i++) {
2190 if (strcmp(adr, path) == 0) {
2196 if (*host_no < 0 || *channel_no < 0 ||
2197 *target_no < 0 || *lun_no < 0)
2212 int target_no,
int lun_no,
char adr[])
2214 char *fname = NULL, *msg = NULL;
2215 int ret = 0, first = 1, i_bus_no = -1, fname_size = 4096;
2216 int i_host_no = -1, i_channel_no = -1, i_target_no = -1, i_lun_no = -1;
2222 sprintf(msg,
"burn_drive_convert_scsi_adr( %d,%d,%d,%d,%d )",
2223 bus_no, host_no, channel_no, target_no, lun_no);
2232 &i_channel_no, &i_target_no, &i_lun_no);
2235 if(bus_no >=0 && i_bus_no != bus_no)
2237 if(host_no >=0 && i_host_no != host_no)
2239 if(channel_no >= 0 && i_channel_no != channel_no)
2241 if(target_no >= 0 && i_target_no != target_no)
2243 if(lun_no >= 0 && i_lun_no != lun_no)
2246 { ret = -1;
goto ex;}
2248 "burn_drive_convert_scsi_adr() found %s", fname);
2250 { ret = 1;
goto ex;}
2267 int bus_no, host_no, channel_no, target_no, lun_no;
2271 &target_no, &lun_no);
2273 sprintf(msg,
"burn_drive_obtain_scsi_adr( %s ) returns %d",
2278 sprintf(msg,
"burn_drive_find_scsi_equiv( %s ) : (%d),%d,%d,%d,%d",
2279 path, bus_no, host_no, channel_no, target_no, lun_no);
2297 if (strncmp(path,
"stdio:", 6) == 0 ||
2301 if (strncmp(path,
"stdio:", 6) != 0)
2303 "burn_drive_is_enumerable_adr( %s ) is true", path);
2308 if(lstat(path, &stbuf) == -1) {
2312 if((stbuf.st_mode & S_IFMT) == S_IFLNK) {
2317 if(stat(path, &stbuf) == -1) {
2322 if((stbuf.st_mode&S_IFMT) == S_IFBLK ||
2323 (stbuf.st_mode&S_IFMT) == S_IFCHR) {
2340 int ret, rec_count = 0;
2349 char *dir_adr,
char **ranks,
int rank_count,
int flag)
2352 struct dirent *entry;
2353 struct stat link_stbuf;
2354 char *adr= NULL, *namept, *sys_adr= NULL;
2355 int ret, name_rank, found_rank= 0x7fffffff, dirlen, i, rec_count = 0;
2356 static char default_ranks_data[][8] =
2357 {
"dvdrw",
"cdrw",
"dvd",
"cdrom",
"cd"};
2358 char *default_ranks[5];
2361 if (ranks == NULL) {
2362 for (i = 0; i < 5; i++)
2363 default_ranks[i] = default_ranks_data[i];
2364 ranks = default_ranks;
2367 dirlen= strlen(dir_adr) + 1;
2377 dirpt = opendir(dir_adr);
2380 strcpy(adr, dir_adr);
2382 namept = adr + strlen(dir_adr) + 1;
2384 entry = readdir(dirpt);
2389 strcpy(namept, entry->d_name);
2390 if(lstat(adr, &link_stbuf) == -1)
2392 if((link_stbuf.st_mode & S_IFMT) != S_IFLNK)
2395 for(name_rank= 0; name_rank < rank_count; name_rank++)
2396 if(strncmp(namept, ranks[name_rank],
2397 strlen(ranks[name_rank])) == 0)
2400 if(name_rank >= rank_count ||
2401 name_rank > found_rank ||
2402 (name_rank == found_rank &&
2403 strcmp(namept, link_adr + dirlen) >= 0))
2412 if(strcmp(dev_adr, sys_adr) == 0) {
2413 strcpy(link_adr, adr);
2414 found_rank= name_rank;
2418 if(found_rank < 0x7fffffff)
2434 char *prefix=
"libburn : ";
2439 "\r%sABORT : Waiting for drive to finish ( %d s, %d max)",
2440 (
char *) prefix, elapsed, patience);
2449 int (*pacifier_func)(
void *handle,
int patience,
int elapsed),
2450 void *handle,
int elapsed,
int flag)
2452 int ret, i, occup, still_not_done= 1, pacifier_off= 0, first_round= 1;
2453 unsigned long wait_grain= 100000;
2454 time_t start_time, current_time, pacifier_time, end_time;
2457 time_t stdio_patience = 3;
2466 current_time = start_time = pacifier_time = time(0);
2467 start_time -= elapsed;
2468 end_time = start_time + patience;
2475 while(current_time < end_time || (patience <= 0 && first_round)) {
2478 for(i = 0; i <
drivetop + 1; i++) {
2503 if (current_time - start_time >
2520 }
else if(occup <= 100) {
2524 }
else if(occup <= 1000) {
2530 if(still_not_done == 0 || patience <= 0)
2533 current_time = time(0);
2534 if(current_time>pacifier_time) {
2535 if(pacifier_func != NULL && !pacifier_off) {
2536 ret = (*pacifier_func)(handle, patience,
2537 current_time-start_time);
2538 pacifier_off = (ret <= 0);
2540 pacifier_time = current_time;
2545 return(still_not_done == 0);
2558 int (*pacifier_func)(
void *handle,
int patience,
int elapsed),
2567 ret =
burn_abort_5(patience, pacifier_func, handle, 0, flg);
2574 int *start_lba,
int *end_lba,
int flag)
2622 "Attempt to read ATIP from ungrabbed drive",
2646 int trackno,
int *lba,
int *nwa)
2654 "Attempt to read track info from ungrabbed drive",
2662 "Attempt to read track info from busy drive",
2676 ret = d->
get_nwa(d, trackno, lba, nwa);
2690 "Attempt to read track info from ungrabbed drive",
2698 "Attempt to read track info from busy drive",
2715 off_t bytes, start_byte = 0;
2730 bytes = (off_t) (512 * 1024 * 1024 - 1) * (off_t) 2048;
2736 d->
get_nwa(d, -1, &lba, &nwa);
2760 int profiles[64],
char is_current[64])
2778 return(name[0] != 0);
2830 for (o = (*s); o->
prev != NULL; o = o->
prev);
2836 if (o->
prev != NULL)
2838 free((
char *) (*s));
2878 (*speed_list) = NULL;
2885 (*speed_list) = csd;
2886 return (csd != NULL);
2895 int best_speed = 0, best_lba = 0,
source= 2, speed;
2900 best_speed = 2000000000;
2910 if (speed_goal < 0) {
2911 if (speed < best_speed) {
2915 }
else if (speed_goal == 0) {
2918 speed > best_speed)) {
2923 }
else if (speed <= speed_goal) {
2924 if (speed > best_speed) {
2935 return (*best_descr != NULL);
2952 int status, num_formats, ret, type, i;
3055 #ifndef Libburn_dvd_r_dl_multi_no_close_sessioN
3082 for (i = 0; i < num_formats; i++) {
3084 &type, &size, &dummy);
3090 if (i >= num_formats)
3133 free((
char *) *caps);
3148 int i, j,
mode, unknown_track_sizes = 0, last_track_is_unknown = 0;
3160 for (i = 0; i < disc->
sessions; i++) {
3162 if (session->
tracks <= 0)
3167 for (j = 0; j < session->
tracks; j++) {
3168 track = session->
track[j];
3175 unknown_track_sizes++;
3176 last_track_is_unknown = 1;
3178 last_track_is_unknown = 0;
3195 if (unknown_track_sizes == 1 && last_track_is_unknown)
3216 *npt = strrchr(*dpt,
'/');
3233 struct stat stbuf1, stbuf2;
3234 char *adr1 = NULL, *adr2 = adr2_in;
3235 char *conv_adr1 = NULL, *conv_adr2 = NULL;
3236 char *npt1, *dpt1, *npt2, *dpt2;
3237 int role1, stat_ret1, stat_ret2, conv_ret2, exact_role_matters = 0, fd;
3246 stat_ret1 = stat(adr1, &stbuf1);
3254 exact_role_matters = 1;
3255 if (strncmp(adr2,
"stdio:", 6) == 0) {
3262 exact_role_matters = 1;
3281 {ret = -1;
goto ex;}
3282 stat_ret2 = stat(adr2, &stbuf2);
3285 if (!exact_role_matters) {
3294 if (strcmp(adr1, adr2) == 0 && role1 == role2)
3296 if (role1 == 1 && role2 == 1) {
3300 if (strcmp(adr1, conv_adr2) == 0)
3304 }
else if (role1 == 0 || role2 == 0)
3307 else if (role1 != 1 && role2 != 1) {
3312 if (stat_ret1 == -1 || stat_ret2 == -1) {
3313 if (stat_ret1 != -1 || stat_ret2 != -1)
3319 strcpy(conv_adr1, adr1);
3321 strcpy(conv_adr2, adr2);
3323 if (strcmp(npt1, npt2))
3325 stat_ret1= stat(adr1, &stbuf1);
3326 stat_ret2= stat(adr2, &stbuf2);
3327 if (stat_ret1 != stat_ret2)
3335 if (stbuf1.st_ino == stbuf2.st_ino &&
3336 stbuf1.st_dev == stbuf2.st_dev)
3339 if (S_ISBLK(stbuf1.st_mode) && S_ISBLK(stbuf2.st_mode) &&
3340 stbuf1.st_rdev == stbuf2.st_rdev)
3342 if (S_ISCHR(stbuf1.st_mode) && S_ISCHR(stbuf2.st_mode) &&
3343 stbuf1.st_rdev == stbuf2.st_rdev)
3351 if (strcmp(conv_adr1, conv_adr2) == 0)
3356 }
else if (role1 == 1 && role2 != 1) {
3361 if (strcmp(adr1, conv_adr2) == 0)
3365 }
else if (role1 != 1 && role2 == 1) {
3372 if (strcmp(conv_adr1, conv_adr2) == 0)
3391 for (i = 0; i <
drivetop + 1; i++) {
3413 if (value / (off_t) 2048 > (off_t) 0x7ffffff0)
3414 value = ((off_t) 0x7ffffff0) * (off_t) 2048;
3431 char **product_id,
char **media_code1,
char **media_code2,
3432 char **book_type,
int flag)
3436 *product_id = *media_code1 = *media_code2 = *book_type = NULL;
3440 product_id, media_code1, media_code2, book_type,
3460 unsigned int *disc_id,
char bar_code[9],
int *app_code,
3464 strcpy(disc_type,
"CD-DA or CD-ROM");
3466 strcpy(disc_type,
"CD-I");
3468 strcpy(disc_type,
"CD-ROM XA");
3470 strcpy(disc_type,
"undefined");
3483 int *alloc_blocks,
int *free_blocks,
int flag)
3489 *alloc_blocks = *free_blocks = 0;
3497 char **book_name,
int *part_version,
int *num_layers,
3498 int *num_blocks,
int flag)
3504 *disk_category = *part_version = *num_layers = *num_blocks = 0;
3506 part_version, num_layers, num_blocks, 0);
3523 unsigned char **text_packs,
int *num_packs,
3544 unsigned char *descr,
int descr_len,
int flag)
3555 o->
flags = descr[2];
3556 if (descr[3] > descr_len - 4)
3564 if (o->
data == NULL) {
3581 for (o = *descr; o != NULL; o =
next) {
3583 if (o->
data != NULL)
3623 (*sno)[*sno_len] = 0;
3635 #ifdef Libburn_enable_scsi_cmd_ABh
3645 #ifdef Libburn_enable_scsi_cmd_ABh
3649 #ifndef Libburn_enable_scsi_cmd_ABh_pretend_currenT
3650 if (feat->
flags & 1)
3653 spc_read_media_serial_number(d);
3669 (*sno)[*sno_len] = 0;
3682 if (feature->
flags & 1)
3703 unsigned char *
flags,
3704 unsigned char *additional_length,
3705 unsigned char **feature_data,
3706 char **feature_text)
3712 *additional_length = 0;
3713 *feature_data = NULL;
3714 if (feature_text != NULL)
3715 *feature_text = NULL;
3720 if (*additional_length > 0)
3722 *additional_length);
3723 for (i = 0; i < *additional_length; i++)
3724 (*feature_data)[i] = descr->
data[i];
3726 if (feature_text != NULL) {
3728 *additional_length, *feature_data,
3740 int *count,
unsigned int **feature_codes)
3746 *feature_codes = NULL;
int burn_drive_get_all_profiles(struct burn_drive *d, int *num_profiles, int profiles[64], char is_current[64])
int burn_drive_inquire_media(struct burn_drive *d)
int burn_drive_unregister(struct burn_drive *d)
int burn_drive_adr_debug_msg(char *fmt, char *arg)
void burn_disc_format_sync(struct burn_drive *d, off_t size, int flag)
int burn_drive_get_min_write_speed(struct burn_drive *d)
int burn_feature_descr_free(struct burn_feature_descr **descr, int flag)
int burn_drive_mark_unready(struct burn_drive *d, int flag)
int burn_drive_is_released(struct burn_drive *d)
static int enumeration_whitelist_top
int burn_drive_grab_stdio(struct burn_drive *d, int flag)
int burn_disc_get_profile(struct burn_drive *d, int *pno, char name[80])
int burn_disc_read_atip(struct burn_drive *d)
struct burn_drive * burn_drive_register(struct burn_drive *d)
int burn_drive_leave_locked(struct burn_drive *d, int flag)
int burn_drive_convert_fs_adr(char *path, char adr[])
int burn_drive_get_adr(struct burn_drive_info *drive_info, char adr[])
int burn_drive_reset_simulate(struct burn_drive *d, int simulate)
int burn_disc_get_phys_format_info(struct burn_drive *d, int *disk_category, char **book_name, int *part_version, int *num_layers, int *num_blocks, int flag)
int burn_drive_send_default_page_05(struct burn_drive *d, int flag)
void burn_drive_release(struct burn_drive *d, int le)
int burn_drive_snooze(struct burn_drive *d, int flag)
int burn_disc_get_leadin_text(struct burn_drive *d, unsigned char **text_packs, int *num_packs, int flag)
int burn_drive_is_occupied(struct burn_drive *d)
int burn_drive_whitelist_count(void)
int burn_disc_pretend_full(struct burn_drive *d)
int burn_disc_get_multi_caps(struct burn_drive *d, enum burn_write_types wt, struct burn_multi_caps **caps, int flag)
int burn_drive_forget(struct burn_drive *d, int force)
int burn_speed_descriptor_destroy(struct burn_speed_descriptor **s, int flag)
static int drive_getcaps(struct burn_drive *d, struct burn_drive_info *out)
int burn_drive_resolve_link(char *path, char adr[], int *recursion_count, int flag)
void burn_drive_get_feature_codes(struct burn_drive *d, int *count, unsigned int **feature_codes)
static int burn__split_path(char *adr, char **dpt, char **npt)
int burn_disc_get_cd_info(struct burn_drive *d, char disc_type[80], unsigned int *disc_id, char bar_code[9], int *app_code, int *valid)
int burn_drive_force_idle(struct burn_drive *d)
int burn_drive_is_banned(char *device_address)
int burn_drive_obtain_scsi_adr(char *path, int *bus_no, int *host_no, int *channel_no, int *target_no, int *lun_no)
int burn_drive_find_by_thread_pid(struct burn_drive **d, pid_t pid, pthread_t tid)
int burn_drive_is_open(struct burn_drive *d)
int burn_disc_get_formats(struct burn_drive *d, int *status, off_t *size, unsigned *bl_sas, int *num_formats)
int burn_drive_d_get_adr(struct burn_drive *d, char adr[])
int burn_drive_get_bd_r_pow(struct burn_drive *d)
int burn_drive_convert_scsi_adr(int bus_no, int host_no, int channel_no, int target_no, int lun_no, char adr[])
int burn_disc_get_bd_spare_info(struct burn_drive *d, int *alloc_blocks, int *free_blocks, int flag)
int burn_drive_free_speedlist(struct burn_speed_descriptor **speed_list)
struct libdax_msgs * libdax_messenger
int burn_drive_release_fl(struct burn_drive *d, int flag)
void burn_drive_free_subs(struct burn_drive *d)
static struct burn_drive drive_array[255]
int burn_drive_scan_sync(struct burn_drive_info *drives[], unsigned int *n_drives, int flag)
char * burn_drive_whitelist_item(int idx, int flag)
int burn_drive_is_listed(char *path, struct burn_drive **found, int flag)
int burn_msf_to_sectors(int m, int s, int f)
int burn_drive_convert_fs_adr_sub(char *path, char adr[], int *rec_count)
struct burn_drive * burn_drive_finish_enum(struct burn_drive *d)
int burn_drive_was_feat21_failure(struct burn_drive *d)
int burn_drive_equals_adr(struct burn_drive *d1, char *adr2_in, int role2)
int burn_disc_pretend_blank(struct burn_drive *d)
static void strip_spaces(char *str, size_t len)
static int burn_drive__is_rdwr(char *fname, int *stat_ret, struct stat *stbuf_ret, off_t *read_size_ret, int flag)
int burn_setup_drive(struct burn_drive *d, char *fname)
int burn_drive_grab_dummy(struct burn_drive_info *drive_infos[], char *fname)
int burn_drive_find_scsi_equiv(char *path, char adr[])
int burn_disc_erasable(struct burn_drive *d)
int burn_drive_get_media_sno(struct burn_drive *d, char **sno, int *sno_len)
enum burn_drive_status burn_drive_get_status(struct burn_drive *d, struct burn_progress *p)
int burn_drive_set_stream_recording(struct burn_drive *d, int recmode, int start, int flag)
int burn_drive_wrote_well(struct burn_drive *d)
int burn_drive_add_whitelist(char *device_address)
off_t burn_disc_available_space(struct burn_drive *d, struct burn_write_opts *o)
int burn_disc_get_format_descr(struct burn_drive *d, int index, int *type, off_t *size, unsigned *tdp)
int burn_drive_info_forget(struct burn_drive_info *info, int force)
int burn_drive_get_speedlist(struct burn_drive *d, struct burn_speed_descriptor **speed_list)
#define BURN_DRIVE_MAX_LINK_DEPTH
int burn_disc_pretend_full_uncond(struct burn_drive *d)
int burn_drive_set_immed(struct burn_drive *drive, int enable)
int burn_abort(int patience, int(*pacifier_func)(void *handle, int patience, int elapsed), void *handle)
int burn_drive_get_drive_role(struct burn_drive *d)
void burn_drive_cancel(struct burn_drive *d)
unsigned int burn_drive_count(void)
enum burn_disc_status burn_disc_get_status(struct burn_drive *d)
int burn_disc_free_multi_caps(struct burn_multi_caps **caps)
int burn_speed_descriptor_copy(struct burn_speed_descriptor *from, struct burn_speed_descriptor *to, int flag)
int burn_drive_is_enumerable_adr(char *adr)
int burn_speed_descriptor_new(struct burn_speed_descriptor **s, struct burn_speed_descriptor *prev, struct burn_speed_descriptor *next, int flag)
int burn_drive_re_assess(struct burn_drive *d, int flag)
int burn_drive_set_media_capacity_remaining(struct burn_drive *d, off_t value)
int burn_drive_get_feature(struct burn_drive *d, unsigned int feature_code, unsigned char *flags, unsigned char *additional_length, unsigned char **feature_data, char **feature_text)
int burn_abort_5(int patience, int(*pacifier_func)(void *handle, int patience, int elapsed), void *handle, int elapsed, int flag)
int burn_obtain_profile_name(int profile_number, char name[80])
int burn_drive__fd_from_special_adr(char *adr)
static char * enumeration_whitelist[255]
void burn_sectors_to_msf(int sectors, int *m, int *s, int *f)
int burn_drives_are_clear(int flag)
int burn_disc_next_track_is_damaged(struct burn_drive *d, int flag)
void burn_drive_info_free(struct burn_drive_info drive_infos[])
int burn_abort_pacifier(void *handle, int patience, int elapsed)
int burn_drive_has_feature(struct burn_drive *d, int feature_code, struct burn_feature_descr **descr, int flag)
int burn_drive_grab(struct burn_drive *d, int le)
void burn_drive_free_all(void)
int burn_drive_get_read_speed(struct burn_drive *d)
void burn_drive_clear_whitelist(void)
int burn_mdata_free_subs(struct scsi_mode_data *m)
int burn_drive_set_speed_exact(struct burn_drive *d, int r, int w)
int burn_get_read_capacity(struct burn_drive *d, int *capacity, int flag)
int burn_disc_get_msc1(struct burn_drive *d, int *start)
static int burn_role_by_access(char *fname, int flag)
struct burn_disc * burn_drive_get_disc(struct burn_drive *d)
int burn_lookup_device_link(char *dev_adr, char link_adr[], char *dir_adr, char **ranks, int rank_count, int flag)
int burn_drive_get_start_end_lba(struct burn_drive *d, int *start_lba, int *end_lba, int flag)
void burn_disc_erase_sync(struct burn_drive *d, int fast)
int burn_drive_get_write_speed(struct burn_drive *d)
int burn_drive_scan_and_grab(struct burn_drive_info *drive_infos[], char *adr, int load)
int burn_drive_get_immed(struct burn_drive *drive)
int burn_disc_get_media_id(struct burn_drive *d, char **product_id, char **media_code1, char **media_code2, char **book_type, int flag)
int burn_drive_probe_cd_write_modes(struct burn_drive_info *dinfo)
int burn_feature_descr_new(struct burn_feature_descr **new, unsigned char *descr, int descr_len, int flag)
int burn_disc_get_write_mode_demands(struct burn_disc *disc, struct burn_write_opts *opts, struct burn_disc_mode_demands *result, int flag)
int burn_drive_get_serial_no(struct burn_drive *d, char **sno, int *sno_len)
int burn_drive_role_4_allowed
int burn_support_untested_profiles
int burn_disc_track_lba_nwa(struct burn_drive *d, struct burn_write_opts *o, int trackno, int *lba, int *nwa)
int burn_drive_set_buffer_waiting(struct burn_drive *d, int enable, int min_usec, int max_usec, int timeout_sec, int min_percent, int max_percent)
int burn_drive_find_devno(dev_t devno, char adr[])
int burn_drive_get_best_speed(struct burn_drive *d, int speed_goal, struct burn_speed_descriptor **best_descr, int flag)
void burn_drive_free(struct burn_drive *d)
void burn_drive_set_speed(struct burn_drive *d, int r, int w)
int burn_init_catch_on_abort(int flag)
burn_abort_handler_t burn_global_signal_handler
int burn_global_abort_signum
int burn_is_aborting(int flag)
int burn_grab_restore_sig_action(int signal_action_mem, int flag)
volatile int burn_global_abort_level
void * burn_global_signal_handle
int burn_grab_prepare_sig_action(int *signal_action_mem, int flag)
#define BURN_FREE_MEM(pt)
#define BURN_ALLOC_MEM(pt, typ, count)
#define BURN_ALLOC_MEM_VOID(pt, typ, count)
#define BURN_DRIVE_WHITELIST_LEN
void burn_write_opts_free(struct burn_write_opts *opts)
@ BURN_DRIVE_READING_SYNC
@ BURN_DRIVE_WRITING_LEADIN
@ BURN_DRIVE_CLOSING_SESSION
@ BURN_DRIVE_WRITING_LEADOUT
@ BURN_DRIVE_WRITING_SYNC
@ BURN_DRIVE_WRITING_PREGAP
#define BURN_DRIVE_ADR_LEN
#define BURN_FORMAT_IS_FORMATTED
void burn_disc_free(struct burn_disc *d)
struct burn_write_opts * burn_write_opts_new(struct burn_drive *drive)
int burn_write_opts_set_write_type(struct burn_write_opts *opts, enum burn_write_types write_type, int block_type)
int libdax_msgs_submit(struct libdax_msgs *m, int origin, int error_code, int severity, int priority, char *msg_text, int os_errno, int flag)
#define LIBDAX_MSGS_SEV_DEBUG
#define LIBDAX_MSGS_PRIO_LOW
#define LIBDAX_MSGS_SEV_FATAL
#define LIBDAX_MSGS_SEV_NOTE
#define LIBDAX_MSGS_PRIO_HIGH
#define LIBDAX_MSGS_SEV_SORRY
#define LIBDAX_MSGS_PRIO_ZERO
#define LIBDAX_MSGS_SEV_FAILURE
int mmc_function_spy(struct burn_drive *d, char *text)
int mmc_get_phys_format_info(struct burn_drive *d, int *disk_category, char **book_name, int *part_version, int *num_layers, int *num_blocks, int flag)
int burn_make_feature_text(struct burn_drive *d, unsigned int feature_code, unsigned char flags, unsigned char additional_length, unsigned char *feature_data, char **text, int flag)
int mmc_get_leadin_text(struct burn_drive *d, unsigned char **text_packs, int *num_packs, int flag)
int mmc_get_bd_spare_info(struct burn_drive *d, int *alloc_blocks, int *free_blocks, int flag)
int mmc_get_media_product_id(struct burn_drive *d, char **product_id, char **media_code1, char **media_code2, char **book_type, int flag)
char * mmc_obtain_profile_name(int profile_number)
int sg_is_enumerable_adr(char *adr)
int sg_dispose_drive(struct burn_drive *d, int flag)
int scsi_enumerate_drives(void)
int burn_os_is_2k_seekrw(char *path, int flag)
int burn_os_stdio_capacity(char *path, off_t write_start, off_t *bytes)
int sg_give_next_adr(burn_drive_enumerator_t *idx, char adr[], int adr_size, int initialize)
int sg_obtain_scsi_adr(char *path, int *bus_no, int *host_no, int *channel_no, int *target_no, int *lun_no)
int burn_scsi_setup_drive(struct burn_drive *d, int bus_no, int host_no, int channel_no, int target_no, int lun_no, int flag)
struct burn_session ** session
unsigned int write_simulate
struct burn_drive * drive
unsigned int write_dvdram
int(* test_unit_ready)(struct burn_drive *d)
enum burn_disc_status status
void(* probe_write_modes)(struct burn_drive *d)
char current_profile_text[80]
int(* grab)(struct burn_drive *)
unsigned int wfb_min_percent
int media_serial_number_len
struct burn_write_opts * write_opts
struct burn_progress progress
unsigned int wfb_min_usec
int current_is_cd_profile
int(* get_erase_progress)(struct burn_drive *)
int(* get_nwa)(struct burn_drive *, int trackno, int *lba, int *nwa)
unsigned int wfb_max_usec
unsigned int format_curr_blsas
char * drive_serial_number
int current_feat2fh_byte4
off_t format_curr_max_size
struct burn_format_descr format_descriptors[32]
int current_is_guessed_profile
void(* lock)(struct burn_drive *)
unsigned char all_profiles[256]
struct burn_feature_descr * features
struct burn_toc_entry * toc_entry
void(* read_atip)(struct burn_drive *)
int(* stop_unit)(struct burn_drive *)
int(* write)(struct burn_drive *, int, struct buffer *)
int set_streaming_exact_bit
int(* read_format_capacities)(struct burn_drive *d, int top_wanted)
int drive_serial_number_len
void(* sync_cache)(struct burn_drive *)
pthread_mutex_t access_lock
int(* read_multi_session_c1)(struct burn_drive *d, int *trackno, int *start)
void(* read_disc_info)(struct burn_drive *)
void(* send_write_parameters)(struct burn_drive *, struct burn_session *, int tno, const struct burn_write_opts *)
int(* start_unit)(struct burn_drive *)
void(* eject)(struct burn_drive *)
int(* drive_is_open)(struct burn_drive *)
void(* unlock)(struct burn_drive *)
struct scsi_mode_data * mdata
void(* read_toc)(struct burn_drive *)
int(* format_unit)(struct burn_drive *d, off_t size, int flag)
void(* close_track_session)(struct burn_drive *d, int session, int track)
int current_is_supported_profile
void(* load)(struct burn_drive *)
enum burn_drive_status busy
unsigned int wfb_timeout_sec
void(* erase)(struct burn_drive *, int)
unsigned int wfb_max_percent
void(* getcaps)(struct burn_drive *)
int stream_recording_start
void(* set_speed)(struct burn_drive *, int, int)
off_t media_capacity_remaining
char * media_serial_number
struct burn_scsi_inquiry_data * idata
int(* release)(struct burn_drive *)
struct burn_feature_descr * next
unsigned char data_lenght
unsigned short feature_code
enum burn_write_types selected_write_mode
enum burn_write_types advised_write_mode
int current_is_cd_profile
struct burn_track ** track
struct burn_speed_descriptor * next
struct burn_speed_descriptor * prev
enum burn_block_types block_type
struct burn_drive * drive
struct burn_speed_descriptor * speed_descriptors
off_t burn_track_get_default_size(struct burn_track *t)
int burn_track_is_open_ended(struct burn_track *t)