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

Generated for libburn by  doxygen 1.8.12