xorriso  1.5.4.pl02
About: GNU xorriso creates, loads, manipulates and writes ISO 9660 filesystem images with Rock Ridge extensions. It is suitable for incremental data backup and for production of bootable ISO 9660 images. GNU xorriso is a statical compilation of the libraries libburn, libisofs, libisoburn, and libjte.
  Fossies Dox: xorriso-1.5.4.pl02.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

isoburn.h
Go to the documentation of this file.
1 
2 /*
3  Class struct of libisoburn.
4 
5  Copyright 2007 - 2009 Vreixo Formoso Lopes <metalpain2002@yahoo.es>
6  Copyright 2007 - 2020 Thomas Schmitt <scdbackup@gmx.net>
7 
8  Provided under GPL version 2 or later.
9 */
10 
11 #ifndef Isoburn_includeD
12 #define Isoburn_includeD
13 
14 
15 /* for uint8_t */
16 #ifdef HAVE_STDINT_H
17 #include <stdint.h>
18 #else
19 #ifdef HAVE_INTTYPES_H
20 #include <inttypes.h>
21 #endif
22 #endif
23 
24 /* For emulated TOC of overwritable media.
25  Provides minimal info for faking a struct burn_toc_entry.
26 */
28  int session;
29  int track_no; /* point */
30  int start_lba;
32  char *volid; /* For caching a volume id from emulated toc on overwritables */
33 
35 };
36 
37 int isoburn_toc_entry_new(struct isoburn_toc_entry **objpt,
38  struct isoburn_toc_entry *boss, int flag);
39 
40 /* @param flag bit0= delete all subordinates too
41 */
42 int isoburn_toc_entry_destroy(struct isoburn_toc_entry **o, int flag);
43 
44 
45 /* Minimal size of target_iso_head which is to be written during
46  isoburn_activate_session().
47  Within this size there is everything that is needed for image access with
48  no partition offset. The actual target_iso_head buffer must be larger by
49  the evential partition offset.
50 */
51 #define Libisoburn_target_head_sizE (32*2048)
52 
53 
54 /* Maximum number of appended partitions. Effectively usable number depends
55  on system area type.
56 */
57 #define Libisoburn_max_appended_partitionS 8
58 
59 /*
60  Maximum length of a disc label text plus 1.
61 */
62 #define Libisoburn_disc_label_sizE 129
63 
64 
65 struct isoburn {
66 
67 
68  /* The libburn drive to which this isoburn object is related
69  Most isoburn calls will use a burn_drive as object handle */
70  struct burn_drive *drive;
71 
72  /* -1= inappropriate medium state detected
73  0= libburn multi-session medium, resp. undecided yet
74  1= random access medium */
76 
77  /* Although rarely used, libburn can operate on several
78  drives simultaneously. */
79  struct isoburn *prev;
80  struct isoburn *next;
81 
82 
83  /* If >= 0, this address is used as reply for isoburn_disc_get_msc1()
84  */
86 
87  /* If >= 0, this address is used in isoburn_disc_track_lba_nwa()
88  as reply parameter nwa.
89  (The other nwa parameters below apply only to the effective write address
90  on random access media. msc2 is handed to libisofs but not to libburn.)
91  */
93 
94 
95  /* The nwa to be used for a first session on the present kind of overwritable
96  media (usually Libisoburn_overwriteable_starT, but might be forced to 0)
97  */
98  int zero_nwa;
99 
100  /* Start address as given by image examination (bytes, not blocks) */
102 
103  /* Aligned start address to be used for processing (counted in blocks) */
104  int nwa;
105 
106 
107  /* Truncate to .nwa an eventual regular file serving as output drive */
108  int truncate;
109 
110  /* Eventual freely fabricated isoburn_disc_get_status().
111  BURN_DISC_UNREADY means that this variable is disabled
112  and normally emulated status is in effect.
113  */
115 
116  /* To be set if read errors occurred during media evaluation.
117  */
119 
120  /* Eventual emulated table of content read from the chain of ISO headers
121  on overwritable media.
122  */
124 
125  /* Indicator whether the most recent burn run worked :
126  -1 = undetermined, ask libburn , 0 = failure , 1 = success
127  To be inquired by isoburn_drive_wrote_well()
128  */
130 
131 
132  /* ISO head buffer to be filled by write run */
134  uint8_t *target_iso_head;
135 
136  /* The 2k offset which was read from a loaded image.
137  */
139 
140 
141  /* Libisofs image context */
143 
144  /* The start LBA of the image */
146 
147  /* The block data source from which the existing image is read.
148  */
150 
151  /* The burn source which transfers data from libisofs to libburn.
152  It has its own fifo.
153  */
155 
156  /* For iso_tree_set_report_callback() */
158 
159  /* For iso_image_attach_data() */
161 
162  /* An application provided method to immediately deliver messages */
163  int (*msgs_submit)(void *handle, int error_code, char msg_text[],
164  int os_errno, char severity[], int flag);
165  void *msgs_submit_handle; /* specific to application method */
166  int msgs_submit_flag; /* specific to application method */
167 
168  /* Forwarding an image generation option to the burn wrapper */
169  int do_tao;
170 
171  /* Forwarding an image generation option to the burn wrapper */
172  int do_fsync;
173 
174 };
175 
176 
177 /* Creation and disposal function */
178 int isoburn_new(struct isoburn **objpt, int flag);
179 int isoburn_destroy(struct isoburn **objpt, int flag);
180 
181 /* Eventual readers for public attributes */
182 /* ( put into separate .h file then ) */
183 int isoburn_get_emulation_mode(struct isoburn *o, int *pt, int flag);
184 int isoburn_get_target_volset(struct isoburn *o, IsoImage **pt, int flag);
185 
186 /* List management */
187 int isoburn_get_prev(struct isoburn *o, struct isoburn **pt, int flag);
188 int isoburn_get_next(struct isoburn *o, struct isoburn **pt, int flag);
189 int isoburn_destroy_all(struct isoburn **objpt, int flag);
190 int isoburn_link(struct isoburn *o, struct isoburn *link, int flag);
191 int isoburn_count(struct isoburn *o, int flag);
192 int isoburn_by_idx(struct isoburn *o, int idx, struct isoburn **pt, int flag);
193 int isoburn_find_by_drive(struct isoburn **pt, struct burn_drive *d, int flag);
194 
195 
196 /* Non API inner interfaces */
197 
198 /* Submit a libisofs error to the libburn messenger. An application message
199  reader shall recognize the error code range and attribute it to the
200  libisofs message channel to which one cannot submit via API.
201  @param iso_error_code return value <= 0 from a libisofs API call.
202  @param default_msg_text is to be put out if iso_error_code leads to no
203  error message
204  @param os_errno operating system errno, submit 0 if none is known
205  @param min_severity minimum severity, might be be increased if libisofs
206  error severity surpasses min_severity.
207  @param flag Bitfield, submit 0 for now
208 */
209 int isoburn_report_iso_error(int iso_error_code, char default_msg_text[],
210  int os_errno, char min_severity[], int flag);
211 
212 /* Calls from burn_wrap.c into isofs_wrap.c */
213 
214 int isoburn_start_emulation(struct isoburn *o, int flag);
215 int isoburn_invalidate_iso(struct isoburn *o, int flag);
216 
217 
218 /* Calls from isofs_wrap.c into burn_wrap.c */
219 
220 /** Get an eventual isoburn object which is wrapped around the drive.
221  @param pt Eventually returns a pointer to the found object.
222  It is allowed to become NULL if return value is -1 or 0.
223  In this case, the drive is a genuine libburn drive
224  with no emulation activated by isoburn.
225  @param drive The drive to be searched for
226  @param flag unused yet
227  @return -1 unsuitable medium, 0 generic medium, 1 emulated medium.
228 */
229 int isoburn_find_emulator(struct isoburn **pt,
230  struct burn_drive *drive, int flag);
231 
232 /* Deliver an event message. Either via a non-NULL o->msgs_submit() method
233  or via burn_msgs_submit() of libburn.
234 */
235 int isoburn_msgs_submit(struct isoburn *o, int error_code, char msg_text[],
236  int os_errno, char severity[], int flag);
237 
238 /** Set the start address for an emulated add-on session. The value will
239  be rounded up to the alignment necessary for the medium. The aligned
240  value will be divided by 2048 and then put into o->nwa .
241  @param o The isoburn object to be programmed.
242  @param value The start address in bytes
243  @param flag unused yet
244  @return <=0 is failure , >0 success
245 */
246 int isoburn_set_start_byte(struct isoburn *o, off_t value, int flag);
247 
248 /** Obtains the image address offset to be used with image generation.
249  This is either the (emulated) drive nwa or a value set by
250  isoburn_prepare_blind_grow().
251  In any case this is the address to tell to iso_write_opts_set_ms_block().
252  @param o The isoburn object to be inquired
253  @param opts If not NULL: write parameters to be set on drive before query
254  @param msc2 The value to be used with iso_write_opts_set_ms_block()
255  @param flag unused yet
256  @return <=0 is failure , >0 success
257 */
258 int isoburn_get_msc2(struct isoburn *o,
259  struct burn_write_opts *opts, int *msc2, int flag);
260 
261 /** Get a data source suitable for read from a drive using burn_read_data()
262  function.
263  @param d drive to read from. Must be grabbed.
264  @param displacement will be added or subtracted to any block address
265  @param displacement_sign +1 = add , -1= subtract , else keep unaltered
266  @return the data source, NULL on error. Must be freed with libisofs
267  iso_data_source_unref() function. Note: this doesn't release
268  the drive.
269 */
272  uint32_t displacement, int displacement_sign,
273  int cache_tiles, int tile_blocks);
274 
275 /** Default settings for above cache_tiles, tile_blocks in newly created
276  struct isoburn_read_opts.
277 */
278 #define Libisoburn_default_cache_tileS 32
279 #define Libisoburn_default_tile_blockS 32
280 
281 /** Maximum size of the cache in 2 kB blocks (1 GB)
282 */
283 #define Libisoburn_cache_max_sizE (1024 * 512)
284 
285 
286 /** Disable read capabilities of a data source which was originally created
287  by isoburn_data_source_new(). After this any attempt to read will yield
288  a FATAL programming error event.
289  This is usually done to allow libburn to release the drive while libisofs
290  still holds a reference to the data source object. libisofs is not supposed
291  to use this object for reading any more, nevertheless. The disabled state
292  of the data source is a safety fence around this daring situation.
293  @param src The data source to be disabled
294  @param flag unused yet
295  @return <=0 is failure , >0 success
296 */
297 int isoburn_data_source_shutdown(IsoDataSource *src, int flag);
298 
299 
300 /** Check whether the size of target_iso_head matches the given partition
301  offset. Eventually adjust size.
302 */
304  uint32_t offst, int flag);
305 
306 
307 /** Initialize the root directory attributes of a freshly created image.
308 */
309 int isoburn_root_defaults(IsoImage *image, int flag);
310 
311 
312 /**
313  * Options for image reading.
314  (Comments here may be outdated. API getter/setter function descriptions
315  may override the descriptions here. Any difference is supposed to be a
316  minor correction only.)
317  */
319  int cache_tiles; /* number of cache tiles */
321 
322  unsigned int norock:1; /*< Do not read Rock Ridge extensions */
323  unsigned int nojoliet:1; /*< Do not read Joliet extensions */
324  unsigned int noiso1999:1; /*< Do not read ISO 9660:1999 enhanced tree */
325 
326  unsigned int do_ecma119_map:1; /* call iso_read_opts_set_ecma119_map() */
327  unsigned int map_mode:2; /* argument for do_ecma119_map */
328 
329  unsigned int do_joliet_map:1; /* call iso_read_opts_set_joliet_map() */
330  unsigned int joliet_map_mode:1; /* for iso_read_opts_set_joliet_map */
331 
332  /* ts A90121 */
333  unsigned int noaaip:1; /* Do not read AAIP for ACL and EA */
334  unsigned int noacl:1; /* Do not read ACL from external file objects */
335  unsigned int noea:1; /* Do not read XFS-style EA from externals */
336 
337  /* ts A90508 */
338  unsigned int noino:1; /* Discard eventual PX inode numbers */
339 
340  /* ts A90810 */
341  unsigned int nomd5:2; /* Do not read eventual MD5 array */
342 
343  unsigned int preferjoliet:1;
344  /*< When both Joliet and RR extensions are present, the RR
345  * tree is used. If you prefer using Joliet, set this to 1. */
346  uid_t uid; /**< Default uid when no RR */
347  gid_t gid; /**< Default uid when no RR */
348  mode_t mode; /**< Default mode when no RR (only permissions) */
349  mode_t dirmode; /**< Default mode for directories
350  when no RR (only permissions) */
351 
352  /**
353  * Input charset for RR file names. NULL to use default locale charset.
354  */
356 
357  /**
358  * Enable or disable methods to automatically choose an input charset.
359  * This eventually overrides input_charset.
360  *
361  * bit0= set the input character set automatically from
362  * attribute "isofs.cs" of root directory
363  */
365 
366  /**
367  * What to do in case of name longer than truncate_length:
368  * 0= throw FAILURE
369  * 1= truncate to truncate_length with MD5 of whole name at end
370  */
373 
374  /* modified by the function isoburn_read_image */
375  unsigned int hasRR:1; /*< It will be set to 1 if RR extensions are present,
376  to 0 if not. */
377  unsigned int hasJoliet:1; /*< It will be set to 1 if Joliet extensions are
378  present, to 0 if not. */
379 
380  /**
381  * It will be set to 1 if the image is an ISO 9660:1999, i.e. it has
382  * a version 2 Enhanced Volume Descriptor.
383  */
384  unsigned int hasIso1999:1;
385 
386  /** It will be set to 1 if El-Torito boot record is present, to 0 if not.*/
387  unsigned int hasElTorito:1;
388 
389  uint32_t size; /**< Will be filled with the size (in 2048 byte block) of
390  * the image, as reported in the PVM. */
391 
392  int tree_loaded; /* from iso_read_image_features_tree_loaded() */
393  int rr_loaded; /* from iso_read_image_features_rr_loaded */
394 
395 
396  unsigned int pretend_blank:1; /* always create empty image */
397 
398  uint32_t displacement;
400 };
401 
402 
403 /**
404  * Options for image generation by libisofs and image transport to libburn.
405  (Comments here may be outdated. API getter/setter function descriptions
406  may override the descriptions here. Any difference is supposed to be a
407  minor correction only.)
408  */
410 
411  /* Options for image generation */
412 
413  int will_cancel :1;
414 
415  int level; /**< ISO level to write at. */
416 
417  /** Which extensions to support. */
418  unsigned int rockridge :1;
419  unsigned int joliet :1;
420  unsigned int iso1999 :1;
421  unsigned int hfsplus :1;
422  unsigned int fat :1;
423 
424  /* Whether to mark suitable IsoNode as hardlinks in RRIP PX */
425  unsigned int hardlinks :1;
426 
427  /* Write eventual AAIP info containing ACL and EA */
428  unsigned int aaip :1;
429 
430  /* Produce and write a MD5 checksum of the whole session stream. */
431  unsigned int session_md5 :1;
432 
433  /* Produce and write MD5 checksums for each single IsoFile.
434  See parameter "files" of iso_write_opts_set_record_md5().
435  */
436  unsigned int file_md5 :2;
437 
438  /* On overwritable media or random access files do not write the first
439  session to LBA 32, but rather to LBA 0 directly.
440  */
441  unsigned int no_emul_toc :1;
442 
443  /* For empty files, symbolic links, and devices use the old ECMA-119 block
444  addresses in the range [0,31] rather than the address of the dedicated
445  empty block.
446  */
447  unsigned int old_empty :1;
448 
449 
450  /* relaxed constraints */
451 
452  /*
453  * Relaxed constraints. Setting any of these to 1 break the specifications,
454  * but it is supposed to work on most moderns systems. Use with caution.
455  */
456 
457  /*
458  * Extra Caution: This option breaks any assumptions about names that
459  * are supported by ECMA-119 specifications.
460  * Omit any translation which would make a file name compliant to the
461  * ECMA-119 rules. This includes and exceeds omit_version_numbers,
462  * max_37_char_filenames, no_force_dots bit0, allow_lowercase.
463  */
464  unsigned int untranslated_name_len;
465 
466  /*
467  * Convert directory names for ECMA-119 similar to other file names, but do
468  * not force a dot or add a version number.
469  * This violates ECMA-119 by allowing one "." and especially ISO level 1
470  * by allowing DOS style 8.3 names rather than only 8 characters.
471  * (mkisofs and its clones seem to do this violation.)
472  */
473  unsigned int allow_dir_id_ext :1;
474 
475  /**
476  * Omit the version number (";1") at the end of the ISO-9660 identifiers.
477  * Version numbers are usually not used.
478  * bit0= omit version number with ECMA-119 and Joliet
479  * bit1= omit version number with Joliet alone
480  */
481  unsigned int omit_version_numbers :2;
482 
483  /**
484  * Allow ISO-9660 directory hierarchy to be deeper than 8 levels.
485  */
486  unsigned int allow_deep_paths :1;
487 
488  /**
489  * If not allow_deep_paths is in effect, then it may become
490  * necessary to relocate directories so that no ECMA-119 file path
491  * has more than 8 components. These directories are grafted into either
492  * the root directory of the ISO image or into a dedicated relocation
493  * directory. For details see libisofs.h, iso_write_opts_set_rr_reloc().
494  */
495  char *rr_reloc_dir; /* IsoNode name in root directory. NULL or
496  empty text means root itself. */
497  int rr_reloc_flags; /* bit0= mark auto-created rr_reloc_dir by RE
498  bit1= not settable via API (used internally)
499  */
500 
501 
502 
503  /**
504  * Allow path in the ISO-9660 tree to have more than 255 characters.
505  */
506  unsigned int allow_longer_paths :1;
507 
508  /**
509  * Allow a single file or directory hierarchy to have up to 37 characters.
510  * This is larger than the 31 characters allowed by ISO level 2, and the
511  * extra space is taken from the version number, so this also forces
512  * omit_version_numbers.
513  */
514  unsigned int max_37_char_filenames :1;
515 
516  /**
517  * ISO-9660 forces filenames to have a ".", that separates file name from
518  * extension. libisofs adds it if original filename doesn't has one. Set
519  * this to 1 to prevent this behavior
520  * bit0= no forced dot with ECMA-119
521  * bit1= no forced dot with Joliet
522  */
523  unsigned int no_force_dots :2;
524 
525  /**
526  * Allow lowercase characters in ISO-9660 filenames. By default, only
527  * uppercase characters, numbers and a few other characters are allowed.
528  */
529  unsigned int allow_lowercase :1;
530 
531  /**
532  * Allow all ASCII characters to be appear on an ISO-9660 filename. Note
533  * that "/" and "\0" characters are never allowed, even in RR names.
534  */
535  unsigned int allow_full_ascii :1;
536 
537  /**
538  * Like allow_full_ascii, but only allowing 7-bit characters.
539  * Lowercase letters get mapped to uppercase if not allow_lowercase is set.
540  * Gets overridden if allow_full_ascii is enabled.
541  */
542  unsigned int allow_7bit_ascii :1;
543 
544  /**
545  * Allow paths in the Joliet tree to have more than 240 characters.
546  */
547  unsigned int joliet_longer_paths :1;
548 
549  /**
550  * Allow leaf names in the Joliet tree to have up to 103 characters
551  * rather than 64.
552  */
553  unsigned int joliet_long_names :1;
554 
555  /**
556  * Use UTF-16BE rather than its subset UCS-2
557  */
558  unsigned int joliet_utf16 :1;
559 
560  /**
561  * Store timestamps as GMT rather than in local time.
562  */
563  unsigned int always_gmt :1;
564 
565  /**
566  * Write Rock Ridge info as of specification RRIP-1.10 rather than
567  * RRIP-1.12: signature "RRIP_1991A" rather than "IEEE_1282",
568  * field PX without file serial number
569  */
570  unsigned int rrip_version_1_10 :1;
571 
572  /**
573  * Store as ECMA-119 Directory Record timestamp the mtime
574  * of the source rather than the image creation time.
575  * The same can be ordered for Joliet and ISO 9660:1999
576  */
577  unsigned int dir_rec_mtime :1;
578  unsigned int joliet_rec_mtime :1;
579  unsigned int iso1999_rec_mtime :1;
580 
581  /**
582  * Write AAIP as extension according to SUSP 1.10 rather than SUSP 1.12.
583  * I.e. without announcing it by an ER field and thus without the need
584  * to precede the RRIP fields by an ES and to precede the AA field by ES.
585  */
586  unsigned int aaip_susp_1_10 :1;
587 
588  unsigned int sort_files:1;
589  /**< If files should be sorted based on their weight. */
590 
591  /**
592  * The following options set the default values for files and directory
593  * permissions, gid and uid. All these take one of three values: 0, 1 or 2.
594  * If 0, the corresponding attribute will be kept as set in the IsoNode.
595  * Unless you have changed it, it corresponds to the value on disc, so it
596  * is suitable for backup purposes. If set to 1, the corresponding attrib.
597  * will be changed by a default suitable value. Finally, if you set it to
598  * 2, the attrib. will be changed with the value specified in the options
599  * below. Note that for mode attributes, only the permissions are set, the
600  * file type remains unchanged.
601  */
602  unsigned int replace_dir_mode :2;
603  unsigned int replace_file_mode :2;
604  unsigned int replace_uid :2;
605  unsigned int replace_gid :2;
606 
607  mode_t dir_mode; /** Mode to use on dirs when replace_dir_mode == 2. */
608  mode_t file_mode; /** Mode to use on files when replace_file_mode == 2. */
609  uid_t uid; /** uid to use when replace_uid == 2. */
610  gid_t gid; /** gid to use when replace_gid == 2. */
611 
612  char *output_charset; /**< NULL to use default charset */
613 
614 
615  /* Options for image transport */
616 
617  /** The number of bytes to be used for the fifo which decouples libisofs
618  and libburn for better throughput and for reducing the risk of
619  interrupting signals hitting the libburn thread which operates the
620  MMC drive.
621  The size will be rounded up to the next full 2048.
622  Minimum is 64kiB, maximum is 1 GiB (but that is too much anyway).
623  */
625 
626 
627  /** Output value: Block address of session start as evaluated from medium
628  and other options by libisoburn and libburn.
629  If <0 : Invalid
630  If >=0: Valid block number. Block size is always 2 KiB.
631  */
633 
634  /** Output value: Block address of data section start as predicted by
635  libisofs.
636  If < 16: Invalid
637  If >=16: Valid block number. Block size is always 2 KiB.
638  */
640 
641  /**
642  * If not empty: Parameters "name" and "timestamp" for a scdbackup stream
643  * checksum tag. See scdbackup/README appendix VERIFY.
644  * It makes sense only for single session images which start at LBA 0.
645  * Such a tag may be part of a libisofs checksum tag block after the
646  * session tag line. It then covers the whole session up to its own start
647  * position.
648  * If scdbackup_tag_written is not NULL then it is a pointer to an
649  * application provided array with at least 512 characters. The effectively
650  * written scdbackup tag will be copied to this memory location.
651  */
655 
656 
657  /* Content of an embedded boot image. Valid if not NULL.
658  * In that case it must point to a memory buffer at least 32 kB.
659  */
661  /*
662  * bit0= make bytes 446 - 512 of the system area a partition
663  * table which reserves partition 1 from byte 63*512 to the
664  * end of the ISO image. Assumed are 63 secs/hed, 255 head/cyl.
665  * (GRUB protective msdos label.)
666  * This works with and without system_area_data.
667  */
669 
670  /* User settable PVD time stamps */
675  /* To eventually override vol_modification_time by unconverted string
676  and timezone 0 */
677  char vol_uuid[17];
678 
679  /* The number of unclaimed 2K blocks before start of partition 1 as of
680  the MBR in system area. If not 0 this will cause double volume
681  descriptor sets and double tree.
682  */
684  /* Partition table parameter: 1 to 63, 0= disabled/default */
686  /* 1 to 255, 0= disabled/default */
688 
689  /* Parameters and state of Jigdo Template Export environment.
690  */
692 
693  /* A trailing padding of zero bytes which belongs to the image
694  */
695  uint32_t tail_blocks;
696 
697  /* Disk file paths of content of PreP partition and EFI system partition */
702 
703  /* Disk file paths of prepared images which shall be appended
704  after the ISO image and described by partition table entries in a MBR.
705  NULL means unused.
706  */
711 
712  /* Flags in case that appended partitions show up in GPT:
713  bit0= appended_part_type_guids[same_index] is valid
714  */
716 
717  /* If 1: With appended partitions: create protective MBR and mark by GPT
718  */
720 
721  /* If 1: With appended partitions: mark by APM
722  */
724 
725  /* If 1: Apply isohybrid gestures to non-isohybrid situations
726  */
728 
729  /* isoburn_igopt_set_iso_mbr_part_type()
730  */
732 
733  /* isoburn_igopt_set_iso_type_guid()
734  */
735  uint8_t iso_gpt_type_guid[16];
736  /* bit0= iso_gpt_type_guid is valid
737  */
739 
740  /* See libisoburn.h isoburn_igopt_set_gpt_guid()
741  */
742  uint8_t gpt_guid[16];
744 
745  /* Eventual name of the non-ISO aspect of the image. E.g. SUN ASCII label.
746  */
748 
749  /* HFS+ image serial number.
750  * 00...00 means that it shall be generated by libisofs.
751  */
752  uint8_t hfsp_serial_number[8];
753 
754  /* Allocation block size of HFS+ : 0= auto , 512, or 2048
755  */
757 
758  /* Block size of and in APM : 0= auto , 512, or 2048
759  */
761 
762  /* Write mode for optical media:
763  * 0 = auto
764  * 1 = TAO, Incremental, no RESERVE TRACK
765  * -1 = SAO, DAO, RESERVE TRACK
766  */
767  int do_tao;
768 
769  /* Whether to fsync() stdio_drives after isoburn_activate_session() */
770  int do_fsync;
771 
772 };
773 
774 
775 /* Alignment for session starts on overwritable media.
776  (Increased from 16 to 32 blocks for aligning to BD-RE clusters.)
777 */
778 #define Libisoburn_nwa_alignemenT 32
779 
780 
781 /* Alignment for outer session scanning with -ROM drives.
782  (E.g. my DVD-ROM drive shows any DVD type as 0x10 "DVD-ROM" with
783  more or less false capacity and TOC.)
784 */
785 #define Libisoburn_toc_scan_alignemenT 16
786 
787 /* Maximum gap to be bridged during a outer TOC scan. Gaps appear between the
788  end of a session and the start of the next session.
789  The longest gap found so far was about 38100 after the first session of a
790  DVD-R.
791 */
792 #define Libisoburn_toc_scan_max_gaP 65536
793 
794 
795 /* Creating a chain of image headers which form a TOC:
796 
797  The header of the first session is written after the LBA 0 header.
798  So it persists and can give the end of its session. By help of
799  Libisoburn_nwa_alignemenT it should be possible to predict the start
800  of the next session header.
801  The LBA 0 header is written by isoburn_activate_session() already
802  with the first session. So the medium is mountable.
803  A problem arises with DVD-RW in Intermediate State. They cannot be
804  written by random access before they were written sequentially.
805  In this case, no copy of the session 1 header is maintained and no TOC
806  will be possible. Thus writing begins sequentially at LBA 0.
807 
808  IMPORTANT: This macro gives the minimal size of an image header.
809  It has to be enlarged by the eventual partition offset.
810 */
811 #define Libisoburn_overwriteable_starT \
812  ((off_t) (Libisoburn_target_head_sizE/2048))
813 
814 
815 /* Wrappers for emulation of TOC on overwritable media */
816 
818  /* Either track or toc_entry are supposed to be NULL */
819  struct burn_track *track;
821 };
822 
824  /* Either session or tracks and toc_entry are supposed to be NULL */
829 };
830 
832  /* Either disc or sessions and toc are supposed to be NULL */
833  struct burn_disc *disc;
834  struct isoburn_toc_session *sessions; /* storage array */
835  struct isoburn_toc_session **session_pointers; /* storage array */
836  struct isoburn_toc_track *tracks; /* storage array */
837  struct isoburn_toc_track **track_pointers; /* storage array */
842 };
843 
844 #endif /* Isoburn_includeD */
845 
int isoburn_toc_entry_destroy(struct isoburn_toc_entry **o, int flag)
Definition: isoburn.c:89
int isoburn_get_prev(struct isoburn *o, struct isoburn **pt, int flag)
Definition: isoburn.c:237
int isoburn_start_emulation(struct isoburn *o, int flag)
Definition: isofs_wrap.c:537
#define Libisoburn_max_appended_partitionS
Definition: isoburn.h:57
int isoburn_root_defaults(IsoImage *image, int flag)
Definition: isofs_wrap.c:129
IsoDataSource * isoburn_data_source_new(struct burn_drive *d, uint32_t displacement, int displacement_sign, int cache_tiles, int tile_blocks)
Definition: data_source.c:325
int isoburn_destroy_all(struct isoburn **objpt, int flag)
Definition: isoburn.c:213
#define Libisoburn_disc_label_sizE
Definition: isoburn.h:62
int isoburn_link(struct isoburn *o, struct isoburn *link, int flag)
Definition: isoburn.c:251
int isoburn_count(struct isoburn *o, int flag)
Definition: isoburn.c:289
int isoburn_set_start_byte(struct isoburn *o, off_t value, int flag)
Definition: burn_wrap.c:1081
int isoburn_data_source_shutdown(IsoDataSource *src, int flag)
Definition: data_source.c:313
int isoburn_invalidate_iso(struct isoburn *o, int flag)
Definition: isofs_wrap.c:673
int isoburn_msgs_submit(struct isoburn *o, int error_code, char msg_text[], int os_errno, char severity[], int flag)
Definition: isoburn.c:340
int isoburn_get_emulation_mode(struct isoburn *o, int *pt, int flag)
int isoburn_report_iso_error(int iso_error_code, char default_msg_text[], int os_errno, char min_severity[], int flag)
Definition: burn_wrap.c:1221
int isoburn_get_target_volset(struct isoburn *o, IsoImage **pt, int flag)
int isoburn_new(struct isoburn **objpt, int flag)
Definition: isoburn.c:115
int isoburn_get_msc2(struct isoburn *o, struct burn_write_opts *opts, int *msc2, int flag)
Definition: burn_wrap.c:865
int isoburn_destroy(struct isoburn **objpt, int flag)
Definition: isoburn.c:178
int isoburn_get_next(struct isoburn *o, struct isoburn **pt, int flag)
Definition: isoburn.c:244
int isoburn_adjust_target_iso_head(struct isoburn *o, uint32_t offst, int flag)
Definition: isoburn.c:368
int isoburn_find_by_drive(struct isoburn **pt, struct burn_drive *d, int flag)
Definition: isoburn.c:326
int isoburn_find_emulator(struct isoburn **pt, struct burn_drive *drive, int flag)
Definition: burn_wrap.c:627
int isoburn_by_idx(struct isoburn *o, int idx, struct isoburn **pt, int flag)
Definition: isoburn.c:302
int isoburn_toc_entry_new(struct isoburn_toc_entry **objpt, struct isoburn_toc_entry *boss, int flag)
Definition: isoburn.c:60
burn_disc_status
Definition: libburn.h:232
uint32_t tail_blocks
Definition: isoburn.h:695
unsigned int replace_uid
Definition: isoburn.h:604
time_t vol_creation_time
Definition: isoburn.h:671
unsigned int fat
Definition: isoburn.h:422
unsigned int allow_dir_id_ext
Definition: isoburn.h:473
unsigned int untranslated_name_len
Definition: isoburn.h:464
char vol_uuid[17]
Definition: isoburn.h:677
unsigned int iso1999_rec_mtime
Definition: isoburn.h:579
uint8_t appended_part_type_guids[8][16]
Definition: isoburn.h:710
uint8_t iso_gpt_type_guid[16]
Definition: isoburn.h:735
unsigned int hfsplus
Definition: isoburn.h:421
unsigned int joliet_rec_mtime
Definition: isoburn.h:578
unsigned int allow_lowercase
Definition: isoburn.h:529
unsigned int no_force_dots
Definition: isoburn.h:523
unsigned int no_emul_toc
Definition: isoburn.h:441
char * scdbackup_tag_written
Definition: isoburn.h:654
unsigned int aaip
Definition: isoburn.h:428
unsigned int allow_deep_paths
Definition: isoburn.h:486
void * libjte_handle
Definition: isoburn.h:691
unsigned int joliet_longer_paths
Definition: isoburn.h:547
unsigned int joliet_utf16
Definition: isoburn.h:558
uint8_t appended_part_gpt_flags[8]
Definition: isoburn.h:715
unsigned int always_gmt
Definition: isoburn.h:563
int partition_secs_per_head
Definition: isoburn.h:685
unsigned int session_md5
Definition: isoburn.h:431
unsigned int replace_dir_mode
Definition: isoburn.h:602
uint8_t gpt_guid[16]
Definition: isoburn.h:742
unsigned int joliet
Definition: isoburn.h:419
time_t vol_expiration_time
Definition: isoburn.h:673
int partition_heads_per_cyl
Definition: isoburn.h:687
int appended_part_flags[8]
Definition: isoburn.h:709
char * rr_reloc_dir
Definition: isoburn.h:495
unsigned int dir_rec_mtime
Definition: isoburn.h:577
uint8_t appended_part_types[8]
Definition: isoburn.h:708
unsigned int replace_gid
Definition: isoburn.h:605
unsigned int joliet_long_names
Definition: isoburn.h:553
unsigned int sort_files
Definition: isoburn.h:588
char * system_area_data
Definition: isoburn.h:660
int part_like_isohybrid
Definition: isoburn.h:727
int efi_boot_part_flag
Definition: isoburn.h:701
uint32_t partition_offset
Definition: isoburn.h:683
unsigned int old_empty
Definition: isoburn.h:447
mode_t file_mode
Definition: isoburn.h:608
char scdbackup_tag_name[81]
Definition: isoburn.h:652
time_t vol_modification_time
Definition: isoburn.h:672
unsigned int allow_longer_paths
Definition: isoburn.h:506
time_t vol_effective_time
Definition: isoburn.h:674
int system_area_options
Definition: isoburn.h:668
unsigned int iso1999
Definition: isoburn.h:420
unsigned int rrip_version_1_10
Definition: isoburn.h:570
char * efi_boot_partition
Definition: isoburn.h:700
unsigned int replace_file_mode
Definition: isoburn.h:603
char * output_charset
Definition: isoburn.h:612
unsigned int aaip_susp_1_10
Definition: isoburn.h:586
unsigned int file_md5
Definition: isoburn.h:436
char * appended_partitions[8]
Definition: isoburn.h:707
unsigned int rockridge
Definition: isoburn.h:418
unsigned int max_37_char_filenames
Definition: isoburn.h:514
unsigned int omit_version_numbers
Definition: isoburn.h:481
unsigned int hardlinks
Definition: isoburn.h:425
char * prep_partition
Definition: isoburn.h:698
char scdbackup_tag_time[19]
Definition: isoburn.h:653
char ascii_disc_label[129]
Definition: isoburn.h:747
unsigned int allow_full_ascii
Definition: isoburn.h:535
unsigned int allow_7bit_ascii
Definition: isoburn.h:542
uint8_t hfsp_serial_number[8]
Definition: isoburn.h:752
int cache_tile_blocks
Definition: isoburn.h:320
unsigned int hasIso1999
Definition: isoburn.h:384
unsigned int hasRR
Definition: isoburn.h:375
mode_t dirmode
Definition: isoburn.h:349
unsigned int noaaip
Definition: isoburn.h:333
unsigned int hasJoliet
Definition: isoburn.h:377
unsigned int noacl
Definition: isoburn.h:334
uint32_t size
Definition: isoburn.h:389
unsigned int noino
Definition: isoburn.h:338
unsigned int nojoliet
Definition: isoburn.h:323
unsigned int norock
Definition: isoburn.h:322
uint32_t displacement
Definition: isoburn.h:398
unsigned int do_ecma119_map
Definition: isoburn.h:326
unsigned int map_mode
Definition: isoburn.h:327
unsigned int nomd5
Definition: isoburn.h:341
char * input_charset
Definition: isoburn.h:355
unsigned int noiso1999
Definition: isoburn.h:324
unsigned int preferjoliet
Definition: isoburn.h:343
int displacement_sign
Definition: isoburn.h:399
unsigned int hasElTorito
Definition: isoburn.h:387
unsigned int do_joliet_map
Definition: isoburn.h:329
unsigned int noea
Definition: isoburn.h:335
int auto_input_charset
Definition: isoburn.h:364
unsigned int joliet_map_mode
Definition: isoburn.h:330
unsigned int pretend_blank
Definition: isoburn.h:396
struct isoburn_toc_track ** track_pointers
Definition: isoburn.h:837
struct isoburn_toc_session * sessions
Definition: isoburn.h:834
struct isoburn_toc_entry * toc
Definition: isoburn.h:841
int incomplete_session_count
Definition: isoburn.h:839
struct burn_disc * disc
Definition: isoburn.h:833
struct isoburn_toc_track * tracks
Definition: isoburn.h:836
struct isoburn_toc_session ** session_pointers
Definition: isoburn.h:835
Definition: isoburn.h:27
int start_lba
Definition: isoburn.h:30
struct isoburn_toc_entry * next
Definition: isoburn.h:34
int session
Definition: isoburn.h:28
char * volid
Definition: isoburn.h:32
int track_blocks
Definition: isoburn.h:31
int track_no
Definition: isoburn.h:29
struct isoburn_toc_entry * toc_entry
Definition: isoburn.h:828
struct burn_session * session
Definition: isoburn.h:825
struct isoburn_toc_track ** track_pointers
Definition: isoburn.h:826
struct burn_track * track
Definition: isoburn.h:819
struct isoburn_toc_entry * toc_entry
Definition: isoburn.h:820
int nwa
Definition: isoburn.h:104
void * read_pacifier_handle
Definition: isoburn.h:160
int(* msgs_submit)(void *handle, int error_code, char msg_text[], int os_errno, char severity[], int flag)
Definition: isoburn.h:163
struct isoburn_toc_entry * toc
Definition: isoburn.h:123
uint8_t * target_iso_head
Definition: isoburn.h:134
int do_fsync
Definition: isoburn.h:172
struct burn_source * iso_source
Definition: isoburn.h:154
int image_start_lba
Definition: isoburn.h:145
off_t min_start_byte
Definition: isoburn.h:101
int wrote_well
Definition: isoburn.h:129
IsoDataSource * iso_data_source
Definition: isoburn.h:149
struct burn_drive * drive
Definition: isoburn.h:70
int truncate
Definition: isoburn.h:108
IsoImage * image
Definition: isoburn.h:142
int(* read_pacifier)(IsoImage *, IsoFileSource *)
Definition: isoburn.h:157
int do_tao
Definition: isoburn.h:169
struct isoburn * prev
Definition: isoburn.h:79
int msgs_submit_flag
Definition: isoburn.h:166
int emulation_mode
Definition: isoburn.h:75
uint32_t loaded_partition_offset
Definition: isoburn.h:138
int fabricated_msc1
Definition: isoburn.h:85
int fabricated_msc2
Definition: isoburn.h:92
enum burn_disc_status fabricated_disc_status
Definition: isoburn.h:114
int zero_nwa
Definition: isoburn.h:98
void * msgs_submit_handle
Definition: isoburn.h:165
struct isoburn * next
Definition: isoburn.h:80
int target_iso_head_size
Definition: isoburn.h:133
int media_read_error
Definition: isoburn.h:118