libburn  1.2.2
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 - 2012 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  ts A70201 : DVD extension, see below
347 */
349 {
350  /** Session the track is in */
351  unsigned char session;
352  /** Type of data. for this struct to be valid, it must be 1 */
353  unsigned char adr;
354  /** Type of data in the track */
355  unsigned char control;
356  /** Zero. Always. Really. */
357  unsigned char tno;
358  /** Track number or special information */
359  unsigned char point;
360  unsigned char min;
361  unsigned char sec;
362  unsigned char frame;
363  unsigned char zero;
364  /** Track start time minutes for normal tracks */
365  unsigned char pmin;
366  /** Track start time seconds for normal tracks */
367  unsigned char psec;
368  /** Track start time frames for normal tracks */
369  unsigned char pframe;
370 
371  /* Indicates whether extension data are valid and eventually override
372  older elements in this structure:
373  bit0= DVD extension is valid @since 0.3.2
374  @since 0.5.2 : DVD extensions are made valid for CD too
375  */
376  unsigned char extensions_valid;
377 
378  /* ts A70201 : DVD extension. extensions_valid:bit0
379  If invalid the members are guaranteed to be 0. */
380  /* @since 0.3.2 */
381  /* Tracks and session numbers are 16 bit. Here are the high bytes. */
382  unsigned char session_msb;
383  unsigned char point_msb;
384  /* pmin, psec, and pframe may be too small if DVD extension is valid */
385  int start_lba;
386  /* min, sec, and frame may be too small if DVD extension is valid */
388 
389  /* ts A90909 : LRA extension. extensions_valid:bit1 */
390  /* @since 0.7.2 */
391  /* MMC-5 6.27.3.18 : The Last Recorded Address is valid for DVD-R,
392  DVD-R DL when LJRS = 00b, DVD-RW, HD DVD-R, and BD-R.
393  This would mean profiles: 0x11, 0x15, 0x13, 0x14, 0x51, 0x41, 0x42
394  */
396 };
397 
398 
399 /** Data source interface for tracks.
400  This allows to use arbitrary program code as provider of track input data.
401 
402  Objects compliant to this interface are either provided by the application
403  or by API calls of libburn: burn_fd_source_new() , burn_file_source_new(),
404  and burn_fifo_source_new().
405 
406  The API calls allow to use any file object as data source. Consider to feed
407  an eventual custom data stream asynchronously into a pipe(2) and to let
408  libburn handle the rest.
409  In this case the following rule applies:
410  Call burn_source_free() exactly once for every source obtained from
411  libburn API. You MUST NOT otherwise use or manipulate its components.
412 
413  In general, burn_source objects can be freed as soon as they are attached
414  to track objects. The track objects will keep them alive and dispose them
415  when they are no longer needed. With a fifo burn_source it makes sense to
416  keep the own reference for inquiring its state while burning is in
417  progress.
418 
419  ---
420 
421  The following description of burn_source applies only to application
422  implemented burn_source objects. You need not to know it for API provided
423  ones.
424 
425  If you really implement an own passive data producer by this interface,
426  then beware: it can do anything and it can spoil everything.
427 
428  In this case the functions (*read), (*get_size), (*set_size), (*free_data)
429  MUST be implemented by the application and attached to the object at
430  creation time.
431  Function (*read_sub) is allowed to be NULL or it MUST be implemented and
432  attached.
433 
434  burn_source.refcount MUST be handled properly: If not exactly as many
435  references are freed as have been obtained, then either memory leaks or
436  corrupted memory are the consequence.
437  All objects which are referred to by *data must be kept existent until
438  (*free_data) is called via burn_source_free() by the last referer.
439 */
440 struct burn_source {
441 
442  /** Reference count for the data source. MUST be 1 when a new source
443  is created and thus the first reference is handed out. Increment
444  it to take more references for yourself. Use burn_source_free()
445  to destroy your references to it. */
446  int refcount;
447 
448 
449  /** Read data from the source. Semantics like with read(2), but MUST
450  either deliver the full buffer as defined by size or MUST deliver
451  EOF (return 0) or failure (return -1) at this call or at the
452  next following call. I.e. the only incomplete buffer may be the
453  last one from that source.
454  libburn will read a single sector by each call to (*read).
455  The size of a sector depends on BURN_MODE_*. The known range is
456  2048 to 2352.
457 
458  If this call is reading from a pipe then it will learn
459  about the end of data only when that pipe gets closed on the
460  feeder side. So if the track size is not fixed or if the pipe
461  delivers less than the predicted amount or if the size is not
462  block aligned, then burning will halt until the input process
463  closes the pipe.
464 
465  IMPORTANT:
466  If this function pointer is NULL, then the struct burn_source is of
467  version >= 1 and the job of .(*read)() is done by .(*read_xt)().
468  See below, member .version.
469  */
470  int (*read)(struct burn_source *, unsigned char *buffer, int size);
471 
472 
473  /** Read subchannel data from the source (NULL if lib generated)
474  WARNING: This is an obscure feature with CD raw write modes.
475  Unless you checked the libburn code for correctness in that aspect
476  you should not rely on raw writing with own subchannels.
477  ADVICE: Set this pointer to NULL.
478  */
479  int (*read_sub)(struct burn_source *, unsigned char *buffer, int size);
480 
481 
482  /** Get the size of the source's data. Return 0 means unpredictable
483  size. If application provided (*get_size) allows return 0, then
484  the application MUST provide a fully functional (*set_size).
485  */
486  off_t (*get_size)(struct burn_source *);
487 
488 
489  /* ts A70125 : BROKE BINARY BACKWARD COMPATIBILITY AT libburn-0.3.1. */
490  /* @since 0.3.2 */
491  /** Program the reply of (*get_size) to a fixed value. It is advised
492  to implement this by a attribute off_t fixed_size; in *data .
493  The read() function does not have to take into respect this fake
494  setting. It is rather a note of libburn to itself. Eventually
495  necessary truncation or padding is done in libburn. Truncation
496  is usually considered a misburn. Padding is considered ok.
497 
498  libburn is supposed to work even if (*get_size) ignores the
499  setting by (*set_size). But your application will not be able to
500  enforce fixed track sizes by burn_track_set_size() and possibly
501  even padding might be left out.
502  */
503  int (*set_size)(struct burn_source *source, off_t size);
504 
505 
506  /** Clean up the source specific data. This function will be called
507  once by burn_source_free() when the last referer disposes the
508  source.
509  */
510  void (*free_data)(struct burn_source *);
511 
512 
513  /** Next source, for when a source runs dry and padding is disabled
514  WARNING: This is an obscure feature. Set to NULL at creation and
515  from then on leave untouched and uninterpreted.
516  */
517  struct burn_source *next;
518 
519 
520  /** Source specific data. Here the various source classes express their
521  specific properties and the instance objects store their individual
522  management data.
523  E.g. data could point to a struct like this:
524  struct app_burn_source
525  {
526  struct my_app *app_handle;
527  ... other individual source parameters ...
528  off_t fixed_size;
529  };
530 
531  Function (*free_data) has to be prepared to clean up and free
532  the struct.
533  */
534  void *data;
535 
536 
537  /* ts A71222 : Supposed to be binary backwards compatible extension. */
538  /* @since 0.4.2 */
539  /** Valid only if above member .(*read)() is NULL. This indicates a
540  version of struct burn_source younger than 0.
541  From then on, member .version tells which further members exist
542  in the memory layout of struct burn_source. libburn will only touch
543  those announced extensions.
544 
545  Versions:
546  0 has .(*read)() != NULL, not even .version is present.
547  1 has .version, .(*read_xt)(), .(*cancel)()
548  */
549  int version;
550 
551  /** This substitutes for (*read)() in versions above 0. */
552  int (*read_xt)(struct burn_source *, unsigned char *buffer, int size);
553 
554  /** Informs the burn_source that the consumer of data prematurely
555  ended reading. This call may or may not be issued by libburn
556  before (*free_data)() is called.
557  */
558  int (*cancel)(struct burn_source *source);
559 };
560 
561 
562 /** Information on a drive in the system */
564 {
565  /** Name of the vendor of the drive */
566  char vendor[9];
567  /** Name of the drive */
568  char product[17];
569  /** Revision of the drive */
570  char revision[5];
571 
572  /** Invalid: Was: "Location of the drive in the filesystem." */
573  /** This string has no meaning any more. Once it stored the drive
574  device file address. Now always use function burn_drive_d_get_adr()
575  to inquire a device file address. ^^^^^ ALWAYS ^^^^^^^*/
576  char location[17];
577 
578  /** Can the drive read DVD-RAM discs */
579  unsigned int read_dvdram:1;
580  /** Can the drive read DVD-R discs */
581  unsigned int read_dvdr:1;
582  /** Can the drive read DVD-ROM discs */
583  unsigned int read_dvdrom:1;
584  /** Can the drive read CD-R discs */
585  unsigned int read_cdr:1;
586  /** Can the drive read CD-RW discs */
587  unsigned int read_cdrw:1;
588 
589  /** Can the drive write DVD-RAM discs */
590  unsigned int write_dvdram:1;
591  /** Can the drive write DVD-R discs */
592  unsigned int write_dvdr:1;
593  /** Can the drive write CD-R discs */
594  unsigned int write_cdr:1;
595  /** Can the drive write CD-RW discs */
596  unsigned int write_cdrw:1;
597 
598  /** Can the drive simulate a write */
599  unsigned int write_simulate:1;
600 
601  /** Can the drive report C2 errors */
602  unsigned int c2_errors:1;
603 
604  /** The size of the drive's buffer (in kilobytes) */
606  /**
607  * The supported block types in tao mode.
608  * They should be tested with the desired block type.
609  * See also burn_block_types.
610  */
612  /**
613  * The supported block types in sao mode.
614  * They should be tested with the desired block type.
615  * See also burn_block_types.
616  */
618  /**
619  * The supported block types in raw mode.
620  * They should be tested with the desired block type.
621  * See also burn_block_types.
622  */
624  /**
625  * The supported block types in packet mode.
626  * They should be tested with the desired block type.
627  * See also burn_block_types.
628  */
630 
631  /** The value by which this drive can be indexed when using functions
632  in the library. This is the value to pass to all libbburn functions
633  that operate on a drive. */
634  struct burn_drive *drive;
635 };
636 
637 
638 /** Operation progress report. All values are 0 based indices.
639  * */
641  /** The total number of sessions */
642  int sessions;
643  /** Current session.*/
644  int session;
645  /** The total number of tracks */
646  int tracks;
647  /** Current track. */
648  int track;
649  /** The total number of indices */
650  int indices;
651  /** Curent index. */
652  int index;
653  /** The starting logical block address */
655  /** On write: The number of sectors.
656  On blank: 0x10000 as upper limit for relative progress steps */
657  int sectors;
658  /** On write: The current sector being processed.
659  On blank: Relative progress steps 0 to 0x10000 */
660  int sector;
661 
662  /* ts A61023 */
663  /* @since 0.2.6 */
664  /** The capacity of the drive buffer */
665  unsigned buffer_capacity;
666  /** The free space in the drive buffer (might be slightly outdated) */
668 
669  /* ts A61119 */
670  /* @since 0.2.6 */
671  /** The number of bytes sent to the drive buffer */
673  /** The minimum number of bytes stored in buffer during write.
674  (Caution: Before surely one buffer size of bytes was processed,
675  this value is 0xffffffff.)
676  */
677  unsigned buffer_min_fill;
678 };
679 
680 
681 /* ts A61226 */
682 /* @since 0.3.0 */
683 /** Description of a speed capability as reported by the drive in conjunction
684  with eventually loaded media. There can be more than one such object per
685  drive. So they are chained via .next and .prev , where NULL marks the end
686  of the chain. This list is set up by burn_drive_scan() and gets updated
687  by burn_drive_grab().
688  A copy may be obtained by burn_drive_get_speedlist() and disposed by
689  burn_drive_free_speedlist().
690  For technical background info see SCSI specs MMC and SPC:
691  mode page 2Ah (from SPC 5Ah MODE SENSE) , mmc3r10g.pdf , 6.3.11 Table 364
692  ACh GET PERFORMANCE, Type 03h , mmc5r03c.pdf , 6.8.5.3 Table 312
693 */
695 
696  /** Where this info comes from :
697  0 = misc , 1 = mode page 2Ah , 2 = ACh GET PERFORMANCE */
698  int source;
699 
700  /** The media type that was current at the time of report
701  -2 = state unknown, -1 = no media was loaded , else see
702  burn_disc_get_profile() */
704  char profile_name[80];
705 
706  /** The attributed capacity of appropriate media in logical block units
707  i.e. 2352 raw bytes or 2048 data bytes. -1 = capacity unknown. */
708  int end_lba;
709 
710  /** Speed is given in 1000 bytes/s , 0 = invalid. The numbers
711  are supposed to be usable with burn_drive_set_speed() */
714 
715  /** Expert info from ACh GET PERFORMANCE and/or mode page 2Ah.
716  Expect values other than 0 or 1 to get a meaning in future.*/
717  /* Rotational control: 0 = CLV/default , 1 = CAV */
718  int wrc;
719  /* 1 = drive promises reported performance over full media */
720  int exact;
721  /* 1 = suitable for mixture of read and write */
722  int mrw;
723 
724  /** List chaining. Use .next until NULL to iterate over the list */
727 };
728 
729 
730 /** Initialize the library.
731  This must be called before using any other functions in the library. It
732  may be called more than once with no effect.
733  It is possible to 'restart' the library by shutting it down and
734  re-initializing it. Once this was necessary if you follow the older and
735  more general way of accessing a drive via burn_drive_scan() and
736  burn_drive_grab(). See burn_drive_scan_and_grab() with its strong
737  urges and its explanations.
738  @return Nonzero if the library was able to initialize; zero if
739  initialization failed.
740 */
741 int burn_initialize(void);
742 
743 /** Shutdown the library.
744  This should be called before exiting your application. Make sure that all
745  drives you have grabbed are released <i>before</i> calling this.
746 */
747 void burn_finish(void);
748 
749 
750 /* ts A61002 */
751 /** Abort any running drive operation and eventually call burn_finish().
752 
753  You MUST shut down the busy drives if an aborting event occurs during a
754  burn run. For that you may call this function either from your own signal
755  handling code or indirectly by activating the built-in signal handling:
756  burn_set_signal_handling("my_app_name : ", NULL, 0);
757  Else you may eventually call burn_drive_cancel() on the active drives and
758  wait for them to assume state BURN_DRIVE_IDLE.
759  @param patience Maximum number of seconds to wait for drives to
760  finish.
761  @since 0.7.8 :
762  If this is -1, then only the cancel operations will
763  be performed and no burn_finish() will happen.
764  @param pacifier_func If not NULL: a function to produce appeasing messages.
765  See burn_abort_pacifier() for an example.
766  @param handle Opaque handle to be used with pacifier_func
767  @return 1 ok, all went well
768  0 had to leave a drive in unclean state
769  <0 severe error, do no use libburn again
770  @since 0.2.6
771 */
772 int burn_abort(int patience,
773  int (*pacifier_func)(void *handle, int patience, int elapsed),
774  void *handle);
775 
776 /** A pacifier function suitable for burn_abort.
777  @param handle If not NULL, a pointer to a text suitable for printf("%s")
778  @param patience Maximum number of seconds to wait
779  @param elapsed Elapsed number of seconds
780 */
781 int burn_abort_pacifier(void *handle, int patience, int elapsed);
782 
783 
784 /** ts A61006 : This is for development only. Not suitable for applications.
785  Set the verbosity level of the library. The default value is 0, which means
786  that nothing is output on stderr. The more you increase this, the more
787  debug output should be displayed on stderr for you.
788  @param level The verbosity level desired. 0 for nothing, higher positive
789  values for more information output.
790 */
791 void burn_set_verbosity(int level);
792 
793 /* ts A91111 */
794 /** Enable resp. disable logging of SCSI commands.
795  This call can be made at any time - even before burn_initialize().
796  It is in effect for all active drives and currently not very thread
797  safe for multiple drives.
798  @param flag Bitfield for control purposes. The default is 0.
799  bit0= log to file /tmp/libburn_sg_command_log
800  bit1= log to stderr
801  bit2= flush output after each line
802  @since 0.7.4
803 */
804 void burn_set_scsi_logging(int flag);
805 
806 /* ts A60813 */
807 /** Set parameters for behavior on opening device files. To be called early
808  after burn_initialize() and before any bus scan. But not mandatory at all.
809  Parameter value 1 enables a feature, 0 disables.
810  Default is (1,0,0). Have a good reason before you change it.
811  @param exclusive
812  0 = no attempt to make drive access exclusive.
813  1 = Try to open only devices which are not marked as busy
814  and try to mark them busy if opened sucessfully. (O_EXCL
815  on GNU/Linux , flock(LOCK_EX) on FreeBSD.)
816  2 = in case of a SCSI device, also try to open exclusively
817  the matching /dev/sr, /dev/scd and /dev/st .
818  One may select a device SCSI file family by adding
819  0 = default family
820  4 = /dev/sr%d
821  8 = /dev/scd%d
822  16 = /dev/sg%d
823  Do not use other values !
824  Add 32 to demand on GNU/Linux an exclusive lock by
825  fcntl(,F_SETLK,) after open() has succeeded.
826  @param blocking Try to wait for drives which do not open immediately but
827  also do not return an error as well. (O_NONBLOCK)
828  This might stall indefinitely with /dev/hdX hard disks.
829  @param abort_on_busy Unconditionally abort process when a non blocking
830  exclusive opening attempt indicates a busy drive.
831  Use this only after thorough tests with your app.
832  @since 0.2.2
833 */
834 void burn_preset_device_open(int exclusive, int blocking, int abort_on_busy);
835 
836 
837 /* ts A70223 */
838 /** Allows the use of media types which are implemented in libburn but not yet
839  tested. The list of those untested profiles is subject to change.
840  - Currently no media types are under test reservation -
841  If you really test such media, then please report the outcome on
842  libburn-hackers@pykix.org
843  If ever then this call should be done soon after burn_initialize() before
844  any drive scanning.
845  @param yes 1=allow all implemented profiles, 0=only tested media (default)
846  @since 0.3.4
847 */
848 void burn_allow_untested_profiles(int yes);
849 
850 
851 /* ts A60823 */
852 /** Aquire a drive with known device file address.
853 
854  This is the sysadmin friendly way to open one drive and to leave all
855  others untouched. It bundles the following API calls to form a
856  non-obtrusive way to use libburn:
857  burn_drive_add_whitelist() , burn_drive_scan() , burn_drive_grab()
858  You are *strongly urged* to use this call whenever you know the drive
859  address in advance.
860 
861  If not, then you have to use directly above calls. In that case, you are
862  *strongly urged* to drop any unintended drive which will be exclusively
863  occupied and not closed by burn_drive_scan().
864  This can be done by shutting down the library including a call to
865  burn_finish(). You may later start a new libburn session and should then
866  use the function described here with an address obtained after
867  burn_drive_scan() via burn_drive_d_get_adr(drive_infos[driveno].drive,adr).
868  Another way is to drop the unwanted drives by burn_drive_info_forget().
869 
870  Operating on multiple drives:
871 
872  Different than with burn_drive_scan() it is allowed to call
873  burn_drive_scan_and_grab() without giving up any other scanned drives. So
874  this call can be used to get a collection of more than one aquired drives.
875  The attempt to aquire the same drive twice will fail, though.
876 
877  Pseudo-drives:
878 
879  burn_drive_scan_and_grab() is able to aquire virtual drives which will
880  accept options much like a MMC burner drive. Many of those options will not
881  cause any effect, though. The address of a pseudo-drive begins with
882  prefix "stdio:" followed by a path.
883  Examples: "stdio:/tmp/pseudo_drive" , "stdio:/dev/null" , "stdio:-"
884 
885  If the path is empty, the result is a null-drive = drive role 0.
886  It pretends to have loaded no media and supports no reading or writing.
887 
888  If the path leads to an existing regular file, or to a not yet existing
889  file, or to an existing block device, then the result is a random access
890  stdio-drive capable of reading and writing = drive role 2.
891 
892  If the path leads to an existing file of any type other than directory,
893  then the result is a sequential write-only stdio-drive = drive role 3.
894 
895  The special address form "stdio:/dev/fd/{number}" is interpreted literally
896  as reference to open file descriptor {number}. This address form coincides
897  with real files on some systems, but it is in fact hardcoded in libburn.
898  Special address "stdio:-" means stdout = "stdio:/dev/fd/1".
899  The role of such a drive is determined by the file type obtained via
900  fstat({number}).
901 
902  Roles 2 and 3 perform all their eventual data transfer activities on a file
903  via standard i/o functions open(2), lseek(2), read(2), write(2), close(2).
904  The media profile is reported as 0xffff. Write space information from those
905  media is not necessarily realistic.
906 
907  The capabilities of role 2 resemble DVD-RAM but it can simulate writing.
908  If the path does not exist in the filesystem yet, it is attempted to create
909  it as a regular file as soon as write operations are started.
910 
911  The capabilities of role 3 resemble a blank DVD-R. Nevertheless each
912  burn_disc_write() run may only write a single track.
913 
914  One may distinguish pseudo-drives from MMC drives by call
915  burn_drive_get_drive_role().
916 
917  @param drive_infos On success returns a one element array with the drive
918  (cdrom/burner). Thus use with driveno 0 only. On failure
919  the array has no valid elements at all.
920  The returned array should be freed via burn_drive_info_free()
921  when it is no longer needed.
922  This is a result from call burn_drive_scan(). See there.
923  Use with driveno 0 only.
924  @param adr The device file address of the desired drive. Either once
925  obtained by burn_drive_d_get_adr() or composed skillfully by
926  application resp. its user. E.g. "/dev/sr0".
927  Consider to preprocess it by burn_drive_convert_fs_adr().
928  @param load Nonzero to make the drive attempt to load a disc (close its
929  tray door, etc).
930  @return 1 = success , 0 = drive not found , -1 = other error
931  @since 0.2.2
932 */
933 int burn_drive_scan_and_grab(struct burn_drive_info *drive_infos[],
934  char* adr, int load);
935 
936 
937 /* ts A51221 */
938 /* @since 0.2.2 */
939 /** Maximum number of particularly permissible drive addresses */
940 #define BURN_DRIVE_WHITELIST_LEN 255
941 
942 /** Add a device to the list of permissible drives. As soon as some entry is in
943  the whitelist all non-listed drives are banned from scanning.
944  @return 1 success, <=0 failure
945  @since 0.2.2
946 */
947 int burn_drive_add_whitelist(char *device_address);
948 
949 /** Remove all drives from whitelist. This enables all possible drives. */
950 void burn_drive_clear_whitelist(void);
951 
952 
953 /** Scan for drives. This function MUST be called until it returns nonzero.
954  In case of re-scanning:
955  All pointers to struct burn_drive and all struct burn_drive_info arrays
956  are invalidated by using this function. Do NOT store drive pointers across
957  calls to this function !
958  To avoid invalid pointers one MUST free all burn_drive_info arrays
959  by burn_drive_info_free() before calling burn_drive_scan() a second time.
960  If there are drives left, then burn_drive_scan() will refuse to work.
961 
962  After this call all drives depicted by the returned array are subject
963  to eventual (O_EXCL) locking. See burn_preset_device_open(). This state
964  ends either with burn_drive_info_forget() or with burn_drive_release().
965  It is unfriendly to other processes on the system to hold drives locked
966  which one does not definitely plan to use soon.
967  @param drive_infos Returns an array of drive info items (cdroms/burners).
968  The returned array must be freed by burn_drive_info_free()
969  before burn_finish(), and also before calling this function
970  burn_drive_scan() again.
971  @param n_drives Returns the number of drive items in drive_infos.
972  @return 0 while scanning is not complete
973  >0 when it is finished sucessfully,
974  <0 when finished but failed.
975 */
976 int burn_drive_scan(struct burn_drive_info *drive_infos[],
977  unsigned int *n_drives);
978 
979 /* ts A60904 : ticket 62, contribution by elmom */
980 /** Release memory about a single drive and any exclusive lock on it.
981  Become unable to inquire or grab it. Expect FATAL consequences if you try.
982  @param drive_info pointer to a single element out of the array
983  obtained from burn_drive_scan() : &(drive_infos[driveno])
984  @param force controls degree of permissible drive usage at the moment this
985  function is called, and the amount of automatically provided
986  drive shutdown :
987  0= drive must be ungrabbed and BURN_DRIVE_IDLE
988  1= try to release drive resp. accept BURN_DRIVE_GRABBING
989  Use these two only. Further values are to be defined.
990  @return 1 on success, 2 if drive was already forgotten,
991  0 if not permissible, <0 on other failures,
992  @since 0.2.2
993 */
994 int burn_drive_info_forget(struct burn_drive_info *drive_info, int force);
995 
996 
997 /** When no longer needed, free a whole burn_drive_info array which was
998  returned by burn_drive_scan().
999  For freeing single drive array elements use burn_drive_info_forget().
1000 */
1001 void burn_drive_info_free(struct burn_drive_info drive_infos[]);
1002 
1003 
1004 /* ts A60823 */
1005 /* @since 0.2.2 */
1006 /** Maximum length+1 to expect with a drive device file address string */
1007 #define BURN_DRIVE_ADR_LEN 1024
1008 
1009 /* ts A70906 */
1010 /** Inquire the device file address of the given drive.
1011  @param drive The drive to inquire.
1012  @param adr An application provided array of at least BURN_DRIVE_ADR_LEN
1013  characters size. The device file address gets copied to it.
1014  @return >0 success , <=0 error (due to libburn internal problem)
1015  @since 0.4.0
1016 */
1017 int burn_drive_d_get_adr(struct burn_drive *drive, char adr[]);
1018 
1019 /* A60823 */
1020 /** Inquire the device file address of a drive via a given drive_info object.
1021  (Note: This is a legacy call.)
1022  @param drive_info The drive to inquire.Usually some &(drive_infos[driveno])
1023  @param adr An application provided array of at least BURN_DRIVE_ADR_LEN
1024  characters size. The device file address gets copied to it.
1025  @return >0 success , <=0 error (due to libburn internal problem)
1026  @since 0.2.6
1027 */
1028 int burn_drive_get_adr(struct burn_drive_info *drive_info, char adr[]);
1029 
1030 
1031 /* ts A60922 ticket 33 */
1032 /** Evaluate whether the given address would be a drive device file address
1033  which could be listed by a run of burn_drive_scan(). No check is made
1034  whether a device file with this address exists or whether it leads
1035  to a usable MMC drive.
1036  @return 1 means yes, 0 means no
1037  @since 0.2.6
1038 */
1039 int burn_drive_is_enumerable_adr(char *adr);
1040 
1041 /* ts A60922 ticket 33 */
1042 /** Try to convert a given existing filesystem address into a drive device file
1043  address. This succeeds with symbolic links or if a hint about the drive's
1044  system address can be read from the filesystem object and a matching drive
1045  is found.
1046  @param path The address of an existing file system object
1047  @param adr An application provided array of at least BURN_DRIVE_ADR_LEN
1048  characters size. The device file address gets copied to it.
1049  @return 1 = success , 0 = failure , -1 = severe error
1050  @since 0.2.6
1051 */
1052 int burn_drive_convert_fs_adr(char *path, char adr[]);
1053 
1054 /* ts A60923 */
1055 /** Try to convert a given SCSI address of bus,host,channel,target,lun into
1056  a drive device file address. If a SCSI address component parameter is < 0
1057  then it is not decisive and the first enumerated address which matches
1058  the >= 0 parameters is taken as result.
1059  Note: bus and (host,channel) are supposed to be redundant.
1060  @param bus_no "Bus Number" (something like a virtual controller)
1061  @param host_no "Host Number" (something like half a virtual controller)
1062  @param channel_no "Channel Number" (other half of "Host Number")
1063  @param target_no "Target Number" or "SCSI Id" (a device)
1064  @param lun_no "Logical Unit Number" (a sub device)
1065  @param adr An application provided array of at least BURN_DRIVE_ADR_LEN
1066  characters size. The device file address gets copied to it.
1067  @return 1 = success , 0 = failure , -1 = severe error
1068  @since 0.2.6
1069 */
1070 int burn_drive_convert_scsi_adr(int bus_no, int host_no, int channel_no,
1071  int target_no, int lun_no, char adr[]);
1072 
1073 /* ts B10728 */
1074 /** Try to convert a given drive device file address into the address of a
1075  symbolic link that points to this drive address.
1076  Modern GNU/Linux systems may shuffle drive addresses from boot to boot.
1077  The udev daemon is supposed to create links which always point to the
1078  same drive, regardless of its system address.
1079  This call tries to find such links.
1080  @param dev_adr Should contain a drive address as returned by
1081  burn_drive_scan().
1082  @param link_adr An application provided array of at least
1083  BURN_DRIVE_ADR_LEN characters size. The found link
1084  address gets copied to it.
1085  @param dir_adr The address of the directory where to look for links.
1086  Normally: "/dev"
1087  @param templ An array of pointers to name templates, which
1088  links have to match. A symbolic link in dir_adr matches
1089  a name template if it begins by that text. E.g.
1090  link address "/dev/dvdrw1" matches template "dvdrw".
1091  If templ is NULL, then the default array gets used:
1092  {"dvdrw", "cdrw", "dvd", "cdrom", "cd"}
1093  If several links would match, then a link will win,
1094  which matches the template with the lowest array index.
1095  Among these candidates, the one with the lowest strcmp()
1096  rank will be chosen as link_adr.
1097  @param num_templ Number of array elements in templ.
1098  @param flag Bitfield for control purposes. Unused yet. Submit 0.
1099  @return <0 severe error, 0 failed to search, 2 nothing found
1100  1 success, link_adr is valid
1101  @since 1.1.4
1102 */
1103 int burn_lookup_device_link(char *dev_adr, char link_adr[],
1104  char *dir_adr, char **templ, int num_templ, int flag);
1105 
1106 /* ts A60923 - A61005 */
1107 /** Try to obtain bus,host,channel,target,lun from path. If there is an SCSI
1108  address at all, then this call should succeed with a drive device file
1109  address obtained via burn_drive_d_get_adr(). It is also supposed to
1110  succeed with any device file of a (possibly emulated) SCSI device.
1111  @return 1 = success , 0 = failure , -1 = severe error
1112  @since 0.2.6
1113 */
1114 int burn_drive_obtain_scsi_adr(char *path, int *bus_no, int *host_no,
1115  int *channel_no, int *target_no, int *lun_no);
1116 
1117 /** Grab a drive. This must be done before the drive can be used (for reading,
1118  writing, etc).
1119  @param drive The drive to grab. This is found in a returned
1120  burn_drive_info struct.
1121  @param load Nonzero to make the drive attempt to load a disc (close its
1122  tray door, etc).
1123  @return 1 if it was possible to grab the drive, else 0
1124 */
1125 int burn_drive_grab(struct burn_drive *drive, int load);
1126 
1127 /* ts B00114 */
1128 /* Probe available CD write modes and block types. In earlier versions this
1129  was done unconditionally on drive examination or aquiration. But it is
1130  lengthy and obtrusive, up to spoiling burn runs on the examined drives.
1131  So now this probing is omitted by default. All drives which announce to be
1132  capable of CD or DVD writing, get blindly attributed the capability for
1133  SAO and TAO. Applications which are interested in RAW modes or want to
1134  rely on the traditional write mode information, may use this call.
1135  @param drive_info drive object to be inquired
1136  @return >0 indicates success, <=0 means failure
1137  @since 0.7.6
1138 */
1139 int burn_drive_probe_cd_write_modes(struct burn_drive_info *drive_info);
1140 
1141 /* ts A90824 */
1142 /** Calm down or alert a drive. Some drives stay alert after reading for
1143  quite some time. This saves time with the startup for the next read
1144  operation but also causes noise and consumes extra energy. It makes
1145  sense to calm down the drive if no read operation is expected for the
1146  next few seconds. The drive will get alert automatically if operations
1147  are required.
1148  @param d The drive to influence.
1149  @param flag Bitfield for control purposes
1150  bit0= become alert (else start snoozing)
1151  This is not mandatory to allow further drive operations
1152  @return 1= success , 0= drive role not suitable for calming
1153  @since 0.7.0
1154 */
1155 int burn_drive_snooze(struct burn_drive *d, int flag);
1156 
1157 
1158 /** Re-assess drive and media status. This should be done after a drive
1159  underwent a status change and shall be further used without intermediate
1160  burn_drive_release(), burn_drive_grab(). E.g. after blanking or burning.
1161  @param drive The already grabbed drive to re-assess.
1162  @param flag Unused yet. Submit 0.
1163  @return 1 success , <= 0 could not determine drive and media state
1164  @since 1.1.8
1165 */
1166 int burn_drive_re_assess(struct burn_drive *d, int flag);
1167 
1168 
1169 /** Release a drive. This should not be done until the drive is no longer
1170  busy (see burn_drive_get_status).
1171  @param drive The drive to release.
1172  @param eject Nonzero to make the drive eject the disc in it.
1173 */
1174 void burn_drive_release(struct burn_drive *drive, int eject);
1175 
1176 
1177 /* ts A70918 */
1178 /** Like burn_drive_release() but keeping the drive tray closed and its
1179  eject button disabled. This physically locked drive state will last until
1180  the drive is grabbed again and released via burn_drive_release().
1181  Programs like eject, cdrecord, growisofs will break that ban too.
1182  @param d The drive to release and leave locked.
1183  @param flag Bitfield for control purposes (unused yet, submit 0)
1184  @return 1 means success, <=0 means failure
1185  @since 0.4.0
1186 */
1187 int burn_drive_leave_locked(struct burn_drive *d, int flag);
1188 
1189 
1190 /** Returns what kind of disc a drive is holding. This function may need to be
1191  called more than once to get a proper status from it. See burn_disc_status
1192  for details.
1193  @param drive The drive to query for a disc.
1194  @return The status of the drive, or what kind of disc is in it.
1195  Note: BURN_DISC_UNGRABBED indicates wrong API usage
1196 */
1197 enum burn_disc_status burn_disc_get_status(struct burn_drive *drive);
1198 
1199 
1200 /* ts A61020 */
1201 /** WARNING: This revives an old bug-like behavior that might be dangerous.
1202  Sets the drive status to BURN_DISC_BLANK if it is BURN_DISC_UNREADY
1203  or BURN_DISC_UNSUITABLE. Thus marking media as writable which actually
1204  failed to declare themselves either blank or (partially) filled.
1205  @return 1 drive status has been set , 0 = unsuitable drive status
1206  @since 0.2.6
1207 */
1208 int burn_disc_pretend_blank(struct burn_drive *drive);
1209 
1210 
1211 /* ts A61106 */
1212 /** WARNING: This overrides the safety measures against unsuitable media.
1213  Sets the drive status to BURN_DISC_FULL if it is BURN_DISC_UNREADY
1214  or BURN_DISC_UNSUITABLE. Thus marking media as blankable which actually
1215  failed to declare themselves either blank or (partially) filled.
1216  @since 0.2.6
1217 */
1218 int burn_disc_pretend_full(struct burn_drive *drive);
1219 
1220 
1221 /* ts A61021 */
1222 /** Reads ATIP information from inserted media. To be obtained via
1223  burn_drive_get_write_speed(), burn_drive_get_min_write_speed(),
1224  burn_drive_get_start_end_lba(). The drive must be grabbed for this call.
1225  @param drive The drive to query.
1226  @return 1=sucess, 0=no valid ATIP info read, -1 severe error
1227  @since 0.2.6
1228 */
1229 int burn_disc_read_atip(struct burn_drive *drive);
1230 
1231 
1232 /* ts A61020 */
1233 /** Returns start and end lba of the media which is currently inserted
1234  in the given drive. The drive has to be grabbed to have hope for reply.
1235  Shortcomming (not a feature): unless burn_disc_read_atip() was called
1236  only blank media will return valid info.
1237  @param drive The drive to query.
1238  @param start_lba Returns the start lba value
1239  @param end_lba Returns the end lba value
1240  @param flag Bitfield for control purposes (unused yet, submit 0)
1241  @return 1 if lba values are valid , 0 if invalid
1242  @since 0.2.6
1243 */
1244 int burn_drive_get_start_end_lba(struct burn_drive *drive,
1245  int *start_lba, int *end_lba, int flag);
1246 
1247 
1248 /* ts A90902 */
1249 /** Guess the manufacturer name of CD media from the ATIP addresses of lead-in
1250  and lead-out. (Currently only lead-in is interpreted. Lead-out may in
1251  future be used to identify the media type in more detail.)
1252  The parameters of this call should be obtained by burn_disc_read_atip(d),
1253  burn_drive_get_start_end_lba(d, &start_lba, &end_lba, 0),
1254  burn_lba_to_msf(start_lba, &m_li, &s_li, &f_li) and
1255  burn_lba_to_msf(end_lba, &m_lo, &s_lo, &f_lo).
1256  @param m_li "minute" part of ATIP lead-in resp. start_lba
1257  @param s_li "second" of lead-in resp. start_lba
1258  @param f_li "frame" of lead-in
1259  @param m_lo "minute" part of ATIP lead-out
1260  @param s_lo "second" of lead-out
1261  @param f_lo "frame" of lead-out
1262  @param flag Bitfield for control purposes,
1263  bit0= append a text "(aka ...)" to reply if other brands or
1264  vendor names are known.
1265  @return Printable text or NULL on memory shortage.
1266  Dispose by free() when no longer needed.
1267  @since 0.7.2
1268 */
1269 char *burn_guess_cd_manufacturer(int m_li, int s_li, int f_li,
1270  int m_lo, int s_lo, int f_lo, int flag);
1271 
1272 /* ts A90909 */
1273 /** Retrieve some media information which is mainly specific to CD. For other
1274  media only the bits in reply parameter valid are supposed to be meaningful.
1275  @param d The drive to query.
1276  @param disc_type A string saying either "CD-DA or CD-ROM", or "CD-I",
1277  or ""CD-ROM XA", or "undefined".
1278  @param disc_id A 32 bit number read from the media. (Meaning unclear yet)
1279  @param bar_code 8 hex digits from a barcode on media read by the drive
1280  (if the drive has a bar code reader built in).
1281  @param app_code The Host Application Code which must be set in the Write
1282  Parameters Page if the media is not unrestricted (URU==0).
1283  @param valid Replies bits which indicate the validity of other reply
1284  parameters or the state of certain CD info bits:
1285  bit0= disc_type is valid
1286  bit1= disc_id is valid
1287  bit2= bar_code is valid
1288  bit3= disc_app_code is valid
1289  bit4= Disc is unrestricted (URU bit, 51h READ DISC INFO)
1290  This seems to be broken with my drives. The bit is
1291  0 and the validity bit for disc_app_code is 0 too.
1292  bit5= Disc is nominally erasable (Erasable bit)
1293  This will be set with overwriteable media which
1294  libburn normally considers to be unerasable blank.
1295  @return 1 success, <= 0 an error occured
1296  @since 0.7.2
1297 */
1298 int burn_disc_get_cd_info(struct burn_drive *d, char disc_type[80],
1299  unsigned int *disc_id, char bar_code[9], int *app_code,
1300  int *valid);
1301 
1302 /* ts B11201 */
1303 /** Read the array of CD-TEXT packs from the Lead-in of an audio CD.
1304  Each pack consists of 18 bytes, of which 4 are header. 12 bytes are pieces
1305  of 0-terminated texts or binary data. 2 bytes hold a CRC.
1306  For a description of the format of the array, see file doc/cdtext.txt.
1307  @param d The drive to query.
1308  @param text_packs Will point to an allocated memory buffer with CD-TEXT.
1309  It will only contain text packs, and not be prepended
1310  by the TOC header of four bytes, which gets stored with
1311  file cdtext.dat by cdrecord -vv -toc. (The first two of
1312  these bytes are supposed to hold the number of CD-TEXT
1313  bytes + 2. The other two bytes are supposed to be 0.)
1314  Dispose this buffer by free(), when no longer needed.
1315  @param num_packs Will tell the number of text packs, i.e. the number of
1316  bytes in text_packs divided by 18.
1317  @param flag Bitfield for control purposes,
1318  Unused yet. Submit 0.
1319  @return 1 success, 0= no CD-TEXT found, < 0 an error occured
1320  @since 1.2.0
1321 */
1322 int burn_disc_get_leadin_text(struct burn_drive *d,
1323  unsigned char **text_packs, int *num_packs,
1324  int flag);
1325 
1326 /* ts B00924 */
1327 /** Read the current usage of the eventual BD Spare Area. This area gets
1328  reserved on BD media during formatting. During writing it is used to
1329  host replacements of blocks which failed the checkread immediately after
1330  writing.
1331  This call applies only to recordable BD media. I.e. profiles 0x41 to 0x43.
1332  @param d The drive to query.
1333  @param alloc_blocks Returns the number of blocks reserved as Spare Area
1334  @param free_blocks Returns the number of yet unused blocks in that area
1335  @param flag Bitfield for control purposes (unused yet, submit 0)
1336  @return 1 = reply prarameters are valid,
1337  <=0 = reply is invalid (e.g. because no BD profile)
1338  @since 0.8.8
1339 */
1340 int burn_disc_get_bd_spare_info(struct burn_drive *d,
1341  int *alloc_blocks, int *free_blocks, int flag);
1342 
1343 /* ts B10801 */
1344 /** Retrieve some media information which is mainly specific to media of
1345  the DVD-R family: DVD-R , DVD-RW , DVD-R DL , HD DVD-R
1346  Currently the information cannot be retrieved from other media types.
1347  @param d The drive to query.
1348  @param disk_category returns DVD Book to which the media complies
1349  @param book_name returns a pointer to the book name of disk_category.
1350  This memory is static. Do not alter or free it !
1351  @param part_version returns the Media Version in the DVD Book
1352  @param num_layers returns the number of media layers
1353  @param num_blocks returns the number of blocks between pysical start
1354  and physical end of the media
1355  @param flag Bitfield for control purposes (unused yet, submit 0)
1356  @return 1 = reply prarameters are valid,
1357  <=0 = reply is invalid (e.g. because no DVD-R)
1358  @since 1.1.4
1359 */
1360 int burn_disc_get_phys_format_info(struct burn_drive *d, int *disk_category,
1361  char **book_name, int *part_version, int *num_layers,
1362  int *num_blocks, int flag);
1363 
1364 /* ts A61110 */
1365 /** Read start lba and Next Writeable Address of a track from media.
1366  Usually a track lba is obtained from the result of burn_track_get_entry().
1367  This call retrieves an updated lba, eventual nwa, and can address the
1368  invisible track to come.
1369  The drive must be grabbed for this call. One may not issue this call
1370  during ongoing burn_disc_write() or burn_disc_erase().
1371  @param d The drive to query.
1372  @param o If not NULL: write parameters to be set on drive before query
1373  @param trackno 0=next track to come, >0 number of existing track
1374  The first existing track on a CD may have a number higher
1375  than 1. Use burn_session_get_start_tno() to inquire this
1376  start number.
1377  @param lba return value: start lba
1378  @param nwa return value: Next Writeable Address
1379  @return 1=nwa is valid , 0=nwa is not valid , -1=error
1380  @since 0.2.6
1381 */
1382 int burn_disc_track_lba_nwa(struct burn_drive *d, struct burn_write_opts *o,
1383  int trackno, int *lba, int *nwa);
1384 
1385 /* ts B10525 */
1386 /** Tells whether a previous attempt to determine the Next Writeable Address
1387  of the upcomming track reveiled that the READ TRACK INFORMATION Damage Bit
1388  is set for this track, resp. that no valid writable address is available.
1389  See MMC-5 6.27.3.7 Damage Bit, 6.27.3.11 NWA_V (NWA valid)
1390  @param d The drive to query.
1391  @param flag Bitfield for control purposes (unused yet, submit 0)
1392  @return 0= Looks ok: Damage Bit is not set, NWA_V is set
1393  1= Damaged and theoretically writable (NWA_V is set)
1394  2= Not writable: NWA_V is not set
1395  3= Damaged and not writable (NWA_V is not set),
1396  @since 1.1.0
1397 */
1398 int burn_disc_next_track_is_damaged(struct burn_drive *d, int flag);
1399 
1400 /* ts B10527 */
1401 /** Try to close the last track and session of media which have bit0 set in
1402  the return value of call burn_disc_next_track_is_damaged().
1403  Whether it helps depends much on the reason why the media is reported
1404  as damaged by the drive.
1405  This call works only for profiles 0x09 CD-R, 0x0a CD-RW, 0x11 DVD-R,
1406  0x14 DVD-RW sequential, 0x1b DVD+R, 0x2b DVD+R DL, 0x41 BD-R sequential.
1407  Note: After writing it is advised to give up the drive and to grab it again
1408  in order to learn about its view on the new media state.
1409  @param o Write options created by burn_write_opts_new() and
1410  manipulated by burn_write_opts_set_multi().
1411  burn_write_opts_set_write_type() should be set to
1412  BURN_WRITE_TAO, burn_write_opts_set_simulate() should be
1413  set to 0.
1414  @param flag Bitfield for control purposes
1415  bit0= force close, even if no damage was seen
1416  @return <=0 media not marked as damaged, or media type not suitable,
1417  or closing attempted but failed
1418  1= attempt finished without error indication
1419  @since 1.1.0
1420 */
1421 int burn_disc_close_damaged(struct burn_write_opts *o, int flag);
1422 
1423 
1424 /* ts A70131 */
1425 /** Read start lba of the first track in the last complete session.
1426  This is the first parameter of mkisofs option -C. The second parameter
1427  is nwa as obtained by burn_disc_track_lba_nwa() with trackno 0.
1428  @param d The drive to query.
1429  @param start_lba returns the start address of that track
1430  @return <= 0 : failure, 1 = ok
1431  @since 0.3.2
1432 */
1433 int burn_disc_get_msc1(struct burn_drive *d, int *start_lba);
1434 
1435 
1436 /* ts A70213 */
1437 /** Return the best possible estimation of the currently available capacity of
1438  the media. This might depend on particular write option settings. For
1439  inquiring the space with such a set of options, the drive has to be
1440  grabbed and BURN_DRIVE_IDLE. If not, then one will only get a canned value
1441  from the most recent automatic inquiry (e.g. during last drive grabbing).
1442  An eventual start address from burn_write_opts_set_start_byte() will be
1443  subtracted from the obtained capacity estimation. Negative results get
1444  defaulted to 0.
1445  If the drive is actually a file in a large filesystem or a large block
1446  device, then the capacity is curbed to a maximum of 0x7ffffff0 blocks
1447  = 4 TB - 32 KB.
1448  @param d The drive to query.
1449  @param o If not NULL: write parameters to be set on drive before query
1450  @return number of most probably available free bytes
1451  @since 0.3.4
1452 */
1453 off_t burn_disc_available_space(struct burn_drive *d,
1454  struct burn_write_opts *o);
1455 
1456 /* ts A61202 */
1457 /** Tells the MMC Profile identifier of the loaded media. The drive must be
1458  grabbed in order to get a non-zero result.
1459  libburn currently writes only to profiles
1460  0x09 "CD-R"
1461  0x0a "CD-RW"
1462  0x11 "DVD-R sequential recording"
1463  0x12 "DVD-RAM"
1464  0x13 "DVD-RW restricted overwrite"
1465  0x14 "DVD-RW sequential recording",
1466  0x15 "DVD-R/DL sequential recording",
1467  0x1a "DVD+RW"
1468  0x1b "DVD+R",
1469  0x2b "DVD+R/DL",
1470  0x41 "BD-R sequential recording",
1471  0x43 "BD-RE",
1472  0xffff "stdio file"
1473  Note: 0xffff is not a MMC profile but a libburn invention.
1474  Read-only are the profiles
1475  0x08 "CD-ROM",
1476  0x10 "DVD-ROM",
1477  0x40 "BD-ROM",
1478  Read-only for now is this BD-R profile (testers wanted)
1479  0x42 "BD-R random recording"
1480  Empty drives are supposed to report
1481  0x00 ""
1482  @param d The drive where the media is inserted.
1483  @param pno Profile Number. See also mmc5r03c.pdf, table 89
1484  @param name Profile Name (see above list, unknown profiles have empty name)
1485  @return 1 profile is valid, 0 no profile info available
1486  @since 0.3.0
1487 */
1488 int burn_disc_get_profile(struct burn_drive *d, int *pno, char name[80]);
1489 
1490 
1491 /* ts A90903 : API */
1492 /** Obtain product id and standards defined media codes.
1493  The product id is a printable string which is supposed to be the same
1494  for identical media but should vary with non-identical media. Some media
1495  do not allow to obtain such an id at all.
1496  The pair (profile_number, product_id) should be the best id to identify
1497  media with identical product specifications.
1498  The reply parameters media_code1 and media_code2 can be used with
1499  burn_guess_manufacturer()
1500  The reply parameters have to be disposed by free() when no longer needed.
1501  @param d The drive where the media is inserted.
1502  @param product_id Reply: Printable text depicting manufacturer and
1503  eventually media id.
1504  @param media_code1 Reply: The eventual manufacturer identification as read
1505  from DVD/BD media or a text "XXmYYsZZf" from CD media
1506  ATIP lead-in.
1507  @param media_code2 The eventual media id as read from DVD+/BD media or a
1508  text "XXmYYsZZf" from CD ATIP lead-out.
1509  @param book_type Book type text for DVD and BD.
1510  Caution: is NULL with CD, even if return value says ok.
1511  @param flag Bitfield for control purposes
1512  bit0= do not escape " _/" (not suitable for
1513  burn_guess_manufacturer())
1514  @return 1= ok, product_id and media codes are valid,
1515  0= no product id_available, reply parameters are NULL
1516  <0= error
1517  @since 0.7.2
1518 */
1519 int burn_disc_get_media_id(struct burn_drive *d,
1520  char **product_id, char **media_code1, char **media_code2,
1521  char **book_type, int flag);
1522 
1523 
1524 /* ts A90904 */
1525 /** Guess the name of a manufacturer by profile number, manufacturer code
1526  and media code. The profile number can be obtained by
1527  burn_disc_get_profile(), the other two parameters can be obtained as
1528  media_code1 and media_code2 by burn_get_media_product_id().
1529  @param profile_no Profile number (submit -1 if not known)
1530  @param manuf_code Manufacturer code from media (e.g. "RICOHJPN")
1531  @param media_code Media ID code from media (e.g. "W11")
1532  @param flag Bitfield for control purposes, submit 0
1533  @return Printable text or NULL on memory shortage.
1534  If the text begins with "Unknown " then no item of the
1535  manufacturer list matched the codes.
1536  Dispose by free() when no longer needed.
1537  @since 0.7.2
1538 */
1539 char *burn_guess_manufacturer(int profile_no,
1540  char *manuf_code, char *media_code, int flag);
1541 
1542 
1543 /** Tells whether a disc can be erased or not
1544  @param d The drive to inquire.
1545  @return Non-zero means erasable
1546 */
1547 int burn_disc_erasable(struct burn_drive *d);
1548 
1549 /** Returns the progress and status of a drive.
1550  @param drive The drive to query busy state for.
1551  @param p Returns the progress of the operation, NULL if you don't care
1552  @return the current status of the drive. See also burn_drive_status.
1553 */
1554 enum burn_drive_status burn_drive_get_status(struct burn_drive *drive,
1555  struct burn_progress *p);
1556 
1557 /** Creates a write_opts struct for burning to the specified drive.
1558  The returned object must later be freed with burn_write_opts_free().
1559  @param drive The drive to write with
1560  @return The write_opts, NULL on error
1561 */
1562 struct burn_write_opts *burn_write_opts_new(struct burn_drive *drive);
1563 
1564 
1565 /* ts A70901 */
1566 /** Inquires the drive associated with a burn_write_opts object.
1567  @param opts object to inquire
1568  @return pointer to drive
1569  @since 0.4.0
1570 */
1571 struct burn_drive *burn_write_opts_get_drive(struct burn_write_opts *opts);
1572 
1573 
1574 /** Frees a write_opts struct created with burn_write_opts_new
1575  @param opts write_opts to free
1576 */
1577 void burn_write_opts_free(struct burn_write_opts *opts);
1578 
1579 /** Creates a read_opts struct for reading from the specified drive
1580  must be freed with burn_read_opts_free
1581  @param drive The drive to read from
1582  @return The read_opts
1583 */
1584 struct burn_read_opts *burn_read_opts_new(struct burn_drive *drive);
1585 
1586 /** Frees a read_opts struct created with burn_read_opts_new
1587  @param opts write_opts to free
1588 */
1589 void burn_read_opts_free(struct burn_read_opts *opts);
1590 
1591 /** Erase a disc in the drive. The drive must be grabbed successfully BEFORE
1592  calling this functions. Always ensure that the drive reports a status of
1593  BURN_DISC_FULL before calling this function. An erase operation is not
1594  cancellable, as control of the operation is passed wholly to the drive and
1595  there is no way to interrupt it safely.
1596  @param drive The drive with which to erase a disc.
1597  Only drive roles 1 (MMC) and 5 (stdio random write-only)
1598  support erasing.
1599  @param fast Nonzero to do a fast erase, where only the disc's headers are
1600  erased; zero to erase the medi or a
1508  text "XXmYYsZZf" from CD ATIP lead-out.
1509  @param book_type Book type text for DVD and BD.
1510  Caution: is NULL with CD, even if return value says ok.
1511  @param flag Bitfield for control purposes
1512  bit0= do not escape " _/" (not suitable for
1513  burn_guess_manufacturer())
1514  @return 1= ok, product_id and media codes are valid,
1515  0= no product id_available, reply parameters are NULL
1516  <0= error
1517  @since 0.7.2
1518 */
1519 int burn_disc_get_media_id(struct burn_drive *d,
1520  char **product_id, char **media_code1, char **media_code2,
1521  char **book_type, int flag);
1522 
1523 
1524 /* ts A90904 */
1525 /** Guess the name of a manufacturer by profile number, manufacturer code
1526  and media code. The profile number can be obtained by
1527  burn_disc_get_profile(), the other two parameters can be obtained as
1528  media_code1 and media_code2 by burn_get_media_product_id().
1529  @param profile_no Profile number (submit -1 if not known)
1530  @param manuf_code Manufacturer code from media (e.g. "RICOHJPN")
1531  @param media_code Media ID code from media (e.g. "W11")
1532  @param flag Bitfield for control purposes, submit 0
1533  @return Printable text or NULL on memory shortage.
1534  If the text begins with "Unknown " then no item of the
1535  manufacturer list matched the codes.
1536  Dispose by free() when no longer needed.
1537  @since 0.7.2
1538 */
1539 char *burn_guess_manufacturer(int profile_no,
1540  char *manuf_code, char *media_code, int flag);
1541 
1542 
1543 /** Tells whether a disc can be erased or not
1544  @param d The drive to inquire.
1545  @return Non-zero means erasable
1546 */
1547 int burn_disc_erasable(struct burn_drive *d);
1548 
1549 /** Returns the progress and status of a drive.
1550  @param drive The drive to query busy state for.
1551  @param p Returns the progress of the operation, NULL if you don't care
1552  @return the current status of the drive. See also burn_drive_status.
1553 */
1554 enum burn_drive_status burn_drive_get_status(struct burn_drive *drive,
1555  struct burn_progress *p);
1556 
1557 /** Creates a write_opts struct for burning to the specified drive.
1558  The returned object must later be freed with burn_write_opts_free().
1559  @param drive The drive to write with
1560  @return The write_opts, NULL on error
1561 */
1562 struct burn_write_opts *burn_write_opts_new(struct burn_drive *drive);
1563 
1564 
1565 /* ts A70901 */
1566 /** Inquires the drive associated with a burn_write_opts object.
1567  @param opts object to inquire
1568  @return pointer to drive
1569  @since 0.4.0
1570 */
1571 struct burn_drive *burn_write_opts_get_drive(struct burn_write_opts *opts);
1572 
1573 
1574 /** Frees a write_opts struct created with burn_write_opts_new
1575  @param opts write_opts to free
1576 */
1577 void burn_write_opts_free(struct burn_write_opts *opts);
1578 
1579 /** Creates a read_opts struct for reading from the specified drive
1580  must be freed with burn_read_opts_free
1581  @param drive The drive to read from
1582  @return The read_opts
1583 */
1584 struct burn_read_opts *burn_read_opts_new(struct burn_drive *drive);
1585 
1586 /** Frees a read_opts struct created with burn_read_opts_new
1587  @param opts write_opts to free
1588 */
1589 void burn_read_opts_free(struct burn_read_opts *opts);
1590 
1591 /** Erase a disc in the drive. The drive must be grabbed successfully BEFORE
1592  calling this functions. Always ensure that the drive reports a status of
1593  BURN_DISC_FULL before calling this function. An erase operation is not
1594  cancellable, as control of the operation is passed wholly to the drive and
1595  there is no way to interrupt it safely.
1596  @param drive The drive with which to erase a disc.
1597  Only drive roles 1 (MMC) and 5 (stdio random write-only)
1598  support erasing.
1599  @param fast Nonzero to do a fast erase, where only the disc's headers are
1600  erased; zero to erase the medi or a
1508  text "XXmYYsZZf" from CD ATIP lead-out.
1509  @param book_type Book type text for DVD and BD.
1510  Caution: is NULL with CD, even if return value says ok.
1511  @param flag Bitfield for control purposes
1512  bit0= do not escape " _/" (not suitable for
1513  burn_guess_manufacturer())
1514  @return 1= ok, product_id and media codes are valid,
1515  0= no product id_available, reply parameters are NULL
1516  <0= error
1517  @since 0.7.2
1518 */
1519 int burn_disc_get_media_id(struct burn_drive *d,
1520  char **product_id, char **media_code1, char **media_code2,
1521  char **book_type, int flag);
1522 
1523 
1524 /* ts A90904 */
1525 /** Guess the name of a manufacturer by profile number, manufacturer code
1526  and media code. The profile number can be obtained by
1527  burn_disc_get_profile(), the other two parameters can be obtained as
1528  media_code1 and media_code2 by burn_get_media_product_id().
1529  @param profile_no Profile number (submit -1 if not known)
1530  @param manuf_code Manufacturer code from media (e.g. "RICOHJPN")
1531  @param media_code Media ID code from media (e.g. "W11")
1532  @param flag Bitfield for control purposes, submit 0
1533  @return Printable text or NULL on memory shortage.
1534  If the text begins with "Unknown " then no item of the
1535  manufacturer list matched the codes.
1536  Dispose by free() when no longer needed.
1537  @since 0.7.2
1538 */
1539 char *burn_guess_manufacturer(int profile_no,
1540  char *manuf_code, char *media_code, int flag);
1541 
1542 
1543 /** Tells whether a disc can be erased or not
1544  @param d The drive to inquire.
1545  @return Non-zero means erasable
1546 */
1547 int burn_disc_erasable(struct burn_drive *d);
1548 
1549 /** Returns the progress and status of a drive.
1550  @param drive The drive to query busy state for.
1551  @param p Returns the progress of the operation, NULL if you don't care
1552  @return the current status of the drive. See also burn_drive_status.
1553 */
1554 enum burn_drive_status burn_drive_get_status(struct burn_drive *drive,
1555  struct burn_progress *p);
1556 
1557 /** Creates a write_opts struct for burning to the specified drive.
1558  The returned object must later be freed with burn_write_opts_free().
1559  @param drive The drive to write with
1560  @return The write_opts, NULL on error
1561 */
1562 struct burn_write_opts *burn_write_opts_new(struct burn_drive *drive);
1563 
1564 
1565 /* ts A70901 */
1566 /** Inquires the drive associated with a burn_write_opts object.
1567  @param opts object to inquire
1568  @return pointer to drive
1569  @since 0.4.0
1570 */
1571 struct burn_drive *burn_write_opts_get_drive(struct burn_write_opts *opts);
1572 
1573 
1574 /** Frees a write_opts struct created with burn_write_opts_new
1575  @param opts write_opts to free
1576 */
1577 void burn_write_opts_free(struct burn_write_opts *opts);
1578 
1579 /** Creates a read_opts struct for reading from the specified drive
1580  must be freed with burn_read_opts_free
1581  @param drive The drive to read from
1582  @return The read_opts
1583 */
1584 struct burn_read_opts *burn_read_opts_new(struct burn_drive *drive);
1585 
1586 /** Frees a read_opts struct created with burn_read_opts_new
1587  @param opts write_opts to free
1588 */
1589 void burn_read_opts_free(struct burn_read_opts *opts);
1590 
1591 /** Erase a disc in the drive. The drive must be grabbed successfully BEFORE
1592  calling this functions. Always ensure that the drive reports a status of
1593  BURN_DISC_FULL before calling this function. An erase operation is not
1594  cancellable, as control of the operation is passed wholly to the drive and
1595  there is no way to interrupt it safely.
1596  @param drive The drive with which to erase a disc.
1597  Only drive roles 1 (MMC) and 5 (stdio random write-only)
1598  support erasing.
1599  @param fast Nonzero to do a fast erase, where only the disc's headers are
1600  erased; zero to erase the medi or a
1508  text "XXmYYsZZf" from CD ATIP lead-out.
1509  @param book_type Book type text for DVD and BD.
1510  Caution: is NULL with CD, even if return value says ok.
1511  @param flag Bitfield for control purposes
1512  bit0= do not escape " _/" (not suitable for
1513  burn_guess_manufacturer())
1514  @return 1= ok, product_id and media codes are valid,
1515  0= no product id_available, reply parameters are NULL
1516  <0= error
1517  @since 0.7.2
1518 */
1519 int burn_disc_get_media_id(struct burn_drive *d,
1520  char **product_id, char **media_code1, char **media_code2,
1521  char **book_type, int flag);
1522 
1523 
1524 /* ts A90904 */
1525 /** Guess the name of a manufacturer by profile number, manufacturer code
1526  and media code. The profile number can be obtained by
1527  burn_disc_get_profile(), the other two parameters can be obtained as
1528  media_code1 and media_code2 by burn_get_media_product_id().
1529  @param profile_no Profile number (submit -1 if not known)
1530  @param manuf_code Manufacturer code from media (e.g. "RICOHJPN")
1531  @param media_code Media ID code from media (e.g. "W11")
1532  @param flag Bitfield for control purposes, submit 0
1533  @return Printable text or NULL on memory shortage.
1534  If the text begins with "Unknown " then no item of the
1535  manufacturer list matched the codes.
1536  Dispose by free() when no longer needed.
1537  @since 0.7.2
1538 */
1539 char *burn_guess_manufacturer(int profile_no,
1540  char *manuf_code, char *media_code, int flag);
1541 
1542 
1543 /** Tells whether a disc can be erased or not
1544  @param d The drive to inquire.
1545  @return Non-zero means erasable
1546 */
1547 int burn_disc_erasable(struct burn_drive *d);
1548 
1549 /** Returns the progress and status of a drive.
1550  @param drive The drive to query busy state for.
1551  @param p Returns the progress of the operation, NULL if you don't care
1552  @return the current status of the drive. See also burn_drive_status.
1553 */
1554 enum burn_drive_status burn_drive_get_status(struct burn_drive *drive,
1555  struct burn_progress *p);
1556 
1557 /** Creates a write_opts struct for burning to the specified drive.
1558  The returned object must later be freed with burn_write_opts_free().
1559  @param drive The drive to write with
1560  @return The write_opts, NULL on error
1561 */
1562 struct burn_write_opts *burn_write_opts_new(struct burn_drive *drive);
1563 
1564 
1565 /* ts A70901 */
1566 /** Inquires the drive associated with a burn_write_opts object.
1567  @param opts object to inquire
1568  @return pointer to drive
1569  @since 0.4.0
1570 */
1571 struct burn_drive *burn_write_opts_get_drive(struct burn_write_opts *opts);
1572 
1573 
1574 /** Frees a write_opts struct created with burn_write_opts_new
1575  @param opts write_opts to free
1576 */
1577 void burn_write_opts_free(struct burn_write_opts *opts);
1578 
1579 /** Creates a read_opts struct for reading from the specified drive
1580  must be freed with burn_read_opts_free
1581  @param drive The drive to read from
1582  @return The read_opts
1583 */
1584 struct burn_read_opts *burn_read_opts_new(struct burn_drive *drive);
1585 
1586 /** Frees a read_opts struct created with burn_read_opts_new
1587  @param opts write_opts to free
1588 */
1589 void burn_read_opts_free(struct burn_read_opts *opts);
1590 
1591 /** Erase a disc in the drive. The drive must be grabbed successfully BEFORE
1592  calling this functions. Always ensure that the drive reports a status of
1593  BURN_DISC_FULL before calling this function. An erase operation is not
1594  cancellable, as control of the operation is passed wholly to the drive and
1595  there is no way to interrupt it safely.
1596  @param drive The drive with which to erase a disc.
1597  Only drive roles 1 (MMC) and 5 (stdio random write-only)
1598  support erasing.
1599  @param fast Nonzero to do a fast erase, where only the disc's headers are
1600  erased; zero to erase the medi or a
1508  text "XXmYYsZZf" from CD ATIP lead-out.
1509  @param book_type Book type text for DVD and BD.
1510  Caution: is NULL with CD, even if return value says ok.
1511  @param flag Bitfield for control purposes
1512  bit0= do not escape " _/" (not suitable for
1513  burn_guess_manufacturer())
1514  @return 1= ok, product_id and media codes are valid,
1515  0= no product id_available, reply parameters are NULL
1516  <0= error
1517  @since 0.7.2
1518 */
1519 int burn_disc_get_media_id(struct burn_drive *d,
1520  char **product_id, char **media_code1, char **media_code2,
1521  char **book_type, int flag);
1522 
1523 
1524 /* ts A90904 */
1525 /** Guess the name of a manufacturer by profile number, manufacturer code
1526  and media code. The profile number can be obtained by
1527  burn_disc_get_profile(), the other two parameters can be obtained as
1528  media_code1 and media_code2 by burn_get_media_product_id().
1529  @param profile_no Profile number (submit -1 if not known)
1530  @param manuf_code Manufacturer code from media (e.g. "RICOHJPN")
1531  @param media_code Media ID code from media (e.g. "W11")
1532  @param flag Bitfield for control purposes, submit 0
1533  @return Printable text or NULL on memory shortage.
1534  If the text begins with "Unknown " then no item of the
1535  manufacturer list matched the codes.
1536  Dispose by free() when no longer needed.
1537  @since 0.7.2
1538 */
1539 char *burn_guess_manufacturer(int profile_no,
1540  char *manuf_code, char *media_code, int flag);
1541 
1542 
1543 /** Tells whether a disc can be erased or not
1544  @param d The drive to inquire.
1545  @return Non-zero means erasable
1546 */
1547 int burn_disc_erasable(struct burn_drive *d);
1548 
1549 /** Returns the progress and status of a drive.
1550  @param drive The drive to query busy state for.
1551  @param p Returns the progress of the operation, NULL if you don't care
1552  @return the current status of the drive. See also burn_drive_status.
1553 */
1554 enum burn_drive_status burn_drive_get_status(struct burn_drive *drive,
1555  struct burn_progress *p);
1556 
1557 /** Creates a write_opts struct for burning to the specified drive.
1558  The returned object must later be freed with burn_write_opts_free().
1559  @param drive The drive to write with
1560  @return The write_opts, NULL on error
1561 */
1562 struct burn_write_opts *burn_write_opts_new(struct burn_drive *drive);
1563 
1564 
1565 /* ts A70901 */
1566 /** Inquires the drive associated with a burn_write_opts object.
1567  @param opts object to inquire
1568  @return pointer to drive
1569  @since 0.4.0
1570 */
1571 struct burn_drive *burn_write_opts_get_drive(struct burn_write_opts *opts);
1572 
1573 
1574 /** Frees a write_opts struct created with burn_write_opts_new
1575  @param opts write_opts to free
1576 */
1577 void burn_write_opts_free(struct burn_write_opts *opts);
1578 
1579 /** Creates a read_opts struct for reading from the specified drive
1580  must be freed with burn_read_opts_free
1581  @param drive The drive to read from
1582  @return The read_opts
1583 */
1584 struct burn_read_opts *burn_read_opts_new(struct burn_drive *drive);
1585 
1586 /** Frees a read_opts struct created with burn_read_opts_new
1587  @param opts write_opts to free
1588 */
1589 void burn_read_opts_free(struct burn_read_opts *opts);
1590 
1591 /** Erase a disc in the drive. The drive must be grabbed successfully BEFORE
1592  calling this functions. Always ensure that the drive reports a status of
1593  BURN_DISC_FULL before calling this function. An erase operation is not
1594  cancellable, as control of the operation is passed wholly to the drive and
1595  there is no way to interrupt it safely.
1596  @param drive The drive with which to erase a disc.
1597  Only drive roles 1 (MMC) and 5 (stdio random write-only)
1598  support erasing.
1599  @param fast Nonzero to do a fast erase, where only the disc's headers are
1600  erased; zero to erase the medi or a
1508  text "XXmYYsZZf" from CD ATIP lead-out.
1509  @param book_type Book type text for DVD and BD.
1510  Caution: is NULL with CD, even if return value says ok.
1511  @param flag Bitfield for control purposes
1512  bit0= do not escape " _/" (not suitable for
1513  burn_guess_manufacturer())
1514  @return 1= ok, product_id and media codes are valid,
1515  0= no product id_available, reply parameters are NULL
1516  <0= error
1517  @since 0.7.2
1518 */
1519 int burn_disc_get_media_id(struct burn_drive *d,
1520  char **product_id, char **media_code1, char **media_code2,
1521  char **book_type, int flag);
1522 
1523 
1524 /* ts A90904 */
1525 /** Guess the name of a manufacturer by profile number, manufacturer code
1526  and media code. The profile number can be obtained by
1527  burn_disc_get_profile(), the other two parameters can be obtained as
1528  media_code1 and media_code2 by burn_get_media_product_id().
1529  @param profile_no Profile number (submit -1 if not known)
1530  @param manuf_code Manufacturer code from media (e.g. "RICOHJPN")
1531  @param media_code Media ID code from media (e.g. "W11")
1532  @param flag Bitfield for control purposes, submit 0
1533  @return Printable text or NULL on memory shortage.
1534  If the text begins with "Unknown " then no item of the
1535  manufacturer list matched the codes.
1536  Dispose by free() when no longer needed.
1537  @since 0.7.2
1538 */
1539 char *burn_guess_manufacturer(int profile_no,
1540  char *manuf_code, char *media_code, int flag);
1541 
1542 
1543 /** Tells whether a disc can be erased or not
1544  @param d The drive to inquire.
1545  @return Non-zero means erasable
1546 */
1547 int burn_disc_erasable(struct burn_drive *d);
1548 
1549 /** Returns the progress and status of a drive.
1550  @param drive The drive to query busy state for.
1551  @param p Returns the progress of the operation, NULL if you don't care
1552  @return the current status of the drive. See also burn_drive_status.
1553 */
1554 enum burn_drive_status burn_drive_get_status(struct burn_drive *drive,
1555  struct burn_progress *p);
1556 
1557 /** Creates a write_opts struct for burning to the specified drive.
1558  The returned object must later be freed with burn_write_opts_free().
1559  @param drive The drive to write with
1560  @return The write_opts, NULL on error
1561 */
1562 struct burn_write_opts *burn_write_opts_new(struct burn_drive *drive);
1563 
1564 
1565 /* ts A70901 */
1566 /** Inquires the drive associated with a burn_write_opts object.
1567  @param opts object to inquire
1568  @return pointer to drive
1569  @since 0.4.0
1570 */
1571 struct burn_drive *burn_write_opts_get_drive(struct burn_write_opts *opts);
1572 
1573 
1574 /** Frees a write_opts struct created with burn_write_opts_new
1575  @param opts write_opts to free
1576 */
1577 void burn_write_opts_free(struct burn_write_opts *opts);
1578 
1579 /** Creates a read_opts struct for reading from the specified drive
1580  must be freed with burn_read_opts_free
1581  @param drive The drive to read from
1582  @return The read_opts
1583 */
1584 struct burn_read_opts *burn_read_opts_new(struct burn_drive *drive);
1585 
1586 /** Frees a read_opts struct created with burn_read_opts_new
1587  @param opts write_opts to free
1588 */
1589 void burn_read_opts_free(struct burn_read_opts *opts);
1590 
1591 /** Erase a disc in the drive. The drive must be grabbed successfully BEFORE
1592  calling this functions. Always ensure that the drive reports a status of
1593  BURN_DISC_FULL before calling this function. An erase operation is not
1594  cancellable, as control of the operation is passed wholly to the drive and
1595  there is no way to interrupt it safely.
1596  @param drive The drive with which to erase a disc.
1597  Only drive roles 1 (MMC) and 5 (stdio random write-only)
1598  support erasing.
1599  @param fast Nonzero to do a fast erase, where only the disc's headers are
1600  erased; zero to erase the medi or a
1508  text "XXmYYsZZf" from CD ATIP lead-out.
1509  @param book_type Book type text for DVD and BD.
1510  Caution: is NULL with CD, even if return value says ok.
1511  @param flag Bitfield for control purposes
1512  bit0= do not escape " _/" (not suitable for
1513  burn_guess_manufacturer())
1514  @return 1= ok, product_id and media codes are valid,
1515  0= no product id_available, reply parameters are NULL
1516  <0= error
1517  @since 0.7.2
1518 */
1519 int burn_disc_get_media_id(struct burn_drive *d,
1520  char **product_id, char **media_code1, char **media_code2,
1521  char **book_type, int flag);
1522 
1523 
1524 /* ts A90904 */
1525 /** Guess the name of a manufacturer by profile number, manufacturer code
1526  and media code. The profile number can be obtained by
1527  burn_disc_get_profile(), the other two parameters can be obtained as
1528  media_code1 and media_code2 by burn_get_media_product_id().
1529  @param profile_no Profile number (submit -1 if not known)
1530  @param manuf_code Manufacturer code from media (e.g. "RICOHJPN")
1531  @param media_code Media ID code from media (e.g. "W11")
1532  @param flag Bitfield for control purposes, submit 0
1533  @return Printable text or NULL on memory shortage.
1534  If the text begins with "Unknown " then no item of the
1535  manufacturer list matched the codes.
1536  Dispose by free() when no longer needed.
1537  @since 0.7.2
1538 */
1539 char *burn_guess_manufacturer(int profile_no,
1540  char *manuf_code, char *media_code, int flag);
1541 
1542 
1543 /** Tells whether a disc can be erased or not
1544  @param d The drive to inquire.
1545  @return Non-zero means erasable
1546 */
1547 int burn_disc_erasable(struct burn_drive *d);
1548 
1549 /** Returns the progress and status of a drive.
1550  @param drive The drive to query busy state for.
1551  @param p Returns the progress of the operation, NULL if you don't care
1552  @return the current status of the drive. See also burn_drive_status.
1553 */
1554 enum burn_drive_status burn_drive_get_status(struct burn_drive *drive,
1555  struct burn_progress *p);
1556 
1557 /** Creates a write_opts struct for burning to the specified drive.
1558  The returned object must later be freed with burn_write_opts_free().
1559  @param drive The drive to write with
1560  @return The write_opts, NULL on error
1561 */
1562 struct burn_write_opts *burn_write_opts_new(struct burn_drive *drive);
1563 
1564 
1565 /* ts A70901 */
1566 /** Inquires the drive associated with a burn_write_opts object.
1567  @param opts object to inquire
1568  @return pointer to drive
1569  @since 0.4.0
1570 */
1571 struct burn_drive *burn_write_opts_get_drive(struct burn_write_opts *opts);
1572 
1573 
1574 /** Frees a write_opts struct created with burn_write_opts_new
1575  @param opts write_opts to free
1576 */
1577 void burn_write_opts_free(struct burn_write_opts *opts);
1578 
1579 /** Creates a read_opts struct for reading from the specified drive
1580  must be freed with burn_read_opts_free
1581  @param drive The drive to read from
1582  @return The read_opts
1583 */
1584 struct burn_read_opts *burn_read_opts_new(struct burn_drive *drive);
1585 
1586 /** Frees a read_opts struct created with burn_read_opts_new
1587  @param opts write_opts to free
1588 */
1589 void burn_read_opts_free(struct burn_read_opts *opts);
1590 
1591 /** Erase a disc in the drive. The drive must be grabbed successfully BEFORE
1592  calling this functions. Always ensure that the drive reports a status of
1593  BURN_DISC_FULL before calling this function. An erase operation is not
1594  cancellable, as control of the operation is passed wholly to the drive and
1595  there is no way to interrupt it safely.
1596  @param drive The drive with which to erase a disc.
1597  Only drive roles 1 (MMC) and 5 (stdio random write-only)
1598  support erasing.
1599  @param fast Nonzero to do a fast erase, where only the disc's headers are
1600  erased; zero to erase the medi or a
1508  text "XXmYYsZZf" from CD ATIP lead-out.
1509  @param book_type Book type text for DVD and BD.
1510  Caution: is NULL with CD, even if return value says ok.
1511  @param flag Bitfield for control purposes
1512  bit0= do not escape " _/" (not suitable for
1513  burn_guess_manufacturer())
1514  @return 1= ok, product_id and media codes are valid,
1515  0= no product id_available, reply parameters are NULL
1516  <0= error
1517  @since 0.7.2
1518 */
1519 int burn_disc_get_media_id(struct burn_drive *d,
1520  char **product_id, char **media_code1, char **media_code2,
1521  char **book_type, int flag);
1522 
1523 
1524 /* ts A90904 */
1525 /** Guess the name of a manufacturer by profile number, manufacturer code
1526  and media code. The profile number can be obtained by
1527  burn_disc_get_profile(), the other two parameters can be obtained as
1528  media_code1 and media_code2 by burn_get_media_product_id().
1529  @param profile_no Profile number (submit -1 if not known)
1530  @param manuf_code Manufacturer code from media (e.g. "RICOHJPN")
1531  @param media_code Media ID code from media (e.g. "W11")
1532  @param flag Bitfield for control purposes, submit 0
1533  @return Printable text or NULL on memory shortage.
1534  If the text begins with "Unknown " then no item of the
1535  manufacturer list matched the codes.
1536  Dispose by free() when no longer needed.
1537  @since 0.7.2
1538 */
1539 char *burn_guess_manufacturer(int profile_no,
1540  char *manuf_code, char *media_code, int flag);
1541 
1542 
1543 /** Tells whether a disc can be erased or not
1544  @param d The drive to inquire.
1545  @return Non-zero means erasable
1546 */
1547 int burn_disc_erasable(struct burn_drive *d);
1548 
1549 /** Returns the progress and status of a drive.
1550  @param drive The drive to query busy state for.
1551  @param p Returns the progress of the operation, NULL if you don't care
1552  @return the current status of the drive. See also burn_drive_status.
1553 */
1554 enum burn_drive_status burn_drive_get_status(struct burn_drive *drive,
1555  struct burn_progress *p);
1556 
1557 /** Creates a write_opts struct for burning to the specified drive.
1558  The returned object must later be freed with burn_write_opts_free().
1559  @param drive The drive to write with
1560  @return The write_opts, NULL on error
1561 */
1562 struct burn_write_opts *burn_write_opts_new(struct burn_drive *drive);
1563 
1564 
1565 /* ts A70901 */
1566 /** Inquires the drive associated with a burn_write_opts object.
1567  @param opts object to inquire
1568  @return pointer to drive
1569  @since 0.4.0
1570 */
1571 struct burn_drive *burn_write_opts_get_drive(struct burn_write_opts *opts);
1572 
1573 
1574 /** Frees a write_opts struct created with burn_write_opts_new
1575  @param opts write_opts to free
1576 */
1577 void burn_write_opts_free(struct burn_write_opts *opts);
1578 
1579 /** Creates a read_opts struct for reading from the specified drive
1580  must be freed with burn_read_opts_free
1581  @param drive The drive to read from
1582  @return The read_opts
1583 */
1584 struct burn_read_opts *burn_read_opts_new(struct burn_drive *drive);
1585 
1586 /** Frees a read_opts struct created with burn_read_opts_new
1587  @param opts write_opts to free
1588 */
1589 void burn_read_opts_free(struct burn_read_opts *opts);
1590 
1591 /** Erase a disc in the drive. The drive must be grabbed successfully BEFORE
1592  calling this functions. Always ensure that the drive reports a status of
1593  BURN_DISC_FULL before calling this function. An erase operation is not
1594  cancellable, as control of the operation is passed wholly to the drive and
1595  there is no way to interrupt it safely.
1596  @param drive The drive with which to erase a disc.
1597  Only drive roles 1 (MMC) and 5 (stdio random write-only)
1598  support erasing.
1599  @param fast Nonzero to do a fast erase, where only the disc's headers are
1600  erased; zero to erase the medi or a
1508  text "XXmYYsZZf" from CD ATIP lead-out.
1509  @param book_type Book type text for DVD and BD.
1510  Caution: is NULL with CD, even if return value says ok.
1511  @param flag Bitfield for control purposes
1512  bit0= do not escape " _/" (not suitable for
1513  burn_guess_manufacturer())
1514  @return 1= ok, product_id and media codes are valid,
1515  0= no product id_available, reply parameters are NULL
1516  <0= error
1517  @since 0.7.2
1518 */
1519 int burn_disc_get_media_id(struct burn_drive *d,
1520  char **product_id, char **media_code1, char **media_code2,
1521  char **book_type, int flag);
1522 
1523 
1524 /* ts A90904 */
1525 /** Guess the name of a manufacturer by profile number, manufacturer code
1526  and media code. The profile number can be obtained by
1527  burn_disc_get_profile(), the other two parameters can be obtained as
1528  media_code1 and media_code2 by burn_get_media_product_id().
1529  @param profile_no Profile number (submit -1 if not known)
1530  @param manuf_code Manufacturer code from media (e.g. "RICOHJPN")
1531  @param media_code Media ID code from media (e.g. "W11")
1532  @param flag Bitfield for control purposes, submit 0
1533  @return Printable text or NULL on memory shortage.
1534  If the text begins with "Unknown " then no item of the
1535  manufacturer list matched the codes.
1536  Dispose by free() when no longer needed.
1537  @since 0.7.2
1538 */
1539 char *burn_guess_manufacturer(int profile_no,
1540  char *manuf_code, char *media_code, int flag);
1541 
1542 
1543 /** Tells whether a disc can be erased or not
1544  @param d The drive to inquire.
1545  @return Non-zero means erasable
1546 */
1547 int burn_disc_erasable(struct burn_drive *d);
1548 
1549 /** Returns the progress and status of a drive.
1550  @param drive The drive to query busy state for.
1551  @param p Returns the progress of the operation, NULL if you don't care
1552  @return the current status of the drive. See also burn_drive_status.
1553 */
1554 enum burn_drive_status burn_drive_get_status(struct burn_drive *drive,
1555  struct burn_progress *p);
1556 
1557 /** Creates a write_opts struct for burning to the specified drive.
1558  The returned object must later be freed with burn_write_opts_free().
1559  @param drive The drive to write with
1560  @return The write_opts, NULL on error
1561 */
1562 struct burn_write_opts *burn_write_opts_new(struct burn_drive *drive);
1563 
1564 
1565 /* ts A70901 */
1566 /** Inquires the drive associated with a burn_write_opts object.
1567  @param opts object to inquire
1568  @return pointer to drive
1569  @since 0.4.0
1570 */
1571 struct burn_drive *burn_write_opts_get_drive(struct burn_write_opts *opts);
1572 
1573 
1574 /** Frees a write_opts struct created with burn_write_opts_new
1575  @param opts write_opts to free
1576 */
1577 void burn_write_opts_free(struct burn_write_opts *opts);
1578 
1579 /** Creates a read_opts struct for reading from the specified drive
1580  must be freed with burn_read_opts_free
1581  @param drive The drive to read from
1582  @return The read_opts
1583 */
1584 struct burn_read_opts *burn_read_opts_new(struct burn_drive *drive);
1585 
1586 /** Frees a read_opts struct created with burn_read_opts_new
1587  @param opts write_opts to free
1588 */
1589 void burn_read_opts_free(struct burn_read_opts *opts);
1590 
1591 /** Erase a disc in the drive. The drive must be grabbed successfully BEFORE
1592  calling this functions. Always ensure that the drive reports a status of
1593  BURN_DISC_FULL before calling this function. An erase operation is not
1594  cancellable, as control of the operation is passed wholly to the drive and
1595  there is no way to interrupt it safely.
1596  @param drive The drive with which to erase a disc.
1597  Only drive roles 1 (MMC) and 5 (stdio random write-only)
1598  support erasing.
1599  @param fast Nonzero to do a fast erase, where only the disc's headers are
1600  erased; zero to erase the medi or a
1508  text "XXmYYsZZf" from CD ATIP lead-out.
1509  @param book_type Book type text for DVD and BD.
1510  Caution: is NULL with CD, even if return value says ok.
1511  @param flag Bitfield for control purposes
1512  bit0= do not escape " _/" (not suitable for
1513  burn_guess_manufacturer())
1514  @return 1= ok, product_id and media codes are valid,
1515  0= no product id_available, reply parameters are NULL
1516  <0= error
1517  @since 0.7.2
1518 */
1519 int burn_disc_get_media_id(struct burn_drive *d,
1520  char **product_id, char **media_code1, char **media_code2,
1521  char **book_type, int flag);
1522 
1523 
1524 /* ts A90904 */
1525 /** Guess the name of a manufacturer by profile number, manufacturer code
1526  and media code. The profile number can be obtained by
1527  burn_disc_get_profile(), the other two parameters can be obtained as
1528  media_code1 and media_code2 by burn_get_media_product_id().
1529  @param profile_no Profile number (submit -1 if not known)
1530  @param manuf_code Manufacturer code from media (e.g. "RICOHJPN")
1531  @param media_code Media ID code from media (e.g. "W11")
1532  @param flag Bitfield for control purposes, submit 0
1533  @return Printable text or NULL on memory shortage.
1534  If the text begins with "Unknown " then no item of the
1535  manufacturer list matched the codes.
1536  Dispose by free() when no longer needed.
1537  @since 0.7.2
1538 */
1539 char *burn_guess_manufacturer(int profile_no,
1540  char *manuf_code, char *media_code, int flag);
1541 
1542 
1543 /** Tells whether a disc can be erased or not
1544  @param d The drive to inquire.
1545  @return Non-zero means erasable
1546 */
1547 int burn_disc_erasable(struct burn_drive *d);
1548 
1549 /** Returns the progress and status of a drive.
1550  @param drive The drive to query busy state for.
1551  @param p Returns the progress of the operation, NULL if you don't care
1552  @return the current status of the drive. See also burn_drive_status.
1553 */
1554 enum burn_drive_status burn_drive_get_status(struct burn_drive *drive,
1555  struct burn_progress *p);
1556 
1557 /** Creates a write_opts struct for burning to the specified drive.
1558  The returned object must later be freed with burn_write_opts_free().
1559  @param drive The drive to write with
1560  @return The write_opts, NULL on error
1561 */
1562 struct burn_write_opts *burn_write_opts_new(struct burn_drive *drive);
1563 
1564 
1565 /* ts A70901 */
1566 /** Inquires the drive associated with a burn_write_opts object.
1567  @param opts object to inquire
1568  @return pointer to drive
1569  @since 0.4.0
1570 */
1571 struct burn_drive *burn_write_opts_get_drive(struct burn_write_opts *opts);
1572 
1573 
1574 /** Frees a write_opts struct created with burn_write_opts_new
1575  @param opts write_opts to free
1576 */
1577 void burn_write_opts_free(struct burn_write_opts *opts);
1578 
1579 /** Creates a read_opts struct for reading from the specified drive
1580  must be freed with burn_read_opts_free
1581  @param drive The drive to read from
1582  @return The read_opts
1583 */
1584 struct burn_read_opts *burn_read_opts_new(struct burn_drive *drive);
1585 
1586 /** Frees a read_opts struct created with burn_read_opts_new
1587  @param opts write_opts to free
1588 */
1589 void burn_read_opts_free(struct burn_read_opts *opts);
1590 
1591 /** Erase a disc in the drive. The drive must be grabbed successfully BEFORE
1592  calling this functions. Always ensure that the drive reports a status of
1593  BURN_DISC_FULL before calling this function. An erase operation is not
1594  cancellable, as control of the operation is passed wholly to the drive and
1595  there is no way to interrupt it safely.
1596  @param drive The drive with which to erase a disc.
1597  Only drive roles 1 (MMC) and 5 (stdio random write-only)
1598  support erasing.
1599  @param fast Nonzero to do a fast erase, where only the disc's headers are
1600  erased; zero to erase the medi or a
1508  text "XXmYYsZZf" from CD ATIP lead-out.
1509  @param book_type Book type text for DVD and BD.
1510  Caution: is NULL with CD, even if return value says ok.
1511  @param flag Bitfield for control purposes
1512  bit0= do not escape " _/" (not suitable for
1513  burn_guess_manufacturer())
1514  @return 1= ok, product_id and media codes are valid,
1515  0= no product id_available, reply parameters are NULL
1516  <0= error
1517  @since 0.7.2
1518 */
1519 int burn_disc_get_media_id(struct burn_drive *d,
1520  char **product_id, char **media_code1, char **media_code2,
1521  char **book_type, int flag);
1522 
1523 
1524 /* ts A90904 */
1525 /** Guess the name of a manufacturer by profile number, manufacturer code
1526  and media code. The profile number can be obtained by
1527  burn_disc_get_profile(), the other two parameters can be obtained as
1528  media_code1 and media_code2 by burn_get_media_product_id().
1529  @param profile_no Profile number (submit -1 if not known)
1530  @param manuf_code Manufacturer code from media (e.g. "RICOHJPN")
1531  @param media_code Media ID code from media (e.g. "W11")
1532  @param flag Bitfield for control purposes, submit 0
1533  @return Printable text or NULL on memory shortage.
1534  If the text begins with "Unknown " then no item of the
1535  manufacturer list matched the codes.
1536  Dispose by free() when no longer needed.
1537  @since 0.7.2
1538 */
1539 char *burn_guess_manufacturer(int profile_no,
1540  char *manuf_code, char *media_code, int flag);
1541 
1542 
1543 /** Tells whether a disc can be erased or not
1544  @param d The drive to inquire.
1545  @return Non-zero means erasable
1546 */
1547 int burn_disc_erasable(struct burn_drive *d);
1548 
1549 /** Returns the progress and status of a drive.
1550  @param drive The drive to query busy state for.
1551  @param p Returns the progress of the operation, NULL if you don't care
1552  @return the current status of the drive. See also burn_drive_status.
1553 */
1554 enum burn_drive_status burn_drive_get_status(struct burn_drive *drive,
1555  struct burn_progress *p);
1556 
1557 /** Creates a write_opts struct for burning to the specified drive.
1558  The returned object must later be freed with burn_write_opts_free().
1559  @param drive The drive to write with
1560  @return The write_opts, NULL on error
1561 */
1562 struct burn_write_opts *burn_write_opts_new(struct burn_drive *drive);
1563 
1564 
1565 /* ts A70901 */
1566 /** Inquires the drive associated with a burn_write_opts object.
1567  @param opts object to inquire
1568  @return pointer to drive
1569  @since 0.4.0
1570 */
1571 struct burn_drive *burn_write_opts_get_drive(struct burn_write_opts *opts);
1572 
1573 
1574 /** Frees a write_opts struct created with burn_write_opts_new
1575  @param opts write_opts to free
1576 */
1577 void burn_write_opts_free(struct burn_write_opts *opts);
1578 
1579 /** Creates a read_opts struct for reading from the specified drive
1580  must be freed with burn_read_opts_free
1581  @param drive The drive to read from
1582  @return The read_opts
1583 */
1584 struct burn_read_opts *burn_read_opts_new(struct burn_drive *drive);
1585 
1586 /** Frees a read_opts struct created with burn_read_opts_new
1587  @param opts write_opts to free
1588 */
1589 void burn_read_opts_free(struct burn_read_opts *opts);
1590 
1591 /** Erase a disc in the drive. The drive must be grabbed successfully BEFORE
1592  calling this functions. Always ensure that the drive reports a status of
1593  BURN_DISC_FULL before calling this function. An erase operation is not
1594  cancellable, as control of the operation is passed wholly to the drive and
1595  there is no way to interrupt it safely.
1596  @param drive The drive with which to erase a disc.
1597  Only drive roles 1 (MMC) and 5 (stdio random write-only)
1598  support erasing.
1599  @param fast Nonzero to do a fast erase, where only the disc's headers are
1600  erased; zero to erase the medi or a
1508  text "XXmYYsZZf" from CD ATIP lead-out.
1509  @param book_type Book type text for DVD and BD.
1510  Caution: is NULL with CD, even if return value says ok.
1511  @param flag Bitfield for control purposes
1512  bit0= do not escape " _/" (not suitable for
1513  burn_guess_manufacturer())
1514  @return 1= ok, product_id and media codes are valid,
1515  0= no product id_available, reply parameters are NULL
1516  <0= error
1517  @since 0.7.2
1518 */
1519 int burn_disc_get_media_id(struct burn_drive *d,
1520  char **product_id, char **media_code1, char **media_code2,
1521  char **book_type, int flag);
1522 
1523 
1524 /* ts A90904 */
1525 /** Guess the name of a manufacturer by profile number, manufacturer code
1526  and media code. The profile number can be obtained by
1527  burn_disc_get_profile(), the other two parameters can be obtained as
1528  media_code1 and media_code2 by burn_get_media_product_id().
1529  @param profile_no Profile number (submit -1 if not known)
1530  @param manuf_code Manufacturer code from media (e.g. "RICOHJPN")
1531  @param media_code Media ID code from media (e.g. "W11")
1532  @param flag Bitfield for control purposes, submit 0
1533  @return Printable text or NULL on memory shortage.
1534  If the text begins with "Unknown " then no item of the
1535  manufacturer list matched the codes.
1536  Dispose by free() when no longer needed.
1537  @since 0.7.2
1538 */
1539 char *burn_guess_manufacturer(int profile_no,
1540  char *manuf_code, char *media_code, int flag);
1541 
1542 
1543 /** Tells whether a disc can be erased or not
1544  @param d The drive to inquire.
1545  @return Non-zero means erasable
1546 */
1547 int burn_disc_erasable(struct burn_drive *d);
1548 
1549 /** Returns the progress and status of a drive.
1550  @param drive The drive to query busy state for.
1551  @param p Returns the progress of the operation, NULL if you don't care
1552  @return the current status of the drive. See also burn_drive_status.
1553 */
1554 enum burn_drive_status burn_drive_get_status(struct burn_drive *drive,
1555  struct burn_progress *p);
1556 
1557 /** Creates a write_opts struct for burning to the specified drive.
1558  The returned object must later be freed with burn_write_opts_free().
1559  @param drive The drive to write with
1560  @return The write_opts, NULL on error
1561 */
1562 struct burn_write_opts *burn_write_opts_new(struct burn_drive *drive);
1563 
1564 
1565 /* ts A70901 */
1566 /** Inquires the drive associated with a burn_write_opts object.
1567  @param opts object to inquire
1568  @return pointer to drive
1569  @since 0.4.0
1570 */
1571 struct burn_drive *burn_write_opts_get_drive(struct burn_write_opts *opts);
1572 
1573 
1574 /** Frees a write_opts struct created with burn_write_opts_new
1575  @param opts write_opts to free
1576 */
1577 void burn_write_opts_free(struct burn_write_opts *opts);
1578 
1579 /** Creates a read_opts struct for reading from the specified drive
1580  must be freed with burn_read_opts_free
1581  @param drive The drive to read from
1582  @return The read_opts
1583 */
1584 struct burn_read_opts *burn_read_opts_new(struct burn_drive *drive);
1585 
1586 /** Frees a read_opts struct created with burn_read_opts_new
1587  @param opts write_opts to free
1588 */
1589 void burn_read_opts_free(struct burn_read_opts *opts);
1590 
1591 /** Erase a disc in the drive. The drive must be grabbed successfully BEFORE
1592  calling this functions. Always ensure that the drive reports a status of
1593  BURN_DISC_FULL before calling this function. An erase operation is not
1594  cancellable, as control of the operation is passed wholly to the drive and
1595  there is no way to interrupt it safely.
1596  @param drive The drive with which to erase a disc.
1597  Only drive roles 1 (MMC) and 5 (stdio random write-only)
1598  support erasing.
1599  @param fast Nonzero to do a fast erase, where only the disc's headers are
1600  erased; zero to erase the medi or a
1508  text "XXmYYsZZf" from CD ATIP lead-out.
1509  @param book_type Book type text for DVD and BD.
1510  Caution: is NULL with CD, even if return value says ok.
1511  @param flag Bitfield for control purposes
1512  bit0= do not escape " _/" (not suitable for
1513  burn_guess_manufacturer())
1514  @return 1= ok, product_id and media codes are valid,
1515  0= no product id_available, reply parameters are NULL
1516  <0= error
1517  @since 0.7.2
1518 */
1519 int burn_disc_get_media_id(struct burn_drive *d,
1520  char **product_id, char **media_code1, char **media_code2,
1521  char **book_type, int flag);
1522 
1523 
1524 /* ts A90904 */
1525 /** Guess the name of a manufacturer by profile number, manufacturer code
1526  and media code. The profile number can be obtained by
1527  burn_disc_get_profile(), the other two parameters can be obtained as
1528  media_code1 and media_code2 by burn_get_media_product_id().
1529  @param profile_no Profile number (submit -1 if not known)
1530  @param manuf_code Manufacturer code from media (e.g. "RICOHJPN")
1531  @param media_code Media ID code from media (e.g. "W11")
1532  @param flag Bitfield for control purposes, submit 0
1533  @return Printable text or NULL on memory shortage.
1534  If the text begins with "Unknown " then no item of the
1535  manufacturer list matched the codes.
1536  Dispose by free() when no longer needed.
1537  @since 0.7.2
1538 */
1539 char *burn_guess_manufacturer(int profile_no,
1540  char *manuf_code, char *media_code, int flag);
1541 
1542 
1543 /** Tells whether a disc can be erased or not
1544  @param d The drive to inquire.
1545  @return Non-zero means erasable
1546 */
1547 int burn_disc_erasable(struct burn_drive *d);
1548 
1549 /** Returns the progress and status of a drive.
1550  @param drive The drive to query busy state for.
1551  @param p Returns the progress of the operation, NULL if you don't care
1552  @return the current status of the drive. See also burn_drive_status.
1553 */
1554 enum burn_drive_status burn_drive_get_status(struct burn_drive *drive,
1555  struct burn_progress *p);
1556 
1557 /** Creates a write_opts struct for burning to the specified drive.
1558  The returned object must later be freed with burn_write_opts_free().
1559  @param drive The drive to write with
1560  @return The write_opts, NULL on error
1561 */
1562 struct burn_write_opts *burn_write_opts_new(struct burn_drive *drive);
1563 
1564 
1565 /* ts A70901 */
1566 /** Inquires the drive associated with a burn_write_opts object.
1567  @param opts object to inquire
1568  @return pointer to drive
1569  @since 0.4.0
1570 */
1571 struct burn_drive *burn_write_opts_get_drive(struct burn_write_opts *opts);
1572 
1573 
1574 /** Frees a write_opts struct created with burn_write_opts_new
1575  @param opts write_opts to free
1576 */
1577 void burn_write_opts_free(struct burn_write_opts *opts);
1578 
1579 /** Creates a read_opts struct for reading from the specified drive
1580  must be freed with burn_read_opts_free
1581  @param drive The drive to read from
1582  @return The read_opts
1583 */
1584 struct burn_read_opts *burn_read_opts_new(struct burn_drive *drive);
1585 
1586 /** Frees a read_opts struct created with burn_read_opts_new
1587  @param opts write_opts to free
1588 */
1589 void burn_read_opts_free(struct burn_read_opts *opts);
1590 
1591 /** Erase a disc in the drive. The drive must be grabbed successfully BEFORE
1592  calling this functions. Always ensure that the drive reports a status of
1593  BURN_DISC_FULL before calling this function. An erase operation is not
1594  cancellable, as control of the operation is passed wholly to the drive and
1595  there is no way to interrupt it safely.
1596  @param drive The drive with which to erase a disc.
1597  Only drive roles 1 (MMC) and 5 (stdio random write-only)
1598  support erasing.
1599  @param fast Nonzero to do a fast erase, where only the disc's headers are
1600  erased; zero to erase the medi or a
1508  text "XXmYYsZZf" from CD ATIP lead-out.
1509  @param book_type Book type text for DVD and BD.
1510  Caution: is NULL with CD, even if return value says ok.
1511  @param flag Bitfield for control purposes
1512  bit0= do not escape " _/" (not suitable for
1513  burn_guess_manufacturer())
1514  @return 1= ok, product_id and media codes are valid,
1515  0= no product id_available, reply parameters are NULL
1516  <0= error
1517  @since 0.7.2
1518 */
1519 int burn_disc_get_media_id(struct burn_drive *d,
1520  char **product_id, char **media_code1, char **media_code2,
1521  char **book_type, int flag);
1522 
1523 
1524 /* ts A90904 */
1525 /** Guess the name of a manufacturer by profile number, manufacturer code
1526  and media code. The profile number can be obtained by
1527  burn_disc_get_profile(), the other two parameters can be obtained as
1528  media_code1 and media_code2 by burn_get_media_product_id().
1529  @param profile_no Profile number (submit -1 if not known)
1530  @param manuf_code Manufacturer code from media (e.g. "RICOHJPN")
1531  @param media_code Media ID code from media (e.g. "W11")
1532  @param flag Bitfield for control purposes, submit 0
1533  @return Printable text or NULL on memory shortage.
1534  If the text begins with "Unknown " then no item of the
1535  manufacturer list matched the codes.
1536  Dispose by free() when no longer needed.
1537  @since 0.7.2
1538 */
1539 char *burn_guess_manufacturer(int profile_no,
1540  char *manuf_code, char *media_code, int flag);
1541 
1542 
1543 /** Tells whether a disc can be erased or not
1544  @param d The drive to inquire.
1545  @return Non-zero means erasable
1546 */
1547 int burn_disc_erasable(struct burn_drive *d);
1548 
1549 /** Returns the progress and status of a drive.
1550  @param drive The drive to query busy state for.
1551  @param p Returns the progress of the operation, NULL if you don't care
1552  @return the current status of the drive. See also burn_drive_status.
1553 */
1554 enum burn_drive_status burn_drive_get_status(struct burn_drive *drive,
1555  struct burn_progress *p);
1556 
1557 /** Creates a write_opts struct for burning to the specified drive.
1558  The returned object must later be freed with burn_write_opts_free().
1559  @param drive The drive to write with
1560  @return The write_opts, NULL on error
1561 */
1562 struct burn_write_opts *burn_write_opts_new(struct burn_drive *drive);
1563 
1564 
1565 /* ts A70901 */
1566 /** Inquires the drive associated with a burn_write_opts object.
1567  @param opts object to inquire
1568  @return pointer to drive
1569  @since 0.4.0
1570 */
1571 struct burn_drive *burn_write_opts_get_drive(struct burn_write_opts *opts);
1572 
1573 
1574 /** Frees a write_opts struct created with burn_write_opts_new
1575  @param opts write_opts to free
1576 */
1577 void burn_write_opts_free(struct burn_write_opts *opts);
1578 
1579 /** Creates a read_opts struct for reading from the specified drive
1580  must be freed with burn_read_opts_free
1581  @param drive The drive to read from
1582  @return The read_opts
1583 */
1584 struct burn_read_opts *burn_read_opts_new(struct burn_drive *drive);
1585 
1586 /** Frees a read_opts struct created with burn_read_opts_new
1587  @param opts write_opts to free
1588 */
1589 void burn_read_opts_free(struct burn_read_opts *opts);
1590 
1591 /** Erase a disc in the drive. The drive must be grabbed successfully BEFORE
1592  calling this functions. Always ensure that the drive reports a status of
1593  BURN_DISC_FULL before calling this function. An erase operation is not
1594  cancellable, as control of the operation is passed wholly to the drive and
1595  there is no way to interrupt it safely.
1596  @param drive The drive with which to erase a disc.
1597  Only drive roles 1 (MMC) and 5 (stdio random write-only)
1598  support erasing.
1599  @param fast Nonzero to do a fast erase, where only the disc's headers are
1600  erased; zero to erase the medi or a
1508  text "XXmYYsZZf" from CD ATIP lead-out.
1509  @param book_type Book type text for DVD and BD.
1510  Caution: is NULL with CD, even if return value says ok.
1511  @param flag Bitfield for control purposes
1512  bit0= do not escape " _/" (not suitable for
1513  burn_guess_manufacturer())
1514  @return 1= ok, product_id and media codes are valid,
1515  0= no product id_available, reply parameters are NULL
1516  <0= error
1517  @since 0.7.2
1518 */
1519 int burn_disc_get_media_id(struct burn_drive *d,
1520  char **product_id, char **media_code1, char **media_code2,
1521  char **book_type, int flag);
1522 
1523 
1524 /* ts A90904 */
1525 /** Guess the name of a manufacturer by profile number, manufacturer code
1526  and media code. The profile number can be obtained by
1527  burn_disc_get_profile(), the other two parameters can be obtained as
1528  media_code1 and media_code2 by burn_get_media_product_id().
1529  @param profile_no Profile number (submit -1 if not known)
1530  @param manuf_code Manufacturer code from media (e.g. "RICOHJPN")
1531  @param media_code Media ID code from media (e.g. "W11")
1532  @param flag Bitfield for control purposes, submit 0
1533  @return Printable text or NULL on memory shortage.
1534  If the text begins with "Unknown " then no item of the
1535  manufacturer list matched the codes.
1536  Dispose by free() when no longer needed.
1537  @since 0.7.2
1538 */
1539 char *burn_guess_manufacturer(int profile_no,
1540  char *manuf_code, char *media_code, int flag);
1541 
1542 
1543 /** Tells whether a disc can be erased or not
1544  @param d The drive to inquire.
1545  @return Non-zero means erasable
1546 */
1547 int burn_disc_erasable(struct burn_drive *d);
1548 
1549 /** Returns the progress and status of a drive.
1550  @param drive The drive to query busy state for.
1551  @param p Returns the progress of the operation, NULL if you don't care
1552  @return the current status of the drive. See also burn_drive_status.
1553 */
1554 enum burn_drive_status burn_drive_get_status(struct burn_drive *drive,
1555  struct burn_progress *p);
1556 
1557 /** Creates a write_opts struct for burning to the specified drive.
1558  The returned object must later be freed with burn_write_opts_free().
1559  @param drive The drive to write with
1560  @return The write_opts, NULL on error
1561 */
1562 struct burn_write_opts *burn_write_opts_new(struct burn_drive *drive);
1563 
1564 
1565 /* ts A70901 */
1566 /** Inquires the drive associated with a burn_write_opts object.
1567  @param opts object to inquire
1568  @return pointer to drive
1569  @since 0.4.0
1570 */
1571 struct burn_drive *burn_write_opts_get_drive(struct burn_write_opts *opts);
1572 
1573 
1574 /** Frees a write_opts struct created with burn_write_opts_new
1575  @param opts write_opts to free
1576 */
1577 void burn_write_opts_free(struct burn_write_opts *opts);
1578 
1579 /** Creates a read_opts struct for reading from the specified drive
1580  must be freed with burn_read_opts_free
1581  @param drive The drive to read from
1582  @return The read_opts
1583 */
1584 struct burn_read_opts *burn_read_opts_new(struct burn_drive *drive);
1585 
1586 /** Frees a read_opts struct created with burn_read_opts_new
1587  @param opts write_opts to free
1588 */
1589 void burn_read_opts_free(struct burn_read_opts *opts);
1590 
1591 /** Erase a disc in the drive. The drive must be grabbed successfully BEFORE
1592  calling this functions. Always ensure that the drive reports a status of
1593  BURN_DISC_FULL before calling this function. An erase operation is not
1594  cancellable, as control of the operation is passed wholly to the drive and
1595  there is no way to interrupt it safely.
1596  @param drive The drive with which to erase a disc.
1597  Only drive roles 1 (MMC) and 5 (stdio random write-only)
1598  support erasing.
1599  @param fast Nonzero to do a fast erase, where only the disc's headers are
1600  erased; zero to erase the medi or a
1508  text "XXmYYsZZf" from CD ATIP lead-out.
1509  @param book_type Book type text for DVD and BD.
1510  Caution: is NULL with CD, even if return value says ok.
1511  @param flag Bitfield for control purposes
1512  bit0= do not escape " _/" (not suitable for
1513  burn_guess_manufacturer())
1514  @return 1= ok, product_id and media codes are valid,
1515  0= no product id_available, reply parameters are NULL
1516  <0= error
1517  @since 0.7.2
1518 */
1519 int burn_disc_get_media_id(struct burn_drive *d,
1520  char **product_id, char **media_code1, char **media_code2,
1521  char **book_type, int flag);
1522 
1523 
1524 /* ts A90904 */
1525 /** Guess the name of a manufacturer by profile number, manufacturer code
1526  and media code. The profile number can be obtained by
1527  burn_disc_get_profile(), the other two parameters can be obtained as
1528  media_code1 and media_code2 by burn_get_media_product_id().
1529  @param profile_no Profile number (submit -1 if not known)
1530  @param manuf_code Manufacturer code from media (e.g. "RICOHJPN")
1531  @param media_code Media ID code from media (e.g. "W11")
1532  @param flag Bitfield for control purposes, submit 0
1533  @return Printable text or NULL on memory shortage.
1534  If the text begins with "Unknown " then no item of the
1535  manufacturer list matched the codes.
1536  Dispose by free() when no longer needed.
1537  @since 0.7.2
1538 */
1539 char *burn_guess_manufacturer(int profile_no,
1540  char *manuf_code, char *media_code, int flag);
1541 
1542 
1543 /** Tells whether a disc can be erased or not
1544  @param d The drive to inquire.
1545  @return Non-zero means erasable
1546 */
1547 int burn_disc_erasable(struct burn_drive *d);
1548 
1549 /** Returns the progress and status of a drive.
1550  @param drive The drive to query busy state for.
1551  @param p Returns the progress of the operation, NULL if you don't care
1552  @return the current status of the drive. See also burn_drive_status.
1553 */
1554 enum burn_drive_status burn_drive_get_status(struct burn_drive *drive,
1555  struct burn_progress *p);
1556 
1557 /** Creates a write_opts struct for burning to the specified drive.
1558  The returned object must later be freed with burn_write_opts_free().
1559  @param drive The drive to write with
1560  @return The write_opts, NULL on error
1561 */
1562 struct burn_write_opts *burn_write_opts_new(struct burn_drive *drive);
1563 
1564 
1565 /* ts A70901 */
1566 /** Inquires the drive associated with a burn_write_opts object.
1567  @param opts object to inquire
1568  @return pointer to drive
1569  @since 0.4.0
1570 */
1571 struct burn_drive *burn_write_opts_get_drive(struct burn_write_opts *opts);
1572 
1573 
1574 /** Frees a write_opts struct created with burn_write_opts_new
1575  @param opts write_opts to free
1576 */
1577 void burn_write_opts_free(struct burn_write_opts *opts);
1578 
1579 /** Creates a read_opts struct for reading from the specified drive
1580  must be freed with burn_read_opts_free
1581  @param drive The drive to read from
1582  @return The read_opts
1583 */
1584 struct burn_read_opts *burn_read_opts_new(struct burn_drive *drive);
1585 
1586 /** Frees a read_opts struct created with burn_read_opts_new
1587  @param opts write_opts to free
1588 */
1589 void burn_read_opts_free(struct burn_read_opts *opts);
1590 
1591 /** Erase a disc in the drive. The drive must be grabbed successfully BEFORE
1592  calling this functions. Always ensure that the drive reports a status of
1593  BURN_DISC_FULL before calling this function. An erase operation is not
1594  cancellable, as control of the operation is passed wholly to the drive and
1595  there is no way to interrupt it safely.
1596  @param drive The drive with which to erase a disc.
1597  Only drive roles 1 (MMC) and 5 (stdio random write-only)
1598  support erasing.
1599  @param fast Nonzero to do a fast erase, where only the disc's headers are
1600  erased; zero to erase the medi or a
1508  text "XXmYYsZZf" from CD ATIP lead-out.
1509  @param book_type Book type text for DVD and BD.
1510  Caution: is NULL with CD, even if return value says ok.
1511  @param flag Bitfield for control purposes
1512  bit0= do not escape " _/" (not suitable for
1513  burn_guess_manufacturer())
1514  @return 1= ok, product_id and media codes are valid,
1515  0= no product id_available, reply parameters are NULL
1516  <0= error
1517  @since 0.7.2
1518 */
1519 int burn_disc_get_media_id(struct burn_drive *d,
1520  char **product_id, char **media_code1, char **media_code2,
1521  char **book_type, int flag);
1522 
1523 
1524 /* ts A90904 */
1525 /** Guess the name of a manufacturer by profile number, manufacturer code
1526  and media code. The profile number can be obtained by
1527  burn_disc_get_profile(), the other two parameters can be obtained as
1528  media_code1 and media_code2 by burn_get_media_product_id().
1529  @param profile_no Profile number (submit -1 if not known)
1530  @param manuf_code Manufacturer code from media (e.g. "RICOHJPN")
1531  @param media_code Media ID code from media (e.g. "W11")
1532  @param flag Bitfield for control purposes, submit 0
1533  @return Printable text or NULL on memory shortage.
1534  If the text begins with "Unknown " then no item of the
1535  manufacturer list matched the codes.
1536  Dispose by free() when no longer needed.
1537  @since 0.7.2
1538 */
1539 char *burn_guess_manufacturer(int profile_no,
1540  char *manuf_code, char *media_code, int flag);
1541 
1542 
1543 /** Tells whether a disc can be erased or not
1544  @param d The drive to inquire.
1545  @return Non-zero means erasable
1546 */
1547 int burn_disc_erasable(struct burn_drive *d);
1548 
1549 /** Returns the progress and status of a drive.
1550  @param drive The drive to query busy state for.
1551  @param p Returns the progress of the operation, NULL if you don't care
1552  @return the current status of the drive. See also burn_drive_status.
1553 */
1554 enum burn_drive_status burn_drive_get_status(struct burn_drive *drive,
1555  struct burn_progress *p);
1556 
1557 /** Creates a write_opts struct for burning to the specified drive.
1558  The returned object must later be freed with burn_write_opts_free().
1559  @param drive The drive to write with
1560  @return The write_opts, NULL on error
1561 */
1562 struct burn_write_opts *burn_write_opts_new(struct burn_drive *drive);
1563 
1564 
1565 /* ts A70901 */
1566 /** Inquires the drive associated with a burn_write_opts object.
1567  @param opts object to inquire
1568  @return pointer to drive
1569  @since 0.4.0
1570 */
1571 struct burn_drive *burn_write_opts_get_drive(struct burn_write_opts *opts);
1572 
1573 
1574 /** Frees a write_opts struct created with burn_write_opts_new
1575  @param opts write_opts to free
1576 */
1577 void burn_write_opts_free(struct burn_write_opts *opts);
1578 
1579 /** Creates a read_opts struct for reading from the specified drive
1580  must be freed with burn_read_opts_free
1581  @param drive The drive to read from
1582  @return The read_opts
1583 */
1584 struct burn_read_opts *burn_read_opts_new(struct burn_drive *drive);
1585 
1586 /** Frees a read_opts struct created with burn_read_opts_new
1587  @param opts write_opts to free
1588 */
1589 void burn_read_opts_free(struct burn_read_opts *opts);
1590 
1591 /** Erase a disc in the drive. The drive must be grabbed successfully BEFORE
1592  calling this functions. Always ensure that the drive reports a status of
1593  BURN_DISC_FULL before calling this function. An erase operation is not
1594  cancellable, as control of the operation is passed wholly to the drive and
1595  there is no way to interrupt it safely.
1596  @param drive The drive with which to erase a disc.
1597  Only drive roles 1 (MMC) and 5 (stdio random write-only)
1598  support erasing.
1599  @param fast Nonzero to do a fast erase, where only the disc's headers are
1600  erased; zero to erase the medi or a
1508  text "XXmYYsZZf" from CD ATIP lead-out.
1509  @param book_type Book type text for DVD and BD.
1510  Caution: is NULL with CD, even if return value says ok.
1511  @param flag Bitfield for control purposes
1512  bit0= do not escape " _/" (not suitable for
1513  burn_guess_manufacturer())
1514  @return 1= ok, product_id and media codes are valid,
1515  0= no product id_available, reply parameters are NULL
1516  <0= error
1517  @since 0.7.2
1518 */
1519 int burn_disc_get_media_id(struct burn_drive *d,
1520  char **product_id, char **media_code1, char **media_code2,
1521  char **book_type, int flag);
1522 
1523 
1524 /* ts A90904 */
1525 /** Guess the name of a manufacturer by profile number, manufacturer code
1526  and media code. The profile number can be obtained by
1527  burn_disc_get_profile(), the other two parameters can be obtained as
1528  media_code1 and media_code2 by burn_get_media_product_id().
1529  @param profile_no Profile number (submit -1 if not known)
1530  @param manuf_code Manufacturer code from media (e.g. "RICOHJPN")
1531  @param media_code Media ID code from media (e.g. "W11")
1532  @param flag Bitfield for control purposes, submit 0
1533  @return Printable text or NULL on memory shortage.
1534  If the text begins with "Unknown " then no item of the
1535  manufacturer list matched the codes.
1536  Dispose by free() when no longer needed.
1537  @since 0.7.2
1538 */
1539 char *burn_guess_manufacturer(int profile_no,
1540  char *manuf_code, char *media_code, int flag);
1541 
1542 
1543 /** Tells whether a disc can be erased or not
1544  @param d The drive to inquire.
1545  @return Non-zero means erasable
1546 */
1547 int burn_disc_erasable(struct burn_drive *d);
1548 
1549 /** Returns the progress and status of a drive.
1550  @param drive The drive to query busy state for.
1551  @param p Returns the progress of the operation, NULL if you don't care
1552  @return the current status of the drive. See also burn_drive_status.
1553 */
1554 enum burn_drive_status burn_drive_get_status(struct burn_drive *drive,
1555  struct burn_progress *p);
1556 
1557 /** Creates a write_opts struct for burning to the specified drive.
1558  The returned object must later be freed with burn_write_opts_free().
1559  @param drive The drive to write with
1560  @return The write_opts, NULL on error
1561 */
1562 struct burn_write_opts *burn_write_opts_new(struct burn_drive *drive);
1563 
1564 
1565 /* ts A70901 */
1566 /** Inquires the drive associated with a burn_write_opts object.
1567  @param opts object to inquire
1568  @return pointer to drive
1569  @since 0.4.0
1570 */
1571 struct burn_drive *burn_write_opts_get_drive(struct burn_write_opts *opts);
1572 
1573 
1574 /** Frees a write_opts struct created with burn_write_opts_new
1575  @param opts write_opts to free
1576 */
1577 void burn_write_opts_free(struct burn_write_opts *opts);
1578 
1579 /** Creates a read_opts struct for reading from the specified drive
1580  must be freed with burn_read_opts_free
1581  @param drive The drive to read from
1582  @return The read_opts
1583 */
1584 struct burn_read_opts *burn_read_opts_new(struct burn_drive *drive);
1585 
1586 /** Frees a read_opts struct created with burn_read_opts_new
1587  @param opts write_opts to free
1588 */
1589 void burn_read_opts_free(struct burn_read_opts *opts);
1590 
1591 /** Erase a disc in the drive. The drive must be grabbed successfully BEFORE
1592  calling this functions. Always ensure that the drive reports a status of
1593  BURN_DISC_FULL before calling this function. An erase operation is not
1594  cancellable, as control of the operation is passed wholly to the drive and
1595  there is no way to interrupt it safely.
1596  @param drive The drive with which to erase a disc.
1597  Only drive roles 1 (MMC) and 5 (stdio random write-only)
1598  support erasing.
1599  @param fast Nonzero to do a fast erase, where only the disc's headers are
1600  erased; zero to erase the medi or a
1508  text "XXmYYsZZf" from CD ATIP lead-out.
1509  @param book_type Book type text for DVD and BD.
1510  Caution: is NULL with CD, even if return value says ok.
1511  @param flag Bitfield for control purposes
1512  bit0= do not escape " _/" (not suitable for
1513  burn_guess_manufacturer())
1514  @return 1= ok, product_id and media codes are valid,
1515  0= no product id_available, reply parameters are NULL
1516  <0= error
1517  @since 0.7.2
1518 */
1519 int burn_disc_get_media_id(struct burn_drive *d,
1520  char **product_id, char **media_code1, char **media_code2,
1521  char **book_type, int flag);
1522 
1523 
1524 /* ts A90904 */
1525 /** Guess the name of a manufacturer by profile number, manufacturer code
1526  and media code. The profile number can be obtained by
1527  burn_disc_get_profile(), the other two parameters can be obtained as
1528  media_code1 and media_code2 by burn_get_media_product_id().
1529  @param profile_no Profile number (submit -1 if not known)
1530  @param manuf_code Manufacturer code from media (e.g. "RICOHJPN")
1531  @param media_code Media ID code from media (e.g. "W11")
1532  @param flag Bitfield for control purposes, submit 0
1533  @return Printable text or NULL on memory shortage.
1534  If the text begins with "Unknown " then no item of the
1535  manufacturer list matched the codes.
1536  Dispose by free() when no longer needed.
1537  @since 0.7.2
1538 */
1539 char *burn_guess_manufacturer(int profile_no,
1540  char *manuf_code, char *media_code, int flag);
1541 
1542 
1543 /** Tells whether a disc can be erased or not
1544  @param d The drive to inquire.
1545  @return Non-zero means erasable
1546 */
1547 int burn_disc_erasable(struct burn_drive *d);
1548 
1549 /** Returns the progress and status of a drive.
1550  @param drive The drive to query busy state for.
1551  @param p Returns the progress of the operation, NULL if you don't care
1552  @return the current status of the drive. See also burn_drive_status.
1553 */
1554 enum burn_drive_status burn_drive_get_status(struct burn_drive *drive,
1555  struct burn_progress *p);
1556 
1557 /** Creates a write_opts struct for burning to the specified drive.
1558  The returned object must later be freed with burn_write_opts_free().
1559  @param drive The drive to write with
1560  @return The write_opts, NULL on error
1561 */
1562 struct burn_write_opts *burn_write_opts_new(struct burn_drive *drive);
1563 
1564 
1565 /* ts A70901 */
1566 /** Inquires the drive associated with a burn_write_opts object.
1567  @param opts object to inquire
1568  @return pointer to drive
1569  @since 0.4.0
1570 */
1571 struct burn_drive *burn_write_opts_get_drive(struct burn_write_opts *opts);
1572 
1573 
1574 /** Frees a write_opts struct created with burn_write_opts_new
1575  @param opts write_opts to free
1576 */
1577 void burn_write_opts_free(struct burn_write_opts *opts);
1578 
1579 /** Creates a read_opts struct for reading from the specified drive
1580  must be freed with burn_read_opts_free
1581  @param drive The drive to read from
1582  @return The read_opts
1583 */
1584 struct burn_read_opts *burn_read_opts_new(struct burn_drive *drive);
1585 
1586 /** Frees a read_opts struct created with burn_read_opts_new
1587  @param opts write_opts to free
1588 */
1589 void burn_read_opts_free(struct burn_read_opts *opts);
1590 
1591 /** Erase a disc in the drive. The drive must be grabbed successfully BEFORE
1592  calling this functions. Always ensure that the drive reports a status of
1593  BURN_DISC_FULL before calling this function. An erase operation is not
1594  cancellable, as control of the operation is passed wholly to the drive and
1595  there is no way to interrupt it safely.
1596  @param drive The drive with which to erase a disc.
1597  Only drive roles 1 (MMC) and 5 (stdio random write-only)
1598  support erasing.
1599  @param fast Nonzero to do a fast erase, where only the disc's headers are
1600  erased; zero to erase the medi or a
1508  text "XXmYYsZZf" from CD ATIP lead-out.
1509  @param book_type Book type text for DVD and BD.
1510  Caution: is NULL with CD, even if return value says ok.
1511  @param flag Bitfield for control purposes
1512  bit0= do not escape " _/" (not suitable for
1513  burn_guess_manufacturer())
1514  @return 1= ok, product_id and media codes are valid,
1515  0= no product id_available, reply parameters are NULL
1516  <0= error
1517  @since 0.7.2
1518 */
1519 int burn_disc_get_media_id(struct burn_drive *d,
1520  char **product_id, char **media_code1, char **media_code2,
1521  char **book_type, int flag);
1522 
1523 
1524 /* ts A90904 */
1525 /** Guess the name of a manufacturer by profile number, manufacturer code
1526  and media code. The profile number can be obtained by
1527  burn_disc_get_profile(), the other two parameters can be obtained as
1528  media_code1 and media_code2 by burn_get_media_product_id().
1529  @param profile_no Profile number (submit -1 if not known)
1530  @param manuf_code Manufacturer code from media (e.g. "RICOHJPN")
1531  @param media_code Media ID code from media (e.g. "W11")
1532  @param flag Bitfield for control purposes, submit 0
1533  @return Printable text or NULL on memory shortage.
1534  If the text begins with "Unknown " then no item of the
1535  manufacturer list matched the codes.
1536  Dispose by free() when no longer needed.
1537  @since 0.7.2
1538 */
1539 char *burn_guess_manufacturer(int profile_no,
1540  char *manuf_code, char *media_code, int flag);
1541 
1542 
1543 /** Tells whether a disc can be erased or not
1544  @param d The drive to inquire.
1545  @return Non-zero means erasable
1546 */
1547 int burn_disc_erasable(struct burn_drive *d);
1548 
1549 /** Returns the progress and status of a drive.
1550  @param drive The drive to query busy state for.
1551  @param p Returns the progress of the operation, NULL if you don't care
1552  @return the current status of the drive. See also burn_drive_status.
1553 */
1554 enum burn_drive_status burn_drive_get_status(struct burn_drive *drive,
1555  struct burn_progress *p);
1556 
1557 /** Creates a write_opts struct for burning to the specified drive.
1558  The returned object must later be freed with burn_write_opts_free().
1559  @param drive The drive to write with
1560  @return The write_opts, NULL on error
1561 */
1562 struct burn_write_opts *burn_write_opts_new(struct burn_drive *drive);
1563 
1564 
1565 /* ts A70901 */
1566 /** Inquires the drive associated with a burn_write_opts object.
1567  @param opts object to inquire
1568  @return pointer to drive
1569  @since 0.4.0
1570 */
1571 struct burn_drive *burn_write_opts_get_drive(struct burn_write_opts *opts);
1572 
1573 
1574 /** Frees a write_opts struct created with burn_write_opts_new
1575  @param opts write_opts to free
1576 */
1577 void burn_write_opts_free(struct burn_write_opts *opts);
1578 
1579 /** Creates a read_opts struct for reading from the specified drive
1580  must be freed with burn_read_opts_free
1581  @param drive The drive to read from
1582  @return The read_opts
1583 */
1584 struct burn_read_opts *burn_read_opts_new(struct burn_drive *drive);
1585 
1586 /** Frees a read_opts struct created with burn_read_opts_new
1587  @param opts write_opts to free
1588 */
1589 void burn_read_opts_free(struct burn_read_opts *opts);
1590 
1591 /** Erase a disc in the drive. The drive must be grabbed successfully BEFORE
1592  calling this functions. Always ensure that the drive reports a status of
1593  BURN_DISC_FULL before calling this function. An erase operation is not
1594  cancellable, as control of the operation is passed wholly to the drive and
1595  there is no way to interrupt it safely.
1596  @param drive The drive with which to erase a disc.
1597  Only drive roles 1 (MMC) and 5 (stdio random write-only)
1598  support erasing.
1599  @param fast Nonzero to do a fast erase, where only the disc's headers are
1600  erased; zero to erase the medi or a
1508  text "XXmYYsZZf" from CD ATIP lead-out.
1509  @param book_type Book type text for DVD and BD.
1510  Caution: is NULL with CD, even if return value says ok.
1511  @param flag Bitfield for control purposes
1512  bit0= do not escape " _/" (not suitable for
1513  burn_guess_manufacturer())
1514  @return 1= ok, product_id and media codes are valid,
1515  0= no product id_available, reply parameters are NULL
1516  <0= error
1517  @since 0.7.2
1518 */
1519 int burn_disc_get_media_id(struct burn_drive *d,
1520  char **product_id, char **media_code1, char **media_code2,
1521  char **book_type, int flag);
1522 
1523 
1524 /* ts A90904 */
1525 /** Guess the name of a manufacturer by profile number, manufacturer code
1526  and media code. The profile number can be obtained by
1527  burn_disc_get_profile(), the other two parameters can be obtained as
1528  media_code1 and media_code2 by burn_get_media_product_id().
1529  @param profile_no Profile number (submit -1 if not known)
1530  @param manuf_code Manufacturer code from media (e.g. "RICOHJPN")
1531  @param media_code Media ID code from media (e.g. "W11")
1532  @param flag Bitfield for control purposes, submit 0
1533  @return Printable text or NULL on memory shortage.
1534  If the text begins with "Unknown " then no item of the
1535  manufacturer list matched the codes.
1536  Dispose by free() when no longer needed.
1537  @since 0.7.2
1538 */
1539 char *burn_guess_manufacturer(int profile_no,
1540  char *manuf_code, char *media_code, int flag);
1541 
1542 
1543 /** Tells whether a disc can be erased or not
1544  @param d The drive to inquire.
1545  @return Non-zero means erasable
1546 */
1547 int burn_disc_erasable(struct burn_drive *d);
1548 
1549 /** Returns the progress and status of a drive.
1550  @param drive The drive to query busy state for.
1551  @param p Returns the progress of the operation, NULL if you don't care
1552  @return the current status of the drive. See also burn_drive_status.
1553 */
1554 enum burn_drive_status burn_drive_get_status(struct burn_drive *drive,
1555  struct burn_progress *p);
1556 
1557 /** Creates a write_opts struct for burning to the specified drive.
1558  The returned object must later be freed with burn_write_opts_free().
1559  @param drive The drive to write with
1560  @return The write_opts, NULL on error
1561 */
1562 struct burn_write_opts *burn_write_opts_new(struct burn_drive *drive);
1563 
1564 
1565 /* ts A70901 */
1566 /** Inquires the drive associated with a burn_write_opts object.
1567  @param opts object to inquire
1568  @return pointer to drive
1569  @since 0.4.0
1570 */
1571 struct burn_drive *burn_write_opts_get_drive(struct burn_write_opts *opts);
1572 
1573 
1574 /** Frees a write_opts struct created with burn_write_opts_new
1575  @param opts write_opts to free
1576 */
1577 void burn_write_opts_free(struct burn_write_opts *opts);
1578 
1579 /** Creates a read_opts struct for reading from the specified drive
1580  must be freed with burn_read_opts_free
1581  @param drive The drive to read from
1582  @return The read_opts
1583 */
1584 struct burn_read_opts *burn_read_opts_new(struct burn_drive *drive);
1585 
1586 /** Frees a read_opts struct created with burn_read_opts_new
1587  @param opts write_opts to free
1588 */
1589 void burn_read_opts_free(struct burn_read_opts *opts);
1590 
1591 /** Erase a disc in the drive. The drive must be grabbed successfully BEFORE
1592  calling this functions. Always ensure that the drive reports a status of
1593  BURN_DISC_FULL before calling this function. An erase operation is not
1594  cancellable, as control of the operation is passed wholly to the drive and
1595  there is no way to interrupt it safely.
1596  @param drive The drive with which to erase a disc.
1597  Only drive roles 1 (MMC) and 5 (stdio random write-only)
1598  support erasing.
1599  @param fast Nonzero to do a fast erase, where only the disc's headers are
1600  erased; zero to erase the medi or a
1508  text "XXmYYsZZf" from CD ATIP lead-out.
1509  @param book_type Book type text for DVD and BD.
1510  Caution: is NULL with CD, even if return value says ok.
1511  @param flag Bitfield for control purposes
1512  bit0= do not escape " _/" (not suitable for
1513  burn_guess_manufacturer())
1514  @return 1= ok, product_id and media codes are valid,
1515  0= no product id_available, reply parameters are NULL
1516  <0= error
1517  @since 0.7.2
1518 */
1519 int burn_disc_get_media_id(struct burn_drive *d,
1520  char **product_id, char **media_code1, char **media_code2,
1521  char **book_type, int flag);
1522 
1523 
1524 /* ts A90904 */
1525 /** Guess the name of a manufacturer by profile number, manufacturer code
1526  and media code. The profile number can be obtained by
1527  burn_disc_get_profile(), the other two parameters can be obtained as
1528  media_code1 and media_code2 by burn_get_media_product_id().
1529  @param profile_no Profile number (submit -1 if not known)
1530  @param manuf_code Manufacturer code from media (e.g. "RICOHJPN")
1531  @param media_code Media ID code from media (e.g. "W11")
1532  @param flag Bitfield for control purposes, submit 0
1533  @return Printable text or NULL on memory shortage.
1534  If the text begins with "Unknown " then no item of the
1535  manufacturer list matched the codes.
1536  Dispose by free() when no longer needed.
1537  @since 0.7.2
1538 */
1539 char *burn_guess_manufacturer(int profile_no,
1540  char *manuf_code, char *media_code, int flag);
1541 
1542 
1543 /** Tells whether a disc can be erased or not
1544  @param d The drive to inquire.
1545  @return Non-zero means erasable
1546 */
1547 int burn_disc_erasable(struct burn_drive *d);
1548 
1549 /** Returns the progress and status of a drive.
1550  @param drive The drive to query busy state for.
1551  @param p Returns the progress of the operation, NULL if you don't care
1552  @return the current status of the drive. See also burn_drive_status.
1553 */
1554 enum burn_drive_status burn_drive_get_status(struct burn_drive *drive,
1555  struct burn_progress *p);
1556 
1557 /** Creates a write_opts struct for burning to the specified drive.
1558  The returned object must later be freed with burn_write_opts_free().
1559  @param drive The drive to write with
1560  @return The write_opts, NULL on error
1561 */
1562 struct burn_write_opts *burn_write_opts_new(struct burn_drive *drive);
1563 
1564 
1565 /* ts A70901 */
1566 /** Inquires the drive associated with a burn_write_opts object.
1567  @param opts object to inquire
1568  @return pointer to drive
1569  @since 0.4.0
1570 */
1571 struct burn_drive *burn_write_opts_get_drive(struct burn_write_opts *opts);
1572 
1573 
1574 /** Frees a write_opts struct created with burn_write_opts_new
1575  @param opts write_opts to free
1576 */
1577 void burn_write_opts_free(struct burn_write_opts *opts);