libisoburn  1.3.6
libisoburn.h
Go to the documentation of this file.
1 
2 /*
3  Lower level API definition of libisoburn.
4 
5  Copyright 2007-2014 Vreixo Formoso Lopes <metalpain2002@yahoo.es>
6  and Thomas Schmitt <scdbackup@gmx.net>
7  Provided under GPL version 2 or later.
8 */
9 
10 /** Overview
11 
12 libisoburn is a frontend for libraries libburn and libisofs which enables
13 creation and expansion of ISO-9660 filesystems on all CD/DVD/BD media supported
14 by libburn. This includes media like DVD+RW, which do not support multi-session
15 management on media level and even plain disk files or block devices.
16 
17 The price for that is thorough specialization on data files in ISO-9660
18 filesystem images. So libisoburn is not suitable for audio (CD-DA) or any
19 other CD layout which does not entirely consist of ISO-9660 sessions.
20 
21 Note that there is a higher level of API: xorriso.h. One should not mix it
22 with the API calls of libisoburn.h, libisofs.h, and libburn.h.
23 
24 
25  Connector functions
26 
27 libisofs and libburn do not depend on each other but share some interfaces
28 by which they can cooperate.
29 libisoburn establishes the connection between both modules by creating the
30 necessary interface objects and attaching them to the right places.
31 
32 
33  Wrapper functions
34 
35 The priciple of this frontend is that you may use any call of libisofs or
36 libburn unless it has a isoburn_*() wrapper listed in the following function
37 documentation.
38 
39 E.g. call isoburn_initialize() rather than iso_init(); burn_initialize();
40 and call isoburn_drive_scan_and_grab() rather than burn_drive_scan_and_grab().
41 But you may call burn_disc_get_profile() directly if you want to display
42 the media type.
43 
44 The wrappers will transparently provide the necessary emulations which
45 are appropriate for particular target drives and media states.
46 To learn about them you have to read both API descriptions: the one of
47 the wrapper and the one of the underlying libburn or libisofs call.
48 
49 Macros BURN_* and functions burn_*() are documented in <libburn/libburn.h>
50 Macros ISO_* and functions iso_*() are documented in <libisofs/libisofs.h>
51 
52 
53  Usage model
54 
55 There may be an input drive and an output drive. Either of them may be missing
56 with the consequence that no reading resp. writing is possible.
57 Both drive roles can be fulfilled by the same drive.
58 
59 Input can be a random access readable libburn drive:
60  optical media, regular files, block devices.
61 Output can be any writeable libburn drive:
62  writeable optical media in burner, writeable file objects (no directories).
63 
64 libburn demands rw-permissions to drive device file resp. file object.
65 
66 If the input drive provides a suitable ISO RockRidge image, then its tree
67 may be loaded into memory and can then be manipulated by libisofs API calls.
68 The loading is done by isoburn_read_image() under control of
69 struct isoburn_read_opts which the application obtains from libisoburn
70 and manipulates by the family of isoburn_ropt_set_*() functions.
71 
72 Writing of result images is controlled by libisofs related parameters
73 in a struct isoburn_imgen_opts which the application obtains from libisoburn
74 and manipulates by the family of isoburn_igopt_set_*() functions.
75 
76 All multi-session aspects are handled by libisoburn according to these
77 settings. The application does not have to analyze media state and write
78 job parameters. It rather states its desires which libisoburn tries to
79 fulfill, or else will refuse to start the write run.
80 
81 
82  Setup for Growing, Modifying or Blind Growing
83 
84 The connector function family offers alternative API calls for performing
85 the setup for several alternative image generation strategies.
86 
87 Growing:
88 If input and output drive are the same, then isoburn_prepare_disc() is to
89 be used. It will lead to an add-on session on appendable or overwriteable
90 media with existing ISO image. With blank media it will produce a first
91 session.
92 
93 Modifying:
94 If the output drive is not the input drive, and if it bears blank media
95 or overwriteable without a valid ISO image, then one may produce a consolidated
96 image with old and new data. This will copy file data from an eventual input
97 drive with valid image, add any newly introduced data from the local
98 filesystem, and produce a first session on output media.
99 To prepare for such an image generation run, use isoburn_prepare_new_image().
100 
101 Blind Growing:
102 This method reads the old image from one drive and writes the add-on session
103 to a different drive. That output drive is nevertheless supposed to
104 finally lead to the same medium from where the session was loaded. Usually it
105 will be stdio:/dev/fd/1 (i.e. stdout) being piped into some burn program
106 like with this classic gesture:
107  mkisofs -M $dev -C $msc1,$nwa | cdrecord -waiti dev=$dev
108 Blind growing is prepared by the call isoburn_prepare_blind_grow().
109 The input drive should be released immediately after this call in order
110 to allow the consumer of the output stream to access that drive for writing.
111 
112 After either of these setups, some peripheral libburn drive parameter settings
113 like burn_write_opts_set_simulate(), burn_write_opts_set_multi(),
114  burn_drive_set_speed(), burn_write_opts_set_underrun_proof() should be made.
115 Do not set the write mode. It will be chosen by libisoburn so it matches job
116 and media state.
117 
118  Writing the image
119 
120 Then one may start image generation and write threads by isoburn_disc_write().
121 Progress may be watched at the output drive by burn_drive_get_status() and
122 isoburn_get_fifo_status().
123 
124 At some time, the output drive will be BURN_DRIVE_IDLE indicating that
125 writing has ended.
126 One should inquire isoburn_drive_wrote_well() to learn about overall success.
127 
128 Finally one must call isoburn_activate_session() which will complete any
129 eventual multi-session emulation.
130 
131 
132  Application Constraints
133 
134 Applications shall include libisofs/libisofs.h , libburn/libburn.h and this
135 file itself: libisoburn/libisoburn.h .
136 They shall link with -lisofs -lburn -lisoburn or with the .o files emerging
137 from building those libraries from their sources.
138 
139 Applications must use 64 bit off_t.
140 E.g. on 32-bit GNU/Linux by defining
141  #define _LARGEFILE_SOURCE
142  #define _FILE_OFFSET_BITS 64
143 The minimum requirement is to interface with the library by 64 bit signed
144 integers where libisofs.h or libisoburn.h prescribe off_t.
145 Failure to do so may result in surprising malfunction or memory faults.
146 
147 Application files which include libisofs/libisofs.h or libisoburn/libisoburn.h
148 must provide definitions for uint32_t and uint8_t.
149 This can be achieved either:
150 - by using autotools which will define HAVE_STDINT_H or HAVE_INTTYPES_H
151  according to its ./configure tests,
152 - or by defining the macros HAVE_STDINT_H resp. HAVE_INTTYPES_H according
153  to the local situation,
154 - or by appropriately defining uint32_t and uint8_t by other means,
155  e.g. by including inttypes.h before including libisofs.h and libisoburn.h
156 
157 */
158 #ifdef HAVE_STDINT_H
159 #include <stdint.h>
160 #else
161 #ifdef HAVE_INTTYPES_H
162 #include <inttypes.h>
163 #endif
164 #endif
165 
166 
167 /* Important: If you add a public API function then add its name to file
168  libisoburn/libisoburn.ver
169 */
170 
171 
172  /* API functions */
173 
174 
175 /** Initialize libisoburn, libisofs and libburn.
176  Wrapper for : iso_init() and burn_initialize()
177  @since 0.1.0
178  @param msg A character array for eventual messages (e.g. with errors)
179  @param flag Bitfield for control purposes (unused yet, submit 0)
180  @return 1 indicates success, 0 is failure
181 */
182 int isoburn_initialize(char msg[1024], int flag);
183 
184 
185 /** Check whether all features of header file libisoburn.h from the given
186  major.minor.micro revision triple can be delivered by the library version
187  which is performing this call.
188  An application of libisoburn can easily memorize the version of the
189  libisoburn.h header in its own code. Immediately after isoburn_initialize()
190  it should simply do this check:
191  if (! isoburn_is_compatible(isoburn_header_version_major,
192  isoburn_header_version_minor,
193  isoburn_header_version_micro, 0))
194  ...refuse to start the program with this dynamic library version...
195  @since 0.1.0
196  @param major obtained at build time
197  @param minor obtained at build time
198  @param micro obtained at build time
199  @param flag Bitfield for control purposes. Unused yet. Submit 0.
200  @return 1= library can work for caller
201  0= library is not usable in some aspects. Caller must restrict
202  itself to an earlier API version or must not use this libray
203  at all.
204 */
205 int isoburn_is_compatible(int major, int minor, int micro, int flag);
206 
207 
208 /** Obtain the three release version numbers of the library. These are the
209  numbers encountered by the application when linking with libisoburn,
210  i.e. possibly not before run time.
211  Better do not base the fundamental compatibility decision of an application
212  on these numbers. For a reliable check use isoburn_is_compatible().
213  @since 0.1.0
214  @param major The maturity version (0 for now, as we are still learning)
215  @param minor The development goal version.
216  @param micro The development step version. This has an additional meaning:
217 
218  Pare numbers indicate a version with frozen API. I.e. you can
219  rely on the same set of features to be present in all
220  published releases with that major.minor.micro combination.
221  Features of a pare release will stay available and ABI
222  compatible as long as the SONAME of libisoburn stays "1".
223  Currently there are no plans to ever change the SONAME.
224 
225  Odd numbers indicate that API upgrades are in progress.
226  I.e. new features might be already present or they might
227  be still missing. Newly introduced features may be changed
228  incompatibly or even be revoked before release of a pare
229  version.
230  So micro revisions {1,3,5,7,9} should never be used for
231  dynamic linking unless the proper library match can be
232  guaranteed by external circumstances.
233 
234  @return 1 success, <=0 might in future become an error indication
235 */
236 void isoburn_version(int *major, int *minor, int *micro);
237 
238 
239 /** The minimum version of libisofs to be used with this version of libisoburn
240  at compile time.
241  @since 0.1.0
242 */
243 #define isoburn_libisofs_req_major 1
244 #define isoburn_libisofs_req_minor 3
245 #define isoburn_libisofs_req_micro 6
246 
247 /** The minimum version of libburn to be used with this version of libisoburn
248  at compile time.
249  @since 0.1.0
250 */
251 #define isoburn_libburn_req_major 1
252 #define isoburn_libburn_req_minor 3
253 #define isoburn_libburn_req_micro 6
254 
255 /** The minimum compile time requirements of libisoburn towards libjte are
256  the same as of a suitable libisofs towards libjte.
257  So use these macros from libisofs.h :
258  iso_libjte_req_major
259  iso_libjte_req_minor
260  iso_libjte_req_micro
261  @since 0.6.4
262 */
263 
264 /** The minimum version of libisofs to be used with this version of libisoburn
265  at runtime. This is checked already in isoburn_initialize() which will
266  refuse on outdated version. So this call is for information purposes after
267  successful startup only.
268  @since 0.1.0
269  @param major isoburn_libisofs_req_major as seen at build time
270  @param minor as seen at build time
271  @param micro as seen at build time
272  @return 1 success, <=0 might in future become an error indication
273 */
274 int isoburn_libisofs_req(int *major, int *minor, int *micro);
275 
276 
277 /** The minimum version of libjte to be used with this version of libisoburn
278  at runtime. The use of libjte is optional and depends on configure
279  tests. It can be prevented by ./configure option --disable-libjte .
280  This is checked already in isoburn_initialize() which will refuse on
281  outdated version. So this call is for information purposes after
282  successful startup only.
283  @since 0.6.4
284 */
285 int isoburn_libjte_req(int *major, int *minor, int *micro);
286 
287 
288 /** The minimum version of libburn to be used with this version of libisoburn
289  at runtime. This is checked already in isoburn_initialize() which will
290  refuse on outdated version. So this call is for information purposes after
291  successful startup only.
292  @since 0.1.0
293  @param major isoburn_libburn_req_major as seen at build time
294  @param minor as seen at build time
295  @param micro as seen at build time
296  @return 1 success, <=0 might in future become an error indication
297 */
298 int isoburn_libburn_req(int *major, int *minor, int *micro);
299 
300 
301 /** These three release version numbers tell the revision of this header file
302  and of the API it describes. They are memorized by applications at build
303  time.
304  @since 0.1.0
305 */
306 #define isoburn_header_version_major 1
307 #define isoburn_header_version_minor 3
308 #define isoburn_header_version_micro 6
309 /** Note:
310  Above version numbers are also recorded in configure.ac because libtool
311  wants them as parameters at build time.
312  For the library compatibility check, ISOBURN_*_VERSION in configure.ac
313  are not decisive. Only the three numbers here do matter.
314 */
315 /** Usage discussion:
316 
317 Some developers of the libburnia project have differing
318 opinions how to ensure the compatibility of libaries
319 and applications.
320 
321 It is about whether to use at compile time and at runtime
322 the version numbers isoburn_header_version_* provided here.
323 Thomas Schmitt advises to use them.
324 Vreixo Formoso advises to use other means.
325 
326 At compile time:
327 
328 Vreixo Formoso advises to leave proper version matching
329 to properly programmed checks in the the application's
330 build system, which will eventually refuse compilation.
331 
332 Thomas Schmitt advises to use the macros defined here
333 for comparison with the application's requirements of
334 library revisions and to eventually break compilation.
335 
336 Both advises are combinable. I.e. be master of your
337 build system and have #if checks in the source code
338 of your application, nevertheless.
339 
340 At runtime (via *_is_compatible()):
341 
342 Vreixo Formoso advises to compare the application's
343 requirements of library revisions with the runtime
344 library. This is to allow runtime libraries which are
345 young enough for the application but too old for
346 the lib*.h files seen at compile time.
347 
348 Thomas Schmitt advises to compare the header
349 revisions defined here with the runtime library.
350 This is to enforce a strictly monotonous chain
351 of revisions from app to header to library,
352 at the cost of excluding some older libraries.
353 
354 These two advises are mutually exclusive.
355 
356 -----------------------------------------------------
357 
358 For an implementation of the Thomas Schmitt approach,
359 see libisoburn/burn_wrap.c : isoburn_initialize()
360 This connects libisoburn as "application" with libisofs
361 as "library".
362 
363 The compatible part of Vreixo Formoso's approach is implemented
364 in configure.ac LIBBURN_REQUIRED, LIBISOFS_REQUIRED.
365 In isoburn_initialize() it would rather test by
366  iso_lib_is_compatible(isoburn_libisofs_req_major,...
367 than by
368  iso_lib_is_compatible(iso_lib_header_version_major,...
369 and would leave out the ugly compile time traps.
370 
371 */
372 
373 
374 /** Announce to the library an application provided method for immediate
375  delivery of messages. It is used when no drive is affected directly or
376  if the drive has no own msgs_submit() method attached by
377  isoburn_drive_set_msgs_submit.
378  If no method is preset or if the method is set to NULL then libisoburn
379  delivers its messages through the message queue of libburn.
380  @param msgs_submit The function call which implements the method
381  @param submit_handle Handle to be used as first argument of msgs_submit
382  @param submit_flag Flag to be used as last argument of msgs_submit
383  @param flag Unused yet, submit 0
384  @since 0.2.0
385 */
386 int isoburn_set_msgs_submit(int (*msgs_submit)(void *handle, int error_code,
387  char msg_text[], int os_errno,
388  char severity[], int flag),
389  void *submit_handle, int submit_flag, int flag);
390 
391 
392 /** Acquire a target drive by its filesystem path resp. libburn persistent
393  address.
394  Wrapper for: burn_drive_scan_and_grab()
395  @since 0.1.0
396  @param drive_infos On success returns a one element array with the drive
397  (cdrom/burner). Thus use with driveno 0 only. On failure
398  the array has no valid elements at all.
399  The returned array should be freed via burn_drive_info_free()
400  when the drive is no longer needed. But before this is done
401  one has to call isoburn_drive_release(drive_infos[0].drive).
402  @param adr The persistent address of the desired drive.
403  @param load 1 attempt to load the disc tray. 0 no attempt,rather failure.
404  @return 1 = success , 0 = drive not found , <0 = other error
405 */
406 int isoburn_drive_scan_and_grab(struct burn_drive_info *drive_infos[],
407  char* adr, int load);
408 
409 
410 /** Acquire a target drive by its filesystem path resp. libburn persistent
411  address. This is a modern successor of isoburn_drive_scan_and_grab().
412  Wrapper for: burn_drive_scan_and_grab()
413  @since 0.1.2
414  @param drive_infos On success returns a one element array with the drive
415  (cdrom/burner). Thus use with driveno 0 only. On failure
416  the array has no valid elements at all.
417  The returned array should be freed via burn_drive_info_free()
418  when the drive is no longer needed. But before this is done
419  one has to call isoburn_drive_release(drive_infos[0].drive).
420  @param adr The persistent address of the desired drive.
421  @param flag bit0= attempt to load the disc tray.
422  Else: failure if not loaded.
423  bit1= regard overwriteable media as blank
424  bit2= if the drive is a regular disk file:
425  truncate it to the write start address when writing
426  begins
427  bit3= if the drive reports a read-only profile try to read
428  table of content by scanning for ISO image headers.
429  (depending on media type and drive this might
430  help or it might make the resulting toc even worse)
431  bit4= do not emulate table of content on overwriteable media
432  bit5= ignore ACL from external filesystems
433  bit6= ignore POSIX Extended Attributes from external
434  filesystems
435  bit7= pretend read-only profile and scan for table of content
436  bit8= re-assess already acquired (*drive_infos)[0] rather
437  than aquiring adr
438  @since 1.1.8
439  bit9= when scanning for ISO 9660 sessions by bit3:
440  Do not demand a valid superblock at LBA 0, ignore it in
441  favor of one at LBA 32, and scan until end of medium.
442  @since 1.2.6
443  @return 1 = success , 0 = drive not found , <0 = other error
444 
445  Please excuse the typo "aquire" in the function name.
446 */
447 int isoburn_drive_aquire(struct burn_drive_info *drive_infos[],
448  char* adr, int flag);
449 
450 /** Acquire a drive from the burn_drive_info[] array which was obtained by
451  a previous call of burn_drive_scan().
452  Wrapper for: burn_drive_grab()
453  @since 0.1.0
454  @param drive The drive to grab. E.g. drive_infos[1].drive .
455  Call isoburn_drive_release(drive) when it it no longer needed.
456  @param load 1 attempt to load the disc tray. 0 no attempt, rather failure.
457  @return 1 success, <=0 failure
458 */
459 int isoburn_drive_grab(struct burn_drive *drive, int load);
460 
461 
462 /** Attach to a drive an application provided method for immediate
463  delivery of messages.
464  If no method is set or if the method is set to NULL then libisoburn
465  delivers messages of the drive through the global msgs_submit() method
466  set by isoburn_set_msgs_submiti() or by the message queue of libburn.
467  @since 0.2.0
468  @param d The drive to which this function, handle and flag shall apply
469  @param msgs_submit The function call which implements the method
470  @param submit_handle Handle to be used as first argument of msgs_submit
471  @param submit_flag Flag to be used as last argument of msgs_submit
472  @param flag Unused yet, submit 0
473 */
474 int isoburn_drive_set_msgs_submit(struct burn_drive *d,
475  int (*msgs_submit)(void *handle, int error_code,
476  char msg_text[], int os_errno,
477  char severity[], int flag),
478  void *submit_handle, int submit_flag, int flag);
479 
480 
481 /** Inquire the medium status. Expect the whole spectrum of libburn BURN_DISC_*
482  with multi-session media. Emulated states with random access media are
483  BURN_DISC_BLANK and BURN_DISC_APPENDABLE.
484  Wrapper for: burn_disc_get_status()
485  @since 0.1.0
486  @param drive The drive to inquire.
487  @return The status of the drive, or what kind of disc is in it.
488  Note: BURN_DISC_UNGRABBED indicates wrong API usage
489 */
490 #ifdef __cplusplus
491 enum burn::burn_disc_status isoburn_disc_get_status(struct burn_drive *drive);
492 #else
493 enum burn_disc_status isoburn_disc_get_status(struct burn_drive *drive);
494 #endif
495 
496 
497 /** Tells whether the medium can be treated by isoburn_disc_erase().
498  Wrapper for: burn_disc_erasable()
499  @since 0.1.0
500  @param d The drive to inquire.
501  @return 0=not erasable , else erasable
502 */
503 int isoburn_disc_erasable(struct burn_drive *d);
504 
505 
506 /** Mark the medium as blank. With multi-session media this will call
507  burn_disc_erase(). With random access media, an eventual ISO-9660
508  filesystem will get invalidated by altering its start blocks on the medium.
509  In case of success, the medium is in status BURN_DISC_BLANK afterwards.
510  Wrapper for: burn_disc_erase()
511  @since 0.1.0
512  @param drive The drive with the medium to erase.
513  @param fast 1=fast erase, 0=thorough erase
514  With DVD-RW, fast erase yields media incapable of multi-session.
515 */
516 void isoburn_disc_erase(struct burn_drive *drive, int fast);
517 
518 
519 /** Set up isoburn_disc_get_msc1() to return a fabricated value.
520  This makes only sense between aquiring the drive and reading the
521  image. After isoburn_read_image() it will confuse the coordination
522  of libisoburn and libisofs.
523  Note: Sessions and tracks are counted beginning with 1, not with 0.
524  @since 0.1.6
525  @param d The drive where msc1 is to be set
526  @param adr_mode Determines how to interpret adr_value and to set msc1.
527  If adr_value shall represent a number then decimal ASCII
528  digits are expected.
529  0= start lba of last session in TOC, ignore adr_value
530  1= start lba of session number given by adr_value
531  2= start lba of track given number by adr_value
532  3= adr_value itself is the lba to be used
533  4= start lba of last session with volume id
534  given by adr_value
535  @param adr_value A string describing the value to be eventually used.
536  @param flag Bitfield for control purposes.
537  bit0= @since 0.2.2
538  with adr_mode 3: adr_value might be 16 blocks too high
539  (e.g. -C stemming from growisofs). Probe for ISO head
540  at adr_value-16 and eventually adjust setting.
541  bit1= insist in seeing a disc object with at least one session
542  bit2= with adr_mode 4: use adr_value as regular expression
543 */
544 int isoburn_set_msc1(struct burn_drive *d, int adr_mode, char *adr_value,
545  int flag);
546 
547 
548 /* ----------------------------------------------------------------------- */
549 /*
550 
551  Wrappers for emulation of TOC on overwriteable media
552 
553  Media which match the overwriteable usage model lack of a history of sessions
554  and tracks. libburn will not even hand out a burn_disc object for them and
555  always declare them blank. libisoburn checks for a valid ISO filesystem
556  header at LBA 0 and eventually declares them appendable.
557  Nevertheless one can only determine an upper limit of the size of the overall
558  image (by isoburn_get_min_start_byte()) but not a list of stored sessions
559  and their LBAs, as it is possible with true multi-session media.
560 
561  The following wrappers add the capability to obtain a session and track TOC
562  from emulated multi-session images on overwriteables if the first session
563  was written by libisoburn-0.1.6 or later (i.e. with a header copy at LBA 32).
564 
565  Be aware that the structs emitted by these isoburn calls are not compatible
566  with the libburn structs. I.e. you may use them only with isoburn_toc_*
567  calls.
568  isoburn_toc_disc needs to be freed after use. isoburn_toc_session and
569  isoburn_toc_track vanish together with their isoburn_toc_disc.
570 */
571 
572 /* Opaque handles to media, session, track */
573 struct isoburn_toc_disc;
574 struct isoburn_toc_session;
575 struct isoburn_toc_track;
576 
577 
578 /** Obtain a master handle for the table of content.
579  This handle governs allocated resources which have to be released by
580  isoburn_toc_disc_free() when no longer needed.
581  Wrapper for: burn_drive_get_disc()
582  @since 0.1.6
583  @param d The drive with the medium to inspect
584  @return NULL in case there is no content info, else it is a valid handle
585 */
586 struct isoburn_toc_disc *isoburn_toc_drive_get_disc(struct burn_drive *d);
587 
588 
589 /** Tell the number of 2048 byte blocks covered by the table of content.
590  This number includes the eventual gaps between sessions and tracks.
591  So this call is not really a wrapper for burn_disc_get_sectors().
592  @since 0.1.6
593  @param disc The master handle of the medium
594  @return Number of blocks, <=0 indicates unknown or unreadable state
595 */
596 int isoburn_toc_disc_get_sectors(struct isoburn_toc_disc *disc);
597 
598 
599 /** Get the array of session handles and the number of complete sessions
600  from the table of content.
601  The result array contains *num + isoburn_toc_disc_get_incmpl_sess()
602  elements. All above *num are incomplete sessions.
603  Typically there is at most one incomplete session with no track.
604  Wrapper for: burn_disc_get_sessions()
605  @since 0.1.6
606  @param disc The master handle of the medium
607  @param num returns the number of sessions in the array
608  @return the address of the array of session handles
609 */
610 struct isoburn_toc_session **isoburn_toc_disc_get_sessions(
611  struct isoburn_toc_disc *disc, int *num);
612 
613 
614 /** Obtain the number of incomplete sessions which are recorded in the
615  result array of isoburn_toc_disc_get_sessions() after the complete
616  sessions. See above.
617  @since 1.2.8
618  @param disc The master handle of the medium
619  @return the number of incomplete sessions
620 */
621 int isoburn_toc_disc_get_incmpl_sess(struct isoburn_toc_disc *disc);
622 
623 
624 /** Tell the number of 2048 byte blocks covered by a particular session.
625  Wrapper for: burn_session_get_sectors()
626  @since 0.1.6
627  @param s The session handle
628  @return number of blocks, <=0 indicates unknown or unreadable state
629 */
630 int isoburn_toc_session_get_sectors(struct isoburn_toc_session *s);
631 
632 
633 /** Obtain a copy of the entry which describes the end of a particular session.
634  Wrapper for: burn_session_get_leadout_entry()
635  @since 0.1.6
636  @param s The session handle
637  @param entry A pointer to memory provided by the caller. It will be filled
638  with info according to struct burn_toc_entry as defined
639  in libburn.h
640 */
641 void isoburn_toc_session_get_leadout_entry(struct isoburn_toc_session *s,
642  struct burn_toc_entry *entry);
643 
644 
645 /** Get the array of track handles from a particular session.
646  Wrapper for: burn_session_get_tracks()
647  @since 0.1.6
648  @param s The session handle
649  @param num returns the number of tracks in the array
650  @return the address of the array of track handles,
651  NULL if no tracks are registered with session s
652 */
653 struct isoburn_toc_track **isoburn_toc_session_get_tracks(
654  struct isoburn_toc_session *s, int *num);
655 
656 
657 /** Obtain a copy of the entry which describes a particular track.
658  Wrapper for: burn_track_get_entry()
659  @since 0.1.6
660  @param t The track handle
661  @param entry A pointer to memory provided by the caller. It will be filled
662  with info according to struct burn_toc_entry as defined
663  in libburn.h
664 */
665 void isoburn_toc_track_get_entry(struct isoburn_toc_track *t,
666  struct burn_toc_entry *entry);
667 
668 
669 /** Obtain eventual ISO image parameters of an emulated track. This info was
670  gained with much effort and thus gets cached in the track object.
671  If this call returns 1 then one can save a call of isoburn_read_iso_head()
672  with return mode 1 which could cause an expensive read operation.
673  @since 0.4.0
674  @param t The track handle
675  @param start_lba Returns the start address of the ISO session
676  @param image_blocks Returns the number of 2048 bytes blocks
677  @param volid Caller provided memory for the volume id
678  @param flag unused yet, submit 0
679  @return 0= not an emulated ISO session , 1= reply is valid
680 */
681 int isoburn_toc_track_get_emul(struct isoburn_toc_track *t, int *start_lba,
682  int *image_blocks, char volid[33], int flag);
683 
684 
685 
686 /** Release the memory associated with a master handle of a medium.
687  The handle is invalid afterwards and may not be used any more.
688  Wrapper for: burn_disc_free()
689  @since 0.1.6
690  @param disc The master handle of the medium
691 */
692 void isoburn_toc_disc_free(struct isoburn_toc_disc *disc);
693 
694 
695 /** Try whether the data at the given address look like a ISO 9660
696  image header and obtain its alleged size. Depending on the info mode
697  one other string of text information can be retrieved too.
698  @since 0.1.6
699  @param d The drive with the medium to inspect
700  @param lba The block number from where to read
701  @param image_blocks Returns the number of 2048 bytes blocks in the session
702  @param info Caller provided memory, enough to take eventual info reply
703  @param flag bit0-7: info return mode
704  0= do not return anything in info (do not even touch it)
705  1= copy volume id to info (info needs 33 bytes)
706  2= @since 0.2.2 :
707  copy 64 kB header to info (needs 65536 bytes)
708  bit13= @since 0.2.2:
709  Do not read head from medium but use first 64 kB from
710  info.
711  In this case it is permissible to submit d == NULL.
712  bit14= check both half buffers (not only second)
713  return 2 if found in first block
714  bit15= return -1 on read error
715  @return >0 seems to be a valid ISO image, 0 format not recognized, <0 error
716 */
717 int isoburn_read_iso_head(struct burn_drive *d, int lba,
718  int *image_blocks, char *info, int flag);
719 
720 
721 /** Try to convert the given entity address into various entity addresses
722  which would describe it.
723  Note: Sessions and tracks are counted beginning with 1, not with 0.
724  @since 0.3.2
725  @param d The drive where msc1 is to be set
726  @param adr_mode Determines how to interpret the input adr_value.
727  If adr_value shall represent a number then decimal ASCII
728  digits are expected.
729  0= start lba of last session in TOC, ignore adr_value
730  1= start lba of session number given by adr_value
731  2= start lba of track given number by adr_value
732  3= adr_value itself is the lba to be used
733  4= start lba of last session with volume id
734  given by adr_value
735  @param adr_value A string describing the value to be eventually used.
736  @param lba returns the block address of the entity, -1 means invalid
737  @param track returns the track number of the entity, -1 means invalid
738  @param session returns the session number of the entity, -1 means invalid
739  @param volid returns the volume id of the entity if it is a ISO session
740  @param flag Bitfield for control purposes.
741  bit2= with adr_mode 4: use adr_value as regular expression
742  @return <=0 error , 1 ok, ISO session, 2 ok, not an ISO session
743 */
744 int isoburn_get_mount_params(struct burn_drive *d,
745  int adr_mode, char *adr_value,
746  int *lba, int *track, int *session,
747  char volid[33], int flag);
748 
749 
750 /* ----------------------------------------------------------------------- */
751 /*
752 
753  Options for image reading.
754 
755  An application shall create an option set object by isoburn_ropt_new(),
756  program it by isoburn_ropt_set_*(), use it with isoburn_read_image(),
757  and finally delete it by isoburn_ropt_destroy().
758 
759 */
760 /* ----------------------------------------------------------------------- */
761 
762 struct isoburn_read_opts;
763 
764 /** Produces a set of image read options, initialized with default values.
765  @since 0.1.0
766  @param o the newly created option set object
767  @param flag Bitfield for control purposes. Submit 0 for now.
768  @return 1=ok , <0 = failure
769 */
770 int isoburn_ropt_new(struct isoburn_read_opts **o, int flag);
771 
772 
773 /** Deletes an option set which was created by isoburn_ropt_new().
774  @since 0.1.0
775  @param o The option set to work on
776  @param flag Bitfield for control purposes. Submit 0 for now.
777  @return 1= **o destroyed , 0= *o was already NULL (harmless)
778 */
779 int isoburn_ropt_destroy(struct isoburn_read_opts **o, int flag);
780 
781 /** Sets the size and granularity of the cache which libisoburn provides to
782  libisofs for reading of ISO image data. This cache consists of several
783  tiles which are buffers of a given size. The ISO image is divided into
784  virtual tiles of that size. A cache tile may hold an in-memory copy
785  of such a virtual image tile.
786  When libisofs requests to read a block, then first the cache is inquired
787  whether it holds that block. If not, then the block is read via libburn
788  together with its neighbors in their virtual image tile into a free
789  cache tile. If no cache tile is free, then the one will be re-used which
790  has the longest time of not being hit by a read attempt.
791 
792  A larger cache might speed up image loading by reducing the number of
793  libburn read calls on the directory tree. It might also help with
794  reading the content of many small files, if for some reason it is not an
795  option to sort access by LBA.
796  Caching will not provide much benefit with libburn "stdio:" drives,
797  because the operating system is supposed to provide the same speed-up
798  in a more flexible way.
799 
800  @since 1.2.2
801  @param o The option set to work on.
802  It is permissible to submit NULL in order to just
803  have the parameters tested.
804  @param cache_tiles Number of tiles in the cache. Not less than 1.
805  Default is 32.
806  @param tile_blocks Number of blocks per tile. Must be a power of 2.
807  Default is 32.
808  cache_tiles * tile_blocks * 2048 must not exceed
809  1073741824 (= 1 GiB).
810  @param flag Bitfield for control purposes. Unused yet. Submit 0.
811  @return <=0 error , >0 ok
812 */
813 int isoburn_ropt_set_data_cache(struct isoburn_read_opts *o,
814  int cache_tiles, int tile_blocks, int flag);
815 
816 /** Inquire the current settings of isoburn_set_data_cache().
817  @since 1.2.2
818  @param o The option set to work on.
819  NULL has the same effect as flag bit0.
820  @param cache_tiles Will return the number of tiles in the cache.
821  @param tile_blocks Will return the number of blocks per tile.
822  @param set_flag Will return control bits. None are defined yet.
823  @param flag Bitfield for control purposes
824  bit0= return default values rather than current ones
825  @return <=0 error , >0 reply is valid
826 */
827 int isoburn_ropt_get_data_cache(struct isoburn_read_opts *o,
828  int *cache_tiles, int *tile_blocks,
829  int *set_flag, int flag);
830 
831 
832 /** Which existing ISO 9660 extensions in the image to read or not to read.
833  Whether to read the content of an existing image at all.
834  The bits can be combined by | resp. inquired by &.
835  @since 0.1.0
836  @param ext Bitfield:
837  bit0= norock
838  Do not read Rock Ridge extensions
839  bit1= nojoliet
840  Do not read Joliet extensions
841  bit2= noiso1999
842  Do not read ISO 9660:1999 enhanced tree
843  bit3= preferjoliet
844  When both Joliet and RR extensions are present, the RR
845  tree is used. If you prefer using Joliet, set this to 1.
846  bit4= pretend_blank
847  Always create empty image.Ignore any image on input drive.
848  bit5= noaaip
849  @since 0.3.4
850  Do not load AAIP information from image. This information
851  eventually contains ACL or XFS-style Extended Attributes.
852  bit6= noacl
853  @since 0.3.4
854  Do not obtain ACL from external filesystem objects (e.g.
855  local filesystem files).
856  bit7= noea
857  @since 0.3.4
858  Do not obtain XFS-style Extended Attributes from external
859  filesystem objects (e.g. local filesystem files).
860  bit8= noino
861  @since 0.4.0
862  Do not load eventual inode numbers from RRIP entry PX,
863  but generate a new unique inode number for each imported
864  IsoNode object.
865  PX inode numbers allow to mark families of hardlinks by
866  giving all family members the same inode number. libisofs
867  keeps the PX inode numbers unaltered when IsoNode objects
868  get written into an ISO image.
869  bit9= nomd5
870  @since 0.4.2
871  Do not load the eventual MD5 checksum array.
872  Do not check eventual session_md5 tags.
873  bit10= nomd5tag
874  @since 1.0.4
875  Do not check eventual session_md5 tags although bit9
876  is not set.
877  @return 1 success, <=0 failure
878 */
879 #define isoburn_ropt_norock 1
880 #define isoburn_ropt_nojoliet 2
881 #define isoburn_ropt_noiso1999 4
882 #define isoburn_ropt_preferjoliet 8
883 #define isoburn_ropt_pretend_blank 16
884 #define isoburn_ropt_noaaip 32
885 #define isoburn_ropt_noacl 64
886 #define isoburn_ropt_noea 128
887 #define isoburn_ropt_noino 256
888 #define isoburn_ropt_nomd5 512
889 #define isoburn_ropt_nomd5tag 1024
890 
891 int isoburn_ropt_set_extensions(struct isoburn_read_opts *o, int ext);
892 int isoburn_ropt_get_extensions(struct isoburn_read_opts *o, int *ext);
893 
894 
895 /** Default attributes to use if no RockRidge extension gets loaded.
896  @since 0.1.0
897  @param o The option set to work on
898  @param uid user id number (see /etc/passwd)
899  @param gid group id number (see /etc/group)
900  @param mode permissions (not file type) as of man 2 stat.
901  With directories, r-permissions will automatically imply
902  x-permissions. See isoburn_ropt_set_default_dirperms() below.
903  @return 1 success, <=0 failure
904 */
905 int isoburn_ropt_set_default_perms(struct isoburn_read_opts *o,
906  uid_t uid, gid_t gid, mode_t mode);
907 int isoburn_ropt_get_default_perms(struct isoburn_read_opts *o,
908  uid_t *uid, gid_t *gid, mode_t *mode);
909 
910 /** Default attributes to use on directories if no RockRidge extension
911  gets loaded.
912  Above call isoburn_ropt_set_default_perms() automatically adds
913  x-permissions to r-permissions for directories. This call here may
914  be done afterwards to set independend permissions for directories,
915  especially to override the automatically added x-permissions.
916  @since 0.1.0
917  @param o The option set to work on
918  @param mode permissions (not file type) as of man 2 stat.
919  @return 1 success, <=0 failure
920 */
921 int isoburn_ropt_set_default_dirperms(struct isoburn_read_opts *o,
922  mode_t mode);
923 int isoburn_ropt_get_default_dirperms(struct isoburn_read_opts *o,
924  mode_t *mode);
925 
926 
927 /** Set the character set for reading RR file names from ISO images.
928  @since 0.1.0
929  @param o The option set to work on
930  @param input_charset Set this to NULL to use the default locale charset
931  For selecting a particular character set, submit its
932  name, e.g. as listed by program iconv -l.
933  Example: "UTF-8".
934  @return 1 success, <=0 failure
935 */
936 int isoburn_ropt_set_input_charset(struct isoburn_read_opts *o,
937  char *input_charset);
938 int isoburn_ropt_get_input_charset(struct isoburn_read_opts *o,
939  char **input_charset);
940 
941 
942 /**
943  Enable or disable methods to automatically choose an input charset.
944  This eventually overrides the name set via isoburn_ropt_set_input_charset()
945  @since 0.3.8
946  @param o The option set to work on
947  @param mode Bitfield for control purposes:
948  bit0= allow to set the input character set automatically from
949  attribute "isofs.cs" of root directory.
950  Submit any other bits with value 0.
951  @return 1 success, <=0 failure
952  */
953 int isoburn_ropt_set_auto_incharset(struct isoburn_read_opts *o, int mode);
954 int isoburn_ropt_get_auto_incharset(struct isoburn_read_opts *o, int *mode);
955 
956 
957 /** Control an offset to be applied to all block address pointers in the ISO
958  image in order to compensate for an eventual displacement of the image
959  relative to the start block address for which it was produced.
960  E.g. if track number 2 from CD gets copied into a disk file and shall then
961  be loaded as ISO filesystem, then the directory tree and all data file
962  content of the track copy will become readable by setting the track start
963  address as displacement and -1 as displacement_sign.
964  Data file content outside the track will of course not be accessible and
965  eventually produce read errors.
966  @since 0.6.6
967  @param o The option set to work on
968  @param displacement 0 or a positive number
969  @param displacement_sign Determines wether to add or subtract displacement
970  to block addresses before applying them to the
971  storage object for reading:
972  +1 = add , -1= subtract , else keep unaltered
973 */
974 int isoburn_ropt_set_displacement(struct isoburn_read_opts *o,
975  uint32_t displacement, int displacement_sign);
976 int isoburn_ropt_get_displacement(struct isoburn_read_opts *o,
977  uint32_t *displacement, int *displacement_sign);
978 
979 /* If you get here because of a compilation error like
980 
981  /usr/include/libisoburn/libisoburn.h:895: error:
982  expected declaration specifiers or '...' before 'uint32_t'
983 
984  then see above paragraph "Application Constraints" about the definition
985  of uint32_t.
986 */
987 
988 
989 /** After calling function isoburn_read_image() there are informations
990  available in the option set.
991  This info can be obtained as bits in parameter has_what. Like:
992  joliet_available = (has_what & isoburn_ropt_has_joliet);
993  @since 0.1.0
994  @param o The option set to work on
995  @param size Number of image data blocks, 2048 bytes each.
996  @param has_what Bitfield:
997  bit0= has_rockridge
998  RockRidge extension info is available (POSIX filesystem)
999  bit1= has_joliet
1000  Joliet extension info is available (suitable for MS-Windows)
1001  bit2= has_iso1999
1002  ISO version 2 Enhanced Volume Descriptor is available.
1003  This is rather exotic.
1004  bit3= has_el_torito
1005  El-Torito boot record is present
1006  @return 1 success, <=0 failure
1007 */
1008 #define isoburn_ropt_has_rockridge 1
1009 #define isoburn_ropt_has_joliet 2
1010 #define isoburn_ropt_has_iso1999 4
1011 #define isoburn_ropt_has_el_torito 8
1012 
1013 int isoburn_ropt_get_size_what(struct isoburn_read_opts *o,
1014  uint32_t *size, int *has_what);
1015 
1016 /* ts A90122 */
1017 /* >>> to be implemented:
1018 #define isoburn_ropt_has_acl 64
1019 #define isoburn_ropt_has_ea 128
1020 */
1021 
1022 
1023 
1024 /* ----------------------------------------------------------------------- */
1025 /* End of Options for image reading */
1026 /* ----------------------------------------------------------------------- */
1027 
1028 /* ----------------------------------------------------------------------- */
1029 /*
1030 
1031  Options for image generation by libisofs and image transport to libburn.
1032 
1033  An application shall create an option set by isoburn_igopt_new(),
1034  program it by isoburn_igopt_set_*(), use it with either
1035  isoburn_prepare_new_image() or isoburn_prepare_disc(), and finally delete
1036  it by isoburn_igopt_destroy().
1037 
1038 */
1039 /* ----------------------------------------------------------------------- */
1040 
1041 struct isoburn_imgen_opts;
1042 
1043 /** Produces a set of generation and transfer options, initialized with default
1044  values.
1045  @since 0.1.0
1046  @param o the newly created option set object
1047  @param flag Bitfield for control purposes. Submit 0 for now.
1048  @return 1=ok , <0 = failure
1049 */
1050 int isoburn_igopt_new(struct isoburn_imgen_opts **o, int flag);
1051 
1052 
1053 /** Deletes an option set which was created by isoburn_igopt_new().
1054  @since 0.1.0
1055  @param o The option set to give up
1056  @param flag Bitfield for control purposes. Submit 0 for now.
1057  @return 1= **o destroyed , 0= *o was already NULL (harmless)
1058 */
1059 int isoburn_igopt_destroy(struct isoburn_imgen_opts **o, int flag);
1060 
1061 
1062 /** ISO level to write at.
1063  @since 0.1.0
1064  @param o The option set to work on
1065  @param level is a term of the ISO 9660 standard. It should be one of:
1066  1= filenames restricted to form 8.3
1067  2= filenames allowed up to 31 characters
1068  3= file content may be larger than 4 GB - 1.
1069  @return 1 success, <=0 failure
1070 */
1071 int isoburn_igopt_set_level(struct isoburn_imgen_opts *o, int level);
1072 int isoburn_igopt_get_level(struct isoburn_imgen_opts *o, int *level);
1073 
1074 
1075 /** Which extensions to support.
1076  @since 0.1.0
1077  @param o The option set to work on
1078  @param ext Bitfield:
1079  bit0= rockridge
1080  Rock Ridge extensions add POSIX file attributes like
1081  owner, group, access permissions, long filenames. Very
1082  advisable if the designed audience has Unix style systems.
1083  bit1= joliet
1084  Longer filenames for Windows systems.
1085  Weaker than RockRidge, but also readable with GNU/Linux.
1086  bit2= iso1999
1087  This is rather exotic. Better do not surprise the readers.
1088  bit3= hardlinks
1089  Enable hardlink consolidation. IsoNodes which refer to the
1090  same source object and have the same properties will get
1091  the same ISO image inode numbers.
1092  If combined with isoburn_igopt_rrip_version_1_10 below,
1093  then the PX entry layout of RRIP-1.12 will be used within
1094  RRIP-1.10 (mkisofs does this without causing visible trouble).
1095  bit5= aaip
1096  The libisofs specific SUSP based extension of ECMA-119 which
1097  can encode ACL and XFS-style Extended Attributes.
1098  bit6= session_md5
1099  @since 0.4.2
1100  Produce and write MD5 checksum tags of superblock, directory
1101  tree, and the whole session stream.
1102  bit7= file_md5
1103  @since 0.4.2
1104  Produce and write MD5 checksums for each single IsoFile.
1105  bit8= file_stability (only together with file_md5)
1106  @since 0.4.2
1107  Compute MD5 of each file before copying it into the image and
1108  compare this with the MD5 of the actual copying. If they do
1109  not match then issue MISHAP event.
1110  See also libisofs.h iso_write_opts_set_record_md5()
1111  bit9= no_emul_toc
1112  @since 0.5.8
1113  On overwriteable media or random access files do not write
1114  the first session to LBA 32 and do not copy the first 64kB
1115  of the first session to LBA 0, but rather write the first
1116  session to LBA 0 directly.
1117  bit10= will_cancel
1118  @since 0.6.6
1119  Announce to libisofs that only the image size is desired
1120  and that the write thread will be cancelled by
1121  isoburn_cancel_prepared_write() before actual image writing
1122  occurs. Without this, cancellation can cause a MISHAP event.
1123  bit11= old_empty
1124  @since 1.0.2
1125  Let symbolic links and device files point to block 0, and let
1126  empty data files point to the address of the Volume Descriptor
1127  Set Terminator. This was done by libisofs in the past.
1128  By default there is now a single dedicated block of zero bytes
1129  after the end of the directory trees, of which the address
1130  is used for all files without own content.
1131  bit12= hfsplus
1132  @since 1.2.4
1133  Produce a HFS+ partition inside the ISO image and announce it
1134  by an Apple Partition Map in the System Area.
1135  >>> GPT production ?
1136  Caution: Interferes with isoburn_igopt_set_system_area() by
1137  overwriting the first 8 bytes of the data, and
1138  several blocks of 2 KiB after the first one.
1139  bit13= fat
1140  @since 1.2.4
1141  >>> Not yet implemented. Planned to co-exist with hfsplus.
1142  Produce a FAT32 partition inside the ISO image and announce it
1143  by an MBR partition entry in the System Area.
1144  Caution: Interferes with isoburn_igopt_set_system_area() by
1145  >>> what impact ?
1146 
1147  @return 1 success, <=0 failure
1148 */
1149 #define isoburn_igopt_rockridge 1
1150 #define isoburn_igopt_joliet 2
1151 #define isoburn_igopt_iso1999 4
1152 #define isoburn_igopt_hardlinks 8
1153 #define isoburn_igopt_aaip 32
1154 #define isoburn_igopt_session_md5 64
1155 #define isoburn_igopt_file_md5 128
1156 #define isoburn_igopt_file_stability 256
1157 #define isoburn_igopt_no_emul_toc 512
1158 #define isoburn_igopt_will_cancel 1024
1159 #define isoburn_igopt_old_empty 2048
1160 #define isoburn_igopt_hfsplus 4096
1161 #define isoburn_igopt_fat 8192
1162 int isoburn_igopt_set_extensions(struct isoburn_imgen_opts *o, int ext);
1163 int isoburn_igopt_get_extensions(struct isoburn_imgen_opts *o, int *ext);
1164 
1165 /** Relaxed constraints. Setting any of the bits to 1 break the specifications,
1166  but it is supposed to work on most moderns systems. Use with caution.
1167  @since 0.1.0
1168  @param o The option set to work on
1169  @param relax Bitfield:
1170  bit0= omit_version_numbers
1171  Omit the version number (";1") at the end of the
1172  ISO-9660 and Joliet identifiers.
1173  Version numbers are usually not used by readers.
1174  bit1= allow_deep_paths
1175  Allow ISO-9660 directory hierarchy to be deeper
1176  than 8 levels.
1177  bit2= allow_longer_paths
1178  Allow path in the ISO-9660 tree to have more than
1179  255 characters.
1180  bit3= max_37_char_filenames
1181  Allow a single file or directory hierarchy to have
1182  up to 37 characters. This is larger than the 31
1183  characters allowed by ISO level 2, and the extra space
1184  is taken from the version number, so this also forces
1185  omit_version_numbers.
1186  bit4= no_force_dots
1187  ISO-9660 forces filenames to have a ".", that separates
1188  file name from extension. libisofs adds it if original
1189  filename has none. Set this to 1 to prevent this
1190  behavior.
1191  bit5= allow_lowercase
1192  Allow lowercase characters in ISO-9660 filenames.
1193  By default, only uppercase characters, numbers and
1194  a few other characters are allowed.
1195  bit6= allow_full_ascii
1196  Allow all ASCII characters to be appear on an ISO-9660
1197  filename. Note that "/" and "\0" characters are never
1198  allowed, even in RR names.
1199  bit7= joliet_longer_paths
1200  Allow paths in the Joliet tree to have more than
1201  240 characters.
1202  bit8= always_gmt
1203  Write timestamps as GMT although the specs prescribe local
1204  time with eventual non-zero timezone offset. Negative
1205  timezones (west of GMT) can trigger bugs in some operating
1206  systems which typically appear in mounted ISO images as if
1207  the timezone shift from GMT was applied twice
1208  (e.g. in New York 22:36 becomes 17:36).
1209  bit9= rrip_version_1_10
1210  Write Rock Ridge info as of specification RRIP-1.10 rather
1211  than RRIP-1.12: signature "RRIP_1991A" rather than
1212  "IEEE_1282", field PX without file serial number.
1213  bit10= dir_rec_mtime
1214  Store as ECMA-119 Directory Record timestamp the mtime
1215  of the source rather than the image creation time.
1216  bit11= aaip_susp_1_10
1217  Write AAIP fields without announcing AAIP by an ER field and
1218  without distinguishing RRIP fields from the AAIP field by
1219  prefixed ES fields. This saves 5 to 10 bytes per file and
1220  might avoid problems with readers which only accept RRIP.
1221  SUSP-1.10 allows it, SUSP-1.12 frowns on it.
1222  bit12= only_iso_numbers
1223  Same as bit1 omit_version_number but restricted to the names
1224  in the eventual Joliet tree.
1225  @since 0.5.4
1226  For reasons of backward compatibility it is not possible yet
1227  to disable version numbers for ISO 9660 while enabling them
1228  for Joliet.
1229  bit13= no_j_force_dots
1230  Same as no_force_dots but affecting the names in the eventual
1231  Joliet tree rather than the ISO 9660 / ECMA-119 names.
1232  @since 0.5.4
1233  Previous versions added dots to Joliet names unconditionally.
1234  bit14= allow_dir_id_ext
1235  Convert directory names for ECMA-119 similar to other file
1236  names, but do not force a dot or add a version number.
1237  This violates ECMA-119 by allowing one "." and especially
1238  ISO level 1 by allowing DOS style 8.3 names rather than
1239  only 8 characters.
1240  (mkisofs and its clones obviously do this violation.)
1241  @since 1.0.0
1242  bit15= joliet_long_names
1243  Allow for Joliet leaf names up to 103 characters rather than
1244  up to 64.
1245  @since 1.0.6
1246  bit16= joliet_rec_mtime
1247  Like dir_rec_mtime, but for the Joliet tree.
1248  @since 1.2.0
1249  bit17= iso1999_rec_mtime
1250  Like dir_rec_mtime, but for the ISO 9660:1999 tree.
1251  @since 1.2.0
1252  bit18= allow_7bit_ascii
1253  Like allow_full_ascii, but only allowing 7-bit characters.
1254  Lowercase letters get mapped to uppercase if not
1255  allow_lowercase is set.
1256  Gets overridden if allow_full_ascii is enabled.
1257  bit19= joliet_utf16
1258  Encode Joliet names by character set UTF-16BE rather than
1259  UCS-2. The difference is with characters which are not present
1260  in UCS-2 and get encoded in UTF-16 by 2 words of 16 bit each.
1261  Both words then stem from a reserved subset of UCS-2.
1262  @since 1.3.6
1263  @return 1 success, <=0 failure
1264 */
1265 #define isoburn_igopt_omit_version_numbers 1
1266 #define isoburn_igopt_allow_deep_paths 2
1267 #define isoburn_igopt_allow_longer_paths 4
1268 #define isoburn_igopt_max_37_char_filenames 8
1269 #define isoburn_igopt_no_force_dots 16
1270 #define isoburn_igopt_allow_lowercase 32
1271 #define isoburn_igopt_allow_full_ascii 64
1272 #define isoburn_igopt_joliet_longer_paths 128
1273 #define isoburn_igopt_always_gmt 256
1274 #define isoburn_igopt_rrip_version_1_10 512
1275 #define isoburn_igopt_dir_rec_mtime 1024
1276 #define isoburn_igopt_aaip_susp_1_10 2048
1277 #define isoburn_igopt_only_iso_versions 4096
1278 #define isoburn_igopt_no_j_force_dots 8192
1279 #define isoburn_igopt_allow_dir_id_ext 16384
1280 #define isoburn_igopt_joliet_long_names 32768
1281 #define isoburn_igopt_joliet_rec_mtime 0x10000
1282 #define isoburn_igopt_iso1999_rec_mtime 0x20000
1283 #define isoburn_igopt_allow_7bit_ascii 0x40000
1284 #define isoburn_igopt_joliet_utf16 0x80000
1285 int isoburn_igopt_set_relaxed(struct isoburn_imgen_opts *o, int relax);
1286 int isoburn_igopt_get_relaxed(struct isoburn_imgen_opts *o, int *relax);
1287 
1288 
1289 /** If not isoburn_igopt_allow_deep_paths is in effect, then it may become
1290  necessary to relocate directories so that no ECMA-119 file path
1291  has more than 8 components. These directories are grafted into either
1292  the root directory of the ISO image or into a dedicated relocation
1293  directory. For details see libisofs.h.
1294  Wrapper for: iso_write_opts_set_rr_reloc()
1295  @since 1.2.2
1296  @param o The option set to work on
1297  @param name The name of the relocation directory in the root directory.
1298  Do not prepend "/". An empty name or NULL will direct
1299  relocated directories into the root directory. This is the
1300  default.
1301  If the given name does not exist in the root directory when
1302  isoburn_disc_write() is called, and if there are directories
1303  at path level 8, then directory /name will be created
1304  automatically.
1305  @param flags Bitfield for control purposes.
1306  bit0= Mark the relocation directory by a Rock Ridge RE entry,
1307  if it gets created during isoburn_disc_write(). This
1308  will make it invisible for most Rock Ridge readers.
1309  bit1= not settable via API (used internally)
1310  @return > 0 success, <= 0 failure
1311 */
1312 int isoburn_igopt_set_rr_reloc(struct isoburn_imgen_opts *o, char *name,
1313  int flags);
1314 
1315 /** Obtain the settings of isoburn_igopt_set_rr_reloc().
1316  @since 1.2.2
1317  @param o The option set to work on
1318  @param name Will return NULL or a pointer to the name of the relocation
1319  directory in the root directory. Do not alter or dispose the
1320  memory which holds this name.
1321  @param flags Will return the flags bitfield.
1322  @return > 0 success, <= 0 failure
1323 */
1324 int isoburn_igopt_get_rr_reloc(struct isoburn_imgen_opts *o, char **name,
1325  int *flags);
1326 
1327 
1328 /** Caution: This option breaks any assumptions about names that
1329  are supported by ECMA-119 specifications.
1330  Try to omit any translation which would make a file name compliant to the
1331  ECMA-119 rules. This includes and exceeds omit_version_numbers,
1332  max_37_char_filenames, no_force_dots bit0, allow_full_ascii. Further it
1333  prevents the conversion from local character set to ASCII.
1334  The maximum name length is given by this call. If a filename exceeds
1335  this length or cannot be recorded untranslated for other reasons, then
1336  image production gets aborted.
1337  Currently the length limit is 96 characters, because an ECMA-119 directory
1338  record may at most have 254 bytes and up to 158 other bytes must fit into
1339  the record. Probably 96 more bytes can be made free for the name in future.
1340  @since 1.0.0
1341  @param o The option set to work on
1342  @param len 0 = disable this feature and perform name translation
1343  according to other settings.
1344  >0 = Omit any translation. Eventually abort image production
1345  if a name is longer than the given value.
1346  -1 = Like >0. Allow maximum possible length.
1347  isoburn_igopt_get_untranslated_name_len() will tell the
1348  effectively resulting value.
1349  @return >0 success, <=0 failure
1350 */
1351 int isoburn_igopt_set_untranslated_name_len(struct isoburn_imgen_opts *o,
1352  int len);
1353 int isoburn_igopt_get_untranslated_name_len(struct isoburn_imgen_opts *o,
1354  int *len);
1355 
1356 
1357 /** Whether and how files should be sorted.
1358  @since 0.1.0
1359  @param o The option set to work on
1360  @param value Bitfield: bit0= sort_files_by_weight
1361  files should be sorted based on their weight.
1362  Weight is attributed to files in the image
1363  by libisofs call iso_node_set_sort_weight().
1364  @return 1 success, <=0 failure
1365 */
1366 #define isoburn_igopt_sort_files_by_weight 1
1367 int isoburn_igopt_set_sort_files(struct isoburn_imgen_opts *o, int value);
1368 int isoburn_igopt_get_sort_files(struct isoburn_imgen_opts *o, int *value);
1369 
1370 
1371 /** Set the override values for files and directory permissions.
1372  The parameters replace_* these take one of three values: 0, 1 or 2.
1373  If 0, the corresponding attribute will be kept as set in the IsoNode
1374  at the time of image generation.
1375  If set to 1, the corresponding attrib. will be changed by a default
1376  suitable value.
1377  With value 2, the attrib. will be changed with the value specified
1378  in the corresponding *_mode options. Note that only the permissions
1379  are set, the file type remains unchanged.
1380  @since 0.1.0
1381  @param o The option set to work on
1382  @param replace_dir_mode whether and how to override directories
1383  @param replace_file_mode whether and how to override files of other type
1384  @param dir_mode Mode to use on dirs with replace_dir_mode == 2.
1385  @param file_mode; Mode to use on files with replace_file_mode == 2.
1386  @return 1 success, <=0 failure
1387 */
1388 int isoburn_igopt_set_over_mode(struct isoburn_imgen_opts *o,
1389  int replace_dir_mode, int replace_file_mode,
1390  mode_t dir_mode, mode_t file_mode);
1391 int isoburn_igopt_get_over_mode(struct isoburn_imgen_opts *o,
1392  int *replace_dir_mode, int *replace_file_mode,
1393  mode_t *dir_mode, mode_t *file_mode);
1394 
1395 /** Set the override values values for group id and user id.
1396  The rules are like with above overriding of mode values. replace_* controls
1397  whether and how. The other two parameters provide values for eventual use.
1398  @since 0.1.0
1399  @param o The option set to work on
1400  @param replace_uid whether and how to override user ids
1401  @param replace_gid whether and how to override group ids
1402  @param uid User id to use with replace_uid == 2.
1403  @param gid Group id to use on files with replace_gid == 2.
1404  @return 1 success, <=0 failure
1405 */
1406 int isoburn_igopt_set_over_ugid(struct isoburn_imgen_opts *o,
1407  int replace_uid, int replace_gid,
1408  uid_t uid, gid_t gid);
1409 int isoburn_igopt_get_over_ugid(struct isoburn_imgen_opts *o,
1410  int *replace_uid, int *replace_gid,
1411  uid_t *uid, gid_t *gid);
1412 
1413 /** Set the charcter set to use for representing RR filenames in the image.
1414  @since 0.1.0
1415  @param o The option set to work on
1416  @param output_charset Set this to NULL to use the default output charset.
1417  For selecting a particular character set, submit its
1418  name, e.g. as listed by program iconv -l.
1419  Example: "UTF-8".
1420  @return 1 success, <=0 failure
1421 */
1422 int isoburn_igopt_set_out_charset(struct isoburn_imgen_opts *o,
1423  char *output_charset);
1424 int isoburn_igopt_get_out_charset(struct isoburn_imgen_opts *o,
1425  char **output_charset);
1426 
1427 
1428 /** The number of bytes to be used for the fifo which decouples libisofs
1429  and libburn for better throughput and for reducing the risk of
1430  interrupting signals hitting the libburn thread which operates the
1431  MMC drive.
1432  The size will be rounded up to the next full 2048.
1433  Minimum is 64kiB, maximum is 1 GiB (but that is too much anyway).
1434  @since 0.1.0
1435  @param o The option set to work on
1436  @param fifo_size Number of bytes to use
1437  @return 1 success, <=0 failure
1438 */
1439 int isoburn_igopt_set_fifo_size(struct isoburn_imgen_opts *o, int fifo_size);
1440 int isoburn_igopt_get_fifo_size(struct isoburn_imgen_opts *o, int *fifo_size);
1441 
1442 
1443 /** Obtain after image preparation the block address where the session will
1444  start on the medium.
1445  This value cannot be set by the application but only be inquired.
1446  @since 0.1.4
1447  @param o The option set to work on
1448  @param lba The block number of the session start on the medium.
1449  <0 means that no address has been determined yet.
1450  @return 1 success, <=0 failure
1451 */
1452 int isoburn_igopt_get_effective_lba(struct isoburn_imgen_opts *o, int *lba);
1453 
1454 
1455 /** Obtain after image preparation the lowest block address of file content
1456  data. Failure can occur if libisofs is too old to provide this information,
1457  if the result exceeds 31 bit, or if the call is made before image
1458  preparation.
1459  This value cannot be set by the application but only be inquired.
1460  @since 0.3.6
1461  @param o The option set to work on
1462  @param lba The block number of the session start on the medium.
1463  <0 means that no address has been determined yet.
1464  @return 1 success, <=0 failure
1465 */
1466 int isoburn_igopt_get_data_start(struct isoburn_imgen_opts *o, int *lba);
1467 
1468 
1469 /** Set resp. get parameters "name" and "timestamp" for a scdbackup checksum
1470  tag. It will be appended to the libisofs session tag if the image starts at
1471  LBA 0. See isoburn_disc_track_lba_nwa. The scdbackup tag can be used
1472  to verify the image by command scdbackup_verify $device -auto_end.
1473  See scdbackup/README appendix VERIFY for its inner details.
1474  @since 0.4.4
1475  @param o The option set to work on
1476  @param name The tag name. 80 characters max.
1477  @param timestamp A string of up to 13 characters YYMMDD.hhmmss
1478  A9 = 2009, B0 = 2010, B1 = 2011, ... C0 = 2020, ...
1479  @param tag_written Either NULL or the address of an array with at least 512
1480  characters. In the latter case the eventually produced
1481  scdbackup tag will be copied to this array when the image
1482  gets written. This call sets scdbackup_tag_written[0] = 0
1483  to mark its preliminary invalidity.
1484  @return 1 success, <=0 failure
1485  */
1486 int isoburn_igopt_set_scdbackup_tag(struct isoburn_imgen_opts *o, char *name,
1487  char *timestamp, char *tag_written);
1488 int isoburn_igopt_get_scdbackup_tag(struct isoburn_imgen_opts *o,
1489  char name[81], char timestamp[19],
1490  char **tag_written);
1491 
1492 
1493 /** Attach 32 kB of binary data which shall get written to the first 32 kB
1494  of the ISO image, the System Area.
1495  options can cause manipulations of these data before writing happens.
1496  If system area data are giveni or options bit0 is set, then bit1 of
1497  el_torito_set_isolinux_options() is automatically disabled.
1498  @since 0.5.4
1499  @param o The option set to work on
1500  @param data Either NULL or 32 kB of data. Do not submit less bytes !
1501  @param options Can cause manipulations of submitted data before they
1502  get written:
1503  bit0= apply a --protective-msdos-label as of grub-mkisofs.
1504  This means to patch bytes 446 to 512 of the system
1505  area so that one partition is defined which begins
1506  at the second 512-byte block of the image and ends
1507  where the image ends.
1508  This works with and without system_area_data.
1509  bit1= apply isohybrid MBR patching to the system area.
1510  This works only with system area data from
1511  SYSLINUX plus an ISOLINUX boot image (see
1512  iso_image_set_boot_image()) and only if not bit0
1513  is set.
1514  bit2-7= System area type
1515  0= with bit0 or bit1: MBR
1516  else: unspecified type
1517  @since 0.6.4
1518  1= MIPS Big Endian Volume Header
1519  Submit up to 15 MIPS Big Endian boot files by
1520  iso_image_add_mips_boot_file() of libisofs.
1521  This will overwrite the first 512 bytes of
1522  the submitted data.
1523  2= DEC Boot Block for MIPS Little Endian
1524  The first boot file submitted by
1525  iso_image_add_mips_boot_file() will be activated.
1526  This will overwrite the first 512 bytes of
1527  the submitted data.
1528  @since 0.6.6
1529  3= SUN Disk Label for SUN SPARC
1530  Submit up to 7 SPARC boot images by
1531  isoburn_igopt_set_partition_img() for partition
1532  numbers 2 to 8.
1533  This will overwrite the first 512 bytes of
1534  the submitted data.
1535  @since 1.3.6
1536  4= HP-PA PALO boot sector header version 4
1537  Submit all five parameters of
1538  iso_image_set_hppa_palo() as non-NULL texts.
1539  5= HP-PA PALO boot sector header version 5
1540  Submit all five parameters of
1541  iso_image_set_hppa_palo() as non-NULL texts.
1542  bit8-9= Only with System area type 0 = MBR
1543  @since 1.0.4
1544  Cylinder alignment mode eventually pads the image
1545  to make it end at a cylinder boundary.
1546  0 = auto (align if bit1)
1547  1 = always align to cylinder boundary
1548  2 = never align to cylinder boundary
1549  bit10-13= System area sub type
1550  @since 1.2.4
1551  With type 0 = MBR:
1552  Gets overridden by bit0 and bit1.
1553  0 = no particular sub type
1554  1 = CHRP: A single MBR partition of type 0x96
1555  covers the ISO image. Not compatible with
1556  any other feature which needs to have own
1557  MBR partition entries.
1558  bit14= Only with System area type 0 = MBR
1559  GRUB2 boot provisions:
1560  @since 1.3.0
1561  Patch system area at byte 92 to 99 with 512-block
1562  address + 1 of the first boot image file.
1563  Little-endian 8-byte.
1564  Should be combined with options bit0.
1565  Will not be in effect if options bit1 is set.
1566  @return 1 success, 0 no data to get, <0 failure
1567 */
1568 int isoburn_igopt_set_system_area(struct isoburn_imgen_opts *o,
1569  char data[32768], int options);
1570 int isoburn_igopt_get_system_area(struct isoburn_imgen_opts *o,
1571  char data[32768], int *options);
1572 
1573 /** Control production of a second set of volume descriptors (superblock)
1574  and directory trees, together with a partition table in the MBR where the
1575  first partition has non-zero start address and the others are zeroed.
1576  The first partition stretches to the end of the whole ISO image.
1577  The additional volume descriptor set and trees will allow to mount the
1578  ISO image at the start of the first partition, while it is still possible
1579  to mount it via the normal first volume descriptor set and tree at the
1580  start of the image resp. storage device.
1581  This makes few sense on optical media. But on USB sticks it creates a
1582  conventional partition table which makes it mountable on e.g. Linux via
1583  /dev/sdb and /dev/sdb1 alike.
1584  @since 0.6.2
1585  @param opts
1586  The option set to be manipulated.
1587  @param block_offset_2k
1588  The offset of the partition start relative to device start.
1589  This is counted in 2 kB blocks. The partition table will show the
1590  according number of 512 byte sectors.
1591  Default is 0 which causes no second set and trees.
1592  If it is not 0 then it must not be smaller than 16.
1593  @param secs_512_per_head
1594  Number of 512 byte sectors per head. 1 to 63. 0=automatic.
1595  @param heads_per_cyl
1596  Number of heads per cylinder. 1 to 255. 0=automatic.
1597  @return 1 success, <=0 failure
1598  */
1599 int isoburn_igopt_set_part_offset(struct isoburn_imgen_opts *opts,
1600  uint32_t block_offset_2k,
1601  int secs_512_per_head, int heads_per_cyl);
1602 int isoburn_igopt_get_part_offset(struct isoburn_imgen_opts *opts,
1603  uint32_t *block_offset_2k,
1604  int *secs_512_per_head, int *heads_per_cyl);
1605 
1606 
1607 /** Explicitely set the four timestamps of the emerging ISO image.
1608  Default with all parameters is 0.
1609  @since 0.5.4
1610  @param opts
1611  The option set to work on
1612  @param creation_time
1613  ECMA-119 Volume Creation Date and Time
1614  When "the information in the volume was created."
1615  A value of 0 means that the timepoint of write start is to be used.
1616  @param modification_time
1617  ECMA-119 Volume Modification Date and Time
1618  When "the informationin the volume was last modified."
1619  A value of 0 means that the timepoint of write start is to be used.
1620  @param expiration_time
1621  ECMA-119 Volume Expiration Date and Time
1622  When "the information in the volume may be regarded as obsolete."
1623  A value of 0 means that the information never shall expire.
1624  @param effective_time
1625  ECMA-119 Volume Effective Date and Time
1626  When "the information in the volume may be used."
1627  A value of 0 means that not such retention is intended.
1628  @param uuid
1629  If this text is not empty, then it overrides vol_modification_time
1630  by copying the first 16 decimal digits from uuid, eventually
1631  padding up with decimal '1', and writing a NUL-byte as timezone GMT.
1632  It should express a reasonable time in form YYYYMMDDhhmmsscc
1633  E.g.: 2010040711405800 = 7 Apr 2010 11:40:58 (+0 centiseconds)
1634  @return 1 success, <=0 failure
1635  */
1636 int isoburn_igopt_set_pvd_times(struct isoburn_imgen_opts *opts,
1637  time_t creation_time, time_t modification_time,
1638  time_t expiration_time, time_t effective_time,
1639  char *uuid);
1640 int isoburn_igopt_get_pvd_times(struct isoburn_imgen_opts *opts,
1641  time_t *creation_time, time_t *modification_time,
1642  time_t *expiration_time, time_t *effective_time,
1643  char uuid[17]);
1644 
1645 
1646 /** Associate a libjte environment object to the upcomming write run.
1647  libjte implements Jigdo Template Extraction as of Steve McIntyre and
1648  Richard Atterer.
1649  A non-NULL libjte_handle will cause failure to write if libjte was not
1650  enabled in libisofs at compile time.
1651  @since 0.6.4
1652  @param opts
1653  The option set to work on
1654  @param libjte_handle
1655  Pointer to a struct libjte_env e.g. created by libjte_new().
1656  It must stay existent from the start of image writing by
1657  isoburn_prepare_*() until the write thread has ended.
1658  E.g. until libburn indicates the end of its write run.
1659  @return 1 success, <=0 failure
1660 */
1661 int isoburn_igopt_attach_jte(struct isoburn_imgen_opts *opts,
1662  void *libjte_handle);
1663 
1664 /** Remove eventual association to a libjte environment handle.
1665  @since 0.6.4
1666  @param opts
1667  The option set to work on
1668  @param libjte_handle
1669  If not submitted as NULL, this will return the previously set
1670  libjte handle.
1671  @return 1 success, <=0 failure
1672 */
1673 int isoburn_igopt_detach_jte(struct isoburn_imgen_opts *opts,
1674  void **libjte_handle);
1675 
1676 
1677 /** Set resp. get the number of trailing zero byte blocks to be written by
1678  libisofs. The image size counter of the emerging ISO image will include
1679  them. Eventual checksums will take them into respect.
1680  They will be written immediately before the eventual image checksum area
1681  which is at the very end of the image.
1682  For a motivation see iso_write_opts_set_tail_blocks() in libisofs.h .
1683  @since 0.6.4
1684  @param opts
1685  The option set to work on
1686  @aram num_blocks
1687  Number of extra 2 kB blocks to be written by libisofs.
1688  @return 1 success, <=0 failure
1689 */
1690 int isoburn_igopt_set_tail_blocks(struct isoburn_imgen_opts *opts,
1691  uint32_t num_blocks);
1692 int isoburn_igopt_get_tail_blocks(struct isoburn_imgen_opts *opts,
1693  uint32_t *num_blocks);
1694 
1695 
1696 /** Copy a data file from the local filesystem into the emerging ISO image.
1697  Mark it by an MBR partition entry as PreP partition and also cause
1698  protective MBR partition entries before and after this partition.
1699  See libisofs.h iso_write_opts_set_prep_img().
1700  @since 1.2.4
1701  @param opts
1702  The option set to be manipulated.
1703  @param path
1704  File address in the local file system.
1705  @param flag
1706  Reserved for future usage, set to 0.
1707  @return 1 success, <=0 failure
1708 */
1709 int isoburn_igopt_set_prep_partition(struct isoburn_imgen_opts *opts,
1710  char *path, int flag);
1711 int isoburn_igopt_get_prep_partition(struct isoburn_imgen_opts *opts,
1712  char **path, int flag);
1713 
1714 /** Copy a data file from the local filesystem into the emerging ISO image.
1715  @since 1.2.4
1716  @param opts
1717  The option set to be manipulated.
1718  @param path
1719  File address in the local file system.
1720  @param flag
1721  Reserved for future usage, set to 0.
1722  @return 1 success, <=0 failure
1723 */
1724 int isoburn_igopt_set_efi_bootp(struct isoburn_imgen_opts *opts,
1725  char *path, int flag);
1726 int isoburn_igopt_get_efi_bootp(struct isoburn_imgen_opts *opts,
1727  char **path, int flag);
1728 
1729 
1730 /** Cause an arbitrary data file to be appended to the ISO image and to be
1731  described by a partition table entry in an MBR or SUN Disk Label at the
1732  start of the ISO image.
1733  The partition entry will bear the size of the image file rounded up to
1734  the next multiple of 2048 bytes.
1735  MBR or SUN Disk Label are selected by isoburn_igopt_set_system_area()
1736  system area type: 0 selects MBR partition table. 3 selects a SUN partition
1737  table with 320 kB start alignment.
1738  @since 0.6.4
1739  @param opts
1740  The option set to be manipulated.
1741  @param partition_number
1742  Depicts the partition table entry which shall describe the
1743  appended image.
1744  Range with MBR: 1 to 4. 1 will cause the whole ISO image to be
1745  unclaimable space before partition 1.
1746  @since 0.6.6
1747  Range with SUN Disk Label: 2 to 8.
1748  @param image_path
1749  File address in the local file system.
1750  With SUN Disk Label: an empty name causes the partition to become
1751  a copy of the next lower partition.
1752  @param image_type
1753  The MBR partition type. E.g. FAT12 = 0x01 , FAT16 = 0x06,
1754  Linux Native Partition = 0x83. See fdisk command L.
1755  This parameter is ignored with SUN Disk Label.
1756  @return
1757  <=0 = error, 1 = success
1758 */
1759 int isoburn_igopt_set_partition_img(struct isoburn_imgen_opts *opts,
1760  int partition_number, uint8_t partition_type,
1761  char *image_path);
1762 
1763 /** Inquire the current settings made by isoburn_igopt_set_partition_img().
1764  @since 0.6.4
1765  @param opts
1766  The option set to be inquired.
1767  @param num_entries
1768  Number of array elements in partition_types[] and image_paths[].
1769  @param partition_types
1770  The partition type associated with the partition. Valid only if
1771  image_paths[] of the same index is not NULL.
1772  @param image_paths
1773  Its elements get filled with either NULL or a pointer to a string
1774  with a file address resp. an empty text.
1775  @return
1776  <0 = error
1777  0 = no partition image set
1778  >0 highest used partition number
1779 */
1780 int isoburn_igopt_get_partition_img(struct isoburn_imgen_opts *opts,
1781  int num_entries,
1782  uint8_t partition_types[],
1783  char *image_paths[]);
1784 
1785 
1786 /** Set a name for the system area. This setting is ignored unless system area
1787  type 3 "SUN Disk Label" is in effect by iso_write_opts_set_system_area().
1788  In this case it will replace the default text at the start of the image:
1789  "CD-ROM Disc with Sun sparc boot created by libisofs"
1790  @since 0.6.6
1791  @param opts
1792  The option set to be manipulated.
1793  @param label
1794  A text of up to 128 characters.
1795  @return
1796  <=0 = error, 1 = success
1797 */
1798 int isoburn_igopt_set_disc_label(struct isoburn_imgen_opts *opts, char *label);
1799 
1800 /** Inquire the current setting made by isoburn_igopt_set_disc_label().
1801  @since 0.6.6
1802  @param opts
1803  The option set to be inquired.
1804  @param label
1805  Returns a pointer to the currently set label string.
1806  Do not alter this string.
1807  Use only as long as the opts object exists.
1808  @return
1809  <=0 = error, 1 = success
1810 */
1811 int isoburn_igopt_get_disc_label(struct isoburn_imgen_opts *opts,
1812  char **label);
1813 
1814 /** Set a serial number for the HFS+ extension of the emerging ISO image.
1815  @since 1.2.4
1816  @param opts
1817  The option set to be manipulated.
1818  @param serial_number
1819  8 bytes which should be unique to the image.
1820  If all bytes are 0, then the serial number will be generated as
1821  random number by libisofs. This is the default setting.
1822  @return
1823  <=0 = error, 1 = success
1824 */
1825 int isoburn_igopt_set_hfsp_serial_number(struct isoburn_imgen_opts *opts,
1826  uint8_t serial_number[8]);
1827 
1828 
1829 /** Inquire the current setting made by isoburn_igopt_set_disc_label()
1830  @since 1.2.4
1831  @param opts
1832  The option set to be inquired.
1833  @param serial_number
1834  Will get filled with the current setting.
1835  @return
1836  <=0 = error, 1 = success
1837 */
1838 int isoburn_igopt_get_hfsp_serial_number(struct isoburn_imgen_opts *opts,
1839  uint8_t serial_number[8]);
1840 
1841 /** Set the allocation block size for HFS+ production and the block size
1842  for layout and address unit of Apple Partition map.
1843  @since 1.2.4
1844  @param opts
1845  The option set to be manipulated.
1846  @param hfsp_block_size
1847  -1 means that this setting shall be left unchanged
1848  0 allows the automatic default setting
1849  512 and 2048 enforce a size.
1850  @param apm_block_size
1851  -1 means that this setting shall be left unchanged
1852  0 allows the automatic default setting
1853  512 and 2048 enforce a size.
1854  Size 512 cannot be combined with GPT production.
1855  Size 2048 cannot be mounted -t hfsplus by Linux kernels at least up
1856  to 2.6.32.
1857  @return
1858  <=0 = error, 1 = success
1859 */
1860 int isoburn_igopt_set_hfsp_block_size(struct isoburn_imgen_opts *opts,
1861  int hfsp_block_size, int apm_block_size);
1862 
1863 /** Inquire the current setting made by isoburn_igopt_set_hfsp_block_size
1864  @since 1.2.4
1865  @param opts
1866  The option set to be inquired.
1867  @param hfsp_block_size
1868  Will be set to a value as described above. Except -1.
1869  @param apm_block_size
1870  Will be set to a value as described above. Except -1.
1871  @return
1872  <=0 = error, 1 = success
1873 */
1874 int isoburn_igopt_get_hfsp_block_size(struct isoburn_imgen_opts *opts,
1875  int *hfsp_block_size, int *apm_block_size);
1876 
1877 
1878 /** Set or inquire the write type for the next write run on optical media.
1879  @since 1.2.4
1880  @param opts
1881  The option set to be manipulated or inquired.
1882  @param do_tao
1883  The value to be set or the variable where to return the current
1884  setting:
1885  0 = Let libburn choose according to other write parameters.
1886  This is advisable unless there are particular reasons not to
1887  use one of the two write types. Be aware that 1 and -1 can
1888  lead to failure if the write type is not appropriate for
1889  the given media situation.
1890  1 = Use BURN_WRITE_TAO which does
1891  TAO on CD, Incremental on DVD-R,
1892  no track reservation on DVD+R and BD-R
1893  -1 = Use BURN_WRITE_SAO which does
1894  SAO on CD, DAO on DVD-R,
1895  track reservation on DVD+R and BD-R
1896  @return
1897  <=0 = error, 1 = success
1898 */
1899 int isoburn_igopt_set_write_type(struct isoburn_imgen_opts *opts, int do_tao);
1900 int isoburn_igopt_get_write_type(struct isoburn_imgen_opts *opts, int *do_tao);
1901 
1902 
1903 /** Frontend of libisofs call iso_conv_name_chars() controlled by
1904  struct isoburn_imgen_opts rather than IsoWriteOpts.
1905  See libisofs.h for a more detailed description.
1906  @since 1.3.6
1907  @param opts
1908  Defines options like output charset, UCS-2 versus UTF-16 for Joliet,
1909  and naming restrictions.
1910  @param name
1911  The input text which shall be converted.
1912  @param name_len
1913  The number of bytes in input text.
1914  @param result
1915  Will return the conversion result in case of success. Terminated by
1916  a trailing zero byte.
1917  Use free() to dispose it when no longer needed.
1918  @param result_len
1919  Will return the number of bytes in result (excluding trailing zero)
1920  @param flag
1921  Bitfield for control purposes.
1922  bit0-bit7= Name space
1923  0= generic (to_charset is valid,
1924  no reserved characters, no length limits)
1925  1= Rock Ridge (to_charset is valid)
1926  2= Joliet (to_charset gets overridden by UCS-2 or UTF-16)
1927  3= ECMA-119 (to_charset gets overridden by the
1928  dull ISO 9660 subset of ASCII)
1929  4= HFS+ (to_charset gets overridden by UTF-16BE)
1930  bit8= Treat input text as directory name
1931  (matters for Joliet and ECMA-119)
1932  bit9= Do not issue error messages
1933  bit15= Reverse operation (best to be done only with results of
1934  previous conversions)
1935  @return
1936  1 means success, <=0 means error
1937 */
1938 int isoburn_conv_name_chars(struct isoburn_imgen_opts *opts,
1939  char *name, size_t name_len,
1940  char **result, size_t *result_len, int flag);
1941 
1942 
1943 /* ----------------------------------------------------------------------- */
1944 /* End of Options for image generation */
1945 /* ----------------------------------------------------------------------- */
1946 
1947 
1948 /** Get the image attached to a drive, if any.
1949  @since 0.1.0
1950  @param d The drive to inquire
1951  @return A reference to attached image, or NULL if the drive has no image
1952  attached. This reference needs to be released via iso_image_unref()
1953  when it is not longer needed.
1954 */
1955 IsoImage *isoburn_get_attached_image(struct burn_drive *d);
1956 
1957 /** Get the start address of the image that is attached to the drive, if any.
1958  @since 1.2.2
1959  @param d The drive to inquire
1960  @return The logical block address where the System Area of the image
1961  starts. <0 means that the address is invalid.
1962 */
1963 int isoburn_get_attached_start_lba(struct burn_drive *d);
1964 
1965 
1966 /** Load the ISO filesystem directory tree from the medium in the given drive.
1967  This will give libisoburn the base on which it can let libisofs perform
1968  image growing or image modification. The loaded volset gets attached
1969  to the drive object and handed out to the application.
1970  Not a wrapper, but peculiar to libisoburn.
1971  @since 0.1.0
1972  @param d The drive which holds an existing ISO filesystem or blank media.
1973  d is allowed to be NULL which produces an empty ISO image. In
1974  this case one has to call before writing isoburn_attach_volset()
1975  with the volset from this call and with the intended output
1976  drive.
1977  @param read_opts The read options which can be chosen by the application
1978  @param image the image read, if the disc is blank it will have no files.
1979  This reference needs to be released via iso_image_unref() when
1980  it is not longer needed. The drive, if not NULL, will hold an
1981  own reference which it will release when it gets a new volset
1982  or when it gets released via isoburn_drive_release().
1983  You can pass NULL if you already have a reference or you plan to
1984  obtain it later with isoburn_get_attached_image(). Of course, if
1985  you haven't specified a valid drive (i.e., if d == NULL), this
1986  parameter can't be NULL.
1987  @return <=0 error , 1 = success
1988 */
1989 int isoburn_read_image(struct burn_drive *d,
1990  struct isoburn_read_opts *read_opts,
1991  IsoImage **image);
1992 
1993 /** Set a callback function for producing pacifier messages during the lengthy
1994  process of image reading. The callback function and the application handle
1995  are stored until they are needed for the underlying call to libisofs.
1996  Other than with libisofs the handle is managed entirely by the application.
1997  An idle .free() function is exposed to libisofs. The handle has to stay
1998  valid until isoburn_read_image() is done. It has to be detached by
1999  isoburn_set_read_pacifier(drive, NULL, NULL);
2000  before it may be removed from memory.
2001  @since 0.1.0
2002  @param drive The drive which will be used with isoburn_read_image()
2003  It has to be acquired by an isoburn_* wrapper call.
2004  @param read_pacifier The callback function
2005  @param app_handle The app handle which the callback function can obtain
2006  via iso_image_get_attached_data() from its IsoImage*
2007  @return 1 success, <=0 failure
2008 */
2009 int isoburn_set_read_pacifier(struct burn_drive *drive,
2010  int (*read_pacifier)(IsoImage*, IsoFileSource*),
2011  void *app_handle);
2012 
2013 /** Inquire the partition offset of the loaded image. The first 512 bytes of
2014  the image get examined whether they bear an MBR signature and a first
2015  partition table entry which matches the size of the image. In this case
2016  the start address is recorded as partition offset and internal buffers
2017  get adjusted.
2018  See also isoburn_igopt_set_part_offset().
2019  @since 0.6.2
2020  @param drive The drive with the loaded image
2021  @param block_offset_2k returns the recognized partition offset
2022  @return <0 = error
2023  0 = no partition offset recognized
2024  1 = acceptable non-zero offset, buffers are adjusted
2025  2 = offset is credible but not acceptable for buffer size
2026 */
2027 int isoburn_get_img_partition_offset(struct burn_drive *drive,
2028  uint32_t *block_offset_2k);
2029 
2030 
2031 /** Set the IsoImage to be used with a drive. This eventually releases
2032  the reference to the old IsoImage attached to the drive.
2033  Caution: Use with care. It hardly makes sense to replace an image that
2034  reflects a valid ISO image on the medium.
2035  This call is rather intended for writing a newly created and populated
2036  image to blank media. The use case in xorriso is to let an image survive
2037  the change or demise of the outdev target drive.
2038  @since 0.1.0
2039  @param d The drive which shall be write target of the volset.
2040  @param image The image that represents the image to be written.
2041  This image pointer MUST already be a valid reference suitable
2042  for iso_image_unref().
2043  It may have been obtained by appropriate libisofs calls or by
2044  isoburn_read_image() with d==NULL.
2045  @return <=0 error , 1 = success
2046 */
2047 int isoburn_attach_image(struct burn_drive *d, IsoImage *image);
2048 
2049 
2050 /** Set the start address of the image that is attached to the drive, if any.
2051  @since 1.2.2
2052  @param d The drive to inquire
2053  @param lba The logical block address where the System Area of the image
2054  starts. <0 means that the address is invalid.
2055  @param flag Bitfield, submit 0 for now.
2056  @return <=0 error (e.g. because no image is attached), 1 = success
2057 */
2058 int isoburn_attach_start_lba(struct burn_drive *d, int lba, int flag);
2059 
2060 
2061 /** Return the best possible estimation of the currently available capacity of
2062  the medium. This might depend on particular write option settings and on
2063  drive state.
2064  An eventual start address for emulated multi-session will be subtracted
2065  from the capacity estimation given by burn_disc_available_space().
2066  Negative results get defaulted to 0.
2067  Wrapper for: burn_disc_available_space()
2068  @since 0.1.0
2069  @param d The drive to query.
2070  @param o If not NULL: write parameters to be set on drive before query
2071  @return number of most probably available free bytes
2072 */
2073 off_t isoburn_disc_available_space(struct burn_drive *d,
2074  struct burn_write_opts *o);
2075 
2076 
2077 /** Obtain the start block number of the most recent session on the medium. In
2078  case of random access media this will normally be 0. Successfull return is
2079  not a guarantee that there is a ISO-9660 image at all. The call will fail,
2080  nevertheless,if isoburn_disc_get_status() returns not BURN_DISC_APPENDABLE
2081  or BURN_DISC_FULL.
2082  Note: The result of this call may be fabricated by a previous call of
2083  isoburn_set_msc1() which can override the rule to load the most recent
2084  session.
2085  Wrapper for: burn_disc_get_msc1()
2086  @since 0.1.0
2087  @param d The drive to inquire
2088  @param start_lba Contains on success the start address in 2048 byte blocks
2089  @return <=0 error , 1 = success
2090 */
2091 int isoburn_disc_get_msc1(struct burn_drive *d, int *start_lba);
2092 
2093 
2094 /** Use this with trackno==0 to obtain the predicted start block number of the
2095  new session. The interesting number is returned in parameter nwa.
2096  Wrapper for: burn_disc_track_lba_nwa()
2097  @since 0.1.0
2098  @param d The drive to inquire
2099  @param o If not NULL: write parameters to be set on drive before query
2100  @param trackno Submit 0.
2101  @param lba return value: start lba
2102  @param nwa return value: Next Writeable Address
2103  @return 1=nwa is valid , 0=nwa is not valid , -1=error
2104 */
2105 int isoburn_disc_track_lba_nwa(struct burn_drive *d, struct burn_write_opts *o,
2106  int trackno, int *lba, int *nwa);
2107 
2108 
2109 /** Obtain the size which was attributed to an emulated appendable on actually
2110  overwriteable media. This value is supposed to be <= 2048 * nwa as of
2111  isoburn_disc_track_lba_nwa().
2112  @since 0.1.0
2113  @param d The drive holding the medium.
2114  @param start_byte The reply value counted in bytes, not in sectors.
2115  @param flag Unused yet. Submit 0.
2116  @return 1=stat_byte is valid, 0=not an emulated appendable, -1=error
2117 */
2118 int isoburn_get_min_start_byte(struct burn_drive *d, off_t *start_byte,
2119  int flag);
2120 
2121 
2122 /** Start production of an ISO 9660 image using the method of Growing:
2123  Create a disc object for writing the new session from the created or loaded
2124  iso_volset which has been manipulated via libisofs, to the same medium from
2125  where the image was eventually loaded.
2126  This call starts a libisofs thread which begins to produce the image.
2127  It has to be revoked by isoburn_cancel_prepared_write() if for some reason
2128  this image data stream shall not be consumed.
2129  The returned struct burn_disc is ready for use by a subsequent call to
2130  isoburn_disc_write(). After this asynchronous writing has ended and the
2131  drive is BURN_DRIVE_IDLE again, the burn_disc object has to be disposed
2132  by burn_disc_free().
2133  @since 0.1.0
2134  @param drive The combined source and target drive, grabbed with
2135  isoburn_drive_scan_and_grab(). .
2136  @param disc Returns the newly created burn_disc object.
2137  @param opts Image generation options, see isoburn_igopt_*()
2138  @return <=0 error , 1 = success
2139 */
2140 int isoburn_prepare_disc(struct burn_drive *drive, struct burn_disc **disc,
2141  struct isoburn_imgen_opts *opts);
2142 
2143 
2144 /** Start production of an ISO 9660 image using the method of Modifying:
2145  Create a disc object for producing a new image from a previous image
2146  plus the changes made by user. The generated burn_disc is suitable
2147  to be written to a grabbed drive with blank writeable medium.
2148  But you must not use the same drive for input and output, because data
2149  will be read from the source drive while at the same time the target
2150  drive is already writing.
2151  This call starts a libisofs thread which begins to produce the image.
2152  It has to be revoked by isoburn_cancel_prepared_write() if for some reason
2153  this image data stream shall not be consumed.
2154  The resulting burn_disc object has to be disposed when all its writing
2155  is done and the drive is BURN_DRIVE_IDLE again after asynchronous
2156  burn_disc_write().
2157  @since 0.1.0
2158  @param in_drive The input drive, grabbed with isoburn_drive_aquire() or
2159  one of its alternatives.
2160  @param disc Returns the newly created burn_disc object.
2161  @param opts Options for image generation and data transport to the
2162  medium.
2163  @param out_drive The output drive, from isoburn_drive_aquire() et.al..
2164  @return <=0 error , 1 = success
2165 */
2166 int isoburn_prepare_new_image(struct burn_drive *in_drive,
2167  struct burn_disc **disc,
2168  struct isoburn_imgen_opts *opts,
2169  struct burn_drive *out_drive);
2170 
2171 
2172 /** Start production of an ISO 9660 image using the method of Blind Growing:
2173  Create a disc object for writing an add-on session from the created or
2174  loaded IsoImage which has been manipulated via libisofs, to a different
2175  drive than the one from where it was loaded.
2176  Usually output will be stdio:/dev/fd/1 (i.e. stdout) being piped
2177  into some burn program like with this classic gesture:
2178  mkisofs -M $dev -C $msc1,$nwa | cdrecord -waiti dev=$dev
2179  Parameter translation into libisoburn:
2180  $dev is the address by which parameter in_drive of this call was
2181  acquired $msc1 was set by isoburn_set_msc1() before image reading
2182  or was detected from the in_drive medium
2183  $nwa is a parameter of this call
2184  or can be used as detected from the in_drive medium
2185 
2186  This call starts a libisofs thread which begins to produce the image.
2187  It has to be revoked by isoburn_cancel_prepared_write() if for some reason
2188  this image data stream shall not be consumed.
2189  This call waits for libisofs output to become available and then detaches
2190  the input drive object from the data source object by which libisofs was
2191  reading from the input drive.
2192  So, as far as libisofs is concerned, that drive may be released immediately
2193  after this call in order to allow the consumer to access the drive for
2194  writing.
2195  The consumer should wait for input to become available and only then open
2196  its burn drive. With cdrecord this is caused by option -waiti.
2197 
2198  The resulting burn_disc object has to be disposed when all its writing
2199  is done and the drive is BURN_DRIVE_IDLE again after asynchronous
2200  burn_disc_write().
2201  @since 0.2.2
2202  @param in_drive The input drive,grabbed with isoburn_drive_scan_and_grab().
2203  @param disc Returns the newly created burn_disc object.
2204  @param opts Options for image generation and data transport to media.
2205  @param out_drive The output drive, from isoburn_drive_aquire() et.al..
2206  typically stdio:/dev/fd/1 .
2207  @param nwa The address (2048 byte block count) where the add-on
2208  session will be finally stored on a mountable medium
2209  or in a mountable file.
2210  If nwa is -1 then the address is used as determined from
2211  the in_drive medium.
2212  @return <=0 error , 1 = success
2213 */
2214 int isoburn_prepare_blind_grow(struct burn_drive *in_drive,
2215  struct burn_disc **disc,
2216  struct isoburn_imgen_opts *opts,
2217  struct burn_drive *out_drive, int nwa);
2218 
2219 
2220 /**
2221  Revoke isoburn_prepare_*() instead of running isoburn_disc_write().
2222  libisofs reserves resources and maybe already starts generating the
2223  image stream when one of above three calls is performed. It is mandatory to
2224  either run isoburn_disc_write() or to revoke the preparations by the
2225  call described here.
2226  If this call returns 0 or 1 then the write thread of libisofs has ended.
2227  @since 0.1.0
2228  @param input_drive The drive resp. in_drive which was used with the
2229  preparation call.
2230  @param output_drive The out_drive used with isoburn_prepare_new_image(),
2231  NULL if none.
2232  @param flag Bitfield, submit 0 for now.
2233  bit0= -reserved for internal use-
2234  @return <0 error, 0= no pending preparations detectable, 1 = canceled
2235 */
2236 int isoburn_cancel_prepared_write(struct burn_drive *input_drive,
2237  struct burn_drive *output_drive, int flag);
2238 
2239 
2240 /**
2241  Override the truncation setting that was made with flag bit2 during the
2242  call of isoburn_drive_aquire. This applies only to stdio pseudo drives.
2243  @since 0.1.6
2244  @param drive The drive which was acquired and shall be used for writing.
2245  @param flag Bitfield controlling the setting:
2246  bit0= truncate (else do not truncate)
2247  bit1= do not warn if call is inappropriate to drive
2248  bit2= only set if truncation is currently enabled
2249  do not warn if call is inappropriate to drive
2250  @return 1 success, 0 inappropriate drive, <0 severe error
2251 */
2252 int isoburn_set_truncate(struct burn_drive *drive, int flag);
2253 
2254 
2255 /** Start writing of the new session.
2256  This call is asynchrounous. I.e. it returns quite soon and the progress has
2257  to be watched by a loop with call burn_drive_get_status() until
2258  BURN_DRIVE_IDLE is returned.
2259  Wrapper for: burn_disc_write()
2260  @since 0.1.0
2261  @param o Options which control the burn process. See burnwrite_opts_*()
2262  in libburn.h.
2263  @param disc Disc object created either by isoburn_prepare_disc() or by
2264  isoburn_prepare_new_image().
2265 */
2266 void isoburn_disc_write(struct burn_write_opts *o, struct burn_disc *disc);
2267 
2268 
2269 /** Inquire state and fill parameters of the fifo which is attached to
2270  the emerging track. This should be done in the pacifier loop while
2271  isoburn_disc_write() or burn_disc_write() are active.
2272  This works only with drives obtained by isoburn_drive_scan_and_grab()
2273  or isoburn_drive_grab(). If isoburn_prepare_new_image() was used, then
2274  parameter out_drive must have announced the track output drive.
2275  Hint: If only burn_write_opts and not burn_drive is known, then the drive
2276  can be obtained by burn_write_opts_get_drive().
2277  @since 0.1.0
2278  @param d The drive to which the track with the fifo gets burned.
2279  @param size The total size of the fifo
2280  @param free_bytes The current free capacity of the fifo
2281  @param status_text Returns a pointer to a constant text, see below
2282  @return <0 reply invalid, >=0 fifo status code:
2283  bit0+1=input status, bit2=consumption status, i.e:
2284  0="standby" : data processing not started yet
2285  1="active" : input and consumption are active
2286  2="ending" : input has ended without error
2287  3="failing" : input had error and ended,
2288  4="unused" : ( consumption has ended before processing start )
2289  5="abandoned" : consumption has ended prematurely
2290  6="ended" : consumption has ended without input error
2291  7="aborted" : consumption has ended after input error
2292 */
2293 int isoburn_get_fifo_status(struct burn_drive *d, int *size, int *free_bytes,
2294  char **status_text);
2295 
2296 
2297 /** Inquire whether the most recent write run was successful.
2298  Wrapper for: burn_drive_wrote_well()
2299  @since 0.1.0
2300  @param d The drive to inquire
2301  @return 1=burn seems to have went well, 0=burn failed
2302 */
2303 int isoburn_drive_wrote_well(struct burn_drive *d);
2304 
2305 
2306 /** Call this after isoburn_disc_write has finished and burn_drive_wrote_well()
2307  indicates success. It will eventually complete the emulation of
2308  multi-session functionality, if needed at all. Let libisoburn decide.
2309  Not a wrapper, but peculiar to libisoburn.
2310  @since 0.1.0
2311  @param d The output drive to which the session was written
2312  @return 1 success , <=0 failure
2313 */
2314 int isoburn_activate_session(struct burn_drive *d);
2315 
2316 
2317 /** Wait after normal end of operations until libisofs ended all write
2318  threads and freed resource reservations.
2319  This call is not mandatory. But without it, messages from the ending
2320  threads might appear after the application ended its write procedure.
2321  @since 0.1.0
2322  @param input_drive The drive resp. in_drive which was used with the
2323  preparation call.
2324  @param output_drive The out_drive used with isoburn_prepare_new_image(),
2325  NULL if none.
2326  @param flag Bitfield, submit 0 for now.
2327  @return <=0 error , 1 = success
2328 */
2329 int isoburn_sync_after_write(struct burn_drive *input_drive,
2330  struct burn_drive *output_drive, int flag);
2331 
2332 
2333 /** Release an acquired drive.
2334  Wrapper for: burn_drive_release()
2335  @since 0.1.0
2336  @param drive The drive to be released
2337  @param eject 1= eject medium from drive , 0= do not eject
2338 */
2339 void isoburn_drive_release(struct burn_drive *drive, int eject);
2340 
2341 
2342 /** Shutdown all three libraries.
2343  Wrapper for : iso_finish() and burn_finish().
2344  @since 0.1.0
2345 */
2346 void isoburn_finish(void);
2347 
2348 
2349 /*
2350  The following calls are for expert applications only.
2351  An application should have a special reason to use them.
2352 */
2353 
2354 
2355 /** Inquire wether the medium needs emulation or would be suitable for
2356  generic multi-session via libburn.
2357  @since 0.1.0
2358  @param d The drive to inquire
2359  @return 0 is generic multi-session
2360  1 is emulated multi-session
2361  -1 is not suitable for isoburn
2362 */
2363 int isoburn_needs_emulation(struct burn_drive *d);
2364 
2365 
2366 /* ---------------------------- Test area ----------------------------- */
2367 
2368 /* no tests active, currently */
2369 

Generated for libisoburn by  doxygen 1.8.3.1