libburn 1.5.8
libburn.h
Go to the documentation of this file.
1/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
2
3/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
4 Copyright (c) 2006 - 2026 Thomas Schmitt <scdbackup@gmx.net>
5 Provided under GPL version 2 or later.
6
7 This is the official API definition of libburn.
8
9*/
10/* Important: If you add a public API function then add its name to file
11 libburn/libburn.ver
12 in the node LIBBURN4_Major.Minor.Micro with the numbers of
13 the next release version, citing the previous node.
14*/
15
16
17#ifndef LIBBURN_H
18#define LIBBURN_H
19
20/*
21
22Applications must use 64 bit off_t. E.g. by defining
23 #define _LARGEFILE_SOURCE
24 #define _FILE_OFFSET_BITS 64
25or take special precautions to interface with the library by 64 bit integers
26where this .h files prescribe off_t.
27
28To prevent 64 bit file i/o in the library would keep the application from
29processing tracks of more than 2 GB size.
30
31*/
32#include <sys/types.h>
33
34/* For struct timeval */
35#include <sys/time.h>
36
37#ifndef DOXYGEN
38
39#if defined(__cplusplus)
40#define BURN_BEGIN_DECLS \
41 namespace burn { \
42 extern "C" {
43#define BURN_END_DECLS \
44 } \
45 }
46#else
47#define BURN_BEGIN_DECLS
48#define BURN_END_DECLS
49#endif
50
51BURN_BEGIN_DECLS
52
53#endif
54
55/** References a physical drive in the system */
56struct burn_drive;
57
58/** References a whole disc */
59struct burn_disc;
60
61/** References a single session on a disc */
62struct burn_session;
63
64/** References a single track on a disc */
65struct burn_track;
66
67/* ts A61111 */
68/** References a set of write parameters */
69struct burn_write_opts;
70
71/** Session format for normal audio or data discs */
72#define BURN_CDROM 0
73/** Session format for obsolete CD-I discs */
74#define BURN_CDI 0x10
75/** Session format for CDROM-XA discs */
76#define BURN_CDXA 0x20
77
78#define BURN_POS_END 100
79
80/** Mask for mode bits */
81#define BURN_MODE_BITS 127
82
83/** Track mode - mode 0 data
84 0 bytes of user data. it's all 0s. mode 0. get it? HAH
85*/
86#define BURN_MODE0 (1 << 0)
87/** Track mode - mode "raw" - all 2352 bytes supplied by app
88 FOR DATA TRACKS ONLY!
89*/
90#define BURN_MODE_RAW (1 << 1)
91/** Track mode - mode 1 data
92 2048 bytes user data, and all the LEC money can buy
93*/
94#define BURN_MODE1 (1 << 2)
95/** Track mode - mode 2 data
96 defaults to formless, 2336 bytes of user data, unprotected
97 | with a data form if required.
98*/
99#define BURN_MODE2 (1 << 3)
100/** Track mode modifier - Form 1, | with MODE2 for reasonable results
101 2048 bytes of user data, 4 bytes of subheader
102*/
103#define BURN_FORM1 (1 << 4)
104/** Track mode modifier - Form 2, | with MODE2 for reasonable results
105 lots of user data. not much LEC.
106*/
107#define BURN_FORM2 (1 << 5)
108/** Track mode - audio
109 2352 bytes per sector. may be | with 4ch or preemphasis.
110 NOT TO BE CONFUSED WITH BURN_MODE_RAW
111 Audio data must be 44100Hz 16bit stereo with no riff or other header at
112 beginning. Extra header data will cause pops or clicks. Audio data should
113 also be in little-endian byte order. Big-endian audio data causes static.
114*/
115#define BURN_AUDIO (1 << 6)
116/** Track mode modifier - 4 channel audio. */
117#define BURN_4CH (1 << 7)
118/** Track mode modifier - Digital copy permitted, can be set on any track.*/
119#define BURN_COPY (1 << 8)
120/** Track mode modifier - 50/15uS pre-emphasis */
121#define BURN_PREEMPHASIS (1 << 9)
122/** Input mode modifier - subcodes present packed 16 */
123#define BURN_SUBCODE_P16 (1 << 10)
124/** Input mode modifier - subcodes present packed 96 */
125#define BURN_SUBCODE_P96 (1 << 11)
126/** Input mode modifier - subcodes present raw 96 */
127#define BURN_SUBCODE_R96 (1 << 12)
128
129/* ts B11230 */
130/** Track mode modifier - Serial Copy Management System, SAO only
131 If this is set and BURN_COPY is not set, then copying the emerging
132 track will be forbidden.
133 @since 1.2.0
134*/
135#define BURN_SCMS (1 << 13)
136
137
138/** Possible disc writing style/modes */
140{
141 /** Packet writing.
142 currently unsupported, (for DVD Incremental Streaming use TAO)
143 */
145
146 /** With CD: Track At Once recording
147 2s gaps between tracks, no fonky lead-ins
148
149 With sequential DVD-R[W]: Incremental Streaming
150 With DVD+R and BD-R: Track of open size
151 With DVD-RAM, DVD+RW, BD-RE: Random Writeable (used sequentially)
152 With overwritable DVD-RW: Rigid Restricted Overwrite
153 */
155
156 /** With CD: Session At Once
157 Block type MUST be BURN_BLOCK_SAO
158 ts A70122: Currently not capable of mixing data and audio tracks.
159
160 With sequential DVD-R[W]: Disc-at-once, DAO
161 Single session, single track, fixed size mandatory, (-dvd-compat)
162 With other DVD or BD media: same as BURN_WRITE_TAO but may demand
163 that track size is known in advance.
164 */
166
167 /** With CD: Raw disc at once recording.
168 all subcodes must be provided by lib or user
169 only raw block types are supported
170 With DVD and BD media: not supported.
171
172 ts A90901: This had been disabled because its implementation
173 relied on code from cdrdao which is not understood
174 currently.
175 A burn run will abort with "FATAL" error message
176 if this mode is attempted.
177 @since 0.7.2
178 ts A91016: Re-implemented according to ECMA-130 Annex A and B.
179 Now understood, explained and not stemming from cdrdao.
180 @since 0.7.4
181 */
183
184 /** In replies this indicates that not any writing will work.
185 As parameter for inquiries it indicates that no particular write
186 mode shall is specified.
187 Do not use for setting a write mode for burning. It will not work.
188 */
190};
191
192/** Data format to send to the drive */
194{
195 /** sync, headers, edc/ecc provided by lib/user */
197 /** sync, headers, edc/ecc and p/q subs provided by lib/user */
199 /** sync, headers, edc/ecc and packed p-w subs provided by lib/user */
201 /** sync, headers, edc/ecc and raw p-w subs provided by lib/user */
203 /** only 2048 bytes of user data provided by lib/user */
205 /** 2336 bytes of user data provided by lib/user */
207 /** 2048 bytes of user data provided by lib/user
208 subheader provided in write parameters
209 are we ever going to support this shit? I vote no.
210 (supposed to be supported on all drives...)
211 */
213 /** 2048 bytes of data + 8 byte subheader provided by lib/user
214 hey, this is also dumb
215 */
217 /** 2324 bytes of data provided by lib/user
218 subheader provided in write parameters
219 no sir, I don't like it.
220 */
222 /** 2332 bytes of data supplied by lib/user
223 8 bytes sub header provided in write parameters
224 this is the second least suck mode2, and is mandatory for
225 all drives to support.
226 */
228 /** SAO block sizes are based on cue sheet, so use this. */
230};
231
232/** Possible status of the drive in regard to the disc in it. */
234{
235 /** The current status is not yet known */
237
238 /** The drive holds a blank disc. It is ready for writing from scratch.
239 Unused multi-session media:
240 CD-R, CD-RW, DVD-R, DVD-RW, DVD+R, BD-R
241 Blanked multi-session media (i.e. treated by burn_disc_erase())
242 CD-RW, DVD-RW
243 Overwritable media with or without valid data
244 DVD-RAM, DVD+RW, formatted DVD-RW, BD-RE
245 */
247
248 /** There is no disc at all in the drive */
250
251 /** There is an incomplete disc in the drive. It is ready for appending
252 another session.
253 Written but not yet closed multi-session media
254 CD-R, CD-RW, DVD-R, DVD-RW, DVD+R, BD-R
255 */
257
258 /** There is a disc with data on it in the drive. It is usable only for
259 reading.
260 Written and closed multi-session media
261 CD-R, CD-RW, DVD-R, DVD-RW, DVD+R, BD-R
262 Read-Only media
263 CD-ROM, DVD-ROM, BD-ROM
264 Note that many DVD-ROM drives report any written media
265 as Read-Only media and not by their real media types.
266 */
268
269 /* ts A61007 */
270 /* @since 0.2.4 */
271 /** The drive was not grabbed when the status was inquired */
273
274 /* ts A61020 */
275 /* @since 0.2.6 */
276 /** The media seems to be unsuitable for reading and for writing */
278};
279
280
281/** Possible data source return values */
283{
284 /** The source is ok */
286 /** The source is at end of file */
288 /** The source is unusable */
290};
291
292
293/** Possible busy states for a drive */
295{
296 /** The drive is not in an operation */
298 /** The library is spawning the processes to handle a pending
299 operation (A read/write/etc is about to start but hasn't quite
300 yet) */
302 /** The drive is reading data from a disc */
304 /** The drive is writing data to a disc */
306 /** The drive is writing Lead-In */
308 /** The drive is writing Lead-Out */
310 /** The drive is erasing a disc */
312 /** The drive is being grabbed */
314
315 /* ts A61102 */
316 /* @since 0.2.6 */
317 /** The drive gets written zeroes before the track payload data */
319 /** The drive is told to close a track (TAO only) */
321 /** The drive is told to close a session (TAO only) */
323
324 /* ts A61223 */
325 /* @since 0.3.0 */
326 /** The drive is formatting media */
328
329 /* ts A70822 */
330 /* @since 0.4.0 */
331 /** The drive is busy in synchronous read (if you see this then it
332 has been interrupted) */
334 /** The drive is busy in synchronous write (if you see this then it
335 has been interrupted) */
337
338};
339
340
341/** Information about a track on a disc - this is from the q sub channel of the
342 lead-in area of a disc. The documentation here is very terse.
343 See a document such as mmc3 for proper information.
344
345 CAUTION : This structure is prone to future extension !
346
347 Do not restrict your application to unsigned char with any counter like
348 "session", "point", "pmin", ...
349 Do not rely on the current size of a burn_toc_entry.
350
351*/
353{
354 /** Session the track is in */
355 unsigned char session;
356 /** Type of data. for this struct to be valid, it must be 1 */
357 unsigned char adr;
358 /** Type of data in the track */
359 unsigned char control;
360 /** Zero. Always. Really. */
361 unsigned char tno;
362 /** Track number or special information */
363 unsigned char point;
364 unsigned char min;
365 unsigned char sec;
366 unsigned char frame;
367 unsigned char zero;
368 /** Track start time minutes for normal tracks */
369 unsigned char pmin;
370 /** Track start time seconds for normal tracks */
371 unsigned char psec;
372 /** Track start time frames for normal tracks */
373 unsigned char pframe;
374
375 /* Indicates whether extension data are valid and eventually override
376 older elements in this structure:
377 bit0= DVD extension is valid @since 0.3.2
378 @since 0.5.2 : DVD extensions are made valid for CD too
379 bit1= LRA extension is valid @since 0.7.2
380 bit2= Track status bits extension is valid @since 1.2.8
381 bit3= Long block address is valid:
382 long_start_lba, long_track_blocks, long_last_rec_adr
383 @since 1.5.8
384 */
385 unsigned char extensions_valid;
386
387 /* ts A70201 : DVD extension. extensions_valid:bit0
388 If invalid the members are guaranteed to be 0. */
389 /* @since 0.3.2 */
390 /* Tracks and session numbers are 16 bit. Here are the high bytes. */
391 unsigned char session_msb;
392 unsigned char point_msb;
393 /* pmin, psec, and pframe may be too small if DVD extension is valid */
394 /* -1 means that only long_start_lba is valid */
396 /* min, sec, and frame may be too small if DVD extension is valid */
397 /* -1 means that only long_track_blocks is valid */
399
400 /* ts A90909 : LRA extension. extensions_valid:bit1 */
401 /* @since 0.7.2 */
402 /* MMC-5 6.27.3.18 : The Last Recorded Address is valid for DVD-R,
403 DVD-R DL when LJRS = 00b, DVD-RW, HD DVD-R, and BD-R.
404 This would mean profiles: 0x11, 0x15, 0x13, 0x14, 0x51, 0x41, 0x42
405 */
406 /* -1 means that only long_last_rec_adr is valid */
408
409 /* ts B30112 : Track status bits extension. extensions_valid:bit2 */
410 /* @since 1.2.8 */
411 /* Names as of READ TRACK INFORMATION, MMC-5 6.27.3 :
412 bit0 - bit3 = Track Mode
413 bit4 = Copy
414 bit5 = Damage
415 bit6 - bit7 = LJRS
416 bit8 - bit11 = Data Mode
417 bit12 = FP
418 bit13 = Packet/Inc
419 bit14 = Blank
420 bit15 = RT
421 bit16 = NWA_V
422 bit17 = LRA_V
423 */
425
426 /* ts C40221 : Long block address extension. extensions_valid:bit3 */
427 /* @since 1.5.8 */
431
432};
433
434
435/** Data source interface for tracks.
436 This allows you to use arbitrary program code as provider of track input
437 data.
438
439 Objects compliant to this interface are either provided by the application
440 or by API calls of libburn: burn_fd_source_new() , burn_file_source_new(),
441 and burn_fifo_source_new().
442
443 The API calls may use any file object as data source. Consider to feed
444 an eventual custom data stream asynchronously into a pipe(2) and to let
445 libburn handle the rest.
446 In this case the following rule applies:
447 Call burn_source_free() exactly once for every source obtained from
448 libburn API. You MUST NOT otherwise use or manipulate its components.
449
450 In general, burn_source objects can be freed as soon as they are attached
451 to track objects. The track objects will keep them alive and dispose them
452 when they are no longer needed. With a fifo burn_source it makes sense to
453 keep the own reference for inquiring its state while burning is in
454 progress.
455
456 ---
457
458 The following description of burn_source applies only to application
459 implemented burn_source objects. You need not to know it for API provided
460 ones.
461
462 If you really implement an own passive data producer by this interface,
463 then beware: it can do anything and it can spoil everything.
464
465 In this case the functions (*read), (*get_size), (*set_size), (*free_data)
466 MUST be implemented by the application and attached to the object at
467 creation time.
468 Function (*read_sub) is allowed to be NULL or it MUST be implemented and
469 attached.
470
471 burn_source.refcount MUST be handled properly: If not exactly as many
472 references are freed as have been obtained, then either memory leaks or
473 corrupted memory are the consequence.
474 All objects which are referred to by *data must be kept existent until
475 (*free_data) is called via burn_source_free() by the last referer.
476*/
478
479 /** Reference count for the data source. MUST be 1 when a new source
480 is created and thus the first reference is handed out. Increment
481 it to take more references for yourself. Use burn_source_free()
482 to destroy your references to it. */
484
485
486 /** Read data from the source. Semantics like with read(2), but MUST
487 either deliver the full buffer as defined by size or MUST deliver
488 EOF (return 0) or failure (return -1) at this call or at the
489 next following call. I.e. the only incomplete buffer may be the
490 last one from that source.
491 libburn will read a single sector by each call to (*read).
492 The size of a sector depends on BURN_MODE_*. The known range is
493 2048 to 2352.
494
495 If this call is reading from a pipe then it will learn
496 about the end of data only when that pipe gets closed on the
497 feeder side. So if the track size is not fixed or if the pipe
498 delivers less than the predicted amount or if the size is not
499 block aligned, then burning will halt until the input process
500 closes the pipe.
501
502 IMPORTANT:
503 If this function pointer is NULL, then the struct burn_source is of
504 version >= 1 and the job of .(*read)() is done by .(*read_xt)().
505 See below, member .version.
506 */
507 int (*read)(struct burn_source *, unsigned char *buffer, int size);
508
509
510 /** Read subchannel data from the source (NULL if lib generated)
511 WARNING: This is an obscure feature with CD raw write modes.
512 Unless you checked the libburn code for correctness in that aspect
513 you should not rely on raw writing with own subchannels.
514 ADVICE: Set this pointer to NULL.
515 */
516 int (*read_sub)(struct burn_source *, unsigned char *buffer, int size);
517
518
519 /** Get the size of the source's data. Return 0 means unpredictable
520 size. If application provided (*get_size) might return 0, then
521 the application MUST provide a fully functional (*set_size).
522 */
523 off_t (*get_size)(struct burn_source *);
524
525
526 /* ts A70125 : BROKE BINARY BACKWARD COMPATIBILITY AT libburn-0.3.1. */
527 /* @since 0.3.2 */
528 /** Program the reply of (*get_size) to a fixed value. It is advised
529 to implement this by a attribute off_t fixed_size; in *data .
530 The read() function does not have to take into respect this fake
531 setting. It is rather a note of libburn to itself. Eventually
532 necessary truncation or padding is done in libburn. Truncation
533 is usually considered a misburn. Padding is considered ok.
534
535 libburn is supposed to work even if (*get_size) ignores the
536 setting by (*set_size). But your application will not be able to
537 enforce fixed track sizes by burn_track_set_size() and possibly
538 even padding might be left out.
539 */
540 int (*set_size)(struct burn_source *source, off_t size);
541
542
543 /** Clean up the source specific data. This function will be called
544 once by burn_source_free() when the last referer disposes the
545 source.
546 */
547 void (*free_data)(struct burn_source *);
548
549
550 /** Next source, for when a source runs dry and padding is disabled
551 WARNING: This is an obscure feature. Set to NULL at creation and
552 from then on leave untouched and uninterpreted.
553 */
555
556
557 /** Source specific data. Here the various source classes express their
558 specific properties and the instance objects store their individual
559 management data.
560 E.g. data could point to a struct like this:
561 struct app_burn_source
562 {
563 struct my_app *app_handle;
564 ... other individual source parameters ...
565 off_t fixed_size;
566 };
567
568 Function (*free_data) has to be prepared to clean up and free
569 the struct.
570 */
571 void *data;
572
573
574 /* ts A71222 : Supposed to be binary backwards compatible extension. */
575 /* @since 0.4.2 */
576 /** Valid only if above member .(*read)() is NULL. This indicates a
577 version of struct burn_source younger than 0.
578 From then on, member .version tells which further members exist
579 in the memory layout of struct burn_source. libburn will only touch
580 those announced extensions.
581
582 Versions:
583 0 has .(*read)() != NULL, not even .version is present.
584 1 has .version, .(*read_xt)(), .(*cancel)()
585 */
587
588 /** This substitutes for (*read)() in versions above 0. */
589 int (*read_xt)(struct burn_source *, unsigned char *buffer, int size);
590
591 /** Informs the burn_source that the consumer of data prematurely
592 ended reading. This call may or may not be issued by libburn
593 before (*free_data)() is called.
594 */
595 int (*cancel)(struct burn_source *source);
596};
597
598
599/** Information on a drive in the system */
601{
602 /** Name of the vendor of the drive */
603 char vendor[9];
604 /** Name of the drive */
605 char product[17];
606 /** Revision of the drive */
607 char revision[5];
608
609 /** Invalid: Was: "Location of the drive in the filesystem." */
610 /** This string has no meaning any more. Once it stored the drive
611 device file address. Now always use function burn_drive_d_get_adr()
612 to inquire a device file address. ^^^^^ ALWAYS ^^^^^^^*/
613 char location[17];
614
615 /* NOTE: The capability to write particular media types is also
616 announced by their profile number being in the list returned
617 by burn_drive_get_all_profile(). This is the only way to
618 inquire types DVD-RW, DVD+R, DVD+R DL, DVD+RW, BD-R, BD-RE.
619 */
620 /** Can the drive read DVD-RAM discs */
621 unsigned int read_dvdram:1;
622 /** Can the drive read DVD-R discs */
623 unsigned int read_dvdr:1;
624 /** Can the drive read DVD-ROM discs */
625 unsigned int read_dvdrom:1;
626 /** Can the drive read CD-R discs */
627 unsigned int read_cdr:1;
628 /** Can the drive read CD-RW discs */
629 unsigned int read_cdrw:1;
630
631 /** Can the drive write DVD-RAM discs */
632 unsigned int write_dvdram:1;
633 /** Can the drive write DVD-R discs */
634 unsigned int write_dvdr:1;
635 /** Can the drive write CD-R discs */
636 unsigned int write_cdr:1;
637 /** Can the drive write CD-RW discs */
638 unsigned int write_cdrw:1;
639
640 /** Can the drive simulate a write */
641 unsigned int write_simulate:1;
642
643 /** DEPRECATED: Can the drive report C2 errors */
644 unsigned int c2_errors:1;
645
646 /** DEPRECATED: The size of the drive's buffer (in kilobytes) */
648
649
650 /**
651 * The supported block types in tao mode.
652 * They should be tested with the desired block type.
653 * See also burn_block_types.
654 */
656 /**
657 * The supported block types in sao mode.
658 * They should be tested with the desired block type.
659 * See also burn_block_types.
660 */
662 /**
663 * The supported block types in raw mode.
664 * They should be tested with the desired block type.
665 * See also burn_block_types.
666 */
668 /**
669 * The supported block types in packet mode.
670 * They should be tested with the desired block type.
671 * See also burn_block_types.
672 */
674
675 /** The value by which this drive can be indexed when using functions
676 in the library. This is the value to pass to all libbburn functions
677 that operate on a drive. */
678 struct burn_drive *drive;
679};
680
681
682/** Operation progress report. All values are 0 based indices.
683 Handed out by burn_drive_get_status().
684 **/
686 /** The total number of sessions */
688 /** Current session.*/
690 /** The total number of tracks */
692 /** Current track. */
693 int track;
694 /** The total number of indices */
696 /** Current index. */
697 int index;
698 /** The starting logical block address */
700 /** On write: The number of sectors.
701 On blank: 0x10000 as upper limit for relative progress steps */
703 /** On write: The current sector being processed.
704 On blank: Relative progress steps 0 to 0x10000 */
706
707 /* ts A61023 */
708 /* @since 0.2.6 */
709 /** The capacity of the drive buffer */
711 /** The free space in the drive buffer (might be slightly outdated) */
713
714 /* ts A61119 */
715 /* @since 0.2.6 */
716 /** The number of bytes sent to the drive buffer */
718 /** The minimum number of bytes stored in buffer during write.
719 (Caution: Before surely one buffer size of bytes was processed,
720 this value is 0xffffffff.)
721 */
723};
724
725
726/** Operation progress report with long block numbers.
727 All values are 0 based indices.
728 Handed out by burn_drive_get_status_v2().
729 @since 1.5.8
730 **/
732 /** Revision of the struct format.
733 0= Elements up to .buffer_min_fill */
735
736 /** The total number of sessions */
738 /** Current session.*/
740 /** The total number of tracks */
742 /** Current track. */
743 int track;
744 /** The total number of indices */
746 /** Current index. */
747 int index;
748 /** The starting logical block address */
750 /** On write: The number of sectors.
751 On blank: 0x10000 as upper limit for relative progress steps */
752 off_t sectors;
753 /** On write: The current sector being processed.
754 On blank: Relative progress steps 0 to 0x10000 */
755 off_t sector;
756
757 /** The capacity of the drive buffer */
759 /** The free space in the drive buffer (might be slightly outdated) */
761
762 /** The number of bytes sent to the drive buffer */
764 /** The minimum number of bytes stored in buffer during write.
765 (Caution: Before surely one buffer size of bytes was processed,
766 this value is 0x7fffffffffffffff.)
767 */
769};
770
771
772/* ts A61226 */
773/* @since 0.3.0 */
774/** Description of a speed capability as reported by the drive in conjunction
775 with eventually loaded media. There can be more than one such object per
776 drive. So they are chained via .next and .prev , where NULL marks the end
777 of the chain. This list is set up by burn_drive_scan() and gets updated
778 by burn_drive_grab().
779 A copy may be obtained by burn_drive_get_speedlist() and disposed by
780 burn_drive_free_speedlist().
781 For technical background info see SCSI specs MMC and SPC:
782 mode page 2Ah (from SPC 5Ah MODE SENSE) , mmc3r10g.pdf , 6.3.11 Table 364
783 ACh GET PERFORMANCE, Type 03h , mmc5r03c.pdf , 6.8.5.3 Table 312
784*/
786
787 /** Where this info comes from :
788 0 = misc
789 1 = mode page 2Ah
790 2 = ACh GET PERFORMANCE Type 03h
791 3 = ACh GET PERFORMANCE Type 00h Data Type 10h (read speed)
792 */
794
795 /** The media type that was current at the time of report
796 -2 = state unknown, -1 = no media was loaded , else see
797 burn_disc_get_profile() */
799 char profile_name[80];
800
801 /** The attributed capacity of appropriate media in logical block units
802 i.e. 2352 raw bytes or 2048 data bytes. -1 = capacity unknown. */
804
805 /** Speed is given in 1000 bytes/s , 0 = invalid. The numbers
806 are supposed to be usable with burn_drive_set_speed() */
809
810 /** Expert info from ACh GET PERFORMANCE and/or mode page 2Ah.
811 Expect values other than 0 or 1 to get a meaning in future.*/
812 /* Rotational control: 0 = CLV/default , 1 = CAV */
813 int wrc;
814 /* 1 = drive promises reported performance over full media */
815 int exact;
816 /* 1 = suitable for mixture of read and write */
817 int mrw;
818
819 /** List chaining. Use .next until NULL to iterate over the list */
822};
823
824
825/** Initialize the library.
826 This must be called before using any other functions in the library. It
827 may be called more than once with no effect.
828 It is possible to 'restart' the library by shutting it down and
829 re-initializing it. Once this was necessary if you follow the older and
830 more general way of accessing a drive via burn_drive_scan() and
831 burn_drive_grab(). See burn_drive_scan_and_grab() with its strong
832 urges and its explanations.
833 @return Nonzero if the library was able to initialize; zero if
834 initialization failed.
835*/
837
838/** Shutdown the library.
839 This should be called before exiting your application. Make sure that all
840 drives you have grabbed are released <i>before</i> calling this.
841*/
842void burn_finish(void);
843
844
845/* ts A61002 */
846/** Abort any running drive operation and eventually call burn_finish().
847
848 You MUST shut down the busy drives if an aborting event occurs during a
849 burn run. For that you may call this function either from your own signal
850 handling code or indirectly by activating the built-in signal handling:
851 burn_set_signal_handling("my_app_name : ", NULL, 0);
852 Else you may eventually call burn_drive_cancel() on the active drives and
853 wait for them to assume state BURN_DRIVE_IDLE.
854 @param patience Maximum number of seconds to wait for drives to
855 finish.
856 @since 0.7.8 :
857 If this is -1, then only the cancel operations will
858 be performed and no burn_finish() will happen.
859 @param pacifier_func If not NULL: a function to produce appeasing messages.
860 See burn_abort_pacifier() for an example.
861 @param handle Opaque handle to be used with pacifier_func
862 @return 1 ok, all went well
863 0 had to leave a drive in unclean state
864 <0 severe error, do no use libburn again
865 @since 0.2.6
866*/
867int burn_abort(int patience,
868 int (*pacifier_func)(void *handle, int patience, int elapsed),
869 void *handle);
870
871/** A pacifier function suitable for burn_abort.
872 @param handle If not NULL, a pointer to a text suitable for printf("%s")
873 @param patience Maximum number of seconds to wait
874 @param elapsed Elapsed number of seconds
875*/
876int burn_abort_pacifier(void *handle, int patience, int elapsed);
877
878
879/** ts A61006 : This is for development only. Not suitable for applications.
880 Set the verbosity level of the library. The default value is 0, which means
881 that nothing is output on stderr. The more you increase this, the more
882 debug output should be displayed on stderr for you.
883 @param level The verbosity level desired. 0 for nothing, higher positive
884 values for more information output.
885*/
886void burn_set_verbosity(int level);
887
888/* ts A91111 */
889/** Enable or disable logging of SCSI commands.
890 This call can be made at any time - even before burn_initialize().
891 It is in effect for all active drives and currently not very thread
892 safe for multiple drives.
893 @param flag Bitfield for control purposes. The default is 0.
894 bit0= log to file /tmp/libburn_sg_command_log
895 bit1= log to stderr
896 bit2= flush output after each line
897 @since 0.7.4
898*/
900
901/* ts A60813 */
902/** Set parameters for behavior on opening device files. To be called early
903 after burn_initialize() and before any bus scan. But not mandatory at all.
904 Parameter value 1 enables a feature, 0 disables.
905 Default is (1,0,0). Have a good reason before you change it.
906 @param exclusive
907 0 = no attempt to make drive access exclusive.
908 1 = Try to open only devices which are not marked as busy
909 and try to mark them busy if opened successfully. (O_EXCL
910 on GNU/Linux , flock(LOCK_EX) on FreeBSD.)
911 2 = in case of a SCSI device, also try to open exclusively
912 the matching /dev/sr, /dev/scd and /dev/st .
913 One may select a device SCSI file family by adding
914 0 = default family
915 4 = /dev/sr%d
916 8 = /dev/scd%d
917 16 = /dev/sg%d
918 Do not use other values !
919 Add 32 to demand on GNU/Linux an exclusive lock by
920 fcntl(,F_SETLK,) after open() has succeeded.
921 @param blocking Try to wait for drives which do not open immediately but
922 also do not return an error as well. (O_NONBLOCK)
923 This might stall indefinitely with /dev/hdX hard disks.
924 @param abort_on_busy Unconditionally abort process when a non blocking
925 exclusive opening attempt indicates a busy drive.
926 Use this only after thorough tests with your app.
927 @since 0.2.2
928*/
929void burn_preset_device_open(int exclusive, int blocking, int abort_on_busy);
930
931
932/* ts A70223 */
933/** Allows the use of media types which are implemented in libburn but not yet
934 tested. The list of those untested profiles is subject to change.
935 - Currently no media types are under test reservation -
936 If you really test such media, then please report the outcome on
937 pkg-libburnia-devel@alioth-lists.debian.net .
938 If ever then this call should be done soon after burn_initialize() before
939 any drive scanning.
940 @param yes 1=allow all implemented profiles, 0=only tested media (default)
941 @since 0.3.4
942*/
944
945
946/* ts A60823 */
947/** Acquire a drive with known device file address.
948
949 This is the sysadmin friendly way to open one drive and to leave all
950 others untouched. It bundles the following API calls to form a
951 non-obtrusive way to use libburn:
952 burn_drive_add_whitelist() , burn_drive_scan() , burn_drive_grab()
953 You are *strongly urged* to use this call whenever you know the drive
954 address in advance.
955
956 If not, then you have to use directly above calls. In that case, you are
957 *strongly urged* to drop any unintended drive which will be exclusively
958 occupied and not closed by burn_drive_scan().
959 This can be done by shutting down the library including a call to
960 burn_finish(). You may later start a new libburn session and should then
961 use the function described here with an address obtained after
962 burn_drive_scan() via burn_drive_d_get_adr(drive_infos[driveno].drive,adr).
963 Another way is to drop the unwanted drives by burn_drive_info_forget().
964
965 Operating on multiple drives:
966
967 Different than with burn_drive_scan() it is allowed to call
968 burn_drive_scan_and_grab() without giving up any other scanned drives. So
969 this call can be used to get a collection of more than one acquired drives.
970 The attempt to acquire the same drive twice will fail, though.
971
972 Pseudo-drives:
973
974 burn_drive_scan_and_grab() is able to acquire virtual drives which will
975 accept options much like a MMC burner drive. Many of those options will not
976 cause any effect, though. The address of a pseudo-drive begins with
977 prefix "stdio:" followed by a path.
978 Examples: "stdio:/tmp/pseudo_drive" , "stdio:/dev/null" , "stdio:-"
979
980 If the path is empty, the result is a null-drive = drive role 0.
981 It pretends to have loaded no media and supports no reading or writing.
982
983 If the path leads to an existing regular file, or to a not yet existing
984 file, or to an existing block device, then the result is a random access
985 stdio-drive capable of reading and writing = drive role 2.
986
987 If the path leads to an existing file of any type other than directory,
988 then the result is a sequential write-only stdio-drive = drive role 3.
989
990 The special address form "stdio:/dev/fd/{number}" is interpreted literally
991 as reference to open file descriptor {number}. This address form coincides
992 with real files on some systems, but it is in fact hardcoded in libburn.
993 Special address "stdio:-" means stdout = "stdio:/dev/fd/1".
994 The role of such a drive is determined by the file type obtained via
995 fstat({number}).
996
997 Roles 2 and 3 perform all their eventual data transfer activities on a file
998 via standard i/o functions open(2), lseek(2), read(2), write(2), close(2).
999 The media profile is reported as 0xffff. Write space information from those
1000 media is not necessarily realistic.
1001
1002 The capabilities of role 2 resemble DVD-RAM but it can simulate writing.
1003 If the path does not exist in the filesystem yet, it is attempted to create
1004 it as a regular file as soon as write operations are started.
1005
1006 The capabilities of role 3 resemble a blank DVD-R. Nevertheless each
1007 burn_disc_write() run may only write a single track.
1008
1009 One may distinguish pseudo-drives from MMC drives by call
1010 burn_drive_get_drive_role().
1011
1012 @param drive_infos On success returns a one element array with the drive
1013 (cdrom/burner). Thus use with driveno 0 only. On failure
1014 the array has no valid elements at all.
1015 The returned array should be freed via burn_drive_info_free()
1016 when it is no longer needed.
1017 This is a result from call burn_drive_scan(). See there.
1018 Use with driveno 0 only.
1019 @param adr The device file address of the desired drive. Either once
1020 obtained by burn_drive_d_get_adr() or composed skillfully by
1021 application or its user. E.g. "/dev/sr0".
1022 Consider to preprocess it by burn_drive_convert_fs_adr().
1023 @param load Nonzero to make the drive attempt to load a disc (close its
1024 tray door, etc).
1025 @return 1 = success , 0 = drive not found , -1 = other error
1026 @since 0.2.2
1027*/
1029 char* adr, int load);
1030
1031
1032/* ts A51221 */
1033/* @since 0.2.2 */
1034/** Maximum number of particularly permissible drive addresses */
1035#define BURN_DRIVE_WHITELIST_LEN 255
1036
1037/** Add a device to the list of permissible drives. As soon as some entry is in
1038 the whitelist all non-listed drives are banned from scanning.
1039 @return 1 success, <=0 failure
1040 @since 0.2.2
1041*/
1042int burn_drive_add_whitelist(char *device_address);
1043
1044/** Remove all drives from whitelist. This enables all possible drives. */
1046
1047
1048/** Scan for drives. This function MUST be called until it returns nonzero.
1049 In case of re-scanning:
1050 All pointers to struct burn_drive and all struct burn_drive_info arrays
1051 are invalidated by using this function. Do NOT store drive pointers across
1052 calls to this function !
1053 To avoid invalid pointers one MUST free all burn_drive_info arrays
1054 by burn_drive_info_free() before calling burn_drive_scan() a second time.
1055 If there are drives left, then burn_drive_scan() will refuse to work.
1056
1057 After this call all drives depicted by the returned array are subject
1058 to eventual (O_EXCL) locking. See burn_preset_device_open(). This state
1059 ends either with burn_drive_info_forget() or with burn_drive_release().
1060 It is unfriendly to other processes on the system to hold drives locked
1061 which one does not definitely plan to use soon.
1062 @param drive_infos Returns an array of drive info items (cdroms/burners).
1063 The returned array must be freed by burn_drive_info_free()
1064 before burn_finish(), and also before calling this function
1065 burn_drive_scan() again.
1066 @param n_drives Returns the number of drive items in drive_infos.
1067 @return 0 while scanning is not complete
1068 >0 when it is finished successfully,
1069 <0 when finished but failed.
1070*/
1071int burn_drive_scan(struct burn_drive_info *drive_infos[],
1072 unsigned int *n_drives);
1073
1074/* ts A60904 : ticket 62, contribution by elmom */
1075/** Release memory about a single drive and any exclusive lock on it.
1076 Become unable to inquire or grab it. Expect FATAL consequences if you try.
1077 @param drive_info pointer to a single element out of the array
1078 obtained from burn_drive_scan() : &(drive_infos[driveno])
1079 @param force controls degree of permissible drive usage at the moment this
1080 function is called, and the amount of automatically provided
1081 drive shutdown :
1082 0= drive must be ungrabbed and BURN_DRIVE_IDLE
1083 1= try to release drive even if in state BURN_DRIVE_GRABBING
1084 Use these two only. Further values are to be defined.
1085 @return 1 on success, 2 if drive was already forgotten,
1086 0 if not permissible, <0 on other failures,
1087 @since 0.2.2
1088*/
1089int burn_drive_info_forget(struct burn_drive_info *drive_info, int force);
1090
1091
1092/** When no longer needed, free a whole burn_drive_info array which was
1093 returned by burn_drive_scan().
1094 For freeing single drive array elements use burn_drive_info_forget().
1095*/
1096void burn_drive_info_free(struct burn_drive_info drive_infos[]);
1097
1098
1099/* ts A60823 */
1100/* @since 0.2.2 */
1101/** Maximum length+1 to expect with a drive device file address string */
1102#define BURN_DRIVE_ADR_LEN 1024
1103
1104/* ts A70906 */
1105/** Inquire the device file address of the given drive.
1106 @param drive The drive to inquire.
1107 @param adr An application provided array of at least BURN_DRIVE_ADR_LEN
1108 characters size. The device file address gets copied to it.
1109 @return >0 success , <=0 error (due to libburn internal problem)
1110 @since 0.4.0
1111*/
1112int burn_drive_d_get_adr(struct burn_drive *drive, char adr[]);
1113
1114/* A60823 */
1115/** Inquire the device file address of a drive via a given drive_info object.
1116 (Note: This is a legacy call.)
1117 @param drive_info The drive to inquire.Usually some &(drive_infos[driveno])
1118 @param adr An application provided array of at least BURN_DRIVE_ADR_LEN
1119 characters size. The device file address gets copied to it.
1120 @return >0 success , <=0 error (due to libburn internal problem)
1121 @since 0.2.6
1122*/
1123int burn_drive_get_adr(struct burn_drive_info *drive_info, char adr[]);
1124
1125
1126/* ts A60922 ticket 33 */
1127/** Evaluate whether the given address would be a drive device file address
1128 which could be listed by a run of burn_drive_scan(). No check is made
1129 whether a device file with this address exists or whether it leads
1130 to a usable MMC drive.
1131 @return 1 means yes, 0 means no
1132 @since 0.2.6
1133*/
1135
1136/* ts A60922 ticket 33 */
1137/** Try to convert a given existing filesystem address into a drive device file
1138 address. This succeeds with symbolic links or if a hint about the drive's
1139 system address can be read from the filesystem object and a matching drive
1140 is found.
1141 @param path The address of an existing file system object
1142 @param adr An application provided array of at least BURN_DRIVE_ADR_LEN
1143 characters size. The device file address gets copied to it.
1144 @return 1 = success , 0 = failure , -1 = severe error
1145 @since 0.2.6
1146*/
1147int burn_drive_convert_fs_adr(char *path, char adr[]);
1148
1149/* ts A60923 */
1150/** Try to convert a given SCSI address of bus,host,channel,target,lun into
1151 a drive device file address. If a SCSI address component parameter is < 0
1152 then it is not decisive and the first enumerated address which matches
1153 the >= 0 parameters is taken as result.
1154 Note: bus and (host,channel) are supposed to be redundant.
1155 @param bus_no "Bus Number" (something like a virtual controller)
1156 @param host_no "Host Number" (something like half a virtual controller)
1157 @param channel_no "Channel Number" (other half of "Host Number")
1158 @param target_no "Target Number" or "SCSI Id" (a device)
1159 @param lun_no "Logical Unit Number" (a sub device)
1160 @param adr An application provided array of at least BURN_DRIVE_ADR_LEN
1161 characters size. The device file address gets copied to it.
1162 @return 1 = success , 0 = failure , -1 = severe error
1163 @since 0.2.6
1164*/
1165int burn_drive_convert_scsi_adr(int bus_no, int host_no, int channel_no,
1166 int target_no, int lun_no, char adr[]);
1167
1168/* ts B10728 */
1169/** Try to convert a given drive device file address into the address of a
1170 symbolic link that points to this drive address.
1171 Modern GNU/Linux systems may shuffle drive addresses from boot to boot.
1172 The udev daemon is supposed to create links which always point to the
1173 same drive, regardless of its system address.
1174 This call tries to find such links.
1175 @param dev_adr Should contain a drive address as returned by
1176 burn_drive_scan().
1177 @param link_adr An application provided array of at least
1178 BURN_DRIVE_ADR_LEN characters size. The found link
1179 address gets copied to it.
1180 @param dir_adr The address of the directory where to look for links.
1181 Normally: "/dev"
1182 @param templ An array of pointers to name templates, which
1183 links have to match. A symbolic link in dir_adr matches
1184 a name template if it begins by that text. E.g.
1185 link address "/dev/dvdrw1" matches template "dvdrw".
1186 If templ is NULL, then the default array gets used:
1187 {"dvdrw", "cdrw", "dvd", "cdrom", "cd"}
1188 If several links would match, then a link will win,
1189 which matches the template with the lowest array index.
1190 Among these candidates, the one with the lowest strcmp()
1191 rank will be chosen as link_adr.
1192 @param num_templ Number of array elements in templ.
1193 @param flag Bitfield for control purposes. Unused yet. Submit 0.
1194 @return <0 severe error, 0 failed to search, 2 nothing found
1195 1 success, link_adr is valid
1196 @since 1.1.4
1197*/
1198int burn_lookup_device_link(char *dev_adr, char link_adr[],
1199 char *dir_adr, char **templ, int num_templ, int flag);
1200
1201/* ts A60923 - A61005 */
1202/** Try to obtain bus,host,channel,target,lun from path. If there is an SCSI
1203 address at all, then this call should succeed with a drive device file
1204 address obtained via burn_drive_d_get_adr(). It is also supposed to
1205 succeed with any device file of a (possibly emulated) SCSI device.
1206 @return 1 = success , 0 = failure , -1 = severe error
1207 @since 0.2.6
1208*/
1209int burn_drive_obtain_scsi_adr(char *path, int *bus_no, int *host_no,
1210 int *channel_no, int *target_no, int *lun_no);
1211
1212/** Grab a drive. This must be done before the drive can be used (for reading,
1213 writing, etc).
1214 @param drive The drive to grab. This is found in a returned
1215 burn_drive_info struct.
1216 @param load Nonzero to make the drive attempt to load a disc (close its
1217 tray door, etc).
1218 @return 1 if it was possible to grab the drive, else 0
1219*/
1220int burn_drive_grab(struct burn_drive *drive, int load);
1221
1222/* ts B00114 */
1223/* Probe available CD write modes and block types. In earlier versions this
1224 was done unconditionally on drive examination or aquiration. But it is
1225 lengthy and obtrusive, up to spoiling burn runs on the examined drives.
1226 So now this probing is omitted by default. All drives which announce to be
1227 capable of CD or DVD writing, get blindly attributed the capability for
1228 SAO and TAO. Applications which are interested in RAW modes or want to
1229 rely on the traditional write mode information, may use this call.
1230 @param drive_info drive object to be inquired
1231 @return >0 indicates success, <=0 means failure
1232 @since 0.7.6
1233*/
1235
1236/* ts A90824 */
1237/** Calm down or alert a drive. Some drives stay alert after reading for
1238 quite some time. This saves time with the startup for the next read
1239 operation but also causes noise and consumes extra energy. It makes
1240 sense to calm down the drive if no read operation is expected for the
1241 next few seconds. The drive will get alert automatically if operations
1242 are required.
1243 @param d The drive to influence.
1244 @param flag Bitfield for control purposes
1245 bit0= become alert (else start snoozing)
1246 This is not mandatory for further drive operations
1247 @return 1= success , 0= drive role not suitable for calming
1248 @since 0.7.0
1249*/
1250int burn_drive_snooze(struct burn_drive *d, int flag);
1251
1252
1253/** Re-assess drive and media status. This should be done after a drive
1254 underwent a status change and shall be further used without intermediate
1255 burn_drive_release(), burn_drive_grab(). E.g. after blanking or burning.
1256 @param d The already grabbed drive to re-assess.
1257 @param flag Unused yet. Submit 0.
1258 @return 1 success , <= 0 could not determine drive and media state
1259 @since 1.1.8
1260*/
1261int burn_drive_re_assess(struct burn_drive *d, int flag);
1262
1263
1264/** Release a drive. This should not be done until the drive is no longer
1265 busy (see burn_drive_get_status).
1266 @param drive The drive to release.
1267 @param eject Nonzero to make the drive eject the disc in it.
1268*/
1269void burn_drive_release(struct burn_drive *drive, int eject);
1270
1271
1272/* ts C40918 */
1273/** Release a drive like with burn_drive_release() or burn_drive_leave_locked()
1274 but with the additional option not to calm down the drive.
1275 @param drive The drive to release.
1276 @param flag Bitfield for control purposes:
1277 bit0-2= mode
1278 0= unlock
1279 1= unlock+eject
1280 2= leave locked
1281 bit3= reserved, submit 0
1282 bit4= do not calm drive
1283 @return 1 means success, <=0 means failure
1284 @since 1.5.8
1285*/
1286int burn_drive_release_v2(struct burn_drive *d, int flag);
1287
1288
1289/* ts A70918 */
1290/** Like burn_drive_release() but keeping the drive tray closed and its
1291 eject button disabled. This physically locked drive state will last until
1292 the drive is grabbed again and released via burn_drive_release().
1293 Programs like eject, cdrecord, growisofs will break that ban too.
1294 @param d The drive to release and leave locked.
1295 @param flag Bitfield for control purposes (unused yet, submit 0)
1296 @return 1 means success, <=0 means failure
1297 @since 0.4.0
1298*/
1299int burn_drive_leave_locked(struct burn_drive *d, int flag);
1300
1301
1302/** Returns what kind of disc a drive is holding. This function may need to be
1303 called more than once to get a proper status from it. See burn_disc_status
1304 for details.
1305 @param drive The drive to query for a disc.
1306 @return The status of the drive, or what kind of disc is in it.
1307 Note: BURN_DISC_UNGRABBED indicates wrong API usage
1308*/
1309enum burn_disc_status burn_disc_get_status(struct burn_drive *drive);
1310
1311
1312/* ts A61020 */
1313/** WARNING: This revives an old bug-like behavior that might be dangerous.
1314 Sets the drive status to BURN_DISC_BLANK if it is BURN_DISC_UNREADY
1315 or BURN_DISC_UNSUITABLE. Thus marking media as writable which actually
1316 failed to declare themselves either blank or (partially) filled.
1317 @return 1 drive status has been set , 0 = unsuitable drive status
1318 @since 0.2.6
1319*/
1320int burn_disc_pretend_blank(struct burn_drive *drive);
1321
1322
1323/* ts A61106 */
1324/** WARNING: This overrides the safety measures against unsuitable media.
1325 Sets the drive status to BURN_DISC_FULL if it is BURN_DISC_UNREADY
1326 or BURN_DISC_UNSUITABLE. Thus marking media as blankable which actually
1327 failed to declare themselves either blank or (partially) filled.
1328 @since 0.2.6
1329*/
1330int burn_disc_pretend_full(struct burn_drive *drive);
1331
1332
1333/* ts B31110 */
1334/** WARNING: This overrides the safety measures against unsuitable media.
1335 Sets the drive status to BURN_DISC_FULL unconditionally.
1336 @since 1.3.4
1337*/
1338int burn_disc_pretend_full_uncond(struct burn_drive *drive);
1339
1340
1341/* ts B51016 */
1342/** Returns the Drive Serial Number as of MMC feature 108h.
1343 @param d The drive to inquire.
1344 @param sno Returns the bytes of the serial number. A trailing 0-byte
1345 is appended for convenience. MMC specifies ASCII 0x20 to
1346 0x7h as possible byte values. But given drive firmware
1347 habits there is no warranty that *sno contains no other
1348 byte values.
1349 Submit *sno as NULL or pointing to free()-able memory.
1350 Apply free() to *sno when no longer needed.
1351 @param sno_len Returns the number of valid bytes in returned *sno,
1352 not counting the appended trailing 0.
1353 @return 1= success (but maybe *sno_len is 0), <= 0 severe failure
1354 @since 1.4.2
1355*/
1356int burn_drive_get_serial_no(struct burn_drive *d, char **sno, int *sno_len);
1357
1358
1359/* ts B51016 */
1360/** Returns the Media Serial Number as of MMC feature 109h and command ABh
1361 READ MEDIA SERIAL NUMBER.
1362
1363 Note: This call will return an empty result unless the macro
1364 Libburn_enable_scsi_cmd_ABh
1365 is defined at compile time.
1366 This is because the command READ MEDIA SERIAL NUMBER demands
1367 superuser authority on Linux, because no medium with serial number
1368 could be tested yet, and because this command made one of the test
1369 drives unusable until power cycle when it was executed despite
1370 feature 109h was not announced as "current".
1371
1372 @param d The drive to inquire.
1373 @param sno Returns the bytes of the serial number. A trailing 0-byte
1374 is appended for convenience. There is no warranty that
1375 *sno contains only non-zero printable bytes.
1376 Submit *sno as NULL or pointing to free()-able memory.
1377 Apply free() to *sno when no longer needed.
1378 @param sno_len Returns the number of valid bytes in returned *sno,
1379 not counting the appended trailing 0.
1380 @return 1= success (but maybe *sno_len is 0), <= 0 severe failure
1381 @since 1.4.2
1382*/
1383int burn_drive_get_media_sno(struct burn_drive *d, char **sno, int *sno_len);
1384
1385
1386/* ts A61021 */
1387/** Reads ATIP information from inserted media. To be obtained via
1388 burn_drive_get_write_speed(), burn_drive_get_min_write_speed(),
1389 burn_drive_get_start_end_lba(). The drive must be grabbed for this call.
1390 @param drive The drive to query.
1391 @return 1=success, 0=no valid ATIP info read, -1 severe error
1392 @since 0.2.6
1393*/
1394int burn_disc_read_atip(struct burn_drive *drive);
1395
1396
1397/* ts B70206 */
1398/** Tells whether a BD-R medium with Pseudo Overwrite (POW) formatting is in
1399 the drive. Such a formatting may have been applied by dvd+rw-tools. It
1400 prevents sequential multi-session.
1401 libburn will refuse to write to such a medium.
1402 @param drive The drive to query.
1403 @return 1 if BD-R Pseudo Overwrite , 0 if not BD-R or not POW
1404 @since 1.4.8
1405*/
1406int burn_drive_get_bd_r_pow(struct burn_drive *drive);
1407
1408
1409/* ts A61020 */
1410/** Returns start and end lba of the media which is currently inserted
1411 in the given drive. The drive has to be grabbed to have hope for reply.
1412 Shortcoming (not a feature): unless burn_disc_read_atip() was called
1413 only blank media will return valid info.
1414 @param drive The drive to query.
1415 @param start_lba Returns the start lba value
1416 @param end_lba Returns the end lba value
1417 @param flag Bitfield for control purposes (unused yet, submit 0)
1418 @return 1 if lba values are valid , 0 if invalid
1419 @since 0.2.6
1420*/
1421int burn_drive_get_start_end_lba(struct burn_drive *drive,
1422 int *start_lba, int *end_lba, int flag);
1423
1424
1425/* ts A90902 */
1426/** Guess the manufacturer name of CD media from the ATIP addresses of lead-in
1427 and lead-out. (Currently only lead-in is interpreted. Lead-out may in
1428 future be used to identify the media type in more detail.)
1429 The parameters of this call should be obtained by burn_disc_read_atip(d),
1430 burn_drive_get_start_end_lba(d, &start_lba, &end_lba, 0),
1431 burn_lba_to_msf(start_lba, &m_li, &s_li, &f_li) and
1432 burn_lba_to_msf(end_lba, &m_lo, &s_lo, &f_lo).
1433 @param m_li "minute" part of ATIP lead-in or start_lba
1434 @param s_li "second" of lead-in or start_lba
1435 @param f_li "frame" of lead-in
1436 @param m_lo "minute" part of ATIP lead-out
1437 @param s_lo "second" of lead-out
1438 @param f_lo "frame" of lead-out
1439 @param flag Bitfield for control purposes,
1440 bit0= append a text "(aka ...)" to reply if other brands or
1441 vendor names are known.
1442 @return Printable text or NULL on memory shortage.
1443 Dispose by free() when no longer needed.
1444 @since 0.7.2
1445*/
1446char *burn_guess_cd_manufacturer(int m_li, int s_li, int f_li,
1447 int m_lo, int s_lo, int f_lo, int flag);
1448
1449/* ts A90909 */
1450/** Retrieve some media information which is mainly specific to CD. For other
1451 media only the bits in reply parameter valid are supposed to be meaningful.
1452 @param d The drive to query.
1453 @param disc_type A string saying either "CD-DA or CD-ROM", or "CD-I",
1454 or ""CD-ROM XA", or "undefined".
1455 @param disc_id A 32 bit number read from the media. (Meaning unclear yet)
1456 @param bar_code 8 hex digits from a barcode on media read by the drive
1457 (if the drive has a bar code reader built in).
1458 @param app_code The Host Application Code which must be set in the Write
1459 Parameters Page if the media is not unrestricted (URU==0).
1460 @param valid Replies bits which indicate the validity of other reply
1461 parameters or the state of certain CD info bits:
1462 bit0= disc_type is valid
1463 bit1= disc_id is valid
1464 bit2= bar_code is valid
1465 bit3= disc_app_code is valid
1466 bit4= Disc is unrestricted (URU bit, 51h READ DISC INFO)
1467 This seems to be broken with my drives. The bit is
1468 0 and the validity bit for disc_app_code is 0 too.
1469 bit5= Disc is nominally erasable (Erasable bit)
1470 This will be set with overwritable media which
1471 libburn normally considers to be unerasable blank.
1472 @return 1 success, <= 0 an error occurred
1473 @since 0.7.2
1474*/
1475int burn_disc_get_cd_info(struct burn_drive *d, char disc_type[80],
1476 unsigned int *disc_id, char bar_code[9], int *app_code,
1477 int *valid);
1478
1479/* ts B11201 */
1480/** Read the array of CD-TEXT packs from the Lead-in of an audio CD.
1481 Each pack consists of 18 bytes, of which 4 are header. 12 bytes are pieces
1482 of 0-terminated texts or binary data. 2 bytes hold a CRC.
1483 For a description of the format of the array, see file doc/cdtext.txt.
1484 @param d The drive to query.
1485 @param text_packs Will point to an allocated memory buffer with CD-TEXT.
1486 It will only contain text packs, and not be prepended
1487 by the TOC header of four bytes, which gets stored with
1488 file cdtext.dat by cdrecord -vv -toc. (The first two of
1489 these bytes are supposed to hold the number of CD-TEXT
1490 bytes + 2. The other two bytes are supposed to be 0.)
1491 Dispose this buffer by free(), when no longer needed.
1492 @param num_packs Will tell the number of text packs, i.e. the number of
1493 bytes in text_packs divided by 18.
1494 @param flag Bitfield for control purposes,
1495 Unused yet. Submit 0.
1496 @return 1 success, 0= no CD-TEXT found, < 0 an error occurred
1497 @since 1.2.0
1498*/
1499int burn_disc_get_leadin_text(struct burn_drive *d,
1500 unsigned char **text_packs, int *num_packs,
1501 int flag);
1502
1503/* ts B00924 */
1504/** Read the current usage of the eventual BD Spare Area. This area gets
1505 reserved on BD media during formatting. During writing it is used to
1506 host replacements of blocks which failed the checkread immediately after
1507 writing.
1508 This call applies only to recordable BD media. I.e. profiles 0x41 to 0x43.
1509 @param d The drive to query.
1510 @param alloc_blocks Returns the number of blocks reserved as Spare Area
1511 @param free_blocks Returns the number of yet unused blocks in that area
1512 @param flag Bitfield for control purposes (unused yet, submit 0)
1513 @return 1 = reply prarameters are valid,
1514 <=0 = reply is invalid (e.g. because no BD profile)
1515 @since 0.8.8
1516*/
1517int burn_disc_get_bd_spare_info(struct burn_drive *d,
1518 int *alloc_blocks, int *free_blocks, int flag);
1519
1520/* ts B10801 */
1521/** Retrieve some media information which is mainly specific to media of
1522 the DVD-R family: DVD-R , DVD-RW , DVD-R DL , HD DVD-R
1523 Currently the information cannot be retrieved from other media types.
1524 @param d The drive to query.
1525 @param disk_category returns DVD Book to which the media complies
1526 @param book_name returns a pointer to the book name of disk_category.
1527 This memory is static. Do not alter or free it !
1528 @param part_version returns the Media Version in the DVD Book
1529 @param num_layers returns the number of media layers
1530 @param num_blocks returns the number of blocks between pysical start
1531 and physical end of the media
1532 @param flag Bitfield for control purposes (unused yet, submit 0)
1533 @return 1 = reply prarameters are valid,
1534 <=0 = reply is invalid (e.g. because no DVD-R)
1535 @since 1.1.4
1536*/
1537int burn_disc_get_phys_format_info(struct burn_drive *d, int *disk_category,
1538 char **book_name, int *part_version, int *num_layers,
1539 int *num_blocks, int flag);
1540
1541/* ts A61110 */
1542/** Read start lba and Next Writeable Address of a track from media.
1543 Usually a track lba is obtained from the result of burn_track_get_entry().
1544 This call retrieves an updated lba, eventual nwa, and can address the
1545 invisible track to come.
1546 The drive must be grabbed for this call. One may not issue this call
1547 during ongoing burn_disc_write() or burn_disc_erase().
1548 @param d The drive to query.
1549 @param o If not NULL: write parameters to be set on drive before query
1550 @param trackno 0=next track to come, >0 number of existing track
1551 The first existing track on a CD may have a number higher
1552 than 1. Use burn_session_get_start_tno() to inquire this
1553 start number.
1554 @param lba return value: start lba
1555 @param nwa return value: Next Writeable Address
1556 @return 1=nwa is valid , 0=nwa is not valid , -1=error
1557 @since 0.2.6
1558*/
1559int burn_disc_track_lba_nwa(struct burn_drive *d, struct burn_write_opts *o,
1560 int trackno, int *lba, int *nwa);
1561
1562/* ts C40302 */
1563/** Like burn_disc_track_lba_nwa(), but with off_t results.
1564 @since 1.5.8
1565*/
1566int burn_disc_track_lba_nwa_v2(struct burn_drive *d, struct burn_write_opts *o,
1567 int trackno, off_t *lba, off_t *nwa);
1568
1569/* ts B10525 */
1570/** Tells whether a previous attempt to determine the Next Writeable Address
1571 of the upcoming track reveiled that the READ TRACK INFORMATION Damage Bit
1572 is set for this track and that no valid writable address is available.
1573 See MMC-5 6.27.3.7 Damage Bit, 6.27.3.11 NWA_V (NWA valid)
1574 @param d The drive to query.
1575 @param flag Bitfield for control purposes (unused yet, submit 0)
1576 @return 0= Looks ok: Damage Bit is not set, NWA_V is set
1577 1= Damaged and theoretically writable (NWA_V is set)
1578 2= Not writable: NWA_V is not set
1579 3= Damaged and not writable (NWA_V is not set),
1580 @since 1.1.0
1581*/
1582int burn_disc_next_track_is_damaged(struct burn_drive *d, int flag);
1583
1584/* ts B10527 */
1585/** Try to close the last track and session of media which have bit0 set in
1586 the return value of call burn_disc_next_track_is_damaged().
1587 Whether it helps depends much on the reason why the media is reported
1588 as damaged by the drive.
1589 This call works only for profiles 0x09 CD-R, 0x0a CD-RW, 0x11 DVD-R,
1590 0x14 DVD-RW sequential, 0x1b DVD+R, 0x2b DVD+R DL, 0x41 BD-R sequential.
1591 Note: After writing it is advised to give up the drive and to grab it again
1592 in order to learn about its view on the new media state.
1593 @param o Write options created by burn_write_opts_new() and
1594 manipulated by burn_write_opts_set_multi().
1595 burn_write_opts_set_write_type() should be set to
1596 BURN_WRITE_TAO, burn_write_opts_set_simulate() should be
1597 set to 0.
1598 @param flag Bitfield for control purposes
1599 bit0= force close, even if no damage was seen
1600 @return <=0 media not marked as damaged, or media type not suitable,
1601 or closing attempted but failed
1602 1= attempt finished without error indication
1603 @since 1.1.0
1604*/
1605int burn_disc_close_damaged(struct burn_write_opts *o, int flag);
1606
1607
1608/* ts A70131 */
1609/** Read start lba of the first track in the last complete session.
1610 This is the first parameter of mkisofs option -C. The second parameter
1611 is nwa as obtained by burn_disc_track_lba_nwa() with trackno 0.
1612 @param d The drive to query.
1613 @param start_lba returns the start address of that track
1614 @return <= 0 : failure, 1 = ok
1615 @since 0.3.2
1616*/
1617int burn_disc_get_msc1(struct burn_drive *d, int *start_lba);
1618
1619
1620/* ts A70213 */
1621/** Return the best possible estimation of the currently available capacity of
1622 the media. This might depend on particular write option settings. For
1623 inquiring the space with such a set of options, the drive has to be
1624 grabbed and BURN_DRIVE_IDLE. If not, then one will only get a canned value
1625 from the most recent automatic inquiry (e.g. during last drive grabbing).
1626 An eventual start address from burn_write_opts_set_start_byte() will be
1627 taken into respect with the capacity estimation. Negative results get
1628 defaulted to 0.
1629 If the drive is actually a file in a large filesystem or a large block
1630 device, then the capacity is curbed to a maximum of 0x7ffffff0 blocks
1631 = 4 TB - 32 KB.
1632 @param d The drive to query.
1633 @param o If not NULL: write parameters to be set on drive before query
1634 @return number of most probably available free bytes
1635 @since 0.3.4
1636*/
1637off_t burn_disc_available_space(struct burn_drive *d,
1638 struct burn_write_opts *o);
1639
1640/* ts A61202 */
1641/** Tells the MMC Profile identifier of the loaded media. The drive must be
1642 grabbed in order to get a non-zero result.
1643 libburn currently writes only to profiles
1644 0x09 "CD-R"
1645 0x0a "CD-RW"
1646 0x11 "DVD-R sequential recording"
1647 0x12 "DVD-RAM"
1648 0x13 "DVD-RW restricted overwrite"
1649 0x14 "DVD-RW sequential recording",
1650 0x15 "DVD-R/DL sequential recording",
1651 0x1a "DVD+RW"
1652 0x1b "DVD+R",
1653 0x2b "DVD+R/DL",
1654 0x41 "BD-R sequential recording",
1655 0x43 "BD-RE",
1656 0xffff "stdio file"
1657 Note: 0xffff is not a MMC profile but a libburn invention.
1658 Read-only are the profiles
1659 0x08 "CD-ROM",
1660 0x10 "DVD-ROM",
1661 0x40 "BD-ROM",
1662 Read-only for now is this BD-R profile (testers wanted)
1663 0x42 "BD-R random recording"
1664 Empty drives are supposed to report
1665 0x00 ""
1666 @param d The drive where the media is inserted.
1667 @param pno Profile Number. See also mmc5r03c.pdf, table 89
1668 @param name Profile Name (see above list, unknown profiles have empty name)
1669 @return 1 profile is valid, 0 no profile info available
1670 @since 0.3.0
1671*/
1672int burn_disc_get_profile(struct burn_drive *d, int *pno, char name[80]);
1673
1674
1675/* ts A90903 : API */
1676/** Obtain product id and standards defined media codes.
1677 The product id is a printable string which is supposed to be the same
1678 for identical media but should vary with non-identical media. Some media
1679 cannot provide such an id at all.
1680 The pair (profile_number, product_id) should be the best id to identify
1681 media with identical product specifications.
1682 The reply parameters media_code1 and media_code2 can be used with
1683 burn_guess_manufacturer()
1684 The reply parameters have to be disposed by free() when no longer needed.
1685 @param d The drive where the media is inserted.
1686 @param product_id Reply: Printable text depicting manufacturer and
1687 eventually media id.
1688 @param media_code1 Reply: The eventual manufacturer identification as read
1689 from DVD/BD media or a text "XXmYYsZZf" from CD media
1690 ATIP lead-in.
1691 @param media_code2 The eventual media id as read from DVD+/BD media or a
1692 text "XXmYYsZZf" from CD ATIP lead-out.
1693 @param book_type Book type text for DVD and BD.
1694 Caution: is NULL with CD, even if return value says ok.
1695 @param flag Bitfield for control purposes
1696 bit0= do not escape " _/" (not suitable for
1697 burn_guess_manufacturer())
1698 @return 1= ok, product_id and media codes are valid,
1699 0= no product id_available, reply parameters are NULL
1700 <0= error
1701 @since 0.7.2
1702*/
1703int burn_disc_get_media_id(struct burn_drive *d,
1704 char **product_id, char **media_code1, char **media_code2,
1705 char **book_type, int flag);
1706
1707
1708/* ts A90904 */
1709/** Guess the name of a manufacturer by profile number, manufacturer code
1710 and media code. The profile number can be obtained by
1711 burn_disc_get_profile(), the other two parameters can be obtained as
1712 media_code1 and media_code2 by burn_disc_get_media_id().
1713 @param profile_no Profile number (submit -1 if not known)
1714 @param manuf_code Manufacturer code from media (e.g. "RICOHJPN")
1715 @param media_code Media ID code from media (e.g. "W11")
1716 @param flag Bitfield for control purposes, submit 0
1717 @return Printable text or NULL on memory shortage.
1718 If the text begins with "Unknown " then no item of the
1719 manufacturer list matched the codes.
1720 Dispose by free() when no longer needed.
1721 @since 0.7.2
1722*/
1723char *burn_guess_manufacturer(int profile_no,
1724 char *manuf_code, char *media_code, int flag);
1725
1726
1727/** Tells whether a disc can be erased or not
1728 @param d The drive to inquire.
1729 @return Non-zero means erasable
1730*/
1731int burn_disc_erasable(struct burn_drive *d);
1732
1733/** Returns the progress and status of a drive.
1734 @param drive The drive to query busy state for.
1735 @param p Returns the progress of the operation, NULL if you don't care
1736 @return the current status of the drive. See also burn_drive_status.
1737*/
1738enum burn_drive_status burn_drive_get_status(struct burn_drive *drive,
1739 struct burn_progress *p);
1740
1741/** Returns the progress with long block numbers and the status of the drive.
1742 @param drive The drive to query busy state for.
1743 @param p Returns the progress of the operation, NULL if you don't care
1744 @return the current status of the drive. See also burn_drive_status.
1745 @since 1.5.8
1746*/
1747enum burn_drive_status burn_drive_get_status_v2(struct burn_drive *drive,
1748 struct burn_progress_v2 *p);
1749
1750/** Creates a write_opts struct for burning to the specified drive.
1751 The returned object must later be freed with burn_write_opts_free().
1752 @param drive The drive to write with
1753 @return The write_opts, NULL on error
1754*/
1755struct burn_write_opts *burn_write_opts_new(struct burn_drive *drive);
1756
1757
1758/* ts A70901 */
1759/** Inquires the drive associated with a burn_write_opts object.
1760 @param opts object to inquire
1761 @return pointer to drive
1762 @since 0.4.0
1763*/
1764struct burn_drive *burn_write_opts_get_drive(struct burn_write_opts *opts);
1765
1766
1767/** Frees a write_opts struct created with burn_write_opts_new
1768 @param opts write_opts to free
1769*/
1770void burn_write_opts_free(struct burn_write_opts *opts);
1771
1772/** Creates a read_opts struct for reading from the specified drive
1773 must be freed with burn_read_opts_free
1774 @param drive The drive to read from
1775 @return The read_opts
1776*/
1777struct burn_read_opts *burn_read_opts_new(struct burn_drive *drive);
1778
1779/** Frees a read_opts struct created with burn_read_opts_new
1780 @param opts write_opts to free
1781*/
1782void burn_read_opts_free(struct burn_read_opts *opts);
1783
1784/** Erase a disc in the drive. The drive must be grabbed successfully BEFORE
1785 calling this functions. Always ensure that the drive reports a status of
1786 BURN_DISC_FULL before calling this function. An erase operation is not
1787 cancellable, as control of the operation is passed wholly to the drive and
1788 there is no way to interrupt it safely.
1789 @param drive The drive with which to erase a disc.
1790 Only drive roles 1 (MMC) and 5 (stdio random write-only)
1791 support erasing.
1792 @param fast Nonzero to do a fast erase, where only the disc's headers are
1793 erased; zero to erase the entire disc.
1794 With DVD-RW, fast blanking yields media capable only of DAO.
1795*/
1796void burn_disc_erase(struct burn_drive *drive, int fast);
1797
1798
1799/* ts A70101 - A70417 */
1800/** Format media for use with libburn. This currently applies to DVD-RW
1801 in state "Sequential Recording" (profile 0014h) which get formatted to
1802 state "Restricted Overwrite" (profile 0013h). DVD+RW can be "de-iced"
1803 by setting bit4 of flag. DVD-RAM and BD-RE may get formatted initially
1804 or re-formatted to adjust their Defect Management.
1805 This function usually returns while the drive is still in the process
1806 of formatting. The formatting is done, when burn_drive_get_status()
1807 returns BURN_DRIVE_IDLE. This may be immediately after return or may
1808 need several thousand seconds to occur.
1809 @param drive The drive with the disc to format.
1810 @param size The size in bytes to be used with the format command. It should
1811 be divisible by 32*1024. The effect of this parameter may
1812 depend on the media profile and on parameter flag.
1813 @param flag Bitfield for control purposes:
1814 bit0= after formatting, write the given number of zero-bytes
1815 to the media and eventually perform preliminary closing.
1816 bit1+2: size mode
1817 0 = use parameter size as far as it makes sense
1818 1 = insist in size 0 even if there is a better default known
1819 (on DVD-RAM or BD-R identical to size mode 0,
1820 i.e. they never get formatted with payload size 0)
1821 2 = without bit7: format to maximum available size
1822 with bit7 : take size from indexed format descriptor
1823 3 = without bit7: format to default size
1824 with bit7 : take size from indexed format descriptor
1825 bit3= -reserved-
1826 bit4= enforce re-format of (partly) formatted media
1827 bit5= try to disable eventual defect management
1828 bit6= try to avoid lengthy media certification
1829 bit7, bit8 to bit15 =
1830 bit7 enables MMC expert application mode (else libburn
1831 tries to choose a suitable format type):
1832 If it is set then bit8 to bit15 contain the index of
1833 the format to use. See burn_disc_get_formats(),
1834 burn_disc_get_format_descr().
1835 Acceptable types are: 0x00, 0x01, 0x10, 0x11, 0x13,
1836 0x15, 0x26, 0x30, 0x31, 0x32.
1837 If bit7 is set, then bit4 is set automatically.
1838 bit16= enable POW on blank BD-R
1839 @since 0.3.0
1840*/
1841void burn_disc_format(struct burn_drive *drive, off_t size, int flag);
1842
1843
1844/* ts A70112 */
1845/* @since 0.3.0 */
1846/** Possible formatting status values */
1847#define BURN_FORMAT_IS_UNFORMATTED 1
1848#define BURN_FORMAT_IS_FORMATTED 2
1849#define BURN_FORMAT_IS_UNKNOWN 3
1850
1851/* ts A70112 */
1852/** Inquire the formatting status, the associated sizes and the number of
1853 available formats. The info is media specific and stems from MMC command
1854 23h READ FORMAT CAPACITY. See mmc5r03c.pdf 6.24 for background details.
1855 Media type can be determined via burn_disc_get_profile().
1856 @param drive The drive with the disc to format.
1857 @param status The current formatting status of the inserted media.
1858 See BURN_FORMAT_IS_* macros. Note: "unknown" is the
1859 legal status for quick formatted, yet unwritten DVD-RW.
1860 @param size The size in bytes associated with status.
1861 unformatted: the maximum achievable size of the media
1862 formatted: the currently formatted capacity
1863 unknown: maximum capacity of drive or of media
1864 @param bl_sas Additional info "Block Length/Spare Area Size".
1865 Expected to be constantly 2048 for non-BD media.
1866 @param num_formats The number of available formats. To be used with
1867 burn_disc_get_format_descr() to obtain such a format
1868 and eventually with burn_disc_format() to select one.
1869 @return 1 reply is valid , <=0 failure
1870 @since 0.3.0
1871*/
1872int burn_disc_get_formats(struct burn_drive *drive, int *status, off_t *size,
1873 unsigned *bl_sas, int *num_formats);
1874
1875/* ts A70112 */
1876/** Inquire parameters of an available media format.
1877 @param drive The drive with the disc to format.
1878 @param index The index of the format item. Beginning with 0 up to reply
1879 parameter from burn_disc_get_formats() : num_formats - 1
1880 @param type The format type. See mmc5r03c.pdf, 6.5, 04h FORMAT UNIT.
1881 0x00=full, 0x10=CD-RW/DVD-RW full, 0x11=CD-RW/DVD-RW grow,
1882 0x15=DVD-RW quick, 0x13=DVD-RW quick grow,
1883 0x26=DVD+RW background, 0x30=BD-RE with spare areas,
1884 0x31=BD-RE without spare areas
1885 @param size The maximum size in bytes achievable with this format.
1886 @param tdp Type Dependent Parameter. See mmc5r03c.pdf.
1887 @return 1 reply is valid , <=0 failure
1888 @since 0.3.0
1889*/
1890int burn_disc_get_format_descr(struct burn_drive *drive, int index,
1891 int *type, off_t *size, unsigned *tdp);
1892
1893
1894
1895/* ts A61109 : this was and is defunct */
1896/** Read a disc from the drive and write it to an fd pair. The drive must be
1897 grabbed successfully BEFORE calling this function. Always ensure that the
1898 drive reports a status of BURN_DISC_FULL before calling this function.
1899 @param drive The drive from which to read a disc.
1900 @param o The options for the read operation.
1901*/
1902void burn_disc_read(struct burn_drive *drive, const struct burn_read_opts *o);
1903
1904
1905
1906/* ts A70222 */
1907/* @since 0.3.4 */
1908/** The length of a rejection reasons string for burn_precheck_write() and
1909 burn_write_opts_auto_write_type() .
1910*/
1911#define BURN_REASONS_LEN 4096
1912
1913
1914/* ts A70219 */
1915/** Examines a completed setup for burn_disc_write() whether it is permissible
1916 with drive and media. This function is called by burn_disc_write() but
1917 an application might be interested in this check in advance.
1918 @param o The options for the writing operation.
1919 @param disc The description of the disc to be created
1920 @param reasons Eventually returns a list of rejection reason statements
1921 @param silent 1= do not issue error messages , 0= report problems
1922 @return 1 ok, -1= no recordable media detected, 0= other failure
1923 @since 0.3.4
1924*/
1925int burn_precheck_write(struct burn_write_opts *o, struct burn_disc *disc,
1926 char reasons[BURN_REASONS_LEN], int silent);
1927
1928
1929/** Write a disc in the drive. The drive must be grabbed successfully before
1930 calling this function. Always ensure that the drive reports a status of
1931 BURN_DISC_BLANK ot BURN_DISC_APPENDABLE before calling this function.
1932 Note: write_type BURN_WRITE_SAO is currently not capable of writing a mix
1933 of data and audio tracks. You must use BURN_WRITE_TAO for such sessions.
1934 To be set by burn_write_opts_set_write_type().
1935 Note: This function is not suitable for overwriting data in the middle of
1936 a valid data area because it is allowed to append trailing data.
1937 For exact random access overwriting use burn_random_access_write().
1938 Note: After writing it is advised to give up the drive and to grab it again
1939 in order to learn about its view on the new media state.
1940 Note: Before mounting the written media it might be necessary to eject
1941 and reload in order to allow the operating system to notice the new
1942 media state.
1943 @param o The options for the writing operation.
1944 @param disc The struct burn_disc * that described the disc to be created
1945*/
1946void burn_disc_write(struct burn_write_opts *o, struct burn_disc *disc);
1947
1948
1949/* ts A90227 */
1950/** Control stream recording during the write run and eventually set the start
1951 LBA for stream recording.
1952 Stream recording is set from struct burn_write_opts when the write run
1953 gets started. See burn_write_opts_set_stream_recording().
1954 The call described here can be used later to override this setting and
1955 to program automatic switching at a given LBA. It also affects subsequent
1956 calls to burn_random_access_write().
1957 @param drive The drive which performs the write operation.
1958 @param recmode -1= disable stream recording
1959 0= leave setting as is
1960 1= enable stream recording
1961 @param start The LBA where actual stream recording shall start.
1962 (0 means unconditional stream recording)
1963 @param flag Bitfield for control purposes (unused yet, submit 0).
1964 @return 1=success , <=0 failure
1965 @since 0.6.4
1966*/
1967int burn_drive_set_stream_recording(struct burn_drive *drive, int recmode,
1968 int start, int flag);
1969
1970
1971/* ts B60730 */
1972/** Enable or disable use of the Immed bit with long running SCSI commands.
1973 If the Immed bit is used, then those SCSI commands end early and leave
1974 the drive in not-ready state. libburn then tries periodically whether
1975 the drive became ready again. Only then it assumes the command to be
1976 completely done.
1977 The default setting may depend on the operating system on which libburn
1978 was compiled.
1979 @param drive The drive which will be affected.
1980 @param enable 1= use Immed bit.
1981 0= use no Immed bit. Affected commands can last very long.
1982 @return 1=success , <=0 failure
1983 @since 1.4.6
1984*/
1985int burn_drive_set_immed(struct burn_drive *drive, int enable);
1986
1987
1988/* ts B60730 */
1989/** Inquire the current setting of usage of the Immed bit. Either the still set
1990 system dependent default or the value set by call burn_drive_set_immed().
1991 @return The current value.
1992 @since 1.4.6
1993*/
1994int burn_drive_get_immed(struct burn_drive *drive);
1995
1996
1997/** Cancel an operation on a drive.
1998 This will only work when the drive's busy state is BURN_DRIVE_READING or
1999 BURN_DRIVE_WRITING.
2000 @param drive The drive on which to cancel the current operation.
2001*/
2002void burn_drive_cancel(struct burn_drive *drive);
2003
2004
2005/* ts A61223 */
2006/** Inquire whether the most recent asynchronous media job was successful.
2007 This applies to burn_disc_erase(), burn_disc_format(), burn_disc_write().
2008 Reasons for non-success may be: rejection of burn parameters, abort due to
2009 fatal errors during write, blank or format, a call to burn_drive_cancel()
2010 by the application thread.
2011 @param d The drive to inquire.
2012 @return 1=burn seems to have went well, 0=burn failed
2013 @since 0.2.6
2014*/
2015int burn_drive_wrote_well(struct burn_drive *d);
2016
2017
2018/* ts B31023 */
2019/** Inquire whether a write error occurred which is suspected to have happened
2020 due to a false report about DVD-RW capability to be written in write type
2021 BURN_WRITE_TAO.
2022 @param d The drive to inquire.
2023 @return 1= it seems that BURN_WRITE_TAO on DVD-RW caused error,
2024 0= it does not seem so
2025 @since 1.3.4
2026*/
2027int burn_drive_was_feat21_failure(struct burn_drive *d);
2028
2029
2030/** Convert a minute-second-frame (MSF) value to sector count
2031 @param m Minute component
2032 @param s Second component
2033 @param f Frame component
2034 @return The sector count
2035*/
2036int burn_msf_to_sectors(int m, int s, int f);
2037
2038/** Convert a sector count to minute-second-frame (MSF)
2039 @param sectors The sector count
2040 @param m Returns the minute component
2041 @param s Returns the second component
2042 @param f Returns the frame component
2043*/
2044void burn_sectors_to_msf(int sectors, int *m, int *s, int *f);
2045
2046/** Convert a minute-second-frame (MSF) value to an lba
2047 @param m Minute component
2048 @param s Second component
2049 @param f Frame component
2050 @return The lba
2051*/
2052int burn_msf_to_lba(int m, int s, int f);
2053
2054/** Convert an lba to minute-second-frame (MSF)
2055 @param lba The lba
2056 @param m Returns the minute component
2057 @param s Returns the second component
2058 @param f Returns the frame component
2059*/
2060void burn_lba_to_msf(int lba, int *m, int *s, int *f);
2061
2062/** Create a new disc
2063 @return Pointer to a burn_disc object or NULL on failure.
2064*/
2065struct burn_disc *burn_disc_create(void);
2066
2067/** Delete disc and decrease the reference count on all its sessions
2068 @param d The disc to be freed
2069*/
2070void burn_disc_free(struct burn_disc *d);
2071
2072/** Create a new session
2073 @return Pointer to a burn_session object or NULL on failure.
2074 */
2075struct burn_session *burn_session_create(void);
2076
2077/** Free a session (and decrease reference count on all tracks inside)
2078 @param s Session to be freed
2079*/
2080void burn_session_free(struct burn_session *s);
2081
2082/** Add a session to a disc at a specific position, increasing the
2083 sessions's reference count.
2084 @param d Disc to add the session to
2085 @param s Session to add to the disc
2086 @param pos position to add at (BURN_POS_END is "at the end")
2087 @return 0 for failure, 1 for success
2088*/
2089int burn_disc_add_session(struct burn_disc *d, struct burn_session *s,
2090 unsigned int pos);
2091
2092/** Remove a session from a disc
2093 @param d Disc to remove session from
2094 @param s Session pointer to find and remove
2095*/
2096int burn_disc_remove_session(struct burn_disc *d, struct burn_session *s);
2097
2098
2099/* ts B11219 */
2100/** Read a CDRWIN cue sheet file and equip the session object by tracks and
2101 CD-TEXT according to the content of the file.
2102 For a description of CDRWIN file format see
2103 http://digitalx.org/cue-sheet/syntax/
2104 Fully supported commands are:
2105 CATALOG , CDTEXTFILE , FLAGS , INDEX , ISRC , PERFORMER ,
2106 POSTGAP , PREGAP , REM , SONGWRITER , TITLE
2107 Further supported commands introduced by cdrecord (usage like PERFORMER):
2108 ARRANGER , COMPOSER , MESSAGE
2109 Partly supported commands are:
2110 FILE which supports only types BINARY , MOTOROLA , WAVE
2111 TRACK which supports only datatypes AUDIO , MODE1/2048
2112 Unsupported types of FILE or TRACK lead to failure of the call.
2113 libburn does not yet support mixing of AUDIO and MODE1/2048. So this call
2114 will fail if such a mix is found.
2115 CD-TEXT information is allowed only if all tracks are of datatype AUDIO.
2116 Empty lines and lines which start by '#' are ignored.
2117 @param session Session where to attach tracks. It must not yet have
2118 tracks or else this call will fail.
2119 @param path Filesystem address of the CDRWIN cue sheet file.
2120 Normally with suffix .cue
2121 @param fifo_size Number of bytes in fifo. This will be rounded up by
2122 the block size of the track mode. <= 0 means no fifo.
2123 @param fifo Returns a reference to the burn_source object that
2124 was installed as fifo between FILE and the track
2125 burn sources. One may use this to inquire the fifo
2126 state. Dispose it by burn_source_free() when no longer
2127 needed. It is permissible to pass this parameter to
2128 libburn as NULL, in order to immediately drop ownership
2129 on the fifo.
2130 @param text_packs Returns pre-formatted CD-TEXT packs resulting from
2131 cue sheet command CDTEXTFILE. To be used with call
2132 burn_write_opts_set_leadin_text().
2133 It is permissible to pass this parameter to libburn
2134 as NULL, in order to disable CDTEXTFILE.
2135 @param num_packs Returns the number of 18 byte records in text_packs.
2136 @param flag Bitfield for control purposes.
2137 bit0= Do not attach CD-TEXT information to session and
2138 tracks. Do not load text_packs.
2139 bit1= Do not use media catalog string of session or ISRC
2140 strings of tracks for writing to Q sub-channel.
2141 @return > 0 indicates success, <= 0 indicates failure
2142 @since 1.2.0
2143*/
2144int burn_session_by_cue_file(struct burn_session *session,
2145 char *path, int fifo_size, struct burn_source **fifo,
2146 unsigned char **text_packs, int *num_packs, int flag);
2147
2148
2149/** Create a track */
2150struct burn_track *burn_track_create(void);
2151
2152/** Free a track
2153 @param t Track to free
2154*/
2155void burn_track_free(struct burn_track *t);
2156
2157/** Add a track to a session at specified position
2158 @param s Session to add to
2159 @param t Track to insert in session
2160 @param pos position to add at (BURN_POS_END is "at the end")
2161 @return 0 for failure, 1 for success
2162*/
2163int burn_session_add_track(struct burn_session *s, struct burn_track *t,
2164 unsigned int pos);
2165
2166/** Remove a track from a session
2167 @param s Session to remove track from
2168 @param t Track pointer to find and remove
2169 @return 0 for failure, 1 for success
2170*/
2171int burn_session_remove_track(struct burn_session *s, struct burn_track *t);
2172
2173
2174/* ts B20107 */
2175/** Set the number which shall be written as CD track number with the first
2176 track of the session. The following tracks will then get written with
2177 consecutive CD track numbers. The resulting number of the last track
2178 must not exceed 99. The lowest possible start number is 1, which is also
2179 the default. This setting applies only to CD SAO writing.
2180 @param session The session to be manipulated
2181 @param tno A number between 1 and 99
2182 @param flag Bitfield for control purposes. Unused yet. Submit 0.
2183 @return > 0 indicates success, <= 0 indicates failure
2184 @since 1.2.0
2185*/
2186int burn_session_set_start_tno(struct burn_session *session, int tno,
2187 int flag);
2188
2189/* ts B20108 */
2190/** Inquire the CD track start number, as set by default or by
2191 burn_session_set_start_tno().
2192 @param session The session to be inquired
2193 @param flag Bitfield for control purposes. Unused yet. Submit 0.
2194 @return > 0 is the currently set CD track start number
2195 <= 0 indicates failure
2196 @since 1.2.0
2197*/
2198int burn_session_get_start_tno(struct burn_session *session, int flag);
2199
2200
2201
2202/* ts B11206 */
2203/** Set the Character Codes, the Copyright bytes, and the Language Codes
2204 for CD-TEXT blocks 0 to 7. They will be used in the block summaries
2205 of text packs which get generated from text or binary data submitted
2206 by burn_session_set_cdtext() and burn_track_set_cdtext().
2207 Character Code value can be
2208 0x00 = ISO-8859-1
2209 0x01 = 7 bit ASCII
2210 0x80 = MS-JIS (japanesei Kanji, double byte characters)
2211 Copyright byte value can be
2212 0x00 = not copyrighted
2213 0x03 = copyrighted
2214 Language Code value will typically be 0x09 = English or 0x69 = Japanese.
2215 See below macros BURN_CDTEXT_LANGUAGES_0X00 and BURN_CDTEXT_LANGUAGES_0X45,
2216 but be aware that many of these codes have never been seen on CD, and that
2217 many of them do not have a character representation among the above
2218 Character Codes.
2219 Default is 0x09 = English for block 0 and 0x00 = Unknown for block 1 to 7.
2220 Copyright and Character Code are 0x00 for all blocks by default.
2221 See also file doc/cdtext.txt, "Format of a CD-TEXT packs array",
2222 "Pack type 0x8f".
2223
2224 Parameter value -1 leaves the current setting of the session parameter
2225 unchanged.
2226 @param s Session where to change settings
2227 @param char_codes Character Codes for block 0 to 7
2228 @param copyrights Copyright bytes for block 0 to 7
2229 @param languages Language Codes for block 0 to 7
2230 @param flag Bitfiled for control purposes. Unused yet. Submit 0.
2231 @return <=0 failure, > 0 success
2232 @since 1.2.0
2233*/
2234int burn_session_set_cdtext_par(struct burn_session *s,
2235 int char_codes[8], int copyrights[8],
2236 int languages[8], int flag);
2237
2238/** This is the first list of languages sorted by their Language codes,
2239 which start at 0x00. They stem from from EBU Tech 3264, appendix 3.
2240 E.g. language 0x00 is "Unknown", 0x08 is "German", 0x10 is "Frisian",
2241 0x18 is "Latvian", 0x20 is "Polish", 0x28 is "Swedish", 0x2b is "Wallon".
2242 See also file doc/cdtext.txt.
2243 @since 1.2.0
2244*/
2245#define BURN_CDTEXT_LANGUAGES_0X00 \
2246 "Unknown", "Albanian", "Breton", "Catalan", \
2247 "Croatian", "Welsh", "Czech", "Danish", \
2248 "German", "English", "Spanish", "Esperanto", \
2249 "Estonian", "Basque", "Faroese", "French", \
2250 "Frisian", "Irish", "Gaelic", "Galician", \
2251 "Icelandic", "Italian", "Lappish", "Latin", \
2252 "Latvian", "Luxembourgian", "Lithuanian", "Hungarian", \
2253 "Maltese", "Dutch", "Norwegian", "Occitan", \
2254 "Polish", "Portuguese", "Romanian", "Romansh", \
2255 "Serbian", "Slovak", "Slovenian", "Finnish", \
2256 "Swedish", "Turkish", "Flemish", "Wallon"
2257
2258/** This is the second list of languages sorted by their Language codes,
2259 which start at 0x45. They stem from from EBU Tech 3264, appendix 3.
2260 E.g. language 0x45 is "Zulu", 0x50 is "Sranan Tongo", 0x58 is "Pushtu",
2261 0x60 is "Moldavian", 0x68 is "Kannada", 0x70 is "Greek", 0x78 is "Bengali",
2262 0x7f is "Amharic".
2263 See also file doc/cdtext.txt.
2264 @since 1.2.0
2265*/
2266#define BURN_CDTEXT_LANGUAGES_0X45 \
2267 "Zulu", "Vietnamese", "Uzbek", \
2268 "Urdu", "Ukrainian", "Thai", "Telugu", \
2269 "Tatar", "Tamil", "Tadzhik", "Swahili", \
2270 "Sranan Tongo", "Somali", "Sinhalese", "Shona", \
2271 "Serbo-croat", "Ruthenian", "Russian", "Quechua", \
2272 "Pushtu", "Punjabi", "Persian", "Papamiento", \
2273 "Oriya", "Nepali", "Ndebele", "Marathi", \
2274 "Moldavian", "Malaysian", "Malagasay", "Macedonian", \
2275 "Laotian", "Korean", "Khmer", "Kazakh", \
2276 "Kannada", "Japanese", "Indonesian", "Hindi", \
2277 "Hebrew", "Hausa", "Gurani", "Gujurati", \
2278 "Greek", "Georgian", "Fulani", "Dari", \
2279 "Churash", "Chinese", "Burmese", "Bulgarian", \
2280 "Bengali", "Bielorussian", "Bambora", "Azerbaijani", \
2281 "Assamese", "Armenian", "Arabic", "Amharic"
2282
2283/* This is the list of empty languages names between 0x30 and 0x44.
2284 Together the three macros fill an array of 128 char pointers.
2285 static char *languages[] = {
2286 BURN_CDTEXT_LANGUAGES_0X00,
2287 BURN_CDTEXT_FILLER,
2288 BURN_CDTEXT_LANGUAGES_0X45
2289 };
2290*/
2291#define BURN_CDTEXT_FILLER \
2292 "", "", "", "", \
2293 "", "", "", "", \
2294 "", "", "", "", \
2295 "", "", "", "", \
2296 "", "", "", "", \
2297 "", "", "", "", \
2298 ""
2299
2300/* ts B11206 */
2301/** Obtain the current settings as of burn_session_set_cdtext_par()
2302 @param s Session which to inquire
2303 @param char_codes Will return Character Codes for block 0 to 7
2304 @param copyrights Will return Copyright bytes for block 0 to 7
2305 @param block_languages Will return Language Codes for block 0 to 7
2306 @param flag Bitfiled for control purposes. Unused yet. Submit 0.
2307 @return <=0 failure, reply invalid, > 0 success, reply valid
2308 @since 1.2.0
2309*/
2310int burn_session_get_cdtext_par(struct burn_session *s,
2311 int char_codes[8], int copyrights[8],
2312 int block_languages[8], int flag);
2313
2314
2315/* ts B11206 */
2316/** Attach text or binary data as CD-TEXT attributes to a session.
2317 They can be used to generate CD-TEXT packs by burn_cdtext_from_session()
2318 or to write CD-TEXT packs into the lead-in of a CD SAO session.
2319 The latter happens only if no array of CD-TEXT packs is attached to
2320 the write options by burn_write_opts_set_leadin_text().
2321 For details of the CD-TEXT format and of the payload content, see file
2322 doc/cdtext.txt .
2323 @param s Session where to attach CD-TEXT attribute
2324 @param block Number of the language block in which the attribute
2325 shall appear. Possible values: 0 to 7.
2326 @param pack_type Pack type number. 0x80 to 0x8e. Used if pack_type_name
2327 is NULL or empty text. Else submit 0 and a name.
2328 Pack type 0x8f is generated automatically and may not
2329 be set by applications.
2330 @param pack_type_name The pack type by name. Defined names are:
2331 0x80 = "TITLE" 0x81 = "PERFORMER"
2332 0x82 = "SONGWRITER" 0x83 = "COMPOSER"
2333 0x84 = "ARRANGER" 0x85 = "MESSAGE"
2334 0x86 = "DISCID" 0x87 = "GENRE"
2335 0x88 = "TOC" 0x89 = "TOC2"
2336 0x8d = "CLOSED" 0x8e = "UPC_ISRC"
2337 Names are recognized uppercase and lowercase.
2338 @param payload Text or binary bytes. The data will be copied to
2339 session-internal memory.
2340 Pack types 0x80 to 0x85 contain 0-terminated cleartext
2341 encoded according to the block's Character Code.
2342 If double byte characters are used, then two 0-bytes
2343 terminate the cleartext.
2344 Pack type 0x86 is 0-terminated ASCII cleartext.
2345 Pack type 0x87 consists of two byte big-endian
2346 Genre code (see below BURN_CDTEXT_GENRE_LIST), and
2347 0-terminated ASCII cleartext of genre description.
2348 Pack type 0x88 mirrors the session table-of-content.
2349 Pack type 0x89 is not understood yet.
2350 Pack types 0x8a to 0x8c are reserved.
2351 Pack type 0x8d contains ISO-8859-1 cleartext which is
2352 not to be shown by commercial audio CD players.
2353 Pack type 0x8e is ASCII cleartext with UPC/EAN code.
2354 @param length Number of bytes in payload. Including terminating
2355 0-bytes.
2356 @param flag Bitfield for control purposes.
2357 bit0= payload contains double byte characters
2358 (with character code 0x80 MS-JIS japanese Kanji)
2359 @return > 0 indicates success , <= 0 is failure
2360 @since 1.2.0
2361*/
2362int burn_session_set_cdtext(struct burn_session *s, int block,
2363 int pack_type, char *pack_type_name,
2364 unsigned char *payload, int length, int flag);
2365
2366
2367/** This is the list of Genres sorted by their Genre codes.
2368 E.g. genre code 0x0000 is "No Used", 0x0008 is "Dance, 0x0010 is "Musical",
2369 0x0018 is "Rhythm & Blues", 0x001b is "World Music".
2370 See also file doc/cdtext.txt.
2371 @since 1.2.0
2372*/
2373#define BURN_CDTEXT_GENRE_LIST \
2374 "Not Used", "Not Defined", "Adult Contemporary", "Alternative Rock", \
2375 "Childrens Music", "Classical", "Contemporary Christian", "Country", \
2376 "Dance", "Easy Listening", "Erotic", "Folk", \
2377 "Gospel", "Hip Hop", "Jazz", "Latin", \
2378 "Musical", "New Age", "Opera", "Operetta", \
2379 "Pop Music", "Rap", "Reggae", "Rock Music", \
2380 "Rhythm & Blues", "Sound Effects", "Spoken Word", "World Music"
2381
2382/* The number of genre names in BURN_CDTEXT_GENRE_LIST.
2383*/
2384#define BURN_CDTEXT_NUM_GENRES 28
2385
2386
2387/* ts B11206 */
2388/** Obtain a CD-TEXT attribute that was set by burn_session_set_cdtext()
2389 @param s Session to inquire
2390 @param block Number of the language block to inquire.
2391 @param pack_type Pack type number to inquire. Used if pack_type_name
2392 is NULL or empty text. Else submit 0 and a name.
2393 Pack type 0x8f is generated automatically and may not
2394 be inquire in advance. Use burn_cdtext_from_session()
2395 to generate all packs including type 0x8f packs.
2396 @param pack_type_name The pack type by name.
2397 See above burn_session_set_cdtext().
2398 @param payload Will return a pointer to text or binary bytes.
2399 Not a copy of data. Do not free() this address.
2400 If no text attribute is attached for pack type and
2401 block, then payload is returned as NULL. The return
2402 value will not indicate error in this case.
2403 @param length Will return the number of bytes pointed to by payload.
2404 Including terminating 0-bytes.
2405 @param flag Bitfield for control purposes. Unused yet. Submit 0.
2406 @return 1 single byte char, 2 double byte char, <=0 error
2407 @since 1.2.0
2408*/
2409int burn_session_get_cdtext(struct burn_session *s, int block,
2410 int pack_type, char *pack_type_name,
2411 unsigned char **payload, int *length, int flag);
2412
2413
2414/* ts B11215 */
2415/** Read a Sony CD-TEXT Input Sheet Version 0.7T file and attach its text
2416 attributes to the given session and its tracks for the given CD-TEXT
2417 block number. This overrides previous settings made by
2418 burn_session_set_cdtext(), burn_track_set_cdtext(), burn_track_set_isrc(),
2419 burn_session_set_start_tno(). It can later be overridden by said function
2420 calls.
2421 The media catalog number from purpose specifier "UPC / EAN" gets into
2422 effect only if burn_write_opts_set_has_mediacatalog() is set to 0.
2423 The format of a v07t sheet file is documented in doc/cdtext.txt.
2424 @param session Session where to attach CD-TEXT attributes
2425 @param path Local filesystem address of the sheet file which
2426 shall be read and interpreted.
2427 @param block Number of the language block in which the attributes
2428 shall appear. Possible values: 0 to 7.
2429 @param flag Bitfield for control purposes.
2430 bit0= Permission to read multiple blocks from the
2431 given sheet file. Each block is supposed to begin
2432 by a line "Input Sheet Version = 0.7T". Therefore
2433 this permission is only valid if the input file
2434 begins by such a line.
2435 @since 1.3.2
2436 bit1= Do not use media catalog string of session or ISRC
2437 strings of tracks for writing to Q sub-channel.
2438 @since 1.2.0
2439 @return > 0 indicates success and the number of interpreted
2440 blocks (1 if not flag bit0 is set).
2441 <= 0 indicates failure
2442 @since 1.2.0
2443*/
2444int burn_session_input_sheet_v07t(struct burn_session *session,
2445 char *path, int block, int flag);
2446
2447
2448/* ts B11210 */
2449/** Produce an array of CD-TEXT packs that could be submitted to
2450 burn_write_opts_set_leadin_text(), or stored as *.cdt file,
2451 or submitted to burn_make_input_sheet_v07t().
2452 For a description of the format of the array, see file doc/cdtext.txt.
2453 The input data stem from burn_session_set_cdtext_par(),
2454 burn_session_set_cdtext(), and burn_track_set_cdtext().
2455 @param s Session from which to produce CD-TEXT packs.
2456 @param text_packs Will return the buffer with the CD-TEXT packs.
2457 Dispose by free() when no longer needed.
2458 @param num_packs Will return the number of 18 byte text packs.
2459 @param flag Bitfield for control purposes.
2460 bit0= do not return generated CD-TEXT packs,
2461 but check whether production would work and
2462 indicate the number of packs by the call return
2463 value. This happens also if
2464 (text_packs == NULL || num_packs == NULL).
2465 @return Without flag bit0: > 0 is success, <= 0 failure
2466 With flag bit0: > 0 is number of packs,
2467 0 means no packs will be generated,
2468 < 0 means failure
2469 @since 1.2.0
2470*/
2471int burn_cdtext_from_session(struct burn_session *s,
2472 unsigned char **text_packs, int *num_packs,
2473 int flag);
2474
2475
2476/* ts B30519 */
2477/** Convert an array of CD-TEXT packs into the text format of
2478 Sony CD-TEXT Input Sheet Version 0.7T .
2479
2480 @param text_packs Array of bytes which form CD-TEXT packs of 18 bytes
2481 each. For a description of the format of the array,
2482 see file doc/cdtext.txt.
2483 No header of 4 bytes must be prepended which would
2484 tell the number of pack bytes + 2.
2485 This parameter may be NULL if the currently attached
2486 array of packs shall be removed.
2487 @param num_packs The number of 18 byte packs in text_packs.
2488 @param start_tno The start number of track counting, if known from
2489 CD table-of-content or other sources.
2490 Submit 0 to enable the attempt to read it and the
2491 track_count from pack type 0x8f.
2492 @param track_count The number of tracks, if known from CD table-of-content
2493 or orther sources.
2494 @param result Will return the buffer with Sheet text.
2495 Dispose by free() when no longer needed.
2496 It will be filled by the text for the v07t sheet file
2497 plus a trailing 0-byte. (Be aware that double-byte
2498 characters might contain 0-bytes, too.)
2499 Each CD-TEXT language block starts by the line
2500 "Input Sheet Version = 0.7T"
2501 and a "Remarks" line that tells the block number.
2502 @param char_code Returns the character code of the pack array:
2503 0x00 = ISO-8859-1
2504 0x01 = 7 bit ASCII
2505 0x80 = MS-JIS (japanese Kanji, double byte characters)
2506 The presence of a code value that is not in this list
2507 will cause this function to fail.
2508 @param flag Bitfield for control purposes. Unused yet. Submit 0.
2509 @return > 0 tells the number of valid text bytes in result.
2510 This does not include the trailing 0-byte.
2511 <= 0 indicates failure.
2512 @since 1.3.2
2513*/
2514int burn_make_input_sheet_v07t(unsigned char *text_packs, int num_packs,
2515 int start_tno, int track_count,
2516 char **result, int *char_code, int flag);
2517
2518
2519/* ts B11206 */
2520/** Remove all CD-TEXT attributes of the given block from the session.
2521 They were attached by burn_session_set_cdtext().
2522 @param s Session where to remove the CD-TEXT attribute
2523 @param block Number of the language block in which the attribute
2524 shall appear. Possible values: 0 to 7.
2525 -1 causes text packs of all blocks to be removed.
2526 @return > 0 is success, <= 0 failure
2527 @since 1.2.0
2528*/
2529int burn_session_dispose_cdtext(struct burn_session *s, int block);
2530
2531
2532/* ts B11221*/
2533/** Read an array of CD-TEXT packs from a file. This array should be suitable
2534 for burn_write_opts_set_leadin_text().
2535 The function tolerates and removes 4-byte headers as produced by
2536 cdrecord -vv -toc, if this header tells the correct number of bytes which
2537 matches the file size. If no 4-byte header is present, then the function
2538 tolerates and removes a trailing 0-byte as of Sony specs.
2539 @param path Filesystem address of the CD-TEXT pack file.
2540 Normally with suffix .cdt or .dat
2541 @param text_packs Will return the buffer with the CD-TEXT packs.
2542 Dispose by free() when no longer needed.
2543 @param num_packs Will return the number of 18 byte text packs.
2544 @param flag Bitfield for control purposes. Unused yet.Submit 0.
2545 @return 0 is success, <= 0 failure
2546 @since 1.2.0
2547*/
2548int burn_cdtext_from_packfile(char *path, unsigned char **text_packs,
2549 int *num_packs, int flag);
2550
2551
2552/** Define the data in a track
2553 @param t the track to define
2554 @param offset The lib will write this many 0s before start of data
2555 @param tail The number of extra 0s to write after data
2556 @param pad 1 means the lib should pad the last sector with 0s if the
2557 track isn't exactly sector sized. (otherwise the lib will
2558 begin reading from the next track)
2559 @param mode data format (bitfield)
2560*/
2561void burn_track_define_data(struct burn_track *t, int offset, int tail,
2562 int pad, int mode);
2563
2564
2565/* ts B11206 */
2566/** Attach text or binary data as CD-TEXT attributes to a track.
2567 The payload will be used to generate CD-TEXT packs by
2568 burn_cdtext_from_session() or to write CD-TEXT packs into the lead-in
2569 of a CD SAO session. This happens if the CD-TEXT attribute of the session
2570 gets generated, which has the same block number and pack type. In this
2571 case, each track should have such a CD-TEXT attribute, too.
2572 See burn_session_set_cdtext().
2573 Be cautious not to exceed the maximum number of 253 payload packs per
2574 language block. Use burn_cdtext_from_session() to learn whether a valid
2575 array of CD-TEXT packs can be generated from your attributes.
2576 @param t Track where to attach CD-TEXT attribute.
2577 @param block Number of the language block in which the attribute
2578 shall appear. Possible values: 0 to 7.
2579 @param pack_type Pack type number. 0x80 to 0x85 or 0x8e. Used if
2580 pack_type_name is NULL or empty text. Else submit 0
2581 and a name.
2582 @param pack_type_name The pack type by name. Applicable names are:
2583 0x80 = "TITLE" 0x81 = "PERFORMER"
2584 0x82 = "SONGWRITER" 0x83 = "COMPOSER"
2585 0x84 = "ARRANGER" 0x85 = "MESSAGE"
2586 0x8e = "UPC_ISRC"
2587 @param payload 0-terminated cleartext. If double byte characters
2588 are used, then two 0-bytes terminate the cleartext.
2589 @param length Number of bytes in payload. Including terminating
2590 0-bytes.
2591 @param flag Bitfield for control purposes.
2592 bit0= payload contains double byte characters
2593 (with character code 0x80 MS-JIS japanese Kanji)
2594 @return > 0 indicates success , <= 0 is failure
2595 @since 1.2.0
2596*/
2597int burn_track_set_cdtext(struct burn_track *t, int block,
2598 int pack_type, char *pack_type_name,
2599 unsigned char *payload, int length, int flag);
2600
2601/* ts B11206 */
2602/** Obtain a CD-TEXT attribute that was set by burn_track_set_cdtext().
2603 @param t Track to inquire
2604 @param block Number of the language block to inquire.
2605 @param pack_type Pack type number to inquire. Used if pack_type_name
2606 is NULL or empty text. Else submit 0 and a name.
2607 @param pack_type_name The pack type by name.
2608 See above burn_track_set_cdtext().
2609 @param payload Will return a pointer to text bytes.
2610 Not a copy of data. Do not free() this address.
2611 If no text attribute is attached for pack type and
2612 block, then payload is returned as NULL. The return
2613 value will not indicate error in this case.
2614 @param length Will return the number of bytes pointed to by payload.
2615 Including terminating 0-bytes.
2616 @param flag Bitfield for control purposes. Unused yet. Submit 0.
2617 @return 1=single byte char , 2= double byte char , <=0 error
2618 @since 1.2.0
2619*/
2620int burn_track_get_cdtext(struct burn_track *t, int block,
2621 int pack_type, char *pack_type_name,
2622 unsigned char **payload, int *length, int flag);
2623
2624/* ts B11206 */
2625/** Remove all CD-TEXT attributes of the given block from the track.
2626 They were attached by burn_track_set_cdtext().
2627 @param t Track where to remove the CD-TEXT attribute.
2628 @param block Number of the language block in which the attribute
2629 shall appear. Possible values: 0 to 7.
2630 -1 causes text packs of all blocks to be removed.
2631 @return > 0 is success, <= 0 failure
2632 @since 1.2.0
2633*/
2634int burn_track_dispose_cdtext(struct burn_track *t, int block);
2635
2636
2637/* ts A90910 */
2638/** Activates CD XA compatibility modes.
2639 libburn currently writes data only in CD mode 1. Some programs insist in
2640 sending data with additional management bytes. These bytes have to be
2641 stripped in order to make the input suitable for BURN_MODE1.
2642 @param t The track to manipulate
2643 @param value 0= no conversion
2644 1= strip 8 byte sector headers of CD-ROM XA mode 2 form 1
2645 see MMC-5 4.2.3.8.5.3 Block Format for Mode 2 form 1 Data
2646 all other values are reserved
2647 @return 1=success , 0=unacceptable value
2648 @since 0.7.2
2649*/
2650int burn_track_set_cdxa_conv(struct burn_track *t, int value);
2651
2652
2653/** Set the ISRC details for a track. When writing to CD media, ISRC will get
2654 written into the Q sub-channel.
2655 @param t The track to change
2656 @param country the 2 char country code. Each character must be
2657 only numbers or letters.
2658 @param owner 3 char owner code. Each character must be only numbers
2659 or letters.
2660 @param year 2 digit year. A number in 0-99 (Yep, not Y2K friendly).
2661 @param serial 5 digit serial number. A number in 0-99999.
2662*/
2663void burn_track_set_isrc(struct burn_track *t, char *country, char *owner,
2664 unsigned char year, unsigned int serial);
2665
2666/* ts B11226 */
2667/** Set the composed ISRC string for a track. This is an alternative to
2668 burn_track_set_isrc().
2669 @param t The track to be manipulated
2670 @param isrc 12 characters which are composed from ISRC details.
2671 Format is CCOOOYYSSSSS, terminated by a 0-byte:
2672 Country, Owner, Year(decimal digits), Serial(decimal digits).
2673 @param flag Bitfield for control purposes. Unused yet. Submit 0.
2674 @return > 0 indicates success, <= 0 means failure
2675 @since 1.2.0
2676*/
2677int burn_track_set_isrc_string(struct burn_track *t, char isrc[13], int flag);
2678
2679/** Disable ISRC parameters for a track
2680 @param t The track to change
2681*/
2682void burn_track_clear_isrc(struct burn_track *t);
2683
2684
2685/* ts B20103 */
2686/** Define an index start address within a track. The index numbers inside a
2687 track have to form sequence starting at 0 or 1 with no gaps up to the
2688 highest number used. They affect only writing of CD SAO sessions.
2689 The first index start address of a track must be 0.
2690 Blocks between index 0 and index 1 are considered to be located before the
2691 track start as of the table-of-content.
2692 @param t The track to be manipulated
2693 @param index_number A number between 0 and 99
2694 @param relative_lba The start address relative to the start of the
2695 burn_source of the track. It will get mapped to the
2696 appropriate absolute block address.
2697 @param flag Bitfield for control purposes. Unused yet. Submit 0.
2698 @return > 0 indicates success, <= 0 means failure
2699 @since 1.2.0
2700*/
2701int burn_track_set_index(struct burn_track *t, int index_number,
2702 unsigned int relative_lba, int flag);
2703
2704/* ts B20103 */
2705/** Remove all index start addresses and reset to the default indexing of
2706 CD SAO sessions. This means index 0 of track 1 reaches from LBA -150
2707 to LBA -1. Index 1 of track 1 reaches from LBA 0 to track end. Index 1
2708 of track 2 follows immediately. The same happens for all further tracks
2709 after the end of their predecessor.
2710 @param t The track to be manipulated
2711 @param flag Bitfield for control purposes. Unused yet. Submit 0.
2712 @return > 0 indicates success, <= 0 means failure
2713 @since 1.2.0
2714*/
2715int burn_track_clear_indice(struct burn_track *t, int flag);
2716
2717
2718/* ts B20110 */
2719/** Define whether a pre-gap shall be written before the track and how many
2720 sectors this pre-gap shall have. A pre-gap is written in the range of track
2721 index 0 and contains zeros (audio silence). No bytes from the track source
2722 will be read for writing the pre-gap.
2723 This setting affects only CD SAO write runs.
2724 The first track automatically gets a pre-gap of at least 150 sectors. Its
2725 size may be enlarged by this call. Further pre-gaps are demanded by MMC
2726 for tracks which follow tracks of a different mode. (But Mode mixing in
2727 CD SAO sessions is currently not supported by libburn.)
2728 @param t The track to change
2729 @param size Number of sectors in the pre-gap.
2730 -1 disables pre-gap, except for the first track.
2731 libburn allows 0, but MMC does not propose this.
2732 @param flag Bitfield for control purposes. Unused yet. Submit 0.
2733 @return > 0 indicates success, <= 0 means failure
2734 @since 1.2.0
2735*/
2736int burn_track_set_pregap_size(struct burn_track *t, int size, int flag);
2737
2738/* ts B20111 */
2739/** Define whether a post-gap shall be written at the end of the track and
2740 how many sectors this gap shall have. A post-gap occupies the range of
2741 an additional index of the track. It contains zeros. No bytes from the
2742 track source will be read for writing the post-gap.
2743 This setting affects only CD SAO write runs.
2744 MMC prescribes to add a post-gap to a data track which is followed by
2745 a non-data track. (But libburn does not yet support mixed mode CD SAO
2746 sessions.)
2747 @param t The track to change
2748 @param size Number of sectors in the post-gap.
2749 -1 disables post-gap.
2750 libburn allows 0, but MMC does not propose this.
2751 @param flag Bitfield for control purposes. Unused yet. Submit 0.
2752 @return > 0 indicates success, <= 0 means failure
2753 @since 1.2.0
2754*/
2755int burn_track_set_postgap_size(struct burn_track *t, int size, int flag);
2756
2757
2758/* ts A61024 */
2759/** Define whether a track shall swap bytes of its input stream.
2760 @param t The track to change
2761 @param swap_source_bytes 0=do not swap, 1=swap byte pairs
2762 @return 1=success , 0=unacceptable value
2763 @since 0.2.6
2764*/
2765int burn_track_set_byte_swap(struct burn_track *t, int swap_source_bytes);
2766
2767
2768/** Hide the first track in the "pre gap" of the disc
2769 @param s session to change
2770 @param onoff 1 to enable hiding, 0 to disable
2771*/
2772void burn_session_hide_first_track(struct burn_session *s, int onoff);
2773
2774/** Get the drive's disc struct - free when done
2775 @param d drive to query
2776 @return the disc struct or NULL on failure
2777*/
2778struct burn_disc *burn_drive_get_disc(struct burn_drive *d);
2779
2780/** Set the track's data source
2781 @param t The track to set the data source for
2782 @param s The data source to use for the contents of the track
2783 @return An error code stating if the source is ready for use for
2784 writing the track, or if an error occurred
2785
2786*/
2788 struct burn_source *s);
2789
2790
2791/* ts A70218 */
2792/** Set a default track size to be used only if the track turns out to be of
2793 unpredictable length and if the effective write type demands a fixed size.
2794 This can be useful to enable write types CD SAO or DVD DAO together with
2795 a track source like stdin. If the track source delivers fewer bytes than
2796 announced then the track will be padded up with zeros.
2797 @param t The track to change
2798 @param size The size to set
2799 @return 0=failure 1=success
2800 @since 0.3.4
2801*/
2802int burn_track_set_default_size(struct burn_track *t, off_t size);
2803
2804/** Free a burn_source (decrease its refcount and maybe free it)
2805 @param s Source to free
2806*/
2808
2809/** Creates a data source for an image file (and maybe subcode file)
2810 @param path The file address for the main channel payload.
2811 @param subpath Eventual address for subchannel data. Only used in exotic
2812 raw write modes. Submit NULL for normal tasks.
2813 @return Pointer to a burn_source object, NULL indicates failure
2814*/
2815struct burn_source *burn_file_source_new(const char *path,
2816 const char *subpath);
2817
2818
2819/* ts A91122 : An interface to open(O_DIRECT) or similar OS tricks. */
2820
2821/** Opens a file with eventual acceleration preparations which may depend
2822 on the operating system and on compile time options of libburn.
2823 You may use this call instead of open(2) for opening file descriptors
2824 which shall be handed to burn_fd_source_new().
2825 This should only be done for tracks with BURN_BLOCK_MODE1 (2048 bytes
2826 per block).
2827
2828 If you use this call then you MUST allocate the buffers which you use
2829 with read(2) by call burn_os_alloc_buffer(). Read sizes MUST be a multiple
2830 of a safe buffer amount. Else you risk that track data get altered during
2831 transmission.
2832 burn_disk_write() will allocate a suitable read/write buffer for its own
2833 operations. A fifo created by burn_fifo_source_new() will allocate
2834 suitable memory for its buffer if called with flag bit0 and a multiple
2835 of a safe buffer amount.
2836 @param path The file address to open
2837 @param open_flags The flags as of man 2 open. Normally just O_RDONLY.
2838 @param flag Bitfield for control purposes (unused yet, submit 0).
2839 @return A file descriptor as of open(2). Finally to be disposed
2840 by close(2).
2841 -1 indicates failure.
2842 @since 0.7.4
2843*/
2844int burn_os_open_track_src(char *path, int open_flags, int flag);
2845
2846/** Allocate a memory area that is suitable for reading with a file descriptor
2847 opened by burn_os_open_track_src().
2848 @param amount Number of bytes to allocate. This should be a multiple
2849 of the operating system's i/o block size. 32 KB is
2850 guaranteed by libburn to be safe.
2851 @param flag Bitfield for control purposes (unused yet, submit 0).
2852 @return The address of the allocated memory, or NULL on failure.
2853 A non-NULL return value has finally to be disposed via
2854 burn_os_free_buffer().
2855 @since 0.7.4
2856*/
2857void *burn_os_alloc_buffer(size_t amount, int flag);
2858
2859/** Dispose a memory area which was obtained by burn_os_alloc_buffer(),
2860 @param buffer Memory address to be freed.
2861 @param amount The number of bytes which was allocated at that
2862 address.
2863 @param flag Bitfield for control purposes (unused yet, submit 0).
2864 @return 1 success , <=0 failure
2865 @since 0.7.4
2866*/
2867int burn_os_free_buffer(void *buffer, size_t amount, int flag);
2868
2869
2870/** Creates a data source for an image file (a track) from an open
2871 readable filedescriptor, an eventually open readable subcodes file
2872 descriptor and eventually a fixed size in bytes.
2873 @param datafd The source of data.
2874 @param subfd The eventual source of subchannel data. Only used in exotic
2875 raw write modes. Submit -1 for normal tasks.
2876 @param size The eventual fixed size of eventually both fds.
2877 If this value is 0, the size will be determined from datafd.
2878 @return Pointer to a burn_source object, NULL indicates failure
2879*/
2880struct burn_source *burn_fd_source_new(int datafd, int subfd, off_t size);
2881
2882
2883/* ts B00922 */
2884/** Creates an offset source which shall provide a byte interval of a stream
2885 to its consumer. It is supposed to be chain-linked with other offset
2886 sources which serve neighboring consumers. The chronological sequence
2887 of consumers and the sequence of offset sources must match. The intervals
2888 of the sources must not overlap.
2889
2890 A chain of these burn_source objects may be used to feed multiple tracks
2891 from one single stream of input bytes.
2892 Each of the offset sources will skip the bytes up to its start address and
2893 provide the prescribed number of bytes to the track. Skipping takes into
2894 respect the bytes which have been processed by eventual predecessors in the
2895 chain.
2896 Important: It is not allowed to free an offset source before its successor
2897 has ended its work. Best is to keep them all until all tracks
2898 are done.
2899
2900 @param inp The burn_source object from which to read stream data.
2901 E.g. created by burn_file_source_new().
2902 @param prev The eventual offset source object which shall read data from
2903 inp before the new offset source will begin its own work.
2904 This must either be a result of burn_offst_source_new() or
2905 it must be NULL.
2906 @param start The byte address where to start reading bytes for the
2907 consumer. inp bytes may get skipped to reach this address.
2908 @param size The number of bytes to be delivered to the consumer.
2909 If size is <= 0 then it may be set later by a call of method
2910 set_size(). If it is >= 0, then it can only be changed if
2911 flag bit0 was set with burn_offst_source_new().
2912 @param flag Bitfield for control purposes
2913 bit0 = Prevent set_size() from overriding interval sizes > 0.
2914 If such a size is already set, then the new one will
2915 only affect the reply of get_size().
2916 See also above struct burn_source.
2917 @since 1.2.0
2918 @return Pointer to a burn_source object, later to be freed by
2919 burn_source_free(). NULL indicates failure.
2920 @since 0.8.8
2921*/
2923 struct burn_source *inp, struct burn_source *prev,
2924 off_t start, off_t size, int flag);
2925
2926/* ts A70930 */
2927/** Creates a fifo which acts as proxy for an already existing data source.
2928 The fifo provides a ring buffer which shall smoothen the data stream
2929 between burn_source and writer thread. Each fifo serves only for one
2930 data source. It may be attached to one track as its only data source
2931 by burn_track_set_source(), or it may be used as input for other burn
2932 sources.
2933 A fifo starts its life in "standby" mode with no buffer space allocated.
2934 As soon as its consumer requires bytes, the fifo establishes a worker
2935 thread and allocates its buffer. After input has ended and all buffer
2936 content is consumed, the buffer space gets freed and the worker thread
2937 ends. This happens asynchronously. So expect two buffers and worker threads
2938 to exist for a short time between tracks. Be modest in your size demands if
2939 multiple tracks are to be expected.
2940 @param inp The burn_source for which the fifo shall act as proxy.
2941 It can be disposed by burn_source_free() immediately
2942 after this call.
2943 @param chunksize The size in bytes of a chunk.
2944 Use 2048 for sources suitable for BURN_BLOCK_MODE1,
2945 2352 for sources which deliver for BURN_BLOCK_AUDIO,
2946 2056 for sources which shall get treated by
2947 burn_track_set_cdxa_conv(track, 1).
2948 Some variations of burn_source might work only with
2949 a particular chunksize. E.g. libisofs demands 2048.
2950 @param chunks The number of chunks to be allocated in ring buffer.
2951 This value must be >= 2.
2952 @param flag Bitfield for control purposes:
2953 bit0= The read method of inp is capable of delivering
2954 arbitrary amounts of data per call. Not only one
2955 sector.
2956 Suitable for inp from burn_file_source_new()
2957 and burn_fd_source_new() if not the fd has
2958 exotic limitations on read size.
2959 You MUST use this on inp which uses an fd opened
2960 with burn_os_open_track_src().
2961 Better do not use with other inp types.
2962 @since 0.7.4
2963 @return A pointer to the newly created burn_source.
2964 Later both burn_sources, inp and the returned fifo, have
2965 to be disposed by calling burn_source_free() for each.
2966 inp can be freed immediately, the returned fifo may be
2967 kept as handle for burn_fifo_inquire_status().
2968 @since 0.4.0
2969*/
2971 int chunksize, int chunks, int flag);
2972
2973/* ts A71003 */
2974/** Inquires state and fill parameters of a fifo burn_source which was created
2975 by burn_fifo_source_new() . Do not use with other burn_source variants.
2976 @param fifo The fifo object to inquire
2977 @param size The total size of the fifo
2978 @param free_bytes The current free capacity of the fifo
2979 @param status_text Returns a pointer to a constant text, see below
2980 @return <0 reply invalid, >=0 fifo status code:
2981 bit0+1=input status, bit2=consumption status, i.e:
2982 0="standby" : data processing not started yet
2983 1="active" : input and consumption are active
2984 2="ending" : input has ended without error
2985 3="failing" : input had error and ended,
2986 4="unused" : ( consumption has ended before processing start )
2987 5="abandoned" : consumption has ended prematurely
2988 6="ended" : consumption has ended without input error
2989 7="aborted" : consumption has ended after input error
2990 @since 0.4.0
2991*/
2992int burn_fifo_inquire_status(struct burn_source *fifo, int *size,
2993 int *free_bytes, char **status_text);
2994
2995/* ts A91125 */
2996/** Inquire various counters which reflect the fifo operation.
2997 @param fifo The fifo object to inquire
2998 @param total_min_fill The minimum number of bytes in the fifo. Beginning
2999 from the moment when fifo consumption is enabled.
3000 @param interval_min_fill The minimum byte number beginning from the moment
3001 when fifo consumption is enabled or from the
3002 most recent moment when burn_fifo_next_interval()
3003 was called.
3004 @param put_counter The number of data transactions into the fifo.
3005 @param get_counter The number of data transactions out of the fifo.
3006 @param empty_counter The number of times the fifo was empty.
3007 @param full_counter The number of times the fifo was full.
3008 @since 0.7.4
3009*/
3011 int *total_min_fill, int *interval_min_fill,
3012 int *put_counter, int *get_counter,
3013 int *empty_counter, int *full_counter);
3014
3015/* ts A91125 */
3016/** Inquire the fifo minimum fill counter for intervals and reset that counter.
3017 @param fifo The fifo object to inquire
3018 @param interval_min_fill The minimum number of bytes in the fifo. Beginning
3019 from the moment when fifo consumption is enabled
3020 or from the most recent moment when
3021 burn_fifo_next_interval() was called.
3022 @since 0.7.4
3023*/
3024void burn_fifo_next_interval(struct burn_source *fifo, int *interval_min_fill);
3025
3026/* ts A80713 */
3027/** Obtain a preview of the first input data of a fifo which was created
3028 by burn_fifo_source_new(). The data will later be delivered normally to
3029 the consumer track of the fifo.
3030 bufsize may not be larger than the fifo size (chunk_size * chunks) - 32k.
3031 This call will succeed only if data consumption by the track has not
3032 started yet, i.e. best before the call to burn_disc_write().
3033 It will start the worker thread of the fifo with the expectable side
3034 effects on the external data source. Then it waits either until enough
3035 data have arrived or until it becomes clear that this will not happen.
3036 The call may be repeated with increased bufsize. It will always yield
3037 the bytes beginning from the first one in the fifo.
3038 @param fifo The fifo object to start and to inquire
3039 @param buf Pointer to memory of at least bufsize bytes where to
3040 deliver the peeked data.
3041 @param bufsize Number of bytes to peek from the start of the fifo data
3042 @param flag Bitfield for control purposes (unused yet, submit 0).
3043 @return <0 on severe error, 0 if not enough data, 1 if bufsize bytes read
3044 @since 0.5.0
3045*/
3046int burn_fifo_peek_data(struct burn_source *fifo, char *buf, int bufsize,
3047 int flag);
3048
3049/* ts A91125 */
3050/** Start the fifo worker thread and wait either until the requested number
3051 of bytes have arrived or until it becomes clear that this will not happen.
3052 Filling will go on asynchronously after burn_fifo_fill() returned.
3053 This call and burn_fifo_peek_data() do not disturb each other.
3054 @param fifo The fifo object to start
3055 @param fill Number of bytes desired. Expect to get return 1 if
3056 at least fifo size - 32k were read.
3057 @param flag Bitfield for control purposes.
3058 bit0= fill fifo to maximum size
3059 @return <0 on severe error, 0 if not enough data,
3060 1 if desired amount or fifo full
3061 @since 0.7.4
3062*/
3063int burn_fifo_fill(struct burn_source *fifo, int fill, int flag);
3064
3065
3066/* ts A70328 */
3067/** Sets a fixed track size after the data source object has already been
3068 created.
3069 @param t The track to operate on
3070 @param size the number of bytes to use as track size
3071 @return <=0 indicates failure , >0 success
3072 @since 0.3.6
3073*/
3074int burn_track_set_size(struct burn_track *t, off_t size);
3075
3076
3077/** Tells how many sectors a track will have on disc, or already has on
3078 disc. This includes offset, payload, tail, and post-gap, but not pre-gap.
3079 The result is NOT RELIABLE with tracks of undefined length
3080*/
3081int burn_track_get_sectors(struct burn_track *);
3082
3083/* ts C40302 */
3084/** Like burn_track_get_sectors(), but with return type off_t.
3085 @since 1.5.8
3086*/
3087off_t burn_track_get_sectors_v2(struct burn_track *);
3088
3089/* ts A61101 */
3090/** Tells how many source bytes have been read and how many data bytes have
3091 been written by the track during burn.
3092 @param t The track to inquire
3093 @param read_bytes Number of bytes read from the track source
3094 @param written_bytes Number of bytes written to track
3095 @since 0.2.6
3096*/
3097int burn_track_get_counters(struct burn_track *t,
3098 off_t *read_bytes, off_t *written_bytes);
3099
3100
3101/** Sets drive read and write speed.
3102 Note: "k" is 1000, not 1024.
3103 1xCD = 176.4 k/s, 1xDVD = 1385 k/s, 1xBD = 4496 k/s.
3104 Fractional speeds should be rounded up. Like 4xCD = 706.
3105 @param d The drive to set speed for
3106 @param read Read speed in k/s (0 is max, -1 is min).
3107 @param write Write speed in k/s (0 is max, -1 is min).
3108*/
3109void burn_drive_set_speed(struct burn_drive *d, int read, int write);
3110
3111
3112/* ts C00822 */
3113/** Sets drive read and write speed using the "Exact" bit of SCSI command
3114 SET STREAMING. This command will be used even if a CD medium is present.
3115 MMC specifies that with the Exact bit the desired speed settings shall
3116 either be obeyed by the drive exactly, or that the drive shall indicate
3117 failure and not accept the settings.
3118 But many drives reply no error and nevertheless adjust their read speed
3119 only coarsly or ignore the setting after a few MB of fast read attempts.
3120
3121 The call parameters have the same meaning as with burn_drive_set_speed().
3122 @param d The drive to set speed for. It must be a role 1 drive.
3123 @param read Read speed in k/s (0 is max, -1 is min).
3124 @param write Write speed in k/s (0 is max, -1 is min).
3125 @return 1=success , 0=failure
3126 @since 1.5.4
3127*/
3128int burn_drive_set_speed_exact(struct burn_drive *d, int read, int write);
3129
3130
3131/* ts C00822 */
3132/** Waits until the time has elapsed since the given previous time to transmit
3133 the given byte count with the given speed in KB/second (KB = 1000 bytes).
3134 This call may be used between random access read operations like
3135 burn_read_data() in order to force a slower speed than the drive is
3136 willing to use if it gets read requests as fast as it delivers data.
3137
3138 The parameter us_corr carries microseconds of time deviations from one
3139 call to the next one. Such deviations may happen because of small
3140 inexactnesses of the sleeper function and because of temporary delays
3141 in the data supply so that sleeping for a negative time span would have
3142 been necessary. The next call will reduce or enlarge its own sleeping
3143 period by this value.
3144
3145 @param kb_per_second the desired speed in 1000 bytes per second.
3146 Supplied by the caller.
3147 @max_corr the maximum backlog in microseconds which shall
3148 be compensated by the next call. Supplied by the
3149 caller. Not more than 1 billion = 1000 seconds.
3150 @param prev_time time keeper updated by burn_nominal_slowdown().
3151 The caller provides the memory and elsewise should
3152 carry it unchanged from call to call.
3153 @param us_corr updated by burn_nominal_slowdown(). See above.
3154 The caller provides the memory and elsewise should
3155 carry it unchanged from call to call.
3156 @param b_since_prev byte count since the previous call. This number
3157 has to be counted and supplied by the caller.
3158 @param flag Bitfield for control purposes:
3159 bit0= initialize *prev_time and *us_corr,
3160 ignore other parameters, do not wait
3161 @return 2=no wait because no usable kb_per_second , 1=success , 0=failure
3162 @since 1.5.4
3163*/
3164int burn_nominal_slowdown(int kb_per_second, int max_corr,
3165 struct timeval *prev_time,
3166 int *us_corr, off_t b_since_prev, int flag);
3167
3168
3169/* ts A70711 */
3170/** Controls the behavior with writing when the drive buffer is suspected to
3171 be full. To check and wait for enough free buffer space before writing
3172 will move the task of waiting from the operating system's device driver
3173 to libburn. While writing is going on and waiting is enabled, any write
3174 operation will be checked whether it will fill the drive buffer up to
3175 more than max_percent. If so, then waiting will happen until the buffer
3176 fill is predicted with at most min_percent.
3177 Thus: if min_percent < max_percent then transfer rate will oscillate.
3178 This may allow the driver to operate on other devices, e.g. a disk from
3179 which to read the input for writing. On the other hand, this checking might
3180 reduce maximum throughput to the drive or even get misled by faulty buffer
3181 fill replies from the drive.
3182 If a setting parameter is < 0, then this setting will stay unchanged
3183 by the call.
3184 Known burner or media specific pitfalls:
3185 To have max_percent larger than the burner's best reported buffer fill has
3186 the same effect as min_percent==max_percent. Some burners do not report
3187 their full buffer with all media types. Some are not suitable because
3188 they report their buffer fill with delay. Some do not go to full speed
3189 unless their buffer is full.
3190
3191 @param d The drive to control
3192 @param enable 0= disable , 1= enable waiting , (-1 = do not change setting)
3193 @param min_usec Shortest possible sleeping period (given in micro seconds)
3194 @param max_usec Longest possible sleeping period (given in micro seconds)
3195 @param timeout_sec If a single write has to wait longer than this number
3196 of seconds, then waiting gets disabled and mindless
3197 writing starts. A value of 0 disables this timeout.
3198 @param min_percent Minimum of desired buffer oscillation: 25 to 100
3199 @param max_percent Maximum of desired buffer oscillation: 25 to 100
3200 @return 1=success , 0=failure
3201 @since 0.3.8
3202*/
3203int burn_drive_set_buffer_waiting(struct burn_drive *d, int enable,
3204 int min_usec, int max_usec, int timeout_sec,
3205 int min_percent, int max_percent);
3206
3207/* ts B61116 */
3208/** Control the write simulation mode before or after burn_write_opts get
3209 into effect.
3210 Beginning with version 1.4.8 a burn run by burn_disc_write() brings the
3211 burn_drive object in the simulation state as set to the burn_write_opts
3212 by burn_write_opts_set_simulate(). This state is respected by call
3213 burn_random_access_write() until a new call of burn_disc_write() happens
3214 or until burn_drive_reset_simulate() is called.
3215 This call may only be made when burn_drive_get_status() returns
3216 BURN_DRIVE_IDLE.
3217
3218 @param d The drive to control
3219 @param simulate 1 enables simulation, 0 enables real writing
3220 @return 1=success , 0=failure
3221 @since 1.4.8
3222*/
3223int burn_drive_reset_simulate(struct burn_drive *d, int simulate);
3224
3225
3226/* these are for my [Derek Foreman's ?] debugging, they will disappear */
3227/* ts B11012 :
3228 Of course, API symbols will not disappear. But these functions are of
3229 few use, as they only print DEBUG messages.
3230*/
3231void burn_structure_print_disc(struct burn_disc *d);
3232void burn_structure_print_session(struct burn_session *s);
3233void burn_structure_print_track(struct burn_track *t);
3234
3235/** Sets the write type for the write_opts struct.
3236 Note: write_type BURN_WRITE_SAO is currently not capable of writing a mix
3237 of data and audio tracks. You must use BURN_WRITE_TAO for such sessions.
3238 @param opts The write opts to change
3239 @param write_type The write type to use
3240 @param block_type The block type to use
3241 @return Returns 1 on success and 0 on failure.
3242*/
3243int burn_write_opts_set_write_type(struct burn_write_opts *opts,
3244 enum burn_write_types write_type,
3245 int block_type);
3246
3247
3248/* ts A70207 */
3249/** As an alternative to burn_write_opts_set_write_type() this function tries
3250 to find a suitable write type and block type for a given write job
3251 described by opts and disc. To be used after all other setups have been
3252 made, i.e. immediately before burn_disc_write().
3253 @param opts The nearly complete write opts to change
3254 @param disc The already composed session and track model
3255 @param reasons This text string collects reasons for decision or failure
3256 @param flag Bitfield for control purposes:
3257 bit0= do not choose type but check the one that is already set
3258 bit1= do not issue error messages via burn_msgs queue
3259 (is automatically set with bit0)
3260 @return Chosen write type. BURN_WRITE_NONE on failure.
3261 @since 0.3.2
3262*/
3264 struct burn_write_opts *opts, struct burn_disc *disc,
3265 char reasons[BURN_REASONS_LEN], int flag);
3266
3267
3268/** Supplies toc entries for writing - not normally required for cd mastering
3269 @param opts The write opts to change
3270 @param count The number of entries
3271 @param toc_entries
3272*/
3273void burn_write_opts_set_toc_entries(struct burn_write_opts *opts,
3274 int count,
3275 struct burn_toc_entry *toc_entries);
3276
3277/** Sets the session format for a disc
3278 @param opts The write opts to change
3279 @param format The session format to set
3280*/
3281void burn_write_opts_set_format(struct burn_write_opts *opts, int format);
3282
3283/** Sets the simulate value for the write_opts struct .
3284 This corresponds to the Test Write bit in MMC mode page 05h. Several media
3285 types do not support this. See struct burn_multi_caps.might_simulate for
3286 actual availability of this feature.
3287 If the media is suitable, the drive will perform burn_disc_write() as a
3288 simulation instead of effective write operations. This means that the
3289 media content and burn_disc_get_status() stay unchanged.
3290 Note: With stdio-drives, the target file gets eventually created, opened,
3291 lseeked, and closed, but not written. So there are effects on it.
3292 Note: Up to version 1.4.6 the call burn_random_access_write() after
3293 burn_disc_write() did not simulate because it does not get any
3294 burn_write_opts and the drive did not memorize the simulation state.
3295 This has changed now. burn_random_access_write() will not write after
3296 a simulated burn run.
3297 Use burn_drive_reset_simulate(drive, 0) if you really want to end
3298 simulation before you call burn_disc_write() with new write options.
3299 @param opts The write opts to change
3300 @param sim Non-zero enables simulation, 0 enables real writing
3301 @return Returns 1 on success and 0 on failure.
3302*/
3303int burn_write_opts_set_simulate(struct burn_write_opts *opts, int sim);
3304
3305/** Controls buffer underrun prevention. This is only needed with CD media
3306 and possibly with old DVD-R drives. All other media types are not
3307 vulnerable to burn failure due to buffer underrun.
3308 @param opts The write opts to change
3309 @param underrun_proof if non-zero, buffer underrun protection is enabled
3310 @return Returns 1 if the drive announces to be capable of underrun
3311 prevention,
3312 Returns 0 if not.
3313*/
3314int burn_write_opts_set_underrun_proof(struct burn_write_opts *opts,
3315 int underrun_proof);
3316
3317/** NOTE: This call is traditionally without any effect on the operations of
3318 libburn. Due to this 20 year old tradition it will stay so.
3319 Use burn_write_opts_set_perform_opc_v2() if real Optimum Power
3320 Calibration is desired.
3321
3322 Wrong traditional description:
3323 Sets whether to use opc or not with the write_opts struct
3324 @param opts The write opts to change
3325 @param opc If non-zero, optimum power calibration will be performed at
3326 start of burn
3327
3328*/
3329void burn_write_opts_set_perform_opc(struct burn_write_opts *opts, int opc);
3330
3331/* ts C60319 */
3332/** Control whether and when to use Optimum Power Calibration (OPC).
3333 @param opts The write opts to change
3334 @param opc 0= Do not perform OPC (default)
3335 1= Perform OPC like growisofs does:
3336 Only with DVD-R[W] and only if the drive does not indicate
3337 the presence of internal OPC table entries.
3338 2= Perform OPC unconditionally on all media types.
3339 @return 1=opc value was accepted, 0=opc value was rejected
3340 @since 1.5.8
3341*/
3342int burn_write_opts_set_perform_opc_v2(struct burn_write_opts *opts, int opc);
3343
3344/** The Q sub-channel of a CD may contain a Media Catalog Number of 13 decimal
3345 digits. This call sets the string of digits, but does not yet activate it
3346 for writing.
3347 @param opts The write opts to change
3348 @param mediacatalog The 13 decimal digits as ASCII bytes. I.e. '0' = 0x30.
3349*/
3350void burn_write_opts_set_mediacatalog(struct burn_write_opts *opts,
3351 unsigned char mediacatalog[13]);
3352
3353/** This call activates the Media Catalog Number for writing. The digits of
3354 that number have to be set by call burn_write_opts_set_mediacatalog().
3355 @param opts The write opts to change
3356 @param has_mediacatalog 1= activate writing of catalog to Q sub-channel
3357 0= deactivate it
3358*/
3359void burn_write_opts_set_has_mediacatalog(struct burn_write_opts *opts,
3360 int has_mediacatalog);
3361
3362
3363/* ts A61106 */
3364/** Sets the multi flag which eventually marks the emerging session as not
3365 being the last one and thus creating a BURN_DISC_APPENDABLE media.
3366 Note: DVD-R[W] in write mode BURN_WRITE_SAO are not capable of this.
3367 DVD-R DL are not capable of this at all.
3368 libburn will refuse to write if burn_write_opts_set_multi() is
3369 enabled under such conditions.
3370 @param opts The option object to be manipulated
3371 @param multi 1=media will be appendable, 0=media will be closed (default)
3372 @since 0.2.6
3373*/
3374void burn_write_opts_set_multi(struct burn_write_opts *opts, int multi);
3375
3376
3377/* ts B31024 */
3378/** Set the severity to be used with write error messages which are potentially
3379 caused by not using write type BURN_WRITE_SAO on fast blanked DVD-RW.
3380
3381 Normally the call burn_write_opts_auto_write_type() can prevent such
3382 errors by looking for MMC feature 21h "Incremental Streaming Writable"
3383 which anounnces the capability for BURN_WRITE_TAO and multi session.
3384 Regrettable many drives announce feature 21h even if they only can do
3385 BURN_WRITE_SAO. This mistake becomes obvious by an early write error.
3386
3387 If you plan to call burn_drive_was_feat21_failure() and to repeat the
3388 burn attempt with BURN_WRITE_SAO, then set the severity of the error
3389 message low enough, so that the application does not see reason to abort.
3390
3391 @param opts The option object to be manipulated
3392 @param severity Severity as with burn_msgs_set_severities().
3393 "ALL" or empty text means the default severity that
3394 is attributed to other kinds of write errors.
3395*/
3396void burn_write_opts_set_fail21h_sev(struct burn_write_opts *opts,
3397 char *severity);
3398
3399/* ts B11204 */
3400/** Submit an array of CD-TEXT packs which shall be written to the Lead-in
3401 of a SAO write run on CD.
3402 @param opts The option object to be manipulated
3403 @param text_packs Array of bytes which form CD-TEXT packs of 18 bytes
3404 each. For a description of the format of the array,
3405 see file doc/cdtext.txt.
3406 No header of 4 bytes must be prepended which would
3407 tell the number of pack bytes + 2.
3408 This parameter may be NULL if the currently attached
3409 array of packs shall be removed.
3410 @param num_packs The number of 18 byte packs in text_packs.
3411 This parameter may be 0 if the currently attached
3412 array of packs shall be removed.
3413 @param flag Bitfield for control purposes.
3414 bit0= do not verify checksums
3415 bit1= repair mismatching checksums
3416 bit2= repair checksums if they are 00 00 with each pack
3417 @return 1 on success, <= 0 on failure
3418 @since 1.2.0
3419*/
3420int burn_write_opts_set_leadin_text(struct burn_write_opts *opts,
3421 unsigned char *text_packs,
3422 int num_packs, int flag);
3423
3424
3425/* ts A61222 */
3426/** Sets a start address for writing to media and write modes which are able
3427 to choose this address at all (for now: DVD+RW, DVD-RAM, formatted DVD-RW).
3428 now). The address is given in bytes. If it is not -1 then a write run
3429 will fail if choice of start address is not supported or if the block
3430 alignment of the address is not suitable for media and write mode.
3431 Alignment to 32 kB blocks is supposed to be safe with DVD media.
3432 Call burn_disc_get_multi_caps() can obtain the necessary media info. See
3433 resulting struct burn_multi_caps elements .start_adr , .start_alignment ,
3434 .start_range_low , .start_range_high .
3435 @param opts The write opts to change
3436 @param value The address in bytes (-1 = start at default address)
3437 @since 0.3.0
3438*/
3439void burn_write_opts_set_start_byte(struct burn_write_opts *opts, off_t value);
3440
3441
3442/* ts A70213 */
3443/** Caution: still immature and likely to change. Problems arose with
3444 sequential DVD-RW on one drive.
3445
3446 Controls whether the whole available space of the media shall be filled up
3447 by the last track of the last session.
3448 @param opts The write opts to change
3449 @param fill_up_media If 1 : fill up by last track, if 0 = do not fill up
3450 @since 0.3.4
3451*/
3452void burn_write_opts_set_fillup(struct burn_write_opts *opts,
3453 int fill_up_media);
3454
3455
3456/* ts A70303 */
3457/** Lets libburn ignore the failure of some conformance checks:
3458 - the check whether CD write+block type is supported by the drive
3459 - the check whether the media profile supports simulated burning
3460 - @since 1.5.6
3461 The check whether a write operation exceeds the size of the medium
3462 as announced by the drive. This is known as "overburn" and may work
3463 for a few thousand additional blocks on CD media with write type SAO.
3464 @param opts The write opts to change
3465 @param use_force 1=ignore above checks, 0=refuse work on failed check
3466 @since 0.3.4
3467*/
3468void burn_write_opts_set_force(struct burn_write_opts *opts, int use_force);
3469
3470
3471/* ts A80412 */
3472/** Eventually makes use of the more modern write command AAh WRITE12 and
3473 sets the Streaming bit. With DVD-RAM and BD this can override the
3474 traditional slowdown to half nominal speed. But if it speeds up writing
3475 then it also disables error management and correction. Weigh your
3476 priorities. This affects the write operations of burn_disc_write()
3477 and subsequent calls of burn_random_access_write().
3478 @param opts The write opts to change
3479 @param value 0=use 2Ah WRITE10, 1=use AAh WRITE12 with Streaming bit
3480 @since 0.6.4:
3481 >=16 use WRITE12 but not before the LBA given by value
3482 @since 0.4.6
3483*/
3484void burn_write_opts_set_stream_recording(struct burn_write_opts *opts,
3485 int value);
3486
3487/* ts A91115 */
3488/** Overrides the write chunk size for DVD and BD media which is normally
3489 determined according to media type and setting of stream recording.
3490 A chunk size of 64 KB may improve throughput with bus systems which show
3491 latency problems.
3492 @param opts The write opts to change
3493 @param obs Number of bytes which shall be sent by a single write command.
3494 0 means automatic size, 32768 and 65336 are the only other
3495 accepted sizes for now.
3496 @since 0.7.4
3497*/
3498void burn_write_opts_set_dvd_obs(struct burn_write_opts *opts, int obs);
3499
3500
3501/* ts B20406 */
3502/** Overrides the automatic decision whether to pad up the last write chunk to
3503 its full size. This applies to DVD, BD and stdio: pseudo-drives.
3504 Note: This override may get enabled fixely already at compile time by
3505 defining macro Libburn_dvd_always_obs_paD .
3506 @param opts The write opts to change
3507 @param pad 1 means to pad up in any case, 0 means automatic decision.
3508 @since 1.2.4
3509*/
3510void burn_write_opts_set_obs_pad(struct burn_write_opts *opts, int pad);
3511
3512
3513/* ts C10909 */
3514/** Exempts BD-R media from the elsewise unavoidable automatic padding of the
3515 last write chunk to its full size.
3516 Even if this exempt is granted it gets into effect only if stream recording
3517 is disabled and burn_write_opts_set_obs_pad() is set to 0.
3518 @param opts The write opts to change
3519 @param value 1= possibly exempt BD-R from end chunk padding.
3520 0= always act on BD-R as if
3521 burn_write_opts_set_obs_pad(opts, 1) is in effect.
3522 @since 1.5.6
3523*/
3524void burn_write_opts_set_bdr_obs_exempt(struct burn_write_opts *opts,
3525 int value);
3526
3527
3528/* ts A91115 */
3529/** Sets the rhythm by which stdio pseudo drives force their output data to
3530 be consumed by the receiving storage device. This forcing keeps the memory
3531 from being clogged with lots of pending data for slow devices.
3532 @param opts The write opts to change
3533 @param rhythm Number of 2KB output blocks after which fsync(2) is
3534 performed.
3535 -1 means no fsync()
3536 0 means default
3537 1 means fsync() only at end, @since 1.3.8 (noop before 1.3.8)
3538 elsewise the value must be >= 32.
3539 Default is currently 8192 = 16 MB.
3540 @since 0.7.4
3541*/
3542void burn_write_opts_set_stdio_fsync(struct burn_write_opts *opts, int rhythm);
3543
3544
3545/** Sets whether to read in raw mode or not
3546 @param opts The read opts to change
3547 @param raw_mode If non-zero, reading will be done in raw mode, so that everything in the data tracks on the
3548 disc is read, including headers.
3549*/
3550void burn_read_opts_set_raw(struct burn_read_opts *opts, int raw_mode);
3551
3552/** Sets whether to report c2 errors or not
3553 @param opts The read opts to change
3554 @param c2errors If non-zero, report c2 errors.
3555*/
3556void burn_read_opts_set_c2errors(struct burn_read_opts *opts, int c2errors);
3557
3558/** Sets whether to read subcodes from audio tracks or not
3559 @param opts The read opts to change
3560 @param subcodes_audio If non-zero, read subcodes from audio tracks on the disc.
3561*/
3562void burn_read_opts_read_subcodes_audio(struct burn_read_opts *opts,
3563 int subcodes_audio);
3564
3565/** Sets whether to read subcodes from data tracks or not
3566 @param opts The read opts to change
3567 @param subcodes_data If non-zero, read subcodes from data tracks on the disc.
3568*/
3569void burn_read_opts_read_subcodes_data(struct burn_read_opts *opts,
3570 int subcodes_data);
3571
3572/** Sets whether to recover errors if possible
3573 @param opts The read opts to change
3574 @param hardware_error_recovery If non-zero, attempt to recover errors if possible.
3575*/
3576void burn_read_opts_set_hardware_error_recovery(struct burn_read_opts *opts,
3577 int hardware_error_recovery);
3578
3579/** Sets whether to report recovered errors or not
3580 @param opts The read opts to change
3581 @param report_recovered_errors If non-zero, recovered errors will be reported.
3582*/
3583void burn_read_opts_report_recovered_errors(struct burn_read_opts *opts,
3584 int report_recovered_errors);
3585
3586/** Sets whether blocks with unrecoverable errors should be read or not
3587 @param opts The read opts to change
3588 @param transfer_damaged_blocks If non-zero, blocks with unrecoverable errors will still be read.
3589*/
3590void burn_read_opts_transfer_damaged_blocks(struct burn_read_opts *opts,
3591 int transfer_damaged_blocks);
3592
3593/** Sets the number of retries to attempt when trying to correct an error
3594 @param opts The read opts to change
3595 @param hardware_error_retries The number of retries to attempt when correcting an error.
3596*/
3597void burn_read_opts_set_hardware_error_retries(struct burn_read_opts *opts,
3598 unsigned char hardware_error_retries);
3599
3600
3601/* ts A90815 */
3602/** Gets the list of profile codes supported by the drive.
3603 Profiles depict the feature sets which constitute media types. For
3604 known profile codes and names see burn_disc_get_profile().
3605 @param d is the drive to query
3606 @param num_profiles returns the number of supported profiles
3607 @param profiles returns the profile codes
3608 @param is_current returns the status of the corresponding profile code:
3609 1= current, i.e. the matching media is loaded
3610 0= not current, i.e. the matching media is not loaded
3611 @return always 1 for now
3612 @since 0.7.0
3613*/
3614int burn_drive_get_all_profiles(struct burn_drive *d, int *num_profiles,
3615 int profiles[64], char is_current[64]);
3616
3617
3618/* ts A90815 */
3619/** Obtains the profile name associated with a profile code.
3620 @param profile_code the profile code to be translated
3621 @param name returns the profile name (e.g. "DVD+RW")
3622 @return 1= known profile code , 0= unknown profile code
3623 @since 0.7.0
3624*/
3625int burn_obtain_profile_name(int profile_code, char name[80]);
3626
3627
3628/* ts B90414 */
3629/** Obtains the list of SCSI Feature Codes from feature descriptors which
3630 were obtained from the drive when it was most recently acquired or
3631 re-assessed.
3632 @param d Drive to query
3633 @param count Returns the number of allocated elements in feature_codes
3634 @param feature_codes Returns the allocated array of feature codes.
3635 If returned *feature_codes is not NULL, dispose it
3636 by free() when it is no longer needed.
3637 @since 1.5.2
3638*/
3639void burn_drive_get_feature_codes(struct burn_drive *d,
3640 int *count, unsigned int **feature_codes);
3641
3642/* ts B90414 */
3643/** Obtains the fields and data of a particular feature which were obtained
3644 from the drive when it was last acquired or re-assessed. See MMC specs
3645 for full detail.
3646 @param d Drive to query
3647 @param feature_code A number as learned by burn_drive_get_feature_codes()
3648 @param flags Returns byte 2 of the feature descriptor:
3649 bit0= Current
3650 bit1= Persistent
3651 bit2-5= Version
3652 @param additional_length Returns byte 3 of descriptor.
3653 This is the size of feature_data.
3654 @param feature_data Returns further bytes of descriptor.
3655 If returned *feature_data is not NULL, dispose it
3656 by free() when it is no longer needed.
3657 @param feature_text Returns text representation of the feature descriptor:
3658 Code +/- : Name : Version,P/N : Hex bytes : Parsed info
3659 Current features are marked by "+", others by "-".
3660 Persistent features are marked by "P", others by "N".
3661 feature_text may be submitted as NULL. In this case
3662 no text is generated and returned.
3663 If returned *feature_text is not NULL, dispose it
3664 by free() when it is no longer needed.
3665 @return 0 feature descriptor is not present
3666 -1 out of memory
3667 >0 success
3668 @since 1.5.2
3669*/
3670int burn_drive_get_feature(struct burn_drive *d, unsigned int feature_code,
3671 unsigned char *flags,
3672 unsigned char *additional_length,
3673 unsigned char **feature_data,
3674 char **feature_text);
3675
3676
3677/** Gets the maximum write speed for a drive and eventually loaded media.
3678 The return value might change by the media type of already loaded media,
3679 again by call burn_drive_grab() and again by call burn_disc_read_atip().
3680 @param d Drive to query
3681 @return Maximum write speed in K/s
3682*/
3683int burn_drive_get_write_speed(struct burn_drive *d);
3684
3685
3686/* ts A61021 */
3687/** Gets the minimum write speed for a drive and eventually loaded media.
3688 The return value might change by the media type of already loaded media,
3689 again by call burn_drive_grab() and again by call burn_disc_read_atip().
3690 @param d Drive to query
3691 @return Minimum write speed in K/s
3692 @since 0.2.6
3693*/
3694int burn_drive_get_min_write_speed(struct burn_drive *d);
3695
3696
3697/** Gets the maximum read speed for a drive
3698 @param d Drive to query
3699 @return Maximum read speed in K/s
3700*/
3701int burn_drive_get_read_speed(struct burn_drive *d);
3702
3703
3704/* ts A61226 */
3705/** Obtain a copy of the current speed descriptor list. The drive's list gets
3706 updated on various occasions such as burn_drive_grab() but the copy
3707 obtained here stays untouched. It has to be disposed via
3708 burn_drive_free_speedlist() when it is not longer needed. Speeds
3709 may appear several times in the list. The list content depends much on
3710 drive and media type. It seems that .source == 1 applies mostly to CD media
3711 whereas .source == 2 applies to any media.
3712 @param d Drive to query
3713 @param speed_list The copy. If empty, *speed_list gets returned as NULL.
3714 @return 1=success , 0=list empty , <0 severe error
3715 @since 0.3.0
3716*/
3717int burn_drive_get_speedlist(struct burn_drive *d,
3718 struct burn_speed_descriptor **speed_list);
3719
3720/* ts A70713 */
3721/** Look up the fastest speed descriptor which is not faster than the given
3722 speed_goal. If it is 0, then the fastest one is chosen among the
3723 descriptors with the highest end_lba. If it is -1 then the slowest speed
3724 descriptor is chosen regardless of end_lba. Parameter flag decides whether
3725 the speed goal means write speed or read speed.
3726 @param d Drive to query
3727 @param speed_goal Upper limit for speed,
3728 0=search for maximum speed , -1 search for minimum speed
3729 @param best_descr Result of the search, NULL if no match
3730 @param flag Bitfield for control purposes
3731 bit0= look for best read speed rather than write speed
3732 bit1= look for any source type (else look for source==2 first
3733 and for any other source type only with CD media)
3734 @return >0 indicates a valid best_descr, 0 = no valid best_descr
3735 @since 0.3.8
3736*/
3737int burn_drive_get_best_speed(struct burn_drive *d, int speed_goal,
3738 struct burn_speed_descriptor **best_descr, int flag);
3739
3740
3741/* ts A61226 */
3742/** Dispose a speed descriptor list copy which was obtained by
3743 burn_drive_get_speedlist().
3744 @param speed_list The list copy. *speed_list gets set to NULL.
3745 @return 1=list disposed , 0= *speedlist was already NULL
3746 @since 0.3.0
3747*/
3749
3750
3751/* ts A70203 */
3752/* @since 0.3.2 */
3753/** The reply structure for burn_disc_get_multi_caps()
3754*/
3756
3757 /* Multi-session capability can keep the media appendable after
3758 writing a session. It also guarantees that the drive will be able
3759 to predict and use the appropriate Next Writeable Address to place
3760 the next session on the media without overwriting the existing ones.
3761 It does not guarantee that the selected write type is able to do
3762 an appending session after the next session. (E.g. CD SAO is capable
3763 of multi-session by keeping a disc appendable. But .might_do_sao
3764 will be 0 afterwards, when checking the appendable media.)
3765 1= media may be kept appendable by burn_write_opts_set_multi(o,1)
3766 0= media will not be appendable
3767 */
3769
3770 /* Multi-track capability can write more than one track source
3771 during a single session. The written tracks can later be found in
3772 libburn's TOC model with their start addresses and sizes.
3773 1= multiple tracks per session are allowed
3774 0= only one track per session allowed
3775 */
3777
3778 /* Start-address capability can set a non-zero address with
3779 burn_write_opts_set_start_byte(). Eventually this has to respect
3780 .start_alignment and .start_range_low, .start_range_high in this
3781 structure.
3782 1= non-zero start address is allowed
3783 0= only start address 0 is allowed (to depict the drive's own idea
3784 about the appropriate write start)
3785 */
3787
3788 /** The alignment for start addresses.
3789 ( start_address % start_alignment ) must be 0.
3790 */
3792
3793 /** The lowest permissible start address.
3794 */
3796
3797 /** The highest addressable start address.
3798 */
3800
3801 /** Potential availability of write modes
3802 4= needs no size prediction, not to be chosen automatically
3803 3= needs size prediction, not to be chosen automatically
3804 2= available, no size prediction necessary
3805 1= available, needs exact size prediction
3806 0= not available
3807 With CD media (profiles 0x09 and 0x0a) check also the elements
3808 *_block_types of the according write mode.
3809 */
3813
3814 /** Generally advised write mode.
3815 Not necessarily the one chosen by burn_write_opts_auto_write_type()
3816 because the burn_disc structure might impose particular demands.
3817 */
3819
3820 /** Write mode as given by parameter wt of burn_disc_get_multi_caps().
3821 */
3823
3824 /** Profile number which was current when the reply was generated */
3826
3827 /** Whether the current profile indicates CD media. 1=yes, 0=no */
3829
3830 /* ts A70528 */
3831 /* @since 0.3.8 */
3832 /** Whether the current profile is able to perform simulated write */
3834};
3835
3836/** Allocates a struct burn_multi_caps (see above) and fills it with values
3837 which are appropriate for the drive and the loaded media. The drive
3838 must be grabbed for this call. The returned structure has to be disposed
3839 via burn_disc_free_multi_caps() when no longer needed.
3840 @param d The drive to inquire
3841 @param wt With BURN_WRITE_NONE the best capabilities of all write modes
3842 get returned. If set to a write mode like BURN_WRITE_SAO the
3843 capabilities with that particular mode are returned and the
3844 return value is 0 if the desired mode is not possible.
3845 @param caps returns the info structure
3846 @param flag Bitfield for control purposes (unused yet, submit 0)
3847 @return < 0 : error , 0 : writing seems impossible , 1 : writing possible
3848 @since 0.3.2
3849*/
3850int burn_disc_get_multi_caps(struct burn_drive *d, enum burn_write_types wt,
3851 struct burn_multi_caps **caps, int flag);
3852
3853/** Removes from memory a multi session info structure which was returned by
3854 burn_disc_get_multi_caps(). The pointer *caps gets set to NULL.
3855 @param caps the info structure to dispose (note: pointer to pointer)
3856 @return 0 : *caps was already NULL, 1 : memory object was disposed
3857 @since 0.3.2
3858*/
3860
3861
3862/** Gets a copy of the toc_entry structure associated with a track
3863 @param t Track to get the entry from
3864 @param entry Struct for the library to fill out
3865*/
3866void burn_track_get_entry(struct burn_track *t, struct burn_toc_entry *entry);
3867
3868/** Gets a copy of the toc_entry structure associated with a session's lead out
3869 @param s Session to get the entry from
3870 @param entry Struct for the library to fill out
3871*/
3872void burn_session_get_leadout_entry(struct burn_session *s,
3873 struct burn_toc_entry *entry);
3874
3875/** Gets an array of all complete sessions for the disc
3876 THIS IS NO LONGER VALID AFTER YOU ADD OR REMOVE A SESSION
3877 The result array contains *num + burn_disc_get_incomplete_sessions()
3878 elements. All above *num are incomplete sessions.
3879 Typically there is at most one incomplete session with one empty track.
3880 DVD+R and BD-R seem support more than one track with even readable data.
3881 @param d Disc to get session array for
3882 @param num Returns the number of sessions in the array
3883 @return array of sessions
3884*/
3885struct burn_session **burn_disc_get_sessions(struct burn_disc *d,
3886 int *num);
3887
3888/* ts B30112 */
3889/* @since 1.2.8 */
3890/** Obtains the number of incomplete sessions which are recorded in the
3891 result array of burn_disc_get_sessions() after the complete sessions.
3892 See above.
3893 @param d Disc object to inquire
3894 @return Number of incomplete sessions
3895*/
3896int burn_disc_get_incomplete_sessions(struct burn_disc *d);
3897
3898
3899/** Tells how many sectors a disc will have, or already has.
3900 This is the sum of all burn_session_get_sectors() results of the disc.
3901 The result is NOT RELIABLE with tracks of undefined length
3902*/
3903int burn_disc_get_sectors(struct burn_disc *d);
3904
3905/* ts C40302 */
3906/** Like burn_disc_get_sectors(), but with return type off_t.
3907 @since 1.5.8
3908*/
3909off_t burn_disc_get_sectors_v2(struct burn_disc *d);
3910
3911
3912/** Gets an array of all the tracks for a session
3913 THIS IS NO LONGER VALID AFTER YOU ADD OR REMOVE A TRACK
3914 @param s session to get track array for
3915 @param num Returns the number of tracks in the array
3916 @return array of tracks
3917*/
3918struct burn_track **burn_session_get_tracks(struct burn_session *s,
3919 int *num);
3920
3921/** Tells how many sectors a session will have, or already has on disc.
3922 This is the sum of all burn_track_get_sectors() results of the session.
3923 The result is NOT RELIABLE with tracks of undefined length
3924*/
3925int burn_session_get_sectors(struct burn_session *s);
3926
3927/* ts C40302 */
3928/** Like burn_session_get_sectors(), but with return type off_t.
3929 @since 1.5.8
3930*/
3931off_t burn_session_get_sectors_v2(struct burn_session *s);
3932
3933
3934/** Gets the mode of a track
3935 @param track the track to query
3936 @return the track's mode
3937*/
3938int burn_track_get_mode(struct burn_track *track);
3939
3940/** Returns whether the first track of a session is hidden in the pregap
3941 @param session the session to query
3942 @return non-zero means the first track is hidden
3943*/
3944int burn_session_get_hidefirst(struct burn_session *session);
3945
3946/** Returns the library's version in its parts.
3947 This is the runtime counterpart of the three build time macros
3948 burn_header_version_* below.
3949 @param major The major version number
3950 @param minor The minor version number
3951 @param micro The micro version number
3952*/
3953void burn_version(int *major, int *minor, int *micro);
3954
3955
3956/* ts A80129 */
3957/* @since 0.4.4 */
3958/** These three release version numbers tell the revision of this header file
3959 and of the API it describes. They are memorized by applications at build
3960 time.
3961 Immediately after burn_initialize() an application should do this check:
3962 burn_version(&major, &minor, &micro);
3963 if(major > burn_header_version_major
3964 || (major == burn_header_version_major
3965 && (minor > burn_header_version_minor
3966 || (minor == burn_header_version_minor
3967 && micro >= burn_header_version_micro)))) {
3968 ... Young enough. Go on with program run ....
3969 } else {
3970 ... Too old. Do not use this libburn version ...
3971 }
3972
3973*/
3974#define burn_header_version_major 1
3975#define burn_header_version_minor 5
3976#define burn_header_version_micro 8
3977/** Note:
3978 Above version numbers are also recorded in configure.ac because libtool
3979 wants them as parameters at build time.
3980 For the library compatibility check, BURN_*_VERSION in configure.ac
3981 are not decisive. Only the three numbers above do matter.
3982*/
3983/** Usage discussion:
3984
3985Some developers of the libburnia project have differing
3986opinions how to ensure the compatibility of libraries
3987and applications.
3988
3989It is about whether to use at compile time and at runtime
3990the version numbers isoburn_header_version_* provided here.
3991Thomas Schmitt advises to use them.
3992Vreixo Formoso advises to use other means.
3993
3994At compile time:
3995
3996Vreixo Formoso advises to leave proper version matching
3997to properly programmed checks in the the application's
3998build system, which will eventually refuse compilation.
3999
4000Thomas Schmitt advises to use the macros defined here
4001for comparison with the application's requirements of
4002library revisions and to eventually break compilation.
4003
4004Both advises are combinable. I.e. be master of your
4005build system and have #if checks in the source code
4006of your application, nevertheless.
4007
4008At runtime (via *_is_compatible()):
4009
4010Vreixo Formoso advises to compare the application's
4011requirements of library revisions with the runtime
4012library. This is to enable runtime libraries which are
4013young enough for the application but too old for
4014the lib*.h files seen at compile time.
4015
4016Thomas Schmitt advises to compare the header
4017revisions defined here with the runtime library.
4018This is to enforce a strictly monotonous chain
4019of revisions from app to header to library,
4020at the cost of excluding some older libraries.
4021
4022These two advises are mutually exclusive.
4023
4024*/
4025
4026/* ts A91226 */
4027/** Obtain the id string of the SCSI transport interface.
4028 This interface may be a system specific adapter module of libburn or
4029 an adapter to a supporting library like libcdio.
4030 @param flag Bitfield for control puposes, submit 0 for now
4031 @return A pointer to the id string. Do not alter the string content.
4032 @since 0.7.6
4033*/
4035
4036/* ts A60924 : ticket 74 */
4037/** Control queueing and stderr printing of messages from libburn.
4038 Severity may be one of "NEVER", "ABORT", "FATAL", "FAILURE", "SORRY",
4039 "WARNING", "HINT", "NOTE", "UPDATE", "DEBUG", "ALL".
4040 @param queue_severity Gives the minimum limit for messages to be queued.
4041 Default: "NEVER". If you queue messages then you
4042 must consume them by burn_msgs_obtain().
4043 @param print_severity Does the same for messages to be printed directly
4044 to stderr. Default: "FATAL".
4045 @param print_id A text prefix to be printed before the message.
4046 @return >0 for success, <=0 for error
4047 @since 0.2.6
4048*/
4049int burn_msgs_set_severities(char *queue_severity,
4050 char *print_severity, char *print_id);
4051
4052/* ts A60924 : ticket 74 */
4053/* @since 0.2.6 */
4054#define BURN_MSGS_MESSAGE_LEN 4096
4055
4056/** Obtain the oldest pending libburn message from the queue which has at
4057 least the given minimum_severity. This message and any older message of
4058 lower severity will get discarded from the queue and is then lost forever.
4059 @param minimum_severity may be one of "NEVER", "ABORT", "FATAL",
4060 "FAILURE", "SORRY", "WARNING", "HINT", "NOTE", "UPDATE",
4061 "DEBUG", "ALL".
4062 To call with minimum_severity "NEVER" will discard the
4063 whole queue.
4064 @param error_code Will become a unique error code as listed in
4065 libburn/libdax_msgs.h
4066 @param msg_text Must provide at least BURN_MSGS_MESSAGE_LEN bytes.
4067 @param os_errno Will become the eventual errno related to the message
4068 @param severity Will become the severity related to the message and
4069 should provide at least 80 bytes.
4070 @return 1 if a matching item was found, 0 if not, <0 for severe errors
4071 @since 0.2.6
4072*/
4073int burn_msgs_obtain(char *minimum_severity,
4074 int *error_code, char msg_text[], int *os_errno,
4075 char severity[]);
4076
4077
4078/* ts A70922 */
4079/** Submit a message to the libburn queueing system. It will be queued or
4080 printed as if it was generated by libburn itself.
4081 @param error_code The unique error code of your message.
4082 Submit 0 if you do not have reserved error codes within
4083 the libburnia project.
4084 @param msg_text Not more than BURN_MSGS_MESSAGE_LEN characters of
4085 message text.
4086 @param os_errno Eventual errno related to the message. Submit 0 if
4087 the message is not related to a operating system error.
4088 @param severity One of "ABORT", "FATAL", "FAILURE", "SORRY", "WARNING",
4089 "HINT", "NOTE", "UPDATE", "DEBUG". Defaults to "FATAL".
4090 @param d An eventual drive to which the message shall be related.
4091 Submit NULL if the message is not specific to a
4092 particular drive object.
4093 @return 1 if message was delivered, <=0 if failure
4094 @since 0.4.0
4095*/
4096int burn_msgs_submit(int error_code, char msg_text[], int os_errno,
4097 char severity[], struct burn_drive *d);
4098
4099
4100/* ts A71016 */
4101/** Convert a severity name into a severity number, which gives the severity
4102 rank of the name.
4103 @param severity_name A name as with burn_msgs_submit(), e.g. "SORRY".
4104 @param severity_number The rank number: the higher, the more severe.
4105 @param flag Bitfield for control purposes (unused yet, submit 0)
4106 @return >0 success, <=0 failure
4107 @since 0.4.0
4108*/
4109int burn_text_to_sev(char *severity_name, int *severity_number, int flag);
4110
4111
4112/* ts A80202 */
4113/** Convert a severity number into a severity name
4114 @param severity_number The rank number: the higher, the more severe.
4115 @param severity_name A name as with burn_msgs_submit(), e.g. "SORRY".
4116 @param flag Bitfield for control purposes (unused yet, submit 0)
4117 @return >0 success, <=0 failure
4118 @since 0.4.4
4119*/
4120int burn_sev_to_text(int severity_number, char **severity_name, int flag);
4121
4122
4123/* ts B21214 */
4124/** Return a blank separated list of severity names. Sorted from low
4125 to high severity.
4126 @param flag Bitfield for control purposes (unused yet, submit 0)
4127 @return A constant string with the severity names
4128 @since 1.2.6
4129*/
4130char *burn_list_sev_texts(int flag);
4131
4132
4133/* ts A70915 */
4134/** Replace the messenger object handle of libburn by a compatible handle
4135 obtained from a related library.
4136 See also: libisofs, API function iso_get_messenger().
4137 @param messenger The foreign but compatible message handle.
4138 @return 1 : success, <=0 : failure
4139 @since 0.4.0
4140*/
4141int burn_set_messenger(void *messenger);
4142
4143
4144/* ts A61002 */
4145/* @since 0.2.6 */
4146/** The prototype of a handler function suitable for burn_set_signal_handling()
4147 Such a function has to return -2 if it does not want the process to
4148 exit with value 1.
4149*/
4150typedef int (*burn_abort_handler_t)(void *handle, int signum, int flag);
4151
4152/** Control built-in signal handling. Either by setting an own handler or
4153 by activating the built-in signal handler.
4154
4155 A function parameter handle of NULL activates the built-in abort handler.
4156 Depending on mode it may cancel all drive operations, wait for all drives
4157 to become idle, exit(1). It may also prepare function
4158 burn_drive_get_status() for waiting and performing exit(1).
4159 Parameter handle may be NULL or a text that shall be used as prefix for
4160 pacifier messages of burn_abort_pacifier(). Other than with an application
4161 provided handler, the prefix char array does not have to be kept existing
4162 until the eventual signal event.
4163 Before version 0.7.8 only action 0 was available. I.e. the built-in handler
4164 waited for the drives to become idle and then performed exit(1) directly.
4165 But during burn_disc_write() onto real CD or DVD, FreeBSD 8.0 pauses the
4166 other threads until the signal handler returns.
4167 The new actions try to avoid this deadlock. It is advised to use action 3
4168 at least during burn_disc_write(), burn_disc_erase(), burn_disc_format():
4169 burn_set_signal_handling(text, NULL, 0x30);
4170 and to call burn_is_aborting(0) when the drive is BURN_DRIVE_IDLE.
4171 If burn_is_aborting(0) returns 1, then call burn_abort() and exit(1).
4172
4173 @param handle Opaque handle eventually pointing to an application
4174 provided memory object
4175 @param handler A function to be called on signals, if the handling bits
4176 in parameter mode are set 0.
4177 It will get parameter handle as argument. flag will be 0.
4178 It should finally call burn_abort(). See there.
4179 If the handler function returns 2 or -2, then the wrapping
4180 signal handler of libburn will return and let the program
4181 continue its operations. Any other return value causes
4182 exit(1).
4183 @param mode : bit0 - bit3: Handling of received signals:
4184 0 Install libburn wrapping signal handler, which will call
4185 handler(handle, signum, 0) on nearly all signals
4186 1 Enable system default reaction on all signals
4187 2 Try to ignore nearly all signals
4188 10 like mode 2 but handle SIGABRT like with mode 0
4189 bit4 - bit7: With handler == NULL :
4190 Action of built-in handler. "control thread" is the one
4191 which called burn_set_signal_handling().
4192 All actions activate receive mode 2 to ignore further
4193 signals.
4194 0 Same as 1 (for pre-0.7.8 backward compatibility)
4195 @since 0.7.8
4196 1 Catch the control thread in abort handler, call
4197 burn_abort() with a patience value > 0 and
4198 finally exit(1). Does not always work with FreeBSD.
4199 2 Call burn_abort() with patience -1 and return from
4200 handler. When the control thread calls
4201 burn_drive_get_status(), then call burn_abort()
4202 with patience 1 instead, and finally exit(1).
4203 Does not always work with FreeBSD.
4204 3 Call burn_abort() with patience -1, return from handler.
4205 It is duty of the application to detect a pending abort
4206 condition by calling burn_is_aborting() and to wait for
4207 all drives to become idle. E.g. by calling burn_abort()
4208 with patience >0.
4209 4 Like 3, but without calling burn_abort() with -1. Only
4210 the indicator of burn_is_aborting() gets set.
4211 bit8: @since 1.3.2
4212 try to ignore SIGPIPE (regardless of bit0 - bit3)
4213
4214 @since 0.2.6
4215*/
4217 int mode);
4218
4219
4220/* ts B00304 */
4221/* Inquire whether the built-in abort handler was triggered by a signal.
4222 This has to be done to detect pending abort handling if signal handling
4223 was set to the built-in handler and action was set to 2 or 3.
4224 @param flag Bitfield for control purposes (unused yet, submit 0)
4225 @return 0 = no abort was triggered
4226 >0 = action that was triggered (action 0 is reported as 1)
4227 @since 0.7.8
4228*/
4229int burn_is_aborting(int flag);
4230
4231
4232/* ts A70811 */
4233/** Write data in random access mode.
4234 The drive must be grabbed successfully before calling this function which
4235 circumvents usual libburn session processing and rather writes data without
4236 preparations or finalizing. This will work only with overwritable media
4237 which are also suitable for burn_write_opts_set_start_byte(). The same
4238 address alignment restrictions as with this function apply. I.e. for DVD
4239 it is best to align to 32 KiB blocks (= 16 LBA units). The amount of data
4240 to be written is subject to the same media dependent alignment rules.
4241 Again, 32 KiB is most safe.
4242 Call burn_disc_get_multi_caps() can obtain the necessary media info. See
4243 resulting struct burn_multi_caps elements .start_adr , .start_alignment ,
4244 .start_range_low , .start_range_high .
4245 Other than burn_disc_write() this is a synchronous call which returns
4246 only after the write transaction has ended (successfully or not). So it is
4247 wise not to transfer giant amounts of data in a single call.
4248 Important: Data have to fit into the already formatted area of the media.
4249
4250 If the burn_drive object is in simulation mode, then no actual write
4251 operation or synchronization of the drive buffer will happen.
4252 See burn_drive_reset_simulate().
4253
4254 @param d The drive to which to write
4255 @param byte_address The start address of the write in byte
4256 (1 LBA unit = 2048 bytes) (do respect media alignment)
4257 @param data The bytes to be written
4258 @param data_count The number of those bytes (do respect media alignment)
4259 data_count == 0 is permitted (e.g. to flush the
4260 drive buffer without further data transfer).
4261 @param flag Bitfield for control purposes:
4262 bit0 = flush the drive buffer after eventual writing
4263 @return 1=successful , <=0 : number of transferred bytes * -1
4264 @since 0.4.0
4265*/
4266int burn_random_access_write(struct burn_drive *d, off_t byte_address,
4267 char *data, off_t data_count, int flag);
4268
4269
4270/* ts A81215 */
4271/** Inquire the maximum amount of readable data.
4272 On DVD and BD it is supposed that all LBAs in the range from 0 to
4273 capacity - 1 can be read via burn_read_data() although some of them may
4274 never have been recorded. With multi-session CD there have to be
4275 expected unreadable TAO Run-out blocks.
4276 If tracks are recognizable then it is better to only read LBAs which
4277 are part of some track and on CD to be cautious about the last two blocks
4278 of each track which might be TAO Run-out blocks.
4279 If the drive is actually a large file or block device, then the capacity
4280 is curbed to a maximum of 0x7ffffff0 blocks = 4 TB - 32 KB.
4281 @param d The drive from which to read
4282 @param capacity Will return the result if valid
4283 @param flag Bitfield for control purposes: Unused yet, submit 0.
4284 @return 1=successful , <=0 an error occurred
4285 @since 0.6.0
4286*/
4287int burn_get_read_capacity(struct burn_drive *d, int *capacity, int flag);
4288
4289/* ts C40303 */
4290/** Like burn_get_read_capacity(), but with uncurbed off_t result.
4291 @since 1.5.8
4292*/
4293int burn_get_read_capacity_v2(struct burn_drive *d, off_t *capacity, int flag);
4294
4295
4296/* ts A70812 */
4297/** Read data in random access mode.
4298 The drive must be grabbed successfully before calling this function.
4299 With all currently supported drives and media the byte_address has to
4300 be aligned to 2048 bytes. Only data tracks with 2048 bytes per sector
4301 can be read this way. I.e. not CD-audio, not CD-video-stream ...
4302 This is a synchronous call which returns only after the full read job
4303 has ended (successfully or not). So it is wise not to read giant amounts
4304 of data in a single call.
4305 @param d The drive from which to read
4306 @param byte_address The start address of the read in byte (aligned to 2048)
4307 @param data A memory buffer capable of taking data_size bytes
4308 @param data_size The amount of data to be read. This does not have to
4309 be aligned to any block size.
4310 @param data_count The amount of data actually read (interesting on error)
4311 The counted bytes are supposed to be valid.
4312 @param flag Bitfield for control purposes:
4313 bit0= - reserved -
4314 bit1= do not submit error message if read error
4315 bit2= on error do not try to read a second time
4316 with single block steps.
4317 @since 0.5.2
4318 bit3= return -2 on permission denied error rather than
4319 issuing a warning message.
4320 @since 1.0.6
4321 bit4= return -3 on SCSI error
4322 5 64 00 ILLEGAL MODE FOR THIS TRACK
4323 and prevent this error from being reported as
4324 event message. Do not retry reading in this case.
4325 (Useful to try the last two blocks of a CD
4326 track which might be non-data because of TAO.)
4327 @since 1.2.6
4328 bit5= issue messages with severity DEBUG if they would
4329 be suppressed by bit1.
4330 @since 1.4.0
4331 @return 1=successful , <=0 an error occurred
4332 with bit3: -2= permission denied error
4333 @since 0.4.0
4334*/
4335int burn_read_data(struct burn_drive *d, off_t byte_address,
4336 char data[], off_t data_size, off_t *data_count, int flag);
4337
4338
4339/* ts B21119 */
4340/** Read CD audio sectors in random access mode.
4341 The drive must be grabbed successfully before calling this function.
4342 Only CD audio tracks with 2352 bytes per sector can be read this way.
4343 I.e. not data tracks, not CD-video-stream, ...
4344
4345 Note that audio data do not have exact block addressing. If you read a
4346 sequence of successive blocks then you will get a seamless stream
4347 of data. But the actual start and end position of this audio stream
4348 will differ by a few dozens of milliseconds, depending on individual
4349 CD and individual drive.
4350 Expect leading and trailing zeros, as well as slight truncation.
4351
4352 @param d The drive from which to read.
4353 It must be a real MMC drive (i.e. not a stdio file)
4354 and it must have a CD loaded (i.e. not DVD or BD).
4355 @param sector_no The sector number (Logical Block Address)
4356 It may be slightly below 0, depending on drive and
4357 medium. -150 is a lower limit.
4358 @param data A memory buffer capable of taking data_size bytes
4359 @param data_size The amount of data to be read. This must be aligned
4360 to full multiples of 2352.
4361 @param data_count The amount of data actually read (interesting on error)
4362 @param flag Bitfield for control purposes:
4363 bit0= - reserved -
4364 bit1= do not submit error message if read error
4365 bit2= on error do not try to read a second time
4366 with single block steps.
4367 bit3= Enable DAP : "flaw obscuring mechanisms like
4368 audio data mute and interpolate"
4369 bit4= return -3 on SCSI error
4370 5 64 00 ILLEGAL MODE FOR THIS TRACK
4371 and prevent this error from being reported as
4372 event message. Do not retry reading in this case.
4373 (Useful to try the last two blocks of a CD
4374 track which might be non-audio because of TAO.)
4375 bit5= issue messages with severity DEBUG if they would
4376 be suppressed by bit1.
4377 @since 1.4.0
4378 @return 1=successful , <=0 an error occurred
4379 with bit3: -2= permission denied error
4380 @since 1.2.6
4381*/
4382int burn_read_audio(struct burn_drive *d, int sector_no,
4383 char data[], off_t data_size, off_t *data_count, int flag);
4384
4385
4386/* ts B30522 */
4387/** Extract an interval of audio sectors from CD and store it as a WAVE
4388 audio file on hard disk.
4389
4390 @param drive The drive from which to read.
4391 @param start_sector The logical block address of the first audio sector
4392 which shall be read.
4393 @param sector_count The number of audio sectors to be read.
4394 Each sector consists of 2352 bytes.
4395 @param target_path The address of the file where to store the extracted
4396 audio data. Will be opened O_WRONLY | O_CREAT.
4397 The file name should have suffix ".wav".
4398 @param flag Bitfield for control purposes:
4399 bit0= Report about progress by UPDATE messages
4400 bit3= Enable DAP : "flaw obscuring mechanisms like
4401 audio data mute and interpolate"
4402 @since 1.3.2
4403*/
4404int burn_drive_extract_audio(struct burn_drive *drive,
4405 int start_sector, int sector_count,
4406 char *target_path, int flag);
4407
4408
4409/* ts B30522 */
4410/** Extract all audio sectors of a track from CD and store them as a WAVE
4411 audio file on hard disk.
4412
4413 @param drive The drive from which to read.
4414 @param track The track which shall be extracted.
4415 @param target_path The address of the file where to store the extracted
4416 audio data. Will be opened O_WRONLY | O_CREAT.
4417 The file name should have suffix ".wav".
4418 @param flag Bitfield for control purposes:
4419 bit0= Report about progress by UPDATE messages
4420 bit3= Enable DAP : "flaw obscuring mechanisms like
4421 audio data mute and interpolate"
4422 @since 1.3.2
4423*/
4424int burn_drive_extract_audio_track(struct burn_drive *drive,
4425 struct burn_track *track,
4426 char *target_path, int flag);
4427
4428
4429/* ts A70904 */
4430/** Inquire whether the drive object is a real MMC drive or a pseudo-drive
4431 created by a stdio: address.
4432 @param d The drive to inquire
4433 @return 0= null-drive
4434 1= real MMC drive
4435 2= stdio-drive, random access, read-write
4436 3= stdio-drive, sequential, write-only
4437 4= stdio-drive, random access, read-only
4438 (only if enabled by burn_allow_drive_role_4())
4439 5= stdio-drive, random access, write-only
4440 (only if enabled by burn_allow_drive_role_4())
4441 @since 0.4.0
4442*/
4443int burn_drive_get_drive_role(struct burn_drive *d);
4444
4445
4446/* ts B10312 */
4447/** Allow drive role 4 "random access read-only"
4448 and drive role 5 "random access write-only".
4449 By default a random access file assumes drive role 2 "read-write"
4450 regardless whether it is actually readable or writeable.
4451 If enabled, random-access file objects which recognizably permit no
4452 writing will be classified as role 4 and those which permit no reading
4453 will get role 5.
4454 Candidates are drive addresses of the form stdio:/dev/fd/# , where # is
4455 the integer number of an open file descriptor. If this descriptor was
4456 opened read-only or write-only, then it gets role 4 or role 5,
4457 respectively.
4458 Other paths may get tested by an attempt to open them for read-write
4459 (role 2) or read-only (role 4) or write-only (role 5). See bit1.
4460 @param allowed Bitfield for control purposes:
4461 bit0= Enable roles 4 and 5 for drives which get
4462 acquired after this call
4463 bit1= with bit0:
4464 Test whether the file can be opened for
4465 read-write, read-only, or write-only.
4466 Classify as roles 2, 4, 5.
4467 bit2= with bit0 and bit1:
4468 Classify files which cannot be opened at all
4469 as role 0 : useless dummy.
4470 Else classify as role 2.
4471 bit3= Classify non-empty role 5 drives as
4472 BURN_DISC_APPENDABLE with Next Writeable Address
4473 after the end of the file. It is nevertheless
4474 possible to change this address by call
4475 burn_write_opts_set_start_byte().
4476 @since 1.0.6
4477*/
4478void burn_allow_drive_role_4(int allowed);
4479
4480
4481/* ts A70923 */
4482/** Find out whether a given address string would lead to the given drive
4483 object. This should be done in advance for track source addresses
4484 with parameter drive_role set to 2.
4485 Although a real MMC drive should hardly exist as two drive objects at
4486 the same time, this can easily happen with stdio-drives. So if more than
4487 one drive is used by the application, then this gesture is advised:
4488 burn_drive_d_get_adr(d2, adr2);
4489 if (burn_drive_equals_adr(d1, adr2, burn_drive_get_drive_role(d2)))
4490 ... Both drive objects point to the same storage facility ...
4491
4492 @param d1 Existing drive object
4493 @param adr2 Address string to be tested. Prefix "stdio:" overrides
4494 parameter drive_role2 by either 0 or 2 as appropriate.
4495 The string must be shorter than BURN_DRIVE_ADR_LEN.
4496 @param drive_role2 Role as burn_drive_get_drive_role() would attribute
4497 to adr2 if it was a drive. Use value 2 for checking track
4498 sources or pseudo-drive addresses without "stdio:".
4499 Use 1 for checking drive addresses including those with
4500 prefix "stdio:".
4501 @return 1= adr2 leads to d1 , 0= adr2 seems not to lead to d1,
4502 -1 = adr2 is bad
4503 @since 0.4.0
4504*/
4505int burn_drive_equals_adr(struct burn_drive *d1, char *adr2, int drive_role2);
4506
4507
4508
4509/*
4510 Audio track data extraction facility.
4511*/
4512
4513/* Maximum size for address paths and fmt_info strings */
4514#define LIBDAX_AUDIOXTR_STRLEN 4096
4515
4516
4517/** Extractor object encapsulating intermediate states of extraction.
4518 The clients of libdax_audioxtr shall only allocate pointers to this
4519 struct and get a storage object via libdax_audioxtr_new().
4520 Appropriate initial value for the pointer is NULL.
4521*/
4522struct libdax_audioxtr;
4523
4524
4525/** Open an audio file, check whether suitable, create extractor object.
4526 @param xtr Opaque handle to extractor. Gets attached extractor object.
4527 @param path Address of the audio file to extract. "-" is stdin (but might
4528 be not suitable for all futurely supported formats).
4529 @param flag Bitfield for control purposes
4530 bit0= enable return -3 in some cases which normally return 0
4531 @since 1.5.8
4532 bit1= read parameters of a recognized suitable format and
4533 return 2 if normally the return value would be 0 or -3
4534 because of a bad format variant.
4535 @since 1.5.8
4536 @return 1 success
4537 2 success, but only because of bit1
4538 0 unrecognized format, possibly raw
4539 -1 severe error
4540 -2 path not found
4541 -3 with flag bit0:
4542 recognized format with unsuitable parameters (e.g compression)
4543 @since 1.5.8
4544 @since 0.2.4
4545*/
4546int libdax_audioxtr_new(struct libdax_audioxtr **xtr, char *path, int flag);
4547
4548
4549/** Obtain identification parameters of opened audio source.
4550 @param xtr Opaque handle to extractor
4551 @param fmt Gets pointed to the audio file format id text: ".wav" , ".au"
4552 @param fmt_info Gets pointed to a format info text telling parameters
4553 @param num_channels e.g. 1=mono, 2=stereo, etc
4554 @param sample_rate e.g. 11025, 44100
4555 @param bits_per_sample e.g. 8= 8 bits per sample, 16= 16 bits ...
4556 @param msb_first Byte order of samples: 0= Intel = Little Endian
4557 1= Motorola = Big Endian
4558 @param flag Bitfield for control purposes (unused yet, submit 0)
4559 @return >0 success, <=0 failure
4560 @since 0.2.4
4561*/
4562int libdax_audioxtr_get_id(struct libdax_audioxtr *xtr,
4563 char **fmt, char **fmt_info,
4564 int *num_channels, int *sample_rate,
4565 int *bits_per_sample, int *msb_first, int flag);
4566
4567
4568/** Obtain the audio_format code of a possible WAVE file.
4569 @param xtr Opaque handle to extractor
4570 @param audio_format returns WAVE Audio Format.
4571 1=Linear quantization, others are unusable
4572 @return 1= returned audio_format is valid
4573 0= no audio_format available, e.g. because not a WAVE file
4574 @since 1.5.8
4575*/
4576int libdax_audioxtr_get_wavfmt(struct libdax_audioxtr *xtr,
4577 unsigned int *audio_format);
4578
4579
4580/** Obtain a prediction about the extracted size based on internal information
4581 of the formatted file.
4582 @param o Opaque handle to extractor
4583 @param size Gets filled with the predicted size
4584 @param flag Bitfield for control purposes (unused yet, submit 0)
4585 @return 1 prediction was possible , 0 no prediction could be made
4586 @since 0.2.4
4587*/
4588int libdax_audioxtr_get_size(struct libdax_audioxtr *o, off_t *size, int flag);
4589
4590
4591/** Obtain next buffer full of extracted data in desired format (only raw audio
4592 for now).
4593 @param xtr Opaque handle to extractor
4594 @param buffer Gets filled with extracted data
4595 @param buffer_size Maximum number of bytes to be filled into buffer
4596 @param flag Bitfield for control purposes
4597 bit0= do not stop at predicted end of data
4598 @return >0 number of valid buffer bytes,
4599 0 End of file
4600 -1 operating system reports error
4601 -2 usage error by application
4602 @since 0.2.4
4603*/
4604int libdax_audioxtr_read(struct libdax_audioxtr *xtr,
4605 char buffer[], int buffer_size, int flag);
4606
4607
4608/** Try to obtain a file descriptor which will deliver extracted data
4609 to normal calls of read(2). This may fail because the format is
4610 unsuitable for that, but WAVE (.wav) is ok. If this call succeeds the xtr
4611 object will have forgotten its file descriptor and libdax_audioxtr_read()
4612 will return a usage error. One may use *fd after libdax_audioxtr_destroy()
4613 and will have to close it via close(2) when done with it.
4614 @param o Opaque handle to extractor
4615 @param fd Returns the file descriptor number
4616 @param flag Bitfield for control purposes
4617 bit0= do not dup(2) and close(2) but hand out original fd
4618 @return 1 success, 0 cannot hand out fd , -1 severe error
4619 @since 0.2.4
4620*/
4621int libdax_audioxtr_detach_fd(struct libdax_audioxtr *o, int *fd, int flag);
4622
4623
4624/** Clean up after extraction and destroy extractor object.
4625 @param xtr Opaque handle to extractor, *xtr is allowed to be NULL,
4626 *xtr is set to NULL by this function
4627 @param flag Bitfield for control purposes (unused yet, submit 0)
4628 @return 1 = destroyed object, 0 = was already destroyed
4629 @since 0.2.4
4630*/
4631int libdax_audioxtr_destroy(struct libdax_audioxtr **xtr, int flag);
4632
4633
4634#ifndef DOXYGEN
4635
4636BURN_END_DECLS
4637
4638#endif
4639
4640
4641/* ts A91205 */
4642/* The following experiments may be interesting in future:
4643*/
4644
4645/* Perform OPC explicitly.
4646 # define Libburn_pioneer_dvr_216d_with_opC 1
4647*/
4648
4649/* Load mode page 5 and modify it rather than composing from scratch.
4650 # define Libburn_pioneer_dvr_216d_load_mode5 1
4651*/
4652
4653/* Inquire drive events and react by reading configuration or starting unit.
4654 # define Libburn_pioneer_dvr_216d_get_evenT 1
4655*/
4656
4657/* ts A91112 */
4658/* Do not probe CD modes but declare only data and audio modes supported.
4659 For other modes or real probing one has to call
4660 burn_drive_probe_cd_write_modes().
4661
4662*/
4663#define Libburn_dummy_probe_write_modeS 1
4664
4665/* ts B30112 */
4666/* Handle DVD+R with reserved tracks in incomplete first session
4667 by loading info about the incomplete session into struct burn_disc
4668*/
4669#define Libburn_disc_with_incomplete_sessioN 1
4670
4671
4672/* Early experimental:
4673 Do not define Libburn_develop_quality_scaN unless you want to work
4674 towards a usable implementation.
4675 If it gets enabled, then the call must be published in libburn/libburn.ver
4676*/
4677#ifdef Libburn_develop_quality_scaN
4678
4679/* ts B21108 */
4680/* Experiments mit quality scan command F3 on Optiarc drive */
4681int burn_nec_optiarc_rep_err_rate(struct burn_drive *d,
4682 int start_lba, int rate_period, int flag);
4683
4684#endif /* Libburn_develop_quality_scaN */
4685
4686
4687/* Linux 3.16 problems with ABh Read Media Serial Number:
4688 - as normal user lets ioctl(SG_IO) return -1 and errno = EFAULT
4689 - as superuser renders LG BH16NS40 unusable until power cycle
4690 #de fine Libburn_enable_scsi_cmd_ABh yes
4691 #de fine Libburn_enable_scsi_cmd_ABh_pretend_currenT yes
4692*/
4693
4694
4695#endif /*LIBBURN_H*/
int burn_drive_get_all_profiles(struct burn_drive *d, int *num_profiles, int profiles[64], char is_current[64])
Gets the list of profile codes supported by the drive.
void burn_write_opts_set_obs_pad(struct burn_write_opts *opts, int pad)
Overrides the automatic decision whether to pad up the last write chunk to its full size.
int burn_disc_pretend_full_uncond(struct burn_drive *drive)
WARNING: This overrides the safety measures against unsuitable media.
int burn_make_input_sheet_v07t(unsigned char *text_packs, int num_packs, int start_tno, int track_count, char **result, int *char_code, int flag)
Convert an array of CD-TEXT packs into the text format of Sony CD-TEXT Input Sheet Version 0....
void burn_set_scsi_logging(int flag)
Enable or disable logging of SCSI commands.
int burn_write_opts_set_simulate(struct burn_write_opts *opts, int sim)
Sets the simulate value for the write_opts struct .
struct burn_source * burn_offst_source_new(struct burn_source *inp, struct burn_source *prev, off_t start, off_t size, int flag)
Creates an offset source which shall provide a byte interval of a stream to its consumer.
int burn_drive_get_min_write_speed(struct burn_drive *d)
Gets the minimum write speed for a drive and eventually loaded media.
char * burn_guess_manufacturer(int profile_no, char *manuf_code, char *media_code, int flag)
Guess the name of a manufacturer by profile number, manufacturer code and media code.
int burn_session_get_sectors(struct burn_session *s)
Tells how many sectors a session will have, or already has on disc.
char * burn_guess_cd_manufacturer(int m_li, int s_li, int f_li, int m_lo, int s_lo, int f_lo, int flag)
Guess the manufacturer name of CD media from the ATIP addresses of lead-in and lead-out.
int burn_track_set_byte_swap(struct burn_track *t, int swap_source_bytes)
Define whether a track shall swap bytes of its input stream.
int burn_drive_release_v2(struct burn_drive *d, int flag)
Release a drive like with burn_drive_release() or burn_drive_leave_locked() but with the additional o...
void burn_read_opts_transfer_damaged_blocks(struct burn_read_opts *opts, int transfer_damaged_blocks)
Sets whether blocks with unrecoverable errors should be read or not.
int burn_msf_to_lba(int m, int s, int f)
Convert a minute-second-frame (MSF) value to an lba.
void burn_track_free(struct burn_track *t)
Free a track.
#define BURN_REASONS_LEN
The length of a rejection reasons string for burn_precheck_write() and burn_write_opts_auto_write_typ...
Definition libburn.h:1911
int burn_session_get_start_tno(struct burn_session *session, int flag)
Inquire the CD track start number, as set by default or by burn_session_set_start_tno().
struct burn_read_opts * burn_read_opts_new(struct burn_drive *drive)
Creates a read_opts struct for reading from the specified drive must be freed with burn_read_opts_fre...
int burn_msgs_obtain(char *minimum_severity, int *error_code, char msg_text[], int *os_errno, char severity[])
Obtain the oldest pending libburn message from the queue which has at least the given minimum_severit...
void burn_write_opts_free(struct burn_write_opts *opts)
Frees a write_opts struct created with burn_write_opts_new.
void burn_set_verbosity(int level)
ts A61006 : This is for development only.
int burn_disc_get_profile(struct burn_drive *d, int *pno, char name[80])
Tells the MMC Profile identifier of the loaded media.
int libdax_audioxtr_get_id(struct libdax_audioxtr *xtr, char **fmt, char **fmt_info, int *num_channels, int *sample_rate, int *bits_per_sample, int *msb_first, int flag)
Obtain identification parameters of opened audio source.
void burn_structure_print_session(struct burn_session *s)
int burn_read_data(struct burn_drive *d, off_t byte_address, char data[], off_t data_size, off_t *data_count, int flag)
Read data in random access mode.
void burn_source_free(struct burn_source *s)
Free a burn_source (decrease its refcount and maybe free it)
void burn_disc_format(struct burn_drive *drive, off_t size, int flag)
Format media for use with libburn.
int burn_drive_leave_locked(struct burn_drive *d, int flag)
Like burn_drive_release() but keeping the drive tray closed and its eject button disabled.
int burn_drive_convert_fs_adr(char *path, char adr[])
Try to convert a given existing filesystem address into a drive device file address.
int burn_track_set_postgap_size(struct burn_track *t, int size, int flag)
Define whether a post-gap shall be written at the end of the track and how many sectors this gap shal...
int burn_drive_d_get_adr(struct burn_drive *drive, char adr[])
Inquire the device file address of the given drive.
void burn_track_get_entry(struct burn_track *t, struct burn_toc_entry *entry)
Gets a copy of the toc_entry structure associated with a track.
int burn_drive_get_adr(struct burn_drive_info *drive_info, char adr[])
Inquire the device file address of a drive via a given drive_info object.
int burn_cdtext_from_session(struct burn_session *s, unsigned char **text_packs, int *num_packs, int flag)
Produce an array of CD-TEXT packs that could be submitted to burn_write_opts_set_leadin_text(),...
int burn_drive_set_stream_recording(struct burn_drive *drive, int recmode, int start, int flag)
Control stream recording during the write run and eventually set the start LBA for stream recording.
int burn_drive_reset_simulate(struct burn_drive *d, int simulate)
Control the write simulation mode before or after burn_write_opts get into effect.
int libdax_audioxtr_get_wavfmt(struct libdax_audioxtr *xtr, unsigned int *audio_format)
Obtain the audio_format code of a possible WAVE file.
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)
Retrieve some media information which is mainly specific to media of the DVD-R family: DVD-R ,...
int burn_session_add_track(struct burn_session *s, struct burn_track *t, unsigned int pos)
Add a track to a session at specified position.
void burn_session_free(struct burn_session *s)
Free a session (and decrease reference count on all tracks inside)
int burn_disc_get_incomplete_sessions(struct burn_disc *d)
Obtains the number of incomplete sessions which are recorded in the result array of burn_disc_get_ses...
int burn_drive_scan(struct burn_drive_info *drive_infos[], unsigned int *n_drives)
Scan for drives.
int burn_session_set_cdtext(struct burn_session *s, int block, int pack_type, char *pack_type_name, unsigned char *payload, int length, int flag)
Attach text or binary data as CD-TEXT attributes to a session.
void burn_write_opts_set_fail21h_sev(struct burn_write_opts *opts, char *severity)
Set the severity to be used with write error messages which are potentially caused by not using write...
int burn_nominal_slowdown(int kb_per_second, int max_corr, struct timeval *prev_time, int *us_corr, off_t b_since_prev, int flag)
Waits until the time has elapsed since the given previous time to transmit the given byte count with ...
int(* burn_abort_handler_t)(void *handle, int signum, int flag)
The prototype of a handler function suitable for burn_set_signal_handling() Such a function has to re...
Definition libburn.h:4150
int burn_track_get_cdtext(struct burn_track *t, int block, int pack_type, char *pack_type_name, unsigned char **payload, int *length, int flag)
Obtain a CD-TEXT attribute that was set by burn_track_set_cdtext().
void burn_read_opts_set_hardware_error_retries(struct burn_read_opts *opts, unsigned char hardware_error_retries)
Sets the number of retries to attempt when trying to correct an error.
int burn_text_to_sev(char *severity_name, int *severity_number, int flag)
Convert a severity name into a severity number, which gives the severity rank of the name.
int burn_drive_snooze(struct burn_drive *d, int flag)
Calm down or alert a drive.
int burn_lookup_device_link(char *dev_adr, char link_adr[], char *dir_adr, char **templ, int num_templ, int flag)
Try to convert a given drive device file address into the address of a symbolic link that points to t...
enum burn_source_status burn_track_set_source(struct burn_track *t, struct burn_source *s)
Set the track's data source.
struct burn_drive * burn_write_opts_get_drive(struct burn_write_opts *opts)
Inquires the drive associated with a burn_write_opts object.
int burn_disc_get_leadin_text(struct burn_drive *d, unsigned char **text_packs, int *num_packs, int flag)
Read the array of CD-TEXT packs from the Lead-in of an audio CD.
void burn_write_opts_set_has_mediacatalog(struct burn_write_opts *opts, int has_mediacatalog)
This call activates the Media Catalog Number for writing.
int burn_disc_read_atip(struct burn_drive *drive)
Reads ATIP information from inserted media.
void burn_write_opts_set_format(struct burn_write_opts *opts, int format)
Sets the session format for a disc.
burn_block_types
Data format to send to the drive.
Definition libburn.h:194
@ BURN_BLOCK_SAO
SAO block sizes are based on cue sheet, so use this.
Definition libburn.h:229
@ BURN_BLOCK_MODE2_OBSCURE
2324 bytes of data provided by lib/user subheader provided in write parameters no sir,...
Definition libburn.h:221
@ BURN_BLOCK_MODE2_PATHETIC
2048 bytes of user data provided by lib/user subheader provided in write parameters are we ever going...
Definition libburn.h:212
@ BURN_BLOCK_MODE2_OK
2332 bytes of data supplied by lib/user 8 bytes sub header provided in write parameters this is the s...
Definition libburn.h:227
@ BURN_BLOCK_RAW0
sync, headers, edc/ecc provided by lib/user
Definition libburn.h:196
@ BURN_BLOCK_RAW96P
sync, headers, edc/ecc and packed p-w subs provided by lib/user
Definition libburn.h:200
@ BURN_BLOCK_MODE2_LAME
2048 bytes of data + 8 byte subheader provided by lib/user hey, this is also dumb
Definition libburn.h:216
@ BURN_BLOCK_RAW16
sync, headers, edc/ecc and p/q subs provided by lib/user
Definition libburn.h:198
@ BURN_BLOCK_MODE1
only 2048 bytes of user data provided by lib/user
Definition libburn.h:204
@ BURN_BLOCK_MODE2R
2336 bytes of user data provided by lib/user
Definition libburn.h:206
@ BURN_BLOCK_RAW96R
sync, headers, edc/ecc and raw p-w subs provided by lib/user
Definition libburn.h:202
void burn_write_opts_set_stdio_fsync(struct burn_write_opts *opts, int rhythm)
Sets the rhythm by which stdio pseudo drives force their output data to be consumed by the receiving ...
void * burn_os_alloc_buffer(size_t amount, int flag)
Allocate a memory area that is suitable for reading with a file descriptor opened by burn_os_open_tra...
int libdax_audioxtr_get_size(struct libdax_audioxtr *o, off_t *size, int flag)
Obtain a prediction about the extracted size based on internal information of the formatted file.
int burn_track_get_mode(struct burn_track *track)
Gets the mode of a track.
void burn_version(int *major, int *minor, int *micro)
Returns the library's version in its parts.
void burn_write_opts_set_stream_recording(struct burn_write_opts *opts, int value)
Eventually makes use of the more modern write command AAh WRITE12 and sets the Streaming bit.
int burn_disc_get_multi_caps(struct burn_drive *d, enum burn_write_types wt, struct burn_multi_caps **caps, int flag)
Allocates a struct burn_multi_caps (see above) and fills it with values which are appropriate for the...
int burn_drive_grab(struct burn_drive *drive, int load)
Grab a drive.
int burn_track_clear_indice(struct burn_track *t, int flag)
Remove all index start addresses and reset to the default indexing of CD SAO sessions.
void burn_write_opts_set_fillup(struct burn_write_opts *opts, int fill_up_media)
Caution: still immature and likely to change.
burn_drive_status
Possible busy states for a drive.
Definition libburn.h:295
@ BURN_DRIVE_FORMATTING
The drive is formatting media.
Definition libburn.h:327
@ BURN_DRIVE_READING_SYNC
The drive is busy in synchronous read (if you see this then it has been interrupted)
Definition libburn.h:333
@ BURN_DRIVE_WRITING_LEADIN
The drive is writing Lead-In.
Definition libburn.h:307
@ BURN_DRIVE_WRITING
The drive is writing data to a disc.
Definition libburn.h:305
@ BURN_DRIVE_CLOSING_SESSION
The drive is told to close a session (TAO only)
Definition libburn.h:322
@ BURN_DRIVE_GRABBING
The drive is being grabbed.
Definition libburn.h:313
@ BURN_DRIVE_WRITING_LEADOUT
The drive is writing Lead-Out.
Definition libburn.h:309
@ BURN_DRIVE_ERASING
The drive is erasing a disc.
Definition libburn.h:311
@ BURN_DRIVE_WRITING_SYNC
The drive is busy in synchronous write (if you see this then it has been interrupted)
Definition libburn.h:336
@ BURN_DRIVE_SPAWNING
The library is spawning the processes to handle a pending operation (A read/write/etc is about to sta...
Definition libburn.h:301
@ BURN_DRIVE_CLOSING_TRACK
The drive is told to close a track (TAO only)
Definition libburn.h:320
@ BURN_DRIVE_WRITING_PREGAP
The drive gets written zeroes before the track payload data.
Definition libburn.h:318
@ BURN_DRIVE_READING
The drive is reading data from a disc.
Definition libburn.h:303
@ BURN_DRIVE_IDLE
The drive is not in an operation.
Definition libburn.h:297
void burn_drive_get_feature_codes(struct burn_drive *d, int *count, unsigned int **feature_codes)
Obtains the list of SCSI Feature Codes from feature descriptors which were obtained from the drive wh...
int burn_os_free_buffer(void *buffer, size_t amount, int flag)
Dispose a memory area which was obtained by burn_os_alloc_buffer(),.
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)
Retrieve some media information which is mainly specific to CD.
int burn_write_opts_set_underrun_proof(struct burn_write_opts *opts, int underrun_proof)
Controls buffer underrun prevention.
int burn_set_messenger(void *messenger)
Replace the messenger object handle of libburn by a compatible handle obtained from a related library...
struct burn_disc * burn_disc_create(void)
Create a new disc.
void burn_read_opts_read_subcodes_data(struct burn_read_opts *opts, int subcodes_data)
Sets whether to read subcodes from data tracks or not.
int burn_drive_obtain_scsi_adr(char *path, int *bus_no, int *host_no, int *channel_no, int *target_no, int *lun_no)
Try to obtain bus,host,channel,target,lun from path.
void burn_read_opts_read_subcodes_audio(struct burn_read_opts *opts, int subcodes_audio)
Sets whether to read subcodes from audio tracks or not.
void burn_read_opts_set_c2errors(struct burn_read_opts *opts, int c2errors)
Sets whether to report c2 errors or not.
int libdax_audioxtr_destroy(struct libdax_audioxtr **xtr, int flag)
Clean up after extraction and destroy extractor object.
void burn_write_opts_set_dvd_obs(struct burn_write_opts *opts, int obs)
Overrides the write chunk size for DVD and BD media which is normally determined according to media t...
void burn_set_signal_handling(void *handle, burn_abort_handler_t handler, int mode)
Control built-in signal handling.
int burn_get_read_capacity_v2(struct burn_drive *d, off_t *capacity, int flag)
Like burn_get_read_capacity(), but with uncurbed off_t result.
off_t burn_session_get_sectors_v2(struct burn_session *s)
Like burn_session_get_sectors(), but with return type off_t.
int burn_drive_probe_cd_write_modes(struct burn_drive_info *drive_info)
int burn_drive_convert_scsi_adr(int bus_no, int host_no, int channel_no, int target_no, int lun_no, char adr[])
Try to convert a given SCSI address of bus,host,channel,target,lun into a drive device file address.
int burn_disc_get_bd_spare_info(struct burn_drive *d, int *alloc_blocks, int *free_blocks, int flag)
Read the current usage of the eventual BD Spare Area.
int burn_drive_free_speedlist(struct burn_speed_descriptor **speed_list)
Dispose a speed descriptor list copy which was obtained by burn_drive_get_speedlist().
int burn_track_set_isrc_string(struct burn_track *t, char isrc[13], int flag)
Set the composed ISRC string for a track.
int burn_initialize(void)
Initialize the library.
void burn_fifo_get_statistics(struct burn_source *fifo, int *total_min_fill, int *interval_min_fill, int *put_counter, int *get_counter, int *empty_counter, int *full_counter)
Inquire various counters which reflect the fifo operation.
int burn_track_set_index(struct burn_track *t, int index_number, unsigned int relative_lba, int flag)
Define an index start address within a track.
int burn_os_open_track_src(char *path, int open_flags, int flag)
Opens a file with eventual acceleration preparations which may depend on the operating system and on ...
void burn_session_get_leadout_entry(struct burn_session *s, struct burn_toc_entry *entry)
Gets a copy of the toc_entry structure associated with a session's lead out.
int burn_track_set_size(struct burn_track *t, off_t size)
Sets a fixed track size after the data source object has already been created.
void burn_track_clear_isrc(struct burn_track *t)
Disable ISRC parameters for a track.
int libdax_audioxtr_read(struct libdax_audioxtr *xtr, char buffer[], int buffer_size, int flag)
Obtain next buffer full of extracted data in desired format (only raw audio for now).
int burn_drive_extract_audio(struct burn_drive *drive, int start_sector, int sector_count, char *target_path, int flag)
Extract an interval of audio sectors from CD and store it as a WAVE audio file on hard disk.
int libdax_audioxtr_new(struct libdax_audioxtr **xtr, char *path, int flag)
Open an audio file, check whether suitable, create extractor object.
int burn_track_get_counters(struct burn_track *t, off_t *read_bytes, off_t *written_bytes)
Tells how many source bytes have been read and how many data bytes have been written by the track dur...
void burn_write_opts_set_bdr_obs_exempt(struct burn_write_opts *opts, int value)
Exempts BD-R media from the elsewise unavoidable automatic padding of the last write chunk to its ful...
void burn_drive_set_speed(struct burn_drive *d, int read, int write)
Sets drive read and write speed.
int burn_msgs_set_severities(char *queue_severity, char *print_severity, char *print_id)
Control queueing and stderr printing of messages from libburn.
int burn_msf_to_sectors(int m, int s, int f)
Convert a minute-second-frame (MSF) value to sector count.
int burn_drive_was_feat21_failure(struct burn_drive *d)
Inquire whether a write error occurred which is suspected to have happened due to a false report abou...
int burn_track_set_cdtext(struct burn_track *t, int block, int pack_type, char *pack_type_name, unsigned char *payload, int length, int flag)
Attach text or binary data as CD-TEXT attributes to a track.
int burn_disc_close_damaged(struct burn_write_opts *o, int flag)
Try to close the last track and session of media which have bit0 set in the return value of call burn...
int burn_disc_get_format_descr(struct burn_drive *drive, int index, int *type, off_t *size, unsigned *tdp)
Inquire parameters of an available media format.
off_t burn_track_get_sectors_v2(struct burn_track *)
Like burn_track_get_sectors(), but with return type off_t.
int burn_disc_pretend_full(struct burn_drive *drive)
WARNING: This overrides the safety measures against unsuitable media.
int burn_track_set_pregap_size(struct burn_track *t, int size, int flag)
Define whether a pre-gap shall be written before the track and how many sectors this pre-gap shall ha...
void burn_write_opts_set_toc_entries(struct burn_write_opts *opts, int count, struct burn_toc_entry *toc_entries)
Supplies toc entries for writing - not normally required for cd mastering.
void burn_disc_write(struct burn_write_opts *o, struct burn_disc *disc)
Write a disc in the drive.
void burn_drive_release(struct burn_drive *drive, int eject)
Release a drive.
int burn_disc_add_session(struct burn_disc *d, struct burn_session *s, unsigned int pos)
Add a session to a disc at a specific position, increasing the sessions's reference count.
int burn_disc_erasable(struct burn_drive *d)
Tells whether a disc can be erased or not.
void burn_drive_cancel(struct burn_drive *drive)
Cancel an operation on a drive.
struct burn_source * burn_fd_source_new(int datafd, int subfd, off_t size)
Creates a data source for an image file (a track) from an open readable filedescriptor,...
int burn_drive_get_media_sno(struct burn_drive *d, char **sno, int *sno_len)
Returns the Media Serial Number as of MMC feature 109h and command ABh READ MEDIA SERIAL NUMBER.
void burn_lba_to_msf(int lba, int *m, int *s, int *f)
Convert an lba to minute-second-frame (MSF)
int burn_track_dispose_cdtext(struct burn_track *t, int block)
Remove all CD-TEXT attributes of the given block from the track.
int burn_drive_wrote_well(struct burn_drive *d)
Inquire whether the most recent asynchronous media job was successful.
int burn_drive_add_whitelist(char *device_address)
Add a device to the list of permissible drives.
int burn_drive_set_speed_exact(struct burn_drive *d, int read, int write)
Sets drive read and write speed using the "Exact" bit of SCSI command SET STREAMING.
void burn_write_opts_set_force(struct burn_write_opts *opts, int use_force)
Lets libburn ignore the failure of some conformance checks:
void burn_disc_erase(struct burn_drive *drive, int fast)
Erase a disc in the drive.
enum burn_write_types burn_write_opts_auto_write_type(struct burn_write_opts *opts, struct burn_disc *disc, char reasons[BURN_REASONS_LEN], int flag)
As an alternative to burn_write_opts_set_write_type() this function tries to find a suitable write ty...
off_t burn_disc_available_space(struct burn_drive *d, struct burn_write_opts *o)
Return the best possible estimation of the currently available capacity of the media.
int burn_session_set_cdtext_par(struct burn_session *s, int char_codes[8], int copyrights[8], int languages[8], int flag)
Set the Character Codes, the Copyright bytes, and the Language Codes for CD-TEXT blocks 0 to 7.
void burn_write_opts_set_perform_opc(struct burn_write_opts *opts, int opc)
NOTE: This call is traditionally without any effect on the operations of libburn.
int burn_drive_get_speedlist(struct burn_drive *d, struct burn_speed_descriptor **speed_list)
Obtain a copy of the current speed descriptor list.
int burn_track_set_default_size(struct burn_track *t, off_t size)
Set a default track size to be used only if the track turns out to be of unpredictable length and if ...
burn_write_types
Possible disc writing style/modes.
Definition libburn.h:140
@ BURN_WRITE_RAW
With CD: Raw disc at once recording.
Definition libburn.h:182
@ BURN_WRITE_PACKET
Packet writing.
Definition libburn.h:144
@ BURN_WRITE_TAO
With CD: Track At Once recording 2s gaps between tracks, no fonky lead-ins.
Definition libburn.h:154
@ BURN_WRITE_SAO
With CD: Session At Once Block type MUST be BURN_BLOCK_SAO ts A70122: Currently not capable of mixing...
Definition libburn.h:165
@ BURN_WRITE_NONE
In replies this indicates that not any writing will work.
Definition libburn.h:189
int burn_fifo_fill(struct burn_source *fifo, int fill, int flag)
Start the fifo worker thread and wait either until the requested number of bytes have arrived or unti...
int burn_is_aborting(int flag)
void burn_structure_print_track(struct burn_track *t)
enum burn_drive_status burn_drive_get_status(struct burn_drive *drive, struct burn_progress *p)
Returns the progress and status of a drive.
void burn_fifo_next_interval(struct burn_source *fifo, int *interval_min_fill)
Inquire the fifo minimum fill counter for intervals and reset that counter.
void burn_track_set_isrc(struct burn_track *t, char *country, char *owner, unsigned char year, unsigned int serial)
Set the ISRC details for a track.
int burn_obtain_profile_name(int profile_code, char name[80])
Obtains the profile name associated with a profile code.
int burn_drive_info_forget(struct burn_drive_info *drive_info, int force)
Release memory about a single drive and any exclusive lock on it.
int burn_drive_set_immed(struct burn_drive *drive, int enable)
Enable or disable use of the Immed bit with long running SCSI commands.
int burn_session_set_start_tno(struct burn_session *session, int tno, int flag)
Set the number which shall be written as CD track number with the first track of the session.
int burn_abort(int patience, int(*pacifier_func)(void *handle, int patience, int elapsed), void *handle)
Abort any running drive operation and eventually call burn_finish().
int burn_session_by_cue_file(struct burn_session *session, char *path, int fifo_size, struct burn_source **fifo, unsigned char **text_packs, int *num_packs, int flag)
Read a CDRWIN cue sheet file and equip the session object by tracks and CD-TEXT according to the cont...
int burn_drive_get_bd_r_pow(struct burn_drive *drive)
Tells whether a BD-R medium with Pseudo Overwrite (POW) formatting is in the drive.
int burn_drive_get_drive_role(struct burn_drive *d)
Inquire whether the drive object is a real MMC drive or a pseudo-drive created by a stdio: address.
struct burn_track ** burn_session_get_tracks(struct burn_session *s, int *num)
Gets an array of all the tracks for a session THIS IS NO LONGER VALID AFTER YOU ADD OR REMOVE A TRACK...
burn_source_status
Possible data source return values.
Definition libburn.h:283
@ BURN_SOURCE_EOF
The source is at end of file.
Definition libburn.h:287
@ BURN_SOURCE_OK
The source is ok.
Definition libburn.h:285
@ BURN_SOURCE_FAILED
The source is unusable.
Definition libburn.h:289
int burn_disc_free_multi_caps(struct burn_multi_caps **caps)
Removes from memory a multi session info structure which was returned by burn_disc_get_multi_caps().
int burn_drive_equals_adr(struct burn_drive *d1, char *adr2, int drive_role2)
Find out whether a given address string would lead to the given drive object.
struct burn_source * burn_fifo_source_new(struct burn_source *inp, int chunksize, int chunks, int flag)
Creates a fifo which acts as proxy for an already existing data source.
int burn_drive_is_enumerable_adr(char *adr)
Evaluate whether the given address would be a drive device file address which could be listed by a ru...
int burn_random_access_write(struct burn_drive *d, off_t byte_address, char *data, off_t data_count, int flag)
Write data in random access mode.
int burn_fifo_peek_data(struct burn_source *fifo, char *buf, int bufsize, int flag)
Obtain a preview of the first input data of a fifo which was created by burn_fifo_source_new().
void burn_read_opts_set_hardware_error_recovery(struct burn_read_opts *opts, int hardware_error_recovery)
Sets whether to recover errors if possible.
void burn_session_hide_first_track(struct burn_session *s, int onoff)
Hide the first track in the "pre gap" of the disc.
void burn_allow_untested_profiles(int yes)
Allows the use of media types which are implemented in libburn but not yet tested.
int burn_session_remove_track(struct burn_session *s, struct burn_track *t)
Remove a track from a session.
int burn_drive_re_assess(struct burn_drive *d, int flag)
Re-assess drive and media status.
void burn_disc_read(struct burn_drive *drive, const struct burn_read_opts *o)
Read a disc from the drive and write it to an fd pair.
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)
Obtains the fields and data of a particular feature which were obtained from the drive when it was la...
struct burn_session * burn_session_create(void)
Create a new session.
void burn_read_opts_report_recovered_errors(struct burn_read_opts *opts, int report_recovered_errors)
Sets whether to report recovered errors or not.
int burn_disc_get_sectors(struct burn_disc *d)
Tells how many sectors a disc will have, or already has.
int burn_session_get_cdtext(struct burn_session *s, int block, int pack_type, char *pack_type_name, unsigned char **payload, int *length, int flag)
Obtain a CD-TEXT attribute that was set by burn_session_set_cdtext()
void burn_write_opts_set_start_byte(struct burn_write_opts *opts, off_t value)
Sets a start address for writing to media and write modes which are able to choose this address at al...
void burn_finish(void)
Shutdown the library.
int burn_sev_to_text(int severity_number, char **severity_name, int flag)
Convert a severity number into a severity name.
int burn_disc_pretend_blank(struct burn_drive *drive)
WARNING: This revives an old bug-like behavior that might be dangerous.
int burn_session_get_hidefirst(struct burn_session *session)
Returns whether the first track of a session is hidden in the pregap.
int burn_read_audio(struct burn_drive *d, int sector_no, char data[], off_t data_size, off_t *data_count, int flag)
Read CD audio sectors in random access mode.
int burn_disc_get_formats(struct burn_drive *drive, int *status, off_t *size, unsigned *bl_sas, int *num_formats)
Inquire the formatting status, the associated sizes and the number of available formats.
void burn_sectors_to_msf(int sectors, int *m, int *s, int *f)
Convert a sector count to minute-second-frame (MSF)
enum burn_disc_status burn_disc_get_status(struct burn_drive *drive)
Returns what kind of disc a drive is holding.
int burn_session_dispose_cdtext(struct burn_session *s, int block)
Remove all CD-TEXT attributes of the given block from the session.
enum burn_drive_status burn_drive_get_status_v2(struct burn_drive *drive, struct burn_progress_v2 *p)
Returns the progress with long block numbers and the status of the drive.
int burn_session_get_cdtext_par(struct burn_session *s, int char_codes[8], int copyrights[8], int block_languages[8], int flag)
Obtain the current settings as of burn_session_set_cdtext_par()
int burn_precheck_write(struct burn_write_opts *o, struct burn_disc *disc, char reasons[BURN_REASONS_LEN], int silent)
Examines a completed setup for burn_disc_write() whether it is permissible with drive and media.
int burn_disc_next_track_is_damaged(struct burn_drive *d, int flag)
Tells whether a previous attempt to determine the Next Writeable Address of the upcoming track reveil...
void burn_disc_free(struct burn_disc *d)
Delete disc and decrease the reference count on all its sessions.
int burn_cdtext_from_packfile(char *path, unsigned char **text_packs, int *num_packs, int flag)
Read an array of CD-TEXT packs from a file.
int burn_msgs_submit(int error_code, char msg_text[], int os_errno, char severity[], struct burn_drive *d)
Submit a message to the libburn queueing system.
int burn_disc_get_msc1(struct burn_drive *d, int *start_lba)
Read start lba of the first track in the last complete session.
void burn_drive_info_free(struct burn_drive_info drive_infos[])
When no longer needed, free a whole burn_drive_info array which was returned by burn_drive_scan().
void burn_write_opts_set_multi(struct burn_write_opts *opts, int multi)
Sets the multi flag which eventually marks the emerging session as not being the last one and thus cr...
int burn_abort_pacifier(void *handle, int patience, int elapsed)
A pacifier function suitable for burn_abort.
void burn_read_opts_free(struct burn_read_opts *opts)
Frees a read_opts struct created with burn_read_opts_new.
burn_disc_status
Possible status of the drive in regard to the disc in it.
Definition libburn.h:234
@ BURN_DISC_UNREADY
The current status is not yet known.
Definition libburn.h:236
@ BURN_DISC_EMPTY
There is no disc at all in the drive.
Definition libburn.h:249
@ BURN_DISC_UNGRABBED
The drive was not grabbed when the status was inquired.
Definition libburn.h:272
@ BURN_DISC_BLANK
The drive holds a blank disc.
Definition libburn.h:246
@ BURN_DISC_UNSUITABLE
The media seems to be unsuitable for reading and for writing.
Definition libburn.h:277
@ BURN_DISC_APPENDABLE
There is an incomplete disc in the drive.
Definition libburn.h:256
@ BURN_DISC_FULL
There is a disc with data on it in the drive.
Definition libburn.h:267
int burn_drive_get_read_speed(struct burn_drive *d)
Gets the maximum read speed for a drive.
void burn_drive_clear_whitelist(void)
Remove all drives from whitelist.
struct burn_write_opts * burn_write_opts_new(struct burn_drive *drive)
Creates a write_opts struct for burning to the specified drive.
int burn_drive_get_start_end_lba(struct burn_drive *drive, int *start_lba, int *end_lba, int flag)
Returns start and end lba of the media which is currently inserted in the given drive.
int burn_write_opts_set_leadin_text(struct burn_write_opts *opts, unsigned char *text_packs, int num_packs, int flag)
Submit an array of CD-TEXT packs which shall be written to the Lead-in of a SAO write run on CD.
char * burn_scsi_transport_id(int flag)
Note: Above version numbers are also recorded in configure.ac because libtool wants them as parameter...
int burn_get_read_capacity(struct burn_drive *d, int *capacity, int flag)
Inquire the maximum amount of readable data.
struct burn_disc * burn_drive_get_disc(struct burn_drive *d)
Get the drive's disc struct - free when done.
void burn_write_opts_set_mediacatalog(struct burn_write_opts *opts, unsigned char mediacatalog[13])
The Q sub-channel of a CD may contain a Media Catalog Number of 13 decimal digits.
struct burn_track * burn_track_create(void)
Create a track.
int burn_disc_remove_session(struct burn_disc *d, struct burn_session *s)
Remove a session from a disc.
int libdax_audioxtr_detach_fd(struct libdax_audioxtr *o, int *fd, int flag)
Try to obtain a file descriptor which will deliver extracted data to normal calls of read(2).
int burn_disc_track_lba_nwa_v2(struct burn_drive *d, struct burn_write_opts *o, int trackno, off_t *lba, off_t *nwa)
Like burn_disc_track_lba_nwa(), but with off_t results.
int burn_track_get_sectors(struct burn_track *)
Tells how many sectors a track will have on disc, or already has on disc.
void burn_preset_device_open(int exclusive, int blocking, int abort_on_busy)
Set parameters for behavior on opening device files.
int burn_drive_get_write_speed(struct burn_drive *d)
Gets the maximum write speed for a drive and eventually loaded media.
int burn_drive_scan_and_grab(struct burn_drive_info *drive_infos[], char *adr, int load)
Acquire a drive with known device file address.
int burn_drive_get_immed(struct burn_drive *drive)
Inquire the current setting of usage of the Immed bit.
int burn_disc_get_media_id(struct burn_drive *d, char **product_id, char **media_code1, char **media_code2, char **book_type, int flag)
Obtain product id and standards defined media codes.
void burn_read_opts_set_raw(struct burn_read_opts *opts, int raw_mode)
Sets whether to read in raw mode or not.
void burn_track_define_data(struct burn_track *t, int offset, int tail, int pad, int mode)
Define the data in a track.
int burn_drive_extract_audio_track(struct burn_drive *drive, struct burn_track *track, char *target_path, int flag)
Extract all audio sectors of a track from CD and store them as a WAVE audio file on hard disk.
int burn_session_input_sheet_v07t(struct burn_session *session, char *path, int block, int flag)
Read a Sony CD-TEXT Input Sheet Version 0.7T file and attach its text attributes to the given session...
int burn_drive_get_serial_no(struct burn_drive *d, char **sno, int *sno_len)
Returns the Drive Serial Number as of MMC feature 108h.
struct burn_session ** burn_disc_get_sessions(struct burn_disc *d, int *num)
Gets an array of all complete sessions for the disc THIS IS NO LONGER VALID AFTER YOU ADD OR REMOVE A...
int burn_fifo_inquire_status(struct burn_source *fifo, int *size, int *free_bytes, char **status_text)
Inquires state and fill parameters of a fifo burn_source which was created by burn_fifo_source_new() ...
int burn_track_set_cdxa_conv(struct burn_track *t, int value)
Activates CD XA compatibility modes.
off_t burn_disc_get_sectors_v2(struct burn_disc *d)
Like burn_disc_get_sectors(), but with return type off_t.
int burn_disc_track_lba_nwa(struct burn_drive *d, struct burn_write_opts *o, int trackno, int *lba, int *nwa)
Read start lba and Next Writeable Address of a track from media.
struct burn_source * burn_file_source_new(const char *path, const char *subpath)
Creates a data source for an image file (and maybe subcode file)
void burn_structure_print_disc(struct burn_disc *d)
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)
Controls the behavior with writing when the drive buffer is suspected to be full.
char * burn_list_sev_texts(int flag)
Return a blank separated list of severity names.
void burn_allow_drive_role_4(int allowed)
Allow drive role 4 "random access read-only" and drive role 5 "random access write-only".
int burn_write_opts_set_write_type(struct burn_write_opts *opts, enum burn_write_types write_type, int block_type)
Sets the write type for the write_opts struct.
int burn_write_opts_set_perform_opc_v2(struct burn_write_opts *opts, int opc)
Control whether and when to use Optimum Power Calibration (OPC).
int burn_drive_get_best_speed(struct burn_drive *d, int speed_goal, struct burn_speed_descriptor **best_descr, int flag)
Look up the fastest speed descriptor which is not faster than the given speed_goal.
Information on a drive in the system.
Definition libburn.h:601
char location[17]
Invalid: Was: "Location of the drive in the filesystem.".
Definition libburn.h:613
unsigned int read_cdr
Can the drive read CD-R discs.
Definition libburn.h:627
unsigned int write_simulate
Can the drive simulate a write.
Definition libburn.h:641
unsigned int write_dvdr
Can the drive write DVD-R discs.
Definition libburn.h:634
unsigned int read_cdrw
Can the drive read CD-RW discs.
Definition libburn.h:629
int packet_block_types
The supported block types in packet mode.
Definition libburn.h:673
unsigned int read_dvdrom
Can the drive read DVD-ROM discs.
Definition libburn.h:625
char product[17]
Name of the drive.
Definition libburn.h:605
int sao_block_types
The supported block types in sao mode.
Definition libburn.h:661
int tao_block_types
The supported block types in tao mode.
Definition libburn.h:655
unsigned int write_cdrw
Can the drive write CD-RW discs.
Definition libburn.h:638
unsigned int read_dvdr
Can the drive read DVD-R discs.
Definition libburn.h:623
int buffer_size
DEPRECATED: The size of the drive's buffer (in kilobytes)
Definition libburn.h:647
unsigned int read_dvdram
Can the drive read DVD-RAM discs.
Definition libburn.h:621
struct burn_drive * drive
The value by which this drive can be indexed when using functions in the library.
Definition libburn.h:678
unsigned int write_cdr
Can the drive write CD-R discs.
Definition libburn.h:636
int raw_block_types
The supported block types in raw mode.
Definition libburn.h:667
unsigned int write_dvdram
Can the drive write DVD-RAM discs.
Definition libburn.h:632
char revision[5]
Revision of the drive.
Definition libburn.h:607
unsigned int c2_errors
DEPRECATED: Can the drive report C2 errors.
Definition libburn.h:644
char vendor[9]
Name of the vendor of the drive.
Definition libburn.h:603
The reply structure for burn_disc_get_multi_caps()
Definition libburn.h:3755
int current_profile
Profile number which was current when the reply was generated.
Definition libburn.h:3825
int might_simulate
Whether the current profile is able to perform simulated write.
Definition libburn.h:3833
off_t start_alignment
The alignment for start addresses.
Definition libburn.h:3791
int might_do_tao
Potential availability of write modes 4= needs no size prediction, not to be chosen automatically 3= ...
Definition libburn.h:3810
off_t start_range_low
The lowest permissible start address.
Definition libburn.h:3795
enum burn_write_types selected_write_mode
Write mode as given by parameter wt of burn_disc_get_multi_caps().
Definition libburn.h:3822
off_t start_range_high
The highest addressable start address.
Definition libburn.h:3799
enum burn_write_types advised_write_mode
Generally advised write mode.
Definition libburn.h:3818
int current_is_cd_profile
Whether the current profile indicates CD media.
Definition libburn.h:3828
Operation progress report with long block numbers.
Definition libburn.h:731
off_t start_sector
The starting logical block address.
Definition libburn.h:749
int indices
The total number of indices.
Definition libburn.h:745
off_t sectors
On write: The number of sectors.
Definition libburn.h:752
int index
Current index.
Definition libburn.h:747
off_t buffer_available
The free space in the drive buffer (might be slightly outdated)
Definition libburn.h:760
int track
Current track.
Definition libburn.h:743
off_t sector
On write: The current sector being processed.
Definition libburn.h:755
off_t buffer_capacity
The capacity of the drive buffer.
Definition libburn.h:758
int tracks
The total number of tracks.
Definition libburn.h:741
off_t buffer_min_fill
The minimum number of bytes stored in buffer during write.
Definition libburn.h:768
off_t buffered_bytes
The number of bytes sent to the drive buffer.
Definition libburn.h:763
int revision
Revision of the struct format.
Definition libburn.h:734
int sessions
The total number of sessions.
Definition libburn.h:737
int session
Current session.
Definition libburn.h:739
Operation progress report.
Definition libburn.h:685
off_t buffered_bytes
The number of bytes sent to the drive buffer.
Definition libburn.h:717
int index
Current index.
Definition libburn.h:697
int session
Current session.
Definition libburn.h:689
unsigned buffer_min_fill
The minimum number of bytes stored in buffer during write.
Definition libburn.h:722
int start_sector
The starting logical block address.
Definition libburn.h:699
unsigned buffer_capacity
The capacity of the drive buffer.
Definition libburn.h:710
int tracks
The total number of tracks.
Definition libburn.h:691
int sector
On write: The current sector being processed.
Definition libburn.h:705
int sessions
The total number of sessions.
Definition libburn.h:687
int indices
The total number of indices.
Definition libburn.h:695
int track
Current track.
Definition libburn.h:693
unsigned buffer_available
The free space in the drive buffer (might be slightly outdated)
Definition libburn.h:712
int sectors
On write: The number of sectors.
Definition libburn.h:702
Data source interface for tracks.
Definition libburn.h:477
int(* set_size)(struct burn_source *source, off_t size)
Program the reply of (*get_size) to a fixed value.
Definition libburn.h:540
void(* free_data)(struct burn_source *)
Clean up the source specific data.
Definition libburn.h:547
off_t(* get_size)(struct burn_source *)
Get the size of the source's data.
Definition libburn.h:523
int(* read_sub)(struct burn_source *, unsigned char *buffer, int size)
Read subchannel data from the source (NULL if lib generated) WARNING: This is an obscure feature with...
Definition libburn.h:516
int(* read)(struct burn_source *, unsigned char *buffer, int size)
Read data from the source.
Definition libburn.h:507
int(* cancel)(struct burn_source *source)
Informs the burn_source that the consumer of data prematurely ended reading.
Definition libburn.h:595
struct burn_source * next
Next source, for when a source runs dry and padding is disabled WARNING: This is an obscure feature.
Definition libburn.h:554
int refcount
Reference count for the data source.
Definition libburn.h:483
void * data
Source specific data.
Definition libburn.h:571
int(* read_xt)(struct burn_source *, unsigned char *buffer, int size)
This substitutes for (*read)() in versions above 0.
Definition libburn.h:589
int version
Valid only if above member .
Definition libburn.h:586
Description of a speed capability as reported by the drive in conjunction with eventually loaded medi...
Definition libburn.h:785
struct burn_speed_descriptor * next
Definition libburn.h:821
int wrc
Expert info from ACh GET PERFORMANCE and/or mode page 2Ah.
Definition libburn.h:813
struct burn_speed_descriptor * prev
List chaining.
Definition libburn.h:820
int end_lba
The attributed capacity of appropriate media in logical block units i.e.
Definition libburn.h:803
char profile_name[80]
Definition libburn.h:799
int profile_loaded
The media type that was current at the time of report -2 = state unknown, -1 = no media was loaded ,...
Definition libburn.h:798
int write_speed
Speed is given in 1000 bytes/s , 0 = invalid.
Definition libburn.h:807
int source
Where this info comes from : 0 = misc 1 = mode page 2Ah 2 = ACh GET PERFORMANCE Type 03h 3 = ACh GET ...
Definition libburn.h:793
Information about a track on a disc - this is from the q sub channel of the lead-in area of a disc.
Definition libburn.h:353
unsigned char adr
Type of data.
Definition libburn.h:357
unsigned char frame
Definition libburn.h:366
unsigned char extensions_valid
Definition libburn.h:385
int start_lba
Definition libburn.h:395
off_t long_track_blocks
Definition libburn.h:429
unsigned char psec
Track start time seconds for normal tracks.
Definition libburn.h:371
unsigned char pmin
Track start time minutes for normal tracks.
Definition libburn.h:369
int last_recorded_address
Definition libburn.h:407
unsigned char point_msb
Definition libburn.h:392
unsigned char point
Track number or special information.
Definition libburn.h:363
unsigned char session
Session the track is in.
Definition libburn.h:355
int track_blocks
Definition libburn.h:398
unsigned char tno
Zero.
Definition libburn.h:361
unsigned char control
Type of data in the track.
Definition libburn.h:359
unsigned char sec
Definition libburn.h:365
unsigned char pframe
Track start time frames for normal tracks.
Definition libburn.h:373
unsigned char min
Definition libburn.h:364
int track_status_bits
Definition libburn.h:424
unsigned char zero
Definition libburn.h:367
unsigned char session_msb
Definition libburn.h:391
off_t long_start_lba
Definition libburn.h:428
off_t long_last_rec_adr
Definition libburn.h:430

Generated for libburn by  doxygen 1.13.2