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