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