libburn  1.4.8
libburn.h
Go to the documentation of this file.
1 /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
2 
3 /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
4  Copyright (c) 2006 - 2017 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 */
1070 int burn_drive_is_enumerable_adr(char *adr);
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 B70206 */
1317 /** Tells whether a BD-R medium with Pseudo Overwrite (POW) formatting is in
1318  the drive. Such a formatting may have been applied by dvd+rw-tools. It
1319  prevents sequential multi-session.
1320  libburn will refuse to write to such a medium.
1321  @param drive The drive to query.
1322  @return 1 if BD-R Pseudo Overwrite , 0 if not BD-R or not POW
1323  @since 1.4.8
1324 */
1325 int burn_drive_get_bd_r_pow(struct burn_drive *drive);
1326 
1327 
1328 /* ts A61020 */
1329 /** Returns start and end lba of the media which is currently inserted
1330  in the given drive. The drive has to be grabbed to have hope for reply.
1331  Shortcomming (not a feature): unless burn_disc_read_atip() was called
1332  only blank media will return valid info.
1333  @param drive The drive to query.
1334  @param start_lba Returns the start lba value
1335  @param end_lba Returns the end lba value
1336  @param flag Bitfield for control purposes (unused yet, submit 0)
1337  @return 1 if lba values are valid , 0 if invalid
1338  @since 0.2.6
1339 */
1340 int burn_drive_get_start_end_lba(struct burn_drive *drive,
1341  int *start_lba, int *end_lba, int flag);
1342 
1343 
1344 /* ts A90902 */
1345 /** Guess the manufacturer name of CD media from the ATIP addresses of lead-in
1346  and lead-out. (Currently only lead-in is interpreted. Lead-out may in
1347  future be used to identify the media type in more detail.)
1348  The parameters of this call should be obtained by burn_disc_read_atip(d),
1349  burn_drive_get_start_end_lba(d, &start_lba, &end_lba, 0),
1350  burn_lba_to_msf(start_lba, &m_li, &s_li, &f_li) and
1351  burn_lba_to_msf(end_lba, &m_lo, &s_lo, &f_lo).
1352  @param m_li "minute" part of ATIP lead-in or start_lba
1353  @param s_li "second" of lead-in or start_lba
1354  @param f_li "frame" of lead-in
1355  @param m_lo "minute" part of ATIP lead-out
1356  @param s_lo "second" of lead-out
1357  @param f_lo "frame" of lead-out
1358  @param flag Bitfield for control purposes,
1359  bit0= append a text "(aka ...)" to reply if other brands or
1360  vendor names are known.
1361  @return Printable text or NULL on memory shortage.
1362  Dispose by free() when no longer needed.
1363  @since 0.7.2
1364 */
1365 char *burn_guess_cd_manufacturer(int m_li, int s_li, int f_li,
1366  int m_lo, int s_lo, int f_lo, int flag);
1367 
1368 /* ts A90909 */
1369 /** Retrieve some media information which is mainly specific to CD. For other
1370  media only the bits in reply parameter valid are supposed to be meaningful.
1371  @param d The drive to query.
1372  @param disc_type A string saying either "CD-DA or CD-ROM", or "CD-I",
1373  or ""CD-ROM XA", or "undefined".
1374  @param disc_id A 32 bit number read from the media. (Meaning unclear yet)
1375  @param bar_code 8 hex digits from a barcode on media read by the drive
1376  (if the drive has a bar code reader built in).
1377  @param app_code The Host Application Code which must be set in the Write
1378  Parameters Page if the media is not unrestricted (URU==0).
1379  @param valid Replies bits which indicate the validity of other reply
1380  parameters or the state of certain CD info bits:
1381  bit0= disc_type is valid
1382  bit1= disc_id is valid
1383  bit2= bar_code is valid
1384  bit3= disc_app_code is valid
1385  bit4= Disc is unrestricted (URU bit, 51h READ DISC INFO)
1386  This seems to be broken with my drives. The bit is
1387  0 and the validity bit for disc_app_code is 0 too.
1388  bit5= Disc is nominally erasable (Erasable bit)
1389  This will be set with overwriteable media which
1390  libburn normally considers to be unerasable blank.
1391  @return 1 success, <= 0 an error occurred
1392  @since 0.7.2
1393 */
1394 int burn_disc_get_cd_info(struct burn_drive *d, char disc_type[80],
1395  unsigned int *disc_id, char bar_code[9], int *app_code,
1396  int *valid);
1397 
1398 /* ts B11201 */
1399 /** Read the array of CD-TEXT packs from the Lead-in of an audio CD.
1400  Each pack consists of 18 bytes, of which 4 are header. 12 bytes are pieces
1401  of 0-terminated texts or binary data. 2 bytes hold a CRC.
1402  For a description of the format of the array, see file doc/cdtext.txt.
1403  @param d The drive to query.
1404  @param text_packs Will point to an allocated memory buffer with CD-TEXT.
1405  It will only contain text packs, and not be prepended
1406  by the TOC header of four bytes, which gets stored with
1407  file cdtext.dat by cdrecord -vv -toc. (The first two of
1408  these bytes are supposed to hold the number of CD-TEXT
1409  bytes + 2. The other two bytes are supposed to be 0.)
1410  Dispose this buffer by free(), when no longer needed.
1411  @param num_packs Will tell the number of text packs, i.e. the number of
1412  bytes in text_packs divided by 18.
1413  @param flag Bitfield for control purposes,
1414  Unused yet. Submit 0.
1415  @return 1 success, 0= no CD-TEXT found, < 0 an error occurred
1416  @since 1.2.0
1417 */
1418 int burn_disc_get_leadin_text(struct burn_drive *d,
1419  unsigned char **text_packs, int *num_packs,
1420  int flag);
1421 
1422 /* ts B00924 */
1423 /** Read the current usage of the eventual BD Spare Area. This area gets
1424  reserved on BD media during formatting. During writing it is used to
1425  host replacements of blocks which failed the checkread immediately after
1426  writing.
1427  This call applies only to recordable BD media. I.e. profiles 0x41 to 0x43.
1428  @param d The drive to query.
1429  @param alloc_blocks Returns the number of blocks reserved as Spare Area
1430  @param free_blocks Returns the number of yet unused blocks in that area
1431  @param flag Bitfield for control purposes (unused yet, submit 0)
1432  @return 1 = reply prarameters are valid,
1433  <=0 = reply is invalid (e.g. because no BD profile)
1434  @since 0.8.8
1435 */
1436 int burn_disc_get_bd_spare_info(struct burn_drive *d,
1437  int *alloc_blocks, int *free_blocks, int flag);
1438 
1439 /* ts B10801 */
1440 /** Retrieve some media information which is mainly specific to media of
1441  the DVD-R family: DVD-R , DVD-RW , DVD-R DL , HD DVD-R
1442  Currently the information cannot be retrieved from other media types.
1443  @param d The drive to query.
1444  @param disk_category returns DVD Book to which the media complies
1445  @param book_name returns a pointer to the book name of disk_category.
1446  This memory is static. Do not alter or free it !
1447  @param part_version returns the Media Version in the DVD Book
1448  @param num_layers returns the number of media layers
1449  @param num_blocks returns the number of blocks between pysical start
1450  and physical end of the media
1451  @param flag Bitfield for control purposes (unused yet, submit 0)
1452  @return 1 = reply prarameters are valid,
1453  <=0 = reply is invalid (e.g. because no DVD-R)
1454  @since 1.1.4
1455 */
1456 int burn_disc_get_phys_format_info(struct burn_drive *d, int *disk_category,
1457  char **book_name, int *part_version, int *num_layers,
1458  int *num_blocks, int flag);
1459 
1460 /* ts A61110 */
1461 /** Read start lba and Next Writeable Address of a track from media.
1462  Usually a track lba is obtained from the result of burn_track_get_entry().
1463  This call retrieves an updated lba, eventual nwa, and can address the
1464  invisible track to come.
1465  The drive must be grabbed for this call. One may not issue this call
1466  during ongoing burn_disc_write() or burn_disc_erase().
1467  @param d The drive to query.
1468  @param o If not NULL: write parameters to be set on drive before query
1469  @param trackno 0=next track to come, >0 number of existing track
1470  The first existing track on a CD may have a number higher
1471  than 1. Use burn_session_get_start_tno() to inquire this
1472  start number.
1473  @param lba return value: start lba
1474  @param nwa return value: Next Writeable Address
1475  @return 1=nwa is valid , 0=nwa is not valid , -1=error
1476  @since 0.2.6
1477 */
1478 int burn_disc_track_lba_nwa(struct burn_drive *d, struct burn_write_opts *o,
1479  int trackno, int *lba, int *nwa);
1480 
1481 /* ts B10525 */
1482 /** Tells whether a previous attempt to determine the Next Writeable Address
1483  of the upcoming track reveiled that the READ TRACK INFORMATION Damage Bit
1484  is set for this track and that no valid writable address is available.
1485  See MMC-5 6.27.3.7 Damage Bit, 6.27.3.11 NWA_V (NWA valid)
1486  @param d The drive to query.
1487  @param flag Bitfield for control purposes (unused yet, submit 0)
1488  @return 0= Looks ok: Damage Bit is not set, NWA_V is set
1489  1= Damaged and theoretically writable (NWA_V is set)
1490  2= Not writable: NWA_V is not set
1491  3= Damaged and not writable (NWA_V is not set),
1492  @since 1.1.0
1493 */
1494 int burn_disc_next_track_is_damaged(struct burn_drive *d, int flag);
1495 
1496 /* ts B10527 */
1497 /** Try to close the last track and session of media which have bit0 set in
1498  the return value of call burn_disc_next_track_is_damaged().
1499  Whether it helps depends much on the reason why the media is reported
1500  as damaged by the drive.
1501  This call works only for profiles 0x09 CD-R, 0x0a CD-RW, 0x11 DVD-R,
1502  0x14 DVD-RW sequential, 0x1b DVD+R, 0x2b DVD+R DL, 0x41 BD-R sequential.
1503  Note: After writing it is advised to give up the drive and to grab it again
1504  in order to learn about its view on the new media state.
1505  @param o Write options created by burn_write_opts_new() and
1506  manipulated by burn_write_opts_set_multi().
1507  burn_write_opts_set_write_type() should be set to
1508  BURN_WRITE_TAO, burn_write_opts_set_simulate() should be
1509  set to 0.
1510  @param flag Bitfield for control purposes
1511  bit0= force close, even if no damage was seen
1512  @return <=0 media not marked as damaged, or media type not suitable,
1513  or closing attempted but failed
1514  1= attempt finished without error indication
1515  @since 1.1.0
1516 */
1517 int burn_disc_close_damaged(struct burn_write_opts *o, int flag);
1518 
1519 
1520 /* ts A70131 */
1521 /** Read start lba of the first track in the last complete session.
1522  This is the first parameter of mkisofs option -C. The second parameter
1523  is nwa as obtained by burn_disc_track_lba_nwa() with trackno 0.
1524  @param d The drive to query.
1525  @param start_lba returns the start address of that track
1526  @return <= 0 : failure, 1 = ok
1527  @since 0.3.2
1528 */
1529 int burn_disc_get_msc1(struct burn_drive *d, int *start_lba);
1530 
1531 
1532 /* ts A70213 */
1533 /** Return the best possible estimation of the currently available capacity of
1534  the media. This might depend on particular write option settings. For
1535  inquiring the space with such a set of options, the drive has to be
1536  grabbed and BURN_DRIVE_IDLE. If not, then one will only get a canned value
1537  from the most recent automatic inquiry (e.g. during last drive grabbing).
1538  An eventual start address from burn_write_opts_set_start_byte() will be
1539  taken into respect with the capacity estimation. Negative results get
1540  defaulted to 0.
1541  If the drive is actually a file in a large filesystem or a large block
1542  device, then the capacity is curbed to a maximum of 0x7ffffff0 blocks
1543  = 4 TB - 32 KB.
1544  @param d The drive to query.
1545  @param o If not NULL: write parameters to be set on drive before query
1546  @return number of most probably available free bytes
1547  @since 0.3.4
1548 */
1549 off_t burn_disc_available_space(struct burn_drive *d,
1550  struct burn_write_opts *o);
1551 
1552 /* ts A61202 */
1553 /** Tells the MMC Profile identifier of the loaded media. The drive must be
1554  grabbed in order to get a non-zero result.
1555  libburn currently writes only to profiles
1556  0x09 "CD-R"
1557  0x0a "CD-RW"
1558  0x11 "DVD-R sequential recording"
1559  0x12 "DVD-RAM"
1560  0x13 "DVD-RW restricted overwrite"
1561  0x14 "DVD-RW sequential recording",
1562  0x15 "DVD-R/DL sequential recording",
1563  0x1a "DVD+RW"
1564  0x1b "DVD+R",
1565  0x2b "DVD+R/DL",
1566  0x41 "BD-R sequential recording",
1567  0x43 "BD-RE",
1568  0xffff "stdio file"
1569  Note: 0xffff is not a MMC profile but a libburn invention.
1570  Read-only are the profiles
1571  0x08 "CD-ROM",
1572  0x10 "DVD-ROM",
1573  0x40 "BD-ROM",
1574  Read-only for now is this BD-R profile (testers wanted)
1575  0x42 "BD-R random recording"
1576  Empty drives are supposed to report
1577  0x00 ""
1578  @param d The drive where the media is inserted.
1579  @param pno Profile Number. See also mmc5r03c.pdf, table 89
1580  @param name Profile Name (see above list, unknown profiles have empty name)
1581  @return 1 profile is valid, 0 no profile info available
1582  @since 0.3.0
1583 */
1584 int burn_disc_get_profile(struct burn_drive *d, int *pno, char name[80]);
1585 
1586 
1587 /* ts A90903 : API */
1588 /** Obtain product id and standards defined media codes.
1589  The product id is a printable string which is supposed to be the same
1590  for identical media but should vary with non-identical media. Some media
1591  cannot provide such an id at all.
1592  The pair (profile_number, product_id) should be the best id to identify
1593  media with identical product specifications.
1594  The reply parameters media_code1 and media_code2 can be used with
1595  burn_guess_manufacturer()
1596  The reply parameters have to be disposed by free() when no longer needed.
1597  @param d The drive where the media is inserted.
1598  @param product_id Reply: Printable text depicting manufacturer and
1599  eventually media id.
1600  @param media_code1 Reply: The eventual manufacturer identification as read
1601  from DVD/BD media or a text "XXmYYsZZf" from CD media
1602  ATIP lead-in.
1603  @param media_code2 The eventual media id as read from DVD+/BD media or a
1604  text "XXmYYsZZf" from CD ATIP lead-out.
1605  @param book_type Book type text for DVD and BD.
1606  Caution: is NULL with CD, even if return value says ok.
1607  @param flag Bitfield for control purposes
1608  bit0= do not escape " _/" (not suitable for
1609  burn_guess_manufacturer())
1610  @return 1= ok, product_id and media codes are valid,
1611  0= no product id_available, reply parameters are NULL
1612  <0= error
1613  @since 0.7.2
1614 */
1615 int burn_disc_get_media_id(struct burn_drive *d,
1616  char **product_id, char **media_code1, char **media_code2,
1617  char **book_type, int flag);
1618 
1619 
1620 /* ts A90904 */
1621 /** Guess the name of a manufacturer by profile number, manufacturer code
1622  and media code. The profile number can be obtained by
1623  burn_disc_get_profile(), the other two parameters can be obtained as
1624  media_code1 and media_code2 by burn_disc_get_media_id().
1625  @param profile_no Profile number (submit -1 if not known)
1626  @param manuf_code Manufacturer code from media (e.g. "RICOHJPN")
1627  @param media_code Media ID code from media (e.g. "W11")
1628  @param flag Bitfield for control purposes, submit 0
1629  @return Printable text or NULL on memory shortage.
1630  If the text begins with "Unknown " then no item of the
1631  manufacturer list matched the codes.
1632  Dispose by free() when no longer needed.
1633  @since 0.7.2
1634 */
1635 char *burn_guess_manufacturer(int profile_no,
1636  char *manuf_code, char *media_code, int flag);
1637 
1638 
1639 /** Tells whether a disc can be erased or not
1640  @param d The drive to inquire.
1641  @return Non-zero means erasable
1642 */
1643 int burn_disc_erasable(struct burn_drive *d);
1644 
1645 /** Returns the progress and status of a drive.
1646  @param drive The drive to query busy state for.
1647  @param p Returns the progress of the operation, NULL if you don't care
1648  @return the current status of the drive. See also burn_drive_status.
1649 */
1650 enum burn_drive_status burn_drive_get_status(struct burn_drive *drive,
1651  struct burn_progress *p);
1652 
1653 /** Creates a write_opts struct for burning to the specified drive.
1654  The returned object must later be freed with burn_write_opts_free().
1655  @param drive The drive to write with
1656  @return The write_opts, NULL on error
1657 */
1658 struct burn_write_opts *burn_write_opts_new(struct burn_drive *drive);
1659 
1660 
1661 /* ts A70901 */
1662 /** Inquires the drive associated with a burn_write_opts object.
1663  @param opts object to inquire
1664  @return pointer to drive
1665  @since 0.4.0
1666 */
1667 struct burn_drive *burn_write_opts_get_drive(struct burn_write_opts *opts);
1668 
1669 
1670 /** Frees a write_opts struct created with burn_write_opts_new
1671  @param opts write_opts to free
1672 */
1673 void burn_write_opts_free(struct burn_write_opts *opts);
1674 
1675 /** Creates a read_opts struct for reading from the specified drive
1676  must be freed with burn_read_opts_free
1677  @param drive The drive to read from
1678  @return The read_opts
1679 */
1680 struct burn_read_opts *burn_read_opts_new(struct burn_drive *drive);
1681 
1682 /** Frees a read_opts struct created with burn_read_opts_new
1683  @param opts write_opts to free
1684 */
1685 void burn_read_opts_free(struct burn_read_opts *opts);
1686 
1687 /** Erase a disc in the drive. The drive must be grabbed successfully BEFORE
1688  calling this functions. Always ensure that the drive reports a status of
1689  BURN_DISC_FULL before calling this function. An erase operation is not
1690  cancellable, as control of the operation is passed wholly to the drive and
1691  there is no way to interrupt it safely.
1692  @param drive The drive with which to erase a disc.
1693  Only drive roles 1 (MMC) and 5 (stdio random write-only)
1694  support erasing.
1695  @param fast Nonzero to do a fast erase, where only the disc's headers are
1696  erased; zero to erase the entire disc.
1697  With DVD-RW, fast blanking yields media capable only of DAO.
1698 */
1699 void burn_disc_erase(struct burn_drive *drive, int fast);
1700 
1701 
1702 /* ts A70101 - A70417 */
1703 /** Format media for use with libburn. This currently applies to DVD-RW
1704  in state "Sequential Recording" (profile 0014h) which get formatted to
1705  state "Restricted Overwrite" (profile 0013h). DVD+RW can be "de-iced"
1706  by setting bit4 of flag. DVD-RAM and BD-RE may get formatted initially
1707  or re-formatted to adjust their Defect Management.
1708  This function usually returns while the drive is still in the process
1709  of formatting. The formatting is done, when burn_drive_get_status()
1710  returns BURN_DRIVE_IDLE. This may be immediately after return or may
1711  need several thousand seconds to occur.
1712  @param drive The drive with the disc to format.
1713  @param size The size in bytes to be used with the format command. It should
1714  be divisible by 32*1024. The effect of this parameter may
1715  depend on the media profile and on parameter flag.
1716  @param flag Bitfield for control purposes:
1717  bit0= after formatting, write the given number of zero-bytes
1718  to the media and eventually perform preliminary closing.
1719  bit1+2: size mode
1720  0 = use parameter size as far as it makes sense
1721  1 = insist in size 0 even if there is a better default known
1722  (on DVD-RAM or BD-R identical to size mode 0,
1723  i.e. they never get formatted with payload size 0)
1724  2 = without bit7: format to maximum available size
1725  with bit7 : take size from indexed format descriptor
1726  3 = without bit7: format to default size
1727  with bit7 : take size from indexed format descriptor
1728  bit3= -reserved-
1729  bit4= enforce re-format of (partly) formatted media
1730  bit5= try to disable eventual defect management
1731  bit6= try to avoid lengthy media certification
1732  bit7, bit8 to bit15 =
1733  bit7 enables MMC expert application mode (else libburn
1734  tries to choose a suitable format type):
1735  If it is set then bit8 to bit15 contain the index of
1736  the format to use. See burn_disc_get_formats(),
1737  burn_disc_get_format_descr().
1738  Acceptable types are: 0x00, 0x01, 0x10, 0x11, 0x13,
1739  0x15, 0x26, 0x30, 0x31, 0x32.
1740  If bit7 is set, then bit4 is set automatically.
1741  bit16= enable POW on blank BD-R
1742  @since 0.3.0
1743 */
1744 void burn_disc_format(struct burn_drive *drive, off_t size, int flag);
1745 
1746 
1747 /* ts A70112 */
1748 /* @since 0.3.0 */
1749 /** Possible formatting status values */
1750 #define BURN_FORMAT_IS_UNFORMATTED 1
1751 #define BURN_FORMAT_IS_FORMATTED 2
1752 #define BURN_FORMAT_IS_UNKNOWN 3
1753 
1754 /* ts A70112 */
1755 /** Inquire the formatting status, the associated sizes and the number of
1756  available formats. The info is media specific and stems from MMC command
1757  23h READ FORMAT CAPACITY. See mmc5r03c.pdf 6.24 for background details.
1758  Media type can be determined via burn_disc_get_profile().
1759  @param drive The drive with the disc to format.
1760  @param status The current formatting status of the inserted media.
1761  See BURN_FORMAT_IS_* macros. Note: "unknown" is the
1762  legal status for quick formatted, yet unwritten DVD-RW.
1763  @param size The size in bytes associated with status.
1764  unformatted: the maximum achievable size of the media
1765  formatted: the currently formatted capacity
1766  unknown: maximum capacity of drive or of media
1767  @param bl_sas Additional info "Block Length/Spare Area Size".
1768  Expected to be constantly 2048 for non-BD media.
1769  @param num_formats The number of available formats. To be used with
1770  burn_disc_get_format_descr() to obtain such a format
1771  and eventually with burn_disc_format() to select one.
1772  @return 1 reply is valid , <=0 failure
1773  @since 0.3.0
1774 */
1775 int burn_disc_get_formats(struct burn_drive *drive, int *status, off_t *size,
1776  unsigned *bl_sas, int *num_formats);
1777 
1778 /* ts A70112 */
1779 /** Inquire parameters of an available media format.
1780  @param drive The drive with the disc to format.
1781  @param index The index of the format item. Beginning with 0 up to reply
1782  parameter from burn_disc_get_formats() : num_formats - 1
1783  @param type The format type. See mmc5r03c.pdf, 6.5, 04h FORMAT UNIT.
1784  0x00=full, 0x10=CD-RW/DVD-RW full, 0x11=CD-RW/DVD-RW grow,
1785  0x15=DVD-RW quick, 0x13=DVD-RW quick grow,
1786  0x26=DVD+RW background, 0x30=BD-RE with spare areas,
1787  0x31=BD-RE without spare areas
1788  @param size The maximum size in bytes achievable with this format.
1789  @param tdp Type Dependent Parameter. See mmc5r03c.pdf.
1790  @return 1 reply is valid , <=0 failure
1791  @since 0.3.0
1792 */
1793 int burn_disc_get_format_descr(struct burn_drive *drive, int index,
1794  int *type, off_t *size, unsigned *tdp);
1795 
1796 
1797 
1798 /* ts A61109 : this was and is defunct */
1799 /** Read a disc from the drive and write it to an fd pair. The drive must be
1800  grabbed successfully BEFORE calling this function. Always ensure that the
1801  drive reports a status of BURN_DISC_FULL before calling this function.
1802  @param drive The drive from which to read a disc.
1803  @param o The options for the read operation.
1804 */
1805 void burn_disc_read(struct burn_drive *drive, const struct burn_read_opts *o);
1806 
1807 
1808 
1809 /* ts A70222 */
1810 /* @since 0.3.4 */
1811 /** The length of a rejection reasons string for burn_precheck_write() and
1812  burn_write_opts_auto_write_type() .
1813 */
1814 #define BURN_REASONS_LEN 4096
1815 
1816 
1817 /* ts A70219 */
1818 /** Examines a completed setup for burn_disc_write() whether it is permissible
1819  with drive and media. This function is called by burn_disc_write() but
1820  an application might be interested in this check in advance.
1821  @param o The options for the writing operation.
1822  @param disc The descrition of the disc to be created
1823  @param reasons Eventually returns a list of rejection reason statements
1824  @param silent 1= do not issue error messages , 0= report problems
1825  @return 1 ok, -1= no recordable media detected, 0= other failure
1826  @since 0.3.4
1827 */
1828 int burn_precheck_write(struct burn_write_opts *o, struct burn_disc *disc,
1829  char reasons[BURN_REASONS_LEN], int silent);
1830 
1831 
1832 /** Write a disc in the drive. The drive must be grabbed successfully before
1833  calling this function. Always ensure that the drive reports a status of
1834  BURN_DISC_BLANK ot BURN_DISC_APPENDABLE before calling this function.
1835  Note: write_type BURN_WRITE_SAO is currently not capable of writing a mix
1836  of data and audio tracks. You must use BURN_WRITE_TAO for such sessions.
1837  To be set by burn_write_opts_set_write_type().
1838  Note: This function is not suitable for overwriting data in the middle of
1839  a valid data area because it is allowed to append trailing data.
1840  For exact random access overwriting use burn_random_access_write().
1841  Note: After writing it is advised to give up the drive and to grab it again
1842  in order to learn about its view on the new media state.
1843  Note: Before mounting the written media it might be necessary to eject
1844  and reload in order to allow the operating system to notice the new
1845  media state.
1846  @param o The options for the writing operation.
1847  @param disc The struct burn_disc * that described the disc to be created
1848 */
1849 void burn_disc_write(struct burn_write_opts *o, struct burn_disc *disc);
1850 
1851 
1852 /* ts A90227 */
1853 /** Control stream recording during the write run and eventually set the start
1854  LBA for stream recording.
1855  Stream recording is set from struct burn_write_opts when the write run
1856  gets started. See burn_write_opts_set_stream_recording().
1857  The call described here can be used later to override this setting and
1858  to program automatic switching at a given LBA. It also affects subsequent
1859  calls to burn_random_access_write().
1860  @param drive The drive which performs the write operation.
1861  @param recmode -1= disable stream recording
1862  0= leave setting as is
1863  1= enable stream recording
1864  @param start The LBA where actual stream recording shall start.
1865  (0 means unconditional stream recording)
1866  @param flag Bitfield for control purposes (unused yet, submit 0).
1867  @return 1=success , <=0 failure
1868  @since 0.6.4
1869 */
1870 int burn_drive_set_stream_recording(struct burn_drive *drive, int recmode,
1871  int start, int flag);
1872 
1873 
1874 /* ts B60730 */
1875 /** Enable or disable use of the Immed bit with long running SCSI commands.
1876  If the Immed bit is used, then those SCSI commands end early and leave
1877  the drive in not-ready state. libburn then tries periodically whether
1878  the drive became ready again. Only then it assumes the command to be
1879  completely done.
1880  The default setting may depend on the operating system on which libburn
1881  was compiled.
1882  @param drive The drive which will be affected.
1883  @param enable 1= use Immed bit.
1884  0= use no Immed bit. Affected commands can last very long.
1885  @return 1=success , <=0 failure
1886  @since 1.4.6
1887 */
1888 int burn_drive_set_immed(struct burn_drive *drive, int enable);
1889 
1890 
1891 /* ts B60730 */
1892 /** Inquire the current setting of usage of the Immed bit. Either the still set
1893  system dependent default or the value set by call burn_drive_set_immed().
1894  @return The current value.
1895  @since 1.4.6
1896 */
1897 int burn_drive_get_immed(struct burn_drive *drive);
1898 
1899 
1900 /** Cancel an operation on a drive.
1901  This will only work when the drive's busy state is BURN_DRIVE_READING or
1902  BURN_DRIVE_WRITING.
1903  @param drive The drive on which to cancel the current operation.
1904 */
1905 void burn_drive_cancel(struct burn_drive *drive);
1906 
1907 
1908 /* ts A61223 */
1909 /** Inquire whether the most recent asynchronous media job was successful.
1910  This applies to burn_disc_erase(), burn_disc_format(), burn_disc_write().
1911  Reasons for non-success may be: rejection of burn parameters, abort due to
1912  fatal errors during write, blank or format, a call to burn_drive_cancel()
1913  by the application thread.
1914  @param d The drive to inquire.
1915  @return 1=burn seems to have went well, 0=burn failed
1916  @since 0.2.6
1917 */
1918 int burn_drive_wrote_well(struct burn_drive *d);
1919 
1920 
1921 /* ts B31023 */
1922 /** Inquire whether a write error occurred which is suspected to have happened
1923  due to a false report about DVD-RW capability to be written in write type
1924  BURN_WRITE_TAO.
1925  @param d The drive to inquire.
1926  @return 1= it seems that BURN_WRITE_TAO on DVD-RW caused error,
1927  0= it does not seem so
1928  @since 1.3.4
1929 */
1930 int burn_drive_was_feat21_failure(struct burn_drive *d);
1931 
1932 
1933 /** Convert a minute-second-frame (MSF) value to sector count
1934  @param m Minute component
1935  @param s Second component
1936  @param f Frame component
1937  @return The sector count
1938 */
1939 int burn_msf_to_sectors(int m, int s, int f);
1940 
1941 /** Convert a sector count to minute-second-frame (MSF)
1942  @param sectors The sector count
1943  @param m Returns the minute component
1944  @param s Returns the second component
1945  @param f Returns the frame component
1946 */
1947 void burn_sectors_to_msf(int sectors, int *m, int *s, int *f);
1948 
1949 /** Convert a minute-second-frame (MSF) value to an lba
1950  @param m Minute component
1951  @param s Second component
1952  @param f Frame component
1953  @return The lba
1954 */
1955 int burn_msf_to_lba(int m, int s, int f);
1956 
1957 /** Convert an lba to minute-second-frame (MSF)
1958  @param lba The lba
1959  @param m Returns the minute component
1960  @param s Returns the second component
1961  @param f Returns the frame component
1962 */
1963 void burn_lba_to_msf(int lba, int *m, int *s, int *f);
1964 
1965 /** Create a new disc
1966  @return Pointer to a burn_disc object or NULL on failure.
1967 */
1968 struct burn_disc *burn_disc_create(void);
1969 
1970 /** Delete disc and decrease the reference count on all its sessions
1971  @param d The disc to be freed
1972 */
1973 void burn_disc_free(struct burn_disc *d);
1974 
1975 /** Create a new session
1976  @return Pointer to a burn_session object or NULL on failure.
1977  */
1978 struct burn_session *burn_session_create(void);
1979 
1980 /** Free a session (and decrease reference count on all tracks inside)
1981  @param s Session to be freed
1982 */
1983 void burn_session_free(struct burn_session *s);
1984 
1985 /** Add a session to a disc at a specific position, increasing the
1986  sessions's reference count.
1987  @param d Disc to add the session to
1988  @param s Session to add to the disc
1989  @param pos position to add at (BURN_POS_END is "at the end")
1990  @return 0 for failure, 1 for success
1991 */
1992 int burn_disc_add_session(struct burn_disc *d, struct burn_session *s,
1993  unsigned int pos);
1994 
1995 /** Remove a session from a disc
1996  @param d Disc to remove session from
1997  @param s Session pointer to find and remove
1998 */
1999 int burn_disc_remove_session(struct burn_disc *d, struct burn_session *s);
2000 
2001 
2002 /* ts B11219 */
2003 /** Read a CDRWIN cue sheet file and equip the session object by tracks and
2004  CD-TEXT according to the content of the file.
2005  For a description of CDRWIN file format see
2006  http://digitalx.org/cue-sheet/syntax/
2007  Fully supported commands are:
2008  CATALOG , CDTEXTFILE , FLAGS , INDEX , ISRC , PERFORMER ,
2009  POSTGAP , PREGAP , REM , SONGWRITER , TITLE
2010  Further supported commands introduced by cdrecord (usage like PERFORMER):
2011  ARRANGER , COMPOSER , MESSAGE
2012  Partly supported commands are:
2013  FILE which supports only types BINARY , MOTOROLA , WAVE
2014  TRACK which supports only datatypes AUDIO , MODE1/2048
2015  Unsupported types of FILE or TRACK lead to failure of the call.
2016  libburn does not yet support mixing of AUDIO and MODE1/2048. So this call
2017  will fail if such a mix is found.
2018  CD-TEXT information is allowed only if all tracks are of datatype AUDIO.
2019  Empty lines and lines which start by '#' are ignored.
2020  @param session Session where to attach tracks. It must not yet have
2021  tracks or else this call will fail.
2022  @param path Filesystem address of the CDRWIN cue sheet file.
2023  Normally with suffix .cue
2024  @param fifo_size Number of bytes in fifo. This will be rounded up by
2025  the block size of the track mode. <= 0 means no fifo.
2026  @param fifo Returns a reference to the burn_source object that
2027  was installed as fifo between FILE and the track
2028  burn sources. One may use this to inquire the fifo
2029  state. Dispose it by burn_source_free() when no longer
2030  needed. It is permissible to pass this parameter to
2031  libburn as NULL, in order to immediately drop ownership
2032  on the fifo.
2033  @param text_packs Returns pre-formatted CD-TEXT packs resulting from
2034  cue sheet command CDTEXTFILE. To be used with call
2035  burn_write_opts_set_leadin_text().
2036  It is permissible to pass this parameter to libburn
2037  as NULL, in order to disable CDTEXTFILE.
2038  @param num_packs Returns the number of 18 byte records in text_packs.
2039  @param flag Bitfield for control purposes.
2040  bit0= Do not attach CD-TEXT information to session and
2041  tracks. Do not load text_packs.
2042  bit1= Do not use media catalog string of session or ISRC
2043  strings of tracks for writing to Q sub-channel.
2044  @return > 0 indicates success, <= 0 indicates failure
2045  @since 1.2.0
2046 */
2047 int burn_session_by_cue_file(struct burn_session *session,
2048  char *path, int fifo_size, struct burn_source **fifo,
2049  unsigned char **text_packs, int *num_packs, int flag);
2050 
2051 
2052 /** Create a track */
2053 struct burn_track *burn_track_create(void);
2054 
2055 /** Free a track
2056  @param t Track to free
2057 */
2058 void burn_track_free(struct burn_track *t);
2059 
2060 /** Add a track to a session at specified position
2061  @param s Session to add to
2062  @param t Track to insert in session
2063  @param pos position to add at (BURN_POS_END is "at the end")
2064  @return 0 for failure, 1 for success
2065 */
2066 int burn_session_add_track(struct burn_session *s, struct burn_track *t,
2067  unsigned int pos);
2068 
2069 /** Remove a track from a session
2070  @param s Session to remove track from
2071  @param t Track pointer to find and remove
2072  @return 0 for failure, 1 for success
2073 */
2074 int burn_session_remove_track(struct burn_session *s, struct burn_track *t);
2075 
2076 
2077 /* ts B20107 */
2078 /** Set the number which shall be written as CD track number with the first
2079  track of the session. The following tracks will then get written with
2080  consecutive CD track numbers. The resulting number of the last track
2081  must not exceed 99. The lowest possible start number is 1, which is also
2082  the default. This setting applies only to CD SAO writing.
2083  @param session The session to be manipulated
2084  @param tno A number between 1 and 99
2085  @param flag Bitfield for control purposes. Unused yet. Submit 0.
2086  @return > 0 indicates success, <= 0 indicates failure
2087  @since 1.2.0
2088 */
2089 int burn_session_set_start_tno(struct burn_session *session, int tno,
2090  int flag);
2091 
2092 /* ts B20108 */
2093 /** Inquire the CD track start number, as set by default or by
2094  burn_session_set_start_tno().
2095  @param session The session to be inquired
2096  @param flag Bitfield for control purposes. Unused yet. Submit 0.
2097  @return > 0 is the currently set CD track start number
2098  <= 0 indicates failure
2099  @since 1.2.0
2100 */
2101 int burn_session_get_start_tno(struct burn_session *session, int flag);
2102 
2103 
2104 
2105 /* ts B11206 */
2106 /** Set the Character Codes, the Copyright bytes, and the Language Codes
2107  for CD-TEXT blocks 0 to 7. They will be used in the block summaries
2108  of text packs which get generated from text or binary data submitted
2109  by burn_session_set_cdtext() and burn_track_set_cdtext().
2110  Character Code value can be
2111  0x00 = ISO-8859-1
2112  0x01 = 7 bit ASCII
2113  0x80 = MS-JIS (japanesei Kanji, double byte characters)
2114  Copyright byte value can be
2115  0x00 = not copyrighted
2116  0x03 = copyrighted
2117  Language Code value will typically be 0x09 = English or 0x69 = Japanese.
2118  See below macros BURN_CDTEXT_LANGUAGES_0X00 and BURN_CDTEXT_LANGUAGES_0X45,
2119  but be aware that many of these codes have never been seen on CD, and that
2120  many of them do not have a character representation among the above
2121  Character Codes.
2122  Default is 0x09 = English for block 0 and 0x00 = Unknown for block 1 to 7.
2123  Copyright and Character Code are 0x00 for all blocks by default.
2124  See also file doc/cdtext.txt, "Format of a CD-TEXT packs array",
2125  "Pack type 0x8f".
2126 
2127  Parameter value -1 leaves the current setting of the session parameter
2128  unchanged.
2129  @param s Session where to change settings
2130  @param char_codes Character Codes for block 0 to 7
2131  @param copyrights Copyright bytes for block 0 to 7
2132  @param languages Language Codes for block 0 to 7
2133  @param flag Bitfiled for control purposes. Unused yet. Submit 0.
2134  @return <=0 failure, > 0 success
2135  @since 1.2.0
2136 */
2137 int burn_session_set_cdtext_par(struct burn_session *s,
2138  int char_codes[8], int copyrights[8],
2139  int languages[8], int flag);
2140 
2141 /** This is the first list of languages sorted by their Language codes,
2142  which start at 0x00. They stem from from EBU Tech 3264, appendix 3.
2143  E.g. language 0x00 is "Unknown", 0x08 is "German", 0x10 is "Frisian",
2144  0x18 is "Latvian", 0x20 is "Polish", 0x28 is "Swedish", 0x2b is "Wallon".
2145  See also file doc/cdtext.txt.
2146  @since 1.2.0
2147 */
2148 #define BURN_CDTEXT_LANGUAGES_0X00 \
2149  "Unknown", "Albanian", "Breton", "Catalan", \
2150  "Croatian", "Welsh", "Czech", "Danish", \
2151  "German", "English", "Spanish", "Esperanto", \
2152  "Estonian", "Basque", "Faroese", "French", \
2153  "Frisian", "Irish", "Gaelic", "Galician", \
2154  "Icelandic", "Italian", "Lappish", "Latin", \
2155  "Latvian", "Luxembourgian", "Lithuanian", "Hungarian", \
2156  "Maltese", "Dutch", "Norwegian", "Occitan", \
2157  "Polish", "Portuguese", "Romanian", "Romansh", \
2158  "Serbian", "Slovak", "Slovenian", "Finnish", \
2159  "Swedish", "Turkish", "Flemish", "Wallon"
2160 
2161 /** This is the second list of languages sorted by their Language codes,
2162  which start at 0x45. They stem from from EBU Tech 3264, appendix 3.
2163  E.g. language 0x45 is "Zulu", 0x50 is "Sranan Tongo", 0x58 is "Pushtu",
2164  0x60 is "Moldavian", 0x68 is "Kannada", 0x70 is "Greek", 0x78 is "Bengali",
2165  0x7f is "Amharic".
2166  See also file doc/cdtext.txt.
2167  @since 1.2.0
2168 */
2169 #define BURN_CDTEXT_LANGUAGES_0X45 \
2170  "Zulu", "Vietnamese", "Uzbek", \
2171  "Urdu", "Ukrainian", "Thai", "Telugu", \
2172  "Tatar", "Tamil", "Tadzhik", "Swahili", \
2173  "Sranan Tongo", "Somali", "Sinhalese", "Shona", \
2174  "Serbo-croat", "Ruthenian", "Russian", "Quechua", \
2175  "Pushtu", "Punjabi", "Persian", "Papamiento", \
2176  "Oriya", "Nepali", "Ndebele", "Marathi", \
2177  "Moldavian", "Malaysian", "Malagasay", "Macedonian", \
2178  "Laotian", "Korean", "Khmer", "Kazakh", \
2179  "Kannada", "Japanese", "Indonesian", "Hindi", \
2180  "Hebrew", "Hausa", "Gurani", "Gujurati", \
2181  "Greek", "Georgian", "Fulani", "Dari", \
2182  "Churash", "Chinese", "Burmese", "Bulgarian", \
2183  "Bengali", "Bielorussian", "Bambora", "Azerbaijani", \
2184  "Assamese", "Armenian", "Arabic", "Amharic"
2185 
2186 /* This is the list of empty languages names between 0x30 and 0x44.
2187  Together the three macros fill an array of 128 char pointers.
2188  static char *languages[] = {
2189  BURN_CDTEXT_LANGUAGES_0X00,
2190  BURN_CDTEXT_FILLER,
2191  BURN_CDTEXT_LANGUAGES_0X45
2192  };
2193 */
2194 #define BURN_CDTEXT_FILLER \
2195  "", "", "", "", \
2196  "", "", "", "", \
2197  "", "", "", "", \
2198  "", "", "", "", \
2199  "", "", "", "", \
2200  "", "", "", "", \
2201  ""
2202 
2203 /* ts B11206 */
2204 /** Obtain the current settings as of burn_session_set_cdtext_par()
2205  @param s Session which to inquire
2206  @param char_codes Will return Character Codes for block 0 to 7
2207  @param copyrights Will return Copyright bytes for block 0 to 7
2208  @param block_languages Will return Language Codes for block 0 to 7
2209  @param flag Bitfiled for control purposes. Unused yet. Submit 0.
2210  @return <=0 failure, reply invalid, > 0 success, reply valid
2211  @since 1.2.0
2212 */
2213 int burn_session_get_cdtext_par(struct burn_session *s,
2214  int char_codes[8], int copyrights[8],
2215  int block_languages[8], int flag);
2216 
2217 
2218 /* ts B11206 */
2219 /** Attach text or binary data as CD-TEXT attributes to a session.
2220  They can be used to generate CD-TEXT packs by burn_cdtext_from_session()
2221  or to write CD-TEXT packs into the lead-in of a CD SAO session.
2222  The latter happens only if no array of CD-TEXT packs is attached to
2223  the write options by burn_write_opts_set_leadin_text().
2224  For details of the CD-TEXT format and of the payload content, see file
2225  doc/cdtext.txt .
2226  @param s Session where to attach CD-TEXT attribute
2227  @param block Number of the language block in which the attribute
2228  shall appear. Possible values: 0 to 7.
2229  @param pack_type Pack type number. 0x80 to 0x8e. Used if pack_type_name
2230  is NULL or empty text. Else submit 0 and a name.
2231  Pack type 0x8f is generated automatically and may not
2232  be set by applications.
2233  @param pack_type_name The pack type by name. Defined names are:
2234  0x80 = "TITLE" 0x81 = "PERFORMER"
2235  0x82 = "SONGWRITER" 0x83 = "COMPOSER"
2236  0x84 = "ARRANGER" 0x85 = "MESSAGE"
2237  0x86 = "DISCID" 0x87 = "GENRE"
2238  0x88 = "TOC" 0x89 = "TOC2"
2239  0x8d = "CLOSED" 0x8e = "UPC_ISRC"
2240  Names are recognized uppercase and lowercase.
2241  @param payload Text or binary bytes. The data will be copied to
2242  session-internal memory.
2243  Pack types 0x80 to 0x85 contain 0-terminated cleartext
2244  encoded according to the block's Character Code.
2245  If double byte characters are used, then two 0-bytes
2246  terminate the cleartext.
2247  Pack type 0x86 is 0-terminated ASCII cleartext.
2248  Pack type 0x87 consists of two byte big-endian
2249  Genre code (see below BURN_CDTEXT_GENRE_LIST), and
2250  0-terminated ASCII cleartext of genre description.
2251  Pack type 0x88 mirrors the session table-of-content.
2252  Pack type 0x89 is not understood yet.
2253  Pack types 0x8a to 0x8c are reserved.
2254  Pack type 0x8d contains ISO-8859-1 cleartext which is
2255  not to be shown by commercial audio CD players.
2256  Pack type 0x8e is ASCII cleartext with UPC/EAN code.
2257  @param length Number of bytes in payload. Including terminating
2258  0-bytes.
2259  @param flag Bitfield for control purposes.
2260  bit0= payload contains double byte characters
2261  (with character code 0x80 MS-JIS japanese Kanji)
2262  @return > 0 indicates success , <= 0 is failure
2263  @since 1.2.0
2264 */
2265 int burn_session_set_cdtext(struct burn_session *s, int block,
2266  int pack_type, char *pack_type_name,
2267  unsigned char *payload, int length, int flag);
2268 
2269 
2270 /** This is the list of Genres sorted by their Genre codes.
2271  E.g. genre code 0x0000 is "No Used", 0x0008 is "Dance, 0x0010 is "Musical",
2272  0x0018 is "Rhythm & Blues", 0x001b is "World Music".
2273  See also file doc/cdtext.txt.
2274  @since 1.2.0
2275 */
2276 #define BURN_CDTEXT_GENRE_LIST \
2277  "Not Used", "Not Defined", "Adult Contemporary", "Alternative Rock", \
2278  "Childrens Music", "Classical", "Contemporary Christian", "Country", \
2279  "Dance", "Easy Listening", "Erotic", "Folk", \
2280  "Gospel", "Hip Hop", "Jazz", "Latin", \
2281  "Musical", "New Age", "Opera", "Operetta", \
2282  "Pop Music", "Rap", "Reggae", "Rock Music", \
2283  "Rhythm & Blues", "Sound Effects", "Spoken Word", "World Music"
2284 
2285 /* The number of genre names in BURN_CDTEXT_GENRE_LIST.
2286 */
2287 #define BURN_CDTEXT_NUM_GENRES 28
2288 
2289 
2290 /* ts B11206 */
2291 /** Obtain a CD-TEXT attribute that was set by burn_session_set_cdtext()
2292  @param s Session to inquire
2293  @param block Number of the language block to inquire.
2294  @param pack_type Pack type number to inquire. Used if pack_type_name
2295  is NULL or empty text. Else submit 0 and a name.
2296  Pack type 0x8f is generated automatically and may not
2297  be inquire in advance. Use burn_cdtext_from_session()
2298  to generate all packs including type 0x8f packs.
2299  @param pack_type_name The pack type by name.
2300  See above burn_session_set_cdtext().
2301  @param payload Will return a pointer to text or binary bytes.
2302  Not a copy of data. Do not free() this address.
2303  If no text attribute is attached for pack type and
2304  block, then payload is returned as NULL. The return
2305  value will not indicate error in this case.
2306  @param length Will return the number of bytes pointed to by payload.
2307  Including terminating 0-bytes.
2308  @param flag Bitfield for control purposes. Unused yet. Submit 0.
2309  @return 1 single byte char, 2 double byte char, <=0 error
2310  @since 1.2.0
2311 */
2312 int burn_session_get_cdtext(struct burn_session *s, int block,
2313  int pack_type, char *pack_type_name,
2314  unsigned char **payload, int *length, int flag);
2315 
2316 
2317 /* ts B11215 */
2318 /** Read a Sony CD-TEXT Input Sheet Version 0.7T file and attach its text
2319  attributes to the given session and its tracks for the given CD-TEXT
2320  block number. This overrides previous settings made by
2321  burn_session_set_cdtext(), burn_track_set_cdtext(), burn_track_set_isrc(),
2322  burn_session_set_start_tno(). It can later be overridden by said function
2323  calls.
2324  The media catalog number from purpose specifier "UPC / EAN" gets into
2325  effect only if burn_write_opts_set_has_mediacatalog() is set to 0.
2326  The format of a v07t sheet file is documented in doc/cdtext.txt.
2327  @param session Session where to attach CD-TEXT attributes
2328  @param path Local filesystem address of the sheet file which
2329  shall be read and interpreted.
2330  @param block Number of the language block in which the attributes
2331  shall appear. Possible values: 0 to 7.
2332  @param flag Bitfield for control purposes.
2333  bit0= Permission to read multiple blocks from the
2334  given sheet file. Each block is supposed to begin
2335  by a line "Input Sheet Version = 0.7T". Therefore
2336  this permission is only valid if the input file
2337  begins by such a line.
2338  @since 1.3.2
2339  bit1= Do not use media catalog string of session or ISRC
2340  strings of tracks for writing to Q sub-channel.
2341  @since 1.2.0
2342  @return > 0 indicates success and the number of interpreted
2343  blocks (1 if not flag bit0 is set).
2344  <= 0 indicates failure
2345  @since 1.2.0
2346 */
2347 int burn_session_input_sheet_v07t(struct burn_session *session,
2348  char *path, int block, int flag);
2349 
2350 
2351 /* ts B11210 */
2352 /** Produce an array of CD-TEXT packs that could be submitted to
2353  burn_write_opts_set_leadin_text(), or stored as *.cdt file,
2354  or submitted to burn_make_input_sheet_v07t().
2355  For a description of the format of the array, see file doc/cdtext.txt.
2356  The input data stem from burn_session_set_cdtext_par(),
2357  burn_session_set_cdtext(), and burn_track_set_cdtext().
2358  @param s Session from which to produce CD-TEXT packs.
2359  @param text_packs Will return the buffer with the CD-TEXT packs.
2360  Dispose by free() when no longer needed.
2361  @param num_packs Will return the number of 18 byte text packs.
2362  @param flag Bitfield for control purposes.
2363  bit0= do not return generated CD-TEXT packs,
2364  but check whether production would work and
2365  indicate the number of packs by the call return
2366  value. This happens also if
2367  (text_packs == NULL || num_packs == NULL).
2368  @return Without flag bit0: > 0 is success, <= 0 failure
2369  With flag bit0: > 0 is number of packs,
2370  0 means no packs will be generated,
2371  < 0 means failure
2372  @since 1.2.0
2373 */
2374 int burn_cdtext_from_session(struct burn_session *s,
2375  unsigned char **text_packs, int *num_packs,
2376  int flag);
2377 
2378 
2379 /* ts B30519 */
2380 /** Convert an array of CD-TEXT packs into the text format of
2381  Sony CD-TEXT Input Sheet Version 0.7T .
2382 
2383  @param text_packs Array of bytes which form CD-TEXT packs of 18 bytes
2384  each. For a description of the format of the array,
2385  see file doc/cdtext.txt.
2386  No header of 4 bytes must be prepended which would
2387  tell the number of pack bytes + 2.
2388  This parameter may be NULL if the currently attached
2389  array of packs shall be removed.
2390  @param num_packs The number of 18 byte packs in text_packs.
2391  @param start_tno The start number of track counting, if known from
2392  CD table-of-content or other sources.
2393  Submit 0 to enable the attempt to read it and the
2394  track_count from pack type 0x8f.
2395  @param track_count The number of tracks, if known from CD table-of-content
2396  or orther sources.
2397  @param result Will return the buffer with Sheet text.
2398  Dispose by free() when no longer needed.
2399  It will be filled by the text for the v07t sheet file
2400  plus a trailing 0-byte. (Be aware that double-byte
2401  characters might contain 0-bytes, too.)
2402  Each CD-TEXT language block starts by the line
2403  "Input Sheet Version = 0.7T"
2404  and a "Remarks" line that tells the block number.
2405  @param char_code Returns the character code of the pack array:
2406  0x00 = ISO-8859-1
2407  0x01 = 7 bit ASCII
2408  0x80 = MS-JIS (japanese Kanji, double byte characters)
2409  The presence of a code value that is not in this list
2410  will cause this function to fail.
2411  @param flag Bitfield for control purposes. Unused yet. Submit 0.
2412  @return > 0 tells the number of valid text bytes in result.
2413  This does not include the trailing 0-byte.
2414  <= 0 indicates failure.
2415  @since 1.3.2
2416 */
2417 int burn_make_input_sheet_v07t(unsigned char *text_packs, int num_packs,
2418  int start_tno, int track_count,
2419  char **result, int *char_code, int flag);
2420 
2421 
2422 /* ts B11206 */
2423 /** Remove all CD-TEXT attributes of the given block from the session.
2424  They were attached by burn_session_set_cdtext().
2425  @param s Session where to remove the CD-TEXT attribute
2426  @param block Number of the language block in which the attribute
2427  shall appear. Possible values: 0 to 7.
2428  -1 causes text packs of all blocks to be removed.
2429  @return > 0 is success, <= 0 failure
2430  @since 1.2.0
2431 */
2432 int burn_session_dispose_cdtext(struct burn_session *s, int block);
2433 
2434 
2435 /* ts B11221*/
2436 /** Read an array of CD-TEXT packs from a file. This array should be suitable
2437  for burn_write_opts_set_leadin_text().
2438  The function tolerates and removes 4-byte headers as produced by
2439  cdrecord -vv -toc, if this header tells the correct number of bytes which
2440  matches the file size. If no 4-byte header is present, then the function
2441  tolerates and removes a trailing 0-byte as of Sony specs.
2442  @param path Filesystem address of the CD-TEXT pack file.
2443  Normally with suffix .cdt or .dat
2444  @param text_packs Will return the buffer with the CD-TEXT packs.
2445  Dispose by free() when no longer needed.
2446  @param num_packs Will return the number of 18 byte text packs.
2447  @param flag Bitfield for control purposes. Unused yet.Submit 0.
2448  @return 0 is success, <= 0 failure
2449  @since 1.2.0
2450 */
2451 int burn_cdtext_from_packfile(char *path, unsigned char **text_packs,
2452  int *num_packs, int flag);
2453 
2454 
2455 /** Define the data in a track
2456  @param t the track to define
2457  @param offset The lib will write this many 0s before start of data
2458  @param tail The number of extra 0s to write after data
2459  @param pad 1 means the lib should pad the last sector with 0s if the
2460  track isn't exactly sector sized. (otherwise the lib will
2461  begin reading from the next track)
2462  @param mode data format (bitfield)
2463 */
2464 void burn_track_define_data(struct burn_track *t, int offset, int tail,
2465  int pad, int mode);
2466 
2467 
2468 /* ts B11206 */
2469 /** Attach text or binary data as CD-TEXT attributes to a track.
2470  The payload will be used to generate CD-TEXT packs by
2471  burn_cdtext_from_session() or to write CD-TEXT packs into the lead-in
2472  of a CD SAO session. This happens if the CD-TEXT attribute of the session
2473  gets generated, which has the same block number and pack type. In this
2474  case, each track should have such a CD-TEXT attribute, too.
2475  See burn_session_set_cdtext().
2476  Be cautious not to exceed the maximum number of 253 payload packs per
2477  language block. Use burn_cdtext_from_session() to learn whether a valid
2478  array of CD-TEXT packs can be generated from your attributes.
2479  @param t Track where to attach CD-TEXT attribute.
2480  @param block Number of the language block in which the attribute
2481  shall appear. Possible values: 0 to 7.
2482  @param pack_type Pack type number. 0x80 to 0x85 or 0x8e. Used if
2483  pack_type_name is NULL or empty text. Else submit 0
2484  and a name.
2485  @param pack_type_name The pack type by name. Applicable names are:
2486  0x80 = "TITLE" 0x81 = "PERFORMER"
2487  0x82 = "SONGWRITER" 0x83 = "COMPOSER"
2488  0x84 = "ARRANGER" 0x85 = "MESSAGE"
2489  0x8e = "UPC_ISRC"
2490  @param payload 0-terminated cleartext. If double byte characters
2491  are used, then two 0-bytes terminate the cleartext.
2492  @param length Number of bytes in payload. Including terminating
2493  0-bytes.
2494  @param flag Bitfield for control purposes.
2495  bit0= payload contains double byte characters
2496  (with character code 0x80 MS-JIS japanese Kanji)
2497  @return > 0 indicates success , <= 0 is failure
2498  @since 1.2.0
2499 */
2500 int burn_track_set_cdtext(struct burn_track *t, int block,
2501  int pack_type, char *pack_type_name,
2502  unsigned char *payload, int length, int flag);
2503 
2504 /* ts B11206 */
2505 /** Obtain a CD-TEXT attribute that was set by burn_track_set_cdtext().
2506  @param t Track to inquire
2507  @param block Number of the language block to inquire.
2508  @param pack_type Pack type number to inquire. Used if pack_type_name
2509  is NULL or empty text. Else submit 0 and a name.
2510  @param pack_type_name The pack type by name.
2511  See above burn_track_set_cdtext().
2512  @param payload Will return a pointer to text bytes.
2513  Not a copy of data. Do not free() this address.
2514  If no text attribute is attached for pack type and
2515  block, then payload is returned as NULL. The return
2516  value will not indicate error in this case.
2517  @param length Will return the number of bytes pointed to by payload.
2518  Including terminating 0-bytes.
2519  @param flag Bitfield for control purposes. Unused yet. Submit 0.
2520  @return 1=single byte char , 2= double byte char , <=0 error
2521  @since 1.2.0
2522 */
2523 int burn_track_get_cdtext(struct burn_track *t, int block,
2524  int pack_type, char *pack_type_name,
2525  unsigned char **payload, int *length, int flag);
2526 
2527 /* ts B11206 */
2528 /** Remove all CD-TEXT attributes of the given block from the track.
2529  They were attached by burn_track_set_cdtext().
2530  @param t Track where to remove the CD-TEXT attribute.
2531  @param block Number of the language block in which the attribute
2532  shall appear. Possible values: 0 to 7.
2533  -1 causes text packs of all blocks to be removed.
2534  @return > 0 is success, <= 0 failure
2535  @since 1.2.0
2536 */
2537 int burn_track_dispose_cdtext(struct burn_track *t, int block);
2538 
2539 
2540 /* ts A90910 */
2541 /** Activates CD XA compatibility modes.
2542  libburn currently writes data only in CD mode 1. Some programs insist in
2543  sending data with additional management bytes. These bytes have to be
2544  stripped in order to make the input suitable for BURN_MODE1.
2545  @param t The track to manipulate
2546  @param value 0= no conversion
2547  1= strip 8 byte sector headers of CD-ROM XA mode 2 form 1
2548  see MMC-5 4.2.3.8.5.3 Block Format for Mode 2 form 1 Data
2549  all other values are reserved
2550  @return 1=success , 0=unacceptable value
2551  @since 0.7.2
2552 */
2553 int burn_track_set_cdxa_conv(struct burn_track *t, int value);
2554 
2555 
2556 /** Set the ISRC details for a track. When writing to CD media, ISRC will get
2557  written into the Q sub-channel.
2558  @param t The track to change
2559  @param country the 2 char country code. Each character must be
2560  only numbers or letters.
2561  @param owner 3 char owner code. Each character must be only numbers
2562  or letters.
2563  @param year 2 digit year. A number in 0-99 (Yep, not Y2K friendly).
2564  @param serial 5 digit serial number. A number in 0-99999.
2565 */
2566 void burn_track_set_isrc(struct burn_track *t, char *country, char *owner,
2567  unsigned char year, unsigned int serial);
2568 
2569 /* ts B11226 */
2570 /** Set the composed ISRC string for a track. This is an alternative to
2571  burn_track_set_isrc().
2572  @param t The track to be manipulated
2573  @param isrc 12 characters which are composed from ISRC details.
2574  Format is CCOOOYYSSSSS, terminated by a 0-byte:
2575  Country, Owner, Year(decimal digits), Serial(decimal digits).
2576  @param flag Bitfield for control purposes. Unused yet. Submit 0.
2577  @return > 0 indicates success, <= 0 means failure
2578  @since 1.2.0
2579 */
2580 int burn_track_set_isrc_string(struct burn_track *t, char isrc[13], int flag);
2581 
2582 /** Disable ISRC parameters for a track
2583  @param t The track to change
2584 */
2585 void burn_track_clear_isrc(struct burn_track *t);
2586 
2587 
2588 /* ts B20103 */
2589 /** Define an index start address within a track. The index numbers inside a
2590  track have to form sequence starting at 0 or 1 with no gaps up to the
2591  highest number used. They affect only writing of CD SAO sessions.
2592  The first index start address of a track must be 0.
2593  Blocks between index 0 and index 1 are considered to be located before the
2594  track start as of the table-of-content.
2595  @param t The track to be manipulated
2596  @param index_number A number between 0 and 99
2597  @param relative_lba The start address relative to the start of the
2598  burn_source of the track. It will get mapped to the
2599  appropriate absolute block address.
2600  @param flag Bitfield for control purposes. Unused yet. Submit 0.
2601  @return > 0 indicates success, <= 0 means failure
2602  @since 1.2.0
2603 */
2604 int burn_track_set_index(struct burn_track *t, int index_number,
2605  unsigned int relative_lba, int flag);
2606 
2607 /* ts B20103 */
2608 /** Remove all index start addresses and reset to the default indexing of
2609  CD SAO sessions. This means index 0 of track 1 reaches from LBA -150
2610  to LBA -1. Index 1 of track 1 reaches from LBA 0 to track end. Index 1
2611  of track 2 follows immediately. The same happens for all further tracks
2612  after the end of their predecessor.
2613  @param t The track to be manipulated
2614  @param flag Bitfield for control purposes. Unused yet. Submit 0.
2615  @return > 0 indicates success, <= 0 means failure
2616  @since 1.2.0
2617 */
2618 int burn_track_clear_indice(struct burn_track *t, int flag);
2619 
2620 
2621 /* ts B20110 */
2622 /** Define whether a pre-gap shall be written before the track and how many
2623  sectors this pre-gap shall have. A pre-gap is written in the range of track
2624  index 0 and contains zeros (audio silence). No bytes from the track source
2625  will be read for writing the pre-gap.
2626  This setting affects only CD SAO write runs.
2627  The first track automatically gets a pre-gap of at least 150 sectors. Its
2628  size may be enlarged by this call. Further pre-gaps are demanded by MMC
2629  for tracks which follow tracks of a different mode. (But Mode mixing in
2630  CD SAO sessions is currently not supported by libburn.)
2631  @param t The track to change
2632  @param size Number of sectors in the pre-gap.
2633  -1 disables pre-gap, except for the first track.
2634  libburn allows 0, but MMC does not propose this.
2635  @param flag Bitfield for control purposes. Unused yet. Submit 0.
2636  @return > 0 indicates success, <= 0 means failure
2637  @since 1.2.0
2638 */
2639 int burn_track_set_pregap_size(struct burn_track *t, int size, int flag);
2640 
2641 /* ts B20111 */
2642 /** Define whether a post-gap shall be written at the end of the track and
2643  how many sectors this gap shall have. A post-gap occupies the range of
2644  an additional index of the track. It contains zeros. No bytes from the
2645  track source will be read for writing the post-gap.
2646  This setting affects only CD SAO write runs.
2647  MMC prescribes to add a post-gap to a data track which is followed by
2648  a non-data track. (But libburn does not yet support mixed mode CD SAO
2649  sessions.)
2650  @param t The track to change
2651  @param size Number of sectors in the post-gap.
2652  -1 disables post-gap.
2653  libburn allows 0, but MMC does not propose this.
2654  @param flag Bitfield for control purposes. Unused yet. Submit 0.
2655  @return > 0 indicates success, <= 0 means failure
2656  @since 1.2.0
2657 */
2658 int burn_track_set_postgap_size(struct burn_track *t, int size, int flag);
2659 
2660 
2661 /* ts A61024 */
2662 /** Define whether a track shall swap bytes of its input stream.
2663  @param t The track to change
2664  @param swap_source_bytes 0=do not swap, 1=swap byte pairs
2665  @return 1=success , 0=unacceptable value
2666  @since 0.2.6
2667 */
2668 int burn_track_set_byte_swap(struct burn_track *t, int swap_source_bytes);
2669 
2670 
2671 /** Hide the first track in the "pre gap" of the disc
2672  @param s session to change
2673  @param onoff 1 to enable hiding, 0 to disable
2674 */
2675 void burn_session_hide_first_track(struct burn_session *s, int onoff);
2676 
2677 /** Get the drive's disc struct - free when done
2678  @param d drive to query
2679  @return the disc struct or NULL on failure
2680 */
2681 struct burn_disc *burn_drive_get_disc(struct burn_drive *d);
2682 
2683 /** Set the track's data source
2684  @param t The track to set the data source for
2685  @param s The data source to use for the contents of the track
2686  @return An error code stating if the source is ready for use for
2687  writing the track, or if an error occurred
2688 
2689 */
2690 enum burn_source_status burn_track_set_source(struct burn_track *t,
2691  struct burn_source *s);
2692 
2693 
2694 /* ts A70218 */
2695 /** Set a default track size to be used only if the track turns out to be of
2696  unpredictable length and if the effective write type demands a fixed size.
2697  This can be useful to enable write types CD SAO or DVD DAO together with
2698  a track source like stdin. If the track source delivers fewer bytes than
2699  announced then the track will be padded up with zeros.
2700  @param t The track to change
2701  @param size The size to set
2702  @return 0=failure 1=success
2703  @since 0.3.4
2704 */
2705 int burn_track_set_default_size(struct burn_track *t, off_t size);
2706 
2707 /** Free a burn_source (decrease its refcount and maybe free it)
2708  @param s Source to free
2709 */
2710 void burn_source_free(struct burn_source *s);
2711 
2712 /** Creates a data source for an image file (and maybe subcode file)
2713  @param path The file address for the main channel payload.
2714  @param subpath Eventual address for subchannel data. Only used in exotic
2715  raw write modes. Submit NULL for normal tasks.
2716  @return Pointer to a burn_source object, NULL indicates failure
2717 */
2718 struct burn_source *burn_file_source_new(const char *path,
2719  const char *subpath);
2720 
2721 
2722 /* ts A91122 : An interface to open(O_DIRECT) or similar OS tricks. */
2723 
2724 /** Opens a file with eventual acceleration preparations which may depend
2725  on the operating system and on compile time options of libburn.
2726  You may use this call instead of open(2) for opening file descriptors
2727  which shall be handed to burn_fd_source_new().
2728  This should only be done for tracks with BURN_BLOCK_MODE1 (2048 bytes
2729  per block).
2730 
2731  If you use this call then you MUST allocate the buffers which you use
2732  with read(2) by call burn_os_alloc_buffer(). Read sizes MUST be a multiple
2733  of a safe buffer amount. Else you risk that track data get altered during
2734  transmission.
2735  burn_disk_write() will allocate a suitable read/write buffer for its own
2736  operations. A fifo created by burn_fifo_source_new() will allocate
2737  suitable memory for its buffer if called with flag bit0 and a multiple
2738  of a safe buffer amount.
2739  @param path The file address to open
2740  @param open_flags The flags as of man 2 open. Normally just O_RDONLY.
2741  @param flag Bitfield for control purposes (unused yet, submit 0).
2742  @return A file descriptor as of open(2). Finally to be disposed
2743  by close(2).
2744  -1 indicates failure.
2745  @since 0.7.4
2746 */
2747 int burn_os_open_track_src(char *path, int open_flags, int flag);
2748 
2749 /** Allocate a memory area that is suitable for reading with a file descriptor
2750  opened by burn_os_open_track_src().
2751  @param amount Number of bytes to allocate. This should be a multiple
2752  of the operating system's i/o block size. 32 KB is
2753  guaranteed by libburn to be safe.
2754  @param flag Bitfield for control purposes (unused yet, submit 0).
2755  @return The address of the allocated memory, or NULL on failure.
2756  A non-NULL return value has finally to be disposed via
2757  burn_os_free_buffer().
2758  @since 0.7.4
2759 */
2760 void *burn_os_alloc_buffer(size_t amount, int flag);
2761 
2762 /** Dispose a memory area which was obtained by burn_os_alloc_buffer(),
2763  @param buffer Memory address to be freed.
2764  @param amount The number of bytes which was allocated at that
2765  address.
2766  @param flag Bitfield for control purposes (unused yet, submit 0).
2767  @return 1 success , <=0 failure
2768  @since 0.7.4
2769 */
2770 int burn_os_free_buffer(void *buffer, size_t amount, int flag);
2771 
2772 
2773 /** Creates a data source for an image file (a track) from an open
2774  readable filedescriptor, an eventually open readable subcodes file
2775  descriptor and eventually a fixed size in bytes.
2776  @param datafd The source of data.
2777  @param subfd The eventual source of subchannel data. Only used in exotic
2778  raw write modes. Submit -1 for normal tasks.
2779  @param size The eventual fixed size of eventually both fds.
2780  If this value is 0, the size will be determined from datafd.
2781  @return Pointer to a burn_source object, NULL indicates failure
2782 */
2783 struct burn_source *burn_fd_source_new(int datafd, int subfd, off_t size);
2784 
2785 
2786 /* ts B00922 */
2787 /** Creates an offset source which shall provide a byte interval of a stream
2788  to its consumer. It is supposed to be chain-linked with other offset
2789  sources which serve neighboring consumers. The chronological sequence
2790  of consumers and the sequence of offset sources must match. The intervals
2791  of the sources must not overlap.
2792 
2793  A chain of these burn_source objects may be used to feed multiple tracks
2794  from one single stream of input bytes.
2795  Each of the offset sources will skip the bytes up to its start address and
2796  provide the prescribed number of bytes to the track. Skipping takes into
2797  respect the bytes which have been processed by eventual predecessors in the
2798  chain.
2799  Important: It is not allowed to free an offset source before its successor
2800  has ended its work. Best is to keep them all until all tracks
2801  are done.
2802 
2803  @param inp The burn_source object from which to read stream data.
2804  E.g. created by burn_file_source_new().
2805  @param prev The eventual offset source object which shall read data from
2806  inp before the new offset source will begin its own work.
2807  This must either be a result of burn_offst_source_new() or
2808  it must be NULL.
2809  @param start The byte address where to start reading bytes for the
2810  consumer. inp bytes may get skipped to reach this address.
2811  @param size The number of bytes to be delivered to the consumer.
2812  If size is <= 0 then it may be set later by a call of method
2813  set_size(). If it is >= 0, then it can only be changed if
2814  flag bit0 was set with burn_offst_source_new().
2815  @param flag Bitfield for control purposes
2816  bit0 = Prevent set_size() from overriding interval sizes > 0.
2817  If such a size is already set, then the new one will
2818  only affect the reply of get_size().
2819  See also above struct burn_source.
2820  @since 1.2.0
2821  @return Pointer to a burn_source object, later to be freed by
2822  burn_source_free(). NULL indicates failure.
2823  @since 0.8.8
2824 */
2826  struct burn_source *inp, struct burn_source *prev,
2827  off_t start, off_t size, int flag);
2828 
2829 /* ts A70930 */
2830 /** Creates a fifo which acts as proxy for an already existing data source.
2831  The fifo provides a ring buffer which shall smoothen the data stream
2832  between burn_source and writer thread. Each fifo serves only for one
2833  data source. It may be attached to one track as its only data source
2834  by burn_track_set_source(), or it may be used as input for other burn
2835  sources.
2836  A fifo starts its life in "standby" mode with no buffer space allocated.
2837  As soon as its consumer requires bytes, the fifo establishes a worker
2838  thread and allocates its buffer. After input has ended and all buffer
2839  content is consumed, the buffer space gets freed and the worker thread
2840  ends. This happens asynchronously. So expect two buffers and worker threads
2841  to exist for a short time between tracks. Be modest in your size demands if
2842  multiple tracks are to be expected.
2843  @param inp The burn_source for which the fifo shall act as proxy.
2844  It can be disposed by burn_source_free() immediately
2845  after this call.
2846  @param chunksize The size in bytes of a chunk.
2847  Use 2048 for sources suitable for BURN_BLOCK_MODE1,
2848  2352 for sources which deliver for BURN_BLOCK_AUDIO,
2849  2056 for sources which shall get treated by
2850  burn_track_set_cdxa_conv(track, 1).
2851  Some variations of burn_source might work only with
2852  a particular chunksize. E.g. libisofs demands 2048.
2853  @param chunks The number of chunks to be allocated in ring buffer.
2854  This value must be >= 2.
2855  @param flag Bitfield for control purposes:
2856  bit0= The read method of inp is capable of delivering
2857  arbitrary amounts of data per call. Not only one
2858  sector.
2859  Suitable for inp from burn_file_source_new()
2860  and burn_fd_source_new() if not the fd has
2861  exotic limitations on read size.
2862  You MUST use this on inp which uses an fd opened
2863  with burn_os_open_track_src().
2864  Better do not use with other inp types.
2865  @since 0.7.4
2866  @return A pointer to the newly created burn_source.
2867  Later both burn_sources, inp and the returned fifo, have
2868  to be disposed by calling burn_source_free() for each.
2869  inp can be freed immediately, the returned fifo may be
2870  kept as handle for burn_fifo_inquire_status().
2871  @since 0.4.0
2872 */
2873 struct burn_source *burn_fifo_source_new(struct burn_source *inp,
2874  int chunksize, int chunks, int flag);
2875 
2876 /* ts A71003 */
2877 /** Inquires state and fill parameters of a fifo burn_source which was created
2878  by burn_fifo_source_new() . Do not use with other burn_source variants.
2879  @param fifo The fifo object to inquire
2880  @param size The total size of the fifo
2881  @param free_bytes The current free capacity of the fifo
2882  @param status_text Returns a pointer to a constant text, see below
2883  @return <0 reply invalid, >=0 fifo status code:
2884  bit0+1=input status, bit2=consumption status, i.e:
2885  0="standby" : data processing not started yet
2886  1="active" : input and consumption are active
2887  2="ending" : input has ended without error
2888  3="failing" : input had error and ended,
2889  4="unused" : ( consumption has ended before processing start )
2890  5="abandoned" : consumption has ended prematurely
2891  6="ended" : consumption has ended without input error
2892  7="aborted" : consumption has ended after input error
2893  @since 0.4.0
2894 */
2895 int burn_fifo_inquire_status(struct burn_source *fifo, int *size,
2896  int *free_bytes, char **status_text);
2897 
2898 /* ts A91125 */
2899 /** Inquire various counters which reflect the fifo operation.
2900  @param fifo The fifo object to inquire
2901  @param total_min_fill The minimum number of bytes in the fifo. Beginning
2902  from the moment when fifo consumption is enabled.
2903  @param interval_min_fill The minimum byte number beginning from the moment
2904  when fifo consumption is enabled or from the
2905  most recent moment when burn_fifo_next_interval()
2906  was called.
2907  @param put_counter The number of data transactions into the fifo.
2908  @param get_counter The number of data transactions out of the fifo.
2909  @param empty_counter The number of times the fifo was empty.
2910  @param full_counter The number of times the fifo was full.
2911  @since 0.7.4
2912 */
2913 void burn_fifo_get_statistics(struct burn_source *fifo,
2914  int *total_min_fill, int *interval_min_fill,
2915  int *put_counter, int *get_counter,
2916  int *empty_counter, int *full_counter);
2917 
2918 /* ts A91125 */
2919 /** Inquire the fifo minimum fill counter for intervals and reset that counter.
2920  @param fifo The fifo object to inquire
2921  @param interval_min_fill The minimum number of bytes in the fifo. Beginning
2922  from the moment when fifo consumption is enabled
2923  or from the most recent moment when
2924  burn_fifo_next_interval() was called.
2925  @since 0.7.4
2926 */
2927 void burn_fifo_next_interval(struct burn_source *fifo, int *interval_min_fill);
2928 
2929 /* ts A80713 */
2930 /** Obtain a preview of the first input data of a fifo which was created
2931  by burn_fifo_source_new(). The data will later be delivered normally to
2932  the consumer track of the fifo.
2933  bufsize may not be larger than the fifo size (chunk_size * chunks) - 32k.
2934  This call will succeed only if data consumption by the track has not
2935  started yet, i.e. best before the call to burn_disc_write().
2936  It will start the worker thread of the fifo with the expectable side
2937  effects on the external data source. Then it waits either until enough
2938  data have arrived or until it becomes clear that this will not happen.
2939  The call may be repeated with increased bufsize. It will always yield
2940  the bytes beginning from the first one in the fifo.
2941  @param fifo The fifo object to start and to inquire
2942  @param buf Pointer to memory of at least bufsize bytes where to
2943  deliver the peeked data.
2944  @param bufsize Number of bytes to peek from the start of the fifo data
2945  @param flag Bitfield for control purposes (unused yet, submit 0).
2946  @return <0 on severe error, 0 if not enough data, 1 if bufsize bytes read
2947  @since 0.5.0
2948 */
2949 int burn_fifo_peek_data(struct burn_source *fifo, char *buf, int bufsize,
2950  int flag);
2951 
2952 /* ts A91125 */
2953 /** Start the fifo worker thread and wait either until the requested number
2954  of bytes have arrived or until it becomes clear that this will not happen.
2955  Filling will go on asynchronously after burn_fifo_fill() returned.
2956  This call and burn_fifo_peek_data() do not disturb each other.
2957  @param fifo The fifo object to start
2958  @param fill Number of bytes desired. Expect to get return 1 if
2959  at least fifo size - 32k were read.
2960  @param flag Bitfield for control purposes.
2961  bit0= fill fifo to maximum size
2962  @return <0 on severe error, 0 if not enough data,
2963  1 if desired amount or fifo full
2964  @since 0.7.4
2965 */
2966 int burn_fifo_fill(struct burn_source *fifo, int fill, int flag);
2967 
2968 
2969 /* ts A70328 */
2970 /** Sets a fixed track size after the data source object has already been
2971  created.
2972  @param t The track to operate on
2973  @param size the number of bytes to use as track size
2974  @return <=0 indicates failure , >0 success
2975  @since 0.3.6
2976 */
2977 int burn_track_set_size(struct burn_track *t, off_t size);
2978 
2979 
2980 /** Tells how many sectors a track will have on disc, or already has on
2981  disc. This includes offset, payload, tail, and post-gap, but not pre-gap.
2982  The result is NOT RELIABLE with tracks of undefined length
2983 */
2984 int burn_track_get_sectors(struct burn_track *);
2985 
2986 
2987 /* ts A61101 */
2988 /** Tells how many source bytes have been read and how many data bytes have
2989  been written by the track during burn.
2990  @param t The track to inquire
2991  @param read_bytes Number of bytes read from the track source
2992  @param written_bytes Number of bytes written to track
2993  @since 0.2.6
2994 */
2995 int burn_track_get_counters(struct burn_track *t,
2996  off_t *read_bytes, off_t *written_bytes);
2997 
2998 
2999 /** Sets drive read and write speed
3000  Note: "k" is 1000, not 1024.
3001  1xCD = 176.4 k/s, 1xDVD = 1385 k/s, 1xBD = 4496 k/s.
3002  Fractional speeds should be rounded up. Like 4xCD = 706.
3003  @param d The drive to set speed for
3004  @param read Read speed in k/s (0 is max, -1 is min).
3005  @param write Write speed in k/s (0 is max, -1 is min).
3006 */
3007 void burn_drive_set_speed(struct burn_drive *d, int read, int write);
3008 
3009 
3010 /* ts A70711 */
3011 /** Controls the behavior with writing when the drive buffer is suspected to
3012  be full. To check and wait for enough free buffer space before writing
3013  will move the task of waiting from the operating system's device driver
3014  to libburn. While writing is going on and waiting is enabled, any write
3015  operation will be checked whether it will fill the drive buffer up to
3016  more than max_percent. If so, then waiting will happen until the buffer
3017  fill is predicted with at most min_percent.
3018  Thus: if min_percent < max_percent then transfer rate will oscillate.
3019  This may allow the driver to operate on other devices, e.g. a disk from
3020  which to read the input for writing. On the other hand, this checking might
3021  reduce maximum throughput to the drive or even get misled by faulty buffer
3022  fill replies from the drive.
3023  If a setting parameter is < 0, then this setting will stay unchanged
3024  by the call.
3025  Known burner or media specific pitfalls:
3026  To have max_percent larger than the burner's best reported buffer fill has
3027  the same effect as min_percent==max_percent. Some burners do not report
3028  their full buffer with all media types. Some are not suitable because
3029  they report their buffer fill with delay. Some do not go to full speed
3030  unless their buffer is full.
3031 
3032  @param d The drive to control
3033  @param enable 0= disable , 1= enable waiting , (-1 = do not change setting)
3034  @param min_usec Shortest possible sleeping period (given in micro seconds)
3035  @param max_usec Longest possible sleeping period (given in micro seconds)
3036  @param timeout_sec If a single write has to wait longer than this number
3037  of seconds, then waiting gets disabled and mindless
3038  writing starts. A value of 0 disables this timeout.
3039  @param min_percent Minimum of desired buffer oscillation: 25 to 100
3040  @param max_percent Maximum of desired buffer oscillation: 25 to 100
3041  @return 1=success , 0=failure
3042  @since 0.3.8
3043 */
3044 int burn_drive_set_buffer_waiting(struct burn_drive *d, int enable,
3045  int min_usec, int max_usec, int timeout_sec,
3046  int min_percent, int max_percent);
3047 
3048 /* ts B61116 */
3049 /** Control the write simulation mode before or after burn_write_opts get
3050  into effect.
3051  Beginning with version 1.4.8 a burn run by burn_disc_write() brings the
3052  burn_drive object in the simulation state as set to the burn_write_opts
3053  by burn_write_opts_set_simulate(). This state is respected by call
3054  burn_random_access_write() until a new call of burn_disc_write() happens
3055  or until burn_drive_reset_simulate() is called.
3056  This call may only be made when burn_drive_get_status() returns
3057  BURN_DRIVE_IDLE.
3058 
3059  @param d The drive to control
3060  @param simulate 1 enables simulation, 0 enables real writing
3061  @return 1=success , 0=failure
3062  @since 1.4.8
3063 */
3064 int burn_drive_reset_simulate(struct burn_drive *d, int simulate);
3065 
3066 
3067 /* these are for my [Derek Foreman's ?] debugging, they will disappear */
3068 /* ts B11012 :
3069  Of course, API symbols will not disappear. But these functions are of
3070  few use, as they only print DEBUG messages.
3071 */
3072 void burn_structure_print_disc(struct burn_disc *d);
3073 void burn_structure_print_session(struct burn_session *s);
3074 void burn_structure_print_track(struct burn_track *t);
3075 
3076 /** Sets the write type for the write_opts struct.
3077  Note: write_type BURN_WRITE_SAO is currently not capable of writing a mix
3078  of data and audio tracks. You must use BURN_WRITE_TAO for such sessions.
3079  @param opts The write opts to change
3080  @param write_type The write type to use
3081  @param block_type The block type to use
3082  @return Returns 1 on success and 0 on failure.
3083 */
3084 int burn_write_opts_set_write_type(struct burn_write_opts *opts,
3085  enum burn_write_types write_type,
3086  int block_type);
3087 
3088 
3089 /* ts A70207 */
3090 /** As an alternative to burn_write_opts_set_write_type() this function tries
3091  to find a suitable write type and block type for a given write job
3092  described by opts and disc. To be used after all other setups have been
3093  made, i.e. immediately before burn_disc_write().
3094  @param opts The nearly complete write opts to change
3095  @param disc The already composed session and track model
3096  @param reasons This text string collects reasons for decision or failure
3097  @param flag Bitfield for control purposes:
3098  bit0= do not choose type but check the one that is already set
3099  bit1= do not issue error messages via burn_msgs queue
3100  (is automatically set with bit0)
3101  @return Chosen write type. BURN_WRITE_NONE on failure.
3102  @since 0.3.2
3103 */
3105  struct burn_write_opts *opts, struct burn_disc *disc,
3106  char reasons[BURN_REASONS_LEN], int flag);
3107 
3108 
3109 /** Supplies toc entries for writing - not normally required for cd mastering
3110  @param opts The write opts to change
3111  @param count The number of entries
3112  @param toc_entries
3113 */
3114 void burn_write_opts_set_toc_entries(struct burn_write_opts *opts,
3115  int count,
3116  struct burn_toc_entry *toc_entries);
3117 
3118 /** Sets the session format for a disc
3119  @param opts The write opts to change
3120  @param format The session format to set
3121 */
3122 void burn_write_opts_set_format(struct burn_write_opts *opts, int format);
3123 
3124 /** Sets the simulate value for the write_opts struct .
3125  This corresponds to the Test Write bit in MMC mode page 05h. Several media
3126  types do not support this. See struct burn_multi_caps.might_simulate for
3127  actual availability of this feature.
3128  If the media is suitable, the drive will perform burn_disc_write() as a
3129  simulation instead of effective write operations. This means that the
3130  media content and burn_disc_get_status() stay unchanged.
3131  Note: With stdio-drives, the target file gets eventually created, opened,
3132  lseeked, and closed, but not written. So there are effects on it.
3133  Note: Up to version 1.4.6 the call burn_random_access_write() after
3134  burn_disc_write() did not simulate because it does not get any
3135  burn_write_opts and the drive did not memorize the simulation state.
3136  This has changed now. burn_random_access_write() will not write after
3137  a simulated burn run.
3138  Use burn_drive_reset_simulate(drive, 0) if you really want to end
3139  simulation before you call burn_disc_write() with new write options.
3140  @param opts The write opts to change
3141  @param sim Non-zero enables simulation, 0 enables real writing
3142  @return Returns 1 on success and 0 on failure.
3143 */
3144 int burn_write_opts_set_simulate(struct burn_write_opts *opts, int sim);
3145 
3146 /** Controls buffer underrun prevention. This is only needed with CD media
3147  and possibly with old DVD-R drives. All other media types are not
3148  vulnerable to burn failure due to buffer underrun.
3149  @param opts The write opts to change
3150  @param underrun_proof if non-zero, buffer underrun protection is enabled
3151  @return Returns 1 if the drive announces to be capable of underrun
3152  prevention,
3153  Returns 0 if not.
3154 */
3155 int burn_write_opts_set_underrun_proof(struct burn_write_opts *opts,
3156  int underrun_proof);
3157 
3158 /** Sets whether to use opc or not with the write_opts struct
3159  @param opts The write opts to change
3160  @param opc If non-zero, optical power calibration will be performed at
3161  start of burn
3162 
3163 */
3164 void burn_write_opts_set_perform_opc(struct burn_write_opts *opts, int opc);
3165 
3166 
3167 /** The Q sub-channel of a CD may contain a Media Catalog Number of 13 decimal
3168  digits. This call sets the string of digits, but does not yet activate it
3169  for writing.
3170  @param opts The write opts to change
3171  @param mediacatalog The 13 decimal digits as ASCII bytes. I.e. '0' = 0x30.
3172 */
3173 void burn_write_opts_set_mediacatalog(struct burn_write_opts *opts,
3174  unsigned char mediacatalog[13]);
3175 
3176 /** This call activates the Media Catalog Number for writing. The digits of
3177  that number have to be set by call burn_write_opts_set_mediacatalog().
3178  @param opts The write opts to change
3179  @param has_mediacatalog 1= activate writing of catalog to Q sub-channel
3180  0= deactivate it
3181 */
3182 void burn_write_opts_set_has_mediacatalog(struct burn_write_opts *opts,
3183  int has_mediacatalog);
3184 
3185 
3186 /* ts A61106 */
3187 /** Sets the multi flag which eventually marks the emerging session as not
3188  being the last one and thus creating a BURN_DISC_APPENDABLE media.
3189  Note: DVD-R[W] in write mode BURN_WRITE_SAO are not capable of this.
3190  DVD-R DL are not capable of this at all.
3191  libburn will refuse to write if burn_write_opts_set_multi() is
3192  enabled under such conditions.
3193  @param opts The option object to be manipulated
3194  @param multi 1=media will be appendable, 0=media will be closed (default)
3195  @since 0.2.6
3196 */
3197 void burn_write_opts_set_multi(struct burn_write_opts *opts, int multi);
3198 
3199 
3200 /* ts B31024 */
3201 /** Set the severity to be used with write error messages which are potentially
3202  caused by not using write type BURN_WRITE_SAO on fast blanked DVD-RW.
3203 
3204  Normally the call burn_write_opts_auto_write_type() can prevent such
3205  errors by looking for MMC feature 21h "Incremental Streaming Writable"
3206  which anounnces the capability for BURN_WRITE_TAO and multi session.
3207  Regrettable many drives announce feature 21h even if they only can do
3208  BURN_WRITE_SAO. This mistake becomes obvious by an early write error.
3209 
3210  If you plan to call burn_drive_was_feat21_failure() and to repeat the
3211  burn attempt with BURN_WRITE_SAO, then set the severity of the error
3212  message low enough, so that the application does not see reason to abort.
3213 
3214  @param opts The option object to be manipulated
3215  @param severity Severity as with burn_msgs_set_severities().
3216  "ALL" or empty text means the default severity that
3217  is attributed to other kinds of write errors.
3218 */
3219 void burn_write_opts_set_fail21h_sev(struct burn_write_opts *opts,
3220  char *severity);
3221 
3222 /* ts B11204 */
3223 /** Submit an array of CD-TEXT packs which shall be written to the Lead-in
3224  of a SAO write run on CD.
3225  @param opts The option object to be manipulated
3226  @param text_packs Array of bytes which form CD-TEXT packs of 18 bytes
3227  each. For a description of the format of the array,
3228  see file doc/cdtext.txt.
3229  No header of 4 bytes must be prepended which would
3230  tell the number of pack bytes + 2.
3231  This parameter may be NULL if the currently attached
3232  array of packs shall be removed.
3233  @param num_packs The number of 18 byte packs in text_packs.
3234  This parameter may be 0 if the currently attached
3235  array of packs shall be removed.
3236  @param flag Bitfield for control purposes.
3237  bit0= do not verify checksums
3238  bit1= repair mismatching checksums
3239  bit2= repair checksums if they are 00 00 with each pack
3240  @return 1 on success, <= 0 on failure
3241  @since 1.2.0
3242 */
3243 int burn_write_opts_set_leadin_text(struct burn_write_opts *opts,
3244  unsigned char *text_packs,
3245  int num_packs, int flag);
3246 
3247 
3248 /* ts A61222 */
3249 /** Sets a start address for writing to media and write modes which are able
3250  to choose this address at all (for now: DVD+RW, DVD-RAM, formatted DVD-RW).
3251  now). The address is given in bytes. If it is not -1 then a write run
3252  will fail if choice of start address is not supported or if the block
3253  alignment of the address is not suitable for media and write mode.
3254  Alignment to 32 kB blocks is supposed to be safe with DVD media.
3255  Call burn_disc_get_multi_caps() can obtain the necessary media info. See
3256  resulting struct burn_multi_caps elements .start_adr , .start_alignment ,
3257  .start_range_low , .start_range_high .
3258  @param opts The write opts to change
3259  @param value The address in bytes (-1 = start at default address)
3260  @since 0.3.0
3261 */
3262 void burn_write_opts_set_start_byte(struct burn_write_opts *opts, off_t value);
3263 
3264 
3265 /* ts A70213 */
3266 /** Caution: still immature and likely to change. Problems arose with
3267  sequential DVD-RW on one drive.
3268 
3269  Controls whether the whole available space of the media shall be filled up
3270  by the last track of the last session.
3271  @param opts The write opts to change
3272  @param fill_up_media If 1 : fill up by last track, if 0 = do not fill up
3273  @since 0.3.4
3274 */
3275 void burn_write_opts_set_fillup(struct burn_write_opts *opts,
3276  int fill_up_media);
3277 
3278 
3279 /* ts A70303 */
3280 /** Eventually makes libburn ignore the failure of some conformance checks:
3281  - the check whether CD write+block type is supported by the drive
3282  - the check whether the media profile supports simulated burning
3283  @param opts The write opts to change
3284  @param use_force 1=ignore above checks, 0=refuse work on failed check
3285  @since 0.3.4
3286 */
3287 void burn_write_opts_set_force(struct burn_write_opts *opts, int use_force);
3288 
3289 
3290 /* ts A80412 */
3291 /** Eventually makes use of the more modern write command AAh WRITE12 and
3292  sets the Streaming bit. With DVD-RAM and BD this can override the
3293  traditional slowdown to half nominal speed. But if it speeds up writing
3294  then it also disables error management and correction. Weigh your
3295  priorities. This affects the write operations of burn_disc_write()
3296  and subsequent calls of burn_random_access_write().
3297  @param opts The write opts to change
3298  @param value 0=use 2Ah WRITE10, 1=use AAh WRITE12 with Streaming bit
3299  @since 0.6.4:
3300  >=16 use WRITE12 but not before the LBA given by value
3301  @since 0.4.6
3302 */
3303 void burn_write_opts_set_stream_recording(struct burn_write_opts *opts,
3304  int value);
3305 
3306 /* ts A91115 */
3307 /** Overrides the write chunk size for DVD and BD media which is normally
3308  determined according to media type and setting of stream recording.
3309  A chunk size of 64 KB may improve throughput with bus systems which show
3310  latency problems.
3311  @param opts The write opts to change
3312  @param obs Number of bytes which shall be sent by a single write command.
3313  0 means automatic size, 32768 and 65336 are the only other
3314  accepted sizes for now.
3315  @since 0.7.4
3316 */
3317 void burn_write_opts_set_dvd_obs(struct burn_write_opts *opts, int obs);
3318 
3319 
3320 /* ts B20406 */
3321 /** Overrides the automatic decision whether to pad up the last write chunk to
3322  its full size. This applies to DVD, BD and stdio: pseudo-drives.
3323  Note: This override may get enabled fixely already at compile time by
3324  defining macro Libburn_dvd_always_obs_paD .
3325  @param opts The write opts to change
3326  @param pad 1 means to pad up in any case, 0 means automatic decision.
3327  @since 1.2.4
3328 */
3329 void burn_write_opts_set_obs_pad(struct burn_write_opts *opts, int pad);
3330 
3331 
3332 /* ts A91115 */
3333 /** Sets the rhythm by which stdio pseudo drives force their output data to
3334  be consumed by the receiving storage device. This forcing keeps the memory
3335  from being clogged with lots of pending data for slow devices.
3336  @param opts The write opts to change
3337  @param rythm Number of 2KB output blocks after which fsync(2) is
3338  performed.
3339  -1 means no fsync()
3340  0 means default
3341  1 means fsync() only at end, @since 1.3.8 (noop before 1.3.8)
3342  elsewise the value must be >= 32.
3343  Default is currently 8192 = 16 MB.
3344  @since 0.7.4
3345 */
3346 void burn_write_opts_set_stdio_fsync(struct burn_write_opts *opts, int rythm);
3347 
3348 
3349 /** Sets whether to read in raw mode or not
3350  @param opts The read opts to change
3351  @param raw_mode If non-zero, reading will be done in raw mode, so that everything in the data tracks on the
3352  disc is read, including headers.
3353 */
3354 void burn_read_opts_set_raw(struct burn_read_opts *opts, int raw_mode);
3355 
3356 /** Sets whether to report c2 errors or not
3357  @param opts The read opts to change
3358  @param c2errors If non-zero, report c2 errors.
3359 */
3360 void burn_read_opts_set_c2errors(struct burn_read_opts *opts, int c2errors);
3361 
3362 /** Sets whether to read subcodes from audio tracks or not
3363  @param opts The read opts to change
3364  @param subcodes_audio If non-zero, read subcodes from audio tracks on the disc.
3365 */
3366 void burn_read_opts_read_subcodes_audio(struct burn_read_opts *opts,
3367  int subcodes_audio);
3368 
3369 /** Sets whether to read subcodes from data tracks or not
3370  @param opts The read opts to change
3371  @param subcodes_data If non-zero, read subcodes from data tracks on the disc.
3372 */
3373 void burn_read_opts_read_subcodes_data(struct burn_read_opts *opts,
3374  int subcodes_data);
3375 
3376 /** Sets whether to recover errors if possible
3377  @param opts The read opts to change
3378  @param hardware_error_recovery If non-zero, attempt to recover errors if possible.
3379 */
3380 void burn_read_opts_set_hardware_error_recovery(struct burn_read_opts *opts,
3381  int hardware_error_recovery);
3382 
3383 /** Sets whether to report recovered errors or not
3384  @param opts The read opts to change
3385  @param report_recovered_errors If non-zero, recovered errors will be reported.
3386 */
3387 void burn_read_opts_report_recovered_errors(struct burn_read_opts *opts,
3388  int report_recovered_errors);
3389 
3390 /** Sets whether blocks with unrecoverable errors should be read or not
3391  @param opts The read opts to change
3392  @param transfer_damaged_blocks If non-zero, blocks with unrecoverable errors will still be read.
3393 */
3394 void burn_read_opts_transfer_damaged_blocks(struct burn_read_opts *opts,
3395  int transfer_damaged_blocks);
3396 
3397 /** Sets the number of retries to attempt when trying to correct an error
3398  @param opts The read opts to change
3399  @param hardware_error_retries The number of retries to attempt when correcting an error.
3400 */
3401 void burn_read_opts_set_hardware_error_retries(struct burn_read_opts *opts,
3402  unsigned char hardware_error_retries);
3403 
3404 
3405 /* ts A90815 */
3406 /** Gets the list of profile codes supported by the drive.
3407  Profiles depict the feature sets which constitute media types. For
3408  known profile codes and names see burn_disc_get_profile().
3409  @param d is the drive to query
3410  @param num_profiles returns the number of supported profiles
3411  @param profiles returns the profile codes
3412  @param is_current returns the status of the corresponding profile code:
3413  1= current, i.e. the matching media is loaded
3414  0= not current, i.e. the matching media is not loaded
3415  @return always 1 for now
3416  @since 0.7.0
3417 */
3418 int burn_drive_get_all_profiles(struct burn_drive *d, int *num_profiles,
3419  int profiles[64], char is_current[64]);
3420 
3421 
3422 /* ts A90815 */
3423 /** Obtains the profile name associated with a profile code.
3424  @param profile_code the profile code to be translated
3425  @param name returns the profile name (e.g. "DVD+RW")
3426  @return 1= known profile code , 0= unknown profile code
3427  @since 0.7.0
3428 */
3429 int burn_obtain_profile_name(int profile_code, char name[80]);
3430 
3431 
3432 /** Gets the maximum write speed for a drive and eventually loaded media.
3433  The return value might change by the media type of already loaded media,
3434  again by call burn_drive_grab() and again by call burn_disc_read_atip().
3435  @param d Drive to query
3436  @return Maximum write speed in K/s
3437 */
3438 int burn_drive_get_write_speed(struct burn_drive *d);
3439 
3440 
3441 /* ts A61021 */
3442 /** Gets the minimum write speed for a drive and eventually loaded media.
3443  The return value might change by the media type of already loaded media,
3444  again by call burn_drive_grab() and again by call burn_disc_read_atip().
3445  @param d Drive to query
3446  @return Minimum write speed in K/s
3447  @since 0.2.6
3448 */
3449 int burn_drive_get_min_write_speed(struct burn_drive *d);
3450 
3451 
3452 /** Gets the maximum read speed for a drive
3453  @param d Drive to query
3454  @return Maximum read speed in K/s
3455 */
3456 int burn_drive_get_read_speed(struct burn_drive *d);
3457 
3458 
3459 /* ts A61226 */
3460 /** Obtain a copy of the current speed descriptor list. The drive's list gets
3461  updated on various occasions such as burn_drive_grab() but the copy
3462  obtained here stays untouched. It has to be disposed via
3463  burn_drive_free_speedlist() when it is not longer needed. Speeds
3464  may appear several times in the list. The list content depends much on
3465  drive and media type. It seems that .source == 1 applies mostly to CD media
3466  whereas .source == 2 applies to any media.
3467  @param d Drive to query
3468  @param speed_list The copy. If empty, *speed_list gets returned as NULL.
3469  @return 1=success , 0=list empty , <0 severe error
3470  @since 0.3.0
3471 */
3472 int burn_drive_get_speedlist(struct burn_drive *d,
3473  struct burn_speed_descriptor **speed_list);
3474 
3475 /* ts A70713 */
3476 /** Look up the fastest speed descriptor which is not faster than the given
3477  speed_goal. If it is 0, then the fastest one is chosen among the
3478  descriptors with the highest end_lba. If it is -1 then the slowest speed
3479  descriptor is chosen regardless of end_lba. Parameter flag decides whether
3480  the speed goal means write speed or read speed.
3481  @param d Drive to query
3482  @param speed_goal Upper limit for speed,
3483  0=search for maximum speed , -1 search for minimum speed
3484  @param best_descr Result of the search, NULL if no match
3485  @param flag Bitfield for control purposes
3486  bit0= look for best read speed rather than write speed
3487  bit1= look for any source type (else look for source==2 first
3488  and for any other source type only with CD media)
3489  @return >0 indicates a valid best_descr, 0 = no valid best_descr
3490  @since 0.3.8
3491 */
3492 int burn_drive_get_best_speed(struct burn_drive *d, int speed_goal,
3493  struct burn_speed_descriptor **best_descr, int flag);
3494 
3495 
3496 /* ts A61226 */
3497 /** Dispose a speed descriptor list copy which was obtained by
3498  burn_drive_get_speedlist().
3499  @param speed_list The list copy. *speed_list gets set to NULL.
3500  @return 1=list disposed , 0= *speedlist was already NULL
3501  @since 0.3.0
3502 */
3503 int burn_drive_free_speedlist(struct burn_speed_descriptor **speed_list);
3504 
3505 
3506 /* ts A70203 */
3507 /* @since 0.3.2 */
3508 /** The reply structure for burn_disc_get_multi_caps()
3509 */
3511 
3512  /* Multi-session capability can keep the media appendable after
3513  writing a session. It also guarantees that the drive will be able
3514  to predict and use the appropriate Next Writeable Address to place
3515  the next session on the media without overwriting the existing ones.
3516  It does not guarantee that the selected write type is able to do
3517  an appending session after the next session. (E.g. CD SAO is capable
3518  of multi-session by keeping a disc appendable. But .might_do_sao
3519  will be 0 afterwards, when checking the appendable media.)
3520  1= media may be kept appendable by burn_write_opts_set_multi(o,1)
3521  0= media will not be appendable
3522  */
3524 
3525  /* Multi-track capability can write more than one track source
3526  during a single session. The written tracks can later be found in
3527  libburn's TOC model with their start addresses and sizes.
3528  1= multiple tracks per session are allowed
3529  0= only one track per session allowed
3530  */
3532 
3533  /* Start-address capability can set a non-zero address with
3534  burn_write_opts_set_start_byte(). Eventually this has to respect
3535  .start_alignment and .start_range_low, .start_range_high in this
3536  structure.
3537  1= non-zero start address is allowed
3538  0= only start address 0 is allowed (to depict the drive's own idea
3539  about the appropriate write start)
3540  */
3542 
3543  /** The alignment for start addresses.
3544  ( start_address % start_alignment ) must be 0.
3545  */
3547 
3548  /** The lowest permissible start address.
3549  */
3551 
3552  /** The highest addressable start address.
3553  */
3555 
3556  /** Potential availability of write modes
3557  4= needs no size prediction, not to be chosen automatically
3558  3= needs size prediction, not to be chosen automatically
3559  2= available, no size prediction necessary
3560  1= available, needs exact size prediction
3561  0= not available
3562  With CD media (profiles 0x09 and 0x0a) check also the elements
3563  *_block_types of the according write mode.
3564  */
3568 
3569  /** Generally advised write mode.
3570  Not necessarily the one chosen by burn_write_opts_auto_write_type()
3571  because the burn_disc structure might impose particular demands.
3572  */
3574 
3575  /** Write mode as given by parameter wt of burn_disc_get_multi_caps().
3576  */
3578 
3579  /** Profile number which was current when the reply was generated */
3581 
3582  /** Wether the current profile indicates CD media. 1=yes, 0=no */
3584 
3585  /* ts A70528 */
3586  /* @since 0.3.8 */
3587  /** Wether the current profile is able to perform simulated write */
3589 };
3590 
3591 /** Allocates a struct burn_multi_caps (see above) and fills it with values
3592  which are appropriate for the drive and the loaded media. The drive
3593  must be grabbed for this call. The returned structure has to be disposed
3594  via burn_disc_free_multi_caps() when no longer needed.
3595  @param d The drive to inquire
3596  @param wt With BURN_WRITE_NONE the best capabilities of all write modes
3597  get returned. If set to a write mode like BURN_WRITE_SAO the
3598  capabilities with that particular mode are returned and the
3599  return value is 0 if the desired mode is not possible.
3600  @param caps returns the info structure
3601  @param flag Bitfield for control purposes (unused yet, submit 0)
3602  @return < 0 : error , 0 : writing seems impossible , 1 : writing possible
3603  @since 0.3.2
3604 */
3605 int burn_disc_get_multi_caps(struct burn_drive *d, enum burn_write_types wt,
3606  struct burn_multi_caps **caps, int flag);
3607 
3608 /** Removes from memory a multi session info structure which was returned by
3609  burn_disc_get_multi_caps(). The pointer *caps gets set to NULL.
3610  @param caps the info structure to dispose (note: pointer to pointer)
3611  @return 0 : *caps was already NULL, 1 : memory object was disposed
3612  @since 0.3.2
3613 */
3614 int burn_disc_free_multi_caps(struct burn_multi_caps **caps);
3615 
3616 
3617 /** Gets a copy of the toc_entry structure associated with a track
3618  @param t Track to get the entry from
3619  @param entry Struct for the library to fill out
3620 */
3621 void burn_track_get_entry(struct burn_track *t, struct burn_toc_entry *entry);
3622 
3623 /** Gets a copy of the toc_entry structure associated with a session's lead out
3624  @param s Session to get the entry from
3625  @param entry Struct for the library to fill out
3626 */
3627 void burn_session_get_leadout_entry(struct burn_session *s,
3628  struct burn_toc_entry *entry);
3629 
3630 /** Gets an array of all complete sessions for the disc
3631  THIS IS NO LONGER VALID AFTER YOU ADD OR REMOVE A SESSION
3632  The result array contains *num + burn_disc_get_incomplete_sessions()
3633  elements. All above *num are incomplete sessions.
3634  Typically there is at most one incomplete session with one empty track.
3635  DVD+R and BD-R seem support more than one track with even readable data.
3636  @param d Disc to get session array for
3637  @param num Returns the number of sessions in the array
3638  @return array of sessions
3639 */
3640 struct burn_session **burn_disc_get_sessions(struct burn_disc *d,
3641  int *num);
3642 
3643 /* ts B30112 */
3644 /* @since 1.2.8 */
3645 /** Obtains the number of incomplete sessions which are recorded in the
3646  result array of burn_disc_get_sessions() after the complete sessions.
3647  See above.
3648  @param d Disc object to inquire
3649  @return Number of incomplete sessions
3650 */
3651 int burn_disc_get_incomplete_sessions(struct burn_disc *d);
3652 
3653 
3654 int burn_disc_get_sectors(struct burn_disc *d);
3655 
3656 /** Gets an array of all the tracks for a session
3657  THIS IS NO LONGER VALID AFTER YOU ADD OR REMOVE A TRACK
3658  @param s session to get track array for
3659  @param num Returns the number of tracks in the array
3660  @return array of tracks
3661 */
3662 struct burn_track **burn_session_get_tracks(struct burn_session *s,
3663  int *num);
3664 
3665 int burn_session_get_sectors(struct burn_session *s);
3666 
3667 /** Gets the mode of a track
3668  @param track the track to query
3669  @return the track's mode
3670 */
3671 int burn_track_get_mode(struct burn_track *track);
3672 
3673 /** Returns whether the first track of a session is hidden in the pregap
3674  @param session the session to query
3675  @return non-zero means the first track is hidden
3676 */
3677 int burn_session_get_hidefirst(struct burn_session *session);
3678 
3679 /** Returns the library's version in its parts.
3680  This is the runtime counterpart of the three build time macros
3681  burn_header_version_* below.
3682  @param major The major version number
3683  @param minor The minor version number
3684  @param micro The micro version number
3685 */
3686 void burn_version(int *major, int *minor, int *micro);
3687 
3688 
3689 /* ts A80129 */
3690 /* @since 0.4.4 */
3691 /** These three release version numbers tell the revision of this header file
3692  and of the API it describes. They are memorized by applications at build
3693  time.
3694  Immediately after burn_initialize() an application should do this check:
3695  burn_version(&major, &minor, &micro);
3696  if(major > burn_header_version_major
3697  || (major == burn_header_version_major
3698  && (minor > burn_header_version_minor
3699  || (minor == burn_header_version_minor
3700  && micro >= burn_header_version_micro)))) {
3701  ... Young enough. Go on with program run ....
3702  } else {
3703  ... Too old. Do not use this libburn version ...
3704  }
3705 
3706 */
3707 #define burn_header_version_major 1
3708 #define burn_header_version_minor 4
3709 #define burn_header_version_micro 8
3710 /** Note:
3711  Above version numbers are also recorded in configure.ac because libtool
3712  wants them as parameters at build time.
3713  For the library compatibility check, BURN_*_VERSION in configure.ac
3714  are not decisive. Only the three numbers above do matter.
3715 */
3716 /** Usage discussion:
3717 
3718 Some developers of the libburnia project have differing
3719 opinions how to ensure the compatibility of libaries
3720 and applications.
3721 
3722 It is about whether to use at compile time and at runtime
3723 the version numbers isoburn_header_version_* provided here.
3724 Thomas Schmitt advises to use them.
3725 Vreixo Formoso advises to use other means.
3726 
3727 At compile time:
3728 
3729 Vreixo Formoso advises to leave proper version matching
3730 to properly programmed checks in the the application's
3731 build system, which will eventually refuse compilation.
3732 
3733 Thomas Schmitt advises to use the macros defined here
3734 for comparison with the application's requirements of
3735 library revisions and to eventually break compilation.
3736 
3737 Both advises are combinable. I.e. be master of your
3738 build system and have #if checks in the source code
3739 of your application, nevertheless.
3740 
3741 At runtime (via *_is_compatible()):
3742 
3743 Vreixo Formoso advises to compare the application's
3744 requirements of library revisions with the runtime
3745 library. This is to enable runtime libraries which are
3746 young enough for the application but too old for
3747 the lib*.h files seen at compile time.
3748 
3749 Thomas Schmitt advises to compare the header
3750 revisions defined here with the runtime library.
3751 This is to enforce a strictly monotonous chain
3752 of revisions from app to header to library,
3753 at the cost of excluding some older libraries.
3754 
3755 These two advises are mutually exclusive.
3756 
3757 */
3758 
3759 /* ts A91226 */
3760 /** Obtain the id string of the SCSI transport interface.
3761  This interface may be a system specific adapter module of libburn or
3762  an adapter to a supporting library like libcdio.
3763  @param flag Bitfield for control puposes, submit 0 for now
3764  @return A pointer to the id string. Do not alter the string content.
3765  @since 0.7.6
3766 */
3767 char *burn_scsi_transport_id(int flag);
3768 
3769 /* ts A60924 : ticket 74 */
3770 /** Control queueing and stderr printing of messages from libburn.
3771  Severity may be one of "NEVER", "ABORT", "FATAL", "FAILURE", "SORRY",
3772  "WARNING", "HINT", "NOTE", "UPDATE", "DEBUG", "ALL".
3773  @param queue_severity Gives the minimum limit for messages to be queued.
3774  Default: "NEVER". If you queue messages then you
3775  must consume them by burn_msgs_obtain().
3776  @param print_severity Does the same for messages to be printed directly
3777  to stderr. Default: "FATAL".
3778  @param print_id A text prefix to be printed before the message.
3779  @return >0 for success, <=0 for error
3780  @since 0.2.6
3781 */
3782 int burn_msgs_set_severities(char *queue_severity,
3783  char *print_severity, char *print_id);
3784 
3785 /* ts A60924 : ticket 74 */
3786 /* @since 0.2.6 */
3787 #define BURN_MSGS_MESSAGE_LEN 4096
3788 
3789 /** Obtain the oldest pending libburn message from the queue which has at
3790  least the given minimum_severity. This message and any older message of
3791  lower severity will get discarded from the queue and is then lost forever.
3792  @param minimum_severity may be one of "NEVER", "ABORT", "FATAL",
3793  "FAILURE", "SORRY", "WARNING", "HINT", "NOTE", "UPDATE",
3794  "DEBUG", "ALL".
3795  To call with minimum_severity "NEVER" will discard the
3796  whole queue.
3797  @param error_code Will become a unique error code as listed in
3798  libburn/libdax_msgs.h
3799  @param msg_text Must provide at least BURN_MSGS_MESSAGE_LEN bytes.
3800  @param os_errno Will become the eventual errno related to the message
3801  @param severity Will become the severity related to the message and
3802  should provide at least 80 bytes.
3803  @return 1 if a matching item was found, 0 if not, <0 for severe errors
3804  @since 0.2.6
3805 */
3806 int burn_msgs_obtain(char *minimum_severity,
3807  int *error_code, char msg_text[], int *os_errno,
3808  char severity[]);
3809 
3810 
3811 /* ts A70922 */
3812 /** Submit a message to the libburn queueing system. It will be queued or
3813  printed as if it was generated by libburn itself.
3814  @param error_code The unique error code of your message.
3815  Submit 0 if you do not have reserved error codes within
3816  the libburnia project.
3817  @param msg_text Not more than BURN_MSGS_MESSAGE_LEN characters of
3818  message text.
3819  @param os_errno Eventual errno related to the message. Submit 0 if
3820  the message is not related to a operating system error.
3821  @param severity One of "ABORT", "FATAL", "FAILURE", "SORRY", "WARNING",
3822  "HINT", "NOTE", "UPDATE", "DEBUG". Defaults to "FATAL".
3823  @param d An eventual drive to which the message shall be related.
3824  Submit NULL if the message is not specific to a
3825  particular drive object.
3826  @return 1 if message was delivered, <=0 if failure
3827  @since 0.4.0
3828 */
3829 int burn_msgs_submit(int error_code, char msg_text[], int os_errno,
3830  char severity[], struct burn_drive *d);
3831 
3832 
3833 /* ts A71016 */
3834 /** Convert a severity name into a severity number, which gives the severity
3835  rank of the name.
3836  @param severity_name A name as with burn_msgs_submit(), e.g. "SORRY".
3837  @param severity_number The rank number: the higher, the more severe.
3838  @param flag Bitfield for control purposes (unused yet, submit 0)
3839  @return >0 success, <=0 failure
3840  @since 0.4.0
3841 */
3842 int burn_text_to_sev(char *severity_name, int *severity_number, int flag);
3843 
3844 
3845 /* ts A80202 */
3846 /** Convert a severity number into a severity name
3847  @param severity_number The rank number: the higher, the more severe.
3848  @param severity_name A name as with burn_msgs_submit(), e.g. "SORRY".
3849  @param flag Bitfield for control purposes (unused yet, submit 0)
3850  @return >0 success, <=0 failure
3851  @since 0.4.4
3852 */
3853 int burn_sev_to_text(int severity_number, char **severity_name, int flag);
3854 
3855 
3856 /* ts B21214 */
3857 /** Return a blank separated list of severity names. Sorted from low
3858  to high severity.
3859  @param flag Bitfield for control purposes (unused yet, submit 0)
3860  @return A constant string with the severity names
3861  @since 1.2.6
3862 */
3863 char *burn_list_sev_texts(int flag);
3864 
3865 
3866 /* ts A70915 */
3867 /** Replace the messenger object handle of libburn by a compatible handle
3868  obtained from a related library.
3869  See also: libisofs, API function iso_get_messenger().
3870  @param messenger The foreign but compatible message handle.
3871  @return 1 : success, <=0 : failure
3872  @since 0.4.0
3873 */
3874 int burn_set_messenger(void *messenger);
3875 
3876 
3877 /* ts A61002 */
3878 /* @since 0.2.6 */
3879 /** The prototype of a handler function suitable for burn_set_signal_handling()
3880  Such a function has to return -2 if it does not want the process to
3881  exit with value 1.
3882 */
3883 typedef int (*burn_abort_handler_t)(void *handle, int signum, int flag);
3884 
3885 /** Control built-in signal handling. Either by setting an own handler or
3886  by activating the built-in signal handler.
3887 
3888  A function parameter handle of NULL activates the built-in abort handler.
3889  Depending on mode it may cancel all drive operations, wait for all drives
3890  to become idle, exit(1). It may also prepare function
3891  burn_drive_get_status() for waiting and performing exit(1).
3892  Parameter handle may be NULL or a text that shall be used as prefix for
3893  pacifier messages of burn_abort_pacifier(). Other than with an application
3894  provided handler, the prefix char array does not have to be kept existing
3895  until the eventual signal event.
3896  Before version 0.7.8 only action 0 was available. I.e. the built-in handler
3897  waited for the drives to become idle and then performed exit(1) directly.
3898  But during burn_disc_write() onto real CD or DVD, FreeBSD 8.0 pauses the
3899  other threads until the signal handler returns.
3900  The new actions try to avoid this deadlock. It is advised to use action 3
3901  at least during burn_disc_write(), burn_disc_erase(), burn_disc_format():
3902  burn_set_signal_handling(text, NULL, 0x30);
3903  and to call burn_is_aborting(0) when the drive is BURN_DRIVE_IDLE.
3904  If burn_is_aborting(0) returns 1, then call burn_abort() and exit(1).
3905 
3906  @param handle Opaque handle eventually pointing to an application
3907  provided memory object
3908  @param handler A function to be called on signals, if the handling bits
3909  in parameter mode are set 0.
3910  It will get parameter handle as argument. flag will be 0.
3911  It should finally call burn_abort(). See there.
3912  If the handler function returns 2 or -2, then the wrapping
3913  signal handler of libburn will return and let the program
3914  continue its operations. Any other return value causes
3915  exit(1).
3916  @param mode : bit0 - bit3: Handling of received signals:
3917  0 Install libburn wrapping signal handler, which will call
3918  handler(handle, signum, 0) on nearly all signals
3919  1 Enable system default reaction on all signals
3920  2 Try to ignore nearly all signals
3921  10 like mode 2 but handle SIGABRT like with mode 0
3922  bit4 - bit7: With handler == NULL :
3923  Action of built-in handler. "control thread" is the one
3924  which called burn_set_signal_handling().
3925  All actions activate receive mode 2 to ignore further
3926  signals.
3927  0 Same as 1 (for pre-0.7.8 backward compatibility)
3928  @since 0.7.8
3929  1 Catch the control thread in abort handler, call
3930  burn_abort() with a patience value > 0 and
3931  finally exit(1). Does not always work with FreeBSD.
3932  2 Call burn_abort() with patience -1 and return from
3933  handler. When the control thread calls
3934  burn_drive_get_status(), then call burn_abort()
3935  with patience 1 instead, and finally exit(1).
3936  Does not always work with FreeBSD.
3937  3 Call burn_abort() with patience -1, return from handler.
3938  It is duty of the application to detect a pending abort
3939  condition by calling burn_is_aborting() and to wait for
3940  all drives to become idle. E.g. by calling burn_abort()
3941  with patience >0.
3942  4 Like 3, but without calling burn_abort() with -1. Only
3943  the indicator of burn_is_aborting() gets set.
3944  bit8: @since 1.3.2
3945  try to ignore SIGPIPE (regardless of bit0 - bit3)
3946 
3947  @since 0.2.6
3948 */
3949 void burn_set_signal_handling(void *handle, burn_abort_handler_t handler,
3950  int mode);
3951 
3952 
3953 /* ts B00304 */
3954 /* Inquire whether the built-in abort handler was triggered by a signal.
3955  This has to be done to detect pending abort handling if signal handling
3956  was set to the built-in handler and action was set to 2 or 3.
3957  @param flag Bitfield for control purposes (unused yet, submit 0)
3958  @return 0 = no abort was triggered
3959  >0 = action that was triggered (action 0 is reported as 1)
3960  @since 0.7.8
3961 */
3962 int burn_is_aborting(int flag);
3963 
3964 
3965 /* ts A70811 */
3966 /** Write data in random access mode.
3967  The drive must be grabbed successfully before calling this function which
3968  circumvents usual libburn session processing and rather writes data without
3969  preparations or finalizing. This will work only with overwriteable media
3970  which are also suitable for burn_write_opts_set_start_byte(). The same
3971  address alignment restrictions as with this function apply. I.e. for DVD
3972  it is best to align to 32 KiB blocks (= 16 LBA units). The amount of data
3973  to be written is subject to the same media dependent alignment rules.
3974  Again, 32 KiB is most safe.
3975  Call burn_disc_get_multi_caps() can obtain the necessary media info. See
3976  resulting struct burn_multi_caps elements .start_adr , .start_alignment ,
3977  .start_range_low , .start_range_high .
3978  Other than burn_disc_write() this is a synchronous call which returns
3979  only after the write transaction has ended (successfully or not). So it is
3980  wise not to transfer giant amounts of data in a single call.
3981  Important: Data have to fit into the already formatted area of the media.
3982 
3983  If the burn_drive object is in simulation mode, then no actual write
3984  operation or synchronization of the drive buffer will happen.
3985  See burn_drive_reset_simulate().
3986 
3987  @param d The drive to which to write
3988  @param byte_address The start address of the write in byte
3989  (1 LBA unit = 2048 bytes) (do respect media alignment)
3990  @param data The bytes to be written
3991  @param data_count The number of those bytes (do respect media alignment)
3992  data_count == 0 is permitted (e.g. to flush the
3993  drive buffer without further data transfer).
3994  @param flag Bitfield for control purposes:
3995  bit0 = flush the drive buffer after eventual writing
3996  @return 1=successful , <=0 : number of transferred bytes * -1
3997  @since 0.4.0
3998 */
3999 int burn_random_access_write(struct burn_drive *d, off_t byte_address,
4000  char *data, off_t data_count, int flag);
4001 
4002 
4003 /* ts A81215 */
4004 /** Inquire the maximum amount of readable data.
4005  It is supposed that all LBAs in the range from 0 to capacity - 1
4006  can be read via burn_read_data() although some of them may never have been
4007  recorded. If tracks are recognizable then it is better to only read
4008  LBAs which are part of some track.
4009  If the drive is actually a large file or block device, then the capacity
4010  is curbed to a maximum of 0x7ffffff0 blocks = 4 TB - 32 KB.
4011  @param d The drive from which to read
4012  @param capacity Will return the result if valid
4013  @param flag Bitfield for control purposes: Unused yet, submit 0.
4014  @return 1=successful , <=0 an error occurred
4015  @since 0.6.0
4016 */
4017 int burn_get_read_capacity(struct burn_drive *d, int *capacity, int flag);
4018 
4019 
4020 /* ts A70812 */
4021 /** Read data in random access mode.
4022  The drive must be grabbed successfully before calling this function.
4023  With all currently supported drives and media the byte_address has to
4024  be aligned to 2048 bytes. Only data tracks with 2048 bytes per sector
4025  can be read this way. I.e. not CD-audio, not CD-video-stream ...
4026  This is a synchronous call which returns only after the full read job
4027  has ended (successfully or not). So it is wise not to read giant amounts
4028  of data in a single call.
4029  @param d The drive from which to read
4030  @param byte_address The start address of the read in byte (aligned to 2048)
4031  @param data A memory buffer capable of taking data_size bytes
4032  @param data_size The amount of data to be read. This does not have to
4033  be aligned to any block size.
4034  @param data_count The amount of data actually read (interesting on error)
4035  The counted bytes are supposed to be valid.
4036  @param flag Bitfield for control purposes:
4037  bit0= - reserved -
4038  bit1= do not submit error message if read error
4039  bit2= on error do not try to read a second time
4040  with single block steps.
4041  @since 0.5.2
4042  bit3= return -2 on permission denied error rather than
4043  issuing a warning message.
4044  @since 1.0.6
4045  bit4= return -3 on SCSI error
4046  5 64 00 ILLEGAL MODE FOR THIS TRACK
4047  and prevent this error from being reported as
4048  event message. Do not retry reading in this case.
4049  (Useful to try the last two blocks of a CD
4050  track which might be non-data because of TAO.)
4051  @since 1.2.6
4052  bit5= issue messages with severity DEBUG if they would
4053  be suppressed by bit1.
4054  @since 1.4.0
4055  @return 1=successful , <=0 an error occurred
4056  with bit3: -2= permission denied error
4057  @since 0.4.0
4058 */
4059 int burn_read_data(struct burn_drive *d, off_t byte_address,
4060  char data[], off_t data_size, off_t *data_count, int flag);
4061 
4062 
4063 /* ts B21119 */
4064 /** Read CD audio sectors in random access mode.
4065  The drive must be grabbed successfully before calling this function.
4066  Only CD audio tracks with 2352 bytes per sector can be read this way.
4067  I.e. not data tracks, not CD-video-stream, ...
4068 
4069  Note that audio data do not have exact block addressing. If you read a
4070  sequence of successive blocks then you will get a seamless stream
4071  of data. But the actual start and end position of this audio stream
4072  will differ by a few dozens of milliseconds, depending on individual
4073  CD and individual drive.
4074  Expect leading and trailing zeros, as well as slight truncation.
4075 
4076  @param d The drive from which to read.
4077  It must be a real MMC drive (i.e. not a stdio file)
4078  and it must have a CD loaded (i.e. not DVD or BD).
4079  @param sector_no The sector number (Logical Block Address)
4080  It may be slightly below 0, depending on drive and
4081  medium. -150 is a lower limit.
4082  @param data A memory buffer capable of taking data_size bytes
4083  @param data_size The amount of data to be read. This must be aligned
4084  to full multiples of 2352.
4085  @param data_count The amount of data actually read (interesting on error)
4086  @param flag Bitfield for control purposes:
4087  bit0= - reserved -
4088  bit1= do not submit error message if read error
4089  bit2= on error do not try to read a second time
4090  with single block steps.
4091  bit3= Enable DAP : "flaw obscuring mechanisms like
4092  audio data mute and interpolate"
4093  bit4= return -3 on SCSI error
4094  5 64 00 ILLEGAL MODE FOR THIS TRACK
4095  and prevent this error from being reported as
4096  event message. Do not retry reading in this case.
4097  (Useful to try the last two blocks of a CD
4098  track which might be non-audio because of TAO.)
4099  bit5= issue messages with severity DEBUG if they would
4100  be suppressed by bit1.
4101  @since 1.4.0
4102  @return 1=successful , <=0 an error occurred
4103  with bit3: -2= permission denied error
4104  @since 1.2.6
4105 */
4106 int burn_read_audio(struct burn_drive *d, int sector_no,
4107  char data[], off_t data_size, off_t *data_count, int flag);
4108 
4109 
4110 /* ts B30522 */
4111 /** Extract an interval of audio sectors from CD and store it as a WAVE
4112  audio file on hard disk.
4113 
4114  @param drive The drive from which to read.
4115  @param start_sector The logical block address of the first audio sector
4116  which shall be read.
4117  @param sector_count The number of audio sectors to be read.
4118  Each sector consists of 2352 bytes.
4119  @param target_path The address of the file where to store the extracted
4120  audio data. Will be opened O_WRONLY | O_CREAT.
4121  The file name should have suffix ".wav".
4122  @param flag Bitfield for control purposes:
4123  bit0= Report about progress by UPDATE messages
4124  bit3= Enable DAP : "flaw obscuring mechanisms like
4125  audio data mute and interpolate"
4126  @since 1.3.2
4127 */
4128 int burn_drive_extract_audio(struct burn_drive *drive,
4129  int start_sector, int sector_count,
4130  char *target_path, int flag);
4131 
4132 
4133 /* ts B30522 */
4134 /** Extract all audio sectors of a track from CD and store them as a WAVE
4135  audio file on hard disk.
4136 
4137  @param drive The drive from which to read.
4138  @param track The track which shall be extracted.
4139  @param target_path The address of the file where to store the extracted
4140  audio data. Will be opened O_WRONLY | O_CREAT.
4141  The file name should have suffix ".wav".
4142  @param flag Bitfield for control purposes:
4143  bit0= Report about progress by UPDATE messages
4144  bit3= Enable DAP : "flaw obscuring mechanisms like
4145  audio data mute and interpolate"
4146  @since 1.3.2
4147 */
4148 int burn_drive_extract_audio_track(struct burn_drive *drive,
4149  struct burn_track *track,
4150  char *target_path, int flag);
4151 
4152 
4153 /* ts A70904 */
4154 /** Inquire whether the drive object is a real MMC drive or a pseudo-drive
4155  created by a stdio: address.
4156  @param d The drive to inquire
4157  @return 0= null-drive
4158  1= real MMC drive
4159  2= stdio-drive, random access, read-write
4160  3= stdio-drive, sequential, write-only
4161  4= stdio-drive, random access, read-only
4162  (only if enabled by burn_allow_drive_role_4())
4163  5= stdio-drive, random access, write-only
4164  (only if enabled by burn_allow_drive_role_4())
4165  @since 0.4.0
4166 */
4167 int burn_drive_get_drive_role(struct burn_drive *d);
4168 
4169 
4170 /* ts B10312 */
4171 /** Allow drive role 4 "random access read-only"
4172  and drive role 5 "random access write-only".
4173  By default a random access file assumes drive role 2 "read-write"
4174  regardless whether it is actually readable or writeable.
4175  If enabled, random-access file objects which recognizably permit no
4176  writing will be classified as role 4 and those which permit no reading
4177  will get role 5.
4178  Candidates are drive addresses of the form stdio:/dev/fd/# , where # is
4179  the integer number of an open file descriptor. If this descriptor was
4180  opened read-only or write-only, then it gets role 4 or role 5,
4181  respectively.
4182  Other paths may get tested by an attempt to open them for read-write
4183  (role 2) or read-only (role 4) or write-only (role 5). See bit1.
4184  @param allowed Bitfield for control purposes:
4185  bit0= Enable roles 4 and 5 for drives which get
4186  acquired after this call
4187  bit1= with bit0:
4188  Test whether the file can be opened for
4189  read-write, read-only, or write-only.
4190  Classify as roles 2, 4, 5.
4191  bit2= with bit0 and bit1:
4192  Classify files which cannot be opened at all
4193  as role 0 : useless dummy.
4194  Else classify as role 2.
4195  bit3= Classify non-empty role 5 drives as
4196  BURN_DISC_APPENDABLE with Next Writeable Address
4197  after the end of the file. It is nevertheless
4198  possible to change this address by call
4199  burn_write_opts_set_start_byte().
4200  @since 1.0.6
4201 */
4202 void burn_allow_drive_role_4(int allowed);
4203 
4204 
4205 /* ts A70923 */
4206 /** Find out whether a given address string would lead to the given drive
4207  object. This should be done in advance for track source addresses
4208  with parameter drive_role set to 2.
4209  Although a real MMC drive should hardly exist as two drive objects at
4210  the same time, this can easily happen with stdio-drives. So if more than
4211  one drive is used by the application, then this gesture is advised:
4212  burn_drive_d_get_adr(d2, adr2);
4213  if (burn_drive_equals_adr(d1, adr2, burn_drive_get_drive_role(d2)))
4214  ... Both drive objects point to the same storage facility ...
4215 
4216  @param d1 Existing drive object
4217  @param adr2 Address string to be tested. Prefix "stdio:" overrides
4218  parameter drive_role2 by either 0 or 2 as appropriate.
4219  The string must be shorter than BURN_DRIVE_ADR_LEN.
4220  @param drive_role2 Role as burn_drive_get_drive_role() would attribute
4221  to adr2 if it was a drive. Use value 2 for checking track
4222  sources or pseudo-drive addresses without "stdio:".
4223  Use 1 for checking drive addresses including those with
4224  prefix "stdio:".
4225  @return 1= adr2 leads to d1 , 0= adr2 seems not to lead to d1,
4226  -1 = adr2 is bad
4227  @since 0.4.0
4228 */
4229 int burn_drive_equals_adr(struct burn_drive *d1, char *adr2, int drive_role2);
4230 
4231 
4232 
4233 /*
4234  Audio track data extraction facility.
4235 */
4236 
4237 /* Maximum size for address paths and fmt_info strings */
4238 #define LIBDAX_AUDIOXTR_STRLEN 4096
4239 
4240 
4241 /** Extractor object encapsulating intermediate states of extraction.
4242  The clients of libdax_audioxtr shall only allocate pointers to this
4243  struct and get a storage object via libdax_audioxtr_new().
4244  Appropriate initial value for the pointer is NULL.
4245 */
4246 struct libdax_audioxtr;
4247 
4248 
4249 /** Open an audio file, check wether suitable, create extractor object.
4250  @param xtr Opaque handle to extractor. Gets attached extractor object.
4251  @param path Address of the audio file to extract. "-" is stdin (but might
4252  be not suitable for all futurely supported formats).
4253  @param flag Bitfield for control purposes (unused yet, submit 0)
4254  @return >0 success
4255  0 unsuitable format
4256  -1 severe error
4257  -2 path not found
4258  @since 0.2.4
4259 */
4260 int libdax_audioxtr_new(struct libdax_audioxtr **xtr, char *path, int flag);
4261 
4262 
4263 /** Obtain identification parameters of opened audio source.
4264  @param xtr Opaque handle to extractor
4265  @param fmt Gets pointed to the audio file format id text: ".wav" , ".au"
4266  @param fmt_info Gets pointed to a format info text telling parameters
4267  @param num_channels e.g. 1=mono, 2=stereo, etc
4268  @param sample_rate e.g. 11025, 44100
4269  @param bits_per_sample e.g. 8= 8 bits per sample, 16= 16 bits ...
4270  @param msb_first Byte order of samples: 0= Intel = Little Endian
4271  1= Motorola = Big Endian
4272  @param flag Bitfield for control purposes (unused yet, submit 0)
4273  @return >0 success, <=0 failure
4274  @since 0.2.4
4275 */
4276 int libdax_audioxtr_get_id(struct libdax_audioxtr *xtr,
4277  char **fmt, char **fmt_info,
4278  int *num_channels, int *sample_rate,
4279  int *bits_per_sample, int *msb_first, int flag);
4280 
4281 
4282 /** Obtain a prediction about the extracted size based on internal information
4283  of the formatted file.
4284  @param o Opaque handle to extractor
4285  @param size Gets filled with the predicted size
4286  @param flag Bitfield for control purposes (unused yet, submit 0)
4287  @return 1 prediction was possible , 0 no prediction could be made
4288  @since 0.2.4
4289 */
4290 int libdax_audioxtr_get_size(struct libdax_audioxtr *o, off_t *size, int flag);
4291 
4292 
4293 /** Obtain next buffer full of extracted data in desired format (only raw audio
4294  for now).
4295  @param xtr Opaque handle to extractor
4296  @param buffer Gets filled with extracted data
4297  @param buffer_size Maximum number of bytes to be filled into buffer
4298  @param flag Bitfield for control purposes
4299  bit0= do not stop at predicted end of data
4300  @return >0 number of valid buffer bytes,
4301  0 End of file
4302  -1 operating system reports error
4303  -2 usage error by application
4304  @since 0.2.4
4305 */
4306 int libdax_audioxtr_read(struct libdax_audioxtr *xtr,
4307  char buffer[], int buffer_size, int flag);
4308 
4309 
4310 /** Try to obtain a file descriptor which will deliver extracted data
4311  to normal calls of read(2). This may fail because the format is
4312  unsuitable for that, but WAVE (.wav) is ok. If this call succeeds the xtr
4313  object will have forgotten its file descriptor and libdax_audioxtr_read()
4314  will return a usage error. One may use *fd after libdax_audioxtr_destroy()
4315  and will have to close it via close(2) when done with it.
4316  @param o Opaque handle to extractor
4317  @param fd Returns the file descriptor number
4318  @param flag Bitfield for control purposes
4319  bit0= do not dup(2) and close(2) but hand out original fd
4320  @return 1 success, 0 cannot hand out fd , -1 severe error
4321  @since 0.2.4
4322 */
4323 int libdax_audioxtr_detach_fd(struct libdax_audioxtr *o, int *fd, int flag);
4324 
4325 
4326 /** Clean up after extraction and destroy extractor object.
4327  @param xtr Opaque handle to extractor, *xtr is allowed to be NULL,
4328  *xtr is set to NULL by this function
4329  @param flag Bitfield for control purposes (unused yet, submit 0)
4330  @return 1 = destroyed object, 0 = was already destroyed
4331  @since 0.2.4
4332 */
4333 int libdax_audioxtr_destroy(struct libdax_audioxtr **xtr, int flag);
4334 
4335 
4336 #ifndef DOXYGEN
4337 
4338 BURN_END_DECLS
4339 
4340 #endif
4341 
4342 
4343 /* ts A91205 */
4344 /* The following experiments may be interesting in future:
4345 */
4346 
4347 /* Perform OPC explicitely.
4348  # define Libburn_pioneer_dvr_216d_with_opC 1
4349 */
4350 
4351 /* Load mode page 5 and modify it rather than composing from scratch.
4352  # define Libburn_pioneer_dvr_216d_load_mode5 1
4353 */
4354 
4355 /* Inquire drive events and react by reading configuration or starting unit.
4356  # define Libburn_pioneer_dvr_216d_get_evenT 1
4357 */
4358 
4359 /* ts A91112 */
4360 /* Do not probe CD modes but declare only data and audio modes supported.
4361  For other modes or real probing one has to call
4362  burn_drive_probe_cd_write_modes().
4363 
4364 */
4365 #define Libburn_dummy_probe_write_modeS 1
4366 
4367 /* ts B30112 */
4368 /* Handle DVD+R with reserved tracks in incomplete first session
4369  by loading info about the incomplete session into struct burn_disc
4370 */
4371 #define Libburn_disc_with_incomplete_sessioN 1
4372 
4373 
4374 /* Early experimental:
4375  Do not define Libburn_develop_quality_scaN unless you want to work
4376  towards a usable implementation.
4377  If it gets enabled, then the call must be published in libburn/libburn.ver
4378 */
4379 #ifdef Libburn_develop_quality_scaN
4380 
4381 /* ts B21108 */
4382 /* Experiments mit quality scan command F3 on Optiarc drive */
4383 int burn_nec_optiarc_rep_err_rate(struct burn_drive *d,
4384  int start_lba, int rate_period, int flag);
4385 
4386 #endif /* Libburn_develop_quality_scaN */
4387 
4388 
4389 /* Linux 3.16 problems with ABh Read Media Serial Number:
4390  - as normal user lets ioctl(SG_IO) return -1 and errno = EFAULT
4391  - as superuser renders LG BH16NS40 unusable until power cycle
4392  #de fine Libburn_enable_scsi_cmd_ABh yes
4393  #de fine Libburn_enable_scsi_cmd_ABh_pretend_currenT yes
4394 */
4395 
4396 
4397 #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
unsigned int write_cdrw
Can the drive write CD-RW discs.
Definition: libburn.h:621
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:3554
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)
unsigned int write_dvdram
Can the drive write DVD-RAM discs.
Definition: libburn.h:615
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.
unsigned int read_dvdr
Can the drive read DVD-R discs.
Definition: libburn.h:606
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.
unsigned int c2_errors
DEPRECATED: Can the drive report C2 errors.
Definition: libburn.h:627
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:3550
unsigned buffer_available
The free space in the drive buffer (might be slightly outdated)
Definition: libburn.h:694
enum burn_write_types selected_write_mode
Write mode as given by parameter wt of burn_disc_get_multi_caps().
Definition: libburn.h:3577
unsigned int read_cdr
Can the drive read CD-R discs.
Definition: libburn.h:610
burn_drive_status
Possible busy states for a drive.
Definition: libburn.h:289
int burn_drive_get_bd_r_pow(struct burn_drive *drive)
Tells whether a BD-R medium with Pseudo Overwrite (POW) formatting is in the drive.
int burn_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.
unsigned int write_simulate
Can the drive simulate a write.
Definition: libburn.h:624
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 sao_block_types
The supported block types in sao mode.
Definition: libburn.h:644
int(* read)(struct burn_source *, unsigned char *buffer, int size)
Read data from the source.
Definition: libburn.h:490
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.
char product[17]
Name of the drive.
Definition: libburn.h:588
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_reset_simulate(struct burn_drive *d, int simulate)
Control the write simulation mode before or after burn_write_opts get into effect.
unsigned int read_cdrw
Can the drive read CD-RW discs.
Definition: libburn.h:612
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.
unsigned int write_cdr
Can the drive write CD-R discs.
Definition: libburn.h:619
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:3510
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...
char profile_name[80]
Definition: libburn.h:735
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
char location[17]
Invalid: Was: "Location of the drive in the filesystem.".
Definition: libburn.h:596
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
unsigned int read_dvdram
Can the drive read DVD-RAM discs.
Definition: libburn.h:604
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:3580
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.
unsigned int write_dvdr
Can the drive write DVD-R discs.
Definition: libburn.h:617
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...
char vendor[9]
Name of the vendor of the drive.
Definition: libburn.h:586
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:3588
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.
enum burn_write_types advised_write_mode
Generally advised write mode.
Definition: libburn.h:3573
int might_do_tao
Potential availability of write modes 4= needs no size prediction, not to be chosen automatically 3= ...
Definition: libburn.h:3565
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:3883
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:3546
char revision[5]
Revision of the drive.
Definition: libburn.h:590
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:3583
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
unsigned int read_dvdrom
Can the drive read DVD-ROM discs.
Definition: libburn.h:608
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:1814
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.14